> Using eclipse, I believe it has a compilation system so that it > compiles while you write the code, while compiling it checks for > errors in the syntax, if there are any syntactical errors it will > underline them and make it known to the user and won't let the user > run the application until all of the errors are fixed.
eclipse also does type-checking, method lookup and all the other stuff a compiler frontend does. > Implementing a similar system in vim, I believe the hardest problems > to deal with would be getting the compiler to compile often enough > so that the user could see the errors and correct them quickly, but > not so often as to affect the performance of the system. So updating > of the compilation would need to occur asynchronously, depenedant on > how much code is being written by the programmer and such. I believe > this to be the crucial part of the project, because if the plugin is > to be a feasible part of Vim, it needs to be so fast that the > programmer doesn't want to turn it off. http://steve-yegge.blogspot.com/2008/03/js2-mode-new-javascript-mode-for-emacs.html has some (lengthy, rambling ;-) ) discussion on asynchronous parsing. > I believe this could be accomplished with help from other projects > such as GCC, G++, who would know good ways to rapidly update the > compilation without affecting performance too greatly. A nice > feature would be to have a gradual compilation, where the project is > compiled as the programmer writes it, and so there is no big > compilation at the end. Such a system is evident in eclipse, and VS > has this as well. > > Any feedback on this is appreciated. As mentioned before, the clang project ( clang.llvm.org ) is an open- source frontend for C, C++ and ObjC. As far as I understand, Apple wants to use it in future XCode releases to do syntax highlighting, eclipse-like error highlighting, and refactoring. It is under active development by Apple employees and other contributors. It uses a library-based design, so you could run only the parser and not the type analysis for example. Writing your own frontend is madness :-) The real challenge is to come up with a general interface between vim and the language checking modules; writing a module for C with clang should be doable. Nico --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_dev" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~---