Skip to content
| Marketplace
Sign in
Visual Studio Code>Debuggers>YU DebuggerNew to Visual Studio Code? Get it now.
YU Debugger

YU Debugger

4mychip

|
1 install
| (0) | Free
Debugger and language support for the YU programming language
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

YU Debugger — 宇语言 VS Code 扩展

为宇语言(Yu Language)提供调试、语言服务和 yulang.json 支持的 VS Code 插件。


宇语言简介

宇语言(yulang)是一门函数式优先的动态编程语言,语法类似 JavaScript,零外部运行时依赖。

函数式优先 · 动态脚本 · 开箱即用

语法示例

Hello World

function main() {
    print("你好,宇语言!")
}
main()

函数与闭包

// 高阶函数
function map(arr, fn) {
    result = []
    for v in arr {
        result.append(fn(v))
    }
    return result
}

// lambda 表达式
double = function(x) { return x * 2 }
print(double(5))  // 10

// 闭包
function make_counter() {
    count = 0
    return function() {
        count = count + 1
        return count
    }
}
c = make_counter()
print(c())  // 1
print(c())  // 2

异步与生成器

// async/await
async function fetch_data() {
    await sleep(100)
    return "ok"
}
result = await fetch_data()

// generator / yield
generator function range(n) {
    i = 0
    while i < n {
        yield i
        i = i + 1
    }
}
for val in range(5) {
    print(val)  // 0 1 2 3 4
}

模块系统

import math
import http.client
import @utils.helper   // @ 前缀引用项目根
import json as j

标准库

模块 功能
math 数学计算、随机数
json stringify / parse
datetime 日期时间处理
regex 正则表达式
file 文件 I/O
collect Array、Object、Set、Stack、Queue
net TCP/UDP 通信
http HTTP/HTTPS 客户端
ws WebSocket 客户端

开发指南

运行脚本

yulang run main.yu        # 运行脚本
yulang run tests/          # 运行测试目录

REPL 交互式环境

yulang repl

代码格式化

yulang fmt source.yu

项目初始化

yulang init                # 在当前目录创建项目模板

bundle 打包

yulang build src/          # 打包为 app.yulang
yulang build src/ --exe    # 打包并生成独立可执行程序

依赖管理

yulang pub get             # 拉取依赖
yulang pub upgrade         # 更新依赖

生成文档

yulang doc src/            # 从 /// 注释生成文档

许可

本软件受宇语言软件许可协议保护。非商业使用免费,商业使用需购买授权。

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft