DEV Community

Discussion on: JavaScript is not an untyped language

Collapse
 
jcubic profile image
Jakub T. Jankiewicz • Edited

I don't understand why to write this post. AFAIK there are no untyped languages. There are no such things. Every language has types. Maybe except some esoteric languages like BrainF*ck. They can be static or dynamic but they're always there.

Collapse
 
peerreynders profile image
peerreynders

Primarily because there's a certain sloppiness in the current discourse.

I've seen people repeatedly talk about TypeScript being "strongly typed" when they (as you have correctly observed) should state "statically typed".

Erlang for example is a strongly typed language but it's also dynamic.

It's important for professionals to use standard terminology, and like it or not,

This is what the article is all about.

Lets get the terminology straight so that we can all communicate in a more precise and effective way.

Collapse
 
miguelmj profile image
MiguelMJ • Edited

Please, read the whole post.
About untyped languages: some shell scripting languages are untyped (type-like restrictions come from subprocesses and not from a native type system), some esoteric languages are untyped, assembly languages are untyped, pure Prolog is untyped, Turing machines are untyped. There might be other examples I don't know personally.
Thanks for your comment.

Collapse
 
peerreynders profile image
peerreynders

Is there an actual accepted definition of 'untyped' somewhere or is it one of those terms that only carry meaning within a very specific context?

Thread Thread
 
miguelmj profile image
MiguelMJ

My main references for the subject are Programming Language Theory textbooks written by L. Cardelli or R. Harper. They and other authors (I would need to check again the bibliography for the names) use 'untyped' to refer to languages where values have no types, or a single type, and therefore don't apply type restrictions of any kind.

Thread Thread
 
jcubic profile image
Jakub T. Jankiewicz

I only know one formal name "untyped lambda calculus". But only because there is typed lambda calculus. So obviously normal lambda calculus is untyped.

Collapse
 
jcubic profile image
Jakub T. Jankiewicz • Edited

Assembly have strings (sequance of ASCII characters) and numbers so I don't think it's untyped unless you treat strings are sequence of bytes that are numbers. Prolog probably is untyped since it only have sentances and words.

I was mainly refered to modern languages that are commonly used. No one will compare JavaScript to Prolog or Shell language.

Thread Thread
 
miguelmj profile image
MiguelMJ

Assembly is not a language, it's a family of languages, and the ones that use characters and numbers, do it as syntax sugar, but in the end don't have a type system that imposes restrictions on how you operate them, so they still adjust to the definition of un typed languages.

Shell languages are modern, thousand of developers use Bash daily.

And that of no one will compare that languages, it depends. I personally have seen comparisons between all kind of languages that I have found relevant. "Modern languages" is something really, really unspecific.