Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / pas2js / 2019-06

TStream implementation committed

4 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Michael Van Canneyt

Hello,

I have implemented TStream.

The latest delphis (and FPC) have added methods to TStream which read/write TBytes instead of a memory buffer. It is possible to implement such a call in pas2js (which has no arbitrary memory buffer). They also added some basic ReadData(Buffer)/WriteData(Buffer) calls which read/write some basic types (integers and a float). These can be ported as well.

This means that if you write your stream handling using these new methods, you can use TStream both natively and in pas2js.

Currently the only available stream is TBytesStream, but I expect to have streams based on the various lower-level javascript TTypedArray classes available soon.

The next steps include also implementing the component streaming classes, and 'resource' support for pas2js.

Michael.

Reply by email

Mattias Gaertner
to Michael Van Canneyt
[...] I have implemented TStream.

Fantastic! Many thought it wouldn't fit into pas2js.

Show quoted text 13 lines
The latest delphis (and FPC) have added methods to TStream which read/write TBytes instead of a memory buffer. It is possible to implement such a call in pas2js (which has no arbitrary memory buffer). They also added some basic ReadData(Buffer)/WriteData(Buffer) calls which read/write some basic types (integers and a float). These can be ported as well. This means that if you write your stream handling using these new methods, you can use TStream both natively and in pas2js. Currently the only available stream is TBytesStream, but I expect to have streams based on the various lower-level javascript TTypedArray classes available soon.

I added it to the changes list:
https://wiki.freepascal.org/Pas2JS_Version_Changes#Trunk

The next steps include also implementing the component streaming classes, and 'resource' support for pas2js.

Mattias

Reply by email

Michael Van Canneyt
to Mattias Gaertner
Mattias Gaertner wrote 7 lines
On Wed, 19 Jun 2019 10:00:22 +0200 (CEST) Michael Van Canneyt wrote: > [...] > I have implemented TStream. Fantastic! Many thought it wouldn't fit into pas2js.

That included me :-)

But luckily, changes in FPC allowed me to reconsider my opinion :)

Michael.

Reply by email

silvioprog
to Michael Van Canneyt: I have implemented TStream. The latest delphis (and FPC) have added methods to TStream…
AM Michael Van Canneyt wrote
Hello, I have implemented TStream.

You have done a great job!

The best thing about open source is that when we least expect, it surprised us by incredible works. :-)

The latest delphis (and FPC) have added methods to TStream which read/write

Show quoted text 18 lines
TBytes instead of a memory buffer. It is possible to implement such a call in pas2js (which has no arbitrary memory buffer). They also added some basic ReadData(Buffer)/WriteData(Buffer) calls which read/write some basic types (integers and a float). These can be ported as well. This means that if you write your stream handling using these new methods, you can use TStream both natively and in pas2js. Currently the only available stream is TBytesStream, but I expect to have streams based on the various lower-level javascript TTypedArray classes available soon. The next steps include also implementing the component streaming classes, and 'resource' support for pas2js. Michael.
Silvio Clécio -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.freepascal.org/pipermail/pas2js/attachments/20190703/f9f8d55c/attachment.html>

Reply by email