HNHacker News
TopNewBestAskShowJobs

pierrebai

1,310 karma · joined October 13, 2011

submissionscomments
pierrebai··on A mundane use of dependent types
But this was not magical: the code has to have a specific check coded in that verify that one thing added here is also added there... AKA a unit test?

Sure it's nice that the language itself has a built-in way to verify a complex invariant and not having to write a unit test.

But what it does illustrate is something I've meant to write a bout for a while: having this kind of convenience let you be lazy about design.

In some (C++) projects I've worked on, adding a new configuration item would automatically documents it because the class to create a configuration item requires you to provide a doc string argument. So it could be even less forgotten.

pierrebai··on GNU poke 1.0
The example in section 1.1.2 Describe-Compute has number of bytes all wrong. I read 4 bytes for 16 bits, 8 for 32 bits...
pierrebai··on On power markets, snow storms, and $16k power bills
Combining real-time data, market with speculators and a product that demand immediate, real-time delivery is a recipe for disaster.

When demand exceed supply, given the real-time nature of the product speculators can come in a take you to the cleaner if they had any chance to beat you to foretelling this would happen.

As I understand it, ERCOT puts a $9000 per MWh to put a limit on speculation, but then what happens is you have to take people off the grid.

The desire to "maximize efficiency" by surfing the demand curve with real-time data is not worth worth the expense of smart meters and risks. Dumb demand curves have another advantage: the utility is forced to over-estimate demand, creating a built-in safety margin.

pierrebai··on Faster JavaScript Calls
I find it amusing that they basically "rediscovered" the C printf() trick, AKA variadic function trick.
pierrebai··on Why doesn’t “Look Around” cover more areas?
Sometimes, article have low information/length ratio.

This one has a ton information of information, but still fail to satisfy because it has a low point/information ratio. It just rambles on with data points and examples.

AFAICT, the points made are:

   * Apple switched from vans to subarus for data gathering. (IOW, they changed their data acquisition equipment.)
   * Their new equipment must be better, because Apple seem to have thrown away all data they acquired with vans.
   * Yet, they still lack tons of labels and mis-label / mis-place many buildings / store etc.
   * Apple seems to be processing data faster than they used to.
... and even these points are must of the shrug / why would I care category, except maybe the fact that most cities are not labeled.

Take-away: you're better off with google street view.

pierrebai··on An unexpected find that freed 20GB of unused index space in PostgreSQL
The chart seems to show an uptick of 2GB, not 20GB. Am I missing something?
pierrebai··on Food Grammar: Unspoken rules of cuisine
Give this article to someone, taking out every occurence of 'food grammar'. I'll bet they'll guess the missing words are 'eating habits'.

Why invent new words for existing concepts? Most of the times, in my experience, it is done to either appear more intelligent or to stake a new ground and be the self-anointed expert.

What's wrong with eating habits?

pierrebai··on Pony – High-Performance Safe Actor Programming
How about, in C++, doing:

template <class T> using shared_immutable = std::shared_ptr<const T>;

template <class T> using isolated = std::unique_ptr<T>;

That's basically how you'd guarantee that shared data is immutable and data passed along is held by only one thread.

Sure, sure, if you try, you can explicitly take out raw pointers out of them. You can also take an axe to your computer but, as they say, "just don't do that".

pierrebai··on Plotnine: Grammar of Graphics for Python (2019)
AM I the only one annoyed by plotnine arbitrary use of abbreviations?

Some are slightly more excusable, like aes instead of aesthetic, but given today's editors auto-completion, I find this kind of choice annoying by making the code less readable for new-comers.

But others are more gratuitous to my sense. For example, the colors gradients. 'Blues' for blue gradient, but GnBl for a gradient going from green to blue? How hard is it to type Greens-Blues? It also makes it harder to remember which are abbreviated and which are not.

pierrebai··on The road ahead for MirageOS in 2021
I'll be a bit of a devil advocate here but both the choice of words and attitude are obscuring facts.

First with a name like MirageOS and calling itself a unikernel, you'd think this was an OS. But this actually has no driver, no user-space, no file system. It receives boot parameters and communicates over TCP or UDP. Mmmm I'd call that a program that receives command-line parameters and communicates over the network. But "program" sounds a lot less exciting than "unikernel".

It does not even manage memory or processes or anything like that. It uses a thin C wrapper to load on virtual machines or . Just like you could with any program that does use any OS facilities.

It does not have process, praising cooperative multi-tasking over multi-threading or multi-processing. Cooperative multi-threading means every part of your system is dependent on every other part behaving correctly to yield the CPU at short interval. Mis-design any single algorithm in the system to be quadratic or worse and you can have long, unpredictable scheduling delays. Forget doing anything requiring real-time responses. Even semi-regular response times are not guaranteed under cooperation.

You could achieve the same goals with a statically linked program in any languages...

pierrebai··on My preferred .NET console stack
For Python, I've standardize on click.

It provides simple decorator to turn functions into commands, sub-commands, etc, with easy options and built-in help.

pierrebai··on The Paradox of Abundance
The problem with the conclusion is that it assumes identifying the healthy information is simple. Fewwilfully choose to be wrong. Everyone is convinced to be right. That is the true heart of the matter: the absence of self-doubt. (And, in many cases, even scorn to those who are not adamant about what they believe.)

To take a topical example, people who believe Trump are doing so because they believe he is the source of truth. They chose him over others because they think career politicians are a power-hungry liars while Trump being an outsider is telling the truth. If you start out with this premise, then everything Trump supporters do and think makes sense.

It has nothing to do with junk thoughts. It has to do with your fundamental beliefs and values.

pierrebai··on Emacs Symbolic Integration
War as a metaphor? I mean, have you ever seen two editors battling out in the field? No.

The war is in usage % among users. VSCode is the most widely used editor by far now, reaching over 51%. [1] Usage converts into further growth, having more and better support from extension developers.

[1] https://blog.robenkleene.com/2020/09/21/the-era-of-visual-st...

pierrebai··on Emacs Symbolic Integration
Which is exactly the reason why... VSCode is winning the editors war.

The main difference is that it chose javascript instead of lisp as its universal language, which, in the current world, is a much better choice for adoption.

Also, saying app can share data easily because the format is text buffer is either a tautology or a non-sequitur: not having a defined format can't be broken, sure, but it also cannot be reliably used. ask anyone who had to maintain bash/awk/perl labyrinthine assemblies...

pierrebai··on GTK4 for Graphical User Interfaces
As a supposedly guide to writing app, the introduction reads more like an opinion piece.

The author has a very anti-C stance to say the least. For an article about writing UI, it spends a lot of time laying out all the short-coming of using C to build a UI toolkit.

Amusingly, Qt is mentioned as initially not having a FOSS license but "now available in version 6 with much less restricted licenses"... that's quite a weak praise given that it is available as LGPL, GPL or commercial non FOSS licensing. He then goes on criticizing Qt for being bloated. Most people would rather say that is very feature-rich. Qt is also modular. You don't need to include libraries you don't use.

English does not seems to be the author native language; there are many bad choices of word, like saying that C in "restricted"; I think he meant it is "limited".

pierrebai··on Sick of spending time on Auth, we built an open source 'Stripe for Auth'
I did find amusing that one of the talking point is to not have to trust AWS with your auth, but you offer a SaaS.

(I haven't read details of the SaaS, maybe all data is still hosted outside of your service, but I would doubt it.)

Not a problem, but a bit of a contradiction. OTOH, SaaS does alleviate some pain.

pierrebai··on Minimal safe Bash script template
Your point seemed like confirmation bias to me. I've been given to use just as many broken bash script as Python. (I'll admit I'm saying that in a false attempt at being fair. In my experience, Python script tend to work better. Then again, I tend to work in mixed env which includes Windows OS.)

You're mentioning exception errors as if having an explicit error message on failure is a problem, not a plus.

What happens when a bash script fails? Or worse, silently fails and leave you with a half-working setup at best and a seriously broken one due to some intermediary step failure being ignored?

If you happen to notice the error that is... like the OP pointed out, almost all bash shell script ignore silently errors and figuring which of the hundred of lines fails on your particular setup is a fun exercise.

And then... which bash debugger to you use to fix problem in bash shell script you been handed? Ah no, it's long reading and echo and trial and errors.

pierrebai··on Minimal safe Bash script template
Shorter minimal safe script template: python.

Seriously, give up on OS-specific, version-nightmare, quoting-hell, hairy-corner-behaviour shell scripts.

I used to install Cygwin and Vim on all new Windows computers. I now install Python and VSCode on all OS. My life has never been better.

pierrebai··on Pointers Are Complicated II, or: We need better language specs
The bug is clearly the writing past the end of an array. That is:

    *(p+1) = 10;
If you start with a buggy program, that it stays buggy after optimizations is not surprising!

Edit: what;s more, the original form of the program also did not write through the q pointer and could have had optimizer the print zero. In the first form, the author assumes the compiler can track the pointer q through q == qi and avoid the optimization that would print zero, but fail to track pointer q through pi + 1 == qi == q.

pierrebai··on Thought Leaders and Chicken Sexers
I wish I'd find it curious the extreme negativity toward the essay, but unfortunately it fits with my world view of people in general: they'll approve of things that concord with their own opinions and interpret everything through the prism of what they already believe.

The essay is labelled ad-hominem by many, even though it provides a cogent argument and multiple supporting facts. Of course, to take an example, the question of the enterpreneur as a luminary and an exploiter depends greatly on what you already believe. I happen to already think that Facebook, Google and co are exerting bad influence, holding and using information they collect about everyone to their own advantage. Others, like Uber, are easy to be thought as direct exploiters.

The attacks on Arc and Bel and succinctness are also argued with factual arguments. (Arguments that I happen to agree with; bias, bias...).

In the end, the essay posits a simple thing: that behind all the pseudo-theoretical posturing underlying PG essays, they are mere opinions pieces.

pierrebai··on A man who posted himself to Australia (2015)
In those years, NY to Japan would not be a direct flight, but would have multiple stops. Then there are the issues of meals and the language barrier in Japan. I think he was pulling your leg.
pierrebai··on macOS to FreeBSD migration a.k.a. why I left macOS
Updates requiring reboot are not applied unless you reboot... so don't apply updates requiring reboot? It's useless to install them if you refuse to reboot. You can't have it both ways.

So the solution, as I said, is to not install these updates. (Or reboot, but you say you don't want reboots.)

pierrebai··on macOS to FreeBSD migration a.k.a. why I left macOS
That is not true. There is a group policy to disable updates. I know, because I have to run updates by hand on my work computer, otherwise I stay months behind on security patches.

Stop spreading lies. It does work. (I also have hot had ads in Windows on all Windows machines I own. But this is a Microsoft product, which always raises these long list of myths.)

pierrebai··on How io_uring and eBPF Will Revolutionize Programming in Linux
Ah the funny things we resad about in 2020.

In 1985... yes I said 1985, the Amiga did all I/O through sending and receiving messages. You queued a message to the port of the device / disk you wanted, when the I/O was complete you received a reply on your port.

The same message port system was used to receive UI messages. And filesystems, on top of drive system, were also using port/messages. So did serial devices. Everything.

Simple, asynchronous by nature.

As a matter of fact, it was even more elegant than this. Devices were just DLL with a message port.

pierrebai··on Apple Silicon M1: Black Magic Fuckery
I agreed. It think it's typical of cargo-culting: explanations don't need to make sense, it's all about the breathless enthusiasm.

Look, want to know how M1 achieve its result? Easy. Apple is first with a 5nm chips. Look in the past: every CPU maker gains both speed and power efficiency when going down a manufacturing node.

Intel CPU were still using a 14nm node (although they called 12+++) while Apple M1 is now at 5nm. According to this [1] chart, that's a transistor density at least 4x.

Not saying Apple has no CPU design chops, They've been at it for their phones for quite a while. But people are just ignoring the elephant in the room: Apple gives TSMC a pile of cash to be exclusive for mass production on their latest 5nm tech.

   [1] https://www.techcenturion.com/7nm-10nm-14nm-fabrication#nbspnbspnbspnbsp7nm_vs_10nm_vs_12nm_vs_14nm_Transistor_Densities
pierrebai··on Killing time with Agatha Christie
This essay seems (I didn't read it fully due to the point I'm making) more a vehicle for the author's desire to display his culture and life than anything about Agatha Christie.
pierrebai··on MCS-48: The quest for 16-bit division on the 8-bit CPU which can’t divide
I didn't, it was an extra-curicular university project.
pierrebai··on An exponent one-fifth algorithm for deterministic integer factorisation
Maybe there is something I don't get, but N ^ 1/5 looks polynomial to me. Even quite small polynome power!
pierrebai··on MCS-48: The quest for 16-bit division on the 8-bit CPU which can’t divide
A loooooong tmie ago (circa... 1992?) I had the same problem with an Hitachi embedded processor. Except our application was hard real-time (controlling the fuel injector of a Ford 150 that was modified to run on natural gas).

We ended-up splitting the division code over multiple loops of the core system so that it would not exceed the allotted time when the engine was running at maximum RPM. It meant that the value that required division would only update at something like 1/6th of the data acquisition speed of all other values, but hey, it worked.

Maybe I still have the source code on some floppy disk somewhere...

Edit: I remembered wrong, it was a GMC truck: https://www.sae.org/publications/technical-papers/content/92...

Edit #2: found a picture of our truck: https://live.staticflickr.com/8487/8186513796_bd60fd3fd2_b.j...

pierrebai··on Ask HN: Good C++ code bases to read?
By reference? Yes.

But the idea of a verified type can be extended by using the verified modifier on your own type. For example, you could have a verified matrix type, where the matrix is guaranteed to be valid, non-degenerate. You can apply it to:

   - matrix
   - vector
   - input data of any sort
And if teh compiler allowed the programmer to declare their own type modifier, the world is your oyster: you could for example tag that a matrix is a world matrix while another a local matrix and provide a function that converts from one to the other...

I wrote a small blog post about the idea:

https://www.spiria.com/en/blog/desktop-software/hypothetical...

← PreviousPage 7 of 15Next →