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:

  1. Write reader with new Pytonish syntax, which would compile input to the SExpressions, that MAL's eval expect
  2. ...

About Lisp syntax

There were a million attempts to create an alternative to SExpressions. See:

Parsers

Crystal libs

Lisp, Sheme, Clojure BNF/EBNF

Grammars

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

Thu, 21 Nov 2024 05:40:57 GMT

Languages