-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add formal EBNF syntax for Flint #170
Comments
The Flint grammar is specified here: It's not exactly EBNF, but close. |
Nice. I will convert to EBNF and play with Nearley to parse the current files :) |
Flint compiles to IULIA bytecode, which can be embedded in a Solidity file. However, features such as line-by-line debugging wouldn't be possible. I'm not a fan of compiling Flint to JS. Rather than building a web-based IDE/playground, I think a binary application is better suited for debugging. It would allow to interact with the bytecode itself (which is what will actually be deployed to Ethereum), rather than a JS version—which is not guaranteed to be equivalent to the bytecode. |
Please make a PR once you have an EBNF! :) |
Sure. Just to clarify, I won't compile Flint to to JS code, but rather try to use Remix & use bytecode for maximum compatibility. Do you have link to IULIA bytecode? I googled but instead found Julia lang. |
Hmm, so you would still like to reimplement the compiler? What is the purpose of that? |
Thanks for the link. I will start with EBNF first. I'm not very familiar with Swift. As Flint is still fresh, I think that having a tool to convert Solidity to Flint would be more useful than writing a new Flint compiler at the moment :) When the language is more mature, I think then we could have another Flint compiler implementation. I would be happy to learn more about Swift and contribute to the project :) |
Swift is easy to pick up, and its type system has some nice features—which a lot of my OCaml friends like. I'd recommend trying it out! A Solidity to Flint compiler would be useful but I think would be challenging! I'm glad you'd like to contribute to the Flint compiler! I think a good start issue would be #116. Let me know if I can help! |
Hehe, you are right. I realised Flint compiles to Solidity and compiling Solidity to Flint is going backward. It won't be possible until standard library, structs in Solidity are done properly. |
@franklinsch What is
|
Thank you for spotting that! Please feel free to submit a PR, otherwise I can do it as well. |
Sure I will create a PR :) |
I have a few questions:
Thanks. |
So as we discussed in #192
Should be changed to:
That's only for dynamic variables, not for properties that can be initialised in the |
The delimiter between statements in Low-level types will not be accessible by the user directly. They can be dangerous to use. Flint's Yes, the parenthesis mean optional. Hope that helps! |
I replied in #192 :) |
Thanks. I will support both |
Please enlighten me more about Flint |
Adding very large In Flint, an exception should be thrown on overflow. There should be a This is tracked by #193. |
Work is being done slowly here: https://github.com/vietlq/flint/tree/scratch/add-nearley-parser |
References from JSON:
I can help with this one :) It will be very useful for have formal EBNF syntax specification as we can use that to develop independent implementations. I want to develop one in JS or ReasonML/OCaml and compile to JS and then have a similar playground like Remix https://remix.ethereum.org or https://reasonml.github.io/en/try.html for people to learn & deploy quickly.
Developing a parser and syntax highlighter for Flint in JS would be a piece of cake when using this tool: https://nearley.js.org
Use this tool for syntax diagram generation: http://www.bottlecaps.de/rr/ui
The text was updated successfully, but these errors were encountered: