Live data from Hacker News

Rust is mostly safety

graydon2.dreamwidth.org

121–130 of 474 posts

Re: Rust is mostly safety

#121
post #40

Earlier quoted context omitted.

Go is the language in the LXC, Docker, containerisation space.

Which is something I never understood. Since you are mainly wrapping OS API, why not take a higher level langage ?

For all the benefits of higher-level languages. Remember that the designers of C had to agree on every feature that went into Go: a language they co-designed for better programming experience & results. Wirth-style languages also compile ultra-fast for quick iterations.

Re: Rust is mostly safety

#122
I think Rust is mostly about safety in the same way that skydiving is mostly about safety. Having safety features that you know you can rely on allows you to take risks that you normally wouldn't in order to accomplish some really awesome things.

(I guess in this analogy C is a parachute that you have to open manually, while Rust is a parachute that always opens at exactly the right altitude, but isn't any heavier than a normal parachute.)

Re: Rust is mostly safety

#123
post #3

Does Rust have template metaprogramming? And does it look more clean and organized than boost's C++ implementation?

Rust has three main forms of metaprogramming: generics, which are kind of like templates, but more like concepts (in C++ terms), macros, and compiler plugins.

Wait, Rust has macros that expand to code and mess up debugging, confuse tooling and everything else just like C++? Isn't that exactly what the language should have avoided?

Re: Rust is mostly safety

#124
post #84
post #57

Earlier quoted context omitted.

> Currently Rust is about Go's age but nowhere close in usage. Rust was released in 2015, it's merely one and a half years old, while Go was released in March 2012. If you count the inception period of Rust (pre-1.0) you should also count Ken Thompson's and Rob Pike's work at plan9, which doesn't make more sense … Fun fact: Go's first commit is 44 years old [1] ;) [1] https://github.com/golang/go/commit/7d7c6a97f815e…

It is not my intention to show Rust in bad light. I roughly mean to say both languages have put about 6-7 years of engineering effort by now but usage differs by an order of magnitude or so. I agree that they had very different priorities in beginning and it changes with time. My goal was to merely point out core rust people in Mozilla and elsewhere now recognize that industry usage is an area of high importance in c…

I think your not looking at this correctly. Swift also had a very fast pasted release cycle like Go.

Rust took a different path, the developers until the 1.0 release basically said; use at your own risk, we reserve the right to change anything and everything and break it all. This freed them of trying to keep the language backward compatible.

After the 1.0 release, there have been nearly no breaking changes introduced to the language, and they have signaled that they want to keep this stability going into the future. This is a big difference from Go which decided to go for an earlier public release, and now is much more constrained on how it can change (if they don't want to break all the stuff built on it out there).

So it's not fair to include the 6-7 year development cycle, as that could be more thought of as a research period, one that laid the groundwork for the safety in everything which is the basis for Rust now.

Re: Rust is mostly safety

#125
post #5

> countless lives lost I have no doubt that people have had their lives ruined, or even died, as the result of flaws in system programming, but is anyone actually tracking this? Is it "countless?"

It was a dumb statement unless he meant... given context of software maintenance... lives "wasted" toiling away on C or C++ monoliths. There are indeed countless lives and billions wasted on that that might be reduced or situation improved by better tooling.

Re: Rust is mostly safety

#126
post #68

Earlier quoted context omitted.

Well, Go is Limbo with some Oberon-2 touches.

I thought it was supposed to be Oberon-2 with some Limbo, C, etc touches. That's part of how it becomes my slam dunk against C in anther discussion. ;)

If you read the Inferno programming guide, you will see how much the languages resemble themselves.

Major differences are that Limbo uses a VM based runtime with dynamic loading and Abstract Data Types.

But your approach is also good, still Oberon had some issues that were eventually improved in Oberon-2 that Go lacks.

On the other hand Oberon-07 is even more bare bones than Go.

Re: Rust is mostly safety

#127

Earlier quoted context omitted.

Any idea when custom allocator will become stable? That's the only thing holding us to nightly.

I literally had a conversation about this yesterday. We need someone to champion the work. If that's you, we should get in touch.

email sent

Re: Rust is mostly safety

#128
post #77
post #61

Earlier quoted context omitted.

There are really only two popular Rust libraries that use unstable features: 1. serde, the best serialization/deserialization library. This works on stable now using the `serge_codegen` crate and a custom `build.rs` script. This will Just Work on stable with no extra setup once Macros 1.1 lands, theoretically in about 5 weeks. But I'm using it on stable now in a half-dozen projects, thanks to a `build.rs` script. 2.…

serde works on stable without serde_codegen or custom build scripts, too. It works like a regular library in fact, just with less features (no code generation feature). A custom data structure might not be able to use the default code generation for its impls anyway.

This is true of diesel as well: http://diesel.rs/guides/getting-started/

Re: Rust is mostly safety

#129

Earlier quoted context omitted.

Rust has three main forms of metaprogramming: generics, which are kind of like templates, but more like concepts (in C++ terms), macros, and compiler plugins.

Wait, Rust has macros that expand to code and mess up debugging, confuse tooling and everything else just like C++? Isn't that exactly what the language should have avoided?

Macros in Rust are very different than macros in C++. They're similar to syntax-rules in Scheme: https://doc.rust-lang.org/book/macros.html
Post reply on HN