Skip to content
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

[feature] self-contained steel program executables #110

Open
kskarthik opened this issue Dec 5, 2023 · 8 comments
Open

[feature] self-contained steel program executables #110

kskarthik opened this issue Dec 5, 2023 · 8 comments

Comments

@kskarthik
Copy link
Contributor

This is a great feature to have! Many scheme implementations do not have this.

This feature makes it easy to deploy steel apps.

Basically, The approach could be steel runtime + script + dependencies -> ELF binary

I am open to more thoughts on this!

@mattwparas
Copy link
Owner

I do have a work in progress statically linked program representation that can be serialized to bytes - I guess the workflow could be something like this:

Rather than calling something like steel main.scm - you'd be able to do something like:

steel build main.scm (or something like that)

That would then generate a main.rs file, with the whole program embedded statically in the file alongside an engine instance to run it - we then just compile this to a binary.

I think that would get the job done?

Another approach that I've experimented with is generating the entire VM + handlers dynamically specific to the program that you've given, but that requires some more work :) (but would be a cool future goal)

@kskarthik
Copy link
Contributor Author

That would then generate a main.rs file, with the whole program embedded statically in the file alongside an engine instance to run it - we then just compile this to a binary.

This is interesting too!

My idea is more like https://deno.com/[email protected]/tools/compiler#compiling-executables

@mattwparas
Copy link
Owner

I'll have to go look at the deno implementation, my hunch is its doing something more or less like what I've described though. Of course, I could be totally wrong

@kskarthik
Copy link
Contributor Author

@mattwparas
Copy link
Owner

Nice, looks like they had discussed my approach but didn't end up landing on it. Would it be a deal breaker if it required the rust tool chain? It would certainly make the implementation trivial

@mattwparas
Copy link
Owner

Whipped up a proof of concept in #113 - I will continue to iterate on it and update the progress here

@kskarthik
Copy link
Contributor Author

Would it be a deal breaker if it required the rust tool chain? It would certainly make the implementation trivial

At this point, I am not sure 😄

@kskarthik
Copy link
Contributor Author

That would then generate a main.rs file, with the whole program embedded statically in the file alongside an engine instance to run it - we then just compile this to a binary.

What could be the file size of the resulting binary ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants