Cool! Take a look also at CEPL [0] an OpenGL environment for Common Lisp. Bit more low level, but you can have an OpenGL window open and make live changes in the code, just like anything else in Common Lisp. I can't imagine coding graphics any other way, and is a lot of fun that way too.
I imagine there are two concurrent threads: one receiving input from the programmer and another running the graphics and window event loop. How do these two communicate? I tried writing something similar as a teenager and the multithreading work quickly overwhelmed me. Perhaps there's a better approach?
I don't know about CEPL but when just using OpenGL you can simply redefine functions that are called in the main thread and they will execute there. You build up a lot of indirection to allow redefining things at run time.
It's also a good idea to write some macros to send the forms to the main thread when working with graphics libs.
This in clojure will eval the form once at the desired point in the program, it just queues up the forms and executes one every time it's called. The stuff below is racey but works.
So you would place (eval-point :foo) somewhere in the main loop so things like OpenGL calls are possible, then when evaling forms from the REPL you wrap them like:
Sorry, don't know the internals or thread details (though you can browse the git of course), but it does work very well. Some key points:
1. As per CL error handling/continuations, if something goes wrong you are dropped into the debugger and can live fix the problem without losing the OpenGL context (usually, I've still found ways to break things of course, since you have some more manual memory management happening with the GPU). CEPL has a 'live continue' feature that handles this for OpenGL/threads.
2. Live changing of code as in usual CL REPL works well. If you want to change stuff on the GPU, like a texture or shader, you may need to repush it to the GPU depending how your main loop draws stuff. For instance, I'll just once set a shader, so if I want to change it I'll need to explicitly update it to the GPU.
Anyway, is all rather great, can't imagine doing this stuff manually like I used to back in the C days and before real GPU programming.
[0] https://github.com/cbaggers/cepl