Re: To develop a system fit for Web-heroes.
Ulrich Neumerkel <[email protected]>
| Newsgroups | gmane.comp.ai.prolog.swi |
|---|---|
| Message-ID | <[email protected]> |
Richard O'Keefe:
>(1) Unicode support -- wide character sets were already considered
> back in 1984 and the Prolog standard deliberately *allows* (but
> does not *require) the use of Unicode.
http://www.complang.tuwien.ac.at/ulrich/iso-prolog/#MOCSH
> Why doesn't it require Unicode? Because some implementors were
> unwilling or unable to support it. (It's worth noting that a
> lack of syntactic support has not stopped Erlang being
> successful in this area, and that Java's botched support for
> Unicode hasn't caused as many problems as you might expect.)
Prolog's first committee draft was CD1:1992 to be precise 1992-03-27.
The first attempt for UTF-8 was 1992-09 when two individuals design
and implement a new, better ISO 10646 encoding for Plan 9.
http://www.cl.cam.ac.uk/~mgk25/ucs/utf-8-history.txt
Prior to that, there was no generally accepted encoding. So agreeing
on a character set that cannot be written nor used with the toplevel
is not very appealing.
> It would be good if there were at least a *conditional*
> standard: "IF you do Unicode this is the way to do it".
> Like the optional components of the old COBOL standard;
> the report writer feature might or might not be there but
> IF it was there you knew what it should look like. In all
> fairness, Unicode is appallingly complex, and there are
> few people who can claim expertise in both Unicode and
> Prolog.
A TR on this would do, too. Enforcing it would be extremely complex
and the effect would be practically the same. The self-declaration
would be longer - and more impressive :-). But to be able to start
this we need some clean implementations. After all, the problems are
"only" in the details! And SWI isn't so good on the details. And
since SWI7 even less. One example out of many:
SWI permits all kind of layout within quoted, double quoted (and
probably also back quoted) items. ISO permits only the space
character. All other characters have to be written symbolically like
\n or as \123\
http://www.complang.tuwien.ac.at/ulrich/iso-prolog/conformity_assessment#5
and the subsequent #177, #6.
with such differences you can waste mails and meetings.
Have you looked at:
http://www.swi-prolog.org/pldoc/man?section=unicodesyntax
| Quoted atoms and strings
|
| Any character of any script can be used in quoted atoms and strings.
Looks like too much. And what means string here?
| Atoms and Variables
Is this definition explicit enough? And robust enough for future
Unicode versions? Lo are considered like Ll. Yes? What to do with
Lm and Lt? Like
writeq('a\x2bb\').
Can this be written without quotes? Does this make sense?
| Control and unassigned characters
|
| Control and unassigned (C*) characters produce a syntax error if
| encountered outside quoted atoms/strings and outside comments.
Maybe in comments, but not inside atoms. Need escape for this.
| Other characters
| The first 128 characters follow the ISO Prolog standard.
ISO Prolog does not define the first 128 characters (...).
| Other characters (this is mainly No: a numeric character of other
| type) are currently handled as `solo'.
Too much.
I believe that a subset of the current Unicode syntax of SWI (minus
the new things in SWI7 of course) could be codified. But identifying
this precise subset will be very difficult when there are no clean
implementations at hand. And many implementors wait for the next step
until things have been settled... After all, they would also then be
comitted to conform.
Also, Unicode itself is a moving target. So some extra caution needs
to be taken here.
(Personally, I can very well understand Jan not removing all these
problematic cases and going even for more incompatibility: Everytime
he made a step towards better ISO conformity in the past which meant
lots of work, this list howled ; better conformance did not make Jan
happier.)