Skip to main content

CurateClick

CurateClick favicon

Toc

Toc 是一个使用 TypeScript 类型系统实现的 C 风格语言解释器,支持动态类型、变量、表达式、控制语句和函数闭包等特性。

Check out Toc on CurateClick

• Copy the embed code to showcase this product on your website

• Share on X to spread the word about this amazing tool

两年前学习 TypeScript 类型体操时,个人的终极体操,并编写了介绍长文给初学者:类型体操之实现一个类C风格语言的解释器下面是实现效果演示的动图:demo实现的语言叫 Toc (点击在线体验). 它是 C 风格语法,接近 js。动态类型,基础类型有数字、布尔、字符串和 null,支持变量,表达式,块语句,if-else 条件语句,for 循环语句,函数。且函数是一等公民,可以传入传出,支持闭包。更详细的语法,可以参见 Toc Grammar Spec。文章比较长,主要介绍了:1. ts 的类型系统是怎样的函数式语言?2. 如何实现 Toc 解释器?文章介绍的很详细,其中为了照顾没有编译器基础的,还写了一个 ts 版本(不使用类型系统,直接使用 ts 语言,额,也可以说用 js 实现的)的做对照。

Latest Weekly Picks

Independent audiophile gear reviews with a transparent scoring system, plus 16 free in-browser audio tools.

CurateClick favicon

getfacereport.com

Private face analysis with personalized style guidance and hairstyle previews.

CurateClick favicon

lovableapp.org

Discover beautiful apps built with vibe coding

CurateClick favicon

antiquescanner.org

Identify antiques, vintage items and collectibles from photos, with estimated market value.

CurateClick favicon

imagelayered.com

AI-powered image decomposition tool that transforms flat images into editable layers.

CurateClick favicon

kaigpt.ai

gpt代充:如何快速申请免手续费的充值服务?

CurateClick favicon

magiclayers.net

Magic Layers – Official Website, What It Is & How to Use

CurateClick favicon

lifepathcalculator.app

Life Path Calculator - free deterministic numerology: your number, strengths, challenges, and shareable cards.