Type Aliasing (sometimes called "Microtypes") is a technique of replacing primitive types with an alias that describes the intent of it's usage. More specifically, type aliasing is a language feature that supports the pattern of Microtypes as a documentation feature.
For example, instead of:
data class Person(val username:String, val password:String)
typealias Username = Stringtypealias Password = Stringdata class Person(val username:Username, val password:Password)
This isn't a new concept, and different languages have had varied levels of support for type aliasing for some time.
As an approach, Microtypes focusses on using typealiases as a documentation technique, to help promote cleaner self-documenting code. In the two examples below, the second is more self-documenting, and presents the developers intent more clearly.
fun sendMessage(String,String)fun sendMessage(EmailAddress,BodyText) // With type aliases.
Type aliases simply providing another name to use when describing the type. The compilers typically replace references during compilation phases, such that in the compiled code, only the underlying type is present.
Depending on the level of compiler tooling & reflection support offered by the languages, Vyne is able to leverage these type aliases to produce mappings between types.
Schema generation, which is what powers Vyne's integration engine, is provided by Taxi. Currently, Taxi only supports JVM languages, with work on other languages underway. Here's a quick overview of language support across the JVM stack:
Level of support
Some support through reflection. Compiler plugin exists for capturing data during compile phase