lite is a reasonably nice programmer's text editor written in Lua. https://github.com/rxi/lite
Last night I decided it might be fun to try to port it to love2d. Today it mostly works? It's bogging down sometimes for reasons I don't understand, some (but not all!) of the icon glyphs aren't showing up correctly. But it can edit itself!
I'm thinking it might be interesting for livecoding? Maybe writing custom editors? But mostly I looked at it and the surface of native function calls was small enough and matched love2d closely enough that I could basically replace it with <250 lines of Lua that calls love2d primitives
Trying to think of another time in my life where running a program under a profiler magically fixed a performance problem. (Turns out: the profiler was regularly running the garbage collector, and my weird performance problem was caused by my code unnecessarily generating huge amounts of garbage)
I added hot code reload as a lite command, so now I can edit my editor without leaving my editor
and like.... I know emacs and smalltalk people are like "big deal" rn but why does programming not work like this everywhere
@SpindleyQ pretty cool. i do like the idea of a funky game engine with its own live code editor built in. i don't have any of the architecture knowledge needed to build a half decent text editor but playscii's ideal form would probably have one.
@jplebreton @SpindleyQ I created an emacs clone in love2d specifically for embedding games in, it's fun. little less polished than lite but more repl capabilities. lite is cool but its language mode model is too primitive to support repl/shell/console buffers last I checked.
polywell is pretty idiosyncratic; you can see an example of a recent game that uses it here: https://technomancy.itch.io/tremendous-quest-iv / https://git.sr.ht/~technomancy/tremendous-quest-iv (it has a sandbox so the players can actually script the user interface but not make changes to the game's core code)
supporting internal reprogrammability and repl interaction is the main priority I've been focusing on.
@SpindleyQ @jplebreton I think it's really cool that you were able to swap in love2d in lite with such a small amount of code! I wrote polywell in a similar way that tries to limit the number of places I make love2d-specific assumptions in hope of some day writing an ncurses frontend, but I haven't actually tried it, and it would probably not work quite as smoothly as what you did.
@technomancy @jplebreton I was really impressed at how small the surface area was! lite's native API mostly boils down to "draw rectangle", "draw / measure text", "poll for SDL events", and a few filesystem calls. https://github.com/jeremypenner/lite/blob/master/main.lua
@technomancy @jplebreton oh yeah, I'm not an emacs person, so lite is very attractive UX-wise. But a fennel repl is pretty high on my list of things I'd want it to be able to do, and I'm not afraid of dealing with an idiosyncratic interface for my current project, so polywell is definitely worth a serious look for me.
@jplebreton oh yeah that’d be cool! I’ve been tempted to build my own text editor more than a few times over the past couple years; I do wonder if I’ll ever persuade myself to give it a shot.
Server run by the main developers of the project It is not focused on any particular niche interest - everyone is welcome as long as you follow our code of conduct!