Re: Cerealed v0.6.1: even less boilerplate for binary serialization

2015-08-03 Thread TC via Digitalmars-d-announce

On Monday, 3 August 2015 at 12:21:05 UTC, Per Nordlöw wrote:

On Monday, 3 August 2015 at 11:51:24 UTC, Atila Neves wrote:
Yes. `cerealise` and `decerealise`. The former is slightly 
weird for performance reasons. It takes a lambda that tells it 
what to do with the resulting bytes.


Close with LDC and DMD, faster with GDC: 
http://forum.dlang.org/post/nkcelouzpjsgmqtvn...@forum.dlang.org


Nice!

Are there any plans to add different backends (for instance 
msgpack) to Cereal? Then we could have one package to rule them 
all!


I'll try Cereal in favor of msgpack next time!

Thanks, Atila!


As I tried the changes on the same test as in [0]
It went on my PC like this:

DMD debug:
Cerealed: 2 secs, 854 ms, 687 μs, and 2 hnsecs
MsgPack:  2 secs, 328 ms, 698 μs, and 3 hnsecs

DMD release:
Cerealed: 1 sec, 619 ms, 570 μs, and 9 hnsecs
MsgPack:  1 sec, 554 ms, and 185 μs

LDC2 release:
Cerealed: 966 ms, 398 μs, and 4 hnsecs
MsgPack:  926 ms, 792 μs, and 3 hnsecs

GDC release:
Cerealed: 1 sec, 97 ms, 892 μs, and 1 hnsec
MsgPack:  1 sec, 138 ms, 359 μs, and 2 hnsecs

So it's almost the same now.

[0] 
http://forum.dlang.org/post/nkcelouzpjsgmqtvn...@forum.dlang.org


Vibe-d MQTT client library

2015-07-25 Thread TC via Digitalmars-d-announce
I wanted to announce the first tagged version[0] of native D MQTT 
client library for vibe-d.


It's just the first release so there are features missing, but 
hopefully with community help, they will be there soon.


It's tested against RabbitMQ[1] message broker.

I wanted it to be as lightweight as possible, so it has no other 
direct dependencies but vibe-d.


There are already mqttd broker implementation by Atila Nevens[2] 
and his cerealed serializer I know of. Actually they were both 
helpfull resources - so thanks for that.


Main differences are:
- messages are structs not classes - avoid GC as much as possible
- focus on the client side
- serialization is done simply, just to work with defined 
messages (not as a generic serialization) with range interfaces - 
speed is on par with msgpack-d[3]
- hopefully clean easily understandable code with a lot of 
comments in it to make it easier for contributors

- supports the latest MQTT protocol - 3.1.1

I still consider myself as a D rookie, so there are surely places 
which can be done better, more D idiomatic way. You are welcome 
to point me to them or even create pull requests.


[0] http://code.dlang.org/packages/vibe-mqtt
[1] https://www.rabbitmq.com/
[2] http://code.dlang.org/packages/mqtt
[3] https://github.com/msgpack/msgpack-d


Re: Vibe-d MQTT client library

2015-07-25 Thread TC via Digitalmars-d-announce

On Saturday, 25 July 2015 at 17:46:23 UTC, Martin Nowak wrote:

On Saturday, 25 July 2015 at 15:23:48 UTC, TC wrote:

It's tested against RabbitMQ[1] message broker.


You also intend to work on a direct AMQP implementation?


It would be nice to have too, but according to specs[0], it seems 
to bee a lot of effort to make in comparison to MQTT.


Maybe STOMP[1] protocol can be interesting too, but it's even 
simpler..


Btw what version of AMQP will be preferred? I guess 1.0, but it's 
totally different to 0.9.1 which RabbitMQ mainly uses.


I can read through specs to at least see how hard it is, I can 
imagine doing the packets serializations/deserializations (it's 
not hard, but takes time to write packet structures and proper 
unit tests), but for now I'm just learning vibe-d and don't feel 
too confident in it to write protocol that complex - but with 
shared efforts it can be done ;-)


[0] 
http://docs.oasis-open.org/amqp/core/v1.0/amqp-core-complete-v1.0.pdf

[1] https://stomp.github.io/stomp-specification-1.2.html