Compiling R7RS code to executable #1383
Labels
No labels
UX
active development
backlog
blocker
bootstrap
bounty
bug
dependencies
discussion
documentation
duplicate
enhancement
flaky test
help wanted
invalid
javascript
question
release
tendentious
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
mighty-gerbils/gerbil#1383
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I noticed that on the website the --r7rs flag is only for running scripts with interpreter, is there something similar for compiling R7RS code?
Assuming files.
main.scm
foo/bar.sld
foo/bar.scm
You can compile it with different R7RS supporting implementations like so:
loko -std=r7rs --compile main.scmcyclone main.scmcsc -R r7rs -X r7rs -c -J -static -unit foo.bar -o foo.bar.a foo/bar.sldcsc -R r7rs -X r7rs -static -uses foo.bar main.scmThey all produce
mainexecutable which can then be just run with./mainThis is an oversight, the compiler should support both --r7rs and general custom preludes.
I will make sure this is implemented before release, hopefully sooner.
We should also add support for recognizing .sld files as r7rs by default, maybe for the .scm files too so that you don't even have to specify the prelude flag and it just works out of the box.
another UX improvement detail should be automatic main (or not requiring a main at all) for r7rs.
Since you are well versed with multiple r7rs implementations, what other flags are common?
Most implementations also have flags for adding directories into the beginning of load path and at the end of load path. Imagine your foo directory was in ~/libraries. Then you could run something like:
gxc --r7rs -I ~/libraries -o main main.scmIf the flags -I and -A are free then I recommend them. They are used often in new implementations and they come from https://srfi.schemers.org/srfi-138/srfi-138.html
Edit: I noticed that there is GERBIL_LOADPATH, but sometimes it can be handy to have the option to put the library path in front of the list, or at the end of the list. For example an SRFI library in the directory can break things if it is loaded first.
yeah, both
-Iand-Aare free.-Iis easy to add and makes sense, we should also add it togxi.What does
-Ado? like-Ibut append instead of prepend?ok i see, prepend and append indeed. I will add them.
I will also add
-D, we already use it in gxtest.