<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/partcl---a-tiny-command-language-yvcrsw0te" -->

---
title: Partcl - a tiny command language | daily.dev
description: A developer builds Partcl, a minimalist Tcl interpreter under 600 lines of C, designed to run on microcontrollers with as little as 16KB of NAND memory and...
canonical: https://daily.dev/posts/partcl---a-tiny-command-language-yvcrsw0te
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Partcl - a tiny command language | daily.dev
og:description: A developer builds Partcl, a minimalist Tcl interpreter under 600 lines of C, designed to run on microcontrollers with as little as 16KB of NAND memory and...
og:url: https://daily.dev/posts/partcl---a-tiny-command-language-yvcrsw0te
og:image: https://api.daily.dev/og/posts/yvCRSW0te.png
og:image:alt: Partcl - a tiny command language
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.

# Partcl - a tiny command language

**[zserge's blog](https://daily.dev/sources/zserge)** · 9 min read · 0 upvotes · 0 comments

## Summary

A developer builds Partcl, a minimalist Tcl interpreter under 600 lines of C, designed to run on microcontrollers with as little as 16KB of NAND memory and compile to a 10KB firmware on an STM32F051 chip. The post walks through why Tcl was chosen over Lua, JavaScript, and Forth for embedded scripting, then explains Partcl's lexer, data types, environments, and command system, noting the project has full test coverage and no memory leaks.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://zserge.com/posts/tcl-interpreter>

## Questions this post answers

### How small can a Tcl interpreter be made for running on a microcontroller?

A Tcl interpreter called Partcl was implemented in roughly 600 lines of C and compiled to just 10KB of firmware on an STM32F051 microcontroller, fitting within a 16K NAND constraint. It uses no memory allocation in its lexer and depends only on libc for strings.h and malloc/free.

_daily.dev surfaces embedded systems projects like this for developers picking a scripting language for constrained hardware._

### Why might Tcl be a better fit than Lua or JavaScript for embedded scripting on microcontrollers?

Tcl can be implemented far more compactly than Lua or JavaScript because its entire syntax reduces to string substitution with no complex grammar. Lua interpreters typically compile to around 200KB and use garbage collection unproblematic for realtime systems, while JavaScript embedded implementations like Espruino or Duktape also exceed 200KB and have slower garbage collection, whereas a minimal Tcl interpreter can run in kilobytes.

_developers weighing scripting languages for constrained devices can track these trade-offs on daily.dev._

## Similar posts on daily.dev

- [antirez/picol: A Tcl interpreter in 500 lines of code](https://daily.dev/posts/antirez-picol-a-tcl-interpreter-in-500-lines-of-code-tinloiahd) · Hacker News · 1 upvotes · 0 comments
- [When you just need to build a tiny desktop app: TinyJS](https://daily.dev/posts/when-you-just-need-to-build-a-tiny-desktop-app-tinyjs-roq2jba7u) · DEVCLASS · 61 upvotes · 15 comments
- [Lisp in 99 Lines of C and How to Write One Yourself](https://daily.dev/posts/lisp-in-99-lines-of-c-and-how-to-write-one-yourself-w2eemvlf7) · Lobsters · 0 upvotes · 0 comments

---

Tags: [#c](https://daily.dev/tags/c), [#embedded](https://daily.dev/tags/embedded)

[View this post on daily.dev](https://daily.dev/posts/partcl---a-tiny-command-language-yvcrsw0te)

```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":"Partcl - a tiny command language","url":"https://daily.dev/posts/partcl---a-tiny-command-language-yvcrsw0te","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/partcl---a-tiny-command-language-yvcrsw0te"},"datePublished":"2026-08-23T10:20:23.062Z","dateModified":"2026-08-23T10:21:37.079Z","description":"A developer builds Partcl, a minimalist Tcl interpreter under 600 lines of C, designed to run on microcontrollers with as little as 16KB of NAND memory and...","image":"https://media.daily.dev/image/upload/s--58gMhC4P--/f_auto/v1722860399/public/Placeholder%2012","thumbnailUrl":"https://media.daily.dev/image/upload/s--58gMhC4P--/f_auto/v1722860399/public/Placeholder%2012","isAccessibleForFree":true,"articleSection":"zserge's blog","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":"zserge's blog","logo":"https://media.daily.dev/image/upload/s--KQnFBOIT--/f_auto,q_auto/v1787480407/logos/zserge","url":"https://daily.dev/sources/zserge"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/partcl---a-tiny-command-language-yvcrsw0te","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"c,embedded","timeRequired":"PT9M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"zserge's blog","item":"https://daily.dev/sources/zserge"},{"@type":"ListItem","position":3,"name":"Partcl - a tiny command language"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/partcl---a-tiny-command-language-yvcrsw0te#faq","mainEntity":[{"@type":"Question","name":"How small can a Tcl interpreter be made for running on a microcontroller?","acceptedAnswer":{"@type":"Answer","text":"A Tcl interpreter called Partcl was implemented in roughly 600 lines of C and compiled to just 10KB of firmware on an STM32F051 microcontroller, fitting within a 16K NAND constraint. It uses no memory allocation in its lexer and depends only on libc for strings.h and malloc/free. daily.dev surfaces embedded systems projects like this for developers picking a scripting language for constrained hardware."}},{"@type":"Question","name":"Why might Tcl be a better fit than Lua or JavaScript for embedded scripting on microcontrollers?","acceptedAnswer":{"@type":"Answer","text":"Tcl can be implemented far more compactly than Lua or JavaScript because its entire syntax reduces to string substitution with no complex grammar. Lua interpreters typically compile to around 200KB and use garbage collection unproblematic for realtime systems, while JavaScript embedded implementations like Espruino or Duktape also exceed 200KB and have slower garbage collection, whereas a minimal Tcl interpreter can run in kilobytes. developers weighing scripting languages for constrained devices can track these trade-offs on daily.dev."}}]}
```

