Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: What's up with DLLs?  (Read 1460 times)

PTTG??

  • Bay Watcher
  • Kringrus! Babak crulurg tingra!
    • View Profile
    • http://www.nowherepublishing.com
What's up with DLLs?
« on: January 17, 2010, 06:44:41 pm »

It seems to me that about half the time, when I try to use an indy program of any kind, I can't, because it needs some dll or the other.
Why do people still use dlls? They only have two uses: One, they break apart large .exes to cut down on redundant code; and two, by not being present, they force you to go do something useful.

This was great back when we where all on dial-up and had 5 megs left on our hard drives. At the moment, though, nobody cares if an exe takes up 1, 10, 50, 100, 1000 megabytes or more.

People, stop using dlls, or at very least stop assuming that your users have them. With the popularity of linux OSes and the huge variety of windows OSes out there, it's just not worth it.

If you must use a dll of any kind, do the following:

- Don't

If that doesn't work for you:

- Package the dll in your distribution (in a zip with the file, in a msi...)

If you still feel the need for more dlls, or otherwise can't distribute them with your product:

- Become a monk and put aside all technology

And if you can't find a monastery:

- Provide a clearly marked list, including links, of all needed files immediately adjacent to the download location. Not on a different page, not on the wiki, not solely in twitter responses, not written on the back of a receipt in your car's glove compartment, put it where the people who will need it are going to look.
Logged
A thousand million pool balls made from precious metals, covered in beef stock.

Willfor

  • Bay Watcher
  • The great magmaman adventurer. I do it for hugs.
    • View Profile
Re: What's up with DLLs?
« Reply #1 on: January 17, 2010, 07:03:39 pm »

If that doesn't work for you:

- Package the dll in your distribution (in a zip with the file, in a msi...)
You would think that would be common courtesy...
Logged
In the wells of livestock vans with shells and garden sands /
Iron mixed with oxygen as per the laws of chemistry and chance /
A shape was roughly human, it was only roughly human /
Apparition eyes / Apparition eyes / Knock, apparition, knock / Eyes, apparition eyes /

Blacken

  • Bay Watcher
  • Orange Polar Bear
    • View Profile
Re: What's up with DLLs?
« Reply #2 on: January 17, 2010, 07:13:28 pm »

I don't think you understand what libraries are actually used for. Static libraries suck really really hard, and you can't hot-load out of static libraries anyway which essentially kills binary plugin architectures. How 'bout no? Shit, you should care about an EXE taking up a gigabyte, because then you're loading in duplicates of all the libraries that your programs are using and that can add up.

Sure, let's go package mscorlib with every program we run! RAWK! \m/

And it's funny that you bring up Linux, which is even worse because of version hell (versioned deps in Linux work...sort of...sometimes...if your package manager supports exactly what you need). Complaining that Linux doesn't have a DLL you want is like complaining that this fish you're eating tastes in fact nothing at all like an eggplant. You're willingly using an OS where WINE is the recommended answer, you should be used to futile Googling by now.

EDIT: And it sounds like you're complaining about software you're using for free. What?
« Last Edit: January 17, 2010, 07:18:07 pm by Blacken »
Logged
"There's vermin fish, which fisherdwarves catch, and animal fish, which catch fisherdwarves." - Flame11235

Lord Dullard

  • Bay Watcher
  • Indubitably.
    • View Profile
    • Cult: Awakening of the Old Ones
Re: What's up with DLLs?
« Reply #3 on: January 17, 2010, 07:14:20 pm »

Well...

Quote
- Package the dll in your distribution (in a zip with the file, in a msi...)

I think most coders do this. However...

Quote
It seems to me that about half the time, when I try to use an indy program

It's a little silly to be griping about something that you're probably using for free, isn't it?
Logged

Aqizzar

  • Bay Watcher
  • There is no 'U'.
    • View Profile
Re: What's up with DLLs?
« Reply #4 on: January 17, 2010, 07:16:05 pm »

It's a little silly to be griping about something that you're probably using for free, isn't it?

Just because it's free is not a license to suck.  If a guy comes up to me and says, "Hey want to hear a joke?" and it's missing a setup, I'm perfectly entitled to tell him so.
Logged
And here is where my beef pops up like a looming awkward boner.
Please amplify your relaxed states.
Quote from: PTTG??
The ancients built these quote pyramids to forever store vast quantities of rage.

Blacken

  • Bay Watcher
  • Orange Polar Bear
    • View Profile
Re: What's up with DLLs?
« Reply #5 on: January 17, 2010, 07:19:08 pm »

It's a little silly to be griping about something that you're probably using for free, isn't it?

Just because it's free is not a license to suck.  If a guy comes up to me and says, "Hey want to hear a joke?" and it's missing a setup, I'm perfectly entitled to tell him so.
Actually, it very much is a license to suck. They shouldn't out of some basic frigging pride, but the appropriate response to "but this free thing doesn't work exactly right out of the box!" is "oh, I'm sorry, deal with it."
Logged
"There's vermin fish, which fisherdwarves catch, and animal fish, which catch fisherdwarves." - Flame11235

kuro_suna

  • Bay Watcher
    • View Profile
Re: What's up with DLLs?
« Reply #6 on: January 17, 2010, 07:19:16 pm »

If that doesn't work for you:

- Package the dll in your distribution (in a zip with the file, in a msi...)
You would think that would be common courtesy...
Often legal reasons prevent developers from including a required dll. For example some commercial game engines have a free version to develop with but you have to pay for a licence to include the runtime into your project.
Logged

Blacken

  • Bay Watcher
  • Orange Polar Bear
    • View Profile
Re: What's up with DLLs?
« Reply #7 on: January 17, 2010, 07:19:54 pm »

If that doesn't work for you:

- Package the dll in your distribution (in a zip with the file, in a msi...)
You would think that would be common courtesy...
Often legal reasons prevent developers from including a required dll. For example some commercial game engines have a free version to develop with but you have to pay for a licence to include the runtime into your project.
Cough cough. LAMEMP3. Cough.
Logged
"There's vermin fish, which fisherdwarves catch, and animal fish, which catch fisherdwarves." - Flame11235

Siquo

  • Bay Watcher
  • Procedurally generated
    • View Profile
Re: What's up with DLLs?
« Reply #8 on: January 17, 2010, 07:23:04 pm »

Static libraries are AWESOME. Dynamic libraries... SUCK!  ;D

Well, the thing could be that the indiedev probably has no idea if the lib he's using is standard Windows or if it's part of a package he once downloaded (I'm looking at you, .NET and MSVC), and hidden in his sys32 or his secret includepath or somewhere. If you lose track of all the libraries you use (and that's easy to do), it's easy to miss those. Also, indy developers (usually) do not have 10 different setups to test their installation, put back a clean windows image, and test again after every minor update.

Which breaks stuff.

So yeah, it's sloppy, but hey, it's indie. Most dll's are easy to find on the net though.
Logged

This one thread is mine. MIIIIINE!!! And it will remain a happy, friendly, encouraging place, whether you lot like it or not. 
will rena,eme sique to sique sxds-- siquo if sucessufil
(cant spel siqou a. every speling looks wroing (hate this))

Lord Dullard

  • Bay Watcher
  • Indubitably.
    • View Profile
    • Cult: Awakening of the Old Ones
Re: What's up with DLLs?
« Reply #9 on: January 17, 2010, 07:28:20 pm »

It's a little silly to be griping about something that you're probably using for free, isn't it?

Just because it's free is not a license to suck.  If a guy comes up to me and says, "Hey want to hear a joke?" and it's missing a setup, I'm perfectly entitled to tell him so.

This is a bit of a misleading metaphor.

It would be more like if a guy came up to you and handed you an MP3 player, and said 'Hey, you can have this - but I programmed it myself, so you might not be able to use it with your computer.'

Now, the guy might be willing to help you if you said: 'Hey, I couldn't get the MP3 player you gave me for free working on my computer. Any idea why? Oh, here are my system specs.'

But going: 'Dude, that thing you gave me for free SUCKS! Learn to code!' will generally be met with disdain, and for good reason.
Logged

zchris13

  • Bay Watcher
  • YOU SPIN ME RIGHT ROUND~
    • View Profile
Re: What's up with DLLs?
« Reply #10 on: January 17, 2010, 08:31:39 pm »

The second response is a perfectly rational response. It may not be the correct one, or the most helpful one, but it makes sense. Sort of. Maybe. Which should be enough for you.  And why would you EVER just plug something into your computer that you somebody handed to you on the street? I thought not.
Logged
this sigtext was furiously out-of-date and has been jettisoned

Lord Dullard

  • Bay Watcher
  • Indubitably.
    • View Profile
    • Cult: Awakening of the Old Ones
Re: What's up with DLLs?
« Reply #11 on: January 17, 2010, 08:44:59 pm »

A rational response? Perhaps. I suppose telling someone they're worthless for giving you free food could also be considered a 'rational response', if we define rational as 'thinking it's okay to act like a total jerk'. Generally I tend to define rational as 'behaving within the scope of reason', though.

Quote
And why would you EVER just plug something into your computer that you somebody handed to you on the street? I thought not.

And yet people download free software all the time. I think you're sort of perpetrating some friendly fire here as debate goes, man. From what I can tell, you seem to be advocating not using indy software at all with this statement?

Edit: After rereading that, I'm not sure if it's just glib sarcasm or not. If it is disregard everything below the quote.

Essentially, if somebody came along and said - "I can't get Dwarf Fortress working on my computer. Therefore I judge that the person who coded it does a crappy  job of coding, and the game itself is junk", what would you think of that person?
« Last Edit: January 17, 2010, 08:53:47 pm by Lord Dullard »
Logged

zchris13

  • Bay Watcher
  • YOU SPIN ME RIGHT ROUND~
    • View Profile
Re: What's up with DLLs?
« Reply #12 on: January 17, 2010, 08:54:51 pm »

Simple. I would answer with stupid in-jokes about magma.
Logged
this sigtext was furiously out-of-date and has been jettisoned

Normandy

  • Bay Watcher
    • View Profile
Re: What's up with DLLs?
« Reply #13 on: January 17, 2010, 10:40:53 pm »

Think about your windows OS for a second. Consider all the RAM that it uses with nothing else running. Now imagine that amount of RAM is consumed by every single program that uses any little bit of WinAPI whatsoever. This is one of the reasons DLLs exist.

Slightly touched on already, DLLs don't just save on disk space, they save RAM as well. The 'right' way to use a DLL is to link to something already on the user's machine, so that programs can share the same copy of that DLL, which is already loaded into memory. This is why you don't have to distribute windows DLLs every single time you create a program utilizing WinAPI, despite the fact that it is fairly obviously a library. *nix systems are slightly better at centralizing these libraries so that this intended memory sharing might happen a bit more often. It's actually better to NOT distribute a DLL with your program, because that removes this advantage. Consider how many copies of the DirectX libraries you have on your computer (hint, it's 1), and consider how many copies of redistributable SDL you have on your computer (hint, it's pretty high). Whereas multiple programs running on the same DirectX library will be able to cut their shared memory (which, for a monolithic library such as DX, turns out to be a lot), whereas every single instance of a program distributed with it's own copy of the SDL runtime library will have its own unnecessary copy of the SDL functions in memory.

Though the idea of DLLs as 'plugins' is somewhat antiquated after the rise of scripting languages, DLLs still allow the underlying framework of a program to be updated independently of the program itself. Say there was a vital security breach found in the DirectX libraries. Every single copy of every single program using DirectX would have to be updated in order to fix this breach. That'd be a hassle. What about unsupported programs? Or the user could just update a single DLL to fix this security issue.

Also, LGPL and many other licenses don't allow for static-linking of certain libraries (*ahem* SDL) without strings attached. Which is enough of a turn-off for most programmers.
Logged

Muz

  • Bay Watcher
    • View Profile
Re: What's up with DLLs?
« Reply #14 on: January 17, 2010, 11:31:28 pm »

You can just google up the dll these days.
Logged
Disclaimer: Any sarcasm in my posts will not be mentioned as that would ruin the purpose. It is assumed that the reader is intelligent enough to tell the difference between what is sarcasm and what is not.