Google discontinuing work on Dart macros

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

CodeRabbit: AI Code Reviews for Developers
Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.
coderabbit.ai
featured
Nutrient - The #1 PDF SDK Library
Bad PDFs = bad UX. Slow load times, broken annotations, clunky UX frustrates users. Nutrient’s PDF SDKs gives seamless document experiences, fast rendering, annotations, real-time collaboration, 100+ features. Used by 10K+ devs, serving ~half a billion users worldwide. Explore the SDK for free.
nutrient.io
featured
  1. build

    A build system for Dart written in Dart (by dart-lang)

    I agree, Dart's public-facing codegen system (build_runner) leaves a lot to be desired. (In part the problem is that Dart uses a separate system inside Google.)

    However, this is a topic of active work for the Dart team: https://github.com/dart-lang/build/issues/3800. I'm sure they would welcome your feedback, particularly if you have examples you can share.

    You're also always welcome to reach out to me if you have Flutter/Dart concerns. I founded the Flutter project (and briefly led the Dart team) and care a great deal about customer success with both. [email protected] reaches me.

  2. CodeRabbit

    CodeRabbit: AI Code Reviews for Developers. Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.

    CodeRabbit logo
  3. sdk

    The Dart SDK, including the VM, JS and Wasm compilers, analysis, core libraries, and more.

    > Runtime introspection (e.g., reflection) makes it difficult to perform the tree-shaking optimizations that allow us to generate smaller binaries.

    Does anyone have any more information on How Dart actually does Tree Shaking? And what is "Tree Shakeable"? This issue is still open on Github https://github.com/Dart-lang/sdk/issues/33920.

    I think this quote accurately sums things up

    >In fact the only references I can find anywhere to this feature is on the Dart2JS page:

    >Don’t worry about the size of your app’s included libraries. The dart2js tool performs tree shaking to omit unused classes, functions, methods, and so on. Just import the libraries you need, and let dart2js get rid of what you don’t need.

    >This has led customers to wild assumptions around what is and what is not tree-shakeable, and without any clear guidance to patterns that allow or disallow tree-shaking. For example internally, many large applications chose to store configurable metadata in a hash-map:

  4. Flutter

    Flutter makes it easy and fast to build beautiful apps for mobile and beyond

    https://github.com/flutter/flutter/blob/master/docs/contribu...

    What exactly all this means as a dev using Dart, I don't know. In general I just assume the tree shaking works and ignore it. :)

    The Dart tech lead has done some writings, but none seem to cover the exact details of treeshaking:

  5. codable

    RFC: Serialization protocol for Dart

    I think after reading through the blog post the reasons they have made a whole lot of sense and sounded like that of a mature engineering team to me.

    There are a bunch of other interesting approaches here they can look at. Improving the code generation story more generally, shopping the augmentations feature (basically C#’s partial classes) and getting more serious about serialization all feel like sensible directions from here.

    There is a really interesting community proposal at the moment on the serialization front that I think would solve a lot of the issues that got people so excited about macros in the first place here: https://github.com/schultek/codable/blob/main/docs/rfc.md

  6. FlatBuffers

    FlatBuffers: Memory Efficient Serialization Library

    Oh how I enjoy trying to compile and use projects where they use some complex home brew codegen system often written in a different language entirely [1]. Luckily they often use Python as part of some core build step which never breaks compatability in their regex librwry [2].

    Yes macros can be a pain and should be limited, but in my experience, a couple hundred lines of macros replaces many thousands of lines code generators with complicated baroque build system integrations (ahem ROS2). The tradeoff is even worse when the language supports templates and compile time operations which can usually replace macros with even less code and are easier to understand. Though at least Go supports codegen properly with support in its official tooling.

    1: https://github.com/google/flatbuffers/blob/master/src/idl_ge...

  7. CPython

    The Python programming language

    2: https://github.com/python/cpython/issues/94675

  8. KhaHotReload

    Hot reload for Kha/Haxe js targets

    Macros give their own kind of power, and it's a tough call to give that up for runtime hot-reloading. Languages like Haxe have macros, but also have hot reloading capabilities that typically are supported in certain game frameworks. You probably don't want to mix them together, but it's also a good development process to have simpler compilation targets that enable more rapid R&D, and then save macros for larger/more comprehensive builds.

    https://haxe.org/manual/macro.html

    https://github.com/RblSb/KhaHotReload

  9. Nutrient

    Nutrient - The #1 PDF SDK Library. Bad PDFs = bad UX. Slow load times, broken annotations, clunky UX frustrates users. Nutrient’s PDF SDKs gives seamless document experiences, fast rendering, annotations, real-time collaboration, 100+ features. Used by 10K+ devs, serving ~half a billion users worldwide. Explore the SDK for free.

    Nutrient logo
  10. freezed

    Code generation for immutable classes that has a simple syntax/API without compromising on the features.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Flutter x Amplify AI Kit Recipe App Development

    3 projects | dev.to | 10 Feb 2025
  • React vs Flutter

    2 projects | dev.to | 30 Jun 2024
  • Checkout Ensemble for native mobile and webapps – now with close to 1M devices

    2 projects | news.ycombinator.com | 27 Feb 2024
  • SQLite Isn't Enough

    8 projects | news.ycombinator.com | 7 Feb 2024
  • Need help on iOS

    1 project | /r/flutterhelp | 10 Dec 2023

Did you know that Dart is
the 20th most popular programming language
based on number of references?