by ffsm8 · 2w ago · 0 comments
You're trying to middle road it. He was talking about actually treating it as a black box, so just give the model your expectations and goals it needs to meet, not tell it a rough solution for it to apply in detail.
The expectation/goal approach in a ai edited project works better then the middle road since opus5.5 ime. Depending on your project structure, it may not be viable however without large refactorings
Other times it will one shot things near perfectly that I was expecting to just use as a reference. Demo pages for work I've done its so fast and gets good enough right out the door
Every time I've tried to use it to write something small in my compiler? :"( pain. It's the perfect intersection of looks good and covers 90% of cases fine but explodes far away because some subtle invariant is wrong. I can't always think of the invariants up front without writing the code myself
I recently asked Gemini 4 Argon a question about a gcloud api, and to answer the question it decompiled the Google Java client library (without me asking) and figured out how it worked.
I do wonder if models struggle with .NET IR because there may be less info about it in its training data. When you’re working with open source systems it has much more to go on.
I’ve used models to generate ONNX IR (executable format for deep learning models), and that worked well. But the ONNX IR is much simpler.
The issue that it ran into is that it needed to keep track of .NET assembly and type information to do do generic calls (you need a reference to the actual type/method information, which you would need to collect and keep for lookup when compiling your AST into .NET). I didn't ask it to do generics until a handful of prompts in, and the codebase was not terrible but sketchy enough that once the LLM realized it needed type information it hadn't been tracking, it tried, flopped a couple times, and reached for reflection to avoid the problem
This is the kind of thing I might have considered to flag to the LLM ahead of time if I had written a .NET IR generator before, but I'm just a long time user/typically focus on native code or transpilation. If I was writing it myself I would have noticed early on that generics should be filed under "weird shit to verify" given it requires me to track info that is not in my AST, but when I'm prompting an LLM my mind is not on that, I'm focused on the higher level constraints + semantics (ie how suspend/resume works or rules around product types etc), and not details like that
I think it could been affected by a lack of training data, I don't know how many feature complete compilers for typed languages exist out there for .NET. C# and F# of course, and there are compilers for SML, Koka, and maybe some others I cant think of, but most were for dynamic languages written many years ago.
.NET IR was standardized before .NET core even IIRC and everything I use in the .NET stack has been MIT for a long time now
> I recently asked Gemini 4 Argon a question about a gcloud api, and to answer the question it decompiled the Google Java client library (without me asking) and figured out how it worked.
I've noticed the same sorts of things happen and its kind of funny, because at times it is the right move, and others I have to interrupt the model and remind it that there is a uh, documentation, it can just skim real quick
It is super handy but also a little funny how quick they are to "let me just reverse engineer this real quick" before considering a short search
But to preempt a "I can't do that in my brownfield distributed monolith I'm maintaining at $dayjob": yes, that's why I said it may not be possible without refactoring.
My point is that you can ask for unrealistic outputs even if you’re treating the system as a black box. This is the classic case of higher level managers asking for infeasible results from their engineering team because they haven’t considered they’re trying to solve the wrong problem. Depends what you’re doing but I don’t think agents tend to push back on badly specified goals unless you’re proactive about it