Bite-sized actionable content, practical tutorials, and resources for programmers#87C++ Bit Counting Tricks, JetBrains’ ‘Junie’ AI, Tailwind CSS 4.0’s Rust Boost, and Rust’s Async ClosuresHi ,Welcome to our very first issue for the year 2025.In today’sExpert Insight, we bring you an excerpt from the recently published book, Debunking C++ Myths, which discusses different approaches to counting set bits in a 32-bit integer, comparing manual bitwise operations, the C++20 std::popcount function, and the CPU-level POPCNT instruction.News Highlights:JetBrains launches ‘Junie’ for AI coding in Python, Kotlin, and Java; Tailwind CSS 4.0’s Rust-powered build engine boosts incremental builds up to 100x; Rust 1.85 stabilizes async closures and enhances Linux kernel support; and 11 new languages like Mojo, Wing, and Jakt target AI, memory safety, and edge computing.My top 5 picks from today’s learning resources:JavaScript Temporal is coming⏳3 Python web frameworks for beautiful front ends🎨Rust: Investigating a Strange Out-of-Memory Error🕵️♂️The Architecture of Open Source Applications🏛️Inside Atlassian Lithium: How a Dynamic ETL Platform is Transforming Data Movement and Cutting Costs⚡But there’s more, so dive right in.Stay Awesome!Divya Anne SelvarajEditor-in-ChiefSign Up|Advertise🗞️News and Analysis🔎11 cutting-edge programming languages to learn now: Covers languages focused on theorem proving (Coq), AI-assisted coding (Plang), Python performance enhancements (Mojo, Erg), edge computing (MoonBit, Wing), and memory safety (Rust, Zig, Jakt, Odin, Mojo).JetBrains debuts agentic AI coding with ‘Junie’, but reviews for existing AI Assistant are poor: Junie supports Python, Kotlin, and Java and can develop features, fix bugs, update documentation, add tests, and resolve failed tests.Tailwind CSS 4.0 released with ‘ground-up rewrite’ for faster Rust-powered build: The versionintroduces a Rust-powered build engine (Oxide), achieving up to 5x faster builds (100x for incremental builds), alongside new CSS features.Async closure support is stable for Rust 1.85: The new version, releasing on February 20, will resolve issues like the “Send”-bound problem and make progress on Linux kernel integration, return type notation, and more.Java News Roundup: Stable Values, Payara Platform, Oracle Critical Patch Update, GraalVM, BellSoft: Also covers BellSoft's Liberica JDK, updates on Jakarta EE 11, Spring, Hibernate, Infinispan, Eclipse Vert.x, and Gradle.State of JavaScript: Highlights of the JavaScript developer survey: The results reveal growing adoption of AI code generators, new language features (nullish coalescing, Promise.allSettled), and build tools (Vite, esbuild).Java-based organizations mostly use Java for AI development – report: The Azul 2025 State of Java Report finds that 50% of Java-based organizations use Java for AI development, ahead of JavaScript (44%) and Python (41%).🎓Tutorials and Learning Resources💡Python💡3 Python web frameworks for beautiful front ends: Introduces Anvil, Reflex, and NiceGUI—which allow developers to build interactive front-end applications using only Python, eliminating the need for JavaScript.For more Python resources, go to PythonProC# and .NET🎓Tutorial | Writing a .NET Garbage Collector in C# - Part 1: Demos writing a custom .NET garbage collector in C# using NativeAOT, detailing initialization challenges, debugging methods, and workaround strategies to resolve conflicts.💡Making SIMD Operations in C# Easier: Introduces F8, an open-source C# SIMD library that optimizes floating-point operations by leveraging AVX 256-bit intrinsics, demonstrating its performance benefits over scalar computations.🎓Tutorial | SQL Server Native Vector Search for .NET Developers: Coversembedding generation, vector storage, similarity search, and document classification using C# and T-SQL for AI-powered search and retrieval.C and C++💡Understanding Memory Management, Part 1: C: Covers fundamental concepts like the stack, heap, malloc, free, and fragmentation, while demonstrating manual memory allocation through a simple file-reading program.🗞️C++26: pack indexing: The update allows direct access to specific elements in parameter packs using the subscript operator (T...[index] ), simplifies previously cumbersome methods, and improves readability.💡The surprising struggle to get a UNIX Epoch time from a UTC string in C or C++: Delves into issues with strptime(), locales, daylight saving time, and the best available solutions, including timegm() and C++20’s time zone library.Java🎓Tutorial | How JVM Executable Assembly Jars Work: Explains how the Mill build tool generates directly executable assembly JARs by prepending a launcher script to a ZIP-based JAR, allowing execution without java -jar .💡Making Java nullable fields backwards compatible: Explains how making a Java field nullable can break source and binary compatibility and provides a solution using method overloading to ensure backwards compatibility in SDKs.🎓Tutorial | How To Do Logging In Java: Covers legacy and modern logging libraries, best practices for logging, log levels, centralized logging, and how to choose the right logging approach for different applications.JavaScript and TypeScript🗞️JavaScript Temporal is coming: JavaScript's new Temporal API is being introduced in experimental browser releases, offering a modern, built-in way to handle dates, times, durations, and calendars.💡How long is a second in JavaScript?: Explains how JavaScript measures time using POSIX time, why it ignores leap seconds, the impact of step adjustments vs. smearing, and how this affects applications that require precise time synchronization.💡TypeScript enums: use cases and alternatives: Examines TypeScript enums, their structure, use cases, limitations, and alternative patterns like object literals, string literal unions, and symbol-based approaches.Go🎓Tutorial |Modeling Complex Data Structure in Golang Using Pointers, References, and Reverse Indices: Demonstrates how memory management techniques optimize performance, reduce redundancy, and simplify complex graph lookups.💡Go 1.24'sgo tool is one of the best additions to the ecosystem in years: Discusses Go 1.24’s new go tool command and tool directive in go.mod , which improves dependency management by reducing bloat.Rust🎓Tutorial | Parsing PDFs (and more) in Elixir using Rust: Demonstrates how to efficiently parse PDFs in Elixir using Rust via Native Implemented Functions (NIFs), leveraging the Extractous library.💼Case Study | Rust: Investigating a Strange Out-of-Memory Error: Investigates an unexpected out-of-memory issue in a Rust service, revealing that the anyhow library captures a backtrace on every error.Swift💡The Swift Runtime: Your Silent Partner: Explores how the Swift Runtime (libswiftCore) interacts with compiled Swift programs, managing memory, dynamic dispatch, and core language features through the ABI and system calls.🎓Tutorial | Network Link Conditioner: Simulating Slow Networking: Explains how to use Apple's Network Link Conditioner to simulate slow network conditions on macOS and iOS and introduces RocketSim as a better alternative.PHP🎓Tutorial | Say Goodbye to Hard-Coding: Manage Laravel Model Columns Efficiently: Introduces a Laravel Artisan command that automatically generates model column constants, reducing hard-coded field names.SQLComposable SQL: Critiques SQL's testability, duplication, and denormalization issues, then introduces functors as a structured way to define reusable query components that improve performance, maintainability, and abstraction.Ruby🎓Tutorial | Supercharge SQLite with Ruby Functions: Covers how to enhance SQLite with user-defined Ruby functions (UDFs) to extend query capabilities, automate data processing, and perform custom computations.💡Instrumenting Thread Stalling in Ruby Applications: Introduces GC.total_time for tracking GC impact, gvltools for measuring GVL wait time, and Linux /proc metrics for monitoring CPU scheduling.Kotlin🎓Tutorial | The Liskov Substitution Principle (LSP) in Kotlin — Deep Dive: Provides an in-depth exploration of the Liskov Substitution Principle (LSP) in Kotlin, explaining how subclass behavior must remain consistent with its superclass.💡Modern Android Security Tools: ProGuard, DexGuard, and R8 with Kotlin & Jetpack Compose: Covers protection strategies, configuration rules, best practices, and performance considerations for modern Android development.🌟Best Practices and Advice🚀📖The Architecture of Open Source Applications: Acollection of books where developers of dozens of open source projects explain their software architecture, design choices, and key lessons learned.The End of the Bronze Age: Rethinking the Medallion Architecture: Advocates for the Shift Left approach, which moves data processing upstream to create reliable, reusable data products that support both operational and analytical workloads.Inside Atlassian Lithium: How a Dynamic ETL Platform is Transforming Data Movement and Cutting Costs: Duscusses how Atlassian's platform's ephemeral pipelines, Kafka-based architecture, and modular Workplans enable efficient, scalable data movement.Integration timelines: How to plan for success without surprises: explores SaaS integration challenges, emphasizing realistic timelines, scalability, security, and in-house vs. third-party solutions to prevent resource strain.🧠Expert Insight📚Here’s an excerpt from “Chapter 8: The Fastest C++ Code is Inline Assembly" in the book, Debunking C++ Myths by Alexandru Bolboacă and Ferenc-Lajos Deák, published in December 2024.One instruction to rule them allDear reader. In our previous section of this chapter, unfortunately, we exhausted the only pompous introduction we could borrow from various cultural sources concerning technical interviews, career and life choices, and whether should we take the red pill or the blue one, so let’s focus our attention on more technicalquestions that our candidates might face at a technical interview (the word technical appears four times in this shortintroductory paragraph).One of these questions, served to the author of these lines a few years ago, was to write a short code snippet that will count the number of 1 bits (the on bits) in a 32-bit integer. Let’s draft up a quick application todo this:int countOneBits(uint32_t n) { int count = 0; while (n) { count += n & 1; n >>= 1; } return count;}Here’s what happens. Firstly, we initialize a counter, starting with0. The next step is to loop through the bits. Whilenis non-zero, we add the least significant bit ofnto the counter (n&1gives us this value). Following this, we shiftnright by one bit (discarding the leastsignificant bit).Once all bits are processed (whennbecomes0), return the total count of 1 bits. Not a very complicated process, justraw work.It seems that this procedure of counting bits in numbers must be of a very peculiar interest in computing circles, such as for the purpose of error detection and correction, data compression, cryptography, algorithmic efficiency, digital signal processing, hardware design, and performance metrics, so no wonder it managed to creep itself into the STL (C++ STL, which is the standard template library) too in the form ofstd::popcountfromC++ 20.The interesting part of the story is that not only in the STL do we find this handy operation, but it was deemed so useful that it even exists at the level of the processors, under the infamousPOPCNT mnemonic. Infamous it is, due to the fact that in 2024, it was effectively used in hindering the installation of Windows 11 on older machines that were not officiallysupported (https://www.theregister.com/2024/04/23/windows_11_cpu_requirements/).But what that means for our candidate, who has to write code to impress the interviewers, is that they can simply replace the complicated code from before with the following veryhandy snippet:int countOneBits(uint32_t n) { return std::popcount(n);}Not forgetting to include the<bit>header, after feeding the preceding program intogcc.godbolt.org’s compilers, we get a strange mishmash of results. The code compiled by GCC, regardless of the optimization level, always generates a variation ofthe following:countOneBits(unsigned int): sub rsp, 8 mov edi, edi call __popcountdi2 add rsp, 8 retSo, the code at some level disappears from our eyes into a strange call deep inside the libraries offered by GCC, called__popcountdi2 (https://gcc.gnu.org/onlinedocs/gccint/Integer-library-routines.html). In order to convince GCC to fully utilize the power of the processor that we are running the code on, we need to utilize some of the not-so-well-known command-line options, such as-march(or-mpopcntfor thisspecific purpose).According to the official documentation, (https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html) this command will select the appropriate processor instruction set in order to use the available extensions of the specific processor. Since, at this stage, we know that the POPCNTinstruction was introduced in the early Core i5 and i7 processors, in the Nehalem family, we should simply specify the following to GCC:-march=nehalem. And now, not surprisingly, the compiler generatesthe following:countOneBits(unsigned int): popcnt eax, edi retInterestingly, if we provide the compiler with just the-mpopcntflag, then it generates an extraxor eax, eax(meaning it nulls the EAX register) so maybe we have witnessed some processor-specific extra optimizations by choosing theNehalem architecture:countOneBits(unsigned int): xor eax, eax popcnt eax, edi retWe cannot squeeze more than this out of GCC; there is simply no lower level for this functionality, so we focus our attention on the next compiler onour list.Without explicitly asking to optimize the code, Clang also generates a generic call to astd::popcountfunction, found somewhere in its libraries; however, explicitly asking to optimize the generated code, Clang at various levels of optimization yieldsthe following:countOneBits(unsigned int): mov eax, edi shr eax and eax, 1431655765 sub edi, eax mov eax, edi and eax, 858993459 shr edi, 2 and edi, 858993459 add edi, eax mov eax, edi shr eax, 4 add eax, edi and eax, 252645135 imul eax, eax, 16843009 shr eax, 24 retSurprising as it seems, there is a perfectly logical explanation for this code, found at the bit-twiddling site (https://graphics.stanford.edu/~seander/bithacks.html#CountBitsSetParallel) of Sean Eron Anderson at Stanford. Not considering this extra detour, Clang behaves identically to GCC when it comes to handling architecture and specifying the subset of CPU extensions to use while generating code.The last of the big three, Microsoft’s own (we know, tiny, squishy) C++ compiler handles the situation very similarly to Clang. When asking to optimize the code while we specify an architecture that does not support thePOPCNTinstruction, it generates code like the one generated by Clang with low-level bit hacks, while if the architecture has support for thePOPCNTinstruction, it will adjust to the correct type and will callPOPCNTfor the proper parameters (/std:c++latest /arch:SSE4.2 /O1).Good work, tiny,squishy compiler.Debunking C++ Mythswas published in Decemver 2024. Packt library subscribers can continue reading the entire book for free or you can buy the book here!Get the eBook for $31.99$21.99🛠️Useful Tools⚒️DeepSeek-Coder-V2: An open-source MoE code model rivaling GPT-4 Turbo, supporting 338 languages with a 128K context length.Web-Dev-For-Beginners: A 12-week, 24-lesson curriculum by Microsoft covering HTML, CSS, and JavaScript through hands-on projects, quizzes, and assignments.MudBlazor: A Material Design component framework for Blazor, built entirely in C# for ease of use, clear structure, and seamless .NET integration.That’s all for today.We have an entire range of newsletters with focused content for tech pros. Subscribe to the ones you find the most usefulhere.If your company is interested in reaching an audience of developers, software engineers, and tech decision makers, you may want toadvertise with us.If you have any suggestions or feedback, or would like us to find you a learning resource on a particular subject, just respond to this email!*{box-sizing:border-box}body{margin:0;padding:0}a[x-apple-data-detectors]{color:inherit!important;text-decoration:inherit!important}#MessageViewBody a{color:inherit;text-decoration:none}p{line-height:inherit}.desktop_hide,.desktop_hide table{mso-hide:all;display:none;max-height:0;overflow:hidden}.image_block img+div{display:none}sub,sup{font-size:75%;line-height:0}#converted-body .list_block ol,#converted-body .list_block ul,.body [class~=x_list_block] ol,.body [class~=x_list_block] ul,u+.body .list_block ol,u+.body .list_block ul{padding-left:20px} @media (max-width: 100%;display:block}.mobile_hide{min-height:0;max-height:0;max-width: 100%;overflow:hidden;font-size:0}.desktop_hide,.desktop_hide table{display:table!important;max-height:none!important}}
Read more