News for hackers. Stuff that matters.
Re:Building on Rock, Not Sand by dsign on Friday October 06, 2017 @05:03AM (#15415393)
We run high-load web services in something-other-than-c with managed memory and checked array access. It is native, 8/9 as fast as C, and it works. We will never have the budget to pay for the additional 1/9th that C would afford us, in terms of security concerns.

Yet, everyday, I have to field questions about why our low-level, network-facing system code is not written in C... old prejudices die hard.

Re:Building on Rock, Not Sand by pjc50 on Friday October 06, 2017 @09:17AM (#15416515)
> why our low-level, network-facing system code is not written in C

Really I think these days, in fact since the Morris Worm, people should be asking the opposite question: why is network-facing code written in C given that almost any error can lead to an exploitable security compromise?

I do not buy the performance argument at all any more. So few systems are really performance-constrained by network processing (usually it's the network itself or the disk), you have to write horizontally scalable code anyway if you want to make use of multiple cores, so almost all cases where it's a bottleneck are more cheaply dealt with by scaling rather than tinkering with the software.

There are people doing HFT in Java. The managed languages are quite capable of great performance with a little effort and imagination.

Re:Building on Rock, Not Sand by elevensies on Friday October 06, 2017 @11:28AM (#15417533)
Watching Heartbleed and Cloudbleed happen really drove it home for me. Given that routine programming errors can cause private data to be transmitted unintentionally, I have to question the sanity of writing networking software handling private data in C.
Re:Building on Rock, Not Sand by brainwipe on Friday October 06, 2017 @05:11AM (#15415424)
Have you ever been asked to switch down into Assembler mid-function in C to solve timing issues in the hardware? I have... but that was 20 years ago!
Re:Building on Rock, Not Sand by Kliment on Friday October 06, 2017 @06:16AM (#15415634)
All the time, but then I do a lot of embedded programming.
Re:Building on Rock, Not Sand by brainwipe on Friday October 13, 2017 @08:19AM (#15464933)
Fair play, I tip my hat to you.
Re:Building on Rock, Not Sand by Cthulhu_ on Friday October 06, 2017 @05:44AM (#15415523)
What counters do you offer though? Or maybe reverse the question - why do they think you should use C? That last 1/9th performance? I'm pretty sure that last factor also isn't due to the language and there's still room for performance improvements.
Re:Building on Rock, Not Sand by rixed on Friday October 06, 2017 @08:32AM (#15416270)
How do you mesure performance against C ? Did you implement a rival unsafe C version to compete with, or is this just a guess ? If so, what makes you believe C would only yield a 10% improvement?

I'm asking because my own gut estimate of the cost of automatic memory management is significantly higher.

Re:Building on Rock, Not Sand by rbehrends on Friday October 06, 2017 @09:25AM (#15416579)
10% is fairly typical overhead for mark-and-sweep GC for an imperative program. It requires artificially high allocations rates – that well-written imperative code shouldn't have – to go much higher than that.

The cost of array bound checks is generally negligible with a modern compiler/CPU and the speed/safety tradeoff is not even worth haggling over for any code that's exposed to the internet.

Re:Building on Rock, Not Sand by Quarrelsome on Friday October 06, 2017 @08:42AM (#15416328)
isn't this exactly the sort of line of questioning that the OP is complaining about?

In my experience of managed software 99.9% of performance problems are due to stupids and 0.1% are due to marshalling and GC costs. An average unmanaged developer seems to assume the opposite.

Re:Building on Rock, Not Sand by thehardsphere on Friday October 06, 2017 @09:11AM (#15416482)
Then you may not be working in the same problem domain as the person who asked the question.

I mean, my experience is pretty much the same as yours, to the point where if someone blames the language for poor performance I'm immediately skeptical of the claim. But other cases do exist, is especially for problems that are CPU intensive.

Re:Building on Rock, Not Sand by blub on Friday October 06, 2017 @08:46AM (#15416357)
Some managed languages can have pretty good performance, but at significant memory usage cost. Performance is not a single dimension.

It's a very legitimate question to ask how it was measured.

Obviously they're happy with their performance and we can't comment on that, but the other claims regarding speed vs. C were more general.

Re:Building on Rock, Not Sand by nine_k on Friday October 06, 2017 @11:02AM (#15417292)
Look at the cost equation. Whatever additional resources they need to spend is a payment for improved safety / security.

It's like saying that a reinforced door with a lock is more expensive and heavy than a regular cardboard-and-planks one, and is slower to open. It is! But is has other advantages, not attainable otherwise.

Re:Building on Rock, Not Sand by blub on Friday October 06, 2017 @11:32AM (#15417569)
By managed languages I understand memory managed, aka GC languages.

It's not correct to say that they use additional resources to provide memory safety or security.

Python for instance uses additional resources because it simply doesn't have a performant implementation and Java uses additional memory to gain execution speed.

Swift and Rust are memory safe, but don't need a GC, so those memory safety advantages are in fact attainable otherwise.

Re:Building on Rock, Not Sand by Quarrelsome on Friday October 06, 2017 @08:48AM (#15416366)
What part of:

> I'm asking because my own gut estimate of the cost of automatic memory management is significantly higher.

Is reasonable and not dripping with bias? My gut estimate says it doesn't matter in many cases. So where does that leave us?

Re:Building on Rock, Not Sand by blub on Friday October 06, 2017 @08:56AM (#15416415)
I said it's a legitimate question to ask, not that their stated reason for asking is legitimate and I stand by what I said.
Re:Building on Rock, Not Sand by barrkel on Friday October 06, 2017 @10:37AM (#15417087)
The performance loss vs C is in that ballpark; arguably it's sometimes less, because of increased flexibility in refactoring. A bigger issue is memory overhead, that's often 100% larger, and it's harder to avoid. But memory is cheap.
Re:Building on Rock, Not Sand by weberc2 on Friday October 06, 2017 @08:48AM (#15416367)
Can I ask what it is?
Re:Building on Rock, Not Sand by s_kilk on Friday October 06, 2017 @11:37AM (#15417616)
My money's on Go.
Re:Building on Rock, Not Sand by rlonstein on Friday October 06, 2017 @02:15PM (#15418995)
> My money's on Go.

Based on submission history, I'd guess Haskell.

Re:Building on Rock, Not Sand by weberc2 on Friday October 06, 2017 @08:35PM (#15421540)
Seems like it would be hard to get Haskell to run 8/9 as fast as C. Haskell is much harder to reason about performance than Go or C, and it's pretty easy to make a seemingly innocuous change that slows your program dramatically.
Re:Building on Rock, Not Sand by tome on Saturday October 07, 2017 @02:53AM (#15422631)
> Seems like it would be hard to get Haskell to run 8/9 as fast as C.

The typical factor mentioned in the Haskell world is 1/2 the performance of C.

Re:Building on Rock, Not Sand by s_kilk on Friday October 06, 2017 @02:38PM (#15419225)
Ah, now that’s intriguing! Thanks
Re:Building on Rock, Not Sand by code5fun on Friday October 06, 2017 @05:53AM (#15415562)
"something-other-than-c" Which letter?