Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I'm about to embark on my master's thesis, in a domain[1] which could realllllly use the "attach to running process; re-evaluate code and have the system just keep going" aspect of Lisp languages.

I know Python best. But I have reached my breaking point with its syntax, and its lack of binding constructs, and lack of symbol datatype, quote, etc. I am intending to use Clojure ... but I have to ship this thing by May 2023 come hell or high water.

All else being equal, I will proooobably be able to go further with Python. But I'm concerned it will hamstring me from doing the crucial feature of "extending the design [ie code] of a game as it runs" since, AFAIK, it's difficult to get a Lisp-ish experience of total live reloadability in Python... jurigged[2] and reloading[3] not withstanding.

I know some common lisp so I'm not a total lisp noob. I've learned enough CLJ to be dangerous ... but I'm worried I'm backing myself into an endless hole by using a language I'm not yet master of. Yet, I think the features of the ecosystem (total live reloadability of a CLJ/CLJS app! with current state preserved even down to what a user has typed in the HTML UI!) are so tempting...

Just venting out loud. comment/contact if you have suggestios or are curious about the project; i'm soon to begin blogging as I develop it.

[1] I'm reinventing the "virtual tabletop." Current ones are so fucking shallow. [2] https://github.com/breuleux/jurigged [3] https://github.com/julvo/reloading



I would urge you to go ahead and use Clojure here.

A big part of the value proposition is access to the entire JVM and JavaScript ecosystems. Bindings will be available for the more popular libraries, and if there aren't, well, Clojure is designed to make that easy.

It might not be pretty, it might not be idiomatic, but you're never going to hit a wall where "oh, if only I was using a popular language, I'd be able to do $obscure-thing". $obscure-thing is available for the JVM.


Nim has hot code-reloading. See: https://nim-lang.org/docs/hcr.html

Also, for anyone interested, Casey Muratori implemented such a system (though very simple) on C for his Handmade Hero game. It works by reloading a dynamically linked module on every frame. It's a model that should be adaptable to any compiled language.


If you don't mind being stuck on Windows you could use Visual C# or Visual Basic, they have edit-and-continue too. https://learn.microsoft.com/en-us/visualstudio/debugger/edit... I've worked with the SuperTux C# level editor in the past. C# was actually pretty nice for GUI stuff.

There doesn't seem to be a good GUI framework for Clojure. There was Seesaw but it hasn't been updated since 2019 (no maintainer). There is a guy developing a new framework https://github.com/HumbleUI/HumbleUI/ but it's WIP. I guess you could sidestep this by making it a webapp and using figwheel + web framework of choice.


Thanks for the tips Mathnerd.

My project will definitely be a web app -- I'm most familiar with web dev, plus I'd much rather be able to point someone at a URL and say "here's the thing try it out" and have that happen in 5 seconds instead of dancing the installation mambo.

Thanks for the pointer to figwheel -- that looks like hot stuff and just what I need for end to end server/client interactive dev!


This all comes to something that only you can answer:

>but I have to ship this thing by May 2023 come hell or high water.

Do you feel that you have to start working today in order to meet the deadline, or you can put a couple of weeks aside to develop your skill in whichever other language you'd like would be more adequate.


You mean the way Erlang does it? You can replace code while the system is running. In a few lines of code.


Erlang: The Movie shows how it's done (RIP Joe Armstrong): https://www.youtube.com/watch?v=xrIjfIjssLE


sounds really neat, i would try using a lisp that is closer to the metal though, something like microlisp or, my favorite: janet

coupling clojure with python sounds like a drag, even using graal i dont think this will be easy. but janet you could bind as a dll and eat your cake while having it as just recently FFI was added. if you are interested, i can probably help a little as im working on an integrated (game)development repl myself. not sure how to classify what im working on but i think its close to your domain as i want to change my hotloop during runtime from the repl and from inside the running game. i just wrote you an email.

EDIT:

ah, just now read that you want to make this a webapp, in that case being closer to the metal isnt really helping, so nevermind ^^


I'm learning Dart at the moment, Flutter is obviously the GUI framework for it. Not sure if this might be suitable for you.


There is a port of the Clojure language to Dart with Flutter support: https://github.com/Tensegritics/ClojureDart


What about something like Lua?


That's a good idea from what I know of it. Thanks. Dunno how the web development story is with that -- I'll have to look into it.


Lua shines at precisely two things. Being well embeddable and glueing libraries together thanks to that feature.

This makes it one of the languages of choice for auxiliary scripting a big system, like a game or an application. (The other common choice is Python, and nowadays also JavaScript.)

Anything else, it is relatively awkward at.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: