![]() ![]() Using a MovingMedian can help clean up some of the ambient noise around these results. This lets us classify length in terms of “units of syntax,” which, while it isn’t perfect, gives us a clearer picture of the number of different elements required to build a function or program.Īnd so, using tokens now as our metric to compare the Wolfram Language and Python, we see a slightly different spread, but the points still lean very much underneath the one-to-one line, implying that the Wolfram Language still ranks comparatively shorter. Instead, we can compare “tokens,” or any string of letters and numbers that are not interrupted by a number or punctuation. On the plus side, this makes the language very straightforward and easy to understand-but it can also skew data when trying to quantify coding efficiency in terms of character count or line count. Lines are fluid and arbitrary in the Wolfram Language, and it has long, descriptive function names. Notice the Wolfram Language still remains shorter for almost every task, staying mostly underneath the dashed one-to-one line:Īlthough the typical methods for comparing coding languages are usually by character count or line count, these measures are not reliable when looking at the Wolfram Language. Each point gives the character counts of the same task programmed in the Wolfram Language and C. Here’s the same graph as in Jon’s 2012 post comparing the Wolfram Language to C. In spite of the Rosetta Code tasks being relatively low-level applications, the Wolfram Language still wins handily on code length compared to every other language. And since the Wolfram Language’s ultra-high-level constructs are designed to match the way people think about solving problems, writing programs in it is usually easier than in other languages. You wouldn’t even think of dashing off a program in C to do handwriting recognition, yet that’s a one-liner in the Wolfram Language. Keep in mind that the programming tasks at Rosetta Code are the typical kinds of exercises that you can write in conventional programming languages: editing text, implementing quicksort, or solving the Towers of Hanoi. So we updated and re-ran Jon’s code, and, much to our excitement (though we really weren’t all that surprised), the Wolfram Language remains largely superior by all accounts! We were curious to see how the Wolfram Language continues to stack up, since a lot has happened in the last two years. He compared the programming language of Mathematica (now officially named the Wolfram Language) to 14 of the most popular and relevant languages, and found that most programs can be written in the Wolfram Language with 1/2 to 1/10 as much code-even as tasks become larger and more complex. ![]() Back in 2012, Jon McLoone wrote a program that analyzed the coding examples of over 500 programming languages that were compiled on the wiki site Rosetta Code. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
March 2023
Categories |