Scala - Java = ? (Or Clojure - Java = ?)

2020-07-06 06:28发布

问题:

  1. Is it possible for a developer to use Scala without knowing Java?
  2. Is it possible for a developer to use Clojure without knowing Java?

Note: For example I am a C# developer and I use .NET without knowing any VB (Of-course WF 4.0 uses VB for statements, so I refuse any projects involving WF 4.0 :) ).

Summary I: Thanks to all for your answers. Now I can tell one can use these languages without knowing Java (The Language). Now I've got another question: How can one start with Java (JVM) ecosystem? What are beginner, intermediate and advanced knowledge-bases (bags!)? To be honest Java ecosystem was always a bit confusing to me, so it would be very helpful to provide some "reference references" and "defacto tutorials" for learning (curve!) JVM. (OK! I will post it as another question!)

回答1:

Scala, and Clojure even more so, are totally different languages from Java. The only thing they have in common is that they run on the Java virtual machine. You do not need to know the Java programming language to program in Scala or Clojure. It would be useful, however, to know something about the Java ecosystem (the Java virtual machine and runtime environment).



回答2:

Sure you can. You'll lack the knowledge of the standard library at first, but that's not a big problem when you're starting with a new languages anyway. Clojure & Scala, however, put a heavy emphasis on the Java interop and do not try to hide the raw Java stuff, so you'd probably have to learn more about Java(not the language - the Java Platform) at some point to make maximum use of the language and the underlying platform.



回答3:

Speaking from the perspective of knowing Java and Clojure (but not Scala), you can use Clojure just fine without knowing Java. You have access to the core language, which is fully-featured, and libraries (e.g. clojure-contrib).

However, one of the big benefits of using Clojure (versus other lisps) is access to the Java ecosystem - libraries, debuggers, JVM, etc.

So, yes you can use Clojure effectively and I wouldn't let a lack of Java knowledge hinder you, but you'll add to your bag of tricks if you eventually start to learn enough Java to take advantage.



回答4:

Well, Clojure has been ported to the CLR. Probably easier thant the whole jump to the JVM since you are a .NET developer. :)

http://github.com/richhickey/clojure-clr



回答5:

yes, thats me!

Has not been much of a problem for me except for when I needed a stupid simple swing gui. thats when I had to go back and review java.



回答6:

Scala is totally different language than java. So yes, you can of course use scala without knowing java ( but of course you have to learn scala first). Even though, knowing java (or any OO language) + some functional language makes it easier to understand scala.