list
an ordered collection of values
1# list2[1, 2, 3]3# a range41..5[1, 2, 3, 4]Example outputCtrl+Enter to run
syntax
Section titled “syntax”1# xs[i] and xs[a..b] pick items2[10, 20, 30][1]203# xs.f(...) calls f with the list first4[3, 1, 2].sort[1, 2, 3]Example outputCtrl+Enter to run
Functions that take it
Section titled “Functions that take it”listconvert to a list: a string’s characters, a map’s [key, value] pairs, a set’s items, a table’s rows as maps, or a copy of a listexecrun a program directly, without a shell, given as a list of its name and argumentsjoinjoin a list’s items into one string, with sep between themgrepthe lines of a string, or items of a list, that contain patbytesa string’s UTF-8 bytes, bytes made from a list of integers 0-255, or an integer’s bytesfrom_bytesa string from UTF-8 bytes, given as bytes or as a list of integersbyte_lenhow many bytes the text takes in UTF-8, rather than how many characters it hashexdumpbytes shown as a hex dump, like the xxd tool, or just n bytes around address atentropyhow unpredictable the bytes are (Shannon entropy)crc32the CRC-32 checksum, as an integer, the same one zip files and PNG images usefreqhow often each symbol appears in s, as a table of symbol, count and percent, the most common firstngramsevery run of n symbols in s with how often it appears, as a table of gram and count, the most common firstiocthe index of coincidence of s: the chance that two symbols picked from it at random are the samechi_squaredhow far the letters of s are from English letter frequencies, as a chi-squared value, where lower is closerfriedmanthe length of a repeating key, estimated from the index of coincidence by Friedman’s formulakey_lengthseach key length up to max with the average index of coincidence of the columns it splits s into, as a table of length and ioc, the highest firstkasiskithe Kasiski examination of s: runs of n symbols that appear more than once, and the key lengths their distances point to, as {repeats, factors}analyzea quick look at the statistics of s, as a map of length, symbols, entropy, ioc, chi_squared, top and likelyaes_encryptencrypt with AES, the standard block cipher, in mode “ecb”, “cbc”, “ctr” or “gcm”aes_decryptdecrypt AES, the reverse of aes_encrypt with the same key, mode and IVdes_encryptencrypt with DES, or Triple DES given a 16- or 24-byte key, in mode “ecb”, “cbc” or “ctr”des_decryptdecrypt DES or Triple DES, the reverse of des_encryptchacha20encrypt or decrypt with ChaCha20 (RFC 8439), a 32-byte key and a 12-byte nonce, as the same call does bothrc4encrypt or decrypt with RC4, as the same call does bothlenhow many items a list, map or set has, characters a string has, or bytes a bytes value hascontainswhether x is in v: text (or a regex match) in a string, an item in a list or set, or a key in a mapfindthe position of the first x in v, counting from 0, or nil if it isn’t therecounthow many times x appears in a string or listreversereverse a string or listsorta sorted copy, smallest firstsort_desca sorted copy, largest first, with the function working as in sortuniquedrop repeated items, keeping the first of each in its placefirstthe first item, or nil if the list is emptylastthe last item, or nil if the list is emptytakethe first n items or charactersdropeverything except the first n items or charactersanywhether at least one item passes the test f, or without f, whether any item is itself truthyallwhether every item passes the test f, or without f, whether every item is itself truthypushadd v to the end of the list, changing it, and return the listpoptake the last item off the list, changing it, and return that item, or nil if the list is emptyshifttake the first item off the list, changing it, and return that item, or nil if the list is emptyunshiftadd v to the front of the list, changing it, and return the listmapa new list of f(item) for every itemfilterkeep only the items that pass the test freducecombine the items into one valueflattenreplace each list inside the list with its items, one level deepzippair up items by position: the first of each list, then the second, and so on, stopping when the shortest list runs outenumerateeach item paired with its position, as [index, item], counting from 0group_bysort items into groups by what f returns for eachcount_bycount items by what f returns for eachchunkssplit into lists of n items each, where the last one may be shorterwindowsevery run of n items in a row, sliding along one at a time: [1, 2, 3] with 2 gives [1, 2] and [2, 3]rotatethe list with its items shifted left by k places, the ones that fall off the front coming back at the endstepevery nth item, starting with the firstfrom_entriesa map from a list of [key, value] pairs, the reverse of entriesseta set of a list’s items or a string’s characters, or of all the arguments, with repeats droppedcartesianevery pair [x, y] with x from a and y from btablea table from a list of maps, one map per rowto_csvCSV text from a table, a list of maps, or a list of listssparklinea chart one line tall: one bar character per number, the smallest number lowest and the largest highestbarsa horizontal bar charthistogramsplit the range of the numbers into bins of equal width, count how many numbers fall in each, and draw the counts as barstree_viewnested maps and lists drawn as a tree with branch lines, like thetreecommand draws foldersheatmapa grid of numbers, given as a list of rows, drawn as shades from ░ for the lowest to █ for the highestsumadd up a list, units includedavgthe mean (average), or with weights, the mean where each item counts as many times as its weighttrimmed_meanthe mean after dropping the lowest and highest fraction p of the items, so outliers count lesswinsorized_meanthe mean after replacing the lowest and highest fraction p of the items with the nearest items keptproductmultiply all the items togethermedianthe middle value once sorted, or with an even count, halfway between the middle twomodethe item that appears most often, or on a tie, the one that appears firstpercentilethe value p% of the way through the sorted data (p from 0 to 100), so the 90th percentile is above 90% of itvariancehow spread out the numbers arestdevhow spread out the numbers are, in the same units as themgeo_meanthe geometric mean: the nth root of the product, the right average for growth factorsharmonic_meanthe harmonic mean: the reciprocal of the average reciprocal, the right average for ratesrmsthe root mean square: the square root of the average of the squaresmadthe median absolute deviation: the median distance from the median, a spread that outliers barely movesemthe standard error of the mean: the standard deviation divided by the square root of the countiqrthe interquartile range: the 75th percentile minus the 25thspreadthe largest minus the smallest (rangemakes a list of numbers)covthe sample covariance of two lists: positive when they rise togetherrankseach item’s place in the sorted order, starting at 1, with ties sharing the average placespearmanhow closely two lists rise and fall together in order, not necessarily in a straight line (rank correlation)minthe smallest of a list, or of the argumentsmaxthe largest of a list, or of the argumentsdescribea summary in one mapcorrhow closely two lists rise and fall together (Pearson correlation)fitthe straight line y = slope × x + intercept that best fits the points (least squares), as {slope, intercept, r2}zscoreeach item as how many standard deviations above (positive) or below (negative) the mean it isnormalizerescale the list so the smallest becomes 0, the largest 1, and the rest fall in betweencumsumrunning totals: each item plus everything before itdeltasthe difference between each item and the one beforegcdgreatest common divisor: the largest integer that divides all of them evenlylcmleast common multiple: the smallest positive integer they all divide evenlypermutationshow many ways there are to pick k things from n when order matters, exactpermthe same as permutationscombinationsevery way to pick k of the list’s items when order doesn’t matter, each as a list in the original ordercrtthe number that leaves remainder rs[0] when divided by ms[0], rs[1] when divided by ms[1], and so on (the Chinese remainder theorem)t_testwhether two groups of measurements really differ, as a map with t, df and the two-sided ppaired_t_testwhether paired measurements, like before and after, really differ, as a map with t, df and the two-sided pfrom_digitsput digits back together into a number, the reverse of digitschoicea random item from the listshufflea copy of the list in random orderdotthe dot product: multiply matching items of two equal-length vectors and add the resultscrossthe cross product of two 3D vectors: a vector at right angles to bothnormthe length of a vector: the square root of the sum of its squared itemstransposea matrix with its rows and columns swappedmatmulthe matrix product of a and b, where a must have as many columns as b has rowsdetthe determinant of a square matrixinvthe inverse of a square matrix: the matrix that multiplies with it to give the identityreshapethe items of xs laid out as a matrix of the given rows and columns, filling row by rowrowrow i of matrix m, counting from 0colcolumn j of matrix m, counting from 0hcattwo matrices side by side, which need the same number of rowsvcattwo matrices one above the other, which need the same number of columnstriplethe scalar triple product of three 3D vectors, the signed volume of the box they spanrrefthe reduced row echelon form of a matrix: the simplest matrix its row operations can reachrankthe rank of a matrix: how many of its rows are independent of the otherscofactorthe cofactor of m at row i and column j: the determinant of what is left without them, signedadjugatethe adjugate of a square matrix: the transposed cofactors, which divided by the determinant give the inversekronthe Kronecker product of two matrices: every item of a times the whole of b, in blockspermanentthe permanent of a square matrix: the determinant without the alternating signssolvesolve linear equations: the list x for which matmul(a, x) gives bsolve_systemthe point where every function in fs is 0 at once, found from a starting guess (Newton’s method)poly_evalthe polynomial’s value at x, from its coefficients highest power firstpoly_multhe product of two polynomialspoly_divdivide polynomial a by b, giving the list [quotient, remainder]poly_derivthe derivative of a polynomial, as a coefficient listpoly_rootsevery root of the polynomial, real or complex, found numericallypolygon_areathe area of a polygon from its corners in order, each a list [x, y]irrthe rate at which a list of cash flows has a net present value of zero (internal rate of return), per flow periodclockthe time right now in each zone or citycolora color in “#rrggbb” form, from a CSS name, “#rgb”, “#rrggbb” or a list [r, g, b]rgbmake a color from red, green and blue amounts (0-255), or give one argument to get a color’s three amountshslmake a color from hue, saturation and lightness, or give one argument to get a color’s three valuesmixblend two colors, where t is how far to go from a toward b, 0 to 1lightenmake a color lighter, keeping its huedarkenmake a color darker, keeping its hueinvertfor a color, the opposite color on the color wheel, like white for blackgrayscalethe gray that looks as bright as the color doescontrasthow readable one color is on the other, as the WCAG contrast ratio from 1 (identical) to 21 (black on white)swatcha block of the color followed by its hex code, to preview itanimateplay an animation in the terminal at fps frames a secondcardsdraw several playing cards side by side, written as for carddicedraw a die showing 1 to 6, or several side by side for a list
Example results generated on 2026-11-04. Ones using now, today or randomness will differ when you run them.