-
Notifications
You must be signed in to change notification settings - Fork 782
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
[RFC] Update .mrb file format #944
Comments
I agreed with compact .mrb file. I still think .mrb format should be endian neutral. There's no reason for "file format" to be endian sensitive, unless you REALLY want to read them through mmap. Only we need is in-memory correspondent of .mrb file, which should consume less memory. FYI, I have a vague plan to remove irep array from mrb_state, instead, I'd add small irep arrays to each ireps. |
.mrb loader support both endian. What do you think about ROM .mrb? |
Why did you store compiler name/ver in irep section? I prefer to be upper-layer. |
Also bytecode ver, endian things. |
In my opinion, ROM stored data format should be separated from .mrb file.
Design something that serves both purposes has no merit. |
I agree with what @mattn said. Compiler name/ver, bytecode ver and endianness are redundant in irep section. Those infomation can be stored in .mrb file header. |
I think that member whose size is 16 or 32bits should not assign on odd address. And in embedded system I think .mrb file needs reserved area for extending format. So I propose it need reserved member after endianess or top of IREP record 'B'. |
I prefer @matz's opinion. The solution is depends on the reason why binary format is required. And I think we should provide a pluggable dump/load framework if the reason is ROM. |
I agree with @mattn's saying basically. |
How about to add file-format-type field in RITE file header? Just a first plan: |
@monaka |
Ok. Go back to the root of this issue, then. Could you tell us again why we need the new format? There have more than a merit. So it become easier to discuss if it was focused. |
I moved compiler name/ver to file header. But byte code ver still in irep section. I agreed remove endianness field. |
I think the new format is for extendable. After that I'll work for containing debug information to the file. |
I think this work is enough worth to develop incremental. We should focus to IREP archiving for now if it regards as the top priority. If it is so, is it acceptable the new file format is based on "ASCII hex format" and "endian neutral"? (for now) |
Do you think a IREP Record have a IREP record header included nlocals, nregs, npools, nsyms and so on? I prefre IREP record header by IREP record. If we have a IREP record header structure, simple to use IREP record section when cast original data to IREP record structure or header structure. |
@monaka |
There are 2 + 1 reason why I suggest ASCII. 1: working step by step. the current version of mrb is ASCII based. 2: easy to debug. This helps you until the format is stable. e.g. We can't paste binary here. 3: target loading in embedded systems. ASCII based formats are still active format on the embedded system area. Typical examples are Intel hex and Motorola S-record. Actually 3 is not important. Maybe embedians will choice the another format anyway. |
|
I have no reason that I recommend strongly if you say so. |
@masuidrive that link is 404 |
I go back to the figure attached. It is probably required IREP section table. Even if we can determine the offset of next section using section size. And it's better alignment conscious. This tactic makes easy to analyze using binary editors. I think 4bytes alignment is fit to this format. 2bytes also possible. |
I propose to have two separate irep representation, one for mrb file format (new mrb), the other for in-memory packed representation (packed irep). new mrb format should be:
packed irep should be:
|
I have no rights to stop someone's creation. If I understand correctly, not packed version of new mrb format can convert to C array and linked as same as current mrb format. Is this right? |
That image is too messy, so I made a diagram in Dia: Download the Dia file here (use "save as" functionality of your browser): |
@beoran thank you. it's cool. |
It's proposal of new .mrb file format.
Current .mrb file is hex format. It's too fat.
New .mrb file can have sections. now it have irep section only. I'll add debug section.
It have #880 in mind. The irep section has 'endianness' field and can choice big/little endian in the irep section.
I'm working on https://github.com/masuidrive/mruby/tree/binary
The text was updated successfully, but these errors were encountered: