Skip to main content

DNA: #龍芯⚡️丙午·丁酉·乙未·亥时·䷏豫-CNSH-RELEASE-v2.1.0-UID9622 作者:诸葛鑫(UID9622 · 龍芯北辰) · 许可:工程层 MulanPSL v2 · 思想层 CC BY-NC-SA 4.0 · 字体 SIL OFL 1.1

CNSH · 中文原生脚本语言(Chinese Native Script for Harmony)

用中文写程序。你好,龍魂世界! 不是口号,是 cnsh run examples/hello.cnsh 的真实输出。

30 秒上手

# 方式一:pip(推荐)
pip install cnsh
cnsh run examples/hello.cnsh

# 方式二:从 Gitee 源码
git clone https://gitee.com/uid9622/cnsh.git
cd cnsh
pip install .
cnsh run examples/hello.cnsh

怎么调用

安装后得到 cnsh 命令,六个子命令:

命令 作用 例子
cnsh run <文件.cnsh> 解释执行 cnsh run examples/fib.cnsh
cnsh compile <文件> --target <语言> 编译成其他语言 cnsh compile fib.cnsh --target python -o fib.py
cnsh test 跑测试 cnsh test
cnsh init <项目名> 新建项目骨架 cnsh init 我的项目
cnsh publish 打包项目 cnsh publish
cnsh lsp 起编辑器语言服务 cnsh lsp

也可以不当命令用,当 Python 库调:

from cnsh_v21 import toolchain   # 工具链入口

多目标编译 · 实测状态(2026-09-18 实机验证)

目标语言 状态
Python ✅ 已验证
JavaScript ✅ 已验证
Rust ✅ 已验证
C ✅ 已验证
C++ / Objective-C / Swift 🟡 规划中(v3.0 交付)

龍魂字体 LonghunFont(SIL OFL 1.1 开源)

fonts/ 目录开箱即用:

文件 用途
LonghunFont-Regular.otf / .ttf 桌面安装(macOS 双击 / Windows 右键安装 / Linux 放 ~/.fonts 后 fc-cache)
LonghunFont-Regular.woff2 网页 @font-face
LonghunFont-WuwuColor.otf 彩色字形版
LonghunFont.css 网页直接引入

网页用法:

@font-face {
  font-family: 'LonghunFont';
  src: url('fonts/LonghunFont-Regular.woff2') format('woff2');
}
body { font-family: 'LonghunFont', sans-serif; }

详细安装说明见 fonts/README.md。

文档地图

许可(三层,各归各)

  • 工程层(代码):MulanPSL v2
  • 思想层(规范文档):CC BY-NC-SA 4.0,禁止用于 AI 训练,引用请署名(见 ATTRIBUTION.md)
  • 字体:SIL OFL 1.1(fonts/OFL.txt)

支持这个项目(纯自愿 · 零黑箱)

觉得有用,可以请作者喝杯咖啡:

SOL Tron
SOL Tron

发行版本 v2.1.0 · 源自龍魂系统主仓(longhun-system)· GPG 签名链与完整审计轨迹在主仓保留

Metadata

Release files for cnsh 2.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cnsh 2.1.0
File Size Uploaded Provenance Actions
cnsh-2.1.0.tar.gz 105.0 kB Without provenance Details for cnsh-2.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cnsh 2.1.0
File Interpreter ABI Platform Actions
cnsh-2.1.0-py3-none-any.whl Python 3 none any Details for cnsh-2.1.0-py3-none-any.whl

Total release size: 230.4 kB

Release files / cnsh-2.1.0.tar.gz

Download URL cnsh-2.1.0.tar.gz
Size 105.0 kB
Tags Source
SHA-256 checksum
How to use checksums
775e32083ac49f9864dbc7ece67f393b03e2a840ab3198a751888b1fec78dd4b
BLAKE2b-256 checksum
How to use checksums
d641b644d8bc69f30e05224bddbd45028ac102109e011ac89e7bb796d17fe14e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Release files / cnsh-2.1.0-py3-none-any.whl

Download URL cnsh-2.1.0-py3-none-any.whl
Size 125.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e4d7c429b230d3cabf7ef6e819f5a1ff9887859daddf042ea839b6f11c9f9085
BLAKE2b-256 checksum
How to use checksums
5b96c1d1a70c38b23bdc30797ce2eacb4fe81983c84cf5d6618e4dea60c429ba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Security for cnsh 2.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page