Replies: 7 comments
-
Idea: Would it be possible to include a general purpose inline command analoge to the planned inline assembly to directly include some code in one of the compilation target languages and then even get rid of some of the commands that are hard/ugly to implement in all target languages?
|
Beta Was this translation helpful? Give feedback.
-
The js target supports (or supported before it broke): |
Beta Was this translation helpful? Give feedback.
-
As for v's goto translation to JS, js supports labeled continue/break |
Beta Was this translation helpful? Give feedback.
-
Thanks @spytheman. Did not know about # notation. This is handy! But a labeled continue/break is not really the same as a goto in c right? I mean it will still be impossible to jump to an arbitrary position in the js code but you can just break or continue outer loops right? |
Beta Was this translation helpful? Give feedback.
-
Yes, but you can structure the generated JS code in such a way, that it is enough in most cases. V's goto is not unrestricted, just like C's goto is not unrestricted - it can not jump outside the function in which it is. |
Beta Was this translation helpful? Give feedback.
-
I'm still not sure about Needed it for code translated from C. |
Beta Was this translation helpful? Give feedback.
-
What about making it reserved (including semantics - i.e. development of V should always consider there might be some After some time (maybe about 3 years since the first stable backwards-compatible release) we could decide to abandon it completely or enable it depending on situation (I can only think of valid |
Beta Was this translation helpful? Give feedback.
-
V is looking really promising. I understand that V is intended to transpile into multiple target languages (at least c & js)?
Quickly scanning the language I was wondering how you intend to generate low level constructs like "goto" into languages like js?
I could imagine that most of V could be compiled into good looking js code but some features like goto are hard for me to imagine to generate human readable/understandable js code.
Will all language features be available for js target?
Beta Was this translation helpful? Give feedback.
All reactions