3 ms·
In Clojure it's common to develop your application by building it inside a running system Every REPL form sent recompiles the running program, I don't want tha
by slifin 6y ago
In Clojure it's common to develop your application by building it inside a running system
Every REPL form sent recompiles the running program, I don't want that fast loop to be force lagged by the program checking types
I'm more than happy for that to happen at edit time, independent of compile time outside of my application process
So I heavily encourage using clj-kondo to check for mistakes doing primitive type checking etc
To reiterate, I love static analysis but I also need control over how and when it runs, I like it in CI and during editing
Otherwise it comprises one of the best things about those old languages, (Smalltalk lisp etc) being able to dev your application by injecting code and recompiling while the app is still running
The feedback loop while coding a live image is hard to explain but anything that makes it slower is disastrous for me, I can lose focus so quick
When deving Clojure idiomatically partial recompile happens at a much greater frequency than most languages, compile time is very important
- skellystudios 6y agoThat sounds super cool, and I'd quite like to give it a go. I'm not sure if what Haskell has is quite the same, abilities but you can hot-reload modules at runtime in GHCi, and FWIW, I've always found the type checker to be pretty zippy.
- adamkl 6y agoThis is what REPL-based development looks like in practice: https://vimeo.com/230220635 https://vimeo.com/230220635 I agree, its pretty cool, and actually pretty fun.
- higerordermap 6y agoI hear this "code as system is running" a lot. Doesn't it complicate our reasoning about the program as compared to simple text files? I haven't heard the other side of this claim.
- Jtsummers 6y agoYou still have the simple text files, but while you're developing (and perhaps in exceptional circumstances while it's running) you interact with it in a live fashion. But the source code is still there, and the whole thing can be recreated from scratch if you kill the image by loading the code. This lets you do things like (stupid trivial example follows, Common Lisp not Clojure) write a function from inside out in the REPL, then move the code to source: > (+ 1 2) 3 > (let ((x 1)) (+ x 2)) 3 (defun add-two (x) ;; in a source file (+ x 2)) > (add-two 1) ;; after evaluating/compiling the above 3 Imagine that these were more complicated things, like you're using a web API and getting JSON files and parsing them. You can develop it interactively, and as you verify that things are correct, you can migrate them to functions (and add tests to really do the verification part).