Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
trealira
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
24 ms
·
361.
▲
by
trealira
2y ago
The point of a language feature is to have support in the syntax and in the compiler for it. Going down that lane, you could say that C has always had object-oriented polymorphism, because you can manually insert pointers to tables of funct
362.
▲
by
trealira
2y ago
From the point of view of writing a parser, Haskell's whitespace syntax seems like a hack. So, the grammar is defined with braces and semicolons, and to implement significant whitespace, the lexer inserts opening braces and semicolons
363.
▲
by
trealira
2y ago
Yeah, this is a common source of confusion with closures in Python. Example on Stack Overflow: https://stackoverflow.com/questions/233673/how-do-lexical-cl...
364.
▲
by
trealira
2y ago
Well, I wasn't saying those would justify a smart phone, just a relatively dumb phone that can text and call. A school-provided phone could also work, like you said.
365.
▲
by
trealira
2y ago
Did you mean to reply to this comment? "As a parent, yep, in event of a school shooting. It's an insurance policy to hear your child's last words. Address the root cause, because everything else is just a band-aid." htt
366.
▲
by
trealira
2y ago
I could see it in case of emergencies or unexpected surprises. Maybe the parent texts "I won't be able to pick you up today because something came up, so take the bus home, and there should be leftovers for dinner in the fridge.&q
367.
▲
by
trealira
2y ago
You know, you're probably right. It's just been so long since I was introduced to programming languages that I had almost forgotten (though I'm probably younger than you). I remember learning JavaScript as a kid (for some cla
368.
▲
by
trealira
2y ago
There's also parinfer, which does pretty much everything for you. I've heard some people don't like it because they dislike auto-insertion of text. Maybe that's more like what OP expected.
369.
▲
by
trealira
2y ago
"Programming in Haskell" by Graham Hutton has a few small text mode games in the second half of the book: Nim, Hangman, the game of life, and Tic-Tac-Toe; and it walks you through the minimax algorithm. The author also implements
370.
▲
by
trealira
2y ago
I know you're being sarcastic, but even in this linked-list quicksort, it could be made more efficient. By defining lesser and greater separately, you're traversing the list twice. You could compute them at the same time by changi
371.
▲
by
trealira
2y ago
Yes, and AFAIK, you're pretty much free to cause side-effects in functional languages; it's just a bit awkward and somewhat discouraged. It's kind of like how C still has goto, yet it's still a structured programming lan
372.
▲
by
trealira
2y ago
It's a fork bomb in shell script. It's more human readable like this: bomb() { bomb | bomb & }; bomb Apparently this trick doesn't work nowadays due to cgroups: https://unix.stackexchange.com/
373.
▲
by
trealira
2y ago
Imperative programming is probably the most intuitive, but I'm doubtful curly braces and C-like syntax are anything more than coincidence. The first programming language was Fortran, and it didn't look anything like C. This is a r
374.
▲
by
trealira
2y ago
That's the difference between [e] and [ɛ] in IPA (in IPA, with "narrow" phonetic transcription, you enclose the sounds in brackets). In American English, "ace" is [eɪs] and "mess" is [mɛs]. But I don'
375.
▲
by
trealira
2y ago
What is UAF?
376.
▲
by
trealira
2y ago
How can you? (genuine question) I found this project: https://git.sr.ht/~vlmutolo/chainlink But they use generational indices into a vector. You can't append two doubly-linked lists because they have their own vec
377.
▲
by
trealira
2y ago
I hadn't heard anyone use the word "guy" like that before now, and didn't know the word was used like that, so I wasn't thinking of those cases. If you said "I've got a guy" or "software guy"
378.
▲
by
trealira
2y ago
> Zig doesn't have a borrow checker. If your application plans to use memory management strategies like "a bump allocator that frees everything at the end of a frame" or "a bump allocator that frees everything at the
379.
▲
by
trealira
2y ago
> If you're a doctor, and you apply for a hospital job, do they at least reply to acknowledge your application? Do they then send a rejection letter if you're simply 'not what they're looking for'? If they then s
380.
▲
by
trealira
2y ago
Neither am I, but I've seen at least one hentai, and I think it tends to have a manga art style and be more sexually explicit.
381.
▲
by
trealira
2y ago
Another idiosyncrasy. "Elementary school" goes kindergarten, first grade, second grade, ..., fifth grade; then "middle school" is sixth, seventh, and eighth grades; but high school is freshman, sophomore, junior, and sen
382.
▲
by
trealira
2y ago
Wow, I just learned that Forth programmers do something similar to the "point free" style in Haskell (which is discouraged in excess). For example, if you have a function like this: -- f: returns the second argument minus the
383.
▲
by
trealira
2y ago
You're right, people do use it neutrally in greetings, not just maybe. And in more than greetings, more as a general form of address. More specifically, I would say that when not used to address multiple people in the second person (i.
384.
▲
by
trealira
2y ago
Maybe it's used neutrally in greetings (e.g. "Hi guys,") but when referring to someone specific, if you say they're a guy, it will generally be assumed that person is a man.
385.
▲
by
trealira
2y ago
If you just care about the instruction set, there's a long series by Raymond Chen about the AArch64 instruction set. This is the first post: https://devblogs.microsoft.com/oldnewthing/20220726-00/?p=10...
386.
▲
by
trealira
2y ago
> As someone who has both written and read a lot of assembly in a professional context, my colleagues who are assembly writers very frequently prefer Intel syntax. The ones who are mostly (exclusively) readers seem to generally prefer AT
387.
▲
by
trealira
2y ago
I haven't played Exapunks, so I can't say, but about AT&T vs Intel: maybe the order of "mov source, destination" and "sub subtrahend, minuend" is easier, since it lines up with English phrases like "
388.
▲
by
trealira
2y ago
I'm agreeing with them. I was just saying that what they say corroborates my experience, that it makes the best use of my willpower to keep those things out of reach.
389.
▲
by
trealira
2y ago
Yes, but even though there were some advanced compilers back then, particularly for Fortran, there were also really dumb compilers for C and Pascal in the 1980s that didn't do any of that, and just did local register allocation stateme
390.
▲
by
trealira
2y ago
> If you're exerting willpower to avoid the candy bowl on your desk, you're actively engaging in an activity that occupies some amount of your time and attention. Simply not having it there is strictly better. Yep, I totally ag
More ›