: Xlerb is Forth Flavoured Erlang! ;
: maths [
: area square constants:pi * ;
: 0 factorial drop 1 ;
: _ factorial dup 1 - factorial * ;
: square dup * ; private
] ; moduleModules and Matching
A fully-fledge module system, and pattern matching right off the stack.
: ping-server
[ : _from :ping -> drop ! :pong send ;
: _from _ -> drop drop ;
] receive
ping-server ;Process-to-process Message Passing
Stack-oriented communication with a somewhat usable syntax!
[0]> [ping-server] spawn
[1]> ! :ping send
[0]> whatever receive .
:pongFearless concurrency
All code runs in isolated processes. Spin up a server, a timer, whatever!
[0]> [1 2 4] [Enum max 1] elixir .
4
[0]> 5 3 [math pow 2] erlang dup .
125.0Elegant Interop
Call any Erlang/Elixir function with an MFA triple.
[0]> :ok 100 &{&2, &1} pack .
{:ok, 100}
[0]> :name :joe %{&2 => &1} pack .s
%{name: :joe}
[1]> &%{name: &1} unpack .
:joeStack packing
Using familar syntax, pack and unpack terms onto the stack
Finally, concurrent multi-process concatenative programming on the BEAM!
Xlerb is a compiled, concatenative stack-based language which takes the experience of writing Joy/Forth and shoehorns it onto rock-solid runtime that powers Erlang, Elixir and Gleam.
The solution to a problem no one had, an answer to a question no one asked - the expressivity and maintainability of Forth/Joy with the unshakable reliability of the Erlang Runtime System!