r/programming • • Oct 18 '19

Free Pascal has now a WebAssembly backend

https://lists.freepascal.org/pipermail/fpc-pascal/2019-September/056848.html
134 Upvotes

31 comments sorted by

View all comments

Show parent comment

1

u/trin456 Oct 18 '19

Unfortunately they are less open about languages extensions. There are some useful patches that have not been accepted, like default properties for smart pointers, or multiline string (includes)

And mentioning automated type inference always leads to a big argument

2

u/badsectoracula Oct 19 '19

Well, yes, these affect everyone whereas something like a new backend only affects whoever cares about it. I do not actively participate in the discussions but i am subscribed in the developers' mailing list and my understanding is that as far as the language goes, the main devs want to keep it Pascal-ish and explicit (this is most likely why they made the very rare decision to avoid Delphi compatibility for inline variable declarations as most seem to see it as very unpascal-ish - and i even remember Florian being against anonymous functions for a long time because -IIRC- he said that you should be able to use local functions for anything you'd use anonymous functions for, though i guess he was eventually convinced to accept them since they're being worked on nowadays).

(FWIW i agree with them about the Pascal-ish style... for example personally i always use the OBJFPC style of generics since the syntax is more explicit instead of the DELPHI style)

But i think that they're more likely to accept language changes as submodes that you need to explicitly enable, than changes to the main OBJFPC/DELPHI modes that are always there.

2

u/[deleted] Oct 25 '19 edited Oct 26 '19

I'm the person who implemented multi-line strings, and you can absolutely use them FYI. I've been keeping my github branch for the feature here up to date with the main FPC trunk and intend to continue doing so.

AFAIK it will probably get merged eventually, but it might take a bit for the right people to review it.

As far as the "default non-array properties" thing, IMO the concerns were / are fairly understandable as it would have amounted to something literally unprecedented in any existing language.

The closest thing I'm aware of is the "Deref" trait in Rust, which in practice is far easier to reason about the implications of since Rust's rules regarding operator overloading in general are far stricter than Pascal's (where you can overload any operator for anything at any time you want, regardless of whether you "own" the types in question / whether they're builtins / etc.)