logoalt Hacker News

IshKebabyesterday at 9:23 PM2 repliesview on HN

It's such a lot of effort to make a language like this. I don't get why they don't just put in like 2% more effort and add syntax that makes it less awful for humans. Nobody really wants to write `[* 5 5]` do they?

  [fn square [x] [* x x]]
Could very easily be

  fn square(x) = x * x;
Or something like that, which is much more readable.

Also

> Hindley-Milner inference eliminates type annotations.

I think it's pretty widely agreed at this point that global type inference is a bad idea. The downsides outweigh the upsides. Specifically: much worse errors & much less readable code.


Replies

xigoiyesterday at 11:26 PM

> Nobody really wants to write `[* 5 5]` do they?

I do. The advantage being that if you suddenly realize that you want to do super-duper-multiplication instead of regular multiplication, you can just change the name instead of having to rewrite the entire expression. And honestly, having a few random functions be called differently from others feels gross.

mapcarsyesterday at 9:31 PM

You never used lisp-like languages did you?

show 2 replies