[fpc-pascal] Porting linux to pascal, would it be possible ?

2008-12-05 Thread Skybuck Flying

Hello,

An open source pascal operating system could be cool.

Would translating/porting linux to pascal be possible ?

Bye,
 Skybuck.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Porting linux to pascal, would it be possible ?

2008-12-05 Thread Gerard N/A
As with many things, it only depends of the time you have.
But as you grow older you get a different idea of life expectancy and
the use of your remaing time.

Regards,

Gerard.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Porting linux to pascal, would it be possible ?

2008-12-05 Thread Marc Geldon (SCALA IT)
What is the use anyhow?

2008/12/4 Skybuck Flying [EMAIL PROTECTED]

 Hello,

 An open source pascal operating system could be cool.

 Would translating/porting linux to pascal be possible ?

 Bye,
  Skybuck.
 ___
 fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
 http://lists.freepascal.org/mailman/listinfo/fpc-pascal



--
SCALA IT | Internet- und Softwareagentur
Büro Mannheim: L7, 7a | 68161 Mannheim
Firmensitz: Gutenbergstr. 18 | 67112 Mutterstadt

Tel: (06234) 600 57-6
Fax: (06234) 600 57-9

e-mail: [EMAIL PROTECTED]
Mobil: (0176) 206 263 04

Inhaber: Marc Geldon
Steuernummer: 41/049/7267/0 (Finanzamt Speyer)
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Porting linux to pascal, would it be possible ?

2008-12-05 Thread leledumbo

 An open source pascal operating system could be cool.

There are already such projects (including mine :-)). Search google code and
sourceforge.

 Would translating/porting linux to pascal be possible ? 

Yes, but who would? And if he/she would, does he/she have the time?
-- 
View this message in context: 
http://www.nabble.com/Porting-linux-to-pascal%2C-would-it-be-possible---tp20850611p20851474.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] Re: Porting linux to pascal, would it be possible ?

2008-12-05 Thread Guillermo Martínez Jiménez
 Would translating/porting linux to pascal be possible ?

Possible?  Yes it is.  Worth of...?  I'm afraid not.

By the way, Linux is good as it is now and Pascal isn't the best
option to create an operating system.

Guillermo Ñuño Martínez
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Re: Porting linux to pascal, would it be possible ?

2008-12-05 Thread Leonardo M . Ramé
--- On Fri, 12/5/08, Guillermo Martínez Jiménez [EMAIL PROTECTED] wrote:

 By the way, Linux is good as it is now and Pascal isn't the best
 option to create an operating system.

Are you sure? doesn't older MacOS's versions where written in Object Pascal?

I think the problem here (again) is not the language, it's the critical mass of 
users of the language. Using C for Linux was a good bet, not because the 
language is good (Pascal is way better for me), but because C has a wider user 
base who can fix/add features.

Leonardo M. Ramé
http://leonardorame.blogspot.com




___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Porting linux to pascal, would it be, possible ?

2008-12-05 Thread Ingemar Ragnemalm

Skybuck Flying [EMAIL PROTECTED] wrote:


Hello,
  
An open source pascal operating system could be cool.
  
Would translating/porting linux to pascal be possible ?
  


Absolutely. Most of Unix is plain C, which translates well to Pascal. 
C++ is harder, of course.


Gerard N/A [EMAIL PROTECTED] wrote:


As with many things, it only depends of the time you have. But as you grow 
older you get a different idea of life expectancy and
the use of your remaing time.
  


This is an argument only after considering the time versus the goal. Is 
the goal worth the time?


An operating system based on FPC code would be one way to give FPC more 
(well deserved) attention, one way to make a wider range of people know 
that the language is not dead, but significantly updated and a stronger 
alternative than most people think.


But it is the best way? An OS kernel is not the most visible source code 
that makes a lot of people gather to have a look. Showing off the 
technology can be done in more time-efficient ways.


Another goal is to make a better OS. FPC programs use less memory and 
starts faster. That can be a good thing. Would it be significant? I'm 
not sure.


You are perfectly right in that we must choose our battles and spend our 
time on things that are worth the time. I don't rule out that this could 
be one. Porting Linux doesn't have to imply that every little program 
is ported.



/Ingemar

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Porting linux to pascal, would it be, possible ?

2008-12-05 Thread Skybuck Flying

If everybody does a little bit it could go quite quickly.

Question is:

Which linux distro ? ;)

Maybe even some BSD version so that closed-source os-es could be done as 
well.


Though I onced tried FreeBSD... I couldn't even figure out the gui or how to 
start an app..


So maybe linux more user friendly...

So first someone needs to find a good/user friendly linux distro which is 
not to large.


Also for kicks maybe a floppy-disk based linux distro could be turned into 
pascal as well.


So could even be multiple linux distro's turned into pascal...

Different flavors for everybody :)

Most important would be to be able to play with the to-be-pascal sources of 
the linux distro so people can try out things with the os... ;)


So focus would be:

1. Linux distro(s)/kernel(s).

2. Linux gui(s).

3. Linux editor for editing pascal files.

4. Free pascal compiler probably already available.

Then anything else can be turned into pascal later on :)

Maybe even drivers and applications and such ;)

Bye,
 Skybuck. 


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Porting linux to pascal, would it be, possible ?

2008-12-05 Thread Vincent Snijders

Skybuck Flying schreef:

If everybody does a little bit it could go quite quickly.



Some (arbitrary numbers) from http://www.ohloh.net/p/linux:
Codebase 10,679,927 lines
Effort (est.)   3,396 Person Years

So, if everybody on this list (maybe 300 persons) work on it, then it 
can be done in just over 11 years. Not so quickly, IMHO.


Vincent
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Porting linux to pascal, would it be, possible ?

2008-12-05 Thread Steve Howe
Hello all,
 Skybuck Flying schreef:
  If everybody does a little bit it could go quite quickly.

 Some (arbitrary numbers) from http://www.ohloh.net/p/linux:
 Codebase   10,679,927 lines
 Effort (est.) 3,396 Person Years

 So, if everybody on this list (maybe 300 persons) work on it, then it
 can be done in just over 11 years. Not so quickly, IMHO.
Although the effort is huge, and the topic is senseless, porting is much 
faster then creating/coding/debugging. The numbers above do not reflect a port 
and are pointless.

-- 
Best Regards,
Steve Howe
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Porting linux to pascal, would it be, possible ?

2008-12-05 Thread Felipe Monteiro de Carvalho
If you want to do some large work to increase the use of FPC I would
recommend creating a Window Manager instead, probably with fpgui.

The work is imensely smaller, althougth still large, and a window
manager usually comes with lot's of useful gui software, so this would
be an opportunity to distribute all kinds of software made with fpc
and lazarus.

My open source project, for example, the Virtual Magnifying Glass,
suffers in linux because KDE only wishes to distribute C++/Qt software
and Gnome only distributes C and C# software, so it get's hard to be
popular.

And don't expect people from the list to join your initiative. Usually
you have to start the project alone and get something working before
one or two people join in. Don't expect everyone to stop what they are
doing to help you in what you think is important.

-- 
Felipe Monteiro de Carvalho
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Porting linux to pascal, would it be, possible ?

2008-12-05 Thread Gerard N/A
On Fri, Dec 5, 2008 at 1:18 PM, Ingemar Ragnemalm [EMAIL PROTECTED] wrote:

 This is an argument only after considering the time versus the goal. Is the
 goal worth the time?

No, and that was exactly my point. Life is too short to spend it
rewriting Linux in Pascal. g


 Another goal is to make a better OS. FPC programs use less memory and starts
 faster. That can be a good thing. Would it be significant? I'm not sure.


Then maybe it would better to focus on something different from Linux.

 You are perfectly right in that we must choose our battles and spend our
 time on things that are worth the time. I don't rule out that this could be
 one. Porting Linux doesn't have to imply that every little program is
 ported.

Not every little program, but only for the kernel + drivers +
filesystems the task is daunting.

Gerard.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] EInvalidOp Excpetion

2008-12-05 Thread Antonio Sanguigni
Hi all,

since fpc 2.2.3 in my Arch Linux box I'm having some troubles with an
EInvalidOp exception raised on normal math operations. I tried to
update to 2.3.1 but with the same result. I found in the bug tracker
an opened bug, about this kind of exception and I tried to use
ClearExceptions and trapping the code block in a try..except block and
this is fine but the error move on another block of my code. Trapping
this too, it moves on synapse library code so I believe there is a
problem I cannot solve. Could you guys point me to the right direction
to solve this errors ?

Thank you.

Follows a my code block:
-
procedure TFileToFtp.Update(ASubject: TtiObject);
var
  TempSpeed: double;
begin
  inherited Update(ASubject);
  begin
FTransferBytes:= FTransferBytes +
TMultiFTP(ASubject).WrittenBytes; //total transferred bytes
FTransferPercentage := RoundTo(fTransferBytes / fSize * 100, -2);
try
  TempSpeed := (TMultiFTP(ASubject).WrittenBytes/SecondSpan(Time,
fTime))/1024;
  fTransferSpeed := TempSpeed;
except
  //do nothing to capture division by zero
  //and keep previous fTransferSpeed value ;-)
end;
fTime := Time; // == *HERE I HAVE EInvalidOp, but if I
trap this I got on the first two rows after begin statement and if I
trap all the block I have it in another code block*
writeln(FloatToStr(RoundTo(fTransferPercentage, -4)) + '%');
writeln(FloatToStr(RoundTo(fTransferSpeed, -4)) + ' Kb');
writeln('Pacchetto: ' + IntToStr(TMultiFTP(ASubject).WrittenBytes));
  end;
end;


Antonio


--
Antonio Sanguigni alias slapshot
--
GioveLUG (Linux User Group) - http://www.giovelug.org
Edupup (Educational distro) - http://www.pieroni.biz/edupup
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Porting linux to pascal, would it be possible ?

2008-12-05 Thread Ingemar Ragnemalm


Leonardo M. Ram? [EMAIL PROTECTED] wrote:


--- On Fri, 12/5/08, Guillermo Martínez Jiménez [EMAIL PROTECTED] wrote:

  

By the way, Linux is good as it is now and Pascal isn't the best
option to create an operating system.



Are you sure? doesn't older MacOS's versions where written in Object Pascal?
  


Yes, and there's nothing wrong with Pascal for an OS. It would be excellent.


I think the problem here (again) is not the language, it's the critical mass of 
users of the language. Using C for Linux was a good bet, not because the 
language is good (Pascal is way better for me), but because C has a wider user 
base who can fix/add features.
  


Using C for Linux was the only way, because there was a free C compiler 
(GCC) and none for Pascal or other comparable languages. Things have 
changed since then, but much of the software industry is on a path 
decided from the situation 20 years ago. The industry took the C route 
since there was no cross-platform Pascal, while Linux made the choice 
from available free software. Now everything must have inherited design 
flaws from C just because of what was available in the 80's. That is, 
unless the tide changes. It can happen.



Felipe Monteiro de Carvalho [EMAIL PROTECTED] wrote:

My open source project, for example, the Virtual Magnifying Glass,
suffers in linux because KDE only wishes to distribute C++/Qt software
and Gnome only distributes C and C# software, so it get's hard to be
popular.
  


Now, that sounds like one real problem, related to the porting issue, 
which we can address. And not that doesn't need as much work.


So the KDE and Gnome projects are language-locked? (How? Surely users 
don't select software by language? Or are the distros incomplete, 
FPC-wise? Hard to recompile?) Anyway. that sounds bad! And that suggests 
a much shorter path: Adapt a distribution to Pascal Gnome support, 
with full Pascal interfaces and code, or whatever is missing. Port Gnome 
examples, if it isn't already done, and show that Pascal (FPC) is not 
only an option but a *better* solution. Easier than C/C++, faster than 
Java, much faster than Python... I don't know if an FPC-tuned distro 
would make any difference, stronger FPC support in, say, Ubuntu, would 
make a bigger impact. Acceptance of FPC sounds like a good goal to me.


Who isn't distributing? Gnome? That isn't a distribution. I don't quite 
understand what you mean.


The FPC OS doesn't have to be 100% written in FPC, not even 10%. No 
hurry. The C code is ugly but it works as long as you don't take GCC 
out. Port what really counts, making it possible and well supported to 
write *new* programs in FPC.



/Ingemar

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Porting linux to pascal, would it be possible ?

2008-12-05 Thread Felipe Monteiro de Carvalho
On Fri, Dec 5, 2008 at 2:40 PM, Ingemar Ragnemalm [EMAIL PROTECTED] wrote:
 So the KDE and Gnome projects are language-locked?

Yes, they are.

 (How? Surely users don't select software by language?

Users don't care, but they usually use what comes with their distro
and window manager, so if KDE comes with a bunch of software they will
use it instead of looking for alternatives.

 Or are the distros incomplete, FPC-wise?

distributions are not the same thing as window manager.

Distributions are much more flexible language-wise, but they tend to
package whatever comes with the window manager.

It would also be possible to build a distribution instead of a window
manager, but I'm usually into writing code, as opposed to setting
things up, so building a distribution doesn't seam a lot of fun to me
=)

-- 
Felipe Monteiro de Carvalho
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Porting linux to pascal, would it be possible ?

2008-12-05 Thread Marc Santhoff
Am Freitag, den 05.12.2008, 17:40 +0100 schrieb Ingemar Ragnemalm:
 Now everything must have inherited design 
 flaws from C just because of what was available in the 80's.

This is one strong argument against porting Lunix to Pascal, isn't it?
Porting means sort of translating old design flaws to another language.

  That is, 
 unless the tide changes. It can happen.

It has happened in the past. There has been OS/2 for example, with it's
superior OO design. RIP.

There have been many OSses with new appealing features, BEOS coming to
my mind.

And there have been some people starting to write an OS in pascal, but
I've never heard of something coming out as ... say at least an alpha
version or some sort of prototype.

SCNR,
Marc
-- 
UN*X is sexy!
who | grep -i blonde | date; cd ~; unzip; touch; strip; \
finger; mount; gasp; yes; uptime; umount; sleep

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Porting linux to pascal, would it be, possible ?

2008-12-05 Thread Prince Riley
Hello Everyone,

While I can't honestly say I share any enthusiasm for writing a OS in
FreePascal, I do think there is merit in looking for projects of similar
scope and interest that can demonstrate the power of the language and the
tremendous tools that have been developed by this group over the past four
years.

I do think that if someone were to interested in testing their mettle for
writing something like an OS, he or she might first take a crack at writing
a few of the GNU tools in FP. Say for example the BusyBox suite. Once they
had done that, there are a few more code foothills they could climb to build
up enough additional undestanding and programming techniques  others could
then learn and then join them later on more ambitious OS projects.

My current projects are to port the FP compiler to the OpenSolaris platform
and to eventually write an Eclipse plug-in oe a Mozilla based XUL
application (like Komodo) for FP. Ultimately, I am interested in exploring
more of the ARM platform support in FP.

Prince

On Fri, Dec 5, 2008 at 9:58 AM, Gerard N/A [EMAIL PROTECTED]wrote:

 On Fri, Dec 5, 2008 at 1:18 PM, Ingemar Ragnemalm [EMAIL PROTECTED]
 wrote:
 
  This is an argument only after considering the time versus the goal. Is
 the
  goal worth the time?
 
 No, and that was exactly my point. Life is too short to spend it
 rewriting Linux in Pascal. g

 
  Another goal is to make a better OS. FPC programs use less memory and
 starts
  faster. That can be a good thing. Would it be significant? I'm not sure.
 

 Then maybe it would better to focus on something different from Linux.

  You are perfectly right in that we must choose our battles and spend our
  time on things that are worth the time. I don't rule out that this could
 be
  one. Porting Linux doesn't have to imply that every little program is
  ported.
 
 Not every little program, but only for the kernel + drivers +
 filesystems the task is daunting.

 Gerard.
 ___
 fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
 http://lists.freepascal.org/mailman/listinfo/fpc-pascal

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

[fpc-pascal] Re: Porting linux to pascal, would it be possible ?

2008-12-05 Thread Guillermo Martínez Jiménez
 Are you sure?

Yes, I am.

 doesn't older MacOS's versions where written in Object Pascal?

Yes, it does, but as I said I think it wasn't the better options.

 I think the problem here (again) is not the language, it's the critical mass 
 of users of the language. Using C for Linux was a good bet, not because the 
 language is good (Pascal is way better for me), but because C has a wider 
 user base who can fix/add features.

I disagree.  C is better for write operating systems *by definition*:
C was created to write UNIX, Pascal was created to learn good
programming techniques.  C is low/mid-level language, Pascal is
high-level (and Object Pascal is even higher):  OS are the lowest
software level.

I'm not saying it's impossible:  here you have MacOS and Toro. I'm
just saying that _I think_ it isn't the best option.  Of course a
better option is to write the kernel in C and Assembler and the
utilities in Pascal and Object Pascal.

Guillermo Ñuño Martínez
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Re: Porting linux to pascal, would it be possible ?

2008-12-05 Thread Prince Riley
Hello

I don't mean to start a culture war here, but I think there is a bit of
overstatement in this post that 'C' is somehow a better language for writing
an OS in than say Pascal or OP or anything else.

In point of fact, the only 'best' language for any processor is its own
machine code which is always binary.
And the first operating system software written was done so in the assembly
language which is written to use mnemoics
that when 'assembled' convert directly into the binary machine language on a
one to one basis.

Now EVERY compiled language, including  C, must be processed from its
syntactical representation into assembly language or machine code. In fact,
if you download the GCC complier source code and read it, you'll see  almost
immediately that it actually a 'language' front-end connected to a
'assembler machine code' back end.

When the 'C' language was designed at ATT it used 'assembler' like
constructs and syntax because it's author wanted
to stop writing programs in a language called BCPL..

So aside from a 'historical accident'  that the first ATT OS ..UNIX.. was
being written at the same time C was being developed, there is no other
reason for any program, including an OS, to be written in C. To suggest that
C is better is rather like suggesting that Spanish is a better language than
English for writing a novel.

That said, if someone wished to write a modern OS in FP, which has nearly
every programming construct that 'C' has (ints, doubles, floats, bytes, and
bits) and you were willing to put in the time to fine tune and modify the FP
compiler, you could produce a OS in FP that would be every bit as effective
and perform as well or better as one written in C.  And as far as the
processor running the OS couldn't tell what language the OS was written in.


If anyone wants to convince themselves on this its simple, you'll find
Ritchie (the creator of the C language) explained these points in the
preface to his first book on C. There is also a brief mention of this in the
Wikipedia article on the UNIX operating system. (see the article footnotes)

Prince


On Fri, Dec 5, 2008 at 6:59 PM, Guillermo Martínez Jiménez 
[EMAIL PROTECTED] wrote:

  Are you sure?

 Yes, I am.

  doesn't older MacOS's versions where written in Object Pascal?

 Yes, it does, but as I said I think it wasn't the better options.

  I think the problem here (again) is not the language, it's the critical
 mass of users of the language. Using C for Linux was a good bet, not because
 the language is good (Pascal is way better for me), but because C has a
 wider user base who can fix/add features.

 I disagree.  C is better for write operating systems *by definition*:
 C was created to write UNIX, Pascal was created to learn good
 programming techniques.  C is low/mid-level language, Pascal is
 high-level (and Object Pascal is even higher):  OS are the lowest
 software level.

 I'm not saying it's impossible:  here you have MacOS and Toro. I'm
 just saying that _I think_ it isn't the best option.  Of course a
 better option is to write the kernel in C and Assembler and the
 utilities in Pascal and Object Pascal.

 Guillermo Ñuño Martínez
 ___
 fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
 http://lists.freepascal.org/mailman/listinfo/fpc-pascal

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Re: Porting linux to pascal, would it be possible ?

2008-12-05 Thread Prince Riley
Here is a direct reference from the Wikipedia article I referenced in my
prior post ...

In 1973, Unix was rewritten in the C programming
languagehttp://en.wikipedia.org/wiki/C_%28programming_language%29,
contrary to the general notion at the time that something as complex as an
operating system, which must deal with time-critical events, had to be
written exclusively in assembly
language.[4]http://en.wikipedia.org/wiki/UNIX#cite_note-Stallings-3The
migration from assembly
language http://en.wikipedia.org/wiki/Assembly_Language to the higher-level
language http://en.wikipedia.org/wiki/High-level_programming_language C
resulted in much more
portablehttp://en.wikipedia.org/wiki/Software_quality#Portabilitysoftware,
requiring only a relatively small amount of machine-dependent code
to be replaced when porting Unix to other computing
platformshttp://en.wikipedia.org/wiki/Platform_%28computing%29
.

Prince


On Fri, Dec 5, 2008 at 7:57 PM, Prince Riley [EMAIL PROTECTED] wrote:

 Hello

 I don't mean to start a culture war here, but I think there is a bit of
 overstatement in this post that 'C' is somehow a better language for writing
 an OS in than say Pascal or OP or anything else.

 In point of fact, the only 'best' language for any processor is its own
 machine code which is always binary.
 And the first operating system software written was done so in the assembly
 language which is written to use mnemoics
 that when 'assembled' convert directly into the binary machine language on
 a one to one basis.

 Now EVERY compiled language, including  C, must be processed from its
 syntactical representation into assembly language or machine code. In fact,
 if you download the GCC complier source code and read it, you'll see  almost
 immediately that it actually a 'language' front-end connected to a
 'assembler machine code' back end.

 When the 'C' language was designed at ATT it used 'assembler' like
 constructs and syntax because it's author wanted
 to stop writing programs in a language called BCPL..

 So aside from a 'historical accident'  that the first ATT OS ..UNIX.. was
 being written at the same time C was being developed, there is no other
 reason for any program, including an OS, to be written in C. To suggest that
 C is better is rather like suggesting that Spanish is a better language than
 English for writing a novel.

 That said, if someone wished to write a modern OS in FP, which has nearly
 every programming construct that 'C' has (ints, doubles, floats, bytes, and
 bits) and you were willing to put in the time to fine tune and modify the FP
 compiler, you could produce a OS in FP that would be every bit as effective
 and perform as well or better as one written in C.  And as far as the
 processor running the OS couldn't tell what language the OS was written in.


 If anyone wants to convince themselves on this its simple, you'll find
 Ritchie (the creator of the C language) explained these points in the
 preface to his first book on C. There is also a brief mention of this in the
 Wikipedia article on the UNIX operating system. (see the article footnotes)

 Prince


 On Fri, Dec 5, 2008 at 6:59 PM, Guillermo Martínez Jiménez 
 [EMAIL PROTECTED] wrote:

  Are you sure?

 Yes, I am.

  doesn't older MacOS's versions where written in Object Pascal?

 Yes, it does, but as I said I think it wasn't the better options.

  I think the problem here (again) is not the language, it's the critical
 mass of users of the language. Using C for Linux was a good bet, not because
 the language is good (Pascal is way better for me), but because C has a
 wider user base who can fix/add features.

 I disagree.  C is better for write operating systems *by definition*:
 C was created to write UNIX, Pascal was created to learn good
 programming techniques.  C is low/mid-level language, Pascal is
 high-level (and Object Pascal is even higher):  OS are the lowest
 software level.

 I'm not saying it's impossible:  here you have MacOS and Toro. I'm
 just saying that _I think_ it isn't the best option.  Of course a
 better option is to write the kernel in C and Assembler and the
 utilities in Pascal and Object Pascal.

 Guillermo Ñuño Martínez
 ___
 fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
 http://lists.freepascal.org/mailman/listinfo/fpc-pascal



___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Re: Porting linux to pascal, would it be possible ?

2008-12-05 Thread Prince Riley
Link to the article about the ATT UNIX OS and C 


http://en.wikipedia.org/wiki/UNIX


On Fri, Dec 5, 2008 at 8:01 PM, Prince Riley [EMAIL PROTECTED] wrote:

 Here is a direct reference from the Wikipedia article I referenced in my
 prior post ...

 In 1973, Unix was rewritten in the C programming 
 languagehttp://en.wikipedia.org/wiki/C_%28programming_language%29,
 contrary to the general notion at the time that something as complex as an
 operating system, which must deal with time-critical events, had to be
 written exclusively in assembly 
 language.[4]http://en.wikipedia.org/wiki/UNIX#cite_note-Stallings-3The 
 migration from assembly
 language http://en.wikipedia.org/wiki/Assembly_Language to the higher-level
 language http://en.wikipedia.org/wiki/High-level_programming_language C
 resulted in much more 
 portablehttp://en.wikipedia.org/wiki/Software_quality#Portabilitysoftware, 
 requiring only a relatively small amount of machine-dependent code
 to be replaced when porting Unix to other computing 
 platformshttp://en.wikipedia.org/wiki/Platform_%28computing%29
 .

 Prince



 On Fri, Dec 5, 2008 at 7:57 PM, Prince Riley [EMAIL PROTECTED]wrote:

 Hello

 I don't mean to start a culture war here, but I think there is a bit of
 overstatement in this post that 'C' is somehow a better language for writing
 an OS in than say Pascal or OP or anything else.

 In point of fact, the only 'best' language for any processor is its own
 machine code which is always binary.
 And the first operating system software written was done so in the
 assembly language which is written to use mnemoics
 that when 'assembled' convert directly into the binary machine language on
 a one to one basis.

 Now EVERY compiled language, including  C, must be processed from its
 syntactical representation into assembly language or machine code. In fact,
 if you download the GCC complier source code and read it, you'll see  almost
 immediately that it actually a 'language' front-end connected to a
 'assembler machine code' back end.

 When the 'C' language was designed at ATT it used 'assembler' like
 constructs and syntax because it's author wanted
 to stop writing programs in a language called BCPL..

 So aside from a 'historical accident'  that the first ATT OS ..UNIX.. was
 being written at the same time C was being developed, there is no other
 reason for any program, including an OS, to be written in C. To suggest that
 C is better is rather like suggesting that Spanish is a better language than
 English for writing a novel.

 That said, if someone wished to write a modern OS in FP, which has nearly
 every programming construct that 'C' has (ints, doubles, floats, bytes, and
 bits) and you were willing to put in the time to fine tune and modify the FP
 compiler, you could produce a OS in FP that would be every bit as effective
 and perform as well or better as one written in C.  And as far as the
 processor running the OS couldn't tell what language the OS was written in.


 If anyone wants to convince themselves on this its simple, you'll find
 Ritchie (the creator of the C language) explained these points in the
 preface to his first book on C. There is also a brief mention of this in the
 Wikipedia article on the UNIX operating system. (see the article footnotes)

 Prince


 On Fri, Dec 5, 2008 at 6:59 PM, Guillermo Martínez Jiménez 
 [EMAIL PROTECTED] wrote:

  Are you sure?

 Yes, I am.

  doesn't older MacOS's versions where written in Object Pascal?

 Yes, it does, but as I said I think it wasn't the better options.

  I think the problem here (again) is not the language, it's the critical
 mass of users of the language. Using C for Linux was a good bet, not because
 the language is good (Pascal is way better for me), but because C has a
 wider user base who can fix/add features.

 I disagree.  C is better for write operating systems *by definition*:
 C was created to write UNIX, Pascal was created to learn good
 programming techniques.  C is low/mid-level language, Pascal is
 high-level (and Object Pascal is even higher):  OS are the lowest
 software level.

 I'm not saying it's impossible:  here you have MacOS and Toro. I'm
 just saying that _I think_ it isn't the best option.  Of course a
 better option is to write the kernel in C and Assembler and the
 utilities in Pascal and Object Pascal.

 Guillermo Ñuño Martínez
 ___
 fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
 http://lists.freepascal.org/mailman/listinfo/fpc-pascal




___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

[fpc-pascal] fstat usage

2008-12-05 Thread Francisco Reyes
Trying the fstat function and don't seem to be getting the right values for 
ctime, mtime and atime.


-- filedate.pp
uses BaseUnix,DateUtils,SysUtils;
var
 info : stat ;
begin
 if fpstat ('myfile.txt' , info) 0 then
   begin
 writeln ('Fstat failed . Errno : ' , fpgeterrno) ;
 halt ( 1 ) ;
   end ;
 writeln ;
 writeln ('atime  : ' , DateTimeToStr(info.st_atime ));
 writeln ('mtime  : ' , DateTimeToStr(info.st_mtime ));
 writeln ('ctime  : ' , DateTimeToStr(info.st_ctime ));
 writeln ('Now STR: ', DateTimeToStr(Now));
 writeln ('Mod diff:' , DaySpan(Now,info.st_mtime));
 writeln ('mtime raw: ', info.st_mtime );
 writeln (' Now  raw: ', Now);
end .

touch mfyle.txt
fpc filedate.pp
./filedate.pp
atime  : 6-9-88--
mtime  : 6-9-88--
ctime  : 6-9-88-- 
Now STR: 5-12-08 22:15:08

Mod diff: 1.22849351907281E+009
mtime raw: 1228533307
Now  raw:  3.97879271865278E+004

I was expecting atime, mtime and ctime to be very close to 'Now'.

The file date is December 5, 2008 as shown on the OS
ll myfile.txt
-rw-r--r-- 1 fran users 16 2008-12-05 22:15 myfile.txt

Any suggestions on what I am missing would be greatly 
appreciated.

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] GTK Pascal and Gnome applets

2008-12-05 Thread Andres Linares

Is it possible to write Gnome Applets using GTK on Pascal? Do somebody know 
about this?

_
Invite your mail contacts to join your friends list with Windows Live Spaces. 
It's easy!
http://spaces.live.com/spacesapi.aspx?wx_action=createwx_url=/friends.aspxmkt=en-us___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

[fpc-pascal] Re: Porting linux to pascal, would it be possible ?

2008-12-05 Thread Mehmet Erol Sanliturk


Dear All ,

In relation to programming language to be used to program
an operating sytem , the Burroughs Corporation is a very good
example .

( I am NOT saying that porting Linux to Free Pascal
is a good idea . There is MINIX3 , porting Free Pascal to MINIX3
could be a very good job .
For 'why' , please see ( http://www.minix3.org/ )
 ... Single-chip, small-RAM, low-power, $100 laptops  for
Third-World children ...
)


I worked on the Burroughs systems
( B3500 since 1974 ... later , B4700 , B6700 ) .


They designed the COBOL compiler , then the B2000 (?)
but I am sure that B3500 was in that form :

Burroughs mid-sized computers were at least 10 times faster
than equivalent other main-frames on data processing jobs
because COBOL statements were translated directly to machine code ,
i.e. , its machine codes were NOT like their contemporary main-frames .

(
http://en.wikipedia.org/wiki/Burroughs_B2000
 ... The architecture was built to support COBOL programming
in the most efficient way possible ...
)

Later , they designed their Algol-like language ESPOL ,
and then B5??? series . In the B6700 main-frame the machine language
was the ESPOL , i.e. , the computer was executing ESPOL
directly . During development of this series , design team did
not say to upper management that ... are designing a computer that
it will NOT have machine language ( assembler ) but a 'new machine' .
because acceptance of a design not having a machine language was very 
unlikely .


(
http://en.wikipedia.org/wiki/Burroughs_Corporation
http://en.wikipedia.org/wiki/Burroughs_large_systems
http://en.wikipedia.org/wiki/MCP_(Burroughs_Large_Systems)
http://en.wikipedia.org/wiki/ESPOL
http://bitsavers.org/pdf/burroughs/B6500_6700/594_B6700_ESPOL_Jun72.pdf
http://en.wikipedia.org/wiki/ALGOL_60
http://en.wikipedia.org/wiki/NEWP
)


Thank you very much ,

Mehmet Erol Sanliturk




___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Porting linux to pascal, would it be, possible ?

2008-12-05 Thread Graeme Geldenhuys
On Fri, Dec 5, 2008 at 3:19 PM, Skybuck Flying [EMAIL PROTECTED] wrote:
 If everybody does a little bit it could go quite quickly.

 Question is:

 Which linux distro ? ;)

Well, you said porting linux.  Linux to be only references the
Kernel only. That is the real OS part. All the other stuff like X11,
and 1000's of utilities and libraries are 3rd party stuff.  Having a
Linux system without a GUI is just as much a Linux system, as one with
a GUI.

So you first need to decide what you want to port?  The kernel only,
or a whole distro?  The latter is absurd, as it will take a lifetime
to complete, plus - what's the point?

As for a OS that can boot a computer, implement a basic filesystem and
copy/rename files is doable. I had friends that had to write such a
simple OS as a end-of-year project in there studies. I guess you can
take a peak at the Linux code to accomplish that, but again, what's
the point. Other that being able to say yes it can be done with Free
Pascal as well.  Maybe you have more free time available than I do.
:-)


Regards,
  - Graeme -


___
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Porting linux to pascal, would it be, possible ?

2008-12-05 Thread Graeme Geldenhuys
On Fri, Dec 5, 2008 at 5:55 PM, Felipe Monteiro de Carvalho
[EMAIL PROTECTED] wrote:
 If you want to do some large work to increase the use of FPC I would
 recommend creating a Window Manager instead, probably with fpgui.

How far did you guys get with the 'fpwm' project?  Did it actually run
at some point. I see the last code changes was 2 years ago.


Regards,
  - Graeme -


___
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Re: Porting linux to pascal, would it be possible ?

2008-12-05 Thread Graeme Geldenhuys
On Fri, Dec 5, 2008 at 1:24 PM, Guillermo Martínez Jiménez
[EMAIL PROTECTED] wrote:

 By the way, Linux is good as it is now and Pascal isn't the best
 option to create an operating system.

Other than Object Pascal not being as popular/mainstream as C... is
there any technical limitations in the language and the reason you say
it's not a good choice?


Regards,
  - Graeme -


___
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

[fpc-pascal] Re: Porting linux to pascal, would it be, possible ?

2008-12-05 Thread Ingemar Ragnemalm

 Guillermo Mart?nez Jim?nez  [EMAIL PROTECTED] wrote:


I disagree.  C is better for write operating systems *by definition*:
C was created to write UNIX, Pascal was created to learn good
programming techniques.  C is low/mid-level language, Pascal is
high-level (and Object Pascal is even higher):  OS are the lowest
software level.
  


This was true in the 70's. Then Pascal wasn't modular (C wasn't but 
hacked it in header files, and still does), it simply wasn't adapted for 
programming of that kind yet. And C was optimized for being similar to 
the machine code of the CPU's of the time. And it still is.


Today, the biggest difference between the languages are missing 
high-level features in C (which Pascal has had for decades), and that 
the syntax of C has a big range of obvious flaws. Neither of these make 
C a better language for anything.


The advantage to be able to mix operations on the same line, like the ++ 
operator, had importance for performance back then, before pipelining 
and caches. Today, it simply doesn't matter.


IMHO, C was simply the *first* language replacing assembly language on 
the OS level. And the first often gets chosen as standard, the only way.


Now, to return to the OS part: How could Linus Torvalds write the core 
of Linux in rather short time, single-handed, if it is such a huge task 
just to port it?


The window manager part is what I find really interesting. If Gnome is 
language-locked, there are two ways to change that: Either convince the 
Gnome team to open it up in our directions (just a matter of interfaces 
to them) or to make an FPC branch of Gnome (assuming that Gnome is under 
appropriate licenses), where appropriate parts are ported to FPC. I 
would call it Jedi Gnome, analogous to Jedi-SDL. Now, is there anyone 
more than me visualizing Yoda with a lightsabre as logotype? :-)



/Ingemar

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal