5 ms·
As I skimmed trough the article, the most important pros of Clojure seem to be: REPL, functional language, immutable data, dynamic typing. I wonder what would
by DeathArrow 2y ago
As I skimmed trough the article, the most important pros of Clojure seem to be: REPL, functional language, immutable data, dynamic typing.
I wonder what would happen if someone adds a REPL to F#. Sure, it wouldn't have dynamic typing, but isn't static typing good for large code bases?
In particular, judging from the article and comments, it seems that the major boon is having an REPL integrated in the IDE, running in the background, so you can have feedback while you are writing the code.
Having such an integrated REPL for a language like Python would make the productivity up to par with Clojure?
I am trying to understand if Clojure has a particular feature other languages can't add with ease.
- fhd2 2y agoI use Python with a REPL in Emacs, it's relatively similar. The two important differences to Lisps I see: 1. Syntax. It's a bit easier to just evaluate a symbolic expression (put in a simplified manner: anything enclosed by parentheses) than to select a region of Python code to evaluate. But it's no major issue. Don't know about any syntax that has similar properties, Ruby seems to be somewhat similar in spirit, every expression returning an object. Python OTOH has all kinds of constructs you can't evaluate readily. 2. Functional code. Lisp code is generally largely side effect free, Python is not. That goes from the libraries down to how you write your own code by convention. Evaluating code without side effects for quick feedback is a breeze. For side effect riddled code, it's kinda easier to just use unit tests with mocks etc. for that. There are lots of languages with good functional libraries nowadays. Generally speaking, the things you list are what used to be unique about Lisp. But apart from the two points I'm making, I don't believe that's the case anymore. Lots of languages got inspired in the last few decades. I love Lisps and I wish I could use them more, but I'm happy lots of popular languages got reasonably close.
- neonsunset 2y ago> I wonder what would happen if someone adds a REPL to F# F# does, in fact, have REPL and excellent one at that! There is F# interactive and F# scripting. It's my workhorse for all sorts of automation and quick "analyze data and draw a chart" style of one-off scripts. It's vastly superior experience because when editing F# scripts you get full LSP, ability to reference nuget packages without vendoring anything, etc etc. Gradual typing and full type inference make it look at times like dynamically typed language but it's anything but and gives really nice user experience. https://learn.microsoft.com/en-us/dotnet/fsharp/tools/fsharp-interactive/ https://learn.microsoft.com/en-us/dotnet/fsharp/tools/fsharp...
- globular-toast 2y agoThe main problem with other languages is they are not designed from the ground up to be REPL driven. With Python, for example, it works fine until you have more than one module, then it just falls apart completely. With Lisps like Common Lisp and Clojure you never have to reload the REPL for any reason. You program is running "live". It's really hard to describe, to be honest, you just have to try a true REPL language like (CL is the best, but Clojure is pretty good too).