SALSA (programming language)

From Wikipedia, the free encyclopedia
Jump to: navigation, search
Paradigm Actor model
First appeared 2001 (2001)
Stable release
1.1.5 / July 18, 2011; 5 years ago (2011-07-18)
Implementation language Java
OS cross-platform
Filename extensions .salsa

The SALSA programming language (Simple Actor Language System and Architecture) is an actor-oriented programming language that uses concurrency primitives beyond asynchronous message passing, including token-passing, join, and first-class continuations. It also supports distributed computing over the Internet with universal naming, remote communication, and migration linguistic abstractions and associated middleware. For portability, it produces Java code.


Hello World[edit]

module demo;

   This behavior simply sends two print(...) messages to the
   standardOutput actor.

behavior HelloWorld {
      The act(...) message handler is invoked by stand-alone
      theaters automatically and is used to bootstrap salsa

   void act( String[] argv ) {

      standardOutput<-print( "Hello" ) @

      standardOutput<-print( "World!" );

      Notice that the above code is different from
         standardOutput<-print( "Hello" );
         standardOutput<-print( "World!" );
      the code above uses a continuation to insure that the
      world message is sent after the hello message
      completes processing.


Standard Input[edit]

module demo;

   This behavior simply prints out a string,
   reads a line from the Standard Input,
   combines the return value of the Standard Input with other strings,
   and then prints out the combined string.

behavior StandardInputTest{

   public StandardInputTest() {}

   String mergeString(String str1, String str2, String str3) {
       return str1+str2+str3;

   void act(String[] args) {
      standardOutput<-println("What's your name?")@
      self<-mergeString("Hi, ",token, ". Nice to meet you!" )@

External links[edit]