What is "Open Language"?
Mark Waddingham
mark at livecode.com
Tue Oct 27 05:19:03 EDT 2015
On 2015-10-24 20:17, Richard Gaskin wrote:
> This is part of the reason I raised this thread. We've seen some
> rather broadly varying ideas about what Open Language means, but I
> share your concerns and I'm not sure that's what Mark intended, even
> if some are excited at the prospect.
I was long concerned about what would happen if the ability to add
syntax was 'opened up' to all. However I ceased being concerned about it
after I worked out how it could be done.
People should be free to experiment and develop their own syntax for
their own ends - why should we restrict that?
As it stands LiveCode syntax is *heavily* based around the idea of it
being a domain-specific language for GUI development. However, I think
the ideas present within LiveCode (and predecessor xTalks) have far far
greater applicability than that.
At the end of the day, any syntax extensions will be under heavy
constraint due to the existing syntactic forms which exist in the engine
already and in terms of what potential users will expect.
Market forces, will in the end, sort out the 'good' from the 'bad' - and
as Geoff Canyon pointed out even if a 'bad' syntax extension becomes
popular - it will only do so because it provides facilities that no-one
else has provided and are important... In which case it might be
'distasteful' to use, but pragmatically that doesn't matter if it gets
the job done.
> I believe the core of the issue is that to date all xTalks have
> required comma-delimited arguments for custom commands. The good news
> is that this is pretty much how most programming languages work, so
> it's not particularly onerous. But the bad news is that it means that
> the libraries we share bear no relationship syntactically with the
> build-in commands.
Indeed - it has been a long standing problem. Something which has been
often opined about by a great many people within our community
(including yourself, I believe, at certain points - although I might be
wrong on that ;)).
However, I should perhaps point out that Open Language evolved from me
trying to work out how to actually service the great many feature
requests we get for adding syntax. The current implementation of the
parser in the engine, whilst it works, is incredibly difficult to
modify. This not only means that it is not at all straightforward to add
English-like syntax to new features, but also that it is far too
expensive (time-wise) to experiment with new syntactic ideas.
Unfortunately, syntax is one of those things that you really do need to
try before you buy - thought experiments really don't cut it in many
cases.
> I *believe* (emphasis added to note that I'd he happy to be corrected
> by Mr. Waddingham if this isn't correct) that Open Language was
> proposed primarily (perhaps only) to allow library scripters to define
> syntax that fits in more closely with the flavor of the rest of the
> language.
>
> For example, today I might write:
>
> CreateDocument "Window Title", tFilePath
>
> ...but with Open Language I could write:
>
> create document titled "Window Title" using file tFilePath
>
> Mr. Waddingham, is that correct?
Pretty much. Syntax is about patterns. There are already a great many
patterns which exist in LiveCode Script, even if they are not directly
apparant.
>
>
> That said, I admit I'm rather enamored of this request:
> <http://quality.runrev.com/show_bug.cgi?id=3157>
That would be probably about a 8 line definition file to implement when
we have Open Language - I'll look forward to making it available on
April 1st the year Open Language arrives :)
Warmest Regards,
Mark.
--
Mark Waddingham ~ mark at livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps
More information about the use-livecode
mailing list