Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
Rusky
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
13 ms
·
121.
▲
by
Rusky
3y ago
It is about solidifying semantics, but those semantics are still a concern to regular users who are writing `unsafe` code, not just Miri. As I understand it, Miri would like to be certain about the presence/absence of the UB of any par
122.
▲
by
Rusky
3y ago
Provenance is a dynamic property of pointer values. The actual underlying rules that a program must follow, even when using raw pointers and `unsafe`, are written in terms of provenance. Miri ( https://github.com/rust-lang&#x
123.
▲
Where Do Interrupts Happen? (2019)
(travisdowns.github.io)
1 points
by
Rusky
3y ago
|
1 comments
124.
▲
by
Rusky
3y ago
That's a distinction without a difference. `ifM` takes a monadic bool but it also returns a monadic value, in exactly the same way that `.await` can only be done within an async computation.
125.
▲
by
Rusky
3y ago
> you can't use regular if/while/for with async What do you mean by this? You can certainly mix if/while/for freely with .await, that's the whole reason it exists.
126.
▲
by
Rusky
3y ago
> The article also highlights an advantage for generic algebraic effects by reducing the cost of async code by not constructing the Waker until there’s a suspension point. No, it doesn't. It highlights that as an advantage of one s
127.
▲
by
Rusky
3y ago
The article is not suggesting that Rust should support arbitrary library-defined effects. It's suggesting that Rust's existing language -defined effects should be combined algebraically. > the biggest knock that I have against
128.
▲
by
Rusky
3y ago
I was talking about language syntax, and in particular the way proof terms for linear logic (which linear type systems come from) already provide a syntax for this. But in fact we also have multiple options on the more programmer-familiar
129.
▲
by
Rusky
3y ago
The comparison you made wasn't to arbitrary distributed UNIX programs, though. It was to X applications, which don't work this way.
130.
▲
by
Rusky
3y ago
VS Code isn't doing this with text or graphics, though. In X terms, it's running both the client and server on your local machine. It simply doesn't put the network boundary in the same place as an X application. VS Code&#x
131.
▲
by
Rusky
3y ago
With linear types alone you don't have any aliasing. Borrowing is a controlled way to recover some aliasing while retaining the benefits of linearity.
132.
▲
by
Rusky
3y ago
You can get the best of piece tables and ropes using a B-tree-based rope- at small sizes, you get a single node that works like a sorted piece table, but you can also scale up to larger documents without the high constant factors of a binar
133.
▲
by
Rusky
3y ago
Lifetimes and borrowing are a convenient thing to have together with linear or affine types, but you can use them on their own as well- e.g. Rust lets you borrow Copy types. At their core, the definition of linear and affine type systems do
134.
▲
by
Rusky
3y ago
Rust certainly doesn't insert automatic cleanup in signal handlers. I don't think there's actually any meaningful difference between linear types and automatic drop here.
135.
▲
by
Rusky
3y ago
Sure, this would just desugar to normal control flow and be checked for linearity in the usual way. I'm not sure what you mean exactly by "tie to the type," though? Just some kind of standard name for it? The benefit of linea
136.
▲
by
Rusky
3y ago
One way you can think of the exception unwinding stuff is that each call provides not just one continuation (the usual return address) but two (also one for the cleanup), and that these are combined using the & connective of linear logi
137.
▲
by
Rusky
3y ago
Linear and uniqueness types sort of collapse into the same thing when an object is required to stay linear or unique for its entire life cycle. They become distinct, and sort of dual to each other, when you relax this restriction: linearity
138.
▲
by
Rusky
3y ago
You don't need lifetimes or lifetime inference for affine types, either. Lifetimes/regions/borrowing are an orthogonal extension that you can add on top of either affine or linear types. (In fact Austral includes a region
139.
▲
by
Rusky
3y ago
What culture crash? The Rust project has a language reference, is working on expanding it into a more formal spec, and there are efforts like Ferrocene's to qualify the existing compiler for use in safety critical environments. The arg
140.
▲
by
Rusky
3y ago
JS arrays don't store their elements directly, they store references to their elements. (Unless the elements are primitives and the engine is using NaN-boxing or pointer tagging to store those inline, or something like that, which does
141.
▲
by
Rusky
3y ago
Often, when you have a compiler-y recursive ADT, you will want to allocate the individual nodes in an arena rather than from the global allocator as with Box. And at that point, you can use references (with the lifetime of the arena) rather
142.
▲
by
Rusky
3y ago
Rust has another advantage in the language itself- generic code can be type-checked and (partially) optimized before being instantiated. When you export a generic function in C++, every file that pulls it in has to re-parse it, and every in
143.
▲
by
Rusky
3y ago
> I'm glad the designers seem to be taking a step back and reconsidering how everything fits together. This is simply not what is happening here. The post is clear that this is about filling out and finishing up the plans that were
144.
▲
by
Rusky
3y ago
Yes, they have very different security models. Wasm is capability-based, starting from zero- a module declares what imports it needs, and the code that loads the module decides how to fulfill those imports. There's no other way for the
145.
▲
by
Rusky
3y ago
> Modules are not intended to serve as an interface alone, so it is more likely that devs (myself included) will simply throw the entire implementation into a module, because it seems like a better idea to do so with modules. > > I
146.
▲
by
Rusky
3y ago
You can write `extern "C"` declarations in modules, actually. And either way the complexity of C++ and its name mangling is independent of headers vs modules, no? Further, swig does seem to support quite a bit of C++. IIUC it even
147.
▲
by
Rusky
3y ago
You can just not write async code in Rust, no? There are a lot of Rust programmers that work this way, and it's fine because async is quite separable from the rest of the language. Even if you have to pull in a dependency that uses asy
148.
▲
by
Rusky
3y ago
Rust can be useful for more than one domain.
149.
▲
by
Rusky
3y ago
Really there's nothing stopping tooling like swig (or a C++ compiler for that matter) from processing module interfaces as text, just like headers. The language spec for modules doesn't require (or even really talk about) compilin
150.
▲
by
Rusky
3y ago
My point is that you can solve the inter-process case with precisely the same tools that Rust already uses to solve the intra-process cases. Outside of a pure-Rust single-threaded process that uses only stack allocation, those cases are a
More ›