Using the WebSharper Compiler to Write Node.js Applications

I was wondering if the WebSharper compiler can be used to write Node.js applications in F #. Are there any resources available that could show me how to do this? Are there any good reasons not to try to do this?

+4
source share
1 answer

[I would post it as a comment, but it took a little longer ...]

Here's another good reason not to do this - F # agents and asynchronous workflows provide a parallel programming model, which in many aspects is much better than Node.js. For instance:

  • it gives you both concurrency and true parallelism so you can write code that doesn't block the system when you need to do some work using the CPU
  • asynchronous workflows provide an easy way to handle exceptions and handle resources
    (you can use try .. with in asynchronous (or event-based) code)
  • agent-based programming model gives you a great way to maintain state

If you can use F # to write your server application, you can also use the powerful abstractions that it provides. See Server-side functional programming for a brief introduction. I also spoke up F # on the server side , which was recorded and discussing the same topic.

This is not necessarily the reason why not try it. Trying to do this can be fun, and if you like the F # language, but want to use it in a Node.js environment, then it would be very helpful to have this.

+10
source

Source: https://habr.com/ru/post/1436902/


All Articles