Live data from Hacker News

Have Static Languages Won?

pointersgonewild.com

61–70 of 120 posts

Re: Have Static Languages Won?

#61

No, they didn't. This article is narrow minded and prejudiced. Of cause if we're talking about programming in general - static typing languages are often a better option. But programming doesn't ends there, there is technical computing, statistical computing, data analysis and so on. How about beating Python + numpy + pandas in data crunching or maybe R in statistics? In this fields underlying data types is almost al…

> How about beating Python + numpy + pandas in data crunching

I'd think this sentiment misses a small bit of context.

In the above combination, Python is the glue language, which merely makes it easy to dispatch the heavy lifting. Numpy is a damn good convenience wrapper around the under-the-hood number crunching engines - which themselves are written in static languages.

I mean, have you ever tried to _build_ numpy from scratch? That thing pulls in both BLAS and LAPACK, some of the most heavily optimised libraries in the world. These fortran(!) libraries can trace their ancestry all the way to 1970's, and have benefited from aggressive optimisations done over the course of 4 decades. [0,1]

So, invoking numpy as a testament to power of dynamic languages misses a pretty important point. And I say that as someone who loves Python, and uses it as a first-choice tool in perhaps 90% of use cases.

0: https://en.wikipedia.org/wiki/Basic_Linear_Algebra_Subprogra...

1: https://en.wikipedia.org/wiki/LAPACK

Re: Have Static Languages Won?

#62
post #29

Earlier quoted context omitted.

> Just because you don't have to explicitly write out the type does not make it any less static. No, but not having to write the type was one of the biggest attractions of dynamic languages -- a lot of us didn't care that much for being fully dynamic, but just enjoyed the less ceremony of dynamic languages. As for not having to commit to types for some cases, STL languages can also have a "void *" or "variant" or "dy…

There is one other undeniable advantage to dynamic languages: you can express things in a dynamic language that you can't in a static one. Static languages try to be as sound as possible, at the cost of some completeness. Dynamic languages are less concerned with soundness and can be more complete. As an example, duck typing is usually not possible to achieve in a static language - it's really hard to allow duck typi…

There is one other undeniable advantage to dynamic languages: you can express things in a dynamic language that you can't in a static one. Static languages try to be as sound as possible, at the cost of some completeness. Dynamic languages are less concerned with soundness and can be more complete.

They are both "limited" to being Turing complete and therefore should be able to express the same things.

Implementing the same algorithm can be cumbersome with types at times (No 1:1 representation of JSON Objects for example) but you can define types which wrap things like that to make it work anyway.

Re: Have Static Languages Won?

#63
Article points to http://wtfjs.com/ to show "glaring flaws" of JS. JavaScript is not perfect, but almost all what is presented on sites similar to wtfjs.com are non-issues to me. It may be stupid or surprising that API behaves in some ways, but as long as it behaves exactly as in documentation it is not much of a problem. I always check available documentation even for basic APIs in every language that I use. i.e. I was amazed that even senior developers at my previous job did not know that strncpy is practically useless. It was just `man strncpy` away.

In a way static typing can save you just like reading of documentation, but in a more organized manner. That said you should still eat your ve^W^W^W read documentation.

What helps in case of dynamic languages is REPL. It is even better than documentation sometimes. You can easly check every line with your reasoning. For C or C++ I always have some simple file for testing basic constructs to check my assumptions. One could argue that that is the role of unit tests, but one does not prevent the other. Unit tests are same thing, but in more organized manner.

Re: Have Static Languages Won?

#64
post #21

Well, there's plenty of controversy in this one, but I think Compared to CS students, the average web developer is not as passionate about programming, and not as skilled a programmer. ...probably takes the biscuit; I'm not even sure where to start with it really, apart from my complete failure to understand how "web developers" and "CS students" are supposed to be two distinct groups which are able to be compared.

Anecdotally, on my year around 75% of students were there just because CS was supposed to bring money. They've started CS studies while not knowing how to program, knowing nothing about operating systems or caring. For them it was a 9-17 future job, nothing more.

Well people come from different backgrounds. I went to UIUC having taken the only programming class my High School had, QBasic. I was in wayyyy over my head in my first C class slinging pointers all over (and then LISP - whoah).

Other people came in after programming as a part time job for a few years. I think it's a little quick to say someone came in for the money because I came in not knowing a ton of programming. On the other hand if course I look at salaries when picking majors. Otherwise I would have been a sci-fi writer :) Programming is better than writing now that I learned it...

Re: Have Static Languages Won?

#65
post #21

Well, there's plenty of controversy in this one, but I think Compared to CS students, the average web developer is not as passionate about programming, and not as skilled a programmer. ...probably takes the biscuit; I'm not even sure where to start with it really, apart from my complete failure to understand how "web developers" and "CS students" are supposed to be two distinct groups which are able to be compared.

Anecdotally, on my year around 75% of students were there just because CS was supposed to bring money. They've started CS studies while not knowing how to program, knowing nothing about operating systems or caring. For them it was a 9-17 future job, nothing more.

It doesn't help that there is this confusion that if you want to get a job as a programmer, you need to study CS, even though CS is not necessarily the best path to doing web development or writing iOS apps! This explains some of the frustration many students suffer, which makes them claim CS is detached from the real needs of programmers. This also explains articles like "the perils of Java schools" -- a "Java school" is by definition NOT teaching CS! CS is a theoretical field which has applications for the software industry (otherwise it wouldn't be very interesting), but it is "researchy" and theoretical first. It is the foundation of computing, kind of like applied maths, and not supposed to be training for your next job. Unless, of course, your next job actually requires a scientist or someone with a good understanding of the theory.

This unfortunate conflation of "CS" and "programming" is so common it's starting to become the mainstream definition of CS, much to my annoyance, and soon it will no longer make sense to push back against it :(

Re: Have Static Languages Won?

#66
post #4

An alternative is optional static languages like Groovy or alternatives like python Type Hints ( https://www.python.org/dev/peps/pep-0484/ ) are better than pure dynamic languages.

I agree, I think optional or gradual typing is the future for dynamic languages.

So a big project with optional typing. How do you handle it? Each person picks a level? Or make rules that all services are strongly typed but within a method is loosy goosy?

I see the project going one of two ways. One all loosy goosy. One all statically typed. At which point what did optional typing add? Pick a side and go for it.

Re: Have Static Languages Won?

#67
post #57

Earlier quoted context omitted.

In what sense are academia and corporate not "the real world"?

[deleted]

In what sense are there no innovative projects in academia? Of all the criticisms that could be made of academic research and projects, this one just doesn't make sense!

Re: Have Static Languages Won?

#68

Earlier quoted context omitted.

> Which static language should supposedly have won? It's absolutely not that specific static languages have "won". But rather that the latest crop of static languages have proved that the oft-cited downsides of static typing, e.g. type stuttering in declarations, can be pragmatically addressed by other means, e.g. type inference. As such, the cost differential of static languages over dynamic is reduced to near-zero,…

So basically Scala and Haskell? I've tried Go but was turned off by the complexity of writing a sort function - an artifact of static typing. Seems to me you'll always end up with something like generics which becomes complicated quickly?

I mean every language has a baked in sort function, so maybe that is a bad place to start :)

Java collection signatures are not super complex but they have fundamental bugs fixed in the slightly more complex scala collections type signatures.

Re: Have Static Languages Won?

#69
post #17

JavaScript, PHP, Python, and Ruby are all in the top 5 spots on GitHub. Java is the only STL that made the cut. There are certainly types of work that seem to favor dynamic languages, because they have the ability to do some interesting things. ORMs, for example, far more powerful in dynamic languages as far as I've encountered

> JavaScript, PHP, Python, and Ruby are all in the top 5 spots on GitHub. All of which are established languages created in the 90's. It takes time for languages which are rapidly gaining mindshare to gain marketshare on GitHub.

> It takes time for languages which are rapidly gaining mindshare

Honestly curious: which new languages are those?

Re: Have Static Languages Won?

#70
Static languages haven't "won".

There's just not much point in creating a new dynamic language.

Ruby is flexible enough to turn into a DSL for whatever. Python does it's job very well. Lua has it's niche. Javascript is everywhere now.

What can a new dynamic language do that isn't easier to accomplish with libraries?

So most of the language development has gone towards making static typing easier to use. Improving on C++ / Java is easy. There are interesting ways to go about it with no clear right answer.

Post reply on HN