Hacker News new | comments | show | ask | jobs | submit login

Thanks for jumping on this (I submitted it after reading it on Reddit awhile back). I like the concept of Forth, but getting started is daunting and JonesForth just isn't enough. Kitten does seem pretty neat for sure and it probably wouldn't be too hard to get into like Haskell and Forth are. I'd love to use a lightweight stack/functional/imperative language if it compiles to native code and is fairly fast. Would it be possible to build someone an .exe or binary and have them run it without any runtime?

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/

Good 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.

> HelloWorld in Nim is ~10 MB

That sounds like a gross exaggeration: https://hookrace.net/blog/nim-binary-size/

I 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.


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.

The reason you saw that is because the default compilation includes lots of debug info.

9.95 MB worth? Dang that is a lot of info. Glad to see they can be made to be really small.

You could do what the Spitbol compiler (for the SNOBOL language) does, which is to statically link against musl libc.

Applications are open for YC Winter 2018

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact