Hacker News new | past | comments | ask | show | jobs | submit login

> What about Rust, like in this case?

I didn't explain myself well enough then. In the specific case of Rust, why doesn't Rust already have a way to tell tools what the API is, and why aren't there already tools which convert that API to bindings for other languages?

Ideally, "import rust_ffi; color_lib = rust_ffi.load_library('csscolorparser')"

We already saw from pcwelder's other responses that this AI generation required human involvement ("me asking it to return a 4 tuple instead of a list").

We can also see style questions, like how is_valid is a static method on the ColorParser class, rather than a module-level function as I would have done, so the API intrinsically cannot be automated.

Which I knew from my own experience in developing Python bindings to C libraries. If you want it to feel like Python, rather than C, you will have to put in the work. (In my case, to add class structure, to hook into Python's garbage collection, to match the iterator protocol, and so on.)






Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: