HNHacker News
TopNewBestAskShowJobs

MHordecki

359 karma · joined May 1, 2009

submissionscomments
MHordecki··on Live map of public transport in Belgium
This is a simulated map based on published transit schedules. As I’m typing this I sit on a bus that’s nowhere to be seen on the map.
MHordecki··on What is a database transaction?
I’ve found this article lacking. Like some other articles in this space, it introduces isolation levels through the lens of the phenomena described in the SQL standard, but I find that there’s a different, more intuitive approach.

I think it’s more tractable to define this problem space starting from the concept of (strict) serializability, which is really a generalization of the concept of thread safety. Every software engineer has an intuitive understanding of it. Lack of serializability can lead to execution-dependent behavior, which usually results in hard-to-diagnose bugs. Thus, all systems should strive towards serializability, and the database can be a tool in achieving it.

Various non-serializable levels of database transaction isolation are relaxations of the serializability guarantee, where the database no longer enforces the guarantee and it’s up to the database user to ensure it through other means.

The isolation phenomena are a useful tool for visualizing various corner cases of non-serializability, but they are not inherently tied to it. It's possible to achieve serializability while observing all of the SQL phenomena. For example, a Kubernetes cluster with carefully-written controllers can be serializable.

MHordecki··on How many computers are in your computer? (2021)
Here: http://spritesmods.com/?art=hddhack&page=1
MHordecki··on UPS sells trucking unit
> (...) separate from the package deliveries for which UPS is known, is primarily a business-to-business enterprise hauling large industrial cargo in big trucks.
MHordecki··on Open Source Smartwatch
> Is it just me or is the screen not vertically centered on this device?

It's a 3D render. The actual display seems to be more or less centered[0].

> Also the wake up button is on the left instead of the right

One could presumably flip the device and the rotate the screen rendering by 180 degrees. This is how Apple Watch handles right wrist use.

[0]: https://pine64.com/wp-content/uploads/2020/09/PineTive-DevKi...

MHordecki··on Four-day week means 'I don't waste holidays on chores'
> There has been no drop in productivity.

As in, your output is the same as with a 5 day work week? So essentially a 20% pay cut per unit of work performed?

MHordecki··on A case study on strict null checks
This specific problem was already dealt with during the introduction of arrow functions[1]. It makes sense to keep the same parsing semantics.

[1]: https://www.ecma-international.org/ecma-262/11.0/index.html#...

MHordecki··on Java Verbal Expressions
Java got them in the most recent version 15: https://openjdk.java.net/jeps/378
MHordecki··on Rust from a Gopher – Lessons 7, 8 and 9
Wouldn't "Alchemists" fit even better?
MHordecki··on Honda quits F1, invests in carbon-free tech instead
> they have yearly CPU instruction limits

This sounded too ridiculous to me, so I started digging. Lo and behold, [1]. Appendix 8, sections 2 and 3.

The entire thing is a fun read, with pearls such as:

    in the case of an Intel CPU with either the Sandybridge or Ivybridge
    chipset where the competitor chooses not to exploit the AVX feature; the
    competitor must explicitly declare and be able to demonstrate that they are
    not using the AVX feature in the CFD solve process. If the non‐usage of the
    AVX feature is proven to the auditor, the Intel Sandybridge and Ivybridge
    chipset cores can be rated as 4 FLOP/cycle/core rather than as 8
    FLOP/cycle/core.
[1]: https://www.fia.com/sites/default/files/2019_sporting_regula...
MHordecki··on JPMorgan to trade shares of pre-IPO giants including SpaceX, Robinhood, Airbnb
Each company C_n would own 51% of the company C_{n-1} (with C_1 being the actual company). At every point each company owns a sizable chunk of equity.
MHordecki··on The battle to invent the automatic rice cooker
Why would the rice cooker need to be programmed for it, though? For any given quantity of rice, the two variables during cooking is the amount of water and the power of the heating element[1].

It is known that brown rice requires a different ratio of water, but this is something that can be replicated with any method. Does the special brown rice setting change the heat output of the rice cooker?

[1]: Fancy rice cookers use non-constant power, or so I've heard. Not sure how much it influences the taste, though.

MHordecki··on Coronavirus doctor's diary: Why are people remaining ill for so long?
> With the exception of Singapore (which put an Australian in charge of its response)

Both Lawrence Wong and Gan Kim Yong are Singaporeans.

https://en.wikipedia.org/wiki/COVID-19_pandemic_in_Singapore

MHordecki··on A Nvidia Engineer Wrote a Vulkan Driver That Works on Older Raspberry Pi
What is the grammar rule?

I've always assumed that you use "an" whenever a noun starts with a vowel sound, which "Nvidia" does ("n" being pronounced as "en"), thus making "an Nvidia" the grammatically correct one.

MHordecki··on The Coming Chip Wars
The moment they start doing this, other countries will restart their mines and the Chinese leverage (and profits) will evaporate. Rare earth minerals aren't that rare.
MHordecki··on Go generics draft design: building a hashtable
> You can ignore the error case on a result / the None case on an option as easily as you ignore the `err` today.

The point of a result type is that you _cannot_ ignore the None case. Any method that would provide you with the value will also check that the error is not present.

In comparison, you can happily ignore `err` in Golang and continue with an invalid `value`.

MHordecki··on The Next Step for Generics
The vocabulary from that language spec is not even followed consistently in the language's own standard library.

The `strings.Compare`[1] function is used to establish ordering, in the spec sense. You'd think they would name it "Order".

Similarly, the popular go-cmp[2] library provides `Equal` for equality, instead of `Compare`.

[1]: https://godoc.org/strings#Compare [2]: https://github.com/google/go-cmp

MHordecki··on The PEPs of Python 3.9
The linked LWN article[1] mentions context-sensitive keywords, ie. a way to treat certain words as language keywords only in specific contexts. For example, a new match statement that wouldn't require reserving the `match` word as a language keyword, which would require a breaking change and break all existing code that uses `match` as a variable name.

Such a feature requires support from the parser.

[1]: https://lwn.net/Articles/816922/

MHordecki··on What Color Is Your Function? (2015)
> Would the Go runtime lock you to that specific thread and block it or sleep that goroutine and move it to another thread when its no longer sleeping?

By default, the Go runtime does not guarantee any affinity between Go-level threads (goroutines) and OS threads. There's a way to forcibly pin a goroutine to a specific thread[1], but it limits your concurrency.

The Go approach does indeed cause problems wrt. OS-thread-affine state. It's a tradeoff. For RPC-oriented network services, the Go niche, OS thread state is very rare.

[1]: https://golang.org/pkg/runtime/#LockOSThread

MHordecki··on TOML for Modern C++
An exception that proves the rule.
MHordecki··on Await in Rust
This code block doesn't actually work the way the Kotlin one does. Async functions are mere pull-based state machines, so both `one` and `two` will compute serially, without concurrency.

What you need is:

    use futures::join;

    let result = executor::block_on({
        let one = async { do_something_useful_one() };
        let two = async { do_something_useful_two() };
        let (one, two) = join!(one, two);
        one + two
    }); 
I feel like this might be a common stumbling block and hope there will be a Clippy check for this or something.
MHordecki··on Tesla Model 3 becomes best-selling car in Switzerland
> Is there a Swiss version of what they consider cheap fast-food, and is that place still $20 for a basic meal?

Döner joints. They are about ~15 CHF for a meal including a drink.

MHordecki··on New Amazon S3 Storage Class – Glacier Deep Archive
Bandwidth is between 9x and 5x more expensive compared to B2, though.
MHordecki··on Recruit Is Japan’s Top Contender for Global Internet Domination
Note that 150k is just the salary. I don’t know about Japanese compensation structure, but you can easily get >200k including bonus + equity at FAANG in a junior position.
MHordecki··on Chrome will Soon Let You Share Links to a Specific Word or Sentence on a Page
How do you run umatrix with Safari? I’ve thought it’s not available.
MHordecki··on Chinese censors go low-tech to clamp down on Twitter
Looks like this website blocks access from Europe, presumably due to GDPR.
MHordecki··on Storing unboxed trait objects in Rust
Note that it's quite possible for a trait to have infinitely many implementations in any given program. For example, Debug is implemented by u64, Box<u64>, Box<Box<u64>>, ..., and so on. While these happen to have the same size, it's not hard to imagine a situation where this is not the case.
MHordecki··on LLVM’s garbage collection facilities and SBCL’s generational GC
#3 is a thread-local allocation buffer, which is what HotSpot is using. https://shipilev.net/jvm-anatomy-park/4-tlab-allocation/
MHordecki··on How Rust Gets Polymorphism Right [video]
There are other imperative languages in the ML family too, right? OCaml has an imperative mode.

I don't think Rust is that much different from other functional languages. The main critical difference is the manual memory management feature - the way it's acknowledged and used throughout the language and the ecosystem means that the functional patterns commonly used in garbage collected languages don't look nearly as natural in Rust.

MHordecki··on How Rust Gets Polymorphism Right [video]
This is why text articles are superior to videos - or at least an accompanying transcript. Text is very hard to mess up.
Page 1 of 3Next →