+ 5

How do you make your own programming language?

How do you make your own programming language? Do you just learn binary or is there more to it?

27th Mar 2017, 5:34 AM
Josh Urbanski
Josh Urbanski - avatar
5 Answers
+ 7
Making the programming language isn't the hard part. That's just where you define the rules for your language, and you can do that without doing any programming or even touching your computer at all. The hard part is actually making the thing that'll let you put your new language to use; i.e. a compiler/interpreter. Compiler design is advanced enough that colleges (or at least my college) have entire courses on the subject. Even then, you won't learn everything about compilers, and you certainly won't learn how to make a compiler from the ground up. Interpreters are a little different in that they convert code to machine instructions one at a time, though the principle is mostly the same. If you want to learn, I suggest you study compiler design with C and assembly. If you're familiar with C++ or Java, C isn't too difficult, but assembly code is a whole different ball game entirely. If you plan on going through with this, grab a cup of coffee and be prepared to jot down a lot of notes.
27th Mar 2017, 6:17 AM
DaemonThread
DaemonThread - avatar
+ 3
Ask yourself a few questions about the programming language you plan to make. Is it a procedural language, or is it object-oriented? What is your language intended for? Is it case-sensitive? How are variables declared? Is it strongly or dynamically typed? How is memory managed? What libraries should it include? How do type conversions work? etc. At this point, you're just coming up with ideas and a design philosophy, which is how a programming language is born. However, the language will only become usable on your computer when you program the compiler/interpreter.
27th Mar 2017, 6:44 AM
DaemonThread
DaemonThread - avatar
+ 2
Will you elaborate on this part please? "Making the programming language isn't the hard part. That's just where you define the rules for your language, and you can do that without doing any programming or even touching your computer at all."
27th Mar 2017, 6:21 AM
Josh Urbanski
Josh Urbanski - avatar
+ 2
So I have to program the compiler or interpreter to follow the rules I want it to for whatever kind of language I am trying to create?
27th Mar 2017, 6:47 AM
Josh Urbanski
Josh Urbanski - avatar
+ 2
Learn assembly code then create a compiler from your language to assembly
28th Mar 2017, 12:22 AM
Logan New
Logan New - avatar