BybyLang is a programming language developed by Byby, allowing you to control virtual hardware (APU, BUS, RAM, Pins) or generate Nim code for direct execution. BybyLang supports AOT compilation for fast executable generation.
_BybyLang là một ngôn ngữ lập trình do Byby phát triển, cho phép điều khiển phần cứng ảo hoặc sinh ra mã Nim thực thi trực tiếp. BybyLang hỗ trợ chế độ biên dịch AOT, giúp bạn sinh file thực thi nhanh chóng.
You can find bybylangjit in https://github.com/bobbydeveloper2014/bybylangjit | Bạn có thể tìm bybylangjit ở https://github.com/bobbydeveloper2014/bybylangjit
-
Supports 3 modes:
- Low: Direct virtual hardware interaction
- Mid: Intermediate code interaction
- High: Python/Objective-C style coding
Hỗ trợ 3 chế độ: Low, Mid, High. Low thao tác phần cứng ảo, High giống Python.
-
Simulates RAM, BUS, Pins
-
Hardware-level commands:
apu tran,apu mem,bit send,mem push,tran pulse -
Compile to Nim and auto-build executable
-
Install Nim (recommended version: 2.2.x):
curl https://nim-lang.org/choosenim/init.sh -sSf | sh -
Clone BybyLang repository:
git clone https://github.com/bobbydeveloper2014/bybylang.git cd bybylang -
Run directly or build AOT:
nim c -r bybylang.nim
-
Compile to Nim code and executable:
./bybylang main.bybylang --aot=output
[--aot=output]will generate:output.nim(Nim code generated from BybyLang)output(Nim executable built with-d:release)
-
Additional options / Tuỳ chọn thêm:
--ignore-errors: skip RAM/Pins errors--quiet: no verbose log
mode is 1# 1: Low, 2: Mid, 3: High
while true:
print "hello"
for i in range(1, 5):
print "hi"
function sayHello
print "Hello, Byby!"
- Call function:
call sayHello
i = 2
if i == 2:
apu tran "core" with "midstep"
elif i == 3:
apu mem write "RAM1" with "99"
else:
print "other"
- Write RAM:
apu mem write RAM0 with 5- Read RAM:
apu mem read RAM0 with 0
- APU data transfer:
apu tran print with "hello world"
- Pin control:
tran pulse pin 3 width 2ns
apu pin 5 set high
- Bus operations:
bit send 101010
bit recv
mem map "RAM0"
mem push "RAM1" with 10
echo "hello world"print "Hello World"
- Always declare
mode is <level>at the top of the file - Use
functionto define functions - Hardware commands (
apu,bit,mem,tran) only run in Low mode - BybyLang files should use
.bybylangextension
mode is 1
function sayHello
print "Hello World"
apu mem write RAM0 with 5
apu tran print with "hello world"
tran pulse pin 3 width 2ns
call sayHello
BybyLang giúp bạn khám phá và điều khiển phần cứng ảo trực quan. Hãy thử nghiệm và khám phá sức mạnh của BybyLang!
Pull requests are very welcome! Thank you for visiting the project!