Lazarus

Programming => Networking and Web Programming => Pas2JS => Topic started by: Kryvich on January 26, 2019, 03:40:21 pm

Title: Pas2js for Delphi
Post by: Kryvich on January 26, 2019, 03:40:21 pm
I have made an adaptation of Pas2js for Delphi compiler. So now it's possible to debug the code in Delphi IDE.

If somebody interested you can find it here: https://github.com/Kryuski/pas2js-for-delphi
Title: Re: Pas2js for Delphi
Post by: Ñuño_Martínez on January 29, 2019, 01:52:59 pm
Nice. :)
Title: Re: Pas2js for Delphi
Post by: Akira1364 on January 31, 2019, 02:42:34 am
Quote
Used generic collections (TDictionary<string, XXX>) instead of TFPHashObjectList.

Certainly something I'd like to see more of on the FPC side of things as far as new libraries/utilities being written, especially considering that for example the FPC Generics.Collections is well known to perform better than any of the other FPC containers libraries.

I don't really understand why anyone would start a new project using non-generic lists/dictionaries/e.t.c. nowadays.
Title: Re: Pas2js for Delphi
Post by: Zoran on January 31, 2019, 11:23:26 am
Quote
Used generic collections (TDictionary<string, XXX>) instead of TFPHashObjectList.

Certainly something I'd like to see more of on the FPC side of things as far as new libraries/utilities being written, especially considering that for example the FPC Generics.Collections is well known to perform better than any of the other FPC containers libraries.

I don't really understand why anyone would start a new project using non-generic lists/dictionaries/e.t.c. nowadays.

Akira1364, Is there a particular reason for introducing TDictionary, when we have TFPGMap (https://www.freepascal.org/docs-html/current/rtl/fgl/tfpgmap.html) from unit fgl, which is part of rtl?

Title: Re: Pas2js for Delphi
Post by: marcov on January 31, 2019, 01:27:28 pm

Akira1364, Is there a particular reason for introducing TDictionary, when we have TFPGMap (https://www.freepascal.org/docs-html/current/rtl/fgl/tfpgmap.html) from unit fgl, which is part of rtl?

- Afaik TFPGMap are array wrappers, and with larger counts, the resizes get more and more expensive and the fragmentation higher.
- no for .. in support.
- primitive hashing.

IOW there is simply no reason to use them, except that they are Delphi incompatible and minimalistic.
Title: Re: Pas2js for Delphi
Post by: PascalDragon on February 04, 2019, 09:11:12 am
Also the types in Generics.Collections support records without any operator overload.

One advantage of the FGL ones: they are small, so they're more suitable for embedded projects where memory size might be an issue.

And for those that are interested: here (http://www.benibela.de/fpc-map-benchmark_en.html) we have a performance comparison of various FPC containers (no, not by me).
Title: Re: Pas2js for Delphi
Post by: Zoran on February 04, 2019, 12:56:33 pm
I see. Thank you, Sven and Marco.
TinyPortal © 2005-2018