Slashdot Mirror


Why Doesn't .NET Include a Linker?

CrypticSpawn asks: "I read an article on Joel on Software it talks about Microsoft missing one important thing from the .NET infrastructure, and I wanted to know what Slashdot readers thought were Microsoft's reasons for leaving [a linker] out?"

14 of 113 comments (clear)

  1. Do you mean... by Anonymous Coward · · Score: 3, Funny

    Something similar to the JAva linkeR ???

    I've used it-- very effective.

  2. One possibilty by sbennett · · Score: 5, Insightful

    One possible advantage to always dynamically linking: when some nasty bug in the runtime is found, it should be easier to upgrade the runtime than to relink every application that's been linked statically to it. Of course, people won't actually bother to upgrade, but you can see how the theory goes.

    Yes, I say when a nasty bug is found, and not just because it's a Microsoft product. No matter how good the software is, there's always at least one critical security flaw.

  3. silly objection, and- you can get a linker! by RevAaron · · Score: 4, Interesting

    where is the surprise in this?

    first of all, you can get a linker for .NET if you want. like similar tools for perl and python, it packages everything up that you need into one exe. this took 10 seconds to find via google. Perhaps Joel should try google next time. What is this, ask slashdot? :)

    there is nothing different about the way .NET does this and any other system. Sure, there isn't a way to link it all into one .exe file, but that may come in the future. that is, in perl and python (among others) that was the case at first- you had to download a big runtime and possibly other libraries to get your app working. these days, you can distribute your app in that way- a 20KB download of your .pl files,or a big-ass executable that integrates all the requisite libraries, VM/runtime system, etc etc. however, this often ends up giving you a file that it almost as big, but at least, it is a little simpler on the user.

    again, Java does this too. If i have a .class file or jar, there isn't some way to encapsulate it all into one double-clickable executable file that I can share. I have to have my users download a big package, the other libraries, and then my app. .NET is no different, and there is no reason to expect it to be. joel gripes, saying that microsoft will come out with a new version every few months. just like with new versions of perl, python or java, there is no reason that the user would neccesarily have to have the brand-spankinest newest version. if your app requires it, you make it a requirement. put it on the CD, and say- install this if you don't have it yet. big deal. if you were smart, you'd write your apps against the most common verison- .NET 1.0 or 1.1 for now, just like a lot of Java apps are still written for Java 1.1, not even Java 2! Most folks don't write apps for the newest Java, 1.4.x unless they really need it.

    what the hell is so different about how .NET does it?

    --

    Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
    1. Re:silly objection, and- you can get a linker! by kzeddy · · Score: 5, Informative

      this linker shown above does nothing more than merge all the classes used by the application into one big assembly. it does not turn the code into native assembly or link into the assembly and mini hosting environment which is what joel is talking about. YOU STILL NEED .NET

    2. Re:silly objection, and- you can get a linker! by Elwood+P+Dowd · · Score: 4, Funny

      And you can include .NET in your installer too. This is like complaining YOU STILL NEED JAVA, or YOU STILL NEED GLIBC. Of course you fucking do.

      --

      There are no trails. There are no trees out here.
    3. Re:silly objection, and- you can get a linker! by RevAaron · · Score: 4, Funny

      Heh. I'm going to write an article about "Linux's biggest oversight." Why should I need libc, or even worse, libc++ to run KDE or GNOME? SICK! WRONG!

      Unless it's written in assembly, with no calls to any library, I won't run it. The only thing allowed is calls to interrupts or BIOS. DOS, here I come! (back)

      --

      Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
    4. Re:silly objection, and- you can get a linker! by spitzak · · Score: 3, Funny

      In fact you could make an installer that contains the entire operating system! Why doesn't Microsoft allow that? Or why don't Linux apps come that way? Just imagine how convienent it would be if every program came with it's own copy of the operating system, modified to work perfectly with that program!

      I agree with most of the posters here, this Joel guy does not know what he is talking about, or he thought he could get site hits by making up a silly complaint about Microsoft.

    5. Re:silly objection, and- you can get a linker! by JDWTopGuy · · Score: 5, Funny

      In fact you could make an installer that contains the entire operating system!

      I believe emacs has something like that.

      --
      Ron Paul 2012
  4. Does Java have a linker? by EddWo · · Score: 3, Informative

    They don't have a linker because .Net is a virtual machine Jit compiler as well as massive class library.
    It will just become part of the Windows platform, its already included with Tablet PC, Media Center, Server 2003, Windows Mobile 2003 and it will be a major part of Longhorn.
    No one asks for a linker to statically link to user32 or GDI.

    --
    "Taligent is still pure vapor. Maybe they'll be the last who jumps up on Openstep... "
  5. A linker is largely redundant by ezy · · Score: 3, Interesting

    The only three potential advantages to a real linker are:
    a) You dont have to include code you dont use
    b) You can ship "all-in-one" executables that work in any environment (excluding the basic OS interfaces)
    c) global optimization

    If you have an environment that:
    a) Shares library usage between processes, and only pages in parts of the library that are being used.
    b) Handles versioning of library interfaces in a reasonably sane way.
    c) Uses meta-code which can be globally optimized. (.net may not be doing this yet)

    You don't really need a linker. Joel's main complaint appears to be about cross version compatibility (b) and all the cruft you need to install to get .net executables working (uh... .Net itself :-)) (a). I understand this in the short term, but over the long term I think it's going to be less of an issue.

  6. How did this post get moderated up? by Inoshiro · · Score: 5, Informative

    All you had was wild speculation ending with, "I've never used .NET,"

    Let's pause a second and see how programs work on a modern operating system.

    There are 2 kinds of programs, typically, in an environment such as your PC: statically linked programs, and dynamically linked programs. Statically linked programs have the library calls included in the binary, wherease dynamically linked programs rely on library implementations stored in a system directory (like \windows\system or /usr/lib). The run-time linker resolves all the dependancies and loads the related libraries for every dynamic application you start (run the ldd command on a binary you have to see the libraries).

    But a .NET program (or a Java program, or a batch file, or a shell script, etc, etc) isn't a binary. It's PCode. It requires an interpreter to parse its Pcode. To make the .NET program stand-alone, ala a statically linked binary, you'd need to include the interpreter, a set of all used class libraries, and any other parts of the environment that are required. A typical 1-3mb application would have to be distributed as a 30mb+ file.

    When you want to run a Python program, you install a Pynthon interpreter. When you want to run a Java program, you have to install the Java runtime environment. When you want to run .NET programs, you need a .NET environment. It's not some crazy lock-in scheme, miyako, it's merely a fact of how virtual machines and Pcode work.

    Before you sit down to learn about .NET, I think you should take off your aluminium beany and learn about how computers work.

    --
    --
    Internet Explorer (n): Another bug -- that is, a feature that can't be turned off -- in Windows.
  7. wow, what planet is that guy from? by ajagci · · Score: 4, Interesting

    For some reason, Microsoft's brilliant and cutting-edge .NET

    Actually, .NET is neither "brilliant" nor "cutting-edge"--it's a modest evolution from Java, which is itself 1970's technology.

    The tool in question? A linker. Here's what a linker does. It combines the compiled version of your program with the compiled versions of all the library functions that your program uses. [...] Instead, .NET has this idea of a "runtime" ... a big 22 MB steaming heap of code that is linked dynamically and which everybody has to have on their computers before they can use .NET applications.

    Well, that's roughly like saying that automobiles leave out the horses and the whip. The whole point of .NET and Java is to run inside a runtime, a runtime that provides garbage collection, dynamic typing, and just-in-time compilation.

    Runtimes are a problem, much like DLLs, because you can get into trouble when application version 1 was designed to work with runtime version 1, and then runtime version 2 comes out, and suddenly application version 1 doesn't work right for some unpredictable reason.

    Well, duh. So, I guess operating systems are a problem, too.

    We solve that sort of thing by having standards and sticking to them. Oh, I forget, besides being rather confused about software in general, Spolsky also actually seems to like Microsoft Windows, so the notion of "standards" and "compatibility" must be rather foreign to him. .NET and Java do have serious design problems. Foremost, safe runtimes like that should run all applications on a machine in a single address space. Then, you can get rid of a lot of useless machinery for inter-process communication, and the overhead gets amortized over dozens of programs. Again, old stuff. But Spolsky's criticism is just missing the point completely.

  8. Re:Joel is a schmuck by Jerf · · Score: 3, Insightful

    I can't see a good reason why he would want a linker to link the .net environment and runtime into a single executable. That is just plain nuts. Yeah, I would rather have my users download a 30MB file instead of a 20MB runtime and a couple hundred K app...

    Actually, he had two good reasons, one of which you winged and one that zoomed right past you, likely because you've never had to support software that you wrote and may have multiple versions in the field.

    First, he objects that users may not download the larger file (and I'd add that some users will balk at installing what is effectively an OS upgrade just to try some software out, especially corporate users), and that as a result those users won't give him money. Unlike free software, a lost user is cash out of pocket. This is not trivial when software is your living.

    This isn't quite what you said because you missed the "money" aspect of the objection, which is critical.

    Of course it's easy to mock Joel, because it's his living, not yours.

    Secondly, he objects that without static linking, he's at the whimsy of both the users and Microsoft as to which .Net runtime his software actually gets dynamically linked to, and observes that there is a "solution" to this virtually nobody can use (so it's not really a "solution"). Again, if his software doesn't run, it's money out of pocket. And again, if you've never had to support software you probably wouldn't understand why it's nice to bundle everything up, as much as possible, into one self-contained bundle.

    I won't go so far as to qualify you as an absolute moron, but you are committing one of the key Moron Sins, which is "Assuming everybody in the world has needs identical to yours and projecting from there." So you're at least partially there with your Rant-From-Inexperience.

  9. Nuisance by GCP · · Score: 4, Insightful

    where is the surprise in this?

    It's not that it's a surprise. It's just a huge annoyance.

    Microsoft talks about how much easier it is to create Windows apps with .Net than with the old VC++/MFC approach, and that's so completely true that after you see what you can do with C#/.Net, you can't bear the thought of going back to C++/MFC.

    But the fatal flaw for Spolsky and others in his position (including me on occasion) is the delivery of such apps to the enormous installed base if you can't deliver via CD-ROM. Then you're in the same position as people who would rather work in Java or Python or Lisp: your elegant little app has this huge boat anchor of a runtime to drag along with it, and people in the general installed base who get your app via download simply won't put up with it.

    VC++/MFC have a huge boat anchor of a runtime, but it's Win32 itself, so it's invisible. The majority of the installed base out there can be counted on to have a huge library built into Win98 (likewise for Linux), and all you need to statically link is whatever wasn't already included in Win98.

    For a C(++) developer on Win32 or Linux, this doesn't usually add much baggage, so I almost always statically link and save my users from dependency hell.

    But for developers in anything else, the runtime is a major impediment to commercial viability (for certain scenarios).

    At first I wondered why MS didn't just AOL the world with .Net installer CDs in everybody's mailboxes. I gradually came to the conclusion that it's because they were essentially gamma testing it first on those more savvy users who could figure out how to obtain it and install it themselves, especially on the server side.

    It appears as though they plan to give themselves some time to work out the bugs and flaws in .Net and gradually insert it into the new OSes, allowing the upgrade cycle to control the speed of adoption. The least likely to upgrade will be the least sophisticated users that way, and therefore the people least likely to be able to handle the inevitable bugs in .Net will be the last to get it.

    It will take a few years, but .Net is a powerful replacement for the Windows API that will eventually be built in to all Windows machines (and others, if MS gets their way), and then you'll be able to safely deliver a C# app without the runtime.

    Of course it's an open question whether developers like me will be willing to wait. The major attraction of Windows for me is the huge market that the installed base represents. The OS itself is of little interest. But it's hard to take advantage of that installed base opportunity using .Net apps at the moment, and I can't see starting anything new with MFC (Yuck! I'd be stuck doing MFC maintenance for years to come). The best way to take advantage of .Net right now is on your own machine -- some sort of server-based app. Well, if it's a server scenario, then what the installed base is running is irrelevant, and I'd prefer to use something like Python or Java or even Lisp on Linux. (We'll see how C# on Linux turns out with Mono later this year with the release of 1.0.)

    If there were a way to take a 300KB C# app and turn it into a 1.3MB windows *.exe that would run on a plain vanilla Win98 machine, that would change the economics for me as it would for Spolsky. Otherwise, well...we'll see....

    --
    "Those who have never entered upon scientific pursuits know not a tithe of the poetry by which they are surrounded."