AXForum  
Вернуться   AXForum > Microsoft Dynamics AX > DAX Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 08.12.2015, 22:12   #1  
Blog bot is offline
Blog bot
Участник
 
25,475 / 846 (79) +++++++
Регистрация: 28.10.2006
Axilicious:What about this new eXceLleNT Dynamics AX compiler?
Источник: http://www.ksaelen.be/wordpresses/dy...s-ax-compiler/
==============

As the new major release of Dynamics AX is released, we can now dig a little deeper into some of the new stuff available to us now. And boy did they put in a lot of effort! Previous major releases did bring us some new tools, but there was a balance between new tooling and new functionality. With this major release, the focus is definitely more on getting the technology stack up to date. One of those new things available to us, is a whole new nice and shiny compiler!



Many of you guys will recognize the picture below. In Dynamics AX 2012 RTM and FP, you could literally wait for hours for your compiler to finish. This was because of the single threaded 32-bit compiler in the client. R2 CU6+ brought some relieve by introducing a command line tool that could compile your application with multiple workers, but still the process of compiling X++ and CIL afterwards, was not quite what it should be.

But now those days are over! A new compiler rises! So let’s have a look and see what stuff this brings along.

XLNT (X++ language Toolkit aka Excellent)

XLNT is a framework written in C# that is similar to the Roslyn compiler framework (but much smaller) (https://roslyn.codeplex.com/).  It has been built up from scratch in C# because the old compiler stack (C++) was from a time where hardware and CPU power was not as powerfull as today.



Below you can see a simplified schema of how the compiler is built now. It uses a more phased approach where you are able to ‘plug in’ passes based on what you want to achieve (Compilation, Best Practice checking, …). You can see the compiler as a set of building blocks that you can use for different scenario’s.

Visual Studio Integration

In this major version of Dynamics AX, Visual Studio has become the IDE for all of your X++ source coding on a daily basis. And because of that, one of the two ways you can access the compiler is from within the GUI of Visual Studio (and the other one is a command line tool called xppc, which can be a post on it’s own)



To start a compilation, you can do one of two things:


  • you can just build your solution / project as you would do with any other C# application. This will invoke an incremental compile of what has changed. To be able to give you a good experience within Visual Studio, this type of compilation is triggered when you go around and change things and will only compile a subset of your model by only recompiling the netmodules in which the changed objects reside.
  • Another way of compiling is to use the new Dynamics AX menu to perform a build on the models you select. This is called a full compilation of the model and will compile all of the netmodules related to your selected models.



If you save your source code written in Visual Studio, every single method is persisted into its own XML file. The XLNT framework is responsible of writing to and reading back from the XML files. (aka stitching and unstitching).



Basic navigation (stuff like Go to declaration) relies on cross references. So to be able to do this, the compiler will contain a pass that handles cross references and bulk copies related data to the cross reference database (DYNAMICSXREFDB). Also keep in mind that when you do not need a building block like this (say in a nightly build), you can just leave it out and compilation time will be much less.

X++ Compilation

In previous versions, not all of the code was generated in MSIL. A part of the code was still compiled into P-Code and being interpreted at run time. Another part was transformed into MSIL by XSL transforming P-Code generated by the compiler. But as of now, this is entirely gone and everything is generated in MSIL managed code by the compiler!



On top of that, the new compiler is massively parallel : as Microsoft states: “This thing will get his hand on all of the resources it can take to do as many things in parallel as possible. It means that you need to run this on a machine with at least 16GB of memory for a full build. That’s just how it’s designed.”



Another feature which is really nice, is the diagnostics support. At each point in time, the compiler can output error messages that will be included in the diagnostic telemetry available for the application. Based on this telemetry data, you can get an insight into different aspects of compilations. Microsoft is able to act on compiler errors, crashes, … much quicker then before to improve the compiling experience.

Best Practices

Let’s not leave out best practices. As Peter Villadsen quoted : “BP’s are important, anyone who says different, has not been in the industry long enough and not suffered enough. They are the result of many years of industry practice and should not be disregarded.” And I could not agree more. For years know, we have been making an effort and succeeded in customizing Dynamics AX without introducing new best practice violations. And to help with this, the XLNT framework also provides the tooling for checking best practices and authoring custom rules.



The best practice checking tool, like the compiler, can be run automatically when compiling or can be called using a command line tool. And Microsoft has clearly taken this seriously because for the first time ever, they too have adopted a zero tolerance approach for all of their code. So yes, all best practices have been addressed!



So this is in a nuttshell what the new compiler is all about. Stay tuned for more!



Источник: http://www.ksaelen.be/wordpresses/dy...s-ax-compiler/
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
emeadaxsupport: Managing general performance issues in Microsoft Dynamics AX Blog bot DAX Blogs 0 12.09.2014 12:11
DAX: Official Dynamics AX 2012 R2 Content (update) - Where is it, and how can you find out about updates? Blog bot DAX Blogs 0 03.12.2012 11:11
axinthefield: Compatibility Testing for Microsoft Dynamics AX Blog bot DAX Blogs 0 23.06.2012 02:26
axinthefield: Dynamics AX Event IDs Blog bot DAX Blogs 0 01.03.2011 22:11

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 00:23.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.