Sylph: the programming language I want
1–10 of 119 posts
Re: Sylph: the programming language I want
#2Re: Sylph: the programming language I want
#3No, I use braces for the computer, and the computer automatically and unambiguously indents it for me.
If anything the wasted effort happens in whitespace significant languages like Haskell and Python where the computer can't tell what you want and you have to cycle through all sensible indentations (for every line!)
Re: Sylph: the programming language I want
#4>If your language has braces, then you are indenting for the sake of humans (because humans are good at noticing alignment and edges), and bracing for the sake of computers. That’s double the effort for something as mundane as where a block ends. If they get out of sync, then your code naturally breaks in a way that’s very difficult for you to detect. No, I use braces for the computer, and the computer automatically…
What? My editor indents stuff for me as per PEP8. I don't have to think about it. Why do you?
Re: Sylph: the programming language I want
#5>If your language has braces, then you are indenting for the sake of humans (because humans are good at noticing alignment and edges), and bracing for the sake of computers. That’s double the effort for something as mundane as where a block ends. If they get out of sync, then your code naturally breaks in a way that’s very difficult for you to detect. No, I use braces for the computer, and the computer automatically…
The main problem with indent oriented languages is that not everyone is or wants to use a modern editor. Then there are LISPers who think braces everywhere are a swell idea.
Re: Sylph: the programming language I want
#6It'd be worth taking a look at things like its macros as well – I actually think Julia hits on a lot of the points in this post really well, though of course no language is perfect.
[0] http://docs.julialang.org/en/latest/manual/types/ [1] https://github.com/astrieanna/TypeCheck.jl
Minor nitpick:
> Tut, tut. That should really be a set! It’s much faster, O(1).
Structures like sets have a lower complexity but higher constants (i.e. the overhead of hashing the value etc). When you have a small number of values, a straight linear search over an array will often be faster (which is why it's useful to have the explicit choice).
Re: Sylph: the programming language I want
#7>If your language has braces, then you are indenting for the sake of humans (because humans are good at noticing alignment and edges), and bracing for the sake of computers. That’s double the effort for something as mundane as where a block ends. If they get out of sync, then your code naturally breaks in a way that’s very difficult for you to detect. No, I use braces for the computer, and the computer automatically…
> you have to cycle through all sensible indentations What? My editor indents stuff for me as per PEP8. I don't have to think about it. Why do you?
def fun():
for x in xs:
if a:
b
c
There's no way for an editor to know where to re-indent c to. You have to cycle through the indents manually.Re: Sylph: the programming language I want
#8Earlier quoted context omitted.
> you have to cycle through all sensible indentations What? My editor indents stuff for me as per PEP8. I don't have to think about it. Why do you?
def fun(): for x in xs: if a: b c There's no way for an editor to know where to re-indent c to. You have to cycle through the indents manually.
Re: Sylph: the programming language I want
#9I would usw tab instead of space, so everyone can adjust their indentation width.
Re: Sylph: the programming language I want
#10Earlier quoted context omitted.
def fun(): for x in xs: if a: b c There's no way for an editor to know where to re-indent c to. You have to cycle through the indents manually.
Auto indent, tab, and shift tab are your friends. Really, it isn't that bad, considering the curly brace alternative is even worse from an effort perspective.