Earlier quoted context omitted.
There's just one type at compile time, but many more at runtime. This is still a strongly typed language. The only problem is our static analysers are too dumb to prove things without providing ample explicit hints, or changing the way we code to restrict certain ambiguities that it can not resolve at compile time. Haskell has chosen to try and push the boundaries of such static analyzer, but there's still limits, an…
> That's why you don't have REPL time be a popular activity in Haskell Is it not a popular activity to use the Haskell REPL (ghci)? I though it was pretty common to use it when developing code, though I admit I don't have any hard data.
Dueling Rhetoric of Clojure and Haskell
41–50 of 107 posts
Re: Dueling Rhetoric of Clojure and Haskell
#42Earlier quoted context omitted.
> A dynamically typed language is a statically typed language with precisely one type. While technically true, saying this is about as useful as saying "You can do anything in any Turing-complete programming language."
No, it's really not equivalent to cracks about Turing completeness. Doing "dynamic" typing in a static language requires me to add all of 5 characters, e.g. ": Any" Doing static typing in a dynamic language requires me to write a type checker. These are nowhere near the same.
But OOP subtyping is already about solving polymorphic call sites at runtime. And because you carry a vtable around for every instance, thus objects being tagged with their classes, you can always do upcastings and downcastings. So OOP languages are already very dynamic on that scale and fairly unsafe.
No, you cannot do ": Any" in Haskell.
Re: Dueling Rhetoric of Clojure and Haskell
#43Seems like critiques of a programming language or paradigm are usually made by someone imagining a very bad codebase from their past.
Re: Dueling Rhetoric of Clojure and Haskell
#44I don't know if we will ever invent the perfect static type system, but I do know that having the ability to specify some types in a pretty good type system, is better than not being able to specify any types.
I'm convinced that a language with a progressive type system is strictly better than one without. Therefor, any debate that compares static vs dynamic, instead of static vs progressive is not interesting to me.
Re: Dueling Rhetoric of Clojure and Haskell
#45Earlier quoted context omitted.
> That's why you don't have REPL time be a popular activity in Haskell Is it not a popular activity to use the Haskell REPL (ghci)? I though it was pretty common to use it when developing code, though I admit I don't have any hard data.
The Haskell REPL is pretty good for a static language, but the experience is dramatically different to how a Clojure programmer would use want to use it. To be fair, Node and Python also have totally not usable REPLs for this style.
Re: Dueling Rhetoric of Clojure and Haskell
#46Earlier quoted context omitted.
No, it's really not equivalent to cracks about Turing completeness. Doing "dynamic" typing in a static language requires me to add all of 5 characters, e.g. ": Any" Doing static typing in a dynamic language requires me to write a type checker. These are nowhere near the same.
Being able to work with "Any" implies either working with Strings (since you can encode anything in strings) or it implies a memory unsafe language (e.g. working with void* in C) or it implies subtyping and hence an OOP language. But OOP subtyping is already about solving polymorphic call sites at runtime. And because you carry a vtable around for every instance, thus objects being tagged with their classes, you can…
https://hackage.haskell.org/package/base-4.10.0.0/docs/Data-...
Re: Dueling Rhetoric of Clojure and Haskell
#47Earlier quoted context omitted.
> That's why you don't have REPL time be a popular activity in Haskell Is it not a popular activity to use the Haskell REPL (ghci)? I though it was pretty common to use it when developing code, though I admit I don't have any hard data.
The Haskell REPL is pretty good for a static language, but the experience is dramatically different to how a Clojure programmer would use want to use it. To be fair, Node and Python also have totally not usable REPLs for this style.
The thing with dynamic languages is that the development style is basically println-driven.
It goes like this: because you can't keep anything longer than a 1-page script in your head and because you can't remember the APIs of other people and hence you can't trust anything you write, in order to keep some sanity, you have to execute every freaking line of code that you write in order to verify that what you wrote actually works — and the sooner you execute, the better, because if your program crashes, the triggered error can happen far away from where the mistake is actually made.
This happens for every dynamic language, not just Clojure. This is why the read–eval–print loop is so important.
However the development experience changes dramatically in a good static language (no, not talking of Java or Go), because you can write more than one line of code before feeling the need to verify it — when compiler type checks a piece of code, at the very least you can be sure that the APIs you used, or the shape of the data you're interacting with are correct.
Refactoring is also painless. Ever done refactoring of projects built on dynamic languages? It's a freaking nightmare and no, the tests don't help that much, the tests actually become part of the problem.
This is also why dynamic languages folks complaining about long compile times are missing the point — those long compile times are necessary to give you guarantees that in a dynamic language you don't get at all, changing the experience, because in turn you don't have to run your code that often.
Re: Dueling Rhetoric of Clojure and Haskell
#48.
.
.
r/clojure on JSON vs EDN: https://www.reddit.com/r/Clojure/comments/6gytlf/json_vs_edn...
Transcript of Rich Hickey EDN talk which OP obviously hasn't seen: https://github.com/matthiasn/talk-transcripts/blob/master/Hi...
Transcript of Rich Hickey talk OP linked, C-f "edn": https://github.com/matthiasn/talk-transcripts/blob/master/Hi... Perhaps OP had his fingers in his ears while he watched it. This blog post should be retracted with an apology.
Re: Dueling Rhetoric of Clojure and Haskell
#49Re: Dueling Rhetoric of Clojure and Haskell
#50The dueling rhetoric is the same rhetoric that has been around for decades: Some people really feel type systems add value; others, feel it's a ball and chain. So which is it? The answer is probably "yes." We should all believe by now since history has proven this correct. Most of the time you start with no type system for speed. Then you start adding weird checks and hacks (here's lookin' at you clojure.spec). Then…