Christmas reading list and writing tips
Our two weeks of vacation are now over, two weeks of family celebration, and while I was playing video games, my husband was upstair working on C³ as always. Since last time, I continue to insist that he should start writing a description of the project. I believe this process will give his vision a much more precise shape. Two difficulties arose from this: words and scope.
I have this great concept in mind but have no idea if it has a name or if I just invented it!
When starting to write things down, Alex had to find the correct vocabulary to describe what he had in mind. The problem is, there aren’t always words for the concepts he wants to express. Or maybe there is, and he just doesn’t know? Or even worst, sometimes in the world of language designers, the same word have been used to describe different concepts, but he needs one for each of them. He ended up reading tons of papers on programming language, watching conference videos, reading presentation slides, and searching in the dictionary. At some point he may have to invent his own vocabulary, and try to keep away from weird terms such as in Algol-68 (my favorite algol invented term is “incestuous union”, isn’t it amazing?)
I don’t think he found all the answers he was searching for, but he sure made a lot of discoveries that are shaping C³ into something even better. I asked him for a bunch of interesting links so that I can read them myself, and share them with my dear readers. Here they are:
- SSA is functionnal programming, an interesting but complex article he found via the site of LLVM. Some of the ideas I talked about in Ancestor of C³ are inspired from this text (about the unification of imperative and functional programming).
- The power of abstraction, a keynote by Barbara Liskov, my new model in life. She is just so brilliant and proves that programming language designers don’t have to wear the beard! To me, she is the example of how intelligence, experience, humility and wisdom make a great person.
- On Understanding Data Abstraction, Revisited, a great vulgarization of various concepts, especially the difference between abstract data types and objects by William R. Cook. Don’t miss the commentaries on lambda the ultimate.
- On understanding types, data abstraction, and polymorphism, the original article that inspired the “Revisited” one. It contains a very good explanation of polymorphism.
- We had lots of fun reading Go vs Brand X which reminded us how important it is to pay respect to our predecessors.
- Java in its early days, interesting to look where it was in 1996 and how it evolved from there.
- Supercompilation an interesting optimization method but on which most of the information is in language we don’t understand.
- X86 calling conventions on Wikipedia. But also the history of calling conventions Part 1, Part 2, Part 3, Part 4, Part 5 on “The Old New Thing”, a very good blog on Win32 programming. Raymond Chen also have a book based on the content of the blog.
- IO and monads in Haskell Alex’s interest in functional programming language is growing lately. Don’t worry, you won’t need to understand monads to code in C³!
- Scala, I started hearing about this one recently on stackoverflow, Alex says it may be the closest sibling C³ may have due to its ability to scale (hence the name).
- The C standard, this reading is a funny one, because at work, Alex have a reputation to know the C++ standard by heart. I’m joking, he didn’t actually read the whole thing, but that doesn’t change what his reputation is!
- Development of the C language history of the ancestors of C³ is always an interesting thing.
- Types and programming language the next generation a good summary of the research that have been done in the field and where we are now. My husband is also thinking about buying a book from the same author, Benjamin C. Pierce.
- The next 700 programming languages written in 1966, but still actual. It describes the ancestor of ML, a well known functional language that later led to the development of Caml, OCaml and F#.
- Scripting: Higher Level Programming for the 21st century a recurring suggested reading from the guy that created TCL. He discusses the difference between scripting and system programming.
- The next mainstream programming language: A game developer’s perspective, written by the CTO of Epic, we especially enjoyed this one as it is very close to our own experience and put into words, things we had in mind. Still, I’m questioning the font choice.
If you have suggestions, either texts or videos, that my husband and I should read or watch, please post them in the commentaries!
How precise should I make this documentation?
Is is very hard to define the exact scope of a first draft documentation for such a large scale project. Code is documentation, the most precise documentation you can hope for, but it is filled with unnecessary details and doesn’t focus on the big picture, so we need words (and/or drawings) to do that. How detailed should the description be and how much should it cover? What is the language syntax, how it works underneath, how it integrates itself with the tools, how it changes the world? He is far from complete in the process of writing so I figure I would write some tips to help him out, tips that could apply for any large scale architecture project.
We have to go back to the goal of this process: refine and clarify the vision. Get down and try to express in words the main aspects of the project, especially everything that makes C³ distinct from its predecessors. What is C³? How does it work? How is it used? But especially, what does make it special?
Having a vision is the starting point, one cannot refine nor clarify what doesn’t exist. Alex has lots of ideas about his project, but he needs to narrow them down to what is really important. This can take the form of vision statements. This method usually have the reputation of a marketing/manager thing but actually, the main goal of these statements is to provide a decision making tool. Testing new ideas against the vision statements allow to see more easily if they are in the right track or not. Since the beginning we have used the three words “flexibility, performance, control” to test lots of the concepts. They have been very useful but is also proved too vague to really lead in the right direction. Many other programming languages could claim to answer to them, while we feel those languages don’t go as far as we aim. I feel that an improved vision statement could probably be a refined version over what we have already been using.
No matter how clear are the ideas, start writing now. Different audiences require different documentation, but we need to be able to write for ourselves before writing for others. Being completely accurate is important when writing for others, but not when writing for yourself. Let the words flow, draw diagrams with tons of overlapping arrows, read ourselves back after a good night of sleep, thrash, re-write, fill the gaps, and start writing again. I believe we will then find our ideas evolving faster than if we had kept them inside our mind.
Priority in writing documentation should be set as in any projects, start with what is the most risky and what gives you the most added value. Describing the little details of something that already exist elsewhere is surely easier, but won’t give you much in return. Efforts have to be put on both the unknown and the major innovations, and they are often intertwined.
Early in the development, better start with the big picture, and refine each section in the next iteration. For this, structure is the key. The exercise of structuring the documentation might have an influence on how you will structure the implementation later on, and it might be easier to do this with words than code. Breaking down the project in parts, then breaking each of these into smaller items will help you find out what is already defined, and what is not. We have never done anything like C³ before, very few have come anywhere close, and so it is very hard to describe and evaluate the project. But if we split it into smaller items, chances are that many of those elements are similar to things that we have encountered before and therefore are easier to describe and represent less risk. Then we can get a better view at the unknown, split in smaller sized pockets, more manageable this way.
How to know what is important to describe in the “how does it work?” section? Before anything else, we need a good conceptual model¹, or in other words, how the system needs to be understood from the outside. This description does not need to be complex and exhaustive. On the contrary, the simpler, the better. The code shall be the deep description of how it works inside, the conceptual model is used to get in touch with the actual goal: that C³ be used by actual people. Talking about this, my husband suggested that he should start writing use-cases, I believe this is the right track.
Back to the pillow talking
I love staying in bed in the morning, and talk with my husband for hours, programming language design being our favorite conversation subject. So two weeks of vacation gave us much more opportunity to do this than usual. He was thrilled with the unification of static and dynamic polymorphism, but now he feels that the unification of imperative and functional programming has even more potential. I love to see him as excited as he is about those things, and all this reading and writing is stimulating even more.
¹ I’m borrowing the term “conceptual model” from “Design of Everyday Things” by Donald A. Norman. The author describes how important it is for the user to have a mental model of how things work inside in order to use them correctly. I deeply recommend this book even if it is more than 20 years old!
January 9th, 2010 at 6:28 am
I like very much the last document: “The next mainstream programming language: A game developer’s perspective”.
I wonder, which are the most time-consuming issues you encounter in your work? Where I was before, the worse were always race conditions bugs because it’s very had to make them reproducible, they almost appear at random and sometime only corrupt other things that have an impact only later.
January 21st, 2010 at 2:20 pm
You’re right, multi-threading is hard with C and C++. But my hope is that with higher level building blocks, we’ll be able to avoid the main problems in multi-core computing: dead locks and race conditions.
January 21st, 2010 at 7:55 pm
Since I got out of school, I have been working on two types of projects, PC/Mac projects, and consoles projects, they bring very different types of problems. Programming for specific hardware makes is a lot easier as your application is the only thing going on in the machine.
On console, especially on PS2, memory fragmentation problem was one of our worst case, which is why I am such a freak about memory management control.
When taking a console application to PC, you are right that race condition becomes a nightmare. Too many engine are frame base instead of time base, assuming that nothing get ever interrupted. Physis engines just seem to have this tendency to break because it assumed so. With time and experience, my team became quite good at this, and lately it was less of a pain to fix those problems than it used to be when I started. We learned a lot from this, I hope it will show in the language design.
But there is another time consuming thing that we never became good at solving: compiler bug. We don’t have the code of the compiler, closed or just obfuscated with complexity, so we are forced to make guesses instead of logic investigation. Making the compiler bug free is one nice wish but I believe the programmer can become better by having access and more control on the different layers of his compiler.
My expectation are high aren’t they! ^_^
February 1st, 2010 at 7:55 am
Hi C3wife,
I’m very curious why my paper is “a great vulgarization of various concepts”. I’m not saying that it isn’t, I’m just curious why he thinks that. Matthias Felleisen said something similar about it, but most people think it’s about purifying concepts, not vulgarizing them. Also, I’d be happy to explain supercompilation to him if he wants to know more about it.
February 6th, 2010 at 10:59 pm
I’m not sure if we used the term “vulgarization” correctly. English is not our first language. In French, “vulgarisation” is simply teaching to the uninitiated. I think that there is a lack of good “vulgarisation” in programming language theory and that your article was a breath of fresh air.
Before reading the article, I had the vague intuition that it would be useful to separate data types from object classes in my language instead of conflating them as in C++. It is indeed the purified concepts presented in the article that helped me solidify my intuition into a good understanding of what that implied.
From the article itself and from comments on Lambda the Ultimate, it seems that those concepts are well understood by the programming language theorists but not by most programmers. I think that the article is written in a clear style that makes it easy to understand for programmers without mathematical backgrounds.
February 7th, 2010 at 9:50 am
My husband is probably right, my limited knowledge in english led me to misinterpret the meaning “vulgarisation”. I remember well the night where he told me about your paper. “You know what I was trying to explain you last week but couldn’t find the words? Well this guy is explaining it just right!”, again, this is a rough translation.
February 8th, 2010 at 10:39 am
Ahh.. ok. Thank you for the explanation. I have studied French quite a bit, so I understand what you mean. I mentioned you on my blog (http://wcook.blogspot.com ), and my offer about supercompilation still stands. Also, if you are reading about metaprogramming, you should also study partial evaluation. If you want to get together and talk sometime, let me know.