frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Open in hackernews

Typed languages are better suited for vibecoding

https://solmaz.io/typed-languages-are-better-suited-for-vibecoding
76•hosolmaz•3h ago

Comments

gompertz•1h ago
Curious, has it been proven that typed languages are easier for LLMs to work with as they dont have to infer types?
benreesman•1h ago
I'm not aware of any rigorous study on it, but my personal anecdote is that I don't even bother with Claude Code or similar unless the language is Haskell, the deployment is Nix, the config is Dhall, and I did property tests. Once you set it up like that you just pour money in until its too much money or its stuck, and thats how far LLMs can go now.

I used to yell at Claude Code when it tried to con me with mocks to get the TODO scratched off, now I laugh at the little bastard when it tries to pull a fast one on -Werror.

Nice try Claude Code, but around here we come to work or we call in sick, so what's it going to be?

herrington_d•1h ago
There are researches backing some sort of "typed language is better for LLM". Like https://arxiv.org/abs/2504.09246, Type-Constrained Code Generation with Language Models, where LLM's output is constrainted by type checkers.

Also https://arxiv.org/abs/2406.03283, Enhancing Repository-Level Code Generation with Integrated Contextual Information, uses staic analyzers to produce prompts with more context info.

Yet, the argument does directly translate to the conclusion that typed language is rigorously better for LLM without external tools. However, typed language and its static analysis information do seem to help LLM.

vidarh•37m ago
Dynamically typed languages are far from "untyped". Though they may well require more effort to analyze from scratch without making assumptions, there is nothing inherently preventing type-constrained code generation of the kind the first paper proposes even without static typing.

A system doing type-constrained code-generation can certainly implement its own static type system by tracking a type for variables it uses and ensuring those constraints are maintained without actually emitting the type checks and annotations.

Similarly, static analyzers can be - and have been - applied to dynamically typed languages, though if these projects have been written using typical patterns of dynamic languages the types can get very complex, so this tends to work best with code-bases written for it.

cultofmetatron•1h ago
this is just the kind of sass I needed today. cheers!
treve•1h ago
Do they infer anything? Correct me if I'm wrong but having the types right there in the source for training data just means more context.
NischalM•1h ago
I have found this to be true as well. Although I exclusively used python and R at work and tried CC several times for small side projects, it always seemed to have problems and ended up in a loop trying to fix its own errors. CC seems much better at vibe coding with typescript. I went from no knowledge of node.js development to deploying reasonable web app on vercel in a few days. Asking CC to run tsc after changes helps it fix any errors because of the faster feedback from the type system compared to python. Granted this was only for a personal side project and may not be true for production systems that might be much larger, I was pleasantly surprised how easy it was in typescript compared to python
koakuma-chan•1h ago
> I was pleasantly surprised how easy it was in typescript compared to python

It's time for people to wake up and stop using Python, and forcing me to use Python

cttet•41m ago
It may be a Claude specific thing. I tried to ask Claude to various tasks in machine learning, like implement gradient boosting without specifying the language, thinking it will use Python since it is the most common option and have utilities like Numpy to make it much easier. But Claude mostly choose Javascript for the language and somehow managed to do it in JS.
linkage•1h ago
This claim needs to be backed up by evals. I could just as well argue the opposite, that LLMs are best at coding Python because there are two orders of magnitude more Python in their training sets than C++ or Rust.

In any case, you can easily get most of the benefits of typed languages by adding a rule that requires the LLM to always output Python code with type annotations and validate its output by running ruff and ty.

yibers•1h ago
I agree that the training sets for LLMs have much more training data for Python than for Rust. But C++ has existed before Python I believe. So I doubt there is 2 orders of magnitude of Python code more than C++.
hibikir•52m ago
You miss how many fewer programmers were there in the early years, how much of that code was ever public, and even if it was, how useful it was, as C++ has changed drastically since, say, what we used to write in 2001.
vidarh•50m ago
It's not just a question of whether there is more actual code in a given language, but how much is available in the public and private training data.

I've done work on reviewing and fine-tuning training data with a couple of providers, and the amount of Python code I got to see at least out-distanced C++ code by far more than 2 orders of magnitude. It could be a heavily biased sample, but I have no problems believing it also could be representative.

dccsillag•36m ago
I think you vastly overestimate the capacity of Python typing.
fluxkernel•1h ago
All existing programming languages are designed for human beings. Is it the right time to design something that is specifically for vibe coding? For example, ease of read/understanding is probably much more important than all the syntactic sugars to reduce typing. Creating ten ways to accomplish the same task is not useful for LLMs.
largbae•26m ago
I've been wondering if Java would have a resurgence due to strong typing even into the error types, and widespread runtime availability. But so far, seems no.
herrington_d•1h ago
The logic above can support exactly the opposite conclusion: LLM can do dynamic typed language better since it does not need to solve type errors and save several context tokens.

Practically, it was reported that LLM-backed coding agents just worked around type errors by using `any` in a gradually typed language like TypeScript. I also personally observed such usage multiple times.

I also tried using LLM agents with stronger languages like Rust. When complex type errors occured, the agents struggled to fix them and eventually just used `todo!()`

The experience above can be caused by insufficient training data. But it illustrates the importance of eval instead of ideological speculation.

MattGaiser•1h ago
Or just bad training data. I've seen "any" casually used everywhere.
mithras•59m ago
In my experience you can get around it by having a linter rule disallowing it and using a local claude file instructing it to fix the linting issues every time it does something.
vidarh•53m ago
You can equally get around a significant portion of the purported issues with dynamically typed languages by having Claude run tests, and try to run the actual code.

I have no problem believing they will handle some languages better than others, but I don't think we'll know whether typing makes a significant difference vs. other factors without actual tests.

herrington_d•25m ago
it does not always work in my experience due to complex type definitions. Also extra tool calls and time are needed to fix linting.
lukev•1h ago
As has been said, actual evals are needed here.

Anecdotally, the worst and most common failure mode of an agent is when an agent starts spinning its wheels and unproductively trying to fix some error and failing, iterating wildly, eventually landing on a bullshit (if any) “solution”.

In my experience, in Typescript, these “spin out” situations are almost always type-related and often involve a lot of really horrible “any” casts.

mewpmewp2•1h ago
This is why I have very specific ruleset and linting for my LLMs, not allowing any at all and other quality checks.
Mtinie•1h ago
Is this a shareable ruleset? I would completely understand if not but I’m interested in learning new ways to interact with my tools.
energy123•54m ago
The question can be asked two ways:

(1) Are current LLMs better at vibe coding typed languages, under some assumptions about user workflow?

(2) Are LLMs as a technology more suited to typed languages in principle, and should RL pipelines gravitate that way?

resonious•47m ago
Right, I've noticed agents are very trigger happy with 'any'.

I have had a good time with Rust. It's not nearly as easy to skirt the type system in Rust, and I suspect the culture is also more disciplined when it comes to 'unwrap' and proper error management. I find I don't have to explicitly say "stop using unwrap" nearly as often as I have to say "stop using any".

smackeyacky•35m ago
Experienced devs coming in to TypeScript are also trigger happy with 'any' until they work out what's going on. Especially if they've come from Javascript.
chrisjharris•1h ago
I've been wondering about this for some time. My initial assumption was that would be that LLMs will ultimately be the death of typed languages, because type systems are there to help programmers not make obvious mistakes, and near-perfect LLMs would almost never make obvious mistakes. So in a world of near-perfect LLMs, a type system is just adding pointless overhead.

In this current world of quite imperfect LLMs, I agree with the OP, though. I also wonder whether, even if LLMs improve, we will be able to use type systems not exactly for their original purpose but more as a way of establishing that the generated code is really doing what we want it to, something similar to formal verification.

ImprobableTruth•1h ago
Even near-perfect LLMs would benefit from the compiler optimizations that types allow.

However perfect LLMs would just replace compilers and programming languages above assembly completely.

Mistletoe•1h ago
I don't know what vibecoding is, and at this point I'm too afraid to ask.
shric•1h ago
It’s fine to not know what it is, but what is the rationale for commenting that you don’t know? Why not just look it up? Or don’t, as you’re too afraid to ask.
bashtoni•1h ago
I wouldn't worry too much, no-one seems to be able to agree what it means anyway.

Depending on who you speak to it can be anything from coding only by describing the general idea of what you want, to just being another term for LLM assisted programming.

OutOfHere•11m ago
The strict original definition of vibe coding is it is LLM writing code with the programmer never caring about the code, only caring about the code's output. It is easily the worst way to use LLMs for code, and I think even coining the term was a highly irresponsible and society-damaging move by Karpathy. This coined definition was taken literally by managers to fire workers.

In truth, for LLM generated code to be maintainable and scalable, it first needs to be speced-out super well by the engineer in collaboration with the LLM, and then the generated code must also be reviewed line-by-line by the engineer. There is no room for vibe coding in making things that last and don't immediately get hacked.

J_Shelby_J•1h ago
Writing rust and the LLM almost never gets function signatures and returns types wrong.

That just leaves the business logic to sort out. I can only imagine that IDEs will eventually pair directly with the compiler for instant feedback to fix generations.

But rust also has traits, lifetimes, async, and other type flavors that multiples complexity and causes issues. It also an in progress language… im about to add a “don’t use once cell.. it’s part of std now “ to my system prompt. So it’s not all sunshine, and I’m deeply curious how a pure vibe coded rust app would turn out.

762236•44m ago
Gemini has been doing a fantastic job for me for Rust
SteveJS•1h ago
I think this is true -- especially for new code.

I did this not knowing any rust: https://github.com/KnowSeams/KnowSeams and rust felt like a very easy to use a scripting language.

xwolfi•51m ago
That seems a little bit dangerous, why not do it in a language you know ? Plus, this is not launching rockets on the moon, it's a sentence splitter with a fancy state machine (probably very useful in your niche, not a critique) - the difficulty was for you to put the effort to build a complicated state machine, the rest was frankly... not very LLM-needing and now you can't maintain your own stuff without Nvidia burning uranium.

Did the LLM help at all in designing the core, the state machine itself ?

SteveJS•15m ago
Nah it was a hobby project because I was laid off for a bit.

Rust's RegEx was perfect because it doesn't allow anything that isn't a DFA. Yes-ish, the LLM facilitated designing the state machine, because it was part of the dev-loop I was trying out.

The speed is primarily what enabled finding all of the edge cases I cared about. Given it can split 'all' of a local project gutenberg mirror in < 10 seconds on my local dev box I could do things I wouldn't otherwise attempt.

The whole thing is there in the ~100 "completed tasks" directory.

exclipy•1h ago
The closest we got to vibe coding pre-LLMs was using a language with a very good strong type system in a good IDE and hitting Ctrl-Space to autocomplete your way to a working program.

I wonder if LLMs can use the type information more like a human with an IDE.

eg. It generates "(blah blah...); foo." and at that point it is constrained to only generate tokens corresponding to public members of foo's type.

Just like how current gen LLMs can reliably generate JSON that satisfies a schema, the next gen will be guaranteed to natively generate syntactically and type- correct code.

treyd•1h ago
You already can use LLM engines that force generation according to an arbitrary CFG definition. I am not aware of any systems that apply that to generating actual programming language code.
koolba•58m ago
> I wonder if LLMs can use the type information more like a human with an IDE.

Just throw more GPUs at the problem and generate N responses in parallel and discard the ones that fail to match the required type signature. It’s like running a linter or type check step, but specific to that one line.

xwolfi•56m ago
We have infinite uranium anyway !
esafak•7m ago
LLMs can use LSPs. https://en.wikipedia.org/wiki/Language_Server_Protocol
nu11ptr•1h ago
Everything said is true without AI as well, at least for me. I don't hate Python, and I like it for very small scripts, but for large programs the lack of static type makes it much to brittle IMO. Static typing gives the confidence that not every single line needs testing, which reduces friction during the lifecycle of the code.
rvz•1h ago
Such extraordinary claims, require extraordinary evidence. Not "vibes"

> It seems that typed, compiled, etc. languages are better suited for vibecoding, because of the safety guarantees.

There are no "safety guarantees" with typed, compiled languages such as C, C++, and the like. Even with Go, Rust and others, if you don't know the language well enough, you won't find the "logic bugs" and race conditions in your own code that the LLM creates; even with the claims of "safety guarantees".

Additionally, the author is slightly confusing the meaning of "safety guarantees" which refers to memory safety. What they really mean is "reasoning with the language's types" which is easier to do with Rust, Go, etc and harder with Python (without types) and Javascript.

Again we will see more of LLM written code like this example: [0]

[0] https://sketch.dev/blog/our-first-outage-from-llm-written-co...

lvl155•1h ago
I can say with 100% certainty that they all stink at Rust. It’s laughably bad. Python, on the other hand, is surprisingly good.
energy123•1h ago
I scraped every comment on HN that discussed using Rust with LLMs and about half gave positive feedback, half negative feedback.

Can you explain more why you've arrived at this opinion?

OutOfHere•16m ago
With Python, it scales better if the Python is well-typed, not so much otherwise.

It's the best at Go imho since it has enforced types and a garbage collector.

timuckun•1h ago
It's been my experience that strongly opinionated frameworks are better for vibe coding regardless of the type system.

For example if you are using rails vibe coding is great because there is an MCP, there are published prompts, and there is basically only one way to do things in rails. You know how files are to be named, where they go, what format they should take etc.

Try the same thing in go and you end up with a very different result despite the fact that go has stronger typing. Both Claude and Gemini have struggled with one shotting simple apps in go but succeed with rails.

topato•58m ago
This is pretty anecdotal, but it feels like most of the published rails source code you find online (and by extension, an LLM has found) is from large, stable, and well-documented code.
rafamvc•44m ago
Claude code with rails is amazing. Should out to Obie for the Claude on rails. Works phenomenally well.
EGreg•54m ago
Basically it's like this:

the more constraints you have, the more freedom you have to "vibe" code

and if someone actually built AI for writing tests, catching bugs and iterating 24/7 then you'd have something even cooler

delifue•51m ago
In my experience Gemini can one-shot go apps. Determining it requires sound eval instead of anecdotes.
adamnemecek•53m ago
They are also better suited for being ported to other languages, also unsurprisingly
itsafarqueue•53m ago
This generalises to “Agents respond well to red/green feedback loops”.
warrenmiller•45m ago
it aint great at c# i can tell you. this from grok yesterday:

foreach (string enumName in Enum.GetNames(typeof(Pair)))

{

  if (input.Contains($"${enumName}"))
woodruffw•41m ago
> I am managing projects in languages I am not fluent in—TypeScript, Rust and Go—and seem to be doing pretty well.

This framing reminds me of the classic problem in media literacy: people know when a journalistic source is poor when they’re a subject matter expert, but tend to assume that the same source is at least passably good when less familiar with the subject.

I’ve had the same experience as the author when doing web development with LLMs: it seems to be doing a pretty good job, at least compared to the mess I would make. But I’m not actually qualified to make that determination, and I think a nontrivial amount of AI value is derived from engineers thinking that they are qualified as such.

giantrobot•34m ago
Gell-Mann Amnesia [0]

[0] https://en.m.wikipedia.org/wiki/Gell-Mann_amnesia_effect

woodruffw•34m ago
Thank you! I couldn’t remember the term.
bravesoul2•24m ago
Why I only use it on stuff I can properly judge.
muglug•3m ago
Yup — this doesn't match my experience using Rust with Claude. I've spent 2.5 years writing Rust professionally, and I'm pretty good at it. Claude will say some dumb things about Rust code because it’s not a static analysis tool and a statistical model. When the code compiles, it’s invariably very inefficient and ugly.

But if you want it to generate chunks of usable and eloquent Python from scratch, it’s pretty decent.

And, FWIW, I’m not fluent in Python.

brikym•36m ago
You could just leave it at "Typed languages are better."
jbellis•34m ago
I'm really shocked at how slow people are to realize this, because it's blindingly obvious. I guess that just shows how much the early adopter crowed is dominated by python and javascript.

(BTW the answer is Go, not Rust, because the other thing that makes a language well suited for AI development is fast compile times.)

poink•31m ago
Typed languages are also better suited to IDE assistance and static analysis

I'm a relatively old school lisp fan, but it's hard to do this job for a long time without eventually realizing helping your tools is more valuable than helping yourself

anupshinde•28m ago
I am comfortable with both Python and Go. I prefer Go for performance; however, the earlier issue was verbosity.

It is easier to write things using a Python dict than to create a struct in Go or use the weird `map[string]interface{}` and then deal with the resulting typecast code.

After I started using GitHub Copilot (before the Agents), that pain went away. It would auto-create the field names, just by looking at the intent or a couple of fields. It was just a matter of TAB, TAB, TAB... and of course I had to read and verify - the typing headache was done with.

I could refactor the code easily. The autocomplete is very productive. Type conversion was just a TAB. The loops are just a TAB.

With Agents, things have become even better - but also riskier, because I can't keep up with the code review now - it's overwhelming.

jjcm•26m ago
I've noticed a fairly similar pattern. I particularly like vibecoding with golang. Go is extremely verbose, which makes it almost like an opposite perl - writing go is a bad experience, but reading go is delightful. The verbosity of golang makes it so you're able to always jump in and understand context, often from just a single file.

Pre-llms, this was an up front cost when writing golang, which made the cost/benefit tradeoff often not worth it. With LLMs, the cost of writing verbose code not only goes down, it forces the LLM to be strict with what it's writing and keeps it on track. The cost/benefit tradeoff has increased greatly in go's favor as a result.

OutOfHere•19m ago
The argument against Python is weak because Python can be written with types. Moreover, the types can be checked for correctness by various type checkers.

The issue is those who don't use type checkers religiously with Python - they give Python a bad name.

The reason the West is warmongering against China

https://www.aljazeera.com/opinions/2025/8/3/the-real-reason-the-west-is-warmongering-against-china
1•mhga•3m ago•0 comments

Generative AI at the Crossroads: Light Bulb, Dynamo, or Microscope? [pdf]

https://www.federalreserve.gov/econres/feds/files/2025053pap.pdf
1•ryan_j_naughton•4m ago•0 comments

Show HN: Send JSON Data directly to a table straight from your web app code

https://jsonbason.com
1•natewww•4m ago•0 comments

Try the #1 Photorealistic Image Generator

https://flux1-krea.dev
2•havanidea•5m ago•1 comments

The Demon that Wears my Face

https://mirawelner.com/posts/demon.html
1•mirawelner•7m ago•0 comments

DuckLake for Busy Engineering Managers

https://blog.incrementalforgetting.tech/p/ducklake-for-busy-engineering-managers
1•mooreds•7m ago•0 comments

Slow Opportunities for Investing Locally

https://soilboulder.org/about
1•mooreds•8m ago•0 comments

The Story of Reddit [audio]

https://podcasts.apple.com/us/podcast/first-time-founders-with-ed-elson-the-story-of-reddit/id1498802610?i=1000706139657
1•mooreds•9m ago•0 comments

Mothers Ruin Software - Independently developled free Mac apps

https://www.mothersruin.com/software/about.html
1•gurjeet•10m ago•0 comments

The Extent of Bladed Terrain on Pluto via Photometric Surface Roughness

https://agupubs.onlinelibrary.wiley.com/doi/10.1029/2024JE008554
1•gnabgib•10m ago•0 comments

Is It Still Disney Magic If It's AI?

https://www.wsj.com/business/media/disney-ai-hollywood-movies-5982a925
1•wawayanda•18m ago•0 comments

Skyscraper-size spikes of methane ice may surround Pluto's equator

https://www.livescience.com/space/pluto/skyscraper-size-spikes-of-methane-ice-may-surround-plutos-equator
2•geox•20m ago•0 comments

Roll Your Own Virtual Ontology with Claude Code

https://github.com/mcfitzgerald/virtual-ontology
1•mcfitzgerald•21m ago•1 comments

Realizing we needed two sorts of alerts for our temperature monitoring

https://utcc.utoronto.ca/~cks/space/blog/sysadmin/MachineRoomTempTwoSortsOfAlerts
1•bobbiechen•23m ago•0 comments

What's Next for AI at DeepMind

https://www.cbsnews.com/video/demis-hassabis-ai-deepmind-60-minutes-video-2025-08-03/
1•jonbaer•26m ago•0 comments

Optimal sizing, control of a grid-connected battery in a stacked revenue model

https://www.sciencedirect.com/science/article/pii/S0306261925008529
1•PaulHoule•27m ago•0 comments

Banana Production in Iceland

https://en.wikipedia.org/wiki/Banana_production_in_Iceland
1•surprisetalk•30m ago•1 comments

Write Faster with AI – While Keeping It Yours

https://www.anupshinde.com/write-faster-with-ai/
2•anupshinde•39m ago•0 comments

Google Adds Veo Watermark to All Veo3 Videos Except for Ultra Members

https://blog.google/products/gemini/veo-3-expansion-mobile/
2•robertwt7•40m ago•0 comments

Heavy metals in Nestlé baby food but off the hook for liability

https://www.youtube.com/watch?v=XQNnZYfKMH4
2•burnt-resistor•44m ago•0 comments

Shroud of Turin image matches low-relief statue–not human body,3D modeling study

https://phys.org/news/2025-08-shroud-turin-image-relief-statue.html
5•pseudolus•47m ago•1 comments

The WOBA Paradox: Signal vs. Noise in Baseball Performance Metrics

https://runningonnumbers.com/posts/machado-soto-suarez-woba-xwoba/
1•oliverc1622•47m ago•0 comments

Show HN: Flash AI Presentation Maker

https://flashpresentationmaker.netlify.app
1•effacestudios•49m ago•0 comments

Are you an American looking to buy a used camera from overseas? Do it quick

https://www.dpreview.com/news/8383296180/us-tariffs-de-minimus-exemption-ending
2•mhga•51m ago•0 comments

LLMs won't save you from bad software engineering culture

https://atelfo.github.io/2025/08/03/llms-and-software-development.html
3•Atelfo•55m ago•0 comments

SF Fake Pitch Competition

https://partiful.com/e/kIca2HfBF8Z390s9d62b
1•smsliman•56m ago•0 comments

A parser for TypeScript types, written in TypeScript types

https://github.com/easrng/tsints
1•todsacerdoti•57m ago•0 comments

Show HN: GPT helped me rebuild a .NET app in 30 mins what took 3 weeks in MFC

2•CodeAndExile•59m ago•0 comments

Ready or not, age verification is rolling out across the internet

https://www.theverge.com/analysis/715767/online-age-verification-not-ready
7•GSSmarin•1h ago•1 comments

Apple Hiring for 'Answers' Team Working on 'ChatGPT-Like Search'

https://www.macrumors.com/2025/08/03/apple-hiring-for-answers-team/
3•mgh2•1h ago•1 comments