Live data from Hacker News

Things Rust shipped without

graydon2.dreamwidth.org

281–290 of 330 posts

Re: Things Rust shipped without

#281

" Next time you're in a conversation about language design and someone sighs, shakes their head and tells you that sad legacy design choices are just the burden of the past and we're helpless to avoid repeating them, try to remember that this is not so." I think rust is neat, but this is somewhat arrogant. Rust is amazingly young . 10-20 years from now, when rust hopefully has bajillions of users, if this is still tr…

On the whole, it's that arrogance that keeps me away from Rust - for now.

Re: Things Rust shipped without

#282
post #241

Earlier quoted context omitted.

I'd need to recheck my vocab, but I'm pretty sure aborting is always safe.

Not if you want to write an OS.

Rust's usage of 'unsafe' refers to a very specific thing: memory safety. Aborts are always safe, though they may not be what you want, of course.

Re: Things Rust shipped without

#283
post #186

Earlier quoted context omitted.

Precompiled headers are a big hack. As pcwalton mentioned, the problem was actually solved when people invented real module systems.

Which, notably, happened decades before the first implementation of the precompiled headers hack.

Yes. Well. And just a few short decades later, modules will most likely make it into C++17.

Re: Things Rust shipped without

#284

Earlier quoted context omitted.

We have an http://doc.rust-lang.org/stable/std/ffi/struct.OsString.html to abstract over a native string in whatever encoding your platform has. Generally, things that interact with the OS use these, and they can convert to a UTF-8 String.

Suppose I'm on Linux, but I want to interact with Windows stuff. (CIFS protocol, NTFS on-disk format, disassembler for Windows executables, Wine-like program, cross-compiler, etc.) I'll be wanting UTF-16 support. Going the other way matters too; if I'm on Windows I may need UCS-32 support.

Sure. That's not a problem. You can write any kind of string type you want, as a library, and convert between them. One of the nice things about Rust is that it's low-level enough that almost everything is a library anyway, so the language won't get in your way if you need SomeNicheString.

Re: Things Rust shipped without

#285

Earlier quoted context omitted.

I think the point of parent comment is "it's ok to don't have goto in Rust, but it's not the reason to be proud of just not having goto". Goto is important enough operator and doesn't deserve blind hate.

Agreed... I honestly tend to break code into a lot of discrete functions, and combine for workflows, but sometimes you just need to easily jump back a few places, and where goto is available it's not always a bad option. Just one that should be used sparingly... once in a complex workflow is fine.. more than twenty times in a few thousand line method, not so much.

Don Knuth, "Structured Programming with go to Statements":

"Just recently, however, Hoare has shown that there is, in fact, a rather simple way to give an axiomatic definition of go to statements; indeed, he wishes quite frankly that it hadn't been quite so simple....

"Informally, α(L) represents the desired state of affairs at label L; this definition says essentially that a program is correct if α(L) holds at L and before all "go to L" statements, and that control never "falls through" a go to statement to the following text. Stating the assertions α(L) is analogous to formulating loop invariants. Thus, it is not difficult to deal formally with tortuous program structure if it turns out to be necessary; all we need to know is the "meaning" of each label."

Re: Things Rust shipped without

#288

Earlier quoted context omitted.

Most applications right now should do thread-per-request. Thread spawning is very optimized in both Rust and the Linux kernel, and you can adjust stack sizes if you need to. If you're hitting limits caused by this, you can use mio.

What about systems other than Linux?

Mac OS X is rarely used for servers, so I'm not particularly concerned about it. On Windows you can use user-mode scheduling—I would like to see a library for this—which is effectively 1:1.

Re: Things Rust shipped without

#290
post #283

Earlier quoted context omitted.

Which, notably, happened decades before the first implementation of the precompiled headers hack.

Yes. Well. And just a few short decades later, modules will most likely make it into C++17.

In my understanding, they won't: https://botondballo.wordpress.com/2015/06/05/trip-report-c-s...

    > Modules making it into C++17 is less likely.
However, they do say

    > That said, from a user’s perspective, I don’t think this is any reason to
    > despair: the feature is still likely to become available to users in the
    > 2017 timeframe, even if it’s in the form of a TS.
Post reply on HN