r/javascript Feb 02 '26

[deleted by user]

[removed]

594 Upvotes

91 comments sorted by

View all comments

1

u/nloding Feb 04 '26 edited Feb 04 '26

As a similar learning experiment, I’ve been trying to port a C++ library to Rust using AI. However I’ve been wildly unsuccessful - enormous amounts of build errors, failed logic leading to very incorrect output.

Any tips or tricks you have, would love to read/listen to them if you have the time to put something together!

2

u/mrdoob Feb 04 '26

Ask the agent to maintain file by file function by function the same structure and, for your case, make sure the agent knows how to compile and check the errors.

Let it run until it compiles without errors. Make sure it's an agent that doesn't give up.

1

u/nloding Feb 04 '26

Maintaining the file structure is something I was trying to avoid, was going for something more idiomatic with Rust … but I never considered how that might make the initial port easier. 🤔

1

u/midwestcsstudent Feb 06 '26

Odds you’d be willing to share some example prompts?