5 ms·
A better question might be, why are people still using OO dynamic languages without any typing?
by pmarreck 2y ago
A better question might be, why are people still using OO dynamic languages without any typing?
- kstrauser 2y agoNot sure. Is anyone using a language like that? Python certainly isn’t one.
- worik 2y ago> Python certainly isn’t one. I am not a Python expert, but... Python is described as OO and I thought is is dynamically typed Not quite "without any typing" but close
- kstrauser 2y agoNot really. Python's strongly typed, but dynamically. You can think of Python variables as untyped references to strongly typed values: the values are typed, but their names are not.
- Dylan16807 2y agoI agree with your last sentence, but I think we shouldn't say python itself is "strongly typed".
- kstrauser 2y agoWhy, specifically? It's commonly described as strongly typed and I'm not aware of an argument against that.
- Dylan16807 2y agoIs the specific reason not clear? You just said it. The variables are untyped. Strong versus weak is not super solidly defined as referring only to values and not variables.
- kstrauser 2y ago> Is the specific reason not clear? Correct. > Strong versus weak is not super solidly defined as referring only to values and not variables. You're right. It's not super solidly defined as referring only to variables and not values, either. If dynamic typing is the same as weak typing, there'd be no point in having both phrases.
- Dylan16807 2y ago>> Is the specific reason not clear? > Correct. Is it still unclear with the clarification you didn't quote? I can't tell if I need to explain more or not. > It's not super solidly defined as referring only to variables and not values, either. I didn't mean to suggest it was. > If dynamic typing is the same as weak typing, there'd be no point in having both phrases. It's not the same. There's a bunch of things referred to as "weak".
- deleted 2y ago[deleted]
- tuveson 2y ago> untyped references to strongly typed values I would call that weakly typed since there is no step before your code runs that validates (or even tries to validate) that your program satisfies a "type system". But since the definition of "strong" and "weak" typing has always been vague, I will just say that it is stupidly typed[1], and that I am a pedantic nerd. 1. https://danieltuveson.github.io/programming/languages/stupid/satire/2024/12/10/stupidly-typed-languages.html https://danieltuveson.github.io/programming/languages/stupid...
- wruza 2y agoThis is just hair splitting. What everyone means by "typing" today is typing members in structures and co. Every time you reach for python after a typed language, it feels like going through a barbed minefield blindfolded. The fact that its "world" almost entirely consists of little moving subclasses in subnamespaces doesn't help either. All you can think of python is how to write as few lines of it as possible to return to DX faster. It is my only use case for AI-based development because I cannot stand an extra minute in this abomination without cursing into the editor.
- dragonwriter 2y ago> Every time you reach for python after a typed language, it feels like going through a barbed minefield blindfolded. Using both Python and mandatorily statically typed languages regularly professsionally (my main working languages being C#, Python, and a mix of JS and TS), that's not my experience at all. (Of course, Python has a variety of optional static typecheckers with differing degrees of type inference, as well as supporting explicit type specifications; its not untyped unless you choose to use it that way.)
- worik 2y ago> mandatorily statically typed languages.... C#, Python, and a mix of JS and TS JS and TS are not good examples of typed languages. I dunno about c#
- kragen 2y agoIt's not hairsplitting, and it's not what everyone means, just the people you talk to. Languages without typing are things like assembly language(s), which underlie everything you do on a computer and is (are) still in the TIOBE Index's top 20 https://www.tiobe.com/tiobe-index https://www.tiobe.com/tiobe-index, as well as much more obscure languages. The distinction between untyped languages and dynamically typed languages is night and day. I'm pretty competent in Python, C, Java, JavaScript, assembly, and a number of other languages†, and my experience in Python is nothing like what you're describing, although I do have my own frustrations with it. It's possible that when you're more experienced you'll have a different perspective, but it sounds like you're stuck inside a pretty small bubble right now. ______ † Last year I also programmed in C++, Lua, C#, bash, Tcl, Emacs Lisp, Forth, Golang, OCaml, Scheme, Perl, Common Lisp, and the ngspice scripting language.
- worik 2y ago> Not really. Python's strongly typed, but dynamically Yea, nah! You cannot have both.
- kstrauser 2y agoThat's an interesting and uncommon claim.
- dragonwriter 2y agoThere are different definitions of most of the terms around typing which make most typing conversations confusing as people talk past each other. Particularly, there is a common definition of “typed” which is exactly equivalent to “statically typed” under which all so-called “dynamically typed” languages are actually “untyped”, and within that system strong and weak typing are either a meaningless distinction or one within the set of statically types languages. There's also, of course, a common usage within which “dynamically typed” is meaningful and strong vs. weak typing is a separate distinction, usually mostly discussed within languages with dynamic typing, though languages like C being both statically typed and weakly typed has been discussed.
- nayuki 2y ago> without any typing? >>> "abc" + 321 Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: can only concatenate str (not "int") to str I rest my case.
- homebrewer 2y agoTaPL should be required reading for self proclaimed "engineers". Do untyped languages even exist, or could they? maybe something purely theoretical for ivory tower academics? Even POSIX shell and assembler type their values.
- nayuki 2y ago> Do untyped languages even exist, or could they? Even POSIX shell and assembler type their values. I program in assembly language. Memory is just a big array of bytes. Values don't have types, but each instruction chooses what type to interpret memory as - e.g. uint8, int16, float32, x86 real-mode pointer, long-mode pointer, etc.
- int_19h 2y agoI think one can reasonably argue that, if the language only has a single type, it is effectively "untyped". That would mean languages like Tcl. Or, for that matter, B.
- tjalfi 2y agoBCPL[0], BLISS[1], and Forth[2] are all untyped. [0] https://en.wikipedia.org/wiki/BCPL https://en.wikipedia.org/wiki/BCPL [1] https://en.wikipedia.org/wiki/BLISS https://en.wikipedia.org/wiki/BLISS [2] https://en.wikipedia.org/wiki/Forth_(programming_language) https://en.wikipedia.org/wiki/Forth_(programming_language)
- pmarreck 2y agoBah, I meant strongly or statically typed, not just "typed"