You raise interesting issues. I need to look into things more carefully,
but here is an initial response.
Overall summary:
1. Some of what you are seeing is old windows 32bit centric stuff that
now works for unix and 64 bit.
2. the 4 areas of interest indicated by your chart do not currently all
have the yes answer you would like.
3. Jsoftware considers it a high priority to have acceptable answers in
those boxes and will try to make this the case for the final J601
release.
Windows 64 bit:
I was not aware of the __fastcall 'bias' in Windows 64bit. We were able
to build the system, pass all our test suites, distribute the product,
and live in blissful ignorance for all this time. This is because we
built and tested everything with __stdcall and it all works quite nicely
together. A quick look back shows there were warning signs there in
compiler errors in some of the com stuff, but as we don't support com
yet they were never pursued.
I don't yet understand what the win64 compiler does with __stdcall vs
__fastcall. I would have thought it reasonable to have __stdcall be the
same as __fastcall in win64, but you indicate this is not the case. If
__stdcall is the same as __fastcall in win64 then this is a non-issue.
If they are different (as they are in win32) then there is an issue.
The jlib.h header file to use the j.dll has __stdcall hardwired in. So
the j.dll in win64 requires __stdcall calls. My immediate reaction is
that this is OK and we will stick with this. That is, pass the problem
on to the users of the j.dll. Is this OK for your requirements? This is
probably a non-issue for compiled users like C or C++, but may be nasty
for users like Perl or Phython depending on how they are coping with
__fastcall vs __stdcall.
We don't currently distribute the jlib.h header file, but this will be
added as a standard part of the next beta and at some point a simple lab
showing its use from J will also be included.
Right now (likely, but I have not verified) calling a __fastcall API
routine from J with cd will crash. However, calling __stdcall (or
__cdecl with the + paramter) API routines works fine. I will look into
this, but suspect/hope that a very simple extension to the + option
would allow selection of __fastcall instead. This means the use of cd
has to be correct, but should handle the immediate problem. My immediate
incliniation is that the default (for both 32 and 64 bit) would be
__stdcall, + would be __cdecl, and some other flag would select
__fastcall.
So the answers to your Win64 boxes are:
yes - as long as you call j.dll with __stdcall
no for cd calls of __fastcall APIs (but we will add __fastcall option
if possible)
Linux:
As far as I know the answer to both your boxes for Linux 64 is yes
without restriction:
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Friday, August 04, 2006 8:19 PM
Subject: [Jbeta] 64-bit support for calling libraries from J and calling
J Engine from 64-bit clients
I am enjoying learning J (J601p). I am trying to pick a platform
(Win64 or
Linux/AMD64) to settle on.
The specific examples for calling a user library or calling J-engine
are
for Win32 and it isn't clear to me if 64-bit Windows/Linux support is
just
a documentation issue or if there is missing support in J64. For
example
the <jroot>\system\examples\data\jdll.h referred to in the docs is
Win32
specific; there seems to be no .h file covering the 64-bit J engine C
interface on either Windows or Linux. The documentation for 15!: is
also
Win32 centric: for example Win64 uses __fastcall not __stdcall and
there is
no explicit mention of 64-bit support.
It would help me if the implementors could fill-in this table and
indicate
if the support requires just more documentation/headers or
planned/unplanned changes to J. FWIW, I have no plans to use the COM
interface.
+-------+--------------+----------------------------+
| | Calling | Calling |
| | J64 Engine | 64-bit DLL/Shared Library |
| | from 64-bit | from J64 using __fastcall |
| | caller | or AMD64 ABI |
+-------+--------------+----------------------------+
| Win64 | | |
+-------+--------------+----------------------------+
| Linux | | |
| AMD64 | | |
+-------+--------------+----------------------------+
Thanks,
Joseph Battelle
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm