The 2016 Top Programming Languages
spectrum.ieee.org
spectrum.ieee.org
I wouldn't mind if I never had to use awk again...
Example usage is:
lambda "x0 + x1 * x2" int int int
Code: import sys
# libs I use commonly...
import random, itertools, re
# parse the types of the columns
types = map(eval, sys.argv[2:])
# craft a lambda with the args x0, x1, ... xN
f = eval("lambda " + ','.join("x"+str(i) for i in xrange(len(types))) + ":" + sys.argv[1])
# apply lambda to stdin, don't print results of None
for line in sys.stdin:
args = []
for t, e in zip(types, line.strip().split()):
args.append(t(e))
result = print f(*args)
if result != None:
print result
Examples:Where data.txt is
john doe 37
jane doe 35
jack bob 20
bill bob 40
And I do cat data.txt | lambda "x0 if x2 < 36 else x1" str str int
It will output doe
jane
jack
bob
You can use this sort of tool for a million things. e.g. sample 1 out of every 1000 lines: lambda "x0 if random.random() <= .001 else None" str
It's probably the same power and whatnot as awk, but I know and am much more familiar with python, so it's useful for me. $ awk '{if ($3 < 36) print $1; else print $2}' data.txt
doe
jane
jack
bob
Python has a lot of strengths and is better than awk at a lot of things, but one-liner column based text processing on the command line is literally awk's bread and butter.Instead of writing scripts for each little task, I just write one-liners. When they become more than 2 lines long it becomes unwieldy and I switch it to a regular script.
From what I hear, Perl 5 is prime for the problem set you defined, but I've never seen any aggregated resource of people's Perl5 munging scripts. Do us all a favor and post a Github Gist of that tool (along with common invocations of you going wild with regexes and hashmaps). If you're feeling overly generous, post the source of the commonly used regular scripts as well.
I don't think of it as a better awk, just a drop-in to minimize my cognitive overhead. It's basically Python-flavored awk.
Given awk's age (1977-when computers were much slower and memory much more expensive) and pedigree (Aho, Weinberger, and Kernighan), I wouldn't bet against it for a task like you describe, but that's just a feeling. Again, I don't have any numbers to support that.
For things like building accumulators a set of data/log parsing rather than data munging (hits per hour or enumerative tasks), I'd imagine (g|n)?awk might hit your 100x since you'd just grab the fd and traverse being IO bound. I'm not sure how awk does it, but if it's just saving an accumulator value (or 10) in a register. Assuming x64-64 treats, say, an r3 fetch analogously to a fetch to ecx (err..rcx now I guess), rather than having to keep a full object in L1 cache, awk has a huge advantage.
---
N.b., if you're benching tasks like this, don't use 'time' and STDOUT and think you're getting real performance numbers. Your bottleneck (terminals can only render $x lines a minute, so the kernel call to write(STDOUT, ....) will be where you choke, not at the language. Also disk fragmentation would be another issue. Put the both the test file and the output file on a RAMdisk.) Cache flush with Something like sync; echo 3 > /proc/sys/vm/drop_caches (on Linux, I forget the BSD way of doing it) then `time benchmark.py /mnt/ramdisk1/file > /mnt/ramdisk2' over multiple runs, under various loads, with different data sets, etc
Another interesting thing to note is that comp arch is so advanced (I was reading a paper on formal verification of ISAs, and apparently even 12 dollar ARMs now have out-of-order instruction execution type stuff) that between the kernel scheduler and CPU optimizations, Python will likely benefit much more from disk-seek latency (effectively allowing PyStringObject allocation to occur while you're waiting for /dev/sd$n to return).
I'm certainly not an authority on rigorous benchmarks though - someone like Brendan Gregg please jump in!
[0] https://diamondinheritance.blogspot.com/2008/04/awk-vs-pytho...
[1] https://brenocon.com/blog/2009/09/dont-mawk-awk-the-fastest-...
[2] http://www.laurentluce.com/posts/python-string-objects-imple...
Swift will enter the top 10 next year after more iOS developers finally see it as stable. The big source changes in the upcoming 3.0 have caused a lot of people to wait.
Nativescript, titanium, xamarin, or qt is where react native would be categorized with
Apple has developed a bad habit of abandoning compatibility with their developer tools. While this is somewhat more excusable with Swift, given that it's fairly new, it's pretty annoying to have to (e.g.) basically relearn Xcode from scratch with every major release.
First, the article says "The 2016 Top Programming Languages" (emphasis mine), and yet HTML is on the list -- which is not a programming language, but a markup language.
Second, if you decide to ignore this, and see how HTML ranks, and turn off everything but the "Web" types, HTML ranks #8 (behind Java, Python, C#, PHP, JavaScript, Ruby, and Go).
OK, I know, I'm easily amused :-D
I'm not buying it. I think there is a valuable distinction between a programming language and a markup language. HTML is not a programming language, it's a markup language (hence the last two letters of its name).
The top ten languages on HN are C, C++, Assembly, Python, Go, Java, Rust, Swift, D and Lisp.
The only reason R is there is because of mentions in research papers which is weighted at 100%.
Java is #1 for jobs and StackOverflow.
Python and Swift is trending + hackernews mentions.
C/C++ are always up there.
Javascript is 5 or 6 always.
Shouldn't surprise anyone.
http://www.tiobe.com/tiobe_index
RedMonk with its more web-centric focus places it at #1:
http://redmonk.com/sogrady/2015/01/14/language-rankings-1-15...
This matches my experience I think JavaScript is popular on the internet but within businesses it is much less common.
Within my world (Industrial manufacturing) the most frequently used languages at least in my orginization...
Control Systems (HMI's, PLCs, Operator Guidance etc): C, C++, A lot of domain specific stuff for PLC's
Process Modelling / Engineering Simulation: Fortran, C, C++, some python, some matlab.
Scrpting: Perl, VBS, .BAT
Analytics / Reporting: SAS, COGNOS, ACCESS (older mostly replaced)
Web Apps: Java, ASP (older), Oracle Forms (older)
Legacy/Mainframe: PL/1 (rarely touched mostly just runs)
In House (business) Apps: Java, C++ (older), VBA (i.e. excel spreadsheets)
Intranet: Sharepoint
At least when I've been job hunting for web-related work, your typical job posting lists the back-end language and the front-end is just assumed. (Things might have changed with all the heavy-duty front-end JS frameworks out there now.)
leftpad(" I think your language is broken", 35)
The nice way: where's the data that would suggest <language X> should be higher or lower than #8? What are the flaws in the measurement methods?Let the karma bleed =P
I'm not discounting the validity of anything here, just stating an example.
Java Developers when they learn ruby, I am sure the will switch to JRuby, coding every thing in ruby and compiling them with JRuby to run them in JVM.
So, I am hopeful that ruby though not listed in top 10 this year, it will be listed next year.
I have faced similar problems like you. Its because ruby is easy to learn for everyone including morons. :D
in particular, adding one small column (about the same width as the "Types" column) with a sparkline having five points, connected by a single line and which represents the Spectrum Ranking for the years 2012 - 2016
with this, the reader could see for each language the five-year trend in their Spectrum Index.
two languages might be next to each other on this chart, yet one might be trending monotonically downward, while the other might be trending sharply and consistently upward.
so for instance, look at places 26 - 29: Rust, Delphi, Fortran, and D. Those are contiguous, hence have similar Spectrum index values, but the shapes of their last-five-year time series are probably quite different (eg, Rust, sharply upward trend, only perhaps slightly flatter for D, essentially flat for fortran, and perhaps downward for delphi).
Same thing for web although I guess it could be the case that people are using C on a lot of old apps that add up to a significant marketshare? I would still be pretty shocked if that were the case.
I'm also pleased to see Fortran is still going strong. Great language for crunching numbers.
I have fondness on the time when HP was American... and Motorola... and calculators were meant to last... mechanical keyboards... when things were simple...
I tell people that the keyboard... the original mechanical one, just God knows how much money took to be designed... how many thousand hours of trial and error it took to be designed... just to get to hp and their new layouts... (don't make me talk about new thinkpads).
Dennis Ritchie was the IBM of programming languages... when fad after fad of JS framework pass, C stands...
It is about as expressive as a "portable assembly language" can be expected to be, it has pretty weird syntax [1], it has neither hygienic macros nor a module system, using "include files" instead. And a bunch of undefined behaviors on top of that.
Well, it was the unifying language despite all these shortcomings, because Unix. This is very much like JS is an ugly unifying language of sorts today, because the browser.
I very much hope that maybe something like Rust will take the place of the close-to-metal portable language. C made some sense when you had a 16-bit CPU @ 10 MHz and 128 KB of RAM for a development machine, and ed on a teletype as the IDE. Now we can do better.
Oranges vs apples
R is at #6 measured by "trending", but only #12 measured by "jobs" (below assembly).
Some of their methodology seems a little handwavy (which to be fair is no different than I've seen with other similar rankings).
For instance, the number of questions asked on StackOverflow confounds the popularity of the language with the difficulty/ambiguity/poor documentation of the language (e.g. a poorly-documented language might well result in a disproportionate number of SO questions).
Straight Google search results (as opposed to Google Trends, which they also use) would only seem to prove that a language was popular in the past. There are lots of Google search results for the Roman Empire, but that doesn't mean it's still a going concern. :-)
CareerBuilder and Dice were headhunter cesspools, the last time I looked at them. I would be very wary of drawing any conclusions about popularity from those (or similar) sites.
And so on.
Compare to someone looking to hire a web developer. There you are much more likely to need the developer to use specific languages, and so those should be mentioned in the job listing.
I will have to turn in my Hipster Membership Cards :-)
Web and app developers code apps connecting net front ends to databases. JS front end and maybe obj-c/swift/c#/python/ruby/perl for the middle tier.
R is domain specific to stats/econometrics/engineering/data analysis. It competes with matlab, c++, maybe fortran and recently python.