Coder Social home page Coder Social logo

macros_example's Introduction

An package to use as a starting point for trying out Dart macros.

SDK setup

First, you need to ensure your SDK is compatible with this package, and also that the versions of the various dependencies are lined up. You can use either a released dev SDK or a local build of the SDK.

Released dev SDK

To use a released Dev SDK, look at the pubspec.yaml file in this repo and download exactly the version you see set in the environment constraint (which should also match the ref you see in each of the dependencies). Then run a pub get.

Local SDK build

To use a local SDK, open up the pubspec_overrides.yaml file, uncomment all the lines in it, and update the paths to point at your local SDK. Make sure you do a build of your local SDK as well.

In this setup, you may find the APIs have changed and you get some errors. If so feel free to update things, as well as the SDK versions in the pubspec.yaml file, and send a PR to update. Or, file an issue on this repo.

Running the example

You can run the example under bin normally on the Dart VM, by passing --enable-experiment=macros. So the full command would be:

dart --enable-experiment=macros bin/auto_to_string.dart

You can also run/debug from your IDE using the instructions below.

Setting up your IDE

VS Code

You will need to set the "dart.experimentalMacroSupport": true, option in your VS Code settings (it's already set in .vscode/settings.json for this project).

To run/debug from VS Code, you will need to add "--enable-experiment=macros" to toolArgs in your .vscode/launch.json (it's already done for this project).

To run this example, open bin/auto_to_string.dart and press F5 (or click the Run/Debug CodeLens links).

Note that support here is still very early days, so please file issues as you find them.

Intellij

TODO: Add instructions once available

macros_example's People

Contributors

jakemac53 avatar dantup avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.