Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
Rusky
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
35 ms
·
331.
▲
by
Rusky
6y ago
> The solution is simple, write a safe wrapper, that uses `unsafe` once. This is the thing I'm calling a cop-out. Chromium wants to avoid the error-prone boilerplate of writing out all those safe wrappers, by asserting in a single
332.
▲
by
Rusky
6y ago
"Just use bindgen" is a cop-out, not a solution. It is technically correct, merely by marking all APIs unsafe. But as the Chromium document describes, this introduces a lot of noise that can mask the more involved proofs. What Chr
333.
▲
by
Rusky
6y ago
There is no such thing as a "safe macro" or an "unsafe macro," so you can't make the usual argument there. Macros (and other forms of code generation) all exist before and outside the "safety system," and
334.
▲
The problem of safe FFI bindings in Rust
(abubalay.com)
2 points
by
Rusky
6y ago
|
0 comments
335.
▲
by
Rusky
6y ago
There is no conflict between (auto)cxx and the view that `unsafe` blocks assert the soundness of their contents. Using cxx does not, in fact, remove any `unsafe` blocks- thus it is not "lying," nor is it "the ultimate evil.&q
336.
▲
by
Rusky
6y ago
It's an interesting way to demonstrate the density of the satellites- they're not hiding the number or duration of images, so you can get a fuzzy intuition for how likely you are to catch them in a given image.
337.
▲
by
Rusky
6y ago
The "my program is single-threaded" button is thread-local storage. If your program truly is single-threaded, then TLS is the same thing as a global!
338.
▲
by
Rusky
6y ago
Note that rust-analyzer could choose to load un-`mod`-ed files with no change to the language. At a minimum, this could be an off-by-default configuration. Ideally, it would suppress errors caused by these extra files, and downgrade error
339.
▲
by
Rusky
6y ago
I'm perfectly aware of `git stash -u` ("by default") as well as `git add -N`, etc, but as I also very intentionally pointed out, that has its own downsides. That is, my own personal workflow poses essentially zero risk of del
340.
▲
by
Rusky
6y ago
I think that was intentional? Or at least, `mod.rs` is explicitly added later on in the article.
341.
▲
by
Rusky
6y ago
Think about the `git stash` use case. The goal is to go from a messy, WIP state that may or may not compile, back to a more stable, probably-working state represented by a commit. That messy state may include a new, partially-implemented mo
342.
▲
by
Rusky
6y ago
But the module system doesn't ignore the directory structure. It is designed to mirror it! Instead, the author points out that the module system ignores undeclared source files. There are a couple of practical reasons that prevented
343.
▲
by
Rusky
6y ago
Yes: https://github.com/rust-lang/rust/pull/65819
344.
▲
by
Rusky
6y ago
I can't speak for all Rust developers, but I try to avoid getting into situations where I need lots of properties and features on one type to begin with. Similar to the usual rule of thumb about keeping functions small, keeping type
345.
▲
by
Rusky
6y ago
Those are more like "allocating the stack in the GC nursery" than they are "allocating objects on the stack." They store the actual chain of function activation records as GC objects, and only "pop" the machine
346.
▲
by
Rusky
6y ago
> if FF is successful in their mission they will cut off their major revenue channel. I don't think that's necessarily true. Their mission isn't to break search engines, just to prevent privacy violations. If Google Search
347.
▲
by
Rusky
6y ago
The article contrasts this approach with voxel cone tracing, so it's not that either.
348.
▲
by
Rusky
6y ago
The use of strings in Rust's implementation is limited to the assembly template and the operand constraints. Functionally speaking, moving those out of strings gains you absolutely nothing and can make parsing more difficult. The impor
349.
▲
by
Rusky
6y ago
> It's perfectly consistent, unless memcpy is so magical that some specific undefined behaviour is allowed (not likely). memcpy is so magical that some specific undefined behavior is allowed. It's more than a mere library fun
350.
▲
by
Rusky
6y ago
> gc-arena will not collect while the heap is being mutated, which is Rust-friendly but also impractical. This is where the generator stuff I mentioned comes in- I think the approach is much more practical than it seems. At the end of th
351.
▲
by
Rusky
6y ago
That's an interesting question, and there has been some work in that area. Getting shared mutability as a user of GC is basically the same as getting shared mutability in any other scenario in Rust. You use `UnsafeCell<T>` or a s
352.
▲
by
Rusky
6y ago
Not really- which is why "owned type" is kind of imprecise and usually just means "a type not constrained by any lifetime."
353.
▲
by
Rusky
6y ago
> The key is that the proprietary Microsoft specific API added by this patch is only usable in a WSL environment The other key, which everyone crying "Extend" seems so eager to ignore, is that they don't actually want anyo
354.
▲
by
Rusky
6y ago
The developers' intent does align with Microsoft's current interests -- as you say, they are hired to do what the business directs. Perhaps their interests will shift in the future, as they clearly have in the past. But the thin
355.
▲
by
Rusky
6y ago
Will the result be the same? I don't see why it would be, given the circumstances.
356.
▲
by
Rusky
6y ago
In the linked thread the Microsoft developers explicitly deny that this is the intent, if that's worth anything to you. The goal, rather, is to take all the usual (for the Linux side) GPU stuff and give it access to the Windows host&#x
357.
▲
by
Rusky
6y ago
That was/is the whole idea behind WindowsRT, Windows 10S, and Windows 10X, which go all-in on UWP/MSIX/whatever which are sandboxed and heavily restrict access to older APIs. So we have plenty of versions of Windows like that
358.
▲
by
Rusky
6y ago
It's called "polonius": https://github.com/rust-lang/polonius There are some posts on Niko Matsakis' blog, starting with this one: https://smallcultfollowing.com/babysteps/blog&
359.
▲
by
Rusky
6y ago
It's only a burden to the extent that type annotations are a burden. It's definitely possible (including in Rust) to do away with both, but that has downsides of its own.
360.
▲
by
Rusky
6y ago
Arguably, someone in that position speaking so definitively while also being uninformed, is at least a little "toxic."
More ›