Vimium in Coffeescript?

58 views
Skip to first unread message

Phil Crosby

unread,
May 27, 2012, 1:41:24 AM5/27/12
to vimiu...@googlegroups.com
Hey everyone,

I've been considering porting Vimium to Coffeescript. With it, we can avoid much of the drudgery of Javascript (bulky for-loops, binding "this", and others) and have shorter code. In past projects that I've ported directly from JS to CS, it has resulted in a 25% reduction in lines.

What are your thoughts? I'm hoping the major pros would be that Vimium is more fun to hack on and we get a more manageable code base. The cons are that the Vimium code base would be accessible to fewer people.

The developer workflow is that Vimium gets written in .cs files and a build script would watch them and recompile as soon as they're changed.

-Phil Crosby

Ilya Sukhar

unread,
May 30, 2012, 2:22:14 PM5/30/12
to vimiu...@googlegroups.com
-1. This project doesn't have enough manpower to do timely pull request reviews. A full rewrite sounds doesn't seem wise at all.

Ilya

Phil Crosby

unread,
May 31, 2012, 5:21:20 PM5/31/12
to vimiu...@googlegroups.com
I chatted with Ilya offline and we're in agreement that Coffeescript would be good for the long term quality and maintainability of Vimium and wouldn't be prohibitively difficult.

I'd still like to hear whether anyone on this list feels like a Coffeescript code base would significantly increase the barrier for outside contributions, or on the other hand, whether it would increase their interest in Vimium.

Jez

unread,
Jun 1, 2012, 5:46:15 PM6/1/12
to vimiu...@googlegroups.com
I don't have much of a preference here. Pros: I think Coffeescript would definitely make for a terser codebase, and we could clean up some of the codebase while doing the refactoring, especially the global scope pollution. Moreover we could use js2coffee to make the port easier. Cons: Coffeescript is a moving target -- for instance, the recent upgrade broke a bunch of stuff in Doppio. Moreover, it still has several warts (e.g. broken for loops), so it _should_ continue to be a moving target. But it moves slowly enough that it should be no more than a minor annoyance.

Jez

Phil Crosby

unread,
Jun 13, 2012, 1:15:09 AM6/13/12
to vimiu...@googlegroups.com
Thanks for the heads up Jez. I hope we can leverage the benefits without being affected by changing syntax.

I've ported the code base to Coffeescript, which has made the refactor/rewrite of the Vomnibar internals possible. Now, to build Vimium:

1. Install coffeescript
2. run `cake build`

I've added these developer instructions to the readme. I cleaned up the global scope pollution in a few places, but not others. vimium_frontend.coffee in particular could still use substantial structural cleanups.

I'll send out a note about beta testing shortly.

Ilya Sukhar

unread,
Jun 13, 2012, 2:05:51 PM6/13/12
to vimiu...@googlegroups.com
Cool!
Reply all
Reply to author
Forward
0 new messages