Inline Assembly in F#
blog.devgenius.io
blog.devgenius.io
> First, F# doesn’t support function pointers
As an experiment, can you work around this with the (deprecated) inline CIL operator: (# ... #)
https://stackoverflow.com/questions/15968054/what-is-the-syn...
To enable it, you need to add the --compiling-fslib flag, which basically declares "hi i want to build a stdlib, I know what I'm doing (the flag is undocumented btw)" and as a result it doesn't include the FSharp.Core library and all the built-in modules.
So your code fails to compile because it doesn't know 'string' or 'printf', AFAIK manually adding the reference isn't enough, you would need to statically include all the FSharp.Core source code.
AFAIK you cannot get the RID at runtime, but you can easily set the RID of your program/package to the supported platforms only
I'd avoid assembler unless its separated into an architecture specific file. Otherwise this hack is asking for trouble.
Also funny I never really understood C# / .NET packages until F# because it's way simpler and less abstracted.
https://dotnet.microsoft.com/en-us/learn/dotnet/what-is-dotn...
I used it on a project where I converted the expression tree to a graph query language "cypher".
One thing I don't get about the async story in Computation Expressions is the sudden need for you to think about return/return!
Couldn't CE continue to use "return by last statement" and then do the CE-invoking version with exclamation mark in the end?
let private readUrls () = async { (IO.File.ReadAllLinesAsync "urls.txt" |> Async.AwaitTask)! }
Would probably break something I haven't thought about.
Also the whole task vs async confusion is a bit difficult to wrap your head around. I understand .net6 introduced task {} CE, but you still need to have two stories in your head and convert back and forth and use async {}