News for hackers. Stuff that matters.
Re:LO – simple WASM native language by MatthiasPortzel on Sunday May 26, 2024 @02:31PM (#40484302)
> a small macro system for WAT, that bootstraps a slightly more highlevel lisp dialect

Lisp traditionally has immutable data structures and a garbage collector, in which case I would consider it more complicated than LO.

I would be very interested if it’s possible to create an extremely simple garbage collector or an ergonomic Lisp that isn’t garbage collected, but a solution doesn’t spring to mind.

Re:LO – simple WASM native language by RodgerTheGreat on Sunday May 26, 2024 @05:06PM (#40485393)
A classic mark-and-sweep GC for a heap of uniform structs (like cons-pairs) can be implemented in a few lines of code. Garbage collection is not inescapably complicated, it just gets more challenging as you impose more constraints: multithreading, generations, compaction, minimizing bookkeeping overhead, etc.
Re:LO – simple WASM native language by j-pb on Sunday May 26, 2024 @08:11PM (#40486473)
While I'm a huge fan of immutable persistent datastructures, I don't think that they are a neccesity.

And linked lists with reference counting are really easy to do, and don't have any leaks if you don't allow cons cell abuse. (which would mess with immutablity anyways)

You could also do linear types like carp [0], or you could just do manual memory management.

I feel like most people will call something with macros and s-expressions, a reasonable, if brutalist, lisp.

0: https://github.com/carp-lang/Carp

Re:LO – simple WASM native language by koito17 on Monday May 27, 2024 @01:24AM (#40487816)
> Lisp traditionally has immutable data structures

Can you provide a source for this? Common Lisp and its predecessors certainly do not have immutable data structures out of the box. The usual data structures are cons cells, lists (composed of cons cells anyway), vectors, and hash tables.

> I would be very interested if it’s possible to create an extremely simple garbage collector or an ergonomic Lisp that isn’t garbage collected, but a solution doesn’t spring to mind.

PreScheme immediately comes to mind for me as does ulisp. The latter in particular is designed for microcontrollers with limited memory.

Re:LO – simple WASM native language by pjmlp on Monday May 27, 2024 @03:49AM (#40488617)
That much be a very special kind of Lisp, given the amount of variations since the Lisp 1.5 Programmer's Manual came to be.
Re:LO – simple WASM native language by davexunit on Monday May 27, 2024 @07:54AM (#40489949)
Pairs in Lisp are mutable, traditionally, and there are other mutable data types like vectors. For targeting wasm only there's no need to figure out a GC solution as that is something the host provides in wasm 2.0.
Re:LO – simple WASM native language by sn9 on Monday May 27, 2024 @06:37PM (#40495444)
You could probably do something similar to what Roc is doing: https://www.roc-lang.org/