Re:Janet for Mortals
by andrewflnr on Friday March 31, 2023 @10:57AM
(#35388076)
Racket can supposedly compile standalone packages with the raco compile command (IIRC). Does anyone have experience with this?
[ Parent
| on HN ]
Re:Janet for Mortals
by butt____hugger on Friday March 31, 2023 @11:08AM
(#35388249)
They aren't standalone executables, they need to be distributed along with the lib folder that includes the racket runtime.
Surely the lib can be included statically no like Lua does no?
Sorry, I meant to respond to this but went to the parent https://news.ycombinator.com/item?id=35392704
Doesn't raco make followed by raco exe produce fully standalone (except libc) executables? I believe some platforms need an additional raco distribute step.
Re:Janet for Mortals
by andrewflnr on Friday March 31, 2023 @04:03PM
(#35392752)
Oh, raco exe is probably what I was thinking of.
Re:Janet for Mortals
by sschwarzer on Sunday April 02, 2023 @04:09PM
(#35414608)
At least in some cases, you need the options --orig-exe (Posix) or --embed-dlls (Windows) to make the binary standalone. For me that worked for command line programs. The options are described at https://docs.racket-lang.org/raco/exe.html . You can use both options at the same time, regardless of running Posix or Windows.
I haven't used it beyond just trying it out once or twice. But a "hello world" application in the Idris2 language compiles to a 17kb racket file (the default backend is chez, but it also does racket and javascript).
If I run `raco exe` on this, I get a 57MB file. On mac, it's only linking system libraries. (For Idris2 programs, there is an Idris support library that is dynamically loaded.)
I haven't tested transporting it to another system (my test was on an arm mac, so I don't have another system to test that on).
I do, it was extremely useful to quickly whip out a GUI doing some stuff and share it with colleagues under Windows/macOS/Linux.
Cons:
- 200MiB archives
Pros:
- I can develop a GUI doing some stuff on proprietary binary files, extracting & converting data, generating a handful of plots in a couple of days and have all my colleagues enjoy it without any issue.