Re: [fpc-pascal] How to inline CompareFunc to Sort method in generic abstract class

2022-12-13 Thread Adrian Veith via fpc-pascal
Hi, with standard generics in pascal there is currently no solution, but you can do it with a "poor man's template". They work with .inc files which contain the generic part of your code and they are then included in your specialization unit. Something like this for a generic sort - I use Del

Re: [fpc-pascal] Stack alias for ARC like memory management?

2018-04-25 Thread Adrian Veith
Am 25.04.2018 um 08:34 schrieb Ryan Joseph: > >> On Apr 25, 2018, at 12:59 PM, Sven Barth via fpc-pascal >> wrote: >> >> No. This would more often than not lead to accidents were users pass such an >> instance to some outer code (it doesn't even need to the routine with the >> stack object, bu

Re: [fpc-pascal] [OT] Happy tickets benchmark

2016-02-18 Thread Adrian Veith
reepascal.org wrote: >> Date: Wed, 17 Feb 2016 18:55:29 +0100 >> From: Adrian Veith >> To: FPC-Pascal users discussions >> Subject: Re: [fpc-pascal] Happy tickets benchmark >> >> I don't want to insist on this, but: if you measure the runtime of your >> p

Re: [fpc-pascal] Happy tickets benchmark

2016-02-17 Thread Adrian Veith
On 17/02/2016 12:00, fpc-pascal-requ...@lists.freepascal.org wrote: >> Date: Tue, 16 Feb 2016 14:44:42 +0100 >> From: Adrian Veith >> To: FPC-Pascal users discussions >> Subject: Re: [fpc-pascal] Happy tickets benchmark >> >> small remark for your testing series: &g

Re: [fpc-pascal] Happy tickets benchmark

2016-02-16 Thread Adrian Veith
al] Happy tickets benchmark >> >> On Mon, 15 Feb 2016, Serguei TARASSOV wrote: >> >>> >On 15/02/2016 12:00,fpc-pascal-requ...@lists.freepascal.org wrote: >>>> >>Date: Mon, 15 Feb 2016 07:55:55 +0100 >>>> >>From: Florian Kl?mpfl >>

Re: [fpc-pascal] Happy tickets benchmark

2016-02-14 Thread Adrian Veith
Hm, doing the same trick in C, it goes down from: 40ms (original) to 3ms (omit the inner loop). This is still the same distance to fpc (v 3.0.0 with -O4 -Ooloopunroll) 185ms (original) to 12ms (omit the inner loop). C is 4 times faster here. Am 14.02.2016 um 12:09 schrieb Michael Van Canneyt:

Re: [fpc-pascal] Happy tickets benchmark

2016-02-14 Thread Adrian Veith
= epochTime() * 1000.0 echo "found ", TicketsCount, " in ", d2-d1, "ms" run() compile and run with (remove -r to run it immediately): nim js -d:release -d:nodejs -r happy.nim for the c version nim c -d:release -r happy.nim Am 14.02.2016 um 10:51 schrieb Adrian Veith: &

Re: [fpc-pascal] Happy tickets benchmark

2016-02-14 Thread Adrian Veith
When I change the programm to run inside a procedure (because this would be the more realistic scenario) the performance decreases about 15% - 160ms in global vs 185ms inside procedure. program HappyTickets; uses SysUtils, DateUtils; procedure run; var n1, n2, n3, n4, n5, n6, n7, n8: 0..

Re: [fpc-pascal] Virtual Constants

2013-03-03 Thread Adrian Veith
Am 01.03.2013 21:31, schrieb Daniel Gaspary: The idea is strange. But here it is: Is possible to have a Class constant with different values in class descendants ? Would be something like that: TA = class const c1: integer; virtual; class function GetC1: integer; //returns c

Re: [fpc-pascal] CrossFPC is finally released

2012-12-29 Thread Adrian Veith
the website was dead for years and still nothing to download, but if I am not wrong one of the makers is BERO who did the impressive besen javascript in pascal. Sounds interesting anyway - even if I see Object Pascal as a dead language for the future. Am 29.12.2012 19:41, schrieb Graeme Geld

Re: [fpc-pascal] FPC JVM checkout problem

2012-01-03 Thread Adrian Veith
Are you connected via CABLE or WIRELESS. We have similar errors connecting to our svn repositories via LTE because of a buggy proxy server in between. Am 03.01.2012 15:23, schrieb leledumbo: > I'm checking out FPC JVM branch, however, in the middle of the process, it > fails with "Decompression of

Re: [fpc-pascal] Re: generics question

2011-05-14 Thread Adrian Veith
But is very strange, that this works: type TTestGen = class constructor Create(); class function Test(val: T): string; inline; end; function Blah(const val: Integer): string; inline; //overload; begin Result:= IntToStr(val + 1); end; {function Blah(const val: string): string; inli

[fpc-pascal] generics question

2011-05-12 Thread Adrian Veith
Hi, I try this: type TTestGen = class constructor Create(); class function Test(val: T): string; inline; end; function Blah(const val: Integer): string; inline; overload; begin Result:= IntToStr(val + 1); end; function Blah(const val: string): string; inline; overload; begin Re

Re: [fpc-pascal] code optimization

2010-09-24 Thread Adrian Veith
On 24.09.2010 14:35, Jonas Maebe wrote: > > On 24 Sep 2010, at 11:48, Adrian Veith wrote: > >> Changing to pointers reduces the amount of multiplications for accessing >> the nth element in an array - if you compare the delphi code to th fpc >> code on assembler base,

Re: [fpc-pascal] code optimization

2010-09-24 Thread Adrian Veith
On 24.09.2010 10:37, Jonas Maebe wrote: > > On 24 Sep 2010, at 08:06, Adrian Veith wrote: > >> On 23.09.2010 17:03, Jonas Maebe wrote: >>> >>> It may help a lot, but only because it will reduce register pressure, >>> not because the multiplications are

Re: [fpc-pascal] code optimization

2010-09-23 Thread Adrian Veith
On 23.09.2010 17:03, Jonas Maebe wrote: > > On 23 Sep 2010, at 16:59, Adrian Veith wrote: > >> I analyzed your code - I think the problem is the array element address >> calculation of the fpc compiler. You have a lot of code like >> Bar[MinValley] etc. The delphi com

Re: [fpc-pascal] code optimization

2010-09-23 Thread Adrian Veith
-Co- -CO- -Ci- > The FPC compiler version is 2.4.0, I run under Windows XP. > > any suggestions? > Stefan > > > -Ursprüngliche Nachricht- > Von: "Adrian Veith" > Gesendet: 22.09.2010 08:08:45 > An: "FPC-Pascal users discussions" > Betreff:

Re: [fpc-pascal] code optimization

2010-09-21 Thread Adrian Veith
Hi Stefan, is this a benchmark program or a complex program you are talking about. If it is a benchmark, then it would be interesting to see the code, because from my experience I doubt that Delphi produces better code than fpc (in general it is the other way round). If it is a complex program, t

Re: [fpc-pascal] fpGUI Toolkit on WinCE

2010-03-17 Thread Adrian Veith
Am 16.03.2010 16:11, schrieb Graeme Geldenhuys: > On 16 March 2010 15:03, Adrian Veith wrote: > >>>> >> Now my second solution works: >> > > Thank you very much. I'll take a look at the code and test on my > Garmin in the next day or tw

Re: [fpc-pascal] fpGUI Toolkit on WinCE

2010-03-17 Thread Adrian Veith
Paul, yes I agree with you, that fpGUI is very nice for embedded GUI systems - and I think it has potential for more. The next thing I will look at, is why it draws a frame around labels etc. in WinCE - do you have the same issue ? Should be a minor problem. Adrian. Am 16.03.2010 17:59, schrieb

Re: [fpc-pascal] fpGUI Toolkit on WinCE

2010-03-16 Thread Adrian Veith
Am 16.03.2010 13:17, schrieb Adrian Veith: > Am 16.03.2010 11:22, schrieb Adrian Veith: > >> Am 16.03.2010 10:45, schrieb Matt Emson: >> >> >>> Adrian Veith wrote: >>> >>> >>>> ..the bitmaps look scrambled and ha

Re: [fpc-pascal] fpGUI Toolkit on WinCE

2010-03-16 Thread Adrian Veith
Am 16.03.2010 11:22, schrieb Adrian Veith: > Am 16.03.2010 10:45, schrieb Matt Emson: > >> Adrian Veith wrote: >> >>> ..the bitmaps look scrambled and have different colors. >>> I haven't found the solution for this yet. >>> >&g

Re: [fpc-pascal] fpGUI Toolkit on WinCE

2010-03-16 Thread Adrian Veith
Am 16.03.2010 10:45, schrieb Matt Emson: > Adrian Veith wrote: >> ..the bitmaps look scrambled and have different colors. >> I haven't found the solution for this yet. > Ignore that last message. It seems WinCE is only ever little endian. > So it is probably more to do

Re: [fpc-pascal] fpGUI Toolkit on WinCE

2010-03-16 Thread Adrian Veith
Am 15.03.2010 16:20, schrieb Graeme Geldenhuys: > > WinCE is experimental, so expect some issue. But that is no excuse. ;-) I > can duplicate the slow down on my Garmin iQue M5, so will try and resolve > the issue before the final v0.7 release. Thanks for bringing this to my > attention. > Ok

Re: [fpc-pascal] fpGUI Toolkit v0.7-rc1 for FPC 2.4

2010-03-15 Thread Adrian Veith
Am 15.03.2010 16:38, schrieb Adrian Veith: > If it makes sense or not - I get the same error in delphi mode. > my error - forget it Adrian ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listin

Re: [fpc-pascal] fpGUI Toolkit v0.7-rc1 for FPC 2.4

2010-03-15 Thread Adrian Veith
Am 15.03.2010 16:23, schrieb Jonas Maebe: > > On 15 Mar 2010, at 16:17, Adrian Veith wrote: > >> when compiling uidesigner with actual fpc from svn it fails with >> duplicate identifier "unitname" in vfdfile.pas. It seems to be a name >> clash with the ne

Re: [fpc-pascal] fpGUI Toolkit v0.7-rc1 for FPC 2.4

2010-03-15 Thread Adrian Veith
Am 09.03.2010 14:16, schrieb Graeme Geldenhuys: > fpGUI v0.7-rc1 is available > when compiling uidesigner with actual fpc from svn it fails with duplicate identifier "unitname" in vfdfile.pas. It seems to be a name clash with the new class procedure unitname in TObject. I don't know why fpc rai

[fpc-pascal] fpGUI Toolkit on WinCE

2010-03-15 Thread Adrian Veith
Am 09.03.2010 14:16, schrieb Graeme Geldenhuys: > fpGUI v0.7-rc1 is available > --- > Hi, this is the first time I looked at fpGUI. Very nice work ! I tried to cross compile some examples for WinCE and it worked so far - looks like my search is over and I found a nice li

Re: [fpc-pascal] Servlet server for Fpc apps

2009-03-30 Thread Adrian Veith
Dariusz Mazur schrieb: > Marco van de Voort pisze: >> In our previous episode, Michael Van Canneyt said: >> But maybe I dont understand your need. You think about counterpart of LCL level, or computation wide consist in event (form.onclick, form.onedit) function in Delphi ? >

Re: [fpc-pascal] Servlet server for Fpc apps

2009-03-29 Thread Adrian Veith
Bee schrieb: >> Using haxe for web applications is very effective, because you use the >> same language for back-end and front-end. With pascal4neko you can use >> your existing pascal code or use pascal for low level tasks. >> > > Have you heard about ExtPascal? It wraps ExtJS library into P

Re: [fpc-pascal] Servlet server for Fpc apps

2009-03-28 Thread Adrian Veith
Eduardo Morras schrieb: > I want to ask (and know) if i can use apache-tomcat to serve servlets > developed with freepascal. If not, is there a similar server for fpc? > Note that i want/need servlet like in java and other languages, not a > propetary format or cgi or anyother. > > Maybe you want

Re: [fpc-pascal] Boehm GC

2009-03-19 Thread Adrian Veith
some code which shows how to handle the gc for objects and interfaces. If you have any questions, you can contact me directly, because this a bit OT for this list. Cheers, Adrian. ritchie turner schrieb: > Hi Adrian, > > Guilty! > > bd. > > > > On Wed, 2009-03-18 at

Re: [fpc-pascal] Boehm GC

2009-03-18 Thread Adrian Veith
ritchie turner schrieb: > Thanks all, I've got something to go on now. > > bd. > bye the way - are you black dog from the haxe list ? Cheers, Adrian. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/lis

Re: [fpc-pascal] Boehm GC

2009-03-18 Thread Adrian Veith
ritchie turner schrieb: > I'm new to fpc and pascal, i.e. I've never done a project in it, but > i've been following the lists for a while and dabbling. > > I like using a garbage collector and I know you can replace the memory > manager in fpc so i guess it's probably trivial to replace the stand

Re: [fpc-pascal] Creating FPC enabled websites

2009-03-04 Thread Adrian Veith
Hello Francisco, I use the following for my applications: - synapse with visualsynapse ( I modified visualsynapse to perform Keep-Alive http connections) - HaXe/Neko for remoting (www.haxe.org) - very easy to use ! same language for client/ server/ flash I have created a pascal framework for emb

Re: [fpc-pascal] Re: crossplatform networking

2009-01-30 Thread Adrian Veith
Paul Nicholls schrieb: > "Bee" > wrote in message > news:49817e1f.8080...@brawijaya.ac.id... > > Hi all, > > > > I need to build some crossplatform networking applications. It'd be > > UDP-based. It should be able to support at least 3 mainstr

Re: [fpc-pascal] Built in Query language (or abuse)

2008-06-04 Thread Adrian Veith
L schrieb: A creative idea: --Another idea-- Remember the "file of Record" innovation in pascal? Table of Record... A "file of record" allows one to remain strongly typed. What about a "DatabaseTable of Record". var // F: File Of DataRec; DB: Table of DataRec; // aka a RelVar We do som

Re: [fpc-pascal] FreePascal Coding style

2008-01-21 Thread Adrian Veith
Graeme Geldenhuys schrieb: On 21/01/2008, Michael Van Canneyt <[EMAIL PROTECTED]> wrote: No, there isn't. I follow Borland coding style, but some others don't. You cannot force everyone to use the same style. And you should not. That's why we need a editor that supports 'elastic tab st

Re: [fpc-pascal] cdecl or stdcall on WinCE for ARM

2007-11-23 Thread Adrian Veith
Florian Klaempfl schrieb: Adrian Veith schrieb: Hi, what is the right calling convention for using system libraries on wince for ARM ? I wrote a pascal wrapper for a system dll and used stdcall for the calling convention - and the program worked. I changed to cdecl - and the program works

[fpc-pascal] cdecl or stdcall on WinCE for ARM

2007-11-23 Thread Adrian Veith
Hi, what is the right calling convention for using system libraries on wince for ARM ? I wrote a pascal wrapper for a system dll and used stdcall for the calling convention - and the program worked. I changed to cdecl - and the program works as well. In my opinion the program should have cr

Re: [fpc-pascal] D language and Object Pascal

2007-10-10 Thread Adrian Veith
Jilani Khaldi schrieb: Hi All, just curious about the D language (http://www.digitalmars.com/d/index.html), I read some articles on the site, downloaded the compiler... and wrote some little examples. Well, many of the things that the author presented as new and hot features are already pres

[fpc-pascal] FPU Configuration inside a library

2007-09-25 Thread Adrian Veith
Hi, i posted this already under a differnt subject, but didn't get a feedback. A .dll written in fpc changes the configuration of the FPU (FPUCW). This might cause a strange behavior inside the loading program. If the loading program allows division by zero (1.0 / 0.0), it will crash after t

[fpc-pascal] FPUCW in a .dll

2007-09-20 Thread Adrian Veith
Hi, a .dll written in fpc changes the FPUCW when it is loaded. I think, that this is the wrong behavior, because it should be the task of the loading program to setup the FPUCW. As far as I can see, a Delphi .dll doesn't change the FPUCW. Cheers, Adrian.

[fpc-pascal] Compiler Crash

2007-06-21 Thread Adrian Veith
Hello, my fpc (current version from svn ) compiler crashes, when I compile a procedure like this: procedure Crash; var c0: function: pointer; cdecl; c1: function: integer; cdecl; m: HMODULE; begin m:= LoadLibrary('blah.dll'); c0:= GetProcAddress(m, 'c0'); c1:= c0(); c1; end; btw. is th

Re: [fpc-pascal] Problem with dynamic libraries

2007-06-14 Thread Adrian Veith
no - that was not the problem. I have my linux running in a coLinux session and it seems that the linker fails, when the file is in a windows drive, even as root. other programms don't have problems to read or write to this drive. but there is still a strange problem with the dynamic library:

[fpc-pascal] Problem with dynamic libraries

2007-06-13 Thread Adrian Veith
Hi, i have written a dll (pasForNeko) in delphi / windows which can be called from the haxe/neko language, in order to use existing object pascal code from this language. now I try to port this to fpc and linux and run into some problems: 1. I can't compile even the simplest library from fpc

Re: [fpc-pascal] 0.9.20 released

2006-11-09 Thread Adrian Veith
Hello, I did a plain install from scratch (the Lazarus-0.9.20-fpc-2.0.4-20061105-win32.exe) and wanted to rebuild Lazarus. The rebuild with the preinstalled fpc-2.0.4 stops with an error: Compiling svn2revisioninc.pas Linking .\svn2revisioninc.exe .\svn2revisioninc.o(.data+0x14): In function

Re: [fpc-pascal] Hardware

2006-08-23 Thread Adrian Veith
google for the Jedi JCL library, it contains many useful routines for delphi - object pascal. with some handwork, the routines should work with fpc as well. Adrian. Fabrício F. Kammer schrieb: Thanks A.J. Do you know where can I get some example of how to do this? Is it possible to have a c

Re: [fpc-pascal] TCP Server

2006-08-21 Thread Adrian Veith
Hello Fabricio, there are some examples at the synapse wiki page. I suggest that you also subscribe to the synalist at sourceforge.net - this is the right place to ask questions about synapse. There are many active users which can answer your questions. Anyway, if you have the echo server ru

Re: [fpc-pascal] TCP Server

2006-08-18 Thread Adrian Veith
Use Synapse instead of Indy. After I have found Synapse, I dumped Indy. goto http://www.ararat.cz/synapse/ Lukas has done a very fine tool !! Cheers, Adrian. Fabrício F. Kammer schrieb: Hi all, I need to developer an application to act as a tcp server that be compatible with windows/linux

[fpc-pascal] Cross compiling from win32 to linux

2006-04-11 Thread Adrian Veith
-linux-ld to ld, the linker reports another error: cannot find -lpthread where is my fault ? thanks, Adrian Veith. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] First Test of FastMM4 for fpc

2005-12-19 Thread Adrian Veith
Peter Vreman schrieb: I took a look at the MM and found that this test is not representative at all. At least in the FPC MM it triggers only a single code path for Reallocmem. And that code path is even the fastest for a not-in-place-reallocation. And looking at the (unmaintable) FastMM4 sources

Re: [fpc-pascal] First Test of FastMM4 for fpc

2005-12-19 Thread Adrian Veith
Florian Klaempfl schrieb: Adrian Veith wrote: I compiled fpc from the sources from the svn repository today, but the results are almost the same as I posted yesterday (I marked with ** where the results have changed): Test1: ** fpc (standard MM): 3.0 sec - factor = 1.30 fpc (FastMM4): 2.9

Re: [fpc-pascal] First Test of FastMM4 for fpc

2005-12-17 Thread Adrian Veith
Florian Klaempfl schrieb: Adrian Veith wrote: Hi, I have changed the FastMM4 that it seemd to work with fpc now. Here are the results of my prior tests now with FastMM4 for fpc: Test1: fpc (standard MM): 3.1 sec - factor = 1.34 fpc (FastMM4): 3.0 sec - factor = 1.30 delphi (standard

Re: [fpc-pascal] First Test of FastMM4 for fpc

2005-12-17 Thread Adrian Veith
Micha Nelissen schrieb: On Thu, 15 Dec 2005 18:21:18 +0100 Adrian Veith <[EMAIL PROTECTED]> wrote: I have changed the FastMM4 that it seemd to work with fpc now. Here are the results of my prior tests now with FastMM4 for fpc: How did you fix FastReallocMem? FPC uses

[fpc-pascal] FastMM4 for fpc

2005-12-15 Thread Adrian Veith
I tried to modify the FastMM4 to work with with fpc. I had no big problems for the non-assembly language version, but with the assembly language version i have the problem, that fpc is allways generating a stack frame, even if i use the {$STACKFRAMES OFF} directive. Is it not possible at the m

[fpc-pascal] First Test of FastMM4 for fpc

2005-12-15 Thread Adrian Veith
Hi, I have changed the FastMM4 that it seemd to work with fpc now. Here are the results of my prior tests now with FastMM4 for fpc: Test1: fpc (standard MM): 3.1 sec - factor = 1.34 fpc (FastMM4): 3.0 sec - factor = 1.30 delphi (standard MM): 3.1 sec - factor = 1.34 delphi (FastMM4): 2.3

Re: [fpc-pascal] AnsiStrings and Memory Management

2005-12-15 Thread Adrian Veith
Peter Vreman schrieb: (astonishing that ShortStrings are slower than AnsiStrings in this example in delphi). Not really. Delphi is silently upcasting your shortstrings to AnsiStrings in the background. You would probably have to recompile the VCL to get around this ;-) I've commi

Re: [fpc-pascal] AnsiStrings and Memory Management

2005-12-15 Thread Adrian Veith
Florian Klaempfl schrieb: Adrian Veith wrote: Hi, two days ago i posted a comment about my experiences porting our database server to fpc. yesterday i tried to figure out where the speed differences between delphi and fpc come from. At the moment i stuck a little bit, because the results

[fpc-pascal] AnsiStrings and Memory Management

2005-12-14 Thread Adrian Veith
- and Delphi proves, that it a much higher speed with AnsiStrings is possible (astonishing that ShortStrings are slower than AnsiStrings in this example in delphi). cheers, Adrian Veith. Code is below: program Bench2; {$APPTYPE CONSOLE} {$H+} uses //{$ifndef fpc} FastMM4, {$endif} sy

Re: [fpc-pascal] FreePascal 2.0.2 available

2005-12-12 Thread Adrian Veith
Marco van de Voort schrieb: Congratulations, with fpc 2.0.2 it's the first time, we were able to compile and run our dbGonzales database server (complete delphi code). In earlier versions of fpc, we always had some problems (mostly with variants), which caused runtime crashes. First tests s

Re: [fpc-pascal] FreePascal 2.0.2 available

2005-12-12 Thread Adrian Veith
nd it seems that the code quality improves with each release of fpc. Thanks for this great compiler. Adrian Veith. -- Veith System GmbH Florian Klaempfl schrieb: Hi, FPC 2.0.2 is finally available for various platforms. 2.0.2 is mainly a bug fix release to 2.0.0 though also some little fea

Re: [fpc-pascal] Optimizer in 2.0

2005-06-01 Thread Adrian Veith
Florian Klaempfl schrieb: Adrian Veith wrote: It shows with useless code like simple nested for .. to loops, but also with some more useful code like the attached RSA_Angriff from the C'T magazine. My results are with: fpc -Sd -OG3rp3 -XX RSA_Angriff_D5.dpr 5266 ms with: fpc -S

Re: [fpc-pascal] Optimizer in 2.0

2005-05-31 Thread Adrian Veith
n off: 8368.20 MIPS cheers, Adrian. Florian Klaempfl schrieb: Adrian Veith wrote: Hi, I am newbie with fpc (but not with pascal, which I use more than 20y now). We have lot of existing delphi code, which some of it, I want to port to new platforms - and fpc looks like the right tool for it.

[fpc-pascal] Optimizer in 2.0

2005-05-31 Thread Adrian Veith
Hi, I am newbie with fpc (but not with pascal, which I use more than 20y now). We have lot of existing delphi code, which some of it, I want to port to new platforms - and fpc looks like the right tool for it. But I am concerned about the speed. I did some basic benchmarks and it seems, that t