The Utility of Today's AI

     

Last month’s article foreshadowed this article’s topic a bit with the sources cited at the bottom. ChatGPT generated the Rust code snippets after I told it “Write a Rust queue using a linked list.” I had to specify that it use a linked list, otherwise ChatGPT would have imported the Rust queue library which uses a less efficient vector implementation. DALL-E generated the image when provided the title of the article, “Rust queue performance.


Rust Queue Performance

     

After creating my Starcraft Rustbot and then comparing queue performance in Kotlin and Swift, I naturally began to wonder about the performance of a queue in Rust. How would a language billed as performant as C compare? Are there truly significant gains for operating “close to the metal”, or have the Swift and Kotlin compilers developed to a point where they can optimize to a similar level of performance? Below is the implementation for my Rust queue:


HackerRank Game Theory

     

I’ve used HackerRank throughout my career, both when I’ve been screened as a candidate, as well as to screen my own candidates. I’ve also used it to study algorithms and data structures. It’s a great platform for practicing and evaluating the fundamentals of Computer Science. In the process of skills evaluation the candidate must check a box stating “I will not consult/copy code from any source including a website, book, or friend/colleague to complete these tests, though may reference language documentation or use an IDE that has code completion features.


Swift & Kotlin Queue Performance

     

This is an expansion on two articles that I did about this time last year: Swift & HackerRank (Part 1). Swift & HackerRank (Part 2). In those articles I marveled at how much faster Kotlin was compared to Swift in terms of queue performance. While I quantified the performance in terms of order of magnitude at a specific volume (3 orders of magnitude better performance for 1,000 enqueues and dequeues) what I failed to do was generalize the differences in terms of Big-O notation.


StarCraft Rust Bot

     

I finished my StarCraft Rust Bot! It’s now good enough to beat the hardest AI that ships with the game. All in only 152 lines. You can see the original source code here. Even though the code itself is brief, the journey to creating and testing it was not. Originally the bot was going to be built using BWAPI (Brood War API). Then I found out that BWAPI was written in C++.