Starting a thread to record my journey as I explore possibly making an inform-inspired programming language. I don’t really have anything substantial done yet, but I have started doing some research.
The thought started here after me thinking about what it would take to make an LSP for inform7.
Now I’m thinking I’d rather just experiment with making my own language that is very inspired by inform.
From my research so far it looks like training a CRF is really simple and can get nearly state-of-the-art accuracy on part of speech tagging. One example is Part-of-Speech Tagging using Conditional Random Fields: Exploiting Sub-Label Dependencies for Improved Accuracy, though we probably don’t need the optimization that that paper presents so much since it didn’t seem to increase accuracy all that much on English.
I can use the crfs crate for training the part-of-speech tagger, instead of implementing the algorithm myself.
For lemmatization, I can use a dictionary taken from the Universal Dependencies word trees that maps words + their part of speech to their lemma. I’ve already got the dictionary generator working, and I can add some simple suffix-stripping fallback rules for verbs and adverbs to create guessed lemmas for out-of-vocabulary words.
I still need to figure out the best algorithm for constructing the tree of the words in the sentence from the (word, lemma, part-of-speech) tags. Stanza is a useful reference, but it uses more neural networks, and I’d like to keep things simpler and faster than that if the accuracy is acceptable.
Inform7 uses an extremely limited subset of English grammar so I should at least be able to tag most inform sentences I’d think, but I’d also like it to be more flexible. It doesn’t need to work for everything, though. The LSP should help show where it can’t understand things, so that you aren’t too confused or annoyed while writing, and you can just simplify the sentence if it doesn’t understand it.
Anyway, that’s about as far as I’ve gotten. If I can create a parser that can decently tag the lemma, part of speech, and the tree structure of a sentence, then I can do more research on how inform bootstraps grammar meaning and work out what that might look in this new language.
Eventually I’ll need a name for the project. I’ve thought of reform which sounds too high and mighty, deform which sounds too negative, and conform which would make more sense if I was trying to be inform compatible, which I don’t think is a useful goal.
It probably shouldn’t be anything form because I’ll probably do this in layers and make the language not even specific to interactive fiction anyway.
I’ll figure the name out later.
I’ll just go ahead and make comments as I make progress and we’ll see how far I get. This will probably come to nothing, but you never know… ![]()