Programming Languages
Why did we move from punch cards to programming languages? What does that tell you about the purpose of programming language?
If you made a mistake on a punch card, you will need to re-punch the whole code on a new punch card, which is very cumbersome. Punch cards are also hard and time consuming to read. This tells me that programming languages are supposed to aid us in the code-writing process, allowing us to make as many changes and trials as possible to produce an efficient code.
There are hundreds of different programming languages out there. Why do you think we need so many?
Each programming languages has their own area of expertise. For example, Python is good for "rapid development", C++ performs in "performance-critical applications and systems programming", and Java is good for "robustness and platform independence". Additionally, a programming language is similar to speaking languages (English, Spanish, Arabic): they evolve over time. Programming languages may evolve to become easier to use. There are also a variety of computers created by people, and these different computers need to be programmed by different programming languages base on their functions.
What are some drawbacks of a programming language you use? How would you like it to be different?
I am currently learning how to use Python in my 15-112 course. One drawback in Python that I found is that it cannot round ".5" numbers properly. round(3.5) will output 4, while round(2.5) will output 2. Python also has this weird thing when dealing with floating numbers. 0.1 + 0.2 does not equal to 0.3 in Python. I would like Python to be able to round properly and handle float operations.
If you were going to create a new programming language, how would you start? What do you need to define?
According to GitHub, if I were to create a new programming language, I would need to define the grammar of the language, build the front-end complier for the source code, and build the back-end code generator. Defining the grammar of a programming language is creating "synthetic rules that programmers will have to respect" (Pietro, 2019) when using your language. The front-end complier "is a piece of software that takes the source code and produces some weird looking data structure" (Pietro, 2019). The back-end code generator "is another piece of software that takes whatever was produced by the front-end and creates a code that can actually run" (Pietro, 2019).
Citations
Pandey, Abhinn. “Python Vs. C++ Vs. Java: Choosing the Right Language for Your Project.” Medium, 19 June 2023, abhinnpandey.medium.com/python-vs-c-vs-java-choosing-the-right-language-for-your-project-31947682a1fd#:~:text=Choosing%20the%20right%20programming%20language,offers%20robustness%20and%20platform%20independence. (Accessed 7 September, 2024).
Pietro. “How to Build a New Programming Language.” Compilers, 1 Oct. 2019, pgrandinetti.github.io/compilers/page/how-to-build-a-new-programming-language. (Accessed 7 September, 2024).