ScalaLoci

Research and development of language abstractions for distributed applications in Scala

Features

Coherent
Implement a cohesive distributed application in a single multitier language
Comprehensive
Freely express any distributed architecture
Safe
Enjoy static type-safety across components

Concepts

Specify Architecture

Define the architectural relation of the components of the distributed system

trait Server extends Peer {
   type Tie = Multiple[Client]
}

trait Client extends Peer {
   type Tie = Single[Server]
}

Specify Placement

Control where data is located and computations are executed

val items = placed[Server] {
  getCurrentItems()
}

val ui = placed[Client] {
  new UI
}

Compose

Combine data flow across components through reactive programming

val items = placed[Server] {
  Var(getCurrentItems())
}

placed[Client] {
  Signal {
    items.asLocal() map createUIEntry
  }
}

Getting Started

Check out ScalaLoci by Code Examples

Try out ScalaLoci Examples from GitHub

Add ScalaLoci to Your Project

  1. Enable the Macro Paradise Plugin (for macro annotations) in your build.sbt
    addCompilerPlugin("org.scalamacros" % "paradise" % "2.1.0" cross CrossVersion.patch)
  2. Add the resolver for the ScalaLoci dependencies to your build.sbt
    resolvers += Resolver.bintrayRepo("stg-tud", "maven")
  3. Add the ScalaLoci dependencies that you need for your system to your build.sbt
    1. ScalaLoci core (always required):
      libraryDependencies += "de.tuda.stg" %% "scala-loci-core" % "0.1.0"
    2. Transmitter for the types of values to be accessed remotely
      • Built-in Scala types and standard collections
        libraryDependencies += "de.tuda.stg" %% "scala-loci-transmitter-basic" % "0.1.0"
      • REScala reactive events and signals
        libraryDependencies += "de.tuda.stg" %% "scala-loci-transmitter-rescala" % "0.1.0"
    3. Network protocols to connect the different components of the distributed system
      • TCP [JVM only]
        libraryDependencies += "de.tuda.stg" %% "scala-loci-network-tcp" % "0.1.0"
      • WebSocket (using Akka HTTP on the JVM) [server: JVM only, client: JVM and JS web browser APIs]
        libraryDependencies += "de.tuda.stg" %% "scala-loci-network-ws-akka" % "0.1.0"
      • WebSocket (Play integration) [server: JVM only, client: JVM and JS web browser APIs]
        libraryDependencies += "de.tuda.stg" %% "scala-loci-network-ws-akka-play" % "0.1.0"
      • WebRTC [JS web browser APIs only]
        libraryDependencies += "de.tuda.stg" %% "scala-loci-network-webrtc" % "0.1.0"
    4. Serializer for network communication
      libraryDependencies += "de.tuda.stg" %% "scala-loci-serializable-upickle" % "0.1.0"