5 ms·
LLM-generated code that seemingly went without much review or design is always such an interesting dive into just how bloated you can make code. In this reposit
by embedding-shape 2mo ago
LLM-generated code that seemingly went without much review or design is always such an interesting dive into just how bloated you can make code. In this repository, multiple files are close to 10K LOC, one file contains a switch statement that has so many case statements it spans more than 1000 lines, and lots of other fun stuff.
I guess it depends on the model you're trying to use, but seems most of them prefer smaller codebases, they work a lot better with less code, which kind of makes sense. With that in mind, I'd probably aim for something way smaller to bootstrap a self-improving agent. Then I'd use this "Prime Agent" as an example to my self-improving agent for what it should not evolve to.
- andai 2mo agoBash is all you need. https://minimal-agent.com/ https://minimal-agent.com/
- digidecode 2mo ago[dead]
- whattheheckheck 2mo agoLiterally says who. Swe are the least credible "engineers". "It depends" "No you cant track us" "No we have no credentials system other than big company shill certs"
- c-hendricks 2mo ago> one file contains a switch statement that has so many case statements it spans more than 1000 lines Probably best to leave YandereDev's code out of the training data.
- trenchgun 2mo agoInteresting, so they shipped slop? Succumbed to their own AI psychosis?
- tosh 2mo agohere is a take on a smol agent ("smol") - 21 lines of Go - no 3rd party dependencies https://github.com/smol-env/smol https://github.com/smol-env/smol easier to add and customize stuff when you start from a small base think of it as your starter dough
- vivzkestrel 2mo agogot one in typescript? or node.js with javascript?
- tosh 2mo agoI'm adding python in a few minutes and then looking into other languages including javascript and typescript all with the same zero 3rd party dependencies approach also want to do clojure, unfortunately it looks like java does not come with json support out of the box
- embedding-shape 2mo ago> also want to do clojure, unfortunately it looks like java does not come with json support out of the box Clojure has clojure.data.json (https://clojure.github.io/data.json/ https://clojure.github.io/data.json/), should be easy to use albeit not blazing fast exactly, doesn't really matter here though. Otherwise, you could use Babashka, comes with Cheshire (and others) out of the box.
- tosh 2mo agoty for the pointers I like the babashka angle!
- evanjrowley 2mo agoThe stuff 99% of agents are coded in? Please tell me this was sarcasm.
- tosh 2mo ago
- nullbio 2mo agoHow on Earth do we solve this bloat and death-by-a-thousand-cuts issue with frontier LLMs? Are there any actual solutions or attempts at solutions to this problem that I can try? Any tools or frameworks? I've tried re-architecture skills, dedicated cleanup sessions, and a bunch of other stuff, but nothing really works well.
- impulser_ 2mo agoDon't have it write the whole thing in one session.
- embedding-shape 2mo agoDon't try to "run as fast as possible" and just add code willy-nilly, think about the design, refactor as you add new features/fixes and intentionally be a bit slower and more considerate. It's not a technical problem, if you steer the LLMs enough and actually review what they do, you can build proper and clean software with them.
- nullbio 2mo agoYeah, but that's boring. :)
- kooi 2mo agoAdd Sentrux to the LLM loop. https://github.com/sentrux/sentrux https://github.com/sentrux/sentrux It's an offline coding grader. It works well: You ask for a new module, LLM starts spitting out bloated crap, the code score goes down. LLM keep looping until code score is back up. Not a substitute for human code review, but keeps things within tight guard rails.
- KingMob 2mo agoAre you the author? The font size and contrast is kind of poor.
- nullbio 2mo agoHave you done any benchmarks on this approach? I wonder if it just ends up in reward-hacking, or if it actually substantially changes the quality of the code. Are these static analysis metrics enough on their own to cause a substantial improvement? I tried setting some constraints as part of my system instruction prompt to prevent God file creation, and it did end up breaking files up, but it would often just create a new type of mess and do it needlessly. Without the model doing additional reasoning and search for alternative approaches that were better fitted on top as it was doing this file splitting, it didn't actually seem to improve quality at all. So I'm curious to know if this would just result in more of that, or if it would actually result in different choices. Because there's more to code maintenance than just splitting things up into modules, etc. Like the main part of it that I suspect will not be captured is the part of thinking about the big picture, brainstorming multiple architectural approaches, and reasoning through the best one.
- ben_w 2mo ago> In this repository, multiple files are close to 10K LOC, one file contains a switch statement that has so many case statements it spans more than 1000 lines, and lots of other fun stuff. Pft. Over multiple cases? I've seen 1000 lines inside a single if-block. The clause was always true. I was not able to break that thing up in my time at that company. Human wrote that nonsense. Thing is, the app was pretty successful despite all the stuff wrong with the code. And this success is why I've been bullish on GenAI code itself, even though I'm also bearish on AI companies being able to profit from that.
- dd8601fn 2mo agoAt all feels a bit like being bullish on the adjustable wrench, to me. It has lots of utility. Very broad… but not the best for a lot of things. It will be a ubiquitous tool. Outcomes will depend heavily on the quality of the mechanic unless you’re tightening a bolt on your fence gate.