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

Fable as a Service (Repl) #82

Open
citymeterio opened this issue Nov 21, 2018 · 6 comments
Open

Fable as a Service (Repl) #82

citymeterio opened this issue Nov 21, 2018 · 6 comments

Comments

@citymeterio
Copy link

citymeterio commented Nov 21, 2018

I'm struggling with building fable-splitter.
It requires to be comfortable with the stack (npm, yarn, dotnet, webpack, fake, packet) and I'm not yet there.
But if I 'm not mistaken I have noticed once on some video that somebody was running F# script through fable-repl online with the POST request. Is this feasible? If not could you Guys think about such a solution?
I really need the simplest possible "fsx2js for the PoC I'm creating for my team leader/product owner.

@alfonsogarciacaro
Copy link
Member

Currently the fable-repl is just static files so there's no backend service. I guess it shouldn't be difficult to create a dotnet/node simple server to provide such an end point, but you'll have to deploy it somewhere by yourself as we don't have a server infrastructure for Fable at the moment. The tricky part is you need to keep the FSharpChecker alive to avoid huge load times, so using a serverless function is not an option.

@nojaf and @jindraivanek have created similar REST services, maybe they can give some hints.

@forki
Copy link
Contributor

forki commented Nov 22, 2018

Even a serverless function can have static variables. It would not cold start with every call. It only cold starts when it's provisioning a new instance and that's rare. But in these cases you definitely have slow down. So if you want to guarantee fast results for every single call then you need something else.

@nojaf
Copy link
Member

nojaf commented Nov 22, 2018

Hmm, its not impossible as mentioned above, however the things we did always had a cold start.
Alfonso is talking about ast-viewer and fantomas online.

@citymeterio
Copy link
Author

I was able to use fable-splitter with Fulma minimal template. This combination seems to be the simplest for a laic. Now I assume it shouldn't be a problem to update F# script file on the fly and trigger fable-splitter command having deamon always being alive. I only need this strange setup for the PoC. Then I plan to dive into the real internals or other possibilities

@jindraivanek
Copy link

I wrote blog post about my setup: http://jindraivanek.gitlab.io/blog/2018-10-22-FAKE-continuous-deployment/

Cold vs hot start is big diff, something like 5s vs 0.5s.

After I figured out deployment process, I didn't have any problem with server, it just works(TM). However as my server have only 1GB RAM, bigger input can bring the service down, so I limit input size to 10kB. Code from F# compiler is good test case for this :)

@citymeterio
Copy link
Author

Thanks @jindraivanek , I will test it as well. I do not have any hardware limitations from the server point of view

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants