Brand-New. NET interpreter-Mono has arrived

Source: Internet
Author: User
Tags emit mixed

Mono has perfected its own on-the-fly compilers and static compilers through new ways of running code.

In 2001, the Mono project officially began, and the Mono development team wrote an interpreter for the. NET instruction set to boot a self-hosted. NET development environment on Linux.

It was thought that the interpreter was just a temporary tool that could be used when creating a just-in-time (JIT) compiler. The Interpreter (mint) and the JIT Engine (mono) maintain a state of synchronization until the JIT engine can be ported to all supported platforms.

When generics are introduced, the engineering costs of preserving both the interpreter and the JIT engine become high and no longer worthwhile, so the interpreter is removed.

will be introduced later. NET code for full static compilation. This is also the introduction of the prohibition target platform to generate dynamic code technology. iOS is the main driver in this area, and it opens the door to allow Mono to run on PlayStation and Xbox consoles.

The main disadvantage of full-static compilation is that you must recreate a new executable file each time you update your code. This is a slow process, not suitable for the interactive development of practice.

For example, some game developers like to tweak their game code without triggering a full recompile. Static compilation makes this impractical, so they embed the scripting language in the game code to quickly iterate and tweak.

. NET lacks dynamic capabilities, which also hinders. NET as a teaching or prototyping tool for use in some environments. Some tools like Xamarin workbooks or simple scripts cannot be used. NET language, have to resort to other solutions on the platform.

Frank Krueger, when building the continuous IDE, needed the environment on iOS, so he wrote his own. NET interpreter in F # so that he could have a complete on the ipad. NET development environment.

In order to solve these problems and support some internal Microsoft products, and then back to the Mono interpreter.

the new mono interpreter

Now it's back to Mono's old interpreter and upgrades it to. NET support, and also added support for generics to run. NET, which has now officially existed for 2017 years. Next, mono will increase support for mixed mode execution.

Mono is now a way of running on webassembly (the other way is to use the static compilation of LLVM).

The interpreter is now an important part of mono, and it passes most of the tests in a large number of test suites, and now you can use it when building mono from source code, as shown here:

$ mono--interpreter Yourassembly.exe

Mixed Mode Execution

Although the independent interpreter is now very mature, the Mono development team is currently developing a configuration that can mix interpreted code with statically compiled code or code that is immediately compiled, called Mixed mode execution.

For platforms like Ios,playstation and Xbox, mixed-mode execution means you can precompile a core library or core application, and still support dynamic loading and executing code. While having the advantage of using LLVM to optimize all core libraries, you still have the flexibility to run some dynamic code.

This will allow game developers to use it on their systems. NET language to prototype, experiment, and tweak game code without recompiling the application.

This will be used for in. NET language, open the door to the design of scriptable applications.

the work of the future

The mono development team is expanding the capabilities of the interpreter to handle a variety of interesting scenarios, the following are some of the current projects:

    • Improve the static compilation of mono

Mono's full AOT-compiled version does not come with System.Reflection.Emit, which has several uses.

The System.Linq.Expressions API has been widely used in many advanced scenarios, such as the Entity Framework or the user using the C # compiler to parse expressions into an expression tree, and you may have seen the code in the following scenario:

Expression sum = a + B;var adder = Sum.compile (); Adder ();

In the complete AOT scenario, the design of the Entity Framework and the way the above works are integrated into the interpreter through the expression class above. Although this expression interpreter has limitations, it is also a large interpreter.

By enabling the System.Reflection.Emit interpreter, you can remove a large amount of code.

This also makes for. NET-built scripting language that can work in statically compiled environments such as Ironpython,ironruby and Ironscheme.

To do this, the Mono development team is completing the work of mixed-mode execution. This means that the interpreted code complements the existing statically compiled ones. NET code.

    • Better isolation.

The Mono Development team is completing support for the AppDomain in order to enable this scenario by not addressing the hot load issues that developers are deploying when they deploy the app.

    • Studying blending mode options

The mono development team found that some programs were interpreted by the interpreter and performed faster than using the JIT engine.

It is therefore intended to study mixed execution patterns, or hierarchical compilation. You can have the interpreter perform some code that is insensitive to performance, such as static constructors or other initialization code that can run only once, to reduce memory usage, and to reduce the resulting code usage and execution time.

Another scenario is to run the code in interpreted mode, and if a threshold is exceeded, switch to the JIT-compiled implementation of the method, or use properties to annotate the problems encountered and methods that are not worth optimizing.

mono:http://www.mono-project.com/download/

Original link: http://www.mono-project.com/news/

Reproduced please specify from: Grape City control

About Grape City

Founded in 1980, Grape City is the world's largest control provider, providing services to more than 75% of Fortune 500 companies worldwide, with a leading provider of enterprise application customization tools, enterprise reporting and business intelligence solutions. In 1988, Grape City set up a research and development center in China, in the development of global products, constantly adapt to the local needs of the Chinese market, and for software enterprises and various industries of information technology to provide excellent software tools and consulting services.


This article is from the "Grape City Control Technology Team Blog" blog, be sure to keep this source http://powertoolsteam.blog.51cto.com/2369428/1982283

Brand-New. NET interpreter-Mono has arrived

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.