barraclough at apple.com
Tue Jan 10 14:20:31 PST 2012
On Jan 10, 2012, at 7:33 AM, Andy Wingo wrote:
> Hello JSC hackers,
> I've been thinking for some time now that there is room for another
> command-line shell for JSC.
Some more things to add to the wish list:
* tab completion (e.g. "Math.si" -tab-> Math.sin)
* persistant command history over invocations
* binding results of prior commands to variables in global scope.
(I believe that the readline library has some useful hooks we're not currently using to help with the first two of these).
> Specific things that one might want to support in the new shell would be
>> ,profile f(1)
>> ,disassemble f
> Meta-commands are commands for the shell, not expressions to be
> evaluated. As expressions can't begin with a comma, we would abuse the
> comma to introduce those meta-commands.
for (var func in foo.prototype) disassemble(foo.prototype[func]);
> There would also be a meta-command to inspect and modify the current
> heuristics, to turn the JIT on and off, etc. These options could also
> be turned on and off from the command line.
> So, I wanted to solicit some thoughts on this idea before going to
> implement it. I really think that the right place for a project like
> this is in WebKit proper, rather than in some external tree, as that way
> it will always be in sync with JSC.
Yes! - we'd definitely love to have a better shell in the project.
One other random thought, it might be desirable if the shell were written to the JSC API, rather than being written directly against JSC's internal headers. If the current API is insufficient we can expose some additional functionality through private headers. This is certainly not a requirement, but it would be a cleaner way to do things, and would serve as a really great test for the utility & design of our API (and may be helpful in informing future improvements).
More information about the webkit-dev