{"id":4653,"date":"2009-01-27T11:45:00","date_gmt":"2009-01-27T11:45:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/vcblog\/2009\/01\/27\/dev10-is-just-the-beginning\/"},"modified":"2019-02-18T18:53:55","modified_gmt":"2019-02-18T18:53:55","slug":"dev10-is-just-the-beginning","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/cppblog\/dev10-is-just-the-beginning\/","title":{"rendered":"Dev10 Is Just The Beginning"},"content":{"rendered":"<p><font face=\"Batang\"><\/p>\n<p class=\"MsoNormal\"><span><font size=\"3\">Hello, I&rsquo;m Mark Hall, an architect in the Visual C++ group.<span>&nbsp; <\/span>I wanted to follow up on Jim Springfield&rsquo;s previous blogs about the history of C++ intellisense, and some of the changes we&rsquo;re making in upcoming Visual Studio 10 release.<span>&nbsp; <\/span>It&rsquo;s been almost a year since Jim&rsquo;s posts, which can be found here:<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><\/p>\n<p><font size=\"3\">&nbsp;<\/font><\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><a href=\"http:\/\/blogs.msdn.com\/vcblog\/archive\/2007\/12\/18\/intellisense-history-part-1.aspx\"><span><font face=\"Times New Roman\" color=\"#0000ff\" size=\"3\">http:\/\/blogs.msdn.com\/vcblog\/archive\/2007\/12\/18\/intellisense-history-part-1.aspx<\/font><\/span><\/a><\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><a href=\"http:\/\/blogs.msdn.com\/vcblog\/archive\/2008\/02\/29\/intellisense-part-2-the-future.aspx\"><span><font face=\"Times New Roman\" color=\"#0000ff\" size=\"3\">http:\/\/blogs.msdn.com\/vcblog\/archive\/2008\/02\/29\/intellisense-part-2-the-future.aspx<\/font><\/span><\/a><\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><\/p>\n<p><font size=\"3\">&nbsp;<\/font><\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><font size=\"3\">Many thanks to Jim for his archeological dig through our old products and explanation of where we&rsquo;re going in &ldquo;Dev10&rdquo;.<span>&nbsp;&nbsp; <\/span>I&rsquo;d like to add a few more details, track our progress over the last year, and offer my perspective on our investment in C++.<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><\/p>\n<p><font size=\"3\">&nbsp;<\/font><\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><font size=\"3\">When we first implemented intellisense for C++, it was easy to exceed expectations, mostly because customers weren&rsquo;t expecting very much.<span>&nbsp;&nbsp; <\/span>It had to run fast, but if it didn&rsquo;t work for templates or a complicated overload scenario people didn&rsquo;t complain.<span>&nbsp; <\/span>Naturally we wanted to leverage the &ldquo;front-end&rdquo; of our C++ command line compiler for intellisense, but it wasn&rsquo;t designed with intellisense in mind.<span>&nbsp; <\/span>It was designed to run in 256K of RAM on 16 bit DOS.<span>&nbsp; <\/span>It would parse and analyze a statement at a time and immediately lower everything to an assembly-level intermediate language.<span>&nbsp; <\/span>Parsing and semantic analysis were completely intertwined.<span>&nbsp;&nbsp; <\/span>A good architecture for intellisense separates parsing from semantic analysis.<span>&nbsp; <\/span>Semantic analysis is expensive, so for intellisense you only want to do it for the one item the user is asking about.<span>&nbsp;&nbsp; <\/span>We considered writing a new C++ front-end for intellisense.<span>&nbsp; <\/span>Thankfully we came to our senses &ndash; C++ is far too rich and complex.<span>&nbsp; <\/span>It would take much longer than one product cycle for that, and we needed something more expedient.<span>&nbsp; <\/span>So we &ldquo;derived&rdquo; our intellisense compiler from our command line C++ compiler through the liberal use of ifdefs in the code.<span>&nbsp; <\/span>We called the intellisense compiler FEACP, for &ldquo;Front End Auto Complete Parser&rdquo;.<span>&nbsp; <\/span>Our command line compiler is called C1XX, for &ldquo;C++ phase 1&rdquo; (turn the X&rsquo;s sideways). <span>&nbsp;<\/span>The ifdefs removed all the C1XX code that did any &ldquo;lowering&rdquo; to the intermediate language.<span>&nbsp; <\/span>It also removed any semantic analysis we didn&rsquo;t think was essential for intellisense (initialization, member offset computation, vtable production, etc).<span>&nbsp;&nbsp; <\/span>The CPU speeds at the time were only 100 MHz, so we had to shortcut a lot of C1XX code to populate dropdown windows within 100 milliseconds.<span>&nbsp; <\/span>We also removed all non-essential memory usage, storing far less information about each symbol we encountered.<span>&nbsp; <\/span>This was especially important because FEACP had to run in the IDE process, which already consumed copious amounts of memory.<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><\/p>\n<p><font size=\"3\">&nbsp;<\/font><\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><font size=\"3\">FEACP was a product success, but a testing and maintenance nightmare.<span>&nbsp; <\/span>There were so many strange dependencies on code and data that we had ifdef&rsquo;d out &ndash; crashes were common, along with corruption of the NCB file.<span>&nbsp; <\/span>We paid a hefty toll in maintenance.<span>&nbsp; <\/span>Since FEACP and C1XX were so different, all our testing of C1XX (millions of lines of code daily) had little effect on the quality of FEACP. <span>&nbsp;<\/span>It had to be tested more or less independently.<span>&nbsp; <\/span>The lesson here is that supporting two different compilers in the same source base is only slightly smarter than supporting two completely separate compilers, and neither is a good choice for long-term maintainability (actually it was three compilers, since ANSI-C was another set of ifdefs &ndash; and truth be told it was actually four if we include the \/analyze compiler).<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><\/p>\n<p><font size=\"3\">&nbsp;<\/font><\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><font size=\"3\">In the years since we first released FEACP we came to realize that we&rsquo;d ventured as far into &ldquo;ifdef hell&rdquo; as we could go.<span>&nbsp;&nbsp; <\/span>At the same time, intellisense for simpler languages like Java and C# raised user expectations for intellisense far beyond what we could support in FEACP.<span>&nbsp;&nbsp; <\/span>With 1000x faster CPU speeds and memory capacity, the (valid) assumptions we made when we created FEACP no longer held.<span>&nbsp;&nbsp; <\/span>Moreover, the multitude of ifdefs (and resulting compiler models) severely diminished our ability to add language features to C1XX, our bread and butter.<span>&nbsp; <\/span>Our bug counts were climbing, and the &ldquo;language gap&rdquo; was growing.<span>&nbsp; <\/span>At the same time, the number of people qualified and willing to work on a C++ compiler was shrinking.<span>&nbsp; <\/span>Something had to give.<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><\/p>\n<p><font size=\"3\">&nbsp;<\/font><\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><font size=\"3\">With the speed and capacity of modern machines we knew one compiler could service both code generation and intellisense for C++.<span>&nbsp;&nbsp; <\/span>What we lacked was a high-level internal representation of the source code.<span>&nbsp; <\/span>If we had that, we could query the representation to service intellisense requests, or lower it to produce machine code.<span>&nbsp; <\/span>We wouldn&rsquo;t have thousands of #ifdefs polluting the front-end code, and there would be just one model of compilation.<span>&nbsp; <\/span>Testing costs would be slashed dramatically.<span>&nbsp; <\/span>The barrier to entry for new compiler developers would be significantly reduced.<span>&nbsp; <\/span>But it wouldn&rsquo;t be free &ndash; even with GHz clock speeds, you can&rsquo;t run the full front-end over all the code for every intellisense request.<span>&nbsp; <\/span>We would have to create a new intellisense framework that could run the full front-end only on the regions of code that were necessary to produce a desired result.<span>&nbsp; <\/span>It would still be a lot of work, but we knew we could do it in a single product cycle.<span>&nbsp; <\/span>I&rsquo;m happy (and relieved) to say that we did, and Dev10 is the result.<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><\/p>\n<p><font size=\"3\">&nbsp;<\/font><\/p>\n<p><\/span><\/p>\n<p class=\"MsoListParagraph\"><span><font size=\"3\">Having read this far you&rsquo;re probably asking yourself, &ldquo;OK, so you&rsquo;ve lowered your cost of ownership.<span>&nbsp; <\/span>Good for Microsoft.<span>&nbsp; <\/span>But what&rsquo;s in it for me?&rdquo;<span>&nbsp; <\/span><span>&nbsp;<\/span>The most compelling feature this brings to intellisense is <i>accuracy<\/i>.<span>&nbsp; <\/span>Visual C++ compiles millions of lines of C++ code daily in build labs and desktops all over the world, and does so with &ldquo;five nines&rdquo; of accuracy.<span>&nbsp; <\/span>Harnessing the command line compiler for intellisense means it will have the same level of accuracy.<span>&nbsp; <\/span>This is our biggest differentiator in the intellisense market for C++.<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoListParagraph\"><span><\/p>\n<p><font size=\"3\">&nbsp;<\/font><\/p>\n<p><\/span><\/p>\n<p class=\"MsoListParagraph\"><span><font size=\"3\">Being accurate means more than just getting the right set of members in an auto-complete dropdown &ndash; it enables other features that would be impossible or undesirable without it.<span>&nbsp; <\/span>For example, accuracy means that any errors encountered during the intellisense parse are real errors, and we can expose them to the user as &ldquo;squiggles&rdquo; in the editor window as they edit or browse code.<span>&nbsp; <\/span>They can fix the errors without leaving the editor.<span>&nbsp; <\/span>This cuts out saving files and kicking off builds to get the command line compiler to provide such diagnostics.<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoListParagraph\"><span><\/p>\n<p><font size=\"3\">&nbsp;<\/font><\/p>\n<p><\/span><\/p>\n<p><span><font size=\"3\"><\/p>\n<p class=\"MsoNormal\"><span lang=\"EN\">A future benefit of accuracy is that our data stores will be reliable enough to use for code analysis and transformations, such as assisted refactoring of source code.<\/span><span> <\/span>There wasn&rsquo;t time in Dev10 to provide access to our expression-level data. <span>&nbsp;<\/span>Users will be able to browse the symbol store to extract symbol-level information about their source bases.<span>&nbsp;&nbsp; <\/span>In a future release we will provide user-facing APIs that provide access to accurate information about their C++ source bases.<span>&nbsp; <\/span>This will open up a whole new ecosystem for analysis, understanding, and productivity tools for C++ on Windows.<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoListParagraph\"><span><\/p>\n<p><font size=\"3\">&nbsp;<\/font><\/p>\n<p><\/span><\/p>\n<p class=\"MsoListParagraph\"><span><font size=\"3\">Dev10 is just the beginning.<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoListParagraph\">&nbsp;<\/p>\n<p><\/font><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hello, I&rsquo;m Mark Hall, an architect in the Visual C++ group.&nbsp; I wanted to follow up on Jim Springfield&rsquo;s previous blogs about the history of C++ intellisense, and some of the changes we&rsquo;re making in upcoming Visual Studio 10 release.&nbsp; It&rsquo;s been almost a year since Jim&rsquo;s posts, which can be found here: &nbsp; http:\/\/blogs.msdn.com\/vcblog\/archive\/2007\/12\/18\/intellisense-history-part-1.aspx [&hellip;]<\/p>\n","protected":false},"author":289,"featured_media":35994,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-4653","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cplusplus"],"acf":[],"blog_post_summary":"<p>Hello, I&rsquo;m Mark Hall, an architect in the Visual C++ group.&nbsp; I wanted to follow up on Jim Springfield&rsquo;s previous blogs about the history of C++ intellisense, and some of the changes we&rsquo;re making in upcoming Visual Studio 10 release.&nbsp; It&rsquo;s been almost a year since Jim&rsquo;s posts, which can be found here: &nbsp; http:\/\/blogs.msdn.com\/vcblog\/archive\/2007\/12\/18\/intellisense-history-part-1.aspx [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/4653","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/users\/289"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/comments?post=4653"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/4653\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/media\/35994"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/media?parent=4653"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/categories?post=4653"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/tags?post=4653"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}