News for hackers. Stuff that matters.
Re:Why We Chose Typescript by mrkgnao on Saturday July 01, 2017 @04:38AM (#14676079)
> infer recursive functions

Any of the mainstream functional languages (which are most likely to have type inference) can infer the types of all functions, unless you use funky language extensions that make type inference undecidable. Rust has a Hindley-Milner system, so it should be able to "infer recursive functions" too (but I can't say for sure since I don't use it).

Re:Why We Chose Typescript by fny on Saturday July 01, 2017 @09:41AM (#14677062)
I've tried in Rust, and it requires a return definition, as do most mainstream functional languages.

Also, mainstream functional languages aren't truly mainstream: I'd struggle to find devs who could help me in consulting gigs.

Re:Why We Chose Typescript by mrkgnao on Saturday July 01, 2017 @12:51PM (#14677827)
I'm pretty sure that's just "administrative" and imposed by the syntax (e.g. think Java/C++ function declaration syntax), instead of being something the compiler can't infer. Thanks for clearing this up, though.
Re:Why We Chose Typescript by steveklabnik on Saturday July 01, 2017 @01:10PM (#14677903)
It was a design decision, yes. We could infer them if we wanted to, but we don't.
Re:Why We Chose Typescript by igouy on Saturday July 01, 2017 @12:40PM (#14677786)

    let rec factorial n = 
        if n = 0 || n = 1 then 1 
        else n * factorial (n - 1)
F#
Re:Why We Chose Typescript by mrkgnao on Saturday July 01, 2017 @12:50PM (#14677820)
Haskell:

  factorial n =
    if n < 2 
      then 1
      else n * factorial (n - 1)
I think the OCaml version will look almost exactly like the F# one.