-
Notifications
You must be signed in to change notification settings - Fork 301
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
[Rust] Can't get minimal example to run #3637
Comments
@Freymaurer can you replace the script with a consoleapp fsproj?
in the same directory and moving your code then adjusting the Cargo.toml like the screenshot below, then
then
|
We also have a setup guide for Rust here and it is indeed using I know that in past |
Ah yes i see, it worked with a .fsproj. Will there be .fsx support in the future? Just asking out of interest |
One more issue i found when testing async: //Program.fs
let asynWaitNPrint(wait: int) = async {
do! Async.Sleep(wait)
printfn "Hello World!"
return 0
}
[<EntryPoint>]
let main argv =
asynWaitNPrint 1000
|> Async.RunSynchronously Calling the output with Compiling fable-rust-sample v0.1.0 (C:\Users\Kevin\Desktop\fable_transpile\rust)
error[E0432]: unresolved import `fable_library_rust::Async_`
--> Program.fs.rs:16:33
|
16 | use fable_library_rust::Async_::Async;
| ^^^^^^ could not find `Async_` in `fable_library_rust`
error[E0432]: unresolved import `fable_library_rust::Async_`
--> Program.fs.rs:17:33
|
17 | use fable_library_rust::Async_::runSynchronously;
| ^^^^^^ could not find `Async_` in `fable_library_rust`
error[E0432]: unresolved import `fable_library_rust::Async_`
--> Program.fs.rs:18:33
|
18 | use fable_library_rust::Async_::sleep;
| ^^^^^^ could not find `Async_` in `fable_library_rust`
error[E0432]: unresolved import `fable_library_rust::AsyncBuilder_`
--> Program.fs.rs:19:33
|
19 | use fable_library_rust::AsyncBuilder_::bind;
| ^^^^^^^^^^^^^ could not find `AsyncBuilder_` in `fable_library_rust`
error[E0432]: unresolved import `fable_library_rust::AsyncBuilder_`
--> Program.fs.rs:20:33
|
20 | use fable_library_rust::AsyncBuilder_::delay;
| ^^^^^^^^^^^^^ could not find `AsyncBuilder_` in `fable_library_rust`
error[E0432]: unresolved import `fable_library_rust::AsyncBuilder_`
--> Program.fs.rs:21:33
|
21 | use fable_library_rust::AsyncBuilder_::r_return;
| ^^^^^^^^^^^^^ could not find `AsyncBuilder_` in `fable_library_rust`
For more information about this error, try `rustc --explain E0432`.
error: could not compile `fable-rust-sample` (bin "Program") due to 6 previous errors looking like this in vs code |
@Freymaurer A lot of
The full list of features is available here. But yes, async support is still somewhat sketchy at the moment, for example |
I see, yeah i wanted to add Rust support to Fable.Pyxpecto, as it supports js, ts, py and .net in the latest beta release. Sadly i have 0 knowledge about rust and would be of no real help implementing. Just wanted to increase support. |
I think this issue can be closed for now :) |
Description
I should start with i have never done anything with/in rust before.
Here is what i did trying to setup fable-rust.
dotnet new tool-manifest
dotnet install fable
Cargo.toml
(See Repro code)test.fsx
(See Repro code)dotnet fable test.fsx --lang rust -e rs --noCache
, creatingtest.rs
.cargo clean
cargo build
get the following error:
Repro code
Copying the code from
test.fsx
into fable repl does not print"Hello World!"
either.Expected and actual results
I would expect
"Hello World!"
console output.Related information
4.6.0
The text was updated successfully, but these errors were encountered: