►
From YouTube: Pest: Building a Language Server. Victor Lopez
Description
Victor is a Brazilian ERP developer who currently works in Russia for the localization of a product. In his free time, he's a Rust enthusiast who aims to bring more companies to its benefits.
To build a language server, we need a very robust parser and some efficient JSON/RPC framework.
To achieve that, I used Pest (PEG-based) with a big TDD coverage for the parser, and Parity’s solution for the JSON/RPC interface.
Currently, I’m on beta; I expect to achieve a base of 10k users.
A
Hello,
my
name
is
Victor
Lopez
I
work
as
a
developer
for
the
localization
of
our
enterprise
search
planning
software
I'm,
going
to
talk
today
about
the
process
of
developing
a
language
server
with
the
Russ
language.
So
the
main
topics
will
be
a
first,
the
describe
briefly.
The
language
server
protocol
general
talk
about
the
rust
language
server.
That's
one
implementation
of
it
and
then
I'm
going
to
talk
why
I
choose
rust
and
how
the
process
of
developing
this
solution
with
rust.
A
So
first,
what's
the
problem?
I
had
I
have
a
proprietary
language
called
adv
pl,
it's
a
property
of
Toto's
and
it's
consolidating
in
latin
america,
but
we're
bringing
a
solution
to
russia
and
we
don't
have
developers
with
it.
So
we
need
to
provide
a
solution
that
will
support
these
developers
and
that
this
solution
should
provide
the
possibility
to
integrate
with
external
components
like
the
one
application
server
that
will
communicate
with
some
object
storage.
A
The
current
protocol
we
are
using
for
this
communication
is
rest,
but
could
be
any
we
can
just
implement
on
the
language
server
and
extend
it
and
also
check
on
the
database.
So
Mattamy
information
about
the
process
of
development.
This
was
the
challenge
and
also
we
work
with
multiple
IDs.
We
have
one
Eclipse
based
IDE,
let's
call
TDs
and
one
extension,
if
yes
code
so
for
these,
we
cannot
for
every
implementation
of
the
language
server
make
one
additional
requirements
on
the
solution
for
the
language,
support
and
also
the
last
challenge
is
the
interaction
with
external
objects.
A
It
should
be
easily
implemented
and
we
can
achieve
this
with
the
language
server.
Also,
the
language
server
protocol,
whites
good,
it's
totally
agnostic.
If
we
talk
about
the
editor
we
are
using,
so
it
means
that
it
will
work
with
VI
with
vyas
code
with
Eclipse
or
whatever
supports
this
protocol,
and
the
definition
is
open
and
very
clear.
So
it's
open
source
work.
A
It's
a
very,
very
booster
nowadays
that
a
lot
of
people
is
using.
So
we
have
some
fairly
good
results
with
it
and
I'd
broadly
use
it,
though
we
have
the
major
languages
using
this
protocol
for
their
implementations,
and
with
these
we
have
a
lot
of
situations
already
covered,
so
it
can
count
on
this
framework.
It's
totally
extensible
design,
aesthetic
see
we
have
with
this
particular
implementation
to
extend
these
functionalities
to
integration
with
other
services,
and
we
have
the
classical
M
times
n
problem
for
the
language
support
development.
A
It
means
that
like,
if
you
have
a
given
language,
you
provide
a
functionality
to
support
this
language.
You
have
simple
amenities:
functionality
for
the
number
of
registers
they
are
going
to
use.
Instead
with
the
language
server,
you
just
implement
the
functionality
I'm
going
to
give
a
very
quick
demo
on
how
it's
working.
A
A
Okay
and
on
the
right
I'm
going
to
perform
some
operations
with
it,
so
we're
going
to
see
for
every
operation
perform
that
ID
a
communication
based
on
the
JSON
RPC
protocol
to
the
language,
server
I'm,
just
dumping
the
information
on
the
terminal.
So
here
we
have
the.
However,
some
linting
with
I'm
doing
crashing
the
users
to
use
single
quotes
in
this
case.
If
we,
for
example,
create
a
new
file,
let's
put
the
languages
this
one
and
I'm
going
to
write
here,
the
classical
hello
world.
A
So
about
that
texture,
it's
on
the
right.
It's
every
finger,
Jesus
anticipated
so
for
every
interaction
as
I
show
to
you.
We
will
send
a
request
that
language
server
and
do
expect
a
response.
If
the
request
type
is
request
or
you
can
just
work
with
notifications,
I
quit
foolin
a
file.
We
expect
no
answer
from
the
language
server,
so
it's
a
notification
and
if
we
ask
for
the
command
like
the
LinkedIn
command,
we
should
expect
one
response:
language
server
who
is
using
I
bet.
All
of
you
know
at
least
two
or
three
of
these
logos.
A
We
have
some
very
big
implementations
for
this
protocol
like
either
for
the
editors
like
VI,
jetbrains
or
Eclipse
Foundation,
and
on
the
right.
We
have
the
rust
language
we
have
the
C++,
Java
go
and
so
on
about
the
the
perspective
for
the
language
server
protocol.
We
see
these
as
a
possibility
of
bringing
every
of
the
support
of
languages
as
a
service.
In
this
example,
I
have
one
implementation
for
eclipse.
That's
called
che.
They
support
on
the
browser
fully
idea
for
ID.
You
can
easily
implement
our
language
support
on
these
with
the
protocol.
A
A
We
also
have
some
possibilities
on
CI
that
we
have
the
current
paradigmatic
bases,
but
we
could
interact
with
some,
for
example,
static
certain
analysis
and
also
we
have
the
possibility
of
using
some
of
the
main
specific
languages
to
implement
language
server
certain
so
not
only
for
the
developers
systems,
but
we
could
also
specify
the
documentation
of
a
company
or
any
other,
even
natural
language.
With
these
support.
A
Here
we
have
one
implementation,
Russ,
that's
very
good.
They
presented
these
on
Russ
conference
of
2016.
It's
called
zai
I,
really
like
it,
because
I'm
big
fan
of
the
ISO
somehow
have
these
are
match
on
the
name,
it's
fully
implemented
in
rust,
and
they
only
implemented
the
the
back
end.
It's
a
somehow
supported
by
Google
and
open-source
as
well,
and
they
have
one
very
strong
pilot,
that's
the
performance,
so
everything
is
a
synchronous
or
on
the
base
of
these
particular
backends.
A
It's
fully
open
source
and
it's
there
are
some
demonstrations
on
the
github
of
these
editor
about
the
speed
they
can
achieve.
Alacrity
alacrity
is
another
Russ.
Implementation
for
terminals
uses
GPU
and
it's
fairly
very
good
as
well,
and
we
have
also
one
brass
implementation
for
the
front
end
that
will
communicate
with
this
editor.
A
That's
called
DXi
it's
based
on
getting
care
and
also
open
source.
The
github
is
there
for
the
ones
who
are
curious
about
this.
So
as
for
the
major
supported
editors
for
the
rest
language
server,
now
we
have
one
resource
called
our
we
IDE
yet
for
the
ones
that
are
familiar
of
the
russ
community.
We
know
that
are
several
resources
like
this.
Like
are
we
game
yet
are
we
were
yet,
and
this
is
for
IDs?
We
have
a
follow
up
of
the
functionalities
of
the
editors
there
and
what
are
the
expected
are
implementations
and
so
on.
A
It's
quite
interesting
for
the
ones
who
take
a
look.
My
personal
selection
for
the
major
players
is
that
I
Eclipse,
the
corrosion
that
they
provide.
The
support
for
rust
of
yes
code
also
have
some
set
of
extensions
VI.
They
also
have
a
fairly
good
support.
It's
my
choice
and
JetBrains.
They
are
not
the
language
at
the
rust
language,
server
user,
but
they
are
implements
support
of
their
own
to
this
language.
A
So
this
was
their
decision
I
flagged
here
as
a
not
RLS
user,
but
there
it's
fair
to
mention
them,
because
I
have
a
lot
of
users
and
it's
a
major
player
absolutely
for
the
completion.
We
have
the
racer
it's
an
implementation
to
provide
completion
and
work
in
parallel
with
the
language
server,
so
they
both
will
work
very
to
a
very
well
together,
especially
for
the
new
Bing
implementation
immigrants,
and
also
we
have
the
github
that's
open
source
for
the
language
server
itself,
it's
always
on
the
bleeding
edge.
So
they
follow
everything.
A
That's
new
on
rust
and
it's
working
currently
on
a
very
stable
state,
a
recommended
set
up
for
beginners
in
openness
vest
code
with
the
set
of
extensions
I
highlighted
there
is
a
fairly
the
same
as
in
the
are
we
ID
yet
and
for
VI
users.
I
use
particular
this
set
of
extensions
that
you
could
easily
start
with
I,
don't
know
bundle
or
any
other
installer,
and
they
will
provide
a
very
good
environment
for
you
to
develop
your
your
solutions
about
the
rest
language
server,
how
to
collaborate.
A
They
follow
a
very
normal
community
approach
to
bring
maintainer
Xand
people
who
are
willing
to
contribute
and
for
the
ones
who
are
beginning
with
rust.
There
is
also
always
the
good
first
issue,
labels
that
are
based
on
some
analysis
of
the
community,
some
issues
that
could
be
easily
understandable
for
newcomers
and
they
can
check
on
on
these
particular
subjects.
A
We
also
have
the
vs
code,
the
extension-
that's
also
open
source,
so
you
can
just
fork
the
repository
and
start
to
work
with
it
and
the
problem
about
the
rust
language
server
that
we
don't
have
a
huge
test
coverage.
So
if
somebody
wants
to
contribute
with
that
and
implement,
some
test
coverage
will
be
awesome
as
well
and,
of
course,
we
can
bring
additional
clients
for
every
client.
We
need
to
have
an
implementation
that
will
communicate
with
the
language
server.
A
So
in
this
case,
if
you
have
a
particular
editor,
that's
not
currently
covered,
you
can
just
implement
additional
clients
and
you'll
be
very
helpful,
and
if
you
just
use
and
report
issues,
you'll
find
you
also
be
helping.
So
these
are
the
key
ways
to
collaborate
on
a
helpful
way
with
the
community.
So,
first
of
all,
why
trust
to
develop
this
solution
performance?
It's
the
strong
points
that
everyone.
A
How
is
talk
about
rust
and
I'm,
going
to
show
a
quick
demonstration
to
some
proof
of
concept,
I
made
to
define
that
this
is
actually
okay
for
what
I
expect
it's
cross-platform,
so
you
I,
don't
have
to
change
the
code
to
make
it
available
for
the
Mac
for
Linux
for
Windows
or
whatever.
So
it's
very,
very
simple,
to
make
this
cross-platform
support
it's
sort
of
the
box,
and
this
was
also
another
very
strong
reason.
If
I'm
talking
about
providing
support
for
different
counters
for
different
editors,
we
need
to
be
cross-platform.
A
Safe
eating
is
also
another
very
strong
point
for
us,
so
we
I
had
I,
never
found
any
weird
memory
problems.
So
it's
a
fairly
good
point
as
well,
and
one
of
the
most
important
is
that
modern
technologies
friendly.
This
means
that
I
have
this
idea
of
bringing
the
community
together
to
provide
some
linting
rules
and
some
solutions
that
we
actually
require
some
involvement
of
the
community.
A
We
talked
previously
about
the
webassembly,
a
solution
and
I
developed
a
parser
that
will
work
out
of
the
bottle
on
any
browser,
any
modern
browser-
and
this
is
one
of
the
possibilities
we
have
with
rust
so
out
of
the
box.
They
can
provide
this
type
of
support
and
follow
any
modern
technology
and
are
perishing.
We
have
available
pest
framework
that
used
some
back.
Grammars
I
will
talk
a
little
bit
about
it
later
and
we
have
one
ready,
crate
called
a
language
server
types.
A
They
will
provide
the
specified
types
for
the
language
server
communication
also
out-of-the-box,
so
it's
a
very
simple
to
be
at
the
plate
with
the
implementation
I
found
out
one
little
bug
with
that.
Eclipse
integration
based
on
the
this
language
type
based
on
some
requires,
do
not
require
the
fusion.
It
was
very,
very
simple:
to
use
this
as
a
base
to
the
carnet.
So
here
I
have
the
proof
of
concept.
I
talking
about
I,
develop
it
a
any
cooing
solution.
It's
a
classical
mathematical
problem
that
they
have
some
fairly
extensive
computational
power
required.
A
A
A
Okay,
so,
for
example,
for
once
you
produce
a
compilation
waiver,
there
will
be
the
the
parsonage
post
that
these
are
character
is
not
expected
on
that
position
and
I
if
I
fix
it.
I
have
the
full
parts
entry
under
the
right,
so
this
works
very
fast
as
well
and
totally
browser
bases
currently
I'm
offline.
A
So
going
back
to
the
slide,
so
this
is
why
I
choose
rust.
So
why
why
the
best
framework
white,
Pegram
ours?
We
have
open
search
solution
as
well
the
best
framework
for
the
development
of
parsers.
It's
a
it's
on
a
very
stable
stage
now
and
for
the
research
demanding
operation
of
Part
C
sources.
I
have
some
examples
like
the
one
I
showed
before
it's
like
two
thousand
and
five
hundred
lines:
I
have
others
with
ten
thousand
lines,
so
this
should
be
parse.
A
It
fast
and
I
can
achieve
these
before
a
less
than
one
second
of
parsing
time,
I
can
show
later
it's
a
fairly
good
number
for
the
user
interaction.
So
if
we're
talking
about
a
complex
operation
with
fuser
and
we
parse
in
less
than
one
second,
it's
a
good
result.
We
could
grant
that
we
have
these
features.
We've
passed
based
on
a
grammar
development
and
these
grammars,
the
pec
grammars,
that
this
framework
provides.
They
are
always
well-formed,
so
I
have
some
validations
on
best
for
the
development
of
the
grammar.
That
will
predict
some
left
recursion
problems.
A
When
you
are
in
development
time,
you
do
not
waste
time
in
production
to
fix
these
very
common
problems.
Also,
safety
is
another
another
topic
for
this
one
another
plus
one
for
this
one
and
also
modern
technologies
friendly
these
type
of
this
framework,
in
particular
because
of
the
Pegram
our
structure,
it's
very
good
two
parts
code,
but
not
good,
two
parts,
some
natural
language.
So,
if
we're
talking
about
developing
a
domain
language,
that's
somehow
close
to
natural
language.
This
is
not
your
solution.
A
I've
put
on
the
right,
simple
graphic
about
the
performance
of
pests
compared
to
gnome
and
third,
normal
cells
are
very
well
consolidated.
Libraries
in
rust
as
well-
and
this
is
the
amount
of
megabytes
we
can.
Our
parts
per
second
of
JSON
data
gnome
is
very,
very
efficient,
but
they
are
not
grammar
based.
So
all
these
solutions
that
I
want
to
provide
natural
will
not
be
available
because
I
have
to
develop
the
parsing
from
scratch.
Something
like
that.
So
Nome
has
a
fairly
good
parsing
time
and
pass
with
the
grammar
base.
A
A
The
challenges
of
using
this
best
framework
that
I
face
it
I
have
the
multi-threading
problem.
So
most
of
the
things
with
the
language
server
is
a
synchronous
and
unfortunately
we
don't
have
the
sentencing.
Implementation
for
pets
on
the
current
state.
I
honestly
expect
this
to
be
implemented
on
the
rows
2018
with
the
new
features,
but
anyway,
the
way
I
had
to
fix
this
particular
problem
is
to
use
some
arcane
mutex
to
axis
the
parse
entry
on
the
main
thread.
A
So
this
was
the
way
and
it's
not
a
big
problem
since
we're
not
talking
about
different
developers
accessing
the
same
resource.
We
not
have
concurrency
problems
there
and
we
have
an
implementation
from
the
pest
framework.
That's
called
a
St,
the
github
is
there
and
they
are
using
generic
types
to
implement
their
parser.
This
means
that
we
could
use
easily
implement
the
standard
SiC
implementations
on
our
types
after
this
table
I'm,
currently
not
using
because
it's
a
very
recent
initiative,
so
I
will
finish
my
work
with
them
native
pests,
but
there
is
also
this
possibility.
A
If
multi-threading
is
a
big
thing
for
you,
you
can
go
to
this
ast
implementation
for
the
development
of
the
grammar.
If
you're
going
to
develop
a
grammar,
you
should
expect
a
proportion
like
this
one.
This
is
my
keys.
I
have
400
lines
of
grammar
and
I
have
4,000
lines
of
our
testing
of
tdg
white
EDD,
it's
very
difficult
to
debug,
one
grammar,
at
least
for
the
past.
We
have
a
set
of
macros.
That's
based
on
this
other
language.
A
That's
the
syntax
for
the
best
grammar-
and
this
is
this-
was
taking
a
lot
of
time,
so
I
decided
to
take
the
TDD
approach
and
if
you
expect
you
to
achieve
a
result,
you
should
expect
the
proportion
similar
to
that
in
order
for
planning.
So
I
pointed
here
that
we
don't
have
cleared
the
bugging
procedures
for
the
parsing,
and
this
will
be
one
of
the
challenges.
Certainly
you
face
so
about
the
execution
of
the
development.
A
All
the
communication
between
the
editor
and
the
language
server
will
send
some
G's
RPC
pro
requests
to
the
server
and
it
will
have
to
manage
the
data
so
for
every
character,
change
for
every
document
to
open
or
any
other
interaction.
The
editorial
just
sends
the
contents
of
these
changed
data
to
the
language
server,
and
it
will
have
to
store
it
internally.
A
The
contents
of
the
sources
you
are
working
with
this
means
that
you
need
to
have
some
sort
of
implementation
for
the
virtual
file
server
that
will
be
in
memory
if
we're
talking
about
always
parsing
data
from
disk.
This
is
absurd
because
takes
a
lot
of
time
and
resources.
So
it's
mandatory
that
you
have
some
memory
control
for
this
and
we
have
the
rest
language
server,
a
solution
for
that.
Already
it's
done
for
us.
It's
a
video
file
server.
The
github
is
right.
A
There,
it's
fairly
stable
as
well,
and
you
can
use
this
as
a
base
for
your
implementation
about
the
desire,
PC
communication
I
use
it
the
parity
tech
solution.
We
have
the
JSON
RPC
protocol
implemented
there
and
it
works
very,
very
well
too.
I
never
had
problems
with
it
and
they
have
several
server
implementations,
so
they
have
some
RPC.
A
Some
ACP
I
myself
used
stdio,
that's
fairly
supported
by
any
environment
we
were
talking
about,
but
they
also
have
some
other
possibilities
for
you
in
case
you
need
and
there's
some
general
guidelines
I
follow
it
to
achieve
the
result.
Any
change
on
the
test
of
the
parcel
will
increment
the
major
version.
This
means
that
we
can
on
us
reliable
way,
counts
that
the
parser
will
always
produce
the
same
tree
on
that
deterministic
way
for
a
given
version.
A
This
is
important
for
and
when
you're
talking
about
our
lynching
rules
and
effort,
if
you
want
to
develop
some
strong,
linking
rules
will
depend
on
some
community
interaction
may
be
those
who
just
rules.
Maybe
there
will
suggest
some
analysis
of
your
source
and
if
you
have
different
parties
for
the
same
version,
it's
totally
not
possible
to
to
consider
this.
So
this
actually
follows
the
TDD
idea.
So
any
change
on
the
test.
A
We
will
increment
the
major
version
when
we
imply
some
possible
breaking
changes
and
we
also
require
a
very
good,
very
strong
participation
of
the
community
when
we
are
talking
about
the
linker
rules.
This
means
that
for
my
particular
implementation,
I'm
using
some
voting
systems
to
integrate
the
contents
of
the
rules
like
the
developers
can
give
a
plus
one
minus
one
for
a
given
rule
and
based
on
this
information,
we
can
define
what's
being
accepted
and
what's
not
being
accepted
by
the
community
like
these
needs
is
usually
struggle
with
developers.
A
A
A
That
I
showed
previously
of
browser
parsing
the
Ford
is
the
best
website
resources
there.
You
can
find
a
very
small
book
that
we
will
somehow
describe
how
you
can
develop
with
this
framework.
Language
specification,
that's
a
fairly
important
resource.
If
we're
talking
about
developing
this
and,
of
course,
that
we
ID
the
language,
server,
github
and
the
G's
or
PC
from
Part
C
tech
implementation,
it's
also
open
source
and
you
can
use
these
as
a
reference.
A
So
in
case
you
want
to
consult
a
to
understand
better
how
the
communication
for
language
service
is
working.
You
cannot
check
these
dis
contents.
That's
pretty
much
it.
Thank
you
very
much
for
the
participation
and
I'm
going
to
be
available
on
the
lunch
order
around
there
for
any
questions.
You
may
eventually
have
Thank
You
Victor.