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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,80ae596d36288e8a X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!28g2000yqu.googlegroups.com!not-for-mail From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Re: Why no socket package in the standard ? Date: Tue, 24 May 2011 14:22:42 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <872169864327910446.796089rmhost.bauhaus-maps.arcor.de@news.arcor.de> <9cb23235-8824-43f4-92aa-d2e8d10e7d8c@ct4g2000vbb.googlegroups.com> <1jue77mrlbkor$.1iuz25va18fvm$.dlg@40tude.net> NNTP-Posting-Host: 83.3.40.82 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1306272162 1804 127.0.0.1 (24 May 2011 21:22:42 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 24 May 2011 21:22:42 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: 28g2000yqu.googlegroups.com; posting-host=83.3.40.82; posting-account=bMuEOQoAAACUUr_ghL3RBIi5neBZ5w_S User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-Header-Order: HUALESNKRC X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13,gzip(gfe) Xref: g2news2.google.com comp.lang.ada:20394 Date: 2011-05-24T14:22:42-07:00 List-Id: On 24 Maj, 09:25, "Dmitry A. Kazakov" wrote: > > In the language? Probably none, as this does not belong to the > > language. > > That is an interesting question. Actually sockets could belong to the > language. Consider for example the select statement containing alternatives > of a socket's select. Still, they (sockets) don't have to be part of the language to be select-ready. It is enough to make them protected objects with appropriate entries. The problem is, neither Ada nor the operating system make it easy to do this kind of integration in a sufficiently efficient way. Which brings some interesting point for the future language evolution: make it possible to write "select hooks" - that is, protected procedures that are called automatically when any task attempts to call some entry in any way, including its use in the select statement. Something like: protected Example is entry Lets_Go when Ready is ... -- this procedure is called when Lets_Go is used -- it is executed *before* evaluation of the barrier in Lets_Go procedure Lets_Go_Hook is begin -- ... -- perhaps set Ready or whatever end Lets_Go_Hook; private Ready : Boolean; end Example; With this language feature I can imagine a relatively efficient implementation of a socket library where socket objects are selectable in the Ada sense. Nitpick: implement Ada 2005 before that. Please. ;-) > > It might, however, be part of the standard library. > > There are many difficulties on that path. When people are demanding sockets > they forget that beyond TCP/IP and UDP there is a lot of other stuff > communicated over sockets, e.g. multi-cast protocols, raw sockets and so > on. These are barely standardized. So what? Standardize the stuff that is obvious to standardize and don't throw the baby out with the water. Just don't give people more reasons for not learning Ada. -- Maciej Sobczak * http://www.msobczak.com * http://www.inspirel.com