SlideShare a Scribd company logo
1 of 59
Download to read offline
What is new in Mono?
July 2013
miguel@gnome.org
Agenda
• Today:
– What is new in Mono-land.
– Major Work-in-Progress Projects
• Tomorrow:
– Brainstorming session
– Future of Mono and .NET
MONO 3.2
Mono 3.2
• Core .NET 4.5 support
– Base Class Libraries
– C# 5
• Available today:
– Desktop
– Server
– Mobile
• 2.10.x is no longer supported
What is new in Mono 3.2
• Vastly improved SGen GC
– Now the default!
• Micro-optimizations
– Mobile-driven
• Consume PCL binaries
• Shipping OSS Microsoft frameworks
• New Mono frameworks
SGen Garbage Collector
• Our Precise, generational collector
• Now the default for Mono
– “mono” now runs mono –gc=sgen
– libmono is Boehm
– libmono-sgen is Sgen
• Sgen is now faster on almost every workload
• MonoDevelop/Xamarin Studio
– Been using it as a default since February
What is new?
• Major collectors:
– Copy collector (old, reference code)
– Mark and Sweep
• Minor collectors:
– Now with support for cementing
• Help game developers love GC
• dtrace probes
Mark and Sweep
• Dynamic heap by default
– Can specify fixed heap if desired
• Allocates blocks of memory to bucket sizes
– Think of the spirit to “slab” allocation
– Support changes in workloads with evacuation
• Concurrent Marking, Lazy Sweeping
Disabling Major Collector
New API on Mono.Runtime (mscorlib.dll)
if (!Mono.Runtime.SetGCAllowSynchronousMajor (false))
Console.WriteLine ("Sorry, the GC won't cooperate.");
// your low-latency code here
Mono.Runtime.SetGCAllowSynchronousMajor (true);
• Exposed on Mobile.
• Use System.Reflection to find it on desktop editions.
dtrace probes on MacOS
Major collections and minor collections pause times visualized
http://schani.wordpress.com/2012/11/02/sgen-and-dtrace/
STATIC BUILD IMPROVEMENTS
Static Compilation
• For systems that don’t support JITing
– Apple’s iOS devices
– Consoles (PlayStation, Xbox)
– Security: when not shipping IL
• Limited generics support
– Static analysis limitations
– Some dynamisms in .NET idioms
• LINQ and Value Types
“Attempting to JIT compile method”
System.ExecutionEngineException: Attempting to JIT
compile method Foo[]:Bar`1
“Attempting to JIT compile method”
System.ExecutionEngineException: Attempting to JIT
compile method Foo[]:Bar`1
iOS Development Improvements
• Improve development cycle
• Incremental Builds
– Disable linker (compile everything)
– Cache resulting native code aggressively
• Incremental Upload
– Only uploads changes
– Main executable, libraries or resources
Incremental Deployment
(With Build Caching)
0
10
20
30
40
50
60
70
80
Hello World Large App
Seconds
Old
New
Deployment times can now be as short as one second.
Incremental Deployment
(With Build Caching)
0
5
10
15
20
25
30
35
40
Hello World Large App
Seconds
6.2
6.4
Deployment times can now be as short as one second.
Build Speed Improvements
0
10
20
30
40
50
60
70
80
Hello World Large App
Seconds
6.2
6.4
6.4+Incremental
MICROSOFT OPEN SOURCE CODE
Now Bundled with Mono
• Reactive Extensions
– Possible on iOS with new code gen changes
• F# everywhere
• Razor
• Entity Framework
• ASP.NET WebStack
MonoDevelop Xamarin Studio
MonoDevelop / Xamarin Studio
MonoDevelop Core MonoDevelop Core
Android Mac iOS
Branding Add-In
Open source
Commercial
CROSS PLATFORM FRAMEWORKS
Cocos2D XNA
• XNA port of the popular Cocos2D API
– Over 4,000 games built with this API
– Well documented, well known
• MonoGame brings it everywhere
– iOS, Android, Windows Phone (7 and 8)
– Mac
– Windows (GL, DX, , Windows Store)
– Xbox360, Ouya
– Play Station Mobile (PS Vita + Sony Androids)
Using Cocos2D XNA Today
• Available as:
– NuGet Packages
– Templates for VS and Xamarin Studio
• Source code:
– http://github.com/mono/cocos2d-xna
• Getting Started:
– http://docs.xamarin.com/guides/cross-platform/cocos2d_xna
Angry Ninjas - Full Open Source Game
https://github.com/xamarin/AngryNinjas
Cocos2D Crash Course
• Mike Bluestein’s talk tomorrow
Xamarin.Mobile
• Base class library
for mobile services
• Mike Bluestein’s talk
Xamarin.Auth
• Clients for OAuth 1 and OAuth 2
– Includes variations
• Stores user credentials
• Support non-standard auth schemes
• Cross Platform
Xamarin.Auth
using Xamarin.Auth;
var auth = new OAuth2Authenticator (
clientId: "App ID from https://developers.facebook.com/apps",
scope: "",
authorizeUrl: new Uri ("https://m.facebook.com/dialog/oauth/"),
redirectUrl: new Uri ("http://www.facebook.com/connect/login_success.html"));
auth.Completed += (sender, eventArgs) => {
DismissViewController (true, null);
if (eventArgs.IsAuthenticated) {
// Use eventArgs.Account to do wonderful things
}
}
PresentViewController (auth.GetUI (), true, null);
// 1. Create the service
Xamarin.Social
• Posts statuses, links, images/media to social networks
– Access social network APIs using authenticated requests.
– Automatically and securely store user credentials using
Xamarin.Auth.
– Cross Platform
• Extensible, currently has support for:
– App.net
– Facebook
– Flickr
– Pinterest
– Twitter
Using Xamarin.Social
var facebook = new FacebookService {
ClientId = MyFacebook_AppId
RedirectUrl = new System.Uri (MyRedirectUrl)
};
// 2. Create an item to share
var item = new Item { Text = "Xamarin.Social is the bomb" };
item.Links.Add (new Uri
("http://github.com/xamarin/xamarin.social"));
// 3. Present the UI on iOS
var shareController = facebook.GetShareUI (item, result => {
// result lets you know if the user shared the item or canceled
DismissViewController (true, null);
});
PresentViewController (shareController, true, null);
Now all Open Source
• All frameworks:
– Cocos2D XNA
• http://github.com/mono/cocos2d-xna
– Xamarin.Auth
• http://github.com/xamarin/Xamarin.Auth
– Xamarin.Mobile
• http://github.com/xamarin/Xamarin.Mobile
– Xamarin.Social
• http://github.com/xamarin/Xamarin.Social
• Taking patches!
WORK IN PROGRESS
PLAYSCRIPT
PlayScript
• Started by Zynga
– Xamarin working to integrate into Mono
– Rescuing Flash Developers!
• ActionScript look-alike language
– Superset of ActionScript
– With C# 5 features
– Optional strongly-typed
• Encouraged for performance
PlayScript Compiler
• Dual Compiler
– playsc foo.play
• Compiles PlayScript to foo.exe
– playsc bar.cs
• Compiles C# to bar.exe
– playsc foo.play bar.cs
• Compiles PlayScript foo.play and C# bar.cs
• Into foo.exe
• Allows blending C# and PlayScript code in one
assembly
PlayScript Compiler
• Based on Mono’s C# compiler
– Altered to accept PlayScript language
• Side effects:
– Compiler as a service support for PlayScript
– Full Xamarin Studio integration
• code completion
• Docs
• Project support
PlayScript Libraries
• pscorlib
– Provides core library for PlayScript/ActionScript
• Flash Stage3D
– GPU accelerated framework
– Used by gaming frameworks
Ported Frameworks
• Starling Framework
• 2D Game Engine
• Powers Angry Birds
• Away3D
• 3D Game Engine
• Physics
PlayScript today
• Compiles existing large ActionScript projects
– Some missing language features
– Actively working to improve language
– Merging into Mono (playscript branch)
– Everywhere Mono runs
• On GitHub:
– Project: http://github.com/playscript
C++ INTEROP
Evolving Cxxi
• Couple of years ago Cxxi project was launched
• Used GCC-XML to parse C++ definitions
• Runtime creation of C# to C++ bridges
– Reflection.Emit
– Pluggable VTable ABIs
CppSharp
• New C++ binding technology from Mono
• Produces C# libraries to consume C++ code
– Use Clang for higher fidelity
– Static compilation (to support iOS, Consoles)
– Customize binding for .NET consistency
– Direct calls to C++ (no intermediate glue)
– Imports C++ Doxygen docs into C# docs
http://github.com/mono/CppSharp
Generating a binding
Sources
Generated
Final Library Foo.dll
libFoo.so
C++
Headers
C++
Source
Foo.cs
C++
Headers
C# API
Driver
public class Sample : ILibrary
{
public Sample(LanguageGeneratorKind kind) : base("Sample", kind) {}
public override void SetupPasses(Driver driver, PassBuilder passes)
{
passes.RenameDeclsUpperCase(RenameTargets.Any);
passes.FunctionToInstanceMethod();
}
public override void Preprocess(Driver driver, Library lib)
{
lib.SetClassAsValueType("Foo");
lib.SetNameOfFunction("FooAdd", "FooCalc");
lib.IgnoreClassField("Foo", "b");
}
static class Program
{
public static void Main(string[] args)
{
ConsoleDriver.Run(new
Sample(LanguageGeneratorKind.CPlusPlusCLI));
ConsoleDriver.Run(new Sample(LanguageGeneratorKind.CSharp));
}
}
NATIVE INTEROP
Assembly in C#
• Allow developers to inline assembly code
– Micro-optimizations
– Optimize a code path
– Use arch-specific features
• You can not get more native than that.
Assembly in C#
• Allow developers to inline assembly code
– Micro-optimizations
– Optimize a code path
– Use arch-specific features
Example
unsafe int Clear (IntPtr buffer, int count)
{
asm.BindIntPtr (0, buffer);
asm.BindInt (1, count);
asm.Emitx86 (@”
push %ecx
push %edi
mov %eax,%edi
mov %ebx,%ecx
xor %eax,%eax
rep stosb
mov $1,%eax
pop %edi
pop %ecx
”);
return asm.FetchInt (0);
}
unsafe int Clear (IntPtr buffer, int count)
{
asm.BindIntPtr (0, buffer);
asm.BindInt (1, count);
asm.Emitx86 (@”
push %ecx
push %edi
mov %eax,%edi
mov %ebx,%ecx
xor %eax,%eax
rep stosb
mov $1,%eax
pop %edi
pop %ecx
”);
return asm.FetchInt (0);
}
In case there are any doubts
Example
unsafe int Clear (IntPtr buffer, int count)
{
asm.BindIntPtr (0, buffer);
asm.BindInt (1, count);
asm.Emitx86 (@”
push %ecx
push %edi
mov %eax,%edi
mov %ebx,%ecx
xor %eax,%eax
rep stosb
mov $1,%eax
”);
return asm.FetchInt (0);
}
• Bind Parameters
• Let Mono know which
parameters you will pass
Example
unsafe int Clear (IntPtr buffer, int count)
{
asm.BindIntPtr (0, buffer);
asm.BindInt (1, count);
asm.Emitx86 (@”
push %ecx
push %edi
mov %eax,%edi
mov %ebx,%ecx
xor %eax,%eax
rep stosb
mov $1,%eax
”);
return asm.FetchInt (0);
}
• Bind Parameters
• Let Mono know which
parameters you will pass
• Assembly code as a string
• Assembled by LLVM
• Mono JIT Calling conventions
Example
unsafe int Clear (IntPtr buffer, int count)
{
asm.BindIntPtr (0, buffer);
asm.BindInt (1, count);
asm.Emitx86 (@”
push %ecx
push %edi
mov %eax,%edi
mov %ebx,%ecx
xor %eax,%eax
rep stosb
mov $1,%eax
”);
return asm.FetchInt (0);
}
• Bind Parameters
• Let Mono know which
parameters you will pass
• Assembly code as a string
• Assembled by LLVM
• Mono JIT Calling conventions
• Fetch result value
Example
unsafe int Clear (IntPtr buffer, int count)
{
asm.BindIntPtr (0, buffer);
asm.BindInt (1, count);
asm.Emitx86 (@”
push %ecx
push %edi
mov %eax,%edi
mov %ebx,%ecx
xor %eax,%eax
rep stosb
mov $1,%eax
”);
return asm.FetchInt (0);
}
• Bind Parameters
• Let Mono know which
parameters you will pass
• Assembly code as a string
• Assembled by LLVM
• Mono JIT Calling conventions
• Fetch result value
Passing parameters, extracting
• Input parameters:
– asm.BindXXX (int incomingParameter, XXX value);
• Emit assembly code:
– asm.Emit (string code)
– Assembled with LLVM assembler
– Injected into resulting assembly
– Follow Mono native rules for preserving register usage
• Output parameters:
– asm.FetchXXX (int resultParamter)
How it works
• Platform.Native.dll
– Contains stub methods
– Allows same source to build on .NET and Mono
• Follow our previous efforts:
– Like SIMD
– On Mono, the runtime recognizes some calls
EmitXxx ignored for other platforms
// Highly optimized native way of getting a native one!
unsafe int GetOneConstant ()
{
asm.Emitx86 (“mov $1,%eax”);
asm.EmitArm (“mov r0,#1”);
asm.Emitx64 (“mov $1,%rax”);
return asm.FetchInt (0);
}
For more complex code, use asm.Arch:
unsafe int GetOneConstant ()
{
if (asm.Arch == Arch.x86) {
asm.Emitx86 (“mov $1,%eax”);
return asm.FetchInt (0);
} else
return 1;
}
WHAT IS NEXT?
Future for Mono
• Community feedback on features needed
• Brainstorming session tomorrow!
– Where should Mono and .NET go?
– Bring your favorite feature request

More Related Content

What's hot

Php[tek] 2016 - BDD with Behat for Beginners
Php[tek] 2016 - BDD with Behat for BeginnersPhp[tek] 2016 - BDD with Behat for Beginners
Php[tek] 2016 - BDD with Behat for BeginnersAdam Englander
 
Ať se z kódu nepráší! 2013
Ať se z kódu nepráší! 2013Ať se z kódu nepráší! 2013
Ať se z kódu nepráší! 2013Juraj Michálek
 
Dial up your flow
Dial up your flowDial up your flow
Dial up your flowWes Eklund
 
VS2015 C++ new features
VS2015 C++ new featuresVS2015 C++ new features
VS2015 C++ new features명신 김
 
JavaScript와 TypeScript의 으리 있는 만남
JavaScript와 TypeScript의 으리 있는 만남JavaScript와 TypeScript의 으리 있는 만남
JavaScript와 TypeScript의 으리 있는 만남영욱 김
 
Grunt JS - Getting Started With Grunt
Grunt JS - Getting Started With GruntGrunt JS - Getting Started With Grunt
Grunt JS - Getting Started With GruntDouglas Reynolds
 
Headless BDD & Responsive Test Automation
Headless BDD & Responsive Test AutomationHeadless BDD & Responsive Test Automation
Headless BDD & Responsive Test AutomationShashikant Jagtap
 
Pre-render Blazor WebAssembly on static web hosting at publishing time
Pre-render Blazor WebAssembly on static web hosting at publishing timePre-render Blazor WebAssembly on static web hosting at publishing time
Pre-render Blazor WebAssembly on static web hosting at publishing timeJun-ichi Sakamoto
 
Why don't you Groovy?
Why don't you Groovy?Why don't you Groovy?
Why don't you Groovy?Orest Ivasiv
 
WHAT / WHY / HOW WE’RE ENGINEERING AT SMARTSTUDY (English)
WHAT / WHY / HOW WE’RE ENGINEERING AT SMARTSTUDY (English)WHAT / WHY / HOW WE’RE ENGINEERING AT SMARTSTUDY (English)
WHAT / WHY / HOW WE’RE ENGINEERING AT SMARTSTUDY (English)Hyun-woo Park
 
카카오 공용준님의 "DevOps: on going pursuit of effectiveness"
카카오 공용준님의 "DevOps: on going pursuit of effectiveness"카카오 공용준님의 "DevOps: on going pursuit of effectiveness"
카카오 공용준님의 "DevOps: on going pursuit of effectiveness"Jay Park
 
Containerized build
Containerized buildContainerized build
Containerized buildDaniel Foo
 
Hot Chocolate: You got cocoa in my PHP
Hot Chocolate: You got cocoa in my PHPHot Chocolate: You got cocoa in my PHP
Hot Chocolate: You got cocoa in my PHPWez Furlong
 
Introduction to composer
Introduction to composerIntroduction to composer
Introduction to composerJino Hoàng
 
BDD using Behat, Selenium,Sahi and SauceLabs
BDD using Behat, Selenium,Sahi and SauceLabsBDD using Behat, Selenium,Sahi and SauceLabs
BDD using Behat, Selenium,Sahi and SauceLabsShashikant Jagtap
 
WebAssembly: In a Nutshell
WebAssembly: In a NutshellWebAssembly: In a Nutshell
WebAssembly: In a NutshellRangHo Lee
 

What's hot (20)

Php[tek] 2016 - BDD with Behat for Beginners
Php[tek] 2016 - BDD with Behat for BeginnersPhp[tek] 2016 - BDD with Behat for Beginners
Php[tek] 2016 - BDD with Behat for Beginners
 
Ať se z kódu nepráší! 2013
Ať se z kódu nepráší! 2013Ať se z kódu nepráší! 2013
Ať se z kódu nepráší! 2013
 
Introduction to Qt
Introduction to QtIntroduction to Qt
Introduction to Qt
 
Dial up your flow
Dial up your flowDial up your flow
Dial up your flow
 
Forseti driven javascript
Forseti driven javascriptForseti driven javascript
Forseti driven javascript
 
VS2015 C++ new features
VS2015 C++ new featuresVS2015 C++ new features
VS2015 C++ new features
 
JavaScript와 TypeScript의 으리 있는 만남
JavaScript와 TypeScript의 으리 있는 만남JavaScript와 TypeScript의 으리 있는 만남
JavaScript와 TypeScript의 으리 있는 만남
 
Grunt JS - Getting Started With Grunt
Grunt JS - Getting Started With GruntGrunt JS - Getting Started With Grunt
Grunt JS - Getting Started With Grunt
 
Headless BDD & Responsive Test Automation
Headless BDD & Responsive Test AutomationHeadless BDD & Responsive Test Automation
Headless BDD & Responsive Test Automation
 
Pre-render Blazor WebAssembly on static web hosting at publishing time
Pre-render Blazor WebAssembly on static web hosting at publishing timePre-render Blazor WebAssembly on static web hosting at publishing time
Pre-render Blazor WebAssembly on static web hosting at publishing time
 
Power Apps + C#
Power Apps + C#Power Apps + C#
Power Apps + C#
 
Why don't you Groovy?
Why don't you Groovy?Why don't you Groovy?
Why don't you Groovy?
 
WHAT / WHY / HOW WE’RE ENGINEERING AT SMARTSTUDY (English)
WHAT / WHY / HOW WE’RE ENGINEERING AT SMARTSTUDY (English)WHAT / WHY / HOW WE’RE ENGINEERING AT SMARTSTUDY (English)
WHAT / WHY / HOW WE’RE ENGINEERING AT SMARTSTUDY (English)
 
카카오 공용준님의 "DevOps: on going pursuit of effectiveness"
카카오 공용준님의 "DevOps: on going pursuit of effectiveness"카카오 공용준님의 "DevOps: on going pursuit of effectiveness"
카카오 공용준님의 "DevOps: on going pursuit of effectiveness"
 
Containerized build
Containerized buildContainerized build
Containerized build
 
Hot Chocolate: You got cocoa in my PHP
Hot Chocolate: You got cocoa in my PHPHot Chocolate: You got cocoa in my PHP
Hot Chocolate: You got cocoa in my PHP
 
Introduction to composer
Introduction to composerIntroduction to composer
Introduction to composer
 
BDD using Behat, Selenium,Sahi and SauceLabs
BDD using Behat, Selenium,Sahi and SauceLabsBDD using Behat, Selenium,Sahi and SauceLabs
BDD using Behat, Selenium,Sahi and SauceLabs
 
Rusty Python
Rusty PythonRusty Python
Rusty Python
 
WebAssembly: In a Nutshell
WebAssembly: In a NutshellWebAssembly: In a Nutshell
WebAssembly: In a Nutshell
 

Viewers also liked

Twitter의 snowflake 소개 및 활용
Twitter의 snowflake 소개 및 활용Twitter의 snowflake 소개 및 활용
Twitter의 snowflake 소개 및 활용흥배 최
 
MsgPack 정리
MsgPack 정리MsgPack 정리
MsgPack 정리Seokmin No
 
signal과 slot, 그리고 jl_signal 라이브러리
signal과 slot, 그리고 jl_signal 라이브러리signal과 slot, 그리고 jl_signal 라이브러리
signal과 slot, 그리고 jl_signal 라이브러리JongSung Hwang
 
KGC2015_C# 스크립트를 사용한 게임서버 모니터링 시스템개발
KGC2015_C# 스크립트를 사용한 게임서버 모니터링 시스템개발KGC2015_C# 스크립트를 사용한 게임서버 모니터링 시스템개발
KGC2015_C# 스크립트를 사용한 게임서버 모니터링 시스템개발흥배 최
 
GDC Europe 2014: Unreal Engine 4 for Programmers - Lessons Learned & Things t...
GDC Europe 2014: Unreal Engine 4 for Programmers - Lessons Learned & Things t...GDC Europe 2014: Unreal Engine 4 for Programmers - Lessons Learned & Things t...
GDC Europe 2014: Unreal Engine 4 for Programmers - Lessons Learned & Things t...Gerke Max Preussner
 

Viewers also liked (8)

Unqlite
UnqliteUnqlite
Unqlite
 
Easyloggingpp
EasyloggingppEasyloggingpp
Easyloggingpp
 
Twitter의 snowflake 소개 및 활용
Twitter의 snowflake 소개 및 활용Twitter의 snowflake 소개 및 활용
Twitter의 snowflake 소개 및 활용
 
MsgPack 정리
MsgPack 정리MsgPack 정리
MsgPack 정리
 
NLog 소개
NLog 소개NLog 소개
NLog 소개
 
signal과 slot, 그리고 jl_signal 라이브러리
signal과 slot, 그리고 jl_signal 라이브러리signal과 slot, 그리고 jl_signal 라이브러리
signal과 slot, 그리고 jl_signal 라이브러리
 
KGC2015_C# 스크립트를 사용한 게임서버 모니터링 시스템개발
KGC2015_C# 스크립트를 사용한 게임서버 모니터링 시스템개발KGC2015_C# 스크립트를 사용한 게임서버 모니터링 시스템개발
KGC2015_C# 스크립트를 사용한 게임서버 모니터링 시스템개발
 
GDC Europe 2014: Unreal Engine 4 for Programmers - Lessons Learned & Things t...
GDC Europe 2014: Unreal Engine 4 for Programmers - Lessons Learned & Things t...GDC Europe 2014: Unreal Engine 4 for Programmers - Lessons Learned & Things t...
GDC Europe 2014: Unreal Engine 4 for Programmers - Lessons Learned & Things t...
 

Similar to Monkey space 2013

Cape Cod Web Technology Meetup - 3
Cape Cod Web Technology Meetup - 3Cape Cod Web Technology Meetup - 3
Cape Cod Web Technology Meetup - 3Asher Martin
 
Continuous Integration with Cloud Foundry Concourse and Docker on OpenPOWER
Continuous Integration with Cloud Foundry Concourse and Docker on OpenPOWERContinuous Integration with Cloud Foundry Concourse and Docker on OpenPOWER
Continuous Integration with Cloud Foundry Concourse and Docker on OpenPOWERIndrajit Poddar
 
Introduction to Cross Platform Development with Xamarin/ Visual Studio
Introduction to Cross Platform Development with Xamarin/ Visual StudioIntroduction to Cross Platform Development with Xamarin/ Visual Studio
Introduction to Cross Platform Development with Xamarin/ Visual StudioIndyMobileNetDev
 
Hackaton for health 2015 - Sharing the Code we Make
Hackaton for health 2015 - Sharing the Code we MakeHackaton for health 2015 - Sharing the Code we Make
Hackaton for health 2015 - Sharing the Code we Makeesben1962
 
C++ Windows Forms L01 - Intro
C++ Windows Forms L01 - IntroC++ Windows Forms L01 - Intro
C++ Windows Forms L01 - IntroMohammad Shaker
 
Deep Dive Azure Functions - Global Azure Bootcamp 2019
Deep Dive Azure Functions - Global Azure Bootcamp 2019Deep Dive Azure Functions - Global Azure Bootcamp 2019
Deep Dive Azure Functions - Global Azure Bootcamp 2019Andrea Tosato
 
State ofappdevelopment
State ofappdevelopmentState ofappdevelopment
State ofappdevelopmentgillygize
 
August Webinar - Water Cooler Talks: A Look into a Developer's Workbench
August Webinar - Water Cooler Talks: A Look into a Developer's WorkbenchAugust Webinar - Water Cooler Talks: A Look into a Developer's Workbench
August Webinar - Water Cooler Talks: A Look into a Developer's WorkbenchHoward Greenberg
 
Fluo CICD OpenStack Summit
Fluo CICD OpenStack SummitFluo CICD OpenStack Summit
Fluo CICD OpenStack SummitMiguel Zuniga
 
Understand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java ApplicationsUnderstand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java ApplicationsC4Media
 
Symfony Under Control by Maxim Romanovsky
Symfony Under Control by Maxim RomanovskySymfony Under Control by Maxim Romanovsky
Symfony Under Control by Maxim Romanovskyphp-user-group-minsk
 
Symfony under control. Continuous Integration and Automated Deployments in Sy...
Symfony under control. Continuous Integration and Automated Deployments in Sy...Symfony under control. Continuous Integration and Automated Deployments in Sy...
Symfony under control. Continuous Integration and Automated Deployments in Sy...Max Romanovsky
 
habitat at docker bud
habitat at docker budhabitat at docker bud
habitat at docker budMandi Walls
 
FITC - Node.js 101
FITC - Node.js 101FITC - Node.js 101
FITC - Node.js 101Rami Sayar
 
Composer JSON kills make files
Composer JSON kills make filesComposer JSON kills make files
Composer JSON kills make filesropsu
 
Build Great Networked APIs with Swift, OpenAPI, and gRPC
Build Great Networked APIs with Swift, OpenAPI, and gRPCBuild Great Networked APIs with Swift, OpenAPI, and gRPC
Build Great Networked APIs with Swift, OpenAPI, and gRPCTim Burks
 

Similar to Monkey space 2013 (20)

Cape Cod Web Technology Meetup - 3
Cape Cod Web Technology Meetup - 3Cape Cod Web Technology Meetup - 3
Cape Cod Web Technology Meetup - 3
 
Continuous Integration with Cloud Foundry Concourse and Docker on OpenPOWER
Continuous Integration with Cloud Foundry Concourse and Docker on OpenPOWERContinuous Integration with Cloud Foundry Concourse and Docker on OpenPOWER
Continuous Integration with Cloud Foundry Concourse and Docker on OpenPOWER
 
Introduction to Cross Platform Development with Xamarin/ Visual Studio
Introduction to Cross Platform Development with Xamarin/ Visual StudioIntroduction to Cross Platform Development with Xamarin/ Visual Studio
Introduction to Cross Platform Development with Xamarin/ Visual Studio
 
.NET7.pptx
.NET7.pptx.NET7.pptx
.NET7.pptx
 
Hackaton for health 2015 - Sharing the Code we Make
Hackaton for health 2015 - Sharing the Code we MakeHackaton for health 2015 - Sharing the Code we Make
Hackaton for health 2015 - Sharing the Code we Make
 
C++ Windows Forms L01 - Intro
C++ Windows Forms L01 - IntroC++ Windows Forms L01 - Intro
C++ Windows Forms L01 - Intro
 
Deep Dive Azure Functions - Global Azure Bootcamp 2019
Deep Dive Azure Functions - Global Azure Bootcamp 2019Deep Dive Azure Functions - Global Azure Bootcamp 2019
Deep Dive Azure Functions - Global Azure Bootcamp 2019
 
State ofappdevelopment
State ofappdevelopmentState ofappdevelopment
State ofappdevelopment
 
Hyperloop
HyperloopHyperloop
Hyperloop
 
Hyperloop
HyperloopHyperloop
Hyperloop
 
August Webinar - Water Cooler Talks: A Look into a Developer's Workbench
August Webinar - Water Cooler Talks: A Look into a Developer's WorkbenchAugust Webinar - Water Cooler Talks: A Look into a Developer's Workbench
August Webinar - Water Cooler Talks: A Look into a Developer's Workbench
 
Intro to CakePHP
Intro to CakePHPIntro to CakePHP
Intro to CakePHP
 
Fluo CICD OpenStack Summit
Fluo CICD OpenStack SummitFluo CICD OpenStack Summit
Fluo CICD OpenStack Summit
 
Understand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java ApplicationsUnderstand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java Applications
 
Symfony Under Control by Maxim Romanovsky
Symfony Under Control by Maxim RomanovskySymfony Under Control by Maxim Romanovsky
Symfony Under Control by Maxim Romanovsky
 
Symfony under control. Continuous Integration and Automated Deployments in Sy...
Symfony under control. Continuous Integration and Automated Deployments in Sy...Symfony under control. Continuous Integration and Automated Deployments in Sy...
Symfony under control. Continuous Integration and Automated Deployments in Sy...
 
habitat at docker bud
habitat at docker budhabitat at docker bud
habitat at docker bud
 
FITC - Node.js 101
FITC - Node.js 101FITC - Node.js 101
FITC - Node.js 101
 
Composer JSON kills make files
Composer JSON kills make filesComposer JSON kills make files
Composer JSON kills make files
 
Build Great Networked APIs with Swift, OpenAPI, and gRPC
Build Great Networked APIs with Swift, OpenAPI, and gRPCBuild Great Networked APIs with Swift, OpenAPI, and gRPC
Build Great Networked APIs with Swift, OpenAPI, and gRPC
 

Recently uploaded

Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024SkyPlanner
 
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostKubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostMatt Ray
 
Videogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfVideogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfinfogdgmi
 
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDEADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDELiveplex
 
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAAnypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAshyamraj55
 
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...DianaGray10
 
20230202 - Introduction to tis-py
20230202 - Introduction to tis-py20230202 - Introduction to tis-py
20230202 - Introduction to tis-pyJamie (Taka) Wang
 
Cybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxCybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxGDSC PJATK
 
Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Adtran
 
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdfIaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdfDaniel Santiago Silva Capera
 
Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )Brian Pichman
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1DianaGray10
 
Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1DianaGray10
 
Bird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemBird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemAsko Soukka
 
COMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a WebsiteCOMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a Websitedgelyza
 
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration WorkflowsIgniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration WorkflowsSafe Software
 
AI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity WebinarAI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity WebinarPrecisely
 
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesAI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesMd Hossain Ali
 
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UbiTrack UK
 
UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6DianaGray10
 

Recently uploaded (20)

Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024
 
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostKubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
 
Videogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfVideogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdf
 
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDEADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
 
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAAnypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
 
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
 
20230202 - Introduction to tis-py
20230202 - Introduction to tis-py20230202 - Introduction to tis-py
20230202 - Introduction to tis-py
 
Cybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxCybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptx
 
Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™
 
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdfIaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
 
Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
 
Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1
 
Bird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemBird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystem
 
COMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a WebsiteCOMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a Website
 
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration WorkflowsIgniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
 
AI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity WebinarAI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity Webinar
 
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesAI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
 
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
 
UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6
 

Monkey space 2013

  • 1. What is new in Mono? July 2013 miguel@gnome.org
  • 2. Agenda • Today: – What is new in Mono-land. – Major Work-in-Progress Projects • Tomorrow: – Brainstorming session – Future of Mono and .NET
  • 4. Mono 3.2 • Core .NET 4.5 support – Base Class Libraries – C# 5 • Available today: – Desktop – Server – Mobile • 2.10.x is no longer supported
  • 5. What is new in Mono 3.2 • Vastly improved SGen GC – Now the default! • Micro-optimizations – Mobile-driven • Consume PCL binaries • Shipping OSS Microsoft frameworks • New Mono frameworks
  • 6. SGen Garbage Collector • Our Precise, generational collector • Now the default for Mono – “mono” now runs mono –gc=sgen – libmono is Boehm – libmono-sgen is Sgen • Sgen is now faster on almost every workload • MonoDevelop/Xamarin Studio – Been using it as a default since February
  • 7. What is new? • Major collectors: – Copy collector (old, reference code) – Mark and Sweep • Minor collectors: – Now with support for cementing • Help game developers love GC • dtrace probes
  • 8. Mark and Sweep • Dynamic heap by default – Can specify fixed heap if desired • Allocates blocks of memory to bucket sizes – Think of the spirit to “slab” allocation – Support changes in workloads with evacuation • Concurrent Marking, Lazy Sweeping
  • 9. Disabling Major Collector New API on Mono.Runtime (mscorlib.dll) if (!Mono.Runtime.SetGCAllowSynchronousMajor (false)) Console.WriteLine ("Sorry, the GC won't cooperate."); // your low-latency code here Mono.Runtime.SetGCAllowSynchronousMajor (true); • Exposed on Mobile. • Use System.Reflection to find it on desktop editions.
  • 10. dtrace probes on MacOS Major collections and minor collections pause times visualized http://schani.wordpress.com/2012/11/02/sgen-and-dtrace/
  • 12. Static Compilation • For systems that don’t support JITing – Apple’s iOS devices – Consoles (PlayStation, Xbox) – Security: when not shipping IL • Limited generics support – Static analysis limitations – Some dynamisms in .NET idioms • LINQ and Value Types
  • 13. “Attempting to JIT compile method” System.ExecutionEngineException: Attempting to JIT compile method Foo[]:Bar`1
  • 14. “Attempting to JIT compile method” System.ExecutionEngineException: Attempting to JIT compile method Foo[]:Bar`1
  • 15. iOS Development Improvements • Improve development cycle • Incremental Builds – Disable linker (compile everything) – Cache resulting native code aggressively • Incremental Upload – Only uploads changes – Main executable, libraries or resources
  • 16. Incremental Deployment (With Build Caching) 0 10 20 30 40 50 60 70 80 Hello World Large App Seconds Old New Deployment times can now be as short as one second.
  • 17. Incremental Deployment (With Build Caching) 0 5 10 15 20 25 30 35 40 Hello World Large App Seconds 6.2 6.4 Deployment times can now be as short as one second.
  • 18. Build Speed Improvements 0 10 20 30 40 50 60 70 80 Hello World Large App Seconds 6.2 6.4 6.4+Incremental
  • 20. Now Bundled with Mono • Reactive Extensions – Possible on iOS with new code gen changes • F# everywhere • Razor • Entity Framework • ASP.NET WebStack
  • 21. MonoDevelop Xamarin Studio MonoDevelop / Xamarin Studio MonoDevelop Core MonoDevelop Core Android Mac iOS Branding Add-In Open source Commercial
  • 23. Cocos2D XNA • XNA port of the popular Cocos2D API – Over 4,000 games built with this API – Well documented, well known • MonoGame brings it everywhere – iOS, Android, Windows Phone (7 and 8) – Mac – Windows (GL, DX, , Windows Store) – Xbox360, Ouya – Play Station Mobile (PS Vita + Sony Androids)
  • 24. Using Cocos2D XNA Today • Available as: – NuGet Packages – Templates for VS and Xamarin Studio • Source code: – http://github.com/mono/cocos2d-xna • Getting Started: – http://docs.xamarin.com/guides/cross-platform/cocos2d_xna
  • 25. Angry Ninjas - Full Open Source Game https://github.com/xamarin/AngryNinjas
  • 26. Cocos2D Crash Course • Mike Bluestein’s talk tomorrow
  • 27. Xamarin.Mobile • Base class library for mobile services • Mike Bluestein’s talk
  • 28. Xamarin.Auth • Clients for OAuth 1 and OAuth 2 – Includes variations • Stores user credentials • Support non-standard auth schemes • Cross Platform
  • 29. Xamarin.Auth using Xamarin.Auth; var auth = new OAuth2Authenticator ( clientId: "App ID from https://developers.facebook.com/apps", scope: "", authorizeUrl: new Uri ("https://m.facebook.com/dialog/oauth/"), redirectUrl: new Uri ("http://www.facebook.com/connect/login_success.html")); auth.Completed += (sender, eventArgs) => { DismissViewController (true, null); if (eventArgs.IsAuthenticated) { // Use eventArgs.Account to do wonderful things } } PresentViewController (auth.GetUI (), true, null); // 1. Create the service
  • 30. Xamarin.Social • Posts statuses, links, images/media to social networks – Access social network APIs using authenticated requests. – Automatically and securely store user credentials using Xamarin.Auth. – Cross Platform • Extensible, currently has support for: – App.net – Facebook – Flickr – Pinterest – Twitter
  • 31. Using Xamarin.Social var facebook = new FacebookService { ClientId = MyFacebook_AppId RedirectUrl = new System.Uri (MyRedirectUrl) }; // 2. Create an item to share var item = new Item { Text = "Xamarin.Social is the bomb" }; item.Links.Add (new Uri ("http://github.com/xamarin/xamarin.social")); // 3. Present the UI on iOS var shareController = facebook.GetShareUI (item, result => { // result lets you know if the user shared the item or canceled DismissViewController (true, null); }); PresentViewController (shareController, true, null);
  • 32. Now all Open Source • All frameworks: – Cocos2D XNA • http://github.com/mono/cocos2d-xna – Xamarin.Auth • http://github.com/xamarin/Xamarin.Auth – Xamarin.Mobile • http://github.com/xamarin/Xamarin.Mobile – Xamarin.Social • http://github.com/xamarin/Xamarin.Social • Taking patches!
  • 35. PlayScript • Started by Zynga – Xamarin working to integrate into Mono – Rescuing Flash Developers! • ActionScript look-alike language – Superset of ActionScript – With C# 5 features – Optional strongly-typed • Encouraged for performance
  • 36. PlayScript Compiler • Dual Compiler – playsc foo.play • Compiles PlayScript to foo.exe – playsc bar.cs • Compiles C# to bar.exe – playsc foo.play bar.cs • Compiles PlayScript foo.play and C# bar.cs • Into foo.exe • Allows blending C# and PlayScript code in one assembly
  • 37. PlayScript Compiler • Based on Mono’s C# compiler – Altered to accept PlayScript language • Side effects: – Compiler as a service support for PlayScript – Full Xamarin Studio integration • code completion • Docs • Project support
  • 38. PlayScript Libraries • pscorlib – Provides core library for PlayScript/ActionScript • Flash Stage3D – GPU accelerated framework – Used by gaming frameworks
  • 39. Ported Frameworks • Starling Framework • 2D Game Engine • Powers Angry Birds • Away3D • 3D Game Engine • Physics
  • 40. PlayScript today • Compiles existing large ActionScript projects – Some missing language features – Actively working to improve language – Merging into Mono (playscript branch) – Everywhere Mono runs • On GitHub: – Project: http://github.com/playscript
  • 42. Evolving Cxxi • Couple of years ago Cxxi project was launched • Used GCC-XML to parse C++ definitions • Runtime creation of C# to C++ bridges – Reflection.Emit – Pluggable VTable ABIs
  • 43. CppSharp • New C++ binding technology from Mono • Produces C# libraries to consume C++ code – Use Clang for higher fidelity – Static compilation (to support iOS, Consoles) – Customize binding for .NET consistency – Direct calls to C++ (no intermediate glue) – Imports C++ Doxygen docs into C# docs http://github.com/mono/CppSharp
  • 44. Generating a binding Sources Generated Final Library Foo.dll libFoo.so C++ Headers C++ Source Foo.cs C++ Headers C# API Driver
  • 45. public class Sample : ILibrary { public Sample(LanguageGeneratorKind kind) : base("Sample", kind) {} public override void SetupPasses(Driver driver, PassBuilder passes) { passes.RenameDeclsUpperCase(RenameTargets.Any); passes.FunctionToInstanceMethod(); } public override void Preprocess(Driver driver, Library lib) { lib.SetClassAsValueType("Foo"); lib.SetNameOfFunction("FooAdd", "FooCalc"); lib.IgnoreClassField("Foo", "b"); } static class Program { public static void Main(string[] args) { ConsoleDriver.Run(new Sample(LanguageGeneratorKind.CPlusPlusCLI)); ConsoleDriver.Run(new Sample(LanguageGeneratorKind.CSharp)); } }
  • 47. Assembly in C# • Allow developers to inline assembly code – Micro-optimizations – Optimize a code path – Use arch-specific features • You can not get more native than that.
  • 48. Assembly in C# • Allow developers to inline assembly code – Micro-optimizations – Optimize a code path – Use arch-specific features
  • 49. Example unsafe int Clear (IntPtr buffer, int count) { asm.BindIntPtr (0, buffer); asm.BindInt (1, count); asm.Emitx86 (@” push %ecx push %edi mov %eax,%edi mov %ebx,%ecx xor %eax,%eax rep stosb mov $1,%eax pop %edi pop %ecx ”); return asm.FetchInt (0); }
  • 50. unsafe int Clear (IntPtr buffer, int count) { asm.BindIntPtr (0, buffer); asm.BindInt (1, count); asm.Emitx86 (@” push %ecx push %edi mov %eax,%edi mov %ebx,%ecx xor %eax,%eax rep stosb mov $1,%eax pop %edi pop %ecx ”); return asm.FetchInt (0); } In case there are any doubts
  • 51. Example unsafe int Clear (IntPtr buffer, int count) { asm.BindIntPtr (0, buffer); asm.BindInt (1, count); asm.Emitx86 (@” push %ecx push %edi mov %eax,%edi mov %ebx,%ecx xor %eax,%eax rep stosb mov $1,%eax ”); return asm.FetchInt (0); } • Bind Parameters • Let Mono know which parameters you will pass
  • 52. Example unsafe int Clear (IntPtr buffer, int count) { asm.BindIntPtr (0, buffer); asm.BindInt (1, count); asm.Emitx86 (@” push %ecx push %edi mov %eax,%edi mov %ebx,%ecx xor %eax,%eax rep stosb mov $1,%eax ”); return asm.FetchInt (0); } • Bind Parameters • Let Mono know which parameters you will pass • Assembly code as a string • Assembled by LLVM • Mono JIT Calling conventions
  • 53. Example unsafe int Clear (IntPtr buffer, int count) { asm.BindIntPtr (0, buffer); asm.BindInt (1, count); asm.Emitx86 (@” push %ecx push %edi mov %eax,%edi mov %ebx,%ecx xor %eax,%eax rep stosb mov $1,%eax ”); return asm.FetchInt (0); } • Bind Parameters • Let Mono know which parameters you will pass • Assembly code as a string • Assembled by LLVM • Mono JIT Calling conventions • Fetch result value
  • 54. Example unsafe int Clear (IntPtr buffer, int count) { asm.BindIntPtr (0, buffer); asm.BindInt (1, count); asm.Emitx86 (@” push %ecx push %edi mov %eax,%edi mov %ebx,%ecx xor %eax,%eax rep stosb mov $1,%eax ”); return asm.FetchInt (0); } • Bind Parameters • Let Mono know which parameters you will pass • Assembly code as a string • Assembled by LLVM • Mono JIT Calling conventions • Fetch result value
  • 55. Passing parameters, extracting • Input parameters: – asm.BindXXX (int incomingParameter, XXX value); • Emit assembly code: – asm.Emit (string code) – Assembled with LLVM assembler – Injected into resulting assembly – Follow Mono native rules for preserving register usage • Output parameters: – asm.FetchXXX (int resultParamter)
  • 56. How it works • Platform.Native.dll – Contains stub methods – Allows same source to build on .NET and Mono • Follow our previous efforts: – Like SIMD – On Mono, the runtime recognizes some calls
  • 57. EmitXxx ignored for other platforms // Highly optimized native way of getting a native one! unsafe int GetOneConstant () { asm.Emitx86 (“mov $1,%eax”); asm.EmitArm (“mov r0,#1”); asm.Emitx64 (“mov $1,%rax”); return asm.FetchInt (0); } For more complex code, use asm.Arch: unsafe int GetOneConstant () { if (asm.Arch == Arch.x86) { asm.Emitx86 (“mov $1,%eax”); return asm.FetchInt (0); } else return 1; }
  • 59. Future for Mono • Community feedback on features needed • Brainstorming session tomorrow! – Where should Mono and .NET go? – Bring your favorite feature request

Editor's Notes

  1. Performance, upstreamed contributions, stability, bug fixing, improved debugging
  2. Geo locationContactsCamera
  3. Mono and .NET offer C and C++ bridgesSometimes you just want to be a real man