https://futureofcoding.org/ logo
#share-your-work
Title
# share-your-work
m

Mike Austin

11/21/2023, 11:57 PM
I've demoed my Kopi language and Rect-Desktop projects a few weeks ago. In my experience writing Kopi, I've always wanted to write a "How to Write a Programming Language" tutorial based on it, since the core language is simple and familiar (infix operators, assignment, anonymous functions, etc.). Here's the start of something (written in Markdown, presented using the React-Desktop Markdown app: https://mike-austin.com/react-desktop/?app=markdown&args=/Let%27s%20Build%20a%20Language.md&width=1280&height=1440 It's in an early draft. I like presenting ideas very incrementally, and being able to see and even interact with each small change. You can modify any of input or parser code and see the result value change.
y

yoz

12/01/2023, 10:35 PM
I'm excited to see more of this. Don't have my head properly wrapped around Kopi yet (especially the
'(expression)
syntax) but I love how concise and powerful it looks.
Is there a GitHub repo for Kopi, React Desktop, etc?
m

Mike Austin

12/01/2023, 11:23 PM
Thanks Yoz! The recent version of Kopi is in a private repo, which I need to migrate to my public Kopi repo - maybe over the holidays. The '(expression) syntax is like LISP's quotes, meaning you get the unevaluated expression tree back.
'foo
is literally a StringLiteral AST node. I hijacked it to support calling methods so you can write
'sin 30
or
'(toFixed 2) 5
to call methods. I've only really used it for this purpose (calling methods), so maybe I should just limit it to that. You can say
'foo == 'foo
, which is true, which can be used like atoms/symbols in other languages.