HNHacker News
TopNewBestAskShowJobs

tikhonj

16,934 karma · joined September 12, 2011

Tikhon Jelvis

I am interested in programming languages, functional programming (especially Haskell), domain-specific languages, static analysis and program synthesis.

I am working on apply programming language ideas to supply chain planning.

I worked on supply chain optimization at Target for several years, and co-authored a textbook on reinforcement learning based on that experience.

contact: http://jelv.is, tikhon@jelv.is

submissionscomments
tikhonj··on A case against currying
> in what sense is make_string_comparator_for_locale "really" a function which takes a locale and a string and returns a function from string to ordering?

In the sense that "make_string_comparator" is not a useful concept. Being able to make a "string comparator" is inherently a function of being able to compare strings, and carving out a bespoke concept for some variation of this universal idea adds complexity that is neither necessary nor particularly useful. At the extreme, that's how you end up with Enterprise-style OO codebases full of useless nouns like "FooAdapter" and "BarFactory".

The alternative is to have a consistent, systematic way to turn verbs into nouns. In English we have gerunds. I don't have to say "the sport where you ski" and "the activity where you write", I can just say "skiing" and "writing". In functional programming we have lambdas. On top of that, curried functions are just a sort of convenient contraction to make the common case smoother. And hey, maybe the contraction isn't worth the learning curve or usability edge-cases, but the function it's serving is still important!

> Because of point 3, our codebase has a trivial wrapper to put round functions when your function actually returns a function

That seems either completely self-inflicted, or a limitation of whatever language you're using. I've worked on a number of codebases in Haskell, OCaml and a couple of Lisps, and I have never seen or wanted anything remotely like this.

tikhonj··on Mayor of Paris removed parking spaces, reduced the number of cars
None of the changes in the comment make owning a car impossible, they just make driving marginally less privileged over walking and biking.
tikhonj··on Rob Pike’s Rules of Programming (1989)
The rule of 3 is awful because it focuses on the wrong thing. If two instances of the same logic represent the same concept, they should be shared. If 10 instances of the same logic represent unrelated concepts, they should be duplicated.

The goal is to have code that corresponds to a coherent conceptual model for whatever you are doing, and the resulting codebase should clearly reflect the design of the system. Once I started thinking about code in these terms, I realized that questions like "DRY vs YAGNI" were not meaningful.

tikhonj··on Government grant-funded research should not be published in for-profit journals
Worth pointing out a success story: all ACM publications have gone open access starting this year[1]. Papers are now going to be CC licensed, with either the very open CC-BY[2] license or the pretty restrictive (but still better than nothing!) CC-BY-NC-ND[3] license.

Computer science as a discipline has always been relatively open and has had its own norms on publication that are different from most other fields (the top venues are almost always conferences rather than journals, and turn-around times on publications are relatively short), so it isn't a surprise that CS is one of the first areas to embrace open access.

Still, having a single example of how this approach works and how grass-roots efforts by CS researchers led to change in the community is useful to demonstrate that this idea is viable, and to motivate other research communities to follow suit.

[1]: https://authors.acm.org/open-access/acm-open-for-authors-hom...

[2]: https://creativecommons.org/licenses/by/4.0/

[3]: https://creativecommons.org/licenses/by-nc-nd/4.0/deed.en

tikhonj··on Verified Spec-Driven Development (VSDD)
> you can't spec out something you have no clue how to build

Ideally—and at least somewhat in practice—a specification language is as much a tool for design as it is for correctness. Writing the specification lets you explore the design space of your problem quickly with feedback from the specification language itself, even before you get to implementing anything. A high-level spec lets you pin down which properties of the system actually matter, automatically finds an inconsistencies and forces you to resolve them explicitly. (This is especially important for using AI because an AI model will silently resolve inconsistencies in ways that don't always make sense but are also easy to miss!)

Then, when you do start implementing the system and inevitably find issues you missed, the specification language gives you a clear place to update your design to match your understanding. You get a concrete artifact that captures your understanding of the problem and the solution, and you can use that to keep the overall complexity of the system from getting beyond practical human comprehension.

A key insight is that formal specification absolutely does not have to be a totally up-front tool. If anything, it's a tool that makes iterating on the design of the system easier.

Traditionally, formal specification have been hard to use as design tools partly because of incidental complexity in the spec systems themselves, but mostly because of the overhead needed to not only implement the spec but also maintain a connection between the spec and the implementation. The tools that have been practical outside of specific niches are the ones that solve this connection problem. Type systems are a lightweight sort of formal verification, and the reason they took off more than other approaches is that typechecking automatically maintains the connection between the types and the rest of the code.

LLMs help smooth out the learning curve for using specification languages, and make it much easier to generate and check that implementations match the spec. There are still a lot of rough edges to work out but, to me, this absolutely seems to be the most promising direction for AI-supported system design and development in the future.

tikhonj··on The Pentagon is making a mistake by threatening Anthropic
3- Anthropic looks "woke" and the administration cares more about perceptions than reality.

Not too different from picking on Harvard/etc.

tikhonj··on Will vibe coding end like the maker movement?
I mean, look at all the startups that succeeded despite being complete shitshows behind the scenes... the baseline for leadership, organization, coordination or, hell, execution for a startup to succeed isn't exactly high either.
tikhonj··on Bus stop balancing is fast, cheap, and effective
Living with ADHD also increases your chances of getting into a car accident substantially. I can't find the numbers now, but the increase is non-trivial and there are some clear mechanisms (inattention, impulsivity and risk-seeking behaviors).

ADHD is a big part of the reason I don't drive. I'm lucky enough to live in Berkeley which is very walkable with decent transit, and I would hesitate to move anywhere more car-oriented exactly because I have ADHD.

tikhonj··on Sizing chaos
There's a lot of area on the spectrum between where we are today and "sugary beverages are all banned".

For example, Starbucks could limit the sizes it sells and advertises—you'd still be able to have as much sugar as you would like by buying multiple drinks, but it would raise the activation energy needed to do that. Making the healthier choice the path of least resistance works wonders.

tikhonj··on AI-First Company Memos
It's not inevitable, it's just poor leadership. I've seen changes at large organizations take without being crudely pushed top-down and you'd better believe I've seen top-down initiatives fail, so "performance management" is neither necessary nor sufficient.
tikhonj··on Code is cheap. Show me the talk
> crystal clear software development plan and the exact know-how to implement it

This is simply not how expert programmers work. Programming is planning, and programming languages are surprisingly good planning tools. But, of course, becoming an expert is hard and requires not only some general aptitude but also substantial time, experience and effort.

My theory is that this is a source of diverging views on LLMs for programming: people who see programming languages as tools for thought compared to people who see programming languages as, exclusively, tools to make computers do stuff. It's no surprise that the former would see more value in programming qua programming, while the latter are happy to sweep code under the rug.

The fundamental problem, of course, is that anything worth doing in code is going to involve pinning down a massive amount of small details. Programming languages are formal systems with nice (well, somewhat nice) UX, and formal systems are great for, well, specifying details. Human text is not.

Then again, while there might be a lot of details, there are also a lot of applications where the details barely matter. So why not let a black box make all the little decisions?

The question boils down to where you want to spend more energy: developing and articulating a good conceptual model up-front, or debugging a messy system later on. And here, too, I've found programmers fall into two distinct camps, probably for the same reasons they differ in their views on LLMs.

In principle, LLM capabilities could be reasonably well-suited to the up-front thinking-oriented programming paradigm. But, in practice, none of the tools or approaches popular today—certainly none of the ones I'm familiar with—are oriented in that direction. We have a real tooling gap.

tikhonj··on AI code and software craft
Efficiency isn't even the best way to optimize for (expected) shareholder returns for an organization! Efficiency fundamentally trades-off against adaptability and resilience.
tikhonj··on What “The Best” Looks Like
A major part of what makes somebody "the best" is tacit knowledge. This is the sort of skill and "know-how" you can build up from experience and one-on-one instruction, but cannot easily be captured in text.

For programmers, this manifests as some mix of intuition and taste. I've worked with people who have had some especial insight that most doesn't; they don't necessarily "produce" the most, but they make the right key decisions and create the kind of core abstractions and systems that provide a better foundation for everything down the line. Or, alternatively, perhaps they're just preternaturally great at finding and fixing bugs. (My experience has been that really good folks tend to lean heavily towards one side or the other, even if they're solid at both.)

I've written before about how this should change how we structure our teams and manage creative, high-leverage work[1]. The same concept should also change how we find and evaluate candidates, but, honestly, I'm not sure how. Evaluating tacit knowledge and expertise is hard, even for experts!

One thing I've found that works is figuring out a way to show-rather-than-tell that you're willing to do things differently. Doing things differently won't be appealing to everyone, but it will be very appealing to specific kinds of experts! When you can't compete on comp and brand, this is one of the better options. One way to do this is to use a specialized, niche language like Haskell. Alex saw this in action at Freckle and I saw it in action hiring folks for Target's supply chain optimization team. But it doesn't have to be a language specifically; it just has to be something that at least some experts care about, and that you can demonstrate. (Just saying you're doing something different or technically interesting won't work because everybody is saying that!)

[1]: https://jelv.is/blog/Letting-Experts-Be-Experts/

tikhonj··on A flawed paper in management science has been cited more than 6k times
It's also pretty clearly a deterrence against people admitting and fixing their own mistakes, both individually and as institutions. Which is exactly what we're seeing here...
tikhonj··on Gas Town's agent patterns, design bottlenecks, and vibecoding at scale
A sense of art and whimsy and experimentation is less compelling when it's jumping on the hypest of hype-trains. I'd love to see more folk art in programming, but Gas Town is closer to fucking Beeple than anything charming.
tikhonj··on AI is a horse (2024)
Fossil-fuel cars a good analogy because, for all their raw power and capability, living in a polluted, car-dominated world sucks. The problem with modern AI has more to do with modernism than with AI.
tikhonj··on Software engineers can no longer neglect their soft skills
I've realized it's a different paradigm in (very loosely) the Kuhn sense. You wouldn't track tasks if you're fundamentally not even thinking of the work in terms of tasks! (You might still want a bug tracker to track reported bugs, but it's a bug tracker, not a work tracker.)

What you actually do is going to depend on the kind of project you're working on and the people you're working with. But it mostly boils down to just talking to people. You can get a lot done even at scale just by talking to people.

tikhonj··on Software engineers can no longer neglect their soft skills
A lot of highly performing teams don't even use tickets.
tikhonj··on Which programming languages are most token-efficient?
I think the trick with Haskell is that you can write types in such a way that the APIs that get generated are idiomatic and designed well. The implementations of individual functions might be messy or awkward, but as long as those functions are relatively small—which is how I tend to write my non-AI-based Haskell code anyhow!—it's not nearly as important.
tikhonj··on Which programming languages are most token-efficient?
From what I've heard—and in my own very limited experiments—LLMs are much better at less popular languages than I would have expected. I've had good results with OCaml, and I've talked to people who've had good results with Haskell and even Unison.

I've also seen multiple startups that have had some pretty impressive performance with Lean and Rocq.

My current theory is that as long as the LLM has sufficiently good baseline performance in a language, the kind of scaffolding and tooling you can build around the pure code generation will have an outsize effect, and languages with expressive type systems have a pretty direct advantage there: types can constrain and give immediate feedback to your system, letting you iterate the LLM generation faster and at a higher level than you could otherwise.

I recently saw a paper[1] about using types to directly constrain LLM output. The paper used TypeScript, but it seems like the same approach would work well with other typed languages as well. Approaches like that make generating typed code with LLMs even more promising.

Abstract:

> Language models (LMs) can generate code but cannot guarantee its correctness often producing outputs that violate type safety, program invariants, or other semantic properties. Constrained decoding offers a solution by restricting generation to only produce programs that satisfy user-defined properties. However, existing methods are either limited to syntactic constraints or rely on brittle, ad hoc encodings of semantic properties over token sequences rather than program structure.

> We present ChopChop, the first programmable framework for constraining the output of LMs with respect to semantic properties. ChopChop introduces a principled way to construct constrained decoders based on analyzing the space of programs a prefix represents. It formulates this analysis as a realizability problem which is solved via coinduction, connecting token-level generation with structural reasoning over programs. We demonstrate ChopChop's generality by using it to enforce (1) equivalence to a reference program and (2) type safety. Across a range of models and tasks, ChopChop improves success rates while maintaining practical decoding latency.

[1]: https://arxiv.org/abs/2509.00360

tikhonj··on Org Mode syntax is one of the most reasonable markup languages for text (2017)
GitHub has at least some support for org-mode rendering. Which is a good reminder that a lot of this stuff really doesn't have to be a stark either-or choice—a lot of standardization isn't inevitable or natural or necessary, but just a choice we happen to make, often for systemic reasons that aren't inherently justified (legibility/etc).
tikhonj··on Professional software developers don't vibe, they control
what I've done is avoid the sort of boss who would mandate AI use

in a past job I did tell a boss that I wasn't going to be doing the whole tickets/estimates/schedule tetris thing, and that actually worked out... because the leaders I worked with understood the value of being flexible and trusting their lead engineers

tikhonj··on Professional software developers don't vibe, they control
most organizations have awful leadership, sure

but that doesn't mean you can't (or shouldn't) work around it

tikhonj··on How uv got so fast
Different programming languages come with different schools of thought about programming and different communities of practice around programming.

If you take a group of people who are squarely in the enterprise Java school of thought and have them write Rust, the language won't make much of a difference. They will eventually be influenced by the broader Rust community and the Rust philosophy towards programming, but, unless they're already interested in changed approaches, this will be a small, gradual difference. So you'll end up with Enterprise Java™ code, just in Rust.

But if you hire from the Rust community, you will get people who have a fundamentally different set of practices and expectations around programming. They will not only have a stronger grasp of Rust and Rust idioms but will also have explicit knowledge based on Rust (eg Rust-flavored design patterns and programming techniques) and, crucially, tacit knowledge based on Rust (Rust-flavored ways of programming that don't break down into easy-to-explain rules). And, roughly speaking, the same is going to be true for whatever other language you substitute for "Rust".

(I say roughly because there doesn't have to be a 1:1 relationship between programming languages, schools of thought and communities of practice. A single language can have totally different communities—just compare web Python vs data scientist Python—and some communities/schools can span multiple languages. But, as an over-simplified model, seeing a language as a community is not the worst starting point.)

tikhonj··on How uv got so fast
If you're doing something forgettable, what makes you think the workaday Java or Python programmer would find it innately motivating?

Alternately, if you have the sort of work or culture that taps into people's intrinsic motivation, why would that work worse with Haskell or Clojure programmers than anybody else?

People are interested in different things along different dimensions. The way somebody is motivated by what they're doing and the way somebody is motivated by how they're doing it really don't seem all that correlated to me.

tikhonj··on Stop Slopware
> In the end the best will win on the merits.

The last six decades of commercial programming don't exactly bear this out...

The real lesson is that writing software is such a useful, high-leverage activity that even absolutely awful software can be immensely valuable. But that doesn't tell us that better software is useless, it just tells us it is not absolutely necessary.

tikhonj··on Stop Slopware
Caring about craft in programming is more like a photographer caring about light and composition and creativity and taste than a photographer caring about equipment.
tikhonj··on I'm just having fun
It's amazing how such a short comment manages to betray a fundamental misunderstanding of stimulants, tinkering, human nature and, implicitly, neurodivergence.
tikhonj··on AWS CEO says replacing junior devs with AI is 'one of the dumbest ideas'
Struggling with poorly organized docs seems entirely like incidental complexity to me. Good learning resources can be both faster and better pedagogically. (How good today's LLM-based chat tools are is a totally separate question.)
tikhonj··on Mozilla appoints new CEO Anthony Enzor-Demeo
You're significantly underestimating fully-loaded cost per person + other expenses. An engineer making a $200k salary is going to cost the company something like $300k, and there are some additional fixed overheads. And $200k is quite a bit less than your competitors are paying.

So you're looking at something more like 150 employees total of which <100 are going to be pure engineers, and that's stretching your budget and operations pretty aggressively while also fighting an uphill battle for recruiting skilled and experienced engineers. (And browser development definitely needs a core of experienced engineers with a relatively niche set of skills!)

← PreviousPage 6 of 34Next →