let numbers = [1, 2, 3, 4, 5]
numbers /> filter((x) -> x > 2) /> map((x) -> x * x) /> reduce(0, (acc, x) -> acc + x) /> print -- 50
A few features I like: - The readability of the syntax - Pipeline algebra – Pipelines are values you can inspect and manipulate: - Reversible functions – Define forward and reverse transformations together: - Reactive pipelines – Automatically recompute when source data changes: - Compose pipelines - Decorators for cross-cutting concerns - VSCode extension with syntax highlighting
Try it out: git clone https://github.com/mcclowes/lea.git cd lea && npm install npm run repl
It's just a pet project, but I'd love feedback on the language design, especially around the readability, direction of type enforcement, reversible functions and pipeline algebra. Are there other operations that would make sense for pipelines as a data type?