Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API

From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Search - "+100 sanity"
-
Sometimes, when I think I'm going crazy, I open devrant and realize that I'm still very far from MadMen / YouAllSuck / AvatarOfKaine.5
-
So we have an API that my team is supposed send messages to in a fire and forget kind of style.
We are dependent on it. If it fails there is some annoying manual labor involved to clean that mess up. (If it even can be cleaned up, as sometimes it is also time-sensitive.)
Yet once in a while, that endpoint just crashes by letting the request vanish. No response, no error, nothing, it is just gone.
Digging through the log files of that API nothing pops up. Yet then I realize the size of the log files. About ~30GB on good old plain text log files.
It turns out that that API has taken the LOG EVERYTHING approach so much too heart that it logs to the point of its own death.
Is circular logging such a bleeding edge technology? It's not like there are external solutions for it like loggly or kibana. But oh, one might have to pay for them. Just dump it to the disk :/
This is again a combination of developers thinking "I don't need to care about space! It's cheap!" and managers thinking "100 GB should be enough for that server cluster. Let's restrict its HDD to 100GB, save some money!"
And then, here I stand trying to keep my sanity :/1 -
Consider,
```
namespace A;
macro m00 a,b;
··display a,b;
end macro;
macro m01 a;
··m00 a,$0A;
end macro;
m01 $24;
end namespace;
```
OUT: $0A24 ("$\n").
Ah, but you just HAD to fuck me in the ass, didncha fasm2? Initializing anal bleeding:
```
namespace B;
A.m01 $24;
end namespace;
```
OUT: illegal instruction 'm00'.
Explanation: macros carry no context, and so 'm00' is unreachable from 'B' namespace.
Could I maybe write a code-capture macro to generate a wrapper that resets the namespace? Yes, and in fact, I did; brilliant exercise in mystical mindfuckery.
But why try so hard? Just pass the fucking ref, like a MAN.
EXPLICIT CTX, BITCH.
```
define @CAS $non; current addressing space
define %ICE @CAS;
macro self:PA&; recursive macro, uuuh spooky-spooky
··match ice , %ICE;
····; self->proc(args)
····match =-=> proc (args) , PA;
······path.proc ice,args; pass ref and args
····; ^self->proc()
····else match =-=> proc () , PA;
······path.proc ice; pass ref only
····; ^sneaky sneaky. set current context when self ctx;
····else match cas , @CAS;
······%ICE equ cas.PA;
····end match;
··end match;
end macro;
```
ALL TOGETHER NOW
```
namespace A;
macro m00 ice,a,b;
··display a,b;
end macro;
macro m01 ice,a;
··self->m00(a,$0A); could also be 'ice.m00 ice,a,$0A' lmao
end macro;
end namespace;
namespace B;
self A; set ice
self->m01($24);
restore %ICE; back to previous
end namespace;
```
OUT: $0A24 ("$\n").
A-há, now **I** got you from behind motherfucker!
Final note: this is 100% perl DNA seeping through the cracks of my sanity and into a fresh fasm2 framework. Why? Dingle-dongle-jungle-berries, that's why. Also crack.
Have a nice wallop.45