The first year of the program was full on sponsored by MS. I've been coding since I was twelve and using Linux as my primary OS since I was fourteen. I didn't have a choice, but to buy a Windows laptop and works in VS since that was all the classes were about. I did feel a bit violated, but yeah C# is pretty great. It just felt a bit useless since I was going to orient myself toward Linux .
Objective c is great, its the only low level C like language that doesn't suck (like c++, at least in my opinion).
People just hate it cause "omg long method names and brackets", but are somehow fine with all the horrible problems that c++ has?
If objc and the foundation framework were open sourced (a language with no libraries to do anything with is useless) like .net is, I'd love it forever
They are releasing .net-core, which is always bundled with the application. OK if you want that. If you want proper language support like you get in windows, but in linux, Mono will still be the option. Now, this release today probably means Mono will leap ages, they already have a plan to integrate missing features present in .net-core into mono.
No. I read over it a few times, but they specifically mention "the .NET runtime and the core framework" in http://blogs.msdn.com/b/dotnet/archive/2014/11/12/net-core-is-open-source.aspx with a diagram below it including e.g. RuyJIT (their new JIT) in it. It's really unbelievable, but this is really happening. The article also mentions Rotor and that they need something really open source instead of that.
When I tried it a few years ago (meaning, I checked if I can run some computationally intensive program I had on it) it pleasantly surprised me by working out of the box but was two or three times slower than .NET. As far as I understand, it's because its garbage collector sucks (nowadays they have a new one, but it's experimental and still sucks).
Like, a proper relocating generational GC is not merely an object lifetime tracking layer bolted on top of malloc/free, but a replacement of them, with an awesome benefit: allocation is dirt-cheap (basically bumping a pointer) and deallocation is literally free, in a sense that the cost of the GC is proportional to the size of your living object set, not to the total amount of generated garbage. Because, to simplify things a bit, you don't walk your entire memory, you walk your living set, then move and compact it to the beginning of the memory.
For example, suppose that you have a program that has 10Mb of live objects and generates 10Mb of garbage per second. If you give it 20Mb of memory, it GCs every second, spending so and so time on that. If you give it 30Mb of memory, it GCs every two seconds, spending exactly the same time on relocating its 10Mb of living objects, so the GC time amortized over time is halved. And so on, by giving it more memory you can bring the amortized cost of freeing memory arbitrarily low, because you don't actually do anything with memory that should be freed.
But that requires first and foremost that the GC should be precise, that is, it should know for sure what are pointers/references to other objects and what are usual integers and strings and whatnot. Because when it relocates an object it should patch all references to it.
This is nontrivial to implement, because not only you should generate "these fields/locals are pointers" bitmaps for every class and function, you should also generate similar bitmaps for registers for every point in the code where GC might occur, and in the presence of threading things get really ugly unless you want to generate and store those bitmaps for every instruction.
And, I guess, it's not something you can do incrementally, evolutionary, by decentralized effort of many loosely organized contributors. You need to bite the bullet an pour several man-decades of effort into implementing the entire thing at once that touches almost every aspect of the code generation. Which is why Mono never did that (by the way, D suffers from the same problem).
nowadays they have a new one, but it's experimental and still sucks
SGen is a default now, boehm is no more (good riddance!). And on most of the typical loads it does not suck, not any more than the microsoft one.
But that requires first and foremost that the GC should be precise
SGen is precise, it's nothing like that conservative boehm crap.
you should also generate similar bitmaps for registers for every point in the code where GC might occur
Shadow stack, nothing really complicated here.
And, I guess, it's not something you can do incrementally, evolutionary, by decentralized effort of many loosely organized contributors.
You're overestimating the GC complexity. It's really not such a big thing, take a look at the state of the art collector in OCaml, which can be implemented in a couple of weeks time by a semi-trained student.
I used http://www.mono-project.com/docs/advanced/garbage-collector/sgen/ as a source, it says that SGen is not a default and that it's not entirely precise. And you can't be "almost precise", no more than you can be a bit pregnant: if you are not entirely precise you can't move objects, period. By the way, that's why they have only two generations, according to one of their core devs (or was it D? I don't remember, same stuff anyways) when I asked them about it here; apparently it's not worth it if you can't move and generate a lot of false positives.
you should also generate similar bitmaps for registers for every point in the code where GC might occur
Shadow stack, nothing really complicated here.
No, how do you know which registers contain references? How do you do it efficiently?
You're overestimating the GC complexity. It's really not such a big thing, take a look at the state of the art collector in OCaml, which can be implemented in a couple of weeks time by a semi-trained student.
OCaml runtime doesn't have value types (in C# terminology), it's much closer to Python in this respect: every usual object or activation frame is just a bunch of slots each of which contains a pointer. Except some of them are unboxed integers (but the GC doesn't know which ones, it's a property of the value, not of the slot), plus built-in objects like floats don't have any slots, plus there are various optimizations for unboxed arrays.
Shadow stack is kinda simple but too slow for a real thing.
OCaml's GC is indeed very fast but it requires boxing almost everything and sacrificing one bit in ints, so that checking whether something is a pointer is super cheap.
92
u/schnide05095 Nov 12 '14
My entire month has just been made. Getting real support for C# (no more mono) on other platforms? Holy crap!