https://github.com/matz/streem
prototype of stream based programming language
https://github.com/matz/streem
Last synced: 6 months ago
JSON representation
prototype of stream based programming language
- Host: GitHub
- URL: https://github.com/matz/streem
- Owner: matz
- License: mit
- Created: 2014-12-11T08:07:50.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2022-01-03T10:45:02.000Z (almost 4 years ago)
- Last Synced: 2025-04-11T23:00:46.008Z (7 months ago)
- Language: C
- Size: 821 KB
- Stars: 4,602
- Watchers: 353
- Forks: 236
- Open Issues: 25
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: CODEOWNERS
Awesome Lists containing this project
- awesome-programming-languages - Streem - 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. (Uncategorized / Uncategorized)
- awesome-rubies - Streem Lang :octocat: - prototype of stream based programming language by Yukihiro Matsumoto (Ruby Language Research, Papers & Books)
README
# Streem
[](https://github.com/matz/streem/actions?query=workflow%3Aci)
[](https://gitter.im/matz/streem?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
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
```shell
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):
```shell
$ bin/streem -e 'stdin | stdout'
```
or
```shell
$ 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 . We consider
you have granted non-exclusive right to your contributed code under
MIT license. Use for
discussion.
## License
MIT license (© 2015-2016 Yukihiro Matsumoto)