[fpc-pascal] Looking for JavaScript component on FPC

Andrew Brunner atbrunner at aurawin.com
Thu Apr 2 04:24:32 CEST 2015


I have Besen installed and I am in the process of evaluating it.  It 
does not handle nested classes.
I need a JIT compiler that provide access to heavily nested class 
information.  This PostInfo is a simple database module that I would 
want Script to have access to.
---------------------------
// sample interface with no implemenation
---------------------------
Type
   PostInfo= class
   type
     IDs= class
     const
       ID                     = 0;
       InsertID               = 1;
       DomainID               = 2;
       IP                     = 3;
       Created                = 4;
       Form                   = 5;
       Data                   = 6;
     end;
     Keys=class
     const
       ID                     = 'ITMID';
       InsertID               = 'ITMIID';
       DomainID               = 'ITMDID';
       IP                     = 'ITMIP';
       Created                = 'IDTC';
       Form                   = 'IFRM';
       Data                   = 'IDAT';
     end;
     XML=class
     type
       Stanzas=class
       const
         Info               = 'pstinf';
       type
         Fields=class
         const
           ID               = 'id';
           Created          = 'ctd';
           IP               = 'ip';
           Form             = 'frm';
           Data             = 'dta';
         end;
       end;
     end;
     Email=class
     const
       Address              = 'au-eml-addr';
       NameSpace            = 'au-eml-ns';
       Subject              = 'au-eml-sbj';
       Body                 = 'au-eml-bdy';
     end;
     const
       TableP: PDatabaseTable = nil;
       MonitorP: PDBMSMonitorItem = nil;
       Startup: TDBTableIni = (
         AutoCreate: True;
         AutoCommit                   : True;
         Group: 'Domains/Storage';
         Name: 'Post Info';
         Value: 'scs_pstinfo';
         Hint: 'Table for accepting domain level form data from the web.';
         PrimaryField: Keys.ID;
         );
       Fields: array [0..6] of TDatabaseField = (
         (PropertyID: IDs.ID; DataType: dftQWord; AutoCreate: True; 
Verified: False; Precision: 0; Flags: cfNotNull or cfPrimaryKey or 
cfIdentity; Name: Keys.ID; ),
         (PropertyID: IDs.InsertID; DataType: dftQWord; AutoCreate: 
True; Verified: False; Precision: 0; Flags: cfNone; Name: Keys.InsertID; ),
         (PropertyID: IDs.DomainID; DataType: dftQWord; AutoCreate: 
True; Verified: False; Precision: 0; Flags: cfNone; Name: Keys.DomainID; ),
         (PropertyID: IDs.IP; DataType: dftQWord; AutoCreate: True; 
Verified: False; Precision: 0; Flags: cfNone; Name: Keys.IP; ),
         (PropertyID: IDs.Created; DataType: dftDouble; AutoCreate: 
True; Verified: False; Precision: 0; Flags: cfNone; Name: Keys.Created; ),
         (PropertyID: IDs.Form; DataType: dftShortString; AutoCreate: 
True; Verified: False; Precision: 255; Flags: cfNone; Name: Keys.Form; ),
         (PropertyID: IDs.Data; DataType: dftMemo; AutoCreate: True; 
Verified: False; Precision: 0; Flags: cfNone; Name: Keys.Data; )
       );

       class function  Post(Var Module:TDBMSModule; Var Task:TDBMSTask; 
DomainID,IP:QWord; Form:TVarString; Data:TVarString): Boolean;
   end;

--------------------------

I need a JITC to provide access to native FPC code that looks like this 
on the compiled side, but would be implemented like so in the cloud.

Before BESEN.Execute, would need to have access to FPC runtime variables 
like Module,Task,IP
if (PostInfo.Post(Module,Task,DomainID,IP,Form,Data)==false){
   Log('FAILED to write');
} else {
   Log ('WooHoo');
};

Nested classes are a modern way to organize complex API and code into 
very easy to read code.  Most of the modules I have are extremely 
nested, the one I chose here is easy and strait forward.

I see PascalScript is part of the Lazarus project now.  I have not been 
able to get nested classes to work there either.  If I am to get my code 
accessible, I will need someone with knowledge in extending BESEN or 
PascalScript or both.  I would be ideal to offer developers a choice of 
which scripting language they want to write back-end code.

But if I am to provide developers with instant API to do complex code 
that is relevant to computing needs of today, I will need access to 
nested objects in either of these JITCs.

Anyone familiar with BESEN or PascalScript that could shed some light?

-- 
Andrew Brunner

Aurawin LLC
512.850.3117
https://aurawin.com/

Aurawin is a great new way to store, share and enjoy your photos, videos, music, and more.



More information about the fpc-pascal mailing list