Code completion and custom grammars

1,028 views
Skip to first unread message

brian heylin

unread,
Feb 3, 2011, 6:41:47 AM2/3/11
to Ajax.org Cloud9 Editor (Ace)
Hey all

I'm doing research to see if Ace can be used as an game scripting/
story writing tool. Ace has some very impressive features but what I
find myself needing on most projects I work on is to make content
entry easier for some expert such as a script writer to make stories
with interactive logic or even from another field, such as a chemistry
or finance.

My aim is to make a textual content entry system based on Ace so that
I can define a quick custom grammar for a small focused language (DSL)
(for example, describing a story with multiple arcs and ability to
trigger animations and effects or a lighting control system for a
museum)

In the best case scenario I would like to write a BNF grammar which
can be linked to certain file types and used to provide code
completion. I know that there is already syntax highlighting, which
needs a very simple grammar.

Is there anything approaching this complex grammar/code completion
system in Ace at the moment? Or where can I look in the core to start
making my own?

Eelco Visser

unread,
Feb 3, 2011, 8:08:00 AM2/3/11
to Ajax.org Cloud9 Editor (Ace), Lennart Kats, Karl Trygve Kalleberg
Hi Brian,

Great question! At TU Delft we're developing the Spoofax Language
Workbench (http://spoofax.org), which supports the definition of the
syntax and (static) semantics of (domain-specific) languages and their
IDEs. Spoofax is an Eclipse plugin and generates language-specific
Eclipse plugins for your DSL; not what you are looking for, but ... As
next step in our research we are starting to work on generating Web
IDEs (plugins) for DSLs from language definitions. We have done some
preliminary prototyping, generating syntactic editor services in
Bespin based on SDF grammars. We are now going to target ACE.
Unfortunately, not something you can use right away, but we are going
to get there, and very much aim to support the type of scenario you
are describing.

cheers,

-- Eelco Visser

Associate Professor at Delft University of Technology

Group: Software Language Design and Engineering
Email: e.vi...@tudelft.nl
Homepage: http://eelcovisser.org
Publications: http://researchr.org/profile/eelcovisser
News: http://twitter.com/eelcovisser

brian heylin

unread,
Feb 3, 2011, 8:40:00 AM2/3/11
to ace-d...@googlegroups.com
Hey Eelco

The company I work for (ijsfontein.nl) are actually based in the center of Amsterdam, so I'm not to far away from you :)
Are you interested in meeting up for a chat maybe? I can pop down to Delft some evening.

We might even be able to cooperate on this, as we are very interested in using a system like this as a content management system for our games and museum projects and also for control systems for interactive installations etc.

What do you think?

--
You received this message because you are subscribed to the Google Groups "Ajax.org Cloud9 Editor (Ace)" group.
To post to this group, send email to ace-d...@googlegroups.com.
To unsubscribe from this group, send email to ace-discuss...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/ace-discuss?hl=en.




--
Brian

Ruben

unread,
Feb 3, 2011, 8:44:19 AM2/3/11
to ace-d...@googlegroups.com
@brian: Haha, funny, you know we are from Amsterdam too, right?

- Ruben

Eelco Visser

unread,
Feb 3, 2011, 8:46:44 AM2/3/11
to ace-d...@googlegroups.com
Hi Brian,

> The company I work for (ijsfontein.nl) are actually based in the center of
> Amsterdam, so I'm not to far away from you :)
> Are you interested in meeting up for a chat maybe? I can pop down to Delft
> some evening.
>
> We might even be able to cooperate on this, as we are very interested in
> using a system like this as a content management system for our games and
> museum projects and also for control systems for interactive installations
> etc.

Excellent! Great to see that there is real industry demand for our
project:) We are in the process of writing a research proposal around
these issues and are looking for industrial partners with good use
cases to join us.

I'll poke you off the mailing list for some further discussion.

cheers,

-- Eelco

brian heylin

unread,
Feb 3, 2011, 8:56:04 AM2/3/11
to ace-d...@googlegroups.com
@rubin: Hah nice, I've just looked at the Ajax.org team. All very Dutch names :)

Well this is gezellig then. Well I'm very interested in meeting up with a lot of people from this list then :)
Maybe we can all work together on a nice application of the Ace toolset.

My aim is to use it for general content for our projects and specifically I'm very interested in using Ace as the basis for an interactive story tool, with a visualization of the story arcs and logic to help semi-technical writers make non-linear stories.

The Ace system and tools are very new to me, but I see it playing a big part in the future of content within our projects.

Fabian Jakobs

unread,
Feb 3, 2011, 9:04:55 AM2/3/11
to ace-d...@googlegroups.com
Hi Brian,

some of the Cloud9 team (including myself) will be at amsterdamJS next
tuesday <http://groups.google.com/group/amsterdam-js/browse_thread/thread/d32f961a84b28b68>.
Wanna join and discuss about Ace over a few beers?

Fabian

Fabian Jakobs

unread,
Feb 3, 2011, 9:06:52 AM2/3/11
to ace-d...@googlegroups.com
Hi,

I have done some work to support background syntax checks in a web
worker for the JS mode. It already works pretty good but it is is not
fully integrated yet. Take a look at lib/ace/mode/javascript_worker.js
to see how it works.

Best,
Fabian

brian heylin

unread,
Feb 3, 2011, 9:08:31 AM2/3/11
to ace-d...@googlegroups.com
@Fabian: sounds like a plan! And as luck would have it, I live right around the corner from the Volkskrantgebouw :)

Alek Paunov

unread,
Feb 3, 2011, 8:13:58 PM2/3/11
to ace-d...@googlegroups.com
Hi guys,

It would be great if you start something like Spoofax (full IDE
support for a new language in pure declarative fashion) based on
Ace/Cloud9, because:
* Interest in Ace and Cloud9 is huge - a lot of developers will
contrubute and relatively quickly the most of the current results in
the Eclipse "hosted" projects [1] will be reached.
* Later, this fondation will draw things to a real dual
Source/Structure еditors (which is the long-awaited progress in the
IDE business). With APF and the other modern JS libs (on DOM and SVG)
it is much easier than Eclipse frameworks. (And the people at this
list will allways keep the state of things from unnecessary
complication :-))


I think the most important - starting points are:

1) Choice of persistent representation (at least within an editing
session) of CST/ASTs and the data from the static analysis - something
which will drive the autocompletion, code folding, jump to def,
refactoring, etc ...

2) Choice of type/notation for language grammars and corresponding
parsing technology (preferably incremental, of course)


Dr.Visser will probably offer something relly clever for these, based
on their great experience with ATerm and SGLR, but just in case, I am
repeating [5] my proposal too:

A1) AcePIX [2]: Presentation of CSTs nested in ASTs as a native
browser XMLDocuments with different namespaces for nodes from
different languages + nodes for space + additional link nodes to
maintain ref/def and inheritance relations.
* Relatively fast XPath and XLST based tooling for such kind of tree
representation comes out of the box with current browsers.
* Because of the APF "kernel", Ajax.org team have extensive
experience with support of such XMLDBs in the browser - this probably
will bring quick results if the approach be chosen.

A2) AcePEG: LPEG [3] style parser (as VM impelemented in JS, but at
RegExp, not at bytes level)
* on top of AcePIX becomes possible the implementation of the
incremental parsing - using VM state recovery as function of last
non-destructed AST node before the incoming diff hunk from the editor.
* similar VM is used in new (current) RegExp V8 implementation [4]
(at bytes level of course, like LPEG)
* it is clear, that because of the language nesting, the perser need
to be scanerless (like SGLR)
* PEG is the most understandable notation for non parsing experts
* LPEG approach is still reasonably fast, but memory effective in
same time - nothing common with the weaknesses of the Packrat
algorithm.


The following questions are: tools for symbols linking and static
analysis for the other languages (apart JS), code trees rewriting and
uparsing like Stratego and TXL, etc, etc ... I have some thoughts, but
let first, if such a direction be taken, Mozilla & Ajax.org team
select approaches for the base questions.

Productive beers at amsterdamJS :-),
Alek

[1] Spoofax/IMP, Xtext, EMFText
[2] AcePIX: By analogy of LLVM/clang CIndex-es (content of clang
emited .ast files used for IDE services).
[3] http://www.inf.puc-rio.br/~roberto/docs/peg.pdf
[4] http://code.google.com/p/v8/source/browse/branches/bleeding_edge/src/interpreter-irregexp.cc#191
[5] http://groups.google.com/group/cloud9-ide/browse_thread/thread/442577c439ac7f7b/a7ee72d05bf8686b
(My first attempt to discuss the topic)

Leen Besselink

unread,
Feb 4, 2011, 3:49:57 AM2/4/11
to ace-d...@googlegroups.com
On 02/03/2011 03:04 PM, Fabian Jakobs wrote:

> > Hi Brian,
> >
> > some of the Cloud9 team (including myself) will be at amsterdamJS next
> > tuesday <http://groups.google.com/group/amsterdam-js/browse_thread/thread/d32f961a84b28b68>.
> > Wanna join and discuss about Ace over a few beers?
> >
> > Fabian

Hi folks,

I've been lurking on this list and Bespin/Skywriter for a while now
because I've been very busy with other things, so I won't be doing any
development on it any time soon. My idea at the time was to create a
mostly generic backend written in PHP for embedded Ace, so I could use
it in some PHP-projects at work and for hobby.

If that backend exists people could use it doing editing of HTML
templates and css for themes and javascript code for things like
Wordpress, Drupal or Joomla as well. I think it could add a lot of users
to Ace as those frameworks are be pretty popular.

If you have more users you can get more bugs fixed. :-)

My guess is, some of you will be at FOSDEM this weekend ?:

http://fosdem.org/2011/schedule/event/cloud9_ide

I don't think I would need to see the talk my self, I think I know what
can be done with it already. :-) And I've seen the video of the French
conference as well.

I've never been at FOSDEM before so I don't know how tight the schedules
are, but I might pop in to see some people.

If you want to know: I'm also from the Netherlands, but at the other end
of the A1 in Hengelo.

Have a nice day,
Leen.


Mike Ratcliffe

unread,
Feb 4, 2011, 2:38:23 PM2/4/11
to Ajax.org Cloud9 Editor (Ace)
Working on a Firebug extension called Acebug, which adds Ace to the
Firebug command line I am really excited that you are working on
this ... I expect that everybody is. It would certainly be a welcome
addition to Ace.

Sadly, travelling from Switzerland to the Netherlands is probably a
little too far for me but if you would like any help I am sure there
will be no shortage of volunteers.

Richard Mayer

unread,
May 20, 2014, 10:20:05 AM5/20/14
to ace-d...@googlegroups.com
And like all good things in the internet, this thread comes to an abrupt end, leaving the reader wandering whatever happened :-P

Brian, I would love to know if you ever realised your project because in our company we're looking to do (technically speaking) the same thing?

We want to define test scenarios, using a custom product DSL and are hoping we can use Ace to help with syntax highlighting and autocompletion.

Gulfaraz Yasin

unread,
Jun 7, 2016, 9:09:54 AM6/7/16
to Ajax.org Cloud9 Editor (Ace), richar...@thinkproject.com
Richard, have you received any reply on this ?

I'm facing the same problem - it would be great if you could share the path you guys took.
Reply all
Reply to author
Forward
0 new messages