Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I'm wondering: are there any RXRS compliant scheme implementations that are competitively fast? say comparable to js or lua, or even C/rust? If not, is the reason coming from scheme itself, or is it more a lack of effort in this direction?


Chez Scheme, which implements R6RS, is the fastest. See https://ecraven.github.io/r7rs-benchmarks/

I would say the reason it beats Chicken and Gambit is that it has a Scheme-specific compiler to machine code that has been worked on for a long time with performance in mind.

Dybvig's talk on Macro Writers' Bill of Rights explains some of the optimizations Chez does: https://www.youtube.com/watch?v=LIEX3tUliHw (Why macro writers? Because the compiler will handle superfluous generated code so macros doesn't have to)

See also The Development of Chez Scheme for the history of it: http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.72....


Would having (optional) type annotation, or even a relatively coercitive type system help much in the way of performance? Admittedly, this wouldn't be scheme anymore, but are there example of this done in the wild with profitable impact? E.g. even as an extension to RXRS.

I'd guess if you're sure your `fib` function handles only integers, you should get a lot of easy inlining/specialization at your disposition.


It helps. Chicken seems to support exactly that: https://wiki.call-cc.org/man/5/Types

Chez instead provides typed/unchecked arithmetic functions, like fx+, flround and so on. In my experience, those sometimes make a big impact on performance(though realistically in some of those cases it would be better to ask C to do it for you).

Racket similarly makes it possible to do either.


Chicken supports fx+ and flround as well, as do all R6RS and R7RS-large systems.


My understanding is that Chez Scheme is pretty fast. Developed by Cisco, and the new backend for Racket.


Chez is also also the default backend for Idris 2.

Edwin Brady (Idris 2 creator and main author) has mentioned a few times that Chez is surprisingly and impressively fast.


How does the C ffi in Chez (or guile if anyone is familiar) compare with Chicken? I’ve heard good things about all three but have only used guile a bit, but never the C ffi. I’ve heard Chicken proponents speak highly of the ffi but have not seen any comparisons between the three implementations.


Developed by Kent Dybvig, sold to Chez which did who-knows-what with it (hiring Dybvig as well) but never commercialized it directly, and then open-sourced by Cisco.


"Cadence Research Systems" (CRS) was Kent's company. The system was "Chez", and was a commercial product of CRS since the '80s. Kent sold CRS (and thus Chez) to Cisco in 2011, and they didn't commercialize it directly, but happily it was open-sourced in 2016.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: