firstname.lastname@example.orgI'm experimenting things with XMPP and I was wondering how can I implement the CORE RFC in an iteration way. I mean, the RFC is huge and I don't want to miss something.
email@example.comI tried to check how other library/server did it but no clue. I would love to validate my experiment over time to check if it's still compliant with the core rfc. I don't really know how to start :)
ZashGood question. Assuming you've heard the "use a library first!" rant and are determined to implement your own, I'd imagine you'd start with a basic stream parser.
jonas’Implementing the XML Stream described in the RFC is a good first start indeed.
jonas’there are fun pitfalls to be found there
firstname.lastname@example.org@Zash Yes that's what I am doing for now. But I don't have any tools to validate if I'm compliant to the CORE rfc. It's just my interpretation and I'm not confortable of claiming that my lib is compliant if I can't test it :s
Samfreyskeyd@jabberx.net: nothing is ever really fully compliant; we all just interpret it and discover the incompatibilities as we go and then try to fix them as best we can :)
ZashNeither do we. Welcome to the eternal "we should have a test suite" discussion 🙂
email@example.com@jonas’ I tried to take babystep on the RFC and implement all the way but I keep refactoring my code every chapter to match the need behaviour which is a lot of time wasted.
ZashThe RFC being huge is a good thing, even if it makes it tough to read. Better that it's explicit and exhaustive than leaving us guessing what to do (yet we do that anyway...)
firstname.lastname@example.orgDo you have any resource that can help me on implementing such things?
jonas’welcome to the game of reading and implementing standards :)
jonas’I implemented a XMPP-specific subset of XML 1.0 a few weeks bcak
ZashBest we can offer is other implementations
jonas’for fun and experimentation. I thought I knew XML 1.0 from my year-long experience with XMPP, but oh boy was I wrong
jonas’I still discovered a bunch of edge cases nobody knew of, and had to take the pickaxe at parts of the code multiple times to do stupid things the standard demands :)
email@example.comI'm trying to implement server part of xmpp here: https://github.com/Freyskeyd/xmpp-rs
Samheh, every time I say "I really know nothing about XML" people are all like "how do you work on XMPP then?"… now you see what I mean :)
firstname.lastname@example.org's still really messy and have no real documentation :'(
SamBest advise I can give you (just in general, this isn't anything XMPP specific) is to always document as you go; it will make development way easier once things start to get bigger :)
email@example.comI can open a stream and bind a resource but I need to implement the authentification part
firstname.lastname@example.org@Sam yes, I did that on first but I was removing and adding stuff so many times that I forgot to do it
ZashAuthentication is another thing best done by using a library.
ZashEven if SASL PLAIN looks really simple.
email@example.comNow I'm focused on splitting logical aspects and trying to base my tests on the rfc to validate it, but it's hard^^
firstname.lastname@example.org@Zash I'm planning to use a preexisting lib for SASL but it's more about how to handle the different authentication and how to deal with the whole session based in my current implementation
theTeddHow to implement XMPP:
1. read the RFC, digest it, and get some sleep;
2. read the RFC again noticing the parts you overlooked, digest it, and sleep;
3. sketch out a rough implementation, sleep;
4. throw away your first sketch and sketch a new implementation, cross-reference this with the RFC, sleep;
5. start writing code;
6. throw it all away and use a library because you value what little sanity you have left;
7. (smugly tell yourself you *could* have implemented it if you wanted to, but there wasn't time, and even though you are using a library, you totally understand the details of how it all works.)
jonas’email@example.com, you may be interested in https://docs.rs/rxml/ which I started specifically to deal with XMPP XML on the server side. The goal being to not even have code for features which could be problematic (such as DTD or entity references)
SamOh nice, I've started this same sort sort of thing a few times but haven't really gotten anywhere; I'll have to read through this. Thanks for the docs.
jonas’might be that search.jabber.network ran with an rxml-based parser for a while ;)
firstname.lastname@example.org@jonas’ I already have a working parser and stream :)