News for hackers. Stuff that matters.
Re:Rust in 2018: easier to use by banachtarski on Sunday January 14, 2018 @04:07AM (#16143420)
> Nobody with a sane mind would write C or CPP micro-services

why? I do this all the time. Maybe I should check into a nearby asylum.

Re:Rust in 2018: easier to use by shadowmint on Sunday January 14, 2018 @04:28AM (#16143470)
The point isn’t that no one does it, its that its hard to do right.

...and that is flat out the case for c++, unequivocally.

In rust you’d expect it to be better, because of (reasons rust is good here, like safety, having a package manager and an ecosystem, etc etc), but practically, there are too many halfbaked solutions, too much ‘use nightly’ and few good stable proven solutions to look at.

Rust isn’t the right solution for every problem, but it should be a good solution for secure very high performance network services.

Its definitely a good goal for the year~

Re:Rust in 2018: easier to use by e12e on Sunday January 14, 2018 @06:29PM (#16147209)
> ...and that is flat out the case for c++, unequivocally.

Arguably, this is why Google made go.

But I'm not sure c++ micro services are a terrible idea. I think the real problems come with a) feature creep as opposed to writing new micro services, and b) the temptation to write "fast" c++.

Just writing plain obvious c++ should give you a leg up on most languages (esp for micro services). But then, rather than refactor and think about the algorithm and data structures (and get a 10x performance benefit from a simpler solution), you could probably get a 2x improvement from a more convoluted, "special" c++ implementation.

And that's where you're likely to encounter elder horrors lurking.

[ed: I'm however more and more convinced there's no such thing as "plain obvious c" that doesn't have a number of serious issues along the lines of not checking mallloc return values, to utf8 string handling etc.]

Re:Rust in 2018: easier to use by sebcat on Sunday January 14, 2018 @06:22AM (#16143792)
I also do this. I make use of Capsicum/seccomp-bpf and jail/chroot to a ro mountpoint, use SSP, ASLR where possible, ... But I still use C as my primary programming language. I've also written code in golang professionally for a year or two.

It's quite common in the embedded space to use C or C++. It's easy to run everything as root and skip fundamental bound checking, so those languages get a bad rep in that space. Totally understandable. But it is possible to engineer solutions that are a lot safer too. It's just a question of priorities. Companies not prioritizing writing safe code or not working on having a safe architectural design will not bother with Rust or other memory safe languages. There's little to no market incentive in most areas. Sad but true.

Re:Rust in 2018: easier to use by pjmlp on Sunday January 14, 2018 @06:56AM (#16143906)
Even using C++ in embedded is an issue, mostly cultural.

A common theme in the C++ community is to advocate C++ to devs that only see Assembly and C89, and don't see any reason to move beyond that.

Most recent example "Embedded & C++ - Meeting 2017 Keynote"

https://www.youtube.com/watch?v=mNPfsUZb3vs

Re:Rust in 2018: easier to use by michaelchisari on Sunday January 14, 2018 @04:16AM (#16143442)
It must depend on what you're building with it. I haven't seen any reason why it couldn't be used for serving up data for an api.

But as far as using it as a full featured web framework, a la Rails, Django or even Laravel, I can see why people say it's got a long way to go.

That said, I haven't built anything production or large scale in Rust, so I can't claim to be an expert.

Re:Rust in 2018: easier to use by raverbashing on Sunday January 14, 2018 @05:53AM (#16143709)
Because your code has bugs and/or security vulnerabilities. It's pretty safe to assume this without looking at your code
Re:Rust in 2018: easier to use by civility on Sunday January 14, 2018 @06:22AM (#16143794)
Heh, so does yours. I can say this without even knowing what language you use to write your software, much less looking at it... All software has bugs, and most of those are security vulnerabilities waiting to happen.
Re:Rust in 2018: easier to use by raverbashing on Sunday January 14, 2018 @09:42AM (#16144417)
Of course. Code is hard.

Using a safer language makes it easier and less prone to out-of-bounds memory accesses.

By using C/C++ you're choosing to make a hard problem harder.

Re:Rust in 2018: easier to use by banachtarski on Monday January 15, 2018 @04:10AM (#16149431)
And slower or impractical even for some things. Maybe we should write a real-time media codec in python 'cause security. I don't understand why you, like the OP, make these sweeping generalizations as though all of engineering is black and white. Sometimes, I reach for a higher abstraction, sometimes not. It depends on the problem domain.

Oh and btw, "out of bounds memory accesses" are not the primary source of security vulnerabilities at all. In fact, such out of bounds access is more likely to just make your program crash (which is a good thing).

Re:Rust in 2018: easier to use by duneroadrunner on Sunday January 14, 2018 @03:08PM (#16146076)
C++ does have a practical, memory-safe subset[1]. Recommended for anyone writing internet facing C++ code.

[1] shameless plug: https://github.com/duneroadrunner/SaferCPlusPlus

Re:Rust in 2018: easier to use by kbwt on Sunday January 14, 2018 @06:17AM (#16143779)
I wouldn't be so sure lower level code necessarily has more vulnerabilities. It's certainly easier to find the vulnerabilities because the attack vectors are well-known.

Software written in higher level languages is often less widely deployed, so less people are trying to find vulnerabilities. All the complexity adds up, and can result in new vulnerabilities that wouldn't have been there if the code was written in a simpler language.

Re:Rust in 2018: easier to use by sambe on Sunday January 14, 2018 @06:27AM (#16143806)
What complexity adds up?
Re:Rust in 2018: easier to use by fauigerzigerk on Sunday January 14, 2018 @05:22AM (#16143612)
>Maybe I should check into a nearby asylum.

If you do, make sure it says "believes in micro-services" on the referral ;-)

Re:Rust in 2018: easier to use by banachtarski on Sunday January 14, 2018 @05:28AM (#16143627)
I just mentally edit "micro-services" to "services" any time I read it hehe.
Re:Rust in 2018: easier to use by StavrosK on Sunday January 14, 2018 @05:56AM (#16143719)
What, do you edit the "web" out of "webscale" too? Certifiable.
Re:Rust in 2018: easier to use by paulddraper on Sunday January 14, 2018 @01:47PM (#16145575)
And "REST" to "HTTP"