Inspiration

We were inspired by esoteric languages such as Brainfuck, and by exotic syntax like that of Common Lisp, to invent a language that would cause its user to develop a debilitating headache after 10 minutes of coding.

What it does

Pa!n is an interpreted programming language with one major caveat; it maps all operators to capital letters in the alphabet, and then rotates the alphabet one position left every time an operator is used. As an example, if one wishes to add numbers multiple times, first they would have to use 'A' (assuming no operators were used beforehand), then 'B', then 'C', etc. This creates a uniquely challenging programming experience, as the programmer has to keep track of the current offset, and adding/removing preceding lines of code ensures one has to modify all lines after it. Also, we inverted brackets so that ')' is instead an opening bracket, just to cause even more pa!n.

How we built it

We decided to start development in Python, because prototyping in Python is simple compared to other languages. To create pa!n, we began by concurrently developing an expression tree module, and a tokenizer/parser module. This allowed for faster development as each person focused on one part only. The two sides were then combined, so that the parser read a script and returned a complete expression tree.

Challenges we ran into

Designing a text parser is incredibly difficult since there are many avenues for bugs and corner cases, and computers don't have the luxury of language processing and natural big picture thinking like humans do. As such, the parser we have been able to create in 1 1/2 days is very rudimentary, with little to no error handling. Also, while Python is very powerful for development, it comes with its own challenges. For instance, assignment to a list index would be most efficiently implemented with a generic reference to a mutable object. However, many objects in Python are immutable, such as integers. Thus, a list would need an explicit reference type that holds the list and the index. This became a limitation, and is why we don't have lists yet.

Accomplishments that we're proud of

We are proud of the fact that we were able to come together and design a real programming language from scratch in 1 1/2 days. While parsing is flimsy and the language lacks many features, it makes for a foundation that opens a plethora of possibilities, and serves as a learning experience for everybody involved.

What we learned

A major lesson from this is that error handling at the very beginning may be annoying, but it pays off in the end. This is because we designed the parser with the idea that error handling would be added later. The only problem is, now we're left with a parser that throws exceptions at so much as a missed bracket, and adding error handling in the time we had left was a daunting task, since it would require a whole new framework to catch and display the errors.

What's next for pa!n

After this event, we will continue to develop the language and redesign the parser. Porting to C/C++ is the next logical step, for faster processing and detachment from Python's already high level libraries, and maybe even evolution into an actual practical language.

Built with love by birb#2137 ICBk#5208 syrbor#1686 Find us on Discord!

Built With

Share this project:

Updates