reswitched / libtransistor

Open source toolchain for Switch development
ISC License
204 stars 46 forks source link

Auto generating services from SwIPC ? #90

Open roblabla opened 6 years ago

roblabla commented 6 years ago

So I was wondering how good an idea it'd be to generate bindings automatically from SwIPC (with something like https://github.com/reswitched/SwIPC/pull/9). Basically, replace most of the stuff in the ipc/ folder with auto-generated things.

This would be a good litmus test to ensure that our SwIPC documentation is correct, while also removing a bunch of boilerplate.

@misson20000 how do you feel about this ?

misson20000 commented 6 years ago

Hmm, there are a few things that I would be really, really careful with here:

If we can come up with a way to address all of these concerns, I'd say it could be worth moving forward with.

daeken commented 6 years ago

I think there's a middle ground we can achieve here. Rather than generating fully-fledged IPC code, generate one function per IPC method, which sends a given message over a given connection. These get grouped into individually includable C files (one per IPC interface class), to be wrapped into nice friendly interfaces.

Compile times wouldn't go up dramatically, interfaces stay clean on the user side, and the ugly names and IPC details stay encapsulated.