5 ms·
>pure functional languages don't support concurrent data structures which is what I deal with the most This is false, you were misinformed. >Sure. C++, Java,
by runT1ME 13y ago
>pure functional languages don't support concurrent data structures which is what I deal with the most
This is false, you were misinformed.
>Sure. C++, Java, C#.
C++ Has a good type system, IMO. The other two are broken. Literally, you can write broken code. Scala has a long list of warts, I just don't think you're listing any of them.
>Well, Scala doesn't give you safety any more than C++ or Java, and as for design, it can't even pick one type system; a cornerstone of great design is that you have to make hard choices.
This is just FUD. Are you telling me Java/C#'s type systems enforce more safety than Scala? Because they don't. They don't get variance right. Do you know what variance is? You ignored that part of my comment.
- asdf1234 13y ago> They don't get variance right. Do you know what variance is? You ignored that part of my comment. This can't be stated enough, and it's a huge problem in Java and C#. Unfortunately, most programmers don't care and simply continue to write broken code.
- pron 13y agoI don't have anything against correct variance, but just to play the devil's advocate, you do know that there are other ways to write correct code than with a "correct" type system, right? AFAIK, none of the safety-critical code running avionics, medical devices, guided missiles and operating systems has been written with a "correct" type system. And people "continue to write broken code" in any language.
- pron 13y ago> This is false, you were misinformed. If I'm wrong, I apologize. I am not familiar with any concurrent data structures in a pure functional language, but I'd love to learn of any. I have not encountered a data structure in a functional language that supports more than one concurrent writer (and I don't mean parallel construction of an immutable DS - that's trivial – but concurrent mutation, like in a concurrent B-Tree, concurrent skip-list, or concurrent hash map).
- codygman 13y agoI haven't checked anymore than glancing through the slides but it has the words "concurrent data structures in haskell" at the beginning: http://www.scribd.com/doc/28336206/Multicore-programming-in-Haskell http://www.scribd.com/doc/28336206/Multicore-programming-in-...
- pron 13y agoYou are right! Didn't know about MVars. Got some learnin' to do now...
- pkolaczk 13y agoC++ has a good type system? C++ templates are just a copy-paste find-replace-all hack around type-system, they don't typecheck at all at the generic level. There is no notion of type variance nor dependent types. Not to mention many warts inherited from C (like being able to implicitly cast char arrays to booleans). It is IMHO much worse than even Java's (which is also not good).
- EpicEng 13y agoYet they are extremely powerful. Whatever their flaws may be, I have worked with your preferred version of templates (C# generics) and, let me tell you, they are inferior in every practical way.
- pkolaczk 13y agoHuh, where did I say my preferred version of templates were C# generics? As of C++ templates being extremely powerful - I agree. But this is a similar kind of "powerfulness" as C macros are, only little safer. Technically they are still just a fancy macrogenerator working at the AST level instead of lexer level, knowing nothing about the types (you even have to tell it which symbols are the types, because it cannot reason it out from syntax). IMHO it is years behind true generic typesystems like in Haskell, OCaml or Scala and calling it a "type system" is an exaggeration.
- _random_ 13y agoCare to elaborate on C# 5 variance issues, please?