|VIM In The Browser - The Magic of WASM|
|Written by Ian Elliot|
|Wednesday, 18 July 2018|
Who knows, there may be some fatal flaw in the WASM project that means its potential will never be realized, but it is important to understand that perhaps we are on the verge of a sea change.
WASM - Web ASseMbly is a fairly low level representation of a program that consists of a set of syntax trees that lend themselves to be executed either by direct interpretation, by a VM, or by being compiled to native code. The idea is that the representation of the code should allow fast execution with minimal need for further syntactic analysis.
At the moment all of the latest versions of the most used browsers support WASM. What this means is that if you take a compiler like LLVM C and convert its intermediate bit code into WASM, then you can run a C program on a browser, or anywhere WASM is accepted.
Of course, things aren't quite as easy because a program like VIM assumes that there is an operating system and other libraries. You still have to do some work.
Developer rhysd on GiHub has a repo where you can avoid the work and just download and run it. There is even a link that will just open VIM in your browser - I hope you remember the command to get out of it.
The project does highlight some of the difficulties in working with WASM and one in particular might be the problem that means that its success is not a certain as its supporters would have us believe.
Yes it is impressive that you can run VIM in a browser, but it is mainly impressive because of the amount of work that has gone into it. In a paradoxical way, it would be more impressive if it was easy.
The big problem with WASM at the moment is that compiling a range of languages into a common executable format isn't really what we want. Both .NET and Java do exactly this and they haven't managed to take over the world completely. The real task for WASM is that it has to provide all of the non-language features that are involved in an execution environment. In this sense the WASM project is more like WINE - the provision of a Windows environment under Linux. The development of WINE has proceeded over the years so that you can run more and more Windows apps, but there is always something more to do and always an app that breaks the emulation.
WASM has to get easier to use and for this to happen the development input required is huge. It isn't enough to simply create browsers that can execute the code.
Now all I can ask for is EMACs in the browser. and then we can start the whole EMACs v VIM argument over again, but this time with a side order of which browser is best. Somehow I don't think this scenario would attract the right sort of programmer.
One Million Programmers Want To Escape Vim
Which Code Editor Do Devs Prefer?
Survey Reveals Developer Preferences
Practical Vim, 2nd Ed (Pragmatic Bookshelf)
To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.
or email your comment to: firstname.lastname@example.org
|Last Updated ( Wednesday, 18 July 2018 )|