HNHacker News
TopNewBestAskShowJobs

slaymaker1907

2,545 karma · joined November 22, 2016

submissionscomments
slaymaker1907··on Mathematics has changed. Let's act like it
You can definitely use it as an incredibly powerful learning tool. I've been using it to guide me through Haskell and I've learned so much more than I did in college when I had spent way more time on it (that time being 10 years ago so I had forgotten most of it). It's invaluable being able to go and ask the AI questions and have it rephrase the parts you don't understand. I spent a good hour with it figuring out exactly what the traverse function does (`traverse (\x -> ['z', x]) "ab"` probably doesn't do what you think it should).

Spoiler: The <> combines lists as cross joins (for-loop within another for-loop). The lambda maps to new lists ['z', 'a'] and ['z', 'b'] (strings are just char arrays). It then computes the various combinations to recombine them so ['z', 'z'], ['z', 'b'], ['a', 'z'], ['a', 'b']. Note it's not all permutations since you don't have ['z', 'a'] even though that's actually one of the "base" arrays we got from the lambda. It took me a long time to really internalize that and it's still probably not a function I'd reach for.

It is kind of cool, though, that you can do `(,) <$> lista <> listb` and you get a nested for loop.

slaymaker1907··on Rust Style Guide
I have a huge disagreement here. You should absolutely be using Arc and Rc for any references *that live outside of the call stack.*

Don't do weird crap with lifetimes to try and convince the compiler that what you're doing is ok, just throw Rc/Arc on it and be done with it.

The Rc/Arc advice also applies to C++ IMO, though you use different constructs, std::shared obviously, but there is a strong argument to be made for a std::shared_st or something which is single threaded.

It would not surprise me if this advice comes from experience with C++ where there is no Rc so reference counting is very expensive. Even so, you can greatly reduce the expense by passing things by ref where lifetimes are simple which is the vast majority of the time.

slaymaker1907··on C++26 Contracts: Introduction to Preconditions and Postconditions
You should check out the Racket programming language. They actually don’t have types at all in their documentation, they only have preconditions and postconditions which are very helpful in telling you if a function expects non-negative integers or something.
slaymaker1907··on Is library building obsoleted by AI coding?
I’ve wondered the same, but with programming languages. However, there are a couple of reasons why I think programming languages and libraries will be important.

Most importantly, imagine a timeline where no one has invented any programming language beyond assembly. I think an LLM would have difficulties implementing complex programs in assembly without a bunch of supporting libraries.

Sure, the LLM might be able to make the libraries eventually (will it actually know them all without ANY domain knowledge from a human?) but it would take a lot of time and money to do that. And really, you’re still creating libraries, the only question is if you share them or not.

Another thing is that human written code can be much better than what the AI would write. For example, saw it basically duplicate the same complex operation three slightly different ways instead of just abstracting that away in a function.

slaymaker1907··on Border agents can search cellphones without a warrant or reasonable suspicion
The trick around that is to use some form of oblivious block storage. That would completely remove those traces, though it is very performance intensive to anything obliviously.

However, that would clearly make your phone look suspicious from forensic analysis. To counteract that, you have two hidden volumes leaving you with three total systems: your insecure system (first password), the honeypot volume for “clever” actors to find, and then the truly secure volume.

I think one honeypot would be ideal. It needs to be convincing and have data that seems sensitive which would take a lot of effort. Put your nude photos there or something.

slaymaker1907··on C++26: Trivial infinite loops are no longer undefined behaviour
And memcpy is kind of special to C/C++ compilers. Sure, it exists as a function, but it will often have special purpose code generated for that particular location.

It’s obvious why you want to inline memcpy, but the specialization is more interesting. For example, I’ve seen the compiler optimize a memcpy with a static number of bytes and then use SIMD registers to do the copying with no loop at all. It can even be smart enough to take advantage of memory alignment for this.

slaymaker1907··on AI boosted homework scores, then exam scores dropped: study
Unlimited retakes would be an enormous amount of work for professors/TAs/teachers.

Optional homework is often a disaster. At best, students would do it right before an exam and the goal of education is not to just pass exams. They’d probably still get a lower score than if they did the homework when they were supposed to.

What I think is better is to have a due date, but just make the maximum 10% each day it is late. So after 2 days, the highest score you could receive would be 80%.

I liked that system because it gave some flexibility with deadlines while still encouraging you to turn things in on time.

slaymaker1907··on How AI text watermarking works
Try using a subagent loop where you have one agent generate text and another critique the text according to some guidelines/goal.
slaymaker1907··on Born Against, or why hobby programming communities are against LLM usage
You're right, there are tons of different workflows you can do. One of the more innocent ones, regardless of you opinions on vibe coding, is just using the LLM to understand the code base better. Even if I'm vibe coding something, I will often start by having the LLM construct documentation for the current code flows. It's a document that is useful to me as a human because it mostly just gives me code pointers and tells me what it does as part of the larger whole. It's useful for the LLM since it saves a ton on time and tokens in the long run.
slaymaker1907··on PR spam today looks like email spam in the early 2000s
I've personally started focusing a lot more on code quality and communication skills over correctness of solving some leetcode problem. If I could get the infrastructure in place for it in the interview, I would have candidates generate something via AI and watch their process for that (how do they evaluate a plan, how do they review the code, etc.).
slaymaker1907··on Claude Fable 5
It will also cause a lot of trouble for companies with specific data access policies (probably most large companies). My money is on this new thing getting gutted very quickly as they figure out how much this constraint cuts into their bottom line.
slaymaker1907··on Claude Fable 5
That's definitely the case as model distillation is one of the explicit safety carveouts they mention. Though TBF, model distillation is also a big concern for general safety as distillation could allow you to have the model without the other guardrails. It's sort of a master key to the model.
slaymaker1907··on How many products does Microsoft have named 'Copilot'?
While less necessary with AI, Excel is still the king of data entry and basic data manipulation (sorting, filtering, updating, etc.). I’d say that SQLite with a GUI for visualization is a far stronger competitor than Jupyter at those sorts of things. You can do that stuff in Jupyter, but it’s easier in Excel.

Jupyter also has a janky execution model. It doesn’t track dependencies so you have to be very careful in how you separate cells from one another and just running the whole notebook every time seems kind of pointless vs just writing a pure Python script.

slaymaker1907··on Practical Guide to Bare Metal C++
std::array can sometimes give you the best of both worlds for stack allocation in that you statically constrain the stack allocation size (no alloca) while guaranteeing that your buffers are large enough for your data. You can also do a lot of powerful things with constexpr that are just not possible with arrays. It is very convenient for maintaining static mappings from enums to some other values.
slaymaker1907··on EU bans the destruction of unsold apparel, clothing, accessories and footwear
That is not what they should do according to microeconomics because luxury goods are Veblen goods. Decreasing price would lower demand, at least until they lowered it enough that it was no longer a Veblen good.

Basic microeconomics is just that: basic and thus an oversimplification.

slaymaker1907··on EU bans the destruction of unsold apparel, clothing, accessories and footwear
This already happens a lot for used clothes with the thrift store->poor country->landfill pipeline. That third step will likely be a lot less rare with new clothes.
slaymaker1907··on Swift is a more convenient Rust (2023)
A vector of boxes is beneficial if you need to move objects around. If each T is 1000B or something, you really don’t want to copy or even do true moves in memory.

Hell, even if you’re not moving things around explicitly, don’t forget that vectors resize themselves. If you use Box, then these resizes will be less painful with large objects.

slaymaker1907··on Employers, please use postmarked letters for job applications (2025)
As long as you have a FedEx or library nearby, you can print things there
slaymaker1907··on A few random notes from Claude coding quite a bit last few weeks
I enjoy both and have ended up using AI a lot differently than vibe coders. I rarely use it for generating implementations, but I use it extensively for helping me understand docs/apis and more importantly, for debugging. AI saves me so much time trying to figure out why things aren’t working and in code review.

I deliberately avoid full vibe coding since I think doing so will rust my skills as a programmer. It also really doesn’t save much time in my experience. Once I have a design in mind, implementation is not the hard part.

slaymaker1907··on “Stop Designing Languages. Write Libraries Instead” (2016)
I think the examples others have highlighted show the problem with just making it a library. They’re all lacking a lot of features from Prolog, particularly in terms of optimization. Just use Prolog if you need its features and invoke SWI-Prolog like you’d call any other language’s interpreter.
slaymaker1907··on Using Python for Scripting
I might need to try it out. However, I haven't really found a use case yet where the speed of Python has been a major factor in my day job. It's usually fast enough and is a lot easier to optimize than many languages.

I actually sped up a script the other day that had been written in bash by 200x by moving it over to Python and rewriting the regexes so they could run on whole files all at once instead of line by line. Performance problems are most often from poorly written code in my experience, not a slow language.

slaymaker1907··on We should all be using dependency cooldowns
And it needs to be said that you generally cannot tell if a vulnerability is critical for a given application except by evaluating the vulnerability in the context of said application. One that I've seen is some critical DoS vulnerability due to a poorly crafted regex. That sort of vulnerability is only relevant if you are passing untrusted input to that regex.
slaymaker1907··on Prozac 'no better than placebo' for treating children with depression, experts
That sounds like mania which is even more likely considering that early depression is often actually bipolar.
slaymaker1907··on IDEmacs: A Visual Studio Code clone for Emacs
You absolutely don't need extensions for JS development. It is absolutely NOT notepad level. In my experience with beginners, installing an extension is also incredibly easy compared to getting them to edit some vim/emacs config.
slaymaker1907··on OpenAI may not use lyrics without license, German court rules
I think it depends on the music. Most people will have a greatly improved experience when listening to opera if they have access to (translated) lyrics. Even if you know the language of an opera, it can be extremely difficult for a lot of people to understand the lyrics due to all the ornamentation.
slaymaker1907··on OpenAI may not use lyrics without license, German court rules
Why not both? As the GP mentioned, lyrics are also invaluable for people besides training for AI.
slaymaker1907··on OpenAI may not use lyrics without license, German court rules
I'm pretty sure you could even have lyrics with a separate copyright from the composition itself. For example, you can clearly have lyrics without the music and you can have the composition alone in the case that it is performed as an instrumental cover or something.
slaymaker1907··on Claude Code on the web
I haven’t used Codex a lot, but GPT-5 is just a bit smarter in agent mode than Claude 4.5. The most challenging thing I’ve used it for is for code review and GPT-5 somewhat regularly found intricate bugs that Claude missed. However, Claude seemed to be better at following directions exactly vs GPT-5 which requires a lot more precision.
slaymaker1907··on What happens when coding agents stop feeling like dialup?
My favorite is when someone is demoing something that AI can do and they have to feed it some gigantic prompt. At that point, I often ask whether the AI has really made things faster/better or if we've just replaced the old way with an opaque black box.
slaymaker1907··on YouTube addresses lower view counts which seem to be caused by ad blockers
The interesting question is how/if this impacts the recommendation engine. If it does impact recommendations, then that will directly penalize channels with more adblock users.
Page 1 of 34Next →