EnqueueZero Techshack 2019-15

antirez/sds

Simple Dynamic Strings C library.

Most C string lib design string data structure like below

struct yourAverageStringLibrary {
    char *buf;
    size_t len;
    ... possibly more fields here ...
};

While SDS design the data structure like below

+------------+------------------------+-----------+---------------\
| Len | Free | H E L L O W O R L D \n | Null term |  Free space   \
+------------+------------------------+-----------+---------------\
             |
             `-> Pointer returned to the user.

Hacking Strings - Redis

The Redis string implementation is hidden behind an interface that accepts only character pointers.


1. Overview - Memory Management Reference 4.0 documentation

A well-designed memory manager can make it easier to write debugging tools, because much of the code can be shared. Such tools could display objects, navigate links, validate objects, or detect abnormal accumulations of certain object types or block sizes.

Typical memory management problems include:

  • Premature frees and dangling pointers
  • Memory leak
  • External fragmentation
  • Poor locality of reference
  • Inflexible design
  • Interface complexity

Erlang Garbage Collector | Erlang Solution blog


Orca is a concurrent and parallel garbage collector for actor programs, which does not require any stop-theworld steps, or synchronisation mechanisms, and which has been designed to support zero-copy message passing and sharing of mutable data


Atoms ELI5 - BEAM VM Wisdoms

Atom is a symbol which does not change its value in runtime. BEAM loader routine reads atom values and looks them up in atom table. It replaces atom names with their integer values, tagged as Atom immediate. These internal values cannot leave the node (over the network or on disk) as integers. This is because another node will have different numeric values for atoms. Thus when leaving the node atoms are always converted to strings.


mrb: What Is Declarative Programming?

This post is part of a series exploring a brain-melting epic known as Concepts, Techniques, and Models of Computer Programming.


Writing a Simple Garbage Collector in C

The hardest part in writing a GC is writing the memory allocator, which is as hard to write as it is to look up the malloc example in K&R.


EdgeDB 1.0 Alpha 1

EdgeDB Alpha 1 released. Some significant features:

  • No NULL. Everything is a set. Nothing yields to an empty set. Boolean logic only need to handle true and false.
  • Enhanced JSON support. SELECT <json>Person { full_name, name_len:=len(.fullname) }
  • Type safety. SELECT <local_datetime>'2019-01-01 01:01:01';.
  • Meta Programming using annotations. This enables building type checking, etc.

Further Readings

GopherCon 2018 - Allocator Wrestling