Git Product home page Git Product logo

d1to2fix's Introduction

d1to2fix

This is a simple tool based on libdparse to automatically perform some final conversion from D1 to D2.

Some of the conversions performed:

  • Convert all delegates into scope delegates to reduce GC allocations from uncalled closures. For now aliased delegate types are not converted as it requires more complicated symbol processing. As a result, when an alias to a delegate is used as function parameter, /* d1to2fix_inject: scope */ should be used.
  • Convert D1-style manifest constants (const Name = Value;) to enum in struct and static immutable everywhere else.
  • Convert all this mentions inside struct bodies to pointers to match D1.
  • Inject some D2 attributes based on special comments /* d1to2fix_inject: ... */ (only const, inout and scope supported for now).

Building

To build just type make or use dub directly. To build a Debian package type make deb (you need fpm for this to work though).

Docker

If you want to use Docker for testing without having to install all the dependencies in your personal environment, you can easily do so, an image definition is provided in the docker/ directory.

To build you can use docker build -t d1to2fix docker and then to run:

docker run -ti --rm -v $PWD:/d1to2fix -w /d1to2fix d1to2fix [<command>]

If you don't enter a <command> you'll get a shell inside the image to do whatever you want. Otherwise you can just do a one run of, for example, dub build inside Docker.

If you don't want to run stuff as root inside Docker, you can use a pre-defined docker user (UID 65456) with -u docker, but you'll have to make sure your files are accesible to that user.

d1to2fix's People

Contributors

mihails-strasuns-sociomantic avatar leandro-lucarella-sociomantic avatar mathias-lang-sociomantic avatar

Watchers

James Cloos 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.