I'm wondering if anyone here has AdaMagic documentation. Like, what does offset_arith_type or ptr_align align mean in the config. And do you possess adabgen.inf and adacgen.inf because these tools are asking for it and I can't find missing files anywhere. Trying to use AdaMagic extracted from MapuSoft AppCOE with EmScripten, and 287 of 325 files from Ada runtime system compiled. But in Asm.js and WebAssembly there is no relaxed alignment like in x86, so it should be expressed in config somehow, and if I don't understand the meaning of configuration variables, that is harder to achieve.
no plus ones
- This kind of question is probably best asked at comp.lang.ada mailing list - there should be someone with some knowledge of AdaMagic.
[just in case, you can access this mailing list through google groups]Feb 9, 2017
- Hmm, I'm not sure about the legal state of affairs here, but the AdaMagic stuff was done by former SofCheck before they merged with AdaCore, so the most knowledgeable person to ask would beFeb 13, 2017
- I can answer your questions... ;-) offset_arith_type is used for computing the byte offset relative to an object, which is needed in certain cases. You can think of it as the type needed for the offsetof macro. ptr_align is the log(base 2) of the 'Alignment, so if you have a 4-byte alignment, ptr_align would be 2, and if you have 8-byte alignment, ptr_align would be 3. I have attached a zip of the ".inf" files (I can't promise they are all up to date). -TuckFeb 13, 2017
- Thanks, that helps. Looks more fresh and appropriate than what I've extracted from ObjectAda Special Edition. I still can't see switches like "-cppa" and "-cppc", but they could have never been in the inf. And what would you say about alignment rules of asm.js? I can put octets anywhere and access them via linear offset, so Storage_Unit is octet IIUC. It's not 32-bit word. However, if I access integer, in asm.js the offset is being shifted to the right by 2 bits, then used as index in a buffer view representing memory as array of integers, thus shifting left again by 2 bits. So 2 bits are lost if they were set. On x86 the most efficient way to extract unaligned integer value is to just read it. On asm.js it can only be gathered from explicitly shifted pieces. Is there anything in the config I should change to declare this strict alignment behavior?
And what is the legal ownership status of C/C++ AdaMagic? I perceive that MapuSoft could only be interested in obtaining AdaMagic license if they obtain exclusive rights. This way they can have a stable rent, and nobody on the market can come up with competing product being essentially the same solution. That would also explain why there is no trace of AdaMagic on AdaCore website after the merger. Is it correct?Feb 13, 2017
- AdaCore owns AdaMagic. MapuSoft is a licensee. AdaCore has chosen not to license AdaMagic further, though they have recently developed a "SPARK2C" tool for the SPARK subset of Ada. SPARK2C isn't really a translator, in that it doesn't preserve comments nor does it try to produce particularly readable output.
I am afraid I know very little about asm.js. As far as alignment, AdaMagic generates explicit shifts and masks in certain cases, such as when you use packed arrays, or packed records that are fields of enclosing packed records, which C doesn't really support directly. In general AdaMagic presumes strict alignment is required by the hardware. It doesn't generally take advantage of hardware such as the x86 that can handle unaligned loads/stores.
-TuckFeb 13, 2017
- Thanks for clarification. Nothing to change. Indeed, works by magic.
So it's AdaCore actually to ask for documentation, it seems.
Wrt asm.js, that's very promising target. I can't say I am fan of HTML5 UI, I like Cocoa very much, but reality is that HTML5 applications (Electron, PhoneGap, …) can reach most consumer platforms and provide nice and modern GUI there. From compiler vendor's point of view, even if Ada managed to lose almost everything in the areas of desktop and mobile applications, targeting asm.js and providing WebIDL compiler would undo all previous fails. From me, from developer's point of view, if I am to develop cross-platform application tomorrow, I must hurry to marry AdaMagic and EmScripten today. Or else I would be forced to pick another programming language.Feb 13, 2017
Add a comment...