Just: safe unknown types in Java-like languages.
Giovanni Lagorio, Elena Zucca · The Journal of Object Technology · 2007
Most mainstream object-oriented languages, like C++, Java and C#, are statically typed.In recent years, untyped languages, in particular scripting languages for the web, have gained a lot of popularity notwithstanding the fact that the advantages of static typing, such as earlier detection of errors, are widely accepted.We think that one of the main reasons for their widespread adoption is that, in many situations, the ability of ignoring types can be handy to write simpler and more readable code.We propose an extension of Java-like languages which allows developers to forget about typing in strategic places of their programs without losing type-safety.That is, we allow programmers to write simpler code without sacrificing the advantages of static typing.This is achieved by means of inferred type constraints.These constraints describe the implicit requirements on untyped code to be correctly invoked.This flexibility comes at a cost: field accesses and method invocations on objects of unknown types are less efficient than regular field accesses and method invocations.Also, our type system is currently more restrictive than it should be; its extension is the subject of ongoing work.We have implemented our approach on a small, yet significant, Java subset.