Tell me more ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I'm looking for a programming language that has the following:

  • static typing
  • distributed programming across a cluster using actors (no shared memory, message passing)
  • functional programming
  • compiled
share|improve this question
1  
Is there a reason you need Actor Model Concurrency? It looks like its likely Static/STM, Dynamic/STM, or Dynamic/Actor. I don't know of any popular language which is usually used as Static/Actor. – alternative Jun 26 '11 at 22:09
2  
Your last bullet point doesn't make sense. Compilation or interpretation are traits of the ... well ... compiler or interpreter (duh!), not the language. – Jörg W Mittag Jun 27 '11 at 2:00
@Jörg: "compiled" here is just a shorthand for "and there exists a compiler" – blubb Jun 27 '11 at 11:37
2  
Why was this migrated? Seems like a perfect question for SO. – Barry Brown Jun 27 '11 at 20:55

migrated from stackoverflow.com Jun 26 '11 at 21:21

7 Answers

Scala with Akka, avaliable as the Typesafe Stack

Akka introduction video from Scala days 2010, 2011 scalax videos THE PROMISING FUTURE OF AKKA, Connecting Akka to the rest of the world with Apache Camel

(Akka actors might be included in future releases of Scala)

share|improve this answer
2  
+1. When I read the question, I immediately thought of Scala. – Matthew Rodatus Jun 27 '11 at 10:31

Haskell?... Erlang?... I'm no expert in either but both are functional, and in one of them pretty much every statement is immutable.

share|improve this answer
1  
Erlang has dynamic typing. – LennyProgrammers Jun 27 '11 at 5:04

There are three implementations of Haskell with this bill (well, substituting actors for other equivalent models of communication). One is researchy, one is low-level, and one is experimental:

  • Researchy - Glasgow Distributed Haskell - venerable distributed version of GHC.
  • Experimental - Cloud Haskell - distributed GHC with message passing, based on Erlang model, but statically typed and with an optimizing compiler that produces native code.
  • Low-level - HaLVM - isolated, cheap GHC nodes on top of Xen, communicating via shared memory. Very cheap to spin up, and good support for networking. Would be an interesting base for a swarm of nodes across a cluster.
share|improve this answer

I think OCaML can get you most of the way, although you'll need to rely on some third party libraries for the distributed programming and in general its parallelism story isn't quite as together as Erlang's. It is, however, the most statically typed language I've ever worked in, forcing explicit coercions even between a type and its base class!

share|improve this answer
JoCaml is an extension of OCaml with concurrency in mind (especially distributed; it's not about parallelism). The concurrency model is based on message passing, but the message passers are pretty much actors. – Gilles Jun 30 '11 at 22:58

After Erlang (which is dynamically typed), I thought of Haskell. I did some searching and came across this discussion of an implementation of the actor model for Haskell. I'm not familiar enough with Erlang (or Haskell - the only functional languages I've used are Scheme and Standard ML and even that was in a university course).

Haskell by itself doesn't appear to be exactly what you want, but perhaps with this library, you can get something close. I would also consider Erlang as an alternative - it does meet three of your four requirements. I think you might be hard-pressed to find something that, out of the box, coincides with all four.

share|improve this answer

I think Erlang fits your definition pretty well.

share|improve this answer
5  
Erlang is not a statically typed language – Boris Pavlović Jun 26 '11 at 21:20
It does, except it doesn't have static typing :( – Xavier Jun 26 '11 at 21:20
My first thought was Erlang, too, because I couldn't remember is type system. – Thomas Owens Jun 26 '11 at 21:37
1  
But there is a static type system for Erlang. – Jörg W Mittag Jun 27 '11 at 1:59

Clojure would fit this discription pretty well:

  • Static typing - yes because although Clojure is dynamically typed by default, you can get the benefits of compile-time static typing any time you want by using type hints

  • Distributed programming - this is easy when coupled with any one of many possible Actor libraries (Akka would work, or swarmiji, plus I think there are various others in the works e.g. saturnine that could also form a good basis for a distributed application)

  • Functional programming - absolutely, Clojure is a functional programming language at heart. Functional influence is pervasive - e.g. lazy infinite sequences, use of higher order functions and immutability of all core data structures are pretty much standard throughout all idiomatic Clojure code. It feels quite like a hybrid of Lisp and Haskell in many respects.

  • Compiled - everything in Clojure is compiled (even with "eval") - and since it is on the JVM you get all the nice benefits of the very well engineered JIT opimization.

Clojure also has a very unique and interesting concurrency model using Software Transactional Memory that is worth investigating. This is intended for multi-core shared-state concurrency rather than the distributed messaging case, but depending on your application may actually be better. See this video by Rich Hickey for some details and insights (if nothing else it will expand your mind regarding the management of the state of objects in software applications!).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.