News for hackers. Stuff that matters.
Re:Goircd: Minimalistic simple IRC server written on Go by diath on Friday May 08, 2020 @09:13AM (#23114461)
IRC-anything gets thumbs up from me, I always thought that IRC bots are a great way to learn a new language, just a nice project that you could do in a day that would teach you the basics of the language, string manipulation, networking and some stuff here and there, an IRC daemon is taking it a step further. This looks very nice but it really is minimal as the title claims, personally I've been working on one to learn Rust which is more featureful at this point but as it turns out the IRC protocol and server handling is much more complex once you get into the details than it normally seems for such a simple protocol.
Re:Goircd: Minimalistic simple IRC server written on Go by omribahumi on Friday May 08, 2020 @09:26AM (#23114604)
That's what I've been doing since I was 12 years old :)

My first "programming" experience was with mIRC scripts. I even wrote an IRC client using mIRC sockets at some point, and a dummy webserver / SMTP client. When you do things the wrong way, you pick up a lot of new skills. I learned to "reverse engineer" (my implementations were trivial, not fully fledged) protocols with a proxy/sniffer pretty early :)

From there, the first use case I had for every new language I wanted to learn was write an IRC bot. I had written one in VB6, VB.NET, Python and even C/C++ at some point.

It's funny to see this comment on HN, as this has been my mantra for a while now. On top of string manipulation and networking, another important piece it teaches you about a language is using data structures and manipulating data. IRC client is super stateful. For example, it needs to maintain the list of channels you're in, the list of users in those channels, their op/voice status, etc.

Highly recommended as a project for picking up a new language.

Re:Goircd: Minimalistic simple IRC server written on Go by gspr on Friday May 08, 2020 @09:59AM (#23114923)
Me too! I will never forget adding "runtime loadable moduels" to my PHP IRC bot at age ca. 14. Oh my was that functionality a travesty: a user might say something like `!load poll` to activate the poll module. What would my code do? Oh it'd `include poll.php` (or whatever the syntax is, this was both my first and my last PHP project) in the main loop. On every iteration. Because hey, how else would the poll code be able to react to stuff?

I learned a lot of lessons and still have fond memories 20 years later :-)

Edit: Man, just thinking at this has Metallica playing as background music in my head even though I haven't listened to them in this decade. It's so strange how childhood memories can be so incredibly strong and cover so many sensory modalities. These days I can hardly remember what I did last week.

Re:Goircd: Minimalistic simple IRC server written on Go by sitkack on Saturday May 09, 2020 @12:06AM (#23122221)
I suggest you check out http://brainrules.net/ by John Medina, he covers the fidelity of our memories as we age and much more.

https://www.youtube.com/watch?v=NujSdn1bg5k

Re:Goircd: Minimalistic simple IRC server written on Go by v64 on Friday May 08, 2020 @04:30PM (#23119080)
> My first "programming" experience was with mIRC scripts. I even wrote an IRC client using mIRC sockets at some point, and a dummy webserver / SMTP client.

Same here! The mIRC scripting language was incredibly rich, and the ability to create native Windows dialogs with it was a powerful tool.

Back in the 90s, a friend and I reverse engineered the protocol behind a popular program used to play Magic the Gathering online called Apprentice. The protocol was insecure and allowed users to cheat by controlling the outcome of coin flips and other elements of the game. The purpose of the research was to prove definitively that the client could be manipulated, in order to resolve some cheating accusations that had been thrown around.

I set out to write a program that would hook into Apprentice through the Win32 API and allow you to change the program's output, while my friend created an mIRC man-in-the-middle server that you could configure through a dialog box to connect to Apprentice and modify incoming and outgoing protocol messages.

My project never shipped and his reached widespread availability, eventually leading to the development of better clients [1]. The fact that he was able to get so much out of mIRC script (dialog boxes, sockets, event handling, etc) and was able to make it simple for others to use was impressive.

[1] https://en.wikipedia.org/wiki/Apprentice_(software)#Backwash

Re:Goircd: Minimalistic simple IRC server written on Go by baruchel on Friday May 08, 2020 @11:35AM (#23115941)
May I promote the bot I have been running for two weeks? An IRC text game described there: https://pink-dragon.surge.sh/
Re:Goircd: Minimalistic simple IRC server written on Go by paddez on Friday May 08, 2020 @10:00AM (#23114934)
I really wish I kept my mIRC scripts somewhere. It'd be interesting to see how I progressed.
Re:Goircd: Minimalistic simple IRC server written on Go by txdv on Saturday May 09, 2020 @02:22AM (#23122721)
im still trying to write my perfect irc client (the code has to be good). my latesy approach is using functional programming a lot
Re:Goircd: Minimalistic simple IRC server written on Go by jsjohnst on Friday May 08, 2020 @01:12PM (#23117036)
> I always thought that IRC bots are a great way to learn a new language

I personally use the project “writing an authoritative DNS server” as mine. Forces you to think about data structures, TCP and UDP, bit packing, file/DB handling, parsing, concurrency, serialization, etc. If you don’t know DNS really well, wouldn’t be as easy, but once you know it backwards and forwards it’s a really a great way to push a language your learning.

Re:Goircd: Minimalistic simple IRC server written on Go by cobalt on Friday May 08, 2020 @01:15PM (#23117080)
meh.. i wrote my first IRC bot when i was like 12. I don't think i'd get very far writing a DNS server as a 12 yr old
Re:Goircd: Minimalistic simple IRC server written on Go by jsjohnst on Friday May 08, 2020 @04:33PM (#23119104)
If you can write an IRC bot from scratch, you can do an authoritative DNS server, don’t sell yourself short.
Re:Goircd: Minimalistic simple IRC server written on Go by d1str0 on Friday May 08, 2020 @08:37PM (#23121091)
IRC is more immediate and self gratifying. Very important things for a self-taught 12 yo. Not that dns isnt cool, just probably not the best recommendation for a young programmer.
Re:Goircd: Minimalistic simple IRC server written on Go by skrtskrt on Friday May 08, 2020 @04:14PM (#23118942)
How would one start with learning those concepts first? I've been wanting a good way to learn networking that I can code along to in my preferred language
Re:Goircd: Minimalistic simple IRC server written on Go by jsjohnst on Friday May 08, 2020 @04:35PM (#23119144)
> I've been wanting a good way to learn networking

1) Do you learn best by reading books, following tutorials, or watching videos?

2) What programming language do you know best / second best?

Happy to dig up a couple sources for you if you limit the scope a bit via the two questions above.

Re:Goircd: Minimalistic simple IRC server written on Go by skrtskrt on Friday May 08, 2020 @04:56PM (#23119361)
I tend to combine books and tutorials... the more in-depth the better.

I know Python best but am very quickly getting just as comfortable with Go. Would probably want to do this work in Go

Also maybe Rust cuz I want to get around it someday? For Rust I would need more “here’s the literal code”. Python or Go I could probably do it just from pseudo code or high level descriptions

Re:Goircd: Minimalistic simple IRC server written on Go by jsjohnst on Tuesday May 12, 2020 @12:01AM (#23150482)
Ok, I’ll try to send you some stuff this week. Python/Go/Rust is easily doable.
Re:Goircd: Minimalistic simple IRC server written on Go by skrtskrt on Tuesday May 12, 2020 @10:08AM (#23154118)
Thank you! much appreciated