You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have found some interesting properties of the molecule language. I'm not suggesting that you should change the language in any way immediately, just sharing my findings and maybe provide some info if you ever want to evolve the language or the parser.
Import path looks like a path but is actually .., / and identifiers and doesn't include the extension. But it also doesn't allow spaces between the components. So it isn't like C #include "../ some-path.h" and also isn't like rust use super:: some_module. It's pretty unconventional IMO. If you ever want to evolve the language, I would recommend adapting either the C include style where the path is quoted and more characters are allowed and the full path (including extension) is spelled or some module import style where whitespace is allowed between components.
Keywords are not reserved. You can have a field called struct. (But when you do the generated code doesn't actually compile.)
(I noticed these because I was playing with lexers and was trying to build a lexer for the molecule language but find it really hard due to the above properties: it's hard to disallow whitespace between import path components if you are ignoring whitespace everywhere. And it's hard to distinguish identifiers and keywords if keywords are not reserved.)
The text was updated successfully, but these errors were encountered:
I have found some interesting properties of the molecule language. I'm not suggesting that you should change the language in any way immediately, just sharing my findings and maybe provide some info if you ever want to evolve the language or the parser.
Import path looks like a path but is actually
..
,/
and identifiers and doesn't include the extension. But it also doesn't allow spaces between the components. So it isn't like C#include "../ some-path.h"
and also isn't like rustuse super:: some_module
. It's pretty unconventional IMO. If you ever want to evolve the language, I would recommend adapting either the C include style where the path is quoted and more characters are allowed and the full path (including extension) is spelled or some module import style where whitespace is allowed between components.Keywords are not reserved. You can have a field called
struct
. (But when you do the generated code doesn't actually compile.)(I noticed these because I was playing with lexers and was trying to build a lexer for the molecule language but find it really hard due to the above properties: it's hard to disallow whitespace between import path components if you are ignoring whitespace everywhere. And it's hard to distinguish identifiers and keywords if keywords are not reserved.)
The text was updated successfully, but these errors were encountered: