Re: [fpc-pascal] How to avoid Copy

2024-01-01 Thread Wayne Sherman via fpc-pascal
On Mon, Jan 1, 2024 at 6:14 AM Hairy Pixels wrote: > > On Jan 1, 2024, at 3:50 PM, Michael Van Canneyt wrote: > > You can't optimize that. As said, a generic is convenient but slow. > > I don't know about that. Like was mentioned the enumerator needs to return a > pointer, preferable without ^ so

Re: [fpc-pascal] Procedures that work like WRITELN()

2023-12-27 Thread Wayne Sherman via fpc-pascal
On Wed, Dec 27, 2023 at 3:42 PM Wayne Sherman wrote: > Example using a TFileStream descendant and StreamIO AssignStream: > ...(line 42 follows) > FileWrite(TextRec(Output).Handle, Buffer, Count); Although that worked (I don't know why) I intended line 42 to be:

Re: [fpc-pascal] Procedures that work like WRITELN()

2023-12-27 Thread Wayne Sherman via fpc-pascal
Example using a TFileStream descendant and StreamIO AssignStream: program TeeStdOut; {$mode objfpc} uses Classes, SysUtils, StreamIO; type TTeeStream = class(TFileStream) Private FOriginalStdOut: Text; FNewStdOut: Text; public constructor Create(const AFileName: string;

Re: [fpc-pascal] Procedures that work like WRITELN()

2023-12-27 Thread Wayne Sherman via fpc-pascal
On Wed, Dec 27, 2023 at 3:25 AM James Richters wrote: > I wanted to write what I thought should be a simple procedure, just instead > of calling WRITELN() with some arguments, call WRITELOG() with the same > arguments that you would use to write to a file, but my WRITELOG() procedure > would write

Re: [fpc-pascal] More syntax questions (part 3)

2023-12-25 Thread Wayne Sherman via fpc-pascal
On Mon, Dec 25, 2023 Michael Van Canneyt wrote: > In short: To make a EBNF grammar which is 100% correct is not so simple > and will make the scheme extremely difficult to understand for a reader. > So I prefer to present a simpler version, and mention some limitations > only in the text ... >

Re: [fpc-pascal] More syntax questions (part 3)

2023-12-16 Thread Wayne Sherman via fpc-pascal
On Sat, Dec 16, 2023 at 7:35 AM Michael Van Canneyt wrote: > Hm. Lot of corrections to do.. I'll be busy tonight :-) Are these grammars in GIT so others can help by submitting merge requests? That way you can spread the love :-) ___ fpc-pascal maillist

[fpc-pascal] Setenv is not Thread Safe (libc)

2023-11-20 Thread Wayne Sherman via fpc-pascal
Beware of using GetEnv / SetEnv in threads: https://www.evanjones.ca/setenv-is-not-thread-safe.html ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Serial connection via TCP/IP sockets on RPi?

2023-11-03 Thread Wayne Sherman via fpc-pascal
There is also some good info here: https://gist.github.com/DraTeots/e0c669608466470baa6c ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Serial connection via TCP/IP sockets on RPi?

2023-11-03 Thread Wayne Sherman via fpc-pascal
On Fri, Nov 3, 2023 at 12:56 AM Bo Berglund wrote: > I am wondering if there is already available what I am needing? Yes, there is software that bridges a serial connection over a network. On Windows it is often called a "virtual com port" or "virtual serial port" or "com port redirector". Open

Re: [fpc-pascal] [Lazarus] Running FPC in the browser...

2023-10-28 Thread Wayne Sherman via fpc-pascal
On Sun, Oct 22, 2023 at 3:20 AM Michael Van Canneyt wrote: > Thanks to the efforts of Nikolay Nikolov, the FPC compiler can now recompile > itself to webassembly I just watched an interesting talk from StrangeLoop called: "Inside the Wizard Research Engine" by Ben L. Titzer

Re: [fpc-pascal] JSON RPC send server request to client

2022-10-04 Thread Wayne Sherman via fpc-pascal
Michael wrote: > Seems like both parts in the LSP protocol are playing 'client' and 'server', > because: > > "The Client is defined as the origin of Request objects and the handler of > Response objects. > The Server is defined as the origin of Response objects and the handler of > Request

Re: [fpc-pascal] JSON RPC send server request to client

2022-10-02 Thread Wayne Sherman via fpc-pascal
Wayne wrote: > JSON-RPC can be used bi-directionally when using > UNIX domain sockets, TCP sockets, and other > bidirectional transports (e.g websockets). > If implemented as such using a bi-direction transport, > the endpoints can be both a server and a client > at the same time... Sorry, my use

Re: [fpc-pascal] JSON RPC send server request to client

2022-10-02 Thread Wayne Sherman via fpc-pascal
Michael wrote: > There is no way to send data from server to client, > only responses to client requests. > What's more, HTTP 1 and 1.1 simplu do not allow this. > You'd need HTTP2 and/or websockets in order to > send data from server to client. >From the spec, JSON-RPC 2.0 is "transport agnostic

[fpc-pascal] How does FPC perform in the FASTEST Computer Language Race

2021-07-09 Thread Wayne Sherman via fpc-pascal
If you are a speed geek, you will probably be interested in this. What is the FASTEST Computer Language? 45 Languages Tested! (E01) https://www.youtube.com/watch?v=tQtFdsEcK_s Current standings at the time of this video Iterations per sec: Ada: 67 Pascal: 143 Fastest language: 7301 Slowest