The Debug Adapter Protocol is a REPL protocol in disguise
1–6 of 6 posts
Re: The Debug Adapter Protocol is a REPL protocol in disguise
#2Re: The Debug Adapter Protocol is a REPL protocol in disguise
#3Hmm, the is `type` the static type or the dynamic type, for languages where both apply?
Re: The Debug Adapter Protocol is a REPL protocol in disguise
#4Hmm, the is `type` the static type or the dynamic type, for languages where both apply?
It’s a very confusing question. How can an evaluated expression’s result have multiple types?
For instance, in typescript you could ascribe an expression with the type Any, yet the actual runtime type will not be Any, it will be any concrete type.
In object oriented languages, you may define a hierarchy of classes, say with "Car" and "Truck" being sub-classes of "Vehicle", each having a concrete implementation, and have an expression returning either a "Car" or a "Truck", or maybe even a "Vehicle". This expression will be statically typed as returning a "Vehicle", yet the dynamic type of the returned value will not necessary be (exactly) that.
Re: The Debug Adapter Protocol is a REPL protocol in disguise
#5Re: The Debug Adapter Protocol is a REPL protocol in disguise
#6Hmm, the is `type` the static type or the dynamic type, for languages where both apply?
It’s a very confusing question. How can an evaluated expression’s result have multiple types?
class Parent {};
class Child extends Parent {};
class Wrapper
{
Parent foo;
}
w = new Wrapper();
w.foo = new Child();
evaluate w.foo;
// static type: Parent
// dynamic type: Child