An open API service indexing awesome lists of open source software.

https://github.com/hackclub/easel

Learn how to write a programming language from scratch!
https://github.com/hackclub/easel

Last synced: 12 months ago
JSON representation

Learn how to write a programming language from scratch!

Awesome Lists containing this project

README

          

From now until the end of the school year (June 29), we're running a [programming language jam](https://langjam.hackclub.com), where you'll have the chance to win a signed copy of [Crafting Interpreters](https://craftinginterpreters.com/).

The gist: write a programming language → record a demo video and write a quick guide on how to get up and running with your programming language (including build instructions, if any!) → open a PR with a link to your repo containing these three things and your name, [#ship](https://hackclub.slack.com/archives/C0M8PUPU6) a demo on [Slack](https://hackclub.com/slack). Submission forms for the jam will open separately on June 29.

Check out [#building-programming-languages](https://app.slack.com/client/T0266FRGM/C06T22ZFQGP) on the Slack to hang out with fellow teenagers hacking on programming languages.

## Step zero: learn how to write a programming language!

**What if you don't know how to write a programming language?** Never fear, Orpheus the dinosaur to the rescue! We've written a guide on writing a programming language from scratch that'll teach you how to write a programming language called [Easel](https://easel.hackclub.com):

https://github.com/hackclub/easel/assets/59099858/9580bc79-933c-4c4d-b5f9-221af9adab2b

By the end of it, you'll have written a programming language and learned about how tree-walk interpreters work! Give it a spin at [https://easel.hackclub.com](https://easel.hackclub.com).

## Step one: write your programming language!

Here's the biggest part of the criteria:

- Minimally, should have the following features: variables, looping (think: for/while loops), conditional branching (think: if/else statements) and some form of recursion (think: functions). _Why? These are what make a programming language [Turing-complete](https://stackoverflow.com/questions/7284/what-is-turing-complete)_.

That's it! During the jam, the [community](https://hackclub.com/slack) will vote on what language does the following the best, including:

- Creativity and silliness!
- Bonus points if you explain your implementation.

And the top three will get a hard copy of [Crafting Interpreters](https://craftinginterpreters.com/) while we're running our programming jam!

Read more about the criteria on [langjam.hackclub.com](https://langjam.hackclub.com).

## Step two: record a demo!

Record a demo of your programming language in action, for example using [Asciinema](https://asciinema.org/). Instructions can be found [here](https://docs.asciinema.org/getting-started/) for how to install Asciinema and then record your terminal with it. After you've got a recording of you running your programming language, grab the Asciinema link, which will look something like [https://asciinema.org/a/590145](https://asciinema.org/a/590145).

If you don't want to use Asciinema, that's perfectly fine! Check out [@Amin](https://hackclub.slack.com/team/U04PW2V355M)'s [programming lang](https://github.com/duckulus/minesketch) in Minecraft:

https://github.com/Duckulus/minesketch/assets/76813487/9075c54e-0dd9-4aa5-a6d1-a2f63ee824e3

Hopefully that gives you some crazy ideas.

## Step three: open a PR!

Open a PR by heading over to Pull requests and opening a PR. Your PR should have the following:

- [ ] A link to your repo, which should have an `examples` folder with at least one example other people can run and a README that describes how to build and run your repo and an explanation of the syntax and what makes it special.
- [ ] A copy of your repo inside a folder inside `languages`.

A good example to take a look at is [Arson](https://github.com/hackclub/easel/tree/main/languages/arson).

## Step four: get your stuff in the mail!

This one's easy. Wait for your stuff to come in the mail!