Creating a scripting language: establishing structure

In the previous article, a lexing ruleset was established, but lexing by itself does nothing to describe the actual structure of a language. It’s more like outlining its phonology, closed lexical categories, and maybe its basic morphology, but it does nothing to express how these things relate to each other; that’s the role of the language’s syntax, which is what will be described here. (In most compsci literature, this stuff is all called the grammar, and I will be using the terms interchangeably) (more…)

Creating a scripting language: establishing a foundation

Anyone who’s trawled through my projects knows that I love Python: it’s simple, it’s flexible, it does almost everything well, and it just works. It’s also a very good fit for this project, since part of the system driving it is being implemented using Boost, which means that Boost.Python is just a small step away for setting up a cross-language control structure. (Before anyone complains, I’ll freely concede that something like Haskell is an ideal candidate for building a new language from scratch, but I’m cheating and using an existing compiler-compiler to skip the parts functional languages are best at)

Within the realm of Python, a number of good compiler-compilers exist, with each having its own pros and generally very few cons (some are implemented in C, some offer great insight into the compilation process). Of what’s available, I decided to use David Beazley’s excellent PLY, for its extensive documentation, maturity, clear expression methodology, and portability (I need to be able to support Windows, too, unfortunately). (more…)

Creating a scripting language

As part of a revitalisation project for a complex system at work, I’ve concluded that one of our sustainability requirements could be best served through use of a specialised, extensible, implementation-independent scripting language.

Since programming language theory is something that’s always interested me, I wanted to make what I’m learning accessible to anyone else who might find it beneficial. Chances are this mostly includes computer science students encountering recursive-descent parsing for the first time or those in an entry-level compiler-construction class, so I’ll be writing towards that knowledge-set, but anyone sufficiently curious should be able to follow along. (more…)

Not updating nearly often enough

Well, seems I wasn’t able to keep my momentum going with the updates.

For anyone interested, Quickshot is stable and available from Launchpad, in both its server and client pieces, though the sevrer’s setup-on-Apache-guide hasn’t yet been written, and we lost direction near the end, when the Manual Project’s project manager got swamped. We’ll get back on track soon, though.

Another Quickshot teaser

Following quickly on the last update (a trend I intend to continue), here’s a screenshot of the non-admin side of the entry created in the last page, demonstrating what a project owner will see when looking at a project version’s status. I decided to include part of the browser interface this time, to show the pretty URL structure, which is sure to be welcome when it comes time to advertise for help with projects.

Each language link (visible and accessible only to owners, due to resource consumption) will lead to a section that allows screenshots to be approved in a task-oriented manner, rejected screenshots older than a minimum age to be purged (age enforced to prevent rogue vandalism), and, for exceptional circumstances, approved screenshots to be rejected. Important features from the first iteration, open in the tabs on the left, will return as well, albeit with a substantial facelift; highlights follow, for those who didn’t play with the original: archived downloads of approved screenshots, access to reference images, and the ability to browse everything in the system. All in all, it should be quite intuitive and smooth.

New changes, design-wise: implementation of a “you are here” bar that sits beside the already-existing (but not-always-visible) admin bar, to balance functionality with whitespace, sans fonts, tasteful and informative progress indicators, and eye-catching-but-not-distracting inline help.

Quickshot teaser

Although it will still be about another month before the server is functionally complete (when I’ll start working on the client, alongside the other project members), I figured now would be a good time to provide a screenshot of the new Quickshot design in its early stages.

This image doesn’t capture much (there are a number of unrepresented project variables, since the architecture is parent-inheritance-driven), and the styling is sure to change once the functionality is complete enough to warrant the involvement of one of the Ubuntu Manual Project‘s web designers, but I think it shows enough to whet the appetite of anyone who’s been longing for a system to simplify the inclusion of screenshots in their multi-lingual documentation: tiered project management, project-family-common settings, support for languages at generic and dialect levels, OpenID-based administration, browser-configurable settings, human-grokable status messages, support for privacy at both the family and project levels, and the capacity for projects to go inactive (either by flipping switches or, though unpictured, setting deadlines).

Symmetric encryption in pure Python (Blowfish)

For a project at work, it became obvious that I would need to implement some form of partial encryption between hosts in a self-configuring network. Nothing super-extreme, of course, since all traffic will exist within a closed environment; I just need enough protection to prevent casual observers from finding out enough about the protocol to inject malicious packets and provide some simple handshaking between the components of the system.

Blowfish came to mind as a good scheme for handling this (each host and operator can be considered sufficiently secure, so sharing an application-specific pass-phrase via config-file is an acceptable solution), and a small amount of Googling turned up (based on, though I doubt that’s the original site), which I ended up using as the basis for my implementation. Actually, ‘basis’ isn’t the right word, since I didn’t change any logic at all. Rather, I just replaced the more antiquated data-types and access methods with more modern equivalents, restructured the layout, and sought to bring things more in line with PEP 8. The result being a slightly faster, leaner implementation that’s a bit more readable.

My code, with an identical interface to Ivan Voras’s version, dual-licensed under the GPLv1 and Artistic Licenses, like the original, is reproduced below:

A month of silence

Between a general lack of free time and a number of short-term tasks, I haven’t had much of an opportunity to do anything with the projects hosted here (or even to prepare for PyWeek). Work will resume next month, once I’ve got a real schedule around which to plan my time.

What time I’ve had has been contributed to the development of Quickshot for the Ubuntu Manual project, so it could make the deadline imposed by the launch of 10.04. Progress is steady, so look forward to the first release of the manual in its many languages, if you’ve been on the fence about switching.

Hymmnoserver update

It’s still not fully up-to-date, but all At3 words identified by aquagon have been added to the database. Note: A full translation check was not performed, since most of the words looked right and aquagon’s translations are usually quite accurate.

Though not reflected on the (presumably abandoned) Japanese site, a section on the Risshizentsukuyomi sister-language will be added to the Hymmnoserver in the next update (probably next weekend).