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
Consider addition RTTI to words #103
Comments
MessagePack supports extension types. So, you can define domain specific types with it. Although they have no versions for their specs ( see msgpack/msgpack#165 and msgpack/msgpack#195 ). |
@pankratov MessagePack extension types looks good. But the more I watch, the less I like this format. Lack of format version is big concern. Also I think we trying to use tools (BSON/MP) looks like suitable but not actually suitable. |
I don't think it would be hard to implement our own protocol. It seems quite simple, and it's an esential part of our vm. |
It seems like you meant data here, not primitive_data, i.e. @fomkin Do you consider binary data (like hash for example) as an array of uint8 ? |
I think tuples (i.e. |
And here
Why primitive? How can I define array of arrays, for example? Should I use refs ? |
Domain specific types (like address or code for example) could be defined as separate types. |
How about a name of a struct itself, I mean how are we going to separate different struct types being of the same structure? Another concern here is an array of a variable length data, e.g. array utf8 .... We won't be able neither to give its length nor have constant time indexed access to values. If it's meant that only refs are used for variable length data in arrays, I think we need to show it in specs. This is complementary to Vasilii's question. ref_data size looks very modest to me, although this will reduce the size of a program significantly, we will have very few space for future changes. |
@sherzodv are we going to distinguish them? I thought it's something like a dictionary or map. |
External mapping is OK too if we can guarantee that our data never moves. In other case things like dynamic cast will be in trouble |
@pankratov Because I want to mutate without copy. Yes, you need to use refs.
@sherzodv +1 great idea.
@sherzodv thanks, I'll fix it.
@sherzodv Ok. You right. Let it be 32 bit. |
|
We need to somehow encode type signature of a word. It's needed in meta method signature and definitely will be needed in future meta information. So I suggest to introduce new
in Probably we're also going to add something for class representation (e.g. for methods in |
@vovapolu looks good. |
Overview
Now RTTI (runtime type information) becomes obvious. It's required by .NET transaction support, by debug purposes like stack and head printing and transaction introspection. Also it will remove necessarity of type-bounded arithmetic instructions. I see two approaches to implementation.
I'm inclined to the second approach.
Proposal
This is specification pseudo-BNF of word format.
smth[num]
means that we duplicatesmth
structurenum
times.byte[8]
means 8 bytes,bytes~num
means that we expectnum
of bytes (which length is dynamic).&length
refers to givenlength
field and means an integer representation of that field.(a, b)
means pair type, e.g. two values ofa
andb
are written consecutively.data(primitive_type)
means corresponding*_data
structure forprimtive_type
The text was updated successfully, but these errors were encountered: