-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for Embeddable Common Lisp (ecl) runner #461
Comments
so basically what i need to do to support any such cli, like ecl, is to enable you to provide cli arguments before the script file. script_runner = "ecl"
script_runner_args = ["--shell"] # this is new thing i'm suggesting
script = [
'''
(write-line "${MESSAGE}")
'''
] would that do? also by the way, cargo-make has embedded duckscript runtime which provides a simple shell like language with a pretty big api. |
I would think that would be sufficient assuming that MESSAGE = "something"
[tasks.kreyren]
script = [
'''
#!/usr/bin/ecl --shell
(write-line "${MESSAGE}")
'''
] Invoked from but i would prefer MESSAGE = "something"
[tasks.kreyren]
script_runner = "@lisp"
script = [
'''
#!/usr/bin/ecl --shell
(write-line "${MESSAGE}")
'''
] instead of MESSAGE = "something"
[tasks.kreyren]
script_runner = "ecl"
script_extension = "cl"
script_runner_args = ["--shell"]
script = [
'''
#!/usr/bin/ecl --shell
(write-line "${MESSAGE}")
'''
] aldo FILES
~/.ecl, ~/.eclrc
Default initialization files loaded at startup unless the option
--norc is provided. (if they exist). FWIW though i share: On C-based Makefile it's not creating a temporary files as cargo-make and so me with irc.freenode.net/##workingset came out with this PoC solution: #!/bin/sh
shift
makeLisp="$(pwd)/wrappers/make.lisp"
command="$*"
escaped="$(echo "$command"|sed -e 's/\\/\\\\/g' -e 's/"/\\"/g')"
#exec ccl -Q -n -b -l "$makeLisp" -e "(eval-make-command \"${escaped}\")" -e '(ccl:quit)'
exec ecl -norc -eval "(load \"$makeLisp\" :verbose nil)" -eval "(eval-make-command \"${escaped}\")" -eval '(ext:quit)'
#exec ecl -norc -eval '(setf *load-verbose* nil)'� -load "$makeLisp" -eval "(eval-make-command \"${escaped}\")" -eval '(ext:quit)' (defun exit (status)
#+ecl (ext:quit status)
#+ccl (ccl:quit status))
(defun eval-make-command (command)
(let ((form (handler-case (read-from-string command)
(error (err)
(format *error-output* "ERROR while reading ~S: ~A~%" command err)
(exit 1)))))
(handler-case (eval form)
(error (err)
(format *error-output* "ERROR while evaluating ~S: ~A~%" form err)
(exit 2))))) |
too many messages :D
|
Sorry didn't know how to make it shorter, but still understandable x.x
might be worth mentioning that lisp is basically framework to make a custom programming language so it has lots of implementations alike ccl (regular common lisp), ecl (Embedded Common Lisp), Vax common Lisp, Emacs Lisp, etc.. which are in core (generally, but not always) same, but are not designed to be compatible with each other (even though some are mostly compatible). So i guess the Point 3 noted. |
Just clarifying based on peer-review in irc.freenode.net/#lisp
This is looking at the issue from a lisp point of view alike comparing common-lisp to emacs lisp which are lisp, but basically different languages as emacs lisp is redefining common lisp functions to be used for the editor. Whereas common-lisp-based languages (ecl, ccl, etc..) are generally compatible with each other. |
@Kreyren I just pushed the support for this in the dev branch 0.32.6 I took your example, just drop the shebang. [env]
MESSAGE = "something"
[tasks.ecl]
script_runner = "ecl"
script_extension = "cl"
script_runner_args = ["--shell"]
script = [
'''
(write-line "${MESSAGE}")
'''
] I didn't test with ecl as i don't have that installed and didn't bother to install :) |
New version released to crates.io so i think we can close this one. |
Op has been updated with the finding from the conversation
Features Description
Support for Embeddable Common Lisp (ecl) script runner.
Describe the solution you'd like
Expecting being able to use:
To execute embeddable common lisp code through cargo-make with the intention to be portable beyond POSIX to support as many turing complete systems as possible including legacy systems created in 1971 where POSIX shell, Bourne Again Shell, Python, etc.. is not an option and writing in Bourne Shell (not to be confused with Bourne Again Shell) is painful.
Additional info
ecl
requires argumnet--shell
to execute the file without openning an interactive session or outputing help message.ecl (write-line "Hello, world!")
opens a help messageCurrently i have to provide shebang to be able to run the ecl session which is not compatible with non-standard unix systems and windows.
Solution
Implement
script_runner_args
Status: being considered
As proposed in #461 (comment) this would add
script_runner_args
for the tasks allowing to specify arguments to thescript_runner
Implement
script_runner = "@ecl"
Status: Dismissed as impractical
As proposed in OP this prefers implementation alike:
for readability reasons.
Was concluded to be not practical as lisp is a framework to create a programming language and using
script_runner = "@lisp"
would require a translational layer to ensure that used lisp is compatiblefor example that would require us to make Embedded Common Lisp compatible with non-embedded Common Lisp which is plausible, but also require implementing things like Emacs Lisp that is not compatible with common lisp as it's redefining most of it's functions for the usage of text editor (or operating system).
The text was updated successfully, but these errors were encountered: