This challenge is not about computing φ! It's about printing as many digits as possible without using any method for doing that twice. So find as many creative ways to get your digits as you can!

Restrictions

By itself, printing the digits of φ would be a bit too simple, so here are the rules:

You have to construct the number in order from left to right, either by printing it piece by piece or by constructing a string from left to right and printing it at the end - you could even generate an array of digit characters and then join it and print it, as long as you do it in order. In the following rules "print" and "output" may refer to any of those processes (e.g. if you're building a string, and the string contains 1.6 that counts as having 1.6 already printed).

For your code you get a budget of 15 characters per digit. The period does not count towards that budget, but has to be printed as well. Note that the restriction is only on total code size: you may use more than 15 characters for any digit as long as you don't use more on average. In fact, you may build up a "debt" in characters and "pay it off" later. E.g. to print 1.618 you have 60 characters.

Standard-library includes/imports do not count towards the code size. But you can't give those includes shorthand aliases for free!

You must not use the digit you are currently generating, nor any you have already printed. E.g. 1 may appear nowhere in your source code, because it's the very first digit. The code that outputs the 8 in 1.618 may use any or all of the digits [0234579], but none of [168]. For this purpose, all literals that are equivalent to a single digit are treated as that digit. So if your language can represent 9 as '\t' you are not allowed to use that anywhere, where you couldn't use an 9 instead.

You must not produce multiple digits at once. It should be possible to clearly split your code into chunks that generate one digit a time.

You must not refer to any built-in function, mathematical/boolean/bit-wise/string operator, variable or constant which you have used in code that generated an earlier digit. Exceptions are integer-to-string conversion, string concatenation and printing functions which you might need for every single digits. Note that it doesn't matter by which name you refer to any built-in: just because you alias a built-in PI to both p and q doesn't mean you get to use p once and q once. Likewise, you are allowed to use a name twice if it refers to two different built-ins, like string length and array length.

If your programming language doesn't have functions use your best judgement on what the equivalent would be - e.g. for bash scripting, invoking other programs should follow the rules imposed on functions

Your submission must be written in a single language. So no executing another language's interpreter to get access to that language's built-ins as well.

Implications

The following points are all implied by the above rules, but I add them here to avoid questions that have already come up in the sandbox::

You're not allowed to overwrite parts of your output by printing some backspaces (usually '\b') in between.

Loops which generate/output multiple digits are forbidden. (Loops that compute a single digit are fine, though.)

Using an obfuscated version (1 + √5)/2 or dividing Fibonacci numbers to obtain more than a single digit is forbidden.

You cannot precalculate the 10 digits and store them in 10 variables and then just refer to those, because those variable references dont' generate the digit - the code that fills the variable does, so this is a violation of rule 6.

In fact, you can't reuse any previous (or intermediate results), because that would mean two digits would share code for being generated.

Otherwise, you can use any means whatsoever (which do not have to purely mathematical) to generate the digits. (And you should!)

In fact there is no need to calculate anything, if you can pull out the correct digits from many different places using your standard library.

You may use an operator multiple times while generating a single digit, so 2+2+2 is fair game to generate the first 6 (although it's unlikely the shortest).

You may use any literal as often as you want, because they are not built-in constants. So as long as you don't have to print 5, you can as many 5s in your code as you want.

You can't hardcode the output, because that would involve using the digits you are outputting.

In short: don't use any method of generating digits twice and don't use the digit you are currently outputting or any have already printed.

If you do spot a loophole which allows you to get a (quasi-)infinite score, please don't ruin the challenge by exploiting it, but let me know so I can see if the loophole can be fixed without breaking anything.

Scoring

The program that prints the highest number of digits correctly wins. In case of a tie the shorter code breaks the tie.

Please add an ungolfed commented version that identifies which part of your code generates which digit.

Hm, I have to admit that is probably valid. The only thing it might fall under is "multiple names referring to the same constant", but I didn't actually intend that wording to cover this case. I clarified in kernigh's answer that this would be only invalid if the actually pointed to the same integer, but I think that's unlikely. The fact that a lot of this does depend on your system is a shame, but not part of the rules either. So unless someone else can spot a problem here, I'll have to admit that your answer is perfectly valid. ;)
–
Martin Büttner♦May 21 '14 at 18:21

<?for(;;); uses 9MB of memory. Now I know why... I do like @kernigh's self-imposed restriction #7, though, which closes this sort of loophole. Also, for what it's worth, the output on my system is this: codepad.org/wSrtJBco
–
primoMay 22 '14 at 3:32

Although, running the generator does produce a valid representation, so +1 for that ;) A version that runs on the codepad server: codepad.org/myBpc6cB
–
primoMay 22 '14 at 3:56

1

Congrats, you broke the challenge. ;) ... Not really... this answer does sidestep the actual challenge somewhat, but it's well within the rules as far as I can see, so I'll have to admit defeat and accept it. :)
–
Martin Büttner♦May 28 '14 at 17:31

I've added a few additional restrictions to limit the use of language features that would trivialize the problem. For example, array dereference @{...} and array final index $#{...} are only used once. Each array used is generated in a different manner (compare [c,c,c,c], [b..j], split('',$~), map(glob,"{,,,}{,}")). Additionally, no symbol or bareword is used more than once, although this is explicitly allowed in the challenge description. I think it's a good idea for perl (or any language with int-only special variables (are there any others?)), because it limits the number of implicit int conversions.

This answer was posted before the backspace-loophole was closed. As it's quite a clever trick and is not harmful to the challenge in this case (and because this was the answer that actually pointed me to the loophole), this answer may remain as is - so please don't downvote it based on that, rather upvote it for cleverness. :)
–
Martin Büttner♦May 19 '14 at 23:46

This program works with ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-openbsd]. Systems other than OpenBSD 5.5 might have different values for a few digits.

Interpretations

The restrictions of this challenge, especially restriction 6, are not precise for Ruby. So I add my own interpretations:

The parentheses, dot and double-colon are not operators. The parentheses just change the order of operations. The dot calls methods, as in $<.fileno, and the double colon gets constants, as in IO::LOCK_NB. The name of the method or constant is part of the operation. Because ().:: are not operators, I do not apply restriction 6 to them. I may reuse them to generate more digits.

A method with a different implementation is a different method. For example, Array#count and Enumerable#count are not the same function for restriction 6. Both methods act the same, but Array#count overrides Enumerable#count with a different implementation. If I use Array#count to generate one digit, I may use Enumerable#count to generate another digit.

Class#new is one method. In Ruby, Mutex.new, Random.new, Time.new and so on refer to the same method, Class#new. I use SignalException.new to generate one digit. Because of restriction 6, I may never again use Class#new.

Constants for classes or modules are still constants. In Ruby, class names like Float and IO are constants! I use IO::LOCK_NB to generate one digit. Because of restriction 6, I may never again use IO. This interpretation binds only Ruby, and not other languages where package names are not constants.

Literals are not constants. Though 2 is a mathematical constant (independent of any variables), it is not a constant in Ruby. I do not apply restriction 6 to literals, and I may reuse the literal 2 for more than one digit.

Literals are not operators. I do not apply restriction 6 to the brackets or quotes that form literal arrays, hashes, regular expressions, or strings, as in []{}//''. I may always use such literals to generate more digits.

Two constants with the same value are the same constant.File::APPEND and IPSocket::LOCK_UN are two names for the same number 8. Restriction 6 says, "it doesn't matter by which name you refer to any built-in." Because File::APPEND and IPSocket::LOCK_UN differ only by name, they must be the same constant, so I may not use them for two digits.

Two digits may not refer to the same global variable. This closes a loophole. Restriction 6 only applies to functions, operators and constants. Restriction 4 only applies to literals. $SAFE is a built-in global variable, not a function, operator, constant, nor literal. $SAFE has the value 0. With the loophole, I can reuse $SAFE to generate every digit 0 in the program. I close the loophole by interpreting restriction 6 to also restrict global variables.

Comments

The first line is #!ruby -rdate -rdigest -ropenssl -rprime -rset -rsocket. Ruby parses this line and loads six parts of its standard library, as if by require 'date', require 'digest' and so on. I do not count these 56 characters, because restriction 3 exempts "standard library imports/includes".

The rest of the program calls print with a long list of arguments, to convert them to strings and print them in order. The arguments are these:

This is the same value as SystemExit.new(false).status, but by interpretation 3, I may no longer call Class#new. Instead I raise and rescue a SystemExit.

7 from Process::RLIMIT_NPROC: number for resource limit for number of processes for one user

7 from :aaaaaaa.size: length of symbol Symbol#size

2 from Prime.first: first prime number Enumerable#first

0 from ?/.next: next string after "?" String#next

3 from {a:p,b:p,c:p}.size: length of hash Hash#size String#p

0 from STDIN.lineno: current line number for standard input IO#lineno

By interpretation 8, I may not reuse $<. I use STDIN. The difference is that $< is a global variable and STDIN is a constant. A program may set $< to a different input, but STDIN is always the original value of $<.

Impressive! Most of your interpretations are in line with the rules anyway. 1. I never intended invocation, dereferencing and access operators to be restricted, which is why I said "mathematical, boolean, bit-wise and string" operators. 2. Covered by rule 6. 3. Reusing new would be fine in other languages, because it's usually an operator - it just can't be reused on the same class because it calls a constructor (built-in function). How is that in Ruby? Does new really always call the same imlpementation or is it overridden in subclasses? [ctd.]
–
Martin Büttner♦May 21 '14 at 6:35

4. I'd be fine if you made an exception there for Ruby, but thanks for your sportsmanship. ;) 5. and 6. No they aren't, which is why some of the rules are stated the way they are. 7. That's a good subtle point I didn't think about. Technically, if they don't refer to the same 8, it would be fine to use both of them. 8. Good point, I didn't think about built-in variables. I'll check if it doesn't substantially break any other submission and amend rule 6. Thanks for playing fair! :)
–
Martin Büttner♦May 21 '14 at 6:39

I couldn't find any rule violation in this answer so I accepted it. However, I would like to reward your answer, as it's by far the longest one that actually plays by how the challenge was intended. Therefore, I will offer a bounty for this challenge. The bounty will run for seven days though and should an answer come along that beats yours in a "fair" way, I'll award the bounty accordingly. (Of course, you're free to try and beat any contenders ;).) Hope you're alright with that!
–
Martin Büttner♦May 28 '14 at 17:52

"Haven't been forced to do anything particularly clever yet." Yeah, I figured Ruby, Perl and the usual suspects would not have a really hard time with 15 characters per digit, but I wanted to leave room for things like C-derivatives and Mathematica with large standard-libraries but more convoluted names.
–
Martin Büttner♦May 19 '14 at 21:50

"If they are really only aliases, no [you cannot use them]." succ and next are aliases.
–
Doorknob♦May 20 '14 at 0:25

The first is being called on a Fixnum, the second on a String, so I don't think they count as the same method.
–
histocratMay 20 '14 at 0:35

Ah, good point. However, the question also says "You must not refer to any... constant which you have used in code that generated an earlier digit," and you use $. twice. Although, gotta love $.... :D
–
Doorknob♦May 20 '14 at 2:11

Mathematica 9 8 digits, in 8683 78 characters.

Ah, I knew I made a mistake somewhere.Prefix notation doesn't quite seem to work in this case. Using unicode Pi and Degree, does seem to still work.
–
TallyMay 23 '14 at 15:13

Yeah, that #&''[] will generate an error from missing input, while in this form it ignores that it got no input. Still doesn't excuse me from not using it where it works though.
–
TallyMay 23 '14 at 15:24

I interpreted characters and strings as usable, so long as I did not re-use a specific character or string (characters in a string could be re-used, as long as the string was not); however, I did not permit myself to use the int value of a character directly. There is one non-ASCII character (й).

The literals are fine (because they are not equivalent to single-digit numbers), but you keep reusing the - operator. Also, I like how you counted the comment for the line length. :D
–
Martin Büttner♦May 21 '14 at 20:18

Yes that looks much better, but you are using 1 to produce a 0 (which is disallowed, because the 1 appeared earlier in the golden ratio). Also you do need to count the #define S (not the other one), as it's not an include but just defining a shorthand alias.
–
Martin Büttner♦May 22 '14 at 20:13