News for hackers. Stuff that matters.
Re:Why you should, actually, rewrite some of it in Rust by CalChris on Wednesday July 12, 2017 @02:49PM (#14755355)
> the syntax is almost as noise-free as exceptions

No.

const USAGE: &'static str = "usage string";

I did rewrite it in Rust. I rewrote a small low level command line app in Rust. I really wanted to like Rust going in but I freaking hated it going out. They had a few good ideas but they never knew how to say no. The part I hated the most was the Rust macro language. And for real low level to the metal systems programming, everything is unsafe; so you may as well be writing in C.

Go is pretty minimal. They knew how to say no. I like modern C (C99 and C11). It has most of the good ideas from C++.

Re:Why you should, actually, rewrite some of it in Rust by steveklabnik on Wednesday July 12, 2017 @02:59PM (#14755475)
As of the most recent release, that's now

    const USAGE: &str = "usage string";
and there's talk of maybe making it

    const USAGE = "usage string";
> The part I hated the most was the Rust macro language.

We don't like it either; there's a replacement coming. We reserved the "macro" keyword before 1.0 and made the current one use the less-good "macro_rules" to help ease the eventual transition.

Re:Why you should, actually, rewrite some of it in Rust by GrayShade on Wednesday July 12, 2017 @04:46PM (#14756514)
> We don't like it either

But.. but.. Scheme macros are so nice!

Re:Why you should, actually, rewrite some of it in Rust by steveklabnik on Wednesday July 12, 2017 @05:13PM (#14756738)
Totally! It's not about the fundamentals, it's about things like "macros are global" and "almost entirely hygienic but sometimes not", stuff like that. Stuff that would be backwards incompatible to just fix.
Re:Why you should, actually, rewrite some of it in Rust by Rusky on Wednesday July 12, 2017 @03:07PM (#14755583)
The comment was about error handling syntax, not constant declaration syntax. The comparison being made is between `result = foo(); if (!result) { ... }`, `foo();`, and `foo()?;`.

> And for real low level to the metal systems programming, everything is unsafe; so you may as well be writing in C.

Sounds wrong to me. People have done things like booting up x86 with all of the hardware bit-twiddling behind safe interfaces (for example: https://os.phil-opp.com/).

Re:Why you should, actually, rewrite some of it in Rust by CalChris on Wednesday July 12, 2017 @03:18PM (#14755683)
setjmp wasn't even supported. I had to use an LLVM intrinsic. This only barely worked if I put the setjmp and the longjmp in separate files.
Re:Why you should, actually, rewrite some of it in Rust by Rusky on Wednesday July 12, 2017 @03:23PM (#14755737)
Why is setjmp such a major issue for you? It's a C language feature, not a "real low level to the metal systems programming" requirement.
Re:Why you should, actually, rewrite some of it in Rust by CalChris on Wednesday July 12, 2017 @03:29PM (#14755790)
If you are calling C or assembly and there is any sort of processor exception, you need to establish a signal() handler and you will need setjmp/longjmp to re-establish a safe stack frame.

Yes, this is a C/assembly thing. But it is also a Linux/BSD/Unix thing. You really cannot call Rust a systems programming language if signal/setjmp/longjmp are not fully supported. It just goes with the territory.

Re:Why you should, actually, rewrite some of it in Rust by Rusky on Wednesday July 12, 2017 @04:37PM (#14756437)
Linux/BSD/Unix are hardly the only systems programming environments. I'd hesitate even to call them the majority.

And for now, there are definitely ways to handle signals using libraries.

Re:Why you should, actually, rewrite some of it in Rust by lossolo on Wednesday July 12, 2017 @07:40PM (#14757615)
> Linux/BSD/Unix are hardly the only systems programming environments. I'd hesitate even to call them the majority.

Do you have any source that can confirm that? Because what you wrote seems really wrong. I see linuxes/bsd/unix EVERYWHERE (Android/iOS/OSX/almost all backend servers etc.)

Re:Why you should, actually, rewrite some of it in Rust by Rusky on Wednesday July 12, 2017 @08:49PM (#14757974)
I'm thinking of embedded systems and desktop machines- the first tends not to use an OS nearly that big (if any at all), and the second tends to use Windows.
Re:Why you should, actually, rewrite some of it in Rust by GrayShade on Wednesday July 12, 2017 @04:43PM (#14756485)
> And for real low level to the metal systems programming, everything is unsafe; so you may as well be writing in C.

You might want to take a look at this series: http://blog.japaric.io/fearless-concurrency/ .