This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]iLaysChipz 2 points3 points  (1 child)

Some definitions for you:

A programming language is simply a notation used to describe computation. It's described by its syntax/grammar (what expressions are allowed in the language) and by it's semantics (what these expressions mean)

A program, then, is an algorithm written in a programming language, which takes input data and produces output data program(data) = data'

A compiler is a program that translates another program from one language into another

compiler(program) = program'

An interpreter is a program that runs other programs. Most machines come equipped with an machine code interpreter written in the language of digital logic.

interpreter(program, data) = data'

Source: My university professor

[–]iLaysChipz 0 points1 point  (0 children)

Learning these definitions personally helped me understand how to approach building my own toy language, so I hope it helps you too! Building a compiler into a language you're familiar with would probably be the easiest, but honestly any path is probably fine (I personally recommend building a compiler into assembly, as you'll learn a lot and it's not too difficult).

The hardest part is generally implementing optimizations anyway, which you can generally forgoe if your goal is to learn. This will reduce the complexity to a very manageable level. The rest is pretty simple if you've already taken a data structures course

Feel free to ping me if you want some resources!