Category: Development

POSIX Time: Not What You Think

2024-12-26

This article debunks a common misconception about POSIX time (Unix time): it's not simply the number of seconds since January 1, 1970, 00:00:00. Due to leap seconds, the number of seconds in a UTC day isn't a constant 86,400, leading to discrepancies between POSIX time and the actual number of seconds. The article delves into the impact of leap seconds on time calculations and recommends alternatives like CLOCK_MONOTONIC or TAI for precise timekeeping, avoiding errors caused by leap seconds.

Development POSIX time leap seconds

A 50-Year-Old Bug in C's File I/O: Unraveling a Legacy Mystery

2024-12-26

While improving a DOS emulator, a developer stumbled upon a seemingly trivial bug in file I/O: appending text to a file using the `echo` command produced unexpected results. Debugging revealed a flaw in how C runtime libraries handle switching between reading and writing, a flaw tracing back to the 1970s and even earlier UNIX systems. The article delves into the historical context, from early K&R C to modern C standards, exploring implementation differences across various UNIX versions and C compilers. The root cause is identified as limitations in early C libraries' handling of update mode, with variations in how different operating systems and compilers addressed these limitations. The author concludes that even today, for portable C code, an explicit `fseek` call is necessary when switching between reading and writing a file.

Development file I/O legacy bug

Postgres Reads Causing Writes: MVCC, Page Pruning, and Hint Bits

2024-12-25

This article delves into the seemingly paradoxical behavior in PostgreSQL where simple SELECT queries can trigger data writes. Starting with the Multi-Version Concurrency Control (MVCC) mechanism, it explains concepts like row versions, pages, and tuples. Through code examples, it analyzes how hint bit updates and page pruning cause read operations to modify pages, ultimately leading to disk writes. The article also discusses the HOT update optimization strategy and uses page inspection tools to illustrate how data is stored and updated within pages.

Development Database Performance

Server-Sent Events (SSE): An Underrated Real-time Data Streaming Solution

2024-12-25
Server-Sent Events (SSE): An Underrated Real-time Data Streaming Solution

This article explores Server-Sent Events (SSE), a simpler and more efficient one-way real-time communication solution compared to WebSockets. SSE leverages standard HTTP protocols, making it easy to implement and deploy, compatible with existing infrastructure, resource-efficient, and featuring automatic reconnection. The article details SSE's workings, advantages, and application scenarios (like real-time news, stock tickers, progress bars, etc.), showing code examples with Flask and JavaScript. Furthermore, it analyzes how LLMs like ChatGPT utilize SSE for streaming responses and points out SSE's limitations, such as unidirectional communication and data format restrictions. In short, SSE provides an elegant solution for many applications requiring unidirectional real-time data streams.

Deep Dive into CPS: A Journey into Functional Programming Compilation

2024-12-25
Deep Dive into CPS: A Journey into Functional Programming Compilation

This article delves into Continuation-Passing Style (CPS) and its application in compiling functional programming languages. The author builds a CPS transformer step-by-step for a simple Scheme-like language, explaining optimization strategies and code generation methods. The article details the transformation of integers, variables, function calls, arithmetic operators, lambda expressions, and if expressions into CPS form. It also discusses meta-continuations and optimization techniques such as constant folding and beta reduction. Finally, it outlines several approaches to generating executable code from CPS, including generating C code, using trampolines, and employing a single large switch statement.

Portspoof: Open-Source Port Spoofing Tool Thwarts Port Scans

2024-12-25
Portspoof: Open-Source Port Spoofing Tool Thwarts Port Scans

Portspoof is an open-source port spoofing tool designed to enhance OS security. It confuses port scanners by always keeping all 65535 TCP ports open and responding with SYN+ACK to every connection attempt. Furthermore, Portspoof boasts a massive database of dynamic service signatures, mimicking various service banners to further hinder attackers from identifying real services. This significantly increases the time and difficulty for attackers to perform port scans and service identification, effectively improving system security without requiring root privileges.

Development port spoofing

Cognitive Load: The Silent Killer in Software Development

2024-12-25

This article explores the importance of cognitive load in software development. Cognitive load refers to the amount of mental effort a developer needs to complete a task; high cognitive load leads to confusion, wasted time, and money. The article analyzes intrinsic and extraneous cognitive load, illustrating how to reduce extraneous load through code examples, such as using meaningful intermediate variables, avoiding nested if statements, and prioritizing composition over inheritance. It also stresses avoiding excessive microservices, choosing appropriate language features, and adhering to the Single Responsibility Principle, noting that excessive abstraction and layered architectures can increase cognitive load. Finally, the article advises developers to focus on code readability and collaborate with junior developers to identify and improve cognitive load issues.

Sherlock Project: Hunt Down Social Media Accounts Across 400+ Networks

2024-12-25

The Sherlock Project is a powerful tool allowing users to search for social media accounts across 400+ networks using only a username. It's easy to get started with simple installation and usage instructions, and supports a wide range of sites. Community contributions are welcome, enabling users to add new sites and improve functionality.

MDN Learning Resources Get a Major Overhaul: New Learning Experience Launched

2024-12-25
MDN Learning Resources Get a Major Overhaul: New Learning Experience Launched

In December 2024, MDN launched a major update to its "Learn Web Development" section, merging the MDN Curriculum with existing learning content to create a more streamlined learning path. This upgrade addresses previous issues like bloated content and unclear learning pathways, providing a clearer and more accessible experience for beginners. The new site uses a modular structure with "Getting Started," "Core," and "Extensions" sections, incorporating clear learning objectives and interactive content. MDN will continue to improve content and design, aiming to deliver even better learning resources in the future.

Microsoft Research Unveils F*: A Proof-Oriented Programming Language

2024-12-25

F* (pronounced F star) is a general-purpose, proof-oriented programming language supporting both purely functional and effectful programming. Combining the expressive power of dependent types with automated proof generation via SMT solving and tactic-based interactive theorem proving, F* defaults to compiling to OCaml. However, it can also be extracted to F#, C, or WebAssembly using KaRaMeL, or to assembly using Vale. Developed and actively maintained by Microsoft Research, Inria, and the community, the open-source F* is used in various projects, including those within Mozilla Firefox and the Linux kernel, showcasing its applications in security, cryptography, and systems development.

OKRs: Tool or Trap?

2024-12-25
OKRs: Tool or Trap?

This article explores the duality of OKRs (Objectives and Key Results). The author points out that many companies misuse OKRs for performance reviews, leading teams to overemphasize measurable metrics while neglecting the actual objectives and external effects. The author uses the example of Alexa to illustrate how blindly pursuing key results can be counterproductive. In contrast, Honeycomb uses OKRs as a tool for communication and reflection, treating key results as clues to observe the world and improve work, rather than ultimate judgment criteria, thus avoiding metric distortion.

EZRGB: Powering Animated Holiday Light Shows with DBOS

2024-12-25

EZRGB uses DBOS to simplify the creation and deployment of animated holiday light shows. Their EZSequence platform allows users to purchase pre-made sequences and automatically map them to their house layouts, eliminating the complex manual process. Built with WordPress, DBOS Transact, AWS SQS, and S3, the platform offers a scalable and reliable solution, proving that even a niche market can benefit from robust technology.

Programmer Builds Native Flame Graph Viewer: Conquering Xlib and Performance Bottlenecks

2024-12-25

A Rust programmer, needing to debug Rust Analyzer, embarked on building a native flame graph viewer. Initial attempts using various GUI toolkits proved too memory-intensive. Instead, he cleverly used Xlib, overcoming challenges like scrolling performance, rendering thousands of buttons, and handling mouse interactions. The result: a lightweight, efficient flame graph viewer. This project showcases excellent programming skills and a deep understanding of performance optimization, offering valuable lessons for other developers.

Development flame graph

A Programmer's First Foray into Assembly: Optimizing a Lexer with Bit Vectors

2024-12-25

After reading "Writing an Interpreter in Go," a programmer attempted a rewrite in Zig and Rust, focusing on optimizing lexer performance. He explored several methods: branching, lookup tables, and bit vectors. Bit vectors compress state representation by mapping ASCII characters to bits, reducing memory usage and improving lookup efficiency. While an attempt to utilize SIMD instructions failed, he successfully implemented bit vectors in Zig and achieved good results in benchmarks, gaining valuable experience in assembly programming and performance optimization.

Ruby 3.4.0 Released: Performance Boost and Language Enhancements

2024-12-25

Ruby 3.4.0 is here with exciting updates! Language-wise, it introduces a new syntax for referencing block parameters, improves string literals, keyword splatting, and index assignments, and enhances exception handling. Core classes like Array, Hash, IO::Buffer, Integer, and String have been optimized with new methods added. YJIT has received significant improvements, boosting performance and memory efficiency. The standard library is also updated, including a 1.5x speedup in JSON parsing. This release enhances support for multi-core processors and improves garbage collection efficiency.

Ruby 3.4.0 Released: Enhanced Performance and New Features

2024-12-25

Ruby 3.4.0 has been released, boasting significant improvements! Key highlights include a performance-boosted YJIT compiler, a new modular garbage collection mechanism, and the convenient `it` block parameter reference. The default parser has switched to Prism, and the socket library now features Happy Eyeballs V2 for more efficient network connections. Core classes have received updates, and various bugs have been squashed. The release also includes deprecation warnings for string literal modifications and improvements to keyword splatting.

Development release

ScyllaDB Shifts to Single Enterprise Edition, Offers Free Tier

2024-12-25
ScyllaDB Shifts to Single Enterprise Edition, Offers Free Tier

ScyllaDB announced a strategic shift to focus on a single release stream: ScyllaDB Enterprise, ending its AGPL-licensed open-source offering. A free tier of ScyllaDB Enterprise will be available to the community, including all performance, efficiency, and security features previously reserved for the Enterprise edition. The free tier is limited to 50 vCPUs and 10TB of total storage. This simplifies the product line while providing a powerful free option for users.

Development

Immutable Linux Distros: Are They Right for You?

2024-12-25
Immutable Linux Distros: Are They Right for You?

This article explores immutable Linux distributions, which enhance stability and security by locking down the core system as read-only. It explains the concept, advantages, and selection criteria for immutable distros, recommending several desktop and server options like Fedora Silverblue, Vanilla OS, and openSUSE Aeon. The author shares personal experiences and discusses the differences between immutable distros and traditional ones, along with snapshot tools like Timeshift and Btrfs. In essence, immutable Linux distros offer a compelling alternative for users prioritizing stability and security, trading some flexibility for a more maintenance-free experience.

Jujutsu VCS: Streamlining Code Merges and Branch Management

2024-12-25
Jujutsu VCS: Streamlining Code Merges and Branch Management

This article presents a highly efficient workflow for managing code merges and branches using the Jujutsu version control system. The author introduces a 'megamerge' approach: create a merge commit as a working area, and then use `jj squash` to integrate changes into the appropriate parent commits upon completion of each task. Further streamlining is achieved with the `jj absorb` command, which automates this integration process. This workflow allows developers to seamlessly manage multiple parallel streams of work, significantly boosting efficiency, particularly when tackling large, long-running upgrades. The author contrasts this with the complexities of achieving the same results with Git.

Development Code Merge

T2 SDE: Major Update for Cross-Architecture OS Development Environment

2024-12-24

T2 SDE is a low-code, ultra-portable package manager and Linux distribution that enables fully automated, reproducible, cross-compilation of custom operating systems across architectures (ARM, x86-64, etc.). The latest release, T2 24.12, boasts 37 pre-compiled ISO images supporting 25 CPU architectures and includes numerous packages like LibreOffice and OpenJDK. It even has proof-of-concept support for the Nintendo Wii U. T2 continues to improve, with a commitment to supporting IA-64 Itanium, enhancing security features like full-disk encryption, and boosting performance through features like hardware video encoding and decoding.

The AI Backlash: A Necessary Correction for Practical Implementation

2024-12-24
The AI Backlash: A Necessary Correction for Practical Implementation

InfoWorld reports a growing developer frustration with the hype surrounding AI, emphasizing the need for practical and easily integrated tools. The article uses the RamaLama project as an example, showcasing how container technology simplifies AI model deployment and usage, and highlights the importance of smaller, more easily understood AI models. Developers want AI to seamlessly integrate into their workflows, not exist as a separate entity. This "AI backlash" presents an opportunity for effective AI implementation.

Real-time ISS Urine Tank Monitor App Launched

2024-12-24
Real-time ISS Urine Tank Monitor App Launched

A developer has created pISSStream, a macOS menu bar app that displays the fill level of the International Space Station's urine tank in real time. While not perfect in terms of coding style, the app's unique concept provides a lighthearted look at a detail of life in space. The developer stated they will not be adding any other data, focusing solely on the urine tank's fill level.

Operational PGP: A Guide to Secure Email Communication

2024-12-24
Operational PGP: A Guide to Secure Email Communication

This guide isn't about installing or using PGP; it's about using it securely. It emphasizes operational security beyond just encrypting email content, covering email composition, storage, key management, and more. It recommends composing emails in a text editor, avoiding saving drafts in email clients; generating and destroying keys frequently; avoiding publishing keys to keyservers; keeping email subjects blank to minimize metadata leakage; using the `gpg --throw-keys` option during encryption; enabling encryption by default and explicitly choosing whether to sign emails. The goal is maximizing PGP's security potential.

Wide Events: A Practitioner's Guide to Enhanced Observability

2024-12-24

This article introduces 'Wide Events,' an observability approach that enhances system monitoring and debugging by emitting a single event containing all collectable information for each unit of work. The author details how to choose appropriate tools (like Honeycomb), add rich attributes (including service metadata, instance info, build info, HTTP request/response details, user/customer info, rate limits, caching info, localization info, uptime, metrics, async request summaries, sampling info, and timing info), and handle errors and feature flags. Common concerns like excessive data volume, redundant data, and the relationship with existing metrics are addressed. The article highlights the significant practical value of this approach, showcasing how it simplifies debugging and reveals unexpected system behaviors.

Adding Refinement Types to Rust: A Feasibility Study

2024-12-24

This article explores the feasibility of adding refinement types to the Rust programming language. Drawing on experience with YAIOUOM, a static analyzer that used refinement types to check units of measure, the author examines approaches to implementing refinement types within Rust's type system. Several options are proposed, including modifications to trait resolution, type variable unification, and the introduction of a pluggable keyword mechanism for post-compilation type checking. An optimistic approach—ignoring unit information early in compilation and checking later—is deemed more practical. API design and error message handling are discussed. Future work involves gathering feedback, writing a rustc driver supporting plugins, and implementing several refinement types, potentially including a new version of YAIOUOM and subsets of Flux or Liquid Haskell.

The Essence of Computing Science: Elegance over Complexity

2024-12-24

This essay by Edsger W. Dijkstra explores the nature of computing science. Dijkstra argues that computing science should be a highly formalized branch of mathematics, emphasizing methodology over factual knowledge, thus bridging the gap between theory and practice. He criticizes the current academic world's pursuit of complexity and the resulting neglect of simple and effective solutions, and calls on computer scientists to pursue elegant solutions and find joy in the process.

AI-Generated Bug Reports Flood Open Source Projects

2024-12-24
AI-Generated Bug Reports Flood Open Source Projects

Open source maintainers are drowning in low-quality bug reports generated by AI. These reports often waste valuable time and resources, as AI systems currently lack the ability to understand code and frequently produce false or even malicious reports. Seth Larson of the Python Software Foundation and Daniel Stenberg of the Curl project have both highlighted the issue, emphasizing the strain on volunteer maintainers and the risk of overlooking genuine vulnerabilities. The problem necessitates a community-wide effort to improve funding, enhance efficiency, and develop better filtering mechanisms to identify and handle AI-generated junk reports.

Development Bug Reports

JavaScript Benchmarking: A Mess of JIT Compilers, Engine Differences, and Timing Inaccuracies

2024-12-24
JavaScript Benchmarking: A Mess of JIT Compilers, Engine Differences, and Timing Inaccuracies

Benchmarking JavaScript performance is notoriously difficult. This article highlights the challenges: the JIT compiler's dynamic optimizations lead to wildly varying results across runs; different JavaScript engines (like V8 and JavaScriptCore) exhibit significant performance disparities, with identical code performing dramatically differently; and browsers intentionally reduce timing accuracy to mitigate timing attacks, making precise measurements difficult. The author suggests using tools like d8 on the server-side for greater control over optimization levels and garbage collection, while browser-side testing relies heavily on the limited information provided by developer tools. In short, JavaScript benchmarking requires careful consideration of JIT compilation, engine variations, and timing precision, making it significantly more complex than in other languages.

Four Surprising Limitations of Rust's Borrow Checker

2024-12-24

This article delves into four surprising limitations of Rust's borrow checker encountered even by experienced Rustaceans. The first limitation involves the borrow checker's inability to fully account for match and return statements, leading to redundant checks when working with HashMaps. The second limitation concerns asynchronous programming, where Rust currently lacks the ability to express certain asynchronous callback type signatures. The third centers around FnMut closures not allowing re-borrowing of captured variables, restricting access to mutable state in async operations. Finally, the Send checker's lack of control flow awareness results in some Futures that should be Send being incorrectly flagged as non-Send. The author illustrates these limitations and their challenges with concrete code examples and workarounds, advocating for improvements to Rust's type system to enhance developer productivity.

1 2 188 189 190 192 194 195 196 201 202