Game Development Principles Yield Performant, Lightweight Windows File Explorer - Episode Hero Image

Game Development Principles Yield Performant, Lightweight Windows File Explorer

Original Title: Vjekoslav Krajačić on File Pilot and a return to fast UIs

TL;DR

  • FilePilot's custom OpenGL renderer and immediate mode UI paradigm enable game-like rendering speeds, offering a stark contrast to the jankiness often experienced in traditional Windows applications.
  • By statically linking the C runtime and minimizing DLL dependencies, FilePilot achieves a remarkably small 2-3 megabyte executable size, promoting portability and reducing bloat.
  • The developer's background in game development directly informs FilePilot's architecture, allowing for efficient rendering pipelines and a focus on performance typically absent in productivity software.
  • FilePilot's approach to DPI scaling recalculates based on monitor, adjusting fonts and UI elements without the jarring visual pop often seen when moving applications between displays.
  • The application's minimal API surface and reliance on older Windows APIs, while challenging for debugging, contribute to its broad compatibility, extending support back to Windows 7.
  • The developer intentionally avoids AI code generation, viewing it as a potential hindrance for new programmers who lack the context to identify and correct hallucinations.
  • FilePilot's future development includes Unicode support for international characters and drag-and-drop functionality from ZIP archives, addressing key user requests and expanding its capabilities.

Deep Dive

FilePilot represents a fundamental shift in Windows file explorer development, demonstrating that a single engineer can deliver a performant, lightweight, and highly responsive user experience by eschewing modern, complex frameworks for a custom-built, low-level approach inspired by game development. This philosophy not only recaptures the speed and polish often missing in contemporary applications but also highlights the trade-offs inherent in deep system integration versus developer velocity and maintainability.

The core of FilePilot's success lies in its deliberate avoidance of standard UI frameworks in favor of a custom, OpenGL-based renderer and an immediate-mode UI paradigm. This approach, rooted in the developer's background in game development, allows for near-instantaneous rendering and updates, a stark contrast to the often janky performance of traditional Windows applications. For example, the immediate mode UI renders everything from scratch each frame, a technique that, when optimized, leads to superior responsiveness compared to retained mode UIs which require complex change tracking. This focus on raw performance means FilePilot is not merely an alternative file explorer, but a demonstration of how decades-old development principles can yield dramatically superior user experiences even on modern operating systems. The implication is that the pursuit of performance and control through custom development, while demanding, can unlock significant advantages in responsiveness and efficiency that are difficult to achieve with higher-level abstractions.

Furthermore, FilePilot's minimal footprint--a 2-3 megabyte executable with few dependencies and a narrowly defined API surface--underscores a philosophical stance against the bloat of modern software development, particularly the prevalent use of frameworks like Electron. By statically linking the C runtime and hand-rolling standard library functions, the developer achieves an executable that is not only small but also free from external runtime dependencies, enhancing portability and reducing potential conflicts. This deliberate choice creates a tension with the rapid development cycles offered by component-based frameworks, suggesting a trade-off between development speed and the ultimate quality of the end product in terms of performance and resource utilization. The success of FilePilot implies that for certain critical system utilities, a return to disciplined, low-level development can yield significant, measurable benefits that resonate with users seeking efficiency and reliability.

The long-term implications of FilePilot's approach extend to how software is perceived and developed. It challenges the notion that the complexity of modern operating systems necessitates reliance on extensive frameworks and libraries. Instead, it champions a deep understanding of system APIs and a commitment to craftsmanship, allowing for novel solutions to long-standing problems, such as the slow rendering of context menus or the complexities of drag-and-drop operations. While the developer acknowledges the challenges in this approach, particularly when interacting with older Windows APIs, the resulting product demonstrates a compelling argument for prioritizing performance and control. This success suggests that a renewed interest in foundational programming principles could lead to a wave of more efficient and responsive applications across various domains, potentially influencing future development paradigms.

Action Items

  • Audit File Pilot's COM integration: Investigate drag-and-drop from zip archives to identify and resolve potential licensing or implementation complexities.
  • Refactor File Pilot's context menu: Migrate the right-click context menu handling to a separate thread to improve responsiveness and prevent potential main-thread blocking.
  • Implement Unicode support: Integrate rendering capabilities for non-Latin character sets (e.g., Japanese, Korean) to broaden File Pilot's global user base.
  • Design WSL integration: Develop a strategy for supporting Windows Subsystem for Linux (WSL) virtual folders to enable access to Linux file systems within File Pilot.

Key Quotes

"This is effectively an entirely engineered from scratch Windows file explorer. It's meant to wholly replace Explorer and to the extent it can be on Windows, right? And that's an important thing to talk about and we should talk about it that there are features and deep features within, you know, Windows Explorer, some of which might be niche or little tiny small features that you don't care about, but you're trying to cover the 80% to be a good file explorer for everyday use all the time."

Vjekoslav Krajačić explains that FilePilot is a complete rebuild of Windows File Explorer, designed to replace it. He clarifies that the goal is to cover the most common use cases, rather than replicating every niche feature of the original. This approach prioritizes functionality for the majority of users.


"Yeah, it is, but I do plan to to move to DirectX because I've had really, really bad experience with OpenGL, like a lot of people have, crazy bugs with OpenGL drivers and and stuff like that. So I hope to move to DirectX at the beginning of the next year and so hopefully stuff will be a bit more stable there. But yeah, it's it's completely custom, like the renderer is OpenGL and the UI framework framework is built on top of it."

Vjekoslav Krajačić discusses the technical implementation of FilePilot's rendering. He notes that while currently using OpenGL, he plans to transition to DirectX due to driver instability issues. Krajačić emphasizes that both the renderer and the UI framework are custom-built.


"My philosophy was, I'm just gonna try to build everything from scratch. Everything except the the parts that I need to use from Windows. But other than that, pretty much everything. So from from opening a window to to the renderer and UI and handling input and pretty much everything, handling strings, handling memory, threads, everything."

Vjekoslav Krajačić outlines his development philosophy for FilePilot. He states that his aim was to build as much of the application as possible from scratch, only utilizing necessary Windows components. This includes fundamental aspects like window management, rendering, UI, input handling, string manipulation, memory, and threading.


"The biggest speed improvement when rendering UI is probably from the immediate mode approach. So instead of, so the other one that that standard apps use is is retain mode. So whenever something changes in the UI, you check which part of the UI changed and you render only that part. And that's how traditionally UIs were written. But immediate mode UIs is pretty much every every frame you render everything, everything from scratch, but you have to make it really, really fast."

Vjekoslav Krajačić explains the performance advantage of FilePilot's UI rendering. He contrasts the "immediate mode" approach, where the entire UI is redrawn each frame, with the "retain mode" used in traditional applications, which only updates changed elements. Krajačić highlights that immediate mode, when optimized for speed, simplifies development and is common in game development.


"The hardest thing that got you the most stuck the longest when you're writing FilePilot? Probably the the thing we just discussed. So it's usually it's usually something that I call from Windows and the reason for that is because that's the code that I don't control and I don't have insight into. So and not only that, it's also because I'm using a lot of old APIs."

Vjekoslav Krajačić identifies challenges in developing FilePilot. He states that the most difficult issues arise when interacting with Windows APIs, as he has no control over that code and limited insight into its inner workings. Krajačić also notes that using older APIs further complicates troubleshooting.


"So to me, ChatGPT is like improved Google. So often times I will, when I'm not sure what to look for or when I can't remember exactly what I'm looking for, but I know what I, but I know what I need, but I just can't remember what what are the words, so I will put it in the ChatGPT. But after that, I'm usually in the official docs and checking every parameter because I've been, I've tried writing some code with it, but I've been bitten a couple of times because they often hallucinate."

Vjekoslav Krajačić describes his use of AI tools like ChatGPT. He views it as an enhanced search engine for finding information when he knows what he needs but struggles to recall the precise terminology. However, Krajačić emphasizes the importance of verifying information in official documentation due to AI's tendency to "hallucinate" or generate incorrect content.

Resources

External Resources

Books

  • "Handmade Hero" by Casey Muratori - Mentioned as an inspiration for the style of programming and building from scratch.

Articles & Papers

  • "Zoom It" by Mark Russinovich - Mentioned as an example of a small, tightly coded C application.

People

  • Casey Muratori - Creator of "Handmade Hero," a series that inspired the speaker's development philosophy.
  • Mark Russinovich - Mentioned in relation to his application "Zoom It" as an example of efficient C coding.
  • Vjekoslav Krajačić - Principal at FilePilot, guest on the podcast.

Organizations & Institutions

  • FilePilot - Software application discussed as a replacement for Windows Explorer.
  • Files App - Mentioned as a competitor in the file explorer space.
  • Microsoft - Mentioned in the context of needing internal expertise for Windows APIs.

Websites & Online Resources

  • FilePilot (filepilot.tech) - The website for the FilePilot application.
  • Files Community (files.community) - The website for the Files App.

Other Resources

  • Immediate Mode UI - A rendering paradigm used in FilePilot, where the UI is declared and drawn every frame.
  • Retained Mode UI - The traditional UI rendering paradigm where only changed parts of the UI are re-rendered.
  • COM (Component Object Model) - A Microsoft software component architecture, mentioned in relation to challenges with zip archive handling.
  • WSL (Windows Subsystem for Linux) - Mentioned as a feature that could be integrated into FilePilot for accessing Linux files.
  • Win32 APIs - Application Programming Interfaces for Windows, used extensively by FilePilot.
  • DirectX - A graphics API that FilePilot plans to move to from OpenGL for improved stability.
  • OpenGL - A graphics API currently used by FilePilot, noted for driver bugs.
  • Electron - A framework for building desktop applications using web technologies, contrasted with FilePilot's native approach.
  • C Runtime - The C standard library, which FilePilot has statically linked or self-implemented to avoid runtime dependencies.
  • AI (Artificial Intelligence) - Discussed as a productivity tool, but with concerns about hallucination and its impact on new programmers.
  • ChatGPT - Mentioned as an example of AI, used as an improved search engine for finding information.
  • Unicode - A character encoding standard, support for which is planned for FilePilot to render non-Latin characters.
  • Network Shares (UNC Paths) - Mentioned as a feature that requires further development in FilePilot.
  • Virtual Folders - A mechanism in Win32 APIs that could enable WSL support in FilePilot.
  • Demo Scene - A subculture focused on creating small, highly optimized software demonstrations, used as an analogy for FilePilot's size and efficiency.
  • Windows 7 - An older operating system that FilePilot supports, indicating the use of older APIs.

---
Handpicked links, AI-assisted summaries. Human judgment, machine efficiency.
This content is a personally curated review and synopsis derived from the original podcast episode.