Thursday, September 10, 2015

New home address

Cadrature du code is changing its home URL. It is still hosted by Blogger but it is now accessible using my own domain name.

So from now on, this blog should be accessed through http://cadrature.cadrian.net

Of cource, Blogger's address stays available.

Wednesday, September 9, 2015

Gate's channels

This blog entry is not really structured. I write it at the same time that I read and modify Gate's source to introduce the channels (see my previous entry).

While working on Gate's code, I found an interesting thing.
The whole client-server communication is centralized on the "server" side, which implements… The server itself, of course, but also a "proxy" that is able to talk with it.

Great! It means that extracting the communication protocol itself will only involve changes in the server package. No shotgun surgery in the whole project.

The currently implemented protocol is go's RPC client, which works via HTTP. Not a bad choice; but I really would like to propose at least one alternate implementation, using ZMQ.

So the first thing is: move the current implementation out of the server implementation (which should concentrate on just implementing server stuff, not protocol), and out of its proxy implementation.

Well… the role of the proxy is only to send things to the server; but I like the symmetry, similar to ISO's stack: one layer talks to its counterpart at the same level. Hence, the server talks with its proxy, and each one should contain a "channel" object; each channel object should be able to talk to another channel object.


Now committing, pushing, publishing… and going to bed :-)

Thursday, September 3, 2015

Reading Gate's code

I needed to read again Gate's code to see how much Pwd diverged from it. Remember: Gate was a Pwd port, written some time ago, but not really maintained; whereas Pwd continued to evolve.

The most striking differences are:
  • Pwd supports named pipes and low-level sockets as client-server channels. (There was also a ZMQ attempt, not finished.) On the other hand, Gate only supports RPC on HTTP. I need to extract the "channels" behaviour, maybe with another naming since "channel" is a native Go concept. Then, I may want to implement a ZMQ "channel".
  • Pwd started to support a web interface, never finished. Gate could use one, too — but only if I intend to finish it (i.e. not now).
Otherwise, the porting was quite fidel to the original. Maybe too much; the server start and synchronization method uses the same kind of algorithm: start the server process, and try to open a socket until it answers and abort if it takes too long. Not pretty! That's why I want to use ZMQ instead: it should better hide those gory details.

To be continued…

Cad reboot

Holidays are over.

Now is time to start again that blog in earnest.

I plan to post at least once a week. To do so, I need to tighten a bit the topic. This blog is about my pet projects; but I own quite a lot of those. I intend to focus on one project for the moment.

The chosen project is: Gate, a port of Pwd to golang.

A few reasons:
  • It is written in Go, and I need to update my skill in that language, because I am interested in knowing more than one OO language and culture.
  • Eiffel, and especially Liberty Eiffel, is as good as dead. I still dream of reviving it — although I love the language, I am afraid that won't happen; in the last few years, nobody has taken time to build the needed community (me included, mea maxima culpa).
  • I need a more solid design, and I intend to rewrite Gate with that aim in mind
  • I need to write blog posts and that is a good opportunity :-)

So, if you are interested in some language learning and some (useful) software building… Stay tuned.

Merry hacking!