Live data from Hacker News

Imba – A new programming language for the web

imba.io

111–120 of 180 posts

Re: Imba – A new programming language for the web

#111
post #37

Earlier quoted context omitted.

Imba includes syntax for tags (scroll down to "Tags"), virtual DOM diffing, event handling (with touch support). Yes, React is not a language in itself, but there's quite big overlap in what Imba does and what React+JSX does. You build UI components like this: tag event event.title "Happening on {event.dateString}"

I find the structure of an Imba app rather intriguing; the view+rendering (i.e. tags) almost looks like an upgraded HTML/HAML (possibly akin to EnyoJS). http://imba.io/#/examples/todomvc/app.imba (this annotated app is illuminating, and ought to be put upfront on your site if possible) The methods are clean and readable: tag #app def dirty persist render def add title if title.trim TodoList.push(TodoItem.new(title.tr…

How does it handle data binding?

Re: Imba – A new programming language for the web

#112
Okay, so I just took Imba for a little spin. Some thoughts:

I like the way it looks. A lot. Love, love the tags. Really like the simplified object literals. The use of global variables for class state is deeply troubling - they are not scoped at all. The parser is far too forgiving. if you change do |x| xx into something like do x xx it will compile fine, but be wrong. The tooling is quite nice, and I like the defaults - although it's still a little bit of a mystery where the imba.js file comes from in the Hello World browser example (I ended up just copying it from Github). I'd like to see argument comprehensions, and the option to generate code outside of an immediately excuting function (so I can play with instances at the dev console)

I would like to see a "strict" mode for imba that chokes on a do block without pipes, for example. I think that if JavaScript has taught us anything it's that anal compilers might frustrate us at build time, but that frustration is nothing compared to the frustration down the line when things break at runtime.

Re: Imba – A new programming language for the web

#113

Earlier quoted context omitted.

I find the structure of an Imba app rather intriguing; the view+rendering (i.e. tags) almost looks like an upgraded HTML/HAML (possibly akin to EnyoJS). http://imba.io/#/examples/todomvc/app.imba (this annotated app is illuminating, and ought to be put upfront on your site if possible) The methods are clean and readable: tag #app def dirty persist render def add title if title.trim TodoList.push(TodoItem.new(title.tr…

How does it handle data binding?

It looks similar to React's one-way data flow - that render method produces the whole app view, and refers to all the necessary variables. When an event occurs [e.g. the user types text to add and hits enter]:

- the appropriate method is called [e.g. add]

- which mutates the state [e.g. TodoList.push(TodoItem.new(title.trim))]

- and then render is called, which updates the view/DOM

So in a sense it's not really data-binding, IMO - instead, the render method contains the entire view + view logic, and it gets called each time the state is changed.

Re: Imba – A new programming language for the web

#114

Personally, I am really over the white-space as a delimiter in my programming languages. I used to love python but that is a long lost love.

"You're gonna indent it anyway!"

"But you will have to read it later."

"If you mess up your indentation, you're in hell."

"Tabs or spaces? If the latter, how many of them?"

"On what particular character will I be able to hit % to find where the related block is started?"

...

Re: Imba – A new programming language for the web

#115

Earlier quoted context omitted.

This comes directly from Ruby via Coffeescript. It's aligned with a general approach of reducing syntax noise, and it can result in some really nice, clean code. It leads to a whole class of syntax possibilities, like implicit returns. There are probably some performance arguments against this in the case of Coffeescript, especially wrt constructing expensive return values that are immediately discarded. The consiste…

I think Ruby got it from PERL... And I'm not sure if PERL was the first language to use these, either. EDIT: of course, there's Smalltalk, where postfix conditionals and loops are the only form available. Maybe Ruby got inspired by those.

Algol 60 had conditional expressions. Pretty much every functional language and LISP has them. They've also been in use in mathematics for longer than computers have been around.

Re: Imba – A new programming language for the web

#118
post #87

I for once would appreciate it if Ruby programmers would stop trying to avoid writing JavaScript by writing their own JS-based implementation of Ruby. With ES6 and Babel this "new programming language" provides nothing interesting other than making your code look more like Ruby.

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…

Ruby did not popularize nor invent REST. The other points I don't feel like arguing about..

Re: Imba – A new programming language for the web

#119
post #89

Earlier quoted context omitted.

> some aspects of Ruby's syntax are well-loved. By Ruby programmers. Why is it that Ruby programmers are incapable of imagining anyone doesn't love Ruby? This isn't a universal truth for all programmers either. I've met plenty Java programmers willing to admit the shortcomings of Java, I've met PHP programmers painfully aware of the language's warts, I've even met Python programmers willing to admit Python's limitati…

By Ruby programmers. And clearly other people – or we wouldn't be seeing those syntax elements in other languages. Why is it that Ruby programmers are incapable of imagining anyone doesn't love Ruby? They're perfectly capable of that, and I think you've let your own prejudices cloud your judgement. I've yet to meet a Ruby programmer who doesn't believe that Ruby is the best thing since sliced Jesus. Hello, pleased to…

yeah sure - I was a bit troll-ish in the language. Let me elaborate. Imba is a spin-off of javascript intended for front-end use whose syntax is a mix of coffeescript, jsx and python as well Ruby imho; that said, please name a single use case in which Ruby will be without a doubt the #1 language for performance, scalability and all the other aspects involved in maintaining a business (including availability of programmers). Ruby is only second to PHP, which is just unreedemable (I'm even certified on it... http://www.zend.com/en/yellow-pages/ZEND005898 so don't think I'd refrain from criticizing languages I know, even very well).
Post reply on HN