I'm a Code Ninja 🥷. Building cool stuff for humans.
stepfenshawn / cantonese Goto Github PK
View Code? Open in Web Editor NEW粤语編程語言.The Cantonese programming language.
Home Page: https://cantonese-community.github.io/
License: MIT License
粤语編程語言.The Cantonese programming language.
Home Page: https://cantonese-community.github.io/
License: MIT License
I'm a Code Ninja 🥷. Building cool stuff for humans.
麻煩Release一下啦。。。
今天好好研究了一下虚拟机里的if语句,但好像不太能理解,您能笼统地解释一下这个if的工作原理吗?
万分感激!(^-^)
期待 Cantonese 能持续更新: )
今天研究了一下vm的代码,但没有注释有点难懂,特别是那几个变量,不知道是用来干什么的。
谢谢啦!
撐你!
看到报错信息主要仍是原本的英文:濑嘢: NameError("name 'A1' is not defined")!
不知是否打算改为粤语风格?以下项目有类似功能供参考:
隻嘢好好玩😆不過作爲一隻粵語編程語言,個 README 自己就應該帶頭寫粵文先啱𠿪。用普通話寫 README 顯得好唔正經。
因为很多人觉得这个语言不实用,没意义,所以加到这个分区可以让喷子们闭嘴😂
今日啱好得閒上 gayhub, 睇到 Cantonese 好耐未更新了, 所以未來幾日準備 Update 呢個 repo, 升級到 Cantonese 1.0.8...
Cantonese 1.0.8 主要更新計劃:
python3 cantonese.py
Traceback (most recent call last):
File "cantonese.py", line 702, in
main()
File "cantonese.py", line 690, in main
with open(sys.argv[1], encoding = "utf-8") as f:
IndexError: list index out of range
学习编程学英文,没想到还得在学个广东话,😀
衆所周知除左廣東之外,港澳亦使用粵語并且用繁體字書寫文字,可考慮增加選擇繁/簡選項
这里有个简单的 中文转SQL 的技术演示供参考。
刚看到 to_web 等参数 (complie 好像是拼写笔误?),不妨考虑也母语化,比如 木兰重现里用的:
--版本, -版 显示版本
--python变木兰, -兰 将 Python 源码转换为木兰源码
--语法树, -树 语法树信息
对了在 pypi 发布的时候可以把命令也母语化,像这样:
entry_points = {
"console_scripts": ['木兰 = 木兰.中:中']
},
就可以运行 $ 木兰
了。
Instead of using the -use_tr
flag to switch modes, is it possible to allow both simplified and traditional keywords at the same time?
既然是面向粤语为母语的开发者,标识符也用母语命名可以提高代码可读性。供参考《Python3选择支持非ASCII码标识符的缘由》
比如个人的木兰语言重现项目就 用了中文命名。
本人是一名初中生,现在也在做自己的编程语言,叫rickroll-lang(求star啦)。来这里是为了借鉴并学习大佬的语言的。
不过现在我有个问题,这个语言是把.cantonese源码转换成python源码执行的吗?还有我不太清楚use_tradtion这个变量是干什么的。
谢谢!
bilibili演示地址:
https://bilibili.com/video/BV11Y4y1H7SD
果然系高手
不用创建源码文件,感觉比较方便试用。运行 python src/cantonese
即进入交互环境如何?
木兰自带的 交互环境功能 供参考。我先搞一个最基本功能的 pr 你看看?
“畀我睇下 |变量| 点样先?”
print 语句太长啦,直接用 “睇下 |变量|” 得唔得?
“返转头” 太过 return 直译,用 “返回” 又冇咩意思…… “还数” 好似几唔错。
Hello, after installing Cantonese
, it fails to run because of the import six
that isn't included in your list of dependencies.
Line 9 in 3072e3b
Lines 31 to 34 in 4870538
You only support Python 3 in setup.cfg
and the README, so it doesn't look like you would need six
for Python 2 interoperability.
Line 30 in 4870538
It doesn't seem like you are using six
at all. Can we delete the import six
line?
% Cantonese
Traceback (most recent call last):
File "/Users/dosentmatter/.pyenv/versions/3.9.6/bin/Cantonese", line 5, in <module>
from src.cantonese import main
File "/Users/dosentmatter/.pyenv/versions/3.9.6/lib/python3.9/site-packages/src/cantonese.py", line 12, in <module>
from src.stack_vm import *
File "/Users/dosentmatter/.pyenv/versions/3.9.6/lib/python3.9/site-packages/src/stack_vm.py", line 9, in <module>
import six
ModuleNotFoundError: No module named 'six'
The workaround is to pip install six
, but this shouldn't be necessary.
CTRL+C
, 收工 doesn't work.% Cantonese
早晨!
> 畀我睇下 " Hello World! " 点样先?
>
> 收工
>
> Traceback (most recent call last):
File "/Users/dosentmatter/.pyenv/versions/3.9.6/bin/Cantonese", line 8, in <module>
sys.exit(main())
File "/Users/dosentmatter/.pyenv/versions/3.9.6/lib/python3.9/site-packages/src/cantonese.py", line 3125, in main
sys.exit(开始交互())
File "/Users/dosentmatter/.pyenv/versions/3.9.6/lib/python3.9/site-packages/src/cantonese.py", line 3089, in 开始交互
交互().cmdloop("早晨!")
File "/Users/dosentmatter/.pyenv/versions/3.9.6/lib/python3.9/cmd.py", line 126, in cmdloop
line = input(self.prompt)
KeyboardInterrupt
Can we change Cantonese
to cantonese
? There are UNIX commands that have capital letters, but most commands are lowercase.
在根目录下运行 src/test.py 未遍历所有例程:
$ python src/test.py
==============START TEST================
=============END=======================
Finished in 0s!
另外,为自动验证运行结果,像 木兰重现项目之前这样 获取进程输出后与期望值作比较如何?
可以向C++学习,把Cantonese语言变成一种标准,而不仅仅是一个解释器。建议创建一个新repo,用于存放core文件的内容。建议取名为CppCantonese。
若得到你的允许,我可以自己创建这个 repo,并且帮你把core移植到里面来。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.