Recent

Author Topic: Anonymous Methods  (Read 40239 times)

Fiji

  • Guest
Re: Anonymous Methods
« Reply #30 on: July 28, 2014, 01:25:38 pm »
That's like saying why should GCC and Clang be compatible.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: Anonymous Methods
« Reply #31 on: July 28, 2014, 02:21:18 pm »
Many years ago I bought D2009 which has built in anonymous methods. But I have done nothing with them.

I think anonymous function has some limited syntactic sugar use (that shouldn't be overrated). But as Lelelumbo says, who is going to do it?

FPC has many useless Delphi features added because of compatibility, but the exact prioritization is mostly done by the implementers, not by a grand plan.

The big problem is of course that new Delphi users are really motivated to try out all the new features of the horribly expensive suite they just bought, even if
it isn't really needed and the Pascal world has lived 40 years without. Most public Delphi codebases are simply of questionable quality from a portability viewpoint.

This is also where comparisons with C++ totally fail. A C++ programmer would never use a feature just new in one codebase for public consumption. Public codebases
are carefully crafted to a widely compatible consensus of the standard.  Public Delphi codebases throw everything together (portable, newest "features") with a blatan disregard of cross compiler portability.

IOW the reason why this works with C++ is because those C++ codebases are crafted with cross-compiler use in mind.
Quote
I find them difficult to use and with my code I can do anything I want (for now).
Why should Lazarus be the same as Delphi?

To use codebases. But this is not black/white, and it will never be a blind "push the recompile button" style change.

When I joined in '97 and we were still pursuing TP compatibility (iow pre Delphi), it was exactly the same. People raved about the most obvious missing compatibility
item of the TP list, and argue that it was very important, and that you couldn't do without it etc etc. Half of them were not even sane (since 16-bitisms)

The problem is always that people consider Delphi clean. It isn't, most codebases are a versioned mess with hidden bugs, and horrible from a portability standpoint.

Quote
If it should be, Lazarus is only interesting for people who can't by Delphi (except the *unix users).

Haven't bought Delphi in the distant past.  Buying delphi now or in the last few years is less logical, since Embacadero seems to really want to deemphasize VCL and Windows development in favour of FM and mobile. So why buy iut then?



hinst

  • Sr. Member
  • ****
  • Posts: 303
Re: Anonymous Methods
« Reply #32 on: July 28, 2014, 02:46:28 pm »
I believe that some C++ library maintainers are currently moving their libraries from C++98 to C++11 because it will make them cleaner and more usable, but not to C++14 yet

but if some Pascal library maintainer suddenly decides to start using anonymous functions in his code it will most likely not make it cleaner & more usable I think

there are at least 6 flavours of C++ I know of:
C++ mostly pure C
C++99
C++ boost
C++ Qt
C++11
C++14
perhaps both GCC and Visual C++ compiler can supposedly compile all of these, but from my experience one should always expect difficulties with C++ libraries. I once tried to use some logging library for Qt and I could not get it working in Qt.....
« Last Edit: July 28, 2014, 02:51:00 pm by hinst »
Too late to escape fate

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: Anonymous Methods
« Reply #33 on: July 28, 2014, 03:30:27 pm »
Majority of the libraries are for Delphi. Infact there are TONS of them. Why don't they get ported? Compatibility.
As Marcov said (many times in the past). Delphi's biggest competition are previous versions of Delphi. (Borland vs Embacadero... zombie fight).

Majorty of libraries are backward compatible to at least Delphi 7. Thus the usage of new features is going to minimum (by using $IFDEFs to "downgrade" the compiler).
The early mentioned "Omni Thread" library, still provides the way to use it, without anonymous functions.
Old versions keep up pretty successfully (that proves the uselessness of new features). The real con of an old version - lack of new targets (64-bit, iOS, Android)... but this is where FPC comes into play.

Maybe Pascal (FPC) should take a waiting approach? Let all other oop/procedural languages to overload their syntax with function-like programming language features. Wait for the next 10 years, until some expert will write an article "why closures are not so good". And that's it. FPC won't need to clean its sources for closure support :)

..not going to happen, of course...

If you read macpascal or fpc-devel, you should probably be aware, of recently added (Apple specifics) "Blocks", which are closures.
« Last Edit: July 28, 2014, 03:33:08 pm by skalogryz »

Fiji

  • Guest
Re: Anonymous Methods
« Reply #34 on: July 28, 2014, 03:32:14 pm »
Does OTL compile with FPC? Yea I thought so..  :)

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: Anonymous Methods
« Reply #35 on: July 28, 2014, 03:41:40 pm »
Does OTL compile with FPC? Yea I thought so..  :)

Maybe nobody cared to try and fix it.   As said it is nearly never a simple click and compile because every version dependent ifdef needs to get a decision about the FPC case.

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: Anonymous Methods
« Reply #36 on: July 28, 2014, 03:45:59 pm »
Does OTL compile with FPC? Yea I thought so..  :)
Now, this is definitely a problem with open source these days.

Is open source supposed to resolve technical problems quickly? (at least from what I know about history of open source - it was supposed too).
Is syntax incompatibility between two object pascal-dialects a technical problem? - I'd think it is.

So the reason why OTL cannot be built by FPC, is your PERSONAL fault, Fiji!
You MUST fix it, by either patching the library or patching the compiler.
The choice is your, but hurry, since time is running out.

Fiji

  • Guest
Re: Anonymous Methods
« Reply #37 on: July 28, 2014, 03:49:15 pm »
I rather wait for Delphi to get Linux platform than wait for FPC to become Delphi compatible.
I don't have time to patch the compiler because I don't exactly write free or opensource software.

But the wake up call for FPC will come when the commercial component developers start dropping FPC.
« Last Edit: July 28, 2014, 03:52:12 pm by Fiji »

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Anonymous Methods
« Reply #38 on: July 28, 2014, 04:00:34 pm »
But the wake up call for FPC will come when the commercial component developers start dropping FPC.
However, I suspect the wake up call for Delphi has come and gone. They're irrelevant in the application development marketplace now.
 
As FPC is not commercially driven, it can afford to go on as it is doing today.
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: Anonymous Methods
« Reply #39 on: July 28, 2014, 04:18:08 pm »
I rather wait for Delphi to get Linux platform than wait for FPC to become Delphi compatible.
I don't have time to patch the compiler because I don't exactly write free or opensource software.
But what about patching the library?

Somehow, patching a library could be easier and faster than waiting for the next compiler release (either Delphi with Linux, or FPC with 100% delphi compatibility).

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: Anonymous Methods
« Reply #40 on: July 28, 2014, 04:35:31 pm »
I rather wait for Delphi to get Linux platform than wait for FPC to become Delphi compatible.

If you have the luxury of waiting, then it was never real to begin with.

Quote
I don't have time to patch the compiler because I don't exactly write free or opensource software.

What you use and what you write don't need to be the same license.

Quote
But the wake up call for FPC will come when the commercial component developers start dropping FPC.

Maybe. If it is so important, maybe they'll contribute the said support.

bylaardt

  • Sr. Member
  • ****
  • Posts: 309
Re: Anonymous Methods
« Reply #41 on: July 28, 2014, 06:30:48 pm »
Quote
I rather wait for Delphi to get Linux platform

You really believe delphi codes (read windows codes) become with 100% compatibility when compiled on linux?

LOL

Leledumbo

  • Hero Member
  • *****
  • Posts: 8746
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Anonymous Methods
« Reply #42 on: July 29, 2014, 03:13:36 am »
But the wake up call for FPC will come when the commercial component developers start dropping FPC.
Well, since you're quite new here, I believe you have no idea how FPC has grown in commercial environment. Yes, we've faced pesimistic user vision like what you just said, and not just once. But we survived and keep growing. So, IMHO, your pesimistic view is pointless.
Quote
I rather wait for Delphi to get Linux platform

You really believe delphi codes (read windows codes) become with 100% compatibility when compiled on linux?

LOL
I somewhat agree. EC never consider Linux as a treasure island like Windows and Mac. Feel free to wait, Fiji. I hope you don't wait forever :P

mangakissa

  • Hero Member
  • *****
  • Posts: 1131
Re: Anonymous Methods
« Reply #43 on: July 29, 2014, 08:48:27 am »
Quote
I rather wait for Delphi to get Linux platform

You really believe delphi codes (read windows codes) become with 100% compatibility when compiled on linux?

LOL
You all forget something. It's not Delphi who is working on Apple, IOS and Android.
Firemonkey is a whole different thing. It has his own libraries to communicate with different OS. Lararus/FPC tries to use the same code for all kind of OS.

The project delphi has now two frameworks: VCL and FM (and you pay for it)
Lazarus 2.06 (64b) / FPC 3.0.4 / Windows 10
stucked on Delphi 10.3.1

Leledumbo

  • Hero Member
  • *****
  • Posts: 8746
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Anonymous Methods
« Reply #44 on: July 29, 2014, 11:00:19 am »
Quote
I rather wait for Delphi to get Linux platform

You really believe delphi codes (read windows codes) become with 100% compatibility when compiled on linux?

LOL
You all forget something. It's not Delphi who is working on Apple, IOS and Android.
Firemonkey is a whole different thing. It has his own libraries to communicate with different OS. Lararus/FPC tries to use the same code for all kind of OS.

The project delphi has now two frameworks: VCL and FM (and you pay for it)
Yep, but it won't work automagically on Linux. GUI library is at the high level, building executable is low. This includes but not limited to: executable format, linking method, startup routine, OS interface, etc.
And there's a big difference between LCL and FM. FM matches LCL Custom Drawn interface philosophy by drawing everything itself, but LCL itself only encapsulates the gluing, drawing is mostly done by the underlying widgetset.

 

TinyPortal © 2005-2018