From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,68b43b837fb71f2a X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-09-12 09:32:41 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!newsfeed.berkeley.edu!news-hog.berkeley.edu!ucberkeley!nntp-relay.ihug.net!ihug.co.nz!west.cox.net!cox.net!p01!news2.central.cox.net.POSTED!53ab2750!not-for-mail Message-ID: <3D80C1B1.5070703@telepath.com> From: Ted Dennison User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.0) Gecko/20020530 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Thoughts on the recent ICFP contest References: <3D7FFD66.9030805@telepath.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 12 Sep 2002 16:32:37 GMT NNTP-Posting-Host: 68.12.51.201 X-Complaints-To: abuse@cox.net X-Trace: news2.central.cox.net 1031848357 68.12.51.201 (Thu, 12 Sep 2002 12:32:37 EDT) NNTP-Posting-Date: Thu, 12 Sep 2002 12:32:37 EDT Organization: Cox Communications Xref: archiver1.google.com comp.lang.ada:28872 Date: 2002-09-12T16:32:37+00:00 List-Id: tmoran@acm.org wrote: >> (3) A generic implementation of Dijkstra's Algorithm > > In the sense of an Ada "generic", or what? I would think a library Not in the Ada sense, no. But it could be made an Ada generic I suppose, to allow user-defined data in the graph nodes. > version of the algorithm would be a single call, taking a graph > representation as input and giving a shortest path as output, > so the only novelty would be in devising convenient ways to build > the input data structure or use the output. Or is this not what > you're think of at all? Well, I believe that algorithm finds *all* shortest paths from a given node as a side effect. Given that, one might want to have one call to find all the paths, then another to return the shortest one between two given nodes. As long as the start node is on the original path, you wouldn't need to recalculate. Then again, if one wanted to make some kind of general path search interface, keeping it simple enough to be supported by any algorithm might be better. But again, I'm not sure how generally useful this would be. I've never needed such a thing at work. But then again there are many industries I've never worked in... >>stream, with the various sockopt function codes implemented as >>primitives on it. I'm curious if anyone else thinks something like this > > Can you give an example of a piece of code written using what you > have in mind? The idea is that network code would look just like file streaming code. Something along the lines of: Ada.Streams.Sockets.Connect (New_Socket => Server, Address => (127,0,0,1), Port => 5517, Protocol => Ada.Streams.Sockets.TCP); Server_Request'Write (Server, Request); Server_Response'Read (Server, Response); > >>to transmit an entire buffer at once, rather than one component at a > > Like marshalling all those 'Writes to a buffer, then making one > socket'write(buffer) call? > > >>Since this is a speed optimization, copying the buffer would be missing >>the point. > > That sounds more like creating a "channel program" to do "gather > writes" when the IO is actually started. Is that what you mean? No, nothing that complicated (unless I'm misunderstanding you). Its just that 'Write on a 1000-byte array will, by default, perform one 'Write on each component of that array, amounting to 1000 'Writes. That means any time someone is interested in efficency, they end up having to make their own 'Write that calls Ada.Streams.Write once for each object that they want transferred efficiently. This is an issue for *any* stream, not just the one I'm proposing above. It would be nice if instead there were a generic object that already has this overload for its 'Write and 'Read, and to which any object can be converted. No actual data would have to be copied to do this.