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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: border1.nntp.dca3.giganews.com!backlog3.nntp.dca3.giganews.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!feeder.erje.net!eu.feeder.erje.net!newsfeed.datemas.de!rt.uk.eu.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: 'Protected' abstract subprograms Date: Thu, 16 Jan 2014 09:52:48 +0100 Organization: cbb software GmbH Message-ID: <1u5t5vkgmmrby.18yvkd683amoj$.dlg@40tude.net> References: <839fee13-2743-49f6-a7f3-f95578386201@googlegroups.com> <1aav8alqsnqqv.5urmifgwh1mv.dlg@40tude.net> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: I5Na6+WsEzT8WoegI0VZTA.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 X-Original-Bytes: 2826 Xref: number.nntp.dca.giganews.com comp.lang.ada:184446 Date: 2014-01-16T09:52:48+01:00 List-Id: On Wed, 15 Jan 2014 09:11:03 -0500, Robert A Duff wrote: > "Dmitry A. Kazakov" writes: > >> Yep, that's what I meant under "cooperative" privacy. For many >> applications, and the number of is growing rapidly, a "non-cooperative" >> privacy is needed as well. > > Well, in a language that allows Unchecked_Conversion, address clauses, > machine code inserts, etc., I don't see any way to achieve > non-cooperative privacy within a single process. Using memory protection and routing certain calls through the sealed RTL. Just the way most OSes do it. Of course RTL could use certain OS services for that, like it does in the case of tasks mapped on system threads. E.g. a part of RTL could be implemented as a driver etc. > You can achieve it > in Ada via remote procedure calls, though. Yes, though using network connection is much overhead comparing to switching contexts. Furthermore RPC is a procedural paradigm unsuitable for the purpose of privacy in an OO language like Ada, too much heavy-weight. As a challenge for uncooperative privacy consider User_Credentials object. Its implementation would store the password inaccessible otherwise than through operations provided. The instances are kept on memory pages unmapped for the rest of the program. The bodies of the operations run on another context, which is switched upon the call. The call also validates the object's 'reference' and converts it to the true address. Though from the programmer's perspective semantically the difference from protected objects Ada already has is not that big, if any. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de