Live data from Hacker News

Imba – A new programming language for the web

imba.io

131–140 of 180 posts

Re: Imba – A new programming language for the web

#131
post #122

The author of imba has some problems understanding languages vs frameworks/libraries. I quote: "Imba is a new programming language for the web that compiles to performant and readable JavaScript." Ok, so i understand Imba is a language spec with an implementation that compiles to javascript. "It has language level support for defining, extending, subclassing, instantiating and rendering dom nodes." Ok so there is spe…

I think they were comparing based on the performance of a simple application:

"For a semi-complex application like TodoMVC, it is more than 20 times faster than React with less code, and a much smaller library."

I think the comparison makes sense because Imba seems to imply a lightweight framework. At least, the generated code in the examples on the front page references a `t$` function, which has to come from somewhere.

Re: Imba – A new programming language for the web

#132
post #122

The author of imba has some problems understanding languages vs frameworks/libraries. I quote: "Imba is a new programming language for the web that compiles to performant and readable JavaScript." Ok, so i understand Imba is a language spec with an implementation that compiles to javascript. "It has language level support for defining, extending, subclassing, instantiating and rendering dom nodes." Ok so there is spe…

There's no rule that says the language/library/framework divide has to lie where contemporary scripting languages put it. In PHP and ColdFusion, HTML is part of the language; in Ruby or Python it's usually relegated to a templating library; in Javascript the DOM is usually a library and it's bad practice to build up HTML strings (in 2015, at least; in 2008 it was good practice to build up HTML strings, because it was orders of magnitude faster than using the DOM). In Matlab or R, statistical and linear-algebra functions are part of the language, while in Python they're a library. In C++, strings, hashtables, and arrays are part of the standard library (or not even that, in early versions), while in Python & Ruby, they're part of the language. In Lisp the language parser is part of the language; in Rust, C++ (under Clang), Python, and Go it's part of the standard library; in many other languages it's not available at all.

There are certain best practices that have emerged for general purpose languages. Imba is not a general purpose language; it's explicitly meant for web programming, and makes sense that it would build common web programming functionality into the language itself.

Re: Imba – A new programming language for the web

#133
post #130

Earlier quoted context omitted.

Here's a quick (incomplete) list of web innovations you can thank the Ruby community for either popularizing or inventing outright: * REST * Many parts of ES.next * Front-end build tools * CSS pre-compilation * JS transpilation I spent years happily using multi-line template strings while JS developers informed me how idiotic I was for using a transpiler. Since Ruby's goal is to be a language that brings joy to the u…

> REST No. Rails populated a form of REST and everybody likes to pretend everything Rails is REST and there are a ton of frameworks trying to imitate Rails' approach to REST but Rails neither invented REST nor was it the one thing making REST popular. It was a major factor, yes, but claiming this purely as an accomplishment of Ruby is silly. I would be willing to give Ruby the point for MVC because of ActiveRecord bu…

> It was a major factor, yes, but claiming this purely as an accomplishment of Ruby is silly.

A major factor in popularizing it, as I claimed. Personally, I had never heard of it before DHH's 2006 RailsConf keynote. Could you point me to another web framework that had implemented it before 2006?

> Some of the syntax was influenced by CoffeeScript (nobody doubts that -- in fact, TC39 members have explicitly referenced it on more than one occasion) but the features are neither novel nor unique to Ruby.

Again, CoffeeScript was popularized by the Ruby community, as uptake increased greatly when it became a default in Rails. The syntax was heavily influenced by Ruby, which then found its way into ES.next.

> Front-end build tools

The Rails asset pipeline was actually listed as the inspiration for Brunch, the closest you can get to replicating its functionality in JavaScript. This went a long way towards popularizing the notion.

> I agree that CoffeeScript is the first one that gained major traction in the startup scene > although most teams seem to have realised that the drawbacks aren't really worth it (not just the transpilation...

Yes, and CoffeeScript first gained traction within Rails. You also seem to be discounting the obvious popularity of ES.next transpilers.

> The Ruby community is very vocal and self-important but it's neither as uniquely innovative nor as much of an influence as its members like to make it out to be. If PHP is the kindergarden of programming languages, Ruby is the angsty teenager complaining about how nobody understands them and writing blog posts about their deep insights gained from flipping through Atlas Shrugged.

This is rude, untrue, and unhelpful. Be civil. https://news.ycombinator.com/newsguidelines.html

Re: Imba – A new programming language for the web

#134

I actually think this looks really good, but 3 things: 1. 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 k…

Contrariwise, implicit creation of local variables is my biggest pet-peeve with languages like Python, so ymmv.

Re: Imba – A new programming language for the web

#136
post #130

Earlier quoted context omitted.

> REST No. Rails populated a form of REST and everybody likes to pretend everything Rails is REST and there are a ton of frameworks trying to imitate Rails' approach to REST but Rails neither invented REST nor was it the one thing making REST popular. It was a major factor, yes, but claiming this purely as an accomplishment of Ruby is silly. I would be willing to give Ruby the point for MVC because of ActiveRecord bu…

> It was a major factor, yes, but claiming this purely as an accomplishment of Ruby is silly. A major factor in popularizing it, as I claimed. Personally, I had never heard of it before DHH's 2006 RailsConf keynote. Could you point me to another web framework that had implemented it before 2006? > Some of the syntax was influenced by CoffeeScript (nobody doubts that -- in fact, TC39 members have explicitly referenced…

> The syntax was heavily influenced by Ruby, which then found its way into ES.next.

I pointed out the major syntax additions of ES6 and to what extent they are based on Ruby or not.

> You also seem to be discounting the obvious popularity of ES.next transpilers.

I'm not. Babel and other "ES.next" transpilers are drastically different in spirit from CoffeeScript. With some exceptions (e.g. JSX and Flow type annotations) most of the syntax it adds to JS are either already part of the language and just not widely supported (i.e. ES2015) or experimental proposals for new language features intended to eventually land in a future JS spec.

CoffeeScript doesn't work because it requires you to learn a new language on top of JS. ES.next works because it's bleeding-edge JS (plus some speculative additions). The code you write for Babel today will likely run without transpilation in a JS environment a year or two from now.

This is a general trend in web technologies. CSS pre-compilers like Sass are being replaced or enriched by CSS "post-compilers" like postCSS (that consume vanilla bleeding edge CSS and spit out CSS that works today). JS transpiler languages like CoffeeScript are being replaced by ES2015 (and speculative ES.next) with compilers that translate the code to JS that works today (or yesterday, even -- Babel generally works fine with IE8/ES3 if you use the necessary shims and shams).

Your point is that Ruby's role to all of the developments you mention is essential and unique. I'm arguing it's not. By far.

The only remarkably unique thing about the Ruby community I keep noticing as an outside its rise and fall of the Brogrammer culture and the aftershock we're still experiencing to this day. But even that, I think, would have happened even if Ruby never existed.

Re: Imba – A new programming language for the web

#137
post #17

Earlier quoted context omitted.

Imba was actually forked from CoffeeScript three years ago. After the fork there's been a bunch changes, both in terms of adding tags, but also when it comes to the object model and variable scope. - Implicit calling: `foo.bar` calls `foo.bar()` and `foo.bar = 123` calls `foo.setBar(123)` - Objects have instance variables that's separate from the methods. Well, technically the instance variable `@bar` is just stored…

Re implicit calling: what would you write if you wanted to access `foo.bar` as a function instead of calling it?

I'm also wondering this. It looks like a huge design error.

Re: Imba – A new programming language for the web

#138
post #14

Disclaimer: 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.…

Can you comment on why the project was kept private? Don't mean that as an implicit criticism: I'm just curious.

Re: Imba – A new programming language for the web

#139
The tag syntax looks like the biggest advantage over ES6. Couldn't ES6 do that though as a template string type? -- like

    dom` ${contents} `
As far as I can tell on a quick google, this remains to be done. (I saw some hits for HTML string templates as opposed to direct DOM construction.)

Re: Imba – A new programming language for the web

#140
post #136

Earlier quoted context omitted.

> It was a major factor, yes, but claiming this purely as an accomplishment of Ruby is silly. A major factor in popularizing it, as I claimed. Personally, I had never heard of it before DHH's 2006 RailsConf keynote. Could you point me to another web framework that had implemented it before 2006? > Some of the syntax was influenced by CoffeeScript (nobody doubts that -- in fact, TC39 members have explicitly referenced…

> The syntax was heavily influenced by Ruby, which then found its way into ES.next. I pointed out the major syntax additions of ES6 and to what extent they are based on Ruby or not. > You also seem to be discounting the obvious popularity of ES.next transpilers. I'm not. Babel and other "ES.next" transpilers are drastically different in spirit from CoffeeScript. With some exceptions (e.g. JSX and Flow type annotation…

> CoffeeScript doesn't work because it requires you to learn a new language on top of JS.

The folks that have been quietly productive with CoffeeScript for years, and have and continue to make millions of dollars because of it, would likely disagree with you on that point.

> Your point is that Ruby's role to all of the developments you mention is essential and unique. I'm arguing it's not. By far.

> The only remarkably unique thing about the Ruby community I keep noticing as an outside its rise and fall of the Brogrammer culture and the aftershock we're still experiencing to this day. But even that, I think, would have happened even if Ruby never existed.

Well, you've failed to sway me on that (by far), and the clear chip on your shoulder you have regarding the Ruby community as a whole leads me to believe your vociferous arguments to the contrary might be motivated by something other than your desire to spread the truth.

Post reply on HN