News for hackers. Stuff that matters.
Re:Hy – A Lisp-flavored Python by kod on Wednesday August 02, 2017 @07:13PM (#14915521)
Yeah, whitespace sensitive languages are a great idea...

Until you permanently lose user data because of a pull request that contained whitespace changes.

Yes, I've seen this happen in production, yes it could have been prevented in other ways... but why invite disasters like that upon yourself?

Re:Hy – A Lisp-flavored Python by simonh on Wednesday August 02, 2017 @08:27PM (#14915951)
Have you really never seen a bug in curly brace code due to a misplaced curly bracket hidden by incorrect indenting? Or code that was just really difficult to understand and modify accurately because it was indented inconsistently with the braces? And yes there are tools that can help with that, but...

I worked on Quartz for a few tears, that's over 10 million lines of Python code and many thousands of commits per day. If concerns like that really were anything more than nitpicking, projects like that would know about it.

Re:Hy – A Lisp-flavored Python by kazinator on Wednesday August 02, 2017 @11:39PM (#14916794)
Discrepancy between actual code structure and indentation is susceptible to diagnosis by machine. That's the beauty of having a bit of redundancy in the representation.

Recent GCC now has a warning for indentation that doesn't match code structure. (Had to recently patch a breakage in GNU Binutils in an embedded distro due to this being a -Werror).

Re:Hy – A Lisp-flavored Python by kod on Wednesday August 02, 2017 @09:08PM (#14916157)
The point is with lisp you can automatically and unambiguously parse and format code regardless of whitespace. Giving that up in favor of whitespace sensitive languages has real world drawbacks, no matter how many "no true python programmer" arguments you make.
Re:Hy – A Lisp-flavored Python by JadeNB on Thursday August 03, 2017 @09:25AM (#14919306)
> I worked on Quartz for a few tears

This lovely typo deserves to be noticed.

Re:Hy – A Lisp-flavored Python by mulmen on Wednesday August 02, 2017 @07:38PM (#14915671)
Is that a problem with whitespace or your test/qa/release process? A curly brace language isn't any less likely to lose user data to a bug just because it has curly braces.
Re:Hy – A Lisp-flavored Python by kod on Wednesday August 02, 2017 @08:12PM (#14915888)
It is less likely to cause problems, because a removed curly brace won't parse correctly, and won't be hidden when someone excludes whitesoace from a diff.
Re:Hy – A Lisp-flavored Python by JadeNB on Thursday August 03, 2017 @09:29AM (#14919335)
> won't be hidden when someone excludes whitesoace from a diff.

Surely it is good advice not to exclude whitespace from a diff when using a whitespace-sensitive language?

Re:Hy – A Lisp-flavored Python by pharrington on Wednesday August 02, 2017 @10:04PM (#14916391)
Your -if- clause sans curly braces definitely still parses.
Re:Hy – A Lisp-flavored Python by jjnoakes on Wednesday August 02, 2017 @10:22PM (#14916463)
Depends on the language.
Re:Hy – A Lisp-flavored Python by lgas on Thursday August 03, 2017 @01:32AM (#14917165)
Technically true, but I mean c'mon... Java, JavaScript, C, C++, C#, PHP... You have to get down to into the Go/Swift neighborhood before you'll find mandatory braces.
Re:Hy – A Lisp-flavored Python by breck on Wednesday August 02, 2017 @07:45PM (#14915722)
This is a great concern, and glad you brought it up.

In ETNs (the new family of programming languages I'm talking about), there are no "whitespace changes", in the sense that all changes to the code affect actual nodes in the program.

This is a really important property that embeds diffs with a whole lot more meaning. You can not only see the number of lines changed, but also the number of nodes changed. If you expected a change to only change content and not change any nodes, and you saw in a negative number in the nodes changed field, you would know immediately that something had gone wrong.

This is one of the many new beneficial properties unique to these languages.

Re:Hy – A Lisp-flavored Python by kod on Wednesday August 02, 2017 @08:10PM (#14915878)
Unless your language is somehow changing the behavior of existing tools like diff -w or github ?w=1, you're just making semantic distinctions.
Re:Hy – A Lisp-flavored Python by breck on Wednesday August 02, 2017 @08:44PM (#14916041)
Correct. We have new diff tools specifically for ETNs.
Re:Hy – A Lisp-flavored Python by gnaritas on Thursday August 03, 2017 @12:18AM (#14916926)
No, that's not changing the behavior of the existing tools everyone uses and aren't going to stop using. You can't say correct when you're not actually agreeing with his point.
Re:Hy – A Lisp-flavored Python by breck on Thursday August 03, 2017 @01:57AM (#14917273)
Perhaps I misunderstood the parent comment.

It changes the behavior in the sense that there is no w=1 option. All whitespace is significant. The idea of ignoring whitespace would be like the idea of ignoring angle brackets in html. Whitespace is an essential part of TN and ETNs and is never ignored.

Diff tools then can benefit by showing not only aggregate line diffs but aggregate node and word level diffs without knowing anything about the meaning of a program.

Re:Hy – A Lisp-flavored Python by olavk on Thursday August 03, 2017 @03:17AM (#14917576)
Well, if you randomly delete parentheses in Lisp or curly braces in C you will also get problems. So...don't delete information at random.