I began writing Cornflakes when I was 15 years old; it was my first adventure into the wonderful word of language design. Although incredibly buggy and lacking many core features, Cornflakes is one of my favorite projects I'd ever worked on. As I got older and learned more about other JVM languages, I found that many of them have lots of features Cornflakes has that I thought I had invented on my own (i.e. shorthand syntactical sugar for getters/setters, etc). My knowledge of parsing text was extremely limited; Cornflakes has no AST parsing, or even regular expressions for that matter. I rolled my own tokenizer (which is why it's so dang buggy) simply because I didn't know what other tools were out there; but I like to look back on this project as something I can see how much progress I've made in my own knowledge and understanding. Maybe some day I'll do it again properly.
Everything below is from the original README. Enjoy!
A powerful yet simple JVM language with a compiler written in Java.
While I was writing the basics for the compiler, I took a moment to think about what I should name the language. I had this song stuck in my head, written by comedian and rapper Michael Dapaah, or Big Shaq, entitled Man's Not Hot. I had this one line stuck in my head especially,
Movin' that cornflakes, Rice Krispies
I wasn't sure what to name the language, so I just decided to give it the working name Cornflakes. Eventually, it just became the final name of the project.
When Dapaah was asked about this quote, he responded with this extremely eloquent response:
Big man don’t try to incriminate me, fam, ‘cause I’m talking about cereal. Man trap on the phone and move Corn Flakes. Rice Krispies. Coco Pops. Weetabix. Man don’t try and incriminate me. FBI is watching. I’m in the States, fam. You get me? FBI, CSI, all of you man. Yeah. Flipping Jackie Chan Rush Hour 4 cops. All of you lot, fam. I’m talking about cereal, fam. It’s a cereal thing. That’s what I’m talking ‘bout. [credit Genius]
...whatever that means.
Cornflakes supports all features of Java (except for, at the time of this being written, lambda expressions). On top of this, it has several more features. These features include, but are not limited to the following:
- Operator Overloading
- Array Indexing of Objects
- Referencing of Getters and Setters like Variables
- Pointers
- Tuples
...and much, much more.
Documentation for Cornflakes syntax can be found on the repository's wiki page. Documentation for the Cornflakes standard library can be found on the JavaDoc located at the github.io page.
If you're reading this and are interested in contributing to the project, I would love to check out (pun intended) your PR's. The Cornflakes tokenizer is quite limiting due to its simplicity (see this class). It currently does not support some nice features (and necessities), such as parentheses in mathematical and boolean expressions. It also prevents the declaration of lambdas and anonymous classes, both useful additions. Creating the parsing methodology for this without rewriting much else would be ideal. I will get around to this once most language features are added, though.
Cornflakes is licensed under the MIT License.