What's the best way to do something like an IRC client where there's messages coming from the network you'll want to display without interrupting the user's input.
I'm using a toy language (MzScheme), so I don't have easy access to some curses library or ptys or anything like that...
Any ideas, or should I just give up and write a curses wrapper? Can GNU Readline do anything like this?
Oh, I haven't read SICP, and I won't do it because I don't read programming books.
The reason I'm using Scheme... well, I started the app off with C, and wanted GNU Guile scripting but had some problems with threading, and thought I might just write it in Scheme instead :/
Funny you saged this thread so much while you all still reply to even worse threads without a sage.
Name:
Anonymous2008-04-19 18:11
>>12
I was considering Haskell, but I'd really like REPL during execution for this project. Also, Haskell isn't very fun when it comes to bits and shit. (Scheme isn't much better.)
Name:
Anonymous2008-04-19 18:12
>>11
Visit us on #sicp at EFnet and we can discuss your problem together. These heartless morons are useless.
Name:
Anonymous2008-04-19 18:15
>>2-7,9-11
A thread actually about programming, and you respond with sages and irrelevant memes. I don't care if I've been trolled, beet tolled or bean rolled, you suck.
You can use hsplugins for a REPL. Or you could link to the greasespot Javascript library and script your IRC client with Javascript.
But, if you really want to use Scheme, threading and networking is easy, I've also written an IRCd in Scheme, too. Finding an ncurses wrapper would be your biggest issue. If you can't find one, you can probably write a simple ncurses wrapper library in C and control it from Scheme in a more high-level fashion.
Name:
Anonymous2008-04-19 18:23
you could have two threads per irc connection: one for reading
the input and one for reading the output
mzscheme is a decent scheme interpreter, i wouldn't give up on
it just yet (it has a great helpdesk, mred might be relevant).
you could easily build a very extensible IRC client with
it. i'm dreaming of something like this right now:
/(map (lambda (x)
(if (not (eq? x (me)))
(kick "#thread" x "GTFO")
'()))
(inhabitants "#thread"))
i admit it would be more [i]l33t[i] to run
it through a terminal, but this would involve a lot more work.
you can do this later, i'd start off with a small gui in mred
(especially if you don't have any experience with scheme).
>>21,23
Go away. You should be able to ignore it if it bothers you, being so busy making interesting and stimulating discussions elsewhere.
Name:
Anonymous2008-04-19 18:28
>>18 bits and shit What is that?
Well, first I have to decompress the Huffman-compressed packets I receive, then I have to find the correct bytes in the packets and flip the byte order (but not in all cases).
As for the input issue... it seems readline can do this somehow, but it'll require some hacking, at least creating a custom output port I think.
>>19
You could do that purely from a REPL inside DrScheme.
Name:
Anonymous2008-04-19 18:32
>>26
You should use STM. Is the REPL that important? Haskell's HsPlugins could provide that. Using STM would do the operations atomically, meaning you could use one input port after all.
Name:
Anonymous2008-04-19 18:47
>>28
Not only do I want a REPL for easy hacking, I also want easy scripting. Haskell isn't Desktop-ready yet.
Name:
Anonymous2008-04-19 18:50
you don't have to multithread an irc client, everything sent from the irc-server is line for line, even stuff in other channels, you just put it in the correct channel buffer by looking at which channel it belongs to PRIVMSG #channel
>>35 No I don't. All your spoilers are revealed for I use w3m.
Name:
Anonymous2008-04-19 20:03
>>36 YOU ARE A BARE-FACED LIARand I am using a pocket calculator that I made into a LISP Machinetm.
Name:
Anonymous2008-04-19 20:20
>>35
All I have to do is highlight the text and it's revealed. Alternatively, since I'm using the Opera browser (www.opera.com) I can disable stylesheets and I can see your text.
>>38 All I have to do is highlight the text and it's revealed. THANKS FER THE TIP I NEVER REALIZZARD ~IT PROBABLY DUSNT WORK IN MY BROWSER OR ANYTHING1