<s>
OMeta	B-Language
is	O
a	O
specialized	O
object-oriented	O
programming	O
language	O
for	O
pattern	B-Language
matching	I-Language
,	O
developed	O
by	O
Alessandro	O
Warth	O
and	O
Ian	O
Piumarta	O
in	O
2007	O
under	O
the	O
Viewpoints	O
Research	O
Institute	O
.	O
</s>
<s>
The	O
language	O
is	O
based	O
on	O
Parsing	B-Language
Expression	O
Grammars	O
(	O
PEGs	O
)	O
rather	O
than	O
Context-Free	O
Grammars	O
with	O
the	O
intent	O
of	O
providing	O
"	O
a	O
natural	O
and	O
convenient	O
way	O
for	O
programmers	O
to	O
implement	O
tokenizers	O
,	O
parsers	B-Language
,	O
visitors	B-Language
,	O
and	O
tree-transformers	O
"	O
.	O
</s>
<s>
OMeta	B-Language
's	O
main	O
goal	O
is	O
to	O
allow	O
a	O
broader	O
audience	O
to	O
use	O
techniques	O
generally	O
available	O
only	O
to	O
language	O
programmers	O
,	O
such	O
as	O
parsing	B-Language
.	O
</s>
<s>
It	O
is	O
also	O
known	O
for	O
its	O
use	O
in	O
quickly	O
creating	O
prototypes	O
,	O
though	O
programs	O
written	O
in	O
OMeta	B-Language
are	O
noted	O
to	O
be	O
generally	O
less	O
efficient	O
than	O
those	O
written	O
in	O
vanilla	O
(	O
base	O
language	O
)	O
implementations	O
,	O
such	O
as	O
JavaScript	B-Language
.	O
</s>
<s>
OMeta	B-Language
is	O
noted	O
for	O
its	O
use	O
in	O
creating	O
domain-specific	B-Language
languages	I-Language
,	O
and	O
especially	O
for	O
the	O
maintainability	O
of	O
its	O
implementations	O
(	O
Newcome	O
)	O
.	O
</s>
<s>
OMeta	B-Language
,	O
like	O
other	O
meta	O
languages	O
,	O
requires	O
a	O
host	O
language	O
;	O
it	O
was	O
originally	O
created	O
as	O
a	O
COLA	O
implementation	O
.	O
</s>
<s>
OMeta	B-Language
is	O
a	O
meta-language	O
used	O
in	O
the	O
prototyping	O
and	O
creation	O
of	O
domain-specific	B-Language
languages	I-Language
.	O
</s>
<s>
It	O
was	O
introduced	O
as	O
"	O
an	O
object-oriented	O
language	O
for	O
pattern	B-Language
matching	I-Language
"	O
.	O
</s>
<s>
It	O
uses	O
parsing	B-Language
expression	O
grammars	O
(	O
descriptions	O
of	O
languages	O
"	O
based	O
on	O
recognizing	O
strings	O
instead	O
of	O
generating	O
them	O
"	O
)	O
designed	O
"	O
to	O
handle	O
arbitrary	O
kinds	O
of	O
data	O
"	O
,	O
such	O
as	O
characters	O
,	O
numbers	O
,	O
strings	O
,	O
atoms	O
,	O
and	O
lists	O
.	O
</s>
<s>
This	O
increases	O
its	O
versatility	O
,	O
enabling	O
it	O
to	O
work	O
on	O
both	O
structured	O
and	O
unstructured	B-Application
data	I-Application
.	O
</s>
<s>
lexing	O
and	O
parsing	B-Language
)	O
.	O
</s>
<s>
OMeta	B-Language
also	O
supports	O
the	O
defining	O
of	O
production	O
rules	O
based	O
on	O
arguments	O
;	O
this	O
can	O
be	O
used	O
to	O
add	O
such	O
rules	O
to	O
OMeta	B-Language
itself	O
,	O
as	O
well	O
as	O
the	O
host	O
language	O
that	O
OMeta	B-Language
is	O
running	O
in	O
.	O
</s>
<s>
OMeta	B-Language
is	O
capable	O
of	O
using	O
host-language	O
booleans	O
(	O
True/False	O
)	O
while	O
pattern	B-Language
matching	I-Language
;	O
these	O
are	O
referred	O
to	O
as	O
"	O
semantic	O
predicates	O
"	O
.	O
</s>
<s>
OMeta	B-Language
uses	O
generalized	O
pattern-matching	B-Language
to	O
allow	O
programmers	O
to	O
more	O
easily	O
implement	O
and	O
extend	O
phases	O
of	O
compilation	O
with	O
a	O
single	O
tool	O
.	O
</s>
<s>
OMeta	B-Language
uses	O
grammars	O
to	O
determine	O
the	O
rules	O
in	O
which	O
it	O
operates	O
.	O
</s>
<s>
OMeta	B-Language
also	O
prioritizes	O
options	O
within	O
a	O
given	O
grammar	O
in	O
order	O
to	O
remove	O
ambiguity	O
,	O
unlike	O
most	O
meta-languages	O
.	O
</s>
<s>
After	O
pattern-matching	B-Language
an	O
input	O
to	O
a	O
given	O
grammar	O
,	O
OMeta	B-Language
then	O
assigns	O
each	O
component	O
of	O
the	O
pattern	O
to	O
a	O
variable	O
,	O
which	O
it	O
then	O
feeds	O
into	O
the	O
host	O
language	O
.	O
</s>
<s>
OMeta	B-Language
uses	O
pattern	B-Language
matching	I-Language
in	O
order	O
to	O
accomplish	O
all	O
of	O
the	O
steps	O
of	O
traditional	O
compiling	O
by	O
itself	O
.	O
</s>
<s>
Typecheckers	O
then	O
match	O
patterns	O
on	O
the	O
syntax	O
trees	O
to	O
make	O
annotated	O
trees	O
,	O
and	O
visitors	B-Language
do	O
the	O
same	O
to	O
produce	O
other	O
trees	O
.	O
</s>
<s>
In	O
OMeta	B-Language
,	O
it	O
is	O
easy	O
to	O
"	O
traverse	O
through	O
the	O
parse	B-Language
tree	O
since	O
such	O
functionality	O
is	O
natively	O
supported	O
"	O
.	O
</s>
<s>
The	O
meta-language	O
is	O
noted	O
for	O
its	O
usability	O
in	O
most	O
programming	O
languages	O
,	O
though	O
it	O
is	O
most	O
commonly	O
used	O
in	O
its	O
language	O
of	O
implementation	O
—	O
OMeta/JS	O
,	O
for	O
example	O
,	O
is	O
used	O
in	O
JavaScript	B-Language
.	O
</s>
<s>
Because	O
it	O
requires	O
a	O
host	O
language	O
,	O
the	O
creators	O
of	O
OMeta	B-Language
refer	O
to	O
it	O
as	O
a	O
"	O
parasitic	O
language	O
"	O
.	O
</s>
<s>
Alessandro	O
Warth	O
and	O
Ian	O
Piumarta	O
developed	O
OMeta	B-Language
at	O
the	O
Viewpoints	O
Research	O
Institute	O
,	O
an	O
organization	O
intended	O
to	O
improve	O
research	O
systems	O
and	O
personal	O
computing	O
,	O
in	O
2007	O
.	O
</s>
<s>
They	O
first	O
used	O
a	O
Combined	O
Object	O
Lambda	O
Architecture	O
,	O
or	O
COLA	O
(	O
a	O
self-describing	O
language	O
investigated	O
at	O
Viewpoints	O
Research	O
Institute	O
)	O
as	O
OMeta	B-Language
's	O
host	O
language	O
,	O
and	O
later	O
,	O
assisted	O
by	O
Yoshiki	O
Ohshima	O
,	O
ported	O
it	O
to	O
Squeak	O
Smalltalk	O
to	O
verify	O
its	O
usability	O
with	O
multiple	O
host	O
languages	O
.	O
</s>
<s>
OMeta	B-Language
was	O
also	O
used	O
"	O
to	O
implement	O
a	O
nearly	O
complete	O
subset	O
of	O
…	O
Javascript	B-Language
"	O
as	O
a	O
case	O
study	O
in	O
its	O
introductory	O
paper	O
.	O
</s>
<s>
OMeta	B-Language
,	O
like	O
other	O
meta	O
languages	O
,	O
is	O
primarily	O
used	O
to	O
create	O
domain-specific	B-Language
languages	I-Language
(	O
DSLs	O
in	O
short	O
)	O
;	O
specifically	O
,	O
it	O
is	O
used	O
to	O
quickly	O
prototype	O
DSLs	O
—	O
OMeta	B-Language
's	O
slow	O
running	O
speed	O
and	O
unclear	O
error	O
reports	O
remove	O
much	O
of	O
its	O
functionality	O
as	O
a	O
full	O
programming	O
language	O
(	O
Heirbaut	O
73	O
–	O
74	O
)	O
.	O
</s>
<s>
OMeta	B-Language
is	O
useful	O
thanks	O
to	O
its	O
ability	O
to	O
use	O
one	O
syntax	O
for	O
every	O
phase	O
of	O
compiling	O
,	O
allowing	O
it	O
to	O
be	O
used	O
rather	O
than	O
several	O
separate	O
tools	O
in	O
the	O
creation	O
of	O
a	O
compiler	O
.	O
</s>
<s>
Additionally	O
,	O
OMeta	B-Language
is	O
valued	O
both	O
for	O
the	O
speed	O
at	O
which	O
it	O
can	O
be	O
used	O
to	O
create	O
DSLs	O
and	O
the	O
significantly	O
lower	O
amount	O
of	O
code	O
it	O
requires	O
to	O
perform	O
such	O
a	O
task	O
as	O
opposed	O
to	O
vanilla	O
implementations	O
,	O
with	O
reports	O
showing	O
around	O
26%	O
as	O
many	O
lines	O
of	O
functional	O
code	O
as	O
vanilla	O
.	O
</s>
<s>
The	O
following	O
is	O
an	O
example	O
of	O
a	O
basic	O
calculator	O
language	O
in	O
C#	O
using	O
OMeta	B-Language
:	O
</s>
<s>
OMeta	B-Language
can	O
theoretically	O
be	O
implemented	O
into	O
any	O
host	O
language	O
,	O
but	O
it	O
is	O
used	O
most	O
often	O
as	O
OMeta/JS	O
,	O
a	O
JavaScript	B-Language
implementation	O
.	O
</s>
<s>
Warth	O
has	O
stated	O
that	O
patterns	O
in	O
"	O
OMeta/X	O
---where	O
X	O
is	O
some	O
host	O
language	O
"	O
are	O
better	O
left	O
to	O
be	O
influenced	O
by	O
"	O
X	O
"	O
than	O
standardized	O
within	O
OMeta	B-Language
,	O
due	O
to	O
the	O
fact	O
that	O
different	O
host	O
languages	O
recognize	O
different	O
types	O
of	O
objects	O
.	O
</s>
<s>
MetaCOLA	O
was	O
the	O
first	O
implementation	O
of	O
OMeta	B-Language
,	O
used	O
in	O
the	O
language	O
's	O
introductory	O
paper	O
.	O
</s>
<s>
MetaCOLA	O
implemented	O
OMeta	B-Language
's	O
first	O
test	O
codes	O
,	O
and	O
was	O
one	O
of	O
the	O
three	O
forms	O
(	O
the	O
others	O
being	O
OMeta/Squeak	O
and	O
a	O
nearly-finished	O
OMeta/JS	O
)	O
of	O
the	O
language	O
made	O
prior	O
to	O
its	O
release	O
.	O
</s>
<s>
OMeta/Squeak	O
was	O
a	O
port	O
of	O
OMeta	B-Language
used	O
during	O
the	O
initial	O
demonstration	O
of	O
the	O
system	O
.	O
</s>
<s>
OMeta/Squeak	O
is	O
used	O
"	O
to	O
experiment	O
with	O
alternative	O
syntaxes	O
for	O
the	O
Squeak	O
EToys	O
system	O
"	O
OMeta/Squeak	O
requires	O
square	O
brackets	O
and	O
"	O
pointy	O
brackets	O
"	O
(	O
braces	O
)	O
in	O
rule	O
operations	O
,	O
unlike	O
OMeta/JS	O
,	O
which	O
requires	O
only	O
square	O
brackets	O
.	O
</s>
<s>
OMeta/Squeak	O
2	O
,	O
however	O
,	O
features	O
syntax	O
more	O
similar	O
to	O
that	O
of	O
OMeta/JS	O
.	O
</s>
<s>
Unlike	O
the	O
COLA	O
implementation	O
of	O
OMeta	B-Language
,	O
the	O
Squeak	O
version	O
does	O
not	O
memorize	O
intermediate	O
results	O
(	O
store	O
numbers	O
already	O
used	O
in	O
calculation	O
)	O
.	O
</s>
<s>
OMeta/JS	O
is	O
OMeta	B-Language
in	O
the	O
form	O
of	O
a	O
JavaScript	B-Language
implementation	O
.	O
</s>
<s>
Language	O
implementations	O
using	O
OMeta/JS	O
are	O
noted	O
to	O
be	O
easier	O
to	O
use	O
and	O
more	O
space-efficient	O
than	O
those	O
written	O
using	O
only	O
vanilla	O
JavaScript	B-Language
,	O
but	O
the	O
former	O
have	O
been	O
shown	O
to	O
perform	O
much	O
more	O
slowly	O
.	O
</s>
<s>
Because	O
of	O
this	O
,	O
OMeta/JS	O
is	O
seen	O
as	O
a	O
highly	O
useful	O
tool	O
for	O
prototyping	O
,	O
but	O
is	O
not	O
preferred	O
for	O
production	O
language	O
implementations	O
.	O
</s>
<s>
The	O
use	O
of	O
DSL	O
development	O
tools	O
,	O
such	O
as	O
OMeta	B-Language
,	O
are	O
considered	O
much	O
more	O
maintainable	O
than	O
"	O
vanilla	O
implementations	O
"	O
(	O
i	O
.	O
e	O
.	O
JavaScript	B-Language
)	O
due	O
to	O
their	O
low	O
NCLOC	O
(	O
Non-Comment	O
Lines	O
of	O
Code	O
)	O
count	O
.	O
</s>
<s>
OMeta	B-Language
's	O
lack	O
of	O
"	O
context-free	O
syntax	O
"	O
allows	O
it	O
to	O
be	O
used	O
in	O
both	O
parser	O
and	O
lexer	O
creation	O
at	O
the	O
cost	O
of	O
extra	O
lines	O
of	O
code	O
.	O
</s>
<s>
Additional	O
factors	O
indicating	O
OMeta	B-Language
's	O
maintainability	O
include	O
a	O
high	O
maintainability	O
index	O
"	O
while	O
Halstead	O
Effort	O
indicate[s]	O
that	O
the	O
vanilla	O
parser	O
requires	O
three	O
times	O
more	O
development	O
effort	O
compared	O
to	O
the	O
OMeta	B-Language
parser	O
"	O
.	O
</s>
<s>
Like	O
JavaScript	B-Language
,	O
OMeta/JS	O
supports	O
"	O
the	O
complete	O
syntax	O
notation	O
of	O
Waebric	O
"	O
.	O
</s>
<s>
One	O
of	O
the	O
major	O
advantages	O
of	O
OMeta	B-Language
responsible	O
for	O
the	O
difference	O
in	O
NCLOC	O
is	O
OMeta	B-Language
's	O
reuse	O
of	O
its	O
"	O
tree	O
walking	O
mechanism	O
"	O
by	O
allowing	O
the	O
typechecker	O
to	O
inherit	O
the	O
mechanism	O
from	O
the	O
parser	O
,	O
which	O
causes	O
the	O
typechecker	O
to	O
adapt	O
to	O
changes	O
in	O
the	O
OMeta	B-Language
parser	O
,	O
while	O
JavaScript	B-Language
's	O
tree	O
walking	O
mechanism	O
contains	O
more	O
code	O
and	O
must	O
be	O
manually	O
adapted	O
to	O
the	O
changes	O
in	O
the	O
parser	O
.	O
</s>
<s>
Another	O
is	O
the	O
fact	O
that	O
OMeta	B-Language
's	O
grammars	O
have	O
a	O
"	O
higher	O
abstraction	O
level	O
...	O
than	O
the	O
program	O
code	O
"	O
.	O
</s>
<s>
It	O
can	O
also	O
be	O
considered	O
"	O
the	O
result	O
of	O
the	O
semantic	O
action	O
code	O
which	O
creates	O
the	O
AST	O
objects	O
or	O
performs	O
limited	O
string	O
operations	O
"	O
,	O
though	O
the	O
grammar	O
's	O
non-semantics	O
create	O
a	O
need	O
for	O
relatively	O
many	O
lines	O
of	O
code	O
per	O
function	O
because	O
of	O
explicit	O
whitespace	O
definition	O
—	O
a	O
mechanism	O
implemented	O
to	O
allow	O
OMeta	B-Language
to	O
act	O
as	O
a	O
single	O
tool	O
for	O
DSL	O
creation	O
.	O
</s>
<s>
In	O
terms	O
of	O
performance	O
,	O
OMeta	B-Language
is	O
found	O
to	O
run	O
at	O
slow	O
speeds	O
in	O
comparison	O
to	O
vanilla	O
implementations	O
.	O
</s>
<s>
The	O
use	O
of	O
backtracking	O
techniques	O
by	O
OMeta	B-Language
is	O
a	O
potential	O
major	O
cause	O
for	O
this	O
(	O
OMeta	B-Language
's	O
parser	O
"	O
includes	O
seven	O
look-ahead	O
operators	O
...	O
These	O
operators	O
are	O
necessary	O
to	O
distinguish	O
certain	O
rules	O
from	O
each	O
other	O
and	O
cannot	O
be	O
left	O
out	O
of	O
the	O
grammar	O
"	O
)	O
;	O
however	O
,	O
it	O
is	O
more	O
likely	O
that	O
this	O
performance	O
drop	O
is	O
due	O
to	O
OMeta	B-Language
's	O
method	O
of	O
memoization	O
:	O
</s>
<s>
Where	O
OMeta	B-Language
gains	O
time	O
on	O
the	O
vanilla	O
implementation	O
,	O
however	O
,	O
is	O
in	O
lexing	O
.	O
</s>
<s>
JavaScript	B-Language
's	O
vanilla	O
lexer	O
slows	O
down	O
significantly	O
due	O
to	O
a	O
method	O
by	O
which	O
the	O
implementation	O
converts	O
the	O
entire	O
program	O
into	O
a	O
string	O
through	O
Java	O
before	O
the	O
lexer	O
starts	O
.	O
</s>
<s>
Despite	O
this	O
,	O
the	O
OMeta	B-Language
implementation	O
runs	O
significantly	O
slower	O
overall	O
.	O
</s>
<s>
OMeta	B-Language
also	O
falls	O
behind	O
in	O
terms	O
of	O
error	O
reporting	O
.	O
</s>
<s>
While	O
vanilla	O
implementations	O
return	O
the	O
correct	O
error	O
message	O
in	O
about	O
"	O
92%	O
of	O
the	O
test	O
cases	O
"	O
in	O
terms	O
of	O
error	O
location	O
,	O
OMeta	B-Language
simply	O
returns	O
"	O
Match	O
failed	O
!	O
"	O
</s>
<s>
Finding	O
the	O
source	O
through	O
OMeta	B-Language
requires	O
"	O
manually	O
...	O
counting	O
the	O
newline	O
characters	O
in	O
the	O
semantic	O
action	O
code	O
in	O
order	O
to	O
output	O
at	O
least	O
the	O
line	O
number	O
at	O
which	O
parsing	B-Language
fails	O
"	O
.	O
</s>
<s>
OMeta#	O
is	O
a	O
project	O
by	O
Jeff	O
Moser	O
meant	O
to	O
translate	O
OMeta/JS	O
into	O
a	O
C#	O
functionality	O
;	O
as	O
such	O
,	O
the	O
design	O
of	O
OMeta#	O
is	O
based	O
on	O
Alessandro	O
Warth	O
's	O
OMeta/JS	O
design	O
..	O
</s>
<s>
Specifically	O
,	O
OMeta#	O
is	O
intended	O
to	O
work	O
as	O
a	O
single	O
tool	O
for	O
.NET	O
language	O
development	O
,	O
reduce	O
the	O
steep	O
learning	O
curve	O
of	O
language	O
development	O
,	O
become	O
a	O
useful	O
teaching	O
resource	O
,	O
and	O
be	O
practical	O
for	O
use	O
in	O
real	O
applications	O
.	O
</s>
<s>
OMeta#	O
currently	O
uses	O
C#	O
3.0	O
as	O
OMeta	B-Language
's	O
host	O
language	O
rather	O
than	O
4.0	O
;	O
because	O
C#	O
3.0	O
is	O
a	O
static	O
language	O
rather	O
than	O
a	O
dynamic	O
one	O
,	O
recognition	O
of	O
the	O
host	O
language	O
within	O
OMeta#	O
is	O
"	O
two	O
to	O
three	O
times	O
uglier	O
and	O
larger	O
than	O
it	O
might	O
have	O
been	O
"	O
in	O
a	O
dynamically	O
typed	O
language	O
.	O
</s>
<s>
OMeta#	O
uses	O
.NET	O
classes	O
,	O
or	O
Types	O
,	O
as	O
grammars	O
and	O
methods	O
for	O
the	O
grammars’	O
internal	O
"	O
rules	O
"	O
.	O
</s>
<s>
OMeta#	O
uses	O
braces	O
(	O
{	O
and	O
}	O
)	O
to	O
recognize	O
its	O
host	O
language	O
in	O
grammars	O
.	O
</s>
<s>
Additionally	O
,	O
to	O
prevent	O
users	O
from	O
accidentally	O
misusing	O
the	O
metarules	O
in	O
OMeta#	O
,	O
Moser	O
has	O
opted	O
to	O
implement	O
them	O
as	O
"	O
an	O
explicit	O
interface	O
exposed	O
via	O
a	O
property	O
(	O
e.g.	O
</s>
<s>
Later	O
parts	O
of	O
OMeta#	O
are	O
written	O
in	O
the	O
language	O
itself	O
,	O
though	O
the	O
functionality	O
of	O
the	O
language	O
remains	O
fairly	O
tied	O
to	O
C#	O
.	O
</s>
<s>
The	O
OMeta#	O
source	O
code	O
is	O
posted	O
on	O
Codeplex	O
,	O
and	O
is	O
intended	O
to	O
remain	O
as	O
an	O
open-source	O
project	O
.	O
</s>
<s>
Gordon	O
Tisher	O
created	O
for	O
.NET	O
in	O
2009	O
,	O
and	O
while	O
similar	O
to	O
OMeta#	O
,	O
it	O
's	O
a	O
much	O
more	O
supported	O
and	O
robust	O
implementation	O
,	O
distributed	O
under	O
BSD	O
license	O
on	O
GitHub	O
.	O
</s>
<s>
is	O
a	O
successor	O
to	O
Ometa	B-Language
that	O
aims	O
to	O
improve	O
on	O
it	O
by	O
(	O
amongst	O
other	O
things	O
)	O
separating	O
the	O
grammar	O
from	O
the	O
semantic	O
actions	O
.	O
</s>
