Live data from Hacker News

Vim.js - JavaScript port of Vim

coolwanglu.github.io

61–70 of 107 posts

Re: Vim.js - JavaScript port of Vim

#64
post #3

Really cool! It even supported doing things like: inoremap jj `^ Backspace ended up triggering the browser's back action though. Other than that, this is really nice. Edit: After looking at the source, this seems to make use of emscripten to reuse Vim's existing source code. This really makes me wonder what other cool things we can bring over to the client side.

… There are still browsers that use backspace for navigation? (I'm a little surprised by this because I've seen so many complaints about it leading to data loss.)

There are still browsers that don't maintain form state across back/forward history?

(I'm a little surprised by this because I thought all browsers used backspace for back)

Re: Vim.js - JavaScript port of Vim

#66
post #47

While this is impressive, I find it surprisingly slow compared to much more demanding applications with bigger code bases compiled via Emscripten. Any ideas why?

Well, I don't know what you mean by slow, but it could be the use of setTimeout() every 10ms to simulate[1] Vim's synchronous busy-wait is affecting responsiveness. Lu mentioned[2] on vim_dev that it was necessary to write a hack for this portion. [1] https://github.com/coolwanglu/vim.js/blob/master/web/vim_lib... [2] https://groups.google.com/forum/#!topic/vim_dev/AQTHbUHijgg

Yeah, I hit this same road-block when trying to port vim to JS and gave up because it didn't seem worth it after that. If only vim ran a regular event loop, it would have been such an easy port, compared to what they had to do here. When figuring out how I could overcome it, I remember reading accounts of KDE developers trying to embed vim into their widgets and failing over and over. In the end, there was a solution to "embed" vim with some special IPC the netbeans IDE developers put into vim, but you had to run vim as a separate process for that to work - which is not possible on the web as it stands today. The numerous synchronous busy-wait loops in vim killed all approaches I had considered, so kudos to these guys for figuring out a way, even if it's slow.

Re: Vim.js - JavaScript port of Vim

#67
post #49
post #27

Who wants to make a javascript emacs? you could call it emscriptenmacs..

ymacs (Fabrice Bellards Emacs "clone") is installed in jslinux.

Ymacs is written by Mihai Bazon. It has nothing to do with Bellard. http://www.ymacs.org/

Edit: And it’s _written_ in JS, not ported.

Re: Vim.js - JavaScript port of Vim

#69

Earlier quoted context omitted.

That would be Atwood's Law: any application that can be written in JavaScript, will eventually be written in JavaScript. http://www.codinghorror.com/blog/2007/07/the-principle-of-le... And tlrobinson's Law (or corollary?): Any submission to Hacker News about a novel JavaScript program will contain a comment referencing Atwood's Law. https://twitter.com/tlrobinson/status/395636386671235072

What about emacs in Linux in JavaScript? :-) http://bellard.org/jslinux/

It would be missing a good editor. Probably not a bad operating system however
Post reply on HN