Skip to content
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

Suggestion: create a socket implementation for Http.fs #64

Open
haf opened this issue Apr 5, 2015 · 2 comments
Open

Suggestion: create a socket implementation for Http.fs #64

haf opened this issue Apr 5, 2015 · 2 comments

Comments

@haf
Copy link
Owner

haf commented Apr 5, 2015

This would allow us much more granular testing of web servers and would allow the F# code to be written in an exception-free style, supporting exhaustive case analysis/static analysis. In the future, that socket implementation could form the basis of Suave and any other TCP lib such as the Kafka F# client I'm writing. In the future, such a socket lib could optionally make use of F* to prove the state machine, all the way up the abstraction stack; from TCP state machine, to HTTP as a protocol, to HTTP as an application protocol, to entities/resources, to 'webmachine'/Freya-style APIs, to server-sent-events as pushed versions of eventually consistent read models, to CRDTs (but now I'm getting ahead of myself) over HTTP.

It would allow specific timeouts to be controlled and the state to be passed around rather than wrapped in the Socket object -- and that state to be inspected, as opposed to the exception-driven model of .Net's Socket (and it's also an implicit model, e.g. the Close() call, which modifies internal state)

@relentless
Copy link
Collaborator

Are you talking about replacing the whole WebRequest part with a socket implementation, e.g. https://msdn.microsoft.com/en-us/library/bew39x2a(v=vs.110).aspx?

If so, it does sound like a very interesting prospect, although to be honest I don't really have the time (or, currently, knowledge) to take that on. I'd be more than happy to use this project an an incubator for that and get involved where I could.

If you're not talking about that, please correct me.

@haf
Copy link
Owner Author

haf commented Apr 6, 2015

Yes, exactly. At one point in the chain of abstractions, so to speak.

Actually, I'm thinking even lower-level than that; the linked article already has an implementation inside suave that makes it really easy to use; so that would be the first step, but I'm thinking that we can bake it all together; Suave is really nice in some ways, like the async sockets, Freya has real parsers for all the web RFCs and this library has an immutable foundation that's good to build on, a nice API and some users. Also thinking about Hopac instead of Async (throughout) and hopefully in the future something like a micro-kernel like Mirage, but from F# and F* that's fully async, only a few MB and runs well on different sorts of hosting platforms. AOT compilation in Mono is probably a piece of the puzzle.

@haf haf added the enhancement label Aug 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants