<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/borrow-checking-without-type-checking-tjpie4zif" -->

---
title: Borrow-checking without type-checking | daily.dev
description: A deep technical exploration of implementing borrow-checking in a dynamically-typed toy language without a static type system. The author demonstrates how...
canonical: https://daily.dev/posts/borrow-checking-without-type-checking-tjpie4zif
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Borrow-checking without type-checking | daily.dev
og:description: A deep technical exploration of implementing borrow-checking in a dynamically-typed toy language without a static type system. The author demonstrates how...
og:url: https://daily.dev/posts/borrow-checking-without-type-checking-tjpie4zif
og:image: https://api.daily.dev/og/posts/tjPie4zIF.png
og:image:alt: Borrow-checking without type-checking
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Borrow-checking without type-checking

**[Jamie Brandon](https://daily.dev/sources/jamiebrandon)** · 26 min read · 0 upvotes · 0 comments

## Summary

A deep technical exploration of implementing borrow-checking in a dynamically-typed toy language without a static type system. The author demonstrates how ownership, borrowing, and shared references can be enforced at runtime using a compact reference-counting scheme stored on the stack. Key design decisions include: using a single integer per variable to encode moved/borrowed/shared states, storing lender and owner provenance in 42 bits per reference, and scanning the stack to produce useful error messages on violations. The system supports interior pointers, stack allocation, external iterators, and closures with explicit captures. Comparisons are drawn to Rust, Hylo, Mojo, Swift, C# refs, and other ownership systems, with honest discussion of tradeoffs and remaining limitations.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.scattered-thoughts.net/writing/borrow-checking-without-type-checking/>

## Similar posts on daily.dev

- [Borrow checker notes](https://daily.dev/posts/borrow-checker-notes-1ngbdqtmw) · Lobsters · 1 upvotes · 0 comments
- [Valen's Memory Safety: A New Kind of Borrow Checking](https://daily.dev/posts/valen-s-memory-safety-a-new-kind-of-borrow-checking-or0nqa182) · Hacker News · 8 upvotes · 1 comments
- [The Algebra of Loans in Rust](https://daily.dev/posts/the-algebra-of-loans-in-rust-zcqh92rn8) · Hacker News · 19 upvotes · 7 comments
- [The Inconceivable Types of Rust: How to Make Self-Borrows Safe](https://daily.dev/posts/the-inconceivable-types-of-rust-how-to-make-self-borrows-safe-iyygx152k) · Lobsters · 0 upvotes · 0 comments
- [Rust Ownership Under the Hood: How Rust Manages Memory Without a Garbage Collector](https://daily.dev/posts/rust-ownership-under-the-hood-how-rust-manages-memory-without-a-garbage-collector-iwyribsvw) · Medium · 0 upvotes · 0 comments

---

Tags: [#rust](https://daily.dev/tags/rust)

[View this post on daily.dev](https://daily.dev/posts/borrow-checking-without-type-checking-tjpie4zif)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Borrow-checking without type-checking","url":"https://daily.dev/posts/borrow-checking-without-type-checking-tjpie4zif","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/borrow-checking-without-type-checking-tjpie4zif"},"datePublished":"2026-04-23T03:00:15.062Z","dateModified":"2026-04-23T03:00:44.166Z","description":"A deep technical exploration of implementing borrow-checking in a dynamically-typed toy language without a static type system. The author demonstrates how...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/8ca46407ab701012cbbd3101d60aaac9?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/8ca46407ab701012cbbd3101d60aaac9?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Jamie Brandon","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Jamie Brandon","logo":"https://media.daily.dev/image/upload/s--lWYKZ6-3--/f_auto/v1721999373/logos/jamiebrandon","url":"https://daily.dev/sources/jamiebrandon"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/borrow-checking-without-type-checking-tjpie4zif","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"rust","timeRequired":"PT26M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Jamie Brandon","item":"https://daily.dev/sources/jamiebrandon"},{"@type":"ListItem","position":3,"name":"Borrow-checking without type-checking"}]}
```

