News for hackers. Stuff that matters.
Re:K as a Prototyping Language by halo on Monday August 04, 2008 @07:05AM (#266178)
My own personal opinion is that whatever language you're using (or, indeed, in mathematics) using redundant brackets is generally the best idea anyway.

Removes any ambiguity, easier to read, doesn't need you to remember precedence rules and there's negligible difference in execution speed.

Re:K as a Prototyping Language by ajross on Monday August 04, 2008 @12:37PM (#266429)
Isn't python (no brackets at all) an existence proof that you're wrong, though? The eye learns rapidly to ignore brackets. What it reads is indentation. And most editors will try to enforce indentation levels even without brackets present.

Or maybe you're just talking about parentheses in precedence grammars? I guess I have no objections there, but still: the fact that "multiplication has higher precedence than addition" is taught in grade schools and is used everywhere, in every language I know that supports precedence at all. What conceivable purpose could one have to buck this trend? All you gain is maybe a few lines of complexity in the parser (I mean, it's not like these things are hard to write) at the cost of a lifetime of newbie syntax errors.

Re:K as a Prototyping Language by stcredzero on Monday August 04, 2008 @02:02PM (#266527)
If the newbie programmers are professionals worthy of the name, those errors won't make it into production. A less complex parser will have tremendous leverage by making it easier to craft syntax-aware programming tools. Smalltalk has a history of amazing ground-breaking programmer tools written by single individuals years ahead of their appearance in other languages. Contrast this with Ruby. I like Ruby a lot. It's a great language. The syntax is a bit hairy, however. Teams of people worked for a couple of years to produce an ANTLR parser which is independent of the Ruby VM's parser and could be used for programming tools.

A good programmer can just crank out a top-down Smalltalk parser in one day. If you make your language easy to work with, you get a more powerful toolset sooner. On top of that, the lowered barrier to entry gets you more real innovation in that toolset.

Re:K as a Prototyping Language by aristus on Monday August 04, 2008 @02:48PM (#266594)
Well, order of precedence rules are much more complex in programming languages, and are not the same across languages. Mixing math with logic and bitwise operators without explicit parens is a classic "newbie" mistake.
Re:K as a Prototyping Language by eru on Monday August 04, 2008 @10:26AM (#266280)
Try using redundant brackets in Lisp.
Re:K as a Prototyping Language by ajross on Monday August 04, 2008 @12:38PM (#266430)
Lisp's grammar doesn't do precedence, so effectively it forces you to fully parenthesize all expressions anyway. The brackets the poster was talking about aren't "redundant" in Lisp in the first place.
Re:K as a Prototyping Language by eru on Tuesday August 05, 2008 @05:15PM (#267898)
That's what I was hinting at.