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?"

23 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
    6. Re:silly objection, and- you can get a linker! by Gyler+St.+James · · Score: 2, Informative
      Maybe you should re-read the FAQs yourself.

      Microsoft .NET Framework is by any standard a significant installation that one would easily notice; some users may not be willing to install it at all. On the other hand, there are still many PCs that may not be suitable for .NET framework installation. This tool helps you to reach more customers as it silently deploys a trimmed down version of the framework without any noticeable effects and conflicts. The framework appears as an integrated part of your own application.

      and...

      The mini-deployment tool puts together the minimum set of CLR runtime files and dependent assemblies that can be simply copied to a single folder on a target machine, and your application runs as if the whole framework is installed. Since the installation is isolated into a single folder, there will be no conflicts with future .NET installation. When linking is used for the dependent assemblies, it will further reduce the file size.

      In layman's terms, you the developer needs to have the framework installed, but the user does not. It doesn't support Windows 95 because that OS is not supported by the .NET CLR itself. Duh.

      --

    7. Re:silly objection, and- you can get a linker! by Gyler+St.+James · · Score: 2, Informative

      I've been doing .NET development for a long time now (2 years) and for all intents and purposes, the Framework install and the run-time is the same thing. There is no separate download of the Framework classes and the run-time. The framework is merely class libraries bundled into assemblies. Besides, have you even tried the linker mentioned? I have. I've taken the assembly generated and run an EXE on a machine with no updates and no run-time.

      --

  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... "
    1. Re:Does Java have a linker? by aminorex · · Score: 2, Interesting

      The point is that you can't deliver an app
      in a reasonble (i.e. minimized) download,
      to run on most of the Windows systems out
      there: Windows 95, 95 OSR2.5, 98, 98SE, ME,
      NT 4.0 sp6a, and 2000 Pro SP4. .NET is only useful for enterprises in which
      all the systems are "upgraded" (more like
      "migrated") to XP. That's a rare environment.
      It probably only happens in small businesses
      or colleges.

      --
      -I like my women like I like my tea: green-
    2. Re:Does Java have a linker? by llzackll · · Score: 2, Interesting

      This is very true. .NET wasn't even available until recently. In other words..

      If your target audience is using Win98, and they don't want to download the .NET framework, then .NET is not right for you. Can't really be mad at Microsoft for requiring a 24+MB framework download that was not even available until the WinXP days.

      If your software company is distrubuting CD's, you can always put the framework on CD and install it with the app. It is a redistributable component per the EULA.

  5. You ask why? by dtfinch · · Score: 2, Informative

    Java doesn't have a compile-time linker either. VM based languages tend to only link at runtime.

    You improve one library, retaining interface compatibility, and every program that depends on it benefits without having to recompile. Executable code doesn't get duplicated in memory each time a new process sharing the same library starts. Libraries can benefit from globally shared objects without running the risk that a program compiled with an older version will mess stuff up. Etc.

    But you're right about this being imperfect. Upgrading my .NET runtime caused my Visual Studio .NET to become instable. I'll probably have to get the newest Visual Studio before I can get much use out of it again. It makes everything incredibly slow to load as well.

    Visual Studio .NET does infact include a linker, for the C++ compiler.

  6. 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.

  7. Give me a break by dedazo · · Score: 2, Interesting
    Joel's flagship product is (or used to be) written in Visual Basic. When he talks about "my users download a 9MB installer that has no additional dependencies" he's including the VB runtime along with everything else. That's 1.2MB, not including any additional ActiveX stuff he might use.

    Joel doesn't want a "linker", he wants C/C++ or Delphi or some other language that can create self-contained executables. So the .NET runtime is 25MB. Those are the breaks. His employee wrote this little app in 60 seconds, right? Well you can either do that and download 25MB of runtime or spend 25 hours writing it and not download anything.

    And of course this posted here looks like yet another evil plot by "M$" to (a) lock in customers (b) stifle competition; or (c) kill baby seals. Jeez.

    Considering Joel's track record I'm surprised he framed this "problem" this way. Linker indeed.

    --
    Web2.0: I love when people Flickr my cuil and digg my boingboing until my google is reddit and I start to yahoo
  8. Joel is a schmuck by Goyuix · · Score: 2, Insightful

    Having never read him before, I can't be 100% sure of the above title, but I can say that I won't be visiting his ruminitions on society anytime soon. I think he is a loud-mouth moron.

    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... and his part on ranting of all the updates he needed to do - well, just further proof he is not staying on top of taking care of his system. The .NET runtime should not have required him to install anything else besides the runtime. He is clearly clueless when it comes to system administration (or writing untrue things to try to get more people up in arms) if he really wants a linked executable he can drop on a box with no other expectations.

    At the end of the day, the question he should have asked would have been something more analgous to the java compiling goodness in gcc to generate native code and not java byte code. That I could seem some benefits to, but really he should just be programming in Delphi or C++ Builder (not all that different from .NET - written by the same guy after all).

    I stand behind my classification as Joel as an absolute moron. He is nothing more than a bad journalist trying to get people up in arms with his so called facts and loads of ranting.

    1. 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. 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.
  10. 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.

  11. 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."
    1. Re:Nuisance by crazyphilman · · Score: 2, Interesting

      Well, ok, I see why you might find this annoying, but look at it from another perspective:

      First of all, because you're compiling to CLI and using a runtime, you don't have to recompile your code every time a vulnerability comes out and you decide your users should patch. They patch the runtime and the app keeps working (knock on wood). A related benefit is that as the runtime improves, your users get a performance boost without you having to lift a finger, if, that is, they're keeping up with their patches (I know, I KNOW).

      Look at a related technology to see this in action: Between Java's JRE 1.3 and JRE 1.4, Sun added a feature that compiles classes to native code and caches them. This is basically an improvement to a runtime that ends up benefitting all code that uses the runtime, without recompiles or rollouts. Users just upgrade their JRE, and poof. Performance boost.

      Ok, another benefit of a runtime is, you don't have to worry about installed libraries, DLL Hell, or any other similar thing. You just make sure your users have the most recent copy of the runtime, and you're set. No more having to figure out dependencies and make sure they get into your MSI. No more having to run RegCrawler on user machines to strip out a dozen instances of the same DLL because some brainiac sysadmin kept re-registering the same dll over and over again (YES, I've had to clean up this kind of thing before, when updating legacy code that hadn't been installed with an MSI -- Ugh). Everything is clean and easy, and everything is where you would expect it to be. Nice for a change, after years of VB6 and dll hell.

      Finally, since the runtime is really only a 25MB download or so, as pointed out by another poster, you can put the install on a mini-cd along with your code MSI and write a script that installs one, then the other -- can't you? It seems to me that that would be relatively trivial. And, everyone who makes a runtime grants developers some form of redistribution rights, don't they? It seems to come with the SDK most of the time.

      I think you're underestimating the value of this approach. Plus, you're overestimating the difficulty of working with it.

      Come on, Strangelove... LOVE the bomb. ;)

      --
      Farewell! It's been a fine buncha years!
  12. Re:We do it because we can. by shaunbaker · · Score: 2, Insightful

    You can have a quick look at the mono project to dispell any thoughts of .NET being strickly a Windows-Centric platform. Could you please explain why the lack of a linker makes it any harder to write a .NET app on multiple platforms. So long as your platform has the the ability to run .NET apps, why should it be any different?