Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Actually, clojure compiles down to java classes, which are statically typed. Existing java types can be extended with clojure protocols. The link below talks about this, specifically about the expression problem.

See https://www.ibm.com/developerworks/library/j-clojure-protoco...

However, I learnt something. I didn't know that the definition of the expression problem required static typing. I prefer to think of it as adding static types to multiple dispatch.



You missed a detail: or even casts in an otherwise static language.

Clojure does compile down to Java classes, but Java is only a partially statically typed language. It also permits run-time casting, which, in a language that even tries to be strongly typed, means run-time (to wit: dynamic) type checking. And Clojure relies heavily on that.

That's why I invoked Haskell. It's an example of a language that is truly statically typed, in that it doesn't (generally) permit any run-time type conversions. ALL type checks must be done statically.


Then, the conclusion can be that dynamic languages don't suffer from the expression problem.


Pretty much. Not entirely unlike how one can't implement the Y combinator in a statically typed language, but it's trivial to do so in a dynamic language.




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

Search: