Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
trealira
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
21 ms
·
271.
▲
by
trealira
2y ago
No problem; I'm glad to be helpful.
272.
▲
by
trealira
2y ago
CPUs can execute arithmetic instructions fast, because we've been trying to execute sequential instructions faster for years. One way to do this is to create a pipeline: while the result of one instruction is being calculated, start re
273.
▲
by
trealira
2y ago
> Also.. why is `node + 1' even a valid comparison here? In C and C++, when you add 1 to a pointer, you actually make it point to the next object of that size in memory, e.g. if I have a pointer to a 4-byte integer at address 0x8000
274.
▲
by
trealira
2y ago
If the revenue and spending of the US doesn't change, it will default on its debt within the next 20 years. > Under current policy, the United States has about 20 years for corrective action after which no amount of future tax incre
275.
▲
by
trealira
2y ago
You seem unreasonably angry at this article for not immediately denouncing capitalism, and ignoring any possibility that there's a cultural aspect. The free market is not a new concept; why wasn't the birth rate as much of a probl
276.
▲
by
trealira
2y ago
The post is from 2022. However, looking at the table of contents [0], she seems to spend a lot of the book on types and pointers. That's cool, since the compiler books that I've seen don't cover languages with pointers and po
277.
▲
by
trealira
2y ago
> they say it's a social problem that must be legislated to get fixed Where did they say this?
278.
▲
by
trealira
2y ago
Most programming languages today don't have dynamic scoping. Here's something you could do in a language that had it. print_x() { print(x); } foo(msg) { let x = msg; print_x(); } main() { let
279.
▲
by
trealira
2y ago
Because they threaten, harass, boycott, and stir up bad PR? You're suggesting the only recourse for people like Aleta would be to defame, boycott, and threaten violence against these people even further. It's medieval.
280.
▲
by
trealira
2y ago
She details what happens. > I lost count of how many people were harassed for following me on Instagram and reported unfollowing me out of fear. They even looked up followers’ employers on LinkedIn. I had to delete all the online photos
281.
▲
by
trealira
2y ago
The idea behind a free market is to use the desire for profit as an incentive for the self-interested to collaborate with others and serve the public interest in doing so; this is why the state promotes the formation of businesses and punis
282.
▲
by
trealira
2y ago
That reminds me of this program, which calculates the month and day given the year and the day of the year [0]. There's a version that abuses goto, and one that stores state in variables and only uses structured statements. You probabl
283.
▲
by
trealira
2y ago
It could be a mistake. I've accidentally flagged and downvoted comments before and then only realized it when looking at the list of comments I've flagged and downvoted. I'm more careful now, though.
284.
▲
by
trealira
2y ago
That's pretty cool; thanks for showing me. I guess x86 instruction encoding isn't as bad as I thought, then.
285.
▲
by
trealira
2y ago
Admittedly, I never wrote an assembler, but the encoding of x86-64 seems pretty convoluted [0] [1], with much of the information smeared across the some bits in the Mod/RM and SIB bytes and then extended by prefix bytes. It's more
286.
▲
by
trealira
2y ago
Studying the x86 architecture is kind of like studying languages with lots of irregularities and vestigial bits, and with competing grammatical paradigms, e.g. French. Other architectures, like RISC-V and ARMv8, are much more consistent.
287.
▲
by
trealira
2y ago
That makes sense; that's how I interpreted it.
288.
▲
by
trealira
2y ago
> If Meet users are told why their meeting isn't working correctly but Zoom, Teams and Slack, Meet users are going to have a better experience that Zoom, Teams or Slack has no way of replicating. I had to re-read this a few times; d
289.
▲
by
trealira
2y ago
> And obviously we as a society created this stark contrast between male and female. Look at animal kingdom How so? Many species of animals show sexual dimorphism.
290.
▲
by
trealira
2y ago
Thanks, that's a good case. Actually, the JavaScript semicolon insertion algorithm [0] seems more complex than I had remembered. I had thought of them as variations on the semicolon insertion in BCPL, but it seems like that's an o
291.
▲
by
trealira
2y ago
Haskell also inserts semicolons, but it has a different rule, which I think is a bit interesting. If the current line starts on the same line that the previous expression started on, then a semicolon is inserted at the beginning of the curr
292.
▲
by
trealira
2y ago
What makes Go's semicolon insertion algorithm different from JavaScript's? They seem similar to me. Isn't it just that the Go compiler requires very strict formatting, which saves you from getting bitten by errors due to unex
293.
▲
by
trealira
2y ago
To be fair, that's not actually in the book. I said it was based on a function from that book, but below is the version they actually write in the book; I apologize for unintentionally misleading you. I wrote the above function myself
294.
▲
by
trealira
2y ago
The C language seems to really like reading/writing data and then modifying it, or modifying data and then reading/writing it, which can make for some dense one-liners full of side-effects. The pre- and post- increment and decreme
295.
▲
by
trealira
2y ago
I would recommend the book Haskell in Depth , which covers both of those topics (monad transformers by chapter 6, lenses in chapter 3 and chapter 14). It also covers some other advanced features, like Template Haskell and concurrency, and
296.
▲
by
trealira
2y ago
I was ready to disagree, but the article makes a good point about business-like non-profits. I hadn't been thinking of hospitals and universities when reading the title; those are notorious for having bloated administrations that drive
297.
▲
by
trealira
2y ago
Typo: that line with "cbnz" should be "cbz". The CBZ instruction branches to a label if a register is zero, and CBNZ branches if the register isn't zero.
298.
▲
by
trealira
2y ago
I think we just define functional programming differently. How do you define it? Also, I just noticed this part again: > Honestly the hardest thing learning OCaml was figuring out where to put the brackets and semicolons. I am 100% serio
299.
▲
by
trealira
2y ago
I'm surprised they didn't try something less clever to optimize their code first. The assembly code could be rewritten like this, so the test requires one branch at the bottom of the loop instead of two (one to jump to the top and
300.
▲
by
trealira
2y ago
One reason you might want an explicit keyword is so that it fails to compile if it can't be calculated at compile time, which is what was intended, rather than fall back to calculating it at runtime. It also seems useful as an ad-hoc m
More ›