27 comments

[ 0.21 ms ] story [ 75.7 ms ] thread
It's been a few releases in the last 168 days when I announced PicoTorrent on HN and I'd like to get some input on both the progress as well as the new WebSocket API.

You can find the relevant API documentation at

- http://docs.picotorrent.org/en/latest/websocket-api/index.ht...

I took a quick look to see if I could find this but does picotorrent have RSS support?
No, it does not, sorry. I've been asked this before and perhaps it's something I should prioritize :)
3 essential features: encryption, filter.dat support and RSS =)
Is the 64bit check in CMakeLists correct?

I'm no CMake expert, but this looks odd:

https://github.com/picotorrent/picotorrent/blob/develop/CMak...

    # Get current architecture
    if(CMAKE_SIZEOF_VOID_P EQUAL 8)
        set(PICO_ARCH "x64" )
    else(CMAKE_SIZEOF_VOID_P EQUAL 8)
        set(PICO_ARCH "x86")
    endif(CMAKE_SIZEOF_VOID_P EQUAL 8)
EDIT: this is just CMake's very odd syntax and it's actually a single condition.
It should be correct - or at least, it works for what I use it for :)

What is odd about it?

I don't know much about CMake, but to me the two conditions look the same, but maybe this is just how CMake magically works.
I get the syntax now. This is a single condition, but it has to be repeated three times. Odd syntax.
It's very unusual, but at least it tells a reader what it's an else of.

In code-reviews I still occasionally have to complain about the

    if (condition){
        // 100 lines of code
    }else{
        // 20 lines of code
    }
pattern.

As we're dealing with a language that has a proper subroutines and a return statement, this can just be refactored away.

But CMake might not have either of those (I don't know - I have only ever written a single trivial CMakeLists.txt), so it might just force this pattern and then it's helpful to also enforce the else to restate the condition.

That makes sense, though the way this seems to be required to write in CMakeLists isn't maintainable. I can only guess they have diagnostics that would warn if you typo'd that easy to mistype string.
Oh, yeah, it seems as it is CMake standard to put the if-expression inside the else-parenthesis as well. It is not an elseif.
Yes, came to the same conclusion, seeing how it's the same "string" in IF, ELSE, and ENDIF. Very, very odd syntax.
Whoa, that took me reading it after each sibling comment here and one additional time to "get it". Why does it require the repetition like that?
Is this Windows-only? If not, what's the UI outside Windows?
Yes, that's a good suggestion. The readme is due for a rewrite so I'll make sure to mention that somewhere up top!

EDIT: the parent post was edited, and this comment was written for the original post.

There's a linux directory, what's that for?
I've split the project in two parts, PicoTorrent and PicoTorrentCore. PicoTorrentCore is cross-platform and builds on GCC4.8.

The linux directory contains build scripts to build on Linux, which is used for the TravisCI builds.

And there's no UI yet, right? If you plan to write one, I'd suggest Qt, since you use C++ extensively already.
I hear qt is excellent, but would encourage you to do distinct ui code for each platform, in that platform's native ui libs. You'll look like a fish out of water otherwise.
Yeah, that's what I'm planning in order to keep it small and tidy.
You might want to start with a web UI then (like SyncThing). This provides you with a simple way to display your data and you get Mac / Linux / etc support for "Free" while also allowing your Windows users to have simple network access.

No extra dependencies, no UI toolkits!

To be clear, Qt is as native as you can get on X11 and Wayland. There is no vendor-controlled UI toolkit as on Windows or OS X or Android or ...
Why not using electron on top of the api? it's not overly complicated UI anyway, and it will build on an api that other can use.
(comment deleted)
Sorry about that, I posted too fast and after seeing the linux directory reformulated it.

Basically I was suggesting to more prominently mention it's Windows-only and not just in the list of features.

Never knew this existed. This could possibly replace qbittorrent for me on windows 10. Thanks for great work.