{"id":209,"date":"2021-02-15T16:42:45","date_gmt":"2021-02-15T16:42:45","guid":{"rendered":"https:\/\/www.spaceflint.com\/?p=209"},"modified":"2025-04-21T05:58:15","modified_gmt":"2025-04-21T05:58:15","slug":"bluebonnet-light-weight-net-on-java","status":"publish","type":"post","link":"https:\/\/www.spaceflint.com\/?p=209","title":{"rendered":"Bluebonnet, light-weight .NET on Java"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><strong>Bluebonnet <\/strong>is a partial implementation of the .NET platform on top of the Java Virtual Machine, and compatible with Android runtime. The <strong>Bluebonnet<\/strong> bytecode compiler translates .NET <a href=\"https:\/\/en.wikipedia.org\/wiki\/Common_Intermediate_Language\">CIL<\/a> into <a href=\"https:\/\/en.wikipedia.org\/wiki\/Java_bytecode\">Java bytecode<\/a> in Java classes, and additional run-time support is provided by the <strong>Baselib<\/strong> library.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The <strong>Bluebonnet<\/strong> platform is compatible with Java on all API levels of the Android platform.  This means Android apps can be written in languages such as C# and F#.  After conversion, they run as 100% Java code on Android, with no native code libraries.  They require only a thin, light-weight support library &#8212; the <strong>Baselib<\/strong> library.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The <strong>Baselib<\/strong>  library is itself written in C# and compiled to Java using <strong>Bluebonnet<\/strong>.  It provides support for .NET features such as types (primitive types, value types, generic types), reflection, collections, and some basic functionality from the .NET Base Class Libraries (BCL).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It should be emphasized that <strong>Bluebonnet<\/strong> does not aim to be a full implementation of .NET, and that large parts of the standard .NET libraries are not implemented in <strong>Baselib<\/strong> at this time.  Having said that, it is possible to create simple Android apps with <strong>Bluebonnet<\/strong>.  For an example, take a look at the <a href=\"https:\/\/www.spaceflint.com\/?p=207\" data-type=\"URL\" data-id=\"https:\/\/www.spaceflint.com\/?p=207\">Unjum<\/a> proof-of-concept game (also on <a href=\"https:\/\/github.com\/spaceflint7\/unjum\">Github<\/a>).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This game relies on <strong>BNA<\/strong> (Github <a href=\"https:\/\/github.com\/spaceflint7\/bna\" data-type=\"URL\" data-id=\"https:\/\/github.com\/spaceflint7\/bna\">link<\/a>), which is a partial implementation of the <a href=\"https:\/\/en.wikipedia.org\/wiki\/Microsoft_XNA\">XNA 4<\/a> library for Android.  The game was developed in F# in Visual Studio on Windows using the original implementation of XNA 4 from Microsoft.  Then the game binary was run through <strong>Bluebonnet<\/strong>, combined with <strong>BNA<\/strong> (as well as with <strong>Baselib<\/strong> and the F# core library) and packaged into an APK, ready to run on Android.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For more information, and to download Bluebonnet, please <a href=\"https:\/\/github.com\/spaceflint7\/bluebonnet\">visit the <strong>Bluebonnet<\/strong> Github page<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Bluebonnet is a partial implementation of the .NET platform on top of the Java Virtual Machine, and compatible with Android runtime. The Bluebonnet bytecode compiler translates .NET CIL into Java bytecode in Java classes, and additional run-time support is provided by the Baselib library. The Bluebonnet platform is compatible with Java on all API levels &hellip; <a href=\"https:\/\/www.spaceflint.com\/?p=209\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Bluebonnet, light-weight .NET on Java<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"class_list":["post-209","post","type-post","status-publish","format-standard","hentry","category-dev-tools"],"_links":{"self":[{"href":"https:\/\/www.spaceflint.com\/index.php?rest_route=\/wp\/v2\/posts\/209","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.spaceflint.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.spaceflint.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.spaceflint.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.spaceflint.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=209"}],"version-history":[{"count":5,"href":"https:\/\/www.spaceflint.com\/index.php?rest_route=\/wp\/v2\/posts\/209\/revisions"}],"predecessor-version":[{"id":214,"href":"https:\/\/www.spaceflint.com\/index.php?rest_route=\/wp\/v2\/posts\/209\/revisions\/214"}],"wp:attachment":[{"href":"https:\/\/www.spaceflint.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=209"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.spaceflint.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=209"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.spaceflint.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=209"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}