Author: paulmoore100
-
Working Through WACC – chapter 17 void, malloc etc
WACC is this excellent book and I am blogging my way through it. This chapter tackles dynamic memory. Once again I was surprised by the complexity. For c dynamic memory just means calling a few functions and working with the returned pointers … well we already have function calls and pointers, so hard can that…
-
Working through WACC – chapter 16 Strings
Working my way through this book This time we hit strings and char types. Once more my thought process was “how hard can this be , I know how those types work”. Once again – boy was I wrong. The big issue is that strings wear several hats And how and when these are processed,…
-
How a 2mhz , 1mb RAM system ran a whole company in the 70s.
I started my sw career on mainframes in the 70s. The pictures I have included are snapshots of that era, by pure coincidence they seem to be the same system. Note the excellently fashionable clothing worn by the operators. I can confirm this was the required uniform at the time. The machines I worked on…
-
Working Through WACC – chapter 18 structs
WACC is this excellent book Oh my goodness! I expected this to be a tricky chapter but not this hard. Initializers I knew when I wrote the initializer code for arrays that it wouldn’t work for structs, so a complete rewrite for this chapter. Why, well because an array, even a multi dimensional one is…
-
Working Through WACC – chapter 15, arrays and pointer arithmetic
WACC is this excellent book and I am blogging my way though it This was by far the hardest chapter so far. This was a surprise to me since I thought I understood arrays and pointer arithmetic, and I always start each chapter out with “do I know the part of C that we are…
-
Working Through WACC – Chapter 14 , pointers
WACC is this great book: I am blogging my way through it, chapter by chapter. Major Refactoring Well first off we need to rewrite the parsing of declarations because it just got a lot more complex. I wasnt happy with my previous ‘making it up as you go along’ version – so I am happy…
-
Working Through WACC – Chapter 13 Floats
Lexer I cheated. My lexer does not use regexes, it does a character-by-character analysis. The parsing of floating point literals looked way too complicated so I used fast_float – Rust. This has a nice feature, you can ask it to parse as far as it can converting to floating point, if it finds a valid…
-
Workinig Though WACC – chapter 12, unsigned types
Easy as pie This one turned out to be pretty simple. The test suite catches all the twiddly parts. Not much else to say The only tricky bits These are covered in the text but, and this is a general observation, the text is very dense. It you speed read it you will miss very…
-
Working Through WACC – Chapter 11 , Long Integers
Now working through Part II of the excellent ‘Writing a c Compiler’ chapter 11 is called ‘Long Integers’. I was discussing this with my son-in-law who works in tech, he laughed saying that that was surely not a big change, I though so too. Boy were we wrong. Its interesting to note that at the…
-
Working Through WACC – Pause after part 1
I am blogging my way through this book:- I have reached the end of Part I and this blog post is a summary of thoughts about the progress. Summary This is a great book. Although I have diverged from some of the design details (more later) I have mainly stuck to its plan. The test…