Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2009-09

Request for student project ideas

93 messages · 25 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Alexander Klenin

As some of you may already know, I teach programming in Far Eastern National University
and encourage students to participate in open source projects for their course works.
Among opensource projects I recommend are Free Pascal and Lazarus.

Last year one of my students already participated in FPC development with moderate success (see http://bugs.freepascal.org/view.php?id=13700).

This year, I expect 1-3 more students to choose Lazarus/FPC for their projects. So I request community for a suitable ideas -- projects should be reasonably self-contained, not too hard, require actual coding and be interesting enough to motivate students.
Students will work on projects they select from October 2009 to April 2010.

Alexander S. Klenin

Reply by email

Doug Chamberlin
to Alexander Klenin: As some of you may already know, I teach programming in Far Eastern National University…
Alexander Klenin wrote
So I request community for a suitable ideas -- projects should be reasonably self-contained, not too hard, require actual coding and be interesting enough to motivate students.

During the Embarcadero CodeRage sessions this week I took a look at the IOUtils unit introduced in Delphi 2010. I expect developers to start using it as they tart to use Delphi 2010 more and more. It would be a big advantage to have an FPC version of this unit.

I have no idea how other Delphi-compatible functionality was developed but I expect the right thing to do is obtain the interface for this unit and have the students re-implement the functionality using FPC.

Reply by email

Paul Ishenin
to Alexander Klenin: As some of you may already know, I teach programming in Far Eastern National University…
Alexander Klenin wrote
Last year one of my students already participated in FPC development with moderate success (see http://bugs.freepascal.org/view.php?id=13700).

This is a very good feature and it is so nice that it was done by a student with some directions by Florian and Jonas. I did not expect a positive result when you started.

Show quoted text 6 lines
This year, I expect 1-3 more students to choose Lazarus/FPC for their projects. So I request community for a suitable ideas -- projects should be reasonably self-contained, not too hard, require actual coding and be interesting enough to motivate students. Students will work on projects they select from October 2009 to April 2010.

I would ask to implement modern delphi language features like:
- anonymous methods
- for-in loop
- class constructors and destructors
- support for strict private and strict protected sections
- abstract and sealed classes
- class const, class var, class type, class property

Anyway, sooner or later delphi developers will use them more and more and there will be a need to port that code to fpc.

Best regards,
Paul Ishenin.

Reply by email

Marco van de Voort
to Doug Chamberlin: During the Embarcadero CodeRage sessions this week I took a look at the IOUtils unit…
Doug Chamberlin wrote 9 lines
Alexander Klenin wrote: > So I request community for a suitable ideas -- projects should be > reasonably self-contained, not too hard, require actual coding and > be interesting enough to motivate students. During the Embarcadero CodeRage sessions this week I took a look at the IOUtils unit introduced in Delphi 2010. I expect developers to start using it as they tart to use Delphi 2010 more and more. It would be a big advantage to have an FPC version of this unit.

That unit might require functionality that is not yet there, because Codegear does all new units in a static class style. (class var/const etc)

Reply by email

Michael Van Canneyt
to Paul Ishenin: This is a very good feature and it is so nice that it was done by a student with some…
Paul Ishenin wrote 24 lines
Alexander Klenin wrote: > Last year one of my students already participated in FPC development > with moderate success (see http://bugs.freepascal.org/view.php?id=13700). > This is a very good feature and it is so nice that it was done by a student with some directions by Florian and Jonas. I did not expect a positive result when you started. > This year, I expect 1-3 more students to choose Lazarus/FPC for their > projects. > So I request community for a suitable ideas -- projects should be > reasonably self-contained, not too hard, require actual coding and > be interesting enough to motivate students. > Students will work on projects they select from October 2009 to April 2010. > I would ask to implement modern delphi language features like: - anonymous methods - for-in loop - class constructors and destructors - support for strict private and strict protected sections - abstract and sealed classes - class const, class var, class type, class property Anyway, sooner or later delphi developers will use them more and more and there will be a need to port that code to fpc.

I second this.
- Class helpers come to mind.
- Attributes (the extended RTTI In D2010)
- Delayed keyword for lazy binding

Michael.

Reply by email

Paul Ishenin
to Michael Van Canneyt
Michael Van Canneyt wrote 30 lines
> Alexander Klenin wrote: >> Last year one of my students already participated in FPC development >> with moderate success (see >> http://bugs.freepascal.org/view.php?id=13700). >> > This is a very good feature and it is so nice that it was done by a > student with some directions by Florian and Jonas. I did not expect a > positive result when you started. >> This year, I expect 1-3 more students to choose Lazarus/FPC for >> their projects. >> So I request community for a suitable ideas -- projects should be >> reasonably self-contained, not too hard, require actual coding and >> be interesting enough to motivate students. >> Students will work on projects they select from October 2009 to >> April 2010. >> > I would ask to implement modern delphi language features like: > - anonymous methods > - for-in loop > - class constructors and destructors > - support for strict private and strict protected sections > - abstract and sealed classes > - class const, class var, class type, class property > > Anyway, sooner or later delphi developers will use them more and more > and there will be a need to port that code to fpc. I second this. - Class helpers come to mind. - Attributes (the extended RTTI In D2010) - Delayed keyword for lazy binding

There is an article at the embarcadero website:
http://edn.embarcadero.com/article/34324 but it covers only d2007 features.

Best regards,
Paul Ishenin.

Reply by email

Joost van der Sluis
to Marco van de Voort: That unit might require functionality that is not yet there, because Codegear does all…
Marco van de Voort wrote 12 lines
> During the Embarcadero CodeRage sessions this week I took a look at the > IOUtils unit introduced in Delphi 2010. I expect developers to start > using it as they tart to use Delphi 2010 more and more. It would be a > big advantage to have an FPC version of this unit. That unit might require functionality that is not yet there, because Codegear does all new units in a static class style. (class var/const etc)

Yes, I saw that during one of their D2010 launch-sessions. Any idea why they do this? Is it just a .Net-me-too?

Joost.

Reply by email

Marco van de Voort
to Joost van der Sluis
Joost van der Sluis wrote 6 lines
> That unit might require functionality that is not yet there, because > Codegear > does all new units in a static class style. (class var/const etc) Yes, I saw that during one of their D2010 launch-sessions. Any idea why they do this? Is it just a .Net-me-too?

Yes I think so. Pretty much with everything, same with the new RTTI modifier stuff in front of a declaration, instead after it. When I asked a question about that, they were even surprised I doubted it at all. (worse, it was Bob Swart!)

However due to the reaction of the audience (I went to a D2010 introduction by Barnsten yesterday), specially from the younger crowd, the public opinion seems to be this is absolutely great functionality.

Reply by email

Michael Van Canneyt
to Paul Ishenin: There is an article at the embarcadero website: http://edn.embarcadero.com/article/34324…
Paul Ishenin wrote 32 lines
Michael Van Canneyt wrote: >> Alexander Klenin wrote: >>> Last year one of my students already participated in FPC development >>> with moderate success (see http://bugs.freepascal.org/view.php?id=13700). >>> >> This is a very good feature and it is so nice that it was done by a >> student with some directions by Florian and Jonas. I did not expect a >> positive result when you started. >>> This year, I expect 1-3 more students to choose Lazarus/FPC for their >>> projects. >>> So I request community for a suitable ideas -- projects should be >>> reasonably self-contained, not too hard, require actual coding and >>> be interesting enough to motivate students. >>> Students will work on projects they select from October 2009 to April >>> 2010. >>> >> I would ask to implement modern delphi language features like: >> - anonymous methods >> - for-in loop >> - class constructors and destructors >> - support for strict private and strict protected sections >> - abstract and sealed classes >> - class const, class var, class type, class property >> >> Anyway, sooner or later delphi developers will use them more and more and >> there will be a need to port that code to fpc. > > I second this. - Class helpers come to mind. - Attributes (the extended > RTTI In D2010) > - Delayed keyword for lazy binding There is an article at the embarcadero website: http://edn.embarcadero.com/article/34324 but it covers only d2007 features.

The Wings Of Wind website has a good overview too.

Michael.

Reply by email

Michael Van Canneyt
to Marco van de Voort: Yes I think so. Pretty much with everything, same with the new RTTI modifier stuff in…
Marco van de Voort wrote 16 lines
On Sat, Sep 12, 2009 at 12:30:17PM +0200, Joost van der Sluis wrote: >> That unit might require functionality that is not yet there, because >> Codegear >> does all new units in a static class style. (class var/const etc) > > Yes, I saw that during one of their D2010 launch-sessions. Any idea why > they do this? Is it just a .Net-me-too? Yes I think so. Pretty much with everything, same with the new RTTI modifier stuff in front of a declaration, instead after it. When I asked a question about that, they were even surprised I doubted it at all. (worse, it was Bob Swart!) However due to the reaction of the audience (I went to a D2010 introduction by Barnsten yesterday), specially from the younger crowd, the public opinion seems to be this is absolutely great functionality.

I still haven't seen any practical use for the new RTTI modifier stuff. I made some comments on some websites, but everybody keeps nagging about the persistent storage uses. Which is a basically flawed use of the feature. No-one has provided an alternative use yet :(

Michael.

Reply by email

yu ping
to Alexander Klenin: As some of you may already know, I teach programming in Far Eastern National University…

I sugest you Pascal soure code analizer and build a pascal class builder.

2009/9/12 Alexander Klenin :

Show quoted text 15 lines
This year, I expect 1-3 more students to choose Lazarus/FPC for their projects. So I request community for a suitable ideas -- projects should be reasonably self-contained, not too hard, require actual coding and be interesting enough to motivate students. Students will work on projects they select from October 2009 to April 2010. -- Alexander S. Klenin -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Paul Ishenin
to Alexander Klenin: As some of you may already know, I teach programming in Far Eastern National University…
Alexander Klenin wrote 6 lines
This year, I expect 1-3 more students to choose Lazarus/FPC for their projects. So I request community for a suitable ideas -- projects should be reasonably self-contained, not too hard, require actual coding and be interesting enough to motivate students. Students will work on projects they select from October 2009 to April 2010.

Another thing which is not that difficult to implement but can be very useful is a resource compiler (a tool which make res files from rc).

Best regards,
Paul Ishenin.

Reply by email

yu ping
to Mattias Gaertner

a GUI program for generate an modify Pascal Class codes. can generate property,methods and event handling functions. like ClassBuilder for C++(http://sourceforge.net/projects/classbuilder) for Delphi there is a program called "OPEdit",but there is no newer version on the net,and it's a shareware.

2009/9/12 Mattias Gaertner :

Show quoted text 14 lines
On Sat, 12 Sep 2009 23:30:13 +0800 yu ping wrote: What do you mean with "a pascal class builder"? Mattias -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Michael Van Canneyt
to Marco van de Voort
Marco van de Voort wrote 5 lines
On Sat, Sep 12, 2009 at 01:33:36PM +0200, Michael Van Canneyt wrote: > I still haven't seen any practical use for the new RTTI modifier stuff. Tag fields for endian correction in the header, and use a generic record endianess correction routine?

Also a definite possibility, but again very minor in it's application...

Michael.

Reply by email

Thierry Coq
to Alexander Klenin: As some of you may already know, I teach programming in Far Eastern National University…
Alexander Klenin wrote 16 lines
As some of you may already know, I teach programming in Far Eastern National University and encourage students to participate in open source projects for their course works. Among opensource projects I recommend are Free Pascal and Lazarus. Last year one of my students already participated in FPC development with moderate success (see http://bugs.freepascal.org/view.php?id=13700). This year, I expect 1-3 more students to choose Lazarus/FPC for their projects. So I request community for a suitable ideas -- projects should be reasonably self-contained, not too hard, require actual coding and be interesting enough to motivate students. Students will work on projects they select from October 2009 to April 2010.

Another thing possible is to implement the package mechanism.

Most of the basic stuff is already in the compiler (dynamic libraries, RTTI, etc), but there is a need to bring that together in something easily usable (maybe add a XML-based manifest in the package, add some code to check compiler compatibilities, etc). Demos can be provided and I can provide support to one or several students on how to achieve. Of course, the FPC and Lazarus team needs to tell us how they want to integrate the feature. We can also breakdown the work so that it is achieved over a couple of years..

Best regards,
Thierry

Reply by email

Alexander Klenin
to Paul Ishenin: This is a very good feature and it is so nice that it was done by a student with some…
Paul Ishenin wrote 12 lines
Alexander Klenin wrote: I would ask to implement modern delphi language features like: - anonymous methods - for-in loop - class constructors and destructors - support for strict private and strict protected sections - abstract and sealed classes - class const, class var, class type, class property Anyway, sooner or later delphi developers will use them more and more and there will be a need to port that code to fpc.

These are obvious candidates for me too, but although they are good projects, they are rather hard -- for advanced students only. I certainly hope to get at least one such student.

But I am also interested in a simpler ideas,
perhaps for Lazarus instead of FPC.

Generally form the replies I get the impression that the need for FPC is much more acute than for Lazarus ones ;-)

Alexander S. Klenin

Reply by email

Alexander Klenin
to Doug Chamberlin: During the Embarcadero CodeRage sessions this week I took a look at the IOUtils unit…
Doug Chamberlin wrote 14 lines
Alexander Klenin wrote: > > So I request community for a suitable ideas -- projects should be > reasonably self-contained, not too hard, require actual coding and > be interesting enough to motivate students. During the Embarcadero CodeRage sessions this week I took a look at the IOUtils unit introduced in Delphi 2010. I expect developers to start using it as they tart to use Delphi 2010 more and more. It would be a big advantage to have an FPC version of this unit. I have no idea how other Delphi-compatible functionality was developed but I expect the right thing to do is obtain the interface for this unit and have the students re-implement the functionality using FPC.

This is good idea, but unfortunately, there is not a chance to start before the release for Delphi 2010. Also, I can not expect students to obey strict clean room procedures required for such reimplementation.

Alexander S. Klenin

Reply by email

Alexander Klenin
to Michael Van Canneyt: I still haven't seen any practical use for the new RTTI modifier stuff. I made some…
Michael Van Canneyt wrote 16 lines
On Sat, 12 Sep 2009, Marco van de Voort wrote: > On Sat, Sep 12, 2009 at 12:30:17PM +0200, Joost van der Sluis wrote: >>> >>> That unit might require functionality that is not yet there, because >>> Codegear >>> does all new units in a static class style. (class var/const etc) >> >> Yes, I saw that during one of their D2010 launch-sessions. Any idea why >> they do this? Is it just a .Net-me-too? > > Yes I think so. Pretty much with everything, same with the new RTTI > modifier > stuff in front of a declaration, instead after it. When I asked a question > about that, they were even surprised I doubted it at all. (worse, it was > Bob Swart!)

I agree that syntax is awkward, but I am afraid compatibility is more important than better syntax.
OTOH, attribute-first syntax gives a way to implement grouping by attribute, something like:

type T = class
public
   ...
   procedure A;
   procedure B;
   begin [deprecated]
     procedure A_old;
     procedure B_old;
   end;
end;
Show quoted text 8 lines
> However due to the reaction of the audience (I went to a D2010 > introduction > by Barnsten yesterday), specially from the younger crowd, the public > opinion seems to be this is absolutely great functionality. I still haven't seen any practical use for the new RTTI modifier stuff. I made some comments on some websites, but everybody keeps nagging about the persistent storage uses. Which is a basically flawed use of the feature.

What is flawed with it? I think this is indeed great for building persistence frameworks.

No-one has provided an alternative use yet :(

Oh, there are many use cases, here are just a few:
- web frameworks (attributes like "handler", "ajax_handler" etc.) -- see any Ruby or Perl framework for detailed usage.
- scripting (attribute "scriptable" for methods callcble from scripts)
- VCL/IDE itself (e.g. attribute "hide_from_OI" for published properties you do not want to display in Object Inspector)
- basically, anything requiring class registration now, including the need to register
components to stream forms.

The latter point will require some kind of built-in global classes registry, which I am not sure will be in D2010, but this is a good feature anyway.

Alexander S. Klenin

Reply by email

Paul Ishenin
to Alexander Klenin: These are obvious candidates for me too, but although they are good projects, they are…
Alexander Klenin wrote 22 lines
> I would ask to implement modern delphi language features like: > - anonymous methods > - for-in loop > - class constructors and destructors > - support for strict private and strict protected sections > - abstract and sealed classes > - class const, class var, class type, class property > > Anyway, sooner or later delphi developers will use them more and more and > there will be a need to port that code to fpc. > These are obvious candidates for me too, but although they are good projects, they are rather hard -- for advanced students only. I certainly hope to get at least one such student. But I am also interested in a simpler ideas, perhaps for Lazarus instead of FPC. Generally form the replies I get the impression that the need for FPC is much more acute than for Lazarus ones ;-)

One thing to implement which is needed and easy at the same time is support for turning paticular warnings and hints on/off in the code:

{$WARN identifier ON} / {$WARN identifier OFF} where identifier can be: SYMBOL_PLATFORM, SYMBOL_DEPRECATED, UNIT_DEPRECATED, UNIT_PLATFORM, UNSAFE_CODE OFF, UNSAFE_TYPE OFF, UNSAFE_CAST OFF, IMPLICIT_STRING_CAST, ...

I suggest to allow also ON/OFF by warning message ID. For example {$WARN 5033 OFF} will turn off message "Function result does not seem to be set".

Same to do with hints {$HINT message_id ON}/{$HINT message_id OFF} although delphi does not support this.

Why it is easy:
1. fpc understand {$WARN} syntax while it currently do nothing
2. fpc allow to turn off warnings and messages by ID

Therefore your student will just need to complete already existed code.

Best regards,
Paul Ishenin.

Reply by email

Hans-Peter Diettrich
to Alexander Klenin: These are obvious candidates for me too, but although they are good projects, they are…
Show quoted text 13 lines
> I would ask to implement modern delphi language features like: > - anonymous methods > - for-in loop > - class constructors and destructors > - support for strict private and strict protected sections > - abstract and sealed classes > - class const, class var, class type, class property > > Anyway, sooner or later delphi developers will use them more and more and > there will be a need to port that code to fpc. These are obvious candidates for me too, but although they are good projects, they are rather hard -- for advanced students only.

ACK, all these tasks required deep insight into the existing compiler code and data structures :-(

Perhaps a somewhat simpler goal: add the new Attributes syntax to the parser, and check for possible implementations. I don't understand the hype and problems with these new attributes - is it really more than adding an Attributes:TStrings property to TObject?

And another one: an Oberon front-end for FPC! {$mode OBERON} The language should be close enough to Pascal, so that the implementation of the parser should not be a big deal. More difficult: the interface to the existing compiler.
There is much room for sub-projects, like garbage collection.

The same for other languages (Java, C...). Wouldn't it be nice to have a C front-end or {$MODE C} for opening the world of existing C code (at least: header files) to FPC? See my ToPas project on SourceForge, that implements an preprocessor and parser for C, written in Delphi OPL - it could be extended by an interface to the FPC compiler.

DoDi

Reply by email

Hans-Peter Diettrich
to Paul Ishenin: One thing to implement which is needed and easy at the same time is support for turning…
Show quoted text 20 lines
One thing to implement which is needed and easy at the same time is support for turning paticular warnings and hints on/off in the code: {$WARN identifier ON} / {$WARN identifier OFF} where identifier can be: SYMBOL_PLATFORM, SYMBOL_DEPRECATED, UNIT_DEPRECATED, UNIT_PLATFORM, UNSAFE_CODE OFF, UNSAFE_TYPE OFF, UNSAFE_CAST OFF, IMPLICIT_STRING_CAST, ... I suggest to allow also ON/OFF by warning message ID. For example {$WARN 5033 OFF} will turn off message "Function result does not seem to be set". Same to do with hints {$HINT message_id ON}/{$HINT message_id OFF} although delphi does not support this. Why it is easy: 1. fpc understand {$WARN} syntax while it currently do nothing 2. fpc allow to turn off warnings and messages by ID Therefore your student will just need to complete already existed code.

Why not replace all the compiler directives, which are unknown to the Delphi compiler, by a common different format, like {#PRAGMA WARN...}, and implement a general Pragma subsystem, where the FPC people could add the functionality later, if this part is too time consuming for a student project?

DoDi

Reply by email

Marco van de Voort
to Alexander Klenin: On Sat, Sep 12, 2009 at 22:33, Michael Van I agree that syntax is awkward, but I am…
Alexander Klenin wrote 6 lines
>> stuff in front of a declaration, instead after it. When I asked a question >> about that, they were even surprised I doubted it at all. (worse, it was >> Bob Swart!) I agree that syntax is awkward, but I am afraid compatibility is more important than better syntax.

This is simularity not compatibility. And no, I don't agree. Orthogonality is an important concept.

Show quoted text 13 lines
OTOH, attribute-first syntax gives a way to implement grouping by attribute, something like: type T = class public ... procedure A; procedure B; begin [deprecated] procedure A_old; procedure B_old; end; end;

Which is so different from

begin
   procedure A_Old;
  procedure B_OLD;
end[deprecated];

A syntax concept that has already been used btw (though for assembler procedures)

> persistent storage uses. Which is a basically flawed use of the feature. What is flawed with it? I think this is indeed great for building persistence frameworks.

Not the primary one.

> No-one has provided an alternative use yet :( Oh, there are many use cases, here are just a few: - web frameworks (attributes like "handler", "ajax_handler" etc.) -- see any Ruby or Perl framework for detailed usage.

I'm sorry. Could you explain this? I know what a handler is, and handlers are already RTTId.

- scripting (attribute "scriptable" for methods callcble from scripts)

To do exactly what? You could use it maybe to avoid heaps of registrating methods with the interpreter, but not more.

- VCL/IDE itself (e.g. attribute "hide_from_OI" for published properties you do not want to display in Object Inspector)

That's more the stuff I imagine. Make annotations so you can easily make exceptions, e.g. due to legacy or versioning concerns.

- basically, anything requiring class registration now, including the need to register components to stream forms.

You still need to register the components. It must know what to iterate for RTTI.

The latter point will require some kind o?f built-in global classes registry, which I am not sure will be in D2010, but this is a good feature anyway.

They did say something about being able to RTTI down from a global level. So it could be that yes.

However it is great for demoes and mails, but applying this succesfully in a major framework that stands the test of time might be hard.

I think it is great for the smaller persistance work (forms, config files etc), but would like to keep it away from the mission critical stuff for general databinding.

Reply by email

Thierry Coq
to Hans-Peter Diettrich: ACK, all these tasks required deep insight into the existing compiler code and data…

This idea about an Oberon front-end is <very> interesting. I second that idea!

Thierry

Hans-Peter Diettrich wrote 48 lines
Alexander Klenin schrieb: >> I would ask to implement modern delphi language features like: >> - anonymous methods >> - for-in loop >> - class constructors and destructors >> - support for strict private and strict protected sections >> - abstract and sealed classes >> - class const, class var, class type, class property >> >> Anyway, sooner or later delphi developers will use them more and >> more and >> there will be a need to port that code to fpc. > > These are obvious candidates for me too, but although they are good > projects, > they are rather hard -- for advanced students only. ACK, all these tasks required deep insight into the existing compiler code and data structures :-( Perhaps a somewhat simpler goal: add the new Attributes syntax to the parser, and check for possible implementations. I don't understand the hype and problems with these new attributes - is it really more than adding an Attributes:TStrings property to TObject? And another one: an Oberon front-end for FPC! {$mode OBERON} The language should be close enough to Pascal, so that the implementation of the parser should not be a big deal. More difficult: the interface to the existing compiler. There is much room for sub-projects, like garbage collection. The same for other languages (Java, C...). Wouldn't it be nice to have a C front-end or {$MODE C} for opening the world of existing C code (at least: header files) to FPC? See my ToPas project on SourceForge, that implements an preprocessor and parser for C, written in Delphi OPL - it could be extended by an interface to the FPC compiler. DoDi -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Florian Klaempfl
to Paul Ishenin: One thing to implement which is needed and easy at the same time is support for turning…
Show quoted text 15 lines
{$WARN identifier ON} / {$WARN identifier OFF} where identifier can be: SYMBOL_PLATFORM, SYMBOL_DEPRECATED, UNIT_DEPRECATED, UNIT_PLATFORM, UNSAFE_CODE OFF, UNSAFE_TYPE OFF, UNSAFE_CAST OFF, IMPLICIT_STRING_CAST, ... I suggest to allow also ON/OFF by warning message ID. For example {$WARN 5033 OFF} will turn off message "Function result does not seem to be set". Same to do with hints {$HINT message_id ON}/{$HINT message_id OFF} although delphi does not support this. Why it is easy: 1. fpc understand {$WARN} syntax while it currently do nothing 2. fpc allow to turn off warnings and messages by ID

Why it's not easy (else it would have been implemented):
- it requires a memory efficient tracking of the state of these switches for every location in the source. Due to the modularized and decoupled compilation process of FPC this is not as simple as it might look.

Reply by email

Graeme Geldenhuys
to Florian Klaempfl

2009/9/13 Florian Klaempfl :

Show quoted text 5 lines
Paul Ishenin schrieb: > - for-in loop This might be as easy as the case of string though it requires probably more code.

I would rather opt for Iterator support in all standard collection classes. Something like what Java does. I have written and wrote an article on this and designed iterators for most standard collection classes in Object Pascal, but it would be much nicer if they came standard with all those collection classes.

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

Florian Klaempfl
to Graeme Geldenhuys
Show quoted text 11 lines
2009/9/13 Florian Klaempfl : > Paul Ishenin schrieb: >> - for-in loop > This might be as easy as the case of string though it requires probably > more code. I would rather opt for Iterator support in all standard collection classes. Something like what Java does. I have written and wrote an article on this and designed iterators for most standard collection classes in Object Pascal, but it would be much nicer if they came standard with all those collection classes.

Yes, my speech. But this is probably harder for a student.

Reply by email

Michael Van Canneyt
to Florian Klaempfl: The problem of header files are macros. No more, no less. Supporting them makes pascal as…
Florian Klaempfl wrote 7 lines
Hans-Peter Diettrich schrieb: > The same for other languages (Java, C...). Wouldn't it be nice to have a > C front-end or {$MODE C} for opening the world of existing C code (at > least: header files) to FPC? The problem of header files are macros. No more, no less. Supporting them makes pascal as unreadable as C is.

They are a definite no-no. They go against everything that Pascal stands for.

Michael.

Reply by email

Paul Ishenin
to Florian Klaempfl: Why it's not easy (else it would have been implemented): - it requires a memory efficient…
Florian Klaempfl wrote 24 lines
Paul Ishenin schrieb: > {$WARN identifier ON} / {$WARN identifier OFF} where identifier can be: > SYMBOL_PLATFORM, SYMBOL_DEPRECATED, UNIT_DEPRECATED, UNIT_PLATFORM, > UNSAFE_CODE OFF, UNSAFE_TYPE OFF, UNSAFE_CAST OFF, IMPLICIT_STRING_CAST, > ... > > I suggest to allow also ON/OFF by warning message ID. For example > {$WARN 5033 OFF} will turn off message "Function result does not seem to > be set". > > Same to do with hints {$HINT message_id ON}/{$HINT message_id OFF} > although delphi does not support this. > > Why it is easy: > 1. fpc understand {$WARN} syntax while it currently do nothing > 2. fpc allow to turn off warnings and messages by ID > Why it's not easy (else it would have been implemented): - it requires a memory efficient tracking of the state of these switches for every location in the source. Due to the modularized and decoupled compilation process of FPC this is not as simple as it might look.

Well, fpc already track {$WARNINGS OFF}/{$WARNINGS ON}, {$HINTS OFF}/{$HINTS ON} switches for every location in the source. I suppose tracking paticular warning/hint can be done in a similar way.

Best regards,
Paul Ishenin.

Reply by email

Graeme Geldenhuys
to Florian Klaempfl: Yes, my speech. But this is probably harder for a student.

2009/9/13 Florian Klaempfl :

Yes, my speech. But this is probably harder for a student.

In that case, I should merge my iterators with the collection classes and start submitting patches, so they can be included in FPC directly. I'll post one small patch for one class for review -- before I do them all.

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

Graeme Geldenhuys
to Alexander Klenin: As some of you may already know, I teach programming in Far Eastern National University…

2009/9/12 Alexander Klenin :

So I request community for a suitable ideas -- projects should be reasonably self-contained, not too hard, require actual coding and

Seeing that we are list our wishlists... :-)

* Full support for "implements" interface delegation in classes.

* Complete Semaphore support via a TSemaphore class -- like was done for TCriticalSection.

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

Jürgen Hestermann
to Bernd Kreuss: This would be an exceptionally cool thing, and I'm sure it would attract much attention…
Hans-Peter Diettrich wrote: > And another one: an Oberon front-end for FPC! {$mode OBERON} This would be an exceptionally cool thing, and I'm sure it would attract much attention in wider circles!

Are you sure this would be possible?
Then all other languages coud be added too: ;-)

{$mode PERL}
{$mode ALGOL}
{$mode Cplusplus}
{$mode Csharp}
{$mode dotNET}
{$mode COBOL}
{$mode BASIC}
{$mode LISP}
{$mode EIFFEL}
{$mode HASKELL}
{$mode JAVA}
{$mode PYTHON}
{$mode LOGO}
{$mode BRAINFUCK}
{$mode C}
{$mode WHITESPACE}
{$mode ZONNON}
{$mode ...}

Reply by email

Hans-Peter Diettrich
to Florian Klaempfl: The problem of header files are macros. No more, no less. Supporting them makes pascal as…
Show quoted text 6 lines
> The same for other languages (Java, C...). Wouldn't it be nice to have a > C front-end or {$MODE C} for opening the world of existing C code (at > least: header files) to FPC? The problem of header files are macros. No more, no less. Supporting them makes pascal as unreadable as C is.

How does a C front-end affect the Pascal front-end?

DoDi

Reply by email

Florian Klaempfl
to Hans-Peter Diettrich
Show quoted text 10 lines
Florian Klaempfl schrieb: >> The same for other languages (Java, C...). Wouldn't it be nice to have a >> C front-end or {$MODE C} for opening the world of existing C code (at >> least: header files) to FPC? > > The problem of header files are macros. No more, no less. Supporting > them makes pascal as unreadable as C is. How does a C front-end affect the Pascal front-end?

If it doesn't affect it, it has no use or what would you do with macros in headers? If they aren't supported in the pascal front end, it makes no sense to read them with a C frontend.

Reply by email

Hans-Peter Diettrich
to Florian Klaempfl
Show quoted text 5 lines
> How does a C front-end affect the Pascal front-end? If it doesn't affect it, it has no use or what would you do with macros in headers? If they aren't supported in the pascal front end, it makes no sense to read them with a C frontend.

[ ] You understand what's a preprocessor

DoDi

Reply by email

Paulo Costa
to Alexander Klenin: As some of you may already know, I teach programming in Far Eastern National University…

An interesting idea, but probably too hard for a student project, would be the capability of using a C library without having to manually create the pas file that translates the c header. That is tedious, error prone and a mess when the .h changes and we continue to use the wrong .pas and strange error creep in.
Also there are a lot of C libraries that are not available to fpc because nobody had the time to create the bindings. I know that there is h2pas but it is a off line tool and needs a lot of help from the programmer.

A better way could be to hack a C compiler (GCC ?) and use only the parser and the first compilation stage to have the symbols related to the available functions and structures and create the pas header from that information. With such tool we could have almost automatic use of any c library...

Of course, hacking an existing C compiler is not a mostly welcome prospect for those who like fpc/Lazarus :)

Paulo Costa

Reply by email

Hans-Peter Diettrich
to Paulo Costa
An interesting idea, but probably too hard for a student project, would be the capability of using a C library without having to manually create the pas file that translates the c header.

This is what ToPas can already do. But...

That is tedious, error prone and a mess when the .h changes and we continue to use the wrong .pas and strange error creep in.

Right, the translator needs exactly the header files as used to create the library.

I'm aware of possible changes in C libraries and header files, and that's why now I suggest an Pascal compiler with the added ability to process C files. Then that compiler would both compile a changed library, and create an Pascal interface unit at the same time. This is exactly what the CBuilder does for Delphi.

A transformation of C files into Pascal units, as ToPas can do (to some degree), IMO is only a provisional solution. When manual intervention is required in this step, it will be required for every following bugfix or improvement to the C code.

Show quoted text 8 lines
Also there are a lot of C libraries that are not available to fpc because nobody had the time to create the bindings. I know that there is h2pas but it is a off line tool and needs a lot of help from the programmer. A better way could be to hack a C compiler (GCC ?) and use only the parser and the first compilation stage to have the symbols related to the available functions and structures

This part of ToPas is already finished :-)

and create the pas header from that information. With such tool we could have almost automatic use of any c library...

The hardest problem I found in ToPas is an automated handling of the #defines. They should be classified into literal constants, functions, macros, and (incomplete) code snippets - where code snippets IMO are of no use in a Pascal unit. Such classification could be done easily by an LR parser, but an LL parser only can deal with complete source files.

DoDi

Reply by email

Paulo Costa
to Hans-Peter Diettrich
Hans-Peter Diettrich wrote 5 lines
A transformation of C files into Pascal units, as ToPas can do (to some degree), IMO is only a provisional solution. When manual intervention is required in this step, it will be required for every following bugfix or improvement to the C code.

Yes. That's the main problem with an off-line tool :( Whatever the mechanism used it must work without manual intervention.

Show quoted text 5 lines
> A better way could be to hack a C compiler (GCC ?) and use only the > parser and the first compilation stage to have the symbols related to > the available functions and structures This part of ToPas is already finished :-)

That's nice.

Show quoted text 5 lines
The hardest problem I found in ToPas is an automated handling of the #defines. They should be classified into literal constants, functions, macros, and (incomplete) code snippets - where code snippets IMO are of no use in a Pascal unit. Such classification could be done easily by an LR parser, but an LL parser only can deal with complete source files.

Yes, that is one of the nastiest problems.
I think that a compromise solution would be an extra file where the macros could be classified by an human. Then, the conversion mechanism would use that information when called. Usually, the macros don't change very often and a warning could be issued when a new macro appeared without classification.

Paulo Costa

Reply by email

Bernd Kreuss
to Jürgen Hestermann: Are you sure this would be possible? Then all other languages coud be added too: ;-)…
J?rgen Hestermann wrote
Are you sure this would be possible? Then all other languages coud be added too: ;-)

Oberon is not just an arbitrary other language, it is Pascals younger brother and ALGOL is their mother and it is told that the same guy named Wirth was around at ETH Z?rich both times when they were created.

I'm not sure how flexible the compiler is and how easy or difficult implementing a new frontend would be, not all the languages in your list are statically typed so much of them wouldn't make sense at all for this compiler, but maybe ALGOL, Modula and Euler would be cool also, to make this family of languages more complete.

And maybe Ada should also be worth thinking about? Ada would be even cooler and has a lot more practical applications than Oberon or Modula, and maybe even the US DoD would start supporting the ompiler ;-)

Reply by email

Graeme Geldenhuys
to Marco van de Voort: Yes I think so. Pretty much with everything, same with the new RTTI modifier stuff in…

Marco van de Voort het geskryf:

Yes I think so. Pretty much with everything, same with the new RTTI modifier stuff in front of a declaration, instead after it. When I asked a question about that, they were even surprised I doubted here... I asked in the non-technical newsgroup. I was brushed of as

yet another Free Pascal troll. They kept bringing up the point that it is C# compatible. I don't give a flying f*ck about C#, I use Object Pascal! Also CodeGear doesn't even do Delphi.NET anymore, so why still copy .NET & C# syntax.

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://opensoft.homeip.net/fpgui/

Reply by email

Graeme Geldenhuys
to Alexander Klenin: On Sat, Sep 12, 2009 at 22:33, Michael Van I agree that syntax is awkward, but I am…

Alexander Klenin het geskryf:

I agree that syntax is awkward, but I am afraid compatibility is more important than better syntax.

Like I told them in the non-technical newsgroup... Compatibility with what? C#??? But the language we are talking about is Object Pascal, NOT C#.

The pascal language generally has modifiers at the end of a declaration. Now Object Pascal parsers and compilers must all be modified to look for modifiers infront and after a declaration. At is purely C# syntax, not Object Pascal syntax! Hasn't CodeGear learnt there lesson with .NET yet??

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://opensoft.homeip.net/fpgui/

Reply by email

Burkhard Carstens
to Bernd Kreuss: Oberon is not just an arbitrary other language, it is Pascals younger brother and ALGOL…
Bernd Kreuss wrote 19 lines
J?rgen Hestermann wrote: > Are you sure this would be possible? > Then all other languages coud be added too: ;-) Oberon is not just an arbitrary other language, it is Pascals younger brother and ALGOL is their mother and it is told that the same guy named Wirth was around at ETH Z?rich both times when they were created. I'm not sure how flexible the compiler is and how easy or difficult implementing a new frontend would be, not all the languages in your list are statically typed so much of them wouldn't make sense at all for this compiler, but maybe ALGOL, Modula and Euler would be cool also, to make this family of languages more complete. And maybe Ada should also be worth thinking about? Ada would be even cooler and has a lot more practical applications than Oberon or Modula, and maybe even the US DoD would start supporting the ompiler ;-)

If I want "eggs and Bacon" I use my oven, not the engine of my car...

Well, finally, I prefer a toaster that toast my bread perfectly, over laptop that also makes coffee.

IOW: I want a perfect pascal compiler, not some chameleon, that does 1000 things but none of them right.

regards
B.

Reply by email

Jürgen Hestermann
to Bernd Kreuss: Oberon is not just an arbitrary other language, it is Pascals younger brother and ALGOL…
Bernd Kreuss schrieb: Oberon is not just an arbitrary other language, it is Pascals younger brother and ALGOL is their mother and it is told that the same guy named Wirth was around at ETH Z?rich both times when they were created.

But there seems to be a reason that these guys didn't enhance Pascal but created completely new languages.

Show quoted text 5 lines
I'm not sure how flexible the compiler is and how easy or difficult implementing a new frontend would be, not all the languages in your list are statically typed so much of them wouldn't make sense at all for this compiler, but maybe ALGOL, Modula and Euler would be cool also, to make this family of languages more complete.

I don't think that it is wise to use a Pascal compiler to compile code from another language, even if it is very similar to Pascal in some respects (and if it's even possible). I believe that there are fundamental differences, otherwise it would not be a different language.

And the existing {$MODE..} modifications are already too much. They were added to avoid code modifications to older programs but they never help me to avoid them yet. In the end, the code had to be adapted anyway.

I would prefer not to do even more of these modifications so that noone can read any code snipped anymore because he does not know which language is meant.

Reply by email

black dog
to Graeme Geldenhuys: 2009/9/12 Alexander Klenin : Seeing that we are list our wishlists... :-) * Full support…

Something that I'd like to see, because I use garbage collected languages mostly, is trying to get the Boehm memory manager working as the plugin memory manager.

I've tried to do it and failed because I don't know fpc that well, and although it seems to work on small tests i can't use the unix library without a segfault.

I don't think it's worthwhile to argue here the benefits of a garbage collector as it's well documented, but certainly, FPC offering such a feature, would help make certain categories of applications more robust , and imo, have the possibilty of attracting many more developers, particularly java developers, as you get the write once compile everywhere and gc which is really all java ever offered.

bd

Show quoted text 26 lines
2009/9/12 Alexander Klenin : > So I request community for a suitable ideas -- projects should be > reasonably self-contained, not too hard, require actual coding and Seeing that we are list our wishlists... :-) * Full support for "implements" interface delegation in classes. * Complete Semaphore support via a TSemaphore class -- like was done for TCriticalSection. Regards, - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/ -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
'Perfection is achieved not when there is nothing more to add, but rather when there is nothing more to take away.' -- Antoine de Saint-Exup?ry

Reply by email

Marco van de Voort
to Graeme Geldenhuys: Marco van de Voort het geskryf: yet another Free Pascal troll. They kept bringing up the…
Graeme Geldenhuys wrote 11 lines
Marco van de Voort het geskryf: > > Yes I think so. Pretty much with everything, same with the new RTTI modifier > stuff in front of a declaration, instead after it. When I asked a question > about that, they were even surprised I doubted it at all. Same here... I asked in the non-technical newsgroup. I was brushed of as yet another Free Pascal troll. They kept bringing up the point that it is C# compatible. I don't give a flying f*ck about C#, I use Object Pascal! Also CodeGear doesn't even do Delphi.NET anymore, so why still copy .NET & C# syntax.

Codegear goes where the public opinion goes, to sell. However the slavish following by a lot of the forummembers continues to surprise me.

Reply by email

Marco van de Voort
to Hans-Peter Diettrich: [ ] You understand what's a preprocessor DoDi
Hans-Peter Diettrich wrote 9 lines
Florian Klaempfl schrieb: >> How does a C front-end affect the Pascal front-end? > > If it doesn't affect it, it has no use or what would you do with macros > in headers? If they aren't supported in the pascal front end, it makes > no sense to read them with a C frontend. [ ] You understand what's a preprocessor

So you are suggesting a preprocessor that reads C and outputs Pascal? :-)

Reply by email

Marco van de Voort
to Bernd Kreuss: Oberon is not just an arbitrary other language, it is Pascals younger brother and ALGOL…
Bernd Kreuss wrote 8 lines
J?rgen Hestermann wrote: > Are you sure this would be possible? > Then all other languages coud be added too: ;-) Oberon is not just an arbitrary other language, it is Pascals younger brother and ALGOL is their mother and it is told that the same guy named Wirth was around at ETH Z?rich both times when they were created.

Modula2 is the brother. Modula-3 is the OOP cousin. Oberon is Modula-3's ackward brother :)

Show quoted text 5 lines
I'm not sure how flexible the compiler is and how easy or difficult implementing a new frontend would be, not all the languages in your list are statically typed so much of them wouldn't make sense at all for this compiler, but maybe ALGOL, Modula and Euler would be cool also, to make this family of languages more complete.

I'm all for Modula2. It is one of the nicest languages from a didactic point of view IMHO.

Reply by email

Alexander Klenin
to Marco van de Voort: Codegear goes where the public opinion goes, to sell. However the slavish following by a…
Marco van de Voort wrote 15 lines
On Mon, Sep 14, 2009 at 02:29:26PM +0200, Graeme Geldenhuys wrote: > Marco van de Voort het geskryf: > > > > Yes I think so. Pretty much with everything, same with the new RTTI modifier > > stuff in front of a declaration, instead after it. When I asked a question > > about that, they were even surprised I doubted it at all. > > Same here... I asked in the non-technical newsgroup. I was brushed of as > ?yet another Free Pascal troll. They kept bringing up the point that it > is C# compatible. I don't give a flying f*ck about C#, I use Object > Pascal! Also CodeGear doesn't even do Delphi.NET anymore, so why still > copy .NET & C# syntax. Codegear goes where the public opinion goes, to sell. However the slavish following by a lot of the forummembers continues to surprise me.

Is not this the definition of the public opinion? :-)

Alexander S. Klenin

Reply by email

Florian Klaempfl
to Hans-Peter Diettrich: [ ] You understand what's a preprocessor DoDi
Show quoted text 9 lines
Florian Klaempfl schrieb: >> How does a C front-end affect the Pascal front-end? > > If it doesn't affect it, it has no use or what would you do with macros > in headers? If they aren't supported in the pascal front end, it makes > no sense to read them with a C frontend. [ ] You understand what's a preprocessor

Maybe you should write compilers for 15 years, then we continue, might be 2024 then.

Reply by email

Hans-Peter Diettrich
to Jürgen Hestermann: But there seems to be a reason that these guys didn't enhance Pascal but created…
Show quoted text 6 lines
> Oberon is not just an arbitrary other language, it is Pascals younger > brother and ALGOL is their mother and it is told that the same guy named > Wirth was around at ETH Z?rich both times when they were created. But there seems to be a reason that these guys didn't enhance Pascal but created completely new languages.

The primary reason for new languages is to replace the old syntax by a better one. This was done in Modula, the ancestor of Oberon. Then objects were added, with various improvements. Finally garbage collection was added to Oberon. Only the garbage collection is really new to FPC Pascal, and it IMO is the only thing that may deserve modifications to the compiler. And GC is a nice playground for student compiler projects :-)

Show quoted text 10 lines
> I'm not sure how flexible the compiler is and how easy or difficult > implementing a new frontend would be, not all the languages in your list > are statically typed so much of them wouldn't make sense at all for this > compiler, but maybe ALGOL, Modula and Euler would be cool also, to make > this family of languages more complete. I don't think that it is wise to use a Pascal compiler to compile code from another language, even if it is very similar to Pascal in some respects (and if it's even possible). I believe that there are fundamental differences, otherwise it would not be a different language.

Right, there exist languages that are compatible with FPC, and others that are incompatible.

And the existing {$MODE..} modifications are already too much. They were added to avoid code modifications to older programs but they never help me to avoid them yet. In the end, the code had to be adapted anyway.

Most languages do not deserve new modes, because the source files have other than PAS extensions.

I would prefer not to do even more of these modifications so that noone can read any code snipped anymore because he does not know which language is meant.

ACK.

DoDi

Reply by email

Hans-Peter Diettrich
to Marco van de Voort: So you are suggesting a preprocessor that reads C and outputs Pascal? :-)
Show quoted text 7 lines
>>> How does a C front-end affect the Pascal front-end? >> If it doesn't affect it, it has no use or what would you do with macros >> in headers? If they aren't supported in the pascal front end, it makes >> no sense to read them with a C frontend. > [ ] You understand what's a preprocessor So you are suggesting a preprocessor that reads C and outputs Pascal? :-)

No, this were what ToPas does. Instead I suggest to skip the intermediate Pascal code, and to compile the given source code immediately.

DoDi

Reply by email

Hans-Peter Diettrich
to Graeme Geldenhuys: Alexander Klenin het geskryf: Like I told them in the non-technical newsgroup...…
The pascal language generally has modifiers at the end of a declaration.

Right, and the syntax sucks :-(
(all the semicolons should be removed from the modifiers, with a single semicolon terminating a declaration)

Now Object Pascal parsers and compilers must all be modified to look for modifiers infront and after a declaration. At is purely C# syntax, not Object Pascal syntax! Hasn't CodeGear learnt there lesson with .NET yet??

IMO they have learned that copy&paste is an essential RAD method. In so far I understand that copying C# declarations into OPL source code simplifies interfacing with the rest of the world.

DoDi

Reply by email

Hans-Peter Diettrich
to Burkhard Carstens: If I want "eggs and Bacon" I use my oven, not the engine of my car... Well, finally, I…
IOW: I want a perfect pascal compiler, not some chameleon, that does 1000 things but none of them right.

gcc has been very successul, with its ability to compile many languages (including Pascal!). IMO it only differs from FPC in the OO model, so that FPC could play the role of gcc in the world of languages compatible with the OPL object model.

DoDi

Reply by email

Raymond Wilson
to Hans-Peter Diettrich

GCC is also known for being a good optimizing compiler.

Is it feasible to use some of the optimizing tech from GCC in FPC?

Raymond.

Earlier message 21 lines
-----Original Message----- From: Hans-Peter Diettrich [mailto:] Sent: Monday, September 14, 2009 3:35 PM To: Lazarus mailing list Subject: Re: [Lazarus] Request for student project ideas Burkhard Carstens schrieb: > IOW: I want a perfect pascal compiler, not some chameleon, that does > 1000 things but none of them right. gcc has been very successul, with its ability to compile many languages (including Pascal!). IMO it only differs from FPC in the OO model, so that FPC could play the role of gcc in the world of languages compatible with the OPL object model. DoDi --

Reply by email

Carlos German Tejero
to Alexander Klenin: As some of you may already know, I teach programming in Far Eastern National University…

Maybe port to fpc and enhance FlashPascal (
http://flashpascal.sourceforge.net/) is a good project for students.

2009/9/11 Alexander Klenin

Show quoted text 25 lines
As some of you may already know, I teach programming in Far Eastern National University and encourage students to participate in open source projects for their course works. Among opensource projects I recommend are Free Pascal and Lazarus. Last year one of my students already participated in FPC development with moderate success (see http://bugs.freepascal.org/view.php?id=13700). This year, I expect 1-3 more students to choose Lazarus/FPC for their projects. So I request community for a suitable ideas -- projects should be reasonably self-contained, not too hard, require actual coding and be interesting enough to motivate students. Students will work on projects they select from October 2009 to April 2010. -- Alexander S. Klenin -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Carlos Germ?n Tejero -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20090914/2f22261b/attachment.html>

Reply by email

Florian Klaempfl
to Hans-Peter Diettrich: No, this were what ToPas does. Instead I suggest to skip the intermediate Pascal code,…
Show quoted text 12 lines
Marco van de Voort schrieb: >>>> How does a C front-end affect the Pascal front-end? >>> If it doesn't affect it, it has no use or what would you do with macros >>> in headers? If they aren't supported in the pascal front end, it makes >>> no sense to read them with a C frontend. >> [ ] You understand what's a preprocessor > > So you are suggesting a preprocessor that reads C and outputs Pascal? :-) No, this were what ToPas does. Instead I suggest to skip the intermediate Pascal code, and to compile the given source code immediately.

So you want a hybrid pascal/C compiler? Or at which point do you want to do macro expansion and translation of the resulting C?

Reply by email

Graeme Geldenhuys
to Hans-Peter Diettrich: Right, and the syntax sucks :-( (all the semicolons should be removed from the modifiers,…

Hans-Peter Diettrich het geskryf:

IMO they have learned that copy&paste is an essential RAD method. In so far I understand that copying C# declarations into OPL source code simplifies interfacing with the rest of the world.

I can't say I have ever heard of a single case where C# developers moved to Delphi (Object Pascal) language. The opposite seems quite popular.

So that tell me, that there is NO point in copying the C# language syntax to a Object Pascal language - no developers move in that direction.

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://opensoft.homeip.net/fpgui/

Reply by email

Graeme Geldenhuys
to Marco van de Voort: Codegear goes where the public opinion goes, to sell. However the slavish following by a…

Marco van de Voort het geskryf:

Codegear goes where the public opinion goes, to sell. However the slavish following by a lot of the forummembers continues to surprise me.

Like I told Hans-Peter, I have not heard about a single case where C# developers move camp to Object Pascal (Delphi) language. The opposite seems much more popular. With saying that, I see no point in copying the C# syntax in the Object Pascal language.

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://opensoft.homeip.net/fpgui/

Reply by email

Lance Collins
to Graeme Geldenhuys

I suspect the attraction of C# is because if you are developing for .NET it makes sense to use the language the evil empire uses or your employer requires you to use.
I rather doubt the reason anyone moves to a C dialect is due to the purity of the language syntax.

Lance

you wrote 12 lines
Marco van de Voort het geskryf: > > Codegear goes where the public opinion goes, to sell. However the slavish > following by a lot of the forummembers continues to surprise me. Like I told Hans-Peter, I have not heard about a single case where C# developers move camp to Object Pascal (Delphi) language. The opposite seems much more popular. With saying that, I see no point in copying the C# syntax in the Object Pascal language. Regards, - Graeme -

Reply by email

Vincent Snijders
to Graeme Geldenhuys: Hans-Peter Diettrich het geskryf: I can't say I have ever heard of a single case where C#…
Graeme Geldenhuys wrote 8 lines
Hans-Peter Diettrich het geskryf: > IMO they have learned that copy&paste is an essential RAD method. In so > far I understand that copying C# declarations into OPL source code > simplifies interfacing with the rest of the world. I can't say I have ever heard of a single case where C# developers moved to Delphi (Object Pascal) language. The opposite seems quite popular.

And that is why there are lots of sample code with C# declarations. It is argued that copying and pasting them is a fast way of getting the declarations in pascal. It is useful, if you don't have to re-arrange the declaration.

So that tell me, that there is NO point in copying the C# language syntax to a Object Pascal language - no developers move in that direction.

It is not about developers, it is about code.

Vincent

Reply by email

Marco van de Voort
to Hans-Peter Diettrich: Right, and the syntax sucks :-( (all the semicolons should be removed from the modifiers,…
Hans-Peter Diettrich wrote 7 lines
Graeme Geldenhuys schrieb: > The pascal language generally has modifiers at the end of a declaration. Right, and the syntax sucks :-( (all the semicolons should be removed from the modifiers, with a single semicolon terminating a declaration)

IMHO since some modifiers can have parameters, that is yet another kludge.

GPC uses [modifier1 arg1,modifier2] iirc, which is better.

Show quoted text 7 lines
> Now Object Pascal parsers and compilers must all be modified to look for > modifiers infront and after a declaration. At is purely C# syntax, not > Object Pascal syntax! Hasn't CodeGear learnt there lesson with .NET yet?? IMO they have learned that copy&paste is an essential RAD method. In so far I understand that copying C# declarations into OPL source code simplifies interfacing with the rest of the world.

I can't really imagine a realworld scenario here.

Reply by email

Marco van de Voort
to Lance Collins: I suspect the attraction of C# is because if you are developing for .NET it makes sense…
Lance Collins wrote
I suspect the attraction of C# is because if you are developing for .NET it makes sense to use the language the evil empire uses or your employer requires you to use.

Well that's certainly it. And going with the flow is certainly a factor there.

But I think adapting some shallow syntax here and there doesn't really bring you up to speed with that.

It's a bit like buying a pig instead of a horse, and then putting a saddle on top of it, and then claim handling the pig is so much easier because both have a saddle. Totally bypassing the fact that the pig is still no riding animal, and the saddle makes no sense on a pig.

However being different doesn't pay in corporate life, so people try to find the weirdest arguments to justify being similar, even if it doesn't have direct merit. It is just more easily marketable, but somehow people aren't willing to acknowledge that. (since that would mean admitting you are on the losing team)

I rather doubt the reason anyone moves to a C dialect is due to the purity of the language syntax.

I think if you are really sensitive to these kind of arguments, (or your boss is), it is time to stop kidding yourself, and go with the flow and adopt C#, VS and everything that goes with it (and also assume you are stuck to Windows, yes I know Mono. Nevertheless). It makes no sense trying to follow an alternate course and still try to blend in.

But adding some minor C# syntax to Delphi doesn't make it .NET or C#, and I don't buy the copy-paste argument either, since I can't see any regular practical case where this would be advantegeous. Specially since you still would have to fix up all other modifiers like calling convention.

Reply by email

Marco van de Voort
to Hans-Peter Diettrich: No, this were what ToPas does. Instead I suggest to skip the intermediate Pascal code,…
Hans-Peter Diettrich wrote 12 lines
Marco van de Voort schrieb: >>>> How does a C front-end affect the Pascal front-end? >>> If it doesn't affect it, it has no use or what would you do with macros >>> in headers? If they aren't supported in the pascal front end, it makes >>> no sense to read them with a C frontend. >> [ ] You understand what's a preprocessor > > So you are suggesting a preprocessor that reads C and outputs Pascal? :-) No, this were what ToPas does. Instead I suggest to skip the intermediate Pascal code, and to compile the given source code immediately.

It would mean integrating a full blown substitution based preprocessor.

But this is a sidetrack of the real problem: I don't see a real benefit in integrating a C compiler.

The main benefits of that one would only get when the C compiler becomes terribly advanced, something that I don't see happening anytime soon, and the position of 3rd party (non-system) C compilers on Unix is not terribly useful either.

Reply by email

Marco van de Voort
to Alexander Klenin: As some of you may already know, I teach programming in Far Eastern National University…
Alexander Klenin wrote 5 lines
This year, I expect 1-3 more students to choose Lazarus/FPC for their projects. So I request community for a suitable ideas -- projects should be reasonably self-contained, not too hard, require actual coding and be interesting enough to motivate students. Students will work on projects they select from October 2009 to April 2010.

Hmm, would updating and bugfixing h2pas not be an ideal project?

- there are several bugreports that could be a starting point.
- its relevant (parsing technology, C grammar)
- there is a severe need.

Reply by email

Graeme Geldenhuys
to Marco van de Voort: Well that's certainly it. And going with the flow is certainly a factor there. But I…

Marco van de Voort het geskryf:

It's a bit like buying a pig instead of a horse, and then putting a saddle on top of it, and then claim handling the pig is so much easier because both have a saddle. Totally bypassing the fact that the pig is still no riding animal, and the saddle makes no sense on a pig.

A very "visual" example! I still can't get the smile off my face. :-)

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://opensoft.homeip.net/fpgui/

Reply by email

Hans-Peter Diettrich
to Florian Klaempfl: So you want a hybrid pascal/C compiler? Or at which point do you want to do macro…
Show quoted text 6 lines
>> So you are suggesting a preprocessor that reads C and outputs Pascal? :-) > No, this were what ToPas does. Instead I suggest to skip the > intermediate Pascal code, and to compile the given source code immediately. So you want a hybrid pascal/C compiler? Or at which point do you want to do macro expansion and translation of the resulting C?

All that is done in the compiler front-end, AKA parser.

BTW, where do you see any C constructs that would require to extend the FPC compiler?

DoDi

Reply by email

Hans-Peter Diettrich
to Graeme Geldenhuys: Marco van de Voort het geskryf: Like I told Hans-Peter, I have not heard about a single…
Show quoted text 7 lines
> Codegear goes where the public opinion goes, to sell. However the slavish > following by a lot of the forummembers continues to surprise me. Like I told Hans-Peter, I have not heard about a single case where C# developers move camp to Object Pascal (Delphi) language. The opposite seems much more popular. With saying that, I see no point in copying the C# syntax in the Object Pascal language.

Do you see points in inventing a different syntax, only for the sake of being different?

DoDi

Reply by email

Hans-Peter Diettrich
to Marco van de Voort: It would mean integrating a full blown substitution based preprocessor. But this is a…
Show quoted text 5 lines
>> So you are suggesting a preprocessor that reads C and outputs Pascal? :-) > No, this were what ToPas does. Instead I suggest to skip the > intermediate Pascal code, and to compile the given source code immediately. It would mean integrating a full blown substitution based preprocessor.

As the one implemented in ToPas...

But this is a sidetrack of the real problem: I don't see a real benefit in integrating a C compiler.

Then you don't want to use any of the many C libraries, out there? Like lex, yacc, regexp, zip, SVN...

DoDi

Reply by email

Marco van de Voort
to Hans-Peter Diettrich: Do you see points in inventing a different syntax, only for the sake of being different?…
Hans-Peter Diettrich wrote 10 lines
>> Codegear goes where the public opinion goes, to sell. However the slavish >> following by a lot of the forummembers continues to surprise me. > > Like I told Hans-Peter, I have not heard about a single case where C# > developers move camp to Object Pascal (Delphi) language. The opposite > seems much more popular. With saying that, I see no point in copying the > C# syntax in the Object Pascal language. Do you see points in inventing a different syntax, only for the sake of being different?

The "only" is your emphasis, not mine.

But more importantly, if you really agree with this, we must really urgently put all modifiers and other information in front of the declaration. Since otherwise.... we could be different!

So the point is not the syntax, but the placing, and in similar cases we put it after. If it is put after you can at least say "It is like C# but everything is always after the declaration", while now it is "It is like C# if C# had it before Pascal added it and the date was 2009 or later, and after it otherwise".

So IMHO there is not even other syntax, just placing.

... and to answer the original question straight up: if something is added to Pascal, first it should fit with Pascal, and only then with other languages that sport totally different parsing models. Not the other way around.

Reply by email

Marco van de Voort
to Hans-Peter Diettrich: As the one implemented in ToPas... Then you don't want to use any of the many C…
Hans-Peter Diettrich wrote 7 lines
>>> So you are suggesting a preprocessor that reads C and outputs Pascal? :-) >> No, this were what ToPas does. Instead I suggest to skip the >> intermediate Pascal code, and to compile the given source code immediately. > > It would mean integrating a full blown substitution based preprocessor. As the one implemented in ToPas...

Yes. And while I don't like that, if there is a real need, that can be escaped. I just don't see a real need.

Show quoted text 5 lines
> But this is a sidetrack of the real problem: I don't see a real benefit in > integrating a C compiler. Then you don't want to use any of the many C libraries, out there? Like lex, yacc, regexp, zip, SVN...

We can already statically link to C code, so what exactly is the point? True, header converting is pain, but a blessing compared with the amount of work to maintain a fullblown C compiler.

Moreover it would be a feeble shade of a compiler to compile a handful of libs only, and you get tons of maintenance work in return. All the C parsing and implementation oddities, GCC compatibility issues, tools preparation ( autoconf etc), libraries etc.

It would probably always be 5 steps behind GCC anyway.

Reply by email

Florian Klaempfl
to Hans-Peter Diettrich: All that is done in the compiler front-end, AKA parser. BTW, where do you see any C…
Show quoted text 12 lines
Florian Klaempfl schrieb: >>> So you are suggesting a preprocessor that reads C and outputs >>> Pascal? :-) >> No, this were what ToPas does. Instead I suggest to skip the >> intermediate Pascal code, and to compile the given source code >> immediately. > > So you want a hybrid pascal/C compiler? Or at which point do you want to > do macro expansion and translation of the resulting C? All that is done in the compiler front-end, AKA parser.

(preprocessing is never part of the parser, it's a separate compiler module or part of the, but this doesn't matter)

Just a simple example:

test.h:

#define POINTER(x) typedef T ## x* x
POINTER(float)

test.pas:

unit test;
interface
  {$I test.h}
  POINTER(longint)
implementation
end.

Does this compile? What is compiled into test.ppu? Can I do

unit test2;
  interface
    uses
      test;
    POINTER(string)
  implementation
end.
?

Reply by email

Hans-Peter Diettrich
to Marco van de Voort: Yes. And while I don't like that, if there is a real need, that can be escaped. I just…
Show quoted text 6 lines
> Then you don't want to use any of the many C libraries, out there? Like > lex, yacc, regexp, zip, SVN... We can already statically link to C code, so what exactly is the point? True, header converting is pain, but a blessing compared with the amount of work to maintain a fullblown C compiler.

What extra work do you mean?

A compiler front-end translates the source code into an internal format, from which the back-end generates the executable code.

Moreover it would be a feeble shade of a compiler to compile a handful of libs only, and you get tons of maintenance work in return. All the C parsing and implementation oddities, GCC compatibility issues, tools preparation ( autoconf etc), libraries etc.

The ToPas C preprocessor and parser has been tested for MSVC and gcc compatibility. Configure is a problem on Windows; I used to configure C libraries on linux, then compiled the result on Windows. No further problems encountered so far.

DoDi

Reply by email

Hans-Peter Diettrich
to Florian Klaempfl: (preprocessing is never part of the parser, it's a separate compiler module or part of…
Show quoted text 6 lines
>> So you want a hybrid pascal/C compiler? Or at which point do you want to >> do macro expansion and translation of the resulting C? > All that is done in the compiler front-end, AKA parser. (preprocessing is never part of the parser, it's a separate compiler module or part of the, but this doesn't matter)

At least since C98 the preprocessor is part of the parser, due to macro expansion requirements.

Show quoted text 14 lines
Just a simple example: test.h: #define POINTER(x) typedef T ## x* x POINTER(float) test.pas: unit test; interface {$I test.h}

A bunch of syntax errors here, because the Pascal preprocessor and parser does not understand C syntax.

POINTER(longint)

You missed the goal :-(

The C code is translated into separate ppu/o files, which can be added to the Uses clauses. Eventually a library unit or (package?) project can enumerate the types, constants, variables and functions of the C modules, which shall become available in other units. In the case of a library unit this unit can be added to the Uses of other Pascal units.

If you ever had used CBuilder, you would better understand how a compiler can compile modules of various languages, and create object files usable from all languages.

DoDi

Reply by email

Florian Klaempfl
to Hans-Peter Diettrich
Show quoted text 11 lines
Florian Klaempfl schrieb: >>> So you want a hybrid pascal/C compiler? Or at which point do you >>> want to >>> do macro expansion and translation of the resulting C? >> All that is done in the compiler front-end, AKA parser. > > (preprocessing is never part of the parser, it's a separate compiler > module or part of the, but this doesn't matter) At least since C98

There is no C98, only C89 and C99. Which one do you mean?

You missed the goal :-(

And you the point :) Such a compiler has to deal with *any* kind of ugly macro stuff not only of specially tailored code for this purpose. If this would be doable, it could be also done with h2pas, ToPas or whatever.

Show quoted text 10 lines
The C code is translated into separate ppu/o files, which can be added to the Uses clauses. Eventually a library unit or (package?) project can enumerate the types, constants, variables and functions of the C modules, which shall become available in other units. In the case of a library unit this unit can be added to the Uses of other Pascal units. If you ever had used CBuilder, you would better understand how a compiler can compile modules of various languages, and create object files usable from all languages.

This works only because the headers are made for this purpose.

Reply by email

Leslie Kaye
to Vincent Snijders: And that is why there are lots of sample code with C# declarations. It is argued that…
Vincent Snijders wrote 21 lines
<div class="moz-text-flowed" style="font-family: -moz-fixed">Graeme Geldenhuys schreef: > Hans-Peter Diettrich het geskryf: >> IMO they have learned that copy&paste is an essential RAD method. In >> so far I understand that copying C# declarations into OPL source >> code simplifies interfacing with the rest of the world. > > I can't say I have ever heard of a single case where C# developers moved > to Delphi (Object Pascal) language. The opposite seems quite popular. > And that is why there are lots of sample code with C# declarations. It is argued that copying and pasting them is a fast way of getting the declarations in pascal. It is useful, if you don't have to re-arrange the declaration. > So that tell me, that there is NO point in copying the C# language > syntax to a Object Pascal language - no developers move in that > direction. It is not about developers, it is about code.

C# is already dead because it is tied to a propriety Java lookalike platform but with even more serious bloat. It will be out of fashion within the next decade. No matter how fast your hardware, native code will always be the faster option. If high connection cloud and web servers are the future then small footprint applications and fast execution of instances will never have previously been more important.

Okay so there is Mono but do you trust M$ not to take it out with a patent infringement lawsuit? Even if M$ were to ultimately lose the claim, the legal fees would be prohibitive for Mono to defend. Do you want to put years of development effort into C# and dot net which could vanish in a second?

ASP.NET is a powerful technology under light loads but why anyone would use dot net on the desktop is beyond me. Are your desktop users in less developed countries than the US likely to be running the latest version of Windows and dot net? I do not think so.

Object Pascal will live on because Delphi and Lazarus are awesome technologies delivering human readable raw speed applications at a low level which cannot be matched for speed and power by any Just In Time CLR or interpreted languages.

Visual Basic was launched by M$ as a lightweight toy to allow non-professionals to go beyond their spreadsheet "applications". Then "serious" software vendors started developing in VB. Nonetheless M$ crapped on them all by discontinuing the native compiler. Now it is for Delphi and Lazarus to facilitate the engineers and accountants and whatever non IT professionals (and the IT houses also!) to write quality code. These applications will deliver high performance and yet will be easily understood by c++ purists and other career programmers.

As soon as C# goes out of fashion then because M$ only goes forward., there will be no backward compatibility...you have been warned!

Show quoted text 6 lines
Vincent </div>

Reply by email

waldo kitty
to Bernd Kreuss: This would be an exceptionally cool thing, and I'm sure it would attract much attention…
Bernd Kreuss wrote 6 lines
Hans-Peter Diettrich wrote: > And another one: an Oberon front-end for FPC! {$mode OBERON} This would be an exceptionally cool thing, and I'm sure it would attract much attention in wider circles!

FWIW: i'm aware of numerous Oberon coders that might find it nice to be able to do Oberon stuffs with FPC and offer their wares to a wider venue ;)

Reply by email

waldo kitty
to Graeme Geldenhuys: Hans-Peter Diettrich het geskryf: I can't say I have ever heard of a single case where C#…
Graeme Geldenhuys wrote 7 lines
Hans-Peter Diettrich het geskryf: > IMO they have learned that copy&paste is an essential RAD method. In so > far I understand that copying C# declarations into OPL source code > simplifies interfacing with the rest of the world. I can't say I have ever heard of a single case where C# developers moved to Delphi (Object Pascal) language. The opposite seems quite popular.

you cannot stop the lemmings ;) :P

Reply by email

waldo kitty
to Vincent Snijders: And that is why there are lots of sample code with C# declarations. It is argued that…
Vincent Snijders wrote 6 lines
Graeme Geldenhuys schreef: > So that tell me, that there is NO point in copying the C# language > syntax to a Object Pascal language - no developers move in that > direction. It is not about developers, it is about code.

on the contrary... it is about what the schools teach and they are all in the lemming camp :rolleyes: :? :(

Reply by email

Marco van de Voort
to Hans-Peter Diettrich: What extra work do you mean? A compiler front-end translates the source code into an…
Hans-Peter Diettrich wrote 11 lines
>> Then you don't want to use any of the many C libraries, out there? Like >> lex, yacc, regexp, zip, SVN... > > We can already statically link to C code, so what exactly is the point? > True, header converting is pain, but a blessing compared with the amount of > work to maintain a fullblown C compiler. What extra work do you mean? A compiler front-end translates the source code into an internal format, from which the back-end generates the executable code.

The frontend, and making sure the generated code meets targets, survives testsuites, complies to standard (e.g. aliassing rules)

Show quoted text 7 lines
> Moreover it would be a feeble shade of a compiler to compile a handful of > libs only, and you get tons of maintenance work in return. All the C parsing > and implementation oddities, GCC compatibility issues, tools preparation > ( autoconf etc), libraries etc. The ToPas C preprocessor and parser has been tested for MSVC and gcc compatibility.

Parsing compatibility I assume. So it eats everything that could turn up in a gcc header? It eats the entire /usr/include on Linux?

Reply by email

Paul Ishenin
to Hans-Peter Diettrich: What extra work do you mean? A compiler front-end translates the source code into an…
Hans-Peter Diettrich wrote
The ToPas C preprocessor and parser has been tested for MSVC and gcc compatibility. Configure is a problem on Windows; I used to configure C libraries on linux, then compiled the result on Windows. No further problems encountered so far.

Sorry, maybe I missed somewhere but where is the link to "ToPas". Is it possible to look at it?

Best regards,
Paul Ishenin.

Reply by email

Andrew Haines
to Alexander Klenin: As some of you may already know, I teach programming in Far Eastern National University…
Alexander Klenin wrote 15 lines
As some of you may already know, I teach programming in Far Eastern National University and encourage students to participate in open source projects for their course works. Among opensource projects I recommend are Free Pascal and Lazarus. Last year one of my students already participated in FPC development with moderate success (see http://bugs.freepascal.org/view.php?id=13700). This year, I expect 1-3 more students to choose Lazarus/FPC for their projects. So I request community for a suitable ideas -- projects should be reasonably self-contained, not too hard, require actual coding and be interesting enough to motivate students. Students will work on projects they select from October 2009 to April 2010.

<opens can of worms>
Perhaps a utf8 compiler supported string type?
</opens can of worms>

Regards,

Andrew Haines

Reply by email