Skip to content

phamtrongthang123/VNlang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VNlang

Là ngôn ngữ lập trình với syntax là tiếng Việt. Được phát triển dựa trên ngôn ngữ Monkey từ quyển Writing An Interpreter In Go.

Description

Các tính năng chính:

  • C-like syntax
  • variable bindings
  • integers and booleans
  • arithmetic expressions
  • built-in functions
  • first-class and higher-order functions
  • closures
  • a string data structure
  • an array data structure
  • a hash data structure

Installation

Usage

Trước mắt là phải sử dụng qua repl, do chưa phát triển dịch từ script file.

cd src
go run .\vnlang\main.go

Một số mẫu sử dụng:

>> đặt a = [1,2,323,4]
>> độ_dài(a)
4
>> đầu(a)
1
>> a[3]
4
>> a[2]
323
>> đặt chuỗi = "asdasdsad"
>> chuỗi[1]
LỖI: toán tử chỉ mục không hỗ trợ cho: XÂU
>> in_ra(chuỗi)
asdasdsad
null
>> đặt c2 = "test here"
>> chuỗi + " " + c2
asdasdsad test here
>> đặt fi = hàm(b) { nếu (b==0){trả_về 0;} ngược_lại { nếu (b==1) {trả_về 1;} ngược_lại {trả_về fi(b-1) + fi(b-2); } } }
>> fi
hàm (b) {
nếu (b == 0) trả_về 0; ngược_lại nếu (b == 1) trả_về 1; ngược_lại trả_về (fi((b - 1)) + fi((b - 2)));
}
>> fi(1)
1
>> fi(4)
3
>> fi(9)
34

License

MIT

About

Programming Language with Vietnamese Syntax. Ngôn ngữ lập trình với cú pháp là tiếng Việt. (WIP)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages