Live data from Hacker News

Dynamic Typing in SQL

rockset.com

21–27 of 27 posts

Re: Dynamic Typing in SQL

#21

> Strong, because values have one specific type (or None) Because its type system does not provide implicit type conversion I guess. But some languages have a stronger type system with, in addition, highly qualified types (e.g. constness, range, sign or any custom contract). > Dynamic, because variables acquire type information at runtime, and the same variable can, at different points in time This is not a character…

This is not a characteristic of dynamic typing, some statically typed languages supports variable shadowing in the same scope. A dynamic (or hybrid) typing system is IMHO simply a system which provides a variant type as first class citizen.

You're welcome to your humble opinion.

Your opinion is not generally accepted, though. The most common definitions of static versus dynamic typing boil down to whether both names and values have types and those types must be compatible (static) or whether only values have types and no checking for compatibility with names is required (dynamic). That is:

    a = 3
    a = 'foo'
The above probably fails in a statically-typed language, because 'a' will be a name of a type incompatible with the value 'foo'. In a dynamically-typed language it's perfectly OK.

Re: Dynamic Typing in SQL

#23

> Strong, because values have one specific type (or None) Because its type system does not provide implicit type conversion I guess. But some languages have a stronger type system with, in addition, highly qualified types (e.g. constness, range, sign or any custom contract). > Dynamic, because variables acquire type information at runtime, and the same variable can, at different points in time This is not a character…

This is not a characteristic of dynamic typing, some statically typed languages supports variable shadowing in the same scope. A dynamic (or hybrid) typing system is IMHO simply a system which provides a variant type as first class citizen. You're welcome to your humble opinion. Your opinion is not generally accepted, though. The most common definitions of static versus dynamic typing boil down to whether both names…

> The above probably fails in a statically-typed language

I am not sure that this is always correct. I am pretty sure that your example would be accepted in some static type systems with union types such as https://www.cl.cam.ac.uk/~sd601/papers/mlsub-preprint.pdf

Re: Dynamic Typing in SQL

#24

Earlier quoted context omitted.

This is not a characteristic of dynamic typing, some statically typed languages supports variable shadowing in the same scope. A dynamic (or hybrid) typing system is IMHO simply a system which provides a variant type as first class citizen. You're welcome to your humble opinion. Your opinion is not generally accepted, though. The most common definitions of static versus dynamic typing boil down to whether both names…

> The above probably fails in a statically-typed language I am not sure that this is always correct. I am pretty sure that your example would be accepted in some static type systems with union types such as https://www.cl.cam.ac.uk/~sd601/papers/mlsub-preprint.pdf

You know, I considered the possibility someone would "well, actually..." me there, and I thought about putting in a pedantic "unless the language you are using supports a type which can be either an integer or a string, and you have previously indicated that the name in question is of such a type, and the values you are attempting to assign are legal for that previously-indicated type".

But then I decided I wanted to live in a world where people don't need to write a Ph.D. thesis with a hundred pages of footnotes covering every conceivable logically-possible eventuality just to make a simple point.

Re: Dynamic Typing in SQL

#25

Earlier quoted context omitted.

> The above probably fails in a statically-typed language I am not sure that this is always correct. I am pretty sure that your example would be accepted in some static type systems with union types such as https://www.cl.cam.ac.uk/~sd601/papers/mlsub-preprint.pdf

You know, I considered the possibility someone would "well, actually... " me there, and I thought about putting in a pedantic "unless the language you are using supports a type which can be either an integer or a string, and you have previously indicated that the name in question is of such a type, and the values you are attempting to assign are legal for that previously-indicated type". But then I decided I wanted t…

> and you have previously indicated that the name in question is of such a type

This is not needed under the inference system proposed in that paper.

> But then I decided I wanted to live in a world where people don't need to write a Ph.D. thesis with a hundred pages of footnotes covering every conceivable logically-possible eventuality just to make a simple point.

Have you considered finding better examples instead? I think that a better explanation on the differences between static and dynamic typing would be to simply say that in dynamic typing type checking happens during the runtime while in static typing type checking happens during the compile time.

Re: Dynamic Typing in SQL

#26

Earlier quoted context omitted.

You know, I considered the possibility someone would "well, actually... " me there, and I thought about putting in a pedantic "unless the language you are using supports a type which can be either an integer or a string, and you have previously indicated that the name in question is of such a type, and the values you are attempting to assign are legal for that previously-indicated type". But then I decided I wanted t…

> and you have previously indicated that the name in question is of such a type This is not needed under the inference system proposed in that paper. > But then I decided I wanted to live in a world where people don't need to write a Ph.D. thesis with a hundred pages of footnotes covering every conceivable logically-possible eventuality just to make a simple point. Have you considered finding better examples instead?…

Have you considered finding better examples instead?

Have you considered being a better person? Rushing to "well actually" someone else over even the tiniest omission in something they say is not a positive character trait. What you should do is immediately and permanently and irrevocably stop doing it.

Re: Dynamic Typing in SQL

#27

Earlier quoted context omitted.

> and you have previously indicated that the name in question is of such a type This is not needed under the inference system proposed in that paper. > But then I decided I wanted to live in a world where people don't need to write a Ph.D. thesis with a hundred pages of footnotes covering every conceivable logically-possible eventuality just to make a simple point. Have you considered finding better examples instead?…

Have you considered finding better examples instead? Have you considered being a better person? Rushing to "well actually" someone else over even the tiniest omission in something they say is not a positive character trait. What you should do is immediately and permanently and irrevocably stop doing it.

> Rushing to "well actually" someone else over even the tiniest omission

Except that I don't believe that it was a tiny omission - especially when you are trying to correct someone.

> is not a positive character trait

Neither is saying "You're welcome to your humble opinion" and continuing with an incorrect example to be honest.

> What you should do is immediately and permanently and irrevocably stop doing it

No can do. I have multiple times fallen "victim" to incorrect examples or claims online - and have multiple times also been "saved" by people posting corrections (even minor ones). If this is something that I can prevent from happening to others, is the ethical thing not to post a correction?

In any case, I did not mean to insult you nor was my post meant to be an aggression to you. I would suggest for the future to take corrections with a more open mind - not everyone is after you.

Post reply on HN