text:
N-dimensional N^N array filled with N
In: Enough memory and a positive integer N
Out: N-dimensional N^N array filled with N, where N^N means N terms of N-by-N-by-N-by...
Examples:
1: [1] which is a 1D array (a list) of length 1, containing a single 1
2: [[2,2],[2,2]] which is a 2D array (a table) with 2 rows and 2 columns, filled with 2s
3: [[[3,3,3],[3,3,3],[3,3,3]],[[3,3,3],[3,3,3],[3,3,3]],[[3,3,3],[3,3,3],[3,3,3]]] which is a 3D array (a cube) with 3 layers, 3 rows, and 3 columns, filled with 3s
4: [[[[4,4,4,4],[4,4,4,4],[4,4,4,4],[4,4,4,4]],[[4,4,4,4],[4,4,4,4],[4,4,4,4],[4,4,4,4]],[[4,4,4,4],[4,4,4,4],[4,4,4,4],[4,4,4,4]],[[4,4,4,4],[4,4,4,4],[4,4,4,4],[4,4,4,4]]],[[[4,4,4,4],[4,4,4,4],[4,4,4,4],[4,4,4,4]],[[4,4,4,4],[4,4,4,4],[4,4,4,4],[4,4,4,4]],[[4,4,4,4],[4,4,4,4],[4,4,4,4],[4,4,4,4]],[[4,4,4,4],[4,4,4,4],[4,4,4,4],[4,4,4,4]]],[[[4,4,4,4],[4,4,4,4],[4,4,4,4],[4,4,4,4]],[[4,4,4,4],[4,4,4,4],[4,4,4,4],[4,4,4,4]],[[4,4,4,4],[4,4,4,4],[4,4,4,4],[4,4,4,4]],[[4,4,4,4],[4,4,4,4],[4,4,4,4],[4,4,4,4]]],[[[4,4,4,4],[4,4,4,4],[4,4,4,4],[4,4,4,4]],[[4,4,4,4],[4,4,4,4],[4,4,4,4],[4,4,4,4]],[[4,4,4,4],[4,4,4,4],[4,4,4,4],[4,4,4,4]],[[4,4,4,4],[4,4,4,4],[4,4,4,4],[4,4,4,4]]]]

5 and 6: Please see one of the answers.

If our language does not support arrays, what would be an acceptable output format?

@Okx JSON, or any other unambiguous array notation.

Since "Enough memory" is part of the input, I want to see an answer that controls a robot to actually take the memory as input and plug it in before using it.

Do all the arrays need to be distinct objects?

@user2357112 I think that's more of a precondition type issue. I doubt the op actually expects the function to accept memory as input.

@TheGreatDuck Correct, but I'm pretty sure user2357112 meant it as a joke.

@Neil I don't understand. Can you elaborate?

Take the case N = 3. Am I allowed to write (unrolled) a = 3; a = [a, a, a]; a = [a, a, a]; a = [a, a, a]; or must I write a11 = [3, 3, 3]; a12 = [3, 3, 3]; a13 = [3, 3, 3]; a1 = [a11, a12, a13]; /* etc. for a2 and a3 */ a = [a1, a2, a3];?

@Neil Ah, they are pointers, so the if one sets the very first element of the first a to 2, all the elements of a become 2, whereas that isn't the case for the second a. The first is fine too, if it isn't too much work, I'd be interested in seeing both for comparison.

and 6. seem expired.

@sergiol Now that there are plenty of answers, you can just use one of the Try it Online! links to generate the desired outputs.

can I have a trailing comma at the end of the answer like "[1]," or "[[2,2],[2,2]],"

@JoshM You're supposed to return/output an array.

@Adám nvm I figured it out

The hastebin links seem to be broken. They redirect me to the main site

Python, 32 bytes
lambda n:eval('['*n+'n'+']*n'*n)

Try it online!
Makes a string like "[[[n]*n]*n]*n" with n multiplcations, and evaluates it as Python code. Since the evaluation happens within the function scope, the variable name n evaluates to the function input.

the scope trick is genius

+1, that eval trick really golfs down a lot of bytes

J, 4 bytes
$~#~

Try it online!
Explanation
$~#~  Input: integer n
  #~  Create n copies of n
$~    Shape n into an array with dimensions n copies of n

When I saw the challenge title, I thought of J immediately. Pretty cool that J even beats Jelly (the golfing language inspired by J).

There's also $~$~ which is equivalent while also repeating itself

$~$~ translated to English... MONEY, get more of, MONEY, get more of...

APL (Dyalog APL), 4 bytes
⍴⍨⍴⊢

Try it online!

Btw, ⍴⍨⍴⍨ works too, while looking cooler.

Mathematica, 22 20 bytes
(t=Table)@@t[#,#+1]&

(* or *)

Table@@Table[#,#+1]&

JavaScript (ES6),  44  40 bytes
f=(n,k=i=n)=>i--?f(n,Array(n).fill(k)):k

Demo

f=(n,k=i=n)=>i--?f(n,Array(n).fill(k)):k

console.log(JSON.stringify(f(1)))
console.log(JSON.stringify(f(2)))
console.log(JSON.stringify(f(3)))
console.log(JSON.stringify(f(4)))

Octave, 35 33 25 23 20 bytes
@(N)ones(N+!(1:N))*N

Try it online!
@(N)ones(N*ones(1,N))*N

@(N)repmat(N,N*ones(1,N))

Thanks to @LuisMendo saved 8 bytes
@(N)ones(num2cell(!(1:N)+N){:})*N

Try it online!
Previous answer:
@(N)repmat(N,num2cell(!(1:N)+N){:})

Try it online!

@LuisMendo Rats, I was just going to post that one ;)

@beaker Whoops :-)

R, 26
This is the obvious answer but perhaps there is something cleverer?
n=scan();array(n,rep(n,n))

is scan() necessary?

Looking at the other answers, it seems like it either has to be a function or accept input somehow?

Right, I don't know R at all. I just thought that you could specify a function somehow instead.

Yes, you can replace n=scan(); by function(n) but it makes it longer.

can it be scan()%>%array(rep(.,.))? It uses magrittr operator

pryr::f(array(n,rep(n,n))) creates an unnamed function instead of using scan, but doesn't save any bytes.

You can save one byte by putting the n assignment inside of array: array(n<-scan(),rep(n,n)).

@raymkchow library(magrittr) adds quite a few bytes.

I've always wondered why R coders in this section don't just use a variable name instead of scan, as other do with their languages.

05AB1E (legacy), 6 5 bytes
-1 thanks to Kevin Cruijssen
F¹.D)

Try it online!
F     # For 0 .. input
 ¹.D) # Push <input> copies of the result of the last step as an array

The leading D can be removed because the input is used implicitly again (not sure if this was a thing when you posted the answer, but you don't need the explicit D anymore now).

@KevinCruijssen I think this is one of the answers that gave us the idea to take implicitly input multiple times :)

Ah ok. I was indeed expecting it to not be implicitly yet at the time of posting, but realized that after posting my comment (which I edited). ;) Sometimes it's funny how much explicit things are being done by old answer (usually pre-2017), and how much shorter it can be done now.

Haskell, 52 bytes
f n=iterate(filter(>'"').show.(<$[1..n]))(show n)!!n

Try it online!
Inspired by @nimi's answer, but using more predefined functions.

Uses iterate and !! instead of a recursive help function.
Instead of constructing list delimiters "by hand", uses filter(>'"').show to format a list of strings, then stripping away the extra " characters.

Haskell, 62 bytes
n#0=show n
n#l='[':tail((',':)=<<n#(l-1)<$[1..n])++"]"
f n=n#n

Usage example: f 2 -> "[[2,2],[2,2]]". Try it online!.
Haskell's strict type system prevents a function that returns nested lists of different depths, so I construct the result as a string.
How it works:
n#l=                         n with the current level l is
    '[':                     a literal [ followed by
           n#(l-1)<$[1..n]   n copies of   n # (l-1)
        (',':)=<<            each prepended by a , and flattened into a single list
      tail                   and the first , removed
                  ++"]"      followed by a literal ]

n#0=show n                   the base case is n as a string

f n=n#n                      main function, start with level n

We can do the same idea shorter with more builtin functions: f n=iterate(filter(>'#').show.(<$[1..n]))(show n)!!n.

@ØrjanJohansen: that's a great idea. Please post it as a separate answer.

Could you shave a byte with (#0)=show? Not too familiar with Haskell

@Cyoce: No, that's a syntax error. For a correct syntax I could flip the arguments and use (#)0=show, but all definitions of a function must have the same number of arguments. The second line (n#l='['...) needs two arguments, so the first line must also have two arguments.

Python 2, 36 bytes

-2 bytes thanks to @CalculatorFeline
a=n=input()
exec"a=[a]*n;"*n
print a

Try it online!

~-n==(n-1).

Would it be possible to include a TIO link?

In fact, this! (-8 bytes due to optimized algorithm, +9 bytes to add output)

@CalculatorFeline You can put things in Header and Footer to avoid inclusion in byte count.

Aren't input and output required in full program submissions?

@CalculatorFeline I only meant to imply the default rules. I've removed the comment.

MATL, 8 bytes
ttY"l$l*

Try it at MATL Online (I have added some code showing the actual size of the output since all n-dimensional outputs in MATL are shown as 2D matrices where all dimensions > 2 are flattened into the second dimension).
Explanation
        % Implicitly grab the input (N)
tt      % Make two copies of N
Y"      % Perform run-length decoding to create N copies of N
l$1     % Create a matrix of ones that is this size
*       % Multiply this matrix of ones by N
        % Implicitly display the result

I can't really tell from MATL Online whether your submission does the right thing. looks like every answer is a wide matrix.

@Adám Dimensions beyond the second are displayed as collapsed into the second. So the example shows a 3x9 array instead of the produced 3x3x3 array. If you add Zy at the end of the code it tells the actual size

Jelly, 5 bytes
⁾Wẋẋv

Try it online!
How?
⁾Wẋẋv - Main link: n                            e.g.       3
⁾Wẋ   - character pair literal ['W','ẋ']                  "Wẋ"
   ẋ  - repeat list n times                               "WẋWẋWẋ"
    v - evaluate as Jelly code with input n          eval("WẋWẋWẋ", 3)
      - ...
        WẋWẋ... - toEval: n                e.g. 3
        W        - wrap                        [3]
         ẋ       - repeat list n times         [3,3,3]
          Wẋ     - wrap and repeat            [[3,3,3],[3,3,3],[3,3,3]]
            ...  - n times total             [[[3,3,3],[3,3,3],[3,3,3]],[[3,3,3],[3,3,3],[3,3,3]],[[3,3,3],[3,3,3],[3,3,3]]]

Second 5-byte Jelly answer. Still unacceptably long compared to J :-)

...and not for want of trying :D

Jelly, 4 bytes
R»µ¡

Try it online!
R»µ¡
R     Range. 2 -> [1, 2]
 »    Max between left arg and right arg. Vectorizes. -> [2, 2]
  µ   Separates into a new chain.
   ¡  Repeat 2 times. After another iteration this yields [[2, 2], [2, 2]].

Same thing but with a single monad and no need for the chain separator:
4 bytes
»€`¡

CJam, 12 bytes
ri:X{aX*}X*p

Try it online!
Explanation
ri:X          Read an integer from input, store it in X (leaves it on the stack)
    {   }X*   Execute this block X times:
     a          Wrap the top of stack in an array
      X*        Repeat the array X times
           p  Print nicely

Java 97 96 95 bytes
Object c(int n,int i){Object[]a=new Object[n];for(int j=0;j<n;)a[j++]=i<2?n:c(n,i-1);return a;}

Ungolfed:
public class N_Dim {

    public static Object create(int n) {
        return create(n, n);
    }

    public static Object create(int n, int i) {
        Object[] array = new Object[n];
        for(int j=0;j<n;j++) {
            array[j] = i<2?n:create(n, i - 1);
        }
        return array;
    }

    public static void main(String[] args) {
        System.out.println(Arrays.deepToString((Object[]) create(3)));
    }

}

can you replace i<=1 with i<2 ?

Yes @cliffrott. That worked. thanks!!

You could save a few bytes with a lambda: (n,i)->{...}

Java 8 lambdas ftw

Hmm, looks like this takes extra input. You'll need to make a separate method of just one parameter in order for this to be valid.

JavaScript (ES6), 38 bytes
f=(n,m=n)=>m?Array(n).fill(f(n,m-1)):n

The memory-hungry version of this is 45 bytes:
f=(n,m=n)=>m?[...Array(n)].map(_=>f(n,m-1)):n

Batch, 141 bytes
@set t=.
@for /l %%i in (2,1,%1)do @call set t=%%t%%,.
@set s=%1
@for /l %%i in (1,1,%1)do @call call set s=[%%%%t:.=%%s%%%%%%]
@echo %s%

Batch doesn't actually have arrays so this just prints the string representation of an array. Explanation: The first two lines build up a repeated pattern of N .s separated by N-1 ,s in the variable t. The fourth line then uses this as a substitution pattern N times to create the N-dimensional array. The double call is necessary because of how the for and set statements work. First, the for command substitutes variables. As it happens, all of my % signs are doubled, so this does nothing except to unquote them all, resulting in call call set s=[%%t:.=%s%%%]. It then repeats the resulting statement N times. Each time, the call command substitutes variables. At this point, the s variable only has a single set of %s, so it gets substituted, resulting in (e.g.) call set s=[%t:.=[2,2]%]. The inner call then substitutes the t variable, resulting in (e.g.) set s=[[2,2],[2,2]], performing the desired assignment. The final value of s is then printed.

+1 Wow, I wouldn't have expected that. All hail the humble .bat file!

Jelly, 5 bytes
Wẋ³µ¡

Try it online!
Explanation
         Implicit input: N
   µ¡    Apply N times to input:
Wẋ³        “N copies of”

Python 3, 57 53 50 38 bytes
f=lambda n,c=0:n-c and[f(n,c+1)*n]or 1

Try it online!

-4 bytes thanks to @CalculatorFeline

34 bytes:
f=lambda c,n:c and[f(c-1,n)*n]or 1

Needs to be called as f(4,4)

Why are your code lines reversed compared to your TIO link?

You can replace c>1 with c   to save 1 byte. (Markdown, stop deduplicating spaces across ```s)

@CalculatorFeline I don't think he can; that would c>0 in this particular case.

Then change the end to <space>n. Problem solved and bonus–more bytes saved! :D (So spaces at the end of inline code is possible, but not the beginning? That's strange...) TIO link

@Adám: On TIO to allow the main function to be assigned in the header and here to keep the main function on the last line.

Ruby, 27 bytes
->a{(z=a).times{z=[z]*a};z}

Only 1 byte more but using a different approach instead of the 'eval' trick from xnor's wonderful Python answer.

Ruby, 28 26  bytes
Thanks to Cyoce for saving 2 bytes!
->n{eval'['*n+'n'+']*n'*n}

Stolen shamelessly from xnor's excellent answer.

Do you need those parens?

Bash + GNU utilities, 117 bytes
n=$[$1**$1]
seq -f$1o%.fd$n+1-p $n|dc|rev|sed -r "s/(0+|$[$1-1]*).*$/\1/;s/^(0*)/\1$1/;s/^1/[1]/"|tr \\n0$[$1-1] \ []

Try it online!

The program essentially counts from 0 to (n^n)-1 in base n, where n is the input. For each base-n number k in the count, it does the following:

If k ends with at least one digit 0, print a '[' for each digit 0 at the end of k.
Print n.
If k ends with at least one digit n-1, print a ']' for each digit n-1 at the end of k.

(The value n=1 needs to have brackets added as a special case. This input value also generates some output to stderr, which can be ignored under standard PPCG rules.)
Maybe there's a shorter way to implement this idea.

Sample run:
./array 3
[[[3 3 3] [3 3 3] [3 3 3]] [[3 3 3] [3 3 3] [3 3 3]] [[3 3 3] [3 3 3] [3 3 3]]]

My Zsh solution could probably translate to Bash

Haskell, 51 bytes
Other than the existing Haskell solutions this constructs a usable data type not just a string representation thereof (and is shorter):
data L=N[L]|E Int
f n=iterate(N.(<$[1..n]))(E n)!!n

Try it online!
Explanation / Ungolfed
The reason why this is an interesting challenge in Haskell is that a solution to this challenge needs to return different deeply nested lists and Haskell (without importing external modules) does not support this. One workaround which turned out to be the golfiest, is to define our own data type:
data NestedList = Nest [NestedList] | Entry Int

Now we can just define a function f :: Int -> NestedList which is able to represent all the required data types:
pow n = iterate (Nest . replicate n) (Entry n) !! n

MathGolf, 5 4 bytes
_{a*

Try it online!
Explanation using n = 2 (note that the outermost [] are not arrays, but are just there to show the stack)
_      duplicate TOS (stack is [2, 2])
 {     loop 2 times (stack is [2])
  a    wrap in array ([2] => [[2]], [[2, 2]] => [[[2, 2]]])
   *   pop a, b : push(a*b) ([[2]] => [[2, 2]], [[[2, 2]]] => [[[2, 2], [2, 2]]])

Raku, 21 bytes
try it online!
{[[xx] [xx] $_ xx 3]}

Welcome to Code Golf! Nice first answer.

Julia 0.6, 23 21 bytes
n->n>(n>n)...
> =fill

Try it online!
(Thanks to @MarcMush for -2 bytes.)
In Julia, binary operators are parsed as function calls, so a>b is >(a, b), which here is fill(a, b). So the above is really saying:
n->fill(n,fill(n,n)...)

The first argument to fill is the value to fill the new array with. The following arguments to that are the dimensions of the new array. Here we create those dimensions themselves using another fill call: we create an array of n ns, then splat that with ... so that the first fill  call gets n number of dimension arguments, each with value n - so it creates an n-dimensional array where each dimension length is n, and filled with the value n.

21 bytes I'm surprised this works

I was wondering why @MarcMush 's improved version doesn't work if we used + or * instead of >, which lead to a Zulip discussion, and a Github issue from that. (The answer has to do with precedence btw, of > vs ... vs +,*,etc.)

this trick also works with ~, saving an additional byte Try it online!

PHP, 70 62 bytes
This is the simplest I can come up with.
for(;$i++<$n=$argv[1];)$F=array_fill(0,$n,$F?:$n);print_r($F);

Takes the input as the first argument and prints the resulting array on the screen.

Thanks to @user59178 for saving me 8 bytes!

Pre-assigning variables like that is unnecessary, as is $l. Dropping the $i=0, & replacing $lwith $n  saves 7 bytes. An additional byte can be saved by not assigning $F, assigning $n in the conditional and using a ternary $F?:$n in the array_fill()

@user59178 I don't know if this is what you had in mind or not, but, thank you for the tips. You've saved me 8 bytes!

Perl 6, 25 bytes
{($^n,{$_ xx$n}...*)[$n]}

Starts with n, and iteratively applies the "repeat n times" transformation n times, each time creating an additional level of List nesting.
Try it online!

Use $_ instead to save a byte

@JoKing: I already use $_ as the inner block's parameter, so I can't use it as the outer block's parameter as well.

Yes, but $n and $_ always have the same value. Try it online!

I, 7 bytes
I got this from my colleague, the creator of I.
#Bbhph~

#Bb     the copy # function Bound to binding

   hp   hook the argument to (the right of) the power function (repeat)

     h~ hook the argument to the left ~ (of the entire resulting function)
Try it online!

Clojure, 36 bytes
#(nth(iterate(fn[a](repeat % a))%)%)

Iterates function which repeats its argument n times, it produces infinite sequence of such elements and then takes its nth element.
See it online

Rebol, 45 bytes
func[n][array/initial append/dup copy[]n n n]

Clojure, 49 bytes
(defmacro r[n]`(->> ~n ~@(repeat n`(repeat ~n))))

Not the shortest Clojure example, but I amused myself with the quoting and unquoting.

Common Lisp, 128 102 95 79 bytes
(defun f(x &optional y)(if(if y(< y 2))x(fill(make-list x)(f x(if y(1- y)x)))))

Try it online!

05AB1E, 2 bytes
Fи

Try it online or verify the first \$[1,5]\$ test cases†.
†: Uses a Bash script to execute the 05AB1E code, so it'll use the (implicit) input within the test suite. If the number would be on the stack instead of as input, it won't work for \$n=2\$ (no idea why..): see this traditional test suite, where every output is correct except for \$n=2\$.
Explanation:
F   # Loop the (implicit) input amount of times:
 и  #  Repeat the (implicit) input the current values amount of times (as list)
    # (after which the resulting nested list is output implicitly)

tinylisp, 76 bytes
Since tinylisp was our most recent LYAL, I figured I had to at least post one answer in the lang. Embarrassingly, this answer (in a golfing dialect of lisp) is just as long as the Common Lisp solution
(load library
(d _(q((N D $)(i D(_ N(s D 1)(repeat-val $ N))$
(q((N)(_ N N N

Try it online!
This defines a helper function _ that takes three arguments, the number of times to repeat each layer N, the current depth of the iteration D (counting down, so deepest depth is zero), and an accumulator $. Depending on depth, this function either returns the accumulator (at depth zero), or uses the library builtin repeat-val to repeat the current accumulator N times, and passes that on to the next depth of the recursion. Then the actual function, A, is defined, which takes a single argument N in, and calls _ with that as all three arguments.
Non-library solution, 86 bytes
This was my first attempt to do this, without using the builtin library (which has rather ungolfy names), but it unfortunately turned out rather longer.
(d _(q((X N D I $)(i D(i I(_ X N D(s I 1)(c X $))(_ $ N(s D 1)N()))X
(q((N)(_ N N N N(

Try it online!
This works much the same as the library solution, but manually defines the behavior of repeat-val, which requires taking two extra arguments in the helper function, which takes the value X the current depth is repeating, the number of repetitions on each depth N, the current depth D (counting down to zero), the number of repetitions remaining in this depth I, and an accumulator $. The proper function A works much the same, taking N calling _ with the proper arguments. (in this case N for the first four, and nil () for the accumulator)

Here's a Try it online! link. Also, since anonymous function solutions are allowed, you don't have to include the (d A in your solution (though you do still need it for TIO).

@DLosc oh ty for the TIO link! I meant to add it when posting, but it slipped my mind, also good shout about making the actual function anonymous

Uiua, 4 bytes
↯▽..

Try it!
↯▽..
   .  # duplicate
  .   # duplicate
 ▽    # keep
↯     # reshape

A fun one: |1 ⍥|'↯|.. (repeat reshape n n times to n). Also ⍥'↯,.. that leaves n below the answer.

Perl 6, 61 bytes
my $x=prompt(0);my @a=$x xx$x;"@a=[@a] xx $x;".EVAL xx$x-1;

Big rippof from the Python 2 answer, but converted :P

Instead of my $x=prompt(0);, you can use $_=get;. You also need to print or return the result somehow, but note that the rules of this site allow writing answers as functions or lambdas instead of of full programs, which is usually shorter in Perl 6.

Clojure, 63 bytes
#(loop[a(repeat % %)d 1](if(= d %)a(recur(repeat % a)(inc d))))

This is a lambda function, usage is like so:
(#(...) {input_no})

...where {input_no} is replaced with the number.
Output for 3 is like this:
(((3 3 3) (3 3 3) (3 3 3)) ((3 3 3) (3 3 3) (3 3 3)) ((3 3 3) (3 3 3) (3 3 3)))

This uses Clojure's definition of lists, which are denoted as ().
Ungolfed code and explanation:
; Defines the function
(defn layered [n]
  ; Begins a loop with a variable depth of 1,
  ; and a list of n elements which are all n
  (loop [depth 1
         array (repeat n n)]
    ; If "depth" is equal to n, return the list
    (if (= depth n) array
      ; Else, continue on with the loop, with
      ; an incremented "depth"...
      (recur (inc depth)
        ; ...and a list which contains the
        ; list repeated n times
        (repeat n array)))))

SNOBOL4 (CSNOBOL4), 59 bytes
	DEFINE('F(N)')
F	F =ARRAY(DUPL(N ',',N - 1) N,N)	:(RETURN)

Try it online!
Defines a function that returns an ARRAY with the appropriate dimensions and filled with value N.

C (GCC), 53 bytes
Since C "has" multidimensional arrays (i.e. chunks of memory plus automatic offset calculation), this is almost a reasonable solution. Still, it's mostly a joke and borders on non-competing.
f(n){int s=pow(n,n),*p=malloc(s*8);wmemset(p,n,s);}

Try It Online
In the TIO I go through the ceremony of casting the result (which is an int) to the appropriate array type despite the fact that my array print function (appropriately) takes a generic pointer.
While I can't demonstrate that the structure of the array is determined by f (it's not), I do include a flat printout of the elements of the output for an input of 3 using the multidimensional array element access syntax, to show that the layout of the returned memory matches that of the corresponding array type.
Byte count

function: 51 bytes
compiler flags (-lm): 2 bytes

Unportability

The result pointer is returned through an int, so this may not work for all heap addresses.
By using wmemset I require that the sizes of int and wchar_t are equal, and the scaling in the argument to malloc requires the sizes to be at most 8 bytes.
Implicit declaration madness. I don't even know why passing ints to an unprototyped pow that actually takes doubles seems to work correctly.
The function "returns" by (I think) just leaving the return value of wmemset in the proper register. This behavior may be particular to the x86 architecture.

42 bytes s;f(n){wmemset(malloc(4*s),n,s=pow(n,n));}

@ceilingcat Nice. But as far as I know neither C nor GCC defines the order of argument evaluation--what guarantees that will work?

Japt, 14 bytes
_òU}g[UpU ÆUÃ]

Try it online!
Output is wrapped in an extra singleton array.
Explanation:
          Æ Ã     #Create an array
           U      #Where every element is U
      UpU         #And the length is U^U
_  }g[       ]    #Repeat this function U times:
 òU               # Cut into slices of length U

14 bytes; I was hoping it'd be shorter.

K (ngn/k), 9 bytes
{(x#x)#x}

Try it online!
There's probably a way to make this tacit.

Variation to make tacit: #/3#

Python 3, 89 Bytes
def f(x):
 r=[x for _ in range(x)]
 for _ in range(x-1):r=[r for _ in range(x)]
 print(r)

Lithp, 82 bytes
(def f #N::((def i #N,I,K::((if(> I 0)((i N(- I 1)(list-fill N K)))K)))(i N N N)))

Try it online!
I tried implementing this as a list comprehension, but couldn't comprehend how to do it correctly. Instead I went for an implementation based on the JavaScript answer. Unfortunately, my language is fairly long-winded, and this is complicated by the fact that I lack shorthand and other useful features.
A more readable version is available at the Try it Online link.

Hoon, 56 bytes
|=
n/@
=+
i=1
|-
?:
=(n i)
(reap n n)
(reap n $(i +(i)))

Create a new function that takes an atom n. Make a variable i starting at 1, and start a loop: if i==n return a list with n elements of n, else return a list with n elements of the value returned by recursing to the start of the loop with i = i + 1.
I'm a little bit upset that there's not really anything you can do to golf this in Hoon :/ The standard trick of using unnamed variables doesn't apply because it's longer to use lark syntax for once, due to the loop shifting the location of i.
> =f |=
  n/@
  =+
  i=1
  |-
  ?:
  =(n i)
  (reap n n)
  (reap n $(i +(i)))
> (f 1)
~[1]
> (f 2)
~[~[2 2] ~[2 2]]
> (f 3)
~[~[~[3 3 3] ~[3 3 3] ~[3 3 3]] ~[~[3 3 3] ~[3 3 3] ~[3 3 3]] ~[~[3 3 3] ~[3 3 3] ~[3 3 3]]]
> (f 4)
~[
  ~[
    ~[~[4 4 4 4] ~[4 4 4 4] ~[4 4 4 4] ~[4 4 4 4]]
    ~[~[4 4 4 4] ~[4 4 4 4] ~[4 4 4 4] ~[4 4 4 4]]
    ~[~[4 4 4 4] ~[4 4 4 4] ~[4 4 4 4] ~[4 4 4 4]]
    ~[~[4 4 4 4] ~[4 4 4 4] ~[4 4 4 4] ~[4 4 4 4]]
  ]
  ~[
    ~[~[4 4 4 4] ~[4 4 4 4] ~[4 4 4 4] ~[4 4 4 4]]
    ~[~[4 4 4 4] ~[4 4 4 4] ~[4 4 4 4] ~[4 4 4 4]]
    ~[~[4 4 4 4] ~[4 4 4 4] ~[4 4 4 4] ~[4 4 4 4]]
    ~[~[4 4 4 4] ~[4 4 4 4] ~[4 4 4 4] ~[4 4 4 4]]
  ]
  ~[
    ~[~[4 4 4 4] ~[4 4 4 4] ~[4 4 4 4] ~[4 4 4 4]]
    ~[~[4 4 4 4] ~[4 4 4 4] ~[4 4 4 4] ~[4 4 4 4]]
    ~[~[4 4 4 4] ~[4 4 4 4] ~[4 4 4 4] ~[4 4 4 4]]
    ~[~[4 4 4 4] ~[4 4 4 4] ~[4 4 4 4] ~[4 4 4 4]]
  ]
  ~[
    ~[~[4 4 4 4] ~[4 4 4 4] ~[4 4 4 4] ~[4 4 4 4]]
    ~[~[4 4 4 4] ~[4 4 4 4] ~[4 4 4 4] ~[4 4 4 4]]
    ~[~[4 4 4 4] ~[4 4 4 4] ~[4 4 4 4] ~[4 4 4 4]]
    ~[~[4 4 4 4] ~[4 4 4 4] ~[4 4 4 4] ~[4 4 4 4]]
  ]
]

WendyScript, 34 bytes
#:(x){<<j=[x]*x#i:1->x j=[j]*x/>j}
#:(x){<<j=[x]*x#i:1->x j=[j]*x/>j}(2) // [[2, 2], [2, 2]]

Try it online!

Is it not possible to have the link actually populate with the your code?

I will have to add that functionality, I'll get back to you in 30 minutes but that's a good point.

@Adám updated link

12-basic, 42 bytes
A=[N=INPUT()]*N
FOR I=2TO N
A=[A]*N
NEXT?A

V, 14 bytes
é,"aPÀñDÀpys0]

Try it online!
input
é,               # write comma
  "aP            # paste register A (input)
     Àñ          # loop À (number in register A) times
       D         # cut to end of line
        Àp       # paste À times
          ysB]   # surround everything before comma in square brackets

This prints a trailing comma..

@BMO is the trailing comma a problem? it was never explicitly stated that it wasn't allowed.  if it is a problem I can change it, it just adds one or two characters

Pip -p, 12 bytes
YaLaY[y]RLay

Try it online!
Explanation
YaLaY[y]RLay
Y             Yank into the y variable
 a            the first command-line argument, a
  La          Fixed-iterations loop, do the following a times:
     [y]       y wrapped in a list
        RLa    repeated a times (results in a list containing a copies of y)
    Y          Yank that list back into y
           y  After the loop, print y

Jelly, 3 bytes
ḷⱮ¡

Try it online!
Like Lynn's solution which heavily inspired this, a full program only.
  ¡    Repeat [input] times, starting with the input on the left and right:
 Ɱ     Produce an array containing, for every element of the right argument,
ḷ      the left argument.

Although dyadic ¡, rather than reusing its right argument, uses the previous left argument for each successive iteration, in this case either behavior would do the same thing--since each intermediate result has the same length as the (implicitly rangified) initial input.

Factor + arrays.shaped, 39 bytes
[ 3 dupn <array> swap repeated-shaped ]

Try it online!
repeated-shaped Takes a sequence of dimensions (i.e. a shape) and an element and creates an array from them. The rest of the code turns 4 into { 4 4 4 4 } 4, for example.

Pari/GP, 33 bytes
n->for(i=1,a=n,a=vector(n,x,a));a

Try it online!

Vyxal, 2 bytes
(ẋ

Try it Online!

Go, 150 bytes
func f(n int)[]any{return g(n,n)}
func g(n,d int)(L[]any){if d<1{return}
for i:=0;i<n;i++{var e any
if d<2{e=n}else{e=g(n,d-1)}
L=append(L,e)}
return}

Attempt This Online!
Call with f(n). Returns an []any, that can be casted to a f(n).([]int),f(n).([][]int),f(n).([][][]int),f(n).([][][][]int), etc.

BQN, 4 bytes
⥊˜⥊⊢

Anonymous tacit function; takes an integer and returns an N-dimensional array. Try it at BQN online!
Explanation
Exactly the same as Dennis's APL answer, though independently derived.
The Reshape builtin ⥊ takes a shape (list of integer dimensions) on the left and an array of values on the right. It creates an array of the given shape, filled with values taken from the original array. If either argument is a bare integer, it is promoted to a list containing that integer.
With example argument 3:
⥊˜ reshapes the argument with itself as the shape. The result is a 3-element 1-dimensional array of 3's: ⟨ 3 3 3 ⟩.
⊢ returns the argument unchanged: 3.
So ⥊˜ ⥊ ⊢ is equivalent to ⟨ 3 3 3 ⟩ ⥊ 3: reshape 3 into a 3 by 3 by 3 array.

Thunno 2, 3 bytes
{Wọ

Attempt This Online!
Explanation
{Wọ  # Implicit input
{    # Repeat input number of times:
 W   #  Wrap top of stack into a list
  ọ  #  Repeat input number of times
     # Implicit output

Perl 5, 34 bytes
sub{eval'@_=[(@_)x$x];'x($x="@_")}

Try it online!

Lua, 85 bytes
function f(n,d,x)d=d or 2 x={}for i=1,n do x[i]=d>n and n or f(n,d+1)end return x end

Try it online!
(The TIO link contains a bit of extra code to print the table as Lua has no built-in way of printing a table's contents)
Explanation
function f(n, d, x)
  d = d or 2
  x = {}
  for i = 1, n do
    x[i] = d > n and n or f(n, d + 1)
  end
  return x
end

As you can probably see, f is a recursive function which takes the number N as n, and two other arguments, d and x. d is the depth, and is not used in the initial call, in which case it defaults to 2. x is not actually used as a parameter, but is there because the function requires a temporary local variable, and it is shorter to declare it as a parameter than to use the local keyword.

Zsh, 74 bytes
try it online!
f(){for i ({1..$1})z+=($2);<<<($z)}
for j ({1..$1})k=`f $1 ${k:-$1}`;<<<$k

Zsh doesn't have multi dimensional arrays but it can do arrays of strings. Here we build up string $k by plugging it into f, then taking that result as the new $k, iterating N times ($1).

Arturo, 20 bytes
$=>[@.of:@.of:<=<=&]

Try it
Huh?
In Arturo, you can initialize a block of values like this:
array.of: 5 2    ; [2 2 2 2 2]

You can also give it a shape:
array.of: [5 3] 2    ; [[2 2 2] [2 2 2] [2 2 2] [2 2 2] [2 2 2]]

@ is syntax sugar for array.
$=> is syntax sugar for function [n].
<=<=& Means push the input to the stack and duplicate it twice.
So putting it all together, $=>[@.of:@.of:<=<=&] is the same as:
function [n][
    array.of: array.of: n n n
]

Or perhaps more clearly:
function [n][
    shape: array.of: n n
    return array.of: shape n
]

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


text:
Penrose Triangle Codegolf
The Penrose triangle, also known as the Penrose tribar, or the impossible tribar, is an impossible object.
The goal in this challenge is to display a Penrose triangle in the fewest bytes possible.

Source: Wikipedia
Rules:

You must display the Penrose Triangle digitally after generating it.
They must look the same as the above image of the wiki page (source above) without directly showing the image.
The same image with the same color scheme must be shown in at least 400x400 size.
Should be as accurate as possible.

Good luck and have fun!

You should give details as to what counts as acceptable outputs; otherwise it's impossible to objectively assess if a submission is valid. For example: what colors, resolution, image size, ...

I think this has the potential to be a great challenge, but there are certain specs that need to be clarified like the colours of the image and its dimensions.

Fixed @KritixiLithos

As a pixel artist who loves penrose triangles, I would love to see this be a 2 color challenge. look up dithering.

I think you need to provide the dimensions of the image, thicknesses, widths, which color values those are, etc.

PS! Don't be discouraged just because the challenge is closed. If it was a bad challenge idea then the close votes would be accompanied with downvotes... :)

I Fixed it @Arnauld

Related.  I'll leave it to the community to decide if this is a duplicate.

@DigitalTrauma I'd say not. That has many more details to draw.

You must display the Penrose Triangle digitally after generating it.  What is your definition of digitally here?

@DigitalTrauma Rule 3

Will any grey do or does it have to be the exact same grey? If it's the latter, it would be nice to provide the exact grey tone in the challenge text.

Aspect rations would also be helpful if they have to be reproduced exactly.

The "must look the same" really limits WolframAlpha. PenroseTriangle displays a rotated grey-er version,

@Thunda Unforchanaly I think you would then be unable to use that language

Is anyone still doing this challenge or still interested?

logo, 129 120 bytes
Draws only the first 4 sides of each L shape, then lifts the pen, moves to the corresponding spot on the next L shape, lowers the pen and draws 4 sides of that. Each L shape borrows 2 sides from the previous one.
Latest edits: move from black fill area to grey fill area using fd instead of setx, and change all movements from fd to bk to save one byte on a 180 deg rotation: rt 210 -> rt 30, shorten setpencolor to setpc (undocumented in the intepreter I'm using, but it works.)
rt 30 repeat 3[pd bk 200 lt 120 bk 360 rt 120 bk 80 rt 60 bk 440 pu rt 139 bk 211 rt 41] setx -2 fill fd 9 setpc 15 fill

logo, 140 bytes
Draws the 6 sides of each L shape, overshoots on the last edge, then turns 180 deg to start the next one.
rt 30 repeat 3[rt 180 fd 200 lt 120 fd 360 rt 120 fd 80 rt 60 fd 440 rt 120 fd 360 rt 120 fd 200] pu setx -5 fill setx 5 setpencolor 15 fill

run at http://www.calormen.com/jslogo/#
It is recommended to do cs pd setpencolor 0 before running to ensure the screen is clear, the turtle is centred and pointing upwards, the pen is down and set to black (default settings, not required for a brand new session) and also ht to hide the turtle (st will show it again.)

SVG (HTML5), 191 bytes

<svg width=498 height=433 stroke=#000><path d=M211,134l38,66L154,365H496L458,431H40 /><path fill=#777 d=M211,2L2,365l38,66L211,134l95,165h76 /><path fill=#FFF d=M496,365L287,2H211L382,299H192

That's really nice!

Python 2, 211 201 195 188 175 173 bytes
from turtle import*
d="t(120);fd(333);rt(120);fd(67);"
s="color(0,%r);begin_fill();fd(200);l"+d+"rt(60);fd(400);r"+d+"end_fill();fd(133);rt(180);"
exec s%'#fff'+s%0+s%'gray'

Unfortunately, exec is not implemented in Trinket, so this cannot be tested online as-is. At least, not in the free version. I printed out the string and pasted as code to test it. If you're clever with scripts, you could resize the html/css as necessary to get a larger canvas. Let me know if you do.
Try it online - uses a smaller size since the site's canvas is too small for 400px, but you can see the entire output.
Ungolfed:
from turtle import*
w=200
def f(n):
  c=255*n/2
  color(0,(c,c,c))
  begin_fill()
  fd(w)
  lt(120)
  fd(5*w/3)
  rt(120)
  fd(w/3)
  rt(60)
  fd(2*w)
  rt(120)
  fd(5*w/3)
  rt(120)
  fd(w/3)
  end_fill()
  fd(2*w/3)
  rt(180)
f(2);f(0);f(1)

I'm wondering if the 255*n/2 can be decreased to 128*n I think float RGB values will round up anyways so would there be a change in pixel-colors?

@AlbertRenshaw That's the ungolfed code. See the code above that for the golfed version. Also, this is Python 2, so they aren't floats, they're integers, since the division is integer division.

PHP, 153 bytes
This will only work if the short_open_tag setting is enabled. The source code contains unprintable characters, so have a hex dump instead:
0000000: 3c3f 3d67 7a69 6e66 6c61 7465 2827 b329  <?=gzinflate('.)
0000010: 2e4b 5728 cb4c 2d77 caaf b0d5 3531 3000  .KW(.L-w....510.
0000020: 611d 0b08 5628 2e29 cacf 4eb5 5536 3030  a...V(.)..N.U600
0000030: b0b3 2948 2cc9 5048 b1f5 d535 35d6 3536  ..)H,.PH...55.56
0000040: b7d0 8152 c6a6 263a 8626 c6ba 8626 0660  ...R..&:.&...&.`
0000050: dac2 5cc7 14c8 b234 0452 510a 6999 3939  ..\....4.RQ.i.99
0000060: b6ca 6969 690a 2545 8979 c569 f945 b9b6  ..iii.%E.y.i.E..
0000070: 45f9 2589 25a9 1a06 9a0a fa14 990a 7415  E.%.%.........t.
0000080: a6a9 8646 949a 9b5e 945a 8969 ae2e cc60  ...F...^.Z.i...`
0000090: 7d60 88d9 0100 2729 3b                   }`....');

The decompressed data looks like this (with line breaks added for legibility):
<svg viewBox=-400-400,800,800 stroke=#000>
<path d=M-53-378,53-378,354,143-140,143-87,50,191,50Z fill=#fff transform=rotate(0) />
<path d=M-53-378,53-378,354,143-140,143-87,50,191,50Z fill=#000 transform=rotate(120) />
<path d=M-53-378,53-378,354,143-140,143-87,50,191,50Z fill=grey transform=rotate(-120) />
</svg>

Although the SVG data isn't entirely valid, PHP serves it as text/html by default. Without a doctype declaration, the document is handled in quirks mode, which is very forgiving.
To improve the compression, I broke the image into three "7"-shaped parts that can be drawn using near-identical <path> elements. The resulting image will expand to fill the viewport. Here's a screen grab from a 500×500 pixel window:

HTML + JS (ES6), 34 + 306 = 340 bytes
Makes use of a 30 degree horizontal skew - in the 3rd argument of the matrix transform, the tangent of 30° is represented as pow(3,-.5).
There are quite a few ugly magic numbers, and it doesn't quite match the proportions of the Wikipedia image. I'm certain there is a more "mathematical" way to go about this; any help would be appreciated.
See the ungolfed version on CodePen.

f=

_=>{with(Math)with(C=c.getContext`2d`)for(l=lineTo.bind(C),lineWidth=.01,transform(50,0,0,50,200,224),N=4;N--;rotate(PI*2/3))beginPath(fill(save(fillStyle=N?N>1?'#fff':'#000':'#777'))),transform(-1,0,-pow(3,-.5),-1,3.965,1.71),l(0,0),l(0,6),l(1,6),l(1,1),l(4.616,1),l(5.772,0),closePath(restore(stroke()))}

f()
<canvas id=c width=400 height=400>

Mathematica 171 Bytes
w=(v=AnglePath)[s={{9,0},{11,2(b=Pi/3)},{2,b},{9,2b},{5,-2b},{2,b}}];x={w[[5]],2b}~v~s;y={x[[5]],-2b}~v~s;Graphics@{White,EdgeForm[Black],(p=Polygon)@w,Gray,p@x,Black,p@y}

Draws 3 polygons using AnglePath, multiples of 60 degree turns, and taking advantage that the starting point for each polygon is the 5th point of the previous polygon.

Nice approach, using AnglePath.

HTML + CSS, 9 + 315 309 308 = 317 bytes
Borders and skews galore! Tested on Chrome. See the ungolfed version on CodePen.

body{margin:9em}b,:after{position:fixed;transform:rotate(240deg)}b:after{content:'';left:-6.1em;top:-7.95em;width:6em;height:9em;border-left:transparent 2.32em solid;border-right:2em solid;border-bottom:2em solid;transform:skew(30deg);filter:drop-shadow(0 0 .1em)}b{color:#777}b>b{color:#000}b>b>b{color:#fff
<b><b><b>

Does it fulfil the requirement of min 400x400px?

You don't need the final >, right?

Tcl/Tk, 205
grid [canvas .c -w 402 -he 402]
.c cr p 171 2 237 2 401 337 125 337 156 280 301 280 -f #FFF
.c cr p 2 335 171 2 310 280 250 280 171 121 31 401 -f gray
.c cr p 171 127 34 401 374 401 401 337 127 337 201 188

Java 8, 367 351 bytes
import java.awt.*;v->new Frame(){public void paint(Graphics g){g.drawPolygon(new int[]{193,348,178,148,448,263},new int[]{38,318,318,373,373,38},6);g.fillPolygon(new int[]{448,148,233,198,43,418},new int[]{373,373,223,158,438,438},6);g.setColor(Color.GRAY);g.fillPolygon(new int[]{43,198,283,348,193,8},new int[]{438,158,318,318,38,378},6);}{show();}}

-16 bytes by drawing on the Frame itself instead of an inner Panel. Now all x-coordinates are increased by 8 to adjust for the left side of the Frame border, and all y-coordinates are increased by 38: 8 to adjust for the top side of the Frame border and 30 for the Frame title-bar.
The Penrose triangle itself has a height of 400 and a width of 440 pixels (since it has to be at least 400x400 by the challenge rules).
Output:

Explanation:
// Method with empty unused parameter and Frame return-type
v->
  // Create a Frame (window for graphical output)
  new Frame(){
    // Override it's default paint method
    public void paint(Graphics g){
      // Draw the white with black outlined 6-pointed polygon:
      g.drawPolygon(new int[]{193,348,178,148,448,263},new int[]{38,318,318,373,373,38},6);
      // Draw the black 6-pointed polygon:
      g.fillPolygon(new int[]{448,148,233,198,43,418},new int[]{373,373,223,158,438,438},6);
      // Change the color to dark gray:
      g.setColor(Color.GRAY);
      // Draw the dark gray 6-pointed polygon:
      g.fillPolygon(new int[]{43,198,283,348,193,8},new int[]{438,158,318,318,38,378},6);}
    // Start an initializer block for this Frame
    {
      // And finally show the Frame
      show();}}

source: Stack Exchange

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

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

sort: votes


text:
Simple CSV/DSV importer
Slightly more than an inverse of this.
In: Multi-line DSV data and a single delimiter character. The DSV may be taken as a file, a filename, line-break separated string, list of strings, etc. All records have the same number of fields, and no field is empty. Data does not contain the delimiter character and there is no quoting or escaping mechanism.
Out: A data structure representing the DSV, e.g. a list of lists of strings or a matrix of strings.
Examples
["here is,some,sample","data,delimited,by commas"] and ",":
[["here is","some","sample"],["data","delimited","by commas"]]
["hello;\"","\";world","\";\""] and ";":
[["hello","\""],["\"","world"],["\"","\""]] (escapes because this example uses JSON)
["to be or not","that is the question"] and " ":
[["to","be","or","not"],["that","is","the","question"]]

So just to clarify, we simply split each item at instances of the given char?

@ETHproductions That's right.

How should we split the strings if the first or last character is the delimiter?
",for,example,this,string,"

@GB no field is empty

So we can assume it won't happen?

@GB Yes, as stated in the OP.

Can the output be a linebreak-separated string too? i.e. would to,be,or,not\nthat,is,the,question be a valid output to your third example?

@Aaron Only if that is the normal way to represent/print lists in your language.

@Aaron I was thinking of asking the same, since in sed the natural representation of a list is a collection of lines. As for list of lists, this is less clear, sed has no data types anyway, so to,be,or,not\nthat,is,the,question is I guess reasonable for this challenge. That, or each field on separate lines.

@seshoumara since the target is CSV, the inner list has to be comma-separated anyway, otherwise I guess any character of the default IFS would have been a good pick even if sed does not care about them. I was asking for ><> which can only output characters and numbers.

Jelly, 3 2 bytes
Dennis points out that while the 2 byte solution appears to not work, the dyadic link itself does, and that it is actually the way command line arguments are parsed that make it look that way.
ṣ€

Try It Online! - footer calls the function with left and right set explicitly, and formats as a grid*.
Exactly as the below, except ṣ splits at occurrences of the right argument rather than at sublists equal to the right argument.

œṣ€

The 3 byter - footer displays the result as a grid*.
A dyadic link (function) that takes the DSV list on the left and the delimiter on the right.
How?
œṣ€ - Main link: list l, delimiter d
  € - for each item in l:
œṣ  -     split at occurrences of sublists equal to d

* As a full program the implicit output would simply "smush" together all the characters, so the footer of the TIO link calls the link as a dyad and uses G to format the result nicely.

@Okx the implicit output would simply "smush" together all the characters

@Okx Yes it is a function that returns a list. The footer is to override the implicit output that occurs when it is run as a full program.

Powershell, 25 22/23 bytes
Two Options, one just calls split on the first arg, using the second arg as a delim value.
$args[0]-split$args[1]

One byte longer, builtin to parse csvs, takes filename as first arg and delim as second.
ipcsv $args[0] $args[1]

-2 because it doesn't require the -Delimiter (-D) param, and will assume it by default.
sadly powershell cannot pass an array of two params, as it will assume they are both files, and will run the command against it twice, no other two-var input method is shorter than this as far as I can see, so this is likely the shortest possible answer.
ipcsv is an alias for Import-Csv, takes a file name as the first unnamed input, and the delim character as the second by default behavior.
Run against the example from the wiki page returns
PS C:\Users\Connor\Desktop> .\csvparse.ps1 'example.csv' ','

Date     Pupil               Grade
----     -----               -----
25 May   Bloggs, Fred        C
25 May   Doe, Jane           B
15 July  Bloggs, Fred        A
15 April Muniz, Alvin "Hank" A

Japt, 3 bytes
mqV

Test it online! (Uses the -Q flag to prettyprint the output)
mqV  // Implicit: U, V = inputs
m    // Map each item in U by the following function:
 qV  //   Split the item at instances of V.
     // Implicit: output result of last expression

:O a JSGL beat MATL!

Python, 33 bytes
lambda a,c:[x.split(c)for x in a]

Haskell, 29 bytes
import Data.Lists
map.splitOn

Usage example: (map.splitOn) " " ["to be or not","that is the question"] -> [["to","be","or","not"],["that","is","the","question"]].

05AB1E, 5 bytes
vy²¡ˆ

Try it online!
Explanation:
v     For each element in the input array
 y    Push the element
  ²   Push second input
   ¡  Split
    ˆ Add to array

JavaScript, 26 bytes
x=>y=>x.map(n=>n.split(y))

Receives input in format (array of strings)(delimiter)
Try it online!

Mathematica, 11 bytes
StringSplit

Builtin function taking two arguments, a list of strings and a character (and even more general than that). Example usage:
StringSplit[{"to be or not", "that is the question"}, " "]

yields
{{"to", "be", "or", "not"}, {"that", "is", "the", "question"}}

MATLAB / Octave, 41 25 bytes
@(x,d)regexp(x,d,'split')

Creates an anonymous function named ans which accepts the first input as a cell array of strings and the second input as a string.
ans({'Hello World', 'How are you'}, ' ')

Try it Online

Cheddar, 19 bytes
a->b->a=>@.split(b)

nice demonstration of looping abilities. I added new composition and f.op. blocks so that allows for interesting golfing. (=>:@.split) is supposed to work but it doesn't :(

MATL, 14 12 4 bytes
H&XX

Try it at MATL Online (the link has a modification at the end to show the dimensionality of the output cell array).
Explanation
        % Implicitly grab the first input as a cell array of strings
        % Implicitly grab the delimiter as a string
H       % Push the number literal 2 to the stack
&XX     % Split the input at each appearance of the delimiter
        % Implicitly display the result

CJam, 5 bytes
l~l./

Explanation:
l~     e#Input evaluated (as list)
  l    e#Another line of input
   ./  e#Split first input by second

Ruby using '-n', 17+1 = 18 bytes
p chomp.split *$*

How it works

Input from file
separator is given as command line parameter
since we only have 1 parameter, *$* splats the string and we can use it as a parameter for the split function
I tried to avoid chomp but any other solution seems to be longer than this.

Rebol, 33 bytes
func[b s][map-each n b[split n s]

GNU sed, 48 + 1(r flag) = 49 bytes
1h;1d
:
G
/,$/bp
s:(.)(.*)\n\1:,\2:
t
:p;s:..$::

Try it online!
In sed there are no data types, but a natural representation of a list would be a collection of lines. As such, the input format consists of DSV records each on a separate line, with the delimiter present on the first line.
Explanation: by design, sed runs the script as many times as there are input lines
1h;1d                  # store delimiter, start new cycle
:                      # begin loop
G                      # append saved delimiter
/,$/bp                 # if delimiter is ',', skip replacements and go to printing
s:(.)(.*)\n\1:,\2:     # replace first occurrence of delimiter with ','
t                      # repeat
:p;s:..$::             # print label: delete appended delimiter (implicit printing)

REXX, 95 bytes
arg f d
do l=1 while lines(f)
    n=linein(f)
    do #=1 while n>''
        parse var n w (d) n
        o.l.#=w
    end
end

Takes a filename and a delimiter as arguments, contents of file are put in stem o.

Is all that whitespace really necessary?

No, I only indented it for readability. The byte count is for unindented code.

Which flavour of REXX is this?

I think it's pure ANSI REXX. I've only tested it with Regina.

On its way to TIO...

APL (Dyalog), 4 bytes
In versions up to and including 15.0, this needs ⎕ML←3 which is default by many. From version 16.0 ⊂ can just be replaced by ⊆ for the same effect.
Takes separator as left argument and DSV as right argument.
≠⊂¨⊢

Try it online!
≠ the inequalities (of the left argument and the right argument)
⊂¨ partition each
⊢ right argument
By partition is mean to remove all elements indicated by a corresponding zero in the left argument, and begin a new partition whenever a the corresponding number in the left argument is greater than its predecessor, i.e. on every one if the left argument is Boolean, as is the case here.

R, 8 bytes (2 ways)
R has two builtin functions that meet the requirements of this challenge:
strsplit

takes a vector of strings and a separator, and returns a list of vectors of the separated strings.
read.csv

takes a file name and a separator, and returns a data frame. Technically this might be 10 bytes because it needs the option header=F so it won't read the first elements as the column names. Currently the TIO link reads from stdin.
Try these online!

Go, 136 bytes
import."strings"
func f(S[]string,d rune)(O[][]string){for _,s:=range S{O=append(O,FieldsFunc(s,func(r rune)bool{return r==d}))}
return}

Attempt This Online!

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


text:
Leaderboard golf
Golf the leaderboard of this question (id=111735). Your program should issue one HTTP or HTTPS request to StackExchange API, parse it and present to user in form similar to a typical Leaderboard Snippet
Sample output (for the question 47338 instead of this):
Leaderboard
    Author  Language    Size
1.  FryAmTheEggman  Pyth    19
2.  Peter Taylor    CJam    24
3.  Martin Ender    CJam    27
3.  Peter Taylor    GolfScript  27
5.  randomra    J   32
5.  Optimizer   CJam    32
7.  Timtech TI-Basic 83/84  40
8.  mollmerx    k   41
9.  Sp3000  ><> 45
10. Sherlock9   Ruby    47
11. Martin Ender    Mathematica 49
12. Alex A. Julia   57
13. Sp3000  Python 2    58
14. Zgarb   Haskell 68
15. Timtech GML 76
16. Jakube  Python 2    79
16. nimi    Haskell 79
18. coredump    Common Lisp 91
19. Jim Large   Ruby    92
Winners by Language
Language    User    Score
Python 2    Sp3000  58
CJam    Peter Taylor    24
Julia   Alex A. 57
TI-Basic 83/84  Timtech 40
><> Sp3000  45
Haskell Zgarb   68
GolfScript  Peter Taylor    27
Common Lisp coredump    91
Pyth    FryAmTheEggman  19
k   mollmerx    41
J   randomra    32
Ruby    Sherlock9   47
Mathematica Martin Ender    49
GML Timtech 76

Note the repeated ranks 3, 5 and 16. Maybe I'll even add a special non-competing answer just to force correct, non-simplified handing of the score duplicates.
The output should consist of:

The line "Leaderboard"
The line "\tAuthor\tLanguage\tSize"
For each answer, tab-separated line of rank and a ., then answer author name, then language name, then score; in ascending order for score
The line "Winners by Language"
The line "Language\tUser\tScore"
For each used language, tab-separated language name, author of the lower score answer and the score

In other words, something like as if one copies and pastes result of the leaderboard snippet of this question to a text file (without "\tLink" things). See also the reference implementation in Python.
Rules

No network access apart from one API request to api.stackexchange.com
No usage of API features or languages that appeared after the submission of this question.
First line of the answer post should be Leaderboard-compatible. If it breaks the leaderboard script attached to the question then answer is non-competing.
If newly added answer renders some existing answer broken then the author of the old answer should fix it (or it becomes non-competing).
Links to languages, striked out scores, etc. should be handleded.
Ranks should be handled like in the snippet (e.g. equal score => equal rank => gap in ranks).

Accepted answer is the answer with the lowest score after sufficient amount of inactivity (minimum 1 month).
Good idea

To test with question IDs 47338 (for duplicate score handling + striked out score handling) and 17005 (for links handling). This bumps the answer from Valid to Good and protects from breaks from later submissions.
To include output examples both for this and for overridden ID versions.

Not necessary

Handling of more than 100 answers (limit of API for single request)
Handling of comment overrides
Sorting of "Winners by Language" section
Discrimination of competing and broken answers

Leaderboard

var QUESTION_ID=111735,OVERRIDE_USER=7773;function answersUrl(e){return"https://api.stackexchange.com/2.2/questions/"+QUESTION_ID+"/answers?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function commentUrl(e,s){return"https://api.stackexchange.com/2.2/answers/"+s.join(";")+"/comments?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+COMMENT_FILTER}function getAnswers(){jQuery.ajax({url:answersUrl(answer_page++),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){answers.push.apply(answers,e.items),answers_hash=[],answer_ids=[],e.items.forEach(function(e){e.comments=[];var s=+e.share_link.match(/\d+/);answer_ids.push(s),answers_hash[s]=e}),e.has_more||(more_answers=!1),comment_page=1,getComments()}})}function getComments(){jQuery.ajax({url:commentUrl(comment_page++,answer_ids),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){e.items.forEach(function(e){e.owner.user_id===OVERRIDE_USER&&answers_hash[e.post_id].comments.push(e)}),e.has_more?getComments():more_answers?getAnswers():process()}})}function getAuthorName(e){return e.owner.display_name}function process(){var e=[];answers.forEach(function(s){var r=s.body;s.comments.forEach(function(e){OVERRIDE_REG.test(e.body)&&(r="
"+e.body.replace(OVERRIDE_REG,"")+"
")});var a=r.match(SCORE_REG);a&&e.push({user:getAuthorName(s),size:+a[2],language:a[1],link:s.share_link})}),e.sort(function(e,s){var r=e.size,a=s.size;return r-a});var s={},r=1,a=null,n=1;e.forEach(function(e){e.size!=a&&(n=r),a=e.size,++r;var t=jQuery("#answer-template").html();t=t.replace("{{PLACE}}",n+".").replace("{{NAME}}",e.user).replace("{{LANGUAGE}}",e.language).replace("{{SIZE}}",e.size).replace("{{LINK}}",e.link),t=jQuery(t),jQuery("#answers").append(t);var o=e.language;/s.lang?1:e.lang<s.lang?-1:0});for(var c=0;c<t.length;++c){var i=jQuery("#language-template").html(),o=t[c];i=i.replace("{{LANGUAGE}}",o.lang).replace("{{NAME}}",o.user).replace("{{SIZE}}",o.size).replace("{{LINK}}",o.link),i=jQuery(i),jQuery("#languages").append(i)}}var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe",COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk",answers=[],answers_hash,answer_ids,answer_page=1,more_answers=!0,comment_page;getAnswers();var SCORE_REG=/<h\d>\s*([^\n,]*[^\s,]),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/,OVERRIDE_REG=/^Override\s*header:\s*/i;
body{text-align:left!important}#answer-list,#language-list{padding:10px;width:290px;float:left}table thead{font-weight:700}table td{padding:5px}
 <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">

Leaderboard

	Author	Language	Size

Winners by Language

Language	User	Score

{{PLACE}}	{{NAME}}	{{LANGUAGE}}	{{SIZE}}	Link

{{LANGUAGE}}	{{NAME}}	{{SIZE}}	Link

Somewhat related  and this (but they are very different challenges).

Perl + Mojolicious, 468 456 469 504 bytes
Using Mojolicious library.
use v5.10;use ojo;while(@i=@{(g("http://api.stackexchange.com/2.2/questions/111735/answers?site=codegolf&filter=withbody&page=".++$p)->json//{})->{items}}){push@r,[$_->{owner}{display_name},(($h=x($_->{body})->at("h1,h2")||next)->at("a")||$h)->text=~/\s*([^,]+)\s*/,$h->text=~/(\d+)[^\d]*$/]for@i}$,="   ";say"Leaderboard
",Author,$l=Language,Size;say+(++$i,$s{@$_[2]}//=$i).".",@$_
for@r=sort{@$a[2]-@$b[2]}@r;%h=map{@$_[1],$_}reverse@r;say"Winners by $l
$l",User,Score;say$_,$h{$_}[0],$h{$_}[2]for keys%h

Ungolfed:
use v5.10;
use ojo;

my @r;
while (my @i = @{ (g("http://api.stackexchange.com/2.2/questions/111735/answers?site=codegolf&filter=withbody&page=" . ++$p)->json // {})->{items} }) {
    my $h = x($_->{body})->at("h1,h2") or next;
    push(@r, [$_->{owner}{display_name}, ($h->at("a") || $h)->text =~ /\s*([^,]+)\s*/, $h->text =~ /(\d+)[^\d]*$/]) for @i;
}

$, = "\t";
my %s;
say("Leaderboard\n", "Author", (my $l = "Language"), "Size");
say((++$i, $s{$_->[2]} //= $i) . ".", @$_) for @r = sort { $a->[2] <=> $b->[2] } @r;

my %h = map { $_->[1] => $_ } reverse(@r);
say("Winners by $l\n$l", "User", "Score");
say($_, $h{$_}[0], $h{$_}[2]) for keys(%h);

Can't locate ojo.pm in @INC -> Does it mean that it is not just "Perl", but "Perl+Mojolicious"? Does't using non-included-with-the-language libraries count as a standard loophole?

If I patch question ID to 47338, I don't see correct handling of ties. Instead of having the sane rank entries disappear.

Correction: same-score entries receive different rank. Although this does not render this answer invalid (yet), it's Not Good.

@Vi. Fixed ties.

Works. Probably the most serious remaining issue (and supposedly the source of the downvote) is the submission name. Maybe change it to "Perl + Mojolicious" to avoid competing with pure Perl solutions? Mojolicious seems to be oneliner-oriented (hence useful for golfing) library not installed in most Perl deployments, so can't be considered a part of the language.

@Vi. Ok. Changed.

Note: now, with the repeated "856" this answer is the main winner candidate (unless other answers get updated).

Python 3, 860 856 bytes
Golfed slightly, just to bootstrap the leaderboard and provide some template for other golfers:
import json,re,html as h,requests as r
p=print
u=h.unescape;a=[];n={}
for i in json.loads(r.get("https://api.stackexchange.com/2.2/questions/111735/answers?page=1&pagesize=100&site=codegolf&filter=!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe").text)["items"]:
    m=re.match(r'<h\d>\s*([^\n,]*[^\s,]),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)',i["body"].splitlines()[0]);l=u(m.group(1));t=u(i["owner"]["display_name"]);s=m.group(2);a.append((t,l,s))
    if l not in n: n[l]=[]
    n[l].append((t,s))
p("Leaderboard\n\tAuthor\tLanguage\tSize")
z=0;y=None
for i in enumerate(sorted(a,key=lambda x:x[2])):
    if y==i[1][2]:z+=1
    else:z=0;y=i[1][2]
    p("%d.\t%s\t%s\t%s"%(i[0]+1-z,i[1][0],i[1][1],i[1][2]))
p("Winners by Language\nLanguage\tUser\tScore")
for i in n.keys():
    n[i].sort(key=lambda x:x[1])
    print("%s\t%s\t%s"%(i,n[i][0][0],n[i][0][1]))

Indented with tabs. The last print is deliberately not replaced by p to create a score tie with the Mathematica answer.
Ungolfed:
import json
import re
import html
import requests
url="https://api.stackexchange.com/2.2/questions/111735/answers?page=1&pagesize=100&site=codegolf&filter=!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe"
data=json.loads(requests.get(url).text)
answers=[]
languages={}
for i in data["items"]:
    header=i["body"].splitlines()[0]
    m=re.match(r'<h\d>\s*([^\n,]*[^\s,]),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)', header)
    lang=html.unescape(m.group(1))
    author=html.unescape(i["owner"]["display_name"])
    score=m.group(2)
    answers.append((author, lang, score))
    if lang not in languages: languages[lang]=[]
    languages[lang].append((author, score))
answers.sort(key=lambda x:x[2])
print("Leaderboard")
print("\tAuthor\tLanguage\tSize")
rankadj=0
prevscore=None
for i in enumerate(answers):
    if prevscore == i[1][2]:
        rankadj+=1
    else:
        rankadj=0
        prevscore=i[1][2]
    print("%d.\t%s\t%s\t%s" % (i[0]+1-rankadj, i[1][0], i[1][1], i[1][2]))
print("Winners by Language")
print("Language\tUser\tScore")
for i in languages.keys():
    w=languages[i]
    w.sort(key=lambda x:x[1])
    print("%s\t%s\t%s" % (i, w[0][0], w[0][1]))

Note: it does not yet handle links correctly, so fails for, for example, question 17005.

Even if you answer it yourself, you have to golf an answer to a [tag:code-golf] question.

@NoOneIsHere, I'm not sure about "have to". Only if "if you anwer to a code-golf question and want to win".

@NoOneIsHere, Also the reason of the answer is mostly to provide initial content and to serve as template for others' golfing attempts.

@Vi See item 3 here

@Vi. Then include it in the question as a reference solution. This is an answer, which does not answer the (your own) question, which asks for golfed code, per [tag:code-golf].

@NoOneIsHere, OK, I'll try to minify it a bit while also providing readable "ungolfed" version.

@Vi. nope. Either it's fully golfed or it's not allowed. If it can easily be golfed, then it's not an answer. I'd really say just to put it in the question as a reference solution.

@NoOneIsHere, Done. "Either fully golfed or not allowed" -> means "newbie answers not allowed"? Golfing tricks needed to really golf an answer in whatever language not just come to mind easily.

@Vi. No, golf it to the best of your extend.

Will this still work once more than one page is needed (the url has ...?page=1&pagesize=100&...)?

@JonathanAllan, It will show only the first page. API seems not to let you download more than 100 answers in one call and I want to keep it 1 run - 1 call. That's why "Handling of more than 100 answers" is in "Not necessary" list.

Ahha, I missed that caveat.

This isn't tested, but what about import json,re,html as h,requests as r as opposed to importing each module on a separate line?

Maybe. I forgot that one can import multiple things per move in Python.

Bash + JQ, 399 bytes
Note, this can almost certainly be golfed further, by optimizing the jq expression logic.
Golfed
curl api.stackexchange.com/2.2/questions/111735/answers?site=codegolf\&filter=withbody|zcat|jq -r '[.items[]|{o:.owner.display_name}+(.body|capture("^
(?<l>.*?),.*?(?\\d*)\\D*</h"))]|sort_by(.b|tonumber)|("Leaderboard\n\tAuthor\tLanguage\tSize",(keys[] as $i|.[$i]|"\($i+1).\t"+.o+"\t"+.l+"\t"+.b),"Winners by Language\nLanguage\tUser\tScore",(group_by(.l)|.[]|min_by(.b)|.l+"\t"+.o+"\t"+.b))'

Sample Output
Leaderboard
    Author  Language    Size
1.  zeppelin    Bash + JQ   399
2.  Tom JavaScript ES6  454
3.  Denis Ibaev Perl    456
4.  Vi. Python 3    860
Winners by Language
Language    User    Score
Bash + JQ   zeppelin    399
JavaScript ES6  Tom 454
Perl    Denis Ibaev 456
Python 3    Vi. 860

What version of jq is needed? I get error: capture is not defined

I don't see repeated ranks when I patch the question ID to 47338. The submission may become invalid as they arrive (and I may later add a special non-competing pseudo-answer just to force correct handling of ranks).

Martin Ender's CJAM answer has "CJam, 28 27 bytes". It should be interpreted as 27, not 28, like in the official leaderboard snippet. Or Pyth's 19 vs 22 bytes.

Note the point "* Links to languages, striked out scores, etc. should be handleded." in the challenge rules.

@Vi - Should be all set now (see https://jqplay.org/s/LuZfAn2Pxr). Pyth answer is still 22 bytes, as it is simply not formatted correctly (the last byte count comes first).

Now the answer is valid (it would have become invalid without the change because of the Perl answer has dropped from 468 to 456 bytes), but equal score don't lead to equal rank in the linked sample: both J and CJam are 32 bytes, but got assigned 3'th and 4'th place arbitrarily.

but equal score don't lead to equal rank in the linked sample

This has never been a part of your original specification, and have only been edited in recently.
Sorry, but I never adjust my answers to match any post-factum changes in the specs (you, as OP, should have thought out all the details in beforehand, not  after other people have already invested time and effort in their answers).
(no offense meant).

Actually the executable leaderboard snippet in question can be loosely considered part of specification. In my recent edit I have just added the emphasis. What answers produce should be like what the JavaScript snippet produces (minus links, formatting), except of what is stated in "Not necessary".

Note: I have updated my answer and now this answer produces incorrect result: there should be two "4." ranks, like in the official leaderboard snippet.

Mathematica, 852 856 bytes
Uses the built-in JSONTools package. This isn't the kind of thing Mathematica's meant to be used for...so I used it!
p=Print;S=StringRiffle;L=Length;r=Range;out=Association@JSONTools`FromJSON[Import["http://api.stackexchange.com/2.2/questions/111735/answers?site=codegolf&filter=withbody"]];l={};i=Association/@(out["items"]);
(f=("body"/.i)[[#]];h=StringPosition[f,{"
","
"}];a="display_name"/.("owner"/.i)[[#]];s=StringSplit[StringTake[f,{h[[1]][[2]]+1,h[[2]][[1]]-1}],{",","","",">","<s>","</s>"," bytes","",""}];AppendTo[l,{a,s[[1]],ToExpression@s[[-1]]}])&/@r@L["body"/.i];l=SortBy[l,Last];o=r@L@l;If[l[[#]][[3]]==l[[#-1]][[3]],o[[#]]=o[[#-1]]]&/@r[2,L@l];
p@"Leaderboard"
p@"\tAuthor\tLanguage\tSize"
For[i=1,i<=L@l,i++,p[ToString@o[[i]]<>"."<>S[l[[i]][[#]]&/@r@3,"\t"]]]
l=SortBy[l,{#[[2]],#[[3]]}&];l=DeleteDuplicatesBy[l,#[[2]]&];
p@"Winners by Language"
p@"Language\tUser\tScore"
For[i=1,i<=L@l,i++,p[S[l[[i]][[#]]&/@{2,1,3},"\t"]]]

How do I test it? I get ReplaceAll::reps: <content of the downloaded Mathematica answer> is neither a list of replacement rules nor a valid      dispatch table, and so cannot be used for replacing., after which the prints are {$Failed, $Failed, $Failed, $Failed, $Failed, bytes, $Failed, $Failed}}.

Maybe the solution is broken by its own source code (which obviously contains
)?

@Vi. That's strange, it's working for me. Which question did you test it on? I don't think it's the source code breaking it, because the StackExchange API uses HTML escapes for the < and > automatically.

This one, 111735. But I substituted the URL with /tmp/q.json where there is a pre-downloaded JSON reply.

Output for 47338: https://paste.debian.net/918716/

I used 111735 to test if my program was working from the start, here's the output: http://imgur.com/i3XVWOj . In regards to 47338, it might actually be a glitch in Mathematica itself, because it fails on the very first Import statement: Import::infer: Cannot infer format of file answers?site=codegolf&filter=withbody. (Also, you're using Mathematica 10, I'm using 11.0.1)

You can workaround the glitch by downloading the JSON outside Mathematica and importing it from file. Does the answer handle links in the language name and ties in the score?

Yes, it handles ties in the score, and it should handle links too. I see why it's failing on a pre-downloaded file: If you use a file, Mathematica is detecting it as a JSON, and converting it to a list of rules automatically. But if you get it from a URL, as is in the question, then you need the JSONTools package (as used) to make it a list of rules; so it breaks on files because it can't convert what Mathematica has already converted!

If you remove the JSONTools around the Import, then reading it from a file will work correctly.


text:
Simulate an instant runoff election
It's the election! The area which we are in implements the system of voting called instant runoff (sometimes called alternative vote or preferential voting). Each voter orders each candidate from most preferred to least preferred, marking a "1" for their most preferred candidate,
a "2" for their second candidate, and so forth until each candidate is numbered. I'll let this friendly koala explain the rest:

(Image modified from original by Patrick Alexander, used under the CC BY-NC-SA 3.0 AU licence).
If you prefer your instant runoff explanation in text form, there's also the Wikipedia article.
(Note: It's also possible, although unlikely, for there to be two or more candidates with the least votes. In these situations, choose one of them randomly at equal probabilities and eliminate them.)
In this challenge, the first line of input is a list of strings, which are the names of the candidates for the election. In these examples I've used pipe delimited values, although feel free to adjust the input format to suit your language.
The Omitted Anti-neutrino|Placazoa|Alexander the Awesome|Tau Not Two|Semolina Sorcerer

Following that are n lines of input which are also lists of strings, each which represents a single vote. The first entry represents that votes #1 preference, the next the #2 preference, etc. For example:
Alexander the Awesome|Semolina Sorcerer|Tau Not Two|Placazoa|The Omitted Anti-neutrino

would mean that that particular vote has Alexander as their first preference, Semolina Sorcerer as their second, Tau Not Two as their third, etc. You can assume that every vote will contain every candidate, and that there will be no blank or incomplete votes.
Given the votes as input, your program or function should then output the winner of the election. You can find an ungolfed reference implementation in Python 3 here.
Example Inputs and Outputs
Input
Dionysius|Portal Butter|Alexander the Awesome|Red Trainmen
Portal Butter|Alexander the Awesome|Dionysius|Red Trainmen
Dionysius|Portal Butter|Alexander the Awesome|Red Trainmen
Portal Butter|Red Trainmen|Alexander the Awesome|Dionysius
Dionysius|Portal Butter|Alexander the Awesome|Red Trainmen
Alexander the Awesome|Red Trainmen|Portal Butter|Dionysius
Red Trainmen|Alexander the Awesome|Dionysius|Portal Butter
Dionysius|Portal Butter|Alexander the Awesome|Red Trainmen
Red Trainmen|Dionysius|Portal Butter|Alexander the Awesome
Alexander the Awesome|Dionysius|Red Trainmen|Portal Butter
Dionysius|Portal Butter|Alexander the Awesome|Red Trainmen
Alexander the Awesome|Red Trainmen|Dionysius|Portal Butter

Output
Alexander the Awesome

Input
Depressed Billy|Sighted Citrus|Frosty Fox|Electronic Accident
Frosty Fox|Sighted Citrus|Electronic Accident|Depressed Billy
Frosty Fox|Depressed Billy|Sighted Citrus|Electronic Accident
Depressed Billy|Electronic Accident|Sighted Citrus|Frosty Fox
Depressed Billy|Sighted Citrus|Electronic Accident|Frosty Fox
Depressed Billy|Electronic Accident|Sighted Citrus|Frosty Fox
Electronic Accident|Frosty Fox|Depressed Billy|Sighted Citrus
Sighted Citrus|Frosty Fox|Electronic Accident|Depressed Billy
Frosty Fox|Depressed Billy|Sighted Citrus|Electronic Accident
Sighted Citrus|Electronic Accident|Frosty Fox|Depressed Billy
Frosty Fox|Electronic Accident|Depressed Billy|Sighted Citrus
Sighted Citrus|Frosty Fox|Depressed Billy|Electronic Accident

Output
Sighted Citrus or Frosty Fox (randomly)
Input
You can get the last input set here. It is one of the voting areas of a recent Australian election, and consists of 63 428 votes.
Output
Ross HART

Do we have to take the first line, or can we infer it from the rest of the input?

@Maltysen You can omit the first line if you want, although please make a note of it in your submission.

@absinthe - the Australian voting set is not there anymore, do you have a copy of it anywhere?

Pyth - 30 bytes
Will refactor it. Infers first line from rest of input.
WgclQ2leKlD.gkhMQ=Q-RhhJKQ;hhJ

Test Suite.

R, 101 99 bytes
f=function(m)`if`(n<-dim(m)-1,f(matrix(m[m!=names(t<-sample(table(m[1,])))[which.min(t)]],n)),m[1])

Try it online!
Takes input as a matrix, with each column representing the choices of one voter. Works by recursion: find a candidate with minimal number of votes, delete all corresponding entries in the matrix, reformat the matrix, and recurse until the matrix has only 1 row.
The votes at each iteration are computed by counting with table the values in the top row, which are the current top choices of each voter. This is shuffled with sample to break ties at random.
n<-dim(m)-1 gives a vector of length 2, but only the first value is used (so it is equivalent, but 1 byte shorter than, n<-nrow(m)-1). This value is used twice: first it is compared to 0 to check whether the last iteration has been reached; second, if we recurse, it is the number of rows of the new matrix.

Python 2, 209 bytes
def f(s):
 d={}
 for v in s:
	k=v[0];d[k]=d.get(k,[])+[v]
	if len(d[k])>len(s)/2:return k
 D=d.values()
 for v in choice([g for g in D if len(g)==len(min(D,key=len))]):v.pop(0)
 return f(s)
from random import*

Try it online!
Takes input as a list of lists of voter prefernces (the header row is not included). The randomization in case of a tie is vexing!

Perl 5 -plF\|, 155 bytes
%r?push@v,[@F]:map$r{$_}=1,@F}{while(@v/2>=$c{$\=pop@t}){map{shift@$_ while!$r{$$_[0]}}@v;%c=();map$c{$$_[0]}++,@v;$r{(@t=sort{$c{$a}-$c{$b}}keys%c)[0]}=0}

Try it online!

Python 2, 200 bytes
def f(s):
 d={}
 for v in s:
    k=v[0];d[k]=d.get(k,[])+[v]
    if len(d[k])>len(s)/2:return k
 D=d.values()
 x=[g for g in D if len(g)==len(min(D,key=len))]
 for v in x[id(x)%len(x)]:v.pop(0)
 return f(s)

Try it online!
Utilises the object ID of the array as a source of 'randomness'.
Based off Chas Brown's Answer - I don't have enough rep to comment!