[REBOL] designing dialects - was OWL
From: robbo1mark:aol at: 21-Mar-2002 9:53
Sunanda,
The Web Ontology Language is NOT a ntural for REBOL.
It IS however a natural for a DIALECTING and ONTOLOGY
language. I've been thinking a bit about this recently
and especially as I consider XML / HTML to be verbose,
not human centric in design, wasteful! why have closing
tags for every value.
Let me explain abit more about what I mean.
An Extensible Dialecting and Ontology Language should not
be REBOL. REBOL is a vendor specific programming or messaging
language and it is proprietary.
A web dialect and ontology language should be programming
language neutral. It is my contention that
DIALECTS ARE NOT REBOL in as much as a well designed dialect
should be a means for describing and encapsulating data and
information about a particular topic, application or area of
specific interest in a language which is natural for the matter
in hand and is also human centric in terms of it's understanding
and maintainability.
NONE OF THIS PRECLUDES THE DESIGN OF A WEB DIALECTING AND ONTOLOGY
LANGUAGE from being REBOL friendly.
Let me illustrate.
Consider HTML as an example, as opposed to writing full blown HTML
in the REBOL community we have tools like make-doc-pro as well as
Andrew Martins excellent etext and html dialects.
These both make it possible to produce HTML documents using scripts
which convert text files into HTML according to the text 'MACRO patterns
which represent HTML functionalities. These are a direct one to one
correspondance between the text-2-html dialect language and HTML proper.
However from my point of view there is a better way to represent HTML
in a REBOL friendly DIALECT which is based on .PAGE from the pliant language project.
please follow this link
http://pliant.cx/pliant/protocol/http/page.html
Instead of text macros like
*this text will appear as bold* ; etext example
in Pliant's .PAGE this would be
BOLD TEXT "this text will apear as bold" ; .page example
This for me is closer to what a true WEB Dialecting and Ontology Language
would look like.
BOLD TEXT "This text will appear as bold"
It is NOT Rebol BUT it could BE, it is very sympathetic to REBOL design.
BOLD TEXT look like functions which take arguments.
This text will appear as bold
is a REBOL string! type.
However it is NOT REBOL per se and could be interpreted and transformed
to HTML via your language of choice, be this lisp / scheme / perl / php
/ pliant / python / java / tcl / REBOL or whatever.
Well designed DIALECT's are programming language neutral.
The DIALECT keywords are specific to the domain of knowledge.
A well designed DIALECTing language is human friendly to understand
and maintain.
XML / HTML are TOO verbose.
C / etext / make-doc-pro are NOT verbose enough, they depend on character
and symbol shortcuts to define meaning, which is great if your hacking
at the keyboard but not so great if you are looking at the file and trying
to interpret it's meaning and structure. For this you require to know
these little languages like etext or make-doc-pro.
Which is most human centric
1. BOLD TEXT "This text will appear as bold" ;.page dialect
2. *this text will appear as bold* ; etext dialect
3. <bold> <text> This text will appear as bold </text> </bold> ; html
This is only a trivial example but which shows us the following;
Etext is the most compact representation but require knowledge of
etext to deduce what "*" means.
HTML has fully balanced tags but soon becomes very verbose very quickly &
causes file sizes to be in the region of 30 to 40 percent larger than
they need to be, just by the closing tags alone!
When you consider a fully internet centric worold with web pages and xml
based web services that is a MASSIVE amount of bandwidth wasted every
minute of every day.
.PAGE for me has the correct balance of dialect keywords (human symbolic
words or values) as well as simple data values like strings and numbers.
If I were designing a language nuetral but REBOL friendly DIALECTING
and ONTOLOGY language for the WEB here is the attributes it would have;
BOLD TEXT MY_WORD a-dialect-term ; key-words or REBOL words!
12345 3.141592 2e4 ; integer and decimal numbers in standard formats
text strings
; text and data string! values
[ color rgb 0 255 0 ] ; lists of values or REBOL blocks!
SET WORD VALUE or WORD: VALUE ; assignment / extensibility see below
=========== interlude ===========
==========================
more .page examples ( note modified to include assignment )
set green [ color rgb 0 255 0 ] ; assign green to a value
green text "this text will appear in green"
=========== end of interlude =========
=======================
CONTEXTS or NAMESPACES the equivalent of REBOL objects!
my-offer: context [ price: "=A3100" amount: 2 ]
in xml this would be the same as
<my-offer> <price> "=A3100" </price> <amount> 2 </amount> </my-offer>
This would be my basis for the design of a WEB dialecting and ontology
language.
NOT REBOL but a rebol friendly language neutral human friendly format
capable of being parsed and interpreted by your programming language
of choice and / or human beings reading file data & information.
None of this is new anyway John MCarthy of LISP fame was discussing
a COMMON BUSINESS COMMUNICATION LANGUAGE back in 1976 before there was
any internet and suggested using SYMBOLIC EXPRESSIONS simlar to
LISPish syntax so the idea of a universal messaging language is NOT new
and NOT entirely exclusive to REBOL.
I think these brief suggestions outline how I think human / computer
communication can be designed and extended indefinetley without relying
on any specific computer language or platform or environment.
As a final point REBOL can only have a limited amount og global words,
at the present time / this will probably & hopefully change soon, but
that alone rules out REBOL as "THE" EXTENSIBLE MESSAGING LANGUAGE
solution, which every other language hacker would scoff at anyway for
a number of reasons, with the fact it's a proprietary language quite an
important point on any list of objections.
The question is CAN XML be dislodged before it's too late?
In any other industry a 30 to 40 per cent improvement in efficiency
would undoubtedly be hailed as breakthrough performance!
My two pence worth.
cheers,
Mark Dickson