text:
Make a PNG image with "Hello World!" with programming APIs, in the shortest code possible
So, I want you to make a PNG image that says "Hello world!" and nothing else on a distinguishable background using only an image making API (eg ImageMagick) and return the image. Fewest characters win, as usual. Oh, and you can use any color text.

Does it have to output Hello World or Hello World!?

@ryan Hello World! is the right one.

A lot of answers could save one character by replacing the double 'l' in 'hello' with the medieval Welsh ligatures 'Ỻ' or 'ỻ': once the chars have been transformed to pixels it shouldn't matter what their origin was as long as people still perceive 'heỻo world!' as 'hello world!'.

@timxyz Clearly not if you want the result to appear correctly on my browser!

@poldie Your browser changes PNG based on how the pixels got in there?

@timxyz: Arguably the extra stroke in ỻ violates the "nothing else" requirement.

@timxyz For me, ỻ is rendered as a box containing 1EFB. I tried to use it in my program anyway, and the result was a square. So, this is probably not very portable.

@timxyz No, it changes the characters you want changed into a PNG.

Sage notebook, 22
text("Hello world",0j)

Does this produce a PNG image?

Yup.  That's why I specified 'notebook', the CLI pops a window open, but the notebook saves a .png for the browser to display.

Bash + ImageMagick: 35 33
Default font, default text size, default colours:
convert label:Hello\ world! a.png

and here's the result:

Thanks to DigitalTrauma and sch for the help :-D

Great!! :-) I wanted to write something like that. Unbeatable! All the esoteric languages will finally get their ass kicked today! :-)

You can shave off one char by using single-quotes: convert 'label:Hello world!' a.png

convert label:Hello\ world! a.png is even shorter.

@sch - True - I was thinking the ! needed escaping when unquoted, but it only needs escaping when in double quotes.

@DigitalTrauma, it doesn't necessarily means escaping when in double quotes. It's just that here it was !" (which is looking for an event starting with " in the history).

Also, if you make it sh, you don't have to worry about ! and you make it even less esoteric.

Would it be valid to save the image with the filename 'a'?

@Vortico: I think convert looks at the extension to figure out what format to save in. Otherwise you would have to specify PNG explicitly, which is longer than the extension.

Save one character if you change ".png" to ".ps" to save to postscript

@alexy13 The task is to create a png.

Frankly I don't think bash qualifies as a programming language here or that convert qualifies as an API. But in this case I'd throw GNU hello in and bring this contraption down to 29 with: convert label:"\hello`" h.png`

Why do you even care for the extension of the file? Just call it a and the mime type will do the rest.

@ArnaudMeuret GNU hello is not very standard, e.g. it's not present on our debian server.

@ArlaudPierre 1) convert relies on the extension to choose the output format 2) Mime Type resolvers rely mostly on file extensions; in rare cases magic cookies

Mathematica 28 27
This creates and exports the sentence, "Hello world!", as a PNG image.  1 char saved by Mechanical snail.
".png"~Export~"Hello world!"

Testing
This imports the PNG image.
The image was enlarged by dragging the image box handles.

27 bytes: ".png"~Export~"Hello world!"

Wow, two snails in a race! :-)

HTML, 1494
I know this won't win, but I didn't see this here before.
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEIAAAANEAYAAABNymQSAAAABmJLR0T///////8JWPfcAAAACXBIWXMAAABIAAAASABGyWs+AAAACXZwQWcAAABCAAAADQDi7GgjAAADvElEQVRYw+1YPa9pTRReRIJKEPHdiEJBoVVIRCenpCJBfCQEDeI3qAh/QCIRUchp0KCUaISgROO7QMRHSGS9xX73u+85592Xe47uepqJZ9bMrFnzrJm1MfBfwAsvAADzM8HhcDgczv2Bj9r9KRgMBoPBeJz/2/DdODwaV+bjU77wN+AliBc+4OmCmE6n0+kUwGKxWCwWAKFQKBQKAfR6vV6vBygWi8Vi8efr7Ha73W4H4HK5XC4XgFQqlUqlADKZTCaTAbjdbrfbTdndg8FgMBgMANVqtVqtUnwikUgkEgBisVgsFgOQFRfZkny/3+/3+z/3i7zC8/l8Pp8HkEgkEomE3u/tdrvdbgEcDofD4aDirVar1Wo1QCaTyWQyj8f1iyAul8vlcqEco2tJu88IBoPBYBDA7/f7/X6A5XK5XC4ByuVyuVwGSCaTyWQSYDAYDAaD7wsiHo/H43EAFovFYrEAxuPxeDwGGI1Go9GI4skDvYe3t7e3tzeAer1er9cpvtlsNptNAC6Xy+VyAYbD4XA4pPwnea1Wq9Vqn+dXu91ut9sAjUaj0WjQ28VisVgsRgl0MplMJhOAXq/X6/UAOp1Op9OhH8/j8Xg83i8EfgKbzWaz2XgXdHYCgUAgEJBfLfQtkQFfx/+/V195uVwul8sRV6vVarX6ak8IEVGpVCqVyvv7IQKISBwsIpHBiBqNRqPRIBIHiJhOp9PpNGIqlUqlUoihUCgUCj3PL3Kf6/V6vV7fjwNxAyEuFovFYvHVnuTp4moymUwmE/Wb9f0c/b3iut1ut9sFIDZO9c9ms9lsBsDn8/l8/s/Xu1c932632+12fx6dTqfT6QD2+/1+vwcolUqlUgnAaDQajUYAs9lsNpsBstlsNpulMjISiUQikef7JRKJRCLRfb+ZTCaT+ZuH/95XCflU/odHM/9Ru3A4HA6HEaPRaDQaRbxer9frFbHVarVaLURCMFSm3MsAOt7j8Xg8HkSfz+fz+RDP5/P5fEY8nU6n0wnR6/V6vV6qfRSBQCAQCFAZXCgUCoUC4vF4PB6PiMRBISoUCoVCgUg8nc/zi27/dP3kPHa73W63IxKCRjwcDofDAZGoWejnrdVqtVrtl/mfLQiiyEG02Ww2m416QogiB/H9/f39/f3xDdPx5DpOp9PpdCISxRfVkjxp9ygqlUqlUqHWm8/n8/mc6ievWKvVarVa6ff/Xb/+VBCbzWaz2VCCIOOtUqlUKhViLpfL5XKPx5XxseOFvx2v/yFe+ICXIF74gH8A5ia8gOmPT18AAAASdEVYdGxhYmVsAEhlbGxvIHdvcmxkIbl+3UEAAAAASUVORK5CYII=

Well apparently StackExchange will not allow data links so you must copy & paste it into your browser's address bar.

@squeamish ossifrage got it down to 176:
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC0AAAAHAQAAAAC0VvlnAAAAOklEQVR4nGLIv/57/+9rDGDqAkPOterN0YIM3KG712pdZcgI3bW26gZD9lUwlRNWW1wtAAAAAP//AwCcyhjs3+7tWQAAAABJRU5ErkJggg

114
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACUAAAAEAQAAAAAhFcs9AAAAIElEQVQIHWOJit1f7szy58v9DAWWPaEMP7hZHHgi1aMB

@primo got it down to 112:
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACYAAAAEAQAAAADKInA+AAAAH0lEQVR4nGOIj///7wVDZOBdoQ4G4dCrYWuA7JNiHQ

http://codegolf.stackexchange.com/a/19929/15891

You can easily compress this to 258 characters: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEIAAAANCAAAAAA4MeeNAAAAdklEQVR4Ac2QUQqFQAwDc9I5Ze6XB8HXXRFE8Mdg+zGEwa7yOurXdUb30ap+UIHkUSDRGg5K5D+SdRQ8iqbdTjmk043ihcQU9r8Y1aEY2A2Y1cte4KRIc1UYg58oIFYuhwQ5UgYp+yF+8Jz1Qgapsz/n23xE8QNxUbxuz+WqjAAAAABJRU5ErkJggg== http://pastebin.com/5TQzNv3D

@squeamish ossifrage got it down to 176: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC0AAAAHAQAAAAC0VvlnAAAAOklEQVR4nGLIv/57/+9rDGDqAkPOterN0YIM3KG712pdZcgI3bW26gZD9lUwlRNWW1wtAAAAAP//AwCcyhjs3+7tWQAAAABJRU5ErkJggg. Must strip the hidden spaces.

166 chars:
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD8AAAAFAQAAAADaxQm5AAAAM0lEQVQIW2Mo0a+w3iKQz8NQ+r56r+71/BIGlnwg40J+GUhkz9lr78sYShQ57O6IKfIAAJypEkNzAX3zAAAAAElFTkSuQmCC http://codegolf.stackexchange.com/a/19941/12800

143 chars:
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACUAAAAEAQAAAAAhFcs9AAAAIElEQVQIHWOJit1f7szy58v9DAWWPaEMP7hZHHgi1aMBegAI03/J+AQAAAAASUVORK5CYII=

149 characters (retaining mixed case "Hello world!"): data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACYAAAAFAQAAAAABfqObAAAAJklEQVR4AWOIjv//7wWzBiNfnzzzc3klmY9MbgwMHCxMLGy6B3QAmcwIOOO9CusAAAAASUVORK5CYII

I got it down to 135 characters! data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACUAAAAEAQAAAAAhFcs9AAAAIElEQVQIHWOJit1f7szy58v9DAWWPaEMP7hZHHgi1aMBegAI03/J+AQAAAAASUV= (btw, that's 83bytes for a png image that says "Hello World", thought I might throw that out there!)

@timgws You can chop the last = off. It's only padding. In fact, you can chop off egAI03/J+AQAAAAASUV= to yield 114: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACUAAAAEAQAAAAAhFcs9AAAAIElEQVQIHWOJit1f7szy58v9DAWWPaEMP7hZHHgi1aMB

@Chloe the IEND is required by the PNG Specification: "A valid PNG image must contain an IHDR chunk, one or more IDAT chunks, and an IEND chunk." It further states that any compliant decoder must treat any missing critical chunks as an error.

Valid png format - 140 bytes http://codepad.org/O0TwZbKF. No IEND - 124 bytes: http://codepad.org/QdutLeK1. No IEND, no IDAT crc32, no zlib adler32 - 112 bytes: http://codepad.org/R4srHxhh.

This isn't HTML. <html><img src="data:..."> is HTML. This is just a URI.

C# - 168 chars
C# is better! ;)
using System.Drawing;class a{static void Main(){var s=new Bitmap(99,9);Graphics.FromImage(s).DrawString("Hello world!",new Font("",5),Brushes.Red,0,0);s.Save(".png");}}

Saves as .png in the current directory.
Rule abuse:

Minimum font/image size has not been specified, so I settled for the minimum readable ;)
Filename is empty (only extension!), but it works flawlessly.

To mirror the Java answer, here is the indented code:
using System.Drawing;
class a
{
    static void Main()
    {
        var s = new Bitmap(99, 9);
        Graphics.FromImage(s).DrawString("Hello world!", new Font("", 5), Brushes.Red, 0, 0);
        s.Save(".png");
    }
}

.net's API is a lot cleaner.

Thanks for the suggestion of making the file call just .png. :)

I don't see how this is much cleaner than the Java one.

It is much cleaner than the Java one.

@immibis I can point the following: Character count is 28% lower, because of: no checked exceptions(throws Exception); the var keyword; Save is a method of the image itself, in contrast to javax.imageio.ImageIO.write(b...; file type is automagically inferred from the extension, no need to specify a separate "png"; No need to instantiate a File object as in new java.io.File("p"); Main method doesn't need to receive a parameter. The general idea is the same: create an image, use Graphics to write to it, and save it - but here it is done with more clear and succint method calls.

But C# doesn't have wildcards in generics. And anonymous classes. And return type covariance. And some other things I'm too lazy to recall.

@Sarge Yes we do, reflection for when we need them. Yes we do. What do you mean? Covariance works in C#.

@It'sNotALie. http://en.wikipedia.org/wiki/Covariant_return_type

@Sarge I could see how that could sometimes be useful but we'd use generics in C# for this instead. Sometimes we really do want it to just return that type.

can the use of f# reduce char count?

@Rozuur I guess it should, but I'm no expert in F# so I didn't use it.

Linux shell + various utilities: 48 bytes
My first thought was to print Hello World! in the console, and then take a screenshot (after a small delay to avoid the race condition) using scrot:
echo Hello World\!;scrot -d1

(28 bytes). Unfortunately, this fails the "and nothing else" requirement: it will generally show other things like window decorations.
So instead, do it inside a full-screen xterm. This covers up any other windows and hides window decorations. It also satisfies the background-color requirement, since xterm defaults to a white background.
Because xterm displays a black cursor, we also need to tell it to hide the cursor. That can be accomplished using a terminal escape sequence: ESC [ ? 2 5 l.
The option to make it full-screen is -fullscreen. However, it seems to work if you abbreviate the option to the shortest unambiguous possibility, -fu, saving 8 bytes.
The final code (48 bytes) is:
xterm -fu -e 'echo \x1b[?25lHello World!;scrot -d1'

(where \x1b denotes a literal ESC character, which takes 1 byte). By default, scrot writes the screenshot to a timestamped PNG file in the current directory.
It works on my system:

You missed some scrot options - I often use -s (interactively select window), but in this case you can use -u to grab the current (focused) window only.

Processing, 38 37
This might be considered cheating, but:
text("HeΠo World!",9,8);save(".png");

38 char solution:
text("Hello World!",9,9);save(".png");

Saves this image as .png:

Java - 340 339 292 261 239 236 233 chars
This outputs a file just called p with a transparent background and white text:
import java.awt.image.*;class R{public static void main(String[]y)throws Exception{BufferedImage b=new BufferedImage(80,9,2);b.getGraphics().drawString("Hello World!",5,9);javax.imageio.ImageIO.write(b,"png",new java.io.File("p"));}}

Here a properly-indented version. Should be pretty clear what is going on:
import java.awt.image.*;

class R {
    public static void main(String[] y) throws Exception {
        // 2 = BufferedImage.TYPE_INT_ARGB
        BufferedImage b = new BufferedImage(80, 9, 2);
        b.getGraphics().drawString("Hello world!", 5, 9);
        javax.imageio.ImageIO.write(b, "png", new java.io.File("p"));
    }
}

You might argue that white text in a transparent background is awful for reading and the file being called just p without the .png extension is awful too. So this longer variant version with 290 chars use red text and outputs a file called p.png:
import java.awt.image.*;import java.awt.*;class R{public static void main(String[]y)throws Exception{BufferedImage b=new BufferedImage(80,9,2);Graphics g=b.getGraphics();g.setColor(Color.RED);g.drawString("Hello world!",5,9);javax.imageio.ImageIO.write(b,"png",new java.io.File("p.png"));}}

That properly-indented:
import java.awt.image.*;
import java.awt.*;

class R {
    public static void main(String[] y) throws Exception {
        // 2 = BufferedImage.TYPE_INT_ARGB
        BufferedImage b = new BufferedImage(80, 9, 2);
        Graphics g = b.getGraphics();
        g.setColor(Color.RED);
        g.drawString("Hello world!", 5, 9);
        javax.imageio.ImageIO.write(b, "png", new java.io.File("p.png"));
    }
}

Do you need to use BufferedImage, or does Image work?

@Quincunx I need BufferedImage. The write method parameter is of type RenderedImage, so it won't compile with just Image without some cast.

Ah, that makes sense.

technically you can call the file "p" and still match the requirements, since the saved file will be a png even if the filename doesn't reflect that.

@TimB Ok, did that.

@Victor, am I correct in thinking that throws Exception throws an exception if something goes wrong in public static void main()? Can you add throws Exception to other methods/extension methods in Java? I haven't seen this in C# before.

@user-12506 Yes, you can add throws Exception to other methods, but the compiler enforce this rule: if you call a method that might throw a Throwable that is not a RuntimeException or an Error, then the compiler will require that you either catch or rethrow it, and this includes Exception. Further, although it is allowed, declaring throws Exception is a bad programming practice, because Exception is way too generic to be effectively handled in practice and rethrowing it just spread the bad practice to elsewhere.

@Victor thanks for explaining. I thought it looked like a cool way of handling exceptions. Good to know :)

@user-12506 It's called checked exceptions. Look it up. :)

@ntoskrnl it's unlikely I'll look into it too much. I've never been a big fan of Java's syntax. IAmMoreOfACSharpKindaGuy - notAnEverythingSeemsToBeginWithALowerCaseCharacterKindaGuy(noOffenseIntended) - :)

I've skinned over a few pages about checked exceptions and just from reading the first paragraph or two, everybody seems to talk about it in a negative undertone. A little disappointing. I will look into this more when I wake up.

@user-12506 Not everything is lower case in Java – classes are CamelCase just like in C#. Methods and fields are lowerCamelCase, and packages are alllowercase. Makes it somewhat easier to determine what a name refers to, in my opinion.

@ntoskrnl Yeah, things can and do get a bit confusing when classes, methods and other things are camel case. But in the case of methods, it either begins with an Identifier that allows you to immediately recognize it as such, and if you're calling a method, you'll know right away that it's a method because it ends in (); or (somethinginHere);. In C#, most things are CamelCase (when I'm typing anyway), except for variables. and (most) types. Either way, I'm going to have to get used to Java eventually. I've just started my first serious Android project.

Save 1 char - Heỻo world!

@Timtech, at least for me ỻ was rendered as a square in the resulting image. Here in the browser (using firefox), it renders as a box containing 1EFB. I strongly suspect that this is not portable.

Fortran 90, 104 94 bytes:
Aight, game on. Fortran 90, using the g2 graphics library and implict typing, so "d" is a real:
d=g2_open_gd('h',80.,12.,g2_gd_png)
call g2_string(d,1,1,'Hello world!')
call g2_close(d)
end

Needs to have the g2 library installed, then just compile with
gfortran -lg2 -fsecond-underscore p.f90

Thanks Kyle Kanos for suggesting to drop "program p"!
I'm pretty satisfied that I beat C#, C + Cairo, Java, Javascript, Python and Ruby! And now also Perl!
Example output:

This can be shortened to 93 characters by eliminating program p as it is not necessary (the only necessary part of a F90 code is end).

R, 52 39 chars
png()
frame()
text(.5,1,"Hello World!")

Saves as Rplot001.png in current directory. To be run as a script in non-interactive (batch) mode.
Thanks to Sven Hohenstein and Michael Hoffman for updates!

I count 52 characters...

@SvenHohenstein sorry you are correct. I made a mistake while attempting shorter versions (they didn't work).

dev.off() is unnecessary when you run this as a script instead of interactively.

PHP + gd2 - 86 bytes
<?imagestring($i=imagecreatetruecolor(97,16),4,2,0,'Hello world!',65535);imagepng($i);

imagecreatetruecolor is used instead of the shorter imagecreate, because colors can used directly without having to allocate them with imagecolorallocate. 65535 corresponds to hex color #00FFFF, a.k.a. cyan. I could have used 255 for blue, but it's fairly hard to see on a black canvas.

If the requirement that the background must be white or transparent is to be strictly enforced, I think the best that can be done is 98 bytes:
<?imagestring($i=imagecreatetruecolor(97,16),4,2,0,'Hello world!',imagefilter($i,0));imagepng($i);

The 0 sent to imagefilter is the value of the constant IMG_FILTER_NEGATE, which of course negates the image. The result, 1, is then used as the paint color (#000001):

Another option at 108 bytes:
<?imagestring($i=imagecreatetruecolor(97,16),4,2,imagecolortransparent($i,0),'Hello world!',1);imagepng($i);

Setting black to be transparent, and drawing with #000001 instead.

PHP + No Library - 790+ bytes
<?
echo pack('CA3N2',137,'PNG',218765834,13);
echo $ihdr = pack('A4N2C5','IHDR',45,7,1,0,0,0,0);
echo hash('crc32b',$ihdr,true);
$data =
  '--------0  0      0 0                        0    0 0---'.
  '--------0  0      0 0                        0    0 0---'.
  '--------0  0  00  0 0  00    0   0  00  0 0  0  000 0---'.
  '--------0000 0  0 0 0 0  0   0   0 0  0 00 0 0 0  0 0---'.
  '--------0  0 0000 0 0 0  0   0 0 0 0  0 0    0 0  0 0---'.
  '--------0  0 0    0 0 0  0   0 0 0 0  0 0    0 0  0  ---'.
  '--------0  0  000 0 0  00     0 0   00  0    0  000 0---';
$bytes = join(array_map(chr,array_map(bindec,str_split(strtr($data,' -',10),8))));
$cmp = gzcompress($bytes);
echo pack('N',strlen($cmp));
echo $idat = 'IDAT'.$cmp;
echo hash('crc32b',$idat,true);
echo pack('NA4N',0,'IEND',2923585666);

Ahh, that's better. No bloat; exactly as much as required, and not a chunk more.
The result is this 109 byte png:

Or, URI encoded (which seems to be trending...) at 168 bytes:
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC0AAAAHAQAAAAC0VvlnAAAANElEQVR4nGPIv/7//+8LDFAq51r15mgBBu7Q3Wu1LjBkhO5aW3WBIfsqkLrBkBNWW1wtAACw2RlgLInRogAAAABJRU5ErkJggg
Supposing we wanted to cut that down a bit more, let's say we replace the data string with this:
$data =
  '--------0  0      0 0                    0   0 0'.
  '--------0  0  00  0 0 000   0   0 000 00 0 000 0'.
  '--------0000 0 00 0 0 0 0   0 0 0 0 0 0  0 0 0 0'.
  '--------0  0 00   0 0 0 0   0 0 0 0 0 0  0 0 0  '.
  '--------0  0  000 0 0 000   00 00 000 0  0 000 0';

(and update the header to the new dimensions, 40x5), the output would be this 96 byte png:

Which URI encodes to 150 bytes:
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAFAQAAAAAft5MoAAAAJ0lEQVR4nGPIv/7//y6GnCvlLosYuEJLQ1cxZF4tDV3NkBNS5LoIANqBDTt5Av0NAAAAAElFTkSuQmCC
I think that's about as small as you're going to be able to get, and still be considered "human readable".

Further Analysis
You may have noticed that we've been toting along an extra byte at the beginning of each scanline (denoted by --------). This isn't solely for decoration. Each byte specifies the filtering used by each scanline. According to the PNG specification, "Filtering transforms the PNG image with the goal of improving compression." So let's try that.
The are five different filtering operations which can be applied independently to each scanline. The PHP implementation that I used for each can be seen here: http://codepad.org/xCQpBPC3 where $bytes represents the raw bytes for the current scanline, and $prior represents the raw, unfiltered bytes for the scanline above the current.
Let's start with the first 45x7 image. Seven scanlines each with 5 different filterings makes 78125 different possibilities to grind through. The initial encoding of the data block was 52 bytes in length, and after a bit of grinding zlib found a one byte improvement using filtering pattern [1, 1, 1, 1, 0, 0, 0] (that is, the first four scanlines with Sub filtering, and the last three unfiltered). The result is this 108 byte png:

Which of course looks identical to the last. But I'm not convinced that zlib is producing the best possible encoding, and I think i have good reason to be skeptical. I decided to try AdvanceComp (which uses the same DEFLATE engine used for 7-zip), and Zopfli, an implementation which claims to "find a low bit cost path through the graph of all possible deflate representations." Sure enough, Zopfli mananged to compress the same data data pattern [1, 1, 1, 1, 0, 0, 0] down to 50 bytes, producing this 107 byte png:

Once again, visually identical. (As a point of interest, it should probably be mentioned at this point that AdvanceComp with the setting -z3 (compress-extra (7z)) didn't manage to find anything shorter than 60 bytes - the data was left uncompressed. It seems it refuses to compress anything this short). The above URI encodes to 165 bytes:
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC0AAAAHAQAAAAC0VvlnAAAAMklEQVR4AWPMz9Bg+HMVRuVkLbVYsZWR2yvtU+0yhozQXWurLjBkXwVSNxhywmqLqwUA+IMVKa7QjrYAAAAASUVORK5CYII
Fully 11 bytes shorter than squeamish ossifrage's attempt at more or less an identical image.
Onwards to the 40x5 image. Five lines with 5 filterings each means we only have 3125 possibilities this time. The original encoding was 39 bytes in length, and with a bit of grinding, zlib found quite a few 38s. The one I've chosen is [1, 0, 0, 2, 0], which contains the largest number of unfiltered lines, and Sub and Up filters on lines 0 and 4, which are the simplest. Zopfli wasn't able to improve this result any further. The result is this 95 byte png:

Which URI encodes to 149 bytes:
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAFAQAAAAAft5MoAAAAJklEQVR4nGPMz9Bg2M2Qc6XcZREDV2hp6Cqm+AYGBkaGnJAi10UAju4JJ/1zkEIAAAAASUVORK5CYII
You might be tempted to think that the last 18 or so bytes of this aren't necessary. After all, this 121 byte URI will still display correctly, at least in Chromium:
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAFAQAAAAAft5MoAAAAIUlEQVR4nGPMz9Bg2M2Qc6XcZREDV2hp6Cqm+AYGBkaGnJAi10U
But if you save it to a file, it will break in very many image viewers. In fact, any compliant decoder is required to report an error. So what have we chopped off?
From end towards beginning:

4 bytes - CRC32 for IEND chunk (always 0xAE426082)
4 bytes - IEND chunk marker (always IEND)
4 bytes - IEND chunk length (always 0x00000000)
4 bytes - CRC32 for IDAT chunk
4 bytes - Adler32 for zlib data
1 byte - Stop marker for zlib data

Additionally adjusting the IDAT length marker down by 5 (to compensate for the bytes we deleted) seems to "fix" the image in Windows Previewer.

The question state that it should have a white or transparent background. I myself think that the rules should be relaxed to allow black too, but for now, it fails the spec at this point.

@Victor Unfortunately, the gd2 library - as exposed by PHP, at least - doesn't have an option to specify the default color. Setting black to be transparent does work, though. Or simply to negate the entire image before adding the text.

make a PNG image that says "Hello world!" …

You'll hopefully excuse my very loose interpretation of the above requirement. :)
OSX bash:
printf '"Hello world!" and nothing else on a distinguishable background using only an image making API (eg ImageMagick) and return the image.' > hello.png
say -f hello.png

But it's not a PNG image, is it?

Well, it's technically a .png file, and it does say what is needed. :-)

PNG image is not "ASCII text, with no line terminators", as said by file. It's a .png file, but not PNG image.

Fail point. I didn't manage to find a way to fool the file utility by pre-pending the whole thing with the relevant code (i.e. decimals 137 80 78 71 13 10 26 10). Perhaps you might know of a way? ;-)

seems you'd need to make full header with all information like dimensions, palette etc., because file prints this information. With your relevant code it only says "data".

Octave, 47
axis('off')
title("Hello World!")
print -dpng x.png

-1 until you remove the axes (I think it would be axis('off'), not sure, see here) It would also be nice if you attached the generated output as well.

+1 now :D  why bother keeping the bigger/broken ones though...

C + Cairo: 238 221 202 bytes
#include <cairo/cairo.h>
main(){cairo_surface_t*s=cairo_image_surface_create(0,99,50);cairo_t*c=cairo_create(s);cairo_move_to(c,0,9);cairo_show_text(c,"Hello world!");cairo_surface_write_to_png(s,"o");}

$ cc `pkg-config cairo --libs --cflags` mini.c && ./a.out && display o
Here is the un-minified version:
#include <cairo/cairo.h>
void main (int argc, char* argv[])
{
    cairo_t *cr;
    cairo_surface_t *surf;
    surf = cairo_image_surface_create (0, 99, 50);
    cr = cairo_create (surf);
    cairo_move_to (cr, 0, 9);
    cairo_show_text (cr, "Hello world!");
    cairo_surface_write_to_png (surf, "out.png");
}

Best enjoyed while listening to this song :)

You can save some chars by removing the type declaraction, i.e. the void for main and the int for x, and possibly the char for **a (I'm not sure about the last one though). In C the type is default to be int if no type is specified, and you don't necessarily need to return a value for int main. This may produce compilation warning messages, but not errors and the program will still work.

Shaved 17 bytes by removing the pointless #define C(n,...) …. Also, main returns int, not void (and as of C99 it's not required to explicitly "return 0" at the end of main; the implementation implicitly adds it for you).

@ace Thank you! I had forgotten that types defaults to int i C. But it looks like it's all-or-nothing; you can't have some variables in the call signature use default types while others don't. So I just changed it to main() and hardcode the filename to o instead of passing it to main. Now it's smaller than the Java version :)

@Quuxplusone Thanks! Did not know that C99 add an implicit return 0 to main if not already there. That was why I choose to (incorrectly) return void instead of int. Since you got rid of the vararg macro, C99 is not required to compile the code anymore. Which makes it more portable to compilers who's vendors has chosen to not implement C99 [read: Microsoft] :)

Javascript! 105 104 101
c=document.createElement('canvas');open(c.toDataURL(c.getContext('2d').fillText('Hello world!',0,9)))

Outputs this size-optimized and pretty image:

TI-BASIC, 22
Text(0,0,"HELLO WORLD!

White background. Use TI-Connect if you wish to retrieve it from the calculator. Resulting PNG:

Why the downvote? Produces a .PNG image with the text HELLO WORLD!

While I don't know for definite, I'm going to assume that Ti-Connect generates and outputs the PNG here.

@slackwear That's for transfer, it's already on the calculator.

There's a PNG file on the calculator?

@slackwear Yes, used by the graph. System variables are Pic1 through Pic9. PNG file is 94 by 62.

The calculator may have a 94 by 62 bitmap, stored in its own uncompressed format. I'll put my money on Ti-Connect converting it into a PNG when it's retrieved.

Can you post the resulting PNG?

This does not produce a .png image in the calculators memory. Retrieving it from the calculator converts it to a .png image.

Personally, I think this is like displaying Hello world! on my computer screen and then saying "Oh, but I can easily convert it to a .png by taking a screenshot of it!"

Ruby, 138
I'm golfing this hole with just my putter.  (I chose a PNG library without fonts or a string draw method.)
require'chunky_png';i=ChunkyPNG::Image.new 34,4
136.times{|v|i[*(v.divmod(4))]=9*(0xb0fae0f02e0eae0ece00eae0f0f0bf0f2f&1<<v)>>v};i.save ?h

Actual output is 34x4 pixels.  (Enlarged below.)  This plots very, very small and nearly transparent hand-drawn chars onto a very small transparent background. Image is saved to a PNG file named h.

Would it be shorter in Ruby to store 0xb0... in Base64 and call a decode function?

@Mechanicalsnail, I think that would require another require and then some, so the savings would be blown. I think.  I did look at Base 36 (since that can be done with to_i alone) but that ends up a bit longer.

BASH + RST + ImageMagick = 43 chars
Just for fun, here's another (quite ugly) one:
echo 'Hello World!'|rst2pdf|convert - a.png

Output:

Gnuplot
Not really a true competitor, just for fun.
(homepage)
#!/usr/bin/gnuplot
set terminal pngcairo
set output "hw.png"
set label "Hello\nWorld!"
unset xtics
unset ytics
set yrange [-1:+1]
plot -1 notitle

or, as a oneliner (thanks to Phil H): 74 characters
se te pngc;se ou "q.png";se la "Hello world!";se yr[-1:1];uns ti;pl -1 not

You can shorten each of those commands to the minimum unique stub - so set te works, and set out etc. And you only need the top line to make it executable in the terminal, which is not a usual code golf requirement. So: se te pngc;se ou "q.png";se la "Hello world!";se yr[-1:1];uns ti;pl -1 not - 74 chars

@Phil H: yeah, sure, thanks ;-) Actually I knew commands could be shortened, but as this contrib wasn't really designed to compete with more efficient solutions, I thought I might as well show full length commands for educational purposes.

Data URI: 446
Following Chloe's idea, applied some basic optimisation to the image.
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEEAAAALCAAAAAAFX7+TAAABBUlEQVQoz2P4Tylg+M8IohiRRUCIkC6E0sFlwhFBJo5kmPAdWSYmuTsgGa6y/3pMf/8yLYEJMcQwARXckmZi8YCawAAG//8L537ZxbEMaoKCwuvXCkogE2y0/nMyL1vC/BcmxKC6AqhAXurBc1kGkNUINzCBDIqFmsB84f//c8wgmcVs91j13d3U4EIMl0AKmM78/38GqJQXyQSWQ///H3sJMwGo7ALYhL/MQUq1wkK1cCEGsE+ZgSacAzKNkUxQ1/kygfEczBeKb18rKICDS4U58SUT8ye4EMQEBelHz+WAzEokE+6IM7HkI4ekLDgk/5cxnPrPK/4fLgQxARSSUdCQpBQAAFZKE8rQG60FAAAAAElFTkSuQmCC
Might be able to hack it further, but then would not be a perfectly conformant PNG and some viewers may not display it correctly.

Could you explain what kind of optimizations did you perform?

PNG2, stripped optional chunks, optimal (not streamed) compression

If you reduce the font size slightly, remove the spacing, the actual binary size of the image would be smaller than some of the posted solutions.

@OrangeDog I got it down to 179: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC0AAAAHAQAAAAC0VvlnAAAAOklEQVR4nGLIv/57/+9rDGDqAkPOterN 0YIM3KG712pdZcgI3bW26gZD9lUwlRNWW1wtAAAAAP//AwCcyhjs3+7tWQAAAABJRU5ErkJggg==

@squeamishossifrage That doesn't load in Firefox for me.

@OrangeDog Oops, should be 178. Try without the line break.

Still not working

@OrangeDog: Stack Exchange comments seem to insert U+200B and U+200C into the comment. It works in Firefox once I strip them out.

Actually, the pad = characters are optional in Base64, giving 177 chars.

Can you add a working one to the answer?

Python and Matplotlib - 66 65 chars
from pylab import*;title('Hello world!');axis('off');savefig('X')

Bit of whitespace, but it has the text and nothing else.  File is saved as X.png:

from pylab import*

@Timtech thanks, I'm a golfing noob clearly ;)

I think you did a great job!

Perl, 95:
The whole command incantation:
perl -MGD::Simple -e'$i=new GD::Simple;moveTo$i 9,50;string$i "Hello world!";print$i->png'>.png

Because of (reasonable) module defaults, it's 95 characters (or 92 if single letter file name allowed).
On Windows we need to binmode STDOUT, the shortest way I think can be -M-encoding+ get rid of double colons:
perl -MGD'Simple -M-encoding -e"$i=new GD'Simple;moveTo$i 9,50;string$i 'Hello world!';print$i->png">.png

i.e. 105

Python with PIL 122 Chars
from PIL import Image,ImageDraw;d=Image.new("RGB",(70,9));i=ImageDraw.Draw(d);i.text((0,0),"Hello World!");d.save("a.png")

It could probably be much smaller but I haven't worked with PIL extensively and made this in 5 minutes.
Output:

You beat me to it by 10 minutes! With about 10 less chars! +1 :D Lose another char by going from 10 to 9 in your new, but you left out the !.

The question state that it should have a white or transparent background. I myself think that the rules should be relaxed to allow black too, but for now, it fails the spec at this point.

Couldn't you save lots of characters with from PIL import*?

You would expect so, but you have to import them individually or else you get a not defined error from PIL import Image,ImageDraw;d=Image.new("RGB",(66,10));i=ImageDraw.Draw(d);i.text((0,0),"Hello World");d.save("a.png") NameError: name 'Image' is not defined

Ghostscript command line incantation, 84 (i.e. Postscript) :
 gs -sDEVICE=png16 -oa.png -c '/ 72 selectfont 9 9 moveto(Hello world!)show showpage'

Missing font message is intentional ;-). And proper (i.e. not hidden) name for our PNG file, too :-)

Python, with 118 115 117 116 114 chars
Here's a full criteria passing with white text on alpha background at 116 114 chars!:
from PIL import Image,ImageDraw as D
m=Image.new("LA",(99,9))
D.Draw(m).text((9,0),'Hello World!')
m.save('r.png')

(You can replace newlines with semicolons - count is the same regardless.)

ImageDraw as D, and then D.Draw saves 3 chars.

Bash + DOT, 46 41
dot -Tpng<<<'graph{label="Hello World!"}'

This outputs a png into the standard output. It is saving a file, but I don't think that was a requirement.
Outout:

I we allow them be in ellipses, it can be 8 chars shorter...

I am not sure whether you should add the bash chars as well for compiling this dot script. This adds dot -Tpng -op d, which is 15 chars.

You should count the command line options/argument if they are needed to make your program solve the task. Normally the dashes are not counted, so I think you only should add Tnpg, op and d to the character count (+7), and specify how to run it in the answer itself.

It can be better if you don't echo but instead write it in a file and run dot -Tpng on the file; it makes it 38, but I don't know if it counts...

Why would it not count?

Hans, I decided for fair play :) Golf it down to 41 with the improvement I suggested in my answer: dot -Tpng<<<'graph{label="Hello World!"}', I will delete my answer then. These derivations shouldn't be done in fair play and should stay as a comments to original answers.

Updated according to Tomas' suggestion.

PureBasic - 128 chars
UsePNGImageEncoder()
CreateImage(0,99,24)
StartDrawing(ImageOutput(0))
DrawText(0,0,"Hello World!")
SaveImage(0,"a.png",4673104)

Not the shortest here, but I have to support my favorite Basic language :)
edit: just in case there is a complain about the black background, at 133 chars:
UsePNGImageEncoder()
CreateImage(0,80,16)
StartDrawing(ImageOutput(0))
DrawText(0,0,"Hello World!",0,-1)
SaveImage(0,"a.png",4673104)

Rebol/View 45
save/png %i to-image layout[h1"Hello World!"]

writes a png image file named i into current directory

bash + netpbm: 31 chars
pbmtext "Hello world!"|pnmtopng

Will make:

Internet 11
Internet is an API!
ow.ly/thgUJ -> http://dummyimage.com/99x9/f/0.png&text=Hello+world!

Clever! Google charts is more readable ;) http://chart.googleapis.com/chart?cht=tx&chl=Hello%5C+world%21

Matlab: 47 characters
I'm not sure what exactly an Image making API is.  This uses a figure/graph making API, which is arguably an image.
text(1,1,'Hello World!');axis off;print -dpng f

EPL, 28
0,0,0,1,1,1,N,"Hello World!"

Can you show the output?

Chloe used a Base64 encoded approach with 1494 characters, however you can easily reduce the size:
Anchor link - 166 chars
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD8AAAAFAQAAAADaxQm5AAAAM0lEQVQIW2Mo0a+w3iKQz8NQ+r56r+71/BIGlnwg40J+GUhkz9lr78sYShQ57O6IKfIAAJypEkNzAX3zAAAAAElFTkSuQmCC
Paste this into your browser

157, see: http://codegolf.stackexchange.com/a/19828

Bash, using Google's chart API: 92 characters
curl http://chart.googleapis.com/chart?chst=d_text_outline&chld=|9|h|||Hello+world! > h.png

Further optimization: 33 characters
curl http://goo.gl/a8ntA4 > h.png

Don't know if the "further optimization" counts, as it caches data in the cloud in the form of a shortened URL service, which allows one to make a script of arbitrary size and complexity to solve this problem that never requires more than 33 characters to represent.

Yeah, I wouldn't think using a URL shortener is very kosher for this. :-)

I have a shorter solution: cat image.png > h.png where image.png is the result of curl http://goo.gl/a8ntA4 > image.png!!!

MATLAB, 41 chars
@gerrit posted a MATLAB solution as well, but since I don't have enough rep to comment, I'll post mine too. (The output is the same as his, so I don't want to take up more space with the resulting PNG).
axis off,title 'Hello world!',print -dpng

Groovy, 133
Not going to win any points for size here as it's just an abbreviated Java.
No color setting:
i=new java.awt.image.BufferedImage(75,30,2);i.graphics.drawString('Hello World',5,20);javax.imageio.ImageIO.write(i,'PNG',System.out)

With setting color (164):
i=new java.awt.image.BufferedImage(75,30,2);g=i.graphics;g.color=java.awt.Color.RED;g.drawString('Hello World',5,20);javax.imageio.ImageIO.write(i,'PNG',System.out)

Formatted:
i = new java.awt.image.BufferedImage(75,30,2)
g = i.graphics
g.color = java.awt.Color.RED
g.drawString('Hello World',5,20)
javax.imageio.ImageIO.write(i,'PNG',System.out)

Here is a cool trick, only 37 chars:
placehold.it/png/99&text=Hello+world! (+7 chars for the protocol).
This generates a 239 bytes long png image with 99px of width and height.
I know it's not programming, but this is a website that generates placeholder images.
You should visit http://placehold.it.

similar to http://codegolf.stackexchange.com/a/20019

Similar, but WAAAAAAAAAAAAY shorter and a totally different website. dummyimage.com is bigger than placehold.it

http://cambelt.co/300/Hello+world! and http://fakeimg.pl/99/?text=Hello+world! are even shorter. Should I post two more answers with them? No. Multiple answers using the same language and principles are boring. If you have improvement for existing answer, please post it as comment.

If you didn't downvoted, perhaps I could get enough reputation to make comments on other posts!

Ah, that is indeed a good reason for not posting comment. Revoked the vote. (I had to make and edit to your post to be able to change my vote.)

Groovy, 151 (or 202 with a black text)
a rewrite of the proposed Java version. Resulting image is with white text on a transparent background. Add 50 chars to have black text !
import java.awt.image.BufferedImage as B
B b=new B(80,9,2)
b.graphics.drawString("Hello world!",5,9)
javax.imageio.ImageIO.write(b,"png",new File("p"))

The version with black text:
import java.awt.*
import java.awt.image.BufferedImage as B
B b=new B(80,9,2)
b.graphics.with {setColor(new Color(0)); drawString("Hello world!",5,9); }
javax.imageio.ImageIO.write(b,"png",new File("p"))

Could you please post the resulted image? By the way, are all those spaces necessary in the code?

image posted and useless spaces removed

Ruby 192 chars:
I use RMagick RVG (Ruby Vector Graphics).
require 'rvg/rvg';include Magick;RVG::dpi = 72;RVG.new(1.5.in, 1.5.in){|canvas|canvas.background_fill = '#C0C0C0';canvas.text(10, 100){|title|;title.tspan("Hello World!")}}.draw.write('hw.png')

output:

Shell + Graphviz (55)
echo 'graph{a[label="Hello World!"]}'|dot -Tpng>h.png

@Timtech I don't know what shell you're using, but the ! works fine for me in bash and doesn't need to be escaped.

That's really weird - all I did was add four spaces in front of your answer to format is correctly. I see what you mean, though O_o I don't remember doing that at all :S

alright, well I'm going to remove it then :)  Thanks for getting the code formatting, not sure how I missed it..

It's fine - I usually do that kind of stuff whenever I see it :)

You can get away with echo 'graph{"Hello World!"}'|dot -Tpng>a.png, which is 44 characters...

...but you should really get rid of the ellipse, which you can do with echo 'graph{"Hello World!"[shape=plaintext]}'|dot -Tpng>a.png, which is 61 characters.

Mouse: 0 chars
"right click" > "save image as"
Result:

Where is the “with programming APIs” part here?


text:
Password Generator
Task:
Make a program that generate a 24-digit password.
Rule:

None of the character can be repeated more than once
Must include at least one upcase, one locase, one number, five special character.
The answer which got most votes win.

SPECIAL CHARACTER LIST:
`~!@#$%^&*()_+-={}|[]\:";'<>?,./ or other

Looks like I edited the post at the same time as you. Did you change "most votes" into "50 votes the earliest"? If yes, then I think my edit has undone that. Also, if you really did that edit, then I don't think that's a good criteria. It is also possible that an answer doesn't get 50 upvotes at all.

Yes, @ProgramFOX.

But I Added This:None of the character can be repeated more than once

bash
You might need to tune A-M by increasing or decreasing the range to meet specs.
ls -al ~ | grep -o . | tr -d A-M | sort | uniq | head -n 24 | xargs | sed 's/ //g'

E.g:
$ ls -al ~ | grep -o . | tr -d A-M | sort | uniq | head -n 24 | xargs | sed 's/ //g'

+-.0123456789:@OPSTU_a

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

sort: votes


text:
Write a program that says how many times it was ran
Write a program that after running will show how many times it was ran before. You are only allowed to modify the executable itself (the code itself, or compiled version of your code), you cannot modify anything else or create new files.
Example:
$ ./yourprogram
0
$ ./yourprogram
1
$ ./yourprogram
2

Somewhat less trivial example than y'old bash, in C:
#include <stdio.h>

int main(int argc,char **argv){
    const char *data="Da best marker in da world 0\0\0\0\0\0\0";
    FILE *f;
    int i;
    char c;
    long int pos;
    printf("%s\n",data+27);
    f=fopen(argv[0],"r+b");
    i=0;
    c=fgetc(f);
    while(!feof(f)){
        if(data[i]==c){
            i++;
            if(i==27)break;
        } else i=0;
        c=fgetc(f);
    }
    if(i!=27)return 1;
    i=0;
    pos=ftell(f);
    c=fgetc(f);
    while(c!='\0'){
        i=10*i+c-'0';
        c=fgetc(f);
    }
    i++; //The increment!
    fseek(f,pos,SEEK_SET);
    fprintf(f,"%d",i);
    fflush(f);
    fclose(f);
    return 0;
}

How were you able to post an answer?

I posted my answer just before the question was closed :)

Are you sure? I guess this is a bug with my browser then because at first I just saw the question flagged as a duplicate with 0 answers. And then after 30 min I saw the answer posted.

I don't know. As far as I know, I posted the answer while there was stilll another bash answer and while the question wasn't yet closed. Anyway.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
Write a brainfuck translator
In any programming or scripting language x, write a program that takes a valid brainfuck sourcecode from stdin and output, to stdout, the sourcecode of a program, written in language x, that would output the exact same thing as the brainfuck program would do.
Your program must work for any valid brainfuck program, including the empty file.
Your score would be equal to the byte count of your sourcecode, plus the byte count of your output given the following input:
+++++ [-]
+++++ +++++ [
    > +++++ ++
    > ++ +++ ++++ +
    > +++
    <<< -
]
> ++ . H
> + . e
++ +++ ++. l
. l
+++ . o
> ++ . space
< +++++ +++ . w
----- --- . o
+++ . r
---- - - . l
----- --- . d
> + . exclamation mark
------lol; useless code :-)--------------------------[.............................................][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]<-<<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

For example, for an input of [-], the output of *p=0; is much more favourable than while(*p) *p--;
If you happen to use non-ASCII characters, the byte count must be calculated using the UTF-8 encoding.
Lowest score wins. However, creative solutions that attempt to minimise the output shall be encouraged by upvotes.

You might want to add a clause that the target language not also be brainfuck ;)

@Josh well, if someone managed to write a short brainfuck program that removes unnecessary useless codes, why not let them do it?

Well quite simply because the trivial solution of outputting the source unchanged is going to have a really low score anyway for brainfuck. I will be surprised if another language can beat that.

@Tim Seguine I could change the question, but would that be unfair to those who have already provided an answer? And if I change the question, I'm thinking about changing the score calculation, making it byte count of source + (byte count of output)^2, would that encourage people to focus more on simplifying the output?

Generally changing a question like that after it has already been answered is frowned upon. I was just pointing out a reason why I think Josh was right. It's good to post stuff like this in the sandbox first, so you can work out potential problems while being fair to everyone.

@Tim Seguine I'm hoping someone can come up with some clever way to minimise the output so as to win this. I mean, the given input essentially is just print "Hello world!", if someone can reduce the output to, say, 200 bytes then even if their program is 300 bytes long they may still beat the current brainfuck solution

What about variants of brainfuck like pbrain? Technically not doing any translation at all is perfectly valid, yet at the same time there exists the opportunity to optimise.

There's a pretty easy way to make it to less than 540+5 bytes (not in BF though) in a lot of languages, including PHP and JS. I'll investigate this further today, but given the example that you have to count as part of the bytecount, I can find a trivial solution.

@FIQ looking forward to it :)

@ace posted it, it's worse than my BF program currently, but that's because the script itself isn't very golfed down at all, the actual resulting script is minimal (for the test case anyways ;) ).

@FIQ nice thinking, I like it

Your scoring criterion is not precisely the source byte-count, so -- according to the blurb for the code-golf tag -- the code-golf tag should not be used, and the code-challenge tag should be used instead.

Perl - 177 (source) + 172 (output) = 349
#!perl -p0
y/-+><.,[]
-~/p-w/d;s/(.)\K\1+|rs|wv[^v]*(?=w)/$+&&length$&/ge;$_="eval'r$_'=~".'s/.(\d*)/(qw(--$ ++$ -- ++ print+chr$ $$i=ord+getc; while($$i){ })[$&&v63].q($i;))x($++1)/ger'

Counting the shebang as 2 bytes, one for each option. First, each of the eight commands is translated onto the range p-w, while at the same time removing all other characters. This string is then run-length encoded and output with a minimal decoder/interpreter. A few things are optimized away: the string >< obviously does nothing, and a for loop that follows directly after another may be removed entirely, as it will never be entered.
Output for the test program:
eval'rq4vpwq9vrq6rq9rq2s2pwrq1trqtq6t1q2trq1tsq7tp7tq2tp5tp7trqtp32vt44wsps1'=~s/.(\d*)/(qw(--$ ++$ -- ++ print+chr$ $$i=ord+getc; while($$i){ })[$&&v63].q($i;))x($++1)/ger

A sample run:
$ perl brainfusk.pl < in.bf | perl
Hello world!

Perl - 232 (source) + 21 (output) = 253
#!perl -p0
y/-+><.,[]
-~/0-7/d;$_="eval'2$_'=~".'s/./qw(--$ ++$ -- ++ print+chr$ $$i=ord+getc; while($$i){ })[$&].q($i;)/ger';
/5/||fork?(wait,$?||exit):($SIG{ALRM}=sub{exit 1},alarm 9,$S=select(open 1,'>',\$o),eval,print$S "print\"\Q$o\E\"")

This one is based on FIQ's observation that if the original program doesn't contain an input statement, the output will be static, and therefore can be reduced to a single print statement. If you like this one, be sure to give his answer a +1.
So what we can do is pipe stdout to a variable, eval the code we would have output, and wrap the result in a print.
...that won't always work, though. Whenever the code to be translated would have resulted in an infinite loop, (e.g. +[.]), this cannot be reduced to a single print statement, for obvious reasons. So instead, we launch the eval in a child process with a short timeout, and if it doesn't finish executing within that time we output the translated program as before.
Structured and commented:
if(!/5/) { # no `,` in program

  if(fork) { # parent process

    # wait for child
    wait;
    # no child error, terminate without output
    $?||exit

  } else { # child process

    # alarm handler, exit with error
    $SIG{ALRM}=sub{exit 1};
    # set an alarm in 9 seconds
    alarm 9;
    # redirect STDOUT to variable $o
    $S=select open 1,'>',\$o;
    # execute translated code
    eval;
    # wrap the result in a print statement
    print$S "print\"\Q$o\E\""
  }
}

Output for sample program:
print"Hello\ world\!"

Output for ,[.]:
eval'25647'=~s/./qw(--$ ++$ -- ++ print+chr$ $$i=ord+getc; while($$i){ })[$&].q($i;)/ger

Output for +[.] (after 9 seconds):
eval'21647'=~s/./qw(--$ ++$ -- ++ print+chr$ $$i=ord+getc; while($$i){ })[$&].q($i;)/ger

This is amazing! Brain hurts :)

I think wv.*?(?=w) is wrong. I think it will only remove code up to the next ], but you need it to find the matching ]; you need to take care of nesting...

@Timwi Fixed, by ignoring the nested cases wv[^v]*(?=w), which is significantly shorter than the alternative.

Brainfuck, 5 + 540 = 545 bytes
5 bytes of code, 540 from output of given test file (assuming  got the count right from my paste of that code).
,[.,]

Assuming EOF is 0.

@primo since it doesn't reset before reading a interpreter that does not chaneg value at EOF will make this program an endless loop for all input larger than 0 bytes.

I cant help to wonder, what software is used to run this stuff? xD

@TeunPronk There's a brainfuck interpreter called bfi  (https://github.com/susam/bfi). Just compile and install it, and run it like so: bfi input.bf where input.bf is the brainfuck file to be interpreted.

PHP, 553 + 27 = 580 bytes
(553 bytes with all whitespaces, i.e. newlines and spaces, removed)
I suck badly at golfing PHP, so this approach can be heavily optimized. I mostly wanted to show my approach to the solution in something not BF.
<?php
echo "<?php ";
$x = 'if (!$b) $c = $_GET[c];
$x=$y=$n[0]=$p=0;$o[0]=1;$d="";
while($a=$c[$x++]){
    if($o[$p]){
        if($a=="-")$m[$y]--;
        if($a=="+")$m[$y]++;
        $m[$y]=$m[$y]%256;
        if($a=="<")$y--;
        if($a==">")$y++;
        if($a=="."){
            $e=chr($m[$y]);
            if ($b) echo $e;
            else $d.=addslashes($e);
        }
        if($a==",")$m[$y]=($b=$_GET[i])?ord($b):0;
    }if($a=="["){
        $p++;
        $n[$p]=$x-1;
        $o[$p]=$o[$p-1]?$m[$y]:0;
    }
    if($a=="]"){
        if($o[$p])$x=$n[$p];
        $p--;
        if($p=-1)$p=0;
    }
}
if (!$b) echo "echo \'$d\';";';
if (strstr($_GET['c'],",")) {
    $x = '$b=1;'.$x;
    echo '$c="'.addslashes($_GET[c]).'";'.$x;
    return;
}
eval($x);

Error reporting must be off, otherwise PHP will hate you. Usage: throw this up as a page, and run it with script.php?c=CODE (if the resulting script requires input, you run it as out.php?i=INPUT). Remember to url escape the input!
What this does is basically this - if the BF script contains ",", it pretty much embeds itself as the resulting script with an attached $b=1; at the top. If it does NOT contain ",", it optimizes it down to "echo '<BF output>'". Conveniently, the test script in the OP does NOT require any input.
The addslashes() is just there for escaping ' and \.

C++, 695 + 510 = 1205 bytes
Code:
#include<iostream>
#include<utility>
#include<vector>
#define D "\n#define "
using namespace std;using S=string;int main(){vector<pair<S,S>>m={{"--------","(*p)-=8;"},{"<>",""},{"[]","F;"},{"+","A;"},{"-","B;"},{">","C;"},{"<","D;"},{"[","F{"},{"]","}"},{".","E;"},{",","std::cin>>*p;"}};S s;char c;while(cin>>c)if(S("+-><[].,").find(c)<8)s+=c;for(int i=0;i<s.length();i++)if(s.substr(i,4)=="[][]")s=s.replace(i--,4,"[]");cout<<"#include<iostream>" D"A ++*p" D"B --*p" D"C p++" D"D p--" D"E std::cout<<*p" D"F while(*p)\nint main(){char*p=new char[1<<19]();";while(s.size())for(auto p:m)if(s.substr(0,p.first.length())==p.first){s=s.substr(p.first.length());cout<<p.second;break;}cout<<"}";}

Output:
#include<iostream>
#define A ++*p
#define B --*p
#define C p++
#define D p--
#define E std::cout<<*p
#define F while(*p)
int main(){char*p=new char[1<<19]();A;A;A;A;A;F{B;}A;A;A;A;A;A;A;A;A;A;F{C;A;A;A;A;A;A;A;C;A;A;A;A;A;A;A;A;A;A;C;A;A;A;D;D;D;B;}C;A;A;E;C;A;E;A;A;A;A;A;A;A;E;E;A;A;A;E;C;A;A;E;D;A;A;A;A;A;A;A;A;E;(*p)-=8;E;A;A;A;E;B;B;B;B;B;B;E;(*p)-=8;E;C;A;E;(*p)-=8;(*p)-=8;(*p)-=8;(*p)-=8;B;F{E;E;E;E;E;E;E;E;E;E;E;E;E;E;E;E;E;E;E;E;E;E;E;E;E;E;E;E;E;E;E;E;E;E;E;E;E;E;E;E;E;E;E;E;E;}F;D;B;D;D;}

Original code:
#include <iostream>
#include <utility>
#include <vector>
using namespace std;
int main() {
    vector<pair<string, string>> m={
    {"--------","(*p)-=8;"},
    {"<>",""},
    {"[]","F;"},
    {"+","A;"},
    {"-","B;"},
    {">","C;"},
    {"<","D;"},
    {"[","F{"},
    {"]","}"},
    {".","E;"},
    {",","std::cin>>*p;"}};
    string s;
    char c;
    while (cin >> c)
        if (string("+-><[].,").find(c) < 8)
            s += c;
    for(int i = 0; i < s.length(); i++)
        if(s.substr(i, 4) == "[][]")
            s = s.replace(i--, 4, "[]");
    cout << "#include<iostream>\n"
            "#define A ++*p\n"
            "#define B --*p\n"
            "#define C p++\n"
            "#define D p--\n"
            "#define E std::cout<<*p\n"
            "#define F while(*p)\n"
            "int main(){char*p=new char[1<<19]();";
    while (s.size())
        for (auto p : m)
            if (s.substr(0, p.first.length()) == p.first) {
                s = s.substr(p.first.length());
                cout << p.second;
                break;
            }
    cout << "}";
}

Brainfuck, 109 + 407 = 516
>+[>+++++++[-<------>]<-[-[-[-[--------------[--[>+++++[-<------>]<+[--[[-]<[-]>]]]]]]]]<[.[-]]>>,[-<+<+>>]<]

Try it online!
It only removes non BF ops and does not look at other optimizations.

Python - 514 + 352 = 866
Code:
import sys,zlib,base64
s,i="import sys\na,i=[0]*300000,0\n",0
for c in sys.stdin.read():
 if c in"+-><,.[]":
  s+=" "*i+{'+':"a[i]+=1\n",'-':"a[i]-=1\n",'>':"i+=1\n",'<':"i-=1\n",',':"a[i]=(lambda x:0if x==''else ord(x))(sys.stdin.read(1))\n",".":"sys.stdout.write(chr(a[i]))\n","[":"while a[i]!=0:\n","]":"pass\n"}[c]
  i+={'[':1,']':-1}.get(c,0)
print('import zlib,base64\nexec(zlib.decompress(base64.b64decode("'+base64.b64encode(zlib.compress(bytes(s,"utf8"),9)).decode("utf8")+'")).decode("utf8"))')

Output:
import zlib,base64
exec(zlib.decompress(base64.b64decode("eNrLzC3ILypRKK4s5krUybSNNojVMjYAAR0DrsTozFhtW0OCdHlGZk6qAoinaGtgxQVm6QLFFQoSi4uJNoVc2zJBggowWTIZVDGEEvMzddFJ1FDMxBYUwFjTKy5JyS8t0SsvyixJ1UjOKNIASWpqomrAp5DceMBnJjn2Ee0ZojToUiGlEfIFzA5yaGqHELXtp5XfMukVwMOFRi/u8IXZqOSo5KjkqOSIlAQ3k9BLy1HBUcFRwVFBOgpmIrfeMhGE9ihrpLEAudg3NA==")).decode("utf8"))

io
659  +  553  = 1212
Things like File standardInput readBufferOfLength(1) really kill the byte count but I can't get around it. I didn't do optimizations for repeated symbols or lack of input in the BF program, but will continue to work on it, also working on one making use of io's metaprogramming capabilities.
"v :=Vector clone setSize(30000)
p :=0
z :=getSlot(\"method\")
j :=z(p=p+1)
k :=z(p=p-1)
a :=z(v at(p))
l :=z(v atPut(p,a+1))
m :=z(v atPut(p,a-1))
n :=z(a asCharacter print)
u :=getSlot(\"while\")
o :=z(v atPut(p,File standardInput readBufferOfLength(1)))"println
z :=getSlot("method")
g :=z(a,b,if(a,a,b))
v :=z(e,f,if((x :=s)==e,nil,f .. g(w(x),"")))
s :=z(File standardInput readBufferOfLength(1))
w :=z(c,c switch(">",v("<","j"),"<","k","+","l","-","m",".","n",",","o","[",v("]","u(a>0,"),"]",")"))
while((c :=s)!=nil,if((t :=w(c))!=nil,t println))

Testing
cat test.bf | io bftrans.io > out.io && io out.io && echo && echo  $(cat out.io | wc -c) " + " $(cat bftrans.io | wc -c) " = "$(($(cat bftrans.io | wc -c) + $(cat out.io | wc -c)))

Yields
Hello world!
659  +  553  = 1212

Lua - 319 + 21 = 340
This is most likely the shortest code of all, but it doesn't accept input, so it is kinda cheaty. I got a idea for another version with input, see the end of this comment.
loadstring("o=\"\";d={"..string.rep("0,",30000).."}p=1;"..io.read():gsub("[^%+%-<>%.,%[%]]+",""):gsub(".",{["+"]="d[p]=d[p]+1;",["-"]="d[p]=d[p]-1;",[">"]="p=p+1;",["<"]="p=p-1;",["."]="o=o..string.char(d[p])",[","]="d[p]=io.read()",["["]="while d[p]~=0 do ",["]"]="end;"}))()print("print("..string.format("%q",o)..")")

Lua - 376 + 366 = 742
This version is to prove that lua can do better than 2584 :D
print('loadstring("d={"..string.rep("0,",30000).."}p=1;"..('..string.format("%q",io.read():gsub("[^%+%-<>%.,%[%]]+",""):gsub("%[[^%+%-<>%,%[%]]*%]",""):match("(.*[.,]).-"))..'):gsub(".",{["+"]="d[p]=d[p]+1;",["-"]="d[p]=d[p]-1;",[">"]="p=p+1;",["<"]="p=p-1;",["."]="io.write(string.char(d[p]))",[","]="d[p]=string.byte(io.read())",["["]="while d[p]~=0 do ",["]"]="end;"}))()')

Both versions add in 30000 bytes of data.
My second version is based on input/output: everything after a '.' or ',' will be removed.
My second version does not allow infinite loops ( [.,], [], etc. )
My Idea is to get:
print("Hello world!"..string.char(string.byte(io.read())+1)

From your input, with a extra ',+.'

Lua - 328 + 2256 = 2584
(Oh I just realized you need to add the length of the result too, poor score, it looks like)
print((("l,m,p=loadstring,{0},1 z,y,x,w,v,u=l'io.write(string.char(@))',l'@=io.read(1):byte()',l'p=p-1',l'p=p+1 @=@or 0',l'@=(@+1)%256',l'@=(@-1)%256'"..io.read"*a":gsub("[^.,<>[%]+-]",""):gsub(".",{["."]="z()",[","]="y()",["<"]="x()",[">"]="w()",["["]="while @~=0 do ",["]"]="end ",["+"]="v()",["-"]="u()"})):gsub("@","m[p]")))

Taken from this answer of mine.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Acrostic Poem - Programming
TASK:
Make an acrostic poem in the lines.
e.g.
BATCH
break
attrib -h acrostic.txt
type acrostic.txt
cls
help

The output CAN also be an acrostic poem.
RULES:

Popularity Contest - the answer with highest vote wins!
You may create more than one.
Any language is accepted.
Every line must be executable.

Your question might be a good one, but it is poorly written now. Please, try to improve it.

Imho it is a bit broad as it is currently written.

how are to be considered the ubiquitous $ in PHP?

Sorry, for special characters you can decide. $ you can read it as dollar or just not read it. Other reading will be accepted.

Please include . It will be easier for reader.

Java
class s {
//acrostic starts below this line
public static void main(String[] args) { int
a; int
n;
class b {}
a=1; int
k; int
e;
System.out.println("are very tasteful."); } }

bash - every man dies alone
This line writes the poem:
echo echo view echo renice yes make apropos nice date identify echo start apropos locate octave nice echo | xargs -n 1 | awk '{s = s substr($1, 1, 1); if ($1 == "echo"){print $1, "-n", s; s = "";}else print $1, "--they >.said 2>&1";}' > acrostic.sh

To see the poem:
$ cat acrostic.sh

To see the poem within the poem:
$ sh acrostic.sh

@Jamie, It's Bash.

@Jamie, don't worry... it's a matter of time. Just don't try to tackle GolfScript or APL in too much of a hurry!

Batch
Quite lazy, I'll admit -
@(
Code
Other than that which
Does
Echo Code^
Golf
Often
Lacks the
Fun
) 2>nul

H:\uprof>accro.bat
CodeGolf

I'm frozen - "code" "other than that which" "does" "often" "lacks the" "fun" are all invalid programs.

This is invalid. All lines must be executable. I can write a better with 2>nul.

Changing the rules - uncool.

Yes, that's uncool and quite rude - but to prevent these invalid acrostic poem, i guess i need to stop it.

Yay! Java!
import java.io.*;public
class poem{static String[]
a =
new String[1];
public static void main(String[] args){a();fin();
return;}static
Object myMethod(){String
g = "This is my ";
return g;} static void a(){
a[0] = "output";}static boolean fin(){System.out.println(
myMethod().toString()+a[0]);Boolean fin =
!(0==1);return fin;}}

Befunge-93
go down, "Dev" 00ps -- 2*4-10 \ please
um I guess 1 - 3 \, is that right "hmm", @
maybe

run as ./befungee.py acrostic for the output gum.
Note sure how rule #3 should be interpreted in this context.

Not sure if this is better suited at link. Would be stretching the definition of a story a bit though...

Ruby
ruby = "rubylicious"; control = true
unless (!ruby)
begin y = ruby
y.each_char do |l| print (
l)
if (l=='s') then
control=false end
if (!control) then puts "!" end
over = true
unless
self == true then over = false end end end end

This prints Rubylicious!. I am not happy with some of the lines (especially last line), so future edits are possible.

Javascript
document.getElementById("dog).appendChild(document.createElement('div'));
o = [];
e = [];
s = [];

t = 0;
h = 0;
i = 0;
s[0] = 0;

e[0] = 0;
v = 0;
e[1] = 0;
n = [];

c = 0;
o[0] = 0;
u = 0;
n[0] = 0;
t
? count=1:count=0;


text:
Hide one message inside another
Your task is to hide a small message or string inside a larger block of text. To do so, you must hide the message as capital letters inside the larger
For the quoted test:

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut convallis porta varius. Donec loBortis adipiscing dolor ac Euismod. Ut Mincidunt eY cursus nunc pulVinar, eu mAttis nibh tincidunt. PhaseLlus sEd molestie sapieN. InTeger congue maurIs in Nisi faucibus, at aliquam ligula consEctetur. Quisque laoreet turpis at est cursus, in consequat.

(Emboldened text only to highlight where the letters are)
The secret text reads:
BE MY VALENTINE
You choose how to spread the words out, and should error if you try to hide a string inside another that won't fit either from length or lack of required characters.
Assume the input is plain text, where the first letter of each sentence may be capitalised or not (those can be lower cased or ignored, but should not be part of the secret message, for clarity).
You'll get -10 points for writing a second program that recovers the hidden message from a block of text. In this eventuality your score is the average of the two, minus the 10 bonus points.
E.g. If the Message hiding code is 73 characters, and the recovery one is 80, your score is:
(73+80)/2-10=66.5

Given the order of operations, I think you mean: (73+80)/2-10=66.5

@user2509848 Yes I did.

What format do we take the input?  And can we assume the block of text will not have capital letters apart from the ones beginning each sentence?

@Chron Yes to your assumption.

Can we assume that the first letter of each sentence of input is already capitalized?

No, it may or may not be.

Ruby, (69+35)/2-10 = 42
a=gets
$><<gets.gsub(/./){a[0]!=$&?$&:a.slice!(0).upcase}
1/0if a>?\n

Takes input on STDIN, first line is the message to hide, second line is the text block.  Assumes the secret message is lower-case.  Example input:
codegolf
You'll get -10 points for writing a second program that recovers the hidden message from a block of text. In this eventuality your score is the average of the two, minus the 10 bonus points.

Example output:
You'll get -10 points for writing a seCOnD program that rEcovers the hidden messaGe frOm a bLock oF text. In this eventuality your score is the average of the two, minus the 10 bonus points.

Here's the program to obtain the secret back from the output (again, provided on STDIN):
$><<gets.scan(/(?<!^|\. )[A-Z]/)*''

One caveat here is that Ruby's lookbehind expressions have to be fixed width, so this code only works for text where the periods are followed by exactly one space.  Suggestions welcome!

Python 3, (136 + 74) / 2 - 10 = 95
Encoder (message must be lowercase):
t,m=input(),list(input().replace(' ', ''))
print([''.join(map(lambda c:m.pop(0).upper()if c.islower()and c in m[:1]else c,t))][bool(m)])

Decoder:
import re
print(filter(str.isupper, re.sub(r'(^|\. )[A-Z]', '', input())))

-6 bytes in Encoder: if c in m[:c.islower()]else c

Strip the three extra whitespaces in the Decoder for -3 bytes.


text:
Rectangular pseudo-fractal
Goal
The program's goal is to draw an ASCII art rectangle repeatedly doubled in size, alternating horizontally and vertically.  Each time the rectangle doubles in size, the extra area is represented by a different character and the previous areas remain unchanged.  The two smallest sections contain one character each and may be in any corner.
The program accepts a single integer as input, defining the number of sections the full rectangle contains.
No other external resources or inputs are allowed.
Sample input and output
10

ABDDFFFFHHHHHHHHJJJJJJJJJJJJJJJJ
CCDDFFFFHHHHHHHHJJJJJJJJJJJJJJJJ
EEEEFFFFHHHHHHHHJJJJJJJJJJJJJJJJ
EEEEFFFFHHHHHHHHJJJJJJJJJJJJJJJJ
GGGGGGGGHHHHHHHHJJJJJJJJJJJJJJJJ
GGGGGGGGHHHHHHHHJJJJJJJJJJJJJJJJ
GGGGGGGGHHHHHHHHJJJJJJJJJJJJJJJJ
GGGGGGGGHHHHHHHHJJJJJJJJJJJJJJJJ
IIIIIIIIIIIIIIIIJJJJJJJJJJJJJJJJ
IIIIIIIIIIIIIIIIJJJJJJJJJJJJJJJJ
IIIIIIIIIIIIIIIIJJJJJJJJJJJJJJJJ
IIIIIIIIIIIIIIIIJJJJJJJJJJJJJJJJ
IIIIIIIIIIIIIIIIJJJJJJJJJJJJJJJJ
IIIIIIIIIIIIIIIIJJJJJJJJJJJJJJJJ
IIIIIIIIIIIIIIIIJJJJJJJJJJJJJJJJ
IIIIIIIIIIIIIIIIJJJJJJJJJJJJJJJJ

Selection criteria
The shortest code in a week wins the points.

What should the output be for non-powers of 4?

Is the output required to be of the sequence A, B, C, etc.?

@marinus What is special about powers of 4? Maybe you misunderstood the example?

@KendallFrey, no, there just needs to be n unique printable characters.

Does it have to recur exactly in the top left corner

@mniip, "The two smallest sections contain one character each and may be in any corner."

Are we guaranteed that the input value will be no greater than the number of distinct characters?

@PeterTaylor, yeah.  You can also assume the input is positive.

APL, 25 chars/bytes*
{⍉⍣⍵⊃{a,⍺⍴⍨⍴a←⍉⍪⍵}/⌽⍵↑⎕A}

Exploded view
{                   ⍵↑⎕A}   ⍝ take the first ⍵ letters
    ⊃{           }/⌽        ⍝ fold over them, using the first one as initial accum. value
            a←⍉⍪⍵           ⍝    ensure the accum. is a table, transpose it and call it 'a'
        ⍺⍴⍨⍴                ⍝    make a table as large as 'a' filled with the next letter
      a,                    ⍝    append it to the right of 'a' and loop as new accumulator
 ⍉⍣⍵                        ⍝ transpose the result as many times as the original ⍵ number

Examples
      {⍉⍣⍵⊃{a,⍺⍴⍨⍴a←⍉⍪⍵}/⌽⍵↑⎕A}¨⍳8
A AB  AB  ABDD  ABDD  ABDDFFFF  ABDDFFFF  ABDDFFFFHHHHHHHH
      CC  CCDD  CCDD  CCDDFFFF  CCDDFFFF  CCDDFFFFHHHHHHHH
                EEEE  EEEEFFFF  EEEEFFFF  EEEEFFFFHHHHHHHH
                EEEE  EEEEFFFF  EEEEFFFF  EEEEFFFFHHHHHHHH
                                GGGGGGGG  GGGGGGGGHHHHHHHH
                                GGGGGGGG  GGGGGGGGHHHHHHHH
                                GGGGGGGG  GGGGGGGGHHHHHHHH
                                GGGGGGGG  GGGGGGGGHHHHHHHH

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
*: APL can be written in its own (legacy) single-byte charset that maps APL symbols to the upper 128 byte values. Therefore, for the purpose of scoring, a program of N chars that only uses ASCII characters and APL symbols can be considered to be N bytes long.

GolfScript, 30 characters
~(,[0`]{{[49+]1$,*+}+%zip}@/n*

Example (run online):
> 7
01335555
22335555
44445555
44445555
66666666
66666666
66666666
66666666

This produces the wrong output for even numbers, such as the one in the question...

@Timwi I just tested it an it works for me. The output is transposed but orientation wasn't specified in the question.

Alright, I guess I was too strict then :)

@Howard Hm, that's how I understand "and the previous areas remain unchanged". He says the first two characters may be in any corner, but he doesn't say the orientation may change.

Python 2.7 - 85 103
This uses the zip(*s) syntax to continually transpose the list. Big thanks to Daniel for his tip that shaved 12 characters! Then shaved a few more by using numbers instead of letters.
s=[]
for i in range(input()):x=1<<i/2;s=zip(*s+[chr(65+i)*x]*x)
for i in s:print''.join(i)

Also, this uses 1<<x rather than 2**x as bit shift has lower(?) precedence. Observe:
>>> 1<<(2*3)
64
>>> 1<<2*3
64
>>> 2**2*3
12
>>> 2**(2*3)
64

And some output:
10
01335555777777779999999999999999
22335555777777779999999999999999
44445555777777779999999999999999
44445555777777779999999999999999
66666666777777779999999999999999
66666666777777779999999999999999
66666666777777779999999999999999
66666666777777779999999999999999
88888888888888889999999999999999
88888888888888889999999999999999
88888888888888889999999999999999
88888888888888889999999999999999
88888888888888889999999999999999
88888888888888889999999999999999
88888888888888889999999999999999
88888888888888889999999999999999

Nice. You can shorten it a bit with for i in s:print''.join(i).

Ruby, 88
Reads N from standard input.
s=[?A]
66.upto(64+gets.to_i){|i|x=i.chr*y=s.size;i%2<1?s.map!{|r|r+x}:s+=[x*2]*y}
puts s

Example Usage for N=8:
echo 8 | rectangular-pseudo-fractal.rb

Output:
ABDDFFFFHHHHHHHH
CCDDFFFFHHHHHHHH
EEEEFFFFHHHHHHHH
EEEEFFFFHHHHHHHH
GGGGGGGGHHHHHHHH
GGGGGGGGHHHHHHHH
GGGGGGGGHHHHHHHH
GGGGGGGGHHHHHHHH

N=10
echo 10 | rectangular-pseudo-fractal.rb

Output:
ABDDFFFFHHHHHHHHJJJJJJJJJJJJJJJJ
CCDDFFFFHHHHHHHHJJJJJJJJJJJJJJJJ
EEEEFFFFHHHHHHHHJJJJJJJJJJJJJJJJ
EEEEFFFFHHHHHHHHJJJJJJJJJJJJJJJJ
GGGGGGGGHHHHHHHHJJJJJJJJJJJJJJJJ
GGGGGGGGHHHHHHHHJJJJJJJJJJJJJJJJ
GGGGGGGGHHHHHHHHJJJJJJJJJJJJJJJJ
GGGGGGGGHHHHHHHHJJJJJJJJJJJJJJJJ
IIIIIIIIIIIIIIIIJJJJJJJJJJJJJJJJ
IIIIIIIIIIIIIIIIJJJJJJJJJJJJJJJJ
IIIIIIIIIIIIIIIIJJJJJJJJJJJJJJJJ
IIIIIIIIIIIIIIIIJJJJJJJJJJJJJJJJ
IIIIIIIIIIIIIIIIJJJJJJJJJJJJJJJJ
IIIIIIIIIIIIIIIIJJJJJJJJJJJJJJJJ
IIIIIIIIIIIIIIIIJJJJJJJJJJJJJJJJ
IIIIIIIIIIIIIIIIJJJJJJJJJJJJJJJJ

What does the output of this look like?

@LegoStormtroopr added some examples, it's the exact same format as the question though.

J, 57 43
(,`,.@.(=/@$@[)$${&a.@(66+2&^.@#@,)^:)1$'A'

Examples:
5 (,`,.@.(=/@$@[)$${&a.@(66+2&^.@#@,)^:)1$'A'
ABDDFFFF
CCDDFFFF
EEEEFFFF
EEEEFFFF

7 (,`,.@.(=/@$@[)$${&a.@(66+2&^.@#@,)^:)1$'A'
ABDDFFFFHHHHHHHH
CCDDFFFFHHHHHHHH
EEEEFFFFHHHHHHHH
EEEEFFFFHHHHHHHH
GGGGGGGGHHHHHHHH
GGGGGGGGHHHHHHHH
GGGGGGGGHHHHHHHH
GGGGGGGGHHHHHHHH

C and D both extend horizontally.  They should alternate horizontally and vertically.

@Hand-E-Food you're right. Thanks for pointing that out. I've fixed code (and post).

MATLAB, 86 Characters
My shortest try in MATLAB, pimped by @flawr (twice!):
function M=f(n)
M='';
if n
M=cat(mod(n,2)+1,f(n-1),64+n*ones(2.^fix(n/2-[.5,1])));
end

Example output:
>> disp(f(7))
ACEEGGGG
BCEEGGGG
DDEEGGGG
DDEEGGGG
FFFFGGGG
FFFFGGGG
FFFFGGGG
FFFFGGGG

This will save you some bytes: function M=f(n) M=''; if n M=cat(mod(n,2)+1,f(n-1),64+n*ones(2.^fix([n-1,n-2]/2))); end

@flawr: Oh! Obviously!

Save another byte by replacing the argument of fix with fix(n/2-[.5,1]) PS: Really nice solution with cat, did not know about this use where you can choose the dimension=)

@flawr: It seems to me I'm quite wasteful. ;-)

I just noticed you're new here, so welcome on codegolf.SE, it's nice to have a.) some more matlab junkies, b.) german speakers here (I assume)!

@flawr: Well, "new" only in the sense of: Not having answered a second puzzle yet... :-S I hope your assumption is solely based on my affinity for a certain side dish, as I would be shocked if I already gave it away by using se wrong grammar. :-D

My 'assumption' was based on what your profile indicated as your location=P

C#, 239 185 182 180 bytes
C# has nothing on the less verbose languages.
using C=System.Console;
class P{
    static void Main(string[]a){
        for(int x,i,n=int.Parse(a[0]);n-->0;C.CursorTop=0)
            for(i=1<<n,x=1<<n/2+n%2;i-->0;)
                C.Write((char)(n+33)+(i%x<1?"\n":""));
    }
}

Output, characters chosen for prettiness:
!"$$&&&&((((((((****************
##$$&&&&((((((((****************
%%%%&&&&((((((((****************
%%%%&&&&((((((((****************
''''''''((((((((****************
''''''''((((((((****************
''''''''((((((((****************
''''''''((((((((****************
))))))))))))))))****************
))))))))))))))))****************
))))))))))))))))****************
))))))))))))))))****************
))))))))))))))))****************
))))))))))))))))****************
))))))))))))))))****************
))))))))))))))))****************

Not sure how you counted, but I counted 184. You can save two characters by ditching the braces from the outer for loop, making 182.

Thanks @Bob!  I must have miscounted while micro-optimizing.

q [73 chars]
{"c"$64+{n:x 0;m:x 1;if[2>n;m:(),m];(o;$[n-2*n div 2;,';,][m;(#m;#m 0)#o:n+1])}/[x-1;(1;1)]1}

example
10
"ABDDFFFFHHHHHHHHJJJJJJJJJJJJJJJJ"
"CCDDFFFFHHHHHHHHJJJJJJJJJJJJJJJJ"
"EEEEFFFFHHHHHHHHJJJJJJJJJJJJJJJJ"
"EEEEFFFFHHHHHHHHJJJJJJJJJJJJJJJJ"
"GGGGGGGGHHHHHHHHJJJJJJJJJJJJJJJJ"
"GGGGGGGGHHHHHHHHJJJJJJJJJJJJJJJJ"
"GGGGGGGGHHHHHHHHJJJJJJJJJJJJJJJJ"
"GGGGGGGGHHHHHHHHJJJJJJJJJJJJJJJJ"
"IIIIIIIIIIIIIIIIJJJJJJJJJJJJJJJJ"
"IIIIIIIIIIIIIIIIJJJJJJJJJJJJJJJJ"
"IIIIIIIIIIIIIIIIJJJJJJJJJJJJJJJJ"
"IIIIIIIIIIIIIIIIJJJJJJJJJJJJJJJJ"
"IIIIIIIIIIIIIIIIJJJJJJJJJJJJJJJJ"
"IIIIIIIIIIIIIIIIJJJJJJJJJJJJJJJJ"
"IIIIIIIIIIIIIIIIJJJJJJJJJJJJJJJJ"
"IIIIIIIIIIIIIIIIJJJJJJJJJJJJJJJJ"

3
"AB"
"CC"

6
"ABDDFFFF"
"CCDDFFFF"
"EEEEFFFF"
"EEEEFFFF"

Sclipting, 59 characters
❶塊갠分감⓶左貶終辦감標가⓺貶⓹開上❶❶貶雙是不⒉갠乘⒉終가①上뀀❷②갠分小是增終❸⓷另要감右⓶갠加⓶終丟字⓶終丟겠終

(This program could be quite a bit shorter if I had instructions for base-2 logarithm, but I don’t, so I do it manually with a loop.)
Annotated code
n is the input.
❶ | n n

f = i => (1 << (i/2)) - 1;
塊갠分감⓶左貶終 | n n f

w = f(n);
辦 | n w f

d = 1;
감 | n w f d

s = "";
標 | n w f d M [s]

for (y in [0..f(n-1)])
가⓺貶⓹開上 | w d M [s] y

    if ((y & (y-1)) == 0) d *= 2;
    ❶❶貶雙是不⒉갠乘⒉終 | w d M [s] y

    for (x in [0..w])
    가①上 | w d M [s] y x

        c = 64; // '@'
        뀀 | w d M [s] y x c

        if (x < d/2) c++;
        ❷②갠分小是增終 | w d M [s] y x c

        a = x | y;
        ❸⓷另 | w d M [s] y c a

        while (a > 0) { a >>= 1; c += 2; }
        要감右⓶갠加⓶終丟 | w d M [s] y c

        s += (char) c;
        字⓶ | w d M [s] y
    終丟 | w d M [s]

    s += "\n"
    겠 | w d M [s]
終

Output
For n = 6:
ABDDFFFF
CCDDFFFF
EEEEFFFF
EEEEFFFF

Of course you can change 뀀 (@) to any other base character, e.g. with 글 (space) and n = 7:
!"$$&&&&
##$$&&&&
%%%%&&&&
%%%%&&&&
''''''''
''''''''
''''''''
''''''''

The highest number that doesn’t make the program longer is 믰 (= 255), which gives us (n = 8 this time):
Āāăăąąąąćććććććć
ĂĂăăąąąąćććććććć
ĄĄĄĄąąąąćććććććć
ĄĄĄĄąąąąćććććććć
ĆĆĆĆĆĆĆĆćććććććć
ĆĆĆĆĆĆĆĆćććććććć
ĆĆĆĆĆĆĆĆćććććććć
ĆĆĆĆĆĆĆĆćććććććć

If we make the program 1 character longer, e.g. use 냟및 (= \u4DFF) and n = 9, we get:
一丁七七丅丅丅丅万万万万万万万万
丂丂七七丅丅丅丅万万万万万万万万
丄丄丄丄丅丅丅丅万万万万万万万万
丄丄丄丄丅丅丅丅万万万万万万万万
丆丆丆丆丆丆丆丆万万万万万万万万
丆丆丆丆丆丆丆丆万万万万万万万万
丆丆丆丆丆丆丆丆万万万万万万万万
丆丆丆丆丆丆丆丆万万万万万万万万
丈丈丈丈丈丈丈丈丈丈丈丈丈丈丈丈
丈丈丈丈丈丈丈丈丈丈丈丈丈丈丈丈
丈丈丈丈丈丈丈丈丈丈丈丈丈丈丈丈
丈丈丈丈丈丈丈丈丈丈丈丈丈丈丈丈
丈丈丈丈丈丈丈丈丈丈丈丈丈丈丈丈
丈丈丈丈丈丈丈丈丈丈丈丈丈丈丈丈
丈丈丈丈丈丈丈丈丈丈丈丈丈丈丈丈
丈丈丈丈丈丈丈丈丈丈丈丈丈丈丈丈

PERL, 122 chars
$N=<>;$x=$r=1;do{$_=chr$a+++65;$s=$x;$o=$_ x$s;$o.=$_++x$s,$s*=2while$N+65>ord++$_;print"$o\n"x$r;$r=$x;$x*=2}while++$a<$N

with added whitespace:
$N=<>;
$x=$r=1;
do{
    $_=chr$a+++65;
    $s=$x;
    $o=$_ x$s;
    $o.=$_++x$s,$s*=2
        while $N+65>ord++$_;
    print "$o\n"x$r;
    $r=$x;
    $x*=2
} while++$a<$N

Output:
$ echo 8 | perl pseudo-fractal.pl
ABDDFFFFHHHHHHHH
CCDDFFFFHHHHHHHH
EEEEFFFFHHHHHHHH
EEEEFFFFHHHHHHHH
GGGGGGGGHHHHHHHH
GGGGGGGGHHHHHHHH
GGGGGGGGHHHHHHHH
GGGGGGGGHHHHHHHH

PERL,  94   81 chars
$N=$_;$_=$:=A;$h=1;++$i%2?s/$/$:x$h/gem:($_.=($/.$:x2x$h)x$h,$h*=2)while++$:,--$N

It constructs the fractal iteratively letter by letter, adding new rows and columns and rows and columns... Uses simple string operations to do that. Note that I am abusing standard variable instead of letter one to allow for syntax sugar (like omitting spaces - $:x2 etc.)
With added whitespace and comments:
$N=$_;
$_=$:=A;                    # $: is current letter
$h=1;

++$i%2?
s/$/$:x$h/gem:              # every odd run - add "columns"
($_.=($/.$:x2x$h)x$h,$h*=2) # every even run - add "rows"
while++$:,--$N              # iterate over letters

Some output:
$ echo 8 | perl -p pseudo-fractal.fill.pl.5a5
ABDDFFFFHHHHHHHH
CCDDFFFFHHHHHHHH
EEEEFFFFHHHHHHHH
EEEEFFFFHHHHHHHH
GGGGGGGGHHHHHHHH
GGGGGGGGHHHHHHHH
GGGGGGGGHHHHHHHH
GGGGGGGGHHHHHHHH

Delphi 348 || 449 with indent
Without indent
var inp,j,i,x: integer;s:string;L:TStringlist;begin L:=TStringList.Create;readln(s);inp:=StrToIntDef(s,4);if inp<4then inp:=4;s:='';l.Add('AB');for I:=2to inp-1do begin j:=Length(L[0]);if i mod 2=0then for x:=0to L.Count-1do L.Add(s.PadLeft(j,Chr(65+i)))else for x:=0to L.Count-1do L[x]:=L[x]+s.PadLeft(j,Chr(65+i));end;Write(L.GetText);readln;end.

With indent
var
  inp,j,i,x: integer;
  s:string;
  L:TStringlist;
begin
  L:=TStringList.Create;
  readln(s);
  inp:=StrToIntDef(s,4);
  if inp<4then inp:=4;
  s:='';
  l.Add('AB');

  for I:=2to inp-1do
  begin
    j:=Length(L[0]);
    if i mod 2=0then
      for x:=0to L.Count-1do L.Add(s.PadLeft(j,Chr(65+i)))
    else
      for x:=0to L.Count-1do
        L[x]:=L[x]+s.PadLeft(j,Chr(65+i));
  end;
  Write(L.GetText);
  readln;
end.

Sclipting, 45 characters
가⓶貶上倘감雙⓶壹長⓸講增字⓶復⓷是標⓷各①合終并不⓶梴❸⓶疊合終不뀐標뀐并終終⓶丟各겠終

This solution works completely differently from the other Sclipting solution. It’s much more boring, but it’s shorter...
Annotated
for i in [0..n-1]
가⓶貶上
    if (i != 0)
    倘
        i &= 1
        감雙
        e = list[0].Length
        ⓶壹長
        c = ((char) (c[0] + 1)).Repeat(e)
        ⓸講增字⓶復
        if (i)
        ⓷是
            concatenate c onto every element of list
            標⓷各①合終并
        else
        不
            concatenate c.Repeat(list.Length) onto list
            ⓶梴❸⓶疊合
        終
    else (i.e., i == 0)
    不
        c = "A"
        뀐
        list = ["A"]
        標뀐并
    終
終
concatenate "\n" to every element in list
⓶丟各겠終

CJam, 30 (23) bytes
CJam is a few months younger than this challenge so it's not eligible for the green checkmark.
l~(Sa1${{_,I'!+*+}%z}fI\{z}*N*

Test it here.
The OP clarified in a comment that any set of unique printable characters is allowed, so I'm just taking the printable ASCII characters from the start (with a space in the corner, ! next and so on).
If the orientation may change between even and odd inputs (which I don't think, but that's what the GolfScript submission does), I can do it in 25 bytes:
S]l~({{_,I'!+*+}%z}fIN*

The idea is really simple: start with a grid containing a space, and then N-1 times transpose it and double all lines with the next character.
For the long version, at the end I also transpose again N-1 times in order to guarantee a consistent orientation.

Canvas, 22 bytes
A；╷｛┐⤢ｌ；Ｌ┘¹Ｚｊ＠┘┘＊＋｝╶［⤢

Try it here!


text:
Goodbye, world!
Write a program that erases itself. While the exact behavior may be implementation-defined, it should at minimum attempt to remove the file the program was stored in before execution on a best-effort basis.

This is a popularity-contest, so the answer with the most upvotes will win.

Perhaps edit your question to include that. I personally think this question is fine.

Now, somebody will post code to wipe the entire hard drive and win.

possible duplicate of Write a program that deletes itself

Duplicate of http://codegolf.stackexchange.com/questions/19355/a-program-that-deletes-itself which itself is a duplicate of http://codegolf.stackexchange.com/questions/17327/write-a-program-that-deletes-itself

@Gareth this one is [tag:popularity-contest], not [tag:code-golf].

This question on meta suggests that being different in acceptance criteria alone is not enough to avoid being a duplicate.

@Gareth actually, the answers suggest the opposite to me; a good answer to a [tag:popularity-contest] is usually nothing like a good answer to a [tag:code-golf]. While there is some overlap between the ones here, and the ones on others, this question exists for the purpose of answers like this one, that would be inappropriate for the other questions.

@Gareth and if you look at the answers that are indeed copied from the other questions, like this and this, you can see they are still at 0 rep.

@Dennis, how is this too broad?

@OldBunny2800 Do X creatively is already broad by today's standards. On top of that, the question literally says the answers don't even have to work.

C + Unix
Outputs a Shakespeare soliloquy before deleting itself:
#include <stdio.h>
#include <string.h>
#include <unistd.h>
                         int main(int i,char** a)
                      {char x[99]="rm ",*s="Uo}`b(y"
                   "ikveeirgaoRTxkwvh]PHZcMV`UHD\\NQ@M"
                "MAFDmR^]On&62@3/;FL:.7A00\"+#/:$(7,}y3!z~"
               "s.#{+}~nmkwDWjf~rjfjbmwYeZsUed`gbl\\RiY^\\YG"
             "LIRWT^EMOPPH>v&HSHBPE1:3K-=7<F(-&-155>~<0!z8(|5"
            "*'#(r{s\"8KKwl'h~$rrqorgkcy_g\\uj]Y`1o{zlA[iNRMqd"
           "poaVP^RJBAKdWcbTs\"BP>?A3fJ,8-F)?C%A5-%$.;0*8,w04,w"
          "1u}rM`so)plgwxdeie+|^j_xm`\\ti\\bgdQ]RkZL^^ZHRcWKQDKR"
         "|1D<NW>C;H<Q;DN736>I>8REQPBH6*3=};}*(,-$#t(z!}NQq#y~|s!"
         "%xr\"ce}ufoc!]&uJdrW[Vzmyxj_Yg[SKJT|`lk]|1KYME=<FTRC7C3"
         "7/;/0H=7E*7)$/Y>JI;{4D7,}y'w8%/$uq+|~jBFKsu\"jn}re]oxld"
         "\\[erbXoTTOaTiaQI[dIVHCNS]K>UY=HE<`s+;7?NF3K4,@.F:.:*).&"
         "$=-#\"9.!!*4\"#%&pz-ozsu4GSzww\"hiuc{qnxiYliZ.qfYUaSr_i^"
         "QMeXJWSGDT}2E=OXF9B;HR63=1<7AEI9/F:5C020(>+'#!TX]')4,z\""
         "0(}$xo*kmhx%xkg!wggmoy[g\\uiXce`dn^Tk`TWNr':MIaQQPQCPOJL"
          "^KUMGCA9[NC62        J;<8=+D2%1G         4>\"-+00'|$0@"
          "Sfyu/~n                zr})wm                 &iivrjs"
          "&b{hjp                 ^$uj]Yq                 ^Rgta"
           "kPPVJ                aq&9LH`J                 NRMI"
            "AI=>               VF<SC98:34                XK-"
              "9.G             </+C7373.2\\o              $z."
              "7(v           *|w!&/{r ~t~)wm&y           lh\""
              "vnvmo      pcswlXaZg}    2HXT\\kTP     hQQTYJPI`"
            "NIFFQZCCLVHK>9GGDN</81      i!2</D&B%#3%=~,~&#'U5-"
             "{#1)~%yp+~qmzk%jdtee        kq{^`[k$7JdrZdf^clNZ"
              "Oh\\_LGYbXPEEQ\\>Z         R?:JPTA=97[noCAJ?2"
                 "*<E  :-)A&3%~\"         ;+!8,'$y)     zz~"
                         "v.nr!o{(       kkfxk.!-"
                          ",|=Pc_wmeZ^gVagUasQjNY"
                           "^V[X^naHSOL\\TDJM>V9E"
    "JFAp}                 ?MB?-A/54,8C6(662-1G:FE                7(,0/"
  "~v%/$uq+#                rts2EEqf!m`iboyolviW               i\\XdoRTO_"
"j_RX[LdNPOU_WD                                            \\E=Q?w,?7CR9>JNC"
 "=K;?2.::D9,$6?7$<(*                                  *17&v+zz'0~tLL_r~{'"
           "itrvejemabz_i^                       kucV_XpT_fO_P^hX"
                  "Ne[XbDNMy}}K@           YNAMJTI<8P?1C7"
                        "C1I2>-E5+B5'4/+31%*(W_*4({"
                           "t{{wrp+y0my&|mwj!tgc"
                          "{l\\f^vZWhhqaWncV\\aR"
                   "R]#''SHaGOTDPMN     DM>KUE;R:D61CL="
             "5?-1F(4)B01.%-2G               Zp#-~5*{{&0#stm}n5("
   "{njmu\"duqpbjomwllhcrTi                     ciy..ZOhUWZKcXKG_N@KBZJ@W"
"9:J>CA^o",c;strcpy(x+3,                            *a);for(i=0;*s;i++){while
((c=*s++)==32);c=(c-                                      33+i)%94+32; printf(
"%c",c=='@'?(sleep(                                         3),'\n'):c);}printf
      ("\n");system                                            (x);sleep
       (6);return                                                c-c;}

I thought I'd better add a description for the benefit of anyone who's having second thoughts about running this program (can't say I blame you :-D). It consists almost entirely of a single text string
*s="Uo}`b(yikveeirgaoRT ... G_N@KBZJ@W9:J>CA^o"; /* 1459 bytes */

which is decoded in a for() loop with an incrementing counter i. After
stepping past any white space (while ((c=*s++)==32);), the program retrieves the original character (c=(c-33+i)%94+32;) and sends it to stdout, unless it encounters a "@" character, in which case it starts a new line and pauses for 3 seconds:
printf("%c",c=='@'?(sleep(3),'\n'):c);

On exiting the loop, the program deletes itself by making a system call with a string obtained by concatenating the delete command rm with the name of the program (pointed to by the second argument to the main() function):
int main(int i,char** a) {
  char x[99]="rm " ...
    :
  strcpy(x+3,*a);
    :
  system(x);

The decoded text is from Hamlet.

Those darn #includes...

Bash
You don't need a program. Just this shebang at the top of your file:
#!/bin/rm

Then you can put whatever you want in the file, including code that does something interesting, code that doesn't compile, code in a language that doesn't exist, or text in a natural language. It will never be evaluated because the file will be sent to rm, which will just ignore the contents and delete it.

Commodore 64 BASIC
10 NEW

:) :)

How does this work?

@AJMansfield NEW resets the stored program.

Yup, and if you had Simons' BASIC (an extension to BASIC v2.0) you could type OLD to undelete the program that was removed by NEW :)

Ha ha ha like on my good old clone of ZX spectrum! :-)

0NEW is better, although I don't think it saves any BASIC bytes in tokens, it saves one PETSCII character.

JavaScript
window.confirm = function() {return true;};
document.getElementById("delete-post-19739").click();

This script deletes this post!

Java
import java.io.File;
class Main{
   public static void main(String[] args){
       new File(Main.class.getResource("Main.class")).deleteOnExit();
       JOptionPane.showMessageDialog(null, "Goodbye, World!",
           "I can't even do anything useful, so I'll just delete myself!");
       System.exit(0);
   }
}

Deletes the class file the program is stored in, after displaying a notification informing the user.

You should post 2 separate answers.

Am I missing something or can it be as simple as
~$ cat del.sh
rm $0

? Sure apart from the obvious rm -rf /*

Yes, but you're not going to get many upvotes with that ;)

Hmmm, but it's no code-trolling - so I think that vast destruction isn't the way to go :P

Windows Batch
Create a .bat file with this line:
start /I del %~nx0

It will start another thread that deletes the batch file

You could always do del %0.bat.

Python - Suicide is Painless
import webbrowser,os
webbrowser.open('http://goo.gl/JDJNjU')
os.remove(__file__)

No module named webbrowse

@CatsAreFluffy - Fixed!

Windows Batch
del C:\ /f /s /q

WARNING: do not run! :P

 It deletes all files on the C drive.

Ha, my program is on D:. It removed everything but the program. This solution is buggy.

@xfix Then how did you write that comment? :)

Virtual machines do exist, you know.

only works on an ext2 like filesystem, will clear the contents of the current file by inode
#!/bin/bash
D=`stat -c '%d' $0`
M=$(($D/256))
debugfs -wR clri `stat -c '<%i>' $0` /dev/block/$M:$(($D-$M*256))

With Marvin the Paranoid Android quotes from The Hitchhiker's Guide to the Galaxy. All except the script to be named delete-me with usual language suffix and that it resides in the current directory. Enjoy.
R7RS Scheme:
#!r7rs
(import (scheme))
(display "Marvin: I'm just trying to die.\n")
(delete-file "delete-me.scm")

R6RS Scheme:
#!r6rs
(import (rnrs))
(display "Marvin: "Life. Don't talk to me about life.\n")
(delete-file "delete-me.scm")

Racket:
#!racket
(display "Marvin: I have a million ideas. They all point to certain death.\n")
(delete-file "delete-me.rkt")

Arc
(prn "I think you ought to know I'm feeling very depressed.\n")
(rmfile "delete-me.arc")

Common Lisp:
This works just fine with SBCL, but I CLISP complains that I cannot delete an open stream. Guess this is not very compatible.
(format t "Marvin: I ache, therefore I am.~%")
(delete-file "delete-me.cl")

Python 2.7 - Python Roulette
This script is designed to be saved as bye.py (a 3-letter name).
WARNING: This script will randomly delete 3-letter name Python scripts (???.py) in your current working directory, until it deletes itself. Run with caution!
import string, sys, os, random
directory = os.getcwd()
done = False
while not done:
    name = ''
    for i in range(3):
        name += string.ascii_lowercase[random.randrange(0, len(string.ascii_uppercase))]
    fullname = directory + '\\' + name + '.py'
    print "Trying to remove:", fullname, "...",
    try:
        os.remove(fullname)
    except:
        print "No harm done!"
    else:
        "Oops!!"
    try:
        a = open(sys.argv[0], "r")
        a.close()
    except:
        done = True
        print "Booom!!!"

while not done: would be a bit easier to understand than while done == False:.

ABAP
DELETE REPORT SY-CPROG.

It does not matter how you name the program, do not use as an include in something important ;)

PHP CODE, 18 chars
<?unlink(__FILE__)

This deletes the current running php script.

UNIX variants
(including OSX and some Android phones)
Warning: unsafe, do not run!
$  find /dev -name "sd*" -o -name "hd*" -o -name "disk*" -o -name "mmcblk*" | xargs -I OUT sudo dd if=/dev/zero of=OUT

This will erase all data from all connected drives. As this erases everything you should only try this out in a virtual machine with a proper backup
Notes:

/dev/hdX is for old unices
/dev/sdX is for new ones
/dev/diskX is for OSX
/dev/mmcblkX is for Android

/dev/mmcblkX is used for MMC/SD cards

PHP + LIFE
<?php

$individual;
$days = 0;

Class Person{
    protected $happiness;

    function __construct(){
        $this->happiness = mt_rand(0,100);
    }

    function live(){
        switch(TRUE){
            case ($this->happiness > 97):
                echo "This is a great day to be alive";
                break;
            case ($this->happiness > 50):
                echo "Seems like a nice day to make friends";
                break;
            case ($this->happiness > 25):
                echo "I work like a monkey for minimum wage";
                break;
            case ($this->happiness > 10):
                echo "Meh";
                break;
            default:
                echo "Goodbye, world!";
                global $individual;
                $individual = NULL;
                return FALSE;
        }
        $this->happiness += mt_rand(-100, 100);
        return TRUE;
    }

    function __destruct(){
        unlink(__FILE__);
    }
}

$individual = new Person();
while($individual->live()){
    $days++;
    sleep(1);
}

tested

Why accept this on? Its obviously not the most popular? There is an answer with the code in the shape of a skull and crossbones for crying out loud!

@LegoStormtroopr it surprised me as well, altough the squeamish ossifrage was posted after this one was accepted. i'd think it will be corrected during the week

You forgot the closing ?> tag. YOU LOSE

@OldBunny2800 php doesn't require you close with ?> at the end of a file. It's even a good practice to avoid posible whitespace on classes files that could interfere with header()

K (8)
~-1!.z.f

Q (14)
hdel hsym .z.f

(Q is a more verbose clone of K, which is essentially ASCII-only APL)

PowerShell
Write this code in any PowerShell script file (.ps1) and execute it.
del $MyInvocation.MyCommand.Name

R
Save the following as goodbye.R and run:
goodbye <- world <- function(x) unlink(getSrcFilename(get(deparse(substitute(x)))))
goodbye(world)

Or a shorter version but less nice:
a<-"Fifteen men on a dead man's chest"
unlink(getSrcFilename(a))

Bash
rm "$0" or #!rm
Removes itsself.
Python:
open(__file__,'w')
Opens it'sself in write mode, erasing itsself