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,FREEMAIL_FROM autolearn=ham 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,UTF8 Path: g2news1.google.com!news3.google.com!feeder.news-service.com!94.75.214.39.MISMATCH!aioe.org!.POSTED!not-for-mail From: =?utf-8?Q?Yannick_Duch=C3=AAne_=28Hibou57?= =?utf-8?Q?=29?= Newsgroups: comp.lang.ada Subject: Re: Why no socket package in the standard ? Date: Tue, 24 May 2011 21:38:03 +0200 Organization: Ada @ Home Message-ID: References: <872169864327910446.796089rmhost.bauhaus-maps.arcor.de@news.arcor.de> <9cb23235-8824-43f4-92aa-d2e8d10e7d8c@ct4g2000vbb.googlegroups.com> <4ddb5bd7$0$302$14726298@news.sunsite.dk> <4ddb81b8$0$7628$9b4e6d93@newsspool1.arcor-online.net> NNTP-Posting-Host: eKwzOZEoYNmUIKtjz8NWow.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes Content-Transfer-Encoding: Quoted-Printable X-Complaints-To: abuse@aioe.org User-Agent: Opera Mail/11.01 (Linux) X-Notice: Filtered by postfilter v. 0.8.2 Xref: g2news1.google.com comp.lang.ada:19419 Date: 2011-05-24T21:38:03+02:00 List-Id: Le Tue, 24 May 2011 12:00:24 +0200, Georg Bauhaus = a =C3=A9crit: > 1. The reason simply is that each and every of them has started > by offering some glue code for the BSD/POSIX socket functions. BSD is the standard C API for sockets, even the POSIX one, intially base= d = on the BSD specification, was kept close enough. The POSIX specification= = seems to only differs in the way to get host by name / address. > .NET languages will likely just use a .NET class. Which is probably a tick binding to the socket API (if I'm wrong with = this, tell me). > But there have been and will be difficulties when porting > the languages' alleged "standard" libraries to non-POSIX > (or non-.NET) operating systems. Perhaps the difficulties > are even conceptual ones whenever POSIX sockets don't really > meet the networking requirements. What networking requirement ? This thread is not about OSI layers packag= es = for Ada, it's only about sockets, which is either OSI layer 4 or 5 = (depending on the point of view). > Define > > Commercially_Important_Platforms :=3D { > =E2=88=83 target | POSIX(target) IN { False, True } > } > > How large is the subset defined by POSIX(target) =3D False? > Is POSIX/Sockets the best Ada solution when this is the case? Be pragmatic : the standard socket API is the BSD socket API, then as sa= id = above, there are only little differences between the POSIX and BSD socke= t = specification, and then after, sockets does not implies POSIX. POSIX is = = one thing, sockets is another. > 2. In the light of Ada's history regarding standardization, > there is, I believe, networking knowledge that warrants more > than canonization of a practical workaround---which might fail > if requirements are actually different. What workaround ? > Opposing a get-that-duct-tape-solution-out=E2=80=93the-door style for > standardization, I'd imagine starting from questions like the > following and then weigh POSIX sockets as the possible answer: Why not, POSIX would be OK, indeed, as it provides the same. But there = should be good reason to introduce POSIX here. This would be OK if there= = was support for POSIX in the Ada standard, and this is actually not. > - What should programs be able to do when communicating data > along some network connection? Answered by the socket specification : there are raw, datagram, stream, = = blocking and none-blocking sockets, with IPv4 or IPv6 addresses. > - Should there be a layered approach? How much detail? Sockets already belong to its layer, but Ada is not concerned about it. = = This is not about creating a network package hierarchy, this is about a = = socket package only (may be a hierarchy, if it appears to be cleaner thi= s = way). > - Where in the language will this integrate nicely? > (E.g. package structure? What types if any? Or anything > that has already been mentioned.) Streams in some part, but not always, has some usage of sockets does not= = have stream behavior (like UDP). This would probably requires two socket= s = type : streams and none-stream. > - Is sockets the right approach? Consider Erlang! Seems Erlang actually provides sockets. > - Is sockets the right approach? Consider a CAN! A can 8-) ? > I doubt that the best answer to these questions can > be summed up by saying, "Mirror Posix sockets!". Why ? Thousands of applications are working nice with either POSIX or BS= D = sockets, and this was not cause of any big troubles I could hear about, = = unlike stack or buffer overflow, lack of typing and the like. Sockets ar= e = a mostly secure things. And Ada has tasking defined in the language, whi= ch = can be useful for sockets (think about the "select" operation, while not= = formally required, is often used in conjunction with sockets). > [*] = > http://pike.ida.liu.se/generated/manual/modref/ex/predef_3A_3A/Stdio/P= ort.html > > [**] http://www.snobol4.org/csnobol4/curr/doc/snobol4.html > > [***] "Haskell's networking functions almost always correspond > directly to familiar C function calls." > http://book.realworldhaskell.org/read/sockets-and-syslog.html OK, will get some time to read these. -- = Si les chats miaulent et font autant de vocalises bizarres, c=E2=80=99es= t pas pour = les chiens. =E2=80=9C c++; /* this makes c bigger but returns the old value */ =E2=80= =9D [Anonymous]