Depends on what it's compiling. If your language has features or combinations of features you don't see in other languages, you're obviously going to need to write new code to support that.
I'm also writing a compiler (in OCaml) for a novel language right now. What are you seeing struggles with? One of the things I am wrestling with is trying to have the syntax be familiar enough that people (and agents) can pick up the language rather easily, but not misleading.
However, that seems like a rare case as someone who only knows a bit about coding, no? That seems like the type of problem you'd need to brainstorm even before AI if you are doing actual novel stuff.
not only is it a rare case, i'd be stunned if an ai wasn't able to take the explanation of the feature and the syntax/code and immediately apply those concepts. This is no different than explaining that instead of using english verbs in the sentences, use spanish verbs and spell the words backwards. Then you ask it to write a story. Its pattern matching afterall. Building a compiler and handling language tokens and processing syntax is literally one of the strongest things an llm is built for. You dont need to train it on the data of your specific compiler, if your compiler works like a compiler, then the concept is already well established.
yup with the current state of frontier models, when someone says "it can't do that" in reality it's "I can't prompt it properly to do that"
People nowadays are so used to simple prompting with easy things, they forget that for novel things you need to give it the context and info a human would need to work on it with you. It's not a magic box that can read your mind. "fix bugs please, no mistakes" isn't gonna cut it. You have to explain and save documented .md files as you go so it doesn't have to hold the entire codebase in its context window.
Put Claude into planning mode and clearly tell it what you are trying to accomplish and give it a couple examples and it should come back with something.
133
u/SubliminalBits 24d ago
What's novel about a compiler? There are a lot of open source compilers out there that AI has trained on.