[mercury-users] socket support in io

Michael Day mikeday at corplink.com.au
Sun Oct 3 11:12:48 AEST 1999


> However, this is really an example of socket programming
> in a combination of C and Mercury, rather than in Mercury.
> The code for the external debugger interface is included in the
> Mercury source distribution, in the file trace/mercury_trace_external.c.
> The function MR_trace_init_external() contains the C code to initialize
> the sockets, and to create Mercury streams for them.
> It then calls some Mercury code defined in browser/debugger_interface.m
> to do the parsing of requests received on the socket.  The Mercury code
> uses the `io__read' predicate from the `io' module in the standard library
> to do the parsing.

Right I've looked through that file a little actually as gcc 2.95.1
collapses with an internal error when it tries to compile it. I had to
comment out a small portion of the code that checks for a unix socket
environment variable or similar, to be able to build it. (I'm assuming
that's a gcc error, the code looks fine...)

> Well, for version 2 of the standard library, we plan to make appropriate
> use of typeclasses throughout the library.  In the case of the `io' module,
> it would be very useful to define typeclasses for the I/O stream operations.
> In particular:

<nice features snipped>

Must admit I'm very interested in this next version, sounds like iostreams
done properly with a language that doesn't get in the way.

> However, I don't think we have any plans to work on these in the near future.

Perhaps next year? The standard libraries appear to be something that
Mercury users could have slightly more input in than language features.
Seems like it wouldn't hurt to have a list of the proposed alterations to
the standard libraries, so that users that need that functionality now
could perhaps develop their own modules and contribute them at some point?
Just a suggestion, don't know if you prefer development to be more
controlled than that.

> Off-hand, I think MCORBA does not use sockets directly;
> it is layered on top of a C++ CORBA implementation, and somewhere
> in the guts of that, the C++ CORBA implementation probably uses
> sockets, but that isn't going to be of much use to you.

Yeah, was still interesting to have a look at it though :) Is MCORBA still
under development?

Michael

--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list