imba - web apps

Imba is quite new and unknown, but seems very suitable for me to develop new web apps (client and server), as it boils down to plain JavaScript.

Its a DSL (Domain Specific Language) made for web development inspired by ruby and python. The syntax is short and tidy.

It follows the approach of a compiled inline dom/memoized dom. It treats DOM elements as first-class citizens. Making it really fast.

The language also supports Single File Components, like one would expect from any other framework with web components.

Here the github page

The authors created the language for themselves to have a tool that fitted their need to create rapidly fast web apps. As far as I know they do not claim to be stable or to replace any existing frameworks, but to actually convince them, to adopt the inline dom pattern.

There are yet some very impressive self-speaking projects built with it, like:

I am not affiliated with them in any way, or have much experience with imba. I just think its worthwhile to have a look into it, in order to support new web “frameworks”. I stumbled on them when I was reviewing things for vue.js.

Who wants to get a quick impression of it and how it works, for those I recommend highly the screencasts (made with scrimba):

or watch the approach presented in this youtube video:

I created this post, as @happybeing pointed out that its maybe being worthwhile to have a own discussion about it.

SAFE Imba Demo

Jump to:

SAFE Imba Demo

3 Likes

Thanks for posting this. I don’t have enough time to dig into Imba but have watched the talk and that was useful.

I’m not sure how it compares to Svelte, but I’d like to understand that! I know Svelte uses a different approach compared to the other frameworks wrt the DOM, but I don’t know if it is fast for similar reasons.

I suspect Svelte is the way to go rather than Imba because of their ecosystems.

Svelte is young, and not so complete as more mature frameworks, but the resources and community are exceptional, while from the sound of it, Imba is not ready for adoption and not likely to grow in that respect. The opposite is true for Svelte, already impressive, easy to learn, very helpful community, and lots of people improving and using it.

I am still interested though, so if you try it out or want to share what you learn about it please do. I’ll ask the Svelte guys about it if I remember - busy for a couple of days now.

2 Likes

The thing with Imba is, that it is a game changer, as they totally abandon the idea of a virtual DOM, if I got it right. It seems to be another beast.

The DSL boils it down to JS and ensures, that only real DOM elements, that need to be updated or created will actually change. So the memoized DOM is like a bunch of precompiled decision trees. When an action happens one starts at a certain point and just runs along the flow of the decisions. Thus there is no need to track any state or make a diff for a virtual DOM.

I’ll try to translate the web app example to Imba, to have some fun learning it and SAFE, too.

2 Likes

Yes, I understood how it is different to the frameworks he mentioned, but I’m not sure how it is different or perhaps similar to Svelte which is also very different to the others. Did you watch the Svelte presentation? It also shows impressive performance comparisons and works differently to React and Vue, but I don’t remember enough detail from the implementation to compare it with Imba.

Great, please share and we can compare the code! If you look at the OP in the Svelte topic I’ve updated it with the status of my Svelte version of the SAFE tutorial app - so if you can make something similar that could make a neat comparison. Mine isn’t working yet, but if you look up the 7guis CRUD example (linked in that post) you can see roughly what I’m aiming for in terms of UI.

The more options the better, so I’m glad you are going to test Imba out. Good luck :slight_smile:

1 Like

I’ll go for

which also includes

Sorry, I just a assumed that it also uses a virtual DOM. Actually I liked to find out at their page, but… the internet is still broken. I reviewed svelte some time ago, but actually forgot everything about it.

1 Like

So svelte and imba are doing the same thing I guess. Its just a matter of choice and the development ecosystem. Just, that imba on the top has created an awesome DSL, which make it even more clean.

In this example svelte seems to be a little bit faster then imba (18:00):

It feels like comparing LESS with Stylus

I’ve looked at the language and it looks good. It indeed seems like Imba and Svelte are similar as an alternative to the virtual DOM. I wouldn’t start using Imba soon though, for the same reason I’ve never adopted Elm. Their strength might be the DSL, but that would be my argument to skip it. They can’t really be integrated incrementally.

I like to stick to more standard tools and languages. Especially now that the Web Components standard gains popularity.

I’m a bit out in a limb here (still learning), but my understanding of Svelte is that it doesn’t restrict you and works with other frameworks and so on. I might be wrong, but that’s my impression and I’m looking forward to testing that out at some point.

Yes, sorry for the confusion, that comment was not about Svelte, but about the DSLs Imba and Elm. It was actually meant as a comment in favour of Svelte.

I guess what I meant was that I prefer to stick to JavaScript APIs and the language, instead of moving to a DSL. A DSL takes time to learn and become somewhat proficient at (though the same can be said about the Vue and Svelte frameworks).

1 Like

SAFE Imba Demo

I have written a small TODO-App with Imba and used the same API code as @happybeing has done for the SAFE Svelte Demo.

safe-browser-example

I’ve created a scrimba playground for those, who just want to fiddle around with the web-app:

The repository is available at:

I had some initial trouble with Imba, but once I understood the examples from the guide it got better.

I really like the language, but the imba community is really small and there isn’t even an imba or ìmba-lang tag at stackoverflow.com for it. So much debugging by oneself and even reading the generated code as suggested in this community guide.

Happy coding!
Sebastian

3 Likes