• Stars
    star
    127
  • Rank 282,790 (Top 6 %)
  • Language
    Scala
  • License
    Other
  • Created over 11 years ago
  • Updated over 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Scala Spores, safe mobile closures.

Spores

Scala Spores, safe mobile closures: SIP-21

Building Spores

The Spores project is built and tested using sbt. It has two modules: spores-core and spores-pickling. The spores-core module contains the core type definitions and the spore macro. The spores-pickling module integrates Spores with scala/pickling by providing picklers for Spores.

To build the core Spores module:

> project spores-core
> compile

To run the test suite:

> test

Get Spores

The spores-core and spores-pickling modules for Scala 2.11 are available on Maven Central and Sonatype. You can use Spores in your sbt project by simply adding the following dependency to your build file:

libraryDependencies += "org.scala-lang.modules" %% "spores-core" % "0.2.4"

To enable integration with Pickling, add the following dependency:

libraryDependencies += "org.scala-lang.modules" %% "spores-pickling" % "0.2.4"

Or you can just directly download the jar files (spores-core, spores-pickling).

Updates since the first draft (June 16th, 2013) of SIP-21

Many users expressed concern that spores would be both unusable with for- expression syntax, and would be incompatible (without a lot of boilerplate) with normal closures or higher-order functions which take normal functions as arguments.

Capture Syntax

To remedy the incompatibility with for-expressions, we propose a new capture syntax. Here is an exemplary use in the context of a hypothetical DCollection type:

def lookup(i: Int): DCollection[Int] = ...
val indices: DCollection[Int] = ...

for { i <- indices
      j <- lookup(i)
} yield j + capture(i)

trait DCollection[A] {
  def map[B](sp: Spore[A, B]): DCollection[B]
  def flatMap[B](sp: Spore[A, DCollection[B]): DCollection[B]
}

Stable Paths

A stable path is an expression which only contains selections and identifiers (no applications, for example), and for which each selected entity is stable. In this context, stable means that the entity or object in question is introduced by object definitions or by value definitions of non-volatile types.

Adapted from the Scala Language specification (section 3.1), a path is defined to be one of the following:

  • C.this, where C references a class. The path this is taken as a shorthand for C.this where C is the name of the class directly enclosing the reference.
  • x where x is a package.
  • p.x where p is a path and x is a stable member of p. Stable members are packages or members introduced by object definitions or by value definitions of non-volatile types. (Section 3.6 of the SLS.)
  • C.super.x or C.super[M].x where C references a class and x references a stable member of the super class or designated parent class M of C. The prefix super is taken as a shorthand for C.super where C is the name of the class directly enclosing the reference.

A path refers to an object, that is, it ends with an identifier.

Uglies

  • Need to make it more convenient to create a nullary spore
  • Should objects be allowed in paths? The reason is that they are initialized lazily, so if we don't allow lazy vals, then allowing objects (which could end up being initialized only when the spore is applied) doesn't make a lot of sense.

More Repositories

1

dist-prog-book

CSS
3,424
star
2

progfun-stats

Visualize statistics from the MOOC "Functional Programming Principles in Scala" using Scala!
Scala
202
star
3

menthor

Parallelizing Machine Learning-- Functionally.
Scala
53
star
4

f-p

A new programming model for asynchronous and distributed programming.
Scala
36
star
5

papers-documents

Papers I (+ collaborators) have written or am currently writing
TeX
20
star
6

scala-pickling

Fast, customizable, boilerplate-free pickling support for Scala. MOVED TO http://github.com/scala/pickling
Scala
18
star
7

healy-article

Minimum working version of one of Kieran Healy's beautiful LaTeX article templates
TeX
18
star
8

cv

My CV
TeX
12
star
9

wwwheathermiller

Heather Miller's homepage
JavaScript
11
star
10

cs7680

Programming Models for Distributed Computation, analyses & minutes
8
star
11

scacs

Scala Cluster Service: a general cluster service + cluster support for Delite.
Scala
6
star
12

wwwcurryon

Website for Curry On!
CSS
5
star
13

scala-dataflow

TeX
5
star
14

wwwcs7680

http://heather.miller.am/teaching/cs7680
CSS
5
star
15

parcolls-extended

Extensions to Scala's Parallel Collections.
Scala
3
star
16

dissertation

Heather Miller's PhD Dissertation
TeX
3
star
17

testing-git-deploy-hooks

3
star
18

unisync

A non-destructive uni-directional sync. Think: รผber simple rsync that won't delete everything in the destination directory.
Scala
2
star
19

oss-community-bib

Bibliography covering peer-reviewed-research on Open Source Software (OSS) communities
1
star
20

reactive-stats

Visualize statistics from the MOOC "Principles of Reactive Programming" using Scala!
Scala
1
star
21

group-page-exp

HTML
1
star
22

wwwscala13

Website for Scala workshop 2013 (Scala'13)
CSS
1
star
23

srlzn-sandbox

Java
1
star
24

wwwscala14

Website for Scala workshop 2014 (Scala'14)
CSS
1
star
25

dep

Scala
1
star