← Back to context

Comment by jasonjmcghee

1 day ago

Live development is still so under-explored, and is just so exciting to work with.

One of my favorite talks is "Stop Writing Dead Programs" (https://www.youtube.com/watch?v=8Ab3ArE8W3s) and touches on a lot of what could be in terms of live development.

Lisp is very well-suited to live development due to code being data, but live development doesn't need to be lispy.

I built a live development extension for Love2D which lets you do graphics livecoding (both lua and glsl) in real-time - every keystroke updating the output, (if a valid program).

https://github.com/jasonjmcghee/livelove

Here are some (early) demos of things you can do with it:

https://gist.github.com/jasonjmcghee/9701aacce85799e0f1c7304...

So many cool things once you break down the barrier between editor and running program.

I've also asked myself the question of, what would a language look like that was natively built for live development, and built out a prototype - though it's definitely a sandbox so haven't posted it anywhere yet, other than demos on mastadon.

Jack Rusher's recent interview is well worth reading too (the "stop writing dead programs" guy).

> On the need to sustain your creative drive in the face of technological change

> https://news.ycombinator.com/item?id=43759204

  • That's a great submission! I put it in the second-chance pool (https://news.ycombinator.com/item?id=26998308), so it will get a random placement on HN's front page.

    • Thanks, dang!

      More people need to read Jack's interview, especially in the context of the contemporary tension between generative AI v/s wetware creativity.

      I've been plastering that interview in every discord / slack / zulip I lurk in, and been sliding it into everyone's Whatsapp DMs :D

Oh wow, just had to log in and give you a high-five for livelove because this is the first I've heard of it and it sounds like the sort of thing I absolutely need to try out.

I remember giving Love2D a go a couple of years ago with Fennel and the lack of such a thing sent me grumbling back to Common Lisp. I'd never even have thought of building that functionality in Love/Lua myself - assuming it's something that the runtime just didn't support - and it absolutely would never have occurred to me to use LSP to set it up. I've not even used it yet and it's already doing things to my brain, so thanks!

  • Excited to spread the brain worm. Don't hesitate to join in the fun / log issues / contribute / share how you use it!

I guess the prevailing worldview is that "recompile everything and re-run" is good enough if it takes 2 seconds. But agreed that it just "feels" different when you're doing live in lisp... I miss Emacs!

  • Well, for me it’s not enough because I need to get back to where I was, repeating the same actions so it gets to the same state. With live dev I don’t need this, or a history replay method. I only update the running code. Heck I could also update the in memory var too if so I want.

    It’s good that it’s fast. Still no good enough!

  • Recompile and hot reload, maybe. 2 seconds if you're very lucky. Many setups are much slower. I've seen some really cool projects over the last few years- things like tcc + hot reload that have really good turn around time.

    But "live" is a whole different thing. And most languages aren't built with the expectation that you'll be patching it while it's running - at least as standard operating procedure and without nuking state.

    And that's a key part.

    I think you should be able to build an app and develop a game without ever having to restart them.

    And that would come with new challenges and the need for new tooling / constructs. E.g. When you change a type / structure, and there's existing state, what happens? (migration, deletion etc)

Have you done some kind of a write-up on how to do this? Lua is popular enough that I suspect there might actually be a demand of a readymade library to use hot reloading.

  • I haven't done a write up- I could, for sure. The code is all open source and the Lua side is only a few files.

    The short of it is, you need a communication medium between LSP and your program. When you edit a text file, it needs to tell the program it updated, along with the latest text.

    To communicate the values of variables is more work- you need a way to keep track of all changes to all variables. I wrote auto instrumentation code that wraps every modification to every variable in the files it instruments (which for livelove is everything but the library files themselves). Obviously this isn't perfect, but it does pretty well- and to see the value of anything you just need to make sure it's assigned to something somewhere or modified (very likely already the case).

    ---

    There are absolutely hot reload Lua libraries- there's even an IDE where this is a key feature!

    https://studio.zerobrane.com/