Sure you can find a single-copy-deployment solution with FCGI too like how PHP does it, but one has to feel a need first.
2,635 karma · joined August 26, 2008
Sure you can find a single-copy-deployment solution with FCGI too like how PHP does it, but one has to feel a need first.
or simply gnod.bsky.social as https is the default protocol on browsers.
In C you can construct your hackish tracing GC yourself. For root objects save the stack address at the beginning of main() by saving the address of a dummy stack variable.
int dummy=0;
void* stack_head=&dummy;
and later during GC get the current stack address again and trace from old one to new. You also need to save the registers and can do it in a semi portable way using unix setjmp() longjmp() functions which save the register values into a structure that you can then later trace. There's also the issues of split stack that you need to keep into mind. But the positive thing is memory alignment ensures pointers are all 8 byte aligned, you only need to read address%8 values in between. It's a bit hackish regardless.I built a few apps using the above technique but now am more comfortable with old styled manual memory management. Valgrind will tell you exactly which line you allocated memory that leaked.
Convert this one to fcgi, and it will get as fast as any other solution. In fcgi mode it runs as a service listening to a socket and reads and sends response over it while never terminating.
Even php running on fcgi mode is far faster than the old styled mod_php.
How much has changed?
Further you can read back previously added contents and make additional chagnes based on those. Like summing up table columns, or adding links to the first column values, or removing or fixing links based on authorization, to name a few.
Found the old code on disk, snapshot here. The DOM parser, manipulator and free was 240 LOC.
allocate(void\* ptr, size_t size);
ptr == NULL : alloc()
size == 0 : free()
both ptr and size sent : realloc()
That way it's simpler on the API stage. I prefer to keep it like that in my code.That's still far less than what Canada was asking. 2% of their yearly revenue which was bumped up to 4% after Meta left. But Google's $100m is more like 0.5% of their yearly gross revenue in Canada.
You create the header files.
- the audio jack doesn't work. Maybe it's because I installed the server installer instead of the client.
- GPIO ports doesn't stay on unless you lock it and keep your program running.
Link to imgur. The first image is screenshot of what I see in the browser. The rest are actual images after pasting to imgur.
- A vim script.
- CMake configuration file.
- An awk script.
And it had a critical error in every 10 LOC, that I had to fix googling.
Finally not much of the generated code was in the final version.
At that time reddit was rising. PG didn't want to turn this forum one into another Reddit. To discourage posts with body he grayed out the body text. And then within the next few weeks he grayed out the texts gradually even more. Until it reached the point that you see now.
Encouragement was to post interesting links and blogs. But not turn this one into a general discussion forum.
That was may be in the late 2000s. As far as I can recall.
But parsing /etc/resolve.conf and using it is all that you need in your code.
Other issues I faced :
- Not epoll() friendly. Always forks a process while resolving domain name.
- Valgrind complains of uninitialized memory touches when the function is called and I can't get rid of it.
Check if you can do that too.
And once you fix it, you have built a light weight library that you can use from any other language.
Also these pointer manipulation is what gives C its power.
- I prefer functions over classes.
- no mangling of exported names, the binary is re-usable as API.
- in the long term, the C source code is more re-usable in other projects than C++ ones.
and more like this.