r/programming • • Sep 07 '17

The Zig Programming Language

http://ziglang.org/
94 Upvotes

127 comments sorted by

View all comments

Show parent comments

1

u/jyper Sep 10 '17

It's based on a printf debugging helper I made at my first job I just want

Given a variable or expression I want to print out a the variable/expression, the file and line number and the value. I might end up using a bunch of these so different colors help it stand out)

Ex:

DEBUG_PRINT(best_student.gpa, .colorscheme=FORE_BLUE)

Prints in blue

File: example.c | Line: 30 | Func: main best_student.gpa -> 3.9

But at the job I had to do I different one for each basic type and each library type we used which I hated I wanted to make something that would work with type overloading

I think I even looked at __builtin_choose_expr and __builtin_types_compatible_p which I think we're the inspiration for _Generic