Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
Gankro
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
23 ms
·
181.
▲
by
Gankro
11y ago
This strikes me as the kind of peephole optimization that LLVM would do anyway (similar to people manually converting `x / 2` to `x >> 1`, my nemesis). But maybe it's esoteric enough for them to not bother?
182.
▲
by
Gankro
11y ago
If you disallow mutation of values in a collected context, then it Just Works. The only way to complete a cycle is by mutating a managed value or "tying the knot" via laziness (which is of course just mutation in a hat). Rust almo
183.
▲
by
Gankro
11y ago
Google Spell Check, WordCount, and Wrap Plus for docs. LLVM for IR highlighting, Rust for Rust highlighting. I've tried racer in the past but it just doesn't scale with the current compiler architecture. I'm hoping the ongoin
184.
▲
by
Gankro
11y ago
I've submitted over a hundred patches to the standard library using only st3, for reference.
185.
▲
by
Gankro
11y ago
I haven't heard of rainbow table attacks being used much at all anymore. It's completely practical to individually brute force every person's password using their specific salt in parallel. Let's say they cranked up bcry
186.
▲
by
Gankro
11y ago
Fundamentally Rust just doesn't define things well enough to be able to answer the "this is what it compiles to" issue. There's some things like `Option<&T>` which we guarantee but really it's a lot of &qu
187.
▲
by
Gankro
11y ago
Maybe use https://dodistribute.com/ ?
188.
▲
by
Gankro
11y ago
Also RIP this intro: https://github.com/Gankro/rust/commit/a42a41520584e28a8fb5e4... (one of the many reasons I refused to squash this glorious history)
189.
▲
by
Gankro
11y ago
Haha, yeah I like to be a bit silly here or there. I might tone it down, but on the other hand I find it makes the text a bit less dry to not take yourself too seriously. :) re italics: https://github.com/rust-lang/ru
190.
▲
by
Gankro
11y ago
Eh, I'm already at the top of HN. :P More eyes to find errors before it makes into the beta channel, hopefully!
191.
▲
by
Gankro
11y ago
I 100% agree that Rust doesn't guarantee an absence of leaks in any formal way. I dedicated a section to this fact: https://doc.rust-lang.org/nightly/adv-book/leaking.html However I will say that Rust makes
192.
▲
by
Gankro
11y ago
Rust is safer than most languages (I'd argue it's even safer than Java/JS/Python/Ruby) but as fast and low-level-capable as C++. If that's not a big deal I dunno what is. (Also it has a really cool concurrency&
193.
▲
by
Gankro
11y ago
Even if assuming considerable knowledge, it's nice to be able to refresh the reader on basics here and there. That text is largely just reserving the right to not explain everything (also I'm moving away from it in general). Als
194.
▲
by
Gankro
11y ago
Thanks!
195.
▲
by
Gankro
11y ago
So it's in nightly today, so barring a tragedy it will land in stable in ~8 weeks I think. I'll probably repost it everywhere when that happens. This and The Book are living documents anyway -- they'll never be done. This jus
196.
▲
by
Gankro
11y ago
Author here. Didn't really want to post this to the wider programming community yet, but oh well. This is basically the first draft. Lots of errors and TODOs. Source is here if you want to file issues or patches: https://gi
197.
▲
by
Gankro
11y ago
Fair enough! Although obviously having to copy the data out (especially if it has a destructor) is a bit nasty.
198.
▲
by
Gankro
11y ago
The fundamental problem with this pattern in C++ is that you can always just keep around a pointer into it and then the "mutex guard" thing falls apart. There's no way to communicate to the language that this pointer can'
199.
▲
by
Gankro
11y ago
Primitives aren't allocated. This is why we have `int` and `Integer`; Integer is a boxed int. Java has a fair amount of sugar around doing the change automagically. Also escape analysis is a thing Java can do to avoid heap allocating o
200.
▲
by
Gankro
11y ago
Their argument doesn't appear to be "Tor is bad because it can be used for bad stuff" but "Tor is bad because it is overwhelmingly used for bad stuff today ". That seems to be a meaningful distinction to me. (I d
201.
▲
by
Gankro
11y ago
It guarantees that the value read was some value that was in the variable at some point. e.g. it prevents a value that toggles from 3 to 5 being read as 117. It also prevents writes from being eaten (e.g. an increment always actually occu
202.
▲
by
Gankro
11y ago
All destructors in Rust are also decided at runtime, fwiw. Even without any allocation or anything: let foo = Moves::new(); if condition { mem::drop(foo) } // should foo be dropped here? In practice many destruct
203.
▲
by
Gankro
11y ago
This has pretty limited scope, though. If a function you call returns an &mut you have no way to tell thanks to type inference, and when you use that value it looks like you're passing by-value. Similarly if you call a method, ther
204.
▲
by
Gankro
11y ago
The Rust community has tended towards lots of tiny libraries. Hey I made this cool function -> library.
205.
▲
by
Gankro
11y ago
If you're just trying to demote a lifetime, you should just be able to specify the lifetime on the variable: let values: &'a Vec<Value> = &values; Lifetimes have variance so that you can always put a "b
206.
▲
by
Gankro
11y ago
One important guarantee of Rust though: If you manage to do that, this is a bug in Rust and it's not your fault . And really, that's true of any "safe" language, right? Java, Ruby, Javascript, Python, whatever -- implem
207.
▲
by
Gankro
11y ago
Care to elaborate as to what you thought they were?
208.
▲
by
Gankro
11y ago
It was more a jab at LLVM's documentation in general ;) But since you're claiming to understand LLVM docs: * How does LLVM identify that a region of memory is "allocated" per the usage in the GEP docs. In particular it m
209.
▲
by
Gankro
11y ago
Author here. I'm currently interning at Mozilla with the goal of writing the "advanced" companion to the TRPL (The Rust Programming Language book): TURPL (The Unsafe Rust Programming Language). In the process I'll need
210.
▲
by
Gankro
11y ago
Boring edition for people who have feels about maturity: http://cglab.ca/~abeinges/blah/everyone-peaches/ ( people getting mad about PPYP is really a victory, though; the second last bullet was the most impor
More ›