53 comments

DASD
Folks may also be interested that this version, 6.0, supports Crunch(although Crunch itself has not been declared a 1.0 status, currently @ .993), which is a compiler for a statically typed subset of Scheme R7RS. (https://wiki.call-cc.org/eggref/6/crunch)
CRUNCH is really cool, I helped make it work better on Windows (although it requires a bit of setup)
For an introduction:

CHICKEN is a compiler that translates Scheme source files into C, which in turn can be fed to a C compiler to generate a standalone executable. An interpreter is also available and can be used as a scripting environment or for testing programs before compilation.

rtpg
does this mean that you can't do `eval`-like things in "production" systems?
p_l
IIRC not compiled (you can include the interpreter).

But then Scheme was always less EVAL-friendly of the lisps

shakna
I'm not seeing the less friendly... Eval, and sandboxing eval, are builtin features of the Scheme standard.
It has eval but it lacks reader macros (or at least it did thirty years ago) which is what makes eval useful on lisp2 systems.
floxy
I'm interested in reading more about how reader macros make `eval` better/useful.
shakna
R5RS supports reader macros? Which would be 1998, and I guess only 28 years ago.

That's why SRFI-49 and its descendants were a possibility. Wisp, JavaScript, brainfuck, etc. implementations all exist because the tools exist in the language.

It does not. https://conservatory.scheme.org/schemers/Documents/Standards... Particular implementations could.
The less-eval-friendly thing is R5RS only requires two possible "environment specifiers" (2nd arg to eval), returned by SCHEME-REPORT-ENVIRONMENT and NULL-ENVIRONMENT, with no special form or procedure to get the current lexical environment; and R4RS (I just checked) does not specify eval. There's pretty much no manipulation of environments in the standard; the best is something like

  ((eval `(lambda (foo) ,exp) (scheme-report-environment 5))
   foo)
(can't really think of applications for getting the current environment right now except for pseudo-macro stuff)
I started playing with Chicken over the weekend because I was looking for a scheme that you could build binaries of and that had a lively ecosystem. I've really enjoyed it. So far I've mostly played with web stuff. Built a wrapper around makemkvcon for ripping some dvds I've been meaning to rip that'll do a little bit of automatic naming of output using the tv db.

I was slightly worried that I'd start using v5 and then v6 would come out but it looked like they'd been working on it for a while so I figured I'd have some time on v5. Turns out I was wrong!

How would it be for a 2D game?
trescenzi OC
I’ve thought a tiny bit about this. I think I’d lean towards Guile for a game because of Hoot, wasm compiler, and Chickadee, little game library. But I’m remarkably unqualified to have a real opinion since I’ve used Chicken for 72 hours now.
hellcow
There's raylib and sdl2 eggs available. Those are a great place to start.
fgh
I am currently looking into simple options for using Scheme as a scripting language in a game written in C. So far, s7 made a good impression for embedding it, but I am also not that far into evaluating the actual performance. I looked a bit at Chicken, and it seemed possible to embed, but too complicated for my purposes.
I would use Guile for that, its documentation about how to use it as a scripting language within a C program is excellent.

It is being used by many projects for this purpose: GNU Cash, Lilypond, GNU Guix... I don't know about games, however.

shakna
I've only made the one game with it. A lot more GUI apps.

sdl is in the package manager, making it fairly easy to hook into, and "standard". From there its about the same as anything else.

Because I was cross-compiling, I compiled to C and had a... Somewhat complicated Makefile for building Linux, Windows, Android binaries all at once.

Debugging Android made me give up, in the end. The platform, not the tools I had, was the pain point.

p0w3n3d
By the way, what do you use to postprocess your DVDs? My experience is that DVDs had awful quality and got interlaced unless using a good player (like cyberlink powerdvd) which was always improving with the video greatly and deinterlacing it?
I was eagerly waiting for this release, which brings full Unicode support.

Congratulations to the team, Chicken Scheme is a little gem!

rmunn
For those who use Chicken Scheme: what made you pick it over other Lisps? What are some things it does particularly well?
The compiler. That’s the gem of the system.

The generated C is reasonably portable, so you can run Scheme programs on systems that “don’t run Scheme”.

Absolutely. And eggs too [1]: these are libraries provided by the community, very easy to import and use.

[1] https://wiki.call-cc.org/eggs

rmunn
What happens if you try to run Python eggs under Chicken? Do you get Roko's Basilisk? :-)
sph
Pythons are too cold to hatch Chicken eggs, and viceversa
shakna
Just to run with the joke - one project I worked on was a CPython extension. We used Chicken to build out our library to do some rather hacky things and bring async/await to Python before it supported it.

And we did call it basilisk.

hellcow
The eggs are great. For instance I can be up and running building an SDL2 game or make a webserver quickly.

It has good emacs support with geiser-chicken.

Because it compiles down to C the FFI provides a lot of nice ergonomics beyond what I get with Chez Scheme.

Error messages are actually useful with a stacktrace. Can't overstate this.

It supports optional type definitions which reduces the number of tests I need.

The docs are adequate, though I frequently add "MIT scheme" to my search queries. I wasn't able to get chicken-doc setup in NixOS, and the docs website has gone down on me a bunch lately. I wish Chicken had complete documentation available including its eggs in an offline format, like a PDF.

anta40
What about Gambit? Perhaps it's a better, optimizing compiler but the built-in library is rather minimalist?
dleslie

     It has good emacs support with geiser-chicken.
I wrote the initial support for chicken some 11 years ago; it wasn't _great_, but I see that Jao and others have worked on it some since then. Glad to see it's working well!
Self-contained, compact, compiled, fast, ready to use.

SBCL is not compact and its "image" concept is not universally liked by everyone.

Guile and Racket are not fast (nor compact).

Chez Scheme is not "ready to use".

tonyg
In many benchmarks, Racket is significantly faster than many other Scheme implementations, including Chicken: https://ecraven.github.io/r7rs-benchmarks/ This is because it is now based on Chez.

It is certainly not compact, though.

Would be interesting to see how Crunch [0][1] does on that benchmark. Any plans to add it to the benchmark?

[0] https://news.ycombinator.com/item?id=49252127

[1] https://wiki.call-cc.org/eggref/6/crunch

drannex
Racket may be significant faster than many, esp since transitioning to Chez, but its still very hard/problematic to compile to a binary, and if wrapped into a binary still very bloated in size.

FWIW: I enjoy working with Gambit, especially since it can compile to C and standalone binaries and also scores even higher than Racket.

anthk
Well, SBCL can just use sources just fine. On Guile not being fast enough, it got a JIT since version 3 and it can be pretty fast. It must be, you know, because if not Guix would be even slower.
To me it is the combination of what is listed in https://www.call-cc.org/.
Disappointed to learn this is unrelated to the Chicken chicken chicken https://www.youtube.com/watch?v=yL_-1d9OSdk
How can you tell?
Why do people use chicken over gambit? Is it due to chicken’s larger ego system and eggs, or is there more?
ngl this is a massive update full R7Rs support UTF-8 strings and they finally ditched blobs for bytevectors the closure reuse otpimization sounds interesting too ngl