Hello,
Here is an idea to help new-comers to FPC understand how it works:
A new project could be created which would be called: "Mini-FPC".
The purpose of the project is to demonstrate how FPC compiles/builds itself
and how it implements basic platform/cpu support.
So the very minimum goal o
"
Have you looked at target "embedded" ?
"
Just took a look at it it's still quite big/huge and uses arm ?
"
For what specific platform are you contemplating this for ?
"
None, redcode, cuda.
Mini-fpc could be reduced to show proportions that it becomes virtual, an
exercise at seperating the
3 comments:
"
1) Floating point support is necessary for the compiler to compile/build
itself, because floating point number support needs to be available in the
compiler itself (otherwise source files containing floating point numbers
cannot be processed by the compiler).
"
Why would a basic/co
-Original Message-
From: Hans-Peter Diettrich
Sent: Saturday, September 10, 2011 2:12 PM
To: FPC developers' list
Subject: Re: [fpc-devel] Project Idea: Mini-FPC
Skybuck Flying schrieb:
Nano would be:
One integer type, one string type, branch support, loop support, basic
su
"
Have a look at the P4 pascal compiler
"
Ok, I had a look at it.
"
http://homepages.cwi.nl/~steven/pascal/ .
"
Nice site.
"
The whole compiler is written in pascal and is only 4000 lines in 1 file.
"
Line-wise not to bad, the code itself also looks not to bad, but it does
look:
1. Very o
P5 is also in an unusuable state.
It should not be allowed to write code as follows:
repeat
if a < b then
begin
end
until a < b;
^ This code should produce an error becomes end is not ended with a semicolon
–> ;
This confuses Delphi’s source beautifier, which could be seen as a short comin
Well I hope the pascal language is updated so semicolons become required for
end's.
Take a long hard look at the P4 or P5 code and you will find a lot of if
then else statements with wrong identation as well, this makes it somewhat
hard to understand which else belongs to which if, it also mak
Hello,
Free Pascal 2.4.2 does not know about "NativeInt" a new type in recent
Delphi compilers which is either 32 bit for 32 bit platforms or 64 bit for
64 bit platforms.
Apperently the adventage of the NativeInt is that it can be used in for
loops, while int64 may not be used in for loops.
Hello,
I want to write code as follows and I will simplify it here to illustrate
the problem.
Let's say I want to kinds of records: TrecordA and TrecordB.
I want to be able to convert types of TrecordA to TrecordB but I also want
to be able to convert types of TrecordB to TrecordA.
So I was th
There appears to be a solution in Delphi for this:
It's called "record helpers":
Demonstration program:
// *** Begin of Test Program ***
program TestProgram;
{$APPTYPE CONSOLE}
{
Test circular records problem and solutions.
version 0.01 created on 19 september 2011 by Skyb
Hmm, interesting, the problem returns when TrecordA and TrecordB are each
put into their own units.
The problem turns from a "circular record" problem into a "circular unit"
problem :(
I guess only way to solve it is to place both types into the same unit ?
Or perhaps there is another way, p
I think the Delphi language has a little problem when it comes to
"properties".
I consider C/C++ to be a "value language" or maybe even a "const language"
where addresses of classes and fields are constant or hard coded into
instructions.
While Delphi is more of a "reference language" or "pointe
This is what I would worry about as well, if I used free pascal or lazarus.
Having a strict delphi mode, would bring free pascal one step closer, to
using it instead of Delphi.
There are other issues which would then remain though like:
Lazarus Forms
Lazarus Packages ?
And perhaps slightly l
Hello,
(Delphi limitation, but probably applies to free pascal as well):
Take following examples:
Tvalue = smallint;
or
Tvalue = word
or
Tvalue = 0..5000;
^ All of these examples are quite bad in the following way:
They become very static, which makes it pretty much impossible to change
th
Actually "wrap back" is probably not the correct behaviour for succ/pred.
So it should probably not "wrap back".
Instead it could give an out of range error message.
However at least Low and High should be able to be used on the dynamic range
type, so that these limits can dynamically be acquir
The reason for the proposal to add a dynamic/runtime version of
Low/High/Succ/Pred is pretty simply:
Currently there simply is no dynamic/runtime version of it.
Thus any code which is written using low/high/succ/pred is static in nature,
when the code needs to be changed to dynamic it's likely
-Original Message-
From: Marco van de Voort
Sent: Friday, December 23, 2011 13:21
To: FPC developers' list
Subject: Re: [fpc-devel] Limitations of static "ranged" integer
typesandsucc/pred, and dynamic solution.
In our previous episode, Skybuck Flying said:
Current
Hello,
*** Short version (more technical) ***:
Pointers to classes should be stored in a CPU or GPU pointer cache to prevent
the pointer from being pushed out of the cache by other data items which might
never be accessed again.
Pointers to classes have a higher likelyhood of being used again
My assumptions for this idea are:
1. Pointers to classes are mostly stored on the heap, in slow RAM.
"
What's fast RAM?
"
That would be the CPU L1 cache ;)
2. Nested/delegated classes incur a pointer access penalty, the deeper the
nesting the higher the penalty.
"
Why? Nested classes are n
Something like this ;):
type
TDepth3 = class
public
mValue : integer;
constructor Create;
destructor Destroy; override;
end;
constructor TDepth3.Create;
begin
mValue := 666;
end;
destructor TDepth3.Destroy;
begin
end;
type
TDepth2 = class
public
mDepth3 : TDepth3;
constructor Create;
-Original Message-
From: Hans-Peter Diettrich
Sent: Tuesday, January 03, 2012 14:56
To: FPC developers' list
Subject: Re: [fpc-devel] Pointer cache for fast class/pointer access.
Skybuck Flying schrieb:
vValue := mDepth1.mDepth2.mDepth3.mValue;
"
You can implement su
-Original Message-
From: Florian Klämpfl
Sent: Wednesday, January 04, 2012 22:20
To: FPC developers' list
Subject: Re: [fpc-devel] Pointer cache for fast class/pointer access.
Am 04.01.2012 19:24, schrieb Hans-Peter Diettrich:
Skybuck Flying schrieb:
-Original Me
-Original Message-
From: Marc Weustink
Sent: Friday, June 08, 2012 9:08
To: FPC developers' list
Subject: Re: [fpc-devel] Scalar value is accepted as an argument for an
openarray parameter
On 8-6-2012 8:18, Alexander Klenin wrote:
The following code compiles both with :
procedure
-Original Message-
From: Sven Barth
Sent: Sunday, June 10, 2012 18:23
To: fpc-devel@lists.freepascal.org
Subject: Re: [fpc-devel] Scalar value is accepted as an argument for
anopenarray parameter
On 10.06.2012 00:22, Skybuck Flying wrote:
-Original Message- From: Marc
I don't think this is a good idea.
For example while debugging and looking at the memory in raw this would lead
to confusion.
It's already bad that Delphi adds invisible fields to classes so they cannot
be simply dumped to disk... (virtual method table pointers ?) this would
make it even wor
-Original Message-
From: Jonas Maebe
Sent: Sunday, July 15, 2012 15:49
To: FPC developers' list
Subject: Re: [fpc-devel] Class field reordering
On 14 Jul 2012, at 14:16, Skybuck Flying wrote:
I don't think this is a good idea.
For example while debugging and looking at
I don't think this is a good idea.
For example while debugging and looking at the memory in raw this would
lead to confusion.
By knowing the order of the fields, you still don't know their exact
offsets. If you want to know their address, print
@classinstance.fieldname
Yes but I do know th
> I also wonder how much of an optimization it actually is ? Maybe
> 0.01%
> more performance ?
"
1) as mentioned in the original mail, the current transformation is
implemented for saving memory, not for improving performance
"
This wasn't clear, it only mentions gaps. What kind of gaps ?
Hello,
Here is an idea how to speed up pascal programs by about 20%.
Currently pascal only supports:
array of structure;
However if structure of array was used this could give 20% additional
performance.
the syntax for such a new feature could be:
structure of array;
So examples:
var
vAr
Hello,
I tried searching the archives manually but this is a bit time consuming, I
also tried the search function on the website but it seems broken.
Anyway my question is the following:
Are there any plans to add OpenCL/CUDA/PTX support for the future ?
With this question I do not mean DLL
Hello,
I would like to experiment with the pascal programming language at the
binary/assembler/machine level.
For example compile pascal sources to virtual machine instruction sets.
I took a look at the free pascal sources and there seem to be some
assemblers inside the folders.
I see clas
Hello,
I kinda forget to mention something in my previous posting to this mailing
list, but perhaps it should go into a seperate thread anyway:
As I mentioned in the previous posting with subject: "Adding a new assembler
to Free Pascal Compiler"... I am interested in using free pascal compile
Answering my own question ;)
I guess the answer to my question is more or less the same as the following
question:
"How to add a new target to free pascal compiler".
And I found this webpage which explains it a bit:
http://wiki.freepascal.org/Porting_Free_Pascal#Adding_a_new_target
I'll quo
Hmm... one of the reasons why I might not have found this documentation is
because of this:
At the wiki/documentation link:
"
Online documentation
Remark:you must have javascript and style sheets enabled in order to view
the html documentation correctly.
The following documents are online a
Hello,
I have a little question about these subfolders in the compiler folder, they
are called:
'i386' and 'x86'
What are these folders, they seem samiliar ?
(cpubase.pas seems to be missing from i386 instead there is an include file
called cpubase.inc)
I'm a bit confused about these fold
ybuck.
- Original Message -
From: "Skybuck Flying"
To: "Free Pascal Developers Mailing List"
Sent: Wednesday, 6 April, 2011 05:34 AM
Subject: [fpc-devel] Compiler subfolders: i386, x86
Hello,
I have a little question about these subfolders in the compiler folder,
they are
Hello,
I am having momentarily confusion about the situation with ccharset.pas and
charset.pas and strings, ansistrings and unicode in general... ?!?
So some questions about this:
I in particularly do not understand the following uses clausule:
{$ifdef VER2_2}ccharset{$else VER2_2}charset{$e
Hello,
First of all I would like to write that I failed to compile the RTL of Free
Pascal so that might be adding a little bit too the confusion.
(Just simple i386/x86 tests to see if the sources build)
The compiler however seems to compile fine.
I am now a bit confused about the whole theory
Hello,
Then again when I think about this some more it doesn't seem to make much
sense... since free pascal does have RTL for other platforms.
And it also has "cpu's" for other platforms.
So perhaps what is needed is the following:
The RTL which is necessary for the other platform must first
Hello,
Perhaps some last silly questions about "external assemblers".
First I'd like to say that I saw some tutorial where the compiler itself
produced some form of assembly output in text... probably real assembly...
So that's kinda interesting to output text this makes it flexible for other
Ok,
I thought about it a bit and I think I now logically understand what's going
on and what needs to happen when one wants to build a new compiler, possibly
for cross compiling and such in relation to the RTL.
First of all "free pascal compiler" is not a "multi-target cross compiler"
but it
4. Step 4 (building full-cross compiler)
Add new target's rtl to free pascal compiler sources so that the free
pascal compiler can compile source into into target-(executable or
package/dll)-binaries.
Re-build the compiler and tell it to use the new-target's-rtl as it's uses
clausule. (This
Around line 1120:
else if is_char(constdef) then
begin
read_factor:=char(qword(value.valueord));
factorType:= [ctetString];
end
valueord seems to be type casted towards an int6
Hello,
(This posting/reply is mostly ment for: Hans-Peter Diettrich)
I saw you mentioned you are working on the "front end part" of the compiler.
I also saw you want to introduce either syntaxes or perhaps even languages
(?)
I guess you want to experiment with alternative syntaxes or introdu
Here is one little idea which might be obvious:
1. The assembler could notify to the rest of the system like parser or
symantic checker which languages features are supported and which are not
supported by the assembler.
This way certain "language elements" of the language could be turned off
(but that's probably pushing it ! ;) =D) Nice to think of
possibilities though... I like backwards compatibility quite a lot ;)
Bye,
Skybuck =D
- Original Message -
From: "Sven Barth"
To:
Sent: Wednesday, 6 April, 2011 14:40 PM
Subject: Re: [fpc-devel] ccharset.pas, char
- Original Message -
From: "Skybuck Flying"
To: "FPC developers' list"
Sent: Thursday, 7 April, 2011 03:06 AM
Subject: Re: [fpc-devel] Building compiler, rtl, host,target... (cross
compiling)
Ok,
I thought about it a bit and I think I now logically un
I have to go do other things now so I will keep this short, maybe I'll get
back to this posting later on...
What is needed is a "full-cross compiler" which also uses the NewRTL for
the NewPlatform.
No, why should the compiler need to use a different RTL, for its *own*
operation?
It already
- Original Message -
From: "Hans-Peter Diettrich"
To: "FPC developers' list"
Sent: Thursday, 7 April, 2011 06:21 AM
Subject: Re: [fpc-devel] Building compiler, rtl, host,target... (cross
compiling)
Skybuck Flying schrieb:
So this is my biggest question
- Original Message -
From: "Hans-Peter Diettrich"
To: "FPC developers' list"
Sent: Thursday, 7 April, 2011 06:10 AM
Subject: Re: [fpc-devel] Building compiler, rtl, host,target... (cross
compiling)
Skybuck Flying schrieb:
First of all "free pa
Hello,
As I was busy with the free pascal compiler source codes I came across an
unfamiliar operator for me: ><
(
It's in nflw.pas at line 830:
{Symdif operator, in case you are wondering:}
loopflags:=loopflags >< [lnf_checknegate];
)
First I googled it a bit and came across a lan
Hello,
I am currently inspecting the following compiler unit of 2.4.2
branch/release ninl.pas:
line 1371: enum:=tenumsym(tenumdef(def).firstenum);
line 1372: v:=tenumdef(def).maxval;
Problem is with line 1372.
.maxval is apperently an integer.
v howe
: "Skybuck Flying"
To: "Free Pascal Developers Mailing List"
Sent: Thursday, 7 April, 2011 08:01 AM
Subject: Oddity: Longint being converted automatically to int64 and then
assignment/conversion operator used/applied for/to structure
variable...(i386) branch (2.4.2)
He
Hello,
There could be a slight little overflow issue in unit "nx86mat.pas"
Line 174:
current_asmdata.asmlists[al_typedconsts].concat(tai_const.create_32bit(-(1
shl 31)));
Explanation of potential bug:
1 shl 31 results in 2147483648 which is already an integer overflow.
It is then tried
I have little bit good news for Delphi:
By adding pp to extension list somewhere in the options it's possible to
compile pp files as well.
At first I thought it was syntax highlighting only... but this does not
appear to be the case...
It actually does compile ! ;) (Delphi XE)
This probabl
Hello,
I have finished with Phase 1 of the Free Pascal Compiler Delphi XE Port
Project:
http://www.skybuck.org/FreePascalCompilerDelphiXEPortProject/
All code with porting issue's have been disabled by me.
(The RTL is not used, instead small portions of it where copied to
unit_skybuck_type
The short story so far:
Hello,
This project is about "porting" the Free Pascal Compiler to Delphi XE.
More information can be found on this little blog:
http://www.skybuck.org/FreePascalCompilerDelphiXEPortProject/
A subversion server has been setup here:
https://free-pascal-compiler-delphi-
Ok,
I gave google code a try but it doesn't have all the features I want, so I
am switching to sourceforge:
https://sourceforge.net/projects/fpcfordelphi/
(I especially like/want the bugtracker ! ;) =D)
Bye,
Skybuck.
___
fpc-devel maillist -
Hello,
These two functions are being used for i386:
// *** Skybuck: Fix Needed (porting issue 582)
function get_frame:pointer;assembler;nostackframe;{$ifdef
SYSTEMINLINE}inline;{$endif}
asm
movl%ebp,%eax
end;
// *** Skybuck: Fix Needed (porting issue 583)
function get_caller_addr(framebp
- Original Message -
From: "Mark Morgan Lloyd"
To:
Sent: Wednesday, 13 April, 2011 10:13 AM
Subject: Re: [fpc-devel] Announcement: Free Pascal Compiler Delphi
XEPortProject
Skybuck Flying wrote:
The source code compiles, however little sections of code have been
d
- Original Message -
From: "Hans-Peter Diettrich"
To: "FPC developers' list"
Sent: Thursday, 14 April, 2011 15:12 PM
Subject: Re: [fpc-devel] Announcement: Free Pascal CompilerDelphi
XEPortProject
Skybuck Flying schrieb:
Anyway if somebody could take
IMHO you'll describing problems he'll never reach. After he gets a Delphi
compiled FPC, he still needs to make the resulting product _work_.
If I understood it correctly, this (making the Delphi compiled FPC work
stable enough) was the problem with earlier attempts, and the unicode
version won't
Hello,
I've been wondering lately a little bit how the basic types are implemented.
Now byte, integer and so forth seem easy, these can be directly translated
by the assemblers into machine instructions.
However pascal's string types, seem more of a special type, one could
consider this a "s
Hello,
I copied "arm" folder to "sky" folder to try and use it as basis for adding
a new target to free pascal.
I also used lazarus 9.30 which builds everything fine.
I also added ifdefs and if defines for sky. "sky" is the conditional used to
indicate my target ;)
fpc builds but when it's
Ok,
I think I got a working to a certain point... the error is gone... it now
probably needs an RTL for "sky".
I am still a bit confused about the difference between "i_" and "t_" units.
I am a bit confused about the difference between "processor" conditional and
"operating system" condition
Also to see what I done to source code new version of compiler is available:
http://www.skybuck.org/FreePascalExperiments/SkyTarget/
Look for:
compilerv2.rar
New files:
ppcsky.pp
i_sky.pas
t_sky.pas
I based the last two on gba ! ;) =D
Bye,
Skybuck.
Hello,
In free pascal/pascal/delphi it's necessary to declare a pointer to a
record, which is to be used inside the record to point to itself, before the
record itself without a type directive in between them for example:
// correct:
type
PMyRecord = ^TMyRecord;
TMyRecord = record
Hello,
I am not sure, maybe we discussed this before, maybe not.
I am getting quite sick of having to write IntToStr all the fricking time
like so:
begin
s := IntToStr(X) + ' ' + IntToStr(Y);
end;
So much typing for nothing ?!?
I could have written just:
begin
s := X + ' ' + Y;
end;
- Original Message -
From: "Marco van de Voort"
To: "FPC developers' list"
Sent: Friday, 29 April, 2011 10:35 AM
Subject: Re: [fpc-devel] type pointer to record before record.
In our previous episode, Skybuck Flying said:
I would first like to remark
- Original Message -
From: "Felipe Monteiro de Carvalho"
To: "FPC developers' list"
Sent: Friday, 29 April, 2011 10:23 AM
Subject: Re: [fpc-devel] Default IntToStr operator for '+' symbol.
The Pascal way to avoid using too much IntToStr is:
begin
s := Format('%d %d', [X, Y]);
end
- Original Message -
From: "Florian Klaempfl"
To: "FPC developers' list"
Sent: Friday, 29 April, 2011 15:57 PM
Subject: Re: [fpc-devel] type pointer to record before record.
Am 29.04.2011 15:51, schrieb Flávio Etrusco:
type
TMyRecord = record
mPrev : ^TMyRecord; // not all
Does it produce executables which can be run by Windows 95 ?
There was a note on the free pascal website which said some version (2.4.2?)
had a bug which prevented this ?
Bye,
Skybuck.
___
fpc-devel maillist - fpc-devel@lists.freepascal.org
http:
you do know how to solve it... then you can do it !
;) =D
// *** Begin of Test Program ***
program TestProgram;
{$APPTYPE CONSOLE}
{
Test complete boolean evaluation compiler switches to see if they
are unit/file width or per routine or per code section
version 0.01 created on 14 june 2011
plete boolean evaluation compiler switches to see if they
are unit/file width or per routine or per code section
version 0.01 created on 14 june 2011 and fixed/improved on 15 june 2011 by
Skybuck Flying
Conclusion: it works per code section however there is a potential problem:
It might n
Another easy solution is the following:
1. Create a C project.
2. Include the file.
3. Printf all key defines.
4. Collect the numbers.
5. Stuff the number into the pascal file.
This will circumvent the macro issue.
I could probably do this myself but for today I have run out of time.
I wil
Very bad tool,
Barely converts anything,
Complains files are missing.
Does weird stuff with F: ?
At least it's written in Delphi it seems,
Doesn't even have a simple convert button.
It needs a manual ? I do not have time to read manuals for something as
simple as converting C to Pascal.
I had to convert "void test( void *data)" to Delphi/Pascal.
My first conversion was:
procedure test( data : pointer );
The documentation of the test function seems to indicate that this function
returns all kinds of pointers, so it's like a call by reference call.
So I am starting to wonder if
There is no configuration, or any configuration options.
When View->Config is shown it shows nothing except "File: " and then more
nothingness.
Bye,
Skybuck.
___
fpc-devel maillist - fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mail
Hello,
Here is a new language idea which would make Delphi a bit more friendly:
First the problem:
pointers and longwords are not assignment compatible.
This is pretty much bullshit because they are the same size.
Now the solution, create a new type which has the same size and make it
"size c
Not a problem, that's what the unified type is for.
It detects "pointer" and "longword" is of different size on 64 bit so then
it's not allowed ;)
Bye,
Skybuck.
___
fpc-devel maillist - fpc-devel@lists.freepascal.org
http://lists.freepascal.org/m
Not really, because if the platform changes from 32 bit to 64 bit then other
types would change too.
For example type declared as being longword would change to uint64.
So the only thing which needs to happen is a changed to TUnifiedAddress for
example.
was:
TUnifiedAddress = unify longword
From: Lloyd Park
Sent: Monday, June 20, 2011 4:30 PM
To: FPC developers' list
Subject: Re: [fpc-devel] New language idea: Unified
types(assignmentsize-compatible types).
“
Not to mention that it breaks the strong typing that is central to Pascal's
design.
“
Nope, the strong type checking is
-Original Message-
From: Hans-Peter Diettrich
Sent: Monday, June 20, 2011 8:01 AM
To: FPC developers' list
Subject: Re: [fpc-devel] Hi listers, , , ,I am trying to translate a C
headerwith H2PAS
Skybuck Flying schrieb:
There is no configuration, or any configuration options.
The difference is actually:
1. Pascal has call by value and call by reference.
2. C only has call by value.
Because of limitation 2, C programmers use the pointer trick to pass the
address of a variable so it can be changed inside the routine, example:
1. C call by value (default):
void test
Actually I am looking for object pascal to c++ converter to be precise, so with
classes support
Bye,
Skybuck.
From: Skybuck Flying
Sent: Tuesday, June 21, 2011 11:04 AM
To: FPC developers' list
Subject: Pascal to C converter
Do you guys know of any good Pascal to C converters ?
I think I would already be happy with a converter which would convert
everything except the defines.
Anyway here an idea for the defines:
1. For each define convert it to a constant.
Then try to compile that with free pascal or try parsing it.
If it produces errors then it must be wrong.
2.
-Original Message-
From: Hans-Peter Diettrich
Sent: Wednesday, June 22, 2011 11:26 AM
To: FPC developers' list
Subject: Re: [fpc-devel] Re: Pascal to C converter
Skybuck Flying schrieb:
Actually I am looking for object pascal to c++ converter to be precise, so
with classes su
Here is a little idea for an automated check or so, to warn if something odd
is happening or so ;) :):
Assert( SizeOf(byte) = 1, 'SizeOf(byte)(' + IntToStr(SizeOf(byte)) + ') =
1' );
Assert( SizeOf(word) = 2, 'SizeOf(word)(' + IntToStr(SizeOf(word)) + ') =
2' );
Assert( SizeOf(longword) = 4, '
gram;
{$APPTYPE CONSOLE}
{
Test dynamic multi dimensional index calculations
version 0.01 created on 1 juli 2011 by Skybuck Flying
To illustrate the theory behind dynamic multi dimension index calculations I
shall now
create a little test/demonstration program to show you how to write this
co
Yeah this is some very nice code:
Enumerator successfully buid into TDynamicIndex ! ;) =D
alternative version 0.07:
// *** Begin of Test Program ***
program TestProgram;
{$APPTYPE CONSOLE}
{
TDynamicIndex
alternative version 0.06 created on 3 july 2011 by Skybuck Flying.
TDynamicIndex
would need to indicate the order of the dimensions like
so:
Block.Order := 2;
Element.Order := 1;
Corrected version 0.07 test program:
// *** Begin of Test Program ***
program TestProgram;
{$APPTYPE CONSOLE}
{
TDynamicIndex
alternative version 0.06 created on 3 july 2011 by Skybuck Flying
91 matches
Mail list logo