Live data from Hacker News

PureScript 0.13 Release

github.com

1–10 of 39 posts

Re: PureScript 0.13 Release

#3
post #2

I noticed a few languages removing support for octal and binary literals. I wonder why. I find them useful and the parser overhead seems minimal to keep them around.

Yeah, it never made sense to me not to include those, given how simple it is.

Re: PureScript 0.13 Release

#4
post #2

I noticed a few languages removing support for octal and binary literals. I wonder why. I find them useful and the parser overhead seems minimal to keep them around.

Generally developers tend to either (1) misunderstand them when they encounter them in the wild or (2) accidentally invoke them. (I believe multiple languages have had issues with '04' being treated as an octal, which works fine and doesn't trigger developer notice until they encounter '09' in the wild).

Whether these are VALID concerns I won't take a stance on - just saying these are the reasons I've seen cited.

Re: PureScript 0.13 Release

#5
post #3
post #2

I noticed a few languages removing support for octal and binary literals. I wonder why. I find them useful and the parser overhead seems minimal to keep them around.

Yeah, it never made sense to me not to include those, given how simple it is.

The typical octal literal syntax I've seen uses a 0 prefix. This gives rise to quite a few gotchas, as most people think of leading 0's as being non-value-changing. Maybe 0o12345670?

Re: PureScript 0.13 Release

#6
post #4
post #2

I noticed a few languages removing support for octal and binary literals. I wonder why. I find them useful and the parser overhead seems minimal to keep them around.

Generally developers tend to either (1) misunderstand them when they encounter them in the wild or (2) accidentally invoke them. (I believe multiple languages have had issues with '04' being treated as an octal, which works fine and doesn't trigger developer notice until they encounter '09' in the wild). Whether these are VALID concerns I won't take a stance on - just saying these are the reasons I've seen cited.

Why not use 0x,0b, and 0o for hex, binary, and octal literals? I never liked the fact that a number starting with 0 was treated as octal.

Re: PureScript 0.13 Release

#7
post #3

Earlier quoted context omitted.

Yeah, it never made sense to me not to include those, given how simple it is.

The typical octal literal syntax I've seen uses a 0 prefix. This gives rise to quite a few gotchas, as most people think of leading 0's as being non-value-changing. Maybe 0o12345670?

Yeah, I agree that it's not a good syntax. I do think 0o is a good prefix though.

Re: PureScript 0.13 Release

#9
Are there other languages that make an opinion on tabs/spaces? This seems nice.

> The only whitespace now allowed in code is ASCII space and line endings. Since you must use indentation to format PureScript code (unlike Haskell), we felt it was best to be more restrictive in what you can write instead of allowing potentially confusing behavior (implicit tab-width, zero-width spaces, etc). You can still use unicode whitespace within string literals.

I’m also wondering about the removed literals.

Re: PureScript 0.13 Release

#10

Are there other languages that make an opinion on tabs/spaces? This seems nice. > The only whitespace now allowed in code is ASCII space and line endings. Since you must use indentation to format PureScript code (unlike Haskell), we felt it was best to be more restrictive in what you can write instead of allowing potentially confusing behavior (implicit tab-width, zero-width spaces, etc). You can still use unicode wh…

I think Elm have similar rules, the official code format tool is very opinionated.
Post reply on HN