Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
Rusky
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
66 ms
·
661.
▲
by
Rusky
9y ago
Rust is certainly harder than Go. There's no need to dance around the issue, that doesn't help anyone. Further, Mercurial is already 100% on the train of "giving up compiler checks," though "low quality code" i
662.
▲
by
Rusky
9y ago
> Exceptions only cause overheard when they happen. They only execute instructions when they happen... but they still inhibit the optimizer when they don't. Calls that may throw act like branches in the control flow graph. They also
663.
▲
by
Rusky
9y ago
To me it seems it's just using different terminology than you expected. I've heard and used the article's version plenty of times and it generally works in context.
664.
▲
by
Rusky
9y ago
It looks like the article pretty consistently uses the phrase "the pointer is allocated ..." to mean that that's where it's pointing to .
665.
▲
by
Rusky
9y ago
In the case of Firefox, that new architecture was impossible without Rust. Mozilla tried and failed twice.
666.
▲
by
Rusky
9y ago
That's entirely unhelpful for the call stack, values stored in registers, loading and storing other sizes, atomics, etc... Wasm solves that because it's aware of what it's doing. Java et al do not.
667.
▲
by
Rusky
9y ago
> you can't really contain the consequences of the unsafe behavior. That's true, but the property I described can still help you track down the root cause and limit the number of places that interact with it.
668.
▲
by
Rusky
9y ago
There are two problems with that, at least for the stdlib. First, the stdlib contains a lot of compiler version-specific code so the savings would not be that great unless (until?) it becomes much more stable, along the lines of glibc. Se
669.
▲
by
Rusky
9y ago
The web platform is not completely safe, but it is far safer than, say, an unsandboxed exe running on Windows.
670.
▲
by
Rusky
9y ago
There is an immense technical advantage: wasm doesn't enforce a high-level memory model like the JVM's classes or Flash's ActionScript. It allows straightforward use as a compiler target for low level languages which do not u
671.
▲
by
Rusky
9y ago
> a submodule that can be treated as if its correctness doesn't impact the safety of the entire kernel. You don't have to go all that way to be better than C or C++. Rust can give you a submodule A whose correctness doesn'
672.
▲
by
Rusky
9y ago
Immutable collections don't play well with non-GC memory management.
673.
▲
by
Rusky
9y ago
> just because your `unsafe` blocks are small and infrequent doesn't say anything about the quality or "buggyness" of your code as a whole if those `unsafe` blocks are dependent on largely the entire rest of the safe code.
674.
▲
by
Rusky
9y ago
The idea behind unsafe is that you're not allowed to do that sort of thing. There's obviously not a way to enforce that in the compiler, but that's because unsafe is inherently a way to extend what the compiler can enforce.
675.
▲
by
Rusky
9y ago
A Rust kernel would likely make this function part of an implementation of the Clone trait, which would lead it to getting the error described above.
676.
▲
by
Rusky
9y ago
I'm pretty excited about that but I doubt it will lead to new alternative browser UIs anytime soon.
677.
▲
by
Rusky
9y ago
Ah fair enough. How easy then would it be for a Firefox fork to drop the chrome the way Electron does?
678.
▲
by
Rusky
9y ago
One thing that might release some of the pressure around addons would be to make Gecko more embeddable, the way Blink is. We've started seeing a lot of alternative Blink UIs (Brave, Vivaldi, new Opera, etc) alongside apps built on it v
679.
▲
by
Rusky
9y ago
Woah, wait. DRM and the ME are not fine in theory. Secure boot is. If the practice of installing your own keys is too hard, that's something we can fix. We can't fix DRM or ME without just removing them.
680.
▲
by
Rusky
9y ago
Secure boot doesn't mean the user isn't allowed to replace the bootloader or kernel, and it is more secure. UEFI doesn't require USB or secure boot or a compiled language or Python or proprietary code. It would be nice to h
681.
▲
by
Rusky
9y ago
Modula-3 either uses one of those techniques, or is not memory safe. (Looks like primarily the first one- manual deallocation is unsafe and it relies on GC for the rest?) Cyclone and ATS do not have Rust's combination of ownership and
682.
▲
by
Rusky
9y ago
Those are bindings.
683.
▲
by
Rusky
9y ago
std::io doesn't use a runtime, it just makes system calls directly. (It used to use a runtime because it had optional M:N threading, but that was removed when it turned out not to be any faster than 1:1 threading, caused all sorts of p
684.
▲
by
Rusky
9y ago
Linux doesn't do any of this, and doing so is tantamount to running a borrow checker on the code, which requires more information than is present in vanilla C.
685.
▲
by
Rusky
9y ago
"Good language features for value types," while retaining memory safety, means at least one of these things: * Boxing anything you take a reference directly to * Forbidding sum types and complicating the GC to allow interior point
686.
▲
by
Rusky
9y ago
Fuchsia doesn't use Rust.
687.
▲
by
Rusky
9y ago
There's some good discussion of how it happened here: https://www.reddit.com/r/rust/comments/7cwpbq/fearless_concu... One of the biggest contributors is "custom derive," which cuts out a l
688.
▲
by
Rusky
9y ago
I think of it less as "the smallest possible" and more as just "one indivisible unit"- going from 56 to 57 without rewriting the style system in Rust would be a long and probably impossible task.
689.
▲
by
Rusky
9y ago
You can do this with internal mutability. Mark the contents of the list nodes mutable by wrapping it in `Cell` or `RefCell`, and Rust will guarantee that any mutations still preserve memory safety. Or, as Veedrac mentions, you can do it w
690.
▲
by
Rusky
9y ago
For cases where you need more than one mutable reference, you can use `Cell` (single-threaded) or atomics, which allow mutation through shared references.
More ›