Project Rumba

General APL language issues

Project Rumba

Postby paulmansour on Fri Jan 02, 2015 6:25 pm

Hi all, and Happy New Year!

A while back, I needed to add a web API to my app and started playing around with some code using Conga. I have extracted the code from my main app and called it “Rumba”.

Rumba is an implementation (or at least the start of one) of HTTP/1.1 for client and server completely written in Dfns. (One design goal was to have dfns.dws worthy code!)

There is much work to be done. My main reason for posting the code here and now is to get feedback on the overall interface. In addition, I would like to get others involved in testing, coding, and debugging Rumba, embedding it in their own apps.

If you would like to play around with Rumba, you can download the workspace here:

https://dl.dropboxusercontent.com/u/108243087/Rumba.zip

Then create a new folder somewhere and drop the workspace into it. Load up the ws in 64 bit V14 Unicode, and run:
      #.Rumba.Admin.StartHelp 0

to fire up the help.

You can launch two sessions of Rumba. From one of them run:
      #.Rumba.TestServer.Start 0


And then from the other run:
      #.Rumba.Admin.RunTests 0


Any feedback would be greatly appreciated.
paulmansour
 
Posts: 420
Joined: Fri Oct 03, 2008 4:14 pm

Re: Project Rumba

Postby DanB|Dyalog on Tue Jan 06, 2015 3:05 am

Hi Paul, I had a very quick look at it.
All I can say at this point is that your Start program is a traditional program which could easily be turned into a dfn. An oversight?
Cheers
DanB|Dyalog
 

Re: Project Rumba

Postby Phil Last on Tue Jan 06, 2015 10:29 am

I can't speak for Paul but he is used to writing stuff to blend in with the Dyalog object framework and it has the restriction that dfns may not be methods. So he devised long ago the technique of wrapping a dfn in a vestigial tradfn as here. My guess is that he has merely followed his usual procedure and in this case he has also taken advantage of the ability to write a niladic tradfn.

For those who haven't seen the technique and prefer to write dfns but also work in classes:
      .
∇ z←{a}method w
⍝ any :Access and :Implements statements and the like go here
⍝ also, where necessary, some technique to account for elided {a}
z←a{
... ⍝ and the actual code goes here
}w
User avatar
Phil Last
 
Posts: 628
Joined: Thu Jun 18, 2009 6:29 pm
Location: Wessex

Re: Project Rumba

Postby paulmansour on Tue Jan 06, 2015 1:33 pm

Hi Dan,

The use of a trad wrapper for TestServer.Start is because to fully automate my tests I start in (what will be) a client session and under program control launch the server in a new APL session using Acre, our code management system. Acre has its own quadLX, but allows me to specify an additional function to run. I don't think Acre liked a space and an argument in the quadLX string. Phil?

Paul
paulmansour
 
Posts: 420
Joined: Fri Oct 03, 2008 4:14 pm

Re: Project Rumba

Postby Phil Last on Wed Jan 07, 2015 1:07 am

If you're passing commandline parameters to a new session containing blanks (or quite likely any non-alphanumerics) they need to be "double quoted". By the time you use #.GetEnvironment or #.GetCommandlineArgs to retrieve them Dyalog (or something else in between) will have stripped them off but at least the content will remain intact. e.g.
      ⎕CMD'"...\dyalog.exe" whatever=asd zxc' ''

followed in the new session by
      #.GetEnvironment'whatever'
asd

whereas
      ⎕CMD'"...\dyalog.exe" whatever="asd zxc"' ''

and
      #.GetEnvironment'whatever'
asd zxc
User avatar
Phil Last
 
Posts: 628
Joined: Thu Jun 18, 2009 6:29 pm
Location: Wessex

Re: Project Rumba

Postby StefanoLanzavecchia on Wed Jan 07, 2015 9:29 am

Very nice!
As I was playing around with the test suite, to get a feel for what your creature can do, I noticed a couple of problems:
  1. A few of the functions called from
          TestServer.GET
    are dyadic (like GetConnections) but are called monadically
  2. You didn't notice this, because in TestConnectionClose you do create a "q2" but still send "q" instead of "q2".

More to come if I get more time to play with it...
Thank you so much for sharing.
User avatar
StefanoLanzavecchia
 
Posts: 109
Joined: Fri Oct 03, 2008 9:37 am

Re: Project Rumba

Postby paulmansour on Wed Jan 07, 2015 1:13 pm

Stefano,

Oops! Thanks, I have fixed it for the next "release". I really need to add some code-coverage facility to my tests. Must find time for ⎕Profile.

Paul
paulmansour
 
Posts: 420
Joined: Fri Oct 03, 2008 4:14 pm


Return to Language

Who is online

Users browsing this forum: No registered users and 1 guest