Skip to content
This repository has been archived by the owner on May 24, 2021. It is now read-only.

Releases: CASC-Lang/CASC-JIT

v0.1.0

31 Jan 10:17
Compare
Choose a tag to compare

CASC is now much more stable!

In this version of CASC Compiler release, we improved our REPL so some preserved keywords such as "func", "return", or "var" will be highlighted, but REPL is not working friendly with Mandarins, so instead, Mandarins user can just type codes in text editors and save it into xxx.casc or xxx.cas files.

We recommend users use Visual Studio Code to have much better playing fun since we have official extensions to highlight our CASC source codes.

To get started with CASC Programming Language, read out our README.md first! So you can 80% sure what is CASC doing!

The release contains multiple files in a tar.gz or 7zip file, based on your runtime. To get started with, decompress the downloaded file and open up a command line and execute CASC.exe in following possible arguments:

  • <source-directory-path>: CASC does not have any way to import other files in runtime, so alternatively the compiler would compile all .casc or .cas files in the folder (included subdirectories) and runs it.
  • repl: if you just want to play with CASC without any preparations, try out CASC Repl! You can test out what CASC can do for you.

Developers Note:

CASC is currently a small group, with one man in it, so basically I don't have much time to improve CASC's document. If you are willing to improve CASC Programming Language, feel free to fork and send back your PR or make a issue, small supports are the motivations for me to keep improving CASC!

Also, here are some fun syntaxes you should better read out before getting start:

for-loop

for i = 0 to 100 {
    print(string(i))
}

  =   一百 {
    print(字串())
}

desc: i is a local variable means index in this statement, i could changes into any other words. One thing to notice, print does only accept string type, to cast types, use the following conversion functions:

  • string() / 字串()
  • bool() / 布林()
  • number() / 數字()

function declarion

func fib(in: number): number {
    if in == 0 || in == 1
        return in
    return fib(in - 1) + fib(in - 2)
}

函式 費氏數列(輸入值: number): number {
    如果 輸入值    輸入值  
        返回 輸入值
    返回 費氏數列(輸入值  )  費氏數列(輸入值  )
}

desc: number, string, and bool are the only three types support currently. And currently we have print function, input function, and random function.

variable declaration

let a = 0
var b = true
val c = "true"

  = 
變數  = 
終值  = "真"

desc: val is equivalent for let, nothing between them are different, and val declares constant variable, which means cannot be reassigned after declared. The only way to change a constant variable is to redeclare itself. Also, variables cannot be reassigned with different type.

That's it :-)

v0.0.1

02 Jan 10:59
Compare
Choose a tag to compare

CASC

A compiler aim for Manderins progremmers

CASC is a handwritten compiler which can compile English or Manderin or even mixed codes!
Currently it's under developement by ChAoS_UnItY.

This project is inspired by Minsk.

Example Code
程式碼範例


> 1 + 9 - 7
3
> 一 加 九 減 七
3
> 1 + 九 減 7
3
> 一加二十一是二十二
True

Preserved Word Conversion Table
保留字對照表


Operators 運算子

Operator Traditional Chinese Simplified Chinese Note
+ 加 / 正 TODO
- 減 / 負 TODO
/ TODO
* TODO
. TODO
( TODO TF
) TODO TF
&& TODO
|| TODO
! TODO
== TODO
!= 不是 TODO
^2 平方 TODO OUA
2√ 平方根 TODO OUA
^^ 次方 TODO OUA
開方 TODO OUA

TF: Testing feature.測試特性。
OUA: Operator Unacceptable. 不接受純運算子,即不接受第一欄位。