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

I would say the optimal solution for the last 2 depends on the total requirements - aka there is no general optimal solution.

Both concerns are about having the need for boilerplate code (either for bindings or for serialization), which is quite repetitive to write and depends on the input types.

Now the possible solutions are from my perspective:

- Write that code by hand, which is quite tedious and error-prone.

- Use some code generator tooling (like protoc) for it. However that might require you to define your types in an IDL before going to code, which leads to an extra step in the development and build process. In my experience this works really well for big teams (because you also have an extra interface documentation against which all parties can work), but it might not be optimal for small teams and rapid iterations.

- Generate the code automatically from the type definitions in your program. Either during compile-time (which would require good compiler support for extracting the relevant details and using them for code generation) or during runtime by reflection. With reflection you are most likely getting the slowest code. But iteration times should be the fastest (no need to change IDL files, run codegen tools, etc.)




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: