5

The Fastest Programming Language? ‘Dave’s Garage’ Seeks the Answer

 3 years ago
source link: https://thenewstack.io/the-fastest-programming-language-daves-garage-seeks-the-answer/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Culture / Development / Open Source / Technology

The Fastest Programming Language? ‘Dave’s Garage’ Seeks the Answer

8 Aug 2021 6:00am, by David Cassel

dave_plummer.png

Retired Microsoft engineer Dave Plummer has attracted 134,000 subscribers to his “Dave’s Garage” YouTube channel. Now he’s using it to stage a head-to-head competition between programming languages to determine which one is fastest.

He’s been aided by a community of over 100 contributors on GitHub — and a core team that’s created Docker containers to provide an appropriate environment for each test.

In July Plummer released a video kicking off the competition — promising his videos in coming weeks will share comparisons of 100 various implementations of the same program in 45 different programming languages in “a software drag racing extravaganza… a no-holds-barred, battle royale of prime number-generating madness.” He promises the videos will cover languages “From Ada to Zig and everything in between.”

The kick-off video claims the competition will include everything from high-performance languages like Rust, C and Assembly to “exotics” like F#, “oddities” like Lisp and Prolog, and a heavily-anticipated showdown between Bash and PowerShell. But it will also give viewers a fun chance just to see 45 different languages, and how each would handle the algorithm, showcasing each language’s own syntax and data declaration structure.

Or, as Plummer puts it, “a quick tour where you learn just enough about each language to be dangerous — or perhaps entertaining at a cocktail party.”

That Time Bill Gates Threw a House Party

Plummer’s YouTube channel offers an eclectic mix of videos that chronicle everything from his experiments with cheap ESP32 microcontrollers and Arduino-controlled LED lights to “How to Make the Best Coffee — in a Power Outage” and “My Dad’s First New Car Turns 50 Years Old!”

But the 140 videos he’s uploaded over the last two years also include reminiscences about his time working at Microsoft. (Like a series of videos titled “The Secret History of Windows Task Manager” or a video titled “That time Bill Gates had a house party.”)

In one video Plummer reaches back even further, remembering how in the early 1990s he’d also emailed Linus Torvalds some fixes for a few handle leaks in the early source code of Linux. In another video Plummer says he was later inspired to apply for an internship at Microsoft — and ended up working on MS-DOS — after reading the book “Hard Drive: Bill Gates and the Making of the Microsoft Empire.”

Cover of Hard Drive - Bill Gates and the Making of the Microsoft Empire - book cover via Amazon

But there’s an especially nostalgic story behind Plummer’s first video showing tests for the speed of programming languages. Back in April Plummer had gotten the idea of comparing C to C++ and Python. (Spoiler alert: C++ won). The specific test Plummer used was inspired by memories of his 9th-grade computer science teacher — “the perfect combination of hipster math teacher and doofus computer enthusiast” — who had cleverly made some of the homework assignments into a competition.

“It was genius in a way because the bar becomes not some arbitrary grade, but rather the peers that surround you,” Plummer said. “Can you write code that runs faster than the other kid’s code?”

He was stunned by one classmate who, using an early 1980s Commodore computer, identified all the prime numbers under 1,000 in less than 10 seconds (and another who’d done it in six), an experience which taught him the importance of an optimized algorithm.

Nearly 40 years later, Plummer recreated that test — the ancient Greek prime-finding algorithm known as the Sieve of Eratosthenes — as a way of testing the speed of three modern programming languages. (But this time, identifying all the prime numbers up to 1 million.) “Do that as many times in five seconds as possible, and then the report averages the number of passes per second.”

Plummer’s video hit a surprise surge of popularity (to date, it’s been viewed nearly 300,000 times). Soon, viewers were also surprising Plummer with some participation of their own. He’d uploaded his three tests into a GitHub repository — “and all of sudden, people started adding other implementations. And pretty soon we had an impressive list of languages and very fast implementations.” Dozens and dozens of tests were ultimately submitted.

Reading through the list during his video, Plummer says at one point “I have no idea what OCaml actually is, but it looks kind of cool.”

Calling for Help

The idea for the fastest-language competition “launched on itself,” Plummer says with bemusement. He’d seen all the enthusiasm online “and I had no idea what to do. Because I barely understand GitHub.” (When he left Microsoft, they were still using Source Depot for version control — an authorized fork of Perforce.)

He posted a call for help. “‘If anybody really understands GitHub well, and wants to play — let me know. You can have this whole project. Just — please take it from me.'”

Almost miraculously, a spontaneous community started to form. Someone stepped up — who Plummer identifies as “a fellow named Rolf over in the Netherlands,” and soon Rolf had helpers of his own. (Or, as the video host tells it, “pretty soon he had two more of his countrymen onboard, Tudor and Rutger … And they have really knocked it out of the park.”) They’d even contributed their own implementations for other languages, including Assembly.

“I’m indebted to everyone in the community who pitched in, but these three guys especially,” Plummer says in the video. At this writing, the project’s repository on GitHub shows an impressive 665 commits from 108 different contributors (with another 16 pull requests)

And there’s something more. “Each language comes with its own Docker container that represents the build environment for the language,” Plummer says. A handy build script sets up all the environments automatically — along with their tests — and then generates an attractive chart showing the results.

In a later video, Plummer details why that’s so helpful. “I don’t know about you, but I don’t have a COBOL or a Fortran compiler ready to go on my machine, let alone V or Zig.”

It’s all been bundled into something called the PrimeView web application (which allows viewing, filtering and sorting the generated results), working in conjunction with what the Readme file refers to as “Dave’s benchmark machine.”

Touring More than 40 Languages

The biggest thing Plummer brings to the project may be his genuine enthusiasm. “I’ve spent a lifetime in operating systems, but it’s been entirely in Assembly, C, and C++,” he explains in one video. “While I’m also recreationally fluent in C#, and dabble some in Python, that’s really about it. As a result, the opportunity to tour more than 40 different languages was simply too good to pass up.”

That enthusiasm has been enough to unify the efforts of all his contributors. And he’s now encouraging people who want to get involved in open source contributions to join in the fine-tuning of the algorithms. He has a similar message for fans of the different programming languages: If they don’t like their language’s performance on the test, improve the code! “Get out your editor, and you head on over to GitHub and you hack away until your code is faster than my code — or whoever’s code that implementation is.”

He’s playfully appealing to their competitive instincts — just like his 9th grade CS teacher did. And he’s promising everyone there’s still time before the ultimate winner gets crowned in a video documenting the competition’s grand finale: “That way, you can improve anything you’re not happy with, and achieve redemption for PowerShell or whatever it is you’re really passionate about.”

But it looks like the experience may have changed him as well. Towards the end of the video, this former Microsoft engineer made an announcement that will warm the hearts of open source developers.

“I’ve had such a good experience with GitHub now, and the open source movement, that — I had a previously commercial project that I was going to release something commercial with it…

“But I’m just going to put it on GitHub and make a couple videos about it, and let people run with it.”


WebReduce

IBM Cloud and the Linux Foundation are sponsors of The New Stack.

Featured image by Heather Joslyn via YouTube.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK