-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feedback on the API #3
Comments
In response to the above:
|
In terms of safety, would it be worth defining some abstract types (http://www.torek.net/torek/c/types2.html) to add some type safety? |
As all our abstract types are nested typedefs of 'unsigned' (broad statement) there is no safety to be had... If it was c++ we could make them shim classes into POD, trivially optimised away. However, we can try to persuade users that they are opaque types regarding the API by not putting the typedefs in the API! p.s, regarding 'streaming_channel' this is now defined in src/ thus is an opaque & safe type as far as the API is concerned - yippy! |
p.s. we could still use structs (or unions) as we have not classes, but this would require a field operator viz: Cant have totally anonymous aggregates :-( |
Some useful feedback on the API:
event_select & event_select_no_wait could be merged and take an argument to determine whether to pause or not. This makes it easier to have different behaviour each time round the loop.
The port API is missing the pullup/down control functions.
The resource allocation functions should be prefixed with "hw_" to highlight that they are allocating hardware resources of a limited number.
The channel transactions could be simpler to use (and harder to break) if the transacting_chanend state was hidden in global state.
It would be helpful to have sendto/recvfrom for many-to-1 channels.
The text was updated successfully, but these errors were encountered: