Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
kimundi
searching Neon…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
7 ms
·
1.
▲
by
kimundi
5y ago
Yes, the macros parse the string at compiletime and generate code that does the formatting as given by them. Here is an example for how the code would look like expanded: https://play.rust-lang.org/?version=stable&mode=d
2.
▲
by
kimundi
5y ago
Think of raising an orbit like moving an item from one side of your desk to the other. You have to put energy into doing it, but the end result is just as much in balance with gravity as the starting point. So if you want it back where it w
3.
▲
by
kimundi
5y ago
Separating the "get to/from moon" vehicle from the "land on/start from moon) vehicle has indeed been the plan for many years now.
4.
▲
by
kimundi
5y ago
With dynamically sized types like `str`, Rust allows to separate "what kind of pointer + metadata is this" from "what kind of data does it point at". So, for example, you can have the types `str`, `[T]` or `Path`, and ca
5.
▲
by
kimundi
6y ago
The github discussion thread where that originates from also contain the language designers optimistically discussing how in the worst case `Pin` just has to be hardcoded to exclude these optimizations. Which wouldn't make it the first
6.
▲
by
kimundi
6y ago
Fully agree with that, and Rust makes that very easy still. Its 5-10 lines to spawn multiple threads that communicate with each other either via shared state or message passing, and I solve most paralleism problems that way to this day in R
7.
▲
by
kimundi
6y ago
The flip will be less extreme in later designs because they will have better/larger RCS control thrusters to rotate it without involving the main engines. Also the center of rotation can be controlled to be inside the passenger section
8.
▲
by
kimundi
6y ago
Affinity is a property of the type in Rust, so any given value is affine or not depending on which type it has.
9.
▲
by
kimundi
6y ago
Note that that is passing by value, so its moving/copying ownership. Its like having a immutable integer variable and copying it to a different mutable variable.
10.
▲
by
kimundi
7y ago
Wasm programs can only crash by triggering a "trap", which has the well defined semantic of aborting the entire (wasm) function stack at that point. It depends on the embedding host how much backtrace or debugging support you get
11.
▲
by
kimundi
9y ago
I think they just meant that Rust references are like normal first-class generic types. Eg, you can nest them to get a &mut &T for example, since they behave more like a pointer in that regard. C++ references on the other hand are m
12.
▲
by
kimundi
10y ago
Rusts references behave like plain raw C/C++ pointers at runtime, without any bookkeeping code running at all. The magic all lies in the compiletime borrow checker, which roughly works like this: - All data is accessed either thr
13.
▲
by
kimundi
10y ago
I don't have concrete examples, but in general: For one, the build system/dependency system is much more easier to handle. Rust uses the cargo package manager, and depending on an external library is as simple as adding a single l
14.
▲
by
kimundi
10y ago
Hi, me and a few others in the Rust community kinda hashed out an plan of how you would do safe code un- and reloading Rust. Its nothing official, and has no implementation or official RFC/proposal yet, but the idea goes something like
15.
▲
by
kimundi
11y ago
The multi threaded architecture of servo is actually more energy friendly than existing engines for the same workloads, since distributing the same amount of work over more cores means that each core has to do less, and can thus run at lowe
16.
▲
by
kimundi
11y ago
Note that I'm not really familiar enough with versioned symbols to know whether there is much more to it than just a specially formatted name.
17.
▲
by
kimundi
11y ago
The default name mangling of Rust library symbols is already kinda versioned because it includes a hash of the library, so two different versions of a library can coexist at the same time. As far explicitly using the symbol versioning schem
18.
▲
by
kimundi
11y ago
That's not a list of Show, that's a list of a single type that instantiates Show. The difference being that in your code you can only put in a single type at a time, eg [Int] or [String], but not both Int and String under the comm
19.
▲
by
kimundi
12y ago
Well, the first two are really just the same thing :P
20.
▲
by
kimundi
12y ago
Yes, though this particular code would not compile because one of the lifetimes is not declared.
21.
▲
by
kimundi
12y ago
Rust actually has two different reference counted smart pointers: `Rc`, which uses non-threadsafe reference counting, and hence is not sendable across thread boundaries; and `Arc`, which uses atomic reference counting and can be send across