"If Ruby and React had an indentation-based lovechild, what would it look like?" asks Norwegian developer Sindre Aarsaether, who answers his own question by introducing the new Web language, Imba.
The Web site for Imba, gets right to the point:
React, of course, is the popular new-age approach to Web UI coding that eschews many traditional programming conventions and has been brought to bear on mobile app development by its creator, Facebook.
Although Imba has existed as a private project for years and was introduced in beta on Hacker News about five months ago, the project just recently unveiled a new Web site and stirred up more interest with a new Hacker News post showcasing the site just today.
Originally, Imba was an attempt to make Ruby run in the browser, according to its GitHub page. Started some six years ago, the project was derailed by the emergence of CoffeeScript, which Aarsaether and his team later forked to meet specific needs, only to be picked up again and turned into a real language. The Ruby influence still exists, according to the project Web site. "It is heavily inspired by Ruby and Python, but developed explicitly for Web programming (both server and client)," the site says.
Aarsaether lists the highlights of the language thusly:
- Everything is an expression, including cases missing from CoffeeScript (returning from loops, break/continue with arguments and so on) without wrapping everything in anonymous functions all over the place.
- Implement syntactic sugar like in CoffeeScript, but with clean and performant code.
- Tags and query-selectors as native language constructs.
- Extremely performant rendering of Web-applications using tags.
Like React, Imba uses reusable components. "A custom tag/component can maintain internal state and control how to render itself," the site says. "With the performance of DOM reconciliation in Imba, you can use one-way declarative bindings, even for animations. Write all your views in a straight-forward linear fashion as if you could rerender your whole application on every single data/state change." Developers also have the option to extend existing native tags or inherit from them.
The new Web site, unveiled Dec. 27, includes sample coding snippets and documentation, things which had been lacking. "Up until now, it has been very difficult to learn Imba, even if you were really interested," Aarsaether said. "We still have a long road ahead, but at least we have docs, guides, and examples to lead the way."
Aarsaether is still working to improve the site along with the language. "The documentation is still lacking, and the ecosystem is in its early days," he said. "We are working on a more usable playground for testing."
For now, Sublime Text 3 is the sole official editor/IDE for Imba, though there are unofficial plugins for Atom and Vim. The site also includes links to a few samples, such as the TodoMVC project on GitHub.
Some Hacker News comments reinforced the need for better example apps, but some also expressed enthusiasm for the project. "I've been following Imba for the past several months since the initial announcement on HN," one commenter said. "I like the clean syntax, tags and high performance, so I hope you guys attract interest despite all the library/framework fatigue we're experiencing in front-end JS land. It's rather refreshing to be able to write code and view all together, like <div.marker>.css(appropriate_styling)."
"We'd love for you to try it out," Aarsaether said. "If you run into any trouble, make sure to file an issue or contact us on gitter. We'll do everything we can to help you out! Happy coding!"
David Ramel is the editor of Visual Studio Magazine.