frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

Ask HN: How do you make the LLM generate good code?

1•bjourne•1h ago
Lately, I wanted to see if I could get the bot to help me organize my music collection. Specifically, I want it to code a Python function that takes the path to an audio file of a song and returns the name of the canonical (i.e., first) album of that song. If one ignores remasters, live recordings, bootlegs, etc., this is an easy heuristic surjective mapping: Smoke on the Water -> Machine Head, Come as You Are -> Nevermind, Fools Gold -> The Stone Roses.

I can code this function quickly using the MusicBrainz API and I believe most other HN readers can too. Yet many hours later, no matter how I prompt the bot I can't get it to do it. This is what ChatGPT generates---other bots reply with similar garbage:

https://chatgpt.com/share/6a396ea9-44d4-83eb-bdfd-216dfcc87e99

They complain about how the problem is ambiguous (is not) or how MusicBrainz doesn't have the data (it does). Am I prompting the bot incorrectly or not using powerful enough coding models? The results are very underwhelming.

Comments

eternityforest•52m ago
I have a ~200 line file of style rules that I copy and paste between all my projects(There's got to be a better way to manage files like that!) but I can never quite tell if it's helping anything....

I usually prompt with very specific architectures, defining classes, functions, and JSON schemas, plus what libraries I want to use, and that seems to work, most of the time.

I generally use AiderDesk with MiniMax M2.5

verdverm•9m ago
Step one is to get out of the ChatGPT web interface. OpenCode is a much better harness

Step 2, have it write a plan in a file, then iterate on that plan

Download dependency source code and API specs for it to reference

Be specific, you wanted it to use a specific API but then said "use any API like .."

Don't expect a single session to get you there, use many and keep them fresh (the design/plan/status files help)

Read Anthropic knowledge share, it is currently the best and applies in generality

We don't use "LLMs" to generate code, we use "agent harnesses" and "context engineering". Good phrases to start your knowledge deepening

Give your agent good tools and context, then iterate

Show HN: DELN – An interactive atlas of AI training datasets

https://deln.ai/atlas
1•yshunnar•12s ago•0 comments

AI is changing biological and nuclear risks; governance must change accordingly

https://thebulletin.org/2026/06/ai-is-changing-biological-and-nuclear-risks-governance-must-chang...
1•pseudolus•1m ago•0 comments

The future of oil prices may depend on China

https://www.cnn.com/2026/06/22/energy/oil-price-china-dependence-iran-war-intl-hnk
1•toomuchtodo•4m ago•1 comments

California police are using drones to disarm people, make arrests

https://www.sfgate.com/bayarea/article/california-police-drone-responders-22315437.php
2•pseudolus•8m ago•0 comments

We built the fastest API for GLM-5.2 (280 TPS)

https://www.baseten.co/blog/how-we-built-the-worlds-fastest-api-for-glm-52/
2•philipkiely•9m ago•0 comments

Why Are LLMs Smart?

https://kevinkelly.substack.com/p/why-are-llms-smart
1•sgallant•11m ago•0 comments

Vietnam plans to discontinue IPv4 by 2030

https://vietnamnet.vn/en/vietnam-launches-ipv6-only-roadmap-to-power-next-digital-era-2527244.html
1•ivlad•13m ago•1 comments

A hedged NSA briefing line became "Mythos hacked the NSA"

https://old.reddit.com/r/AICognitiveWatch/
1•GlyphWeaver_a•14m ago•0 comments

How transparent is DiffusionGemma (and why it matters)

https://www.lesswrong.com/posts/zoYXpdaMgFT43Wc24/how-transparent-is-diffusiongemma-and-why-it-ma...
1•gmays•14m ago•0 comments

Show HN: The Only Prediction Market That Helps You Make Educated Bets

6•realJared54•23m ago•0 comments

Fable 5 wrote a Windows kernel in 38 minutes

https://tolmo.com/blog/when-the-model-writes-the-kernel/
2•ecares•27m ago•0 comments

Porting Moebius 0.2B image inpainting model to run in browser with Claude Code

https://simonwillison.net/2026/Jun/22/porting-moebius/
1•lumpa•27m ago•0 comments

Music retailer sues Fender over C&Ds in Stratocaster copyright dispute

https://www.guitarworld.com/gear/electric-guitars/thomann-is-suing-fender
3•ilamont•29m ago•0 comments

The Complete Kubrick

https://www.criterion.com/boxsets/9000-the-complete-kubrick
1•pentagrama•33m ago•0 comments

SpaceX turns to bond market to raise capital, reports $100.8B cash

https://www.reuters.com/business/media-telecom/spacex-launches-notes-offering-discloses-1008-bill...
5•voxadam•35m ago•2 comments

Heritage sites are at risk in a warming world – and how to save them

https://www.nature.com/articles/d41586-026-01956-0
1•gnabgib•36m ago•0 comments

Show HN: Nts – NTS Radio in your terminal

https://github.com/r-ohan/nts-radio-cli
2•rohan_•38m ago•0 comments

What it takes to get high Text-to-SQL accuracy in production

https://www.wisdom.ai/blog/how-wisdom-gets-text-to-sql-right
2•sharva•38m ago•0 comments

The Adobe Semaphore puzzle had been solved

https://www.nbcbayarea.com/news/local/san-jose-adobes-third-semaphore-puzzle-solved/4102715/
2•thatxliner•38m ago•0 comments

Fatal Tesla Crash into Texas Home Now Under Federal Safety Investigation

https://www.wsj.com/business/autos/fatal-tesla-crash-into-texas-home-now-under-federal-safety-inv...
3•JumpCrisscross•40m ago•0 comments

The annotated PyTorch training loop

https://idlemachines.co.uk/essays/pytorch-training-loop
3•smaddrellmander•42m ago•0 comments

Sakana Fugu multi-agent system delivered as one model

https://github.com/SakanaAI/fugu
2•882542F3884314B•43m ago•0 comments

At least 18 dead in France, including two children in hot car, as Europe bakes

https://www.reuters.com/business/environment/temperatures-exceed-40c-european-heatwave-three-die-...
2•rawgabbit•47m ago•0 comments

The Technium: Why Are LLMs Smart?

https://kk.org/thetechnium/why-are-llms-smart/
1•tortilla•49m ago•0 comments

PostmarketOS v26.06 (Alpen Avocado) released

https://postmarketos.org/blog/2026/06/21/v26.06-release/
2•birdculture•49m ago•0 comments

We are witnessing the slow death of the prestige career

https://www.theguardian.com/commentisfree/2026/jun/22/consulting-ai-prestige-careers
1•bookofjoe•53m ago•1 comments

"ChatGPT is I presume broken"

https://old.reddit.com/r/ChatGPT/comments/1ucs6ni/chatgpt_is_i_presume_broken/
1•beatthatflight•53m ago•2 comments

Humanoid Robot Begs for Electricity Money on China Streets with QR Code

https://yipzap.com/humanoid-robot-begs-for-electricity-money-on-china-streets-with-qr-code-the-vi...
4•noida•55m ago•0 comments

GLM-5.2 is above GPT-5.5 in new agentic knowledge work eval

https://artificialanalysis.ai/articles/aa-briefcase
4•declanjackson•56m ago•0 comments

AI Doesn't Replace On-Call Judgment

https://blog.sntxrr.dev/ai-doesnt-replace-on-call-judgment/
1•mooreds•58m ago•0 comments