5 ms·
I like types, but jeez, the vast majority of web systems over the last decade were written in dynamic languages. You're trying to claim absolute proof for a ver
by woah 11y ago
I like types, but jeez, the vast majority of web systems over the last decade were written in dynamic languages. You're trying to claim absolute proof for a very subjective choice, and it sounds silly.
- vosper 11y agoThe vast majority by count, perhaps, but if you took complexity of functionality into account I bet you'd find static languages (specifically Java and C#) take the win.
- paulddraper 11y agoGoogle uses a lot C++. They've done some Web things.
- kazinator 11y agoThere can be an awful lot of dynamic typing hiding inside C++ code bases, by the way. C++ has very good support for dynamic typing. You can make C++ look almost like Javascript, if you want.
- paulddraper 11y agoC++ has polymorphism and templates. If you have a lot of dynamic typing, you may want to look at C instead.
- marvy 11y agoHow on earth do you make C++ like JS? I'm no JavaScript programmer so correct me if I'm wrong, but I think this is legal: x = 5; x = "five"; How do you do that in C++? In C# they have the dynamic keyword, but C++? I guess boost has all sorts of magic, but... good support?
- kazinator 11y agoThat can be easily made to work in C++95. x can be of a smart pointer type (let's call it "var") which acts as reference to an anyobject class instance, which comes in varieties like string_anyobject, integer_anyobject and so on. The smart pointer class can have a few assignment operators and conversion constructors for usage like var x = "lit"; or x = 5.
- seanmcdirmid 11y agoThey are not making a claim backed up by scientific evidence, but are rather stating a believable assumption that premises the work. PL is more about studying type theory than a it figuring out why it is useful (which dives into non science design anyways).
- sgeisenh 11y agoThere is plenty of work in PL that covers why type theory is useful. Check out the classic paper by Philip Wadler called "Theorems for free" that covers some of the terrific benefits of parametric polymorphism. There has also been a good amount of discussion generated by organizations such as Jane Street concerning the benefits of static typing and type inference in practice. Notably, the free documentation (that is completely coupled with the code) that you get when you design software that takes advantage of the type system.
- seanmcdirmid 11y agoWadler's work is great, I've seen his talk on this many times (where he has the lambda shirt on), but it doesn't really cover "why it is useful" just "why it is inevitable". Really, how would you scientifically show that parametric polymorphism is "useful?" "Useful" isn't a very empirical property, it isn't something you can reliably measure. In a scientific paper, you can't just say something like: > When it comes to maintaining and evolving these systems, the lack of explicit static typing becomes a bottleneck. without justification! You have a citation, or perhaps it is something just accepted universally (which it isn't, of course). At the very least, you have to weaken the statement a bit...like: > When it comes to maintaining and evolving these systems, the lack of explicit static typing is probably a bottleneck. You can't talk in absolutes without evidence. But you know, the benefits of static typing are clear via anecdotal experience, we only really argue about whether or not the benefits balance out the disadvantages of static typing (and how those disadvantages can be mitigated, and if that is enough...). Again, in arguing about this we are firmly in the area of design and not science.
- iheartmemcache 11y ago
- coldtea 11y ago>I like types, but jeez, the vast majority of web systems over the last decade were written in dynamic languages That's because the vast majority of web systems are glorified CRUD apps, the easiest kind of application one can make. When it comes to the real hard backend parts (not just some queue handling of video conversion tasks for example, but things like search engines, social graph stores, programs for finding the cheapest air tickets, etc.), they're usually done in languages like Java, Scala, C++, Go, etc. Heck, even as web front-ends got more evolved, people developed several typing systems to assist us (Flow, Typescript, etc) to solve that need, we got Go, Hack. Optional types are also landing in PHP and even in Python -- there's a consensus among many people about a need for such things. And Google wrote their more complex apps in a Java lib that could spat out Javascript IIRC (GWT). As for the non CRUD apps, from PostgeSQL, Chrome, Office and Photoshop to Pixelmator, OmniPlan, Notepad++ and Scrivener, nobody writes those in dynamic languages (where nobody obviously means: some outliers being excepted). One might argue that those are few (they are not, they are merely "fewer" than web systems. Still millions of programmers work in that space), but the point remains: for developing harder apps, people opt to static languages.