Can someone tell me what Strong typing and weak typing means and which one is better?

That’ll be the theory answers taken care of, but the practice side seems to have been neglected… Strong-typing means that you can’t use one type of variable where another is expected (or have restrictions to doing so). Weak-typing means you can mix different types. In PHP for example, you can mix numbers and strings and …

Read more

Which languages are dynamically typed and compiled (and which are statically typed and interpreted)?

Here’s a list of a few interesting systems. It is not exhaustive! Dynamically typed and compiled The Gambit Scheme compiler, Chez Scheme, Will Clinger’s Larceny Scheme compiler, the Bigloo Scheme compiler, and probably many others. Why? Lots of people really like Scheme. Programs as data, good macro system, 35 years of development, big community. But …

Read more

Why Is Dynamic Typing So Often Associated with Interpreted Languages?

Interesting question. BTW, I’m the author/maintainer of phc (compiler for PHP), and am doing my PhD on compilers for dynamic languages, so I hope I can offer some insights. I think there is a mistaken assumption here. The authors of PHP, Perl, Python, Ruby, Lua, etc didn’t design “interpreted languages”, they designed dynamic languages, and …

Read more

Python typing what does TypeVar(A, B, covariant=True) mean?

Covariance and contra-variance are terms that relate to the intersection between object orientation and generics. Here’s the question this concept is trying to answer: We have a couple of “regular”, “object-oriented” classes, Base and Derived. We also have some generic type – let’s say List[T]. We know that Derived can be used anywhere Base can …

Read more

Are there any statically typed, embeddable scripting languages? [closed]

I’d suggest you check out Angelscript. We used it on Warsow and it’s pretty good. It has all the features you’d expect like classes, memory management, etc. Since it’s statically typed, it can make better optimizations for you, and so the bytecode ends up faster than other scripting languages. However, AS is not as easy …

Read more

Disadvantages of Scala type system versus Haskell?

The big difference is that Scala doesn’t have Hindley-Milner global type inference and instead uses a form of local type inference, requiring you to specify types for method parameters and the return type for overloaded or recursive functions. This isn’t driven by type erasure or by other requirements of the JVM. All possible difficulties here …

Read more