Hacker News new | past | comments | ask | show | jobs | submit login
A small Scheme implementation with AOT and incremental compilers that fits in 4K (github.com/udem-dlteam)
118 points by eatonphil on Nov 28, 2021 | hide | past | favorite | 27 comments



Marc Feeley of Gambit Scheme is one of the contributors. And the compiler is in plain Scheme itself, so can be executed from Guile, Chicken and Gambit. Very interesting.

And as for the origin on the Chicken Scheme name, it is mentioned here: https://news.ycombinator.com/item?id=9323673



> A small and portable Scheme implementation that supports closures, tail calls, first-class continuations, a REPL and AOT and incremental compilers. All that for a run time footprint around 4 KB!

It's portable, but it contains a compiler? For any architecture?

> Currently Ribbit supports the target languages C, JavaScript, Python and Scheme

Aha. So it compiles to another language, and relies on that for portably compiling to a target architecture. Actually pretty sensible!

Well, apart from the last option. Using Scheme to compile this Scheme implementation, written in Scheme, to a Scheme program which you can run on another Scheme implementation is surely just Scheme with extra steps.

Anyway, how does the incremental compiler work with the C target?


It doesn't compile to C, it compiles on the fly to VM code, and there are implementations of the VM in C, Python, Scheme, and JS. Otherwise the REPL would have to invoke a C compiler. Note that while the code footprint (size of the compiled VM) is only around 4k, the ram usage is much higher. They use a heap size of 200k though smaller would probably still work.


AOT - Ahead of Time compilation


When claiming it's a scheme, they should also state which version they are aiming at. From the readme, this seems to be a partial implementation of R4RS? Is this correct?


I wonder how this would change if they wanted to optimize for total memory usage or runtime memory usage. Many of their target use cases (e.g. embedded) have more flash memory than ram.

Does anyone know of scheme (or other) such interpreters that better in that respect?


Search for

    picbit scheme
in Google.


Nice to see some AOT love for Scheme, and not yet another interpreter.


[flagged]


Why do people incessantly complain about this? It's by far the lowest brow complaint I've ever seen about anything - "some hypothetical person might not be able to Google". Note they're never complaining on their own behalf because they have the OP's link. So it's a case of "won't someone please think of the poor Googler".

In 20 years of googling there is only one project I had a hard time googling (https://dl.acm.org/doi/10.1145/390016.808445). It does not happen.


I remember having trouble googling for examples of Nice and Clean code back when I was interested in those languages, because even adding "programming" and similar to the mix wasn't really helpful. but that was also a while ago, google has gotten better at contextual keywords since.



yes, but (a) that is now; the languages themselves had their heyday when search engines were a lot less good, and (b) it wasn't finding the language homepage itself that was hard, it was finding third party pages with code examples, blog posts etc.


>yes, but (a) that is now

As far as I can tell the complaint is being made now, not 10 years ago. But maybe I'm wrong and actually I've woken up in the past - please let me know if that's the case.


It can matter. One thing that is hard to impossible to Google is Alonzo Church's early 1970s paper on an hyperintensional logic he called LSD.


https://www.google.com/search?q=Alonzo+Church+Logic+of+Sense...

Took me exactly two searches - one to figure out what lsd stood for (which I'm sure you knew, so you wouldn't have the same issue) and then one more to pull up the paper.


>Why do people incessantly complain about this?

May be because number of those names grows and it's becoming overwhelming?

>"some hypothetical person"

It's not hypothetical person I constantly stumble on strange names and frequently in context where I do not care how it is called as long as I know what function it performs (even approximately). And strange names appear more and more and the main question I have usually: What is it? What it does?.

The same happens with web sites for new products. With all great slogans like "It will improve your productivity" and similar sentences I am not interested to read it's lacking one mention of what it actually does and what it's all about.

Thus the idea to use prefix-Name format in descriptions. What do you think about that idea? Would it improve educational function? Would it be easier to understand then searching for the term?


> Seriously with all those names at some point isn't it a good idea to use some prefix-Name where prefix explains what Name does?

While neither "chicken" nor "scheme" is a very good search term on its own, of course, "chicken scheme" works pretty well.

It's far from the most unsearchable name I've seen.


Sure but this name was used just as example and even in that example one can say it's unclear why he should combine Scheme with Chicken and not other two for wining combination of those unfamiliar words.

With all respect my focus is not with that specific name but with proposition to add prefixes-to-Name when it may be unclear to possible reader.

The number of those names is growing and it seems inevitable to do something about it. It's hard to read page and search every word on it while it's enough to approximately understand what is it about and search for details later if there is a need.


Yes things like Windows, Racket, Amazon, Tesla, Apple, Android… these are already words that existed however there is clearly room to share meaning based on context. When you’re taking about lisp and you mention “chicken” it’s clear you’re not talking about the animal.

I am honestly surprised how many people in HN comments have this same complaint over and over again. Not everything needs to be directly searchable by name only.


Sure, it's just the number of them is getting bigger. So what do you think about mentioned idea of prefix-Name format in descriptions?


Search engines will already ignore the hyphenation, and humans have the context to note that the two things are related. Exactly what information are you attempting to add by this?


My idea is mostly to avoid search engine usage or reduce the number of those searches.

The idea is to provide some explanation about the Name instead of just using the Name. When you track many domains reading BazunaGuanga is harder then lisp-dialect-BazunaGuanga or at least lisp-BazunaGuanga


That's far less information than the first line of clicking the link gives, and would actually cause all kinds of strife if they followed that naming convention.

lisp-BazunaGuanga would quickly learn that "Lisp" has a pretty vocal crowd that think that it either only means "Common Lisp" or a Lisp2, and take quite a decent amount of offense to any Scheme being called a Lisp.

And scheme-BazunaGuanga would have people complaining that the name is misleading, because they were expecting it to be about the Bazuna Scheme, which is a name clash with some esoteric financial strategy, or expected it to be about Guanga Bazuna's algorithm, etc.

On the other hand, as well as a title we have a link, like most aggregators, and the first line you're giving after clicking it is:

> A small and portable Scheme implementation that supports closures, tail calls, first-class continuations, a REPL and AOT and incremental compilers.

I don't need to search anything to know that this is a programming language, implementing a standard, which has a feature list. Even if I had never encountered Scheme before.


It's more an issue of how much 'common vocabulary' folks who are interested in a subject share. If you're 'into' Scheme, you probably know many implementations, including Guile, Gambit, and Chicken. And also versions inside Racket, and Scheme48, and ...

True, for someone coming at this who's not Scheme-implementation-familiar, the names might as well be Zaphod, or Beeblebrox, or similar-seeming nonsense.

It seems in any 'domain' there is a set of definitions that is assumed in that domain. That is, I don't see any real problem with naming here.


Chicken in particular exists for roughly 20 years and like many projects started as hobby... Some time ago I read an interview with the author (Felix Winkelmann) and he gave the name because of the toy on his desk (if I remember correctly).

Your point is clear, but he probably did not have second thoughts considering he was doing it for fun.


>Your point is clear, but he probably did not have second thoughts considering he was doing it for fun.

Honestly I prefer playfulness and fun in naming. All I suggest is to provide later on some prefix for reader to understand at least something as a starting point if the name is unfamiliar. For example lisp-Kurunga instead of just Kurunga.




Consider applying for YC's W25 batch! Applications are open till Nov 12.

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

Search: