News for hackers. Stuff that matters.
Re:Clojure is cool by hellofunk on Sunday September 09, 2018 @12:09PM (#17946503)
I really like and use Clojure professionally, but I have become wary of the extraordinary time I spend dealing with runtime issues because of the dynamic typing. I hope the future of core.typed is bright. I know it is being very seriously worked on. It can't come soon enough for me. Nowadays, I prefer to write in any statically typed language even if it is more line counts, just for my own sanity.
Re:Clojure is cool by pka on Sunday September 09, 2018 @12:39PM (#17946642)
For Clojure, check out Ghostwheel [1] - a lightweight DSL for writing specs.

If you want proper static typing though, ReasonML might be a good choice. Static, compiles to js and native, super easy to learn, and there’s an experimental Lisp frontend with Clojure-like syntax if you can’t live without paredit.

[1] https://github.com/gnl/ghostwheel

Re:Clojure is cool by hellofunk on Sunday September 09, 2018 @12:50PM (#17946682)
To me, core.spec has valid uses, but not as a replacement for static tying.
Re:Clojure is cool by gnl on Monday September 10, 2018 @05:30AM (#17950511)
Author of Ghostwheel here – clojure.spec is certainly not a replacement for static typing, but it goes a long way to covering many of the same use cases, in fact longer than one might think at a cursory glance.

With Ghostwheel you write your function specs similar to how you'd write a type signature and you get automatic generative testing (including higher order function support) and side effect detection which – when combined with spec instrumentation (+ the upcoming evaluation tracing for the test execution) – can often tell you quite precisely where you screwed up in a much more immediate and granular manner than a simple unit test or mucking about in the REPL could. It really is a quite different experience from plain Clojure.

That being said, I'd love types in addition to this and I'm keeping a keen eye on ReasonML.

Re:Clojure is cool by pka on Sunday September 09, 2018 @01:23PM (#17946838)
I agree, but it’s the best you can get if for some reason you’re stuck with Clojure.
Re:Clojure is cool by r00k on Sunday September 09, 2018 @12:35PM (#17946619)
Are you using core.spec in your codebase? Did that help at all?
Re:Clojure is cool by hellofunk on Sunday September 09, 2018 @12:48PM (#17946671)
No, core.spec does not address the main issues with dynamic typing. It offers some neat stuff, but it is not a replacement for static typing.
Re:Clojure is cool by cutler on Sunday September 09, 2018 @01:13PM (#17946789)
Dude, Clojure is a dynamically typed language and always will be. If you don't like it use something else.
Re:Clojure is cool by grovehaw on Sunday September 09, 2018 @02:04PM (#17947007)
You may want to check out Typed Racket as an example of what people can do if they decide they want types in their lisp. [0]

[0] https://docs.racket-lang.org/ts-guide/

Re:Clojure is cool by hellofunk on Sunday September 09, 2018 @01:29PM (#17946870)
> Clojure is a dynamically typed language and always will be

I don't entirely agree with the "always will be," as Clojure is a very creative language that inspires a wide variety of experimentation, and core.typed is currently being actively worked on (as a PhD dissertation no less by the original author of core.typed), so there is ample room to think the future will offer good static typing abilities for Clojure.

Also, I find your response unnecessarily curt.

Re:Clojure is cool by pleasecalllater on Sunday September 09, 2018 @01:13PM (#17946790)
If you also add the line count for the additional tests needed to check the behavior of passing not what you expected, then I'm not sure it will be more.