Coder Social home page Coder Social logo

mjstahl / soma Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 60 KB

Social Machines is a server-side programming language with a syntax greatly inspired by Smalltalk. Every object in Social Machines is a concurrent unit of computation, libraries can be shared like peers in a network.

License: Other

Go 100.00%

soma's Introduction

Social Machines

Social Machines is a server-side programming language with a syntax greatly inspired by Smalltalk. Every object in Social Machines is a concurrent unit of computation, and libraries can be shared like peers in a BitTorrent network.

Goals

Social Machines is an exercise (read 'experiment') in language design and the evaluation of assumptions. The two assumptions that affected the design are as follows:

  1. Every object is an isolated, concurrent unit, easing the burden on the programmer by removing the need to choose whether to thread code or not.
  2. All modern computer languages are designed in the context that a language is designed for writing a single application running on a single machine. The network is an afterthought and therefore relegated to APIs. This is invalid due to the ubiquity of the internet.

Semantics

The core of Social Machines is Carl Hewitt's Actor Model. All Social Machines objects exhibit three core behaviors:

  1. Create Objects
  2. Send Messages
  3. Receive Messages

All message passing in the Actor Model was done asynchronously. To make a program slightly easier to reason about, Social Machines adds Promises. All Social Machines Promises are first class. Promises allow the source to behave sequentially at the potential expense of dead locks/live locks.

Syntax

The syntax is greatly inspired by Smalltalk. An example of the True object is listed below. The + indicates the defining of an External Behavior.

    + True ifFalse: fBlock -> Nil.

    + True ifTrue: tBlock -> tBlock value.

    + True ifTrue: tBlock ifFalse: fBlock -> tBlock value.

    + True not -> False.

    + True & aBool ->
      aBool ifTrue: { self } ifFalse: { False }.

    + True | aBool -> self.

    + True ^ aBool ->
      aBool ifTrue: { False } ifFalse: { self }.

Getting Started

    $ go get github.com/socialmachines/soma
    $ cd $GOPATH/src/github.com/socialmachines/soma
    $ go install

    # ensure $GOROOT/bin is on your path, if not
    $ export PATH=$PATH:$GOROOT/bin
    $ soma

Testing

    $ cd $GOPATH/src/github.com/socialmachines/soma/test
    $ go test

License

Unless otherwise specified all source code is licensed under the MIT license.

parse/interface.go and scan/errors.go are licensed under Go's BSD license.

soma's People

Contributors

mjstahl avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.