# Jorge Castillo

You'll find all my tech posts here.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Diving into Mosaic for Jetpack Compose

DevFeed: [Diving into Mosaic for Jetpack Compose](<https://devfeed.tech/articles/diving-into-mosaic-for-jetpack-compose-27466.md>)

Original publisher: [Read original article](<https://jorgecastilloprz.github.io/diving-into-mosaic>)

Author: Jorge Castillo

Published: 2022-04-26T12:00:00Z

Content type: article

Language: en

Sources: [Jorge Castillo](<https://devfeed.tech/sources/jorge-castillo.md>)

Topics: [Jetpack Compose](<https://devfeed.tech/topics/jetpack-compose.md>), [client library](<https://devfeed.tech/topics/client-library.md>), [Compose Compiler](<https://devfeed.tech/topics/compose-compiler.md>), [User Interfaces](<https://devfeed.tech/topics/user-interfaces.md>)

Tags: [2022](<https://devfeed.tech/tags/2022.md>), [case-study](<https://devfeed.tech/tags/case-study.md>), [client-library](<https://devfeed.tech/tags/client-library.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [compose](<https://devfeed.tech/tags/compose.md>), [compose-compiler](<https://devfeed.tech/tags/compose-compiler.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [jetpack](<https://devfeed.tech/tags/jetpack.md>), [jetpack-compose](<https://devfeed.tech/tags/jetpack-compose.md>), [library](<https://devfeed.tech/tags/library.md>), [overview](<https://devfeed.tech/tags/overview.md>), [runtime](<https://devfeed.tech/tags/runtime.md>)

### AI overview

Mosaic shows how a client library can use the Jetpack Compose compiler and runtime to build console UI. Its `TextNode` and `BoxNode` represent text and row or column containers; each node measures, lays out, and renders itself. A `MosaicNodeApplier` builds and updates the tree by delegating child insertions, removals, and moves to the nodes. `runMosaic` creates the root, `Recomposer`, and `Composition`, then drives recomposition with a coroutine context, `BroadcastFrameClock`, and a loop that sends frames and renders output when requested. A global snapshot write observer also enables state changes outside snapshots to trigger notifications. The excerpt's counter example updates Compose state every 250 ms, with the UI recomposing to reflect it. Mosaic is presented as a case study; the excerpt does not cover all library details.

### Source excerpt

Overview on how to create a client library for the Compose compiler and runtime.

## Composed modifiers in Jetpack Compose

DevFeed: [Composed modifiers in Jetpack Compose](<https://devfeed.tech/articles/composed-modifiers-in-jetpack-compose-27464.md>)

Original publisher: [Read original article](<https://jorgecastilloprz.github.io/composed-modifiers-in-jetpack-compose>)

Author: Jorge Castillo

Published: 2022-04-04T10:00:00Z

Content type: tutorial

Language: en

Sources: [Jorge Castillo](<https://devfeed.tech/sources/jorge-castillo.md>)

Topics: [Jetpack Compose](<https://devfeed.tech/topics/jetpack-compose.md>), [User Interfaces](<https://devfeed.tech/topics/user-interfaces.md>), [context](<https://devfeed.tech/topics/context.md>), [factory function](<https://devfeed.tech/topics/factory-function.md>), [Library](<https://devfeed.tech/topics/library.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [compose](<https://devfeed.tech/tags/compose.md>), [compose-ui](<https://devfeed.tech/tags/compose-ui.md>), [context](<https://devfeed.tech/tags/context.md>), [extension-function](<https://devfeed.tech/tags/extension-function.md>), [factory-function](<https://devfeed.tech/tags/factory-function.md>), [jetpack](<https://devfeed.tech/tags/jetpack.md>), [jetpack-compose](<https://devfeed.tech/tags/jetpack-compose.md>), [modifiers](<https://devfeed.tech/tags/modifiers.md>), [state](<https://devfeed.tech/tags/state.md>), [stateful](<https://devfeed.tech/tags/stateful.md>), [stateless](<https://devfeed.tech/tags/stateless.md>)

### AI overview

This tutorial explains the difference between standard and composed modifiers in Jetpack Compose. Standard modifiers use extension functions and are stateless, while composed modifiers support state and access to composition context by creating them within a Composition.

### Source excerpt

Learn about composed modifiers and compare those to standard ones.

## A letter to my younger self

DevFeed: [A letter to my younger self](<https://devfeed.tech/articles/a-letter-to-my-younger-self-27462.md>)

Original publisher: [Read original article](<https://jorgecastilloprz.github.io/a-letter-to-my-younger-self>)

Author: Jorge Castillo

Published: 2021-03-06T10:00:00Z

Content type: opinion

Language: en

Sources: [Jorge Castillo](<https://devfeed.tech/sources/jorge-castillo.md>)

Topics: [Learning](<https://devfeed.tech/topics/learning.md>), [intrinsic motivation](<https://devfeed.tech/topics/intrinsic-motivation.md>)

Tags: [advice](<https://devfeed.tech/tags/advice.md>), [articles](<https://devfeed.tech/tags/articles.md>), [axe](<https://devfeed.tech/tags/axe.md>), [books](<https://devfeed.tech/tags/books.md>), [burnout](<https://devfeed.tech/tags/burnout.md>), [business](<https://devfeed.tech/tags/business.md>), [career](<https://devfeed.tech/tags/career.md>), [code](<https://devfeed.tech/tags/code.md>), [communication](<https://devfeed.tech/tags/communication.md>), [crunch](<https://devfeed.tech/tags/crunch.md>), [exercise](<https://devfeed.tech/tags/exercise.md>), [failure](<https://devfeed.tech/tags/failure.md>), [family](<https://devfeed.tech/tags/family.md>), [feedback](<https://devfeed.tech/tags/feedback.md>), [flexibility](<https://devfeed.tech/tags/flexibility.md>), [health](<https://devfeed.tech/tags/health.md>), [hobbies](<https://devfeed.tech/tags/hobbies.md>), [knowledge](<https://devfeed.tech/tags/knowledge.md>), [learning](<https://devfeed.tech/tags/learning.md>), [soft-skills](<https://devfeed.tech/tags/soft-skills.md>)

### AI overview

The author's advice centers on building a sustainable development career through curiosity, humility, communication, and care for personal well-being. Ask questions, accept feedback, seek mentors, share knowledge, and review code constructively. Focus on delivering useful work, listen to business needs, make progress visible, and choose worthwhile disagreements; be willing to remove features or offer alternatives when plans or deadlines are unrealistic. Treat side projects and learning as hobbies only while they remain enjoyable, and make room for non-work interests, rest, and relationships. The author also recommends discussing compensation and performance honestly, prioritizing work-life balance and mental health, and embracing failure without demanding perfection. These are personal reflections, not a prescribed process, and the author notes that applying them can be difficult.

### Source excerpt

Just some advice I would give to my younger self today.

## Sealed interfaces in Kotlin

DevFeed: [Sealed interfaces in Kotlin](<https://devfeed.tech/articles/sealed-interfaces-in-kotlin-27470.md>)

Original publisher: [Read original article](<https://jorgecastilloprz.github.io/sealed-interfaces-kotlin>)

Author: Jorge Castillo

Published: 2021-03-06T10:00:00Z

Content type: article

Language: en

Sources: [Jorge Castillo](<https://devfeed.tech/sources/jorge-castillo.md>)

Topics: [sealed interface](<https://devfeed.tech/topics/sealed-interface.md>), [interface](<https://devfeed.tech/topics/interface.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>)

Tags: [1-5](<https://devfeed.tech/tags/1-5.md>), [api](<https://devfeed.tech/tags/api.md>), [data-class](<https://devfeed.tech/tags/data-class.md>), [enum](<https://devfeed.tech/tags/enum.md>), [exhaustive](<https://devfeed.tech/tags/exhaustive.md>), [experimental](<https://devfeed.tech/tags/experimental.md>), [groovy](<https://devfeed.tech/tags/groovy.md>), [hierarchy](<https://devfeed.tech/tags/hierarchy.md>), [interfaces](<https://devfeed.tech/tags/interfaces.md>), [java](<https://devfeed.tech/tags/java.md>), [keep](<https://devfeed.tech/tags/keep.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-compiler](<https://devfeed.tech/tags/kotlin-compiler.md>), [sealed](<https://devfeed.tech/tags/sealed.md>)

### AI overview

Kotlin 1.5 introduces experimental sealed interfaces, allowing implementations in different files within the same module while keeping the compiler able to check exhaustive `when` expressions. The article explains that sealed interfaces let library APIs expose a contract without exposing internal implementations, and let enums or other types participate in multiple sealed hierarchies. In the error examples, this avoids wrapper cases and nested `when` checks required by the sealed-class approach; alternatively, individual cases can implement multiple sealed interfaces to control which hierarchies they join. The article cautions that the feature and relaxed location rule are experimental, and shows enabling language and API version 1.5 in Gradle Kotlin options to try them.

### Source excerpt

Short overview of the sealed interfaces coming up in Kotlin 1.5.

## Tracking side effects at compile time with suspend

DevFeed: [Tracking side effects at compile time with suspend](<https://devfeed.tech/articles/tracking-side-effects-at-compile-time-with-suspend-27471.md>)

Original publisher: [Read original article](<https://jorgecastilloprz.github.io/tracking-side-effects-with-suspend>)

Author: Jorge Castillo

Published: 2020-10-10T10:00:00Z

Content type: article

Language: en

Sources: [Jorge Castillo](<https://devfeed.tech/sources/jorge-castillo.md>)

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Functional programming](<https://devfeed.tech/topics/functional-programming.md>), [Declarative programming](<https://devfeed.tech/topics/declarative-programming.md>), [Concurrency](<https://devfeed.tech/topics/concurrency.md>), [Jetpack Compose](<https://devfeed.tech/topics/jetpack-compose.md>)

Tags: [all-kotlin-posts-including-the-fp-ones](<https://devfeed.tech/tags/all-kotlin-posts-including-the-fp-ones.md>), [android](<https://devfeed.tech/tags/android.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [compose](<https://devfeed.tech/tags/compose.md>), [coroutine](<https://devfeed.tech/tags/coroutine.md>), [declarative](<https://devfeed.tech/tags/declarative.md>), [functional-programming](<https://devfeed.tech/tags/functional-programming.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [suspend](<https://devfeed.tech/tags/suspend.md>)

### AI overview

The article explains suspend as a Kotlin standard-library mechanism that makes effects visible to the compiler and restricts them to coroutine environments prepared to execute those effects. It relates this model to deferred execution in Kotlin Sequences and runtime interpretation and optimization in Jetpack Compose.

### Source excerpt

Thinking of suspend as a Kotlin stdlib mechanism for flagging and tracking effects at compile time.

## Kotlin Continuations

DevFeed: [Kotlin Continuations](<https://devfeed.tech/articles/kotlin-continuations-27465.md>)

Original publisher: [Read original article](<https://jorgecastilloprz.github.io/digging-into-kotlin-continuations>)

Author: Jorge Castillo

Published: 2020-09-03T11:00:00Z

Content type: article

Language: en

Sources: [Jorge Castillo](<https://devfeed.tech/sources/jorge-castillo.md>)

Topics: [suspend function](<https://devfeed.tech/topics/suspend-function.md>), [Coroutines](<https://devfeed.tech/topics/coroutines.md>), [async](<https://devfeed.tech/topics/async.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [IntelliJ IDEA](<https://devfeed.tech/topics/intellij-idea.md>)

Tags: [1-3](<https://devfeed.tech/tags/1-3.md>), [android](<https://devfeed.tech/tags/android.md>), [api](<https://devfeed.tech/tags/api.md>), [apis](<https://devfeed.tech/tags/apis.md>), [arrow](<https://devfeed.tech/tags/arrow.md>), [async](<https://devfeed.tech/tags/async.md>), [asynchronous](<https://devfeed.tech/tags/asynchronous.md>), [blocking](<https://devfeed.tech/tags/blocking.md>), [boolean](<https://devfeed.tech/tags/boolean.md>), [bridge](<https://devfeed.tech/tags/bridge.md>), [bytecode](<https://devfeed.tech/tags/bytecode.md>), [callback](<https://devfeed.tech/tags/callback.md>), [cancellation](<https://devfeed.tech/tags/cancellation.md>), [class](<https://devfeed.tech/tags/class.md>), [clicks](<https://devfeed.tech/tags/clicks.md>), [compile](<https://devfeed.tech/tags/compile.md>), [control](<https://devfeed.tech/tags/control.md>), [flow](<https://devfeed.tech/tags/flow.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [program](<https://devfeed.tech/tags/program.md>)

### AI overview

Kotlin compiles `suspend` functions into continuation-passing calls: each receives a `Continuation` that carries coroutine context and resumes execution with a success or failure result. Generated state machines and saved stack-frame state let execution pause at suspension points and continue later. Java can call the generated functions with an explicit continuation, but Kotlin's `Result` inline class complicates that route; the excerpt also describes bridging through `CompletableFuture`, calling coroutine builders from Java, or exposing Kotlin wrapper functions. For callback APIs, `suspendCoroutine` can resume a one-shot continuation, so listeners must be detached after use. The excerpt recommends `suspendCancellableCoroutine` when cancellation cleanup is needed; for repeated user events, it points to stream-based approaches such as `callbackFlow` or Arrow Fx `Stream.cancellable`.

### Source excerpt

Continuations represent the rest of a program. They are a form of control flow.