V: Provide a full syntax diagram of V

Created on 2 Sep 2019  路  8Comments  路  Source: vlang/v

As long we have no up-to date language reference besides of the tutorial, a => Syntax Diagram could possibly help to write V code and keep up with ongoing changes in the V language specs (e.g. recently the signed integer type "i32" has been made an invalid type in favor of its former alias "int").

Ideally this diagram would be build automatically from source and be updated each time one compiles V using the native V-compiler (ASCII-art representation would be more than sufficient for now), and be used to display it on the vlang.io homepage.

What do you think, would this be valuable for people learning V or working with it?

Feature Request

All 8 comments

All new breaking changes will be taken care of by vfmt. User code will be automatically upgraded.

All new breaking changes will be taken care of by vfmt. User code will be automatically upgraded.

All right, so at least this sounds like backwards-compatibility to older version's source code which is good!

How about the learning aspect of the issue? Perhaps some kind of EBNF would be a good start at least?

How about the learning aspect of the issue? Perhaps some kind of EBNF would be a good start at least?

I'm all for it :)

Unfortunately I can't work on it right now. My hands are full.

Unfortunately I can't work on it right now. My hands are full.

I understand, I will close this in favor of #288 then for now - thx for pointing to it

Just in case someone digs up this issue one day. there is an other example how a language specification could be displayed: https://ziglang.org/documentation/master/#Grammar

FYI.
Welcome to Railroad Diagram Generator!
https://www.bottlecaps.de/rr/ui

I prefer to PEG notation for describing V specification! https://github.com/pointlander/peg

Was this page helpful?
0 / 5 - 0 ratings

Related issues

clpo13 picture clpo13  路  3Comments

choleraehyq picture choleraehyq  路  3Comments

vtereshkov picture vtereshkov  路  3Comments

PavelVozenilek picture PavelVozenilek  路  3Comments

penguindark picture penguindark  路  3Comments