DISCLAIMER
LLVM is not cooperating, I might be uploading commits soon so uhh if you want kind of the "latest run" of a functioning lexer and parser, run the commit that says "Parser Debugs and Symbol Table Implementation"
An actual code execution with ".crunch" will have to wait for a bit, sorry! This is not looking good for judging standards, but uhhh if you're interested please follow the repo I WILL be completing this in the next week or so (at least to a executable extent)
Inspiration
Hello World and New Scene happened at the same time. It's a bummer for most, but I wanted to do something a little funny, why not make a game and a technical project?
Yeah, and so the technical project I chose was to make a whole custom language. Genius, right? (shoutout qter, big inspiration, if only I knew Rust)
What it does
Introducing Crunch! A computer language I made solely for a video game (insanity)
Right now, it's SUPER simplified as I am still implementing crucial language syntax (like loops and my own custom data type which needs its own parsing tree).
The functionality it has now though is that you have to write really simplified math processes to get an output. Really simple, nothing much. This is supposed to be a core gameplay mechanic in my New Scene video game though, that's why it lacks in many features as of now.
Simply make a ".crunch" file, and have the compiler load it and, well, compile it. Follow the documentation, write your program, and run. You should see a numerical output of some sort (unless you printed a string literal).
How we built it
HAHAHAHAHA please help
Here is what I poured into this amalgamation of C++
- Lexer (Tokenizer)
- Grammar and AST
- Parser
- IR and other stuff
- Ignore Step 4 and use LLVM
- I will actually develop an IR, try me
- maybe later
- im already out of time
Challenges we ran into
HAHAHAHAHAHA
On a real note, making this wasn't too bad, just a LOT of file parsing and data structure run throughs.
Accomplishments that we're proud of
COMPILER DESIGN RAHHHH
I can genuinely open source this if people find this user friendly enough (or have tips)
NEW CHALLENGE LLVM is not downloading help help
What we learned
Delusion leads to success
(clearly, because you can design an ENTIRE COMPILER FRONTEND (well sure for a simple language) in 24 hours with NO PRIOR COMPILER EXPERIENCE ( I didn't even know how to use CMake before I started this (but I did know C++) ) )
((((((((wow I sure love my parentheses))) parenthesis ))))
What's next for Crunch
BUNCH of more language syntax, including my aforementioned custom data type and calculus operations.
More stuff:
- Add documentation, people/AI needs to learn how to code this thing right lololol
- Possible linear algebra integration as well?
- Crack down on the syntax and make it easier to work with
- LaTex formatting / integration for visibility
- Desmos porting??
- Developing the actual game, "Number Cruncher," which will soon feature Crunch as a gameplay mechanic
- Possible open sourcing
- Add OOP functionality? If it's necessarily
- Use my skills to develop an ACTUAL programming language
- Then use that programming language to develop my own OS
- Delusion leads to success, ammiright?
Built With
- c++
- llvm
Log in or sign up for Devpost to join the conversation.