- A machine is a thing that can do a task with no help, or not much help, from a person.
- A language is a vocabulary and rules for what a string of words might mean to a person or a machine that hears them.
- To define a word is to tell what it means. When you defined a word, you add it to your vocabulary and to the vocabulary of each person who hears you. Then you can use the word.
- To program is to make up a list of things to do and choices to make, to be done be a computer. Such a list is called a program.
- A programming language is a language that we can use to tell a computer program what to do.
- Should a programming language be small or large? A small programming language might take but a short time to learn. A large programming language may take a long, long time to learn, but then it is less hard to use, for we then have a lot of words at hand--or, I should say, at the tips of our tongues--to use at the drop of a hat. If we start with a small language, then in most cases we can not say much at the start. We must first define more words; then we can speak of the main thing that is on our mind.
- A primitive is a word for which we can take it for granted that we all know what it means.
- We have to do this a lot [define things] when we write real computer programs: a thought that seems like a primitive in our minds turns out not to be a primitive in a programming languages, and in each new program we must define it once more.
- A design is a plan for how to build a thing. To design is to build a thing in one's mind but not yet in the real world--or, better yet, to plan how the real thing can be built.
- A language as large as C++ could not have spread so wide if it had been foisted on the world all at once. It would have been too hard to port.
- The gist of it is that the best way to get a language used by many persons is not to design and build "The Right Thing", because that will take too long. In a race, a small language with warts will beat a well designed language because users will not wait for the right thing; they will use the language that is quick and cheap, and put up with the warts. Once a small language fills a niche, it is hard to take its place.
- A small language just won't cut it.
- So a small language can not do the job right and a large language takes too long to get off the ground.
- I said that users will not wait for "The Right Thing", but will use what comes first and put up with the warts. But--users will not put up with the warts for all time. It is not long till they scream and moan and beg for changes. The small language will grow. The warts will be shaved off or patched.
- If one person does all the work, then growth will be slow. But if one lets the users help do the work, growth can be quick.
- A main goal in designing a language should be to plan for growth. The language must start small, and the language must grow as the set of users grows.
- There are two kinds of growth in a language. One can change the vocabulary, or one can change the rules that say what a string of words means.
- A library is a vocabulary designed to be added to a programming language to make the vocabulary of the programming language larger.
- The key point is that the new words defined by a library should look just like primitives of the languages.
- The existence of a master plan alienates the users. After all, the very existence of a master plan means, be definition, that the members of the community can have little impact on the future shape of their community, because most of the important decisions have already been made.
- A pattern should give hints or clues as to when and where it sis best put to use.
- It is good to design a thing, but it can be far better (and far harder) to design a pattern. Best of all is to know when to use a pattern.
- A word is said to be overloaded if it is made to mean two or more things and the hearer has to choose the meaning based on the rest of what is said.
- Some parts of the programming vocabulary are fit for all programmers to use, but other parts are just for their own niches. It would not be fair to weight down all programmers with the need to have or to learn all the words for all niche users.
- Meta means that you step back from your own place. What you used to do is now what you see. What you were is now what you act on. Verbs turn to nouns. What you used to think of as a pattern is now treated as a thing to put in the slot of an other pattern. A meta foo is a foo in whose slots you can put foos.
- In a way, a language design of the old school is a pattern for programs. But now we need to "go meta". We should now think of a language design as a pattern for language designs, a tool for making more tools of the same kind.
- This is the nub of what I want to say. A language design can no longer be a thing. It must be a pattern--a pattern for growth--a pattern for growing the pattern for defining the patterns that programmers can use for their real work and their main goal.
- My point is that a good programmer in these times does not just write programs. A good programmer builds a working vocabulary. In other words, a good programmer does language design, though not from scratch, but by building on the frame of a base language.
- Language design is not at all the same kind of work it was thirty years ago, or twenty years ago. Back then, you could set out to design a whole language and then build it by yourself, or with a small team, because it was small and because what you would then do with it was small.
- If you design a big language all at once and then try to build it all at once, you will fail.
- Parts of the language must be designed to help the task of growth. A good set of types, ways for a user to define new types, to add new words and new rules to the language, to define and use all sorts of patterns--all these are needed.
- Some warts are not bad things you put in, but good things you leave out.
20170908
Growing a Language by Guy Steele
Growing a Language
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment