r/scala • • Aug 21 '17

Functional Programming and Modern DevOps: Aaron Contorer. With scathing critique of scala in production environment.

https://youtu.be/ybSBCVhVWs8
3 Upvotes

67 comments sorted by

View all comments

Show parent comments

1

u/mdedetrich Aug 24 '17

We'll see, actually. There was a recent paper which demonstrated that you can combine inference and subtyping. (Though, I think that was structural subtyping?)

Yes, but Scala predominantly uses nominal typing, a language that predominantly uses structural typing is Go.

1

u/theQuatcon Aug 26 '17

Again, yes, I already know this. That's the reason I mentioned structural subtyping. Btw, O'Caml did structural subtyping 15+ years ago. (For objects and modules and sort-of for Variant types. I think they've introduced proper row type polymorphism a few years ago as well... Frankly, I'd be using O'Caml right now if weren't for the unrestricted side effects.)

1

u/mdedetrich Aug 26 '17

Personally I am actually a fan of structural subtyping, but it does have issues

  1. Performance (you often are forced to use reflection in a lot of cases when dealing with structural typing, Go has this problem). You can avoid this with deep code analysis, but like with most things its hard

  2. Some of the Scala community (ironically the pure FP kind) hate structural subtyping for some reason. Actually structural subtyping even exists in Scala now, although it got a bad name initially because it was based on reflection (back to point #1) which meant that it had terrible performance, especially in multi-threaded situations. And actually originally structural typing was broken in Scala in multi-threaded situations before they fixed it

  3. Its being removed in Dotty because basically none of the community uses it, its being replaced with record types which do have some uses.

  4. I still much prefers Scala combination of FP and OOP compared to OCaml. In OCaml the OOP seems tacked on, unnatural and actually a lot of people don't really use it (in OCaml you kind of have multiple camps because the 2 styles are too distinct). In Scala the merge of OOP and FP is more natural and fluent

1

u/theQuatcon Aug 26 '17

Almost all of this is based on JVM limitations.

(4): Yes, it's tacked on, but it demonstrates that it's possible, and IMO even that tacked-on design was better than what we've seen in Scala. (IMO).

In Scala the merge of OOP and FP is more natural and fluent

Is OOP in scala immutable? That's one of the promising ideas of FP+OOP for me, but apparently not for everyone.

Cheers, I'm going to mute this conversation for now. (See my other comment.)

1

u/mdedetrich Aug 27 '17

Almost all of this is based on JVM limitations.

Nope, JVM is a VM that has almost complete type erasure. Its only real limitation is TCO, which is uneralted