
Mobius – .NET runtime running on .NET Core - pjmlp
https://tooslowexception.com/mobius-net-runtime-running-on-net-core/
======
zamalek
You might find this project interesting OP[1]. The aim is to create a self-
hosting CIL JIT/AOT for the purposes of an operating system. Ultimately you'd
have an OS written in 100% C#.

It has got a good few years of history and a lone brave contributor who I'm
sure would welcome some help with open arms.

[1]: [https://github.com/mosa/MOSA-Project](https://github.com/mosa/MOSA-
Project)

------
lostmsu
I thought about doing something similar in university. But I used LLVM as the
compiler backend:
[https://github.com/lostmsu/CodeBlock](https://github.com/lostmsu/CodeBlock)

Written in F# of course.

~~~
sdegutis
I've been wanting to make some .NET apps for our family's use (like a timer
etc.) but don't know C# so I figured maybe I should just start off learning F#
since I have a FP background. So is F# pretty much Rust but with GC? Or is it
more like TypeScript -- in the sense that it's based on OCaml which maps
nicely to JS (i.e. ReasonML) -- but also with sum types?

~~~
wazanator
If all you are wanting to do is make desktop gui stuff for your family C# +
Winforms is super easy to pick up.

~~~
CuriousSkeptic
Or perhaps skip it altogether.

Most of my “family” apps is just quick hacks in JavaScript. Simple to throw
together, runs on everything with a browser, like the tv, and is easily
published on anything serving static files, like github pages.

Edit: For some more hobby like projects C# works out quite nicely though. I’d
say it’s probably easier to stick with the beaten path here if not seeing a
particular advantage from a functional language. I hear F# is quite nice as
far as a functional languages go though.

~~~
sdegutis
I've been wanting for a while a lightweight Electron alternative that doesn't
use web views, just native APIs, and uses Lua instead. So it would be an .exe
file that looks for a main.lua somewhere, and runs it, giving access to
modules that wrap the Win32 API in high-level functionality. Then you could
run a command that combines the .exe and the main.lua into a new .exe file
that you can distribute. It would be super lightweight and wouldn't even need
a compiler to be installed to be able to make tiny lightweight apps.

~~~
DisownedWheat
So something like LÖVE2D with wrapped Win32 APIs? That would be super cool, I
wonder if anyone has done something like that.

~~~
sdegutis
I know there are Win32 Lua APIs. Maybe this is a 10 line windows app that just
loads those in a host that loads main.lua?

------
triangleman
The big question, for me at least, is can this be used to containerize a .NET
application without having to package a full Windows OS into the container?

~~~
9wzYQbTYsAIc
In case you weren’t yet aware, .NET Core runtime can be containerized on
Linux. .NET Framework is the (mostly) Windows dependent runtime. Mono is the
open / Microsoft supported translation of .NET Framework to Linux.

~~~
triangleman
Right but converting a big application to .NET Core is hard. Is this project
not sort of an emulator to allow a legacy .NET Windows app to run on .NET
Core? I had better read TFA better.

~~~
efdee
You're postponing the inevitable. .NET 5 is .NET Core.

~~~
stragies
Yes, but many legacy .Net apps were delivered without source-code, the
original developer is not available, and now people like OP and me are looking
to run this old crap (for paying customers) without having to maintain a
dedicated Windows VM.

~~~
uk_programmer
Have you tried decompiling it? Telerik Just Decompile will decompile it back
out to C#. It ultimately depends on agreement you had with the original
developer as to whether it is legal or not.

------
quickthrower2
Definitely useful for research. "What if the .NET CLR could do X" can be
answered more quickly with code like this. I wonder if this could support
something like runtime macros. Maybe you can do that anyway using Roslyn.

------
jacobush
... so it's like running Wine on Windows NT 4.0?

~~~
chrisseaton
No, it's an interpreter for CIL. Wine is mostly an implementation of the
Windows API, not an interpreter or emulator of any kind.

~~~
kyberias
They say it has a JIT, a just-in-time translator. Not an interpreter. Wine
also has a translator that translates Windows application's calls to Win32
into calls to Linux API.

The comparison with Wine is not totally incorrect.

~~~
int_19h
JIT is a compiler - bytecode to native code. Wine is not a translator in that
sense - it doesn't rewrite native code to change the APIs it calls. It just
provides an implementation of those APIs, which may (or may not) ultimately
invoke some POSIX or X API.

~~~
contextfree
It might be an interesting perspective to think of almost any software library
or framework as a kind of interpreter or translator from the layer above it to
the layer below - e.g., a web browser is a translator from DOM constructs to
native draw calls?

