Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Reason still looks like an ML-style language rather than something from the C family of things (where JavaScript ultimately comes from).

For example, in Reason, a function is:

    let x: (int, int) => int = (a, b) => a + b;
A more JS-like syntax might be:

    fn x(a, b int): int {
      a + b
    }
Or at least:

    let x = fn(a, b int): int {
      a + b
    }


But the Reason example you shared is almost valid TypeScript already!

https://www.typescriptlang.org/play/?#code/DYUwLgBAHgXBAUBDO...

I've seen JS using lambdas instead of classic functions like that in the wild. And that Reason can be made more JS-idiomatic without changes to the syntax:

    let x = (a: int, b: int): int => a + b;




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: