Research Log

Research Log: November 2013

# November 3, 2013

I began the RQE process today by submitting my abstract and the names of 3 faculty members I propose for the committee. It's looking like there might not be much programming this month. I'll be preparing for the RQE and working on a fellowship application.

# November 11, 2013

Two new modules today, as I start my trek to learn from all the mistakes I've made in JavaScript instrumentation.

falafel-helpers

falafel-helpers is where I'll be trying to put all the source rewriting hacks that you'd otherwise need to be aware of when creating more invasive instrumentation. For example:

None of the exceptions are too annoying on their own, but they add up and that's a lot of the reason fondue is a mess.

esprima-selector

Brian Burg wrote about declarative instrumentation and I wrote this library to help me mull it over concretely. Falafel gives you a callback for every node in an AST. esprima-selector gives you callbacks for all AST nodes that match CSS-like selectors.

This example would match the BlockStatement corresponding to every function declaration, wrapping its source with calls to start() and end():

var src = falafel(fs.readFileSync('test.js', 'utf8'), eselector.tester([
    {
        selector: 'program declaration.function > block',
        callback: function (node) {
            node.update("{start();" + node.source() + "end();}");
        },
    },
]));