Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

25
  • 1
    You don't necessarily need a dedicated for for each type of array; just like makeItBark works for any type with a bark function, for can be made to work with any type that has an indexing function or a function for retrieving an iterator. Yes, each type needs to implement its own indexing function but this is no different in a dynamically-typed language. OCaml's use of + is .+ is related to resolving ambiguity with type inference. Consider fun (a, b) => a + b. If they had overloaded +, the language wouldn't know whether the arguments are ints or floating point... Commented Jul 3, 2014 at 13:41
  • 2
    You forgot to attribute your source for the first paragraph -- existentialtype.wordpress.com/2011/03/19/… Commented Jul 3, 2014 at 13:51
  • 3
    @Matt Re: 1, I haven't assumed it's not important; I addressed it under Conciseness. Re: 2, although I never explicitly said it, by "good" I mean "has thorough type inference" and "has a module system that allows you to match code to type signatures after the fact", not up-front like Java/C#'s interfaces. Re 3, the burden of proof is on you to explain to me how given two languages with equivalent syntax and features, one dynamically-typed and the other with full type inference, you wouldn't be able to write code of equal length in both. Commented Jul 3, 2014 at 14:11
  • 4
    @MattFenwick I've already justified it - given two languages with the same features, one dynamically-typed and the other statically-typed, the main difference between them will be the presence of type annotations, and type inference takes that away. Any other differences in syntax are superficial, and any differences in features turns the comparison into apples vs oranges. It's on you to show how this logic is wrong. Commented Jul 3, 2014 at 14:29
  • 1
    You should have a look at Boo. It's statically typed with type inference, and has macros that allow for the language's syntax to be extended. Commented Jul 3, 2014 at 14:36