Live data from Hacker News

Show HN: Imba – I have spent 7 years creating a programming language for the web

news.ycombinator.com

71–80 of 354 posts

Re: Show HN: Imba – I have spent 7 years creating a programming language for the web

#71

Quick question - how does the memoized DOM compare with no-virtual-dom-at-all approach of something like Svelte?

https://krausest.github.io/js-framework-benchmark/2020/table... This lets you choose from multiple frameworks - comparing svelte against a few react variations, what I saw was that svelte was always fastest, but usually by a factor less than 2 (any react was 1.x times slower than the svelte). The imba vs react numbers (from the article at https://www.freecodecamp.org/news/the-virtual-dom-is-slow-me... ) shows a 30-40…

Tbh, I think the js-framework-benchmark is flawed. It mostly tests the performance of the browser. I should write a whole blog post about this. Just as an example, all the table benchmarks uses a table with non-fixed width, which results in a full repaint AND layout of the whole table+page whenever a cell changes. If you change the table to a fixed width (as all real tables are) the relative difference between the frameworks increase by a factor of 5 or more.

And when you benchmark the speed of creating 10000 dom elements in an instant, less than 5% of the time should really be spent inside the framework one is supposed to test.

I stand by my claim in the mentioned article that tiny changes to a larger dom tree is a far better indicator of real world performance than anything else. Here Imba is really orders of magnitudes faster than react.

The last time I tested it, Imba was more than 10x faster than Svelte as well, but I'm not proficient enough in Svelte to claim that as a fact, and I have tremendous respect for Rich Harris and everything he's done with Svelte and other libraries.

Re: Show HN: Imba – I have spent 7 years creating a programming language for the web

#72
post #6
post #5

One thing that irks me about Javascript is "const". I think it should have been called "con". "var", "let", "con". So the first thing I did here is look up the docs and see how variables are declared. Aaarghh.. "let" and "const" again :)

Tbh, var is actually deprecated since v1, so any mention of var in the docs is a mistake. Are there any other languages using 'con' for constants?

No, but there should be!!

Re: Show HN: Imba – I have spent 7 years creating a programming language for the web

#73
post #62

Earlier quoted context omitted.

Lisps don't have reserved words, generally.

Not even cons and defun?

Depends on what you mean by "reserved word". In Common Lisp, you can define your own cons and defun, provided that you're not attempting to mutate the respective symbols from the COMMON-LISP package. That can be achieved by either defining your own cons and defun and shadowing the cons and defun from the COMMON-LISP package (typically for function or macro bindings), or just straight up using cons and defun from the COMMON-LISP package in "legal" ways - for example (let ((cons 1) (defun 2)) (list cons defun)) is legal and evaluates as '(1 2) since using those two symbols as names for lexical variables doesn't break the running Lisp in any way. In the former case (of defining your own functions/macros accessed as "unqualified" cons or defun from your own code) it's up to you if you consider cons and defun to be "reserved words" based on their package or not (packages for reserved words being something that languages explicitly recognizing the concept of a reserved word don't seem to have, so it's not clear how this should qualify). In Scheme, a Lisp-1, it's kind of free-for-all, especially in R5RS where you don't even have to bother with hiding standard bindings.

Re: Show HN: Imba – I have spent 7 years creating a programming language for the web

#74
I’m sick of programming languages that use “fast typing” and “productiveness” as a selling point. There’s no selling point in being productive doing a counter in a few seconds, production scenarios are far more complex and very often all those new programming languages fall short to their promise. Btw I don’t want to be fast or productive, I want to write code that works decently and is great for other humans myself included

Re: Show HN: Imba – I have spent 7 years creating a programming language for the web

#75
post #31

Looks cool. I'm honestly curious as to why a lot of new web languages/frameworks are mixing logic and content in the same file again though. The distinction between HTML, JS and CSS always made perfect sense to me. Anyone care to enlighten me?

> The distinction between HTML, JS and CSS always made perfect sense to me. Really? HTML is already heavy on syntax, and the whole point of SGML-style angle-bracket markup is to invisibly structure text hierarchically and sneak in rendering properties or other "metadata" not rendered to the user, via attributes. In which universe, then, has it ever made sense to write rather than in a document representation language…

Not that I disagree that what we have today is a big mess but this sounds to me almost like the philosophy behind the old PHP version that everyone seems to hate. Personally I'd much rather have everything separated in a better HTML/CSS/JS than HTML+CSS+JS in one big pile. But I'm also not a fan of JavaScript at all, especially not of the hyped "one framework today, another tomorrow" that is JS development today. In my opinion in that area we are moving backwards very quickly.

Re: Show HN: Imba – I have spent 7 years creating a programming language for the web

#76
post #71

Earlier quoted context omitted.

https://krausest.github.io/js-framework-benchmark/2020/table... This lets you choose from multiple frameworks - comparing svelte against a few react variations, what I saw was that svelte was always fastest, but usually by a factor less than 2 (any react was 1.x times slower than the svelte). The imba vs react numbers (from the article at https://www.freecodecamp.org/news/the-virtual-dom-is-slow-me... ) shows a 30-40…

Tbh, I think the js-framework-benchmark is flawed. It mostly tests the performance of the browser. I should write a whole blog post about this. Just as an example, all the table benchmarks uses a table with non-fixed width, which results in a full repaint AND layout of the whole table+page whenever a cell changes. If you change the table to a fixed width (as all real tables are) the relative difference between the fr…

Flawed in what sense? I don't doubt that there are some conceptual drawbacks, and this only benchmarked chrome, not other browsers. I do think there's some utility in relative comparisons that have a standard/fixed baseline, as it would still seem to show what overhead a framework/library brings to the table.

FWIW, my initial impression of imba is that it's very impressive. I do think you rightly point out that, at this point, it may still be hard to leave larger ecosystems of react/vue/etc. DOM/UI speed of the project's JS toolkit generally has not been any meaningful impact in the projects I've worked on in the last several years - the data size and audience and app space just don't really call for it. However... as my needs change, imba will be something I'll revisit. Thank you.

Re: Show HN: Imba – I have spent 7 years creating a programming language for the web

#77
Really interesting project! I will definitely be trying it out today. One question—although you criticize some of the more common vdom benchmarks, I think it is still valuable to see where the dom updating strengths and weaknesses are in various approaches. Have you run any of the more standard frontend benchmarks on this and compared? I think it would be cool to see an entry for imba in the js-framework-benchmark table, especially considering your claim of low memory footprint.

https://github.com/krausest/js-framework-benchmark

Great work so far, I’m excited to give imba a spin.

Re: Show HN: Imba – I have spent 7 years creating a programming language for the web

#78
post #77

Really interesting project! I will definitely be trying it out today. One question—although you criticize some of the more common vdom benchmarks, I think it is still valuable to see where the dom updating strengths and weaknesses are in various approaches. Have you run any of the more standard frontend benchmarks on this and compared? I think it would be cool to see an entry for imba in the js-framework-benchmark ta…

I will try to add v2 to that benchmark relatively soon - it is a lot faster than v1 and has a much lower memory footprint and faster initial load time :) Should probably combine it with a few pull requests to the benchmark itself - as I consider it pretty flawed (see another comment here).

Re: Show HN: Imba – I have spent 7 years creating a programming language for the web

#79
post #74

I’m sick of programming languages that use “fast typing” and “productiveness” as a selling point. There’s no selling point in being productive doing a counter in a few seconds, production scenarios are far more complex and very often all those new programming languages fall short to their promise. Btw I don’t want to be fast or productive, I want to write code that works decently and is great for other humans myself…

It depends. If your work is to create a new counter app every day to support some specific, single usecase, in other words you write a lot of simple apps and not a single complex one, then it’s definitely a win for productivity.

Re: Show HN: Imba – I have spent 7 years creating a programming language for the web

#80
post #31

Looks cool. I'm honestly curious as to why a lot of new web languages/frameworks are mixing logic and content in the same file again though. The distinction between HTML, JS and CSS always made perfect sense to me. Anyone care to enlighten me?

This is exactly why I prefer Angular to React.

Our designer wouldn't have been able to deal with HTML markup within the JS files in React. Having the HTML and (S)CSS separated out made life much easier for him in Angular.

(edit: Naturally downvoted due to being slightly critical of React on HN. Which happens every time.)

Post reply on HN