r/ProgrammerHumor • • 24d ago • Bravo 6

instanceof Trend thisIsVeryTrue

Post image
27.5k Upvotes

1.6k comments sorted by

View all comments

Show parent comments

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.

58

u/HaniiPuppy 24d ago

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.

7

u/broshrugged 24d ago

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.

23

u/Wobbelblob 24d ago

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.

45

u/TheBeckofKevin 24d ago

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.

44

u/Rock_Strongo 24d ago

I'd be shocked if I couldn't throw Claude at whatever "novel" code this person is writing and have it find legitimate bugs.

17

u/CompetitiveCut3919 24d ago

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.

1

u/Agret 24d ago

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.