Streem

基于流(stream)的编程语言原型。「prototype of stream based programming language」

Github星跟蹤圖

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 https://github.com/matz/streem. We consider
you have granted non-exclusive right to your contributed code under
MIT license. Use https://github.com/matz/streem/issues for
discussion.

License

MIT license (© 2015-2016 Yukihiro Matsumoto)

主要指標

概覽
名稱與所有者matz/streem
主編程語言C
編程語言Makefile (語言數: 6)
平台
許可證MIT License
所有者活动
創建於2014-12-11 08:07:50
推送於2022-01-03 10:45:02
最后一次提交2022-01-03 19:45:02
發布數19
最新版本名稱201611 (發布於 2016-10-08 15:39:10)
第一版名稱201502 (發布於 2014-12-11 17:47:01)
用户参与
星數4.6k
關注者數353
派生數235
提交數1k
已啟用問題?
問題數63
打開的問題數21
拉請求數100
打開的拉請求數4
關閉的拉請求數20
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?