3 ms·
If Nim’s compile-to-c is attractive, and you like lisp, how about Chicken Scheme?: https://www.call-cc.org/ https://www.call-cc.org/ What little I’ve done is a
by peatmoss 8y ago
If Nim’s compile-to-c is attractive, and you like lisp, how about Chicken Scheme?: https://www.call-cc.org/ https://www.call-cc.org/
What little I’ve done is a pleasure. I like some of Racket’s post-Scheme language features better, but Chicken has a lot of Get Stuff Done libraries (eggs), and compiling a single executable is pretty killer.
Racket will bundle up an executable pretty well too, but it’s hard to compete with Scheme -> C -> statically linked executable for some things.
- sdegutis 8y agoThe way Chicken Scheme compiles to C is pretty neat actually. It gets turned into a giant chain of function calls, so that the stack never actually returns. So this Chicken code: (foo) (bar) (qux) gets turned into this C code: foo(bar(qux())) When it hits the C stack's limit, it resets the stack and unwinds to the beginning, and starts over again. I think it was done this way to allow call/cc to work without having to use setjmp/longjmp.
- waterhouse 8y agoIt also, assuming it follows Baker's original paper[1] (which I believe it does), allocates all objects on the stack, maintaining the invariant[2] that nothing on the heap points to anything on the stack, and nothing in an older stack frame points to anything in a newer stack frame; and, to maintain this invariant, it kicks things out of the stack and onto the heap whenever necessary. The stack thus serves as a nursery in a kind of generational GC. [1] "CONS Should Not CONS Its Arguments, Part II: Cheney on the M.T.A." http://home.pipeline.com/~hbaker1/CheneyMTA.pdf http://home.pipeline.com/~hbaker1/CheneyMTA.pdf [2] "CONS Should not CONS its Arguments, or, a Lazy Alloc is a Smart Alloc" http://home.pipeline.com/~hbaker1/LazyAlloc.html http://home.pipeline.com/~hbaker1/LazyAlloc.html
- eggy 8y agoI was using Gambit many years ago, and I remember hitting issues with Windows and Chicken. I do like IUP and Canvas Draw though! I am not a Nim fan, but I don't like Python either, so it's just a subjective syntax thing.
- peatmoss 8y agoI feel like a few years may have cleared up issues on Windows. Compilers and Windows vs. The Rest of the World felt wilder and weirder not long ago. In general I feel like F/OSS tooling on Windows has gotten lower friction. I base this not on any specific understanding, but on needing to compile something for Windows every few years and feeling now that the hoops to jump are fewer.
- eggy 8y agoI agree. I've noticed the same. I should give Chicken another try before the year ends.