If the answer is "instead," is it a language and a view framework?
Imba – A new programming language for the web
21–30 of 180 posts
Re: Imba – A new programming language for the web
#22I don't think of react as a language, but rather a virtual DOM + JSX. This looks like a nice modern syntax which is both an ES6 focused minimal JS (removing unnecessary tokens) with HTML building included.
Re: Imba – A new programming language for the web
#23Re: Imba – A new programming language for the web
#24React is a template library, not a language.
JSX is a way to write templates, but that's not react, and its not what react does. It's just a shortcut to writing XML.
You could say this is a competitor to JSX, perhaps; but anything more is hyperbole.
People aren't using react and angular because they have a nice syntax, that's just nice, they use them because you can build applications with them.
How do you build ui components using imba? Use react? :P
Re: Imba – A new programming language for the web
#25Disclaimer: I've been following the development of Imba while it's been a private project (for six years now). Lately I've been helping out fixing bugs and improving smaller parts of the language. Having tags as a proper part of the language is very nice. This just works in Imba: for event in @events if event:type == "like" elif event:type == "comment" In React I'd have to use `map` and refactor parts into variables.…
Re: Imba – A new programming language for the web
#26Thank you for not saying "transpile".
Yup. "Transpile" is "compile" for those who're too young to ever have worked with a compiled language.
Re: Imba – A new programming language for the web
#271. Why differentiate it from CoffeeScript so much? Why not call it DOMCoffeeScript or something? Are there any core language changes from CoffeeScript other than the tag features?
2. I'm not sure how I feel about the mixture of XML tag characters with HAML/Jade-like indentation. My gut instinct is to always look for a closing tag with XML/HTML. Why not use some kind of sigil like % or @ or ! to represent a tag, since clearly the requirement for both a left and right caret is now obviated?
3. Why require the `var` keyword instead of making it the default? That's one of my biggest pet peeves with languages like Javascript and Lua. Local-by-default always makes the most sense.
Re: Imba – A new programming language for the web
#28Is there more information about how the 'very efficient rendering' part works?
1. It store the previous rendered tag and does a diff. (Just like React).
2. Every tag is compiled to JavaScript that's easy for the optimiser.
tag event
"Hello world!"
Compiles to: // Setting up the tag-object. Then:
tag.prototype.render = function() {
return this
.setChildren(Imba.static([
(this.$a = this.$a || t$('h1').setBar("123")).setBaz(bar)
], 1))
.setText("Hello world!")
.synced()
}
While React passes an object of props around, Imba will instead call setters. These setters are very easily inlined by modern browsers. Also note that it caches directly on the tag object itself which gives another additional boost. Since it caches the objects themselves it can also compare everything with `===` and/or `indexOf`.The `Imba.static`-call marks an array as static which is a guarantee that the structure of the array won't change. In this case Imba will not do the full diff-algorithm, but instead compare each item element-by-element.
And yes, once you've achieved the minimal amount of DOM changes needed (like React), the next step for performance is all of these little tweaks. Does it matter? It all depends. Imba is capable of rendering bigger applications than React when you use the "render everything over again in the animation loop".
TLDR: The tags are more integrated into the language. The language is also designed around features that's easy for the optimiser.
Re: Imba – A new programming language for the web
#29Re: Imba – A new programming language for the web
#30Anybody know the color scheme for the code on this page?