Hacker News new | past | comments | ask | show | jobs | submit login

I really like this idea. Dynamic typing (especially truthy / falsy) gives you a lot of easy flexibility and conciseness, but static typing gives you a lot of "free" documentation and confidence.

So when I use Scala I'm frustrated that I have to dance for the type system to make the damn thing do what I want, and when I use Clojure I occasionally get lost down long holes of confusion only to realise that the map with params I passed to some function somewhere had an element misspelt slightly (an hour lost because I used :url instead of :uri once, no joke).

I've heard good things about core.typed, but have yet to find the time to try it out.

Edit: I've also found that in all the static languages I've tried (Scala being the one with the most comprehensive type system) you get to a point where you can't describe what you want with your type system because it's too conceptually complex, and then all your assumptions about what the type system gives you falls away.




Your experience with Scala sounds unusual. What is an example of something you wanted it to do, but could not easily?


Not so unusual, if you come at it from a developer who's experience is in mostly dynamic languages perspective. It can feel like you're fighting the type checker at times, however I found that the reason that's the case is because I'm trying to write dynamic code in a statically typed language. Once I got over that impedance mismatch, Scala became a lot nicer for me.

Funnily, that is one of the problems I've experienced with gradually typed (and optionally typed) systems; you need to have strong discipline to get the most of out them. My personal way of tackling it (in Hack these days) is to strictly type everything, and only rely on dynamic typing where it's absolutely needed.




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: