[fpc-devel] First pas2js public release

Mattias Gaertner nc-gaertnma at netcologne.de
Sun Dec 17 22:24:50 CET 2017


On Sun, 17 Dec 2017 21:43:45 +0100
Benito van der Zander <benito at benibela.de> wrote:

> Hi,
> 
> >
> > Naturally, any memory pointer operation is not possible in Javascript. 
> > Code that relies on this will not work.  
> 
> 
> it would be great, if pointers were added.

There are pointers already. For example references to class and
arrays. 
It seems you want to emulate pointer of integer.

 
> One trick would be to wrap every variable that is accessed by a pointer 
> in an array (or object).

That would be quite a slow down.
Isn't speed the main idea of using pointers?

Also what if var and @var are in different units?
And what about pointer of pointer?

You may want to take a look at asm.js, which has a working
model for emulating pointers in JavaScript. It would be possible to add
a pas2js target for that. But then again there is webassembly
as well and it seems to have better support.

Mattias




More information about the fpc-devel mailing list