Skip to content

Instantly share code, notes, and snippets.

View Bruno-366's full-sized avatar

Bruno-366

View GitHub Profile
@Bruno-366
Bruno-366 / 0-Readme.md
Last active July 18, 2023 15:10
Why Forth?

Why Forth?

2 Reasons:

  • linear types means immutable data by default
  • point-free by default means focus on composition
@Bruno-366
Bruno-366 / 0-Readme.md
Last active July 18, 2023 14:41
Fibonacci in JavaScript - Concatenative-style

Fibonacci Sequence in Javascript - Concatenative-style

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.

@Bruno-366
Bruno-366 / 0-Readme.md
Last active July 18, 2023 14:43
Exploring how to define a Grammar in APL using BNF-like syntax

BNF in APL

Exploring how to define a Grammar in APL using BNF-like syntax

@Bruno-366
Bruno-366 / 0-Readme.md
Last active July 18, 2023 14:44
Context-sensitive grammars in Shen-lisp

Context-sensitive grammars in Shen-lisp

Shen has its own in built version of YACC.
The irony is that YACC is less powerful in theory than the above.
Since it is based on BNF which is used to describe context-free grammars.

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)