Jump to content

How to make your own programming language?

Featured Replies

Hey, guys!
So, I've been thinking about making my own programming language that can be both interpreted and compiled and can run on web. For now, I've just made a web-app that converts arithmetic expressions to i486-compatible assembly and interprets them.
http://flatassembler.000webhostapp.com/compiler.html
So, what do you think is the next step?
I only have a vague idea of what the syntax should look like right now, I am planning to make it possible to use both S-expressions and infix notation for arithmetic expressions and only LISP-like syntax everywhere else.

"I only have a vague idea of what the syntax should look like right now ..."

That would be the place to start. First you figure out WHAT you want to build; then you figure out HOW to build it. Projects that reverse the order are doomed, since you have no basis for design decisions. You don't know what you want so you end up with something else, as they say. 

So first spec out your language. Doesn't have to be complete in every last detail, but get the broad outlines and main syntactic features nailed down on paper. Then the implementation will be far easier, since you are harnessing tools and techniques to a particular objective.

4 hours ago, FlatAssembler said:

So, what do you think is the next step?

Although it is a useful learning exercise to design and implement a new language, there are so many existing languages out there that I would try and think of a novel twist. (OK, probably not novel, but a little less common.)

For example, there is a bit of a shortage of languages that have rigorous, formally defined semantics so that it is easy to reason about the correctness of a program (if it implements a formal spec) or prove that two implementations are equivalent (e.g one that is easy to understand versus one that is optimised).

Or maybe a language with a good concurrency model (CSP?) built in.

Archived

This topic is now archived and is closed to further replies.

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.