using JHS server with J

λ November 9, 2019
Tags: j

I have stumbled across J!

It has my full attention! It seems to be very well supported and comes with libraries that allow one to do everything from OpenGL to web development. Wow. However there are times when the official wiki pages sometimes aren’t as clear as they should be so this page is about getting the JHS server up and running.

The first thing to be done is to start a console. I have the Qt IDE installed as well but unless I am feeling lazy I tend to go for the console as it feels more like home to me.

Loading the installer script

Once you are in the J session, type this:

    load '~addons/ide/jhs/installer.ijs'

which is exactly as posted on this page of the wiki entitled, Guides/JHS/Server.

The first thing to realise is that you don’t have to do the Preliminary section, I tried that running a stock Unit session on Ubuntu and all it did for me was this:

   load '~addons/ide/jhs/installer.ijs'
   shortcut 0
|domain error: shortcut
|   e=.'create ',y    ,' launch icon failed'

So I ignored it and carried on, I am not a big fan of desktops and shortcuts anyway and it doesn’t look that serious and it’s not totally necessary to run the server.

At this point I totally lost it for a while. There is nothing on the wiki page that says how to start the server or even where it is or anything. All it says is…

Start JHS server and try the following:

Seriously?!! And then somehow I found this page:

Which also has instructions on how to do it and, in its favour, it seemed to be more to the point than the other page and so I can’t understand why there are two pages seemingly geared towards doing the same thing but the former page just left me dazed and confused.

At last I found the magic sauce as stated on the latter page:

   load '~addons/ide/jhs/core.ijs'
   init_jhs_''

J HTTP Server - init OK

Ctrl+c here signals an interrupt to J.

Browse to: http://127.0.0.1:65001/jijx

And lo…there it was, a lovely little browser based play-pit for J.

JHS browser session

I still prefer the console I guess after all that but I am a little more confident in handling the J stuff now and I also spent a good half-hour reading source code too!

Comments