News for hackers. Stuff that matters.

ianhorn

Re:I accidentally turned LLM memory into program analysis on Saturday August 29, 2026 @12:45PM (#49491338)
That’s practically what i’m working on! But i’m training the models to do this natively. It gets complex given the inherent relevant uncertainties (aka making it resilient to their bullshit). Luckily, datalog and monotonic logic in general is reasonably amenable to packed representations of the possible knowledge bases, and reasoning from them in a way that lends itself to decent UX, but it’s been a huge amount of elbow grease to get working with reasonable complexity end-to-end.
Re:Show HN: Huzzah – a novel approach to coding with AI on Thursday August 20, 2026 @05:35PM (#49380585)
I'm working on a bidirectional version of this! The big challenge is keeping the various versions of the thing in sync through edits.
Re:We have proof automation now on Monday July 27, 2026 @12:03AM (#49065082)
in case anyone's interested i have a vibe coded fork of verus that replaces the verus-the-language side of verus with plain old Lean 4. It's still two languages, but now at least the second language is as mainstream as it gets in the field and has good automation. i haven't finished wiring up the Lean 4 infoview and vs code extensions and LLM skills into it yet, which makes it not as easy to write yet as lean 4 with the IDE bells and whistles.

I'm also playing around with using the lean's compile-to-C tooling to instead compile to rust instead and it's getting more of my focus than the lean-via-verus route right now.

if people are interested, ping me and i can put them up on gh.

Re:CQL: Categorical Databases on Tuesday June 02, 2026 @11:50AM (#48371846)
Huh, I read the pitch differently. As "reduce risk of (failure through artificial intelligence)," not as "(reduce risk of failure) through artificial intelligence."

Maybe that's my bias since that's what I'm working on, but it's a big benefit to have stronger compiler guarantees of correctness so that an LLM can't screw things up as much. No BSing that it works when the compiler requires proof.

Re:Formal Verification Gates for AI Coding Loops on Wednesday May 20, 2026 @10:07PM (#48216948)
Not the author, but I've been doing this kind of thing with Lean. I'm still trying to figure out how to make this workflow play nicely with other systems. I have a bunch of rust code that I want these kinds of guarantees on, and that code has third party dependencies that would be terrible to give up. It's totally unclear right now how to get the best of both worlds.
Re:Formal Verification Gates for AI Coding Loops on Wednesday May 20, 2026 @09:32PM (#48216696)
I've been experimenting with this a lot lately in Lean because it's equally capable as a theorem prover and as a programming language. It's resolving a lot of the frustration I feel with LLM coding.

You write a type signature for a function that amounts to "take a Foo x and return a Bar y with a proof of does_what_i_wanted(x,y)." Voila, no more agents doing something else because it won't compile if they don't do what I wanted.

It's great to build faster without the frustration of having no confidence in what I build. But it sure makes the gap between toys in Lean and using this in a Real Project in some other language that much more frustrating.

Re:"Why not just use Lean?" on Monday April 27, 2026 @11:49PM (#47930265)
I remember trying to play around with Coq/Rocq and a few others about 15 years ago, and I couldn’t make heads or tails of them. Not the concepts, but the software. What’s weird about proof assistants/interactive provers is that the “interactive” part makes it a combo of IDE and language and they seem to get pretty tightly coupled in practice. You can’t talk about the language without talking about the environment you use it in.

I’m not the biggest VS code fan, but a battle honed extensible IDE used by zillions and maintained by $$$ has proved itself miles ahead of the environments for alternatives. As far as i can tell, the excellent onboarding path that is the Natural Numbers Game is possible because of VS code’s hackability and ecosystem.

My main concern as I’m learning lean is that the syntax extensibility seems to be a double edged sword. Once i’ve learned a language, i want to be able to read code written in it. If everything is in a project’s own DSL, that can get out of hand, but that comes down to community/ecosystem so i’m crossing my fingers.

Re:"Why not just use Lean?" on Monday April 27, 2026 @11:31PM (#47930192)
Complex numbers and Schwartz distributions (the thing the dirac delta is) come immediately to mind. “Not all numbers have square roots, but what if they did?” It seems like a common pattern.
That works until you make a plan/tests/etc, set the thing loose, and then when it has trouble it decides "actually the pragmatic thing would be [diverge from the plan/change the tests/etc]" and goes off the rails. I'm so frustrated by these things right now.
I like the Kronecker quote, "Natural numbers were created by god, everything else is the work of men" (translated). I figure that (like programming) it turns out that putting our problems and solutions into precise reusable generalizable language helps us use and reuse them better, and that (like programming language evolution) we're always finding new ways to express problems precisely. Reusability of ideas and solutions is great, but sometimes the "language" gets in the way, whether that's a programming language or a particular shape of the formal expression of something.
I always mentally slotted prosemirror-collab/your recommended solution in the OT category. What’s the difference between the “rebase” step and the “transformation” step you’re saying it doesn’t need?
Re:What happens when US economic data becomes unreliable on Saturday March 14, 2026 @02:05PM (#47379354)
Two things come to mind:

- Whatever you measure gets optimized.

- When a measure becomes a target, it ceases to be a good measure.

I have no idea which is more relevant here. Looking at the first one, my whole life people have been complaining that the measures that get touted in political discourse don't reflect quality of life. So if we stop looking at those as measures because they cease to be reliable, maybe they stop getting myopically optimized and we can get less myopic about what we prioritize in aggregate.

But looking at the second one, I've also wondered whether those measures really do reflect typical quality of life, and it's just that the people doing worse than typical will always see the measure as the wrong measure. So then we'd be losing the ability to prioritize actually useful things.

In my heart though, I kinda lean towards the first one. I've been in enough orgs where "the dashboard goes up" is incentivized to the detriment of the unmeasurable things that actually matter to the org.

Re:Multiplicative Infinitesimals on Thursday January 09, 2025 @12:54PM (#42648098)
On the topic, do you know any approaches to infitesimals/differentials that do cotangents and pullbacks as primitives?

In practice, I always end up needing to work in cotangents, but deriving them is always roundabout in terms of the limit definition of pushforwards. Never found a nice way to swap which is primary and which is secondary, but it feels like there should be a clean view of it that way somewhere.

Re:Modelica on Monday December 16, 2024 @03:36PM (#42435133)
Any chance you know of good DAE books/resources that go into combining symbolics and numerics or parametrized DAEs?
This is a thing I'm working on, so I have some potentially useful thoughts. tl;dr, it doesn't have to be about encoding arbitrary real life statements to be super duper useful today.

> how might an arbitrary statement like "Scholars believe that professional competence of a teacher is a prerequisite for improving the quality of the educational process in preschools" be put in a lean-like language?

Totally out of scope in the any near future for me at least. But that doesn't prevent it from being super useful for a narrower scope. For example:

- How might we take a statement like "(x + 1) (x - 5) = 0" and encode it formally?

- Or "(X X^T)^-1 X Y = B"?

- Or "6 Fe_2 + 3 H_2 O -> ?"?

We can't really do this for a huge swath of pretty narrow applied problems. In the first, what kind of thing is X? Is it an element of an algebraically closed field? In the second, are those matrices of real numbers? In the third, is that 6 times F times e_2 or 6 2-element iron molecules?

We can't formally interpret those as written, but you and I can easily tell what's meant. Meanwhile, current ways of formally writing those things up is a massive pain in the ass. Anything with a decent amount of common sense can tell you what is probably meant formally. We know that we can't have an algorithm that's right 100% of the time for a lot of relevant things, but 99.99% is pretty useful. If clippy says 'these look like matrices, right?' and is almost always right, then it's almost always saving you lots of time and letting lots more people benefit from formal methods with a much lower barrier to entry.

From there, it's easy to imagine coverage and accuracy of formalizable statements going up and up and up until so much is automated that it looks kinda like 'chatting about real-life statements' again. I doubt that's the path, but from a 'make existing useful formal methods super accessible' lens it doesn't have to be.

Re:Ask HN: Who wants to be hired? (December 2022) on Thursday December 01, 2022 @04:30PM (#33823088)
Location: San Francisco, California

Remote: Ideally hybrid

Willing to relocate: No

Technologies: Pytorch, JAX, spark, and the rest of the python data ecosystem; AWS; Python, C, R, SQL, Java

Resume/CV: CV link (https://imh.github.io/assets/cv.pdf) Machine Learning Engineer with over a decade of industry experience in ML, stats, and numerical optimization roles. Looking for companies where ML is critical path, especially in NLP.

Email: horn (dot) imh (at) gmail

Re:The good things in the current age in tech on Friday November 12, 2021 @09:28PM (#29206848)
I’d expand “tech” beyond computers. I’ve recently gotten into mini painting and sculpting. I can get paints and brushes and magic epoxy putties and sculptable thermoplastics and precision tools for less than a nice dinner out, which is so cool. I’d bet it’s not too long ago that this would have to be something you’re seriously pursuing to make the costs worth it. [0]

Or if we’re sticking with tech = computers, I can sculpt for free in blender (the software) and print it with a 3d printer. Or paint in procreate/photoshop on my ipad with this fantastic not-really-a-pencil (and somehow procreate is only $10??). Or learn to draw from the internet.

Or the fact that nothing like D&D Beyond existed for a game I’m playing, so I was able to put up an app based on free software (react + yjs) on cloud servers god knows where for dirt cheap without knowing much of anything about any of those things.

Hobbies and leisure activities seem to be pretty accessible (in price). The downside for me is that all the accessible addictive stuff (like this site) makes it hard to actually dedicate time to the hobbies I want to spend time on.

[0] Unfortunately, I couldn’t find data on prices of various art supplies going very far back.

Re:Excel as Code on Monday September 20, 2021 @12:42PM (#28595762)
Excel is kind of WYSIWYG programming. I use it for quick stuff frequently and I’m amazed at what it makes easier than e.g. numpy. There’s a whole class of error you don’t make because you see the whole intermediate state all together (there are also whole classes of error you do make that you wouldn’t make in normal programming).

I have been using it for character sheets in tabletop RPGs I’m playing lately, and it’s great. With a line of js, you can add an arbitrary button to google sheets, and then it turns into a quick, dirty UI that’s transparent (click on the cell and see that AC=10 plus dexterity modifier) and on-the-fly editable by everyone together.

Remember that unlicensed content is still licensed. Generally the implicit license of a work is less permissive. So however you feel about this using GPL code, the situation is even worse for most ML models that have no license at all to use their training data.
Unlicensed code just means “all rights reserved.” You’d need to limit it to permissively licensed code and make sure you comply with their requirements.
Re:Folk wisdom on visual programming on Friday July 02, 2021 @11:56AM (#27713148)
What a fantastic post.

> Is ‘folk wisdom from internet forums’ worth exploring as a genre of blog post?

I’d add another yes here, if they’re all as thorough as this post.

I’ll add something that I didn’t see directly addressed in here: input methods strongly affect the medium.

Last year I struggled intensely with RSI. I got to the point where I couldn’t type for months. I tried some voice coding tools (caster and talon). Some aspects of this were actually better than keyboard coding. Unfortunately speech recognition is still at a point where it drove me insane with inaccuracies.

It also made me realize that with a keyboard, text code is incredibly natural. With keyboard+mouse, some new modes open up. With voice alone, I wanted to code a very different way.

I won’t go into detail, because this is already a long comment, but I believe that when we get speech recognition as reliable as typing, we’ll see an explosion of new programming paradigms.

Re:What if an AI wins the Nobel Prize for medicine? on Monday June 28, 2021 @10:54AM (#27662777)
We used to not understand how steam engines worked either, even once we got them working. At least not past the most macro level. Understanding at the micro level came later.
Re:Biases in AI Systems on Friday June 25, 2021 @11:37AM (#27632117)
Rather than being a suppressed topic, in my experience, this is a case of people talking past each other. It's like correlation versus causation (versus plain old connected definitions). It can be true that A and B are correlated, while A doesn't cause B (or neither causes the other), and while their definitions have nothing to do with each other. Like nurse and gender. They're correlated in the US, but making someone a nurse doesn't change their gender, and the definitions have nothing to do with each other. Maybe in some countries the correlation is even flipped!

Recall all the times in stats where an estimator can be an unbiased estimator of a correlation while being a biased estimator of a causal effect.

So you get some people saying it (the correlation) is correct and other people saying it (the causal effect) is incorrect. Both are right! To stop talking past each other, they need to talk about bias with respect to the correlation or bias with respect to the causal effect in this particular direction.

But what frustrates me is when the correlation side uses the (true) correlation to argue against a system being biased with regards to something else (w.r.t. a definition or w.r.t. a causal effect or w.r.t. a literal translation or w.r.t. some more complicated aspect of the system), and that harms are okay because the bias is a correct bias.

We need to work on our terminology so that we can stop talking past each other. It doesn't help that our models have weird biases in absurdly complex function spaces, but we have to progress beyond a first-stats-course one-size-fits-all definition of bias.

Re:Nvidia Canvas on Friday June 25, 2021 @01:26AM (#27627417)
It wouldn't be a smooth app, but it would still render, which would be fun to play with.
Re:Julia: Faster than Fortran, cleaner than Numpy on Wednesday June 23, 2021 @05:55PM (#27610982)
Hi! Thanks for engaging with the comments.

I believe you've misunderstood the main point of my comment. I don't have too strong opinions about reshape vs newaxis.

The real point was about excessive inlining, which your update does not to fix. A fairer comparison regarding readability would be pulling out the matrix version of a into a named variable:

  n = len(a)
  A = a.reshape(n,1)
  M = exp(1j * k * sqrt(A**2 + A.T**2))
I believe these are much much more readable.

When you need loops, you need loops, of course, and python tends to suck here (though with jax's functional programming constructs the boundary is shifting). But the readability/cleanliness comparison in your post is still an unfair comparison.

Re:Julia: Faster than Fortran, cleaner than Numpy on Monday June 21, 2021 @12:12PM (#27580598)
> I'd prefer if the language only had a single number type (maybe configurable at once by an external option) and a single sqrt function.

If you meant a numeric single type class, like haskell's Num, I think it's a great option. If you mean a single numeric type, like javascript, it unfortunately leads to a bunch of issues. Integers and floats really are both necessary very frequently. For example floats to represent something like speed, and ints to represent your bank balance. And you need different sizes of them (like float32 vs float64) are still necessary in a ton of applications, so you'll need them eventually if you want the language/numerics library to be truly general purpose.

It's also a huge convenience to be able to apply e.g. `+` to arrays as well as numbers and other polymorphism niceties.

Re:Julia: Faster than Fortran, cleaner than Numpy on Sunday June 20, 2021 @04:50PM (#27573776)
I got bored with trying to find an analytical boost, but I benchmarked a couple IMO super readable python versions (basically what's in my original comment after making the (100+i)i change):

https://colab.research.google.com/drive/1ABrZJlm8pwB6_Sd6ayO...

On my macbook, using XLA's jit in python gave about a 12-15x speedup on CPU over OP's solution, which was pretty cool, but I'm too lazy to figure out how to install and benchmark Julia on my machine. Applying a 12-15x speedup would at least beat the Julia MT solution in OP, and you've got to admit `exp(CONST * sqrt(A**2 + A.T**2))` is a pretty clean way to do it.

Then I ran on whatever GPU colab decided to give me (a P100), and for just adding a decorator, it's a 1000x-1900x speedup (better as n goes up). Hence my current honeymoon period with jax. I love the speed vs readability tradeoff.

Re:Julia: Faster than Fortran, cleaner than Numpy on Sunday June 20, 2021 @03:11PM (#27573016)
Regarding your performance work, you've nerd sniped me into looking for analytical tricks to speed it up ;) We'll see...

Regarding the readability, I suppose it's a matter of taste at this point, but if I swapped `import numpy as np` for `from numpy import newaxis, exp, sqrt`, then IMO, the numpy is more readable:

    A = a[newaxis]
    M = exp(1j * k * sqrt(A**2 + A.T**2)) 
But then my tastes also run towards preferring the handwritten definitions to be in terms of vectors and transposes instead of elements and indices, at least until you get to many indexed tensors.

Side note: any idea why the python and fortran are exp(i k... while the julia is exp((100 +i) i...)? Is it something I overlooked?

Re:Julia: Faster than Fortran, cleaner than Numpy on Sunday June 20, 2021 @02:21PM (#27572569)
This an unfair example of trying to make the numpy readable:

    n = len(a)
    M = np.exp(1j*k*(np.tile(a,(n,1))**2 + np.tile(a.reshape(n,1),(1,n))**2))
This has a common issue in functional programming and there's an easy trick to fix it. Change the big one liner by naming things:

    n = len(a)
    A = np.tile(a,(n,1))
    A_T = np.tile(a.reshape(n,1),(1,n))
    M = np.exp(1j*k*(A**2 + A_T**2))
Much easier to read now, and it even exposes an error (the sqrt is missing!). Before we fix that, let's make the obvious simplification of using the .T for transpose:

    n = len(a)
    A = np.tile(a,(n,1))
    M = np.exp(1j*k*(A**2 + A.T**2))
Then let's use numpy's broadcasting to be more idiomatic:

    A = a[:, np.newaxis]
    M = np.exp(1j*k*(A**2 + A.T**2))
Now let's fix the bug:

    A = a[:, np.newaxis]
    M = np.exp(1j*k*np.sqrt(A**2 + A.T**2))
or even

    A = a[:, np.newaxis]
    root_sum_squares = np.sqrt(A**2 + A.T**2)
    M = np.exp(1j*k*root_sum_squares)
I think the last two of these are fairer comparisons.

--------

And to pitch the hype train for jax: if you want to fuse the loops and/or get gpu/tpu for free, just swap np for jnp:

    A = a[:, jnp.newaxis]
    M = jnp.exp(1j*k*jnp.sqrt(A**2 + A.T**2))
Re:Excel Never Dies on Monday March 08, 2021 @07:36PM (#26393708)
Grandparent here. Yeah I know how to program, but the point here was to make my players a simple interactive GUI that saves its data somewhere we can all access together (e.g. the cloud). Doing that in R would be well beyond my skillset, even as an R user. Doing it with a web stack would be more appropriate, but even then it would have been a lot more work and I can't think how I'd do it without spinning up a server and setting up some http endpoints.

Older »