HPL (H Programming Language) 是一种基于 YAML 格式的面向对象编程语言
Project description
HPL Runtime
HPL(H Programming Language)运行时 - 一种基于 YAML 格式的面向对象编程语言解释器。
特性
- 📝 YAML 语法 - 使用人类可读的 YAML 格式编写代码
- 🏗️ 面向对象 - 支持类、继承和对象实例化
- 🔄 动态类型 - 无需显式类型声明
- 📦 模块系统 - 文件包含和标准库导入
- 🛠️ 标准库 - 内置 math、io、json、os、time 等模块
- 🐛 调试工具 - 内置错误分析和调试功能
安装
pip install hpl-runtime
快速开始
创建 hello.hpl 文件:
main: () => {
echo "Hello, HPL!"
}
call: main()
运行程序:
hpl hello.hpl
完整示例
classes:
Calculator:
add: (a, b) => {
return a + b
}
objects:
calc: Calculator()
main: () => {
result = calc.add(10, 20)
echo "Result: " + result
}
call: main()
使用标准库
imports:
- math
- io
main: () => {
echo "PI: " + math.PI
echo "sqrt(16): " + math.sqrt(16)
io.write_file("test.txt", "Hello from HPL!")
}
call: main()
文档
项目链接
- 主页: https://github.com/TheSingularityStudio/HPL
- 问题反馈: https://github.com/TheSingularityStudio/HPL/issues
许可证
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
hpl_runtime-1.1.4.tar.gz
(138.9 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
hpl_runtime-1.1.4-py3-none-any.whl
(103.3 kB
view details)
File details
Details for the file hpl_runtime-1.1.4.tar.gz.
File metadata
- Download URL: hpl_runtime-1.1.4.tar.gz
- Upload date:
- Size: 138.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
876aa5d2feda76ec1b748a9bbf21c70fd76e82b6b82092bc1095a3ee4f2f20a8
|
|
| MD5 |
937c5332308599f92075226b4fa06f2f
|
|
| BLAKE2b-256 |
4b1d0ad333ee41e624dfb3bfa77c4d874cc171d3dc8eb8e6c67f26c9d8c036b6
|
File details
Details for the file hpl_runtime-1.1.4-py3-none-any.whl.
File metadata
- Download URL: hpl_runtime-1.1.4-py3-none-any.whl
- Upload date:
- Size: 103.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
558d1e6b0b6da62e91352eb898e249ad5f24c1284b1351348cd7cda3e556526c
|
|
| MD5 |
aa873ea92f567707e14bdddc5f89f91b
|
|
| BLAKE2b-256 |
46c5c5fc3243bfcc9249799b7a35d1da2095f6415abdd102e78611ee7fdf254b
|