"An extremely naïve, brutalist attempt at packaging up simple Lua (5.1) apps with all the stuff needed to edit and build them."
You knew this was coming. Conway's Game of Life in text mode using Unicode Braille glyphs.
git clone https://github.com/akkartik/teliva
@akkartik I love the idea behind this; nice work.
I am super curious about the decision to use a version of Lua that dates from 2006 though; even 5.2 fixes almost all of the most glaring flaws in 5.1 without having the higher LOC count of the latest version.
@technomancy Yeah, totally. I'm not really sure what I'm doing there, and might change this. My reasoning at the moment was:
- preserve the luajit option
- go with a smaller implantation if it's still widely used (thanks to luajit)
I'd love to be corrected on either score.
@akkartik I see, yeah. unfortunately those two goals are somewhat at odds with each other; if you prioritize speed you have to sacrifice size.
despite being compatible with 5.1, luajit fixes almost all the big flaws in it, though some of its fixes need to be specifically opted into at compile time.
IMO either switching to luajit or a newer PUC would be better than staying on PUC 5.1 but I can understand wanting to keep options open.
@technomancy That's really helpful. I'm going to keep an eye out for flaws since I haven't experienced them myself yet. Is there a definitive list somewhere?
I plan to write lots of Lua code over the next few weeks and months, so I'm sure I'll run into them for myself.
@akkartik the biggest problems are the inability for coroutines to yield across protected calls or C code boundaries and the inability to construct proxy tables (using metamethods) that can be iterated.
these are both issues which beginners are unlikely to hit on their own, but coroutines and metamethods are both pretty important as means of abstractions for using 3rd-party code. if your goals don't involve users pulling in libraries, maybe it's less of an issue.
@akkartik this doesn't work for libraries but if you control the final environment you can more or less fix the metamethod problem completely in userspace: https://gitlab.com/technomancy/bussard/-/blob/master/metatable_monkey.lua
it's very ugly but it gets the job done. I used this in my game Bussard to implement read-only tables being exposed to the in-game sandbox which allows users to run whatever code they write while playing.
now that I think about it, a similar approach could work for teliva.
The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!