|
|
|
|
|
by dharmaturtle
1681 days ago
|
|
I have ~8 months of Clojure experience and ~3 years of F#. Clojure's REPL and feedback loop is bloody marvelous. F# also has a REPL, but it doesn't compare. However I still prefer F#'s type-safety. (I believe) a key part of how Clojure's REPL works is by compiling top level forms into JVM instructions which it puts into global mutable scope. Clojure can run on the CLR, so it seems this should be possible with F# as well. It would be cool if F# could temporarily bypass type-safety to quickly iterate on a module before plugging it back into the rest of an assembly and re-enabling type safety. There's no reason to recompile everything when all I want is to test out a 1 line delta independent of its... uh... dependents. Basically, I want Jupyter-stype notebooks to be my primary dev environment. The blog goes in that direction, but calling code via let result = assembly |> extract<string -> Async<unit>> "This.Is.A.Namespace.HelloHost.myFunc"
is just yuck. What I want probably requires language level changes. |
|
In a REPL, you're given a buffer to enter text into, and it evaluates it as you submit this buffer.
This is fine if you live in an age before graphical editors, but today we have tools with a better REPL-like experience.
In VS Code, I can use extensions to show realtime values next to every line of my program, and indicators of whether a branch/code path was ever hit.
This allows me to use an entire file as a visual REPL with instant feedback.
Using an actual REPL sucks compared to being able to regularly edit a file in your editor and get all of this + more without being handicapped to a terminal buffer.
Notebooks are also a worse experience for the same reason. You need to manually trigger "cells", which return a single value/visualization, or add a bunch of print statements.
JavaScript:
https://quokkajs.com/
Python:
https://marketplace.visualstudio.com/items?itemName=xirider....
Scala:
https://scalameta.org/metals/docs/editors/vscode/#worksheets
You can find something like this for most languages, either in VS Code or Jetbrains IDE's