Dyalog v12 32bit vs 64 bit TCPSockets

General APL language issues

Dyalog v12 32bit vs 64 bit TCPSockets

Postby orlandod on Wed Nov 03, 2010 7:52 pm

What is the difference between an APL socket created in the 32 bit Classic V12 and a 64 bit TCP socket of style APL?
I have a 32 bit application that I had done in C++ and I do a mapping of the values using the quadAV character set. Everything works well with the 32bit v12 but with the 64bit v12, I am getting an error.

Thanks.
orlandod
 
Posts: 4
Joined: Tue Mar 09, 2010 9:15 pm

Re: Dyalog v12 32bit vs 64 bit TCPSockets

Postby Geoff|Dyalog on Thu Nov 04, 2010 10:13 am

The communication of APL arrays down sockets is based on "sender sends native", "receiver translates". Thus a 64 bit big endian version sends arrays with 64 bit length, zones, shape. If the receiver is 32 little endian it has to do the translation and the re-ordering. There is a header on the transmission that tells you what architecture the sender is using. The header uses "network byte order" which happens to be big-endian. The first 32 bits are the length of the communication. The second 32 bits specify the architecture although only 7 are used.

There is an exception for this, the TCPSocket object can take a parameter that forces "classic" or "unicode". This was to support the new unicode versions talking to old classic versions that didn't yet know about unicode.

This fragment is taken from d_machin.h which is issued with Dyalog APL as part of the support for AP development:

#define ARCH_LITTLE 0x80
#define ARCH_DEXTEND 0x40
#define ARCH_64BIT 0x20
#define ARCH_DALIGN 0x10
#define ARCH_MACH 0x08 // not an ARCH this one is MACHINETYPE
#define ARCH_UNICODE 0x04
#define ARCH_IALIGN 0x02 //need this to distinguish ARM from INTEL
#define ARCH_SPARE 0x01

From a socket point of view you should worry about ARCH_LITTLE which is set for little endian; ARCH_64BIT which indicates that the sender is a 64 bit platform; ARCH_UNICODE which is sent if the platform is Unicode or the "Encoding" property has forced Unicode.

If you are only sending arrays and not ⎕OR's or namespaces then ARCH_UNICODE probably doesn't worry you. The Unicode character arrays have a different ELTYPE coded in the array itself. So ELTYPE 0 is a classic array; ELTYPE 7 is UCS-1; ELTYPE 8 is UCS-2; ELTYPE 9 is UCS-4. If you want to be forward thinking then version 13 will add ELTYPE 10 for complex numbers and ELTYPE 12 for decimal floating point in DPD format.

ARCH_MACH is for backwards compatibility on component files so you can ignore it. ARCH_IALIGN is for workspaces and doesn't affect sockets. ARCH_DEXTEND has not been used yet on any of our interpreters.
Geoff|Dyalog
 
Posts: 43
Joined: Wed May 13, 2009 12:36 pm

Re: Dyalog v12 32bit vs 64 bit TCPSockets

Postby Geoff|Dyalog on Thu Nov 04, 2010 1:05 pm

This link covers the introduction of 64 bit to Dyalog APL. Some of it is relevant to the socket issue. http://www.dyalog.com/uploads/conferenc ... /64bit.pdf
"Geoff Streeter: 64-bit Dyalog APL"
Geoff|Dyalog
 
Posts: 43
Joined: Wed May 13, 2009 12:36 pm

Re: Dyalog v12 32bit vs 64 bit TCPSockets

Postby orlandod on Thu Nov 04, 2010 1:47 pm

Thanks, Geoff. I will review the material.
orlandod
 
Posts: 4
Joined: Tue Mar 09, 2010 9:15 pm


Return to Language

Who is online

Users browsing this forum: No registered users and 1 guest