-
Notifications
You must be signed in to change notification settings - Fork 1
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
Running Flint #31
Comments
Hi Beatriz, You seem to be trying to install an old version of Flint. We have done a complete rewrite. The instructions for building the new Flint compiler are at: https://github.com/flintlang/flint-2/blob/master/docs/guide.md#building-from-source You need to start by installing LLVM and Rust. We're interested if this works for you. Cheers |
You may be having trouble because your default LLVM installation is the wrong version. If you homebrewed LLVM, I imagine you would have LLVM 10 (which is correct). But you may have another version acting as the default. If you can find the path to your llvm-10 installation, you can compile with We’re just curious. What are you hoping to do with Flint? |
It would be nice to have a formal semantics. We don't actually have a published paper (there is one on Arxiv and a short one right at the begining of Flint) on Flint and if you produce good semantics we would be happy to try to put a Flint paper together for publication. George said: You will need to run cargo with the To compile a contract, the syntax (I think) is |
The goal of our work is to define a small smart language with behavioural types. Flint is a good starting point, since it has typestates; Featherweight Solidity (FS) is another source of inspiration since it is a core language with a formal semantics and a type system. To better understand a formal language and to debug its definition, we use Racket, as it allows to take a formalisation of a programming language and to have a step-by-step visualisation of the formal semantics, by using Redex (one of its many tools). With it, we are able to generate reduction graphs automatically, and see the environments change with the progression of the evaluation of the expressions and check if the formalisations are indeed correct. Right now we wrote in Racket the formal semantics of FS. It was not super easy, but we managed to achieve the goal. With the lessons learned we intend to formalize Flint, so we can better understand your language. The aim would be then to get the “best” from Flint and FS and add a typestate/behavioural type system, inspired by yours and by approaches like Mungo. Also, can you give me an example on where am I supposed to write Thank you :) |
LLVM_SYS_100_PREFIX=<path_to_llvm> cargo run ... You can also make it permanent for the current command-line session by running: export LLVM_SYS_100_PREFIX=<path_to_llvm> |
Hi, So I removed the parenthesis and run My version of llvm is 10.0.1_2 . |
This part (and any use of the
|
That still seems to be complaining about no LLVM found. Have you run the |
Yes, I ran the |
Maybe that is the problem, try with a slash in front of
|
Does the file |
As for the main.flint in the language guide, this is not your fault. It was an oversight on our part and should not be in the guide, since it is not implemented in flint2. The working version of this is the counter.flint contract in behaviour tests. However, the assert contract is compiling for me. I get the same error as you when I change my flint-config.json file to make it wrong. Have you set up your flint-json file to specify where flint can find llc (needed to create LLVM byte code) and wasm-ld (needed to link web assembly methods into the LLVM code)? |
I've just run the assert contract and had the same error message as you. I didn't have wasm-ld-10 installed, but after installing the lld-10 package the assert contract is now compiling for me. Let us know if this fixes your issue! |
I'm sorry, I didn't understand, what am i supposed to change in the
Im running it on a mac, should i install lld? |
So the flint-config file tells the compiler how to construct the LLVM code when you compile to eWASM. For this, it needs the llc command to create the bytecode, and the wasm-ld command to import the various eWASM functions. So you need to set the paths in the config file. This will depend where your llc and wasm-ld commands are. I am on a mac, and my LLVM installed llc and wasm-ld into my path, so for me I just set my llcPath to llc, and my wasm-ldPath to wasm-ld. Obviously you will first need to find your installations (probably to be found in the bin of your llvm installation). |
Once you've run the |
Thank you very much for your help :D Another question, in your language guide you refer some constants and variables can be declared without a value associated to it, therefore being set to |
I think you're referring to this sentence in the language guide:
let <name>: <type> What we meant was that if you don't assign a value to a constant in the contract declaration, you must assign a value to it in the contract initialiser, therefore there are not any predefined values for these constants. However, the check for this in the compiler is currently unimplemented. I hope that helps! |
Oh ok :) thank you! Btw I have been trying to run the |
If you're using the WebAssembly Studio website to run the I hope that helps :) |
Hello,
I am trying to install and run flint on my mac, but I cannot do it.
I tried through Docker (in your language-guide there's a . (dot) missing at the end of the command
sudo docker build -t "flint_docker"
) and on the [15/17] there is an undeclared type 'PropertyListEncoder' which then results in an error.I also tried building from source, and I installed the Solidity Compiler but when I do
which solc
nothing appears, only when I dosolcjs
. So I cannot run your code as there is nosolc
command.Is there another way to do it?
Thank you!!
The text was updated successfully, but these errors were encountered: