Programming Languages

Why did we move from punch cards to programming languages? What does that tell you about the purpose of programming languages?

Punch cards could only store a limited amount of data and thus hundreds of them were required to store computer programs, which was a waste of time and space. These punch cards are also prone to misuse (being damaged or lost) which leads to loss of data. To make the programming experience much more easier, programming languages were used as a means to abstract this process of converting high-level code to machine readable code.

There are hundreds of different programming languages out there. Why do you think we need so many?

Each programming language fulfills its own set of requirements for a particular niche. For example, C and C++ are mainly used for high-performance applications like low level compilers, microcontrollers, etc. while Python is used in data science, AI, etc. They all different use cases which couldn’t be done using just a single programming language.

What are some drawbacks of a programming language you use? How would you like it to be different? Think of specific examples.

Python is a very slow due to it being an interpreted language natively. There are methods to compile Python code which makes it faster, but it cannot compare to the speeds of C or C++ code. It is also a dynamically typed language which makes any typing errors much harder to debug.

If you were going to create a new programming language, how would you start? What do you need to define?

I would do some research first on the terminology surrounding programming language development. Then I would ask myself “What purpose do I want this language to fulfill?”, then base my feature-set on that. I’d define the key parts that make up a programming language (dynamically or statically typed, interpreted or compiled, reserved keywords, main entry point, memory model, garbage collection, etc.). Then I would start creating the syntax by using a lexer and a parser to create an abstract syntax tree. Then I would use this AST to create IR code using a linker (LLVM). Then I would create a compiler to convert this IR code into machine code and then run it.

Resources