Jump to content


Photo

Concerns about compatibility with other Pascal compilers

Delphi Free Pascal

  • Please log in to reply
1 reply to this topic

#1 Ñuño Martínez

Ñuño Martínez
  • Members
  • 28 posts

Posted 19 March 2016 - 03:53 PM

So I started to play with the Smart Pascal language.  I've read the "A Smart Book Sample" included in my evaluation copy and I have some concerns about compatibility with other compilers, specially Free Pascal.

 

It looks like there are no problems at syntax level, but there are problems with RTL units.  I know, modern compilers have added new unit naming conventions, and FPC will use it too (I'm researching my installation and I can't find it, but I'm pretty sure they'll do it if they didn't yet in FPC 3.0), and I'm not against evolution, but today it may be a problem for me.  Right now I don't know what code we will share between FPC and SMS, but I'm not happy with the idea of using conditional compilation, or to maintain two different units for each compiler where only the USES clause changes and 99% of code is the same.

 

Or may be I am wrong.  I mean, I've just read that Sample book and played few hours with the compiler and read some of the example sources.  May be the RTL is fully compatible (except the WriteLn procedure, that doesn't work.  I've tested.  No surprises anyway) but I didn't see that yet.

 

Anyway I'm tempted to write my own RTL units for SMS, fully compatible with FPC, and that would solve most of the problems.



#2 Laksekjønn

Laksekjønn
  • Members
  • 440 posts

Posted 21 March 2016 - 12:17 AM

Smart Pascal have several differences that clearly separate the dialect from standard Object Pascal.
 
Smart Pascal does not support generics, for instance. The original syntax of Delphi Web Script, from which Smart Pascal derives, was compatible with Delphi 7. Although, It allows to use as well as define whole classes (with polymorphism, meta-class and interfaces support, etc.). The scripting language is based on Delphi, but also supports syntax and features similar to Prism and FreePascal, as well as various language extensions. 
 
Does Smart Pascal support RTTI? 
Yes, there is already some low level support for RTTI, but no higher level “easy to use” functions yet.
Run-time type information is in-part supported, including the ability to enumerate properties and class members. 
 
BTW. Presently, I think RTTI is not currently working as expected in the ver 2.2.0 4447 RC
 
 
 






Also tagged with one or more of these keywords: Delphi, Free Pascal

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users