Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
eddyb
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
21 ms
·
151.
▲
by
eddyb
12y ago
An allocator like that would require unsafe code to write and could not expose a safe interface unless it couldn't be used to read uninitialized memory. `Vec::with_capacity` would still not let you read the data even if you had a cus
152.
▲
by
eddyb
12y ago
The equivalent would be `Vec::with_capacity` which allocates the right size but does not provide safe access to uninitialized memory - in other words, you can only read what you wrote.
153.
▲
by
eddyb
12y ago
Mentioning Go for `name: type` may not be inaccurate, but it is an odd choice (we're seeing more comparisons of Rust and Go than Rust and any language it is closely related to). I believe the origin for Rust's choice is actually t
154.
▲
by
eddyb
12y ago
No, that has been refuted to death (on reddit, mostly) - the BitTorrent Sync folder was created much later by random people making the same faulty assumption.
155.
▲
by
eddyb
12y ago
Not to mention it would be difficult, if not impossible, to parse in the first place (the contents of a macro invocation are stored as token trees within macro AST nodes, within the regular AST).
156.
▲
by
eddyb
12y ago
That link is outdated, see http://doc.rust-lang.org/arena/ .
157.
▲
by
eddyb
12y ago
Well, you wouldn't go for Arc (atomic RC) unless you need to share data across tasks (threads), within the same task you can use Rc. This is different from shared_ptr in C++ which is always atomic and LLVM has to try hard (in clang, no
158.
▲
by
eddyb
12y ago
There is an interesting claim about Rust: > However, it prevents you from writing generic macros that use any l-value – we can’t write swap!(x[0], x[1]) as we could in Common Lisp. As long as `macro_rules!` has existed (I could be wrong
159.
▲
by
eddyb
12y ago
The Rust compiler cannot assume the loop will never iterate, the analysis phases that could determine that are ran before optimizations. And optimizations are performed by LLVM, with no feedback to the compiler. I actually analyzed your exa
160.
▲
by
eddyb
12y ago
Right, that too, no first-class lvalues in Rust.
161.
▲
by
eddyb
12y ago
traceur-compiler can preserve ES6 syntax (without desugaring it), it's only missing automated feature detection at runtime (which I wanted to add more than an year ago, but was busy with other things).
162.
▲
by
eddyb
12y ago
Not `map[k] = v;`, which is deal breaker.
163.
▲
by
eddyb
12y ago
I would guess `Arc<Mutex<T>>`, `Arc<RWLock<T>>` and `Arc<SomeConcurrentContainer>` would all work (cloning them is a ref-count - the handle gets copied, not the contents).
164.
▲
by
eddyb
12y ago
They already have automated Haskell packages from cabal, it shouldn't be hard to integrate cargo with nix once it's more stable. You wouldn't even require upstream NixOS packages, just place built cargo packages in the nix st
165.
▲
by
eddyb
12y ago
Having used both zypper and apt-get, I find the latter very lacking, even when coupled with other tools. Take `zypper se -s`, for example - or if you prefer the long form, `zypper search --detailed`. How do you get that information from any
166.
▲
by
eddyb
12y ago
The Mentalist reference, anyone? In any case, pretty cool project, I'm a bit amazed how far we've come since I've last played with OCRs (and defeated one bad CAPTCHA implementation, still in use at pastebin.com it seems).