Add language specification document

This commit introduces the BNF for the Myc language, along with its core
semantics, data types, and evaluation logic. It also details the macro
system and provides an overview of the standard library. This document
serves as a foundational context for LLMs to understand and generate Myc
code.
This commit is contained in:
Michael Schimmel
2026-03-06 11:35:18 +01:00
parent 9ba4f795d1
commit 32a1f21463
7 changed files with 221 additions and 50 deletions
+14
View File
@@ -0,0 +1,14 @@
;; Output: 20
(do
(def tst
(fn [length]
(do
(def history (series :float))
(fn [val]
(do
length
))
)))
((tst 20) 5)
)
+24
View File
@@ -0,0 +1,24 @@
(do
(def SMA
(fn [length]
(do
(def history (series :float))
(push history 0)
(fn [val]
(do
(def sum (+ val (history 0)))
(push history sum)
(/ sum length)
))
)))
(def sma20 (SMA 20))
(def n 100)
(while (> n 0)
(do
(print "val=" n " sma20=" (sma20 n))
(assign n (- n 1))
))
)