GithubHelp home page GithubHelp logo

kaisar420 / streem Goto Github PK

View Code? Open in Web Editor NEW

This project forked from matz/streem

1.0 3.0 0.0 777 KB

prototype of stream based programming language

License: MIT License

Dockerfile 0.19% Makefile 0.40% C 90.22% C++ 0.62% Lex 1.34% Yacc 7.03% Ruby 0.15% Shell 0.05%

streem's Introduction

Streem

Build Status Gitter

Streem is a stream based concurrent scripting language. It is based on a programming model similar to the shell, with influences from Ruby, Erlang, and other functional programming languages.

Note: Streem is still in the design stage. It's not working yet. Stay tuned.

Compiling

Installing dependencies

  • bison
  • flex
  • gcc / clang

Run make

make

Examples

In Streem, a simple cat program looks like this:

stdin | stdout

You can try it out by (firstly cd to streem top directory):

$ bin/streem -e 'stdin | stdout'

or

$ bin/streem examples/01cat.strm

Streem is a (sort of) DSL for data flows. Above code means building data-flow connection between stdin and stdout. Actual data processing will be done in the event loop invoked after program execution.

For another example, a simple FizzBuzz will look like this:

# seq(100) returns a stream of numbers from 1 to 100.
# A function object in pipeline works as a map function.
# stdout is an output destination.
seq(100) | map{x->
  if (x % 15 == 0)     "FizzBuzz"
  else if (x % 3 == 0) "Fizz"
  else if (x % 5 == 0) "Buzz"
  else                 x
} | stdout

The second part in the pipeline ({x ->...}) is a function object. If a function object is connected in the pipeline, it will be invoked for each element in the stream.

There are more examples under folder examples/. Just play with them!

Contributing

Send a pull request to http://github.com/matz/streem. We consider you have granted non-exclusive right to your contributed code under MIT license. Use http://github.com/matz/streem/issues for discussion.

License

MIT license (© 2015-2016 Yukihiro Matsumoto)

streem's People

Contributors

matz avatar mattn avatar suzukaze avatar nickmccurdy avatar dbohdan avatar shuichiro-makigaki avatar practicalswift avatar arcz avatar mtsmfm avatar jakecraige avatar proppy avatar markburns avatar vifino avatar chancancode avatar goom11 avatar jonathanmarvens avatar khasinski avatar marado avatar artintal avatar mneilsen avatar nobu avatar coderobe avatar gitter-badger avatar yhara avatar halogenandtoast avatar octarect avatar vendethiel avatar polarker avatar yamamuteki avatar kmdsbng avatar

Stargazers

Iparhan avatar

Watchers

James Cloos avatar Iparhan 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.