23 ms·
Ruma, a Matrix homeserver written in Rust
- Perceptes 10y agoAuthor of Ruma here. I can answer any questions people have. Ruma is in very early stages of development, if it's not clear from the website, so it can't actually be used for its intended purpose yet, but we're getting there. :}
- fit2rule 10y agoWould love to know how you're testing it .. can you describe your rig?
- Perceptes 10y agoThe basic functionality of the homeserver is only just starting to land, so we're not testing any of the federation aspects yet. The current test suite is just your standard web app integration testing. Take a look at the repository's README[1] for some high-level details, and src/test.rs[2] for details of how it's actually achieved in Rust using the iron-test and diesel crates. The PostgreSQL database used for testing is managed with Docker and Docker Compose. [1] https://github.com/ruma/ruma https://github.com/ruma/ruma [2] https://github.com/ruma/ruma/blob/04e5af143136c026c1b74499219eb3180096bfbd/src/test.rs https://github.com/ruma/ruma/blob/04e5af143136c026c1b7449921...
- Arathorn 10y agoIt's worth noting that the Matrix.org project itself provides an integration test harness called sytest which can be pointed at other HS implementations to check their behaviour: github.com/matrix-org/sytest
- shimo5037 10y agoThe name of the project means "ugly" in Finnish. I wouldn't sweat it though, no one cares. Just thought I'd let you know since it's mildly humorous.
- Perceptes 10y agoI learned that recently and also thought it was pretty amusing. Cheers. :}
- buovjaga 10y agoThere's a pair of bars called Ruma in Finland: http://www.ruma.fi/ http://www.ruma.fi/
- SilasX 10y agoWait till you hear what rust(y) means/connotes in English! (Seriously, I know it seems minor, but I've always hated the name they picked; it's almost like they named it "filth".)
- eximius 10y agoAnecdotally, it is named after a certain multi-stage lifecycled fungus. Much better :)
- steveklabnik 10y agoThat's one of the various reasons for the name; there's no single reason Rust is named "Rust."
- SilasX 10y agoMaybe so, but if they had named it "filth" and explained that it was this Uber-geeky reference, I'd still say it's a bad name for the same reason.
- eximius 10y agoI also tend to think of thermite before uncleanliness when I hear rust. Rust is just iron oxide, not anything dirty.
- 10y ago
- akerro 10y agoHow does end-to-end encryption compares to tox? Tox uses TOXID - huge hexadecimal numbers as encryption key and DHT to find peers. Once you connect to a friend you know their IP, all messages, AV and file transfers are encrypted. I find a lot of documentation about it is missing. Would like to know which tox or matrix will be better for my next project. Tox also doesn't expose any metadata.
- Perceptes 10y agoEnd-to-end encryption is still in the draft phase in terms of the Matrix specification—there hasn't yet been a published version of the spec that includes it. Synapse, the reference homeserver implementation, and Vector, the premiere web client, are still developing the implementation and will be deploying it sometime soon, likely followed by a new version of the spec that formalizes it. The documents I know of that provide details about it are here: * https://matrix.org/jira/browse/SPEC-162 https://matrix.org/jira/browse/SPEC-162 (the tracking issue for the feature in Matrix's issue tracker) * https://matrix.org/git/olm https://matrix.org/git/olm (C implementation of the protocol formerly known as axolotl v2 developed for use in Matrix) * https://matrix.org/speculator/spec/drafts%2Fe2e/client_server/unstable.html#end-to-end-encryption https://matrix.org/speculator/spec/drafts%2Fe2e/client_serve... (draft of the spec for E2E)
- akerro 10y agoThanks, I will try to find some time and join your team and help with development. I lost hopes in tox despite being much more mature than matrix.
- zanny 10y agoDepends on your definition of mature. The security was mature, but the UX was always garbage and there was never consensus in the ecosystem and huge swathes of critical features (like usable dns) have never been wholly adopted. Matrix is lacking its E2E encryption but already has everything else. You can use Vector today to replace Hangouts or Skype completely.
- deleted 10y ago
- rajanchandi 10y agoWhat is the underlying protocol that Ruma uses for communication? Is it HTTP, XMPP or something else?
- Perceptes 10y agoIn terms of OSI layer 7 protocol, Matrix uses HTTP, though in the future it may specify other application protocols.
- rajanchandi 10y agoThe problem with HTTP is that it drains 11 times more battery on a mobile phone than something like MQTT.
- gmfawcett 10y agoCan you give any evidence to support that statement?
- Arathorn 10y agoAs Perceptes says, Matrix is designed to have modular transports. So if you want to use MQTT or CoAP or WebSockets or whatever for the client/server API, then go for it :) PRs welcome!
- akerro 10y ago[sources required]
- alex_duf 10y agoI don't know if you're involved in Matrix's development, but what's the advantage compared to XMPP? I feel like it's bringing a new protocol that - as xmpp - is unlikely to break the massive silos that are Hangout, Messenger, whatsapp etc... Or am I wrong, and if so what did I miss? Edit: Don't get me wrong, I'm dreaming to see the end of that fragmentation happening, and I don't want to discourage anyone to address that problem, I'm simply wondering if anything is fundamentally different from XMPP. Edit2: found a few answers here : https://matrix.org/docs/guides/faq.html#what-is-the-difference-between-matrix-and-xmpp https://matrix.org/docs/guides/faq.html#what-is-the-differen...
- Perceptes 10y agoI answered the same question elsewhere in the thread so I will just link to it: https://news.ycombinator.com/item?id=12028977 https://news.ycombinator.com/item?id=12028977 Happy to follow up with additional questions, though!
- kovrik 10y agoWhat is `Matrix homeserver'?
- DiabloD3 10y agoLiterally the first paragraph answers this.
- kovrik 10y agoYes, missed that somehow. Thanks and sorry.
- ahazred8ta 10y agoOui. "Matrix is an open specification for an online communication protocol. It includes all the features you'd expect from a modern chat platform"
- CMCDragonkai 10y agoBut what is a "homeserver"?
- ahazred8ta 10y agoapparently 'homeserver' = 'P2P node' running as a service on your system
- Perceptes 10y agoFor a lot more detail, including a better explanation of homeservers, take a look at the Introduction to Matrix guide in the documentation: https://www.ruma.io/docs/matrix/ https://www.ruma.io/docs/matrix/
- axonic 10y agoAwesome! I was selecting a Matrix implementation but not anymore I think. Thank you.
- Mandatum 10y agoNice little project, really clean code - super easy to understand after reading some of the Matrix spec.
- kiba 10y agoSomehow, I was expecting a virtual world simulator before opening up the link.
- netforay 10y agoLooking for Matrix vs Jabber. Is there any comparison document? Also I was just trying to implement our own Telegram Server to take advantage of Free Telegram Clients available. Can anyone compare Telegram with Matrix. (Except the Federated part).
- Perceptes 10y agoJabber (XMPP) has two fundamental differences from Matrix, as I see it: XMPP is a spec for a system for exchanging messages. It has very small, granular "extensions," most of which are optional. Matrix is a spec for a system that stores arbitrary data ("events") and a way to synchronize and resolve conflict across federated servers. It doesn't have extension specifications like XMPP does, and includes a much more complete set of features in its core, to ensure that all client implementations have compatible features. This is a problem in XMPP, where many features can't be used effectively because the servers cannot assume that all clients understand many of the extensions. More detail in Matrix's FAQ: https://matrix.org/docs/guides/faq.html#what-is-the-difference-between-matrix-and-xmpp https://matrix.org/docs/guides/faq.html#what-is-the-differen...
- Arathorn 10y agohttps://docs.google.com/spreadsheets/d/1tv5QTuoS29YwApP7i2OKe9aLrZZIwgY-f5b-d73vlI0/edit#gid=0 https://docs.google.com/spreadsheets/d/1tv5QTuoS29YwApP7i2OK... is a fairly comprehensive (crowd-sourced) comparison of different FOSS messaging clients, including Telegram.
- Animats 10y agoThat's nice, but is Matrix going anywhere? There are so many of these federated social systems now (Diaspora, Urbit, Gnu Social etc.) with few users. (And they don't interoperate with each other, which is a lack.) Maybe we just need some federated system that's a directory only. All it does is help you find people and resources, after which they speak end to end.
- Perceptes 10y agoWhat you're asking is pretty hard to answer, since you're essentially asking if a particular technology will become popular. If anyone had the ability to answer such a question, they'd make a lot of money. :} Matrix is still a new technology and most of its specifications are not yet stable. Most of the implementations of Matrix clients and servers are very young, too. Even Vector, the feature-rich web client, which is developed by the Matrix team, only recently entered public beta. The development of the spec and of the tools must come first before the system can be used by the masses. But that's what's happening now. I'd call that "going somewhere!"
- akerro 10y agoGood luck than.
- Arathorn 10y agoIt's worth noting that Matrix is the only federated system which sets out from the outset to bridge together all the others (hence the name Matrix). Whilst we don't have bridges to diaspora/urbit/gnu social yet, it's only a matter of time. PRs welcome! In terms of the community size - looking at just the Matrix.org homeserver, there are around 300K messages a day, 250K users (of which about 200K are bridged), and 30K rooms. Meanwhile there are at least 500 openly federated homeserver installations we can see from the Matrix.org homeserver. Synapse is relatively mature as a homeserver (although it still has performance challenges; it is very cool to see Ruma progressing!) - meanwhile Vector as a flagship web/ios/android client is in late public beta and very usable too - eapecially with end-to-end encryption on the horizon. I may be biased (being project lead for Matrix), but I'd say that it's going somewhere :)
- chjohasbrouck 10y agoWould you say the Matrix specification is intended to compete more with messaging (Slack, Skype, etc), email, or both? What do you think people would use this for, and what's the value proposition?
- Arathorn 10y agoMatrix itself is a fairly flexible building block for decentralised communication of any kind where you care about decentralising the conversation history. You can use it for messaging, VoIP, IoT data - and once threading lands it'll be good for email and forums too. Right now most of the clients are geared up for the messaging and VoIP use cases. The value prop is to provide a meta-network which connects together all the existing communication silos, so users can talk to folks on other platforms (eg Slack, IRC) without caring what service or client they are using. Ideally someone on Slack could end up talking to someone on IRC, bridged via a decentralised Matrix room, without even realising they are using Matrix. Alternatively you could use a native Matrix client like Vector.im or the Matrix API to get at the data. The key thing is that no single silo ends up owning or controlling the data - it is replicated over all the participants, who thus own the conversation equally. The end goal is to let users select which communication apps and services they want to trust with their data (including running their own, if they so desire), rather than the communication and contacts being fragmented over hundreds of different apps.
- moosingin3space 10y agoDoes this imply that one could build a distributed GitHub-style issue tracker/pull-request manager on top of Matrix? That sounds pretty awesome, if true.
- Arathorn 10y agoYes, you could, although it's not a perfect fit right now as the only data structures you get in matrix are a timeline of arbitrary objects (events) for a room, and a key-value map of arbitrary "state" events. This is flexible enough for many purposes (and you could probably use them for issue tracking and PR management), but we can't efficiently store arbitrary object graphs or trees yet. It'd be great to get there though; meanwhile there are other projects like IPFS and IPDB which are active in that space too.
- ambrop7 10y agoSlightly off-topic, but, as far as Rust goes, I've completely given up on it after realizing (after much study) that it is unsuitable for event-driven (callback-based) design. In short, its idea of ownership, borrowing and references is incompatible with "lower" objects knowing about their "parents" and invoking callbacks to them. I know there are ways to get around but I don't see any which is sufficiently good for me (e.g. low boilerplate, scalable/composable, no compromise of performance). Some details are in my question on StackOverflow[1]. One particular example that C and C++ allow is to have an object "self-destruct" itself in a callback (e.g. after a TCP disconnect, EventLoop callbacks Socket callbacks MyClient which directly destroys MyClient including Socket). Yes it is indeed valid to call a (virtual) function on a class and for that class to proceed to delete itself [2]. This is very nice because it removes need to have special cleanup code all around and/or half-dead states. In Rust, this seems impossible by design (i.e. would need unsafe, and it's unclear if the compiler itself allows it anyway). [1] http://stackoverflow.com/questions/36952894/event-driven-design-with-callbacks-in-rust http://stackoverflow.com/questions/36952894/event-driven-des... [2] http://stackoverflow.com/questions/3150942/c-delete-this http://stackoverflow.com/questions/3150942/c-delete-this
- moosingin3space 10y agoYou should try rotor for event-driven programming - it uses composable state machines to define network protocols.
- biokoda 10y agoRight now I'm working on something where the choice was between Nim or Rust. I required integration with lots of C/C++ code and there are callbacks from C that execute my code, Nim was the clear choice. The main app is C that links all my libs together, but the actual C code just calls a Nim to execute the code. I talk to all the C libs using Nim. I'm very happy with that decision. It was a breeze to setup and is great to work with.
- baq 10y ago> I required integration with lots of C/C++ code and there are callbacks from C that execute my code, Nim was the clear choice. i don't follow - Rust integrates with C quite well, too.
- aphextron 10y agoRelevant XKCD: https://imgs.xkcd.com/comics/standards.png https://imgs.xkcd.com/comics/standards.png Neat project though.
- deleted 10y ago[deleted]
- JepZ 10y agoHey man, that's what I thought... ;-)
- Perceptes 10y agoI didn't downvote your comment, but I do want to provide a response for anyone else reading: This comic gets linked quite a lot when discussing new systems, and I and many others see it as a fairly low-effort jab. I'd venture a guess that anyone reading HN has seen this comic before, and the creators of systems like Matrix are certainly not oblivious to it as common criticism. While there is danger of becoming yet another variation that doesn't "win" or solve problems in a meaningful way, the folks developing systems like Matrix think they can do more to help by approaching these problems in a new way than they can by throwing up their hands and living with the problems, and I think that effort deserves respect. It'd be more constructive to do some reading about the protocol, become more familiar with it, and share more specific criticisms that concern you than to drop a link to the comic everyone has seen before.
- _pmf_ 10y agoThe problem is that Matrix is positioned right in the middle of the train wreck of unfulfilled promises left behind by Google Wave, XMPP and (for those of enough to remember it) Chandler[0]. It's something that a lot of people (including myself) really, really want to succeed, but all previous trials failed (even when only E-mail was around; now we have the data silos by Twitter and Facebook that are additional obstacles). Even after almost a decade, the well is still poisoned for everyone from Google's botched Wave rollout; if even Google (with the tremendous leverage of Gmail) was unable to pivot communication is this direction, who will? [0] https://en.wikipedia.org/wiki/Chandler_(software) https://en.wikipedia.org/wiki/Chandler_(software)
- partycoder 10y agohow does matrix compare to the wave protocol
- Arathorn 10y agoThey are related to some extent. The big differences were that Wave was built on XMPP, driven largely by and for Google, and put higher emphasis on collaborative editing and threading and less on bridging. Matrix is non-profit opensource and focuses on defragmentation and bridging from the outset. Matrix also provides many more clients than were ever available for the Wave protocol, some of which have subjectively better UX. If Wave had bridged with protocols like email or IM, provided a clearer UX for newbies, and nurtured an open community and network rather than focusing primarily on Google's use cases, Matrix probably wouldn't be needed today.
- annnnd 10y agoI haven't had a chance to work on a real-world problem with Rust (I mostly use Python, but have started learning Rust for fun), so this is genuine curiosity speaking: is this (https://github.com/ruma/ruma/blob/master/src/main.rs#L60 https://github.com/ruma/ruma/blob/master/src/main.rs#L60) idiomatic Rust? If I understand correctly, lines 63-76 are using chaining because Rust doesn't support optional / named parameters? And lines 78 - 107 are basically just "run server if no error"? Seems like an awful lot of code for what it does... Could it be make nicer or is such level of verbosity something normal in Rust? EDIT: again, not trying to put anybody down, I would just like to learn if this code is representative of bigger Rust apps.
- MHordecki 10y agoIs it that verbose, though? I have a hard time seeing how it could be made any shorter in other languages, without sacrificing functionality. EDIT: I think what gives the code its length here is the explicit error handling. If you do the same in Python you'll end up with the same amount of code. In Rust, you could unwrap() everything and lose nice error messages and probably slash the LOC in half.
- reissbaker 10y agoWith the built-in error handling macro, you can generally do: let value = try!(fn_that_may_error()); Rather than having to muck around with explicit matching on Ok vs Err. The try! macro would make the linked function much less verbose... Except that what try! does is bubble the error further up the stack by returning an Err if the called function returns an Err — and since this is the main function, there's nowhere up the stack to go (main() has a return type of "Unit," which is Rust's version of void or null; for functions that pass errors up the stack you'd have a return type of Result<ReturnType, ErrorType>, which allows errors to be returned), so try! can't work. I agree that some of that error handling in 79-101 is pretty awkward looking, but luckily it's not super representative of idiomatic Rust: usually you can make Rust much more concise by using try!, with the exception of the main() function which can't use try! and has to actually handle the error.
- tambourine_man 10y agoMatrix (the protocol) seems very interesting, I wasn't aware of it.
- ckok 10y agoSo how usable is this atm? Can it be used with vector yet to setup a fully working homeserver?
- Perceptes 10y agoNo. It's in very, very early stages of development and is not usable for its stated purpose yet. All the attention on HN is appreciated but unfortunately premature in terms of being able to promote it as a working program.