[fpc-pascal] Interface syntax: Is possible don't use specialize in mode objfpc?
Michael Van Canneyt
michael at freepascal.org
Fri Jul 17 08:57:39 CEST 2015
On Thu, 16 Jul 2015, silvioprog wrote:
> Currently I made a wery fast websocket server using Node.js, and I had some dificult to find an updated WS Pascal client compatible with FPC 3 and XE8, so I found one called Bauglir websocket, after
> some changes I could compile it in both compilers. But I found some comercial clients, but unfortunatelly it could not compile in FPC because they are using generic classes from the Delphi
> Generic.Collections. Ironically, there are zillions WS clients written in JS.
This is not ironical; websockets are an interface made specially for the browser.
Websockets are useless somewhere else, where everyone uses TCP/IP long before the browser existed.
So, since JS is the language for the browser, naturally there will be lots of websocket clients.
And: I repeat, I am not advocating against people using Delphi mode.
People that care about Delphi syntax and compatibility should use
Delphi mode, period.
Mode objfpc is meant to implement new features in a more pascal like fashion - in the opinion of the FPC devs.
If you don't agree: no problem. Use mode delphi.
> To me, that tells me that all these additions to Object Pascal which everyone claims are 'so essential' are in fact pure nonsense. Eye candy to make it look modern.
> Buddy, I don't think so. Pascal is a very nice language, but it could be modernized to be compatible with the current very fast necessity of our customers, allowing us to do core more fast, and this new
> features (generics, custom attributes etc) could be very helpful. Yes, in mantis there are already many more important issues to be fixed, but we can see some people interested in helping to do these
> new features, so IMHO I think it would be interesting to hear them a little more. =)
I am not stopping anyone from using generics. I am just not convinced by your arguments.
The code you posted - to me - only shows that your design is wrong to begin with.
(see the remark by Graeme).
Generics, to me, are just there to circumvent or assuage the strict typing of pascal.
typing to begin with.
JS has no attributes either, in fact, it has none of the features you claim will help you.
Yet you will move to Node.js, and so to JS. Why ?
Simple: there is a bigger community, and more ready-to-use code floating on internet.
The language itself has absolutely nothing to do with it.
More information about the fpc-pascal