UWP (Universal Windows Platform) port

Hi everyone!

I am completely new to Tribler, having just recently heard about it. I was wondering, if the community would be open to a UWP port of Tribler. I believe the new Windows 10 additions to the Windows Runtime allow for a full fledged implementation of Tribler without any limitations. With just 1 implementation, the community could obtain a Windows Store version compatible with Windows 10, Windows 10 Mobile and Windows 10 for IoT.

Being somewhat disillusioned by the way Torrex uses the Windows Runtime, I thought of writing my first Windows Store App to be a UWP Torrent client with a decent XAML-based UI. libTorrent building atop other libraries that are not WinRT compatible, I would’ve had to implement a torrent library for myself. Since the protocol is documented, it wouldn’t have been too big of a job. (Yes, a lot of work, but pretty straightforward.)

When I encountered Tribler, I thought to myself: why not jump to the next generation of torrent, and write a Tribler client in WinRT? I would be willing to take part in the implementation keeping it as a low-priority task beside my PhD, but I am much interested in gaining experience with C++/CX, XAML, as I have already fooled around with these MS techs.

We are working on separating the Tribler core from the GUI, so new GUIs can be created for it. It still is not ready and the core will still be Python based. But if you want to help with decoupling the GUI from the core so you can create a new gui for windows 10 that would be great!

The problem is that Windows Store only allows statically linked native code to be published. Python is pretty much a dealbreaker.

If there is ongoing work in trying to separate the UI from the Core, I would also advise applying MVVM (Model, View, View-Model) design. You can find plenty of information online what this means. In short, it is a design pattern employed throughout Microsoft Apps as a means of separating application logic from OS and UI interactions. Generally, you have your data layer in the Model layer. This part of the code is meant to be portable, C++ let’s say. Views are interfaces that you communicate with, such as opening network sockets, opening files, making something appear on the UI, etc. Views are usually stuff that you are not the implementer of. Views are things like XAML files descripting UI, OS calls for loading files, and things like that. The translational layer between the Model and the View is the Model-View layer. It is responsible for casting of types between the two layers, relaying messages, etc. The Model speaks to the View-Model through ordinary function calls, and the View-Model speaks to the Views in all sorts of manner. Function calls when speaking to OS API, Commands/Delegates when speaking to XAML, etc.

While MVVM is known to be embraced by MS, it can be applied to non-MS tech. Essentially, someone developing against Qt can do the very same thing. Commands/Delegates and Data Binding in Qt terms is Signal/Slot and Properties. The pattern can be applied anywhere where you want to decouple app logic and protocols from speaking to external modules that you do not own.

The reason why libTorrent is not WinRT compatible is because it uses Boost::asio to talk over the network, which invokes WinAPI, an OS API not accessible to Windows Store Apps. Application logic passes the ViewModel a string as IP address and port, and the ViewModel will take care of making the connection through whatever library it interfaces with, and returns a stream of char, another type known by the Model. Every platform can have their own ViewModels and implementing Views, as far as they all speak the language of the Model.

Do you think such a pattern could be applied to the codebase? Native code in the long run would be beneficial once the design phase if more or less complete and one can start focusing on performance.

We don’t care much for what Microsoft decides is the right thing to do :wink: Our program runs in Linux, OSX and Windows and we are not going to rewrite the whole thing and switch dependencies just so it can be accepted in a given store. Sorry.