lundi 18 septembre 2017

Language for front and back end web programming: Clojure or Scala?

I am a computer science professor and, in my lab, we work with front and back end web development. We used to use Java/GWT as our default language for development. But that combination isn't as productive as before. Our biggest concern is software productivity/reuse. Any language has to comply with the following requirements:

  • Be expressive, when a student finishes his/her PhD/MSc and leaves, I want the next student to be able to understand and reuse the programs created by the first one.
  • Be flexible enough, so students can easily explore innovative solutions.
  • Run both in the client (browser) and server.
  • Have good support: Books, frameworks, IDE support, etc.
  • Have good support for embedded DSLs (Domain Specific Languages).

Running in the JVM is a plus, but not a requirement.

After some research, we selected Clojure and Scala (Kotlin was also a close contender). But both have bad points:

Clojure (mostly ClojureScript)

Bad:

  • Code very susceptible to small errors: It gets to the point that the compiler crashes (Stack Overflow) due to an error in the project.clj file. Error messages do not help in this cases. Is clojure.spec a solution?
  • Figwheel: Great idea, but it doesn't detect many changes in code. For instance, changing the name (a string constant) of a tab (cljs-react-material-ui library)`.
  • DSLs limited to Lisp sintaxe (not easy to explain to domain experts).

Scala

Bad:

  • Complexity: Being a multi-paradigm language, makes Scala complex. Example: Scala authors use Haskell examples to simplify Scala type definitions! Many people seems to use just a subset of the language. Is that a good option?
  • Much more verbose.

Given all the new technologies released recently (e.g. Web Assembly), that has been a hard decision.

Disclaimer: We do have more experience with Clojure. Maybe Scala has other bad points that we just didn't discover yet.




Aucun commentaire:

Enregistrer un commentaire