Skip to content

Commit

Permalink
update doc and translate to english
Browse files Browse the repository at this point in the history
  • Loading branch information
limuy2022 committed Nov 26, 2023
1 parent 56155e8 commit 87baddb
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 32 deletions.
58 changes: 28 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,50 +1,49 @@
# Trc

## Trc是一个基于栈的编程语言
## Trc is a stack-based programming language

Trc是一个功能强大,工具链完善,容易上手的解释型语言,易于学习和使用,并且也容易被其他c++项目使用。
Trc's syntax is easy,and have full toolchain.It is easy to learn modern c++ and compiler,too.

## 语言
## language

完全由C++编写,采用全新的c++20标准,并且完全使用模块(module)特性
100% C++

## 目标
Using c++ 20 standard and use module feature

#### Python的简洁
## Goal

#### Java的速度
#### as easy as Python

#### lua的体积
#### as fast as Java

## 项目站点
#### as small as lua

## project website

[Gitee](https://gitee.com/li-muyangangel/trc.git)
[GitHub](https://github.com/limuy2022/trc.git)

## 具体文档说明请参考
## All docs reference

[所有文档](doc)
[All docs](doc)

## 快速使用
#### 由于Linux系统兼容性过低,所以请参考下一章自行编译安装
#### windows请直接使用编译好的二进制文件或参考下一章的编译教程
## How to compile

## 如何编译此项目
[编译指南](doc/developer/build.md)
[Compilation guide](doc/developer/build.md)

## 更改语言
## International

trc支持多种语言,支持方式是用相应的动态链接库文件覆盖掉原有的language文件即可
trc support many languages,the way to change language is that uses the language's dynamic linked library to replace the original language library

## 简单例子
## Simple examples

### hello world

```
println("hello world!")
```

### 求1到n中的偶数
### calculate even numbers from 1 to n

```
a := int(input())
Expand All @@ -56,7 +55,7 @@ while a > 0 {
}
```

### 大整数运算
### Big num calculation

```
a := 1231234561234
Expand All @@ -70,19 +69,18 @@ del "c"
println(a * b)
```

### 更多例子请参考

[更多例子](tests/black_test/program)
[more example](tests/black_test/program)

## 联系作者
## Contact author

微信:angelgel2020
Wechat:angelgel2020

QQ:3570249647

## 引用的开源软件
| 库名 | 用途 |
## Referenced Open-source software

| Library |Usage |
|:-----------|:-------|
| googletest | 单元测试框架 |
| googletest | Uniitest |

在此向开源软件的作者表示感谢!
Express my thanks to Open-source software contributors!
15 changes: 13 additions & 2 deletions doc/developer/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
### First

You can run this python script to install toolchain, build and install Trc and run unittest(just for Linux and Windows user)

```
cd script
python3 easy.py
```

### notice:require a compiler that is support c++ 23 standard,especially module support.Advice getting the newest compiler to compile.
### notice:require a compiler that is support c++ 23 standard,especially module support.Advice getting the newest compiler to compile

Use cmake or xmake to compile project,should install cmake or xmake
Use cmake or xmake(Recommend,most easy) to compile project,should install cmake or xmake

Network is required.Because this project uses xrepo to download packages.

Expand Down Expand Up @@ -45,3 +46,13 @@ xmake install
xmake unittest
xmake run unittest
```

if you use cmake,you should first download [googletest](https://github.com/google/googletest)(because cmake don't have a package manager),and place it in dir ```cmake_third_party```,then run:

```
cmake . -GNinja
ninja
./bin/unittest
```

to build and run unittest

0 comments on commit 87baddb

Please sign in to comment.