Code Monkey home page Code Monkey logo

tupleinator's Introduction

tupleinator

have a lot of zig code that's still in 0.5.0-land, are you sure you're ready for 0.6.0? have you done your research and found out how energy intensitve it is to replace every warn() call? have i got the tool for you!

zig made a large (only if you're an std.debug.warn/print-debugging addict like me) breaking change that removed varargs and replaced them by tuples throughout all of std.fmt some time ago between 0.5 and 0.6, and i got too lazy to fix every instance of warn(), so i made a tool for it

// old (0.5.0)
warn("test {} {} {}", a, b, c);

// new (0.6.0)
warn("test {} {} {}", .{a, b, c});

it might be ok for 3 warns in a bit of code but then you look at me writing a toy compiler and you have as many warns as there are instructions in x86

selling points:

  • python 3
  • very bad code, unmaintainable code, to the public domain, for everyone
  • this won't get all warn calls. manual tinkering required
  • generated code needs a zig fmt pass

how use

python3 ./tupleinator.py path/to/unenlightened/code.zig > enlightened_code.zig

# profit
mv enlightened_code.zig path/to/unenlightened/code.zig

tupleinator's People

Contributors

lun-4 avatar

Stargazers

 avatar

Watchers

 avatar  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.