Path: utzoo!mnetor!uunet!mcvax!ukc!eagle!icdoc!doc.ic.ac.uk!cdsm From: cdsm@doc.ic.ac.uk (Chris Moss) Newsgroups: comp.lang.prolog Subject: re: BSI Syntax Message-ID: <227@gould.doc.ic.ac.uk> Date: 8 Mar 88 13:10:45 GMT Sender: news@doc.ic.ac.uk Reply-To: cdsm@doc.ic.ac.uk (Chris Moss) Organization: Dept. of Computing, Imperial College, London, UK. Lines: 62 > In reply to: ok@quintus.UUCP (Richard A. O'Keefe) > Chris Moss's recent posting on the syntax part of the BSI Prolog SubStandard > deserves a detailed response, which I intend to provide in the coming week. > For the record, here's a brief response: Ok, I'll take the bait!. Before I have to reply to a longer one :-) > (1) about half of the programs I have ever written would not be > accepted by a BSI-compatible reader. I suspect the reason for this comment is the existence of various types of odd directives in his programs which are not catered for in the standard. > (2) they've made several changes to operators. Amongst other things, > a postfix operator cannot be any other kind of operator as well, > but another change they made means that this restriction is > pointless. The reason for the changes is to standardise the interpretation of operators: in particular to ensure that one can't write ambiguous expressions. It may well be that the current proposal is too restrictive. If so, I'd like to see a PROOF that any other proposal works. (At last count I'd had 12 replies to my 'operator tests' posted to the net and no two of them are identical!) > (3) The attempt to describe Prolog control structures as *syntax* > is fundamentally misdirected. I assume that by 'control structures' you mean operators such as 'and' and 'or' -- I hate the word 'control' for these, they're supposed to be logical though of course they do have a control component! There are 2 basic reasons for 'freezing' the basic logical structures: 1. Manufacturers demand some consistency; they don't want to find that someone has inverted the priorities of 'and' and 'or' so a program means something entirely different to the way it reads. 2. To enable Prolog readers to be written with decent error checking and reporting facilities. I've recently seen a research report comparing Prolog with several other programming languages and it sure comes off worse! The basic reason is that EVERYTHING is operators: all a parser can say is "Syntax error ... here". > (4) The basic structure of the BSI approach to syntax has been > to cut the Gordian Goose. That is, instead of regarding the > (actually rather low) diversity of Prolog syntax as a an > opportunity to be solved by making the language more powerful > (e.g. having a table-driven tokeniser), it has been treated as > a problem to be solved by inventing a new, more restricted, > language. You may think there is low diversity but I would say the opposite. Whereas the basic semantic ideas of Prolog are well-defined there have been a number of entirely different syntaxes used to express that (I can think of at least 6 - the original Marseille, Edinburgh, microProlog, Waterloo/VM, LM Prolog, Prolog II) of which all but the first are commercial products. What other language has this diversity? The fact that one of these is undoubtedly dominant shouldn't blind you to the reservations that the others have about the 'rough edges' of the Edinburgh system. Enough for now! Chris Moss.