4 ms·
The main problem with more and more abstract forms of describing "what you want" instead of "what the computer should do" is that the program still needs to run
by WJW 4y ago
The main problem with more and more abstract forms of describing "what you want" instead of "what the computer should do" is that the program still needs to run on a computer, and those are inherently non-abstract. There is no duck typing on the CPU level and figuring out what exactly you passed as an argument takes up a lot of time.
Don't get me wrong, I love me some Ruby and it makes up the majority of my income. But it would be foolish to ignore that it is indeed 100x slower (or more sometimes!) than some of the modern compiled languages. Small to medium web applications are exactly the sweet spot for Ruby because network latency hides a lot of the language slowness. Nobody cares about 20 extra milliseconds for a request to a server 100 ms away, but a lot of people care about 20 milliseconds delay in frame rendering.
EDIT: The following:
> What I actually want is a new programming language/environment which makes Ruby look like programming pointer arithmetic in C by comparison. Something so advanced, so high level, that much of the time you're really just describing patterns and flows and data models and extensions, and then letting the computer determine the most efficient way to develop those code paths and execute them.
sounds exactly how I feel when programming in Haskell, although that particular language will probably not sit well with you if you absolutely want duck typing.
- commandlinefan 4y ago> describing "what you want" instead of "what the computer should do" Actually, static typing is describing "what you want" and leaving it up the compiler to make sure you were consistent.
- samatman 4y agoProlog, and SQLite dialect of SQL, are both declarative and dynamically typed. Static typing is neither necessary nor sufficient here, the gradient from declarative to imperative is largely orthogonal.