Most of the dynamic languages are data and instruction cache-miss machines. They chase objects and pointers all around the memory.
Most of the dynamic languages are data and instruction cache-miss machines. They chase objects and pointers all around the memory.
...That doesn't sound like a cache miss. Knowing Android, A cache miss is probably the least of your worries.
>Users may need a second to click or touch a button, but when they do the software should react instantly, and that does not leave you that many cycles.
You raise a good point...
>Most of the dynamic languages are data and instruction cache-miss machines. They chase objects and pointers all around the memory.
...and this is part of my point. If you look at a problem and think, "A high-level language is fast enough," then you are implicitly saying that the latency of a cache miss is acceptable. And IME, in most cases that's true. I mean, heck, I'm using Scheme, so while I may have pointer chases like the Amazon has trees, but I CAN optimize them into array lookups, and my code is compiled: not great, but better than most HLLs.
It's the same argument as always: perf vs. development speed. You can be in the C and FP loop, or the Lisp and JS loop.
My example was meant to illustrate the user input problem. From what I know about Android, the absymal performance is very much a case of "death from a thousand cuts".
> It's the same argument as always: perf vs. development speed. You can be in the C and FP loop, or the Lisp and JS loop.
The fast(er) languages we have are old and full of warts, and that makes them slow to develop in. The heavily used HLLs such as Python and Ruby were made by people who did not care much (at all?) about performance, and it shows in many design decisions. But here's the thing: we could have both at the same time. I don't buy this dichotomy.
That's actually not true: OO, dynamism, late binding, and a lot of the other things that HLLs have to offer require a lot of pointer chasing and non-consecutive datastructures. I'm mostly a Schemer, and Scheme and Lisp have had decades of research put into making them compile and run fast. Most dynamic languages aren't so lucky. But the required pointer chasing and garbage collection mean they'll never be as fast as C.
Functional programming languages, however, are rarely late-binding, and don't expose as much about their implementation, so some of the pointer chasing can be avoided.
Rust doesn't need a GC, and is fairly C-like - or rather, ALGOL-like and BLISS-like - with added memory safety. So with a programmer who knows what they're doing, it can be pretty fast. But here's the rub: the faster a language is, the closer it has to be to the metal, and the less it can do with high-level features.
So yes, you can make HLLs faster, but you can't take the cache misses out of an HLL, and you can't make a systems language wearing an HLL's clothing - although Rust is making an admirable attempt.
None of these are required for ease of development. At least the first two often result in precisely the opposite.
HLLs are not required to focus on slow abstractions. For example, homogeneous arrays of tagged unions can replace inheritance most of the time. And they avoid breaking your code in 10 files and 20 classes (though for some reason this metric is seen as a good thing way too often).
And while I don't set much store by inheritance, it set considerably more store by duck-typing and polymorphism.
>None of these are required for ease of development. At least the first two often result in precisely the opposite.
So are you talking about Java-style OO? Because I was talking about Smalltalk OO, which is pretty different.
Required, no, but they're tools, and they come in handy. Certainly make development a lot more comfortable.
And some of the time, they make delvelopment a lot easier.
This is precisely the kind of thing that leads to unmaintainable "magic" code, even though it can still be useful but with extreme moderation. So I don't see the point of making that a core feature of any language.
If you have any example to the contrary, I'd love a link to a good open-source project that uses these things extensively.
As for not seeing the point of making it a feature of your language, how about Lisp? And I'm not just talking macros. Lambdas, late binding, and in Scheme, the ability to rebind anything lead to a lot of cool tricks and capabilities.
And late binding is extrordinarily important.!
Well I guess it's good at making CRUD web sites. Hardly rocket science.
Tinyclos is a fairly sophisticated implementation of OO and the MOP, written in Scheme.
Its descendants, COOPS, GOOPS, and others, are in most schemes today. Many of them are written in their respective dialect of scheme, with little or no specific compiler support.
SXML allows for writing XML in native scheme syntax.
The anaphoric macros (aif, acond, etc.) are all, well, macros, and thus use metaprogramming principles.
tclOO, [incr tcl], and other OO TCL systems are usually implemented in regular TCL.
Give or take, any large Lisp or Smalltalk codebase takes advantage of dynamic typing, late binding, and some form of metaprogramming.
However, you've made it clear that you hate Ruby, Dynamic Typing, and other such things, as given as much of metaprogramming requires this sort of flexibility, I very much doubt anything I say will convince you that dynamic languages are in any way useful.
All your examples are programming gimmicks, and I've yet to see stuff that solves actual hard problems. I'm not interested in programming for programming's sake. I want to use it to make my computer do useful stuff.
Maxima is a descendant of the original MACSYMA, developed at MIT. It is still a usable and viable system, even if it has ageda bit.
Emacs is a popular programmer's text editor written in C and a dialect of lisp.
Both of the above programs are large, useful, and written in an HLL - one particularly amenable to pointer chasing, I might add - and they make use of the variety of abstractions which that HLL provides.
If those aren't modern enough for you, check out some Clojure applications.