HN user

professoretc

465 karma
Posts0
Comments213
View on HN
No posts found.

Some markdown flavors for example use \(\), which is probably the worst of them to use.

Some markdown flavors say they use `\(\)` but they also use `\` as the escape character, so in practice you have to use `\\(\\)` which is definitely the worst.

The post I was replying to said,

UB was coined only in the first C standard, in 1989. Prior to that there was no "If you do this, anything can happen".

I.e., the context is, before UB existed as a concept, how would these things be categorized. And I was trying to offer the correction that, before UB existed, it wasn't "all behavior is defined" but rather many behaviors depend on your particular local environment. While that may technically be implementation defined, the current standard requires that implementation defined be documented, and UB-like edge cases were most definitely not documented anywhere consistently in the old days!

Plus, if the LLM goes down (or gets "upgraded" to a model that does the translation differently/wrong), you still have the tool available locally.

GPT-5.5 3 months ago

If my compiler "went down" I could still think through the problem I was trying to solve, maybe even work out the code on paper. I could reach a point where I would be fairly confident that I had the problem solved, even though I lacked the ability to actually implement the solution.

If my LLM goes down, I have nothing. I guess I could imagine prompts that might get it to do what I want, but there's no guarantee that those would work once it's available again. No amount of thought on my part will get me any closer to the solution, if I'm relying on the LLM as my "compiler".

An interesting side effect might be that only people locked out from using LLMs will learn how to program in the future, as vide coding doesn't teach you the fundamentals.

While thinking about/working with LLMs, I've been reminded more than once of Asimov's short story Profession (http://employees.oneonta.edu/blechmjb/JBpages/m360/Professio...). In it, no one goes to school: information is just dumped into your brain. You get an initial dump of the basics when you're a kid, and then later all the specialty information for your career (which is chosen for you, based on what your brain layout is most suited to).

The protagonist is one of a number of people who can't get the second dump; his brain just isn't wired right, so he's sent to a Home for the Feeble Minded to be with other people who have to learn the old-fashioned way.

Through various adventures he eventually realizes that everyone who was "taped" is incapable of learning new material at all. His Home for the Feeble Minded is in fact an Institute of Higher Studies, one of only a handful, which are responsible for all the invention and creation that sustains human progress.

On a phone keyboard, sure, it's as hard as an accent sign (á, for example), difficult but not twrrible. But on a keyboard? Yeah, no one is typing in Alt combos when literally any other construction will do.

For me, --- gets converted to an em-dash (—) while typing, if I have my input method (ELatin) enabled. I'm so used to typing in while working in LaTeX I can easily slip it in elsewhere.

Correct; the ability of a model to reproduce source material verbatim does not necessarily make the model's existence illegal. However, using a model to do just that might very well present a legal liability for the user. I would be interested to see the extent to which models can "recite from memory" source code, e.g., from the various MS code leaks. Put another way, if I'm using LLM code generation extensively, do I need to run a filter on its output to ensure that I don't "accidentally" copy large chunks of the Windows codebase?

I miss TkDesk, which I discovered many years ago when I was first trying Linux, partly because it supports unlimited splits, not just two. In fact, if I'm remembering correctly, when navigating to a subdirectory the default was just to open it in a new split. You ended up with splits containing the full path from wherever you started to your eventual subdirectory (you could scroll the view of splits horizontally once there got to be too many).

https://tkdesk.sourceforge.net/

This also lets you run QEMU over SSH, if you want. I use this in my assembly language course; towards the end I give an assignment to write Hello, World! as a 16-bit real mode MBR bootloader. Students can do the whole thing on our SSH server, including testing in QEMU (and even attaching GDB to it to debug) not needing to install anything locally.

My wife and I agreed to expunge "just" from our vocabulary, at least with regards to asking to do this. It's almost always kind of belittling, implying that the thing you're asking for is easy and obvious, and you're an idiot/lazy for either not doing it already or trying to explain why its more difficult that it looks.

I think any NPC with dialogue important to a goal (a quest, a tutorial, etc) is going to be hard to use generative AI for. It not only needs to be coherent with the story, but it needs to correctly include certain ideas. I.e. if the NPC gives a quest to go find some item at some location, it needs to say what the item is and where it is.

That was my experience when I was experimenting with using current LLMs to generate quests. You can of course ask for both a human-readable quest description and also a JSON object (according to some schema) describing the important quest elements, but the failure rate of the results was too high. Maybe 10% of quests would have some important mismatch between the description and the JSON; the description would mention an important object but it would be left out of the JSON, or the JSON would mention an important NPC but the description wouldn't, etc.

As a player, I think it would get frustrating quickly if 10% of quests were unsolvable, especially since, as a player, you don't know when a quest is unsolvable; maybe you just haven't found the item/NPC yet.

Orthodox C++ 2 years ago

> apparently in C++ a structure cannot really have zero length

Yes it can: https://en.cppreference.com/w/cpp/language/attributes/no_uni...

A structure with no members can be made to have zero length as a member of something else but not as part of its own definition. I.e., the `[[no_unique_address]]` attribute is a property of the member, not of the struct on its own. It's somewhat annoying that you can't flag an empty struct as being really empty, and have no-unique-address-ness applied everywhere it's used automatically; you have to flag every use with the attribute manually.

Prefixes come first, 1 byte each, order doesn't matter except that REX, if present, must come last. Then the opcode, 1-3 bytes. Followed by Mod R/M byte, if present. Followed by SIB byte, if present. Followed by address/immediate, 1, 2, 4, or 8 bytes, if present.

Ugh; there's a reason why I'm switching my architecture course to MIPS32.

The problem is that if you call another function, you won't know whether that function is uses any instructions that require alignment. So in practice, only leaf functions can skip stack alignment. The ABI states that the stack pointer must be aligned to a multiple of 16, plus 8, before any `call` instruction.

For my beginner programming class, I have them use a script `compile` which handles compilation and linking, while also enabling enabling all the warnings/errors I think are helpful, and also doing the above redirection. An absolute beginner doesn't gain anything from invoking `g++` directly.

A typical grocery store will carry on the order of 40,000 unique products. Costco is hard limited to a max of 3,700 unique products. If a store wants to bring a new product in, something must be rotated out. This also means that if a product wants to stay in Costco, it has to sell a certain minimum number of pallets, per month, to be worth it.

The implementation of inheritance (more specifically, polymorphism and dynamic dispatch via vtables) is a problem in games, because it adds an extra layer of indirection, and screws with cache locality. But the semantics of inheritance (X ISA Y) still apply. In an ECS, the implementation is different (struct-of-arrays) but you can still think of an entity as "inheriting from" the various components its built from.