Live data from Hacker News

Imba – A new programming language for the web

imba.io

101–110 of 180 posts

Re: Imba – A new programming language for the web

#101
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…

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

Re: Imba – A new programming language for the web

#102
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.

> Ruby programmers would stop trying to avoid writing JavaScript by writing their own JS-based implementation of Ruby I would appreciate it if people knowing very little about programming languages stopped commenting on new languages. Nearly every comment here is either baseless or irrelevant or simply wrong. It's frustrating. In your specific case: CoffeeScript and this are most certainly not a "JS-based implementat…

That's why I said "their own" JS-based implementation.

And the point is that it goes out of its way to re-invent features already supported by ES6 just so they look more like Ruby. Like using string interpolation instead of template strings, for example.

It's not a language built on top of JS to improve upon JS, it's just as contrived as CoffeeScript (which unlike this one actually had a reason to exist in that it influenced the development of ES6 when a lot of features it implemented weren't yet part of JS).

What is the benefit of learning this language? Who is this for? JS programmers? No, they could just use Babel to write something that will eventually become vanilla JS.

Does it bring anything new to the table like ClojureScript or LiveScript does? No, it's basically CoffeeScript with ES6 scoping rules and JSX elements.

So in the end all it adds is another barrier to entry for new developers joining your project/company with the only benefit being that it's "prettier".

I'm not saying bad ideas aren't worth exploring -- they are, and if your bad idea happens to involve creating your own programming language, all the more power to you. But the only "good" reason to use this language is if you want your JS to look like Ruby.

Just like Haml is for people who want their HTML to look like Ruby; and like Sass (not SCSS, I mean the original braceless syntax) is for people who want their CSS to look like Ruby.

Re: Imba – A new programming language for the web

#104
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 user, I see nothing wrong with bringing that ethos to other languages. You yourself acknowledge the impact it had on the development of JavaScript.

We in the Ruby community will keep innovating, and you keep hoping that we'll stop, and we'll see which happens.

Re: Imba – A new programming language for the web

#105
post #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}"

Any plans for SVG support? I'm getting errors when using , but maybe there's some way to make it work?

Re: Imba – A new programming language for the web

#109
post #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}"

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.trim))
	        dirty
	      self
And the view+rendering (literally the whole "upgraded-HTML" of the app) is so compact:

    def render
		var all    = TodoList
		var active = all.filter do |todo| !todo.completed
		var done   = all.filter do |todo| todo.completed

		var items  = {'#/completed': done, '#/active': active}[hash] or all		

		
			
				 "todos"
				

			if all:length > 0
				
					
					
						for todo in items
							
								
									 todo.title
									
									

								

  ($$(.todoapp) or $$(body)).append #app

I'd enjoy being able to code a SPA like this, I think - nice work! If something this clean is already possible in some other language/framework/library, I'd love to hear about it (since I haven't been following recent JS developments closely).

edit: @judofyr, the Scroller example app doesn't work for me on Firefox 40.0.2 on Win 8. It works in Chrome.

Post reply on HN