-
Notifications
You must be signed in to change notification settings - Fork 31
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
Rework --compile
and add a seperate --build
option
#294
Conversation
Thanks, as for the discussion: I am not sure whether you would need to edit the pretty printed output. It should suffice to prefix it. However, I think for the JS backend, it would be enough to output a script next to the compiled result (maybe called like a binary would) that contains a shebang and the For Chez, there is an option to create a binary that does WPO and bundles the interpreter. Maybe this one helps: https://github.com/gwatt/chez-exe/blob/master/compile-chez-program.ss |
Good idea! I will do just that.
It seems to be using the |
I thought there was a way to automatically generate a binary that also bundles |
Unless I am missing something, it is not possible to create a single standalone binary. See this part of the link you posted:
Tldr: Using this approach, you can only compile a Therefore, it is only up to discussion if
|
I think it would also suffice to do something similar to the JS solution: compile the ss scheme as much as possible using the documented process. Then put a bash script next to it that just starts it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! Feel free to merge (if you have the permission, otherwise I'll do it).
Ideally, we would have some CI to check whether a binary can be created for each backend using build
. However, running the backend specific tests probably already covers this?
Yes, it does. However, only for the platform we run the CI on. So only Linux (Ubuntu) if I am not mistaken. It also "runs on my system" (OSX). Windows will probably be problematic, though.
Hm looks like I do not have permission. I'll just message you when I have implemented your proposed changes and it's ready. |
Yeah, that's annoying to setup and maintain. |
Thanks @dvdvgt! |
This issue addresses #254 (and #273).
Changes
In the
Runner
we now have two methods,build
just for building an executable andeval
for then evaluating (running) said executable. Furthermore, we now have one new flag in addition to the--compile
flag, which also has been reworked.--build
flag builds executables when selecting certain backends (LLVM and MLton) instead of only outputting the transpiled code. This option overwrites the--compile
option, as the transpiled code is needed for building.--compile
flag only outputs (saves) the transpiled code.Discussion
I am not quite sure how to handle the ChezScheme and JS backend in terms of "building" an executable. Prepending a shebang (
#!/usr/bin/env node ...
) only works on UNIX systems. Furthermore, this would require more drastic changes to the current implementation, as I would need to edit the pretty-printed output ofCompiler.compile
in the respective runner, which is currently not available in theRunner
.