Live data from Hacker News

Idris, a language that will change the way you think about programming (2015)

crufter.com

11–20 of 101 posts

Re: Idris, a language that will change the way you think about programming (2015)

#11
post #9

"Indentation significant syntax" :( in my opinion, one of the worst ideas to plague many new languages brackets are really, seriously, honestly a better visual cue for grouping

I think it depends on the way your brain works. Some people prefer tables full of numbers, other prefer data visualizations. Some people prefer compact, tight code with lots of symbols. Others prefer spatially organized code. While there are probably people on the extremes and people in the middle. My observations have found lots of people generally fall into two main camps. A number/symbol/dense data aesthetic group, and a visual/spatial group. Left-Right brain? I don't know. Neither is better or worse. It just depends on who you are and who you are working with.

Re: Idris, a language that will change the way you think about programming (2015)

#12
post #9

"Indentation significant syntax" :( in my opinion, one of the worst ideas to plague many new languages brackets are really, seriously, honestly a better visual cue for grouping

Brackets are also noise.

There is no objective best answer here. I vastly prefer indentation based grouping, but I respect that you don't.

Re: Idris, a language that will change the way you think about programming (2015)

#13
post #9

"Indentation significant syntax" :( in my opinion, one of the worst ideas to plague many new languages brackets are really, seriously, honestly a better visual cue for grouping

Haskell allows the use of brackets and indentation to format code, but nobody uses brackets. Do you find Haskell hard to read? And if so, is it because of the indentation? I bring up Haskell because Idris is very similar to Haskell syntactically.

These are functional languages, and there isn't a lot of code to chunk together with brackets. Functions are often just one line, and it's a bit cumbersome to make functions that require multiple lines. Do you believe brackets add to the readability of a one line function?

Re: Idris, a language that will change the way you think about programming (2015)

#14
post #9

"Indentation significant syntax" :( in my opinion, one of the worst ideas to plague many new languages brackets are really, seriously, honestly a better visual cue for grouping

Please, please don't let this be the top comment on Idris. I really want to hear from people who have experience with it in different regards.

For example, what's the editing experience like compared to e.g. OCaml with emacs/Merlin? Is there anyone in a position to compare 1ML's approach to unifying type/value languages vs using dependent types?

Re: Idris, a language that will change the way you think about programming (2015)

#15
post #9

"Indentation significant syntax" :( in my opinion, one of the worst ideas to plague many new languages brackets are really, seriously, honestly a better visual cue for grouping

There's nothing about braces that ensures visual cues to nested code. Significant whitespace does precisely that. And eliminates brace placement arguments.

  int func()
  {
  while dosomething()
  {
  dosomething()
  dosomething()
  doanotherthing()
  }
  dosomething()
  }
  
  def func():
      while dosomething():
          dosomething()
          dosomething()
          doanotherthing()
      dosomething()

Re: Idris, a language that will change the way you think about programming (2015)

#16
post #15
post #9

"Indentation significant syntax" :( in my opinion, one of the worst ideas to plague many new languages brackets are really, seriously, honestly a better visual cue for grouping

There's nothing about braces that ensures visual cues to nested code. Significant whitespace does precisely that. And eliminates brace placement arguments. int func() { while dosomething() { dosomething() dosomething() doanotherthing() } dosomething() } def func(): while dosomething(): dosomething() dosomething() doanotherthing() dosomething()

> There's nothing about braces that ensures visual cues to nested code.

A machine can look at the braces and re-indent the code, so that you don't have to look at the braces. All while you rest assured that the meaning didn't change:

I just popped it into Vim, selected all and hit =:

  int func()
  {
    while dosomething()
    {
      dosomething()
        dosomething()
        doanotherthing()
    }
    dosomething()
  }
Some semicolons are expected so things are a little off.

Re: Idris, a language that will change the way you think about programming (2015)

#19
I recently had some murky thoughts on my ideal Matlab replacement, and it would have a feature like this. It would be huge for array-oriented programming:

    func train_model(X: [n d], y: [n 1])
So many lines of code are spent verifying that the sizes of two function arguments are compatible.

Re: Idris, a language that will change the way you think about programming (2015)

#20
post #17

app : Vect n a -> Vect m a -> Vect (n + m) a That is pretty amazing if you ask me. I look forward to the day when we all use languages which save programmers from themselves.

As a Python programmer who doesn't understand this notation - what am I looking at, and what's amazing about it?
Post reply on HN