machuidel
https://gist.github.com/machuidel/d7cc099ddc4970c6ddf4
By adding more abstractions it should even be possible to support semigroups, monoids etc.
Of course this was just for fun.
My system is dual-boot Windows / Linux using Grub and somehow it did not break (showing that MS knows how to not break dual-boot). So I used Windows 10 Pro for a while only to discover that they removed "Services for Unix" NFS support which is now only available for Windows 10 Enterprise.
I've been using Linux for 20 years and am finally looking into not using Windows anymore at all. People may call it childish (my experience 20y advocating for Linux / BSD etc.), but I just do not trust them anymore. I also did not forget how they compared open-source with cancer and communism, something I think a professional company should never do.
For people thinking this will close the web even more because the source will not be "human"readable. Remember that JavaScript gets minified and compiled into (using Emscripten) as well. The benefits I see compared to what we have now:
- Better sharing of code between different applications (desktop, mobile apps, server, web etc.)
- People can finally choose their own favorite language for web-development.
- Closer to the way it will be executed which will improve performance.
- Code compiled from different languages can work / link together.
Then for the UI part there are those common languages / vocabularies we can use to communicate with us humans: HTML, SVG, CSS etc.
I only hope this will improve the "running same code on client or server to render user-interface" situation as well.
Somewhere along the line a kind of "takeover" happened. I am not going to say that the people doing this are "evil" or something as they at least contributed something that can be used for free. Difficult to argue with that. But I cannot stop myself having the feeling that there is some hidden agenda of interests behind it as well. For me this "takeover" looks similar to what happened to W3C where certain people (companies?) started to ignore them and created HTML5 instead. I really like the well-formness of XHTML where XML itself is very strict and has many built-in features which are still missing inside what replaced them in popularity, like JSON. The people of W3C knew what they were doing and strived for every change to be stable and future proof which can be a slow process. Too slow for some people it seems.
Of course I tried to use Systemd and was really happy with it till the moment it started crashing and taking some clusters down with it. I migrated 2 servers to the new Debian and everything went well. Even the LXC containers started just fine until I started to upgrade the containers to the new Debian as well. At that time I did not even know the author of Systemd was the same as the one that started Pulseaudio, but somehow these issues gave me the same feeling of uncertainty that reminded me of it.
For the servers I am now using Gentoo (as almost every other distro already switched to systemd) in combination with OpenRC without any issues. Compilation of source packages happens on a separate server where I can test them before deploying the binary packages I just build to the test and production servers.
The server is stateless because it receives the latest state from the client (location, cookie and other headers) and sends an new updated state (location, set-cookie and other headers) to the client again along with an optional representation. There is no need for the server to keep the state in memory anymore. Because the server does not keep the state it does not matter which copy of the server (in case of load-balancing or fail-over etc.) handles the next request as everything needed can be derived from the state sent along with request from the client.
Keep in mind that it is best practice to be able to reproduce a representation by the use of a resource identifier, like with "pure functions" in functional programming, it should be deterministic. The content of a representation may change but not the semantics of it.
The part that is stateful is the state that is being passed back and forth between the client and the server.
Does that answer your question?
HTTP basic auth does this automatically.
Creating a resource for a session is optional but may be useful if the state to sent back and forth is too big. But this will require centralized storage.
The state may be stored inside a cookie where parts of it can be encrypted. It is also possible to specify that parts can only be updated by the server.
You may also use Local Storage and send the data across using an XMLHttpRequest or even use a HTML form (which may have limited support for the HTTP verbs).
Read my other comment for more information.
Recursion can be done by the use of nested "resource identifiers" (SSI or ESI for example) inside the returned "representation". A "connector" may then decide to do another request to replace the "identifier". If the "connector" uses caching it may not even need to do another sub-request. I use this to do something like what Facebook's Relay does. As the full state is always being sent along with every request it is very easy to scale because the servers, wherever they are, always have enough context to be able to work with it. A server may even ignore what it does not understand for the next layer to handle it called "partial understanding" which is supported by XML for example. Unfortunately when using JSON most of these advantages are lost. That is why I prefer a less verbose "XML Infoset" similar to JSON while still keeping all the advantages.