I've used it to make Freja, a text editor making coding GUIs and games fun for me again. Demo: https://youtu.be/KOBi805nxNc
When comparing to non-lisps
1. It has a real REPL, so you can do live coding (this is what makes me choose it over many languages at the same "level", js, lua, python, java). Honestly, this feature alone makes or breaks languages for me.
2. It is easy to interact with C (I found this hard in js, haven't tried the other)
Comparing to lisps (I've only properly tried guile & clojure)
1. Easy to build on windows / macos / linux (compared to guile which I didn't manage to build on windows)
2. Compared to clojure, just closer to the machine overall, in my case specifically OpenGL libs. I love Clojure but have had a hard time making client side apps with it. Done a bunch of CLJS stuff (e.g. card game https://animal-capital.surge.sh/), but many little things get annoying (e.g. can't open my editor from a browser error, can't `eval` etc. Doesn't quite have the live coding feel).
Thanks. Could you expand on the 'real repl', what do you mean exactly? For me live coding is also important, which I do for python in Ipython so I can run the scripts, access all the modules and do what I like in the repl; if I want persistent change I have to copy it in a script before closing the session though. Is this similiar to Janet or what am I missing?
I'm happy you asked! :) I think these terms are very vague, and I haven't found a good way to be more clear. For me a "real repl" includes:
1. Decent support from the language to do REPLy things
E.g. being able to change a function during runtime. Imagine an animation which is defined by perhaps: `(defn anim [time v] (* time v))`. Now you want to try something else, without having to recreate all state, so you just do `(defn anim [time v] (* time v v))` and hit Ctrl+L ("load file"). Oh, it seems I need to reset the animation, so I add some code to reset just the part of the state needed. Now I'm able to hit Ctrl+L and it'll run the new animation each time. The ability to do this ad-hoc anywhere in my code is so flow-inducing it's crazy. And I do this for games, web servers and browser GUIs. It's surprisingly general!
2. Editor support
The Ctrl+L I mentioned above is something I do in my editor to send code from my editor to the repl server. I haven't tried Ipython, but I'm guessing it might work similarly to node, where the client and server are kind of stuck together. With a "real repl", you generally use your editor as the client. Here's a video I've made that shows how this can look: https://youtu.be/Enumt6qxAgc?t=667
I know it's often possible to disconnect these (I've tried connecting my editor to the chrome debugger -- that's pretty cool!), but it doesn't seem to be in common use, which leads to...
3. Libraries supporting being run from REPLs
One not-so-uncommon problem is that e.g. a web server or game loop might block the REPL. This one is probably the hardest one to fix for existing languages and their libraries. There are often ways around this, like running on multiple threads, but that can lead to new problems. Even in clojure, I've had problems due to java libraries blocking (e.g. game lib LWJGL). It doesn't help that on macos all GUI related calls must be done on the main thread (so running LWJGL on one thread and repl on other breaks things). So far with janet I've managed to solve these issues easily thanks to the event loop (which iiuc works similar to js event loop).
---
I think the main thing to realize is that this way of developing leads to new possibilities of exploring software development. Suddenly you're able to experiment quicker, in a way that sometimes leads to typing speed being a bottleneck! :D It feels really cool, and I want to share this feeling of flow with as many as possible.
I agree. I am using Ipython from vscode, and I THINK I am doing it similar (cannot currently watch the video). I switched from a different editor, since the problem of the gui loop you mentioned (Ipython has gui loop running in the background, so you are non blocking, but not every editor plays along)
Ah, that's cool. I haven't heard of similar integrations with python, but I imagine it's possible to set up. :) Hope you're having fun with it!
If you get a chance to watch the videos it might give you some extra ideas on how to enhance your vscode + ipython experience, or maybe you can find issues with what I'm doing and tell me how to do it better. :D
When comparing to non-lisps 1. It has a real REPL, so you can do live coding (this is what makes me choose it over many languages at the same "level", js, lua, python, java). Honestly, this feature alone makes or breaks languages for me. 2. It is easy to interact with C (I found this hard in js, haven't tried the other)
Comparing to lisps (I've only properly tried guile & clojure) 1. Easy to build on windows / macos / linux (compared to guile which I didn't manage to build on windows) 2. Compared to clojure, just closer to the machine overall, in my case specifically OpenGL libs. I love Clojure but have had a hard time making client side apps with it. Done a bunch of CLJS stuff (e.g. card game https://animal-capital.surge.sh/), but many little things get annoying (e.g. can't open my editor from a browser error, can't `eval` etc. Doesn't quite have the live coding feel).