[Pas2js] Records as pure data?

Michael Van Canneyt michael at freepascal.org
Wed May 9 15:46:51 CEST 2018



On Wed, 9 May 2018, Ryan Joseph wrote:

>
>
>> On May 9, 2018, at 7:38 PM, Mattias Gaertner <nc-gaertnma at netcologne.de> wrote:
>> 
>>> Float32Array seems to do this but it only works for a single type. I wonder if you could use Float32Array and Int8Array for example and concatenate them.
>> 
>> AFAIK no.
>
> What do you think about this? Looks like it may be possible. If that works then you could pack records into bytes if you made a little helper function in the parser.

This will not happen.

We are transpiling to Javascript. 
Records translate to javascript object literals and memory layout is opaque.
The idea is explicitly not to make memory layout available in the language.

You can use the native constructs that the runtime makes available if you
need specific memory buffers, but no more than that.

Michael.


More information about the Pas2js mailing list