What are your favorite statically typed, compiled, memory safe programming languages?

CoderSupreme@programming.dev to Programming@programming.dev – 105 points –
120

You are viewing a single comment

Name one statically typed language that doesn't have that property. Name one non statically typed language that has that property.

It's much more involved than that. For example, static type systems involve checking that the functions you call accept the types of parameters you're supplying then. It's a necessary part of static typing but alone is not sufficient.

If this code were a valid program in some hypothetical language but only failed at runtime then that would be an example of dynamic typing because the types cannot be verified statically (e.g., at compile time).

var a = 1
a = "a"

But you're right, I don't really know of any languages like that. I could've sworn I heard this called strong typing but I can't easily find a source. And strong/weak typing are a mess of definitions nobody agrees on.

1 more...
1 more...