Welcome! Log In Create A New Profile

Advanced

Arbitrary async tasks and services with nginx-haskell-module

Posted by alexey.radkov 
Arbitrary async tasks and services with nginx-haskell-module
October 17, 2016 04:32AM
Here is the article from my blog: http://lin-techdet.blogspot.com/2016/10/asynchronous-handlers-in-nginx-haskell.html
Link to the module: http://github.com/lyokha/nginx-haskell-module
Re: Arbitrary async tasks and services with nginx-haskell-module
October 17, 2016 04:55PM
It may sound daft, but what advantages has haskell over Lua ? (https://github.com/chaoslawful/lua-nginx-module)

---
nginx for Windows http://nginx-win.ecsds.eu/
Re: Arbitrary async tasks and services with nginx-haskell-module
October 18, 2016 04:44AM
I cannot compare them side by side as far as I know lua very little, but I can try to list some prominent features of haskell.

1. Haskell compiles libraries to machine codes and can be loaded as simple as dlopen() lets it.
2. Strong static typing won't let occasionally replace a handler by another one of a wrong type.
3. Even more, strong static typing allows reasoning about impossibility of non-deterministic side effects, i.e. code purity in functions that return pure types. It means, for example, that you cannot make any file operations, opening/closing/waiting sockets etc. in functions that return Int or String: comiler won't let you do that. If you want produce such side effects, then you have to wrap the returned type in IO monad.
4. Pure functions allow very aggressive code optimizations.
5. Objects immutabilty allows very simple and fast garbage collection model (there is no need to watch for global references as soon as they do not simply exist).
6. The language is quickly evolving, the latest ghc 8.0.1 released 3 or 4 months ago had lots of new impressive features. Haskell community is known to be large and friendly.
7. Declarative nature of haskell and functions as first class citizens makes programming in it a real fun and pleasure.

Anyway, I did not try to compete with the lua module, but rather I wanted to educate myself in doing haskell/C cooperation.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 114
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready