Re: [fpc-devel] Proposal: Enhanced replacement for assignment operators

2010-08-05 Thread Graeme Geldenhuys
Op 2010-08-06 05:05, Alexander Klenin het geskryf: > I specifically replace all usage of Inc/Dec and Include/Exclude in my > Pascal programs > by += / -= *to increase readability*. > And I think it really helps ;-) :-) I do the same, and use += and -+ more - simply to save on typing. But what Jane

Re: [fpc-devel] Proposal: Enhanced replacement for assignment operators

2010-08-05 Thread Alexander Klenin
On Fri, Aug 6, 2010 at 16:08, "Vinzent Höfler" wrote: > Alexander Klenin : > >> C-like operators reduce the number of required punctuation -- >> I always think that the extra punctuation is bad for readability. > > Rght. Shrt sntncs r mch sr t rd. (No) ((but) the sentences (without (extra)) paren

Re: [fpc-devel] Proposal: Enhanced replacement for assignment operators

2010-08-05 Thread Michalis Kamburelis
Vinzent Höfler wrote: > Alexander Klenin : > >> C-like operators reduce the number of required punctuation -- >> I always think that the extra punctuation is bad for readability. > > Rght. Shrt sntncs r mch sr t rd. > This is more about SomeReallyLongVariableNameX += 10; being nicer to read

Re: [fpc-devel] Proposal: Enhanced replacement for assignment operators

2010-08-05 Thread Vinzent Höfler
Alexander Klenin : > C-like operators reduce the number of required punctuation -- > I always think that the extra punctuation is bad for readability. Rght. Shrt sntncs r mch sr t rd. SCNR, Vnznt. -- Neu: GMX De-Mail - Einfach wie E-Mail, sicher wie ein Brief! Jetzt De-Mail-Adresse reservie

Re: [fpc-devel] Proposal: Enhanced replacement for assignment operators

2010-08-05 Thread Alexander Klenin
On Fri, Aug 6, 2010 at 14:08, Marco van de Voort wrote: > In our previous episode, Alexander Klenin said: >> > as this diminish the readability. >> >> FWIW, while migrating to FPC/newer Delphi, >> I specifically replace all usage of Inc/Dec and Include/Exclude in my >> Pascal programs >> by += / -

Re: [fpc-devel] Proposal: Enhanced replacement for assignment operators

2010-08-05 Thread Marco van de Voort
In our previous episode, Alexander Klenin said: > > as this diminish the readability. > > FWIW, while migrating to FPC/newer Delphi, > I specifically replace all usage of Inc/Dec and Include/Exclude in my > Pascal programs > by += / -= *to increase readability*. > And I think it really helps ;-)

Re: [fpc-devel] Proposal: Enhanced replacement for assignment operators

2010-08-05 Thread Alexander Klenin
On Fri, Aug 6, 2010 at 08:29, Michael Van Canneyt wrote: > Pascal as it is, is a very readable language as opposed to C. Proposals such > as this diminish the readability. FWIW, while migrating to FPC/newer Delphi, I specifically replace all usage of Inc/Dec and Include/Exclude in my Pascal progr

Re: [fpc-devel] Proposal: Enhanced replacement for assignment operators

2010-08-05 Thread Alexander Klenin
On Fri, Aug 6, 2010 at 07:23, Florian Klämpfl wrote: > Am 05.08.2010 22:19, schrieb _-jan...@web.de: >> Hello everybody, >> >> I would like to propose an enhanced replacement for the special assignment >> operators += -= *= and /= : >> More pascal-like would be constructs of the form "operator :=

Re: [fpc-devel] OO rewrite - first round finished

2010-08-05 Thread Hans-Peter Diettrich
Felipe Monteiro de Carvalho schrieb: What is the OO rewrite? It's an SVN branch, aimed at making the compiler more object-oriented. It should simplify the maintenance of the compiler code, the test of different algorithms and procedures for specific parts, and finally the use of threads and

Re: [fpc-devel] buildfaq

2010-08-05 Thread Hans-Peter Diettrich
Henry Vermaak schrieb: Build systems seem to be a constant itch. See a list here: http://en.wikipedia.org/wiki/List_of_build_automation_software Shouldn't we add FPC to that list? IMO the list completely ignores the existence of platform independent development systems, like for Basic, Jav

[fpc-devel] File search

2010-08-05 Thread Hans-Peter Diettrich
IMO the file search performance can be improved, in detail for files to compile. Currently FileExists is called for every possible directory, name case and possible extensions. This means that the OS may have to search the same directory multiple times, for all these cases - O(n). This can be

Re: [fpc-devel] threadvar implementation

2010-08-05 Thread Jonas Maebe
On 05 Aug 2010, at 21:36, Hans-Peter Diettrich wrote: > Michael Schnell schrieb: > >>> FS/GS for non-zerobased segments, all others are zero-based. >> I have no idea what you mean by "zerobased". > > Then you missed fundamental 32/64 bit hardware and software principles :-( > > Please read and

[fpc-devel] Some proposals

2010-08-05 Thread _-jane-_
Hello! I recently put other proposals on http://wiki.freepascal.org/Talk:Modernised_Pascal. However I am not sure whether this is the right place to put this. The forum appears to be a better place. Unfortunately I am inexperienced in FPC's wiki system. What should I do about my postings? Shoul

Re: [fpc-devel] Proposal: Enhanced replacement for assignment operators

2010-08-05 Thread Michael Van Canneyt
On Thu, 5 Aug 2010, Felipe Monteiro de Carvalho wrote: I guess that the problem which you want to solve is "having to type too much". If that is the case, you should rather work on improving code completion in Lazarus or whichever IDE you use. Then you could type something like += and Ctrl+Alt

Re: [fpc-devel] Proposal: Enhanced replacement for assignment operators

2010-08-05 Thread Felipe Monteiro de Carvalho
I guess that the problem which you want to solve is "having to type too much". If that is the case, you should rather work on improving code completion in Lazarus or whichever IDE you use. Then you could type something like += and Ctrl+Alt+C and it would expand to the natural Pascal version. Or whi

[fpc-devel] Proposal: Enhanced replacement for assignment operators

2010-08-05 Thread _-jane-_
Hello Florian! >> I would like to propose an enhanced replacement for the special assignment >> operators += -= *= and /= : >> More pascal-like would be constructs of the form "operator :=" such as >> a + := 1; >> a div := 3; >> a or := b; >> a xor := 3; >> a << := 1; >> Together with my prior p

Re: [fpc-devel] OO rewrite - first round finished

2010-08-05 Thread Felipe Monteiro de Carvalho
What is the OO rewrite? -- Felipe Monteiro de Carvalho ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel

Re: [fpc-devel] buildfaq

2010-08-05 Thread Henry Vermaak
On 4 August 2010 19:50, Hans-Peter Diettrich wrote: > Henry Vermaak schrieb: > >>> I'm not very familiar with the make syntax :-( >> >> Heh, prepare to lose your mind. > > It's like with the universe - once somebody will figure out, how it works, > it will turn immediately into something even more

Re: [fpc-devel] threadvar implementation

2010-08-05 Thread Hans-Peter Diettrich
Michael Schnell schrieb: FS/GS for non-zerobased segments, all others are zero-based. I have no idea what you mean by "zerobased". Then you missed fundamental 32/64 bit hardware and software principles :-( Please read and understand the available documentation, my preceding posts, and ask f

Re: [fpc-devel] OO rewrite - first round finished

2010-08-05 Thread Hans-Peter Diettrich
Mattias Gärtner schrieb: Unable to run the tool "Executing command before": Program make not found Under windows the program is called 'make.exe'. If you do not specify a path the IDE searches it in the PATH. Aha! If you want to use that make, use the macro $(make). Thanks :-) DoDi ___

Re: [fpc-devel] Passing parameters through the stack to interfaces

2010-08-05 Thread Hans-Peter Diettrich
Joost van der Sluis schrieb: It seems like that when you call a method of an interface, a 'hidden' wrapper is generated by the compiler to adjust the 'self' parameter so that it does not refers to the interface-pointer, but the actual class-pointer. This is common practice, also in C++. The

Re: [fpc-devel] Proposal: Enhanced replacement for assignment operators

2010-08-05 Thread Florian Klämpfl
Am 05.08.2010 22:19, schrieb _-jan...@web.de: > Hello everybody, > > I would like to propose an enhanced replacement for the special assignment > operators += -= *= and /= : > More pascal-like would be constructs of the form "operator :=" such as > a + := 1; > a div := 3; > a or := b; > a

[fpc-devel] Proposal: Enhanced replacement for assignment operators

2010-08-05 Thread _-jane-_
Hello everybody, I would like to propose an enhanced replacement for the special assignment operators += -= *= and /= : More pascal-like would be constructs of the form "operator :=" such as a + := 1; a div := 3; a or := b; a xor := 3; a << := 1; Together with my prior proposal of mult

[fpc-devel] Proposal: Multiple assignments

2010-08-05 Thread _-jane-_
Hello everybody, probably this is not really new stuff, but... May I propose multiple assignments, e.g. a,b:=0; or a,b += c+d; The right hand expression should be evaluated once and assigned (independently and in no particular order) to all the entries to the left of := . Jasper __

Re: [fpc-devel] threadvar implementation

2010-08-05 Thread Vinzent Höfler
Michael Schnell : > 2) ES: in my tests I modified ES in ASM code in a Delphi program and > caused it to crash by this, So the Delphi compiler seems to use it (for > whatever purpose) No surprise, in any sane environment DS should be equal to ES. Most notorious instruction requiring that would

Re: [fpc-devel] threadvar implementation

2010-08-05 Thread Vinzent Höfler
Michael Schnell : > > No need to. The segment value is not used by LEA. It calculates the > "effective address" which basically means the offset. > Yep "basically". :) But with other instructions the same notation and > description as used for "effective address" with LEA is used to access a > v

Re: [fpc-devel] Passing parameters through the stack to interfaces

2010-08-05 Thread Joost van der Sluis
On Thu, 2010-08-05 at 16:01 +0200, Jonas Maebe wrote: > On 05 Aug 2010, at 15:18, Joost van der Sluis wrote: > > > 1: replace the 'call' in the wrapper with a 'jmp'. I've tried this and > > it works, but when the function returns, the 'self'-class-pointer is > > not > > converted to the interfac

Re: [fpc-devel] Passing parameters through the stack to interfaces

2010-08-05 Thread Joost van der Sluis
On Thu, 2010-08-05 at 17:36 +0400, Sergei Gorelkin wrote: > Joost van der Sluis пишет: > > ... > > I don't know what's the best way to fix this. > > 2: See if we can let the caller do the > > interface-pointer-to-class-pointer conversion. That way the wrapper is > > not necessary anymore. Leads to

Re: [fpc-devel] OO rewrite - first round finished

2010-08-05 Thread Mattias Gärtner
Zitat von Hans-Peter Diettrich : Marc Weustink schrieb: While I can use Lazarus to debug the compilation of a single source file, no such feature exists for Makefiles. I even don't know how to translate an error address to a source code position. In Delphi I had a "jump to address..." menu ite

Re: [fpc-devel] Passing parameters through the stack to interfaces

2010-08-05 Thread Jonas Maebe
On 05 Aug 2010, at 15:18, Joost van der Sluis wrote: 1: replace the 'call' in the wrapper with a 'jmp'. I've tried this and it works, but when the function returns, the 'self'-class-pointer is not converted to the interface-pointer. But I don't see why this is done in the first place?!?

Re: [fpc-devel] Passing parameters through the stack to interfaces

2010-08-05 Thread Sergei Gorelkin
Joost van der Sluis пишет: ... I don't know what's the best way to fix this. I see three solutions: 1: replace the 'call' in the wrapper with a 'jmp'. I've tried this and it works, but when the function returns, the 'self'-class-pointer is not converted to the interface-pointer. But I don't see

[fpc-devel] Passing parameters through the stack to interfaces

2010-08-05 Thread Joost van der Sluis
Hi all, It seems like that when you call a method of an interface, a 'hidden' wrapper is generated by the compiler to adjust the 'self' parameter so that it does not refers to the interface-pointer, but the actual class-pointer. The problem is only that the extra 'call' which is made adds one ext

Re: [fpc-devel] threadvar implementation

2010-08-05 Thread Michael Schnell
On 08/05/2010 11:19 AM, Hans-Peter Diettrich wrote: Please accept that no more than 3 different segments are in use nowadays. This is not true. 1) FS: as discussed in this thread, Windows uses FS to address the thread management block 2) ES: in my tests I modified ES in ASM code in a Delph

Re: [fpc-devel] threadvar implementation

2010-08-05 Thread Michael Schnell
On 08/05/2010 11:19 AM, Hans-Peter Diettrich wrote: Michael Schnell schrieb: See http://flint.cs.yale.edu/cs422/doc/24547212.pdf page 3-7 The "logical address" is 24 bits: 16 bits "Segment Selector" and 32 bits "Offset". Please be a bit more precise with your bitcounts. Sorry for the typo

Re: [fpc-devel] threadvar implementation

2010-08-05 Thread Michael Schnell
On 08/05/2010 11:09 AM, Hans-Peter Diettrich wrote: I had thought that this has been fixed on newer architectures, that use the flat model only. This can't easily be "fixed" by hardware, how to express that LEA should convert e.g. a DS-based offset into a FS based one or the other way round,

Re: [fpc-devel] buildfaq

2010-08-05 Thread Michael Schnell
Thanks for the explanation ! -Michael ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel

Re: [fpc-devel] threadvar implementation

2010-08-05 Thread Hans-Peter Diettrich
Michael Schnell schrieb: OK I was wrong by two bits. See http://flint.cs.yale.edu/cs422/doc/24547212.pdf page 3-7 The "logical address" is 24 bits: 16 bits "Segment Selector" and 32 bits "Offset". Please be a bit more precise with your bitcounts. The Selector is used to take one of up to

Re: [fpc-devel] threadvar implementation

2010-08-05 Thread Hans-Peter Diettrich
Michael Schnell schrieb: IMHO, if the compiler should issue an error message if yo9u give a segment register with LEA, as the result obviously is erroneous. Maybe other compilers in fact do this. I only tested Turbo Delphi. I had thought that this has been fixed on newer architectures, that u

Re: [fpc-devel] buildfaq

2010-08-05 Thread Hans-Peter Diettrich
Michael Schnell schrieb: On 08/04/2010 09:23 PM, Hans-Peter Diettrich wrote: autobloat, I never heard of same ?!?!? automake, autoconf, configure... These are tools that try and guess how a project should be adopted to various targets. But it's up to the user to create the tests, with the

Re: [fpc-devel] OO rewrite - first round finished

2010-08-05 Thread Hans-Peter Diettrich
Marc Weustink schrieb: While I can use Lazarus to debug the compilation of a single source file, no such feature exists for Makefiles. I even don't know how to translate an error address to a source code position. In Delphi I had a "jump to address..." menu item... Use make all as "Execute bef

Re: [fpc-devel] buildfaq

2010-08-05 Thread Michael Schnell
On 08/05/2010 10:59 AM, Jonas Maebe wrote: He means autoconf and automake. They do have their own (very short) chapter in the GNU book. -Michael ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/

Re: [fpc-devel] buildfaq

2010-08-05 Thread Jonas Maebe
On 05 Aug 2010, at 09:30, Michael Schnell wrote: On 08/04/2010 09:23 PM, Hans-Peter Diettrich wrote: autobloat, I never heard of same ?!?!? He means autoconf and automake. It might be best if everyone would use the normal technical terms instead of derogatory inventions, since it obvious

Re: [fpc-devel] threadvar implementation

2010-08-05 Thread Michael Schnell
On 08/04/2010 09:40 PM, "Vinzent Höfler" wrote: JFTR, plain vanilla C (i.e. ISO C99) does not even have a notion of a "thread variable", because it doesn't have threads. So I don't know what C you're referring to here. GNU C provides the "__thread" keyword to specify threadvars. M$ C provides

Re: [fpc-devel] threadvar implementation

2010-08-05 Thread Michael Schnell
On 08/04/2010 09:19 PM, Hans-Peter Diettrich wrote: Michael Schnell schrieb: Look at the document I mentioned: a "linear address" is 48 bits, while a pointer is only 32 bits (the "Offset") . Read section 3.3 ff. and 3.8. Linear addresses are always 32 bit, and only a few server-type CPUs h

Re: [fpc-devel] buildfaq

2010-08-05 Thread Michael Schnell
On 08/04/2010 09:23 PM, Hans-Peter Diettrich wrote: autobloat, I never heard of same ?!?!? -Michael ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel

Re: [fpc-devel] threadvar implementation

2010-08-05 Thread Michael Schnell
OK I was wrong by two bits. See http://flint.cs.yale.edu/cs422/doc/24547212.pdf page 3-7 The "logical address" is 24 bits: 16 bits "Segment Selector" and 32 bits "Offset". Obviously in an instruction, usually the "Segment Selector" is taken from one of the six Segment registers while the "Off

Re: [fpc-devel] threadvar implementation

2010-08-05 Thread Michael Schnell
On 08/04/2010 10:29 PM, "Vinzent Höfler" wrote: |"The source operand is a memory address (offset part)" ^^^ Says that only the offset is used. OK, it says the offset part is _specified_. But the text describes the LEA instruction ("8D") itsel