| Bytes | Lang | Time | Link |
|---|---|---|---|
| 020 | UiuaSBCS | 240811T194715Z | Europe20 |
| 027 | JavaScript | 240811T043953Z | Andrew B |
| 013 | Keg | 190810T182411Z | user8505 |
| nan | 181231T225351Z | 12Me21 | |
| 033 | TIBASIC | 181230T190851Z | Hello Go |
| 021 | Tcl | 181229T104808Z | sergiol |
| 019 | XQuery | 140117T181651Z | Michael |
| nan | 140118T041028Z | zw324 | |
| 035 | JavaScript | 140119T225350Z | Eliseo D |
| nan | 140408T123403Z | Timtech | |
| nan | 140120T002820Z | Tomas | |
| nan | 140131T133248Z | Gaffi | |
| 019 | Javascript | 140119T231906Z | 1j01 |
| 018 | Plain TeX | 140119T194315Z | yo' |
| nan | 140121T183809Z | Toothbru | |
| 052 | JavaScript | 140129T132345Z | Toothbru |
| nan | 140121T103304Z | Barry St | |
| nan | 140117T160647Z | Wasi | |
| nan | 140123T104738Z | Udi | |
| nan | 140117T171901Z | Joe Z. | |
| nan | 140122T001410Z | qwerty | |
| 041 | C | 140121T072738Z | KARTHIK |
| nan | 140119T170133Z | Udi | |
| nan | 140119T205959Z | Tomas | |
| 025 | k/q | 140120T092935Z | Aaron Da |
| 011 | Sclipting | 140117T222753Z | Justin |
| nan | 140120T110546Z | Indoor | |
| 026 | POSIX shell Bash et al | 140120T004354Z | Laurence |
| nan | 140117T204055Z | cnst | |
| nan | 140118T091435Z | Mohammad | |
| 022 | Lua | 140119T191840Z | isidor3 |
| nan | 140119T162620Z | cormulli | |
| 192 | C | 140117T211954Z | FireFly |
| nan | 140118T211513Z | ugoren | |
| 032 | C | 140119T020125Z | mcleod_i |
| 037 | JavaScript [37 bytes] | 140117T161556Z | VisioN |
| nan | 140118T232738Z | shoghicp | |
| 016 | HTML 16 Chars | 140118T190847Z | Dozer789 |
| 054 | Node.js 54 Unicode characters | 140118T170831Z | aaaaaaaa |
| 028 | Perl | 140118T162518Z | Tomas |
| 016 | q/kdb [16 chars] | 140118T162201Z | nyi |
| 029 | Perl | 140118T141552Z | tobyink |
| 027 | Haskell | 140118T125447Z | vek |
| nan | 140118T010333Z | Francisc | |
| nan | 140118T063408Z | SSpoke | |
| 098 | Befunge | 140118T050159Z | Justin |
| 035 | Clojure | 140118T030714Z | Bob Jarv |
| 066 | JavaScript | 140118T024250Z | David Ca |
| 033 | PHP | 140117T175344Z | Vereos |
| nan | 140117T223649Z | Daniel A | |
| nan | 140117T221923Z | Timtech | |
| nan | 140117T214640Z | Timtech | |
| nan | 140117T172804Z | SztupY | |
| 017 | HTML — | 140117T212007Z | cnst |
| nan | Piet No characters whatsoever! | 140117T203420Z | Approach |
| 043 | C 43 Characters | 140117T192804Z | Kirk Bac |
| 030 | PHP | 140117T193737Z | Aycan Ya |
| 022 | LINQPad | 140117T193726Z | Ross Pre |
| 029 | Scala | 140117T175752Z | KChaloux |
| 046 | C 46 Characters | 140117T191244Z | Phillip |
| nan | 140117T184116Z | Runium | |
| 034 | Perl | 140117T155118Z | manatwor |
| 021 | HTML Fiddle | 140117T182943Z | Briguy37 |
| 027 | Ruby | 140117T160353Z | manatwor |
| nan | 140117T180124Z | cnst | |
| 034 | AWK | 140117T162428Z | Wasi |
| nan | 140117T165037Z | Oberon | |
| 003 | Python 3 [38 bytes] | 140117T160420Z | VisioN |
| 021 | GolfScript | 140117T162906Z | ProgramF |
| nan | 140117T162245Z | Peter Ta | |
| 020 | Powershell | 140117T155350Z | Danko Du |
| 001 | HQ9+ | 140117T154705Z | 6160 |
UiuaSBCS, 20 bytes
&p-⇡12$ Hfnos%}vzun,
Subtracts the numbers 0 to 11 from the string Hfnos%}vzun,, resulting with Hello, world!, then prints it.
Bonus: every character appears only once, 22 bytes
&p-↧9⇡12$ Hfnos%}vzum*
Uses the ↧ minimum function to change the last two characters of the encoded string so that n doesn't appear twice.
JavaScript, 27 bytes
alert("Hel\x6Co wor\154d!")
Keg, 13 bytes
The winner was chosen, but I still want to do it. :) (Astonishingly it is shorter than HTML!)
Hel:o world\!
This is a popularity contest, but the program is very easy to understand despite of the conciseness.
Explanation
Hel #Push "Hel" onto the stack
: #Duplicate the top of the stack (l)
o world #Push "o world" onto the stack
\!#Escape ! and push it onto the stack(since it is an instruction)
SmileBASIC
?@H[1]+@e[!0];CHR$(108);"lo world!
Another solution:
CLS?"He__o world!
LOCATE 2,0?@l[1]*2
TI-BASIC, 33 bytes on-calculator
"l→Str1:Disp "He..o World!
Str1:Output(2,3,Ans+Ans
Since TI-BASIC uses tokens instead of characters, I limited myself by token. Make sure the screen is cleared before running the program. Note that l and o are two-byte tokens, but w is a sequence variable and d, e, and r are statistics variables, which are all one-byte tokens. This program first Displays the string without the first two l's, and then uses a different command to paste in the other two. Also note that TI-BASIC has no equivalent to a newline, but when the program ends the cursor does move down to allow further input to the calculator.
XQuery, 19 chars
"Hello World!"
Emacs Command (15 keystrokes)
He<Ctrl-3>l<Left>o wor<End>d!<Enter>
If that vim answers is legal then this must be too :)
Joking aside, macro it can become too :)
More nonsense aside, I can probably squeeze some more, but this seems to be good enough for the time being (since it beats vim).
P.S., please ignore all my nonsense (I (rarely, but)use vim too!).
JavaScript 35
With inspiration from @VisioN
alert(atob("SGVsbG8gV29y")+'ld!\n')
Malbolge
(=<`#9]~6ZY32Vw/.R,+Op(L,+k#Gh&}Cdz@aw=;zyKw%ut4Uqp0/mlejihtfrHcbaC2^W\>Z,XW)UTSL53\HGFjW
Taking it directly from the instructions on this page:
curl -sL bit.do/gBfx|perl -E'@Q=map{m%OUtPUTS The chARAC.ERS\N*?>([^<]+)%i?$1:()}<>;say$Q[1]'
or, if you wanna be strict with the white-spaces:
PERL
`curl -sL v.gd/92XIMS`=~m%ThE\WChAracTERS.*?>\K[^<]+%i;say$&
or
`curl -sL v.gd/qmwAMh`=~m%outpUtS\WTHE\WChAracTERS.*?>([^<]+)%i;say$1
Advantage: will work for every sentence, but please don't change wording of the question :)
Rules: we can consider this question being an "internal" resource. Without this question, no one would solve it. Should it be me or the program reading it? :)
Backstage story: I almost teared out all my hair trying to debug this! :)
First solution
- using
wget -O-leads to 3x- sedneeded too many/- so I need cur
land perl, but all perl loops likeuntil,whilecontain 3rdl! - I needed to replace the loop, this is quite complicated but
- it seems
$1only works after positive (=~) not negative (!~) match - I couldn't use
!(..)- too many parentheses :x - neither I could use
||(I need a pipe!) oror(perl, curl ...)
- it seems
Second solution
- I reread the rules. White-spaces shouldn't be repeated either - oh my!
- At least could recycle the
do{}whileidea. Better said, it was forced, the map solution could not be used for using()2 times, 3rd needed to callopensince no more whitespaces are left. - Find proper url shortener was a story, using
goo.gl,bit.ly,is.gdorow.lywas obviously impossible for the first solution, as wasbit.doanddft.bafor the second. Then, url-shorten the URL until you get something you can use, especially withbit.lyandv.gd. Why on earth they use so much lowercase characters?
The regex could be shortened, but I like the instructions to be as long as possible :-)
These rules are damn crazy :)
PERL v5.10 say feature has to be enabled, e.g. by running PERL
-E option
R
Not gonna win anything, but I didn't see R yet...
'He\154\154o, World!'
'Hello, Wor\154d!'
Javascript, 19ch
> 'Hello Wor\154d!\n'
Character count:
> "'Hello Wor\154d!\n'".length -> 15 //cough, cheating
> "'Hello Wor\\154d!\\n'".length -> 19
With your choice of return, alert(), or nothing? Man, javascript has too many contexts.
Slightly more interesting: ["He",,'o World\n'].join('l')
Plain TeX - 18 chars
He^^,lo world!\bye
Remark: TeX terminates the paragraph before shipping it, so the "newline" is actually included.
Active Server Pages (Classic ASP):
Hel<%REspOnsE.wRite Chr((0<0>-.6&"!")+&H6C+h-dinptO)
%>o world!
Each character is used twice!
To run it, you'll need a web server running IIS.
Save it in the site root with a ".asp" extension, make a HTTP request to the server, and you'll see that the response text is exactly "Hello world!" and a new line:
Hello world!
Edit: You could also use this smaller code:
Hel<%= Chr((0<0>we=6&"!")+&H6C+hd)
%>o world!
Or this:
Hel<%= CHr((0<1>wedC=8&"!&")++108)
%>o world!
JavaScript (52 characters)
alert(['He\x6C\x6Co world!'][(!1,0)-0], +-1+"Hadtw")
Each character is used 2 times, and it doesn't use any comments!
Edit: I've just posted the same answer here.
PHP
I am amazed at how many people give invalid answers without mentioning they are.
My attempt, only reusing o" characters twice.
<?Php EchO "Hello wor\154d!";
Edit: fixed thanks to @FireFly: i understood to use each character once. This is no challenge anymore.
Actually I don't like cheating :P
Python
print("!dlrow os%eH"[::-1]%('l'*2))
BASH
printf "a\107Vs\x62G8gd29ybGQhCg=="|base64 -d
Vim command (18 keystrokes)
iHeEsc3alEscio WorRightd!Enter
Doesn't repeat any keystroke more than twice.
It kinda violates the "user input" rule since it's still the user that needs to input that sequence, but I suppose if you store it as a macro or an nnoremap beforehand it would count, since you're just running it without explicitly doing any input to make it happen.
It also requires nocompatible to be set, which may count as using external resources, so I have provided another variation below:
Vim command (21 keystrokes)
iHeEsc3alEscio WorCtrl+[$ad!Enter
This variation doesn't require nocompatible to be set, although it does work around using Esc three times by using Ctrl+[ in its place.
C, 41
main(){printf("He%clo world!%c",108,10);}
AWK and echo
EDIT: fix the extra o's following the note. (thanks ProgramFOX)
echo He: | awk -F: '{print $1,Q,"\157 Wor",Q}' OFS=l ORS=d\!
and thanks awk which give me the option to say "-F" instead of "IFS=" (:-)
You have to use more expressive languages.
Chinese, 6 4 3 chars
喂世!
Running google translate on this produces Hello world!
(thanks @sreservoir and @Quincunx for the update)
k/q (25 chars)
-1@.h.uh"Hello wor%6cd!";
works in either k or q
(btw, the validity can be checked elegantly with |/#:'="-1@.h.uh\"Hello wor%6cd!\";")
Sclipting, 11 characters
丟낆녬닆묬긅덯댦롤긐뤊
I saw this beautiful HelloWorld program on esolang's Hello World program list.
Яussian
Хелло мир!
A mix of transliteration and proper language :) Google translate will turn it into proper "Hello world!"
POSIX shell (Bash et al) - 26 chars
printf 'Hel\x6Co world!\n'
nginx.conf
return 200 "Hello world!\n";
In action:
% curl -6 http://localhost/ | lynx -dump -stdin
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 21 100 21 0 0 20958 0 --:--:-- --:--:-- --:--:-- 21000
Hello world!
%
c-41
main(){printf("He%clo world!%c",154,10);}
Lua - 22 characters
print"Hel\108o World!"
Simple enough, example output
lua -e 'print"Hel\108o World!"'
Hello World!
newLISP
Such a cruel challenge for a Lisp-like language, where so much is possible if only you don't count parentheses... :) But a solution can be found:
(eval-string(encrypt {`4?3%;=6^9z*9&^m=>*],c;W}{HDMZKOQX~B2OUJ1MJQX1HBF~KU2FZD}))
(81 characters)
which uses the simple encrypt function to pass a command through to the evaluator. The actual command is (println {Hello world!}). (Having "z" and "Z" and "Z" is allowed, according to the comments...:)).
C, 192 chars
#
#
/*$$@``*/ATION_[]={9.};main(BBCDDEEFFGGHJJKKLLMMPPQQRRSSUUVVWWXXYYZZabbdefgghhjjkkmpqqsstuuvvwxyyzz) {printf("He%clo \
world!%c\
",2^7&!8.&~1|~-1?4|5?0x6C:48:6<3>2>=3<++ATION_[0],'@'^79-5);}
Since this isn't golf, I decided to have some fun and try to use every character exactly twice (while putting as few as possible in a comment, because that's boring). I realise that I didn't do terribly well, since my code contains a ton of boring "dead" code too (not in the literal sense, but in the sense of placeholder characters just used in order to fullfil the requirement). Anyway, this was surprisingly hard (but fun) with the two-character limitation, so unfortunately I couldn't come up with anything more interesting. It did give me an idea for a new problem though...
(Updated per @ugoren's comment.)
C
q=7103816;
main(){printf("%slo world!%c",&q,2+8);}
Works on little-endian platforms, where 7103816 is encoded the same as Hel\0.
C (32 characters)
main(){puts("He\x6clo world!");}
JavaScript [37 bytes]
alert(atob("SGVsbG8g")+'wor\x6cd!\n')
Too primitive isn't it?
PHP 5.1.2+
<?="\x48".hasH_file(@cRC32b,__FILE__,'« Tý'|5)." wor\X6Cd!";
The code hashes itself to get the remaining characters. Repeats the characters ".\,'_
A tab messes up the formatting. Base64:
PD89Ilx4NDgiLmhhc0hfZmlsZShAY1JDMzJiLF9fRklMRV9fLCfCqwlUw70nfDUpLiIgd29yXFg2Q2QhIjs=
HTML - (16 Chars):
Hello World!
Proper HTML would be to put a ; after l but it still compiles fine. :)
Node.js - 54 Unicode characters
eval([]+Buffer('consolť.ŬůgĨĢHťŬɬů wɯrɬd!Ģĩ',"ascii"))
console.log outputs a given string and a line shift, unfortunately that initially leaves me with way too many ls and os, so it took some work.
The code creates a buffer from a string and is told to use ascii encoding, this effectively takes all character values mod 256 and stores them in the buffer, the buffer is then added to an empty array, which cause both buffer and array to be converted to string before the addition, an empty array converts to an empty string, and the buffer is implicitly converted using UTF-8 encoding. The result is evaled to produce the desired result.
Perl, 28 chars
printf"He%so world!\n",'l'x2
Rules tested with:
perl -e '$"="\n";@a=split//,<>;print"@a";' | sort | uniq -c | sort
q/kdb [16 chars]
"hel\154o world"
Perl, 29 characters
This answer includes x-rated clogs!
say"07-8*d<#B+>!"^xRATEDkL0GZ
Perl, 23 characters
Shorter, but no porno shoes. :-( Same basic idea though...
say'0@@lo World!'^"x%,"
Perl, 20 characters
Boring...
say"Hello Wor\x6Cd!"
Haskell, 27
main=print"Hello Wor\108d!"
Twice-check:
import Data.List
main=getContents>>=print.all((<3).length).group.sort
PHP
32 Chars
Note how I am not using a character more than twice, since l != L
He<?=strtolower("LLO WOR");?>ld!
Also note that, despite of Stack Overflow deleting it in the representation, there's a line break after the !.
Java
Okay I found this on SO, it doesn't output a big H
Rare sequence of random stream of digits for 2 specific seeds.
Probably fixed out by brute forcing
One of the SO solutions also include a brute forcer to make your own sequences.
System.out.println(randomString(-229985452) + " " + randomString(-147909649) + "!");
And randomString() looks like this
public static String randomString(int i)
{
Random ran = new Random(i);
StringBuilder sb = new StringBuilder();
for (int n = 0; ; n++)
{
int k = ran.nextInt(27);
if (k == 0)
break;
sb.append((char)('`' + k));
}
return sb.toString();
}
Source: https://stackoverflow.com/questions/15182496/why-does-this-code-print-hello-world
Befunge 98
a"!dlrow ol":'e'Hck,@
Here is a version where every character appears twice.
bka!e:dw"H@!dlrow ol":'e'Hbk,a,@
Leaves a bunch of junk on the stack.
As a bonus, every single character has something done with it by the IP.
Clojure (35)
(printf "He%c%co world!\n",108,108)
The whitespace almost got me, but Clojure allows the use of commas to separate parameters.
JavaScript, 66 characters
alert('Hel'+window.atob("\x62G8gd29ybGQhCg=="));//rH+in.\x689yQhC;
Inspired by FireFly, every character used by this code is used exactly twice.
PHP, 33 chars
I just love how much PHP is forgiving and understanding!
<?=Hel.str_rot13("yb jbe").'ld!';
Before it was deleted (or if it's still there, I'm totally blind), I saw a comment saying "No brainf*ck? :D". Well, it is pretty much impossible to write a solution in BrainF*ck, as you know. But I managed to code this, just for the lulz.
++++++++++[>++++>+++++>++++++>+++++++>++++++++++>+++++++++++>+++++++++<<<<<<<-]
>>>.+++.--.>++.>+.+++++++.<<<<++++++.>>>>>+++++.+.--.>+++++.<.---.+++++.<<<<-.+
+.<------.------.>>>>>+++++.<----------.<<<<--.>>>>++++++++.--------.+++.
<<<<++.+++++++.+++++.-------.>>>>+++++++.--------.<<<<------.++++++.>++++++++.
If you don't have a BF interpreter, the code above just prints the PHP one :P
In C. Choose one of these.
My favourite (crazy but compact in memory):
#include <stdint.h>
printf("%s", (char*)(int32_t[]){1819043144,1870078063,6581362});
For those who like big numbers:
printf("%s", (char*)(int64_t[]){8031924123371070792,43509902450});
Or here the more descriptive versions:
printf("%s", (char*)(int32_t[]){0x6c6c6548,0x6f77206f,0x646c72});
printf("%s", (char*)(int64_t[]){0x6f77206f6c6c6548,0x0a21646c72});
char map:
H e l l o w o r l d ! <LF>
48 65 6c 6c 6f 20 77 6f 72 6c 64 21 0a
(remember to swap big/little endian bytes when composing)
Btw: why there is no 128 bit integer in C?
printf("%s", (char*)(int128_t[]){0x0a21646c726f77206f6c6c6548});
printf("%s", (char*)(int128_t[]){802616035175250124568770929992}); // string uses only 100 of 128 bits
Hexish
0B
Ruby (1.9+)
Since this is a popularity contest let's try to not use ANY of the characters from 'Hello world!' while still using other characters only a maximum of two times:
puts("S\107VsbG8gV29ybGQhCg".unpack(?m))
It's 40 chars btw.
Bash
And this one uses unicode magic.
Notes:
- While the orignal characters appear elsewhere (unlike the ruby example), the printed string contains only non-ascii characters.
- Two from the three spaces are actually tabs, so there are no utf-8 characters that appear more than 2 times
- As binary some of the octets do appear more than 2 times, hopefully that's not against the rules. I'm trying to resolve them though.
Code:
echo '𝓗𝐞𝑙𝒍𝓸 𝓦𝗈𝖗𝖑𝘥¡'|iconv -t asCIi//TRANSLIT
For those who don't have a proper font installed it looks like this:

Here is the hexdump:
00000000 65 63 68 6f 20 27 f0 9d 93 97 f0 9d 90 9e f0 9d |echo '..........|
00000010 91 99 f0 9d 92 8d f0 9d 93 b8 e2 80 8a f0 9d 93 |................|
00000020 a6 f0 9d 97 88 f0 9d 96 97 f0 9d 96 91 f0 9d 98 |................|
00000030 a5 c2 a1 27 7c 69 63 6f 6e 76 09 2d 74 09 61 73 |...'|iconv.-t.as|
00000040 43 49 69 2f 2f 54 52 41 4e 53 4c 49 54 0a |CIi//TRANSLIT.|
0000004e
You have to run it on a machine where the default charset is utf-8. I tried on an OSX10.8 using iTerm2 with the following environment:

PHP 5.4
This uses zLib: (unfortunately it does uses the characters e and o)
<?=gzuncompress('x▒▒H▒▒▒W(▒/▒IQ▒!qh');
Hexdump:
00000000 3c 3f 3d 67 7a 75 6e 63 6f 6d 70 72 65 73 73 28 |<?=gzuncompress(|
00000010 27 78 9c f3 48 cd c9 c9 57 28 cf 2f ca 49 51 e4 |'x..H...W(./.IQ.|
00000020 02 00 21 71 04 68 27 29 3b |..!q.h');|
00000029
+1
Here is the ruby 2.0 code I used to test for duplicates:
d=ARGF.read
p [d.split(//),d.unpack('C*')].map{|x|x.inject(Hash.new(0)){|i,s|i[s]+=1;i}.select{|k,v|v>2}}
HTML — 17 characters
Hello world!
In action:
%echo -n "Hello world!" | wc
0 2 17
%echo -n "Hello world!" | lynx -dump -stdin
Hello world!
%
Piet-- No characters whatsoever!

C - 43 Characters
main(){printf("Hel%co World!%c",'k'+1,10);}
Output
Hello World!
Character Counts
' ' Count: 1 '!' Count: 1 '"' Count: 2 '%' Count: 2 ''' Count: 2
'(' Count: 2 ')' Count: 2 '+' Count: 1 ',' Count: 2 '0' Count: 1
'1' Count: 2 ';' Count: 1 'H' Count: 1 'W' Count: 1 'a' Count: 1
'c' Count: 2 'd' Count: 1 'e' Count: 1 'f' Count: 1 'i' Count: 2
'k' Count: 1 'l' Count: 2 'm' Count: 1 'n' Count: 2 'o' Count: 2
'p' Count: 1 'r' Count: 2 't' Count: 1 '{' Count: 1 '}' Count: 1
LINQPad, C# Expression - 22 chars
"Hello w\x6fr\x006cd!"
Scala: 34 29 characters
I'm proud of myself for this one:
printf("He%c%co world!\n",108,108)
Had a really hard time overcoming duplicate 'l's, 'r's, quotation marks and brackets. Then I discovered the old Java printf function, which will happily convert numbers to letters when given the %c format specifier.
Update
MrWonderful did a wonderful thing by pointing out that a whole bunch of characters can be saved by using up my second 'l' manually in the string!
printf("Hel%co world!\n",108)
C - 46 Characters
main(){printf("He%clo wor%cd!\x0d",'l',108);}
Prints out:
Hello world!
Perl: 34 characters
$_="He12o wor3d!
";s{\d}{l}g;print
Sample run:
bash-4.1# perl -e '$_="He12o wor3d!
> ";s{\d}{l}g;print'
Hello world!
(Not a big deal. Posted just to use at least once in my life s/// with those fancy delimiters.)
HTML Fiddle - 21 characters
Hello World!<br>
Ruby: 27 characters
puts [:Hel,'o wor',"d!"]*?l
Sample run:
bash-4.1# ruby <<ENDOFSCRIPT
> puts [:Hel,'o wor',"d!"]*?l
> ENDOFSCRIPT
Hello world!
Ruby: 25 characters
(Based on Vache's comment.)
puts 'He'+?l*2+"o world!"
Ruby: 23 characters
(Copy of Danko Durbić's Powershell answer.)
puts"He#{?l*2}o world!"
nginx.conf
set $i l;
return 202 "Hel${i}o world!\n";
In action:
opti# curl -6v "http://localhost/"
* About to connect() to localhost port 80 (#0)
* Trying ::1...
* connected
* Connected to localhost (::1) port 80 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.26.0
> Host: localhost
> Accept: */*
>
< HTTP/1.1 202 Accepted
< Server: nginx/1.4.1
< Date: Fri, 17 Jan 2014 18:02:08 GMT
< Content-Type: application/octet-stream
< Content-Length: 13
< Connection: keep-alive
<
Hello world!
* Connection #0 to host localhost left intact
* Closing connection #0
AWK,34
BEGIN{printf"Hel%co world!\n",108}
Hmm.
In C, given these rules, we can only have one #define (because of i and n) and at most two function calls OR definitions (( and )).
I presume there's pretty much only one way to do it (though I'm probably wrong):
main(){puts("Hello w\x6fr\154d!");}
Python 3 [38 bytes]
exec('import '+chr(95)*2+"h\x65llo__")
I wouldn't consider import __hello__ as an external resource.
GolfScript, 21 characters
'He'[108]+"lo world!"
108 is the ASCII code for l.
First, I push He on the stack. Then, He gets popped and becomes Hel. Then I push lo world! on the stack. Now there are two elements on the stack. Because at the end of a GolfScript program, everything of the stack is outputted, this program outputs:
Hello world!
followed by a newline, because Golfscript always outputs a newline.
GolfScript
'He
o world!'n/"l"*
Substitutes two newlines (fortunately the third one, needed for the substitution, is provided by the built-in n), using both types of string literal to avoid quadruplicate copies of a quote mark. Since l is the only character which occurs more than twice in the original string, it's not too hard.
Powershell, 20
"He$('l'*2)o world!"
HQ9+, 1 char
H
keeping it simple :)
