candy-lang / candy

🍭 A sweet, functional programming language that is robust, minimalistic, and expressive.
MIT License
313 stars 3 forks source link

Does a grammar file 'candy.g' exist??? #28

Open jayjah opened 3 years ago

jayjah commented 3 years ago

Hey guys,

I am looking quite excited at your 'new' programming language!

I just wanted to know if you use or have a grammar file for these Candy language? That grammar file could (!) be used to make Candy as an interpreted language as well.

JonasWanke commented 3 years ago

Hi, thanks for your interest! We do have an (outdated!) ANTLR v4 grammar file. It's not yet in this repository, and due to it being outdated, I don't want to add it right now, but you can view it here: https://files.wanke.cloud/f/0e3243926ab4435ba536/.

We're currently working on the compiler written in Dart, and in parallel building the Candy standard library. The current parser uses petitparser and is located here: https://github.com/JonasWanke/candy/blob/d4d56b0d517af05735753f3414bf01af41bad9f2/packages/parser/lib/src/parser/grammar.dart.

When we have some basic utilities and the compiler has enough features, we plan to bootstrap the compiler, i.e., rewrite it in Candy itself. You can see an overview of the current design & implementation status (and what's required for the bootstrapping) over here: https://files.wanke.cloud/f/8a57ff4c3349426f8634/.

Part of the bootstrapping process consists of creating a new (more fault-tolerant) parser, though we haven't decided on the type of parser yet, or whether we'll use a parser generator or not. Either way, running Candy as an interpreted language is a use-case we definitely want to support, if only because we can use that to evaluate compile-time expressions.

We'll soon update the README and include some info about the rewrite and architecture of this project. Don't hesitate to ask if you have any further questions :)