5 ms·
every dynamically-typed language has "weird" behaviour around type coercion, that's simply the nature of the beast. sure wish i knew what you are talking about
by workinthehead 8y ago
every dynamically-typed language has "weird" behaviour around type coercion, that's simply the nature of the beast.
sure wish i knew what you are talking about w/r/t "silently failing". JS has working exceptions just like 99% of widely used languages.
I'm very glad that you've been omniscient enough to determine what "proper" parallel support is, though. How's that working out for you? Meanwhile, those of us using JavaScript simply run one process per core and never worry about contention, deadlocks, or race conditions.
- tom_ 8y agoProbably this thing, easy to spot in isolation but much harder when part of a larger system: > x={} > x.fred undefined Actively unhelpful!
- pdpi 8y ago> every dynamically-typed language has "weird" behaviour around type coercion Do they now? $ irb irb(main):001:0> "0" + 1 TypeError: no implicit conversion of Fixnum into String from (irb):1:in `+' from (irb):1 from /usr/bin/irb:11:in `<main>' irb(main):002:0> ^D $ python >>> "0" + 1 Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: cannot concatenate 'str' and 'int' objects >>> ^D $ node > "0" + 1 '01' > Meanwhile, those of us using JavaScript simply run one process per core and never worry about contention, deadlocks, or race conditions. If you never worry about those things, then you're either not sharing any resources at all (in which case threads are also dead easy), or you're failing to deal with the shared resources properly.
- StavrosK 8y agoI know you know this, but for the GP or anyone else: "Dynamically typed" doesn't mean "strongly typed". Python and Ruby are strongly typed, JS is weakly typed.
- workinthehead 8y agoIn your rush to be an asshole you completely missed my point, smart guy.
- pdpi 8y agoYeah, went for the "picture is worth a thousand words" approach to explaining the distinction :)
- workinthehead 8y agoand yet you still managed to misunderstand the point :)
- workinthehead 8y agoThank you for illustrating my point. All of the dynamic languages made different decisions on how to handle type conflicts, there simply is no right or wrong answer. Oh, and JavaScript is single-threaded. It's impossible to share resources in a single process.
- pdpi 8y ago> Oh, and JavaScript is single-threaded. It's impossible to share resources in a single process. DBs, files, etc etc. in-process memory isn't the only resource you're sharing.
- workinthehead 8y agoYou really don't have a solid understanding of how computers work, do you?
- dragonwriter 8y ago> every dynamically-typed language has "weird" behaviour around type coercion, that's simply the nature of the beast. No, that's not true at all. Dynamic languages don't necessarily have type coercion at all, much less weird behavior around it (and, conversely, statically typed languages they have coercion may have weird behavior around it; there's just no link between dynamic typing and weird coercion behavior.)
- workinthehead 8y agoWho's to say not doing type coercion isn't weird? Every dynamic language treats things slightly differently.
- dragonwriter 8y ago> Who's to say not doing type coercion isn't weird? Well, if someone has to do it, I will: not doing type coercion isn't weird, and doing inplicit type coercion (not strict promotion[0]) is both weird and dangerous. But, in any cases that's not really the point. The point is that in this... > Every dynamic language treats things slightly differently. “dynamic” is irrelevant. Languages have a wide variety of approaches, doing promotion, coercion, neither, or both (though where both are done, it's often just called coercion even when it is promotion), and dynamic vs. static is mostly irrelevant. [0] that is, where the “from" type has a range that is a subset of the range of the “to” type.so that there is never a change in meaning resulting from the conversion.
- FridgeSeal 8y ago> I'm very glad that you've been omniscient enough to determine what "proper" parallel support is, though. How's that working out for you? Meanwhile, those of us using JavaScript simply run one process per core Yeah, and I can do the same thing in Python, and it will be equally as lame: both languages are fundamentally single-threaded. You act as if JS has all problems solved: Erlang/Elixir/Golang have far superior async & parallel stories and will happily thrash JS/Node in performance and efficiency. How’s it working out for me? Well I do a lot of stuff in Haskell and Rust now, so pretty great actually.