This article stems from a practical problem. If you’re worried I’ll be barking up my own tree, you are right. Otherwise, read on and bark along.
My new code editor is now available for trying out. ee-ide doesn’t boast much for now, but the underlying application platform, Kippu (?Kiphu) – based on a trial F* implementation, is more than promising, and I feel encouraged given a mere 52 hours logged into my project manager.
When quoting that I write development tools, I often meet a do we need another IDE shrug kinda thing. People just quote Eclipse and Netbeans, or backtrack to IntelliJ.
I beg to differ. Have a look at Antegram for web or Antegram for java and you’ll get a feel of how alluringly different an IDE can be.
Now to the point. ee-ide is a kind of prequel to Antegram. Since I dropped XML annotated code for now (just for now), I may have to give in a little to the establishment:
- Syntax highlighting
- Code validation
- Hinted typing (e.g: displaying a drop down menu showing all functions available from a given variable)
I can’t really dedicate time to each and every language out there, and a soon to be, fast and ready extension framework won’t allow me to just sit and wait (for somebody else to integrate parsing functionality on a case basis). Instead, I’ll be looking for simple analysis techniques to help me providing fairly reliable services. For example:
- Discovering language tokens – An example of that is when a token appears in all, or nearly all, files of a given type.
- Semantic closure – a name occuring only once in a file is a sign that something’s going on. It could be that the name hasn’t been spelled correctly, or it could be that the name is defined elsewhere (for example, in a file referred by name in the current source file)
- Terminals – given correct productions in a given language, we can surely evaluate with fair confidence what does (and doesn’t) count as a valid line terminal.
- Brackets – even if we don’t know what bracketting style is used outfront, we can use valid code to detect ‘immutable pairs’ that constitute brackets in a given language.
- Foreign forms – just today, a colleague pointed out my giving into old habits by declaring variables using C++/Java syntax. Unfortunately I meant writing AS3 code. This kind of error shouldn’t be too hard to spot, even without language specific knowledge.
I’ll definitely have some fun trying to write reliable solutions using generic strategies, and I hope the result will match my expectations.
Finally comes the question: why should somebody use ‘rough and ready’ technology while the competition uses strict parsers that get it right every time? Three answers to that:
- Rules versus Practice – where a strict parser lets you write any code, a soft parser willl potentially endorse good practices – what might be perfectly OK according to a parser may amount to poorly formatted, awkward code, and the soft parser will let you know.
- Graceful performance degradation – even if your code is a weird avatar of an existing language that doesn’t really compile until it gets processed in some way, or code written in a really obscure language, a soft parser is more likely to discover (and respect) patterns idiosyncratic to your source files without giving up on validation altogether.
- It’s a N-body problem - never mind the fact that F*(and some other stuff coming really soon) will make extending ee-ide and other Kippu apps a gentle breeze, I’ll be iterating the proof that 10 years off the beaten track likely got me to be a happier and more productive developer than average. This time I’ll have pretty standard features to lure you in and the quixotic, yet commonsense stuff that’s motivated the Antegram iterations in the first place plus other stuff that mainstream IDEs don’t really bother bringing up, given that dominating the market isn’t the biggest incentive for innovation.
If you’re not deeply shocked by my lack of excitement and interest for regular parsers
…wish me good luck.