💾 Archived View for dioskouroi.xyz › thread › 29371908 captured on 2021-11-30 at 20:18:30. Gemini links have been rewritten to link to archived content

View Raw

More Information

-=-=-=-=-=-=-

A small Scheme implementation with AOT and incremental compilers that fits in 4K

Author: eatonphil

Score: 118

Comments: 27

Date: 2021-11-28 19:16:13

Web Link

________________________________________________________________________________

cheesecake_luvr wrote at 2021-11-28 23:13:30:

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

throwaway81523 wrote at 2021-11-28 19:47:55:

Earlier thread:

https://news.ycombinator.com/item?id=29348033

twic wrote at 2021-11-28 23:35:15:

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?

throwaway81523 wrote at 2021-11-28 23:44:41:

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.

ozten wrote at 2021-11-29 06:31:39:

AOT - Ahead of Time compilation

stewbrew wrote at 2021-11-29 05:00:20:

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?

tooltower wrote at 2021-11-29 09:44:59:

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?

soegaard wrote at 2021-11-29 09:59:45:

Search for

  picbit scheme

in Google.

pjmlp wrote at 2021-11-29 06:47:14:

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

lovelyviking wrote at 2021-11-28 19:59:36:

The Ribbit compiler is written in Scheme and can be executed with Gambit, Guile or Chicken.

Just imagine how one who never used those tools reads it ... especially the "Chicken" part. Don't forget to imagine using search engine to find the meaning of 'Chicken' and how many nice results from the local farms you have to filter out before you find what you need.

Do people think about those things when they invent them?

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?

Because we see more and more of those "names" and it's getting worse and worse.

Really try to read something in unfamiliar area with all those Chickens Dinosaurs and other artificial life forms )... it's getting a bit crazy.

tubby12345 wrote at 2021-11-28 20:59:44:

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.

zem wrote at 2021-11-28 22:47:08:

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.

throwaway81523 wrote at 2021-11-29 02:45:47:

*

https://duckduckgo.com/?q=nice+programming+language

*

https://duckduckgo.com/?q=clean+programming+language

Both get language pages on the first hit past the ads.

zem wrote at 2021-11-29 06:57:35:

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.

tubby12345 wrote at 2021-11-29 16:37:48:

>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.

jonathanstrange wrote at 2021-11-29 09:23:58:

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_.

tubby12345 wrote at 2021-11-29 12:03:37:

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.

lovelyviking wrote at 2021-11-28 21:25:52:

>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?

Turing_Machine wrote at 2021-11-28 20:06:07:

> 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.

lovelyviking wrote at 2021-11-28 20:28:46:

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.

glenda wrote at 2021-11-28 20:53:36:

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.

lovelyviking wrote at 2021-11-28 21:27:18:

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?

shakna wrote at 2021-11-29 00:26:05:

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?

lovelyviking wrote at 2021-11-29 13:29:50:

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

shakna wrote at 2021-11-29 14:51:04:

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.

GeorgeTirebiter wrote at 2021-11-28 21:09:46:

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.

alekq wrote at 2021-11-28 20:44:03:

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.

lovelyviking wrote at 2021-11-29 13:32:32:

>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.