Torrent client - pbTorrent (source code).

Developed or developing a new product in PureBasic? Tell the world about it.
link0101
User
User
Posts: 34
Joined: Mon Jul 14, 2008 5:03 pm

Re: Torrent client - pbTorrent (source code).

Post by link0101 »

really cool Torrent loader, shows that Purebasic can do just about any program you need. love the layout , will have to study your code so I can write my own torrent program and steal other peoples IP addresses lol, jk.

And xorc1zt, Purebasic is just fine the way it is.

I've programmed in almost every language there is, and been doing it for years! there is no other language as power and easy to use as Purebasic.
(well, Maybe Action on the Atari 800, but since I'm the only one I know that still uses my Atari, I'd be alone in enjoying it)

And procedures are just as powerful as classes and methods. and a lot less messy looking.

Purebasic:
Print("Hello World")

Java:
Class Helloworld{
public static void main (String args[]){
System,out.println("hello world");
}
}


So if you like classes and methods, and over complicating a program with massive encapsulations, go for it. I hear they are looking for Java programmers, so theres your calling xorc1zt.

You down with OOP?
No, you know me!,

Not down OOP?,
No , you know me!

Purebasic for the win!
xorc1zt
Enthusiast
Enthusiast
Posts: 276
Joined: Sat Jul 09, 2011 7:57 am

Re: Torrent client - pbTorrent (source code).

Post by xorc1zt »

@Seymour Clufley

continually post snide comments about it?

http://www.purebasic.fr/english/search. ... 7&sr=posts

@link0101

why are u arguing about oop ? no body did talk about it. I really don't like java but your hello world example is miss leading. the benefit of the package system and forced class of java is clearly when you must do a huge project with a team of programmers.
link0101
User
User
Posts: 34
Joined: Mon Jul 14, 2008 5:03 pm

Re: Torrent client - pbTorrent (source code).

Post by link0101 »

Silly me, Assuming you meant the brackets that define an array in Java.

And no, Classes and methods mean no more to a team than procedures do, if you cant work with a team in a procedural language, then you better give up programming.

And most of us are singular programmers . i.e. we program alone, in the dark ( why I have a light up keyboard, laser etched for her pleasure), with a beer at our side, at times .

And just FYI, I program in javascript/html5 also, and I avoid classes as much as possible, you can actually read my code, its amazin, no really, it is!.

Oh and [] or () its still a freakin array to store data!.

So excuse me if your comments on Purebasics syntax being poor lead me to believe you are a Java/C#, C++ OOP programming fool, maybe you should word yourself more carefully next time,

peace out and all that hippy well wishing crap.
Purebasic or bust!!
xorc1zt
Enthusiast
Enthusiast
Posts: 276
Joined: Sat Jul 09, 2011 7:57 am

Re: Torrent client - pbTorrent (source code).

Post by xorc1zt »

you should not put c++ in the same bag as java or c#. c++ doesn't force you to do oop.
using c++ for procedural is easier than with C (namespace, overloading, ...)

about the array, not only java use brackets but also most of the modern languages . i think using () come from the old one FORTRAN. [] got adopted for being less confusing

r = abc(5, 8 )

is abc a array or a procedure ? with [] you will know without any further research. its not a big deal i know.

my second concern was about the multi line statement. actually i am working on a crt monitor with a 1024x768 resolution and not being able to cut line between () is really annoying. implementing this will not turn purebasic into oop.

seriously i didnt want to start a feud about oop. i am not a pro oop neither a procedural fanatic. to tell more about me i started programming with common lisp then ada and c. ada is my fav one when java is the one i hate the most (or maybe objective c which is really ugly :lol: ). to me, the best language right now is python : free, open, huge community, libs for everything. you can do oop, prodecural or functional and even the three at the same time if you want. i don't care if oop will be add to purebasic or not and i not gonna tell you pb cannot survive without it because it not true as you wrote on another thread but imo oop should be add. take a look at what is coming with windows 8 and metro: a huge api totally oop oriented. microsoft want to push C# as their primary language and its gonna getting worse in the future. pb devs could add oop if they want, they know how to but i think they are concerned about breaking the community into oop and non oop codes, they should not.

now u certainly saw dat iam more comfortable to read english than write it so please don't blame me for my crappy syntax here ( :D )
Zach
Addict
Addict
Posts: 1656
Joined: Sun Dec 12, 2010 12:36 am
Location: Somewhere in the midwest
Contact:

Re: Torrent client - pbTorrent (source code).

Post by Zach »

xorc1zt wrote:is abc a array or a procedure ? with [] you will know without any further research. its not a big deal i know.
I'm sorry, but that is an absolute logical fallacy. If you are looking at Purebasic code in an attempt to ascertain what it does, then you either use Purebasic, or have the necessary knowledge of its syntactical rules to port the code you want to another language.

Either situation is precluded by the fact you MUST be familiar with Purebasic syntax in some shape or form, and assuming you WEREN'T in a reader that highlights syntax and/or gives code hints, you still should be familiar enough to know when you are looking at an Array, a Procedure Call, or a Procedure calling into an Array, or any other combination thereof.

Even the third (and irrelevant) possibility that you are just looking at the file with no previous knowledge, because you are wondering what the syntax is like or if it looks "readable" enough to you as a person interested in trying the language out, still implies you would have some sort of reference to look at while you are browsing code.

I have learned to do basic things in several different languages, with a wide variety of syntax rules, and not once was I confused in the manner you have described. I have never been confused this way by Purebasic, either. I just don't see how it is possible. I don't understand what all the fuss is either, to be honest? I bought Purebasic, and I intend to learn Purebasic - that means learning how Purebasic does things whether I think C++/Java/Python/Ruby/Perl/or whatever does it "prettier" or not.

I would also counter with the argument that assuming "Oh, I'm looking at an Array!" when you see [some,thing] in any given language, just because X other languages use this method, is not only stupidly dangerous, but flat out erroneous thinking, and not justifiable criticism of how another language does something.


But moreover, I just don't see why people care so much? If you have a vested interested in something, you learn to use it how it is, and once you learn something it is not that hard to remember (with appropriate effort).


Multi-line statements? Sure I can understand that, I don't think its an unreasonable request.
Much in the same way I and others have wished for
*/
multi
line
commenting
*/

It would also be neat to have docstring functionality, Internal Documentation for our programs as well, which could also be parsed to create a reference manual of some sort on the side.

There are lots of things other languages do well, or better, or that are just plain cool to have. I'd rather focus my energy on those things, than arguing over syntax rules.
Image
Olby
Enthusiast
Enthusiast
Posts: 461
Joined: Mon Jan 12, 2009 10:33 am
Contact:

Re: Torrent client - pbTorrent (source code).

Post by Olby »

Can someone bring a bucket of ice cold water and cool them down! :D

Anyhow amazing application! Professionally designed and shows what PB is really capable of. What else can you possibly want.
Intel Core i7 Quad 2.3 Ghz, 8GB RAM, GeForce GT 630M 2GB, Windows 10 (x64)
Zach
Addict
Addict
Posts: 1656
Joined: Sun Dec 12, 2010 12:36 am
Location: Somewhere in the midwest
Contact:

Re: Torrent client - pbTorrent (source code).

Post by Zach »

Olby wrote:Can someone bring a bucket of ice cold water and cool them down! :D

Anyhow amazing application! Professionally designed and shows what PB is really capable of. What else can you possibly want.

Release a cross-platform compiling source :mrgreen:
Image
xorc1zt
Enthusiast
Enthusiast
Posts: 276
Joined: Sat Jul 09, 2011 7:57 am

Re: Torrent client - pbTorrent (source code).

Post by xorc1zt »

you could use a universal doc maker like robodoc

here is a example http://www.mediafire.com/?onz9iyl37w615so
Seymour Clufley
Addict
Addict
Posts: 1233
Joined: Wed Feb 28, 2007 9:13 am
Location: London

Re: Torrent client - pbTorrent (source code).

Post by Seymour Clufley »

I actually agree with Exorcist that PB should use square brackets for arrays, maps and lists. That would immediately distinguish data storage from data processing (procedures and macros).

But I still don't understand why someone would use a programming language they weren't happy with.
JACK WEBB: "Coding in C is like sculpting a statue using only sandpaper. You can do it, but the result wouldn't be any better. So why bother? Just use the right tools and get the job done."
IdeasVacuum
Always Here
Always Here
Posts: 6425
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: Torrent client - pbTorrent (source code).

Post by IdeasVacuum »

I actually agree with Exorcist that PB should use square brackets for arrays, maps and lists
I do too, I think it would make the code easier to read and it is a fairly common thing. I'm very satisfied with PB though, it's strengths easily out way it's weaknesses.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
Joakim Christiansen
Addict
Addict
Posts: 2452
Joined: Wed Dec 22, 2004 4:12 pm
Location: Norway
Contact:

Re: Torrent client - pbTorrent (source code).

Post by Joakim Christiansen »

Wow, I always wanted to write my own torrent client, thanks for sharing this!
Also I must say that this is one of the most professional project I have ever seen a shared source code for in here. So respect to you!

Would be nice with a English version though.
I have the practice of always commenting my code in English even if it is for my own personal use.
I like logic, hence I dislike humans but love computers.
User_Russian
Addict
Addict
Posts: 1443
Joined: Wed Nov 12, 2008 5:01 pm
Location: Russia

Re: Torrent client - pbTorrent (source code).

Post by User_Russian »

When working on the project, noticed that the compiled program requires too much virtual memory (swap file) - up to 80 MB. Moreover, if the structure Local_TorrentList.Core_Torrent of the procedure Core_NetworkEvent_Thread() File Core.pbi Declare a Static, rather than Protected as at present, the consumption of virtual memory is several times lower that strange.
I think this is due to the fact that the compiler allocates memory for irrational content structures (nested lists of structures containing other lists).
Maybe it's even a bug compiler?
Maybe there is another explanation?
User_Russian
Addict
Addict
Posts: 1443
Joined: Wed Nov 12, 2008 5:01 pm
Location: Russia

Re: Torrent client - pbTorrent (source code).

Post by User_Russian »

Added support for compiling source code in PB 5.20.
Link to files in first post of topic.
anelehto
New User
New User
Posts: 5
Joined: Sat Jun 23, 2012 10:45 pm

Re: Torrent client - pbTorrent (source code).

Post by anelehto »

Very nice and thanks for sharing!

I have a little problem with the udp trackers here though, it can't connect to any peers

Image
User avatar
minimy
Enthusiast
Enthusiast
Posts: 349
Joined: Mon Jul 08, 2013 8:43 pm

Re: Torrent client - pbTorrent (source code).

Post by minimy »

Amazing what you can do with PureBasic and Rusian_User. (do not be angry with me that joke) :D
Congratulations Rusian_User've impressed me with your program.
Thank you very much for sharing! :wink:
If translation=Error: reply="Sorry, Im Spanish": Endif
Post Reply