Skip to main content

ISHML: API for Parser IF (JavaScript)

Version 1 of ISHML has been released!

ISHML stands for Interactive Story grapH Management Library, but call it “Ishmael.” Its intent is to facilitate the creation of interactive fiction in JavaScript and is intended for client-side applications running in modern browsers.

The ISHML library is a fluent API with straightforwardly named properties and methods, many of which are chainable.

Eventually, ISHML will address all aspects of creating interactive fiction. For now, though, ISHML is just a really flexible and powerful recursive descent parser with backtracking, which is capable of returning multiple interpretations of a given input text.

In ISHML, you create a parser by defining a grammar. A grammar is a set of nested rules that describes the syntax tree to be generated during parsing. The structure of the grammar mirrors the structure of the syntax tree. Rules are, in spirit, a JavaScript adaptation of BNF notation.

There are many, many ways to configure the rules.

If you are looking to write Parser IF in JavaScript but don’t want to hand code a parser from scratch, this may be the library you’ve been looking for. I won’t say writing a good grammar is easy. It isn’t. However, it’s definitely easier than writing a parser. There is a lengthy tutorial and API reference here:

https://whitewhalestories.com

PS Its open source.

Comments

Popular posts from this blog

On Modeling Languages

Well, I was spending a lot of time wondering how far I could stretch the definition of  modeling language.  It turns out the definition is very stretchy. I was worried that a graphically oriented interface for ISML would cause it to cease to be a modeling language.  Turns out I was wrong. Quoting from Wikipedia :  A modeling language is any artificial language that can be used to express information or knowledge or systems in a structure that is defined by a consistent set of rules... A modeling language can be graphical or textual. ISML fits the definition well.  I'm going to stop worrying about my initialism and get back to work.

ISML Still Vaporware

ISML is still very much vaporware.  I've been going down many blind alleys during the brainstorming phase.  I've been throwing away lots of clumsy design concepts.  What remains, though, seems solid and interesting.  I'm not ready to publish these ideas at this time, but I will say that it's starting to look like the 'L' in ISML may stand for Lab rather than Language.