Uri Guttman presents some questions: > > first off, why are there so many languages? and by many, i mean > thousands and more. how many of you have invented a language (even a > mini-lang)?
I have a rather unusual view here, that any parsed format constitutes a "language". Thus, /etc/passwd is just as much a programming language as /bin/sh or C. This view is surely somewhat inspired by LISP/Scheme, but I find it useful to take it further. This view makes it possible to see programs as being instructed by their data to take specific actions, much as one sees a kernel/cpu/api as being instructed by language code to take specific actions. Thus one becomes inclined to consider every little data format or configuration file format in ways one would think about a programming language, "Does this format permit strong typing? Does it permit static analysis? Should it include flow control and/or math operations?" And so forth. So, I would suggest that nearly everyone has invented a language and run into some "language design" issues. There is no great difference between belatedly realizing that "," is a problematic syntax character if your data may include ",", thus leading to the "invention" of an escaping, encoding or quoting mechanism to permit "," to safely appear in data; and similarly realizing that a language with a lot of keywords is going to step on names that a programmer is free to choose for their own symbol names. Many other problems inherent in decisions or tradeoffs between options are more subtle. One can run into them directly by attempting to implement a language that has incompatible features -- and the attempts of naïf developers lead to the creation of many languages -- or one can eventually realize what they are by observing various languages and understanding how they are implemented. (For example, there is a design tradeoff behind Java's immutable String objects. It is easy to not appreciate this and to attempt to write a Java-like language which permits C-like string operations, but one will eventually run into issues, and have to make choices that lead to "surprising" additional differences from Java in the resulting language.) But this is not directly why there are so many languages -- this is more why so many languages seem to have flaws and shortcomings, which then leads to there being many languages. Particularly when people design a language without knowing what implicit tradeoffs they are making, the result can include elements that can only co-exist inefficiently. (For example, Java's original Vector type.) If you want to know why there are so many programming languages, consider why there are so many text editors. I'd not because we need them. It's often not because they do something new or even something clever. I'd suggest that it's mainly because people think they can achieve something that includes incompatible features. Many developers like programming. And so they look for things to write. And there are few projects that are more interesting/challenging than that of writing a language. (As there are few projects that provide the developer with more instant and visible functional feedback than a text editor.) Once written, any language will have, by plan or by chance, something that it is good at, and people may start to use it. From that point, it's a study in memeology. I'll also say that I don't think this is really a problem. Certainly not for the people writing these languages, as they can learn a lot from the process. (They might not actually learn anything, but there's a lot of potential.) I tend to think people are better off implementing an existing language than writing a new one -- they can gain the same insights, but when they are done it's much easier to throw their version in the garbage as it's "exactly the same, only much worse" than someone else's implementation. (Incidentally, the worst recent case of a newly invented language taking over mindshare "needlessly" is PHP. Clearly, PHP users would have been willing to use Perl-like syntax. It's interesting to consider why PHP "beat" Perl into that niche.) > no one seems to have mentioned turing compatibility. this means > something deep in all the langs mentioned. discuss. I don't think it matters much -- as is flamboyantly demonstrated by my initial claim that all data is a form of instruction. A language only needs the capabilities that are needed to achieve its purpose. That begs the question you ask below -- the purpose of a language is to satisfy a specific human need. Languages are for people, not computers. If languages were for computers, we'd only have machine code and ASN.1. > what about all those langs that were meant to conquer computing > civilization? PL/I, COBOL, ALGOL and even the dreaded ADA. c actually > conquered more than all of them. do you consider c a high level > language? That's a sociological question. Why do humans feel the need to declare that this or that is true in all cases and everyone should use it / believe it / worship it / pay taxes to it / etc... That said, people use ADA and COBOL for significant projects. C didn't "beat" them any more than they "beat" anything else. Nothing ever "beats" anything (things do die off, but almost always for internal reasons not externally imposed ones -- however the etiology of real-world events are hopelessly tangled). C is a low-level language. I consider it thus because I know, to a reasonable approximation, what assembler code will be produced simply by looking at the C code. (This isn't a particularly objective answer, but it's not a particularly objective question.) > should you learn assembler? is there work in it (yes)? what would > assembler teach you when using a high level lang? Yesish. I think you should learn some assembly. Many assemblers are mired in backwards compatibility, multiple addressing modes, and other complexities that are fascinating but generally have no direct benefit on the production of higher-level algorithms. Thus I'd advocate learning Forth. If I were to pick an assembly for someone to learn for its educational effect, it would be SPARC. It would decidedly never be PPC. > what does it mean when you like or dislike a lang? in a non-technical > way why did you make that decision? I like languages that empower the programmer. That means both functionality and flexibility. Thus my favorite languages are Modula-3, D, VB.NET -- and to a lesser degree, Forth and JavaScript. Not exactly favorite in terms of "what I use", but in terms of languages I like the design of. M3, D, and VB.NET are like enormous sacks into which every conceivably compatible language concept has been thrown -- note that none of them have MI -- thus facilitating low-level coding in which the programmer can control the algorithms directly and efficiently -- and yet also including many layers of static checking, dynamic checking, templates, typing, etc... When languages get higher-level, they will make decisions outside of the programmer's control. These aren't necessarily bad decisions, but they aren't ones the programmer can change _or_ bypass without extraordinary effort. A good example of this is Perl's approach to "sort". For a long time, sort was quicksort, and there was nothing reasonable the programmer could do about it -- not directly within the Perl language. This problem was significantly addressed by "use sort", but many elements of Perl (and other HLLs) remain inflexible and not efficiently avoidable. > have any of you ever read an ANSI standard for a language? or tried to > implement parts of a standard like that? hell, reading ANSI standards is > a major skill in its own right! Yes. I've read several and implemented some -- notably for Forth (DPANS94) and SQL98. (And others that aren't ANSIed or ANSI things that people don't consider languages). > are languages for people or computers? People (see above). _______________________________________________ Boston-pm mailing list [email protected] http://mail.pm.org/mailman/listinfo/boston-pm

