What is "Open Language"?
Mark Waddingham
mark at livecode.com
Tue Oct 27 05:02:59 EDT 2015
On 2015-10-25 00:19, Monte Goulding wrote:
> OK, well we can let Mark Waddingham comment on whether I’m right in
> that control structures are unlikely targets for open language or not.
> It seems quite unlikely to me as it’s significantly more complicated
> than commands. I’m not saying it’s not possible the ROI would be
> terrible. As in almost 0 return for a reasonably heavy investment…
Initially, Open Language will allow you to define:
- commands
- expressions
- iterators
This is the range of things which the 'custom' LiveCode Builder syntax
is built upon (which means I know it definitely works!).
Commands are what they you would imagine - they are a sequence of tokens
interspersed with expressions:
'put' <Expression> 'after' <Expression>
Expressions fall into three categories. First we have 'prefix
operators':
'word' <Expression> 'of' <Expression>
Then we have postfix operators:
<Expression> 'is' 'a' 'number'
Then we have infix operators:
<Expression> 'is' 'less' 'than' <Expression>
Then we have radical expressions:
'the' 'empty' 'string'
Note that in all three 'operator' cases, you can also have expressions
in-between the tokens:
<Expression> 'is' 'between' <Expression> 'and' <Expression>
The thing which defines what class of operator it is is determined by
whether there is an expression on the left, right or both.
Iterators are essentially extensions to 'repeat':
'repeat' 'for' 'each' 'char' <Variable> 'in' <Expression>
Basically, we'll extend the reach of Open Language in terms of what you
can create in the host language with it over time. Already, implementing
the initial LiveCode Builder compiler has taught me that there need to
be a greater set of patterns such as property accesses, chunks etc. -
defining them at the low level 'syntax clause' point is a little too
much work (although a great deal less then writing explicit C code as an
ad-hoc parser in the engine ;)).
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