Lazarus and FPC integration

classic Classic list List threaded Threaded
75 messages Options
1234
Reply | Threaded
Open this post in threaded view
|

Re: Lazarus and FPC integration

Florian Klaempfl-2
Agustin Barto wrote:

> On 10/30/05, Florian Klaempfl <[hidden email]> wrote:
>
>>Agustin Barto wrote:
>>
>>>I was talking about design. One example? Polymorphism with primitive
>>>data types can get really messy really fast with ObjectPascal. It's
>>>not easy, for instance, to have a generic data structure that can
>>>store *any* primitive data in a type-safe way.
>>
>>Variants?
>>
>
>
> If Variants could store objects and interface instances, maybe.

They can? Simply use custom variants.

> I
> could use pointers too, but I really don't want to implement poor
> men's polymorphism :)
>
> I solved the problem using a single-rooted wrapper hierarchy (java
> style). It's not elegant nor efficient,

Which isn't java either ...

> but it saved me from writing
> the same code over and over, and having to deal with pointers, or
> variants.


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Lazarus and FPC integration

Felipe Monteiro de Carvalho
In reply to this post by Agustin Barto
On 10/30/05, Agustin Barto <[hidden email]> wrote:
>
> It's a HUGE problem! I can't properly document the code!
>
> This is a big problem for me, 'cause I only use Windows to play games :)
>
> I hope it gets fixed.

You´ve beat me =)

They only thing I can say now is that I would love to see it implemented =P

here is the bug report for more info:
http://www.lazarus.freepascal.org/mantis/view.php?id=1186

--
Felipe Monteiro de Carvalho
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Lazarus and FPC integration

Agustin Barto
In reply to this post by Florian Klaempfl-2
On 10/30/05, Florian Klaempfl <[hidden email]> wrote:
> > If Variants could store objects and interface instances, maybe.
>
> They can? Simply use custom variants.
>

Don't know what custom variants are. I'd appreciate a link to the documentation.

> > I solved the problem using a single-rooted wrapper hierarchy (java
> > style). It's not elegant nor efficient,
>
> Which isn't java either ...
>

I don't know how other developers work, but for us at work,
development speed is far more important (several orders of magnitude)
than execution speed. If using Haskell or Lisp lets us meet or beat
the ever-closing deadlines, we "advice" the client to get really fast
computer with lots and lots of memory :)

I won't get into a "which is better" debate. I have enough of those
trying to convince Debian users to switch Fedora :)

We use the tool that better suits our needs. The only thing that we
won't use, no matter how good or profitable they can be, are Microsoft
products.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Lazarus and FPC integration

L505
In reply to this post by Bugzilla from elio@mixtk.com

>This is a common problem with "visual" IDE's, they are focused in
>implementation speed and not overall project quality, this had already been
>discused in other places. As Agustin pointed this is not visible for small
>Form1 based projects but it gets bad as the project grows. I agree this is
>not entirely Lazarus' fault too.

I'm beginning to think we need a Big huge button in the lazarus IDE with caption as:
 "Hide Lazarus Component Palette (Click This Only If You Come From a Java Background)"

That caption is quite big, so the button might span across the entire screen.

I simply ignore the palette when I don't need it! Can't you? For example if I was designing
the Google search engine in the Lazarus IDE, I would find little use for the component
palette (except maybe for protyping templates of how the website will look, which accounts
for 2 percent of the application code). But all the OTHER benefits of the IDE such as code
completion, plug-ins (and for me cliptext, FTP, linux testing in Windows, etc) are what the
IDE can do for me. It's not only to do with visual designer, it is also the code completion
and quick syntax check, FTP uploading, and things like that.

--
L505
http://z505.com


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Lazarus and FPC integration

L505
In reply to this post by Florian Klaempfl-2

> > I solved the problem using a single-rooted wrapper hierarchy (java
> > style). It's not elegant nor efficient,

Google.com

Your search - "single-rooted wrapper hierarchy" - did not match any documents.

Suggestions:
- Make sure all words are spelled correctly.
- Try different keywords.
- Try more general keywords.

Both Lars and Google are wondering.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Lazarus and FPC integration

L505
In reply to this post by Agustin Barto

>I was talking about design. One example? Polymorphism with primitive
>data types can get really messy really fast with ObjectPascal. It's

Google.com

Your search - "Polymorphism with primitive data types" - did not match any documents.

Suggestions:
- Make sure all words are spelled correctly.
- Try different keywords.
- Try more general keywords.


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Lazarus and FPC integration

Dean Zobec
In reply to this post by Agustin Barto
Agustin Barto wrote:

>>What bad designs does it impose the programmer?? I have a big interest
>>to know because I like to make a as reusable as possible code. Are you
>>talking about the form designer??
>>    
>>
>
>Software that's designed starting from the user interface to the
>behavioral parts of the program leads to some pretty nasty design
>bias. We usually call this the "visual basic syndrome" :)
>
It's true, but you don't have to use a RAD approach if you don't want to :)
The RAD approach is handy for prototyping or for the quick development
of small utilities.
When it comes to bigger projects, to avoid the inclusion of the domain
code in the GUI interface code, that leads to unmaintainable projects,
you can choose a different design.
One approach is the use of the RTTI - aware controls to link them to the
published properties of your Business Objects or, better, use a more
complex but more flexible bridge pattern to decouple the link  between
the business objects and the GUI without even using the RTTI metadata.  
You only need a powerful editor to be productive in this case, and
Lazarus has a indeed a good one.
You told us about the lack of some refactoring tools:  Lazarus has a
wonderful object oriented framework for writing plugins, so we all can
feel free to contribute to add them. It's not a Lazarus limit imho.
Ciao, Dean
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Lazarus and FPC integration

John Coppens
In reply to this post by L505
On Sun, 30 Oct 2005 15:50:00 -0800
L505 <[hidden email]> wrote:

> Your search - "Polymorphism with primitive data types" - did not match
> any documents.

Don't use the ""s... Too restrictive.

Without them,

Results 1 - 10 of about 266,000 for Polymorphism with primitive data types

John
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Lazarus and FPC integration

Agustin Barto
In reply to this post by L505
On 10/30/05, L505 <[hidden email]> wrote:
>
> > > I solved the problem using a single-rooted wrapper hierarchy (java
> > > style). It's not elegant nor efficient,
>
> Google.com
>
> Your search - "single-rooted wrapper hierarchy" - did not match any documents.
>

Let's say you need a general purpose list to store any kind of
primitive data or objects (you don't know in advance what are you
going to store). This problem can be solve with the good ole TList and
casting, but you have to deal with pointers and their syntax. What I
did is define an abstract wrapper (a class) that can be evaluated to
any primitive type or Object. I then define implementations of this
wrapper for the primitive types, and make a list of wrappers using
TList or TObjectList. If a wrapped is evaluated for the wrong type, I
throw an exception (Or I just let fpc/delphi deal with the call to an
abstract method).

As I said, it wasn't elegant nor efficient, but certainly was
flexible. Looking back (this code is from two years ago) I guess I
could have done things differently, but at the time I was just
starting with Pascal and I was in a rush to get my CS degree.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Lazarus and FPC integration

Bugzilla from elio@mixtk.com
In reply to this post by Felipe Monteiro de Carvalho
El Dom 30 Oct 2005 15:35, Felipe Monteiro de Carvalho escribió:
> On 10/30/05, Agustin Barto <[hidden email]> wrote:
> > I can't type any international characters (like accented vowels) in
> > the editor. FYI, mi FC4 uses UTF-8.
>
> AFAIK this is a gtk only problem and has already being submited as a
> bug report (by me). It works perfectly on Windows. And the problem is
> only related to the IDE. TEdit (and programs that use it) can handle
> accented words on gtk. The real importance is the programs produced by
> the IDE not it. The problem then becames only a annoyance on linux.

I reported it directly to the Lazarus mailing list a loooong time ago. I only
received "works for me" kind of answers. I hope you get more lucky and this
"bug" gets fixed soon. That would be good for all of us.

>
> --
> Felipe Monteiro de Carvalho
> _______________________________________________
> fpc-pascal maillist  -  [hidden email]
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Lazarus and FPC integration

Bugzilla from elio@mixtk.com
In reply to this post by Micha Nelissen
El Dom 30 Oct 2005 14:51, Micha Nelissen escribió:
> On Sun, 30 Oct 2005 13:48:52 -0600
>

> I'd like to know why this isn't a problem in Eclipse or KDevelop, but is in
> Lazarus.
>
Don't take the comment too personal :). I don't think the "problem" is
necesarily bad, i love Lazarus, it can get me an application done in a few
hours even with complete lack of documentation. It's just that if used
incorrectly can lead to huge problems, but that's true for any tool right?

> Micha
> _______________________________________________
> fpc-pascal maillist  -  [hidden email]
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Lazarus and FPC integration

Bugzilla from elio@mixtk.com
In reply to this post by Felipe Monteiro de Carvalho
El Dom 30 Oct 2005 14:27, Felipe Monteiro de Carvalho escribió:

> > > This eliminates:
> > > a) C++ using any platform independent library, like gtk, qt,
> > > wxwidgets, etc, because the library is too big to fit a floppy
> >
> > Which library do you use for Pascal that fits in a floppy?
>
> LCL (Win32 on Windows and gtk 1.2 for Linux).
>
> After strip and upx I get:
> 700kb on Linux
> 420kb on Windows
>
> And this does not require any special library to be distributed. I am
> guessing any modern linux already comes with gtk 1.2 +. The main size
> problem is for Windows, witch in run on the vast majority of old
> computers. The app needs to fit a floppy and run on a 233Mhz computer
> with Windows 95. Lazarus produces this kind of app.

This is not really a fair reason to reject C++. You can also program gtk 1.2
applications in C++. Of course you still have all the other problems with
C++ :).
About your guess, well, i have always had to explicitly install gtk1.2 libs in
order to install Lazarus. The only exception was FC3. gtk1.2 is already too
old, most distros will, if at all, use gtk2 instead. But anyway you can't
spect to fit everything in a floppy do you? You always have to asume
something.

>
> The result with Delphi is significantly superior as I get a 400kb app
> that handles XML DOM, many forms and lot´s of data without upx. But is
> not platform independent...
>
> > Perl is usually fast, Python not so much. But anyway if you want fast go
> > with assambler :-).
>
> No, I have already seen a speed comparion using the factoring of a
> number as the problem. Perl and Python are overwelmingly inferior no
> anything, including Java, c++ and pascal. java is slow then both c++
> and pascal.
>
> Assembler is not cpu independend =)

Well, all depends in the application i guess. If i want really small i use
assambler (mosly for PIC programming), i want really fast i do it in C, if i
want fast implementation i do it in Python, if i want fast GUI implementation
i use Lazarus. For anything else i use Pascal.

>
> --
> Felipe Monteiro de Carvalho
> _______________________________________________
> fpc-pascal maillist  -  [hidden email]
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Lazarus and FPC integration

Bugzilla from elio@mixtk.com
In reply to this post by L505
El Dom 30 Oct 2005 17:42, L505 escribió:

>
> I'm beginning to think we need a Big huge button in the lazarus IDE with
> caption as: "Hide Lazarus Component Palette (Click This Only If You Come
> From a Java Background)"
>
> That caption is quite big, so the button might span across the entire
> screen.
>
> I simply ignore the palette when I don't need it! Can't you? For example if
> I was designing the Google search engine in the Lazarus IDE, I would find
> little use for the component palette (except maybe for protyping templates
> of how the website will look, which accounts for 2 percent of the
> application code). But all the OTHER benefits of the IDE such as code
> completion, plug-ins (and for me cliptext, FTP, linux testing in Windows,
> etc) are what the IDE can do for me. It's not only to do with visual
> designer, it is also the code completion and quick syntax check, FTP
> uploading, and things like that.
>

These are all good things, but if the IDE editor can't handle basic stuff like
international characters it's not very useful. Another thing is that the IDE
looks very ugly. I know these are Linux especific, in windows Laz is great.
As they say, take this with a grain of salt, my ideal IDE is
Kate+vim+bash+Konsole :-)

Btw, i hate Java :-)

> --
> L505
> http://z505.com
>
>
> _______________________________________________
> fpc-pascal maillist  -  [hidden email]
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Lazarus and FPC integration

Bugzilla from elio@mixtk.com
In reply to this post by Dean Zobec
El Dom 30 Oct 2005 16:52, Dean Zobec escribió:
>[...]
>> One approach is the use of the RTTI - aware controls to link them to the
> published properties of your Business Objects or, better, use a more
> complex but more flexible bridge pattern to decouple the link  between
> the business objects and the GUI without even using the RTTI metadata.
> You only need a powerful editor to be productive in this case, and
> Lazarus has a indeed a good one.
> [...]
Excuse my ignorance, but, what's RTTI?
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Lazarus and FPC integration

Vincent Snijders
In reply to this post by Bugzilla from elio@mixtk.com
Elio Cuevas Gómez wrote:
> These are all good things, but if the IDE editor can't handle basic stuff like
> international characters it's not very useful.

For you. It is useful for most of the English speaking people and those
are quiet a lot too, although not as much as the whole world population.
And even though I don't live in a English speaking country, I never had
problems with it, because all source and comments of my programs are
English. Therefore for me it is not a very important issue. It is nice
to have for others.

Vincent.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Lazarus and FPC integration

Vincent Snijders
In reply to this post by Bugzilla from elio@mixtk.com
Elio Cuevas Gómez wrote:

> El Dom 30 Oct 2005 16:52, Dean Zobec escribió:
>
>>[...]
>>
>>>One approach is the use of the RTTI - aware controls to link them to the
>>
>>published properties of your Business Objects or, better, use a more
>>complex but more flexible bridge pattern to decouple the link  between
>>the business objects and the GUI without even using the RTTI metadata.
>>You only need a powerful editor to be productive in this case, and
>>Lazarus has a indeed a good one.
>>[...]
>
> Excuse my ignorance, but, what's RTTI?

Run-time Type Information.

See for example
http://www.freepascal.org/svn/lazarus/trunk/components/rtticontrols/examples/

Vincent.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Import Pascal record function to C

L505
In reply to this post by John Coppens
If you had a procedure or a function in a Pascal record, and it was a DLL/DSO, could a C
application import it as a Struct with a pointer to a function in that struct?

--
L505
http://z505.com

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Lazarus and FPC integration

Florian Klaempfl-2
In reply to this post by Vincent Snijders
Vincent Snijders wrote:

> Elio Cuevas Gómez wrote:
>
>> These are all good things, but if the IDE editor can't handle basic
>> stuff like international characters it's not very useful.
>
>
> For you. It is useful for most of the English speaking people and those
> are quiet a lot too, although not as much as the whole world population.
> And even though I don't live in a English speaking country, I never had
> problems with it, because all source and comments of my programs are
> English. Therefore for me it is not a very important issue. It is nice
> to have for others.

Indeed, if it is so important, somebody would have implemented it already :)
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Lazarus and FPC integration

Marco van de Voort
In reply to this post by Bugzilla from elio@mixtk.com
> El Dom 30 Oct 2005 14:27, Felipe Monteiro de Carvalho escribi?:
> >
> > Assembler is not cpu independend =)
>
> Well, all depends in the application i guess. If i want really small i use
> assambler (mosly for PIC programming), i want really fast i do it in C, if i
> want fast implementation i do it in Python, if i want fast GUI implementation
> i use Lazarus. For anything else i use Pascal.

C shouldn't be faster than Pascal.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Lazarus and FPC integration

Vinzent Höfler
On Monday 31 October 2005 10:02, Marco van de Voort wrote:

> C shouldn't be faster than Pascal.

Well, it is - if you leave out the range checks.


Vinzent.

--
public key: http://www.t-domaingrabbing.ch/publickey.asc

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

attachment0 (196 bytes) Download Attachment
1234