News for hackers. Stuff that matters.
Re:Chicken Scheme by rosetremiere on Friday September 03, 2021 @03:17AM (#28401286)
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?
Re:Chicken Scheme by kryptiskt on Friday September 03, 2021 @03:35AM (#28401408)
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....

Re:Chicken Scheme by rosetremiere on Friday September 03, 2021 @04:42AM (#28401804)
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.

Re:Chicken Scheme by arc-in-space on Friday September 03, 2021 @05:09AM (#28401968)
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.

Re:Chicken Scheme by johncowan on Friday September 03, 2021 @02:22PM (#28407563)
Chicken supports fx+ and flround as well, as do all R6RS and R7RS-large systems.
Re:Chicken Scheme by avhon1 on Friday September 03, 2021 @03:30AM (#28401378)
My understanding is that Chez Scheme is pretty fast. Developed by Cisco, and the new backend for Racket.
Re:Chicken Scheme by nerdponx on Friday September 03, 2021 @08:48AM (#28403428)
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.

Re:Chicken Scheme by rgrmrts on Friday September 03, 2021 @09:10AM (#28403677)
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.
Re:Chicken Scheme by johncowan on Friday September 03, 2021 @02:23PM (#28407579)
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.
Re:Chicken Scheme by tonyg on Saturday September 04, 2021 @12:07PM (#28416270)
"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.