Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Real Time Capabilities?

Tags:

clojure

Over the last few weeks I've been learning and experimenting with Clojure and Erlang. From what I understand both solve the same type of problems - but - with different approaches. If that is correct, then is Clojure just as viable an option for real-time systems like chat applications or ticker plants, as Erlang is?

like image 311
kin1 Avatar asked Aug 09 '11 20:08

kin1


2 Answers

both address concurrent programming though in different environments:

  • Clojure is really good at shared memory concurrent programming. Where there are many threads all working on a single big chunk of memory (the heap) and they need to coordinate access to shared objects within that memory.
  • Erlang is really good at share nothing distributed computing where processes need to be able to run on many computers and work on independent memory spaces. They do not coordinate shared access to objects.

Both of these systems are "soft real time" and are well suited to things like chat and control systems though neither of them would be suited to system with hard real-time requirements.

like image 50
Arthur Ulfeldt Avatar answered Nov 22 '22 18:11

Arthur Ulfeldt


As far as Clojure goes, it can provide as much real time capabilities as the underlying Java VirtualMachine can.

You CAN create a hard real time system with a JVM, but this has to go beyond just the language syntax that Clojure provides.

Depending on your real-time requirement, it looks like you are going to need to tune the JVM (here is a good IBM Works article or to use a specific JVM like the Fiji JVM

Concerning Erland, there is already a related questions on SO

Chat and ticker plants applications can be achieved with both languages, but I personally suspect it would be easier to deploy with Clojure, especially looking at the offers in the Cloud (Heroku) and regular hosting services.

like image 40
Nicolas Modrzyk Avatar answered Nov 22 '22 18:11

Nicolas Modrzyk