[HN Gopher] Did you ever need to run a piece of C# code on Windo...
       ___________________________________________________________________
        
       Did you ever need to run a piece of C# code on Windows 3.11?
        
       Author : lelf
       Score  : 206 points
       Date   : 2020-01-10 11:11 UTC (11 hours ago)
        
 (HTM) web link (twitter.com)
 (TXT) w3m dump (twitter.com)
        
       | jugg1es wrote:
       | His twitter feed is pretty interesting. He's a damn wizard.
       | https://twitter.com/MStrehovsky/status/1214542538079690757
        
       | yread wrote:
       | How come there are so many Slovak and Czech people working on
       | .NET Core at MS? Tomas Petricek, Karel Zikmund, Jan Kotas, Jan
       | Vorlicek, Tomas Matousek,...
        
         | MStrehovsky wrote:
         | (Author of the "C# on Windows 3.11" hack here - and a Slovak.)
         | 
         | I would say the concentration of Czech/Slovak people around
         | .NET at MS is a result of accidents and networking. I got into
         | the team thanks to a friend of a friend who heard I was
         | interested. But yeah, it's a surprising number given the size
         | of the population of Slovakia and Czech republic.
         | 
         | There's a newly opened .NET development center in Prague so the
         | number is likely going to grow (they do hire from all over the
         | world though): https://karelz.github.io/hiring_prague_net/.
        
         | flamtap wrote:
         | Could be as simple as a networking thing. Czech/Slovak people
         | know Czech/Slovak people, those people get recommended, etc.
        
         | JoeMayoBot wrote:
         | Great minds - Microsoft is an increasingly diverse company and
         | you'll see smart people from everywhere in the world there.
        
           | DaiPlusPlus wrote:
           | Aye. My team in DevDiv (home of .NET) had a Brit (me), a
           | Turkish lady, two Russians, two Canadians (one French), three
           | Indians, my lead was Mexican, and only 1 American.
        
         | jhkjhtiou45 wrote:
         | Could be that they aqui-hired some Slovak/Czech company that
         | ended up working on .NET Core.
        
       | ComputerGuru wrote:
       | Holy backwards compatibility, Microsoft!
        
         | egdod wrote:
         | Raymond Chen has lot of good stories about the lengths
         | Microsoft would go to to ensure old programs still worked.
         | 
         | https://devblogs.microsoft.com/oldnewthing/tag/history
        
         | mister_hn wrote:
         | Try it now MacOS X
        
           | blinkingled wrote:
           | I'm ok with Apple having different priorities so long as it
           | benefits the end users of the product (and I'm sure some
           | people will go to lengths to make up end user benefits ) but
           | whenever I use OS X I just don't see any benefits of not
           | having backwards compatibility - it's not faster than Windows
           | , nor stabler, it's not like it updates faster and it's only
           | getting iOS features backported. So it feels like not caring
           | about backward compat is just a self serving easy way out for
           | Apple.
        
             | jtdev wrote:
             | > " it's not faster than Windows , nor stabler"
             | 
             | Couldn't disagree more; ctrl-alt-del gets a LOT of use on
             | every Windows OS and client software combination I've ever
             | used - I can't even remember the equivalent hotkey on MacOS
             | although it's now been my daily driver for ~2 years of
             | heavy use.
        
               | LeifCarrotson wrote:
               | Cmd-Opt-Esc on a Mac is analogous to Ctrl-Shift-Esc on a
               | Windows machine (Cmd-Alt-Del brings you back to the login
               | page with a button to open task manager on post-Vista
               | Windows PCs).
        
               | Wowfunhappy wrote:
               | I have to force quit apps all the time on macOS. I'll
               | admit I also routinely forget the key combination, but
               | that's just because the Dock makes force quitting easy,
               | and the Windows task bar does not (afaik).
        
               | JonathonW wrote:
               | Recent versions of Windows have gotten pretty good at
               | identifying programs that aren't responding and offering
               | to close them; it's gotten pretty rare that I actually
               | have to open Task Manager to close a program. macOS, on
               | the other hand, never offers to kill a hanging program--
               | it'll let an application beach ball for hours until you
               | go out of your way to force quit it via the Dock or
               | keyboard shortcut.
               | 
               | At any rate, the applications that make up most of my
               | daily work are all really stable these days-- we've come
               | a long way since the Classic MacOS and Windows 9x days
               | where application (and OS) crashes and freezes were a
               | daily occurence.
        
               | blinkingled wrote:
               | I don't remember using Ctrl+Alt+Del on any personal
               | Windows machine either. It's the corporate client systems
               | that make you use it for login. Heck on surface devices
               | you don't even have to touch the keyboard to login :)
               | 
               | I haven't had the need to kill anything using task
               | manager either so not sure what I would use CAD for.
        
               | [deleted]
        
             | jhkjhtiou45 wrote:
             | > _So it feels like not caring about backward compat is
             | just a self serving easy way out for Apple._
             | 
             | I think there is more to it. I think is because they
             | actually don't want obsolete software to be seen on their
             | computers. Imagine people posting a picture with a Macbook
             | on Instagram, and you see some ugly 1990 piece of software
             | running on it. Not cool. So from time to time they remove
             | whole frameworks, to force developers to re-implement the
             | app in a new one, which is prettier. If no one is still
             | around to maintain the app, that's ok too.
             | 
             | This is why you don't see any ugly software on Macs, they
             | make sure to purge it every 5 years or so.
        
               | selimthegrim wrote:
               | This is the only kind of backward compatibility Apple
               | cares about:
               | 
               | https://youtu.be/Ja1vMy88_bA
        
       | vortico wrote:
       | It's funny that someone else on HN just managed to run a Java
       | program on Amiga 1000.
       | https://news.ycombinator.com/item?id=22011199
        
       | thrownaway954 wrote:
       | the last 2 articles from this dude have amazed me. he is a
       | NINJA!!!
        
       | Dutchie2020 wrote:
       | Love this guy, make sure you check out his 8kb C# game:
       | https://medium.com/@MStrehovsky/building-a-self-contained-ga...
        
         | zip1234 wrote:
         | It really is a great article and truly interesting techniques
         | to get the size down.
        
           | rafaelvasco wrote:
           | That's like gold to me. Really useful tips right there. At
           | the end things went crazy haha. I'm satisfied with 1MB size
           | hahah.
        
       | fuball63 wrote:
       | I've been seeing a lot of stuff about Windows 3.11 lately, did
       | they release it free recently? Like they did early versions of
       | MSDOS? https://github.com/microsoft/MS-DOS
        
         | neurostimulant wrote:
         | People uploads a lot of old Microsoft OSes and software on
         | Internet Archive [1], but curiously, no one uploaded Windows
         | 3.11 installer yet (plenty of Windows 3.1 though). I wonder
         | why. Legal reason?
         | 
         | [1]
         | https://archive.org/search.php?query=creator%3A%22Microsoft%...
        
         | Macha wrote:
         | The author mentioned in a reply that they got their copy with a
         | VS subscription.
        
           | fuball63 wrote:
           | If anyone else is curious what else you can get, Microsoft
           | publishes this Excel list: https://download.microsoft.com/dow
           | nload/1/5/4/15454442-CF17-...
        
           | sebazzz wrote:
           | Yes, and until about a year back Windows 95 and 98 were
           | available also but they have been taken offline. If I recall
           | it correctly it is due to some copyright issue.
        
             | zozbot234 wrote:
             | Didn't Windows 95 and Windows 98 include Java by default?
             | Probably yet another side-effect of the Oracle-Google
             | thing.
        
               | pram wrote:
               | Microsoft Java (lol) and they already were sued about it
               | ;P
        
               | stkdump wrote:
               | Oh, I remember J++! The glorious embrace and extend
               | days...
        
               | WorldMaker wrote:
               | J++ is a big part of why C# exists today.
        
               | Nitramevfank wrote:
               | Isn't that a back backwards? Isn't it more like:
               | Microsoft wanted a more modern language and they weren't
               | allowed to use Java so they created c#?
        
               | WorldMaker wrote:
               | Microsoft thought Java was a good idea in that they liked
               | the JVM a lot, but the language itself they saw as flawed
               | and missing key features that would make it a truly
               | modern language, in particular they heavily disagreed
               | with Sun's approach to FFI (foreign function interface)
               | [Java's slow, laborious efforts eventually building JNI,
               | the Java Native Interface], because of their many years
               | of experience for better and worse with COM (component
               | object model).
               | 
               | J++ was never meant to be "Java", and never technically
               | was even in branding, it was essentially a second
               | language (that Microsoft saw at the time as C++ is to C,
               | it was to Java, and that's very clearly represented in
               | that brand name) that also targeted the Microsoft version
               | of the JVM, and used a couple Microsoft-specific escape
               | hatches for FFI and COM.
               | 
               | (So it absolutely was an "embrace and extend", but it
               | wasn't of the Java language itself so much as it was the
               | JVM that Microsoft wanted to embrace and extend that
               | seemed to fright Sun so badly. That's probably why so
               | much of the legal drama and the consequent blows to the
               | rest of the Java ecosystem at the time was Sun
               | withdrawing JVM licenses from just about everyone as a
               | part of that battle. Originally Sun seemed rather happy
               | licensing the JVM to whoever wanted to implement it,
               | which is why Microsoft had a JVM in the first place,
               | thinking controlling the Java language was enough. Sun
               | worked to put that genie back in the bottle and move
               | everyone back to mostly a single JVM again. There's no
               | lack of irony in the exact same battle playing out
               | between Oracle and Google decades later in the battle of
               | Dalvik [Google's JVM] and Android.)
               | 
               | It wasn't that Sun didn't want Microsoft using Java, they
               | didn't want Microsoft using the JVM any longer, and
               | without a license to build their own JVM, J++ wouldn't
               | run on any other JVM and wasn't a useful language.
               | 
               | When Microsoft lost their JVM they decided to start from
               | scratch, moved the J++ team (including and particularly
               | Anders Hejlsberg, C# lead) to a new VM that they could
               | control from top to bottom (including its FFI mechanics),
               | and much of what had directly been the J++ team used what
               | they learned from the whole mess to create C#.
        
       | mmoez wrote:
       | Truly mind-boggling!
        
       | leeoniya wrote:
       | > This will produce a single EXE file that has whopping 65 MB.
       | The produced EXE includes the game, the .NET Runtime, and the
       | base class libraries that are the standard part of .NET. You
       | might say "still better than Electron" and call it good, but
       | let's see if we can do better.
       | 
       | Perhaps a better JS baseline would be QuickJS [0].
       | 
       | Once 1.2MB was reached:
       | 
       | > Now we've reached the end of what's possible with the .NET SDK
       | and we need to get our hands dirty. What we're going to do now is
       | starting to be ridiculous and I wouldn't expect anyone else to do
       | this. We're going to rely on the implementation details of the
       | CoreRT compiler and runtime.
       | 
       | QuickJS is 620K.
       | 
       | I guess that doesn't include any kind of facility for rendering
       | to the screen (besides basic barfing to stdout) or interacting
       | with keyboard/mouse. i wonder how much code would be needed to
       | add support for a basic canvas pixeldata api & keyboard event
       | handling.
       | 
       | [0] https://bellard.org/quickjs/
        
       ___________________________________________________________________
       (page generated 2020-01-10 23:00 UTC)