janet-lang / janet

A dynamic language and bytecode vm
https://janet-lang.org
MIT License
3.45k stars 223 forks source link

Official language spec? #542

Open ghost opened 3 years ago

ghost commented 3 years ago

Several features of Janet remain underspecified: notably, the representation of values and the operation of the garbage collector. We could say the implementation is the spec, but that presents two problems:

I say we fix these problems with an official specification. We don't have to define the precise operation of everything; we may choose the appropriate level of detail, and document only those behaviours which are necessary or convenient. So, if an implementation wants to implement a more efficient scheduling algorithm or garbage collector, it is free to do so, and conformant applications will not experience problems as a result.

I think this will also help Janet become much more widespread, if we care about that.

bakpakin commented 3 years ago

Agreed, an "official spec" is desirable (and a lot of work). The Janet website (https://janet-lang.org) is the official Janet specification, but it is lacking in certain domains, and lacks some rigor and exhaustiveness.

Various domains that a full, perfect spec would document:

At some point, I plan on writing more exhaustive documentation for Janet's C API (including the interface to the garbage collector and memory management, multi-threading, the event loop, etc.) on Janet's website. As you might expect, this is a lot of work.

I don't really have much else to add here, but I will leave this open for task tracking purposes and further comments and suggestions.

Yam76 commented 2 years ago

This discussion reminded me of the following comment chain: https://news.ycombinator.com/item?id=16363586

In general, it is desirable to have multiple implementations of a standard. One reason is that it is then less likely that you are standardizing the bugs or idiosyncrasies of a single implementation.

amano-kenji commented 7 months ago

Official language spec didn't save scheme and common lisp....

Scheme implementations aren't compatible with each other.

Common lisp stopped evolving because of rigid specification....