4 ms·
Reminds me of the "no free lunch" theorem from ML. To paraphrase, there is no language that is better than every other language on all tasks. https://en.wikipe
by visarga 9y ago
Reminds me of the "no free lunch" theorem from ML. To paraphrase, there is no language that is better than every other language on all tasks.
https://en.wikipedia.org/wiki/No_free_lunch_theorem https://en.wikipedia.org/wiki/No_free_lunch_theorem
- TuringTest 9y agoAs a corollary, if you're using a general purpose language, there will always exist some domain where a Domain Specific Language will be equal or better.
- TeMPOraL 9y agoI view this as shifting complexity around. All Turing-complete languages are essentially equivalent, and there is some essential minimum complexity in any computation you'd like to describe. Any given language we use makes trade-offs, which cause some programs to be expressed simply in it, but the cost is that some other programs will become much more complex to express in it.
- TuringTest 9y agoMaybe, but comp-sci does not study all possible programs with equal probability. A notation should be optimized for the kind of problems that are more often studied, and make expressing those easier. If this pushes complexity towards the expression of randomly generated programs, that's a good thing (except for the few guys that study randomly generated programs, that is).
- TeMPOraL 9y agoYes. This is the general mental model I use when explaining that the design goal of a good general-purpose language is to shift the complexity to the areas almost no one will care about. Also your corollary from a sibling comment can be restated as saying that you can get extra simplicity for a particular task by designing DSL that will shift complexity to outside of its domain.
- tormeh 9y ago... which is why a certain class of programs is most elegantly described in brainfuck? Certainly there are tradeoffs to be made, but this does not mean that some languages are not simply better than others.
- TeMPOraL 9y ago> ... which is why a certain class of programs is most elegantly described in brainfuck? Possibly, though for sure those aren't programs you'd usually want to write. The key phrase of my comment was "essential complexity". You can pile up extra complexity that's not helping anything, but assuming you got rid of it, all you can do to make things easier is to shift the remaining complexity around the problem space.
- tormeh 9y agoI'd argue that no language in existence is even remotely close to having no extra complexity.
- tomp 9y agoThat obviously applies to all domains of life, but when it's actually said out loud, it's most often a cop-out. It's very improbably that the current-era languages are at (or anywhere near) the local optima of their respective niches. Sure, you don't want to issue database queries in C++ or write a high-frequency trading engine in JavaScript, but there's still a lot of progress being made, and to be made on every front of programming language development (syntax, type systems, semantics, libraries, compilation strategies, memory/resource management, ...).
- jasode 9y ago>improbably that the current-era languages are at (or anywhere near) the local optima of their respective niches. Your statement is true (e.g. Javascript/C++/etc syntax is suboptimal and could be better). However it's a separate concept from what grandparent posters' grabcocque and visarga are talking about. If we engage with their point, it's not a "cop-out" but stating an important fundamental truth about the syntax of all programming languages. Many beginners do not know this truth as can be seen by the following questions in the wild: - Why can't there be an “universal” programming language that serves all purposes? : https://softwareengineering.stackexchange.com/questions/4889/why-cant-there-be-an-universal-programming-language-that-serves-all-purposes https://softwareengineering.stackexchange.com/questions/4889... - ELI5: Why isn't there a universal programming language? : https://www.reddit.com/r/explainlikeimfive/comments/j2v84/eli5_why_isnt_there_a_universal_programming/ https://www.reddit.com/r/explainlikeimfive/comments/j2v84/el... - Why are there so many programming languages? : https://stackoverflow.com/questions/4334954/why-are-there-so-many-programming-languages https://stackoverflow.com/questions/4334954/why-are-there-so... - Why there are so many programming languages? Can't we create one language to do everything? : https://www.quora.com/Why-there-are-so-many-programming-languages-Cant-we-create-one-language-to-do-everything-It-would-just-be-easier-right https://www.quora.com/Why-there-are-so-many-programming-lang... The top voted answers in each case tries to explain it using analogies. (e.g. hammer is wrong tool for driving screws, etc). However, I'm not sure they actually provide the insight needed to make the questioner understand that creating the "One Universal Programming Language" is mathematically impossible. It's not possible to express multiple disparate concepts using finite characters with minimum string length for ease of typing and reading. All desirable concepts cannot simultaneously share the same minimal syntax for convenience. (This impossibility is also not solved by splitting concepts via language-vs-library as in "language reserved keywords" vs "library function calls".) (As an educational exercise, we could ask the questioner to try to invent a "One Universal Programming Language". He would soon run into contradictions rooted in trying to express multiple concepts via finite symbols. Eventually of those concepts he desires will end up being encoded with noisier and inconvenient syntax.)
- sampo 9y ago> https://en.wikipedia.org/wiki/No_free_lunch_theorem https://en.wikipedia.org/wiki/No_free_lunch_theorem This is a very theoretical result that people often overinterpret bease it has a catchy name. But it has no relevance for real world data.
- DonbunEf7 9y agoNo Free Lunch is very real, and occurs in many different guises under different masks. Here is an example constructive instantiation of No Free Lunch: https://blog.acolyer.org/2017/09/12/universal-adversarial-perturbations/ https://blog.acolyer.org/2017/09/12/universal-adversarial-pe...
- sampo 9y agoThat article doesn't mention no free lunch at all. Also, they're just calculating small perturbations that send the classifier over decision boundaries.
- stcredzero 9y agoAs I noted below, it could be argued that x86-64 is a universal programming language that currently serves all purposes across a very wide swath of all computation, modulo a number of interpreters, compilers, and VMs. (Even that doesn't take care of literally all, however.) So maybe there's no free lunch, but you can get lunch for a "coupon" in the form of a compiler or interpreter, which for many is close enough to free.
- carapace 9y agoAll Turing-Complete languages are universal. No Turing-Complete language is best for all problems. (That's why CPUs get GPUs, for example.)
- stcredzero 9y agoAll Turing-Complete languages are universal. No Turing-Complete language is best for all problems. But that doesn't mean they are or are not "fit for purpose." That brings in a lot of subjective and human factors.