Call: +44 (0)7759 277220 Call
PeteFinnigan.com Limited Products, Services, Training and Information
PFCLScript

PFCLScript

Introduction

PFCLScript is a simple scripting language currently implemented in PL/SQL. The project started out as a way to show that it is possible to do extreme programming in PL/SQL. My first language was C and C can be used for system level projects such as writing operating systems like Unix or Windows or to write compilers and interpreters or to create multi-tasking software or virtual machines...

I like PL/SQL and have been programming it for around 32 years since the mid 1990s. I write a lot of PL/SQL and have given away a lot of scripts and free tools written in PL/SQL, many on this site and also with the materials of my training classes. I wanted to show that PL/SQL can also be used to do system level programming and as I said I called it Extreme PL/SQL. I have plans to write even more low level tools/code/things in PL/SQL if and as time allows in addition to what is presented here.

This first project started out as an implementation of an interpreter written in PL/SQL to parse and execute a simple version of the BASIC programming language. As I created the PL/SQL I kept notes of all of the development so that the complete story of the development and design of the language and the interpreter will be added to this site as a set of blogs or chapters of a book even though its not a printed book.

These chapters or articles will be added to this page which will act as an index page for all interpreter and compiler articles and possibly more complex or Extreme PL/SQL. I have also written a VM in PL/SQL and an assembler in PL/SQL and also a compiler written in PL/SQL that generates ASM to be run in the VM.

The final goal is to embed the VM or the interpreter into an existing PL/SQL program so thatb it can be scripted and modified at run time.

Why?

Why did i want to do this project?

As I said I write code in C and one of the things we have done is written parsers for PL/SQL in C using Lex and Yacc for our PL/SQL code security analyser and also for our PL/SQL obfuscator. One part of those applications and also part of our database scanner for Oracle security is the use of the Lua programming language. We write a lot of checks in Lua and we have embedded Lua into our C code. This is a design feature of Lua; to be able to embed the language into your own applications and extend the language to add your own calls to your own code.

This is exactly what I wanted to do with this scripting language. I want to provide a stand alone script language that can be used to extend PL/SQL applications including those in APEX. I want a user of a PL/SQL language based application to be able to extend the application not through screens of settings or parameters or... but be able to do that through scripts. We could use PL/SQL to extend an application BUT this is a risk for security. If we embed a script parser into an application then we limit how the script interacts with the whole application.

This is what we will achieve with this script interface; allow it to be embedded into any PL/SQL application

Article Series

There are three sets of articles that have been written and created by Pete Finnigan and presented here. The first is the articles on the design and creation of the interpreter written in PL/SQL; The second is the articles written on the design and build of a VM, Assembler, Compiler and associated test suites also written in PL/SQL; The third set of articles is covering the embedding of scripts into existing PL/SQL.

There are in fact four sections as there is also a small section listing existing blogs on the subjects of compilers, interpreters, assemblers, virtual machines (VMs) all written in PL/SQL.

Existing Blog Articles

There are a few articles already released that refer to this project. These are listed here and may be extended outside of the main article series - some may not be directly about languages, interpreters or compilers but they are part of the development:

Articles about the design and development of the Interpreter

Here is the list of articles / chapters for the development of the PFCLScript language and interpreter. As articles are added I will announce on social media. This list is an indication of the articles to come but they may change slightly before release and additional ones could be added:

Articles about the design and development of the VM, ASM and Compiler

Here is the list of articles / chapters for the development of the VM, ASM and compiler for the scipt language:

Embedding a virtual machine into an existing PL/SQL program

Here is a list of articles/chapters explaining how to embed the virtual machine into existing PL/SQL programs:

Future

I plan to do more with this scripting language. The obvious thing is to convert to a compiler and generate ASM and then assemble that into a binary and then provide a virtual machine in PL/SQL to execute that binary. This will allow more Extreme PL/SQL programming but most likely better speed of execution.

NOTE: I reserve the right to release this as a commercial product.... or not....