# minor **Repository Path**: labsite/minor ## Basic Information - **Project Name**: minor - **Description**: Minor语言,表现力强,简洁,有活力的语言 - **Primary Language**: Python - **License**: GPL-3.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 4 - **Forks**: 1 - **Created**: 2020-11-08 - **Last Updated**: 2021-06-27 ## Categories & Tags **Categories**: scripting-language **Tags**: None ## README # Minor语言 ## 公告 可以看最新版本文件夹中的example文件夹学习 新版本发布(0.4.1.1) 增加loop语句,看图 ![](https://images.gitee.com/uploads/images/2021/0529/201917_629c48fe_5647384.png "屏幕截图.png") 使用Easygui 有BUG ![](https://images.gitee.com/uploads/images/2021/0522/201051_48357668_5647384.gif "录制_2021_05_22_20_09_00_986.gif") 邀请Github的peterlits zo加入Minor开发! 在线版 [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/git/https%3A%2F%2Fgitee.com%2Flabsite%2Fminor/HEAD) - 运行main.ipynb即可 ![](https://images.gitee.com/uploads/images/2021/0522/201704_4a5f6a3c_5647384.gif "录制_2021_05_22_20_12_00_96.gif") 点击链接加入群聊【Minor语言】:https://jq.qq.com/?_wv=1027&k=mgyw0umB 群号 942417279 ![拥有的函数](https://images.gitee.com/uploads/images/2021/0503/185448_0bd1eb3b_5647384.png "屏幕截图.png") ## 语法 ### 示例 #### 猜数游戏 ```minor let won = false; let guess: int; print("Welcome to the guessing game!"); print("In this game you need to guess a number between 1 and 100"); let number = random(100) + 1; while !won { guess = to_int(input("Enter a number: ")); if guess == number { print("You won!"); won = true; } else if guess < number { print("Your guess was too low"); } else { print("Your guess was too high"); } } ``` ## 想法 - 我们希望MINOR语言是一个简洁、易用的语言 - 我们不希望MINOR语言的源码过于复杂,希望任何人都能看懂和改进它 - 我们希望Minor语言能转化为C代码,拥有极快的速度与Python的易用性 ## Version ```text version 0.4.1 ``` ## Rely - Python - - sly - - llvmlite - C++ - - cpp_range - - kfs - - python_like_list - - lexicaluion/dict - - SGSSGEM/expression - - simpleMap - - python_like_list_cpp ## Usage build-in function: ![拥有的函数](https://images.gitee.com/uploads/images/2021/0503/185448_0bd1eb3b_5647384.png "屏幕截图.png") ## How to use - Windows - - 如果你有Python3解析器 1. 下载源码,打开src文件夹内版本号最新的文件夹(e.g. src/0.4.x/0.4.0.1) 2. 打开cmd或powershell 3. 输入```python3 minor.py```运行交互式解析器 4. 输入```python3 minor.py 你的Minor程序文件名.mino```运行您的程序 5. 推荐将minor.py所在文件夹加入PATH环境变量,方便使用 - - 如果你没有Python3解析器 1. 下载最新的发行版压缩包(e.g. Minor 0.4.0.1 Win32.zip) 2. 解压缩 3. 输入```minor```运行交互式解析器 4. 输入```minor 你的Minor语言程序文件名.mino```运行您的程序 5. 同样推荐加入PATH环境变量 ## 参考 - [pylite](https://github.com/linuxmooc/pylite) - [郑钢《自制编程语言》随书源码及读书笔记](https://github.com/yifengyou/sparrow) - [Go语法树入门——开启自制编程语言和编译器之旅!](https://github.com/chai2010/go-ast-book) - [类似与python + cpp语法的x语言,x语言解释器命名为xlang。](https://github.com/lws597/xlang) - [toypl](https://github.com/ayuLiao/ToyPL/blob/master/lexer.py) - [Akilang](https://hub.fastgit.org/syegulalp/Akilang) - [Squanchy-Pl](https://hub.fastgit.org/mv-lab/Squanchy-PL) Mythril Rain ## Demo [Demo](https://github.com/streetartist/minor/blob/master/Demo.md) ## Grammar [Grammar](https://github.com/streetartist/minor/blob/master/Grammar.md)