News for hackers. Stuff that matters.
Re:Are dynamic languages going to replace static languages? ... by zzzeek on Wednesday August 04, 2021 @09:34AM (#28060831)
> if you haven't coded in a language like OCaml, Haskell, ML etc. you really don't know enough about what strong static types offer to discount them. Java, C and C++ have much weaker checks of correctness and lack type inference + pattern matching that make strong types pleasant to work with.

Those are all functional languages, so this argument seems to be the "functional is better than OO" argument, typing is not the primary factor (but of course to the degree that FP allows static typing to be more intuitive, that's a plus). What examples of static typing with OO or procedural languages that are only a "pleasure to work with" can we look at ?

Re:Are dynamic languages going to replace static languages? ... by klysm on Wednesday August 04, 2021 @09:37AM (#28060855)
I think functional languages historically have much better type systems but recently, more procedural languages have taken a lot of those innovations and integrated them (e.g. typescript, rust)
Re:Are dynamic languages going to replace static languages? ... by kragen on Wednesday August 04, 2021 @09:50AM (#28060974)
The simply-typed lambda-calculus [01940] predated Abadi and Cardelli's object-calculus or sigma-calculus [01996] by 56 years, and both of those have trouble with side effects; the kind of non-sharing thread-safety guarantees Rust's type system can provide for mutable data structures stem from Jean-Yves Girard's "linear logic" [01987] and Wadler's "linear types" [01990], although Reynolds published a POPL paper in 01978 that we can recognize in retrospect as having invented a Rust-like affine typing system.

I've never been able to make heads or tails of Girard's paper but http://pauillac.inria.fr/~fpottier/slides/fpottier-2007-05-l... is an introductory divulgation of some of the pre-Rust history of this stuff. It makes me think I should read Wadler's 01990 paper.

So I think functional languages kind of had a head start, but also in a sense they have an easier problem to solve. ML's type system doesn't even have subtyping, much less mutation and resource leak safety.

Re:Are dynamic languages going to replace static languages? ... by tome on Friday August 06, 2021 @06:28AM (#28085306)
Thanks, that presentation is absolutely fascinating!
Re:Are dynamic languages going to replace static languages? ... by Zababa on Wednesday August 04, 2021 @10:44AM (#28061582)
> What examples of static typing with OO or procedural languages that are only a "pleasure to work with" can we look at ?

OCaml and Rust would fit the bill. You can do procedural and OO in both. You could add Scala to that. I think the conclusion is not that "functional is better than OO" but "they both have their strength and are not mutually exclusive".

Re:Are dynamic languages going to replace static languages? ... by cb321 on Wednesday August 04, 2021 @12:24PM (#28062917)
You could add Nim [1] to that list. Many people say it has "the ergonomics of Python but the strong static typing of C++/Rust."

[1] https://nim-lang.org

Re:Are dynamic languages going to replace static languages? ... by lolinder on Wednesday August 04, 2021 @12:45PM (#28063184)
In additional to what others have mentioned (OCaml has OOP), Kotlin is very good. It's not as expressive as ML-family languages, but sealed classes + null safety + type inference makes for a very fluid, almost dynamic programming experience that still has strong guarantees.
Re:Are dynamic languages going to replace static languages? ... by bmitc on Wednesday August 04, 2021 @09:50AM (#28060973)
OCaml and F# are functional first multi paradigm languages. They’re perfectly fine being used for OOP.