I finally pushed myself to open-source Fluent, a differentiable array-oriented language I've been building for the New Kind of Paper project [1-5]. Demo is available at [0].
Few salient features:
1. Every operator is user-(re)definable. Don't like writing assignment with `:`, change it to whatever you like. Create new and whacky operators – experiment to the death with it.
2. Differentiability. Language is suitable for machine learning tasks using gradient descent.
3. Reactivity. Values can be reactive, so down-stream values are automatically recomputed as in spreadsheet.
4. Strict left-to-right order of operations. Evaluation and reading should be the same thing.
5. Words and glyphs are interchangeable. All are just names for something. Right?
6. (Pre,In,Post)-fix. You can choose style that suits you.
It has its own IDE with live evaluation and visualization of the values. The whole thing runs in browser (prefer Chrome), it definitely has ton of bugs, will crash your browser/computer/stock portfolio, so beware.
Some bait – linear regression (Ctrl+O, "linear-regression-compressed" or [6]):
x: (0 :: 10),
y: (x × 0.23 + 0.47),
θ: ~([0, 0]),
f: { x | x × (θ_0) + (θ_1) },
L: { μ((y - f(x)) ^ 2) },
minimize: adam(0.03),
losses: $([]),
(++): concat,
{ losses(losses() ++ [minimize(L)]), } ⟳ 400,
(losses, θ)
pre-, in-, post- fix & name/glyph equivalence: 1 + 2,
1 add 2,
add(1,2),
+(1,2),
(1,2) . +,
(1,2) apply add,
---[0]: https://mlajtos.github.io/fluent/?code=RG9jdW1lbnRhdGlvbg
[1]: https://mlajtos.mu/posts/new-kind-of-paper
[2]: https://mlajtos.mu/posts/new-kind-of-paper-2
[3]: https://mlajtos.mu/posts/new-kind-of-paper-3
[4]: https://mlajtos.mu/posts/new-kind-of-paper-4
[5]: https://mlajtos.mu/posts/new-kind-of-paper-5
[6]: https://mlajtos.github.io/fluent/?code=eDogKDAgOjogMTApLAp5O...