Posts Tagged ‘CrossPlatform’
[NDCOslo2024] Smarter, Not Harder: Scaling Without Burning Out in an Always-More Landscape – Marion Løken
Amid the relentless crescendo of expectations—ever-expanding portfolios, dwindling headcounts—Marion Løken, a product manager at FINN.no, chronicles a odyssey of astute adaptation. As FINN merged with Nordic kin like Blocket and DBA, Marion’s lean cadre of four developers and a designer scaled offerings from Norwegian dealer portals to pan-Nordic private and financial forays, all while safeguarding sanity. Her manifesto: intelligence over intensity, leveraging toolchains and toolboxes to transmute toil into triumph, ensuring expansion exhilarates rather than exhausts.
Marion’s narrative unfolds against FINN’s tectonic shift: from solitary insight apps to embedded analytics across platforms, reinventing for diverse demographics. This “more with less” maelstrom, she concedes, could crush spirits, yet a smarter ethos—component curation, documentation dynamism—drove delight. By embracing mainstream stacks like Kotlin and Spring, augmented by FINN’s Podium toggles, her team doubled revenues annually, sans burnout’s bite.
Cultivating Resilience: Buffers Against Overload
Stress, Marion posits, stems from workload, control, and reward imbalances. Her buffers: processes fortify all facets—planning preempts panic, frequent releases reclaim rhythm. Culture cascades calm: transparent retrospectives temper tensions, fostering feedback loops that affirm agency.
Tools tame tasks: reusable libraries liberate from reinvention, Swagger’s specs streamline specs. Marion’s metric: fun’s stability, tracked longitudinally, underscores sustainability’s success. Her heuristic: under duress, deliberate—rethink routines, not redouble efforts.
Toolbox Transformation: From Niche to Nimble
FINN’s evolution eschewed esoterica for ubiquity: Kotlin supplanted Kotlin Multiplatform, OpenAPI supplanted bespoke bindings. Marion marvels at Podium’s prowess—feature flags flipping functionalities fleetly—enabling A/B artistry without architectural upheaval. Documentation, once dormant, danced dynamically via auto-generated APIs, accelerating assimilation for newcomers.
This pivot propelled progress: a pricing tool, inherited and iterated, burgeoned from parity to prowess, yielding fiscal fruits. Marion’s mantra: mainstream multiplicity multiplies might, marrying maturity with maneuverability.
Embedding Efficiency: Innovation Amid Integration
Embedding insights into journeys demanded deft design: component catalogs curbed custom code, promoting parity across portals. Marion’s lean legion—four coders, one crafter—conquered complexity through collaboration, cross-pollinating with Nordic nests.
Her horizon: stress as signal, prompting smarter strides. By buffering buffers, teams transcend thresholds, turning “always more” into ample achievement.
Links:
[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:
[KotlinConf2023] Compose Multiplatform on iOS: Sharing UIs Across Ecosystems with Sebastian Aigner and Nikita Lipsky
At KotlinConf’23, Sebastian Aigner (Developer Advocate at JetBrains) and Nikita Lipsky (Software Developer for Kotlin at JetBrains) presented an exciting overview of Compose Multiplatform, focusing on its then-Alpha support for iOS. Their session detailed how this JetBrains initiative enables developers to write their user interface once in Kotlin and deploy it across Android, iOS, desktop, and web, fostering significant code sharing and development efficiency. The official documentation for Compose Multiplatform offers further insights.
The presentation began by recapping the classic Kotlin Multiplatform (KMP) use case, which allows sharing of business logic while retaining access to platform-specific APIs. Compose Multiplatform builds upon this by providing a solution for sharing the UI layer itself, addressing scenarios where building and maintaining separate native UIs for each platform is not feasible due to time, resources, or the desire for rapid market entry. While the talk focused on iOS and Android, the speakers emphasized that Compose Multiplatform also supports desktop (stabilized in late 2021) and web targets.
Architecture and Jetpack Compose Foundations
A key point underscored by Sebastian and Nikita was that Compose Multiplatform is built upon Jetpack Compose, Google’s modern declarative UI toolkit for Android, which is 100% Kotlin. This means developers familiar with Jetpack Compose can leverage their existing knowledge and skills to build UIs for iOS and other platforms. The JetBrains team collaborates closely with Google, regularly upstreaming changes to the Jetpack Compose repositories.
Nikita Lipsky delved into the architecture, explaining that official Jetpack Compose itself is already a Kotlin Multiplatform project at its core, with its lowest levels defining Kotlin Multiplatform sources. The composable function concept is an extension to the Kotlin language requiring compiler support, and the entire Compose system is managed by the Compose Runtime. For iOS, Compose Multiplatform renders UI elements by drawing directly onto a CAPI (Canvas API) provided by Skiko, a graphics library that abstracts over Skia (for Android and desktop) and CoreGraphics (for iOS). This allows for consistent rendering across platforms.
Live Demos and iOS Integration
The session featured live demonstrations showcasing the capabilities of Compose Multiplatform on iOS. Sebastian Aigner walked through a sample application, highlighting how standard Jetpack Compose code for UI elements, state management (using remember
), layouts (like Column
), and modifiers can be shared and run on iOS simulators and devices. He demonstrated features like text input, button interactions, and even integration with iOS-specific functionalities like the share sheet, emphasizing the goal of seamless interoperability.
The speakers also discussed the importance of providing solid accessibility integrations and ensuring smooth performance, even on high-refresh-rate displays, which is an ongoing area of focus for the Kotlin/Native and Compose Multiplatform teams. Interoperability with existing iOS UI code (SwiftUI and UIKit) was also presented as a key feature, allowing for gradual adoption. Developers can embed Compose Multiplatform views within existing SwiftUI applications or, conversely, embed native iOS views within a Compose Multiplatform UI. This flexibility is crucial for teams looking to integrate Compose into their established projects incrementally.
Getting Started and Future Outlook
Sebastian and Nikita provided clear guidance on how developers can start experimenting with Compose Multiplatform for iOS. They pointed to project templates, sample applications available on the Compose Multiplatform GitHub repository (including to-do list apps and code viewers), and updated KMP production samples that now include branches with Compose-based UI implementations. The new memory manager in Kotlin/Native was also mentioned as a significant improvement, simplifying multi-threaded programming for all Kotlin targets, including iOS.
While acknowledging that the iOS target was in Alpha and some areas were still works in progress, the overall message was one of excitement and a call to action for the community. They encouraged developers to explore the technology, provide feedback, and contribute to its evolution. The vision is a future where developers can agree on a delightful way to write UIs for all their target platforms using Kotlin.
Links:
[KotlinConf2019] Kotlin Multiplatform Programming: Present and Future with Dmitry Savvinov and Liliia Abdulina
Kotlin Multiplatform Programming (MPP) has been a significant focus for JetBrains, aiming to extend Kotlin’s reach beyond traditional JVM and Android development. At KotlinConf 2019, Dmitry Savvinov and Liliia Abdulina, both from the Kotlin team at JetBrains, delivered an insightful overview of MPP’s capabilities in version 1.3.X and offered a glimpse into its future direction. Dmitry Savvinov, a key contributor to Kotlin Contracts and heavily involved in MPP, brought his compiler expertise to the discussion. The official Kotlin language website, the central hub for MPP information, is kotlinlang.org.
Their talk was structured to cover the fundamentals of multiplatform projects, illustrate these basics with examples, provide guidelines for designing first multiplatform projects, and showcase a production-like application to demonstrate design principles in action. This comprehensive approach aimed to equip developers with the knowledge needed to start leveraging MPP effectively.
Core Concepts of Kotlin Multiplatform
Dmitry Savvinov and Liliia Abdulina began by explaining the core building blocks of Kotlin Multiplatform projects. These foundational concepts are crucial for understanding how code can be shared and specialized across different platforms:
* Source Sets: The fundamental unit of code organization in MPP. A project is typically structured with a commonMain
source set containing platform-agnostic Kotlin code. Platform-specific source sets (e.g., jvmMain
, jsMain
, iosMain
) contain code tailored for each target and can depend on commonMain
.
* Targets: These define the platforms the project will compile for, such as JVM, Android, JavaScript, iOS (Native), Linux, Windows, and macOS. Each target has its own compilations.
* Compilations: A compilation process for a specific target that produces the appropriate artifacts (e.g., JVM bytecode, JavaScript files, native executables).
* expect
and actual
Declarations: This powerful mechanism allows common code in commonMain
to declare an expect
class, function, or property. Platform-specific source sets must then provide an actual
implementation for that declaration, bridging the gap between shared logic and platform-specific APIs. For example, a common module might expect
a function to generate a UUID, and the JVM and Native modules would provide actual
implementations using their respective platform libraries.
These concepts enable developers to write shared business logic, data models, and algorithms once in commonMain
and then reuse them across multiple platforms, significantly reducing code duplication and improving consistency.
Designing and Implementing Multiplatform Projects
Beyond the basic syntax, Dmitry and Liliia provided guidance on how to approach the design of a multiplatform project. This involved discussing strategies for identifying what code can and should be shared, how to structure modules for optimal maintainability, and best practices for using expect
/actual
effectively.
They used toy examples to illustrate these basics in a clear and understandable manner, helping attendees grasp how these pieces fit together in a real project. The presentation then progressed to showcase a “more or less production-like application”. This larger example would have served to demonstrate how the design principles discussed could be applied to build a substantial, real-world multiplatform application, highlighting how to manage dependencies, handle platform-specific interactions, and structure a scalable MPP architecture. The focus was on providing practical insights that developers could apply to their own projects, whether starting from scratch or integrating MPP into existing applications.
The Trajectory of Kotlin Multiplatform: Beyond 1.3.X
While detailing the state of MPP in Kotlin 1.3.X, Dmitry Savvinov and Liliia Abdulina also looked towards its future development. At KotlinConf 2019, MPP was still evolving, with ongoing improvements to tooling, library support, and the overall developer experience. Their talk touched upon the roadmap for MPP, including planned enhancements to areas like Kotlin/Native (for performance and interoperability), library ecosystem growth, and further refinements to the build system and IDE support within IntelliJ IDEA and Android Studio.
The vision presented was one of Kotlin as a truly universal language, enabling developers to target a wide array of platforms with a unified codebase and skillset. The commitment from JetBrains to invest heavily in MPP was clear, with the aim of making it a robust and production-ready solution for cross-platform development. The session would have encouraged developers to explore MPP, provide feedback, and contribute to its growing ecosystem, reinforcing the community-driven aspect of Kotlin’s development.
Links:
[KotlinConf2019] Sharing Is Caring: Kotlin Multiplatform for Android Developers with Britt Barak
The vision of writing code once and running it across multiple platforms is a long-held dream in software development. Britt Barak, an experienced Android and Kotlin developer, and Google Developer Expert, brought this vision closer to reality for Android developers at KotlinConf 2019. Her talk, “Sharing Is Caring – Kotlin Multiplatform for Android Developers,” explored the exciting, albeit then-experimental, capabilities of Kotlin Multiplatform (KMP) and how it could revolutionize the way Android developers collaborate with teams working on iOS, backend, or JavaScript projects.
Britt Barak emphasized the common scenario where Android developers work alongside backend services or with iOS and JavaScript teams developing similar functionalities. The ability to share Kotlin code across these platforms promised significant savings in implementation time, testing effort, and overall development efficiency. Her session focused on creating a full-stack Kotlin project, demonstrating how to share code between an Android app and a backend Kotlin component, ultimately leading to more efficient and robust applications.
The Promise of Kotlin Multiplatform
Kotlin Multiplatform (KMP) allows developers to write common logic in Kotlin and compile it for various targets, including JVM (for Android and backend), JavaScript (for web frontends), and Native (for iOS and other native applications). Britt Barak highlighted the power of this approach: sharing business logic, data models, and even presentation logic (in some architectures) can drastically reduce redundancy and inconsistencies between different platform implementations.
The core idea is to isolate platform-agnostic code in a “common” module. This module can then be consumed by platform-specific modules (e.g., Android, iOS, JVM backend) which implement the platform-dependent parts, such as UI or interactions with platform-specific APIs. This separation allows teams to leverage Kotlin’s strengths across their entire stack while still catering to the unique requirements of each platform. Britt’s presentation aimed to show Android developers how they could take the lead in initiating such code-sharing efforts, benefiting not only their own workflow but also that of their teammates on other platforms.
Practical Implementation and Considerations
Britt Barak’s session was hands-on, guiding attendees through the process of setting up and building a Kotlin Multiplatform project. She covered key KMP concepts such as:
* Common Modules: Where shared Kotlin code resides, free of platform-specific dependencies.
* Platform-Specific Modules: Modules targeting specific platforms (Android, JVM, JS, Native) that can depend on common modules and implement platform-specific functionalities using expect
/actual
declarations.
* expect
and actual
Keywords: A powerful mechanism in KMP that allows common code to declare an expected functionality (expect
), which platform-specific modules then provide concrete implementations for (actual
). This is crucial for accessing platform-specific APIs (like device sensors, file systems, or UI elements) from shared code.
She demonstrated how to structure a project to share code effectively between an Android application and a backend Kotlin component, showcasing the potential for building more cohesive and maintainable full-stack applications. This practical approach would have involved setting up the build system (Gradle), defining dependencies, and writing shared business logic that could be consumed by both the Android client and the server. The goal was to illustrate how to build “more efficient and robust applications” through strategic code sharing.
Navigating the Experimental Landscape and Community Support
At the time of KotlinConf 2019, Kotlin Multiplatform was still an experimental feature. Britt Barak acknowledged this, preparing attendees for a landscape where documentation might sometimes be a bit dated, and tooling was rapidly evolving. However, she also pointed to the strong and growing community support as a significant asset. The official Kotlin Slack and various online forums were highlighted as valuable resources for troubleshooting and learning from others’ experiences.
She shared the sentiment that KMP was gaining popularity in a positive way, with many developers interested and actively contributing to its growth. This collaborative environment was seen as a good sign for the future development and stabilization of KMP. Britt encouraged developers to embrace this journey, start experimenting with multiplatform projects, and contribute to the community by sharing their own code and experiences. Her message was clear: despite its experimental nature, Kotlin Multiplatform offered a powerful and awesome way to achieve cross-platform code sharing, and it was a “really good time to jump on on the ride”.
Links:
[KotlinConf2017] My Transition from Swift to Kotlin
Lecturer
Hector Matos is a senior iOS developer at Twitter, with extensive experience in Swift and a growing expertise in Kotlin for Android development. Raised in Texas, Hector maintains a technical blog at KrakenDev.io, attracting nearly 10,000 weekly views, and has spoken internationally on iOS and Swift across three continents. His passion for mobile UI/UX drives his work on high-quality applications, and his transition from Swift to Kotlin reflects his commitment to exploring cross-platform development solutions.
Abstract
The similarities between Swift and Kotlin offer a unique opportunity to unify mobile development communities. This article analyzes Hector Matos’s presentation at KotlinConf 2017, which details his transition from Swift to Kotlin and compares their features. It explores the context of cross-platform mobile development, the methodology of comparing language constructs, key differences in exception handling and extensions, and the implications for fostering collaboration between iOS and Android developers. Hector’s insights highlight Kotlin’s potential to bridge divides, enhancing productivity across mobile ecosystems.
Context of Cross-Platform Mobile Development
At KotlinConf 2017, Hector Matos shared his journey from being a dedicated Swift developer to embracing Kotlin, challenging his initial perception of Android as “the dark side.” As a senior iOS developer at Twitter, Hector’s expertise in Swift, a language designed for iOS, provided a strong foundation for evaluating Kotlin’s capabilities in Android development. The context of his talk reflects the growing need for cross-platform solutions in mobile development, where developers seek to leverage skills across iOS and Android to reduce fragmentation and improve efficiency.
Kotlin’s rise, particularly after Google’s 2017 endorsement for Android, positioned it as a counterpart to Swift, with both languages emphasizing type safety and modern syntax. Hector’s presentation aimed to bridge the divide between these communities, highlighting similarities that enable developers to transition seamlessly while addressing differences that impact development workflows. His personal narrative, rooted in a passion for UI/UX, underscored the potential for Kotlin and Swift to unify mobile development practices, fostering collaboration in a divided ecosystem.
Methodology of Language Comparison
Hector’s methodology involved a detailed comparison of Swift and Kotlin, focusing on their shared strengths and distinct features. Both languages offer type-safe, concise syntax, reducing boilerplate and enhancing readability. Hector demonstrated how Kotlin’s interfaces with default implementations mirror Swift’s protocol extensions, allowing developers to provide default behavior for functions. For example, Kotlin enables defining function bodies within interface declarations, similar to Swift’s ability to extend protocols, streamlining code reuse and modularity.
He also explored structural similarities, such as both languages’ support for functional programming constructs like map and filter. Hector’s approach included live examples, showcasing how common tasks, such as data transformations, are implemented similarly in both languages. By comparing code snippets, he illustrated how developers familiar with Swift can quickly adapt to Kotlin, leveraging familiar paradigms to build Android applications with minimal learning overhead.
Key Differences and Exception Handling
Despite their similarities, Hector highlighted critical differences, particularly in exception handling. Swift treats exceptions as first-class citizens, using a do-try-catch
construct that allows multiple try
statements within a single block, enabling fine-grained error handling without nested blocks. Kotlin, inheriting Java’s approach, relies on traditional try-catch
blocks, which Hector noted can feel less elegant due to potential nesting. This difference impacts developer experience, with Swift offering a more streamlined approach for handling errors in complex workflows.
Another distinction lies in Kotlin’s handling of extensions, which are declared in separate files without requiring curly braces, unlike Swift’s protocol extensions. This syntactic difference enhances readability in Kotlin, allowing developers to organize extensions cleanly. Hector’s analysis emphasized that while both languages achieve similar outcomes, these differences influence code organization and error management strategies, requiring developers to adapt their mental models when transitioning between platforms.
Implications for Mobile Development
Hector’s presentation has significant implications for mobile development, particularly in fostering collaboration between iOS and Android communities. By highlighting Swift and Kotlin’s similarities, he demonstrated that developers can leverage existing skills to work across platforms, reducing the learning curve and enabling cross-platform projects. This unification is critical for companies like Twitter, where consistent UI/UX across iOS and Android is paramount, and Kotlin’s interoperability with Java ensures seamless integration with existing Android ecosystems.
The broader implication is the potential for a unified mobile development culture. Hector’s call for community engagement, evidenced by his interactive Q&A, encourages developers to share knowledge and explore both languages. As Kotlin and Swift continue to evolve, their shared design philosophies could lead to standardized tools and practices, enhancing productivity and reducing fragmentation. For developers, this transition opens opportunities to work on diverse projects, while for the industry, it promotes innovation in mobile application development.
Conclusion
Hector Matos’s presentation at KotlinConf 2017 offered a compelling case for bridging the Swift and Kotlin communities through their shared strengths. By comparing their syntax, exception handling, and extension mechanisms, Hector illuminated Kotlin’s potential to attract Swift developers to Android. The methodology’s focus on practical examples and community engagement underscores the feasibility of cross-platform expertise. As mobile development demands increase, Hector’s insights pave the way for a unified approach, leveraging Kotlin’s and Swift’s modern features to create robust, user-focused applications.