4 ms·
Thanks! Codegen isn’t done in the new compiler, but yes, the goal is to compile to native, statically linked executables, much like Go does. Ideally we wouldn’t
by evincarofautumn 10y ago
Thanks! Codegen isn’t done in the new compiler, but yes, the goal is to compile to native, statically linked executables, much like Go does. Ideally we wouldn’t even incur a libc dependency, but malloc is just so damn convenient.
You might also give Gforth a try. https://www.gnu.org/software/gforth/ https://www.gnu.org/software/gforth/
- throwaway7645 10y agoGood to know. I think a small dependency is fine. There are precious few languages that allow a static binary. I wonder what the size would be though. HelloWorld in Nim is ~10 MB, although there may be an optimization setting I skipped. GForth can't make standalone executables though and doesn't have good beginner information either. I'm also under the impression that Forth shines best as a special purpose implementation for that particular project (how Chuck Moore does it). Not sure if Kitten works better as a general purpose language or not yet, but i like the concepts so far.
- dom96 10y ago> HelloWorld in Nim is ~10 MB That sounds like a gross exaggeration: https://hookrace.net/blog/nim-binary-size/ https://hookrace.net/blog/nim-binary-size/
- throwaway7645 10y agoI downloaded Nim last year, wrote the line: echo "Hello World" , and then used the Aporia IDE's feature to compile to executable I believe. That or the command-line method. This was on Windows and the resulting exeutable was indeed sized around 10 MB. I did state that there could have been more optimizations like a release mode flag. Edit: The sizes in the link you submitted are very small and rational (what I was expecting to see). I can't remember what it does on Windows without GCC. It might have used Cygwin, but it should have still not been orders of magnitude bigger. This turned me off immediately.
- dom96 10y agoThe reason you saw that is because the default compilation includes lots of debug info.
- throwaway7645 10y ago9.95 MB worth? Dang that is a lot of info. Glad to see they can be made to be really small.
- avhon1 10y agoYou could do what the Spitbol compiler (for the SNOBOL language) does, which is to statically link against musl libc.