The struggles of being forced to think about what you're coding
Posted on December, 19 2014Embarking on a project from scratch in a new environment was an interesting task. This week I was planning, and started the base for a toy assembly compiler for an instruction set I implemented not too long ago in a logisim CPU. For the futures sake, I decided instead of using the boring Python to accomplish this task, I would use C. Over the summer and beginning of this year I have been browsing around C source code for popular applications, and getting to know the standard libraries and how people use them efficiently.
Starting out was hard. I had to sit down and think how the program would read the file, and break the lines up into consumable chunks for my program to decipher. Working in a different language makes you think about how you are going to do things with the tools at hand. Unlike python, C is a simple procedural language with many different types of tools to manipulate data at a low level. The design for this program was thought out keeping in mind the way C operates.
Implementation was another task. Compiling, running and debugging is a new experience that I wish I started out in. Compared to a programming language, an interpreted language uses high-level datatypes that require a lot of effort to implement in C. Going from having a nice air conditioned house to a hut in the middle of Antarctica where all of the conveniences have been ripped out and stomped on by a large elephant. In all, it was a fun challenge and I hope what I learned this week will help me make bigger and better projects for the future.