|
|
| Author |
Message |
W-Unit Newbie

Joined: 29 Jul 2004 Posts: 83
|
Posted: Oct 16, 2004 8:18am Post subject: Can it be done? |
|
|
| Since I am having NO LUCK in programming C or C++ on my Windows computer (absolutely refuses to compile), do you think it would be possible to code an IRCd in C# or Perl and if not, why? |
|
| Back to top |
|
 |
EviL_SmUrF Lurker

Joined: 23 Feb 2004 Posts: 219
|
Posted: Oct 16, 2004 9:34am Post subject: |
|
|
anything is possible. ive seen ircd's coded in mirc script.
however the question you need to be asking is, "is it worthit?" |
|
| Back to top |
|
 |
upinsmoke Newbie

Joined: 01 Mar 2004 Posts: 59 Location: pennsylvania
|
|
| Back to top |
|
 |
katsklaw Guru

Joined: 28 Jun 2004 Posts: 1614 Location: Somewhere you're not.
|
Posted: Oct 16, 2004 4:02pm Post subject: Re: Can it be done? |
|
|
| W-Unit wrote: | | do you think it would be possible to code an IRCd in C# or Perl and if not, why? |
If you have to ask this question, then it's obvious that you don't know enough about these languages either. |
|
| Back to top |
|
 |
W-Unit Newbie

Joined: 29 Jul 2004 Posts: 83
|
Posted: Oct 17, 2004 12:40pm Post subject: Re: Can it be done? |
|
|
| katsklaw wrote: | | If you have to ask this question, then it's obvious that you don't know enough about these languages either. |
Heh. I knew that from the beginning, but this is how you learn, no?
I know I can at least get it started, and from there I will ask on perlmonks.com when I need help.
I was just wondering if there was any specific reason that I couldn't find an IRCd coded in anything but C, save a couple that were C++. Other than that, I couldn't find any other languages. |
|
| Back to top |
|
 |
chrishogben Lurker

Joined: 09 Sep 2003 Posts: 216 Location: UK
|
Posted: Oct 17, 2004 2:19pm Post subject: |
|
|
Wow, someone managed to dig up my old project of WaveIRCD. I would just like to say, that after some memory tests with PHP, it has been decided that it is simply not worth it.
For every client that connects, another 4KB of memory is used by PHP, but never freed, therefore eventually PHP will crash from memory exahaustion.
But yes, If you do have the tools, and the persiverence, anything is possible.  |
|
| Back to top |
|
 |
katsklaw Guru

Joined: 28 Jun 2004 Posts: 1614 Location: Somewhere you're not.
|
Posted: Oct 17, 2004 2:23pm Post subject: Re: Can it be done? |
|
|
| W-Unit wrote: | | katsklaw wrote: | | If you have to ask this question, then it's obvious that you don't know enough about these languages either. |
Heh. I knew that from the beginning, but this is how you learn, no?
I know I can at least get it started, and from there I will ask on perlmonks.com when I need help.
I was just wondering if there was any specific reason that I couldn't find an IRCd coded in anything but C, save a couple that were C++. Other than that, I couldn't find any other languages. |
Then go for it  |
|
| Back to top |
|
 |
w00t Eleet

Joined: 09 Jun 2004 Posts: 698 Location: Nowra, Australia
|
Posted: Oct 17, 2004 10:20pm Post subject: |
|
|
| chrishogben wrote: | | For every client that connects, another 4KB of memory is used by PHP, but never freed, therefore eventually PHP will crash from memory exahaustion. |
Were you using the standard fsock stuff? |
|
| Back to top |
|
 |
aquanight Lurker

Joined: 14 Jun 2004 Posts: 116 Location: Boise, ID
|
Posted: Oct 17, 2004 10:28pm Post subject: Re: Can it be done? |
|
|
| W-Unit wrote: | | I was just wondering if there was any specific reason that I couldn't find an IRCd coded in anything but C, save a couple that were C++. Other than that, I couldn't find any other languages. |
w00t found a (crappy) VB IRCd. Google "site:sourceforge.net fastvbircd" |
|
| Back to top |
|
 |
w00t Eleet

Joined: 09 Jun 2004 Posts: 698 Location: Nowra, Australia
|
Posted: Oct 17, 2004 11:54pm Post subject: |
|
|
| And made it much better, hopefully... one of these days, i had really better try get it finished :p |
|
| Back to top |
|
 |
EviL_SmUrF Lurker

Joined: 23 Feb 2004 Posts: 219
|
Posted: Oct 17, 2004 11:54pm Post subject: |
|
|
yeah, i know the guy who coded vbircd. use to talk to him all the time :p
its actually quite interesting |
|
| Back to top |
|
 |
Snerf Newbie

Joined: 15 Sep 2004 Posts: 76 Location: IRC
|
Posted: Nov 23, 2004 4:56pm Post subject: |
|
|
Writing an IRCd in C# would be rather interesting to do.
Since the Mono Project is going rather well, and as long as you dont want to run WinForms, the code should run Cross Platform.
Of course, writing an IRCd to begin with, is no easy task. But I am sure someone would have some fun coding it.
my 2cents |
|
| Back to top |
|
 |
codemastr Idler

Joined: 05 Feb 2004 Posts: 345
|
Posted: Nov 23, 2004 10:22pm Post subject: |
|
|
| Quote: | | I was just wondering if there was any specific reason that I couldn't find an IRCd coded in anything but C, save a couple that were C++. Other than that, I couldn't find any other languages. |
There are two main reasons for this. First, the original IRCd was written in the 1980s. Back then there was no C# or even a standard C++. The only powerful language you had that could do the stuff necessary for an IRCd was C. Today, most IRCds out there are still based on this original. Probably 80+% of the code is different, but it was originally based off of it, so it is still in C.
The second reason is performance. Yes, you can write an IRCd in Perl, in PHP, in VB, or in most any other language. But, it might be significantly slower. Out of all high-level languages out there, C is the fastest. So when you want to serve thousands and thousands of clients, it makes sense. C++ is not quite as fast as C, but it is close, and it also provides several other benefits that make it significantly easier to use, so some chose C++. Plus, the close relationship between C and C++ makes switching very easy. Things like Java or C# are also good choices, but they are generally slower. Java uses byte code and C# uses CIL, this will, most of the time, make them slower. But, they provide significantly safer code which, with today's fast machines, is often more valuable than speed.
In short, making an IRCd in C# would be fine. Perl would probably be borderline. It is an interpreted language, but the way it works makes it OK for an IRCd (hybrid language implementation). But something like PHP, I wouldn't recommend that. |
|
| Back to top |
|
 |
W-Unit Newbie

Joined: 29 Jul 2004 Posts: 83
|
Posted: Nov 26, 2004 9:58am Post subject: |
|
|
I don't know much about other languages, but isn't PHP intended primarily for programming web sites? It seems pointless to me to try to program an IRCd in something like that.
While we're on the topic, I've heard people say that PHP is similar to the mIRC programming language. If there's any truth to that then its going to waste a lot of space, even if it didn't cause memory crashes. |
|
| Back to top |
|
 |
codemastr Idler

Joined: 05 Feb 2004 Posts: 345
|
Posted: Nov 26, 2004 12:53pm Post subject: |
|
|
| Quote: | | I don't know much about other languages, but isn't PHP intended primarily for programming web sites? It seems pointless to me to try to program an IRCd in something like that. |
Yeah, well Perl was designed for, as it's name says "practical extraction and reporting" not making an IRCd. But, languages evolve. PHP is used in much more than just websites now.
| Quote: | | While we're on the topic, I've heard people say that PHP is similar to the mIRC programming language. If there's any truth to that then its going to waste a lot of space, even if it didn't cause memory crashes. |
Umm, there is absolutely NO relation between the two. Anyone who says that has never even seen PHP. PHP is an object oriented language based on the Zend scripting engine. mIRC script is an imperative language based on a custom script engine. PHP and mIRC are no more similar than Perl and C. The syntax might be a bit the same, but the languages are completely different. |
|
| Back to top |
|
 |
|
|
| |