Radically Cross Platform: Scripting with Kablooie

Photo of dog on screen of Apple Iic monitor by believekevin on Flickr.

This Dog is Turing Complete. (believekevin on Flickr)

How would you design your own ideal scripting language?  Would you go with a functional language in the LISP family, or with a more procedural style?  Would you offer object oriented organization?  Would large parts of your ideal language be recognizable as C or another common language, or would you "go for broke" with a domain specific language that (probably) only you will be able to read?

One of the fun things about computer science is that people will answer this question in very different ways, and they can all be right.  Almost everything (including your dog) is probably Turing complete.  And since the ultimate goal is accomplishing whatever operations the script is performing, whatever helps you express that well is the right answer, for you.

When implementing my cross platform graphical app engine, a set of characteristics began to crystalize for my ideal scripting language: (more…)

Project Plumbing with Plumbum (Part I)

Project Plumbing with Plumbum (Part I)

Bash scripting is hard, let’s go plumbing

Consider the following scenario:

Let’s say you’re working on a software project. Maybe it’s a web service, maybe a GUI app, whatever. Doesn’t matter. As usual, you discover there’s some tedious task that needs doing repeatedly, so you decide to automate it. Since it’s pretty much the easiest thing you can think of, you crank out a quick bash[1] script, which seems to handle things for the moment.

Later, you find some more similar tasks, so you crank out some more bash scripts. And then some more. Then you realize that you’re repeating yourself an awful lot, so you try factoring out some stuff, calling some scripts from other scripts. Eventually you realize that you have dozens of bash scripts calling each other in various combinations, scripts depending on other scripts three and four deep, parameter passing that makes your eyes melt from all the "$1"s, dogs and cats living together, mass hysteria!

But what else can you do? I mean, these scripts are basically just calling a bunch of command line tools, so we have to use a shell language to automate them, right?

Nope. Totally wrong.

Plumbum is a Python module originally written by Tomer Filiba which adopts the motto "Never write shell scripts again". You can use it to completely replace those pesky, unwieldy shell scripts with nice, clean, reusable Python.

(more…)

Adding Scripting to a Qt Application – Part 2

Adding Scripting to a Qt Application – Part 2

QT logoIn Part I of this set of articles we introduced the basics of adding scripting capabilities to your Qt application. In this article we extend that to allow the user to build and utilize his own QtDesigner-created widgets through script.

This article focus on adding more advanced capabilities of allowing the user to load widgets for UI files created in QtDesigner.

The example code used for this article can be found on github.

(more…)

Adding Scripting to a Qt Application – Part 1

Adding Scripting to a Qt Application – Part 1

Qt_master_logo_CMYK_300dpi

Adding scripting capabilities using Qt is a painless process that can give your application’s users incredible powers to extend the functionality of your application. You can expose limited functionality for simple actions or you can expose nearly everything in the application to let the user modify any aspect of the application (for power users obviously). How much power you give the user is up to you.

Combine the scripting capability with the QUiLoader class, which loads in Qt Designer-created files, and you’ve given the user the ability to not only interact with your application but also to extend it with their own widgets.

Part 1 will cover adding simple scripting capabilities and Part 2 will cover adding UI file loading and interaction.

(more…)

Contact Us