3 ms·
I'm certainly not aware of any. Pretty much all statically typed languages use the REPL as a toy on the side. It's not part of the actual development process. Y
by yogthos 11y ago
I'm certainly not aware of any. Pretty much all statically typed languages use the REPL as a toy on the side. It's not part of the actual development process. You're not running the REPL in the actual app you're working on and its usefulness is extremely marginal at that point.
A language like Haskell pretty much precludes having REPL integration as you can't just run any top level expression without going through the main.
- wtetzner 11y ago> A language like Haskell pretty much precludes having REPL integration as you can't just run any top level expression without going through the main. What? Why not? I know people who pretty much use the REPL (GHCi) as their primary method of developing in Haskell.
- yogthos 11y agoLet me give you an example of my typical day working with Clojure. I will start the app then connect my IDE to its instance. When I work on any code I write it in the context of the running application. I have access to all the state that's been built up, I can leverage user sessions, database connections etc. Let's say I'm writing an endpoint to serve some data to the client. I would go to my db namespace, write the function to query the db, run the code and see what it's doing. I'll modify and run it until it does what I want. Then I might go write a controller and do the same thing, and so on. At each point I have my code running within the context of the app, anything I write in the editor can be evaluated modified, and inspected. This workflow simply doesn't exist in Haskell last I checked.
- tome 11y agoI'm not aware of any simple way to get up and running like you are describing in Haskell, no. But it's unclear whether you are saying that such a thing cannot exist in a statically typed language, or whether it just does not at the moment. Can you clarify?
- yogthos 11y agoIn case of Haskell it's due to the fact that you can't just evaluate any top level form without going through the main. I'm sure it would be possible to design a statically typed language that's REPL development friendly, but none exist currently.
- marcosdumay 11y agoOk, I either don't get what you are saying, or you never really tried Haskell's REPL for real. I've probably run most of the modules I've written in Haskell on the REPL, normally without importing the main one, because I use it for early-stage testing. I've run DB interfaces, network abstractions, and, of course, lots and lots of pure stuff. Just like you describe doing for Clojure. Ok, I don't use an IDE that run stuff automatically at the REPL. On Haskell I import the interesting module, and run it. There is at least one IDE that connects with ghci, but I don't like it, and don't know how far it takes debuging (at a minimum, it evaluates your code and tells you the type of anything - I've tried this).
- deleted 11y ago[deleted]
- belovedeagle 11y agoThis is simply misinformed. GHCI can evaluate/run the IO monad. Syntax: to run and throw away the result, simply type an expression with type IO a: it will be evaluated to IO a, then executed. If GHCI can show values in a, it will (unless a=()). To get the value, say var <- expr.
- marcosdumay 11y agoWell, are you aware that the same Haskell you cite has a REPL environment, with on the fly code patching, and that does not require all expressions to "go throught main" anyway, right? I simply have no idea how anyone would use a REPL to do main development (I never liked the idea anyway). I use it just for early stage testing and debugging assistance, just like I do in Python, Lisp, Prolog... and certainly not Perl - this one has a useless REPL.
- yogthos 11y agosee here https://news.ycombinator.com/item?id=10645106 https://news.ycombinator.com/item?id=10645106