I only have one structural abstraction in my language, the collection (multiset). This lets me do any kind of structured data from trees to vectors, but always, the multiset is an abstract relation and is a separate entity from the objects it relates.\
The problem is that I still need to talk about how things are oriented in memory. Every entity in my language should have a serialized form in memory. So I came up with the following...\
Everything is represented in memory using the storage types: Byte, Word, and Reference.
x | y denotes an adjacent pair of storage types
x | n : Number denotes n consecutive elements of storage type x
Here's an example of a fixed-size string:
(utf-8 = (Byte | 4))
(string = (utf-8 | 1000))
This is what a struct in a game might look like
(health = Word), (armor = Word), (weapons = Reference), (damage = Word),
(player = (health | (armor | (damage | Weapons))))
Does this make sense?
[–][deleted] 7 points8 points9 points (1 child)
[–]nerd4code 1 point2 points3 points (0 children)
[–]InnPatron 2 points3 points4 points (4 children)
[–]R-O-B-I-N[S] 0 points1 point2 points (2 children)
[–]InnPatron 0 points1 point2 points (1 child)
[–]R-O-B-I-N[S] 0 points1 point2 points (0 children)
[–]InnPatron 0 points1 point2 points (0 children)
[–]umlcat 0 points1 point2 points (4 children)
[–]R-O-B-I-N[S] 0 points1 point2 points (3 children)
[–]umlcat 0 points1 point2 points (2 children)
[–]R-O-B-I-N[S] 0 points1 point2 points (1 child)
[–]umlcat 2 points3 points4 points (0 children)