This is a pleasant surprise: I just added hyperlin...
# devlog-together
k
This is a pleasant surprise: I just added hyperlinks to my text editor in 35 lines of Lua. https://codeberg.org/akkartik/lines-and-links/commit/c81bedca8ddd Deep in the guts of the renderer, right before it renders a fragment of text, check if it's a file, and if so turn it into my button abstraction (https://github.com/akkartik/lines.love/blob/main/button.lua). Caveats: links can't wrap over multiple lines, links can't contain spaces. Incredibly inefficient, to check the file system for every single word. So it's in a fork for now while I decide just what to do with this new super power.
i
I should have gotten into Lua and been a much braver teenager. I remember seeing the language in all kinds of weird game environments (here’s to you, Gary’s Mod 🍻) and wondering what’d it be like to know it. It seems more than reasonably powerful and useful. So if you’re writing up a text editor.. well now I’m curious, haha.
And now I get to try out
love
and some itch games, haha
k
I'm sure it'd be equally straightforward in any other language. If you made all the weird and idiosyncratic choices I did about what to include and what to exclude from the codebase and the product 😄
i
LOL, that’s fair. Lemme search up a Lua transpiler and see what it spits out in COBOL 🙃 👍
w
Imagine any other dynamic language (Ruby, JavaScript, Python), remove features until you can't anymore, and that's basically Lua. https://www.lua.org/pil/ is a short, fun read.
The first edition is online (I doubt it's changed too much). For a flavor, take a look at the section on multiple inheritance https://www.lua.org/pil/16.3.html.