I can't speak to Gleam, but for Elixir I just used Burrito to create a single executable: https://github.com/burrito-elixir/burrito I think it works for just Erlang too.
I haven't used it, but from the docs, I don't see why this wouldn't work for any language that compiles to beam files. You might need to adjust the build setup a bit.
Personally, I think I'd prefer something that worked without unpacking, but I don't actually need something like this, so my preferences aren't super important :D
Yes, I've created single-file Gleam executables by compiling to JavaScript and then using Node's experimental SEA (single executable application) feature. As a bonus, typically I've found the JavaScript targets to run a good deal faster for number-crunching tasks.
Hefty. The process is effectively just injecting all of the JS into the Node interpreter executable, so it's the size of the interpreter plus whatever you stuff inside. It's close to 50MB.
No, the VM needs to be installed on the machine, similar to C#, Java, Python, etc.
There have been some projects for creating self-extracting executable archives for the VM, and some projects for compiling BEAM programs to native code, but nothing has become well established yet.
I think C# has been able to compile the vm + your DLL into a single binary that doesn’t extract for a while now. There’s currently ongoing work for Java to do this.
Yes, for sure. Both the JVM and the CLR have some native binary compilation options that, while less popular, are certainly suitable for production. The similar project for the BEAM unfortunately stalled and is no longer being developed.
I can't speak to Gleam, but for Elixir I just used Burrito to create a single executable: https://github.com/burrito-elixir/burrito I think it works for just Erlang too.
I haven't used it, but from the docs, I don't see why this wouldn't work for any language that compiles to beam files. You might need to adjust the build setup a bit.
Personally, I think I'd prefer something that worked without unpacking, but I don't actually need something like this, so my preferences aren't super important :D
Yes, I've created single-file Gleam executables by compiling to JavaScript and then using Node's experimental SEA (single executable application) feature. As a bonus, typically I've found the JavaScript targets to run a good deal faster for number-crunching tasks.
How big is a hello world executable in that case?
Hefty. The process is effectively just injecting all of the JS into the Node interpreter executable, so it's the size of the interpreter plus whatever you stuff inside. It's close to 50MB.
Oof, well that’s not ideal.
No, the VM needs to be installed on the machine, similar to C#, Java, Python, etc.
There have been some projects for creating self-extracting executable archives for the VM, and some projects for compiling BEAM programs to native code, but nothing has become well established yet.
I think C# has been able to compile the vm + your DLL into a single binary that doesn’t extract for a while now. There’s currently ongoing work for Java to do this.
Yes, for sure. Both the JVM and the CLR have some native binary compilation options that, while less popular, are certainly suitable for production. The similar project for the BEAM unfortunately stalled and is no longer being developed.
You can compile to javascript as well.