HNHacker News
TopNewBestAskShowJobs

devit

4,235 karma · joined September 10, 2015

submissionscomments
devit··on The State of Async Rust: Runtimes
And note that it's a good thing that crates are async, because async-in-sync using block_on has only some potential small CPU time overhead, while sync-in-async requires having a thread for each concurrent usage and has potentially catastrophic memory overhead since a user and kernel mode stacks and thread data structures could in some cases be 100-1000x bigger than the future; hence, an async-only create is much better than a sync-only crate (although of course a crate that supports both is ideal from the user's point of view).
devit··on The State of Async Rust: Runtimes
You can use `block_on` from the futures-lite crate (or from other crates) to synchronously call async functions.

Not using async or async crates is not recommended since most new or updated high quality crates now use async.

devit··on 64-bit bank balances ‘ought to be enough for anybody’?
Most CPUs don't have BCD math instructions, so you need multiple instructions, with probably around a 10-100x slowdown in math.
devit··on Unity's Self-Combustion Engine
It looks like the Godot problem is that Chrome on Apple systems by default uses the native Apple OpenGL driver, which are broken, and can be worked around by passing --use-angle=metal to Chrome to tell it to use the new experimental Metal backend.

So in practice it's probably going to be fixed by the time a new game is released, and otherwise you can tell users to start the browser with the proper command line, or contribute a workaround to Godot yourself.

devit··on How to store a chess position in 26 bytes using bit-level magic (2022)
There's a simple trick to encode it: if there are less than 32 pieces, invert the bitboard (easily decoded since boards can't have more than 32), while if there are 32 pieces flip the board vertically (easily decoded because white pawns can't be after black pawns with no captures).
devit··on B612 Font Family
Seems really bad to me.

There's a lot of distracting glitches like the K and Q having small gaps where strokes come together, and even glyphs like the N, M, Y and Z have weird little gaps at the joints, the F and B have a bizarre overhang at the upper horizontal stroke, the 1 and 6 have a weird cut in their strokes.

There are lots of weird confusing choices like the parenthesis being a round rect instead of a bow shape, the @ having a "complex a" inside, the 3 and 5 using a "cute" diagonal layout instead of the normal "rounded-and-rect layout".

Seems horrible for something that should be as simple as possible. The default system UI fonts like DejaVu Sans, Segoe UI, Roboto, etc. are far better.

devit··on Whonix – an OS focused on anonymity, privacy and security
Well, unless you absentmindedly type in your mail address, name or any other real credentials.
devit··on The SHA256 for this sentence begins with: one, eight, two, a, seven, c and nine.
Presumably generated lots of variations of that sentence. It's 28 bits, so you only need to have around 14 places where 4 variations are possible.

For instance, it could start with "Was", "I was", "verifying" could be "checking" or "computing" or "testing", etc.

A bit tight, but it seems feasible with some work.

devit··on Peredvizhnikov Engine: Lock-free game engine written in C++20
It says that it's actor-based, and sending messages to an actor is equivalent to running the actor function under a mutex, and thus reduces parallelism (in other words, you have N threads sending messages, but only 1 thread running the actor code, so it's just as serialized as a mutex), so while it may technically be "fully lock-free", using actors means that there is no parallelization improvement.
devit··on I wired up my bike's GPS to order me pizza during a gravel race
That's because the author apparently neglected to parse the resulting page to ensure that the submission succeeded.

If you terminate the system right after sending a form there is no guarantee that the data even left the local buffers for the network.

devit··on Maybe Rust isn’t a good tool for massively concurrent, userspace software
You can use impl Borrow<T> for that if the choice is static.

If it's dynamic, you can use Cow or the supercow/bos/... crates if you want Arc/Rc to be options as well.

devit··on Maybe Rust isn’t a good tool for massively concurrent, userspace software
Rust is designed like this because it seeks to achieve zero-cost abstractions and safety.

Or in other words, the goal is that you can think in abstract what the natural optimal machine code would be for a program, and you can write a Rust program that, in principle, can compile to that machine code, with as little constraints as possible on what that machine code looks like.

Unlike C, that also has this property, Rust additionally seeks to guarantee that any code will satisfy a bunch of invariants (such as that a variable of a data type actually always holds a valid value of that data type) provided the unsafe code part satisfies a bunch of invariants.

If you use Go or Haskell, that's not possible.

For example, Go requires a GC (and thus requires to waste CPU cycles uselessly scanning memory), and Haskell requires to use memory to store thunks rather than the actual data and has limited mutation (meaning you waste CPU cycles uselessly handling lazy computations and copying data). Obviously neither of this are required for the vast majority of programs, so choosing such a language means your program is unfixably handicapped in term of efficiency, and has no chance to compile to the machine code that any reasonable programmer would conceive as the best solution to the problem.

devit··on Farewell EC2-Classic, it’s been swell
Do they really not do live migration or at least auto-restart (if configured) in those cases?
devit··on Farewell EC2-Classic, it’s been swell
It's not clear, but my interpretation is that they contacted every account holder, somehow convinced them to migrate (perhaps with discounts and/or threats of termination) and then shut down once everyone migrated.

Would be very interesting to learn how that was possible, it seems surprising to me that there wasn't even one instance that the owner forgot about or just was unwilling to do any work on.

It's possible that credit card expiration was the key, as that may have automatically disabled almost all forgotten accounts.

devit··on Organic Maps
OsmAnd, while a bit harder to use (but not that much), is much better than Organic Maps: it can show satellite imagery from both Google and Microsoft (and download it for offline use!), has a 3D map view, supports coloring slopes, has a bunch of specialized functionality for hiking, cycling, skiing, maritime navigation, can record trails, can route according to vehicle dimensions and in general can do everything (except for things that require access to Google's data like routing based on live traffic data and showing data like opening hours that businesses put in Google Maps).
devit··on Doom for 16-bit DOS computers
Well, it's going to look like normal Doom.
devit··on Making life (even) harder for proprietary modules
Seems easily avoidable by having the modules rendezvous in one of the myriad ways that are possible given that both run in kernel mode with full privileges.

For example, you can walk the kernel-only page tables, find all executable pages, and scan them for a magic string that the other module puts in their text section.

devit··on Embracing sabbaticals, sunsetting retirement age
You might be dead before 60.
devit··on Choosing the Right Rust Web Framework: An Overview
Rust is the best programming language, so the question is more why you wouldn't use it.

And the answer is you wouldn't use it if there's a library or existing codebase in another language that is much better than the Rust equivalent, and the program is short enough that it's simpler to directly use that language rather than writing a binding or RPC interface.

Or if you need the software to be written by someone who doesn't know Rust and doesn't want to learn (but in that case, they might not be able to write a correct program in any language, so this strategy is probably best reserved when a program that only works properly sometimes is acceptable).

devit··on The first conformant M1 GPU driver
The article claims that Apple's compiler doesn't use the instruction, so it seems like the compiler author did indeed forget or never learn about it.
devit··on Pixel Binary Transparency: verifiable security for Pixel devices
On Google Pixel devices you can load your own verified boot key into the "avb_custom_key" partition and then it will only boot OSes signed by it (it will also say that you are running a different operating system in the boot screen).

GrapheneOS for instance uses this mechanism.

Unfortunately you can only register one key and you have to wipe the device to change it, but that's still fine for most use cases.

devit··on uBlock Origin Lite now available on Firefox
I assume Firefox doesn't have Chrome's arbitrary limit on the number of filtering rules, right?
devit··on FreeBSD replaces bubblesort with mergesort on SYSINTs
Trucks drive just fine with no rear view at all other than side mirrors, so cars can do that as well.
devit··on The Hallucinated Rows Incident
That also suffers from integer overflow if they implement it naively as they seem to show in the blog with a `pub trait Modification: PartialEq + Default + Add<Output = Self>` and using primitive integers.
devit··on The missing C++ smart pointer
T&& doesn't run the T destructor when it's destroyed, which is the whole point of unique_ptr.
devit··on Spotify looked to ban white noise podcasts to become more profitable
I guess their issue might be that if people listen to white noise 8 hours while asleep every night and Spotify distributes their monthly fee weighted by time listened, then a lot of their fee will go to the white noise for sleep and thus the total fee distributed to their daytime music would be unexpectedly significantly reduced.

The easy fix would be to cap track time weight, although that is susceptible to an attack of splitting the white noise in many parts and publishing a playlist.

I guess a possibility could be to somehow compute "song variety" (i.e. entropy in a model where the decoder can generate noise/randomness) and weight by that, but not sure if the available lossy codecs are good enough to do that.

devit··on The original source code of the vi text editor, taken from System V
This code implements the most important feature of the editor in question: https://github.com/Cube9999/vi/blob/master/vax/ex_cmds.c#L45...
devit··on Desktop Linux has a Firefox problem
That's obviously infeasible (either it would be bad or it would cost too much time/money).

However, maintaining a variant of Ungoogled Chromium or Vanadium targeted at desktop Linux would be feasible.

devit··on Toki Pona: an attempted universal language with only ~120 words
"continuous" (in this actually incorrect usage, since the correct term is "dense")

->

said of an algebraic structure such that for every x != y there exists z such that x < z and z < y

->

characteristic ("nimi"?) of a set ("poki") where for ("tawa?") all ("ale") thing ("ijo") different ("ante" + "lon"?) than other ("ante" + "nimi"?) thing ("ito") there exists ("lon") a new ("sin") thing ("ijo") such that the first ("wan" + "nimi" + "ito"?) thing is less ("lili") than the new thing ("sin" + "ito"?) and the new thing ("sin" + "ito"?) is less ("lili") that the second thing ("tu" + "nimi" + "ito"?)

Would need some way to join into a grammatical structure and probably a preamble that establishes that the context is mathematics.

devit··on Toki Pona: an attempted universal language with only ~120 words
Seems ineffective with abstract concepts.

"In mathematics, a real number is a number that can be used to measure a continuous one-dimensional quantity such as a distance, duration or temperature. Here, continuous means that pairs of values can have arbitrarily small differences. Every real number can be almost uniquely represented by an infinite decimal expansion."

->

"toki pi nanpa, nanpa lon li nanpa li ken lukin e suli tawa wan. lon ni la, nanpa tu li ken ala li poka li ken lili. nanpa lon ali li ken lukin kepeken nimi nanpa mute tawa pini ala"

->

"Talking about numbers, when a number is present, it can be seen to be important or significant to an individual."

"In this context, the number two might not be significant or might be seen as small or lesser."

"All numbers can be seen using many number names endlessly or without an end."

ChatGPT 4, obviously in separate chats: as you can see a complete failure to convey and roundtrip the original message.

← PreviousPage 9 of 34Next →