HNHacker News
TopNewBestAskShowJobs

Mathnerd314

3,005 karma · joined November 1, 2009

Making the ultimate programming language https://mathnerd314.github.io/stroscot/

In the past I developed SuperTux (http://supertux.lethargik.org) when I was bored.

submissionscomments
Mathnerd314··on Into CPS, Never to Return
What?

Let's say E[h] is "if h == 1 then 2 else 3", a is 1, and b is 2. Then before:

if (if x then 1 else 2) == 1 then 2 else 3

After:

if x then (if 1 == 1 then 2 else 3) else (if 2 == 1 then 2 else 3)

which trivially simplifies to if x then 2 else 3

Your proposed rewrite is "let a0 = if x then 1 else 2 in if a0 == 1 then 2 else 3" which is not a simplification at all - it makes the expression longer and actually introduces a variable indirection, making the expression harder to analyze. The call will require some sort of non-local analysis to pierce through the variable and do the duplication and elimination.

Mathnerd314··on Into CPS, Never to Return
If you think ANF is great then explain how to deal with the transformation from "E (if x then a else b)" to "if x then E a else E b".
Mathnerd314··on 38th Chaos Communication Congress
https://fahrplan.events.ccc.de/congress/2024/fahrplan/talk/H... looks fun. Also https://fahrplan.events.ccc.de/congress/2024/fahrplan/talk/P...
Mathnerd314··on New research suggests that Walmart makes the communities it operates in poorer
> we find that poverty is still 3 percentage points higher in treated counties 10 years after the Walmart opening.

So... 10 years after Walmart opens, poverty is 3% higher, and annual household earnings decline by $4,230. Is this a huge effect? This is something like a 10 point difference on the SAT (https://www.cs.jhu.edu/~misha/DIReadingSeminar/Papers/DixonR...).

Mathnerd314··on Tenstorrent and the State of AI Hardware Startups
I almost forgot about that ARM-Qualcomm dispute, the fireworks are only a few days away.
Mathnerd314··on TikTok divestment law upheld by federal appeals court
Full opinion: https://www.courtlistener.com/opinion/10289420/an-opinion-wa...
Mathnerd314··on Diátaxis – A systematic approach to technical documentation authoring
Well, look at the process of training a chatbot:

- first you make a "raw" corpus, with all the information needed to produce an answer

- then you generate sample question-answer pairs

- then you use AI to make better questions and better answers (look at e.g. WizardLM https://arxiv.org/pdf/2304.12244)

- can also finetune with RLHF or modify the Q-A pairs directly

- then you have a final model finetune once the Q-A pairs look good

- then you use RAG over the corpus and the Q-A pairs because the model doesn't remember all the facts

- then you have a bullshit detector to avoid hallucinations

So the corpus is very important, and the Q-A pairs are also important. I would say you've got to make the corpus by hand, or by very specific LLM prompts. And meanwhile you should be developing the Q-A pairs with LLMs as the project develops - this gives a good indication of what the LLM knows, what needs work, etc. When you have a good set of Q-A pairs you could probably publish it as a static website, save money on LLM generation costs if people don't need super-specific answers.

To add to the current top-scoring comment, though (https://news.ycombinator.com/item?id=42326324), one advantage of an LLM-based workflow is that the corpus is the single source of truth. It is true that good documentation repeats itself, but from a maintenance standpoint, changing all the occurrences of a fact, idea, etc. is hard work, whereas changing it once in the corpus and then regenerating all the QA pairs is straightforward.

Mathnerd314··on On Bullshit (2005)
There is a longer essay called "On Truth", also by Frankfurt, less read but also more interesting IMO.
Mathnerd314··on Francis Crick's "Central Dogma" was misunderstood
One way to look at it is that most college textbooks are bad. They are written by one person, who has limited time, and limited understanding. And then you have a teacher who knows even less than the textbook, trying to explain the textbook.

In contrast, Wikipedia editors have all the time they care to spend on the subject (which is a lot!). They often reproduce the original discoverer's words, when appropriate. E.g., https://en.wikipedia.org/wiki/Central_dogma_of_molecular_bio... uses Crick's words. Whereas in the case of Maxwell, the formulation "is credited to Oliver Heaviside". Long story short: Wikipedia has the best explanations, and if you don't think so then fix it!

Mathnerd314··on Microbenchmarks Are Experiments
I take away a different lesson: Dart is most likely slow out of the box. The author lists several reasons: int vs. Int64, GC interrupts, load hoist optimization. All of these are issues with Dart. Hence microbenchmarks, even without interpretation or validation, point to issues with the language implementation. They are not "meaningless".

It is true, one microbenchmark only shows that said microbenchmark is slow, not that the language as a whole is slow, but the plural of anecdotes is data. If you systematically evaluate a representative set of microbenchmarks (as in the Computer Language Shootout), then it is proof that the language is slow or fast.

Now of course one can argue about what is "representative", but taking random samples of code from across GitHub seems like a reasonable approach. And of course there is the issue of 1-1 translation but at this point LLM's can do that.

Mathnerd314··on RFC 35140: HTTP Do-Not-Stab (2023)
The actual author is one person, user '5225225'
Mathnerd314··on Emit-C: A time travelling programming language
There is the TARDIS monad in Haskell https://hackage.haskell.org/package/tardis-0.5.0/docs/Contro... It doesn't have the multiple timelines or killing features - it just deadlocks if there is a paradox or the timeline is inconsistent.
Mathnerd314··on Thinking about recipe formats more than anyone should
Yeah, personally I'd use markdown too, at this point it is easier to use llama-3.1-8b to parse markdown / text into your JSON format of choice than it is to massage recipes into a specific markup like Cooklang.
Mathnerd314··on The EdTech Revolution Has Failed
These authors have big Google Docs of evidence, https://jonathanhaidt.com/reviews/. But if you read it, you will see the effect is (AFAICT) limited to certain populations. There is a significant fraction of students that do have trouble with executive function and staying on task and will fail to do their homework because of social media access. Then there are the other students that have no trouble staying off social media when they have to do homework.
Mathnerd314··on I'm a neurology ICU nurse. The creep of AI in our hospitals terrifies me
> There’s a proper way to do this.

Is there? Seems like people will complain however fast you roll out AI, so you might as well roll it out quickly and get it over with.

Mathnerd314··on Show HN: I made a minimalistic AI calendar creator to accelerate daily planning
I looked into doing something like this and I was like "Todoist has AI, Notion has AI, how am I going to do any better than them?" So I didn't start. At this point I have specific prompts for ChatGPT and when I need this functionality I manually copy/paste them in and copy/paste the output into the todo apps.

Even after trying the site, I still don't think you have a marketable product, but kudos for shipping. I hope to see you back in a year with "How I made 1 million dollars shipping SaaS apps" blog post. ;-)

Mathnerd314··on OpenCoder: Open Cookbook for Top-Tier Code Large Language Models
Mozilla has a list, https://publicsuffix.org/list/, relatively easy to update. I'm sure there is some Python wrapper library they could use.
Mathnerd314··on Segmenting Credit Card Customers with K-Means: A Fun Dive into Clustering
I would say to look at credit utilization as a function of the other variables. Or more generally each variable as a function of the other variables. There is a bit of this in the initial correlation analysis, but a GLM is more robust.
Mathnerd314··on Segmenting Credit Card Customers with K-Means: A Fun Dive into Clustering
I think glm would be more interesting than clustering, would be good to compare the two. Or maybe UMAP.
Mathnerd314··on Are Devs Becoming Lazy? The Rise of AI and the Decline of Care
> Always Review AI-Suggested Code

So really the problem is a lack of code review... but I seem to recall that AI is decent at code review too. It won't spot state machine bugs, but SQL injections, no problem.

Mathnerd314··on Ambulance hits cyclist, rushes him to hospital, then sticks him with $1,800 bill
This is one of the common accidents, the "right hook". https://velosurance.com/blog/how-to-avoid-most-common-riding... https://www.fcgov.com/traffic/pdf/bicycle-crashes.pdf

I mostly walk these days but when I did bike I had these crash patterns memorized so I could avoid them.

Mathnerd314··on Sets, types and type checking
> Free variables and closures

Are these even types? I always mentally filed closures under "implementation detail of nested functions".

Mathnerd314··on Becoming physically immune to brute-force attacks (2021)
It doesn't account for quantum computing? Cracking passwords seems like one of those things that should get an exponential speedup with quantum computing.
Mathnerd314··on "We took on Google and they were forced to pay out £2B"
But Google didn't pay 2 billion to the couple - it went to the EU government. So now they have a civil lawsuit...
Mathnerd314··on Life is not a story
> Living in a non-narrative way means rejecting a particular identity, and instead seeing life and meaning as a set of open choices.

I choose to fly up through the sky into outer space, away from this place. ;-) Oh wait, I don't have wings, and there's no way to fly into outer space besides maybe begging for a ticket on Virgin Galactic.

It's true that choices are important, but it's also true that you have less control over your choices than you might think (see e.g. The Power of Habit). In particular some choices that you would like to decide one way are simply impossible to actually do.

In practice I've found the best way to modify choices is to build tools. In particular my smartphone - at this point essentially all of my life is directed by apps. There are some cases where this backfires, e.g. recently I found myself driving to an event location and halfway there I realized the event had been cancelled and I had forgotten to remove it from my calendar, but it's the best I've got.

Mathnerd314··on Fixed Timestep Without Interpolation
For reference, SuperTux's code: https://github.com/SuperTux/supertux/blob/8d79ac7ce4db5e4225... (disclosure: not code I wrote, but I've tweaked it here and there)

The idea is similarly to just simulate one logical step at a time, with the fixed timestep (this is important because SuperTux uses simple Euler integration which is timestep-sensitive). But there is tracking code that sleeps / adds extra logical steps between frames so the rate of logical frames ends up corresponding closely to the rate of rendered frames. And as with the final solution here there's no interpolation in rendering, you just display the latest game state without storing the previous.

Mathnerd314··on Arithmetic is an underrated world-modeling technology
This seems more like Fermi estimation (https://en.wikipedia.org/wiki/Fermi_problem). And it is underrated and also it is really hard. I mean, it is easy for the author here to say "look I threw it into Google and it worked" but practically I have seen many people struggle with these sorts of problems - they get the wrong numbers, they divide instead of multiply, or whatever, and the units don't really help.
Mathnerd314··on Life expectancy rise in rich countries slows down: took 30 years to prove
Actual study: https://www.nature.com/articles/s43587-024-00702-3#Sec2
Mathnerd314··on Arm position can substantially overestimate blood pressure readings, study finds
I guess it depends on the study. If it is just comparing between groups, the conclusions probably still hold if they consistently measured blood pressure in the "incorrect" way. If it is something like "85% of Americans have high blood pressure", then probably the conclusions are incorrect because they are comparing the "correct" baseline against an incorrect measurement method. There are also other ways to measure blood pressure, like recent smartwatches - so read the methods section carefully, I guess.
Mathnerd314··on The Society in Dedham for Apprehending Horse Thieves
You can read the discussion yourself: https://en.wikipedia.org/wiki/Wikipedia:Articles_for_deletio... The result was "no consensus". That in was 2006, before current policies were well-established, and at this point I think it would be a clear keep.
← PreviousPage 4 of 34Next →