4 ms·
Studying programming languages has the same side effects as studying AI. You have to learn some broadly applicable programming tricks to get your programs runni
by ipnon 6y ago
Studying programming languages has the same side effects as studying AI. You have to learn some broadly applicable programming tricks to get your programs running. I see closures everywhere after writing my own programming language. Someone might use backtracking in a new domain after studying AI.
- rightbyte 6y agoOne revelation I got from programming a hobby language was that many language feutures seems accidental.
- throwaway_pdp09 6y agoCould you elaborate please?
- rightbyte 6y agoIt's hard to explain but it was a feeling I got. It felt like the language fell into place on it's own when you added stuff and not in a way other code projects do. Parsing with flex/bison "naturally" converged syntax towards other languages because other languages are made so they are easy to write grammar for etc. Whether an "if(exp)" introduces a scope of is own is just down to where you happen to put the push_scope() call, and so on. I wonder how much of C that was just "that is how it happened to turn out".
- coldtea 6y agoWell, for big ideas that are not accidental you need to compare between really unique langauges. E.g. C vs Lisp vs Smalltalk vs APL vs ML/Haskell vs COBOL vs FORTH vs PROLOG
- chrisseaton 6y agoPeople add language features because they're easy to do in the implementation they already have, not because they're well-principled. Concrete example from personal experience: All objects in Ruby have a unique ID. The standard implementation of Ruby added a function to go from the ID to the object. This was easy on the standard implementation of Ruby, because the ID is just the pointer, so you can just cast it. It's a nightmare on more sophisticated implementations of Ruby where an object may not have a single canonical address that you can use as an ID, and you need to store a huge separate mapping.
- throwaway_pdp09 6y agoYeah, once you introduce moving garbage collectors that happens. I'm sure ruby isn't the first language to have made that mistake (I believe some implementations of SQL actually have similar, a reference to the row on disk, and it turned out to be a short-term gain and a long-term mistake).
- _pmf_ 6y agoWould call it "emergent" instead of "accidental".