4 ms·
OO C is passable
- tptacek 18y agoThis guy's blog is awesome. Go read his archives.
- stcredzero 18y agoIf you want something like C, but with virtual functions, then you should look at Lua. It's fast, minimal, and designed to be embeddable. It doesn't start with OO, but you can actually easily build as much OO as you want. In fact, "something like C, but with virtual functions" almost describes Lua. (You have to add that it's Dynamic and Interpreted.)
- listic 18y agoIs Lua fast? I heard it has double as its only numeric data dype. How can that ever be fast? Here, look at the benchmarks: http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=lua&lang2=gcc http://shootout.alioth.debian.org/gp4/benchmark.php?test=all...
- davidw 18y agoFor a "scripting language", yes. Compared to C, no.
- stcredzero 18y agoIf you're going to be crunching petabytes of 32 bit floats, then by all means, use C or even FORTRAN. Most of us don't have a requirements that stringent, and something like Lua is just fine. Unfortunately, a lot of us are brainwashed into thinking we've got to act like weather simulation programmers, when we're really doing business apps.
- davidw 18y agoI wasn't making any value judgments about languages and speed, only stating the obvious that Lua is very fast as an interpreted language, but not so fast compared to fast compiled languages.
- xirium 18y agoNull terminated vtables. That's horrid. The performance must be terrible.
- ajross 18y agoWhy? The time to search a three entry vtable (or whatever) is still an order of magnitude lower than the time to fetch the thing from main memory in the first place. Performance optimization stopped being about instruction cycle counting a few years back.