Re: [lazarus] Object pascal a Modern Language

2006-03-05 Thread Markku Niskanen
On Sun, 5 Mar 2006 03:50:47 -0300, Flávio Etrusco
[EMAIL PROTECTED] wrote:

I guess it's not so hugely useful or else someone would have
contributed it already. This is much more important in Java because
the String objects are constant/immutable and thus can't be

This is very true  I have never seen any performance problems with 
FPC. A StringTokenizer class could, however, be handy and it would 
not be very difficult to implement.

Markku
-- 
[EMAIL PROTECTED]

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] Object pascal a Modern Language

2006-03-05 Thread Michael Van Canneyt


On Sun, 5 Mar 2006, L505 wrote:

 
 
   for very large strings that
   constantly change via concatenations. Instead of reserving memory for the
   ansistring to whatever amount you request, the stringbuffer type would
 reserve
   extra memory for you in a specifyable increment (256K, 128K, 20K, whatever
 you
   choose). If the string has a concatenation on queue which is larger than 
   the
   increment size, then the stringbuffer allocates enough memory with overlap
   (several increments until it fills the need).
 
  I guess it's not so hugely useful or else someone would have
  contributed it already.
 
 Mmm... if that was the case I wouldn't be programming because everyone has
 already implemented what I'm trying to program :-)
 
 Seriously though - it would mean less calls to SetLength when doing big
 operations on strings. Ansistrings work fine when you are doing small random
 concatenations but when you do tons at once they are much slower and you must
 resort to the following:
 
 setlength(string, NewMaxValue);
 string[i]:= 'string I want to concatenate';
 
 instead of
 
 string:= string + 'string I want to concatenate';

If it helps, we could add a function to TStrings:

Function TStrings.Concatenate : String;

begin
end;

Which would optimize the whole matter into a single 'getmem' call ?
if there is interest, I can add it. It's 30 minutes of work.

Michael.

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] Object pascal a Modern Language

2006-03-05 Thread L505
   I guess it's not so hugely useful or else someone would have
   contributed it already.
 
  Mmm... if that was the case I wouldn't be programming because everyone has
  already implemented what I'm trying to program :-)
 
  Seriously though - it would mean less calls to SetLength when doing big
  operations on strings. Ansistrings work fine when you are doing small random
  concatenations but when you do tons at once they are much slower and you
must
  resort to the following:
 
  setlength(string, NewMaxValue);
  string[i]:= 'string I want to concatenate';
 
  instead of
 
  string:= string + 'string I want to concatenate';

 If it helps, we could add a function to TStrings:

 Function TStrings.Concatenate : String;

 begin
 end;

 Which would optimize the whole matter into a single 'getmem' call ?
 if there is interest, I can add it. It's 30 minutes of work.

 Michael.


But I mean if you are doing things at different times in the program:

for i := 1 to 1000
  DoSomestuff
  s:= string + string;
  DoOtherStuff
  s:= string + string;

in other words.. not one big concatenation at once such as:

string.concatenate(string1, string2, string3, string4);

The only way I saw it possible in my mind was through a special string buffer
type (or hey, even a stringbuffer class if not a true system type).

With TStrings.concatenate did you mean an all at once concatenation?

p.s. the reason I mention this was because I was just doing some work with my
friend Tony in pascal server pages for output buffering and we were doing some
benchmarks playing around with setlength calls

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] Object pascal a Modern Language

2006-03-05 Thread Michael Van Canneyt


On Sun, 5 Mar 2006, L505 wrote:

I guess it's not so hugely useful or else someone would have
contributed it already.
  
   Mmm... if that was the case I wouldn't be programming because everyone has
   already implemented what I'm trying to program :-)
  
   Seriously though - it would mean less calls to SetLength when doing big
   operations on strings. Ansistrings work fine when you are doing small 
   random
   concatenations but when you do tons at once they are much slower and you
 must
   resort to the following:
  
   setlength(string, NewMaxValue);
   string[i]:= 'string I want to concatenate';
  
   instead of
  
   string:= string + 'string I want to concatenate';
 
  If it helps, we could add a function to TStrings:
 
  Function TStrings.Concatenate : String;
 
  begin
  end;
 
  Which would optimize the whole matter into a single 'getmem' call ?
  if there is interest, I can add it. It's 30 minutes of work.
 
  Michael.
 

 But I mean if you are doing things at different times in the program:

 for i := 1 to 1000
   DoSomestuff
   s:= string + string;
   DoOtherStuff
   s:= string + string;

 in other words.. not one big concatenation at once such as:

 string.concatenate(string1, string2, string3, string4);

 The only way I saw it possible in my mind was through a special string buffer
 type (or hey, even a stringbuffer class if not a true system type).

 With TStrings.concatenate did you mean an all at once concatenation?

All strings in the list are concatenated in one step, regardless of
when they were added to the list:

Sl:=TStringList.Create;
for i := 1 to 1000 do
 begin
 DoSomestuff;
 SL.Add(SomeString);
 DoOtherStuff;
 SL.Add(SomeOtherString);
 end;
Result:=SL.Concatenate; // This can be optimized to 1 getmem call.

Michael.

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] Object pascal a Modern Language

2006-03-05 Thread L505

  But I mean if you are doing things at different times in the program:
 
  for i := 1 to 1000
DoSomestuff
s:= string + string;
DoOtherStuff
s:= string + string;
 
  in other words.. not one big concatenation at once such as:
 
  string.concatenate(string1, string2, string3, string4);
 
  The only way I saw it possible in my mind was through a special string
buffer
  type (or hey, even a stringbuffer class if not a true system type).
 
  With TStrings.concatenate did you mean an all at once concatenation?

 All strings in the list are concatenated in one step, regardless of
 when they were added to the list:

 Sl:=TStringList.Create;
 for i := 1 to 1000 do
  begin
  DoSomestuff;
  SL.Add(SomeString);
  DoOtherStuff;
  SL.Add(SomeOtherString);
  end;
 Result:=SL.Concatenate; // This can be optimized to 1 getmem call.

 Michael.


I suppose this is sort of like SetTextBuff for stringlist :)

And how about if you don't have any line delimiter? i.e. a string buffer with no
CRLF or LF.. does the TStrings type allow to disable the line delimiter?


_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] Object pascal a Modern Language

2006-03-05 Thread Michael Van Canneyt


On Sun, 5 Mar 2006, L505 wrote:

 
   But I mean if you are doing things at different times in the program:
  
   for i := 1 to 1000
 DoSomestuff
 s:= string + string;
 DoOtherStuff
 s:= string + string;
  
   in other words.. not one big concatenation at once such as:
  
   string.concatenate(string1, string2, string3, string4);
  
   The only way I saw it possible in my mind was through a special string
 buffer
   type (or hey, even a stringbuffer class if not a true system type).
  
   With TStrings.concatenate did you mean an all at once concatenation?
 
  All strings in the list are concatenated in one step, regardless of
  when they were added to the list:
 
  Sl:=TStringList.Create;
  for i := 1 to 1000 do
   begin
   DoSomestuff;
   SL.Add(SomeString);
   DoOtherStuff;
   SL.Add(SomeOtherString);
   end;
  Result:=SL.Concatenate; // This can be optimized to 1 getmem call.
 
  Michael.
 
 
 I suppose this is sort of like SetTextBuff for stringlist :)
 
 And how about if you don't have any line delimiter? i.e. a string buffer with 
 no
 CRLF or LF.. does the TStrings type allow to disable the line delimiter?

That would be the difference between 'Text' and 'Concatenate': 
Text adds CR/LF between the strings, 'Concatenate' would not.

Michael.

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] Object pascal a Modern Language

2006-03-05 Thread L505
   Sl:=TStringList.Create;
   for i := 1 to 1000 do
begin
DoSomestuff;
SL.Add(SomeString);
DoOtherStuff;
SL.Add(SomeOtherString);
end;
   Result:=SL.Concatenate; // This can be optimized to 1 getmem call.
  
   Michael.
 
 
  I suppose this is sort of like SetTextBuff for stringlist :)
 
  And how about if you don't have any line delimiter? i.e. a string buffer
with no
  CRLF or LF.. does the TStrings type allow to disable the line delimiter?

 That would be the difference between 'Text' and 'Concatenate':
 Text adds CR/LF between the strings, 'Concatenate' would not.

 Michael.


Oh! it has been a while since I looked into the Tstrings source code.. so you're
saying that a tstrings already *IS* buffered and all you would have to do is
implement concatenate function.. because buffering already exists.

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] Object pascal a Modern Language

2006-03-04 Thread Uwe Grauer
Matt Henley wrote:
 I belong to a mailing list for a defunt open source chemical process
 simulator (Sim42).  Members of the list are now showing interest in
 restarting the effort.  It was originally written in python which
 cause some speed issues.  Several of the list members (including me)
 suggested freepascal and lazarus.  The gentleman spearheading the
 effort sent the following and I would like to know what is the best
 way to respond.  I do not know what features define a modern
 language and would like to know what points to bring up.
 snip...

Matt,

python is a very nice language.
Why don't you just write the speed critical parts in C or C++.
That's how everyone does it in python.
There is no need to port to a language which needs 5-10 times the efford
in getting things out.

Just my opinion,
Uwe

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] Object pascal a Modern Language

2006-03-04 Thread Michael Van Canneyt


On Sat, 4 Mar 2006, Uwe Grauer wrote:

 Matt Henley wrote:
  I belong to a mailing list for a defunt open source chemical process
  simulator (Sim42).  Members of the list are now showing interest in
  restarting the effort.  It was originally written in python which
  cause some speed issues.  Several of the list members (including me)
  suggested freepascal and lazarus.  The gentleman spearheading the
  effort sent the following and I would like to know what is the best
  way to respond.  I do not know what features define a modern
  language and would like to know what points to bring up.
  snip...
 
 Matt,
 
 python is a very nice language.
 Why don't you just write the speed critical parts in C or C++.
 That's how everyone does it in python.

Showing only that python isn't up to the task. 
Just like all these other interpreted languages: .NET, Java... 

It's cheating, and they all do it: falling back to compiled
languaged. My message to the designers of these languages:
Quit fooling around, and do things right from the start.

Michael.

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] Object pascal a Modern Language

2006-03-04 Thread A.J. Venter

 
  python is a very nice language.
  Why don't you just write the speed critical parts in C or C++.
  That's how everyone does it in python.

 Showing only that python isn't up to the task.
 Just like all these other interpreted languages: .NET, Java...

 It's cheating, and they all do it: falling back to compiled
 languaged. My message to the designers of these languages:
 Quit fooling around, and do things right from the start.

This does bring up an interesting point, why is it that more and more 
languages are becoming interpreted or bytecompiled ? I mean, surely the 
python designers could have written platform level compilers for no more 
difficulty than to write bytecompilers ?
Heck they even got jython - compiling to the java vm so they must have had the 
option.

Instead it offers the choices of bytecompiled or scripted.
Why is source portability not enough ? Why sacrifice so much speed and power 
to get binary compatibility (or at least cheat so it looks like that) ?
Of course that is not the only power that gets lost, memory management, 
pointers - there is so much these approaches sacrifices, now I know their 
designers love to say things like if you need pointers you are doing it 
wrong but in my mind that is a cop-out to avoid dealing with the fact that 
they make it impossible for programmers to use a truly powerful construct 
that can do some pretty amazing things. 
The simple truth is that even java's pseudo implementations of things like 
hash tables to get around the fact that in other languages those are done 
with pointers aren't good - I have USED java's hash table interface, it's 
horrid !

As I told a SUN employee a few days ago I will stick with having a truly 
powerful source-portable fully object oriented language that doesn't practise 
bondage-and-discipline on style for as long as such languages exist - in 
short, I will use and promote lazarus - not java

As an aside, I remain adamant that anybody who writes a free software/open 
source program in Java is being foolish. What is the POINT of a free software 
program that REQUIRES a non-free program just to RUN ?

Ciao
A.J.
-- 
there's nothing as inspirational for a hacker as a cat obscuring a bug 
by sitting in front of the monitor - Boudewijn Rempt
A.J. Venter
Chief Software Architect
OpenLab International
www.getopenlab.com
www.silentcoder.co.za
+27 82 726 5103

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] Object pascal a Modern Language

2006-03-04 Thread Danny Milosavljevic
Hi,

Am Samstag, den 04.03.2006, 15:41 +0200 schrieb A.J. Venter:
  
   python is a very nice language.
   Why don't you just write the speed critical parts in C or C++.
   That's how everyone does it in python.
 
  Showing only that python isn't up to the task.

Actually showing that one should use the right tool for the job. i.e.
Expressive languages for the high level constructs and fast but horrid
languages (= assembly, more or less - that is what C is.) for the low
level constructs.

  Just like all these other interpreted languages: .NET, Java...

Halfway languages... Trying to get the best of both worlds. Very hard to
do but it will show if it's doable or not, so we don't have to try it
out to see :)

 
  It's cheating, and they all do it: falling back to compiled
  languaged. My message to the designers of these languages:
  Quit fooling around, and do things right from the start.
 
 This does bring up an interesting point, why is it that more and more 
 languages are becoming interpreted or bytecompiled ? I mean, surely the 
 python designers could have written platform level compilers for no more 
 difficulty than to write bytecompilers ?

No... afaik it isn't really a bytecompiler either... its mostly
interpreted, which brings them a flexibility unparallelled anywhere else
except in lisp (which, ironically, is compiled).

 Heck they even got jython - compiling to the java vm so they must have had 
 the 
 option.
 
 Instead it offers the choices of bytecompiled or scripted.
 Why is source portability not enough ? Why sacrifice so much speed 

more speed 

 and power 

less power. It's always like that. The language of a human (and maths)
is just so much more advanced than any computer language, it depresses
me at times. (Assembly language is so primitive that we all stopped
talking it by now, except when we absolutely must do it. But it sure is
flexible, like an atom - you can use tons of them to build a copy of
the earth, given you have a few billion years time and way too much
patience for your own good :))

 to get binary compatibility (or at least cheat so it looks like that) ?
 Of course that is not the only power that gets lost, memory management, 
 pointers - there is so much these approaches sacrifices, now I know their 
 designers love to say things like if you need pointers you are doing it 
 wrong 

No, if you need pointer _arithmetic_ you are doing it wrong or using a
language that is assembly in disguise. Pointers itself are fine and
dandy, but don't *(x + 3 * i + 2) = *(y - 3);. Would you talk like that
to a human? No? Why talk like that to a computer then? It's just a sign
that something in the language is broken when you need to do stuff like
that (except when writing a heap memory manager, I guess). But I mean
when you need to do it like all the time, like for arrays (hello C :)).
Also, by doing stuff like that you throw all bounds checking out of the
window, so you could as well write it in assembly and spare yourself the
hassle of using a compiler that brags all the time except where it
matters.

 but in my mind that is a cop-out to avoid dealing with the fact that 
 they make it impossible for programmers to use a truly powerful construct 
 that can do some pretty amazing things. 

Well, it really depends on what you are doing. I always found the
combination pascal  assembly great because pascal lets you do the
highlevel things nicely and safely (i.e. *checked*), and assembly lets
you do the dirty details, without any safety, like being able to shoot
yourself in the foot every two instructions or so :).

 The simple truth is that even java's pseudo implementations of things like 
 hash tables to get around the fact that in other languages those are done 
 with pointers aren't good - I have USED java's hash table interface, it's 
 horrid !

Hash Tables in no way need pointers to be visible. A hash table is so
easy a construct.. it's just a normal array. The index into the array is
the hash of the key (mod the size of array to prevent out-of-boundness).
The value in the array at that index is (key, value).  That's it!

(The only three weaknesses being 1) you need to find a hash algorithm
that doesn't suck _for your data_, 2) the processor cache hates you and
will get back at you one of those days :), and 3) resizing requires
rehashing usually)

Now there are examples for where you mostly do need pointers: trees and
lists.
The trend for lists goes more to a mixed dynamic array approach - that
is, lists of blocks of tons of entries - nowadays (like the inodes are,
for example), because the members are more adjacent and the cache likes
you more for that (harddisks as well, since they don't need to seek
around - it's even worse there).

Remaining use for pointers on client side: tree nodes. Not sure if
pointer arithmetic is useful there. Guess not. :)

 
 As I told a SUN employee a few days ago I will stick with having a truly 
 powerful source-portable fully object oriented 

Re: [lazarus] Object pascal a Modern Language

2006-03-04 Thread L505

 No, if you need pointer _arithmetic_ you are doing it wrong or using a
 language that is assembly in disguise. Pointers itself are fine and
 dandy, but don't *(x + 3 * i + 2) = *(y - 3);. Would you talk like that
 to a human? No? Why talk like that to a computer then? It's just a sign
 that something in the language is broken when you need to do stuff like
 that (except when writing a heap memory manager, I guess). But I mean
 when you need to do it like all the time, like for arrays (hello C :)).
 Also, by doing stuff like that you throw all bounds checking out of the
 window, so you could as well write it in assembly and spare yourself the
 hassle of using a compiler that brags all the time except where it
 matters.

I've decided that C is now officially the learning language for universities.
Students will now learn about all sorts of computer memory management in C, but
C will never be used for any practical purpose. It serves as the teaching
language of what language we should never use but teaches us a lot about the
memory in a computer. It also serves as a language which makes a programmer
feel happy I'm glad I learned C because it was 8 times harder just to create a
string, and now I'm ahead 8 times by not using C. If I wouldn't have learned C I
wouldn't have known I was 8 times ahead.

  As an aside, I remain adamant that anybody who writes a free software/open
  source program in Java is being foolish. What is the POINT of a free
software
  program that REQUIRES a non-free program just to RUN ?

 I've also wondered about that.. I mean there is gcj and mono and such,
 but... why not do something that is better but our own thing... I've
 looked at parrot for a vm but it's tailored for interpreted languages
 only. sigh.

It's the same as Delphi users doing the JEDI project and allowing borland to use
their code without Jedi getting paid. Borland is smiling and laughing all the
way to the bank while Jedi developers are smiling, but not laughing to the bank.

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] Object pascal a Modern Language

2006-03-04 Thread Dale Welch
Object Pascal is a long way from Wirth's pascal or even 
from turbo pascal.  People who say it is a backward language 
or dead language don't know object pascal, teach C++, and think 
pascal is algol.

The mass of interpreted languages out do indeed have
interesting features.  Very nice features.  But it does mean
without the speed of todays hard drives and computers you 
have serious problems.  And sometimes you still have 
problems.  That said You can write some wonderfully 
difficult to follow scripts in them.  They are also good as 
embedded scripting languages for your application.  
Notice it took MS a while but they finally opened up and made 
it where you could embed a number of scripting systems instead 
of only VB.

As i remember Java, i haven't looked at it in about 6 years, 
there were a number of features which just plain couldn't 
happen without an interperter.  
Many of the early compilers were p-code compilers which
then required an interperter, i think i had one on my first
ibm compatible when i booted under cpm.

But everyone always knew java was slow.  It wasn't meant
to be able to be your primary language for large projects.  
But as we now have computers 1000s of times faster than 
my first one, and tremendously faster than when java 
came out we are getting lazy.

I mean when people on a regular basis make arrays that
are larger than my early computers had in all of their memory or 
could even address.   Of course, one place i worked at used to
sell computers with 5 megabyte hard drives and tell people 
that's more than you'll ever need.  I had a difficult time with that
since i had a HUGE 10 megabytes of stuff on floppy disks.

---dale

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] Object pascal a Modern Language

2006-03-04 Thread A.J. Venter
 less power. It's always like that. The language of a human (and maths)
 is just so much more advanced than any computer language, it depresses
 me at times. (Assembly language is so primitive that we all stopped
 talking it by now, except when we absolutely must do it. But it sure is
 flexible, like an atom - you can use tons of them to build a copy of
 the earth, given you have a few billion years time and way too much
 patience for your own good :))

This is a nice argument but it's highly subjective, I find OP to be the 
computer language CLOSEST to human language, python and java both inherrited 
too much ascii art from C++ and don't get me STARTED on perl !

One of the things I love about OP (a compiled language) is that it uses mostly 
WORDS to say things, not symbols, true it's slightly more typing  - but it is 
so much more readable. 

I always tell my trainee's If I NEED comments to read your code - it is badly 
written. Of course I also make it absolutely clear that any program of more 
than 100 lines which doesn't have comments is pretty much guaranteed to 
ensure they won't get a permanent position with me, but comments should be 
there to add clarity NOT to tell you what the code DOES ! That should be 
obvious just from reading the code.

This isn't possible in most languages, in OP it's the default - that is why I 
think it's such a brilliantly designed language, and the fact is this is 
something Pascal has boasted since Wirth invented the first version of it. 

Pascal is probably the only language you can read (large sections of) aloud 
without stuttering. In other words, by your argument those languages have all 
failed at exactly the supposed REASON they are interpreted/bytecompiled in 
the first place. 

Like I said, it's way too subjective an argument. Now don't get me wrong, I 
actually rather like python, it has a nice design (although the whole 
whitespace has meaning thing annoys me a bit) and a fairly decent syntax but 
the simple reality is that I write code which will end up running on thin 
clients - that means if a computer slows down to any noticeable degree when 
running 50 copies of the program at once -it's not good enough, and that 
rules out python for anything complex. 
Lazarus works beautifully, I have the language that I like for most work, I 
can quickly design my GUI's in a RAD environment and the programs run FAST.

In the end, Java has spent ten years telling programmers that computers are 
now so fast that customers don't care about speed anymore, and in ten years 
computers still haven't gotten that fast and frankly they never will because 
as computers get faster customers will always expect software to get faster 
at the same rate (and customers being customers they will expect it to be 
just as fast on a PII). In the real world, a program that runs slowly and 
uses up a lot of resources annoys customers and they find another program. 

Throw in the realities of Africa, and you end up utilising things like thin 
clients so that those PII's or sometimes even 486's can run modern day apps. 
Of course they are never quite as fast as on a P4 but they look as fast to 
users which is good enough -at least for compiled programs which do not abuse 
all the available resources in the system but use only what they need leaving 
the rest for the other users.

In the end, the choice of a language is personal and not the least of your 
concerns should be what language does most of the people on this project 
know the best, but discounting OP because of what it wasn't in the 80's 
is ... well uninformed silliness.

A.J.
-- 
there's nothing as inspirational for a hacker as a cat obscuring a bug 
by sitting in front of the monitor - Boudewijn Rempt
A.J. Venter
Chief Software Architect
OpenLab International
www.getopenlab.com
www.silentcoder.co.za
+27 82 726 5103

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] Object pascal a Modern Language

2006-03-04 Thread Danny Milosavljevic
Hi,

Am Samstag, den 04.03.2006, 19:44 +0200 schrieb A.J. Venter:
  less power. It's always like that. The language of a human (and maths)
  is just so much more advanced than any computer language, it depresses
  me at times. (Assembly language is so primitive that we all stopped
  talking it by now, except when we absolutely must do it. But it sure is
  flexible, like an atom - you can use tons of them to build a copy of
  the earth, given you have a few billion years time and way too much
  patience for your own good :))
 

 This is a nice argument but it's highly subjective, I find OP to be the 
 computer language CLOSEST to human language, 

Exactly. I count Object Pascal to the best there are (speaking about
expressiveness / clarity), actually (along with ada, oberon, smalltalk).

 python and java both inherrited 
 too much ascii art from C++ 

java did, python not really.. most is pretty verbose and nice there...
have an example?

 and don't get me STARTED on perl !

eeek. well we all know the-language-we-dont-mention that is write-only,
bogged down with as many operators as there a special characters on the
keyboard and that has evolved to a real complex incomprehensible
monster.

 
 One of the things I love about OP (a compiled language) is that it uses 
 mostly 
 WORDS to say things, not symbols, true it's slightly more typing  - but it is 
 so much more readable. 

yes, especially for rare stuff. I mean + for addition is okay, but
what's up with  instead of and, I mean it saves one char, but
needs you to use the shift key now, so it saves 0 keys. And its cryptic.
What is that for? And if you absolutely must, use ^ damnit, like in
maths. Don't invent _another_ set of symbols for the same thing. And if
the exact symbols don't exist on the keyboard, that should tell you
something... like hey! those symbols are not used by anyone on a
computer

:)

 
 I always tell my trainee's If I NEED comments to read your code - it is 
 badly 
 written. Of course I also make it absolutely clear that any program of more 
 than 100 lines which doesn't have comments is pretty much guaranteed to 
 ensure they won't get a permanent position with me, but comments should be 
 there to add clarity NOT to tell you what the code DOES ! 

yes.

But I am at a phase now where even seeing design patterns strike me as
odd. The language should do them if they are so essential. Why can I see
them (and not really well either) in the source code? like observer
pattern. That should be a property-change-notify instead... and so on...

as a side note: what the hell is will all the people removing
enumerations (ex. TDirection = (East, South, West, North)) in later
languages? If I can't write a lexer in a language something has to be
really f*cked up with it. What are they thinking? (I'd really be
interested, strikes me as odd...)

 That should be 
 obvious just from reading the code.
 
 This isn't possible in most languages, in OP it's the default - that is why I 
 think it's such a brilliantly designed language, and the fact is this is 
 something Pascal has boasted since Wirth invented the first version of it. 
 
 Pascal is probably the only language you can read (large sections of) aloud 
 without stuttering. 

yes

 In other words, by your argument those languages have all 
 failed at exactly the supposed REASON they are interpreted/bytecompiled in 
 the first place. 

Mostly, yes. But it's also because the marketdroids only like stuff that
builds on proven stuff, which of course means
lowest-common-denominator, e.g. assembly or C. Changing slowly nowadays,
though. For the wrong reasons. But I don't care about the reasons as
long as the result is good in the end :)

 
 Like I said, it's way too subjective an argument. Now don't get me wrong, I 
 actually rather like python, it has a nice design (although the whole 
 whitespace has meaning thing annoys me a bit) and a fairly decent syntax but 
 the simple reality is that I write code which will end up running on thin 
 clients - that means if a computer slows down to any noticeable degree when 
 running 50 copies of the program at once -it's not good enough, and that 
 rules out python for anything complex. 

Yes, it should be compiled and type checking instead. Check out
http://boo.codehaus.org/ though. 
I am generally opposed to scripting languages, *but* even for compiled
languages garbage collection is the way to go, after having 40 years to
test it, I think by now we can get it right :)
(This is one of the major points object pascal doesn't have... it's not
surprising and it's not essential and there are reasons against it, but
manual memory management is just... so.. sigh... so manual; although
interface refcounting is nice too - slower though)

 Lazarus works beautifully, I have the language that I like for most work, I 
 can quickly design my GUI's in a RAD environment and the programs run FAST.
 
 In the end, Java has spent ten years telling programmers that computers are 

Re: [lazarus] Object pascal a Modern Language

2006-03-04 Thread Markku Niskanen
On Sat, 4 Mar 2006 08:41:53 -0800, Dale Welch [EMAIL PROTECTED] wrote:

But everyone always knew java was slow.  It wasn't meant
to be able to be your primary language for large projects.  

This is where I have do disagree, having used Java. Example: I wrote
a piece of linguistic software in Java. It needed an lot of HEAVY string
handling. Using the wrong technique in concatenation (Strings instead of
StringBuffer) I would have had problems. Using the language in a correct
manner (Strings where necessary and StrinbBuffer in everywhere else) I 
got all the functionality I needed and the performance was excellent. Using
just Strings is one of the common mistakes that causes low performance 
when lots of concatenations are done as every concatenation creates a
new object.

I want to point out that I also wrote a very exotic Replace function in
plain Java that I thought would NEVER be fast enough, knowing that I am
dealing with bytecode. To my surprise the code was faster than I could ever
have dreamed and could be run just like any native .exe. 

Three years later I wrote the same routines in PHP and used every
possible piece of optimization I could think of (and I know PHP very
well). I ended up with junk that used 40x CPU compared with the
Java one. And believe me, I did everything I could think of. Nope,
the PHP can only be used if I write the critical parts (~50% of the
application code  in C as a PHP extension. So there is a difference
between a bytecode/JIT-compiled and a sort-of-compiled language.

After that I thought of rewriting the same app in FPC but have not
yet had the time to start the project. What I noticed, however, was
that a lot of work should be done to achieve the same functionality
the Java String/Stringbuffer/Tokenizer classes have - we do not have
them in plain FPC. What I really miss is in FPC the multitude of good
classes, good functions that Java has. Tokenizer is a good example
of a effort-saving utility class that is very well written in Java.

Java is definitely NOT slow if written properly and used properly. At
least Java basic things (String handling, hash maps, loops etc) perform
very well compared with just about any language. With lots mathematics,
matrixes and things like that I know less about things may be different
though.

As for large projects anybody can have a look at Eclipse. In my latest
project it was chosen as the default environment and we never had any
performance problems with it... not to mention big sites with JSPs and
servlets and the J2EE abstraction level.

Markku
-- 
[EMAIL PROTECTED]

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] Object pascal a Modern Language

2006-03-04 Thread Flávio Etrusco
 Maybe a StringBuffer type is needed for pascal

Do you mean in pascal or for FreePascal? ;-)

 for very large strings that
 constantly change via concatenations. Instead of reserving memory for the
 ansistring to whatever amount you request, the stringbuffer type would reserve
 extra memory for you in a specifyable increment (256K, 128K, 20K, whatever you
 choose). If the string has a concatenation on queue which is larger than the
 increment size, then the stringbuffer allocates enough memory with overlap
 (several increments until it fills the need).

I guess it's not so hugely useful or else someone would have
contributed it already. This is much more important in Java because
the String objects are constant/immutable and thus can't be
reallocated.
But maybe a method in TStringList to return all the text without
adding linefeeds could be handy ;-)

Cheers,
Flávio

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] Object pascal a Modern Language

2006-03-03 Thread Felipe Monteiro de Carvalho
On 3/3/06, Matt Henley [EMAIL PROTECTED] wrote:
 My personal objective is not just to put out a simulator, but a fast
 and efficient simulator.  Furthermore, personally, I do not consider a
 program portable if it is written in a language which very few can
 understand.

Althought a lot less popular then c, c++ and java, pascal is still
reasonably popular, and is easy to learn.

Very important software like Skype is written on Object Pascal.

Mac OS 7 and below had a lot of Object Pascal code on them, and it's
API was written fully in pascal.

 A modern language such as any of the .NET languages will
 meet the efficiency objective but portability remains an issue.

This statement isn't true. .NET in general has performance much
inferior to native pascal.

Take a look at debian shootout comparison of Free Pascal and c#:

http://shootout.alioth.debian.org/debian/benchmark.php?test=alllang=fpascallang2=csharp

Free Pascal is more then 10 times faster and uses 10 times less
memory. Yes, benchmarks are all flawed, but a huge difference like
this can point at .NET performance flaws.

Also take a look at this article:

http://www.microsoft-watch.com/article2/0,1995,1820607,00.asp

Specially the part:

quoteEverything in Longhorn was supposed to be written in C# and to
be managed code. But managed code was going to require machines that
weren't going to be available for five years or more. So now Microsoft
is rewriting everything in Longhorn, the developer says. Developers
claim that the Windows team actually began rethinking Microsoft's .Net
Framework and managed code promises last summer, around the time of
the infamous Longhorn Reset. (The Longhorn Reset is shorthand for
Microsoft's decision to axe certain Longhorn features, most notably
WinFS, in order to be able to commit to a 2006 ship date.) end quote

  While
 I do have the Visual Studio .NET and I am happy with it, I understand
 that not everybody has it and it is not cheap.

I bet that the price of buying VS will be a much bigger blocker then
people needing to write pascal code. Pascal is considered easy to
learn, and still used a lot in basic programming courses.

 It will however, limit us to
 Pascal which is not really a modern language.  For those of you who
 are in favor of using Lazarus, can you assure the rest of us that
 Pascal has been modernized? 

When I talk to developers of other languages they all think Pascal is
that non-object oriented thing from early 1980s and that it did not
change  people need to know that Object Pascal is the real
industry used pascal.

One prove that Pascal is evolving still today is the talks on fpc
mailling lists about the inclusion of templates (generics).

--
Felipe Monteiro de Carvalho

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


[lazarus] Object pascal a Modern Language

2006-03-03 Thread Matt Henley
I belong to a mailing list for a defunt open source chemical process
simulator (Sim42).  Members of the list are now showing interest in
restarting the effort.  It was originally written in python which
cause some speed issues.  Several of the list members (including me)
suggested freepascal and lazarus.  The gentleman spearheading the
effort sent the following and I would like to know what is the best
way to respond.  I do not know what features define a modern
language and would like to know what points to bring up.

My personal objective is not just to put out a simulator, but a fast
and efficient simulator.  Furthermore, personally, I do not consider a
program portable if it is written in a language which very few can
understand.  A modern language such as any of the .NET languages will
meet the efficiency objective but portability remains an issue.  While
I do have the Visual Studio .NET and I am happy with it, I understand
that not everybody has it and it is not cheap.  I looked at the
Lazarus project and (at least at a first glance) it is indeed very
Visual and will likely do the job.  It will however, limit us to
Pascal which is not really a modern language.  For those of you who
are in favor of using Lazarus, can you assure the rest of us that
Pascal has been modernized? 

Thanks for any help
Matt Henley

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives