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

推荐订阅源

爱范儿
爱范儿
Y
Y Combinator Blog
博客园 - Franky
D
Docker
B
Blog RSS Feed
M
MIT News - Artificial intelligence
雷峰网
雷峰网
博客园 - 司徒正美
人人都是产品经理
人人都是产品经理
宝玉的分享
宝玉的分享
S
SegmentFault 最新的问题
GbyAI
GbyAI
Recent Announcements
Recent Announcements
Martin Fowler
Martin Fowler
H
Hackread – Cybersecurity News, Data Breaches, AI and More
MyScale Blog
MyScale Blog
B
Blog
H
Help Net Security
Microsoft Security Blog
Microsoft Security Blog
WordPress大学
WordPress大学
Vercel News
Vercel News
The Cloudflare Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Google DeepMind News
Google DeepMind News

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.