Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
skitter
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
11 ms
·
91.
▲
by
skitter
3y ago
It's well known in Germany under the name Mill, but I cannot recall the last time I've seen anyone actually play it.
92.
▲
by
skitter
3y ago
Mozilla has an interesting sandboxing strategy: They compile some of the C/C++ parts of Firefox (e.g. the ogg parser) to Wasm and then back to C. Because Wasm is memory safe, the resulting C is too.
93.
▲
by
skitter
3y ago
If you append to a slice, you can't rely on the changes showing up in the original slice, nor on them not showing up.
94.
▲
by
skitter
3y ago
Something as simple as adding integers is tricky due to its implicitness. Due to promotion, the following code works on some platforms but is verboten on others: int16_t a = 20000; int16_t b = a + a; But even ignoring size, it
95.
▲
by
skitter
3y ago
In JRE terms, Rust doesn't have Exceptions, but it has Errors.
96.
▲
by
skitter
3y ago
Similarly ldd – which is mentioned in the article – works by setting LD_TRACE_LOADED_OBJECTS, which then gets picked up by Linux's dynamic linker, so any program that doesn't use it can just do whatever instead.
97.
▲
by
skitter
3y ago
When hovering over an item that item is highlighted in pale lavender for only a moment before the highlight moves to the first entry.
98.
▲
by
skitter
3y ago
It's not intrinsic to async functions; you can block on a future inside another future via e.g. pollster or even manual polling.
99.
▲
by
skitter
3y ago
Technically, you can break Go's memory model via race conditions: Write to an interface on one thread while reading it from another and you may read the old vtable pointer but new data pointer / the other way around. Same goes for
100.
▲
by
skitter
3y ago
Firefox does do this.
101.
▲
by
skitter
3y ago
When storing an object in an array, the value is checked to be a Value::Object (which can't be null), but you also have Value::Null, so storing null in an array fails (I think). Storing null in local variables, a static field or an ins
102.
▲
by
skitter
3y ago
VM creation is using unsafe (the line I pointed out above). You're right, I can't find any deallocation either – but weirdly it /does/ segfault (or sometimes have other memory related errors) if I drop the VM while it&#x
103.
▲
by
skitter
3y ago
Your understanding of Rust is correct, but the code uses unsafe: https://github.com/andreabergia/rjvm/blob/93e7e48db085e780b0... As a result, when the VM gets dropped, the memory gets deallocated even if ther
104.
▲
by
skitter
3y ago
You're right there – It looks like the author is trying to express "this lifetime lasts as long as the VM exists", which isn't possible to express in Rust. For VM::new, the callsite just picks a lifetime that lasts long
105.
▲
by
skitter
3y ago
You're right, but that's what's meant - using the Go GC vs also implementing a custom one.
106.
▲
by
skitter
3y ago
If you want near-go-like performance, Jacobin doesn't help you either.
107.
▲
by
skitter
3y ago
Technically, there's memory unsafe memory sharing: Interfaces and slices are mutable and consist of multiple word that are accessed without synchronization, sharing a reference to a interface or slice between goroutines means you can g
108.
▲
by
skitter
3y ago
Rust has those types as Saturating<u32> and Wrapping<u32>.
109.
▲
by
skitter
3y ago
You don't even need C: ctypes.c_int.from_address(id(8)+24).value = 9
110.
▲
by
skitter
3y ago
Rust's (and other languages) memory safety doesn't come from hardware features. Implementing memory safety at the language level means that you don't care about whether the data sits in a paged mapped as read-only, because th
111.
▲
by
skitter
3y ago
Nope, that's just UB, so you cannot know what the code will do. Case in point, running it on linux (compiled via clang) doesn't trigger a segvault for me: main: .cfi_startproc .Lfunc_end0: .size mai
112.
▲
by
skitter
3y ago
Eh, Hare expects you to write and rewrite collections like hashmaps yourself. It just looks like a less flexibe and less useful Zig.
113.
▲
by
skitter
3y ago
Was about to bring up that thread. Having a dictator for life isn't a good combination with that dictator going on unprompted, unhinged rants.
114.
▲
by
skitter
3y ago
That would be great, but that article is about recommendations for applications running on Windows, not about what valid file names applications may encounter. Here's a counter-example: https://github.com/golang/go
115.
▲
by
skitter
3y ago
Because that's how UTF-8 is defined[1]. WTF-8 lifts that restriction. [1] https://simonsapin.github.io/wtf-8/#utf-8
116.
▲
by
skitter
3y ago
Annoyingly, Java, JavaScript, Windows file paths and more don't quite use UTF-16 (well, even if they did, that would be annoying) — they allow unpaired surrogates, which don't represent any Unicode character. So if you want to rep
117.
▲
by
skitter
3y ago
The "black triangle moment": https://web.archive.org/web/20050306071700/http://www.rampan...
118.
▲
by
skitter
3y ago
I'm not sure what you mean? Mutability wasn't the issue, lifetimes was. It already implemented interior mutability according to Java's rules.
119.
▲
by
skitter
3y ago
I'm annoyed at the reason that any/all have to be on this list. If they (and map, filter, …) were methods, you could just write `foo.` and your IDE could show you what methods are available. Postfix would make things easier to rea
120.
▲
by
skitter
3y ago
This is a breaking change too, as it can break type inference: https://play.rust-lang.org/?edition=2021&gist=8d528bcec2b92b...
More ›