Category: Development

Understanding C Memory Management: A Deep Dive into Stacks, Heaps, and Leaks

2025-01-16
Understanding C Memory Management: A Deep Dive into Stacks, Heaps, and Leaks

This article provides a detailed explanation of C's memory management, starting with how programs use memory and progressing through the roles of the stack and heap, the usage of malloc() and free(), and the causes of memory leaks and Use After Free (UAF) vulnerabilities. Using a simple example, the author demonstrates manual memory management and explains the inner workings of a memory allocator (malloc), including memory fragmentation. Suitable for readers with some programming experience, this article enhances understanding of memory management and helps avoid common memory errors.

Development Stack Heap

RK3588 SBC QEMU Hypervisor with ZFS on Debian: A Deep Dive

2025-01-16

This article details setting up a QEMU hypervisor on a BananaPi M71 2 (RK3588) single-board computer using Armbian and ZFS for storage. The author walks through building a custom Armbian image, flashing it, preparing NVMe SSD storage with a ZFS zpool, installing libvirtd, and finally running virtual machines. Challenges with NVMe drive compatibility on the RK3588 are addressed, along with solutions. The end result is a functional, small-scale private cloud capable of running various VMs (web servers, databases, etc.) offering workload isolation and resource management.

Development

Let Users Help Solve Their Own Transit Problems: Beyond Algorithmic Route Planning

2025-01-16

The author criticizes current map apps for relying solely on algorithms to plan public transit routes, neglecting user needs and expertise. He proposes allowing users to customize route options, such as specifying particular bus route combinations, and including these in route planning comparisons. This mirrors the "report spam" and "not spam" functions of email filters, improving algorithms through user feedback. Despite privacy concerns, user participation could enhance route accuracy and user satisfaction, ultimately improving algorithms. The ability for users to add their own route combinations, even without sharing data, would be a significant improvement.

Development public transit

WebAssembly's Memory64: A Trade-off Between Speed and Memory

2025-01-16
WebAssembly's Memory64: A Trade-off Between Speed and Memory

WebAssembly recently introduced Memory64, adding support for 64-bit pointers. Surprisingly, however, Memory64 doesn't result in performance gains; instead, due to limitations in hardware, operating systems, and WebAssembly's design, it can run 10% to over 100% slower than 32-bit mode. This is because 32-bit mode allows browsers to reserve 4GB of memory, eliminating the need for bounds checks. Memory64, however, requires bounds checks, adding computational overhead. Therefore, unless you need more than 4GB of memory, Memory64 isn't the optimal choice. Future improvements in hardware and WebAssembly might improve Memory64's performance.

Development

Byte Queue Limits: A Little-Known Networking Optimization Story

2025-01-16
Byte Queue Limits: A Little-Known Networking Optimization Story

This article recounts the story of Byte Queue Limits (BQL), a lesser-known networking optimization technique in the Linux kernel. BQL tackles bufferbloat by dynamically adjusting device queue limits, thereby reducing latency. The author, drawing on key concepts learned during their time at Sun Microsystems, details BQL's design philosophy, implementation, and algorithm, using diagrams and data to analyze its performance improvements and potential shortcomings. While newer hardware may eventually supersede BQL, its value for billions of low-end devices remains significant.

Docker Desktop macOS Startup Failure Due to Malware Reports

2025-01-16

Docker Desktop for macOS users recently experienced startup issues where macOS flagged `com.docker.vmnetd` or `com.docker.socket` as malware. Docker identified the root cause as incorrectly signed files in existing installations and released patches. Users are advised to update to the latest version or manually replace the affected files. The issue is resolved, but Docker continues monitoring for any further issues.

Development

Jacob Dement's Stunning Portfolio: A Full-Stack Developer's Journey

2025-01-16

Jacob Dement's portfolio showcases the talent of a seasoned full-stack engineer. From meticulously designed websites to complex applications, he demonstrates a comprehensive grasp of front-end, back-end, and database technologies. The portfolio is more than just a collection of code; it's a compelling testament to his technical skills and creativity. Multiple project examples highlight his experience in solving real-world problems using diverse tech stacks. His dedication to both technical detail and user experience underscores his professionalism.

Apache DataFusion: A Powerful and Extensible Query Engine in Rust

2025-01-16

Apache DataFusion is an extensible query engine written in Rust that uses Apache Arrow as its in-memory format. It offers SQL and DataFrame APIs, boasts excellent performance, and provides built-in support for CSV, Parquet, JSON, and Avro. DataFusion features a full query planner, a columnar, streaming, multi-threaded, vectorized execution engine, and partitioned data sources. It's highly customizable, allowing additions of data sources, query languages, functions, custom operators, and more. Related subprojects include DataFusion Python (Python bindings), DataFusion Ray (distributed version), and DataFusion Comet (Apache Spark accelerator).

Development Query Engine

dnSpyEx: The Unofficial Revival of a Powerful .NET Debugger and Assembly Editor

2025-01-15
dnSpyEx: The Unofficial Revival of a Powerful .NET Debugger and Assembly Editor

dnSpyEx is an unofficial continuation of the popular dnSpy project, a debugger and .NET assembly editor. It lets you edit and debug .NET and Unity assemblies even without source code. Key features include debugging and editing .NET and Unity assemblies, light and dark themes, and powerful decompilation, hex editing, and debugging capabilities such as breakpoint setting, variable windows, call stacks, and exception handling. dnSpyEx also offers a public API for extensions and scripting, and supports multiple language translations.

Development Decompiler

Code Reviews: A Success Story

2025-01-15
Code Reviews: A Success Story

Engineer X at Google worked on two projects with vastly different code review processes. The first, with minimal review, resulted in a buggy release. The second, with a thorough and rigorous review process, although slower initially, yielded a bug-free release and significant learning for X, positively impacting his career. The article argues that code reviews aren't inherently antagonistic; it's the people involved and how the tool is utilized that matters for improving code quality and mentorship.

Development

Imaging Mounted Disks Under Duress: A blktrace-Based Solution

2025-01-15
Imaging Mounted Disks Under Duress: A blktrace-Based Solution

This post details a clever method for backing up system disks when point-in-time snapshots aren't available. The author faced the challenge of needing to back up a system nearing failure that lacked snapshot capabilities, while rebooting or reconfiguring storage was undesirable. The solution leverages Linux's blktrace API to track block device activity in real-time, allowing for complete disk imaging even while data is being written. The author shares their Go-based tool, hot-clone, which tracks modified blocks, ensuring no data loss during imaging. This provides a reliable solution for backing up critical systems in emergency situations.

Keon: A Human-Readable Serialization Format Inspired by Rust

2025-01-15
Keon: A Human-Readable Serialization Format Inspired by Rust

Keon is a human-readable object notation (ORN) and serialization format syntactically similar to Rust and fully supporting Serde's data model. It boasts a cleaner syntax, allowing comments and trailing commas, and enabling a near-Rust-like writing experience. Keon distinguishes between tuples and lists, supports arbitrary types as dictionary keys, and offers Base64, Base32, and Base16 support. The goal is a more intuitive, readable, and writable serialization format.

Development

Cloudflare Pages' Surprisingly Generous Free Tier: Why?

2025-01-15
Cloudflare Pages' Surprisingly Generous Free Tier: Why?

Cloudflare Pages offers an unlimited bandwidth free tier, a standout feature among competitors. The author explores the reasons behind this generosity: static websites are lightweight and easy to serve; Cloudflare benefits from a faster, more reliable internet, leading to increased demand for its security products; and the free tier drives word-of-mouth marketing and potential upgrades to paid services. While Cloudflare hasn't officially explained it, the author posits it's a strategic move aligned with other free services like 1.1.1.1 and free DDoS protection, ultimately boosting its security product ecosystem.

Right-Nulled GLR Parsing: Gracefully Handling Context-Free Grammars

2025-01-15

This article delves into Generalized LR (GLR) parsing and its improvement, Right-Nulled GLR (RNGLR) parsing. GLR parsing can handle any context-free grammar without restrictions, making it a useful prototyping tool. However, traditional GLR parsing suffers from efficiency issues when dealing with hidden left and right recursion. RNGLR parsing elegantly addresses these issues by cleverly handling right-nulled rules, improving parsing efficiency. The article explains the principles of RNGLR parsing and demonstrates its advantages in handling conflicts and constructing Shared Packed Parse Forests (SPPFs) through examples.

Ropey: A High-Performance Text Rope for Rust

2025-01-15
Ropey: A High-Performance Text Rope for Rust

Ropey is a UTF-8 text rope library written in Rust, designed as a backing text buffer for applications like text editors. It's fast, robust, and handles massive texts and memory-incoherent edits with ease. Ropey boasts strong Unicode support, predictable performance, and excels at frequent edits on medium-to-large texts. However, it's not ideal for very small texts or those exceeding available memory. Key features include line awareness, efficient rope slices, and flexible low-level APIs. Ropey has proven itself in various projects and undergoes rigorous testing, providing a reliable solution for text manipulation.

Development Text Editing

Modern JavaScript for Django Developers: A Comprehensive Guide

2025-01-15
Modern JavaScript for Django Developers: A Comprehensive Guide

This guide provides a clear path for Django developers to master modern JavaScript development. It covers organizing front-end code, modern JavaScript tooling, integrating a JavaScript pipeline, building React applications, creating JavaScript-optional websites with HTMX and Alpine.js, and improving front-end API interactions with OpenAPI. The guide is broken down into manageable parts, progressing from foundational concepts to practical applications, making it accessible to developers of all skill levels.

Development Frontend Development

Building a Database with the Rust Open-Source Community: The ScopeDB Story

2025-01-15
Building a Database with the Rust Open-Source Community: The ScopeDB Story

A team of three built ScopeDB, a shared-disk architecture cloud database for managing petabytes of observability data, in just four months using Rust. Leveraging the power of the Rust ecosystem and numerous open-source projects like Apache OpenDAL, SQLx, and SeaQuery, the team actively contributed back to the community with patches and new libraries. ScopeDB also features an open-source twin, Morax, for sharing engineering experience, demonstrating a commercial open-source paradigm.

Development

Lambda Calculus Interpreter in 383 Bytes

2025-01-15
Lambda Calculus Interpreter in 383 Bytes

This blog post introduces a brand new 383-byte implementation of a binary lambda calculus interpreter as an x86-64 Linux ELF executable. This tiny interpreter manages to achieve garbage collection, lazy lists, and tail recursion. Programs are encoded in a remarkably small binary format; for example, its metacircular evaluator is only 232 bits. The author provides friendly portable C code and pre-built binaries for other platforms. This project is a fun learning tool for lambda calculus and showcases the possibility of implementing complex computation in extremely resource-constrained environments.

Development Lambda Calculus

Programmer's Nostalgia: A $30 Custom Voice Recording from the AOL Voice

2025-01-15
Programmer's Nostalgia: A $30 Custom Voice Recording from the AOL Voice

Blogger John Graham-Cumming recounts his 2002 experience commissioning custom voice recordings from Elwood Edwards, the iconic voice of AOL. For $30, he ordered two phrases, "Mail classified by POPFile" and "Use the source, Luke!" for his machine learning email filtering program, POPFile. Edwards even included a bonus "You've got mail, John!" This charming anecdote reveals a personalized touch of the early internet and the humor of tech pioneers.

Development personalized service

Kokoro: 82M Parameter TTS Model Turns Ebooks into High-Quality Audiobooks

2025-01-15

Claudio Santini created Audiblez, a tool leveraging the lightweight 82M parameter text-to-speech model Kokoro to convert ebooks into high-quality audiobooks. Audiblez supports multiple languages and voices, converting large ebooks in a few hours. The Python-based tool requires installing necessary libraries and model files. While chapter detection is still a bit rough, it works well overall, with future improvements planned for chapter detection and added features.

Development text-to-speech

Parallels Desktop Now Runs x86 Windows and Linux on Apple Silicon Macs

2025-01-15
Parallels Desktop Now Runs x86 Windows and Linux on Apple Silicon Macs

Parallels Desktop 20.2 adds early support for running 64-bit x86 Windows and Linux operating systems on Apple Silicon Macs. This allows users of M1, M2, and later Macs to run a wider range of operating systems, although performance will be slower than native ARM versions due to emulation. Limitations include USB device support, nested virtualization, and slower boot times, but it's a significant step for developers and users needing x86 compatibility on Apple Silicon.

Development

Customasm: An Assembler for Your Own Instruction Sets

2025-01-15
Customasm: An Assembler for Your Own Instruction Sets

Customasm is an assembler that lets you define your own custom instruction sets, perfect for testing the bytecode of a new virtual machine or writing programs for that new microprocessor architecture you just implemented on an FPGA chip! Try it online in your browser, check out an example project targeting the NES, and install the VSCode syntax highlighting extension. Install via `cargo install customasm`, download pre-built executables from Releases, or compile from source. Documentation and a how-to-start guide are available in the wiki.

Microsoft Code Change Nearly Breaks Linux 6.13 Release

2025-01-15
Microsoft Code Change Nearly Breaks Linux 6.13 Release

A code change contributed by a Microsoft engineer nearly caused a major disruption to the upcoming stable release of Linux kernel 6.13. Intended as a performance improvement, the change introduced issues on certain systems, especially those with Control Flow Integrity (CFI) enabled, such as machines with Intel Alder Lake processors. An urgent patch from Intel engineer Peter Zijlstra disabled the problematic code, preventing a delay in the 6.13 release. This incident highlights the critical importance of code review and thorough testing before merging code into large, open-source projects.

Development

Pyper: Concurrent Python Made Simple

2025-01-15
Pyper: Concurrent Python Made Simple

Pyper is a flexible framework for concurrent and parallel data processing, built on functional programming patterns. It seamlessly integrates threaded, multiprocessed, and asynchronous operations, simplifying the creation of ETL systems, data microservices, and data collection pipelines. With a clean API and efficient queueing, Pyper offers a lightweight, pure Python solution (zero dependencies) that prioritizes ease of use, safety, and efficiency. Developers can focus on building logic rather than managing low-level concurrency details.

Development

SimplexDocsPlaygroundRequest API: Code Execution Preview

2025-01-15

The SimplexDocsPlaygroundRequest API provides code execution and preview functionality. Users submit code to the server via this API, which executes the code and returns the results, along with a preview of the execution process. This is useful for developers debugging code, testing APIs, and rapidly prototyping. The API is currently loading; results will be available after code execution.

Development Code Execution Preview

From SvelteKit to Plain HTML: A Website Rewrite

2025-01-15

Frustrated with the complexities of SvelteKit's build system, the author decided to rewrite their personal website using plain HTML and CSS. The process involved using Pandoc to convert Markdown to HTML and Python with uv for a lightweight build pipeline. Despite the small scale of the site, the rewrite resulted in a reduction in size from 356kb to 88kb and simpler, easier-to-understand code. The author notes remaining issues like code duplication and lack of live reloading, intending to address them in future improvements. The project serves as a simple template for building static sites with Markdown blogs.

Development

Benchmark: Bitwise vs. Modulo for Even Number Check

2025-01-14
Benchmark: Bitwise vs. Modulo for Even Number Check

This post benchmarks two methods for checking if a number is even in Pascal and C: modulo operation and bitwise operation. The bitwise approach (using the bitwise AND operator) proves significantly faster. A Pascal test iterating from 0 to MaxInt showed bitwise operations were nearly 15 times quicker than modulo. In C, while compiler optimization might translate modulo 2 to bitwise AND, the bitwise method still slightly outperformed modulo. This highlights the efficiency advantage of bitwise operations for even number checks in performance-critical scenarios.

rqlite's Testing Strategy: A Pyramid Approach to Efficiency

2025-01-14

rqlite, a lightweight, open-source, distributed relational database built on SQLite and Raft, prioritizes reliability and quality through a rigorous testing strategy. This article details how rqlite adheres to the testing pyramid, prioritizing unit tests as the foundation, supplemented by system tests and a minimal number of end-to-end tests for efficiency and debuggability. Unit tests dominate, ensuring component independence and testability; system tests validate the interaction between the Raft consensus module and SQLite; end-to-end tests serve as a final sanity check. The article also highlights the importance of performance testing and shares lessons learned, such as optimizing fsync calls identified as a bottleneck through performance testing. rqlite's success demonstrates how this strategy maintains high quality while minimizing overhead.

structured-logprobs: Boosting OpenAI Structured Output Reliability

2025-01-14

structured-logprobs is an open-source Python library that enhances the reliability of OpenAI's structured outputs by providing detailed token log probability information. It works with OpenAI's Structured Outputs feature, ensuring consistent responses adhering to a supplied JSON Schema, preventing missing keys or invalid values. The library offers two methods for integrating log probabilities: adding them as a separate field or embedding them inline within the message content.

1 2 184 185 186 188 190 191 192 214 215