Hi, I've got some F# / C# code that needs a little tidying up. It executes J statements using JHS (JHS is a server wrapper for j.dll which runs out-of-process over http). Let me know if you are interested in this way forward, and I'll try to get this code released on github a bit sooner. The out-of-process way is more robust and flexible for many purposes such as using jd... although obviously not as performant as hooking directly into j.dll.
There are a few ins and outs to my implementation. I opted to use the J native format, and to get a proof of concept done, I used the j602 version over COM to do that native serialisation / deserialisation. JHS will also work with JSON I believe. I always meant to come back and eliminate the j602 dependency. Perhaps this would be okay for your purposes as is. Hope that helps. regards, -Steven Taylor On 9 July 2014 13:14, Jon Hough <[email protected]> wrote: > Thanks for replying, > > I understand .cpp indicates a c++ file. What I wanted to do was follow the > lab that used this file, which seems to not exist. > I see your point about needing a compiler, but I assumed there was a way > to make a dll using J and perhaps the microsoft compiler (on windows, linux > and mac already have gcc inbuilt). > The next best thing is to link to the j.dll which I assume calls my script > in turn. But again, the lab seems to be geared toward J6, which I > unceremoniously deleted. > > Having said that, I am pretty sure I read somehwere on the J wiki that it > is possible to build an executable file, so J does not need to be installed > on the computer. Can't find it now though. > > > > --- Original Message --- > > From: "Raul Miller" <[email protected]> > Sent: July 9, 2014 8:38 PM > To: "Programming forum" <[email protected]> > Subject: Re: [Jprogramming] DLL Lab > > I often use j6 just so I can run its labs. > > The .cpp suffix indicates a c++ file - so you would use a c++ compiler to > build that "dll". > > Note that at one point in history, .cpp would probably have indicated a "c > pre processor" file. Then again, early versions of what became c++ were > apparently written in cpp's macro language. > > Note also that "dll" implies windows. I think OsX uses ".dynlib" or > something like that. Linux and *BSD mostly use ".so" (shared object). > > Anyways, you need a compiler to build a library file (or you need a lot of > study to build one by hand - a good preliminary step in building a > compiler). And as we currently don't have any J compilers that can build > libraries (f. and 13 : could be thought of as J compilers, but they aren't > the right kind), ... > > Enough said? > > Thanks, > > -- > Raul > On Jul 9, 2014 4:55 AM, "Jon Hough" <[email protected]> wrote: > > > In J7/8 is it possible to build and use DLL files and call them from > other > > programs (e.g. .NET programs etc)? > > I tried doing one of the DLL Labs in J7.01, and got blocked when the Lab > > tried to load a non-existent file: > > > > > > open '~system\examples\dllwrite\dlltest.cpp' > > > > Presumably this is left over from J6, and is not included in later > > versions? Regardless, the cpp file does not exist. > > > > Also, I tried looking through the JWiki guide for using DLLs, which also > > seems to be only usable in J6? > > > > In J7/8 how can I : > > > > (a) call dll from J script? > > > > (b) create a DLL file to be called by another program? > > > > > > Regards, > > Jon > > > > ---------------------------------------------------------------------- > > For information about J forums see http://www.jsoftware.com/forums.htm > > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
