Introducing COMPEL: A command based interpreter and programming language

imageToday I open source and share with you my final year project called COMPEL for my Computer Science degree from the American University of Science and Technology in Lebanon.

I started the project back in early 2006 and worked on it for something close to 6 month while maintaining a part time job, freelance jobs and my part time studies.

Today, 8 years later, when looking back at the amount of work I did and the level of professionalism, I am still satisfied with the COMPEL project.

I hope you will find this project useful!

What is COMPEL?

The word “compel” as defined in a dictionary literally means “Make someone do something”. The project’s name is carefully selected to denote that the syntax used is a command rather than a full syntax like other programming languages.

COMPEL is a command based interpreter, that is, when it receives a command it interprets it accordingly. The name “COMPEL” also looks very similar to the world compiler, and borrows some of the compiler constructions techniques.

COMPEL is a double faced project:

  • The first part is a developer library, facilitating the command line interfacing and scripting facilities integration within one’s application. It is comprised of an SDK for C/C++, .NET and Delphi
  • The second part provides:
    • An integrated development environment (IDE): A full blown IDE to allow you to write scripts and debug them all from within the IDE.
    • A standalone command line interpreter: It allows you to run scripts from the console (or command prompt)

The developer library is a set of APIs that programmers can use while writing their software, so that they can allow their application to accept commands either typed by the user or commands read from a file (script file). The programmer is saved from the burden of reading the input file and analyzing the commands and interpreting them. The developer’s task is then trimmed down to just two steps: the first is to implement the function (or command) from the high-level programming language and the second step is to bind the function with COMPEL’s scripting engine.

When COMPEL is used as a standalone interpreter, through COMPEL’s IDE, it serves as very simple and easy to learn programming language well suited for teaching programming concepts such as allowing novice users to easily grasp programming concepts, creating a program from scratch, translating a thought or idea into a program, locating bugs and errors using the integrated debugger, using breakpoints and watches to control the program’s flow and least but not last how to execute an instruction at a time (single stepping) in a complex program in order to assimilate its overall function.

Please check the following documents for more information:

Please remember that this project is 8 years old and may contain incorrect, inaccurate or facts that do not apply anymore. Use it as an educational tool and feel free to improve it or point out bugs / mistakes.

Features highlight

COMPEL is a fully featured scripting language. It is far more superior than Batch Files and much more easy to learn than JavaScript, Python or PowerShell.

Let me highlight some of the most important features of COMPEL:

  • COMPEL with roughly 16 extensions allows you to do most of the programming operations needed to write a elaborate program logic.
  • COMPEL IDE is very handy. It allows you to write scripts and debug them all from the same place within its editor
  • COM automation built-in extension: it allows you to instantiate COM objects and programmatically use desired COM objects. For example, you can use COMPEL to automate Microsoft Word or Microsoft Excel. Similarly, you can use the Speech API to have your COMPEL script read text out loud.
  • COMPEL SDK: COMPEL is highly programmable. Much easier and simpler than you imagine.
    • Using the SDK is so simple, compared to other languages such as Python/C integration
    • All of the SDK functions are fully documented.
    • SDK is available for the .NET, Delphi and C/C++ languages
  • COMPEL ships with two useful extensions that allow you to write interesting and fun scripts:
    • Canvas extension: allow you to create graphical elements, draw lines, circles, change font, write text, etc…
    • DirectShow extension: The direct show extension allows you to write multimedia able applications. You will be able to play audio files and other multimedia files.
  • COMPEL is free, original and open source!

Please check the design manual or the language syntax for a full reference.

COMPEL IDE features highlight

The COMPEL IDE has the following features:

  • Edit and debug source files
  • Saves and Restores Workspaces
  • Manage source level breakpoints
  • Provides variables watch window
  • Allows live script editing



flower separator

Closing words

Thank you for spending some time to read about COMPEL. If I have met you, my reader, in real life, then I would have asked about your background and expressed something like this:

  • To those who admire programming but did not get started yet: start doing something about it now and try COMPEL. It is a very simple language and very forgiving when it comes to syntax errors.
  • To the young programmers looking to adopt an old project and improve it: go ahead, fork it and improve it
  • To those programmers who are bored and want to do something else: It would be nice to port the IDE to .NET framework
  • To university students: also feel free to adopt this project and improve it
  • To the open source enthusiasts: please help port COMPEL to Linux

I always enjoy it when the readers leaves comments or suggestions. If you use COMPEL and like it, then I would love to hear from you.


flower separatorYou might also like:

One thought on “Introducing COMPEL: A command based interpreter and programming language

Leave a Reply