Live data from Hacker News

Imba – A new programming language for the web

imba.io

91–100 of 180 posts

Re: Imba – A new programming language for the web

#91
post #20
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.…

I would really like to see React do something like this as a shortcut to having to do map. It would be SO helpful.

The benefit of JSX is its syntactical simplicity. Lots of beginners seem to think JSX adds all kinds of language features but in reality most of them are unrelated to JSX and either part of ES6 or experimental features of ES7.

The only new thing JSX brings to the table is the element syntax. And all that does is translate `{d}` to `React.createElement(a, {b: c}, d)`.

Re: Imba – A new programming language for the web

#92
post #78

Earlier quoted context omitted.

Does Ruby allow the value of the if statement to be used as the RHS of an assignment? That's surprising. In Perl, which I assume they got that from (it's a fairly safe bet, Ruby is heavily Perl influenced), postconditionals are not allowed to be used as a statement, they are statement modifiers. You can do this: $v = 1 if $v 10; But you cannot: $v = if $v; You also cannot use else on postconditionals (if it's that co…

Ah, that's interesting – they become expression modifiers instead. x = (:false if true) => :false x = (:false if false) => nil Any other if statement does appear to be treated as a value: x = if true then 5 else 10 end => 5

And that's different than in Perl, where they aren't statement modifiers (I slightly misspoke), they really are just rearranged into single statement if blocks. That is, if the postconditional is false, the statement is not executed at all.

  my $x = 1;
  $x = 10 if $x > 1;
  say $x; # 1
Personally I find the assignment of the if/else statement's return value distasteful, as it's both complex to read and mixes a portion of a natural pattern of thinking while later abandoning it, making it unintuitive. At that level, I prefer a ternary operator.

Re: Imba – A new programming language for the web

#93
post #89

Earlier quoted context omitted.

This tool is forked from Coffeescript, which is deliberately designed to resemble Ruby. There's a good reason for that – some aspects of Ruby's syntax are well-loved. It might be more effective for you to use your time understanding why these aspects are important, since you apparently feel this project is good, and less time being a bit of a dick about it.

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

As well as by not-Ruby programmers, which is why they keep getting used in non-Ruby languages that don't keep other aspects of Ruby.

> Why is it that Ruby programmers are incapable of imagining anyone doesn't love Ruby?

I think most Ruby programmers are capable of understanding that lots of people don't like Ruby, and more importantly that lots of people don't like aspects of Ruby that those Ruby programmers find most attractive.

Sure, some Ruby programmers have problems with this, but, OTOH, some non-Ruby programmers seem incapable of understanding that other non-Ruby programmers might find some aspects of Ruby attractive that they, themselves, do not.

> I've met plenty Java programmers willing to admit the shortcomings of Java

Well, sure, the more likely you are to be compelled to use a language because of corporate inertia, the more likely people that actually do use it will be the people that don't like it and use it under duress. So I'd expect Java to be among the languages with the highest proportion of active programmers who not only are willing to admit its shortcoming, but who outright despise it.

> I've yet to meet a Ruby programmer who doesn't believe that Ruby is the best thing since sliced Jesus.

Given the number of non-Ruby programming languages created with substantial input from (or even under the leadership of) people in the Ruby community specifically because, while they like many things about Ruby, they find it not optimal for some uses, I think this says a lot more about your limited exposure to the Ruby community than about the Ruby community itself.

Re: Imba – A new programming language for the web

#95
post #89

Earlier quoted context omitted.

This tool is forked from Coffeescript, which is deliberately designed to resemble Ruby. There's a good reason for that – some aspects of Ruby's syntax are well-loved. It might be more effective for you to use your time understanding why these aspects are important, since you apparently feel this project is good, and less time being a bit of a dick about it.

> 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 meet you. I'm a mostly-Ruby programmer who is well aware that the language is not suited to every task. Need high performance? Look elsewhere. Need a highly reliable service? Something that would benefit from static typing? Systems-level tools? Same. Ruby is a pain to deploy and has lots of irritating legacy cruft.

What this doesn't mean is that the statement "that pile of junk that is ruby" is anything other than a fucking stupid thing to say.

Re: Imba – A new programming language for the web

#96
post #89

Earlier quoted context omitted.

This tool is forked from Coffeescript, which is deliberately designed to resemble Ruby. There's a good reason for that – some aspects of Ruby's syntax are well-loved. It might be more effective for you to use your time understanding why these aspects are important, since you apparently feel this project is good, and less time being a bit of a dick about it.

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

[deleted]

Re: Imba – A new programming language for the web

#97
post #89

Earlier quoted context omitted.

This tool is forked from Coffeescript, which is deliberately designed to resemble Ruby. There's a good reason for that – some aspects of Ruby's syntax are well-loved. It might be more effective for you to use your time understanding why these aspects are important, since you apparently feel this project is good, and less time being a bit of a dick about it.

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

[deleted]

Re: Imba – A new programming language for the web

#98
post #57

Earlier quoted context omitted.

People also know CSS query selectors... Some Text Might be nicer than actually spelling out the attributes and properties, if you're taking an already wrist friendly language and bolting on tags, then taking that a step farther would probably be a nice idea as well.

Imba supports the syntax for IDs and classes: "Label" compiles to: ti$('label','foo').flag('bar').flag('baz',this.isBaz()).setText("Label").end() where `flag` is a method which adds to the class list (unless the second argument is falsey).

Ok that is awesome.

Re: Imba – A new programming language for the web

#99

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?

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.

Re: Imba – A new programming language for the web

#100
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 implementations of Ruby." This is: http://opalrb.org/

And how the language "looks" - its syntax - does matter, but not in the way most people think it matters. It's just that the syntactically simpler constructs tend to be used more often, so the choice of syntax affects the code people write. The rest, including "readability" or simply "beauty", is meaningless in the long run.

EDIT: I'm in no way involved in this project!

Post reply on HN