r/scheme

▲ 27 r/scheme

Hawk: A tracing JIT for scheme

I've been hacking on a tracing JIT compiler for scheme for a couple years now on and off, and it's in a pretty good state now. It has full R7RS support, with full seatbelts-on safety. Currently it's approximately 60% faster across the whole r7rs-benchmark suite than Chez scheme.

It's disproportionately faster on flonum benchmarks, it does quite well at inlining everything and keeping flonums in registers. I think it shows quite well that a JIT is especially helpful to get good numerical performance out of standard scheme, especially for flonums, making it possible to keep flonums in register much of the time.

There have been several previous scheme JIT attempts that took various approaches- Nash was based on Guile, but didn't quite get far enough along to see good results. Pycket was great, but used a continuations-on-the-heap approach, with quite different performance characteristics. Modern Guile has a template JIT, but currently does no register allocation or optimizations. Stalin only supported fixnums and flonums in its numerical tower, which allowed it to get great results. I wanted to support the full r7rs scheme numerical tower while still specializing as much as possible.

I've started writing a paper on the tracing JIT aspects, because some of these techniques I haven't seen elsewhere and may be novel.

Currently it supports x86-64 Linux & AArch64 OSX (sorry, no Windows yet).

Project page:

https://djwatson.github.io/hawk/

reddit.com
u/Justanothertech — 21 hours ago
▲ 64 r/scheme+1 crossposts

LIPS Scheme 1.0.0-beta.22 with continuations and TCO

The new beta of LIPS Scheme just got released. The evaluator was rewritten. It now supports continuations and TCO.

The implementation was inspired by JS-Scheme by Alex Yakovlev.

There is also a new quasiquote implementation based on Alen Bawden's paper "Quasiquotation in Lisp", a new macroexpand, and some performance improvements.

Full article about the release on the blog:

https://lips.js.org/blog/beta-continuations-and-tco

u/jcubic — 3 days ago
▲ 21 r/scheme

Very very thoughtful interview with Xavier Leroy

Interested part about moving to the multicore OCaml language model. As I know, Racket at 8.18 -> v9 choose the same way. Guile was posix threads compatible from 3.0? Chez biversion with or without real threads.

youtu.be
u/corbasai — 5 days ago
▲ 12 r/scheme

SRFI 279: In(tro)spection Protocol

Scheme Request for Implementation 279,
"In(tro)spection Protocol",
by Artyom Bologov,
is now available for discussion.

Its draft and an archive of the ongoing discussion are available at https://srfi.schemers.org/srfi-279/.

You can join the discussion of the draft by filling out the subscription form on that page.

You can contribute a message to the discussion by sending it to srfi-279@srfi.schemers.org.

Here's the abstract:

>Interactive REPL-driven systems (that most Schemes are) need a way to get detailed information on a given piece of data. Inspectors, as these are conventionally called. This SRFI defines a basic protocol for inspectors, consisting of two procedures: inspect-properties and inspect-describe. Some suggestions for standard and popular types' inspection are also provided.

Regards,

SRFI Editor

reddit.com
u/arthurgleckler — 8 days ago
▲ 21 r/scheme

which scheme implementation includes the most batteries?

I get that the language is minimal by design. But it would be nice to have a similar ecosystem to python. Like if I wanted to read from a CSV, it would be nice to have that functionality already built and accessible. Which implementation provides the most out-of-the-box functionality?

reddit.com
u/011011100101 — 11 days ago
▲ 8 r/scheme+1 crossposts

Kaappi - Yet another implementation

I wanted a complex problem to work on agentic coding. I am not a scheme programmer, but I found the scheme standard would be a good fit as it is well defined. That's how I ended up with creating Kaappi, a new scheme implementation in Zig.

github.com
u/baijum — 11 days ago