Lazy is basically just a library full of functions I'm too... Well, lazy, to write again.
With things like try/catch
and vectors
this surely makes it the best library for
lazy C programmers that have nothing better to do than read a README (like you!).
So this thing started back in the 1800s when I was figuring out C for the first time, I was frustrated, as C had a minimal standard library. Take that as you will, nowadays I quite like the C standard library but back then I despised it, I wanted to create something that you could just use, like this:
#include <magical-library-with-solutions-to-everything.h>
int main() {
try()
println("Hello World!");
catch()
println("NO YOU STUPID IDIOT");
return 1;
return 0;
}
Basically, a heaven where everything becomes easier, a world were this:
#include <assert.h>
#include <ctype.h>
#include <errno.h>
#include <float.h>
#include <limits.h>
#include <locale.h>
#include <math.h>
#include <setjmp.h>
#include <signal.h>
#include <stdarg.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <iso646.h>
#include <wchar.h>
#include <wctype.h>
#include <complex.h>
#include <fenv.h>
#include <inttypes.h>
#include <stdbool.h>
#include <stdint.h>
#include <tgmath.h>
#include <stdalign.h>
#include <stdatomic.h>
#include <stdnoreturn.h>
#include <threads.h>
#include <uchar.h>
#include <stdbit.h>
#include <stdbit.h>
#include <stdckdint.h>
Becomes this:
#include <magical-library-with-solutions-to-everything.h> /* Maybe I should
* come up with a
* better name? */
And thus, lazy(.h)
was born!
#include <lazy.h>
#include <errno.h>
#include <assert.h>
#include <math.h>
int main(flagargs) {
flagzone {
flag({"--debug", "-d"}) {
println("System: Debug mode activated!")
}
flag({"--die", "X_X"}) {
println("System: I'm dying nooo X_X");
return -1;
}
}
errno = 0;
try {
log(0.0);
} catch(EDOM) {
assert(errno == EDOM);
}
return 0;
}
git clone https://github.com/ElisStaaf/lazy
cd lazy
sudo make
echo "Enjoy!"