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 X-Google-Thread: 103376,508516c114ade8e1 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,UTF8 Received: by 10.68.74.201 with SMTP id w9mr1551341pbv.0.1328798449756; Thu, 09 Feb 2012 06:40:49 -0800 (PST) Path: wr5ni5187pbc.0!nntp.google.com!news1.google.com!goblin2!goblin.stu.neva.ru!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: ada without ada libraries? Date: Thu, 9 Feb 2012 15:40:40 +0100 Organization: cbb software GmbH Message-ID: References: <82mx8tttx7.fsf@stephe-leake.org> <120f2efrm73fc$.mi1m9kwbbkes$.dlg@40tude.net> <1o71uiwmoiunb.bkjz8c54rcbl.dlg@40tude.net> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: FbOMkhMtVLVmu7IwBnt1tw.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Date: 2012-02-09T15:40:40+01:00 List-Id: On Thu, 09 Feb 2012 14:42:02 +0100, Yannick Duchêne (Hibou57) wrote: > Le Thu, 09 Feb 2012 11:45:31 +0100, Dmitry A. Kazakov > a écrit: >>> No language at all, >>> not even Ada, could be an universal model for everything. >> >> Since when a language became a model? > > Always been for me. I see Ada as a language providing a set of low level > models. All languages comes with their own model, even natural language > (people are just not aware of that fact). Maybe, but why this model must be "an universal model of everything" in order to be able to program finite state automata (which modern computers are)? >> If you want to be serious in pushing your argument, you have to show how >> and why the domain's specific fails to fit into a strongly typed, >> imperative, OO framework. > > First is readability. Huh, I remember a description of a 8-channel input device in such a language. The text file containing it was 40 Kb long. These languages are absolutely, ultimately unreadable, fully of useless syntactic garbage and thousands of keywords of which nobody cared to define what they are supposed to mean. I don't claim that they could not be designed readable, but the fact that they are usually developed by groups of engineers strikes any chance for that. Language design is a very difficult task. There is no more than a dozen of people in the world who could do that. > Using Ada for > some things, would be like using assembly instead of Ada. Nope. Ada provides abstraction means based on ADTs, OO and packages. On this measure DSLs are assemblers, as they provide practically no means for encapsulation, abstraction, refactoring, reuse. For an outsider they might look so easy to use, but they are not. In my area all these languages end up as programs generated automatically from other languages, and nobody reads that mess. > You could provide some package holding the > functionnalities of a DSL, a attempt to right what a DSL do in a simple > Ada program, but you will miss conciness and specifically designed context > which come with a DSL and help to focus on the DSL domain only. This requires a proof. If you don't claim a need in a very special syntax (e.g. MatLab/SIMULINK), you cannot make an argument here. >> The only debatable position here is actually declarative vs. imperative. >> But it won't fly with scripting languages anyway. > > It precisely do. Really? How many *declarative* scripting languages are in use? >>> and some scripting >>> languages, like LISP or derivatives, or logic programming languages, >>> are a >>> kind of. >> >> ... mess. > Either you use it badly, or it is just not well suited to you in > particular. Rather they use me badly (:-)) I must touch them because in my realm (automotive, energy) a lot of stuff is described in DSL languages. > What would be a real mess, would be an attempt to express Prolog clauses > with Ada arrays (arrays with anonymous types, of course; don't even think > about named array sub‑types). I see no problem to have a decent way do describe inference rules in Ada by overriding "and", "or", "=" etc. Look at GNAT Spitbol package. There is no big difference in describing patterns and rules of inference. This is basically the same stuff. > Similar comments could apply with others, including some as common as SQL is. But SQL miserably fails as a language of relation algebra. I think that an Ada implementation based on aggregates to describe tuples would be much better. If ARG concentrated on improving the Ada's type system rather than on hacking limited returns and exception throwing comments, Ada could certainly be perfect for that. Apart from the fact that a relational DB is not the brightest idea in the world, when it comes to the objects just a bit more complex than integer or string. Here is where your fine idea of DSL collapses. There is no insulated domains. Any specific language is turns unsuitable when faces the real world. Program power set in SQL or path finding in SIMULINK... -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de