Live data from Hacker News

Sylph: the programming language I want

eev.ee

1–10 of 119 posts

Re: Sylph: the programming language I want

#3
>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 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
post #3

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

Re: Sylph: the programming language I want

#5
post #3

>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 computer is really quite proficient at inferring block structure from indentation, and if you use a modern editor this structure is manipulated rather effortlessly.

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

#6
For some of the stuff about types and optimisation in particular, you should check out Julia's type system [0]. First-class types, avoiding inheritance, optional type restrictions, and (albeit early) support for static checking [1], it's all there.

It'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
post #3

>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

#8
post #7

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

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.

Re: Sylph: the programming language I want

#10
post #7

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

To each their own. I came to C++ from Haskell and found braces to be superior (except visually).
Post reply on HN