2 Reasons:
- linear types means immutable data by default
- point-free by default means focus on composition
Demo on how to produce the Fibonacci Sequence in Javascript - Concatenative-style.
Drawing inspiration from Concatenative Programming Languages, such as Forth and Factor,
this demonstration relies on recursion or iteration only for ease-of-use rather than functionality.
BNF = { } | |
-- create definition | |
BNF["::="] = function (stack) | |
local non_terminal = pop(stack) ; | |
push(BNF,non_terminal) ; end | |
-- add words to definition | |
BNF[";"] = function (stack) | |
local non_terminal = pop(BNF) |