Recent Posts
Archives

Archive for the ‘en-US’ Category

PostHeaderIcon [DevoxxGR2024] Devoxx Greece 2024 Sustainability Chronicles: Innovate Through Green Technology With Kepler and KEDA

At Devoxx Greece 2024, Katie Gamanji, a senior field engineer at Apple and a technical oversight committee member for the Cloud Native Computing Foundation (CNCF), delivered a compelling presentation on advancing environmental sustainability within the cloud-native ecosystem. With Kubernetes celebrating its tenth anniversary, Katie emphasized the urgent need for technologists to integrate green practices into their infrastructure strategies. Her talk explored how tools like Kepler and KEDA’s carbon-aware operator enable practitioners to measure and mitigate carbon emissions, while fostering a vibrant, inclusive community to drive these efforts forward. Drawing from her extensive experience and leadership in the CNCF, Katie provided a roadmap for aligning technological innovation with climate responsibility.

The Imperative of Cloud Sustainability

Katie began by underscoring the critical role of sustainability in the tech sector, particularly given the industry’s contribution to global greenhouse gas emissions. She highlighted that the tech sector accounts for 1.4% of global emissions, a figure that could soar to 10% within a decade without intervention. However, by leveraging renewable energy, emissions could be reduced by up to 80%. International agreements like COP21 and the United Nations’ Sustainable Development Goals (SDGs) have spurred national regulations, compelling organizations to assess and report their carbon footprints. Major cloud providers, such as Google Cloud Platform (GCP), have set ambitious net-zero targets, with GCP already operating on renewable energy since 2022. Yet, Katie stressed that sustainability cannot be outsourced solely to cloud providers; organizations must embed these principles internally.

The emergence of “GreenOps,” inspired by FinOps, encapsulates the processes, tools, and cultural shifts needed to achieve digital sustainability. By optimizing infrastructure—through strategies like using spot instances or serverless architectures—organizations can reduce both costs and emissions. Katie introduced a four-phase strategy proposed by the FinOps Foundation’s Environmental Sustainability Working Group: awareness, discovery, roadmap, and execution. This framework encourages organizations to educate stakeholders, benchmark emissions, implement automated tools, and iteratively pursue ambitious sustainability goals.

Measuring Emissions with Kepler

To address emissions within Kubernetes clusters, Katie introduced Kepler, a CNCF sandbox project developed by Red Hat and IBM. Kepler, a Kubernetes Efficient Power Level Exporter, utilizes eBPF to probe system statistics and export power consumption metrics to Prometheus for visualization in tools like Grafana. Deployed as a daemon set, Kepler collects node- and container-level metrics, focusing on power usage and resource utilization. By tracing CPU performance counters and Linux kernel trace points, it calculates energy consumption in joules, converting this to kilowatt-hours and multiplying by region-specific emission factors for gases like coal, petroleum, and natural gas.

Katie demonstrated Kepler’s practical application using a Grafana dashboard, which displayed emissions per gas and allowed granular analysis by container, day, or namespace. This visibility enables organizations to identify high-emission components, such as during traffic spikes, and optimize accordingly. As a sandbox project, Kepler is gaining momentum, and Katie encouraged attendees to explore it, provide feedback, or contribute to its development, reinforcing its potential to establish a baseline for carbon accounting in cloud-native environments.

Scaling Sustainably with KEDA’s Carbon-Aware Operator

Complementing Kepler’s observational capabilities, Katie introduced KEDA (Kubernetes Event-Driven Autoscaler), a graduated CNCF project, and its carbon-aware operator. KEDA, created by Microsoft and Red Hat, scales applications based on external events, offering a rich catalog of triggers. The carbon-aware operator optimizes emissions by scaling applications according to carbon intensity—grams of CO2 equivalent emitted per kilowatt-hour consumed. In scenarios where infrastructure is powered by renewable sources like solar or wind, carbon intensity approaches zero, allowing for maximum application replicas. Conversely, high carbon intensity, such as from coal-based energy, prompts scaling down to minimize emissions.

Katie illustrated this with a custom resource definition (CRD) that configures scaling behavior based on carbon intensity forecasts from providers like WattTime or Electricity Maps. In her demo, a Grafana dashboard showed an application scaling from 15 replicas at a carbon intensity of 530 to a single replica at 580, dynamically responding to grid data. This proactive approach ensures sustainability is embedded in scheduling decisions, aligning resource usage with environmental impact.

Nurturing a Sustainable Community

Beyond technology, Katie emphasized the pivotal role of the Kubernetes community in driving sustainability. Operating on principles of inclusivity, open governance, and transparency, the community fosters innovation through technical advisory groups (TAGs) focused on domains like observability, security, and environmental sustainability. The TAG Environmental Sustainability, established just over a year ago, aims to benchmark emissions across graduated CNCF projects, raising awareness and encouraging greener practices.

To sustain this momentum, Katie highlighted the need for education and upskilling. Resources like the Kubernetes and Cloud Native Associate (KCNA) certification and her own Cloud Native Fundamentals course on Udacity lower entry barriers for newcomers. By diversifying technical and governing boards, the community can continue to evolve, ensuring it scales alongside technological advancements. Katie’s vision is a cloud-native ecosystem where innovation and sustainability coexist, supported by a nurturing, inclusive community.

Conclusion

Katie Gamanji’s presentation at Devoxx Greece 2024 was a clarion call for technologists to prioritize environmental sustainability. By leveraging tools like Kepler and KEDA’s carbon-aware operator, practitioners can measure and mitigate emissions within Kubernetes clusters, aligning infrastructure with climate goals. Equally important is the community’s role in fostering education, inclusivity, and collaboration to sustain these efforts. Katie’s insights, grounded in her leadership at Apple and the CNCF, offer a blueprint for innovating through green technology while building a resilient, forward-thinking ecosystem.

Links:

PostHeaderIcon [KotlinConf2024] KotlinConf2024 Keynote: Powering the Future with Kotlin 2.0

KotlinConf2024, hosted in Copenhagen, welcomed 2,000 attendees and thousands online, kicking off with a vibrant keynote celebrating Kotlin’s evolution. Igor Tolstoy, Kotlin Project Lead at JetBrains, unveiled Kotlin 2.0, powered by the K2 compiler, promising double compilation speeds and robust multiplatform capabilities. Joined by speakers from Meta, Google, Amazon, and JetBrains, the keynote showcased Kotlin’s adoption in 20M lines of code at Meta, Google’s multiplatform push, and Amazon’s AWS SDK. From Compose Multiplatform to AI-driven tools, the event underscored Kotlin’s role in modern development, fueled by a thriving ecosystem.

A Global Stage for Kotlin Innovation

KotlinConf2024 buzzed with energy, uniting 2,000 in-person attendees, online viewers, and 71 global events across 37 countries. The conference featured five parallel sessions, lightning talks, a coach challenge, and code labs by Touchlab. A lively party with a live band and quiz, plus a closing panel, kept spirits high. Attendees donned T-shirts with words like “love,” “code,” and “nothing,” encouraged to form phrases for social media with #KotlinConf. Sponsors, including American Express, powered the event, with their booths bustling in the exhibit hall. The KotlinConf app, built with Compose Multiplatform, guided attendees, urging them to vote on sessions to shape future lineups.

Kotlin 2.0: The K2 Compiler Revolution

Igor Tolstoy introduced Kotlin 2.0, a milestone driven by the K2 compiler. This rewrite delivers a 2x compilation speed boost, slashing wait times for builds. Tested across 10M lines of code from 40 JetBrains and community projects, K2 ensures stability, with 18,000 developers and companies like Meta adopting early versions. The IntelliJ K2 mode, nearing beta, accelerates code highlighting by 1.8x, set to become default in IntelliJ 24.3. Avoiding major syntax changes, K2 fixes longstanding issues, enhancing code consistency and enabling faster language evolution without breaking existing projects.

Meta’s Kotlin Journey: Scaling Android

Eve Maler, an Android engineer from Meta, shared their Kotlin adoption, now spanning 20M lines of code. Since embracing Kotlin-first development three years ago, Meta reduced code by 10%, boosting reliability and developer preference. K2’s incremental compilation cut build times by up to 20%, with 95% of modules now using K2. Tools like IntelliJ’s J2K converter automate Java-to-Kotlin transitions, converting tens of thousands of lines weekly. Meta’s frameworks, including Litho and Dex optimizations, fully support Kotlin, paving the way for a mono-language Android experience, enhancing developer productivity.

Google’s Multiplatform Commitment

Jeffrey van Gogh from Google highlighted their investment in Kotlin, with 33M lines of code internally, doubling since 2023. Kotlin 2.0’s stability thrilled Google, who contributed compiler fixes and ported tools like Android Lint and Compose plugins to K2. The Compose compiler plugin now ships with Kotlin distributions, simplifying updates. Google announced official Android support for Kotlin Multiplatform (KMP) at Google I/O, enabling shared business logic across mobile, web, and desktop. Jetpack libraries like Room and DataStore now support KMP, with Android Studio integrating native KMP tooling, signaling a hybrid model balancing native and shared code.

Compose Multiplatform: Cross-Platform UI

Sebastian Aigner and Ekaterina Petrova celebrated Compose Multiplatform’s stability on Android and desktop, with iOS nearing beta and web in alpha. Used in thousands of apps, including McDonald’s, Compose reduced crashes and unified teams by sharing business logic. New APIs, like Jetpack Navigation and type-safe resources, enhance cross-platform development. iOS-specific improvements, such as VoiceOver integration and refined scroll physics, ensure native experiences. Web support leverages Kotlin/Wasm for high-performance browser apps. Compose’s flexibility lets developers choose how much code to share, from logic to full UI, meeting users across platforms.

Tooling Evolution: Amper and Fleet

JetBrains introduced Amper, a new build tool simplifying multiplatform project setup with minimal configuration. A Kotlin JVM project requires just one line, with dependencies easily added. Amper integrates with IntelliJ and Android Studio, offering quick fixes for project creation. Fleet, a preview multiplatform IDE, unifies Kotlin and Swift development, supporting Xcode projects and cross-language debugging. These tools automate environment checks, provide UI previews, and integrate JetBrains’ AI Assistant for code generation, streamlining workflows and lowering barriers for KMP adoption.

Ecosystem Growth: Libraries and AWS

The Kotlin ecosystem thrives, with a 50% rise in open-source multiplatform solutions. Libraries like Ktor, Serialization, and DateTime gain multiplatform APIs, while new additions like Kandy (data visualization) and DataFrame (data processing) expand capabilities. Amazon’s Julia detailed their AWS SDK for Kotlin, now generally available, built on Smithy for idiomatic APIs. Supporting hundreds of services, including Amazon Bedrock, the SDK leverages coroutines for pagination and streams. Amazon’s internal Kotlin use surged 6x, with teams like Prime Video reporting higher quality and productivity.

AI-Powered Development with JetBrains

Svetlana Isakova closed with JetBrains’ AI Assistant, written in Kotlin and integrated into IntelliJ and Fleet. It offers context-aware code completion, refactoring, and explanations, understanding project structures and dependencies. A Kotlin-specific language model, trained on open-source repositories, powers precise code generation, outperforming larger models in benchmarks. Available in IntelliJ 24.2, it supports multi-line completion and custom contexts. For enterprises, an on-premises version ensures compliance. Open-sourced datasets on Hugging Face further Kotlin’s AI advancements, equipping developers for the AI-driven future.

Links:

PostHeaderIcon [PHPForumParis2023] Learn and Share Differently – Aurélie Vache

Aurélie Vache, a Developer Advocate at OVHcloud, captivated the audience at Forum PHP 2023 with her keynote on reimagining how we learn and share knowledge in the tech world. With a passion for simplifying complex concepts through accessible explanations and vibrant sketchnotes, Aurélie shared her personal journey from a childhood marked by shyness to becoming a celebrated speaker and author. Her talk emphasized the power of embracing individuality and creativity to make technical learning inclusive, particularly for neurodivergent individuals, and inspired developers to rethink traditional approaches to education and knowledge-sharing.

Embracing Individuality in Learning

Aurélie began by highlighting a universal challenge: the expectation to conform to standardized educational frameworks despite our unique differences. With approximately 8 billion people on Earth, each with distinct learning styles, she questioned why technical resources, like programming books, often follow a uniform format. Drawing from her own struggles as a child who found it difficult to speak, Aurélie shared how her love for drawing and Legos evolved into creating sketchnotes—visual summaries that distill complex technical concepts into digestible illustrations. This approach, she explained, not only helped her understand technologies like Kubernetes and Docker but also resonated with others seeking alternative learning paths.

Sketchnotes as a Tool for Inclusion

Delving deeper, Aurélie showcased how her sketchnotes have become a powerful medium for making technical content accessible, particularly for neurodivergent individuals. Responding to an audience question, she noted feedback from colleagues and friends with ADHD, who found her visual summaries easier to process than dense texts. Her 13-year-old dyslexic son also benefited from her illustrated notes, which aided his schoolwork. By emphasizing key information through visuals, Aurélie’s work bridges gaps for those who find traditional resources, like O’Reilly books, challenging due to attention or processing difficulties. Her approach underscores the importance of tailoring educational tools to diverse needs.

Inspiring Creative Knowledge-Sharing

Aurélie concluded by urging developers to break free from conventional methods and share knowledge in ways that reflect their unique perspectives. Her journey from creating a single sketchnote during the 2020 lockdown to publishing illustrated books on cloud technologies demonstrates the impact of embracing one’s passions. By fostering creativity and leveraging supportive communities, she encouraged the audience to experiment with formats like videos, blogs, or talks to make learning engaging and inclusive. Aurélie’s call to action inspired attendees to rethink how they contribute to the tech ecosystem, prioritizing authenticity over conformity.

Links:

PostHeaderIcon [NDCOslo2024] Running .NET on the NES – Jonathan Peppers

In a whimsical fusion of nostalgia and innovation, Jonathan Peppers, a principal software engineer at Microsoft, embarks on an audacious quest: running .NET on the Nintendo Entertainment System (NES), a 1985 gaming relic powered by a 6502 microprocessor. With a career steeped in .NET for Android and .NET MAUI, Jonathan’s side project is a playful yet profound exploration of cross-platform ingenuity, blending reverse engineering, opcode alchemy, and MSIL wizardry. His journey, shared with infectious enthusiasm, unveils the intricacies of adapting modern frameworks to vintage hardware, offering lessons in creativity and constraint.

Jonathan opens with a nod to the NES’s cultural cachet—a living room arcade for a generation. Its modest specs—less than 2 MHz, 52 colors, and minuscule cartridges—contrast starkly with today’s computational behemoths. Yet, this disparity fuels his ambition: to compile C# into 6502 assembly, enabling .NET to animate pixels on a 256×240 canvas. Through meticulous reverse engineering and bespoke compilers, Jonathan bridges eras, inviting developers to ponder the portability of modern tools.

Decoding the NES: Reverse Engineering and Opcode Orchestration

The NES’s heart, the 6502 microprocessor, speaks a language of opcodes—terse instructions dictating arithmetic and flow. Jonathan recounts his reverse-engineering odyssey, dissecting ROMs to map their logic. His approach: transform C#’s intermediate language (MSIL) into 6502 opcodes, navigating the absence of high-level constructs like methods or garbage collection. By crafting a custom compiler, he translates simple C# programs—think console outputs—into assembly, leveraging the NES’s 2KB RAM and 8-bit constraints.

Challenges abound: switch statements falter, branching logic stumbles, and closures remain elusive. Yet, Jonathan’s demos—a flickering sprite, a basic loop—prove viability. His toolkit, open-sourced on GitHub, invites contributions, with a human-crafted logo replacing an AI-generated predecessor. This endeavor, while not production-ready, showcases the power of constraints to spark innovation, echoing the NES’s own era of elegant simplicity.

Bridging Eras: Lessons in Cross-Platform Creativity

Jonathan’s experiment transcends mere novelty, illuminating cross-platform principles. The NES, with its rigid architecture, mirrors edge devices where resources are scarce. His compiler, mapping .NET’s abstractions to 6502’s austerity, mirrors modern efforts in WebAssembly or IoT. Structs, feasible sans garbage collection, hint at future expansions, while his call for pull requests fosters a collaborative ethos.

His reflection: constraints breed clarity. By stripping .NET to its essence, Jonathan uncovers universal truths about code portability, urging developers to question assumptions and embrace unconventional platforms. His vision—a C# Mario clone—remains aspirational, yet the journey underscores that even vintage hardware can host modern marvels with enough ingenuity.

Links:

PostHeaderIcon [DotAI2024] DotAI 2024: Steeve Morin – Revolutionizing AI Inference with ZML

Steeve Morin, a seasoned software engineer and co-founder of ZML, unveiled an innovative approach to machine learning deployment during his presentation at DotAI 2024. As the architect behind LegiGPT—a pioneering legal AI assistant—and a former VP of Engineering at Zenly (acquired by Snap Inc.), Morin brings a wealth of experience in scaling high-performance systems. His talk centered on ZML, a compiling framework tailored for Zig programming language, leveraging MLIR, XLA, and Bazel to streamline inference across diverse hardware like NVIDIA GPUs, AMD accelerators, and TPUs. This toolset promises to reshape how developers author and deploy ML models, emphasizing efficiency and production readiness.

Bridging Training and Inference Divides

Morin opened by contrasting the divergent demands of model training and inference. Training, he described, thrives in exploratory environments where abundance reigns—vast datasets, immense computational power, and rapid prototyping cycles. Python excels here, fostering innovation through quick iterations and flexible experimentation. Inference, however, demands precision in production settings: billions of queries processed with unwavering reliability, minimal resource footprint, and consistent latency. Here, Python’s interpretive nature introduces overheads that can compromise scalability.

This tension, Morin argued, underscores the need for specialized frameworks. ZML addresses it head-on by targeting inference exclusively, compiling models into optimized binaries that execute natively on target hardware. Built atop MLIR (Multi-Level Intermediate Representation) for portable optimizations and XLA (Accelerated Linear Algebra) for high-performance computations, ZML integrates seamlessly with Bazel for reproducible builds. Developers write models in Zig—a systems language prized for its safety and speed—translating high-level ML constructs into low-level efficiency without sacrificing expressiveness.

Consider a typical workflow: a developer prototypes a neural network in familiar ML dialects, then ports it to ZML for compilation. The result? A self-contained executable that bypasses runtime dependencies, ensuring deterministic performance. Morin highlighted cross-accelerator binaries as a standout feature—single artifacts that adapt to CUDA, ROCm, or TPU environments via runtime detection. This eliminates the provisioning nightmares plaguing traditional ML ops, where mismatched driver versions or library conflicts derail deployments.

Furthermore, ZML’s design philosophy prioritizes developer ergonomics. From a MacBook, one can generate deployable archives or Docker images tailored to Linux ROCm setups, all within a unified pipeline. This hermetic coupling of model and runtime mitigates version drift, allowing teams to focus on innovation rather than firefighting. Early adopters, Morin noted, report up to 3x latency reductions on edge devices, underscoring ZML’s potential to democratize high-fidelity inference.

Empowering Production-Grade AI Without Compromise

Morin’s vision extends beyond technical feats to cultural shifts in AI engineering. He positioned ZML for “AI-flavored backend engineers”—those orchestrating large-scale systems—who crave hardware agnosticism without performance trade-offs. By abstracting accelerator specifics into compile-time decisions, ZML fosters portability: a model tuned for NVIDIA thrives unaltered on AMD, fostering vendor neutrality in an era of fragmented ecosystems.

He demonstrated this with Mistral models, compiling them for CUDA execution in mere minutes, yielding inference speeds rivaling hand-optimized C++ code. Another showcase involved cross-compilation from macOS to ARM-based TPUs, producing a Docker image that auto-detects and utilizes available hardware. Such versatility, Morin emphasized, eradicates MLOps silos; models deploy as-is, sans bespoke orchestration layers.

Looking ahead, ZML’s roadmap includes expanded modality support—vision and audio alongside text—and deeper integrations with serving stacks. Morin invited the community to engage via GitHub, underscoring the framework’s open-source ethos. Launched stealthily three weeks prior, ZML has garnered enthusiastic traction, bolstered by unsolicited contributions that refined its core.

In essence, ZML liberates inference from Python’s constraints, enabling lean, predictable deployments that scale effortlessly. As Morin quipped, “Build once, run anywhere”—a mantra that could redefine production AI, empowering engineers to deliver intelligence at the edge of possibility.

Links:

PostHeaderIcon [DotJs2024] Converging Web Frameworks

In the ever-evolving landscape of web development, frameworks like Angular and React have long stood as pillars of innovation, each carving out distinct philosophies while addressing the core challenge of synchronizing application state with the user interface. Minko Gechev, an engineering and product leader at Google with deep roots in Angular’s evolution, recently illuminated this dynamic during his presentation at dotJS 2024. Drawing from his extensive experience, including the convergence of Angular with Google’s internal Wiz framework, Gechev unpacked how these tools, once perceived as divergent paths, are now merging toward shared foundational principles. This shift not only streamlines developer workflows but also promises more efficient, performant applications that better serve modern web demands.

Gechev began by challenging a common misconception: despite their surface-level differences—Angular’s class-based templates versus React’s functional JSX components—these frameworks operate under remarkably similar mechanics. At their heart, both construct an abstract component tree, a hierarchical data structure encapsulating state that the framework must propagate to the DOM. This reactivity, as Gechev termed it, was historically managed through traversal algorithms in both ecosystems. For instance, updating a shopping cart’s item quantity in a nested component tree would trigger a full or optimized scan, starting from the root and pruning unaffected branches via Angular’s OnPush strategy or React’s memoization. Yet, as applications scale to thousands of components, these manual optimizations falter, demanding deeper introspection into runtime behaviors.

What emerges from Gechev’s analysis is a narrative of maturation. Benchmarks from the prior year revealed Angular and React grappling similarly with role-swapping scenarios, where entire subtrees require recomputation, while excelling in partial updates. Real-world apps, however, amplify these inefficiencies; traversing vast trees repeatedly erodes performance. Angular’s response? Embracing signals—a reactive primitive now uniting a constellation of frameworks including Ember, Solid, and Vue. Signals enable granular tracking of dependencies at compile time, distinguishing static from dynamic view elements. In Angular, assigning a signal to a property like title and reading it in a template flags precise update loci, minimizing unnecessary DOM touches. React, meanwhile, pursues a compiler-driven path yielding analogous outputs, underscoring a broader industry alignment on static analysis for reactivity.

This convergence extends beyond reactivity. Gechev highlighted dependency injection patterns, akin to React’s Context API, fostering modular state management. Looking ahead, he forecasted alignment on event replay for seamless hydration—capturing user interactions during server-side rendering gaps and replaying them post-JavaScript execution—and fine-grained code loading via partial hydration or island architectures. Angular’s defer views, for example, delineate interactivity islands, hydrating only triggered sections like a navigation bar upon user engagement, slashing initial JavaScript payloads. Coupled with libraries like JAction for event dispatch, this approach, battle-tested in Google Search, bridges the interactivity chasm without compromising user fidelity.

Gechev’s insights resonate profoundly in an era where framework selection feels paralyzing. With ecosystems like Angular boasting backward compatibility across 4,500 internal applications—each rigorously tested during upgrades—the emphasis tilts toward stability and inclusivity. Developers, he advised, should prioritize tools with robust longevity and vibrant communities, recognizing that syntactic variances mask converging implementations. As web apps demand finer control over performance and user experience, this unification equips builders to craft resilient, scalable solutions unencumbered by paradigm silos.

Signals as the Reactivity Keystone

Delving deeper into signals, Gechev positioned them as the linchpin of modern reactivity, transcending mere state updates to forge dependency graphs that anticipate change propagation. Unlike traditional observables, signals compile-time track reads, ensuring updates cascade only to affected nodes. This granularity shines in Angular’s implementation, where signals integrate seamlessly with zoneless change detection, obviating runtime polling. Gechev illustrated this with a user profile and shopping cart example: altering cart quantities ripples solely through relevant branches, sparing unrelated UI like profile displays. React’s compiler echoes this, optimizing JSX into signal-like structures for efficient re-renders. The result? Frameworks shedding legacy traversal overheads, aligning on a primitive that empowers developers to author intuitive, responsive interfaces without exhaustive profiling.

Horizons of Hydration and Modularity

Peering into future convergences, Gechev envisioned event replay and modular loading as transformative forces. Event replay, via tools like JAction now in Angular’s developer preview, mitigates hydration delays by queuing interactions during static markup rendering. Meanwhile, defer views pioneer island-based hydration, loading JavaScript incrementally based on viewport or interaction cues—much like Astro’s serverside islands or Remix’s partial strategies. Dependency injection further unifies this, providing scoped services that mirror React’s context while scaling enterprise needs. Gechev’s vision: a web where frameworks dissolve into interoperable primitives, letting developers focus on delighting users rather than wrangling abstractions.

Links:

PostHeaderIcon [KotlinConf2023] Video Game Hacking with Kotlin/Native: A Low-Level Adventure with Ignat Beresnev

At KotlinConf’23, Ignat Beresnev, a member of the Kotlin team at JetBrains and a core contributor to Dokka, stepped onto the stage with an unexpected topic: using Kotlin/Native for video game hacking. Far from a gimmick, his talk offered a solid foundation in low-level memory manipulation techniques, revealing how Kotlin/Native can be a surprisingly practical tool for creating trainers, bots, and various forms of game hacks. Drawing on examples such as modding Grand Theft Auto, the session aimed to demystify game hacking and present it as an accessible and technically rich domain for Kotlin developers.

Ignat began by recounting his personal journey into game modification, which started years earlier with a self-imposed challenge to write a World of Warcraft bot in Java. While technically successful, the attempt exposed the limitations of Java when it comes to low-level system access. Rediscovering the problem through the lens of Kotlin/Native, he found a much better fit: a language that retained Kotlin’s expressiveness while unlocking native-level capabilities required for deep interaction with operating system APIs.

Understanding Game Internals and Memory Manipulation

The core premise of game hacking, Ignat explained, lies in understanding how games store and manage state. Just like any other program, a game keeps its data—such as player health, in-game currency, or positional coordinates—in memory. If you can discover where a particular value is stored, you can read it, monitor it, or even modify it in real time. He illustrated this with a relatable scenario: if a character in a game has 100 units of currency, then somewhere in memory exists a variable holding that value. The trick is finding it.

To pinpoint such a memory address, one typically uses a memory scanning tool like Cheat Engine. The process involves searching the memory space for a known value—say, 100—then performing an in-game action that changes it, such as spending money. The search is then repeated for the new value (e.g., 80), gradually narrowing down the list of candidate addresses until the correct one is isolated.

Once the memory address is identified, Kotlin/Native can be used to read from or write to that memory location by interfacing directly with native Windows API functions. Ignat detailed this workflow by first obtaining a handle to the target process using functions like OpenProcess, which grants the required permissions to access another process’s memory. He pointed out how abstract and opaque some of the types in C APIs can be—such as HANDLE, which is essentially a pointer behind the scenes—but noted that Kotlin/Native handles these seamlessly through its C interop layer.

To read memory, one would use ReadProcessMemory, specifying the process handle, the target memory address, a buffer to receive the data, and additional arguments to track the number of bytes read. Kotlin/Native’s support for functions like allocArray and cValuesOf simplifies this otherwise complex operation. Writing memory involves a nearly identical process, this time using the WriteProcessMemory function to inject new values into specific memory locations.

Ignat added a humorous aside, noting how tricky it can be to locate something like a string literal in a game’s memory. Nonetheless, he successfully demonstrated a live example, changing an on-screen number in a lightweight game to prove the concept in action.

DLL Injection and Function Invocation

While reading and writing memory opens up powerful capabilities, more advanced techniques allow even deeper integration with the target game. One such technique is DLL injection. This method involves writing a Dynamic Link Library and tricking the game process into loading it. Once loaded, the DLL gains access to the same memory and execution privileges as the game itself, effectively becoming part of its runtime.

Ignat outlined the injection process step by step. First, the target process must be located and a handle acquired. Next, the injector allocates memory in the target’s address space to store the path of the DLL. This path is written into the allocated space, after which the program looks up the address of the LoadLibrary function in kernel32.dll. Since this system library is mapped at the same location across processes, it provides a reliable anchor point. Finally, CreateRemoteThread is used to spawn a new thread inside the game process that calls LoadLibrary, thereby loading the malicious DLL and executing its code.

Once injected, the DLL has full access to call the game’s internal functions—if their memory addresses and calling conventions are known. Ignat demonstrated this by referencing documentation from a modding community for GTA: San Andreas, which includes reverse-engineered addresses and function signatures for in-game routines like CreateCar. By defining a function pointer in Kotlin/Native that matches the signature and calling it through the injected DLL, one can trigger effects like spawning vehicles at will. Of course, this requires careful adherence to calling conventions, such as stdcall, and a deep understanding of binary interfaces.

Beyond Games: Broader Applications

While the talk focused on game modification, Ignat was clear in emphasizing that these techniques extend far beyond entertainment. The same approaches can be used to patch bugs in native libraries, build plugins for applications not originally designed for extensibility, gather usage metrics from legacy software, or automate GUI interactions. What Kotlin/Native brings to the table is the rare combination of modern Kotlin syntax with native-level system access, making it a uniquely powerful tool for developers interested in systems programming, reverse engineering, or unconventional automation.

By the end of the session, Ignat had shown not just how to hack a game, but how to think like a systems programmer using Kotlin/Native. It was a fascinating, fun, and deeply technical presentation that pushed the boundaries of what most Kotlin developers might expect from their tooling—and opened the door to new realms of possibility.

Links:

PostHeaderIcon [DevoxxGR2024] The Architect Elevator: Mid-Day Keynote by Gregor Hohpe

In his mid-day keynote at Devoxx Greece 2024, Gregor Hohpe, reflecting on two decades as an architect, presented the Architect Elevator—a metaphor for architects connecting organizational layers from the “engine room” to the “penthouse.” Rejecting the notion that architects are the smartest decision-makers, Gregor argued they amplify collective intelligence by sharing models, revealing blind spots, and fostering better decisions. Using metaphors, sketches, and multi-dimensional thinking, architects bridge technical and business strategies, ensuring alignment in complex, fast-changing environments.

Redefining the Architect’s Role

Gregor emphasized that being an architect is a mindset, not a title. Architects don’t make all decisions but boost the team’s IQ through seven maneuvers: connecting organizational layers, using metaphors, drawing abstract sketches, expanding solution spaces, trading options, zooming in/out, and embracing non-binary thinking. The value lies in spanning multiple levels—executive strategy to hands-on engineering—rather than sitting in an ivory tower or engine room alone.

The Architect Elevator Metaphor

Organizations are layered like skyscrapers, with management at the top and developers below, often isolated by middle management. This “loosely coupled” structure creates illusions of success upstairs and unchecked freedom downstairs, misaligning strategy and execution. Architects ride the elevator to connect these layers, ensuring technical decisions support business goals. For example, a strategy to enter new markets requires automated, cloud-based systems for replication, while product diversification demands robust integration.

Connecting Levels with Metaphors and Sketches

Gregor advocated using metaphors to invite stakeholders into technical discussions, avoiding jargon that alienates smart executives. For instance, explaining automation’s role in security and cost-efficiency aligns engine-room work with C-suite priorities. Sketches, like Frank Gehry’s architectural drawings, should capture mental models, not blueprints, abstracting complexity to focus on purpose and constraints. These foster shared understanding across layers.

Multi-Dimensional Thinking

Architects expand solution spaces by adding dimensions to debates. For example, speed vs. quality arguments are resolved by automation and shift-left testing. Similarly, cloud lock-in concerns are reframed by balancing switching costs against benefits like scalability. Gregor’s experience at an insurance company showed standardization (harmonization) enables innovation by locking down protocols while allowing diverse languages, trading one option for another. The Black-Scholes formula illustrates that options (e.g., scalability) are more valuable in uncertain environments, justifying architecture’s role.

Zooming In and Out

Zooming out reveals system characteristics, like layering’s trade-offs (clean dependencies vs. latency) or resilience in loosely coupled designs. Local optimization, as in pre-DevOps silos, often fails globally. Architects optimize globally, aligning teams via feedback cycles and value stream mapping. Zooming also applies to models: different abstractions (e.g., topographical vs. political maps) answer different questions, requiring architects to tailor models to stakeholders’ needs.

Architecture and Agility in Uncertainty

Gregor highlighted that architecture and agility thrive in uncertainty, providing options (e.g., scalability) and flexibility. Using a car metaphor, agility is the steering wheel, and architecture the engine—both are essential. Architects avoid binary thinking (e.g., “all containers”), embracing trade-offs in a multi-dimensional solution space to align with business needs.

Practical Takeaways

  • Connect Layers: Bridge technical and business strategy with clear communication.
  • Use Metaphors and Sketches: Simplify concepts to engage stakeholders.
  • Think Multi-Dimensionally: Reframe problems to expand solutions.
  • **Zoom In/Out: Optimize globally, tailoring abstractions to questions.
  • Embrace Uncertainty: Leverage architecture and agility to create valuable options.

Links

Hashtags: ##SocioTechnical #GregorHohpe #DevoxxGR2024 #ArchitectureMindset #PlatformStrategy

PostHeaderIcon [DevoxxGR2024] Socio-Technical Smells: How Technical Problems Cause Organizational Friction by Adam Tornhill

At Devoxx Greece 2024, Adam Tornhill delivered a compelling session on socio-technical smells, emphasizing how technical issues in codebases create organizational friction. Using behavioral code analysis, which combines code metrics with team interaction data, Adam demonstrated how to identify and mitigate five common challenges: architectural coordination bottlenecks, implicit team dependencies, knowledge risks, scaling issues tied to Brooks’s Law, and the impact of bad code on morale and attrition. Through real-world examples from codebases like Facebook’s Folly, Hibernate, ASP.NET Core, and Telegram for Android, he showcased practical techniques to align technical and organizational design, reducing waste and improving team efficiency.

Overcrowded Systems and Brooks’s Law

Adam introduced the concept of overcrowded systems with a story from his past, where a product company’s subsystem, developed by 25 people over two years, faced critical deadlines. After analysis, Adam’s team recommended scrapping the code and rewriting it with just five developers, delivering in two and a half months instead of three. This success highlighted Brooks’s Law (from The Mythical Man-Month, 1975), which states that adding people to a late project increases coordination overhead, delaying delivery. A visualization showed that beyond a certain team size, communication costs outweigh productivity gains. Solutions include shrinking teams to match work modularity or redesigning systems for higher modularity to support parallel work.

Coordination Bottlenecks in Code

Using behavioral code analysis on git logs, Adam identified coordination bottlenecks where multiple developers edit the same files. Visualizations of Facebook’s Folly C++ library revealed a file modified by 58 developers in a year, indicating a “god class” with low cohesion. Code smells like complex if-statements, lengthy comments, and nested logic confirmed this. Similarly, Hibernate’s AbstractEntityPersister class, with over 5,000 lines and 380 methods, showed poor cohesion. By extracting methods into cohesive classes (e.g., lifecycle or proxy), developers can reduce coordination needs, creating natural team boundaries.

Implicit Dependencies and Change Coupling

Adam explored inter-module dependencies using change coupling, a technique that analyzes git commit patterns to find files that co-evolve, revealing logical dependencies not visible in static code. In ASP.NET Core, integration tests showed high cohesion within a package, but an end-to-end Razor Page test coupled with four packages indicated low cohesion and high change costs. In Telegram for Android, a god class (ChatActivity) was a change coupling hub, requiring modifications for nearly every feature. Adam recommended aligning architecture with the problem domain to minimize cross-team dependencies and avoid “shotgun surgery,” where changes scatter across multiple services.

Knowledge Risks and Truck Factor

Adam discussed knowledge risks using the truck factor—the number of developers who can leave before a codebase becomes unmaintainable. In React, with 1,500 contributors, the truck factor is two, meaning 50% of knowledge is lost if two key developers leave. Vue.js has a truck factor of one, risking 70% knowledge loss. Visualizations highlighted files with low truck factors, poor code health, and high activity as onboarding risks. Adam advised prioritizing refactoring of such code to reduce key-person dependencies and ease onboarding, as unfamiliarity often masquerades as complexity.

Bad Code’s Organizational Impact

A study showed that changes to “red” (low-quality) code take up to 10 times longer than to “green” (high-quality) code, with unfamiliar developers needing 50% more time for small tasks and double for larger ones. A story about a German team perceiving an inherited codebase as a “mess” revealed that its issues stemmed from poor onboarding, not technical debt. Adam emphasized addressing root causes—training and onboarding—over premature refactoring. Bad code also lowers morale, increases attrition, and amplifies organizational problems, making socio-technical alignment critical.

Practical Takeaways

Adam’s techniques, supported by tools like CodeScene and research in his book Your Code as a Crime Scene, offer actionable insights:
Use Behavioral Code Analysis: Leverage git logs to detect coordination bottlenecks and change coupling.
Increase Cohesion: Refactor god classes and align architecture with domains to reduce team dependencies.
Mitigate Knowledge Risks: Prioritize refactoring high-risk code with low truck factors to ease onboarding.
Address Root Causes: Invest in onboarding to avoid mistaking unfamiliarity for complexity.
Visualize Patterns: Use tools to highlight socio-technical smells, enabling data-driven decisions.

Links:

PostHeaderIcon [PHPForumParis2023] Learn to Learn: From Junior Dev to Master – Aline Leroy

Aline Leroy, a developer who transitioned into tech three years ago, shared an inspiring session at Forum PHP 2023 on the art of learning as a developer. Drawing from her diverse background as an educator and special needs professional, Aline offered a unique perspective on overcoming the challenges of self-directed learning in programming. Her talk, infused with psychological and pedagogical insights, provided actionable strategies for junior developers to grow into confident professionals.

Overcoming Learning Challenges

Aline began by recounting her transition into development, initially struggling with the overwhelming volume of online resources. Starting with JavaScript, she faced self-doubt and slow progress, a common experience for new developers. Aline emphasized that learning to learn is a skill, requiring patience and structured approaches. She shared how breaking down complex concepts into manageable steps helped her gain confidence, a lesson she now applies to PHP development.

Psychological and Pedagogical Strategies

Drawing from her background, Aline introduced psychological concepts like incremental learning, where small, consistent efforts lead to significant progress. She referenced the “Learn to Learn” MOOC, advocating for focusing on the process rather than the end goal. By setting short-term objectives and celebrating small wins, Aline transformed her learning experience, making it less daunting. Her insights resonated with developers facing similar hurdles, offering a roadmap for sustained growth.