For Common Lispers such as myself, who are vaguely aware of developments in the Scheme space: the most important difference between CRUNCH and Chicken appears to be that, while both compile down to C/object code, CRUNCH is additionally targeting a statically-typed subset of Scheme. Opinion: this is great. The aversion of Lispers to static types is historical rather than intrinsic and reflects the relative difference…
> Now that types and tools are advancing, static Lisps are feasible, and I love that. Haven't that been feasible for a pretty long time already? Judging by how well-received (or not) they've been, it seems there isn't much demand for it. Things like clojure.spec and alike (compile-time + run-time typing) seems much more popular, but isn't static.
Crunch – a Scheme compiler with a minimal runtime
41–50 of 73 posts
Re: Crunch – a Scheme compiler with a minimal runtime
#42> No support for first class continuations I'm not sure about how people would feel about this. I have mixed feelings. It feels like a loss of many things. What are the gains from ditching continuations?
Re: Crunch – a Scheme compiler with a minimal runtime
#43Re: Crunch – a Scheme compiler with a minimal runtime
#44> Other targets are possible, like GPUs. I don't know anything about that, so if you are interested and think you can contribute, please don't hesitate to contact me. The freestanding macro suggests most of the heavy lifting is done. Stuff the GPU targets will struggle with in no particular order: - setjmp / longjmp - signals (if used?) - threads - fast alloc/free - stack will be smaller than chicken expects I don't…
Isn't that mostly needed by call/cc, which is not supported by Crunch?
Re: Crunch – a Scheme compiler with a minimal runtime
#45> No support for first class continuations I'm not sure about how people would feel about this. I have mixed feelings. It feels like a loss of many things. What are the gains from ditching continuations?
Re: Crunch – a Scheme compiler with a minimal runtime
#46Earlier quoted context omitted.
What are the main differences between OcamML and a statically typed Lisp?
Type inference is probably the biggest thing. You would need explicit "phases" to expand macros, disallow macro expansion at runtime, and implement bi-directional type inference HM-style to get even close to what OCaml has. To be honest, I'd kill for a Lisp that had the same type system as OCaml, but I suspect the closes we'll get is basically Rust (whose macro system is quite good).
type Divisor Number
def divide(Number, Divisor) = Number / Divisor
As compared to: def divide(number: Number, divisor: Number) = number / Divisor
I have implemented a compiler for a language that does this with different (less familiar) syntax. It's a bit more complicated than described above to handle local variables but it works very well for me.Re: Crunch – a Scheme compiler with a minimal runtime
#47Earlier quoted context omitted.
Racket has Typed Racket, which while not Hindley-Miller can do some type inference. There's also the plait language which says its type system is similar to ML: https://docs.racket-lang.org/plait/index.html And Hackett, inspired by Haskell: https://lexi-lambda.github.io/hackett/ And Common Lisp has coalton: https://coalton-lang.github.io/
Most of those aren't really ready for production use except maybe Typed Racket, which I consider to be too "weak" and took a route with annotations that I'm not a fan of. Coalton is very interesting, I've been following it for a bit. Carp [0] is another one that I've been following. [0]: https://github.com/carp-lang/Carp
Re: Crunch – a Scheme compiler with a minimal runtime
#48so if I understand this right, it could be a way to run scheme on esp32 and similar microcontrollers, isn't it? Also its small size would make it a perfect target to compile to typescript/deno/wasm without rejecting the s-exp power and runtime possibilities in its full chicken code at the backend...
Not a scheme, but for running a lisp on microcontrollers uLisp is pretty amazing. http://www.ulisp.com/ You even get a REPL and everything WHILE running on the hardware. Super easy to set up and get going. Though as it is interpreted so you will of course not have native performance. Still very useful for prototyping and hobbyist projects.
Re: Crunch – a Scheme compiler with a minimal runtime
#49> Other targets are possible, like GPUs. I don't know anything about that, so if you are interested and think you can contribute, please don't hesitate to contact me. The freestanding macro suggests most of the heavy lifting is done. Stuff the GPU targets will struggle with in no particular order: - setjmp / longjmp - signals (if used?) - threads - fast alloc/free - stack will be smaller than chicken expects I don't…
> - setjmp / longjmp Isn't that mostly needed by call/cc, which is not supported by Crunch?
Re: Crunch – a Scheme compiler with a minimal runtime
#50Earlier quoted context omitted.
Most of those aren't really ready for production use except maybe Typed Racket, which I consider to be too "weak" and took a route with annotations that I'm not a fan of. Coalton is very interesting, I've been following it for a bit. Carp [0] is another one that I've been following. [0]: https://github.com/carp-lang/Carp
Coalton is used in production for quantum computing systems and soft real-time control system automation. There are also (a small number of) Coalton jobs.