Add host stdlib modules and unify view/run capabilities.

Ship fs/time/sys/json/net L1 libs (plus existing text/table), default-on host caps with soft exit under view, bilingual public/stdlib docs, and design notes for deferred math/foreign.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
cflmyandCursor committed 2026-08-05 10:03:54 +08:00
1 parent a5d30c00b3
commit a53ebb65ee
66 files changed
+2703 -45

No files matched your search

+1
View File
@@ -0,0 +1 @@
hello-lib
+1
View File
@@ -0,0 +1 @@
{"a":1,"b":"x"}
+17
View File
@@ -0,0 +1,17 @@
---
title: fs read/exists
> lib/fs.mq.md
---
# main
*`ok` = > exists path=hello.txt *
+ `ok`
> print text=exists
+ *
> print text=missing
*`t` = > read_text path=hello.txt *
> print text=`t`
+1
View File
@@ -0,0 +1 @@
hello-lib
+23
View File
@@ -0,0 +1,23 @@
---
title: json roundtrip
> lib/fs.mq.md
> lib/json.mq.md
---
# main
*`raw` = > read_text path=sample.json *
*`obj` = > parse text=`raw` *
*`ty` = > type `obj` *
> print text=`ty`
*`a` = > get value=`obj` key=a *
> print text=`a`
*`out` = > stringify value=`obj` *
> print text=`out`
+10
View File
@@ -0,0 +1,10 @@
---
title: net url_encode
> lib/net.mq.md
---
# main
*`e` = > url_encode text=a b *
> print text=`e`
+1
View File
@@ -0,0 +1 @@
{"a":1,"b":"x"}
+15
View File
@@ -0,0 +1,15 @@
---
title: sys cwd
> lib/sys.mq.md
---
# main
*`d` = > cwd *
*`n` = > len `d` *
+ `n` > 0
> print text=cwd-ok
+ *
> print text=cwd-empty
+16
View File
@@ -0,0 +1,16 @@
---
title: time format/parse
> lib/time.mq.md
---
# main
*`s` = > format unix=0 pattern=%Y-%m-%d *
> print text=`s`
*`u` = > parse text=1970-01-01 00:00:00 pattern=%Y-%m-%d %H:%M:%S *
> print text=`u`
> sleep_ms ms=0
+17
View File
@@ -0,0 +1,17 @@
---
title: 中文文件库
> lib/文件.mq.md
---
# main
*`有` = > 存在 路径=hello.txt *
+ `有`
> 打印 内容=存在
+ *
> 打印 内容=缺失
*`t` = > 读文本 路径=hello.txt *
> 打印 内容=`t`