Better HN
topnewbestaskshowjobs
Log inSign up

wholesomepotato

115 karma · joined Sep 8, 2023 (3y ago) · 49 submissions

Submissions

comment 2y ago · link · parent

Instruction level parallelism will make extra shift free. Other than this it needs to be benched and might depend on cpu/arch. I don't care enough to bench and optimize further.

comment 2y ago · link · parent

I think you're right. Even better. Did you have time to bench it, etc.?

I see what you mean by length. I just skimmed over the text originally as I don't have time for rather lame problems like this. I'd just add 3 bits of length to be part of the index, job done. 12KB lookup table instead of 4KB, assuming 0 is not a valid value (negate to avoid needing 0b11).

comment 2y ago · link · parent

It's unclear what is in the highest byte, so I assume not 0x000x0y0z, but 0xab0x0y0z where ab is unknown (in the past comment I used XX for this). If highest byte is known, then sure, even better.

comment 2y ago · link · parent

Might be wrong but this shortcut corrupts the lower bits with garbage from the higher byte.

The lookup table can detect some, but not all errors, so yeah, it relies on valid input.

comment 2y ago · link · parent

Yes, but also - they lie about the inflation and force the public to hold the bonds anyway (aka. financial repression, yield curve control).

comment 2y ago · link · parent

I'm sorry but most of your comment has nothing to do to what I said, and seems like random rambling. Except:

> 3.2% is absolutely peanuts to what it was some 3-4 decades ago.

But 3-4 decades ago governments, all institutions and economy as as whole were not so much in debt. https://fred.stlouisfed.org/series/GFDEGDQ188S . And this chart doesn't include all the "unfunded liabilities".

You can hike rates to curb the inflation only if it doesn't bankrupt everything and everyone.

And 3-4 decades ago boomers globally were ahead of most productive years of their lives, without the "baggage" of tons of kids and globalization had plenty of room ahead to increase productivity.

I don't want to waste time talking about nonsense like AI and "space exploration". The financial system is screwed. That's all I'm saying.

comment 2y ago · link · parent

What's amazing about it if the debt increased more in the absolute terms? :D . If I max out credit cards I can at least show spending (GDP) growth at least the same as what I borrowed...

How is it not obvious to everyone that this is the end game? Increasing rates will rapidly increase debt, which increases inflation, which pushes increasing rates ...

comment 2y ago · link · parent

it's one XOR, SHL, OR, SHR, AND, on some archs the shifts might come free with the other instruction. I'd expect it to be faster.

a = v ^ 0x30303030lu // normalize to digits 0xXX0a0b0c

b = (a << 12) | a // combine into XXXXXbacb0c

idx = (b >> 12) & 0xfff // get bac

res = lookup[idx]

comment 2y ago · link · parent

What products/services they produce if they're private?

They're in this sweet spot where they're neither held accountable by the voter, nor by the consumer.

The can be wrong over and over and over again and nothing is going to happen. A private company has to at least not loose more money then they can bribe politicians to give them.

comment 2y ago · link · parent

Exxon is a private company so some basic level of competency can be assumed. The Fed is basically bunch of incompetent academic buffoons.

comment 2y ago · link · parent

Would use XOR 0x30303030lu, then OR with a value shifted left 12 bits, take bits 24..12 and lookup in 4k pre-computed lookup array.

comment 2y ago · link · parent

This needs to be said: Every single thing Poettering touched was huge improvement. A great hero of Linux userspace architecture.

comment 2y ago · link · parent

> In an infinite world of abundance ...

:D

comment 3y ago · link · parent

Features of modern CPUs don't really prevent them from real time usage, afaik. As long as something is bounded and can be reasoned about it can be used to build a real time system. You can always assume no cache hits and alikes, maximum load etc and as long as you can put a bound on the time it will take, you're good to go.

comment 3y ago · link · parent

Public discourse was and should always be in the private domain. Anything else is totalitarianism by definition.

comment 3y ago · link · parent

The do increase shareholder value, just in exactly short-term. The problem with publicly traded companies is not as much wanting to increase the value, but how short is the time horizon, when most owners don't have any understanding of the bussiness other than just handful of numbers every quarter.

comment 3y ago · link · parent

If you want to really understand modern money check "Broken Money" book.

comment 3y ago · link · parent

What about my code?

comment 3y ago · link · parent

https://www.service-architecture.com/articles/web-services/s...

After enough people retire that remember how big of a mess this was, we can probably re-use "Service Oriented".

comment 3y ago · link · parent

Wow, how much do I pay to run it on MacOS?

comment 3y ago · link · parent

Helix the binary is around 24M on my system.

Helix uses tree-sitter for rich language support. Tree-sitter's grammars are binary dynamic libraries compiled from some source code. Depending on how they are written and how complex they are, they can be anywhere from few KB to many MB. There's like 150 of them ATM. It's not exactly Helix's fault that some are unreasonably large.

Tree-sitter is a large part of what makes Helix editing experience so good. Unlike regex-based parsing that (Neo)Vim uses (or at least it used to, last time I looked) which often break in weird ways and make the editor very sluggish sometimes.

Helix official releases ship with all the supported grammars pre-compiled to give a convenient fully-featured user experience. It's entirely possible to package Helix without grammars, then compile selected few and so on. Some distros and individual users do so. Grammars compiled by distros / package managers can be re-used between other programs using Tree-Sitter, so could be packages as additional (possibly optional) dependencies.

Honestly 140MB for such a good editor is totally fine with me, but people who can't live with it have plenty of routes to take, like improving Helix integration in their package manager of choice.

comment 3y ago · link · parent

Nice use of both Observer and Strategy patterns!

comment 3y ago · link · parent

> The visceral reactions to OOP here are interesting.

You could say it's a pattern.

comment 3y ago · link · parent

It's like Pox Party. You're exposing them early so they get immune when they're adults from this disease.

comment 3y ago · link · parent

Arguably Xi was a design-bloat. I mean - it was a research project. Nothing wrong with it, but the community got super-excited about it, ignoring ... well, the pragmatic reality. Any time it was mentioned it talked about efficiently editing > 1GB files. Super over-flexible plugin system design.

For a lean and pragmatic text editor look at Helix, Kakoune, even NeoVim or Emacs.

comment 3y ago · link · parent

Even as a non civil engineer I can understand floor plans and alikes and find then immediately useful. Even as a professional SWE these example diagrams don't seem useful or informative enough to justify bothering with them.

Code is too multidimensional to be approximated with 2d drawings. It just doesn't work.

What could work are more conventional architectural code patterns. Things like structured concurrency, but also for higher level. Maybe.

comment 3y ago · link · parent

It's still a rock. Play with a language with proper pattern matching, Rust, Haskell, Ocaml, Scala, and you will also see it's just a rock.

comment 3y ago · link · parent

Your planning to scoop up some on the cheap? Because all it would do is to benefit buyers and price would bounce back very quickly.

comment 3y ago · link · parent

It's like some choice who brainwashes my kids. Are they going to learn about men being pregnant and go to a drag show or that god created earth 5 thousand years ago.

Maybe i could even alternate every year so they are "well rounded".

comment 3y ago · link · parent

I need X. A and B both have X product. It's worth for them something to make me aware of and buy their product over competition. So that $14 is not just "didn't even want".
12