▲ 90 points
back
15 comments
When I was learning Clojure a year ago, I spent quite some time Googling the cryptic error messages. An overview like this would have been useful. But I never really understood why Clojure couldn't give better error-messages by itself.
Yes, I think error messages are the weakest point of Clojure. The rest is pretty good though. :)
I don't use Clojure regularly now, but learning functional programming with it was great. Tip for starting clojurians: try solving the interactive problems at 4clojure.com.
Agreed. But having one place to check before reaching for StackOverflow is nice.
The other thing that I find interesting is that when I'm hitting into an error I want it to go away ASAP. But if I read a collected list, an error I don't understand immediately gets my attention. So I think it's an nice way to learn something.
They are working on this right now. There's tons of work done to integrate core.spec into the core functions so they spit out legible error messages instead of raw stack traces and exceptions.
Any chance this or something else could make it into core so that the user doesn't have to go through hoops? Having to add a library to get that is just very...perl lol.
With clojure 1.9 clojure.spec will be available and core libraries should be updated. This should make error messages much better.
This library however could be a useful edition when you encounter the lower level errors.
Is there any date on when 1.9 will be released? I searched a little bit for the date but couldn't find anything concrete (I know I can access lambdas and that there is a spec "antishim"[1] for 1.8 - I'm just curious).
There is no release date as of yet [1]. But in that thread Sean Cornfield:
> Obligatory: “we’ve been running the 1.9 Alphas in production for months so that we can leverage clojure.spec” – no problems so far.
[1]: https://groups.google.com/forum/#!topic/clojure/i7ipoze2jos
My company's also been using 1.9 alphas for months, have maybe encountered a minor bug or two, but very few & nothing major.
right b/c you can't clojure.spec everything.
Because some of Clojure Core is written in Java or is there another reason that I'm missing?
Some things in Clojure are so dynamic, that it's still an open research problem as to how you can properly assign types to them.
because clojure.spec, in practice, only governs interaces. It's not going to help you with bugs that are as a result of data structures generated and manipulated inside of a function.
I have not use this package, but looks to be pretty helpful with figuring out stack traces.