Not-Nik / raylib-zig

Manually tweaked, auto-generated raylib bindings for zig. https://github.com/raysan5/raylib
MIT License
517 stars 102 forks source link

About function name style #16

Closed Jack-Ji closed 2 years ago

Jack-Ji commented 2 years ago

Hi @Not-Nik, nice work you've being doing there! This may be a little nitpicking, however, I wanna know are there any plan to make naming style more akin to zig's standard library?

InitWindow --> initWindow
SetTargetFPS --> setTargetFPS
WindowShouldClose --> windowShouldClose
CloseWindow --> closeWindow

I think it would nice to distinguish between functions and types more easily.

Not-Nik commented 2 years ago

if zig has a way of forcing linkage such that a reference to initWindow links to InitWindow, that would be awesome. Does such a thing exist?

Jack-Ji commented 2 years ago

Not really sure. In my other c lib’s zig bindings, I simply use ‘pub const abc = Abc’, the bad part is editor’s auto-completion can’t give prototype of function, you need to jump over to check original declarations.

Jack-Ji commented 2 years ago

Sometimes I even create a zig wrapper for c api, it could introduce some overhead, but I get to make api more zig-like. For example, optional arguments can be wrapped into a struct, and change c pointer to zig’s non-nullable pointer etc.

Not-Nik commented 2 years ago

I don't currently plan on implementing this, but if you want, you can update the function generator script to reflect your proposal.