Hacker Read top | best | new | newcomments | leaders | about | bookmarklet login

It's a lot easier to blame an language for being slow because it's obvious. Blaming algorithms requiresputying in the time to figure things out.


sort by: page size:

I don't think we can really blame slow languages.

Implementations of languages like javascript, ruby - and I would presume python and php - are a lot faster than they used to be.

I think most slowness is architectural.


I disagree. The slowness of these languages is mostly uncorrelated with increases in productivity. People only think there’s cause-and-effect here because they haven’t seen counterexamples, because the trend in language design for 25 years has been to make slow languages.

Those speed differences don't come from language, they come from using terribly wrong data structures and algorithms.

Being fast requires effort. It's not always about raw performance of the language yo use, it's about using the right structures, algorithms, tradeoffs, solving the right problems, etc. It's not trivial and I've seen so many bad implementations in "fast" compiled languages.

I didn't say it's just "slow". I said it's an expected performance hit in comparison with languages like C++. In some cases that hit is tolerable, in others not.

No, they aren't. That's the whole point. This idea that high level languages are slow is a pernicious myth.

won't be so fast if every change has to be painstakingly reviewed and tested due to the complexity of interactions in the code base

You can write spaghetti code in any language, it turns out. Blaming the language for that is not really an indicator of understanding the problem.


There isn't much inherent in the language design which dictates it must be very slow, though. It's mostly a result of the canonical implementation.

But doesn't that mean the article's point is kind of moot? That when people blame slow languages / VMs, they actually are slow and it has nothing to do with warm-up time?

There’s also a confound between a language and its communities. I’ve seen so many cases where a “slow” language like Python or (older) Perl smoked Java or C++ because the latter developers were trying to follow cultural norms which said that Real Decelopers™ don’t write simple code and they had huge memory churn with dense object hierarchies and indirection so performance ended up being limited by O(n) XML property lookups for a config setting which nobody had ever changed whereas the “slow” language developer had just implemented a simple algorithm directly and most of the runtime was in highly-optimized stdlib native code, a fast regex instead of a naive textbook parser which devolved into an object churn benchmark, etc.

Languages like Java get a lot of bad reputation for that because of popularity: not just that many people are hired into broken-by-design environments (or ones where they’re using some framework from a big consultancy or a vendor who makes most of their revenue from consulting services) but also because many people learn the language as their first language and often are deeply influenced by framework code without realizing the difference between widely used long-term reusable code and what most projects actually need and are staffed for. It’s easy to see the style of the Java standard frameworks or one of the major Apache projects and think that everyone is supposed to write code like that, forgetting that they have to support a greater number of far more diverse projects over a longer timeframe than your in-house business app nobody else works on. Broader experience helps moderate this but many places choose poor metrics and neglect career development.


A <Language> program can be really slow, especially when it's written by non-experts who don't understand <CorePrinciple> well.

It's perhaps worth pointing out that programming languages are not themselves fast or slow; it is the programming language implementations that are fast or slow. (This is a particularly sore point in the programming languages research community.)

This is a good example of why I roll my eyes at most programming language discussions. There is always someone that starts the "language X is SLOW" bandwagon, and people hop on.

Languages are rarely "slow" or "fast" by themselves. Programs written in those languages can be slow or fast.


As other commenters point out, how can a language be fast in a way besides something CPU bound? You are saying it is fast when it's not doing anything. Not sure I understand.

That's not a problem, that's a core policy of that language's design.

If you want a language that is slow, there are plenty of options.


Shame it's slower than existing work. We know pretty well how to optimise dynamic languages these days.

Slow code is usually written due to ignorance rather than choice. Lots of people only know OOP, which is slow and unoptimisable by default.

The language itself I don't really have a problem with, but it's slow.

When I think of the problem what I see is the compiler pretends to be fast by forcing the programmer to deal with the problems. Bonus the solutions are inherently fragile and bug ridden. Which the programmer gets smugly blamed for.
next

Legal | privacy