More reactions to Ged's remark, where he said,
"I can see FBP and Rust being excellent complements. Rust is great, but
it's uncompromising approach to safety and tight resource management can
drag down productivity. Defining safe, tight components in Rust to
be composed using as FBP IDE for high velocity delivery looks to be an
ideal partnership,"
I'm afraid my initial enthusiasm has waned - I am just about ready to give up on Rust for the FBP environment! I wouldn't have come to this conclusion if I hadn't tried to get something working...
I have spent (wasted?) the last week trying to get a simple FBP proof of concept going in Rust - I know someone else has put a similar idea up on GitHub, called RustFBP, but I prefer to implement my own! My attempt still does not compile, so I can't even begin testing! FYI, the URL is
https://github.com/jpaulm/rust-test/blob/master/src/main.rs .
A nice chap in Germany has modified my code so that it does run, but he is cloning connections (and maybe also closures?), which IMHO doesn't make much sense, and seems unnecessary, just to get around Rust's paranoia (!), so I am trying to use pointers, which feel more in keeping with real FBP... ! This in turn seems to lead to a lot of weird "lifetime" stuff... Getting some simple code working shouldn't be this hard!
Andrew Cherry on the Slack group made some changes earlier, which worked and which I have kept - thnaks Andrew! - but I needed more function, hence my current situation... I would like to move on, but can't get past this point! Help!
I also need a mechanism for storing individual components in separate
source files ("crates"?) - I can't even start that until I get the
present version running...
Preliminary reactions:
a) my code is a dog's breakfast (with apologies to dogs) - a lot of the declarative stuff is unnecessarily repeated - at any rate, when I leave it out, the test ('cargo run') tells me to put it back! Why could Rust not just use a simple system of declaring variables, and then using them without having to repeat all the declarative info?
b) I don't like not being able to look at a variable and see what type it is - Rust claims to be type-safe, so why not just write in the types, instead of having it be deduced?!
c) all this "lifetime" garbage - FBP has a nice clear lifetime concept, so there should be a way in Rust to say "trust me - I know what I'm doing"! Instead I get the impression that the Rust folks think they're smarter than anyone else! However, apparently they are not familiar with FBP, so FBP and Rust are very much working at cross-purposes! This won't be the first time that I've experienced this feeling of frustration! By comparison, when something works well with FBP, it feel great! :-)
d) There doesn't seem an easy equivalent of Java 'null' - that's weird! That should be in all languages!
e) The only tool I've found that gives half-way useful diagnostics is 'cargo run', but it gives too many, and often its recommendations don't work when I try them out! Basically, same problem as before - it doesn't understand FBP, and doesn't understand why one might want to pass IPs from one process to another via connections!
e.g. thread::spawn(move || {
| ^^^^^^^^^^^^^ `(dyn FnMut() -> bool + 'static)` cannot be shared between threads safely
what the h*** does that even mean? I never said I wanted to share it...
So, if any of you are FBP and Rust enthusiasts, and feel they can work together, please take a look at my chunk of code, and tell me how to get things rolling again! There are probably tools that would help, but so far I have not run across them!
Thanks in advance, and
<End of rant!>