Re:The Unix Philosophy and Elixir as an Alternative to Go
by dschiptsov on Tuesday June 23, 2015 @08:17AM
(#9764114)
> Saying that statically typed languages cannot be expressive is pure FUD.
Could you, please, show us an example from the rosettacode.org website? Generic Quicksort, perhaps?
Re:The Unix Philosophy and Elixir as an Alternative to Go
by rubiquity on Tuesday June 23, 2015 @09:27AM
(#9764445)
Take a look at OCaml, or any ML variant language (aside from Rust, which is more C++ than ML in my opinion anyway) for that matter, for a static typed language with a good implementation of generic types.
Re:The Unix Philosophy and Elixir as an Alternative to Go
by adwn on Tuesday June 23, 2015 @09:47AM
(#9764566)
Would you mind elaborating why you think that Rust doesn't have a good implementation of generic types?
Re:The Unix Philosophy and Elixir as an Alternative to Go
by rubiquity on Tuesday June 23, 2015 @10:17AM
(#9764761)
The signatures can get really unwieldy compared to generics in other languages. As I understand it, the Rust team is working on this.
Re:The Unix Philosophy and Elixir as an Alternative to Go
by pcwalton on Tuesday June 23, 2015 @10:52AM
(#9764979)
I think you're comparing Rust to a language with ad-hoc polymorphism like C++ (where you pay for the somewhat simpler signatures with confusing template instantiation errors), and I'm very glad we didn't follow the C++ route. Rust's generics are very similar to those of Haskell.
The only major generics-related issue that is getting some significant thought is the ability to have the automatically derive the return type on top-level functions, which is not something that is common in other statically typed languages (only C++ and those with whole program type inference, which has its own set of drawbacks).
Re:The Unix Philosophy and Elixir as an Alternative to Go
by dschiptsov on Tuesday June 23, 2015 @12:08PM
(#9765585)
I took the Dan Grossman's PL course, so I appreciate how good Standard ML is.)
Re:The Unix Philosophy and Elixir as an Alternative to Go
by the_why_of_y on Tuesday June 23, 2015 @02:31PM
(#9766673)
No idea what you're looking for, but just for the record:
import List(partition)
qs [] = []
qs (pivot:rest) = qs smaller ++ pivot : qs larger
where (smaller,larger) = partition (< pivot) rest
Haskell 98, the (polymorphic) type is "Ord a => [a] -> [a]"
Re:The Unix Philosophy and Elixir as an Alternative to Go
by dschiptsov on Wednesday June 24, 2015 @05:40AM
(#9770561)
Haskell is an exception. Haskell is two distinct languages in one - one for defining types, and one for expressions.)
Concurrency in Go certainly is, the rest is not, definitely.
> its syntactic clumsiness and shortcomings (hipsters are blogging about) came from being statically typed, just admit it
That's the kind of dismissive and arrogant attitude I often hear from gophers. Doesn't make me want to be part of that community.
Have a look at the Cyclone language. It has generics,tagged unions and pattern matching AND it is statically typed.
https://cyclone.thelanguage.org/wiki/User%20Manual/
Saying that statically typed languages cannot be expressive is pure FUD. Go designers just didn't strike the right balance between features and minimalism, because they didn't care. Without its concurrency model, Go is not much.