crystal-lisp
MAL in Crystal
Forked from https://github.com/kanaka/mal/tree/master/impls/crystal
Why Crystal?
My previous experiment was to build MAL in Pony. Pony is a nice language, but its type system is a bit "rigid", which slows down me. I want to experiment and iterate fast.
I want a compiled fast language, but not C. My options are:
- Go - I don't want to deal with the absence of generics
- Rust - I don't want to deal with the borrow checker
- Chez Scheme or sbcl or clasp - may be, but there is no static type checker?
- Zig
- Crystal
I decided to go with Crystal because it is a bit more flexible than Zig. Also, I heard that they want to rewrite the Ponylang compiler from C to Crystal, so I was curious.
Ideas
Ideas I want to explore:
- Write reader with new Pytonish syntax, which would compile input to the SExpressions, that MAL's
eval
expect - ...
About Lisp syntax
There were a million attempts to create an alternative to SExpressions. See:
- History of alternative syntaxes for Lisp
- Readable Lisp S-expressions Project
- LISP Infix Syntax Survey
- wisp: Whitespace to Lisp
- Curly infix, Modern-expressions, and Sweet-expressions: A suite of readable formats for Lisp-like languages
- nonelang
- LSIP: An operator-based syntax for Racket programs; O-expressions
- rhombus-brainstorming
Parsers
Crystal libs
- http://crystalshards.xyz/?filter=parser
- arborist
- pars3k
- crystal-pegmatite - no documentation
- pegasus - regexp
Lisp, Sheme, Clojure BNF/EBNF
Grammars
- The Packrat Parsing and Parsing Expression Grammars Page
- Language Grammar
- Confluent Orthogonal Drawingfor Syntax Diagrams
- Guy Steele on Computer Science Metanotation
Brainstorming
- operator precedence rules is hard to remeber. Pony doesn't have it
- punctuation-signs as operators are hard to search
- I don't think that prefix notation is a problem, almost all functions except math operators and special operators like in Haskell use it. See: operators
- In Scheme it is possible to use
[]
and{}
in addition to()
, which makes it more readable - In Clojure
[]
denotes a vector (doesn't evaluate like application),{}
denotes a hashmap,:...
denotes a keyword (doesn't evaluate like a variable, more like Ruby's symbol)
Repository
crystal-lisp
Owner
Statistic
- 1
- 0
- 0
- 0
- 2
- almost 4 years ago
- December 23, 2020
License
Links
Synced at
Sun, 22 Dec 2024 04:35:46 GMT
Languages