Comment by kragen
5 days ago
Hmm, you might want to rename that: https://strlen.com/bla-language/
An interpreter and editor in 1K sounds very challenging! Do you mean 1K of Squeak bytecode? Including vectors of literals and selectors?
5 days ago
Hmm, you might want to rename that: https://strlen.com/bla-language/
An interpreter and editor in 1K sounds very challenging! Do you mean 1K of Squeak bytecode? Including vectors of literals and selectors?
Thanks for the link - at the time I did a quick search and didn't find that or any other language with that name.
The 1KB target was for Baby 8 (the associated processor) binary code. That processor had a few quirks (like only indirect addressing outside the "zero page") and the language design partly reflected that. Seeing other people fit Lisp into less than 512 bytes made me think I had sacrificed too much functionality for size.
The incomplete Squeak code was just a quick test to see if the language made sense at all before wasting time doing the assembly version.
It looks inspiring! Does Bla have any kind of indexing or aggregate data structures? IIRC Tiny Basic had one array that was the leftover part of memory, which is enough to do a lot.
You have to manually carve up the heap into arrays if you want to have more than one. If variable F points to the start of an array then F,I@ will read F[I] while 42!(F,I) is an assignment F[I] := 42. The comma operator is just to convert a word index to a byte index, so F+(2*I)@ and 42!(F+(2*I)) also work but are uglier.
The sieve example uses a single 8Kword array https://github.com/jeceljr/baby8/blob/main/examples/bla/siev...
1 reply →