eo icon indicating copy to clipboard operation
eo copied to clipboard

get rid of "data" attribute in XMIR

Open yegor256 opened this issue 2 years ago โ€ข 18 comments

Say, this is the code in EO:

[] > foo
  42 > a
  3.1415926 > b
  "hello" > c

It will be translated to XMIR:

<o name="foo">
  <o name="a" data="int" base="int">42</o>
  <o name="b" data="float" base="float">3.1415926</o>
  <o name="c" data="string" base="string">hello, ะดั€ัƒะณ</o>
</o>

I suggest to get rid of data attribute and use only bytes inside the element text:

<o name="foo">
  <o name="a" base="int">2a</o>
  <o name="b" base="float">40-49-0f-da</o>
  <o name="ั" base="string">68-65-6c-6c-6f-2c-20-d0-b4-d1-80-d1-83-d0-b3</o>
</o>

Thus, the parser will translate primitive types to bytes.

yegor256 avatar Sep 27 '21 14:09 yegor256

What are the benefits of this change?

As I see it, this would only make XMIR less human-readable and introduce additional overhead of decoding the bytes for applications that rely on XMIR.

nikololiahim avatar Sep 27 '21 14:09 nikololiahim

@nikololiahim the main reason is uniformity between implementations. Now, when we keep 3.1415926 in the XMIR, each reader of XMIR can interpret it their own way. Some may think it's float (4 bytes), while others may think it's double (8 bytes). With the proposed changes we get rid of this problem: different interpretations of data.

yegor256 avatar Sep 27 '21 14:09 yegor256

Ok, I see, but I still think that this change would introduce even more problems than it would solve. Every implementer would come up with their own way to decode the bytes which would spawn even more ambiguity and even bugs.

nikololiahim avatar Sep 27 '21 15:09 nikololiahim

@nikololiahim each EO2* compiler will have to be integrated into objectionary, in order to become an official one. In order to be integrated there, all tests for all existing EO objects have to pass with this compiler. Thus, we will have no misunderstandings between compilers.

yegor256 avatar Sep 27 '21 16:09 yegor256

@Graur please, help

yegor256 avatar Aug 08 '22 11:08 yegor256

@Graur if you can make this top priority, would be great

yegor256 avatar Aug 10 '22 13:08 yegor256

@andreoss Can you help us with this issue? The budget is 30 minutes

Graur avatar Aug 11 '22 12:08 Graur

@andreoss this is urgent, would be great if you put it to the highest priority

yegor256 avatar Aug 15 '22 10:08 yegor256

@yegor256 3 puzzles #1084, #1085, #1086 are still not solved.

0pdd avatar Aug 24 '22 09:08 0pdd

@yegor256 2 puzzles #1085, #1086 are still not solved; solved: #1084.

0pdd avatar Aug 26 '22 07:08 0pdd

@yegor256 the puzzle #1085 is still not solved; solved: #1084, #1086.

0pdd avatar Aug 26 '22 08:08 0pdd

@yegor256 2 puzzles #1085, #1099 are still not solved; solved: #1084, #1086.

0pdd avatar Aug 26 '22 08:08 0pdd

@yegor256 3 puzzles #1085, #1103, #1104 are still not solved; solved: #1084, #1086, #1099.

0pdd avatar Aug 27 '22 04:08 0pdd

@yegor256 4 puzzles #1085, #1103, #1110, #1111 are still not solved; solved: #1084, #1086, #1099, #1104.

0pdd avatar Aug 29 '22 07:08 0pdd

@yegor256 6 puzzles #1085, #1103, #1111, #1114, #1115, #1116 are still not solved; solved: #1084, #1086, #1099, #1104, #1110.

0pdd avatar Aug 30 '22 03:08 0pdd

@yegor256 5 puzzles #1085, #1103, #1111, #1114, #1115 are still not solved; solved: #1084, #1086, #1099, #1104, #1110, #1116.

0pdd avatar Aug 31 '22 06:08 0pdd

@yegor256 6 puzzles #1085, #1103, #1111, #1114, #1115, #1144 are still not solved; solved: #1084, #1086, #1099, #1104, #1110, #1116.

0pdd avatar Sep 03 '22 04:09 0pdd

@yegor256 5 puzzles #1085, #1103, #1114, #1115, #1144 are still not solved; solved: #1084, #1086, #1099, #1104, #1110, #1111, #1116.

0pdd avatar Sep 14 '22 07:09 0pdd

@yegor256 3 puzzles #1085, #1115, #1144 are still not solved; solved: #1084, #1086, #1099, #1103, #1104, #1110, #1111, #1114, #1116.

0pdd avatar Dec 28 '22 14:12 0pdd

@yegor256 2 puzzles #1115, #1144 are still not solved; solved: #1084, #1085, #1086, #1099, #1103, #1104, #1110, #1111, #1114, #1116.

0pdd avatar Mar 05 '23 05:03 0pdd

@yegor256 the puzzle #1144 is still not solved; solved: #1084, #1085, #1086, #1099, #1103, #1104, #1110, #1111, #1114, #1115, #1116.

0pdd avatar Mar 05 '23 05:03 0pdd

this is done, thanks to all

yegor256 avatar Mar 05 '23 05:03 yegor256

@andreoss Please, check the SolarStaff platform

Graur avatar Mar 27 '23 08:03 Graur