wenyan-lang / wenyan

文言文編程語言 A programming language for the ancient Chinese.
https://wy-lang.org/
MIT License
19.72k stars 1.1k forks source link

Is there a plan to provide a language spec? #1

Open nanmu42 opened 4 years ago

nanmu42 commented 4 years ago

Hi,

It would be nice if the language specification can be provided, for example: https://golang.org/ref/spec, so that people may implement/port the language to the backend they like.

Very impressive work, I enjoy it a lot!

freddy5566 commented 4 years ago

agree @nanmu42 , I want to implement other language, does it have doc or something like it?

LingDong- commented 4 years ago

Hi nanmu42 and jamfly, Thanks! Indeed writing the spec is among my top priorities, I’m working on it and you can expect it in a couple of days. Will update here when done. :-)

nanmu42 commented 4 years ago

Brilliant! Looking forward to it. :+1:

das6ng commented 4 years ago

Great work!

FrankHB commented 4 years ago

Well done... possible towards a more practical one not so toyish like Rust? ;)

cuixiping commented 4 years ago
if_statement                : IF if_expression '者' statement+ (ELSE statement+)? FOR_IF_END ;

Should statement+ be statement* ?

LingDong- commented 4 years ago

@cuixiping Good catch! @jiangzoi fix this XD

jiangzoi commented 4 years ago
if_statement                : IF if_expression '者' statement+ (ELSE statement+)? FOR_IF_END ;

Should statement+ be statement* ?

Thank you for proposing this suggestion. Let's see what will happen if statement+ is replaced by statement*: 若「滿足條件」者。也 Which does not make much sense from reading. That is why we consider to put statement+ here.

cuixiping commented 4 years ago

@jiangzoi

若「滿足條件」者。
若非
      do something
也

and why is statement * in for statements but if statement? They should not be different.

antfu commented 4 years ago

Now available on https://wy-lang.org/spec

FrankHB commented 4 years ago

Is this completed? I find the grammar summary, but nothing about semantics, nor any rules of conformance.

fe26game commented 2 years ago