Live data from Hacker News

Imba – A new programming language for the web

imba.io

31–40 of 180 posts

Re: Imba – A new programming language for the web

#31
I have to admit I was really not excited to see this:

    var answer = if number == 42
The language looks shockingly pleasant in a number of ways, but everything being an expression seems odd. Would somebody mind helping me understand the value (semantic, performance, etc.) of such a choice?

Re: Imba – A new programming language for the web

#32
post #3

I 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.

It's confusing they made a whole nice language that doesn't speak about react VDOM diffing which .. was the whole point right ?

Hi. We actually do a different kind of diffing - which turns out to be substantially faster than React: http://somebee.github.io/todomvc-render-benchmark/index.html. The language has just been released, it is still very lacking when it comes to documentation. Working on it :)

Re: Imba – A new programming language for the web

#33
post #17
post #6

"if Ruby and React had an indentation based lovechild, what would it look like?" Let me guess!... CoffeeScript?

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…

- Implicit calling: `foo.bar` calls `foo.bar()` and `foo.bar = 123` calls `foo.setBar(123)`

Wuhh. Why wouldn't you use JS defineProperty here?

Re: Imba – A new programming language for the web

#34

I have to admit I was really not excited to see this: var answer = if number == 42 The language looks shockingly pleasant in a number of ways, but everything being an expression seems odd. Would somebody mind helping me understand the value (semantic, performance, etc.) of such a choice?

Expressions compose

Re: Imba – A new programming language for the web

#35

I have to admit I was really not excited to see this: var answer = if number == 42 The language looks shockingly pleasant in a number of ways, but everything being an expression seems odd. Would somebody mind helping me understand the value (semantic, performance, etc.) of such a choice?

CoffeeScript (which this is forked from) has some parts like this that I strongly dislike, such as using the unless keyword after an action. For example:

    doSomeThing() unless person.present
For me that utterly destroys readability - in my mind, when I see a (), that function is being called there and then. The fact that you can invalidate that later in the line confuses me deeply - and it doesn't really provide any benefits above an if statement anyway.

The rest of CoffeeScript is great though, don't get me wrong. (though ES6 JavaScript has taken the best features anyway)

Re: Imba – A new programming language for the web

#37

This isn't a competitor to react; its a competitor to ES6/typescript/coffeescript. React 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 nic…

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}"

Re: Imba – A new programming language for the web

#38

Earlier quoted context omitted.

It's confusing they made a whole nice language that doesn't speak about react VDOM diffing which .. was the whole point right ?

Hi. We actually do a different kind of diffing - which turns out to be substantially faster than React: http://somebee.github.io/todomvc-render-benchmark/index.html . The language has just been released, it is still very lacking when it comes to documentation. Working on it :)

Fair enough, I guess you have other more important things to do then.

Re: Imba – A new programming language for the web

#39

I have to admit I was really not excited to see this: var answer = if number == 42 The language looks shockingly pleasant in a number of ways, but everything being an expression seems odd. Would somebody mind helping me understand the value (semantic, performance, etc.) of such a choice?

Technically, the language has patterns (e.g. identifiers) too.

A major semantic benefit of expression-oriented programming is minimizing state while maximizing composition (e.g. compare and contrast a switch statement to pattern matching).

Re: Imba – A new programming language for the web

#40
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.…

You can do that right now with CoffeeScript+React and it looks almost identical:

    {ul, li} = React.DOM
    # require in like and comment components here...

    ul {},
      for event in @events
        li {},
          if event.type is "like"
            like {event: event}
          else if event.type is "comment"
            comment {event: event}
Post reply on HN