Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
Rusky
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
66 ms
·
631.
▲
by
Rusky
9y ago
Typical assembly languages hardly do anything more with cache hierarchies than C does.
632.
▲
by
Rusky
9y ago
> I thought a growable stack via a guard page that allocates more stack on a fault was common in C-based languages. It is, but that's not how Go's growable stack works. Go's is grown by the language runtime and relocated
633.
▲
by
Rusky
9y ago
> Like tomorrow someone will come with practical voxel based system instead of current abstract vector ones, what will we do? For one thing, any new approach will still have to solve the same problems around data transfer and formats tha
634.
▲
by
Rusky
9y ago
> you're effectively talking about a secondary, novel type system, right? Yes, exactly. The main reason I prefer language-level effects rather than monads is for composability with normal imperative control flow. Monads are written
635.
▲
by
Rusky
9y ago
Trivial to use the included fiber API; impossible to implement yourself without the risk of a future OS update breaking your implementation.
636.
▲
by
Rusky
9y ago
No, continuations can be controlled similarly through effect polymorphism, which is what I was trying to describe. The difference is not that continuations allow anything at all, but that your effects are commutative rather than layered lik
637.
▲
by
Rusky
9y ago
I'm not at all convinced. Stackless coroutines have a statically-known fixed stack size, which can be treated as an anonymous type a la C++ or Rust closures. This is far cheaper and easier to optimize than any possible implementation o
638.
▲
by
Rusky
9y ago
Ah, right. I guess I have seen this sort of thing in Haskell then as well. When implemented with HKTs it usually gets really messy with things like monad transformers, so I prefer to think of asynchronicity more in terms of continuations.
639.
▲
by
Rusky
9y ago
I used this: https://github.com/Kotlin/kotlin-coroutines/blob/master/kotl...
640.
▲
by
Rusky
9y ago
Technically you can get the convenience of not needing to write async/await, with the same runtime implementation decisions underneath as Tokio/futures. Kotlin is an example of this approach- its coroutines are state machines but
641.
▲
by
Rusky
9y ago
There's nothing about stackless coroutines that means you can't have good stack traces. For example, C# already does it, at least to some degree. Stackful coroutines are clearly a viable tool, but they don't work in all use c
642.
▲
by
Rusky
9y ago
Concepts (lite, the version that is still around) are "one-way." They constrain what types you can use as template arguments, but they do not constrain what templates can do. Which means the templates themselves can still impose a
643.
▲
by
Rusky
9y ago
That doesn't affect the download size because it's not distributed.
644.
▲
Godot 3.0 game engine released
(godotengine.org)
308 points
by
Rusky
9y ago
|
39 comments
645.
▲
by
Rusky
9y ago
It's doable to keep using pointers instead of indices- they just all have the lifetime of the vector and you can freely follow them around. This does prevent resizing the vector, but you can get around that by using a different arena t
646.
▲
by
Rusky
9y ago
Rust can totally help you do that properly. You can wrap the indices in a struct parameterized by a lifetime and regain all the same tools you would have with language pointers.
647.
▲
by
Rusky
9y ago
What would make this "declarative way to talk about C interfaces" less error prone than something like this? extern fn read(fd: c_int, buf: *mut c_char, len: usize) -> isize; pub fn read(fd: c_int, buf: &mut [c_c
648.
▲
by
Rusky
9y ago
The definition of what you're allowed to do with `unsafe`, however nebulous its specifics may be at the moment, is that such a situation is a bug in one or both of those libraries, not their composition. To put it another way, if you c
649.
▲
by
Rusky
9y ago
Because the closure itself contains a reference either to the struct or to its fields. That's the second path, and it can be invalidated by the first path either a) freeing the struct or b) changing its "shape" in memory (res
650.
▲
by
Rusky
9y ago
Callbacks by definition create multiple paths to the data. (You can also often get away with Cell rather than RefCell.)
651.
▲
by
Rusky
9y ago
There actually is work going on in that direction. The Cretonne code generator is written in Rust, and designed to support WebAssembly. It would also work as a fast rustc backend for debug builds on the few platforms it supports.
652.
▲
by
Rusky
9y ago
The language itself isn't coupled to LLVM outside of some underspecified details around things like unsafe and the memory model, which will eventually be better-defined. The compiler has historically been fairly strongly tied to LLVM.
653.
▲
by
Rusky
9y ago
You can interpret wasm if you want, but considering the motivation for wasm is performance that kind of defeats the point.
654.
▲
by
Rusky
9y ago
Display lists actually remind me a lot of sprite batching, where game engines also build up VBOs based on the whole scene. Probably not as common in 3D (maybe particles?) but standard practice for 2D. And for what it's worth, the last
655.
▲
by
Rusky
9y ago
Spectre also applies to other address spaces, not just the kernel.
656.
▲
by
Rusky
9y ago
Spectre also allows reads from places you can't map, as long as you can mistrain the branch predictor for some other code that can.
657.
▲
by
Rusky
9y ago
No. It has a user-visible idea of "capabilities" in the sense that apps get a checklist of things they can and cannot access, but that's not "capability based security," just another access control list. Capability
658.
▲
by
Rusky
9y ago
Multiple units don't have their own copies of type definitions to begin with. The compiler sees them all at once instead, to the point that different versions of a crate produce different incompatible types. At a lower level, symbols a
659.
▲
by
Rusky
9y ago
> C only has 2 lifetimes: block scope for stack variables, forever (until explicitly free'd) for heap malloc'ed memory. To the contrary, C has just as many lifetimes as Rust. They're just not explicit. "free() it when
660.
▲
by
Rusky
9y ago
Certainly, those are exactly the reasons I would use to argue for Rust. I just don't like seeing people minimize its learning curve just to make a point.
More ›