Follow

lite is a reasonably nice programmer's text editor written in Lua. 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!

· · Web · 1 · 5 · 8

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

Show thread

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)

Show thread

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

Show thread

@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.

git.sr.ht/~technomancy/polywel

@technomancy @jplebreton oh yeah I forgot about this! I will definitely try this out as well.

@SpindleyQ @jplebreton I think lite's UI is a lot more accessible to folks who don't use Emacs fwiw, and it's impressive how few LOC it is without any heavy dependencies.

polywell is pretty idiosyncratic; you can see an example of a recent game that uses it here: technomancy.itch.io/tremendous / git.sr.ht/~technomancy/tremend (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. github.com/jeremypenner/lite/b

@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.

Sign in to participate in the conversation
Mastodon

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!