r/haskell • • 6d ago

question Can AI reliably reverse engineer Haskell?

15 years ago, someone posted this question about reverse engineering Haskell. The conclusion was

GHC's output, stripped, is more difficult to reverse engineer than that of a similar program written in C or C++. That is due to the increased indirection, different idioms, and lack of interest and tools.

With all the recent news about people using AI to reverse engineer video games, Photoshop and other software, I'm wondering if that conclusion is still true. Have any of you tried using AI agents to reverse engineer a Haskell binary that's been stripped of its symbols? If so, what was the program and how well did it work?

I'm interested because I'm developing a video game in Haskell on my own. I'm not using generative AI, and I was planning to release a free prototype, to solicit feedback and kick-start my marketing campaign. But now I have to consider the likelihood of someone using the prototype to vibe-code a cheap knock-off and beat me to market.

EDIT: I'm aware that people can vibe-code a knock-off by describing it and giving screenshots/videos to an AI agent. I'm just wondering if decompiling the prototype would be an easy way for someone to greatly improve the result. I.e. I'm looking for information on what's achievable at a given cost, so that I can do a risk assessment.

0 Upvotes

21 comments sorted by

15

u/TheCommieDuck 6d ago

With all the recent news about people using AI to reverse engineer video games, Photoshop and other software...and I was planning to release a free prototype, to solicit feedback and kick-start my marketing campaign. But now I have to consider the likelihood of someone using the prototype to vibe-code a cheap knock-off

I am not an expert, but I am very confident that there are two problems going on right now - there's the slop infestation of the game reverse engineering scene (because people can just go "ok claude. run ghidra and decomp all this stuff") and there's the dark forest slop infestation where people are copying games from prototypes.

On the second issue, it's not a case of reverse engineering (I think). nobody is throwing decompilers at indie demos. they are simply going "Ok claude, make me a game with these mechanics. here are some assets and data files and everything else that ships with it".

so...I think the good news is "I don't think anyone is bothering to try or succeed at reverse engineering haskell binaries" but the very bad news is "and it doesn't matter if someone wants to slop your game prototype" :(

2

u/Osemwaro 5d ago

I'm not quite as concerned about people vibe-coding crappy knock-offs just using prompts, assets and information about the game that I put online, because I can: a) store assets in non-standard, obfuscated file formats of my own devising; and b) try to strike a balance between revealing enough information online about the game to get people interested, and omitting information that would be needed to create a faithful clone. A person who plays the prototype might be able to figure out some of the omitted information by playing it, but it would still be hard for them to use the obfuscated assets. But if agents can quickly and cheaply infer every detail about how the prototype works by reverse engineering it, including how to make sense of the asset files, then I have no way of protecting myself.

→ More replies (2)

8

u/retief1 6d ago edited 6d ago

Honestly, if you aren't a major developer or otherwise notable, I can't imagine why anyone would bother trying to reverse engineer your game. Like, you may think your game is the best thing ever, but no one else gives a shit about it. If your game fails, it will be because it never got enough interest to matter, not because someone stole the idea and beat you to market.

Edit: actually, no, the most likely form of failure is that you never finish the game at all. Never getting any interest is the second most likely form of failure. And if you avoid those failure modes, you'll get some degree of success. If you get enough success, people will steal your idea, but that will only happen after you've already succeeded. And, well, what game is more popular and better known, stardew valley or fields of mistria?

1

u/Osemwaro 5d ago

Have you read what happened to My Own Hero Party? For context, it's the developer's first Steam game, due for release in December. They released a demo on Itch and Steam 4 months ago, which got a little under 200 reviews -- great for a little-known indie game, but maybe not life-changing.

If AI makes it cheap and easy for people to steal work like this, a game won't necessarily need to attract a great deal of interest before it attracts thieves.

→ More replies (3)

7

u/Drumedor 6d ago

Even if it was possible, the likelihood of anyone bothering to reverse-engineer your game and then re-creating it is incredibly small.

If someone wanted to re-create your game and try to beat you to market they would just write down how the prototype is actually playing, its features and core gameplay loop, and then have agents work from that.

The only reason to decompile like CoD etc. is to re-create it exactly since they are very well known games and gamers knows how they should play.

If someone wanted to beat you to market they wouldn't care about having an exact replica, just a copy of the idea and gameplay since virtually none would know exactly how the game should feel/play.

→ More replies (1)

1

u/recursion_is_love 6d ago edited 6d ago

About the news, they are not the true reverse-engineer, more like a clean-room re-implementation. AI write completely new software from spec that copy from the target application. They didn't touch the binary.

IMO, reverse core-langauage (system-fc) might be doable but reverse the binary that include runtime sound lots harder. I've learn not to underestimate exponential advancement of AI, so I would not say it is impossible.

1

u/Osemwaro 5d ago

By "spec", do you mean a prompt written by the user, or something else? Have you come across any technical information anywhere that details what information and tools the agents used?

→ More replies (1)

1

u/jberryman 5d ago

I agree that you'll probably have to try it if you're trying for a serious risk assessment. I will say that if someone told me they built a passable binary to STG to haskell decompiler in a day in claude I would not be surprised. I'm certain it would take tons of engineering and heuristics if you needed something relatively idiomatic, which is maybe what you are asking about.

1

u/Osemwaro 5d ago

It doesn't have to be idiomatic, nor does it even have to be decompiled to Haskell. To pose a threat, agents just need to infer enough about how the prototype works from the binary to allow someone to vibe-code it into a complete game.

I don't trust the AI companies with any data that I care about, especially after the Navier-Stokes controversy, so I don't want to reverse engineer my own game with a SotA model. But I might try it on an open-source Haskell game at some point.

→ More replies (1)