Community/IRC

From J Wiki
Jump to: navigation, search

chat

Members of the J community are invited and encouraged to come talk with their compatriots, on IRC.

IRC is a live, real time, chat medium. It is similar to instant messenging (IM), but provides a mechanism for any number of participants to talk; it is not merely a dialog. It has a different tone and flavor from the Forums and the Wiki; its informality and immediacy complements those mediums.

Since Jers are all over the world, it is hard for many of us to meet face to face. But, thanks to IRC, we can now converse. We have lively real-time discussion on topics of interest to Jers, with J expressions typed and executed right in the channel (thanks to our bots).

The IRC channels and bots provide a facility for J newbies to ask questions and get live, immediate, answers, and for J veterans to show off gems and discuss J.

Come join us! To get started, see the following sections.

setup

To use IRC, you'll need an IRC client. If you've never tried IRC before, and simply want to try it out, you can begin with a web based client:

These are also good for using on a foreign computer, or from work, if there's a firewall in your way (though you might be able to work out your proxy to get around the latter).

width=240

But, to get the full effect of the medium, you'll need to install a desktop client. Popular choices for the major operating systems are:

OS Client Notes
Windows mIRC
Macintosh Snak or Colloquy
Linux irssi Also *BSD, Unix, etc.
iPhone Colloquy or Rooms
Any OS xchat GUI client that has been ported to many OSes, and makes a good alternative to the command-line/text-mode irssi on *X

See also Wikipedia's list of IRC clients.

Once you've installed a client, you'll have to set it up. For that, refer to the client's documentation. But pay particular attention to choosing a nickname.

Once you've got an IRC client installed and configured, see the following sections on how to find your fellow Jers.

policy

network

IRC is split into many different networks. These networks are independent, and clients of one cannot see clients of another.

J has chosen freenode for its primary IRC network (mostly because of its bot policy). Some of us also idle on EFnet, but you should only connect there if, for some reason, you cannot connect to freenode (you will not find the bots there).

In most clients, you can issue the command /server freenode to connect to the freenode network. If that doesn't work, try /server irc.freenode.net 6667. If that doesn't work, you'll have to resort to your client's documentation.

Once you're connected to freenode, simply issue the command /join #jsoftware, which you can often abbreviate to (/j jsoftware).

Now you're connected to the J channel -- welcome! The following sections discuss channels in more depth, and provide details for advanced IRC usage, including using the bots.

channels

The primary, or core, J channel is named #jsoftware (IRC is a popular medium and the channel #j was already taken [1]). There are several other, related channels, mostly sandboxes for playing with the bots. Notable examples are #ijx and #jeval .

The core channel is intended for discussion, and the English to J ratio should be kept fairly high; avoid flooding the channel with pasted text (use a pastebin for that). Similarly, avoid making the bots output large amounts of text, as that scrolls the channel.

Similarly, multiple attempts to get a buggy J expression working scroll the channel. Before you evaluate a J expression in #jsoftware, make sure you've got it right; the sandbox channels are a good place to work out bugs. They're intended for experimentation with the bots, and to act as "pseudo J sessions"; the English to J ratio is expected to be low.

nicks

If you follow of the Forums, you'll find several familiars in #jsoftware, from novice to guru. We all use anonymizing handles known as "nicks", but most of us will divulge our names if asked.

Any nick you choose is fine by us; we have no policy beyond the networks'. However, it is nice to know who we're talking with. So nicks that don't change often are appreciated, as is an introduction the first time we meet you. For example

  *** incognito joins #jsoftware
  <incognito>  Hi, i'm John Smith from the Forums.
  <nomdeplum> Hey John.  I'm Jane Eyre.  I saw your post on $: . Good stuff.
  <alias> icognito: sup.  I'm Jason.
  *** icognito is now known as icognito_
  *** icognito_ is away

Once you've chosen a nick, it's a good idea to stick with it. To that end, pick one you like and consider registering it with freenode.

Registering your nick has several advantages. Primarily,

A. It keeps others from using it, so we know you're you. A. It allows you to send and receive private messages (i.e. private dialogs like with IM) A. It grants you certain rights on the network. Among them the ability to have a privileged status on a channel (for example, some Jers are entrusted with keeping the peace on the channels).

To register your nick, follow the instructions in the freenode FAQ. Basically:

A. /msg nickserv register <your-password> A. /msg nickserv set hide email on A. /msg nickserv set email <your-email-address>

It's also a good idea to register and link an alternate nick (usually used to indicate a different status, such as "away"). Best practice is to make your alternate nick the same as your primary nick, with an underscore (_) appended. That way we'll still recognize you. To register and link your alternate nick:

A. /nick alternate_nick A. /msg nickserv register <your-password> A. /msg nickserv link primary_nick

Finally, configure your IRC client to identify you to nickserv upon connection the network. To your client's connection scripts, add these lines:

A. /msg nickserv identify <your-password> A. /join #jsoftware

The second is a convenience that will automatically join you to #jsoftware upon connection.

bots

Because J is so terse, it is a great language for communicating with short snippets; and one line can say a lot. Furthermore, J is in ASCII, the lowest common denominator of networked communication.

The IRC channels leverage those advantages with bots which permit J sentences to be executed directly in the channel. Your IRC client has become, in effect, a J session manager.

Thanks to these bots, we can execute J right in IRC, live, realtime, and publicly. They make communication with and about J easy and fun.

If you address a bot in the channel, you may give it a J sentence, which it will dutifully execute and print the results back on the channel. Here's an example:

  <icognito> ijx:  i. 5
  <ijx> icognito: 0 1 2 3 4

Specific details about addressing the bots and their limitations are given in the following sections.

new bot docs

Short instructions. Take an irc client. Make it join the irc.freenode.net server. If you're lucky, there's an evaluator bot instances running. The one called jcon is the most likely to be running these days. The one called evalj is running in BJonas's home computer so is up only when he starts it. You can find both of these in the #jsoftware channel (which is a general j discussion channel. (Alternately, if you don't want to flood the channel with your evaluation session, you can talk to the bots on the #ijx channel or in irc private message.)

To evaluate an expression in, join the #jsoftware channel, and there say jcon: foo (foo is any j fret, jcon is the nick of the bot, leave out the nick but keep the colon if in private message, never start the line with a space). Then the bot answers with the output (truncated if it's too long) or an error message.

Your commands are evaluated in a persistent session by default. This means the bot stores the values of names in the main locale and restores them when you do the next evaluation with double colon. If you mess something up, jcon new: clears the persistent session so you start anew. Every irc users gets a separate persistent session, can use more sessions and can share it with others (this is where it gets really undocumented, but some statements apart from new are load, save, cd, pwd). (There's also a way to enter more than one lines at once, eg. jcon:.. f =: 3 :0 then jcon:.. 2 * y then jcon: ) then jcon: f 5. There are also various short forms and the syntax rules are really random, so try replacing jcon: with ): or ]: or look at the source. Try jcon source:)

addressing

There are several bots, hosted by different participants. Each bot has a distinct presence on IRC, with a distinct nick, just like a normal client.

Currently, the bots are named:

nick impl short form channels
evalj jeval.rb ] #jsoftware
jcon jeval.rb ) #jsoftware
jeval_620 jeval.rb ) #jsoftware, #ijx
ijx jeval.rb ) #jsoftware, #ijx
buubot buubot3 jeval #buubot

If you see any of these nicks in the list of participants on the channel, they're bots. Don't attempt to converse with them.

Instead, to address them, use the format nick: j sentence where nick is the bot's nick, and there is whitespace between the colon and the J sentence (but not between the nick and the colon).

You may also address the bots using the short form. For example, to address evalj in less characters than evalj: i.5, you could type ] i. 5. The whitespace is still mandatory, and the short form is NOT included in the J expression evaluated, though it may appear so.

Finally, since many people may address a bot simulatenously, and some sentences take longer than others, the bots will prefix your nick to their response to you. That way, you can know which answer is yours, independent of order of execution. for example:

 <alias> ]  ([ 6!:3) 5  NB.  Pause 5 seconds
 <incognito> ] 'ab',:'cd'
 <jeval> incognito: ab
 <jeval> incognito: cd
 <jeval> alias: 5

limitations

The J bots are limited; both purposefully to ensure the saftey and security of their host systems, and consquentially, due to the constraints of their environment, IRC.

Some limits are:

  • Only a single line can be executed at a time.
  • Each line executed has its own context. Consequently, a line can effect the output of another only in limited ways. In particular, names in locales other than the main locale are not currently saved, and there's some other context that's not saved as well.
  • The bots do not load the standard profile; you cannot depend upon names usually present when you start J. For example, ] 1 + each 1 2 3;4 5 will not work (but 1 + &.> 1 2 3; 4 5 will).
  • Output is limited. Because we do not want large J results to scroll the channel, the bots' output is limited. You can expect a maxium of 6 lines. Buubot2, in particular, will only ever output one line (the linear representation of the result).
  • Time and space are limited.
  • Host interaction is limited. For example, you cannot read or write files.
  • Frontend features, such as wd, are not implemented.

Please to not subvert these limits, even if you can. If you annoy the participants hosting these bots, we will lose the use of them. That would make #jsoftware a lot less fun and useful.

On the other hand, if you're of the bug-hunting bent, by all means attempt to subvert the limits. But (A) do so in a way you're confident won't hurt the host systems, (B) do it in a sandbox channel, such as #ijx and (C) report your findings, so the holes can be plugged.

workarounds

The first two limits listed, "single line" and "seperated contexts" are not neccesarily security measures, and may be lifted in the future. Ideas for bot extensions are accumulating on Bots. For now, you may use the ijxer script to convert most multi-line J script files to a single line of executable J.

Download the script and save it to your user folder. Now create a new script file, name it "cal.ijs", and save it in your temp folder. Here are the contents of the script:

NB.== script file:  cal.ijs ==
   calendar =: 3 : 0
a=. ((j<100)*(-100&|){.6!:0'')+j=. {.y
b=. a+-/<.4 100 400%~<:a
r=. 28+3,(~:/0=4 100 400|a),10$5$3 2
r=. ,(-7|b+0,+/\}:r)|."0 1 r(]&:>:*"1>/)i.42
m=. m,(0=#m=. <:}.y)#i.12
h=. 'JanFebMarAprMayJunJulAugSepOctNovDec'
h=. ' Su Mo Tu We Th Fr Sa',:"1~_3(_12&{.)\h
<"2 m{h,"2[12 6 21$,>(<'') ((r=0)#i.#r)} <"1 [ 3":,.r
)

>calendar 2007 4

In the J session, type:

  load 'user\ijxer'
  ijxer 'temp/cal.ijs'
+ 2 : 'Z' ( 0!:0 ; (10{a.) ,&.> 'calendar =: 3 : 0';'a=. ((j<100)*(-100&|){.6!:0'''')+j=. {.y';'b=. a+-/<.4 100 400%~<:a';'r=. 28+3,(~:/0=4 100 400|a),10$5$3 2';'r=. ,(-7|b+0,+/\}:r)|."0 1 r(]&:>:*"1>/)i.42';'m=. m,(0=#m=. <:}.y)#i.12';'h=. ''JanFebMarAprM...

The verb ijxer has turned the script into a single, executable line. To get the line on your clipboard, type clixer 'temp/cal.ijs'. Now, paste the line into your IRC client, and put a short form of address (e.g. ]) in front of it . Now press enter, and the bot will execute your entire script, returning the result of its last line.

For example:

<incognito> ) + 2 : 'Z' ( 0!:0 ; (10{a.) ,&.> 'calendar =: 3 : 0';'a=. ((j<100)*(-100&|){.6!:0'''')+j=. {.y';'b=. a+-/<.4 100 400%~<:a';'r=. 28+3,(~:/0=4 100 400|a),10$5$3 2';'r=. ,(-7|b+0,+/\}:r)|."0 1 r(]&:>:*"1>/)i.42';'m=. m,(0=#m=. <:}.y)#i.12';'h=. ''JanFebMarAprMayJunJulAugSepOctNovDec''';'h=. '' Su Mo Tu We Th Fr Sa'',:"1~_3(_12&{.)\h';'<"2 m{h,"2[12 6 21$,>(<'''') ((r=0)#i.#r)} <"1 [ 3":,.r';,')';'Z =: >calendar 2007 4')
<ijx> incognito:          Apr
<ijx> incognito:  Su Mo Tu We Th Fr Sa
<ijx> incognito:   1  2  3  4  5  6  7
<ijx> incognito:   8  9 10 11 12 13 14
<ijx> incognito:  15 16 17 18 19 20 21
<ijx> incognito: ...

Be aware that IRC servers limit line length, and some IRC clients will split up very long lines (you may configure yours not to); so it is best to only use ijxer on short scripts. Also, please read the warnings at the top of the ijxer.ijs script file.

tips

  • Obviously, if a bot is not in the channel, you cannot address it.
  • Many IRC clients allow you to start typing the bot's name, then press TAB to automatically complete it. So, for example, you might be able to type ev<TAB>: i.5<ENTER> to get evalj to print the result of i.5.
  • Because Jers are spread around the world, you'll probably find someone to talk to no matter what time you join. However, a large portion of participants are on or near EST (UTC -4), so the channel gets more active around 6 pm EST (22:00 UTC), when they get home from work.

credit

Credit is owed to Andrew Nikitin (and previously Mike Day and Martin Neitzel) for the idea of a J IRC community, and again to Nikitin for the idea of a J bot.

Further, the J IRC community owes many thanks to B Jonas for his ruby script, jeval.rb, and to buu, for incorporating BJonas' implementation into buubot2 and buubot3 (svn://erxz.com/bb2 and svn://erxz.com/bb3).

Thanks to all participants who host a J IRC bot.

footnotes

  1. Actually I don't think I ever considered taking #j -- B Jonas 2009-06-19T16:02:50+0200)