g | x | w | all
Bytes Lang Time Link
021Uiua240818T193724ZjanMakos
010Japt240818T181308ZShaggy
069R240818T160530Zint 21h
004Burlesque200125T181202ZMintable
048Perl 5 lF200204T232441ZXcali
060Ruby200128T125424ZG B
004Husk200128T113835Zuser8505
nanPHP200125T185533ZGuillerm
nanScratch 3.0200126T071628Zlyxal
112R200126T231952ZMickyT
017Charcoal200126T112502ZNeil
090JavaScript ES7200126T101947ZArnauld
042PowerShell200126T092249ZAndrei O
034Haskell200125T191131Zxnor
068Python 2200125T223507ZChas Bro
002Jelly200125T153930ZJonathan
005Pyth200125T151604ZMr. Xcod
016J200125T145035ZJonah
00305AB1E200125T134713ZGrimmy
032Perl 6200125T131424ZJo King
00605AB1E200125T121639Zmabel
095Python 3200125T120006ZRGS

Uiua, 21 bytes

/◇⊂⍚(⍚⊏⊙¤☇1⇡↯+1)⊸⇡⊃⧻¤

Try it online!

Japt, 10 bytes

There's gotta be a better way!

ÊÆp°X áX â

Try it

R, 69 bytes

for(j in s<-el(strsplit(scan(,q<-''),q)))cat(q<-outer(q,s,paste0),'')

Try it online!

A program which takes a string as an input and outputs the permutations as defined in the question.

A more verbose version with comments:

# q is an empty string
q <- ''   
        
# split the input
# in characters and save as s            
s <- el(strsplit(scan(,q),q))

# concatenate q with every character
# of s, assign the result back to q and
# print it out. Repeat the process
# as many times as the length
# of the input string
for(j in s)cat(q<-outer(q,s,paste0),'')

Burlesque,  5  4 bytes

sacb

Try it online!

-1 thanks to DeathIncarnate!

sa    # Duplicate the input and get it's length
  cb  # Get all combinations of the input characters up to the length of the input

Perl 5 -lF, 48 bytes

$"=',';map$k{$_}++||say,glob"{@F}"."{@F,''}"x$#F

Try it online!

Ruby, 60 bytes

->s{a,*z=s.chars,'';z.product(*a.map{a+z}).map(&:join)-z|[]}

Try it online!

Husk, 4 bytes

Total Husk novice, there may be better ways to golf this.

Mπŀ¹

Try it online!

Explanation

  ŀ¹ Find the range [1, ..., len(input)]
Mπ   Map with cartesian power of input

PHP, 176 174 173 171 170 166 bytes

$c=$t=count($u=array_values(array_unique(str_split($argn))));for($s=1;$i<$t**$t;){$i-$c?:[$s++,$c*=$t,$i=0];for($k=$i++,$j=0;$j<$s;$j++,$k/=$t)echo$u[$k%$t];echo',';}

Try it online!

-4 bytes thanks to @Ismael Miguel.

Method: simply count in base N, where N is the number of unique characters in the input string.

Scratch 3.0, 65 blocks / 637 632 bytes

Part 1

Part 2

Part 3

Part 4

Look at y'all, having fun with your fancy shmancy permutation functions/map tools. Well, not I! No, not I! When using Scratch, one has to do things themselves! You won't find any built-ins around these parts! I'm just glad there still ain't any gotos ;)

But more seriously, the image is split into 4 parts because it's just soooo long Press space to clear the lists before each run

And finally,

Try it online Scratch!

As SB Syntax:

when gf clicked
set[c v]to(0
ask()and wait
set[L v]to(length of(answer
add(1)to[b v
repeat((L)-(1
add(0)to[b v
end
repeat until<(c)=(1
set[s v]to(0
set[l v]to(1
repeat(length of[b v
change[s v]by(item(l)of[b v
change[l v]by(1
end
if<(s)=((L)*(L))>then
set[c v]to(1
end
set[r v]to(
set[l v]to(1
repeat(length of[b v
set[r v]to(join(r)(letter(item(i)of[b v])of(answer
change[i v]by(1
end
add(r)to[o v
replace item(1)of[b v]with((item(1)of[b v])+(1
set[j v]to(1
repeat(length of[b v
if<(item(j)of[b v])>(length of(answer))>then
replace item(j)of[b v]with(1
replace item((j)+(1))of[b v]with((item((j)+(1))of[b v])+(1
end
change[j v]by(1

-5 bytes due to not being a silly billy and removing extranous spaces

R, 112 bytes

function(S,s=sapply)cat(unlist(s(1:nchar(S),function(X)do.call('paste0',expand.grid(s(rep(S,X),strsplit,''))))))

Try it online!

Things that make you go Argh, strings in R.

Expands out to the following

cat(                                           # output the results
  unlist(                                      # collapse the list
    sapply(1:nchar(S),                         # for 1 to character length of S
      function(X)do.call('paste0',             # for each row from the grid paste characters together
         expand.grid(                          # create permutations 
           sapply(rep(S,X),strsplit,''))))))   # replicate the string X times and split.

So we produce a lists of [['a','b','c']], [['a','b','c'],['a','b','c']], [['a','b','c'],['a','b','c'],['a','b','c']]. These are feed into expand.grid to produce the permutations.

Each row of the grid is pasted together with no gaps in the do.call.

As it is still in a list we apply unlist so that cat will be able to output it.

Charcoal, 17 bytes

FEθXLθ⊕κEι✂⍘⁺ικθ¹

Try it online! Link is to verbose version of code. Explanation:

FEθXLθ⊕κ

Loop over the substring lengths and raise the length to each power in turn.

Eι✂⍘⁺ικθ¹

Loop from each power to double its value and perform base conversion using the input string as the alphabet, then slice off the first character.

JavaScript (ES7), 90 bytes

Returns a Set.

s=>new Set([...Array(n=(L=-~s.length)**~-L)].map(_=>(g=n=>n?[s[n%L-1]]+g(n/L|0):'')(n--)))

Try it online!

Commented

s => new Set(            // build a set from
  [...Array(             //   an array of
    n =                  //   n entries, with:
      (L = -~s.length)   //     n = L ** (L - 1)
      ** ~-L             //     where L is the length of s + 1
  )]                     //   
  .map(_ =>              //   for each entry:
    ( g = n =>           //     g is a recursive function taking n
        n ?              //       if n is not equal to 0:
          [s[n % L - 1]] //         output s[(n mod L) - 1]
                         //         or an empty string if it's undefined
          + g(n / L | 0) //         recursive call with floor(n / L)
        :                //       else:
          ''             //         stop recursion
    )(n--)               //     initial call to g; decrement n afterwards
  )                      //   end of map()
)                        // end of Set()

PowerShell, 42 bytes

($a=$args)|%{($p=$p|%{$t=$_;$a|%{$t+$_}})}

Try it online.

Expects input via splatting.

Haskell, 34 bytes

f s=init$mapM(\_->s)=<<scanr(:)[]s

Try it online!

Here's how it works, using input s="abc":

                       scanr(:)[]s

Produces the suffixes of s, ["abc","bc","c",""], by prepending each character in turn to the front and tracking the intermediate results.

         mapM(\_->s)

Uses the list monad to map each element to s, that is, 'xy'-> ["abc","abc"], and take multiply them as a Cartesian product, here giving ["aa","ab","ac","ba","bb","bc","ca","cb","cc"].

         mapM(\_->s)=<<scanr(:)[]s

Uses =<< as concatMap to take the function above that uses mapM and apply it to each of the suffixes, thereby producing the Cartesian products of copies of s numbering from 0 to its length, in a single list.

    init$

Removes the empty string, produces from the suffix of length 0.

f s=

Declares the function.

Python 2, 69 68 bytes

f=lambda s,A={''}:s in A and A or f(s,A|{a+c for a in A for c in s})

Try it online!

Outputs a set; includes the empty string.

Python 2, 71 bytes

f=lambda s,A=[]:s in A and A or f(s,set(s)|{a+c for a in A for c in s})

Try it online!

If empty string is not allowed...

Jelly, 2 bytes

ṗJ

A monadic Link which accepts a list of characters and returns a list of lists of lists of characters.

Try it online! (footer formats as a grid)

How?

ṗJ - list, S
 J - range of length of S
ṗ  - Cartesian power (vectorises)

If we must output a flat list of "strings" (lists of characters) we can add (tighten) for the cost of a byte.

Pyth, 5 bytes

^LQSl

Try it here!

J, 16 bytes

a:-.~[:,#\{@#"{<

Try it online!

05AB1E, 4 3 bytes

-1 byte thanks to a'_'

ā€ã

Try it online!

Perl 6, 32 bytes

{flat [\X~] '',|[xx] .comb xx 2}

Try it online!

Anonymous code block that takes a string and returns a list of string including the length zero permutation.

05AB1E, 6 bytes

gENIã)

Try it online!

Explanation

gENIã)
 E     # foreach in...
g      # the input
    ã  # find the cartesian product of...
   I   # the input...
  N    # repeat N
     ) # wrap the final stack to an array
       # implicit output of the top element

Python 3, 95 bytes

import itertools as i;lambda s:[''.join(p)for l in range(len(s))for p in i.product(s,repeat=l)]

Try it online