Skip to content

Instantly share code, notes, and snippets.

View kevmoo's full-sized avatar
🤘
Crankin!

Kevin Moore kevmoo

🤘
Crankin!
View GitHub Profile
@kevmoo
kevmoo / dart_sdk_isolate_stuff.md
Created April 12, 2026 05:39
SDK Isolate as of Dart 3.10

Isolate groups in Dart (introduced in version 2.15) allow isolates to share code and some memory structures, significantly increasing the efficiency of communication. Based on my investigation of the Dart SDK's runtime implementation and documentation, here is a summary of what is efficient to send:

1. Objects Shared by Reference ($O(1)$ cost)

When isolates are in the same isolate group (which is the default for isolates created via Isolate.spawn()), the following objects are shared by reference rather than copied:

  • All Strings: In the Dart VM, all strings are considered "deeply immutable" and are shared by reference.
  • Primitive Types: bool, int, double, and Null.
  • Constants: Any object created with the const keyword.
  • Special System Objects: SendPort, Capability, RegExp, StackTrace, and Type.
  • Deeply Immutable Instances: Objects of classes annotated with @pragma('vm:deeply-immutable').
  • Stateless Closures: Closures that do not capture any mutable

Canonical's Flutter-based projects for Ubuntu are primarily hosted under the official Canonical organization on GitHub, with some community-driven or experimental projects living under the Ubuntu Flutter Community organization.

Below are the key repositories for the major Ubuntu components written in Flutter:

Core Ubuntu Desktop Components

  • Ubuntu Desktop Provision (Installer):
    This repository contains the source for the modern Ubuntu installer (the one used in Ubuntu 24.04 LTS and later) and the initial setup wizard.
    github.com/canonical/ubuntu-desktop-provision
  • App Center:
@kevmoo
kevmoo / json_dart_thinking.md
Last active April 5, 2026 20:35
Pondering better json things in dart

JSON serialization in the Dart SDK is a sophisticated system that balances platform-native capabilities with cross-platform consistency. Below is an analysis of its inner workings, platform specializations, and a proposal for a streaming API.

1. How JSON Serialization Works in the SDK

The core of JSON serialization in dart:convert is built around a Visitor Pattern implemented in the internal _JsonStringifier class.

  • Encoder (JsonEncoder): Traverses the object graph. Primitives (num, String, bool, Null) and standard containers (List, Map) are handled directly. For other objects, it calls toEncodable (defaulting to .toJson()), which is expected to return a serializable object.
  • Specializations: The SDK provides _JsonStringStringifier (for String output) and _JsonUtf8Stringifier (for direct List<int> output). The UTF-8 version is highly optimized to avoid intermediate string allocations by writing directly to byte buffers.
  • Decoder (JsonDecoder): Us
@kevmoo
kevmoo / kevmoo-cli.md
Created February 27, 2026 16:27
kevmoo cli setup crazy

📂 Managing Dotfiles with a Bare Git Repository

This setup allows for managing configuration files (dotfiles) directly in the $HOME directory using Git, without the need for symlinks, specialized management tools, or messy directory structures.

🚀 The Implementation

The core of the system is a bare Git repository located at ~/.dotfiles/. Unlike a standard repository, a bare repo doesn't have a default working directory. We manually point its "working tree" to $HOME using a simple shell

@kevmoo
kevmoo / SKILL.md
Last active January 20, 2026 06:39
pkg:checks migration SKILLZ!
@kevmoo
kevmoo / main.dart
Last active May 22, 2025 09:41
Negative zero and simplifying Dart code
void main() {
// Define different scenarios for t5 using Dart records
// (String name, double t5_value, String expected_behavior)
final List<(String name, double t5Value, String expectedBehavior)> scenarios =
[
('t5 is a regular number', 1.0, 'Simplification is okay'),
(
't5 is positive Infinity',
double.infinity,
'Simplification breaks due to NaN',
@kevmoo
kevmoo / main.dart
Created March 6, 2025 20:27
Using emoji!
import 'package:flutter/material.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
@kevmoo
kevmoo / index.html
Created September 5, 2024 22:28
kevmoo.com
<!DOCTYPE html>
<html lang="en-US" xml:lang="en-US" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Kevin Moore - Google Product Manager for Flutter and Dart</title>
<meta name="viewport" content="width=device-width"/>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
<meta content="Kevin Moore" property="og:title"/>
<meta name="description" content="Product manager at Google working on Flutter and Dart."/>
<meta content="https://kevmoo.com" property="og:url"/>
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
Graphics Feature Status
=======================
* Canvas: Hardware accelerated
* Canvas out-of-process rasterization: Enabled
* Direct Rendering Display Compositor: Disabled
* Compositing: Hardware accelerated
* Multiple Raster Threads: Enabled
* OpenGL: Enabled
* Rasterization: Hardware accelerated
* Raw Draw: Disabled
@kevmoo
kevmoo / main.dart
Last active March 8, 2023 00:00
left shift dart2js
void main() {
for (var i = 0; i < 64; i++) {
print([i, 1 << i].join('\t'));
}
}