📝 update README.md & README_zh.md

This commit is contained in:
ValKmjolnir 2022-07-24 13:01:42 +08:00
parent c6129267aa
commit afbee18e26
4 changed files with 58 additions and 70 deletions

View File

@ -20,7 +20,7 @@
* [__Introduction__](#introduction) * [__Introduction__](#introduction)
* [__Compile__](#how-to-compile) * [__Compile__](#how-to-compile)
* [__Usage__](#how-to-use) * [__Usage__](#how-to-use)
* [__Tutorial__](#tutorial) * [__Tutorial__](#tutorial)<details><summary>more</summary>
* [basic value type](#basic-value-type) * [basic value type](#basic-value-type)
* [operators](#operators) * [operators](#operators)
* [definition](#definition) * [definition](#definition)
@ -33,19 +33,12 @@
* [closure](#closure) * [closure](#closure)
* [trait](#trait) * [trait](#trait)
* [native functions](#native-functions) * [native functions](#native-functions)
* [modules](#modulesfor-library-developers) * [modules](#modulesfor-library-developers)</summary>
* [__Release Notes__](#release-notes) * [__Release Notes__](./doc/dev.md#release-notes)
* [v8.0](#version-80-release)
* [__Development History__](./doc/dev.md) * [__Development History__](./doc/dev.md)
* [__Benchmark__](./doc/benchmark.md) * [__Benchmark__](./doc/benchmark.md)
* [__Difference__](#difference-between-andys-and-this-interpreter) * [__Difference__](#difference-between-andys-and-this-interpreter)
* [strict definition](#1-must-use-var-to-define-variables)
* [default dynamic arguments](#2-default-dynamic-arguments-not-supported)
* [__Trace Back Info__](#trace-back-info) * [__Trace Back Info__](#trace-back-info)
* [native function 'die'](#1-native-function-die)
* [stack overflow](#2-stack-overflow-crash-info)
* [runtime error](#3-normal-vm-error-crash-info)
* [detailed crash info](#4-detailed-crash-info)
* [__Debugger__](#debugger) * [__Debugger__](#debugger)
__Contact us if having great ideas to share!__ __Contact us if having great ideas to share!__
@ -55,7 +48,7 @@ __Contact us if having great ideas to share!__
## __Introduction__ ## __Introduction__
__[Nasal](http://wiki.flightgear.org/Nasal_scripting_language)__ __[Nasal](http://wiki.flightgear.org/Nasal_scripting_language)__
is an ECMAscript-like programming language that used in [FlightGear](https://www.flightgear.org/). is an ECMAscript-like language that used in [FlightGear](https://www.flightgear.org/).
This language is designed by [Andy Ross](https://github.com/andyross). This language is designed by [Andy Ross](https://github.com/andyross).
The interpreter is totally rewritten by [ValKmjolnir](https://github.com/ValKmjolnir) using `C++`(`-std=c++11`) The interpreter is totally rewritten by [ValKmjolnir](https://github.com/ValKmjolnir) using `C++`(`-std=c++11`)
@ -95,7 +88,7 @@ this interpreter a useful tool in your own projects (such as a script in a game
Better choose the latest update of the interpreter. Better choose the latest update of the interpreter.
Download the source and build it! It's quite easy to build this interpreter. Download the source and build it! It's quite easy to build this interpreter.
__CAUTION__: If want to use the release zip/tar.gz file to build the interpreter, please read the [__Release Notes__](#release-notes) below to make sure this release file has no fatal bugs. There are some tips to fix the release manually. __CAUTION__: If want to use the release zip/tar.gz file to build the interpreter, please read the [__Release Notes__](./doc/dev.md#release-notes) to make sure this release file has no fatal bugs. There are some tips to fix the release manually.
Use g++(`MinGW-w64`) or MSVC(`Visual Studio`) on __`Windows`__ platform. Download MinGW-w64 [__HERE__](https://www.mingw-w64.org/downloads/)(Visual Studio also has this), and use g++/clang++ on __`linux/macOS/Unix`__ platform (we suggest `clang`). Use g++(`MinGW-w64`) or MSVC(`Visual Studio`) on __`Windows`__ platform. Download MinGW-w64 [__HERE__](https://www.mingw-w64.org/downloads/)(Visual Studio also has this), and use g++/clang++ on __`linux/macOS/Unix`__ platform (we suggest `clang`).
@ -754,29 +747,6 @@ If get this, Congratulations!
832040 832040
``` ```
## __Release Notes__
### __version 8.0 release__
I made a __big mistake__ in `v8.0` release:
in __`nasal_dbg.h:215`__: `auto canary=gc.stack+STACK_MAX_DEPTH-1;`
this will cause incorrect `stackoverflow` error.
please change it to:
`canary=gc.stack+STACK_MAX_DEPTH-1;`
If do not change this line, only the debugger runs abnormally. this bug is fixed in `v9.0`.
Another bug is that in `nasal_err.h:class nasal_err`, we should add a constructor for this class:
```C++
nasal_err():error(0){}
```
This bug is fixed in `v9.0`. So we suggest that do not use `v8.0`.
## __Difference Between Andy's and This Interpreter__ ## __Difference Between Andy's and This Interpreter__
### 1. must use `var` to define variables ### 1. must use `var` to define variables

View File

@ -20,7 +20,7 @@
* [__简介__](#简介) * [__简介__](#简介)
* [__编译__](#编译) * [__编译__](#编译)
* [__使用方法__](#使用方法) * [__使用方法__](#使用方法)
* [__教程__](#教程) * [__教程__](#教程)<details><summary>展开</summary>
* [基本类型](#基本类型) * [基本类型](#基本类型)
* [运算符](#运算符) * [运算符](#运算符)
* [定义变量](#定义变量) * [定义变量](#定义变量)
@ -33,19 +33,12 @@
* [闭包](#闭包) * [闭包](#闭包)
* [trait(特性)](#特性) * [trait(特性)](#特性)
* [内置函数](#内置函数) * [内置函数](#内置函数)
* [模块](#模块开发者教程) * [模块](#模块开发者教程)</summary>
* [__发行日志__](#发行日志) * [__发行日志__](../doc/dev_zh.md#发行日志)
* [v8.0](#version-80-release)
* [__开发历史__](../doc/dev_zh.md) * [__开发历史__](../doc/dev_zh.md)
* [__测试数据__](../doc/benchmark.md) * [__测试数据__](../doc/benchmark.md)
* [__特殊之处__](#与andy解释器的不同之处) * [__特殊之处__](#与andy解释器的不同之处)
* [严格的定义要求](#1-必须用var定义变量)
* [默认不定长参数](#2-默认不定长参数)
* [__堆栈追踪信息__](#trace-back-info) * [__堆栈追踪信息__](#trace-back-info)
* [内置函数`die`](#1-内置函数die)
* [栈溢出](#2-栈溢出信息)
* [运行时错误](#3-运行时错误)
* [详细的崩溃信息](#4-详细的崩溃信息)
* [__调试器__](#调试器) * [__调试器__](#调试器)
__如果有好的意见或建议欢迎联系我们!__ __如果有好的意见或建议欢迎联系我们!__
@ -55,7 +48,7 @@ __如果有好的意见或建议欢迎联系我们!__
## __简介__ ## __简介__
__[Nasal](http://wiki.flightgear.org/Nasal_scripting_language)__ __[Nasal](http://wiki.flightgear.org/Nasal_scripting_language)__
是一个与ECMAscript标准语法设计相似的编程语言并且作为运行脚本语言被著名的开源飞行模拟器 [FlightGear](https://www.flightgear.org/) 所依赖。 是一个与ECMAscript标准语法设计相似的编程语言并且作为运行脚本被著名的开源飞行模拟器 [FlightGear](https://www.flightgear.org/) 所依赖。
该语言的设计者和初版解释器实现者为 [Andy Ross](https://github.com/andyross)。 该语言的设计者和初版解释器实现者为 [Andy Ross](https://github.com/andyross)。
这个解释器项目则由 [ValKmjolnir](https://github.com/ValKmjolnir) 完全使用 `C++`(`-std=c++11`)重新实现,没有复用 [Andy Ross的nasal解释器](<https://github.com/andyross/nasal>) 中的任何一行代码。尽管没有任何的参考代码我们依然非常感谢Andy为我们带来了这样一个神奇且容易上手的编程语言。 这个解释器项目则由 [ValKmjolnir](https://github.com/ValKmjolnir) 完全使用 `C++`(`-std=c++11`)重新实现,没有复用 [Andy Ross的nasal解释器](<https://github.com/andyross/nasal>) 中的任何一行代码。尽管没有任何的参考代码我们依然非常感谢Andy为我们带来了这样一个神奇且容易上手的编程语言。
@ -81,7 +74,7 @@ __我们为什么想要重新写一个nasal解释器?__
我们推荐你下载最新更新的代码包来直接编译,这个项目非常小巧因此你可以非常快速地将它编译出来。 我们推荐你下载最新更新的代码包来直接编译,这个项目非常小巧因此你可以非常快速地将它编译出来。
__注意__: 如果你想直接下载发行版提供的zip/tar.gz压缩包来构建这个解释器在下载之后请阅读下文中对应发行版本的[__发行日志__](#发行日志)以保证这个发行版的文件中不包含非常严重的bug(有的严重bug都是在发行之后才发现非常搞心态)。在发行版日志中我们会告知如何在代码中手动修复这个严重的bug。 __注意__: 如果你想直接下载发行版提供的zip/tar.gz压缩包来构建这个解释器在下载之前请阅读[__发行日志__](../doc/dev_zh.md#发行日志)以保证这个发行版的文件中不包含非常严重的bug(有的严重bug都是在发行之后才发现非常搞心态)。在发行版日志中我们会告知如何在代码中手动修复这个严重的bug。
__`Windows`__ 用户通过g++(`MinGW-w64`)使用以下命令或者使用MSVC(`Visual Studio`)来进行编译. 没有编译环境的请在[__这里__](https://www.mingw-w64.org/downloads/)下载MinGW-w64。(VS同样也有MinGW-w64) __`Windows`__ 用户通过g++(`MinGW-w64`)使用以下命令或者使用MSVC(`Visual Studio`)来进行编译. 没有编译环境的请在[__这里__](https://www.mingw-w64.org/downloads/)下载MinGW-w64。(VS同样也有MinGW-w64)
__`linux/macOS/Unix`__ 用户可以使用g++或者clang++替代下面命令中中括号的部分来进行编译(我们建议您使用`clang`)。 __`linux/macOS/Unix`__ 用户可以使用g++或者clang++替代下面命令中中括号的部分来进行编译(我们建议您使用`clang`)。
@ -714,29 +707,6 @@ dylib.dlclose(dlhandle);
832040 832040
``` ```
## __发行日志__
### __version 8.0 release__
这个版本的发行版有个 __严重的问题__:
in __`nasal_dbg.h:215`__: `auto canary=gc.stack+STACK_MAX_DEPTH-1;`
这个会导致不正确的`stackoverflow`报错。因为它覆盖了原有的变量。
请修改为:
`canary=gc.stack+STACK_MAX_DEPTH-1;`
如果不修改这一行,调试器运行肯定是不正常的。在`v9.0`第一个commit中我们修复了这个问题。
另外一个bug在 `nasal_err.h:class nasal_err`这边,要给这个类添加一个构造函数来进行初始化,否则会出问题:
```C++
nasal_err():error(0){}
```
同样这个也在`v9.0`中修复了。所以我们建议不要使用`v8.0`。
## __与andy解释器的不同之处__ ## __与andy解释器的不同之处__
### 1. 必须用`var`定义变量 ### 1. 必须用`var`定义变量

View File

@ -18,6 +18,7 @@
* [v8.0](#version-80-vm-last-update-2022212) * [v8.0](#version-80-vm-last-update-2022212)
* [v9.0](#version-90-vm-last-update-2022518) * [v9.0](#version-90-vm-last-update-2022518)
* [v10.0](#version-100-vm-latest) * [v10.0](#version-100-vm-latest)
* [__Release Notes__](#release-notes)
## __Parser__ ## __Parser__
@ -642,3 +643,26 @@ so we conclude this:
resume (main->coroutine) return coroutine.top[0]. coroutine.top[0] = coroutine.top[0]; resume (main->coroutine) return coroutine.top[0]. coroutine.top[0] = coroutine.top[0];
yield (coroutine->main) return a vector. main.top[0] = vector; yield (coroutine->main) return a vector. main.top[0] = vector;
``` ```
## __Release Notes__
### __version 8.0 release__
I made a __big mistake__ in `v8.0` release:
in __`nasal_dbg.h:215`__: `auto canary=gc.stack+STACK_MAX_DEPTH-1;`
this will cause incorrect `stackoverflow` error.
please change it to:
`canary=gc.stack+STACK_MAX_DEPTH-1;`
If do not change this line, only the debugger runs abnormally. this bug is fixed in `v9.0`.
Another bug is that in `nasal_err.h:class nasal_err`, we should add a constructor for this class:
```C++
nasal_err():error(0){}
```
This bug is fixed in `v9.0`. So we suggest that do not use `v8.0`.

View File

@ -18,6 +18,7 @@
* [v8.0](#version-80-vm-last-update-2022212) * [v8.0](#version-80-vm-last-update-2022212)
* [v9.0](#version-90-vm-last-update-2022518) * [v9.0](#version-90-vm-last-update-2022518)
* [v10.0](#version-100-vm-latest) * [v10.0](#version-100-vm-latest)
* [__发行日志__](#发行日志)
## __语法分析__ ## __语法分析__
@ -575,3 +576,26 @@ __接下来我们解释这个协程的运行原理:__
resume (main->coroutine) return coroutine.top[0]. coroutine.top[0] = coroutine.top[0]; resume (main->coroutine) return coroutine.top[0]. coroutine.top[0] = coroutine.top[0];
yield (coroutine->main) return a vector. main.top[0] = vector; yield (coroutine->main) return a vector. main.top[0] = vector;
``` ```
## __发行日志__
### __version 8.0 release__
这个版本的发行版有个 __严重的问题__:
in __`nasal_dbg.h:215`__: `auto canary=gc.stack+STACK_MAX_DEPTH-1;`
这个会导致不正确的`stackoverflow`报错。因为它覆盖了原有的变量。
请修改为:
`canary=gc.stack+STACK_MAX_DEPTH-1;`
如果不修改这一行,调试器运行肯定是不正常的。在`v9.0`第一个commit中我们修复了这个问题。
另外一个bug在 `nasal_err.h:class nasal_err`这边,要给这个类添加一个构造函数来进行初始化,否则会出问题:
```C++
nasal_err():error(0){}
```
同样这个也在`v9.0`中修复了。所以我们建议不要使用`v8.0`。