4 ms·
raises hand There are dozens of us!
by mbrock 9y ago
raises hand
There are dozens of us!
- kreetx 9y agoliterally :) EDIT: Oh, the hard earned karma is leaving me. :) I apologize for the irony! In a nicer way: if you're interested in type theory then javascript is not the language to look at. I'm not even sure if typescript helps here, since the typing mechanism is fairly simple (and I don't mean it's not useful -- just not very advanced).
- mbrock 9y agoWell, it's kind of like "if you're interested in type theory then bash will not arouse your intellectual curiosity." Sure, but it's still a practical and kind of necessary part of the world, and if you take it for what it is, it's pretty nice.
- kreetx 9y agoI can't really agree with you. Yes, javascript is "good for what it is", but this kind of positive evaluation is only the result of that it (the language) pretty much can't be avoided when doing web development. Many things appear in a more positive light if they have been around you long enough, and you've gotten use to the experience. I.e yes, bash is nice, but if it weren't the default shell in most systems I wouldn't ever think about switching to it voluntarily, nor be interested in learning it. It is useful because its so widely spread.
- mbrock 9y agoThe reasons why people accuse JavaScript of being a terrible hack just never really resonated with me. The "wat" video is funny, but that stuff just isn't a problem in my experience. Sure, I've been confused by "array.map(parseInt)" and other oddities, but overall, I think weird semantic edge cases are mostly an easy thing to nitpick about. So as I see it, JavaScript is a nice little language with good syntax for literals (JSON, which conquered the world), a familiar brace notation, first class functions, high quality implementations, etc. Bash's oddities are weirder, but it's also a fun and extremely useful language, and I like it a lot. Many of my coding and administration tasks involve calling programs, running background processes, piping streams around, making temporary files, globbing, etc etc, and shell scripting is still unsurpassed in convenience for these things.
- kreetx 9y agoI don't think js it's a hack. Yes, in the beginning there were some strange things, like objects based on prototype, referring to this, and probably more. Much of this has been worked on, and fixed (unfortunately-but-understandably keeping the old behaviors as well). But nowdays there are many who want more-- they want types --and not only simple types, but some advanced type system. This is where it's hard to see the intersection of js "likers" and type theory "likers" -- they must have really different reasons for liking these things. As for where the criticism towards js probably stems from is the lack of freedom -- it's the only language that runs in browser. On the server people are free to choose what to use. And yes, you can now compile other languages to js too, but reaching an agreement to use such a setup can be challenging in many workplaces.
- mbrock 9y agoThe overlap between people who love Haskell and people who love Nix is huge, yet Nix has no static typing! Sure, people recognize that a good static type system could improve Nix, but they also recognize that making such a thing isn't easy and that advanced type systems steepen language learning curves. I just try to counter the meme that people have to take a side and can't simultaneously appreciate very different languages. :)
- kreetx 9y agoIt's a good discussion! I think it's more about where are we coming from and where are we going. I have no nix experience (but know bits from reading stuff on the internet :-), but maybe the pro-nix attitude among haskellers is from a few factors: (1) referentially transparent definitions, and (2) it's better than things that have come before. I.e even with other devops/deployment scripting tools nix adds new value, and is in this sense "on it's way somewhere" (perhaps haskellization, but we'll see). So the nix people might move to the typed version when that happens. But for languages the typed ones are already here, and have been for quite some time. So if one has stuck around with javascript then my question is why (apart from the practicality reasons).
- dahauns 9y agoDon't underestimate Typescript. Sure, it's somewhat restricted by the "superset of JS" property, but you still get stuff like ADTs with exhaustiveness checking.
- dmitriid 9y agoTS doesn’t have exhaustiveness checking
- dahauns 9y agoI know TS discriminated unions may not be the most elegant construct in the world, but in what way is the check via the never type (as a return or assertion parameter after the switch) not an exhaustiveness check?
- dmitriid 9y ago“exhaustiveness checking”: automatically making sure that we’ve covered all of the possible cases anywhere that we interact with a piece of data [1] Typescript doesn’t do that. There’s a way to manually force exhaustive checking with discriminating unions: https://github.com/basarat/typescript-book/blob/master/docs/types/discriminated-unions.md https://github.com/basarat/typescript-book/blob/master/docs/... However, it’s a manual workaround. [1] Quoted from http://www.adamsolove.com/js/flow/type/2016/04/15/flow-exhaustiveness.html http://www.adamsolove.com/js/flow/type/2016/04/15/flow-exhau...
- dahauns 9y agoHm? Typescript actually uses the same mechanism for exhaustiveness checking as flow (like your link describes).
- dmitriid 9y agoIt does. And, like in the article, Typescript is “saved by a hack”. Compare that to Elm, where it will automatically fail compilation if you don’t include all required types in a switch statement. Without any hacks or manual intervention.
- TeMPOraL 9y agoExactly. On the diagram: OO you're part of the boundary between two O-s that renders on a cleartype-enabled screen! :).