All Projects β†’ biboudis β†’ sml-streams

biboudis / sml-streams

Licence: other
Streaming library for bulk memory operations with Standard ML in MLton

Programming Languages

Standard ML
205 projects
Makefile
30231 projects

Projects that are alternatives of or similar to sml-streams

SMLReader
ESP8266 based smart meter (SML) to MQTT gateway
Stars: ✭ 170 (+529.63%)
Mutual labels:  sml
vim-better-sml
πŸŽ‰ Enjoy writing SML within Vim
Stars: ✭ 97 (+259.26%)
Mutual labels:  sml
Learning
@elahe-dastan / @1995parham training and testing repository πŸ“š πŸ€“
Stars: ✭ 53 (+96.3%)
Mutual labels:  sml
Home Assistant EDP Box
Integração das EDP Box com Home Assistant Core
Stars: ✭ 91 (+237.04%)
Mutual labels:  sml
secs4java8
This library is SEMI-SECS-communicate implementation on Java8.
Stars: ✭ 46 (+70.37%)
Mutual labels:  sml

sml-streams

The vision: Bulk memory operations with Standard ML in MLton. The pattern is based on pipelines that are composed via continuations, where a source is wrapped as a push-based stream, transformations are applied via lazy operations and eager combinators force the effects on the backing, in-memory collection of items:

source - lazy - lazy - lazy - eager

Test

To experiment with the library install MLton and make the project:

> sudo yum install mlton
> make bench
> cd build 
> ./bench-streams

Example

(* using F#-like pipe operators *)
Array.tabulate (10, fn i => i)
    |> Stream.ofArray
    |> Stream.map(fn x => x * x)
    |> Stream.take 6
    |> Stream.sum

Benchmarks

# Outer=1000000, Inner=10
Streams cart time: 0.098 sec/op
Baseline cart time: 0.048 sec/op

# Outer=5000000, Inner=50
Streams cart time: 1.857 sec/op
Baseline cart time: 1.195 sec/op

# Outer=10000000, Inner=100
Streams cart time: 7.151 sec/op
Baseline cart time: 4.723 sec/op

References

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].