News for hackers. Stuff that matters.
Re:Imba – A new programming language for the web by javajosh on Thursday August 20, 2015 @02:58PM (#10093894)
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 by sindreaa on Thursday August 20, 2015 @06:36PM (#10095036)
Thanks for the feedback. What do you mean with global variables for class state? We do consider moving class-bodies inside an actual function (again) - but there is a virtual scope there in the compiler. So

    class A
	var i = 10
    var i = 20
Compiles to

    function A(){ };	
    var i1 = 10;
    var i = 20;
So they are actually scoped even though it does not look like it in the compiled js. I'm looking really forward to improving the sublime plugin to show much more stuff from the compiler and warn about calls to undefined methods etc. There is a lot of analysis from the compiler that can be used to improve the ide-like experience.
Re:Imba – A new programming language for the web by javajosh on Thursday August 20, 2015 @08:00PM (#10095296)
Ah, okay, well that example makes it clearer. It wasn't clear from your example (or from my local test) where you just show this:

   class Todo
	# variable defined in class scope
	var count = 0
Which compiles into this:

   var count = 0;
And also your example page elides the IIFE that your compiler surrounds all output with, implying (falsely) that it's global.

As for ST, I think that for me based on my brief experience, you might want to add more compiler warnings to the watcher. (Basically I messed with Imba locally with two ST windows side-by-side, looking at Imba on the left and js on the right, treating the watcher output as compiler output.) Don't get me wrong, ST feedback is great, but the watcher feels more canonical. Besides, not everyone has ST!