惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

aimingoo的专栏
aimingoo的专栏
月光博客
月光博客
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
阮一峰的网络日志
阮一峰的网络日志
博客园_首页
Last Week in AI
Last Week in AI
The Cloudflare Blog
IT之家
IT之家
Hugging Face - Blog
Hugging Face - Blog
美团技术团队
S
SegmentFault 最新的问题
量子位
大猫的无限游戏
大猫的无限游戏
Recent Announcements
Recent Announcements
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Microsoft Security Blog
Microsoft Security Blog
云风的 BLOG
云风的 BLOG
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
I
InfoQ
人人都是产品经理
人人都是产品经理
G
Google Developers Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Engineering at Meta
Engineering at Meta

blag

SQLite prefixes its temp files with `etilqs_` - blag Setsum - order agnostic, additive, subtractive checksum - blag Oldest recorded transaction - blag Replacing a cache service with a database - blag SQLite commits are not durable under default settings - blag PSA: SQLite WAL checksums fail silently and may lose data - blag Rickrolling Turso DB (SQLite rewrite in Rust) - blag Collection of insane and fun facts about SQLite - blag How bloom filters made SQLite 10x faster - blag In search of a faster SQLite - blag Galloping Search - blag Building a distributed log using S3 (under 150 lines of Go) - blag Zero Disk Architecture - blag PSA: Most databases do not do checksums by default - blag PSA: SQLite does not do checksums - blag Disaggregated Storage - a brief introduction - blag Why does SQLite (in production) have such a bad rep? - blag SQLite Slaps - blag Now - blag Learning C - blag Snapshot Testing - blag Win: contribution to libSQL (SQLite) codebase - blag Errata in Hekaton MVCC paper - blag Internet is wholesome: MVCC edition - blag It is becoming difficult for me to be productive in Python - blag MongoDB secondary only index - blag Introducing CaskDB – a project to teach you writing a key-value store - blag Recurse Center: Winter Break - blag Recurse Center Day 24: Hacking Go compiler to add a new keyword - blag Recurse Center Day 20: Django v4 upgrade (from v1) - blag
Recurse Center Day 5: Garbage Collection Algorithms - blag
2021-11-06 · via blag

This is a draft post that I have prematurely published. Currently, I am attending RC and I want to write as much as possible, log my daily learnings and activities. But, I also don't want to spend time on grammar and prose, so I am publishing all the posts which usually I'd have kept in my draft folder.

Meet & Greets

We had another meet and greet session! I had one on one with a few, break out room chat with a few others. This is the last session arranged by RC, however, if people are interested there can be more. I am hoping we will have a few more of these and do them more often. I enjoy these because it’s fun to meet new people, learn their experiences and hear about all the interesting things they want to do at RC.

I also found a few people who are interested in my database project. I am hoping to talk with them more and collaborate.

Today I learned about the basics of garbage collection algorithms, from the Crafting Interpreters by Bob Nystrom. It seems there are two kinds of them, Conservative and Precise, but I don’t think I fully understood the distinction. Crafting Interpreters implements a precise garbage collector.

One of the easy algorithms is Mark and Sweep, which was introduced by John McCarthy (who also coined the term garbage collection) in the seminal Lisp paper. The algorithm is fairly simple, which involves two phases:

  1. Mark: Find all the root things and mark them. Recursively find all the things which are pointed by the roots, mark them
  2. Sweep: Anything which is unmarked, should be freed and garbage collected

The book does an amazing job explaining the basics and the algorithm, so go check it out!

B Tree

I spent some time thinking about the B Tree, nodes, and paging. It suddenly dawned on me that I need to write a memory management system too, which

  1. Maintains a list of empty, not full and full pages
  2. Does garbage collection of pages (?)
  3. Does defragmentation of pages, to fill the gaps

My background is in writing web services. Most web programming languages do all these with in-memory data structures. Now I am writing an on-disk data structure, I need to do all of these chores.

Are there any programming languages that come with built in support for disks too?

I also found two good resources which teach about data structures for external memory:

  1. Algorithms and Data Structures for External Memory by Jeffrey Scott Vitter - (pdf)
  2. A data structures book which has two chapters specifically for external storage - link

People

I paired with David today who is writing a compiler for Lisp in C. He was re-implementing the garbage collector. This was a precise garbage collector and this article provided a good starting point. While all these things were new to me, David was kind and incredibly patient, explained new things and provided enough context.

Few things I learned:

  1. A hack to find current stack pointer
  2. Tagged pointers which were used in marking the objects in the mark phase

Presentations

I attended the Presentation session, which happens every Friday (at 1:30 am. my sleep: 😐) where everyone gets five minutes to present on things. This event is open to the current batch of RC and also to alumni. People are free to present to anything, as long as it is technical, it can be about the project they are working on, a tricky bug they run into or something new they learned.

This was a great session, had people talking about a variety of things: someone built a custom keyboard, CSS/Design, meme generator, elixir, handmade hero etc.

I was fully inspired and pumped up to work on my projects.

…and that wrapped my first week at the Recurse Center.