Lojic Technologies

Posts Tagged ‘programming

Programming Language Popularity – Part Nine

with one comment

I made a number of Google searches of the forms below and summed the results:

"implemented in <language>"
"written in <language>"
"developed in <language>"
"programmed in <language>"

See Part Eight for prior results 17 months ago. I finally got around to writing a program (in Racket) to automate the collection of the search results, so it was much easier!

I’ve divided the table into sections based on percentage increases of more than 50% from one language to the next. To compute the rank delta, I excluded the newly added languages.

|------+-----------------+------------+-------+-------|
| Rank | Language        | # Search   | Prev. |  Rank |
|      |                 | Results    |  Rank | Delta |
|------+-----------------+------------+-------+-------|
|    1 | C               | 54,696,000 |     2 |     1 |
|------+-----------------+------------+-------+-------|
|    2 | R               | 22,784,600 |    12 |    10 |
|------+-----------------+------------+-------+-------|
|    3 | Java            |  1,490,000 |     6 |     3 |
|    4 | C++             |  1,256,600 |     3 |    -1 |
|    5 | PHP             |  1,082,000 |     1 |    -4 |
|    6 | C#              |  1,065,900 |     5 |    -1 |
|    7 | Python          |  1,016,500 |     4 |    -3 |
|    8 | Lisp Family (1) |    951,300 |    11 |     3 |
|    9 | JavaScript      |    764,100 |     8 |    -1 |
|   10 | FORTRAN         |    565,000 |     9 |    -1 |
|   11 | Perl            |    541,700 |     7 |    -4 |
|   12 | Ruby            |    509,900 |    10 |    -2 |
|   13 | ML Family (2)   |    445,716 |    13 |       |
|   14 | Scheme          |    381,200 |    19 |     5 |
|   15 | Go              |    378,200 |    16 |     1 |
|   16 | (S)ML (3)       |    376,116 |    21 |     5 |
|   17 | Lisp            |    357,900 |    15 |    -2 |
|------+-----------------+------------+-------+-------|
|   18 | Scala           |    236,770 |    23 |     5 |
|   19 | Haskell         |    220,580 |    17 |    -2 |
|   20 | Prolog          |    152,450 |    20 |       |
|   21 | Lua             |    133,360 |    22 |     1 |
|   22 | COBOL           |    113,700 |    14 |    -8 |
|   23 | Erlang          |    101,840 |    18 |    -5 |
|   24 | Common Lisp     |    100,580 |    25 |     1 |
|   25 | Rust            |     90,860 |   N/A |   N/A |
|   26 | Clojure         |     85,930 |    27 |     2 |
|   27 | Smalltalk       |     75,000 |    24 |    -2 |
|   28 | OCaml           |     69,600 |    26 |    -1 |
|   29 | Coffeescript    |     60,420 |    29 |     1 |
|   30 | Julia           |     51,315 |   N/A |   N/A |
|   31 | Forth           |     50,920 |    28 |    -1 |
|------+-----------------+------------+-------+-------|
|   32 | Racket          |     25,660 |    30 |       |
|------+-----------------+------------+-------+-------|
|   33 | Elixir          |      8,112 |   N/A |   N/A |
|------+-----------------+------------+-------+-------|

Update Oct. 6: I added Bing search results, and they’re significantly different. For a while Elixir was #2 because one of the four phrases resulted in no results, so Bing automatically switched to an unquoted search which skewed the results. I caught that and looked over the raw data and didn’t see anything similar for other languages. It’s interesting that C# came out #1 on Bing ūüôā

|------+-----------------+----------|
| Rank | Language        | # Search |
|      |                 |  Results |
|------+-----------------+----------|
|    1 | C#              | 32100000 |
|    2 | C++             | 31900000 |
|------+-----------------+----------|
|    3 | C               |  4845000 |
|    4 | Java            |  3319000 |
|------+-----------------+----------|
|    5 | R               |  1219310 |
|    6 | Python          |  1123700 |
|    7 | Php             |  1093800 |
|    8 | Javascript      |   945200 |
|------+-----------------+----------|
|    9 | Lisp Family (1) |   525530 |
|   10 | Perl            |   460360 |
|   11 | Common Lisp     |   398039 |
|   12 | Ruby            |   301740 |
|   13 | Go              |   270593 |
|   14 | FORTRAN         |   245500 |
|   15 | Lua             |   214200 |
|   16 | Scala           |   188570 |
|   17 | Haskell         |   188520 |
|   18 | Lisp            |   160930 |
|   19 | COBOL           |   140910 |
|   20 | Scheme          |    98012 |
|   21 | ML Family (2)   |    97425 |
|   22 | Prolog          |    75740 |
|   23 | Erlang          |    63270 |
|   24 | (S)ML (3)       |    56375 |
|   25 | OCaml           |    41050 |
|   26 | Smalltalk       |    27960 |
|   27 | Julia           |    25319 |
|   28 | Clojure         |    23091 |
|   29 | Coffeescript    |    20322 |
|   30 | Forth           |    17529 |
|   31 | Rust            |    17086 |
|------+-----------------+----------|
|   32 | Racket          |     6388 |
|------+-----------------+----------|
|   33 | Elixir          |     2542 |
|------+-----------------+----------|

Here is the delta difference between Google and Bing:

|--------+------+-------+-----------------|
| Google | Bing | Delta | Language        |
|   Rank | Rank | G - B |                 |
|--------+------+-------+-----------------|
|      1 |    3 |    -2 | C               |
|      2 |    5 |    -3 | R               |
|      3 |    4 |    -1 | Java            |
|      4 |    2 |     2 | C++             |
|      5 |    7 |    -2 | Php             |
|      6 |    1 |     5 | C#              |
|      7 |    6 |     1 | Python          |
|      8 |    9 |    -1 | Lisp Family (1) |
|      9 |    8 |     1 | Javascript      |
|     10 |   14 |    -4 | FORTRAN         |
|     11 |   10 |     1 | Perl            |
|     12 |   12 |       | Ruby            |
|     13 |   21 |    -8 | ML Family (2)   |
|     14 |   20 |    -6 | Scheme          |
|     15 |   13 |     2 | Go              |
|     16 |   24 |    -8 | (S)ML (3)       |
|     17 |   18 |    -1 | Lisp            |
|     18 |   16 |     2 | Scala           |
|     19 |   17 |     2 | Haskell         |
|     20 |   22 |    -2 | Prolog          |
|     21 |   15 |     6 | Lua             |
|     22 |   19 |     3 | COBOL           |
|     23 |   23 |       | Erlang          |
|     24 |   11 |    13 | Common Lisp     |
|     25 |   31 |    -6 | Rust            |
|     26 |   28 |    -2 | Clojure         |
|     27 |   26 |     1 | Smalltalk       |
|     28 |   25 |     3 | OCaml           |
|     29 |   29 |       | Coffeescript    |
|     30 |   27 |     3 | Julia           |
|     31 |   30 |     1 | Forth           |
|     32 |   32 |       | Racket          |
|     33 |   33 |       | Elixir          |
|--------+------+-------+-----------------|

(1) combines Lisp, Common Lisp, Scheme, Clojure & Racket
(2) combines (S)ML & OCaml
(3) summed separate searches for standard ml, sml & ml

Written by Brian Adkins

October 6, 2015 at 3:53 am

The Three R’s

with one comment

I’ve read that ten years is a common “lifetime” for a technology. Whether that’s true, or not, it seems to be the case with me. After beginning with BASIC & S/360 Assembler, I programmed in C/C++ from ~ 1985 until 1995, then in Java until 2006, and since then I’ve been programming primarily in Ruby/Rails.

For a number of years, I’ve felt the need to consider what my next primary language should be, and after experimenting with various lisps, Haskell and OCaml, I found that Racket is the best fit for me. I’m still very much in learning mode now, but I hope to be using Racket professionally in 2016.

Despite the fact that Racket is significantly faster than Ruby, I do occasionally have compute-intensive tasks that require more raw speed, so for a high performance language to maximize all the cores at my disposal, I’ve recently settled on Rust. I expect I will mostly be developing in Racket with the occasional performance hungry lib/program in Rust.

A current interest of mine is statistical programming, big data, data science, etc. Both R and Python are on the short list here with Julia trailing behind. I really like what I’ve seen in Julia, and I wouldn’t at all be surprised if I end up there; however, as a newbie learning the field, I think I’ll find much better support (educational info, existing libraries, community support, etc.) with R, so I’m starting with that until I’m convinced of switching.

At my stage, the language isn’t as important as becoming more educated in probability & statistics, machine learning, etc.

I didn’t plan it this way, but it appears that I’m going to be spending a lot of time with Racket, Rust and R.

Written by Brian Adkins

September 24, 2015 at 10:00 pm

Programming Language Popularity – Part Eight

with 2 comments

I compiled some programming language popularity statistics in¬†April 2009,¬†October 2009,¬†October 2010,¬†September 2011,¬†August 2012, Februrary 2013 and September 2013. Here’s an update for May 2014:

I made a number of Google searches of the forms below and summed the results:

"implemented in <language>"
"written in <language>"
"developed in <language>"
"programmed in <language>"

I’ve divided the table into sections based on large percentage drops from one language to the next.

|------+-----------------+------------+-------+-------|
| Rank | Language        | # Search   | Prev. |  Rank |
|      |                 | Results    |  Rank | Delta |
|------+-----------------+------------+-------+-------|
|    1 | PHP             | 41,418,000 |     1 |       |
|------+-----------------+------------+-------+-------|
|    2 | C               | 22,892,000 |     2 |       |
|    3 | C++             | 15,498,000 |     4 |     1 |
|    4 | Python          | 13,313,000 |     3 |    -1 |
|    5 | C#              | 12,279,000 |     5 |       |
|------+-----------------+------------+-------+-------|
|    6 | Java            |  6,997,000 |     6 |       |
|    7 | Perl            |  5,857,000 |     7 |       |
|    8 | JavaScript      |  4,917,000 |     8 |       |
|------+-----------------+------------+-------+-------|
|    9 | FORTRAN         |  3,124,000 |    10 |     1 |
|   10 | Ruby            |  3,066,000 |     9 |    -1 |
|   11 | Lisp Family (1) |  2,106,580 |    11 |       |
|------+-----------------+------------+-------+-------|
|   12 | R               |  1,267,000 |    16 |     4 |
|   13 | ML Family (2)   |    874,760 |    12 |    -1 |
|   14 | COBOL           |    731,600 |    17 |     3 |
|   15 | Lisp            |    711,300 |    18 |     3 |
|   16 | Go              |    650,970 |    23 |     7 |
|   17 | Haskell         |    629,700 |    20 |     3 |
|   18 | Erlang          |    594,900 |    19 |     1 |
|   19 | Scheme          |    580,800 |    24 |     5 |
|   20 | Prolog          |    542,200 |    14 |    -6 |
|   21 | (S)ML (3)       |    505,160 |    21 |       |
|   22 | Lua             |    490,700 |    13 |    -9 |
|   23 | Scala           |    472,300 |    25 |     2 |
|   24 | Smalltalk       |    407,400 |    15 |    -9 |
|   25 | Common Lisp     |    396,380 |    22 |    -3 |
|   26 | OCaml           |    369,600 |    26 |       |
|   27 | Clojure         |    302,220 |    27 |       |
|------+-----------------+------------+-------+-------|
|   28 | Forth           |    199,730 |    28 |       |
|   29 | CoffeeScript    |    192,366 |    30 |     1 |
|------+-----------------+------------+-------+-------|
|   30 | Racket          |    115,880 |    29 |    -1 |
|------+-----------------+------------+-------+-------|

(1) combines Lisp, Common Lisp, Scheme, Clojure & Racket
(2) combines (S)ML & OCaml
(3) summed separate searches for standard ml, sml & ml

Written by Brian Adkins

May 20, 2014 at 8:31 pm

Programming Language Popularity – Part Seven

with 2 comments

I compiled some programming language popularity statistics in¬†April 2009,¬†October 2009,¬†October 2010,¬†September 2011,¬†August 2012¬†and Februrary 2013. Here’s an update for September 2013:

I made a number of Google searches of the forms below and summed the results:

"implemented in <language>"
"written in <language>"
"developed in <language>"
"programmed in <language>"

I’ve divided the table into sections based on large percentage drops from one language to the next.

|------+-----------------+------------+----------+-------|
| Rank | Language        | # Results  | Previous |  Rank |
|      |                 |            |     Rank | Delta |
|------+-----------------+------------+----------+-------|
|    1 | PHP             | 54,516,000 |        1 |       |
|------+-----------------+------------+----------+-------|
|    2 | C               | 31,536,000 |        2 |       |
|    3 | Python          | 24,700,000 |        4 |     1 |
|    4 | C++             | 22,697,000 |        3 |    -1 |
|    5 | C#              | 20,309,000 |        5 |       |
|------+-----------------+------------+----------+-------|
|    6 | Java            | 13,314,000 |        7 |     1 |
|    7 | Perl            | 11,588,000 |        6 |    -1 |
|------+-----------------+------------+----------+-------|
|    8 | JavaScript      |  6,389,000 |        8 |       |
|    9 | Ruby            |  4,710,000 |        9 |       |
|   10 | FORTRAN         |  4,167,000 |       11 |     1 |
|------+-----------------+------------+----------+-------|
|   11 | Lisp Family (1) |  2,444,860 |       10 |    -1 |
|   12 | ML Family (2)   |  1,787,586 |       16 |     4 |
|   13 | Lua             |  1,653,100 |       15 |     2 |
|   14 | Prolog          |  1,389,900 |       22 |     8 |
|   15 | Smalltalk       |  1,003,200 |       27 |    12 |
|   16 | R               |  1,000,700 |       13 |    -3 |
|   17 | COBOL           |    856,500 |       18 |     1 |
|   18 | Lisp            |    835,600 |       12 |    -6 |
|   19 | Erlang          |    808,400 |       17 |    -2 |
|   20 | Haskell         |    798,700 |       19 |    -1 |
|------+-----------------+------------+----------+-------|
|   21 | (S)ML (3)       |    559,186 |       23 |     2 |
|   22 | Common Lisp     |    548,100 |       20 |    -2 |
|   23 | Go              |    490,230 |       28 |     5 |
|   24 | Scheme          |    487,100 |       25 |     1 |
|   25 | Scala           |    481,100 |       24 |    -1 |
|   26 | OCaml           |    429,700 |       21 |    -5 |
|   27 | Clojure         |    352,000 |       30 |     3 |
|------+-----------------+------------+----------+-------|
|   28 | Forth           |    230,630 |       31 |     3 |
|   29 | Racket          |    222,060 |       33 |     4 |
|   30 | CoffeeScript    |    205,809 |       29 |    -1 |
|------+-----------------+------------+----------+-------|

(1) combines Lisp, Common Lisp, Scheme, Clojure & Racket
(2) combines Haskell, (S)ML & OCaml
(3) summed separate searches for standard ml, sml & ml

Written by Brian Adkins

September 12, 2013 at 2:30 am

Programming Language Popularity – Part Six

with 3 comments

I compiled some programming language popularity statistics in April 2009, October 2009, October 2010, September 2011 and August 2012 . Here’s an update for February 2013:

I made a number of Google searches of the forms below and summed the results:

"implemented in <language>"
  "written in <language>"

Naturally this is of very limited utility, and the numbers are only useful when comparing relatively within the same search since the number of results Google returns can vary greatly over time.

I’ve divided the table into sections based on large percentage drops from one language to the next.

|------+-----------------+------------+----------+-------+------------|
| Rank | Language        |    # Search| Previous |  Rank | Delta from |
|      |                 |     Results|     Rank | Delta |    Apr '09 |
|------+-----------------+------------+----------+-------+------------|
|    1 | PHP             |  52,699,000|        1 |       |          3 |
|    2 | C               |  39,330,000|        2 |       |         -1 |
|    3 | C++             |  26,490,000|        4 |     1 |            |
|    4 | Python          |  22,410,000|        3 |    -1 |          1 |
|    5 | C#              |  21,474,000|        5 |       |          2 |
|------+-----------------+------------+----------+-------+------------|
|    6 | Perl            |  11,013,000|        8 |     2 |            |
|    7 | Java            |  10,150,000|        6 |    -1 |         -5 |
|    8 | JavaScript      |   7,340,000|        9 |     1 |          1 |
|------+-----------------+------------+----------+-------+------------|
|    9 | Ruby            |   3,456,000|        7 |    -2 |          1 |
|   10 | Lisp Family (1) |   2,955,000|       10 |       |         -2 |
|   11 | FORTRAN         |   2,256,000|       11 |       |        N/A |
|   12 | Lisp            |   1,708,000|       17 |     5 |            |
|   13 | R               |   1,305,000|       21 |     8 |        N/A |
|   14 | Tcl             |   1,072,100|       13 |    -1 |         -1 |
|   15 | Lua             |   1,011,000|       19 |     4 |          5 |
|   16 | ML Family (2)   |     988,400|       16 |       |         -2 |
|   17 | Erlang          |     842,000|       18 |     1 |         -1 |
|   18 | COBOL           |     729,200|       23 |     5 |        N/A |
|   19 | Haskell         |     707,000|       12 |    -7 |         -4 |
|   20 | Common Lisp     |     557,000|       20 |       |         -2 |
|   21 | OCaml           |     528,000|       24 |     3 |         -4 |
|   22 | Prolog          |     521,000|       25 |     3 |         -3 |
|   23 | (S)ML (3)       |     496,800|       27 |     4 |          1 |
|   24 | Scala           |     426,100|       22 |    -2 |          1 |
|   25 | Scheme          |     347,000|       28 |     3 |        -14 |
|   26 | Groovy          |     320,000|       14 |   -12 |        N/A |
|------+-----------------+------------+----------+-------+------------|
|   27 | Smalltalk       |     201,400|       29 |     2 |         -6 |
|   28 | Go              |     201,200|       15 |   -13 |        N/A |
|   29 | CoffeeScript    |     182,800|       31 |     2 |        N/A |
|   30 | Clojure         |     173,100|       30 |       |         -2 |
|   31 | Forth           |     128,800|       26 |    -5 |         -8 |
|   32 | Caml            |     102,600|       34 |     2 |         -6 |
|   33 | Racket          |      93,500|       33 |       |        N/A |
|   34 | Arc             |      76,400|       32 |    -2 |        -12 |
|   35 | Io              |      60,200|       35 |       |         -8 |
|------+-----------------+------------+----------+-------+------------|

(1) combines Lisp, Scheme, Common Lisp, Racket, Arc & Clojure
(2) combines OCaml, (S)ML, Caml
(3) summed separate searches for standard ml, sml & ml

Written by Brian Adkins

February 23, 2013 at 2:59 pm

Beware of YAML serialization on Linux without libyaml

leave a comment »

The Problem

I noticed some unusual behavior with respect to YAML String serialization between my Linux production system and my Mac OSX development system.

After dumping the production database via pg_dump -O –no-acl mydb | gzip > ~/mydb.sql.gz and then restoring it on my development system via rake db:drop; rake db:create; psql mydb < mydb.sql, I noticed that a particular serialized field in my Rails app that should always be an Array of String objects occasionally contained Integers.

After a little research and experimentation, I discovered that the production Linux system would occasionally omit quotations around Strings containing only numeric digits. I haven’t analyzed the pattern fully, but here are some examples where the YAML serialization did or did not use quotes:

  • “90103”
  • 000080
  • “000071”
  • “000124”
  • “000003”
  • 008397
  • 000408
  • 000009
  • 000188
  • “000021”

Further investigation revealed that the Linux production system was using Syck (a “dated C implementation of YAML 1.0”) and my Mac OSX development system was using psych (a “libyaml wrapper (in Ruby core for 1.9.2)”). libyaml is a “fast C implementation of YAML 1.1. So, either the quotation rules have changed between YAML 1.0 and YAML 1.1, or there is a bug in one of the implementations (likely Syck).

The Solution

The solution for proper “future” behavior is pretty simple. Install libyaml on the Linux system as follows:

wget http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz
tar xzf yaml-0.1.4.tar.gz
cd yaml-0.1.4
./configure
make
make install

I think that’s enough, but I went ahead and rebuilt my Ruby 1.9.2 just in case it needed to know about the existence of libyaml at build time.

The solution for converting my database with YAML 1.0 serialization to YAML 1.1 serialization is a bit trickier. Since the “dump” and “load” operations are matched for a particular version of YAML, it seems difficult to load the data using YAML 1.0 (thereby retaining the String type when reading an unquoted 000088) and then dump the data using YAML 1.1 (to get proper quoting of ‘000088’). Further complicating this is the fact that Rails handles the serialization operations automatically.

It does appear possible to dynamically switch between syck and psyck by using the following:

YAML::ENGINE.yamler = 'syck'
YAML::ENGINE.yamler = 'psych'

So, one option is to repeatedly switch to syck, read in data, switch to psych, and then write the data. <sigh>

Update:

It appears that due to the semantics of the Rails serialize function, it’s not enough to just read the model object using syck and then immediately write with psych because that doesn’t appear to be enough to cause the field to be deserialized. I had to refer to the field for each object. This is a pain because it prevents me from doing a generic loop where I can handle all model objects easily w/o reference to their specific fields.

I’ll withhold judgment for a while, but my first inclination is to consider abandoning YAML serialization for something a little more robust and portable.

Update 2:

It appears my welcome from psych is a serious memory leak. I’ve been running long running Ruby/Rails processes for years, and this is the first time I’ve experienced a failure due to an out of memory condition. There are a number of Google hits regarding the issue. After I fix the leak, I’ll begin researching alternatives to YAML serialization in Rails.

Update 3:

The number of bug reports on psych and rubygems I’ve had to wade through recently is amazing. My current solution is to remove the psych system gem and install Ruby 1.9.3p0 which required upgrading Passenger to the latest version from source to get Ruby 1.9.3 compatibility. I still had to track down a few odd errors such as “undefined method `yaml’ for #<Psych::Nodes::Stream:…>” and “invalid date format in specification: “2011-10-02 00:00:00.000000000Z”” – all because I chose to use the default Rails serialization assuming there would be no issues. Lesson learned.

Written by Brian Adkins

November 22, 2011 at 2:44 pm

Posted in programming

Tagged with , ,

Programming Language Popularity – Part Four

leave a comment »

See Part Five

I compiled some programming language popularity statistics in April 2009, October 2009 and October 2010 . Here’s an update for September 2011:

I made a number of Google searches of the forms below and summed the results (previous posts averaged the results):

"implemented in <language>"
  "written in <language>"

Naturally this is of very limited utility, and the numbers are only useful when comparing relatively within the same search since the number of results Google returns can vary greatly over time.

Language Total Prev. Position Position Delta
C 10,360,000 2 1
PHP 10,351,000 1 -1
C++ 6,495,000 3 0
Python 5,759,000 5 1
C# 5,335,000 4 -1
 
Java 4,890,000 8 2
Perl 3,702,000 6 -1
JavaScript 3,077,000 7 -1
Ruby 1,654,000 9 0
Lisp Family1 1,022,870 11 1
 
FORTRAN 975,600 10 -1
Tcl 594,500 12 0
Lisp 486,000 14 1
Haskell 450,500 16 2
Erlang 419,700 13 -2
 
Lua 367,100 18 2
ML Family2 348,400 17 0
COBOL 308,270 15 -3
Common Lisp 254,900 19 0
OCaml 240,300 21 1
 
Prolog 224,000 20 -1
Scala 203,400 23 1
Scheme 184,700 22 -1
Smalltalk 129,700 24 0
Clojure 84,600 27 2
 
(S)ML3 83,630 25 -1
Forth 69,980 26 -1
Caml 24,470 28 0
Io 17,700 30 1
Arc 12,670 29 -1

1 combines Lisp, Scheme, Common Lisp, Arc & Clojure
2 combines OCaml, (S)ML, Caml
3 summed separate searches for sml and ml

Written by Brian Adkins

September 22, 2011 at 10:37 am