HNHacker News
TopNewBestAskShowJobs

joaonmatos

134 karma · joined April 20, 2021

submissionscomments
joaonmatos··on On the unexpected joys of Denglisch, Berlinglish and global Englisch
I’ve seen retired Brits live in southern Spain and Portugal for 20+ years calling themselves expats and not making any effort to integrate, even though they have all the intent of staying there and not returning to England.

So expat/immigrant seems like a very social/economic background distinction.

joaonmatos··on Displaying My Washing Machine's Remaining Time with Curl, Jq, and Pizauth
Many cases I knew, people would have several repeaters and extra routers to extend coverage in big houses, and not set it up correctly in PA/Bridge mode, so peripheral network devices would be locked behind in a separate NAT’ed subnet.
joaonmatos··on Java 20 / JDK 20: General Availability
`var` in Java is local for a reason. In most contexts I can think of the variable either was created above or was passed in as a parameter/object field. Unless you set it from a weirdly named creation pattern/function.

Regarding records, you never had someone update a POJO, add a field, and forget to update equals and hashCode?

Sealed classes are great for everything parsing/validation, in data modelling. They're not a solution for behavior polimorphism, but I don't think they were supposed to.

joaonmatos··on Cyclists now outnumber motorists in City of London
The Berlin S-Bahn Ring is a looping railway around the city center. It excludes some higher density areas in the north of the city and includes some less populated areas in the south of the city, but being inside the ring is the most accepted benchmark of living in the city core.
joaonmatos··on Twitter Blue breaks EU consumer law by showing prices without tax
It’s okay if you don’t want to change your frontend for a foreign country, you just can’t do B2C business with a market of half a billion people :)
joaonmatos··on MailCrab
Which is a factor that really does not matter for a test server
joaonmatos··on “Clean” code, horrible performance
It is the exact same situation, though. Most people can just chain a sort and a binary search to do it, and both are included in most languages. Or just put it into a tree map, if your language has it.
joaonmatos··on Facebook and Google hand over user data, help police prosecute abortion seekers
Disingenuous. Contraception and abortions freed women from being locked into patriarchal family structures (see the thousands of years of history where women were passed from father, to brother, to husband with no choice in the matter).
joaonmatos··on “Clean” code, horrible performance
Are you even manually implementing sorts frequently?

Even languages that are notorious for having tiny libraries, like C and JS, have built-in sorts.

joaonmatos··on Infinite-Storage-Glitch – Use YouTube as cloud storage for any files
Elon Musk was the one claiming to do it
joaonmatos··on Flow Manifest(o)
I love that this website is just Wordpress with the default 2020 theme. Even I did more CSS tweaking when I was building out a business site for my father.
joaonmatos··on Less gym time, same results: Why ‘lowering’ weights is all you need to do
Yes, but that’s just because most people have stronger legs than backs so it’s easier for them to jump up to the bar that to pull themselves up.
joaonmatos··on Kyrsten Sinema Switches to Independent, Complicates Democratic Control of Senate
Democrats are beholden to the same powers that republicans are, so they play the rotating villain. There’s always a “moderate democrat” that plays with republicans to water down any significant law. These representatives need to be so scared of being recalled or primaried out that they listen to the electorate rather than the corporate donors.
joaonmatos··on Subsurface: An open source dive log
Linus Torvalds, besides maintaining the kernel, is also a diver.

According to the website:

> In fall of 2011, when a forced lull in kernel development gave him a chance to start a new project, Linux creator Linus Torvalds decided to tackle his frustration with the lack of decent divelog software on Linux.

> Linus worked with a team of developers, and Subsurface is the result. It now supports Linux, Windows and MacOS and allows data import from many dive computers and several existing divelog programs. It provides a quick and easy way to see the key information provided by a modern dive computer and lets users track a wide variety of data about their dives. In fall of 2012 Dirk Hohndel took over as Subsurface maintainer.

This was not his first time creating software to scratch an itch. Linux and Git also came from it. Like with Git, Torvalds gave away maintainership to focus on Linux, but we are grateful for his initiative.

joaonmatos··on Tell HN: Rust Is Complex
Waiters and pollers are artifacts from the fact that Futures in Rust are lazily scheduled, unlike Javascript, for example, where Promises are eagerly scheduled and executed.

When you don't want to block your process and program in a reactive, non-blocking way, which is what futures and promises are an implementation of, what you are actually defining is something like this:

> "our process will do some synchronous work, then it will need to stop at point X to wait for asynchronous data"

> "after that data arrives, we can restart our process where it stopped, at point X, and do some more work until it hits point Y, where it will need to wait some more asynchronous data"

> "after that also completes, we can restart from Y, and process until the end of the function"

However, the problem that arises is _how do you store the variables that are being used in this function_? Particularly those values that would be saved in the stack, because by returning the function, the program needs to pop all those stack frames so that the caller can continue executing.

There are two ways of accomplishing this. The first way is to use stackful co-routines, aka threads. The OS does this, but platform threads have very high overhead, so many languages avoid it. You can also use the OS's reactive APIs or thread pools and implement your own scheduler with virtual threads on top, which is what Go or Erlang (and soon Java) do, but then you can't avoid that runtime overhead, which Rust and C++ don't want to have, or maybe you want a more lightweight model (which Javascript wanted).

In that case, the other approach you can do is explicitly represent the processes' variables and state as a structure in the heap, and create functions that operate on those structures. In Javascript you can easily do this (you can capture the values in a closure), and in Rust it is more complicated but doable, and in general you can do this in most languages.

The downside here is that, instead of being able to simply code your process in a straightforward way and have it block implicitly, you need to explicitly code the synchronous steps between each asynchronous wait, which results in either callback hell, confusing functional styles such as continuation passing, or future combinators and callbacks.

What async lets you do, then, is have the compiler write those state machines for you. If you mark your function as async, the compiler will create the closure for you, the state transitions for you, deal with waiting for nested futures for you, and so on, and you can just write the code in the 'dumb' synchronous style. This is common to all the async implementations, from Rust to JS to C#.

However, at some point, you need to actually drive these state machines. You need some kind of scheduling that is able to receive external events, get the state machine that is waiting for it, and execute the next state transition. Driving these state machines is done using those waiters and pollers. Rust exposes these APIs, because it does not bundle the executor, and so it exposes those methods so that async runtimes like tokio can be built against a standard API. Javascript, on the other hand, still needs to perform those tasks but, because it has a runtime of its own, implements an execution service implicitly, and so the external interface of Promise does not need to expose that concern.

joaonmatos··on An easter egg when you Google “Dart Mission”
Works on iOS 16 Safari
joaonmatos··on Why do arrays start at 0?
On elevators you don’t see “R/C” unless the elevator is very old, and the same for office building directories or shopping centres. In almost all cases it’s the number zero. OTOH, in countries like Germany you will see the “E” for Erdgeschoss everywhere.
joaonmatos··on A 14kb page can load much faster than a 15kb page
English is my second language, and the comma separating that particle from the rest of the sentence makes it pretty explicit even for me that it is talking about the platform, at the same semantic level as “powerful”, “extensive” and “to serve your sites […]”.
joaonmatos··on Why do arrays start at 0?
That is a description of the commonly agreed upon definition of the C abstract machine and language semantics. You could simply define the language another way with regards to this behaviour.

Not that I would want to do it, I think zero-based addressing is not very taxing for the convenience of being closer to how we think of memory addressing.

joaonmatos··on Why do arrays start at 0?
For most cases you could get away with some index transformation logic in the compiler (but probably your language would need special types for indices, so I do agree with you that it is not worth the trouble).
joaonmatos··on Why do arrays start at 0?
Quick complement. Where I’m from (Portugal) we use the literal number 0 for the ground floor.
joaonmatos··on If everyone bicycled like the Danes, we’d avoid a UK’s worth of emissions
Well, you may still end up needing a faster vehicle, and perhaps a BEV is indeed better for you. The fun thing is: most people live or are projected to live in cities, so this is still applicable to them. Different people may use different modes of transportation.
joaonmatos··on Micromobility: The Obligatory Origin Story
I wonder why velocipede users end up on the sidewalks. Could it be because they do not feel safe on the road, where they should be? Or that bike lanes have no separation from the road and often have larger vehicles parked there?

In general, I suspect someone is purposely ignoring the gas-powered, 3-ton metal elephant in the room (road?).

joaonmatos··on Apple tells employees to work at the office three times per week starting Sept
The short term will obviously be problematic for those people. However, in the mid term they can move some of those service activities to residential areas instead of business districts (provided that zoning regulations become less senseless than they are now), and in the long term those demographics can be redirected to more productive endeavours (by the combination of the appearance of new industries that leverage increased workforce availability and a general decrease in working hours).
joaonmatos··on Beginner's guide to error handling in Rust
Copy types must be trivially copiable bitwise (the clone implementation is returning the deref of the cloned type), so a copy is a move except for the fact that the previous reference is not invalidated.

The docs for the trait (core::marker::Copy) are pretty good

joaonmatos··on The Log: Real-time data's unifying abstraction (2013)
This is probably one of the best written articles I’ve seen this year, which is funny seeing how old it is.
joaonmatos··on Vegan burger hyped for tasting like ‘human meat’ wins award
How is some cheeky halloween joke food a PR disaster?
joaonmatos··on France bans veggie ′steaks,′ ′sausages′ to describe vegetarian products
I hope not
joaonmatos··on France bans veggie ′steaks,′ ′sausages′ to describe vegetarian products
Your parent comment apparently thinks farmed animals don’t eat plants too
joaonmatos··on France bans veggie ′steaks,′ ′sausages′ to describe vegetarian products
I suppose you think animals exist out of thin air, as opposed to the reality of their needing more plant-based calories, for the calories they provide you, than what you’d need if you cut out the middleman.
← PreviousPage 2 of 3Next →