kithinji brian
I'm building a database server like Redis. If you are developer, let's connect.
- Report this post
It's astonishing how much you can accomplish when you set your mind to it.
To view or add a comment, sign in
More Relevant Posts
-
kithinji brian
I'm building a database server like Redis. If you are developer, let's connect.
- Report this post
Who agrees with this?One thing that has always baffled me is that the performance of a program seems inversely proportional to a developer’s sanity. If you aim to write incredibly fast code, there are numerous factors to consider: cache locality, minimizing the number of syscalls, choosing the right data structures... And don't even get me started on custom memory allocators—it's one big arena (if you know, you know).
Like CommentTo view or add a comment, sign in
-
kithinji brian
I'm building a database server like Redis. If you are developer, let's connect.
How do you overcome writers block? I've been staring at my laptop for hours. The creative juices aren't flowing today.
Like CommentTo view or add a comment, sign in
-
kithinji brian
I'm building a database server like Redis. If you are developer, let's connect.
- Report this post
Until I get rich, that thing about work life balance is a myth to me. I wake at 6 am push work until 8pm. Only take breaks to do solo walks. It's not healthy I know but it's either that or die of cold flu because I can't afford OTC medicine.
Like CommentTo view or add a comment, sign in
-
kithinji brian
I'm building a database server like Redis. If you are developer, let's connect.
- Report this post
C is arguably the most powerful programming language out there. Unlike other languages, the C standard library is very lean. There are no built-in data structures apart from arrays, so you end up writing more code to meet your requirements. This approach is essential for learning programming—no fancy one-liners, just more code.
Like CommentTo view or add a comment, sign in
-
kithinji brian
I'm building a database server like Redis. If you are developer, let's connect.
- Report this post
If you're a developer, this is the skill you want to learn this year. Trust me!
Like CommentTo view or add a comment, sign in
-
kithinji brian
I'm building a database server like Redis. If you are developer, let's connect.
- Report this post
I'm writing a book explaining and documenting my database project and I'm at page 97. Super proud, please leave me a like. I need something motivational, I've suffered a lot. Also, I'm looking for a software developer job.
Like CommentTo view or add a comment, sign in
-
kithinji brian
I'm building a database server like Redis. If you are developer, let's connect.
- Report this post
(Philosophy from programming)Reference counting as a tool for memory management is cruel and inhumane.When you are writing code in C. You have to do memory management on your own. There is no garbage collector.To handle memory management manually, you can use: - Memory arenas - Reference counting - Plain malloc/freeOf the three, reference counting has a horrifying analogy with life.Here is how it works. You allocate memory with malloc, but each struct has a reference counter field. Like so:struct string_t {int ref;char str[5];}This ref counter starts at 1. When you give out the ownership of the struct you increment the ref counter. To take back ownership, you decrement the reference counter. When the counter reaches zero, the object is freed automatically because it has no owner and thus no longer needed.string_t *str = malloc(sizeof(string_t))str->ref = 1;memcpy(str->str, "Hello Mum", 10);string_t *str2 = str; // give ownership to another pointerretain(str2); // i.e str->ref = str->ref + 1;printf("%s\n", str2->str);release(str2); // take back ownership from str2 pointer // i.e str->ref = str->ref - 1;str2 = NULL;release(str) // take back ownership from str pointer // i.e str->ref = str->ref - 1; // the ref counter reaches zero and memory is freed automaticallyIt's that simple. Under the hood, in the release function, you check if the counter has reached zero. If so you call free().To me reference counting serves like philosophy. In life, those people that depend on you, treat them well. For when nobody depends on you, that's when life is over.
Like CommentTo view or add a comment, sign in
-
kithinji brian
I'm building a database server like Redis. If you are developer, let's connect.
- Report this post
I've been thinking a lot about creating my own programming language lately. The motivation for this stems from the challenges I've encountered while writing a database engine in C.Here are the features I want my new language to have:- Powerful Error Handling: Many people might not realize it, but Common Lisp has incredibly powerful error handling despite its syntax being somewhat unattractive.- Type System: TypeScript boasts one of the best type systems, and I would like to incorporate similar capabilities.- Type Classes: Haskell's type classes are very cool, and I would love to integrate something similar.- Memory Ownership: Modern C++ and Rust excel in memory management with patterns like RAII, unique_ptr, weak_ptr, and shared_ptr.- Hooks: This is a key feature I want. I would like to attach callback functions to a variable that get invoked automatically when certain events occur, such as: 1. A variable leaving scope 2. A variable being read or written to 3. A variable mutatingFor functions, I could have hooks like when a function is called, when it returns, or when an error occurs.My idea is to make a variable behave like a class.
1
Like CommentTo view or add a comment, sign in
-
kithinji brian
I'm building a database server like Redis. If you are developer, let's connect.
- Report this post
Types of min heap representation and how the insertion algorithm works.
Like CommentTo view or add a comment, sign in
221 followers
- 41 Posts
View Profile
Follow