Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
nneonneo
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
49 ms
·
601.
▲
by
nneonneo
4y ago
I already teach borrowing and ownership semantics as ways to avoid memory issues in C. While Rust is a more complex language on the whole, the fundamentals of borrowing and ownership are more broadly applicable concepts.
602.
▲
by
nneonneo
4y ago
And that's why we have Unicode! Vec⟪u8⟫ Vec「u8」 Vec⟦u8⟧ Vec༼u8༽ I'm sure this could open up a whole new frontier of exciting, untypeable language designs. If it works for APL, it should work for any language!
603.
▲
by
nneonneo
4y ago
`impl` exists now, so you can write pub fn read(path: impl AsRef<Path>) -> io::Result<Vec<u8>> { in Rust without needing to declare P separately.
604.
▲
by
nneonneo
4y ago
Memory management is hard. Thread safety is hard. Go (and Java, Python, …) pushes the complexity of the former to a GC, which has its own drawbacks. Few popular languages actually tackle the latter - most languages have safety problems ther
605.
▲
by
nneonneo
4y ago
Worth noting: if you're not seeing the Brotli header, it's probably because something (e.g. your browser) is transparently decoding the declared Content-Encoding (which is `br` for Brotli). That'll yield raw gzip data. In thi
606.
▲
by
nneonneo
4y ago
The main CSS file they're using is https://www.w3.org/2008/site/css/minimum . If you download this with `curl ' https://www.w3.org/2008/site/css/minimum ' -H '
607.
▲
by
nneonneo
4y ago
The statement that a JIT is itself unsafe is tantamount really to saying that “compilers are unsafe” or even “interpreters are unsafe”. All a JIT really is is a way to execute code. As an example, the Rust compiler has some [60+ open unsoun
608.
▲
by
nneonneo
4y ago
Breaking the JIT is just the first step for most browser exploits. The JIT lives in the renderer process, which is heavily sandboxed in modern browsers. To do anything useful, an exploit usually has to compromise the browser process with a
609.
▲
by
nneonneo
4y ago
A JIT is not, by itself, unsafe. The problem is that maintaining the complex set of constraints and invariants necessary to generate both safe and performant code is extremely difficult, and one slip-up can mean generating code that breaks
610.
▲
by
nneonneo
4y ago
A common approach is that there is a bug in the JavaScript engine (most often a bug in the JIT) which makes it possible for a bit of nasty JS code to start executing arbitrary native code inside the browser tab. This can, for example, invol
611.
▲
by
nneonneo
4y ago
The unskippable ads are getting progressively more aggressive too. Two 30-second unskippable ads on an 8-minute video? It’s a disaster.
612.
▲
by
nneonneo
4y ago
It’s simpler than that; the pixels were just light intensity values (per the article, they had originally intended to get various shades of grey chalk). The scientists just wound up applying their own “palette” to the intensity values.
613.
▲
by
nneonneo
4y ago
If you can run adb shell, you should also be able to run sendevent, which lets you inject touch events into the screen. Coupled with screencap to capture screen contents, you have a way to fully remote control your phone from a connected co
614.
▲
by
nneonneo
4y ago
It sounds like the pause/unpause might be the way to fix this properly, since trying to be heuristically smarter sounds like a recipe for never-ending corner case bugs like the OP’s issue. The patch for pausing and unpausing seems quit
615.
▲
by
nneonneo
4y ago
I used to have a dual physical SIM iPhone X from China! However, when I sent it in to get (warranty) a local Apple repair shop screwed up and replaced it with a North American model. After much gnashing of teeth with Apple Support, I wound
616.
▲
by
nneonneo
4y ago
Rust's philosophy is "batteries not included". It's weird coming from Python or Go, where the standard libraries are much larger, but it makes sense for Rust: keep the standard library small and agile (especially as it i
617.
▲
by
nneonneo
4y ago
Primary source: https://www.courtlistener.com/docket/6359557/979/united-stat... (maybe the URL could be changed to this?) Schulte's lawyer then filed this response to the court: https://www.co
618.
▲
by
nneonneo
4y ago
Yes, you’re right on the state: the state for each level can just be OTCA timestep and x,y within the parent level. However, I think you need to store somewhat more than 2^4 animations: there are 35328 cycles per OTCA tick, and a cell’s ani
619.
▲
by
nneonneo
4y ago
Yeah, this part is very clever and quite well-done IMHO. I suspect the trick is to only store the state for any levels you've actually seen. As you go higher, they can just arbitrarily select a location in the simulation a few levels
620.
▲
by
nneonneo
4y ago
The other trick is that the simulation speed scales with draw distance, such that once you've zoomed out a full cycle the simulation has gotten exactly 35328x faster, which is the period of the OTCA metapixel. There's some lovely
621.
▲
by
nneonneo
4y ago
I suspect it’s a breadth-first search, which is substantially easier to code. .front looks like the queue of nodes to visit.
622.
▲
by
nneonneo
4y ago
Oh my bad! That must be why C++, a definitely not super unsafe language that is basically totally different from C, lets you do this: char buf[10]; std::cin >> buf; std::cout << buf << std::endl; g++ -Wall
623.
▲
by
nneonneo
4y ago
Oh absolutely! Here’s an example from 2019: https://www.cve.org/CVERecord?id=CVE-2019-15900 “An issue was discovered in slicer69 doas before 6.2 on certain platforms other than OpenBSD. On platforms without strtonum(3), ssc
624.
▲
by
nneonneo
4y ago
Rust has some amazing libraries, too. I recently found out about `rayon`, and I applied it to a compute-heavy program I was writing. It was literally a one-line change (as promised!) to go from sequential to parallel, and I didn't need
625.
▲
by
nneonneo
4y ago
Thanks for the correction. I will update my comment accordingly.
626.
▲
by
nneonneo
4y ago
Except, you've failed to check for an error, and you need another line to do that. Suppose the user ended their input or the input is a pipe that's been closed - what does your C++ program do? Here's another example. C++ lets
627.
▲
by
nneonneo
4y ago
I would argue that the type system does make it somewhat more difficult for bad programmers to do egregiously bad things in the language. A carefully written library can be quite difficult to misuse (at least, without panics or using unsafe
628.
▲
by
nneonneo
4y ago
- Ada: good example, has substantial uses in certain areas. However, certain things are quite difficult, e.g. compile-time checked pointers (a la Rust's borrow-checked references). - D, Nim: neither provide strong memory safety guarant
629.
▲
by
nneonneo
4y ago
Unclear what you mean by user input - for arguments, `std::env::args()` exists, and for stdin `std::io::stdin()` exists and provides various read functions. let mut line = String::new(); stdin().read_line(&mut line)?; prin
630.
▲
by
nneonneo
4y ago
Also, there are several different ways to pass self: `self`, `mut self`, `&self`, `&mut self`, and they have very different semantics. Rust could have taken the C++ route here: `fn static foo()`, `fn foo()`, `fn mut foo()`, `fn &
More ›