Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scala and Clojure both in one project

I'm looking for a guide for polyglot programming in this two languages.

I know that interop between them is possible, since they are both running on the same Java VM, and both got compiled to the same bytecode. But there is some cumbersomes:

  • Can I use sbt to compile Clojure code?
  • Can I use leiningen to compile Scala code?

( Yeah, yeah, I know I can just plug in jar from one language to project in other lang.)

So the question is How to setup polyglot development in Scala and Clojure?

like image 897
om-nom-nom Avatar asked Mar 13 '12 00:03

om-nom-nom


People also ask

Is Scala faster than Clojure?

Scala is faster than Clojure. The microservice development is efficient.


2 Answers

The short anser: use Maven3

maven3 with the zi plugin for clojure and the maven-scala-plugin will allow you to have a nicely integrated polyglot project where you can use any language you want as long as its Java ;)

One of the big changes in Maven3 was a push toward polyglot JVM programming including the ability to write POMs in many languages. You loose the polish of leiningen when taking this route, though you gain plenty in return.

like image 176
Arthur Ulfeldt Avatar answered Sep 30 '22 08:09

Arthur Ulfeldt


I've not used it, but Leiningen does have scalac support.

like image 41
Paul Butcher Avatar answered Sep 30 '22 07:09

Paul Butcher