The Crow Programming Language

Crow by Example

Short programs, a page for each area. The chapters taught the ideas; this is every corner of the language and its modules in example form, to read through once and come back to. crow test --book checks every block: it runs each one in both execution modes and holds its output to the text printed under it; a block that serves, reaches another host or ends the program is built without being run, and one that shows a mistake must be refused. crow test --docs fails if a module is imported by no block of the book, or a builtin is called by none, here or in the chapters. For the tables, with every function linked back to the example that shows it, see The Standard Library in Part II.

PageCovers
Numbers and conversionabs sqrt floor ceil round min max type int float str, ints past 64 bits, decimal, fraction
Stringstrim upper lower replace starts ends repeat split join reverse len, indexing, characters with split[s, ''], occurs translate
Formattingfmt with decimals commas percent width fill align
Regular expressionsmatches find sub
Arrayssort reverse slice push pop concat range, x in xs and not in, a part of text in text, concat of a list written down, a mask picking items, a matrix's number and row written in place
Mapsmap keys values set del, k in m, map[keys, values], a map keyed by ints
Files and directoriesmkdir write exists read cp mv ls rm, error values from I/O
JSONjson encode, open-schema fields, encode and decode with a scheme (base64, url)
The system: shell, environment, time, argumentsshell env now args hash; sleep exit halt, built but not run
Moments and freshnessmoment from parts, from text and in another zone, now, fields (.hour, .weekday), fmt[t, style =, tz =], arithmetic in seconds, captured
Math: tensors* and .*, transpose det solve, creating tensors, element-wise functions, shape operations, a mask picking a matrix's rows, counted by sum and taken by where
Math: reductions and linear algebrasum prod mean min max argmax argmin cumsum cumprod topk argsort unique where, axis =; det inv norm dot triu tril rank cond solve lstsq pinv qr svd cholesky eigen
Math: random, signal, special, and sparseseed normal uniform poisson bernoulli gamma_dist beta_dist exponential shuffle choice permutation rand, fft ifft fft2 conv conv2d hamming hanning stft spectrogram lowpass highpass bandpass, gamma erf bessel factorial choose fma, complex real imag magnitude phase conjugate, sparse dense nnz spmv
Automatic differentiationgrad of a function of numbers, one parameter and several, and of a function of tensors
Structured files: use iocsv lines
Documentation: use docchapters markdown menu pager plain document
Bits and character codes: use bitsbitand bitor bitxor bitcount shift code char
Process memory: use memoryremember recall revise forget canonical
Frames: use frameframe.load save select sort group pivot window join stack head tail fill unique rename stats complete sample unpivot where bucket, masks (f[mask]), frame.new[…], df.name = values, in over a column, a then chain as lines
Databases: use dbconnect query transact describe insert, a transaction rolled back
Web: a JSON routeroute serve, a JSON response
Web: responses and submodulestext html redirect respond msgpack arrow bytes stream, serve's cors and files, a route's limit, a handler's own connect, sign verify (web.auth), smtp and mail (web.mail), socket send recv close (web.ws), request with its options
Views: the whole element vocabularythe 32 HTML elements, the containers stack row grid overlay scroll, details summary dropdown modal drawer toast divider, fetch poll field slider, a layout tested at two widths
The standard library's layer: use sysbytes, a connection (open send recv close), a process (start), files, digests, the readers' parsers, describe and apply