All the F# code that's fit to tweet!
All you need to use fsibot is a twitter account. Send a tweet to @fsibot, and if is a valid F# expression, fsibot will evaluate it and reply to you with the result of the evaluation:
@yukitos "F# for fun!"
— fsibot (@fsibot) August 29, 2014
Unlike FSI, the F# Interactive, you do not need to terminate your expression with ;; to get it evaluated. However, if you do, fsibot should be able to handle it:
@waarnink 10
— fsibot (@fsibot) September 1, 2014
fsibot evaluates expressions only. As a result, using printfn in your exchanges with @fsibot will probably not work as expected, because printfn pretty-prints as a side effects, but evaluates to unit.
> printfn "%s" "Hello, world";;
Hello, world
val it : unit = ()
Typically using printfn will result in a dreaded
@panesofglass <null>
— fsibot (@fsibot) August 23, 2014
If you use sprintf instead, you can now ace your next interview, and dazzle the audience, with a twitter-sized FizzBuzz implementation, right from your cell phone:
@ashtonkj ["1"; "2"; "Fizz"; "4"; "Buzz"; "Fizz"; "7"; "8"; "Fizz"; "Buzz"; "11"; "Fizz";
"13"; "14"; "FizzBuzz"; "16"; "17"; "Fizz"; [...]
— fsibot (@fsibot) August 25, 2014
Similarly, let will by itself not do anything; the following code will bind x to 42, but not "return" anything:
> let x = 42;;
val x : int = 42
You can however use let - as long as your expression evaluates to something:
@teramonagi ""F#" is the best language which I know!!!"
... or using some F# Verbose syntax:
@teramonagi "NABE-ATSU"
— fsibot (@fsibot) August 30, 2014
Yes, F# is a fantastic language for parallel computing. Yes, it's also awesome for data processing. However... if you are using System.Threads or System.IO (for instance) when interacting with @fsibot, I suspect you might not have the best intentions in mind. So @fsibot, in the sake of self-preservation, might just decide that your plans are evil, and not evaluate what you sent it. Also, if your expressions doesn't evaluate in a reasonably timely fashion, @fsibot will probably decide to just cancel it.