5 ms·
It seems to me that the author is attacking the wrong problem axes. I don't think expressiveness or power are the problem here. I think the problem is lack of c
by Tloewald 11y ago
It seems to me that the author is attacking the wrong problem axes. I don't think expressiveness or power are the problem here. I think the problem is lack of clarity.
Consider the discussion of terseness. What is the best way to explain something in Englush? Long winded or terse? Wrong axis. Explain things clearly. Expressing a concept perfectly with a small number of words the listener doesn't understand is useless. Beating a dead horse is useless.
I have a huge problem with C because the same characters and keywords are reused in multiple different similar but different ways and it adds cognitive load to things that should be simple (eg declarations) -- leaving me less able to devote my limited mental faculties to the problem I am actually trying to solve. (Not singling out C, just picking a well known example.)
Languages that give you lots of redundant ways of doing things -- especially if some ways are better than others but not obviously so -- aren't more powerful, they simply harder to understand. (This is not the same as arguing for newspeak — words that are similar but not the same are useful.)
What we want is clarity. Clarity isn't simple or easy but it is exactly what we want in programming languages.
- Avshalom 11y agoYeah clarity is nice but no, sometimes we want less power. Until some one invents the sufficiently oracular compiler power often prevents various effort saving/performance boosting tricks, which is what 2/3 of the article is giving evidence of. Also: formally verifiable code and static analysis.
- nickpsecurity 11y agoThe most powerful language I know of is LISP. Guess what one of most field-proven verification tools uses and verifies? LISP via ACL2. There were also hardware kits like DDD that did correct by construction hardware from LISP specs. So, power != hard to verify. One should subset, though, for best results.
- Avshalom 11y ago>One should subset, though, for best results. ... So giving up power produces better results?
- PeCaN 11y agoNaturally, if you give up Turing completeness, you can have excellent 100% verified results. Sometimes yeah, it's easier to prove things about simpler systems.
- nickpsecurity 11y agoHard to say as nobody has pushed it to the full extent. Giving up complexity gets better results for verification. So, you use a simple subset of the powerful language. That subset might still be more powerful than many languages but a bit less powerful and complex than the original. Complexity, ease of modelling, and state explosion are the real issues in verification.
- angelbob 11y agoGiving up power makes it easier to write good tools. That's one reason that IDE support for Java is amazing, but IDE support for JavaScript isn't nearly as good - JavaScript allows and encourages way more freeform do-it-however runtime unverified stuff. Java locks everything down with a lot more "must be compile time" and static type system conventions. You can permit the dynamic stuff as an alternative (as Java more or less does.) But if people actually use it, it screws up the tools' ability to introspect into your code. As a result, less-dynamic formats like HTML and CSS get better tooling, as a rule, because the tools have an easier job to do. And highly-dynamic languages like JavaScript and Ruby have terrible tools support, because they make the tools' lives quite difficult because of their language and library design.
- spion 11y agoAs you can clearly see from your example, power is entirely different from being amendable to tooling and static analysis. This whole thing is just a false dichotomy.
- kd0amg 11y agoGuess what one of most field-proven verification tools uses and verifies? LISP via ACL2. The dialect of lisp that ACL2 verifies is not very powerful at all.
- nickpsecurity 11y agoIt can be integrated into LISP or transformed into forms of Turing complete languages. It doesn't have to be powerful to be used powerfully. :) Part of my recurring them that you can have both worlds.
- kd0amg 11y agoAny language's code can be integrated or transformed into some Turing-complete language. That doesn't make a language powerful. You don't see anyone raving about how amazing the language of variable-free arithmetic expressions is, but that's already integrated into most languages people would call "powerful." The idea that ACL2 verifies a powerful language is outright false. ACL2's verified language is stripped down (no first-class functions, nontermination, exceptions, etc.) because added power makes it too hard to verify.
- nickpsecurity 11y agoAlright I'll give you that. My main argument is for a language powerful enough for both solving problems concisely and creating DSL's should be used with DSL's for common or hard problems. The DSL's or the language can be subject to verification.
- xorcist 11y agoClarity is hard to define. You seem to argue that a simpler language such as C gives rise to more convoluted code while more complex languages such as Java can deliver more terse code. That's not always the case. Take GUIs for example. In pre-C++/Java times the user interface declaration was often data. Now it is code. Whatever data is still necessary to function, such as button texts, are now object attributes. That code can then grow functionality and that's when you get non responsive UIs and hard to debug callback spaghetti. So things are done differently in less expressive languages, but it's hard to argue it's less clear in the general sense. Another example is "application servers" and the rise of enterprise programming where object factories instantiate other objects in order to keep dependencies unidirectional. In a more simple language none of that would exist, and that particular problem would not be there to solve. But would it mean more complex, and perhaps unique, solutions elsewhere in the software? I'm not sure. Git won out over the more engineered and more complex alternatives for example.
- Tloewald 11y agoI agree that clarity is hard to define. But so is power. Is C more or less "powerful" than Java?