jdev - 2021-05-30

  1. freyskeyd@jabberx.net


  2. freyskeyd@jabberx.net

    I'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.

  3. freyskeyd@jabberx.net

    I 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 :)

  4. Zash

    Good 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.

  5. jonas’

    Implementing the XML Stream described in the RFC is a good first start indeed.

  6. jonas’

    there are fun pitfalls to be found there

  7. freyskeyd@jabberx.net

    @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

  8. Sam

    freyskeyd@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 :)

  9. Zash

    Neither do we. Welcome to the eternal "we should have a test suite" discussion 🙂

  10. freyskeyd@jabberx.net

    @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.

  11. Zash

    The 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...)

  12. freyskeyd@jabberx.net

    Do you have any resource that can help me on implementing such things?

  13. jonas’


  14. jonas’

    welcome to the game of reading and implementing standards :)

  15. jonas’

    I implemented a XMPP-specific subset of XML 1.0 a few weeks bcak

  16. Zash

    Best we can offer is other implementations

  17. 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

  18. 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 :)

  19. freyskeyd@jabberx.net

    I'm trying to implement server part of xmpp here: https://github.com/Freyskeyd/xmpp-rs

  20. Sam

    heh, 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 :)

  21. freyskeyd@jabberx.net

    it's still really messy and have no real documentation :'(

  22. Sam

    Best 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 :)

  23. freyskeyd@jabberx.net

    I can open a stream and bind a resource but I need to implement the authentification part

  24. freyskeyd@jabberx.net

    @Sam yes, I did that on first but I was removing and adding stuff so many times that I forgot to do it

  25. Zash

    Authentication is another thing best done by using a library.

  26. Zash

    Even if SASL PLAIN looks really simple.

  27. freyskeyd@jabberx.net

    Now I'm focused on splitting logical aspects and trying to base my tests on the rfc to validate it, but it's hard^^

  28. freyskeyd@jabberx.net

    @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

  29. theTedd

    How 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.)

  30. jonas’

    freyskeyd@jabberx.net, 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)

  31. Sam

    Oh 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.

  32. qrpnxz

    lol tedd

  33. jonas’

    might be that search.jabber.network ran with an rxml-based parser for a while ;)

  34. freyskeyd@jabberx.net

    @jonas’ I already have a working parser and stream :)