Jump to content
Sign in to follow this  

Concerns about compatibility with other Pascal compilers

Recommended Posts

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.

Share this post

Link to post
Share on other sites
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




Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this