News for hackers. Stuff that matters.
[dead]
Re:Caramel: an Erlang back end for OCaml by devmunchies on Sunday September 27, 2020 @08:55PM (#24611703)
> I know people are irrational, especially when they feel that their beliefs are being questioned.

do you think I haven't used dynamic languages? I started using elixir in 2016. I started my career in Ruby, JS, and PHP.

Just because you can conceptualize the entire codebase's type system in your big brain, doesn't mean other don't have a rational reason for preferring static typing.

> Did you have this problem recently?

Every time I refactor, my dude.

Re:Caramel: an Erlang back end for OCaml by yawaramin on Sunday September 27, 2020 @08:34PM (#24611589)
> in many statically typed languages this involves bitwise operators, lots of boilerplate, and mental hoops to adapt to an API 50 years old.

Bitstring in OCaml: https://bitstring.software/

Just as simple as in Erlang.

> I know for a fact that static typed languages don't help that much.

How do you know this?

> We all know that static typed languages are harder to learn and master

Again–how do you know this?

> Erlang has int (arbitrary length, like in real life) and floats. It is definitely easier.

OCaml has int and float, simple.

> We've all seen companies like Github, Twitter, Airbnb, born because Ruby on Rails exists.

These companies are now using Haskell, Scala, TypeScript.

> Facebook was written in PHP.

Fb created Hack, a statically-typed language that compiles to PHP. It has at least two other static-typing language compilers.

> Rust creates incredibly fast code, it has an incredibly slow compiler.

Is this proving something?

> Did you have this problem recently?

Yes–I and many others have this problem constantly, because we are mostly paid to work on existing codebases, not throwaway scripts.

> Of course the answer is "this is the programmers fault", but if it's wrong, why is it allowed?

Why is it allowed in dynamically-typed languages? Because it's useful. Same reason.

> Types are harder to understand and to correctly plan ahead for.

Types are not unchangeable; the whole point is that you can safely change code that has a typing discipline.

> it takes a great programmer to use types correctly in a way that others will comprehend without prior knowledge of the domain.

Then it must take an incredible programmer to maintain a dynamically-typed codebase.