[cfe-dev] RFC: A proposal for a Clang-based service architecture

Jean-Daniel Dupas devlists at shadowlab.org
Tue Jun 12 11:43:11 PDT 2012

Le 12 juin 2012 à 20:22, Manuel Klimek a écrit :

> On Tue, Jun 12, 2012 at 8:12 PM, Eli Bendersky <eliben at gmail.com> wrote:
> On Tue, Jun 12, 2012 at 12:43 PM, Chandler Carruth <chandlerc at gmail.com> wrote:
> > Greetings all!
> >
> > What follows is a fairly lengthy and detailed design document for a proposed
> > persistent Clang server (or clangd in unix-terms) to serve as infrastructure
> > for increasingly advanced and interactive C++ tools. It should generalize
> > and build upon libclang, and will allow us to effectively target Vim, Emacs,
> > and other editors. This is something we're planning to pursue in the near
> > term, so I'd appreciate any and all feedback.
> >
> > Here is a Google Docs link you can use to view and comment on the proposal:
> > https://docs.google.com/document/d/1kNv2jJK0I0JGnxJxU6w5lUOlrIBoecU4fi9d_o5e2-c/edit
> >
> > Its interim home is on github here, where you can see the history and the
> > actual rest version in all its glory:
> > https://github.com/chandlerc/llvm-designs/blob/master/ClangService.rst
> >
> > I've also attached the text for email-based comments.
> Great proposal, I really like the potential of such a project - it's
> exactly the kind of service that can start with one thing in mind and
> then find itself adapted for various interesting uses. That said, your
> initial proposed application is awesome and itself worth the effort -
> having real IDE-ish code completion and indexing in Vim & Emacs could
> be awesome.
> Some minor comments on the design document:
> * Goal: "Provide a restartable, long-lived background process which
> manages caching, compilation, indexes, and performs the business
> logic."
> What does "compilation" mean in this context? From the rest of the
> document I understand Clang is only used for its analysis features,
> not for actual code generation or full compilation.
> * "The crazy stretch goal for this is O(1ms) for code-completion with
> fully warm and primed caches."
> It really sounds overly ambitious, taking IPC and a fairly complex
> code-base into account. Why 1ms, though? Since this is user
> interaction application, isn't 1ms far, far below the human detection
> threshold?
> Well, people argue about what is "far below the human detection threshold". For example, I (personally, no idea how much chandler agrees) want this service to just take my keystrokes and be able to give me contextual information updated while I type. That would require getting close to the 1ms.

Do you really managed to type 1000 chars per seconds ? For the record, with a 60Hz screen, each frame is displayed 16ms, so even if you were able to type faster than that and query completion for each keystroke, you would not be able to display all results.

> Cheers,
> /Manuel

-- Jean-Daniel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20120612/f1e69c03/attachment.html>

More information about the cfe-dev mailing list