You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For expresiveness and consistency, it would be nice to use the binarylang's data structure definitions, to define outgoing only data in a network protocol, that does not need to be parsed in any way, just serialized. We can do this, but the object variable still has to be initialized with the values we want, and thus the assertion expressions are just comsetic in this example. I'd like to be able to do something like
On second thought, there are cases where one might want to initialize the object with different default values than the ones used for assertions. I believe there should be some special syntax to allow defining default values. Nim also recently got support merged for default value in objects: nim-lang/Nim#20480
Sounds like a useful feature. My only concern is that, this essentially it requires extra codegen - some kind of initializer proc. I don't want to bloat codegen with something like this, because most people will probably not need it, but binarylang will still generate it for every single parser definition.
The next big planned change for binarylang is to split codegen into loosely-coupled components, and allow the used to configure which components to use. Once this component-based system is implemented, this feature can be a separate component.
For expresiveness and consistency, it would be nice to use the binarylang's data structure definitions, to define outgoing only data in a network protocol, that does not need to be parsed in any way, just serialized. We can do this, but the object variable still has to be initialized with the values we want, and thus the assertion expressions are just comsetic in this example. I'd like to be able to do something like
The text was updated successfully, but these errors were encountered: