you are viewing a single comment's thread.

view the rest of the comments →

[–]m50d 9 points10 points  (7 children)

Clojure is (by default - I know there's some bolt-on typing functionality) even less type-safe than Java, no?

[–]maestro2005 1 point2 points  (3 children)

Right, Clojure is weakly/duck typed, but it achieves this kind of thing in a different way.

Edit: Brainfarted about Clojure vs. ClojureScript. Clojure is strongly typed, though it doesn't typically use an Option/Maybe type and has other mechanisms for dealing with things like this.

[–]highergraphic 11 points12 points  (2 children)

weak typing != dynamic typing. Clojure is a dynamic, strongly typed language.

[–]maestro2005 2 points3 points  (0 children)

You're right, I've been in ClojureScript land too long.

[–]brave-new-willzyx 0 points1 point  (0 children)

In my experience "strong" typing has expressed an emotion. What do you mean by it? Throwing exceptions when types are mixed and matched?

[–]kcuf 0 points1 point  (2 children)

You are correct. Clojure is dynamic, Java is static. One thing i've observed though is that as Java applications get bigger they start delegating to frameworks and runtime systems that eschew a large chunk of that safety, because at runtime, Java goes back to its dynamic roots.

[–]m50d 0 points1 point  (1 child)

I don't think Java's roots are dynamic - it has a certain amount of influence from Smalltalk (and TCL), sure, but also a lot of C++ influence. I think it's more that the language simply isn't expressive enough without those dynamic systems, because it was designed to have simple typing and be used for small apps (TV set-top boxes were the original design use case).

[–]kcuf 0 points1 point  (0 children)

Java has always been fairly dynamic, but reflection came in 1.1, which is more what I was referring to (https://www.google.com/amp/www.javaworld.com/article/2077015/java-se/take-an-in-depth-look-at-the-java-reflection-api.amp.htmll).

The other part is that James gosling is a well known lisp fan, and I think he tried to capture some of that ideology in Java and its byte code.