Category:Quackery
This programming language may be used to instruct a computer to perform a task.
See Also: 


Quackery is an opensource, lightweight, entrylevel concatenative language for educational and recreational programming.
It is coded as a Python 3 function in under 48k of Pythonscript, about half of which is a string of Quackery code.
The Quackery GitHub repository, which includes the Quackery manual "The Book of Quackery" as a pdf, is at github.com/GordonCharlton/Quackery.
About Quackery
The Quackiverse consists of operators (i.e. opcodes or "primitives"), numbers (BigInteger) and nests (dynamic arrays of operators, numbers and nests). They reside on either of two stacks, or in one of the two dictionaries of named items (operators, numbers and nests) that the Quackery compiler, build
, uses to translate written Quackscript into nests that can be evaluated with do
, the default behaviour, or added to either of the dictionaries.
[ build do ] is quackery
Quackery in a nutshell.
To compile this definition of quackery
, build
takes a string of Quackscript and turns it into a nest. The left and right brackets delimit a nest, which will contain pointers to the dictionary items called build
and do
, in that order. Quackery code is evaluated from left to right, one item after another, traversing a tree of nests in depthfirst order. Once build
has compiled the string, it passes the resultant nest via the Quackery stack, which is used to carry arguments and results from one word to the next, to do
for evaluation. The second stack, the return stack, manages do
's depthfirst traversal of nested nests.
The words is
, [
, and ]
are builders; they can be found in the builders dictionary, which extends the functionality of build
beyond building a flat nest for do
to evaluate. is
takes the item that do
most recently added to its output nest, and adds it to the names dictionary, along with the string that follows it, "quackery
" as its name. The syntax of Quackery is; words and numbers are sequences of printable characters, separated by spaces and carriage returns unless a builder treats the text that follows it otherwise. The builder builds
is equivalent to is
for adding new words and behaviours to the builders dictionary.
Evaluation of a nest proceeds from left to right unless a control flow operator redirects it. done
causes do
to stop evaluating a nest and return to the nest that pointed to it immediately, rather than at the end of the nest. again
restarts the evaluation of that nest, nonrecursively. The word recurse
does it recursively. if
and iff
conditionally (depending on the item on the top of the Quackery stack) skip over the next one and two items in the nest respectively. else
skips over one item, unconditionally. As with the other provided control flow operators, these words are nests, not operators, that make use of the "metacontrol flow" operators, which grant the behaviours described above to words that use them. (They modify items on the return stack, rather than acting on the Quackery engine's various pointers registers directly, so their changes are enacted upon exiting the nest that called them.)
There are no variables in Quackery. Instead, there are stack management words to rearrange the uppermost items on the Quackery stack as required, and nameable ancillary stacks that fulfil the roles of variables.
Everything is code except when it is data. When do
does a number, the behaviour of the number is to put its numerical value on the stack. Operators do the heavy lifting; there are operators that treat numbers as integers, or as booleans, or as sequences of bits, or as characters, and there are operators to edit nests, interface with the realworld host computer for I/O, and so on. Nests give structure to code and data alike.
Conceptually, the Quackery engine is a stack based processor which does not have direct access to physical memory but has a memory management coprocessor that intermediates, that takes care of the nests and bignums, provides pointers to the Quackery engine CPU on request, and garbage collects continuously.
Quackery is not intended to be a superfast enterpriselevel language; it is intended as a fun programming project straight out of a textbook. (The textbook is included in the download.)
If your language supports bignums, firstclass functions and dynamic arrays of bignums, functions and dynamic arrays, and has automatic garbage collection, and if you can code depthfirst traversal of a tree you can implement Quackery in your preferred language with reasonable ease, and modify it as you please.
Or try your hand at one of the Tasks not implemented in Quackery.
Pages in category "Quackery"
The following 200 pages are in this category, out of 702 total.
(previous page) (next page)A
 A+B
 ABC problem
 ABC words
 Abundant odd numbers
 Abundant, deficient and perfect number classifications
 Accumulator factory
 Achilles numbers
 Ackermann function
 Additive primes
 Address of a variable
 AKS test for primes
 AlmkvistGiullera formula for pi
 Almost prime
 Alternade words
 Amicable pairs
 Anagrams
 Anagrams/Deranged anagrams
 Angle difference between two bearings
 Anonymous recursion
 Antiprimes
 Append numbers at same position in strings
 Apply a callback to an array
 Arbitraryprecision integers (included)
 Archimedean spiral
 Arithmetic derivative
 Arithmetic numbers
 Arithmeticgeometric mean
 Arithmetic/Integer
 Arithmetic/Rational
 Array concatenation
 Array length
 Arrays
 Ascending primes
 Attractive numbers
 Average loop length
 Averages/Arithmetic mean
 Averages/Mode
 Averages/Pythagorean means
 Averages/Root mean square
 Averages/Simple moving average
B
 Babbage problem
 Bacon cipher
 Balanced brackets
 Barnsley fern
 Base 16 numbers needing a to f
 Base58Check encoding
 Bell numbers
 Bernoulli numbers
 Bifid cipher
 Bin given limits
 Binary digits
 Binary search
 Bioinformatics/base count
 Bioinformatics/Sequence mutation
 Bitwise operations
 Blum integer
 Boolean values
 Box the compass
 Brazilian numbers
 Brilliant numbers
 Bulls and cows
C
 Caesar cipher
 Calculating the value of e
 CalkinWilf sequence
 Call a function
 Call an object method
 Calmo numbers
 Camel case and snake case
 Cantor set
 Cartesian product of two or more lists
 Casesensitivity of identifiers
 Casting out nines
 Catalan numbers
 Catalan numbers/Pascal's triangle
 Catamorphism
 Change e letters to i in words
 Changeable words
 Chaos game
 Character codes
 Check input device is a terminal
 Check output device is a terminal
 Chinese zodiac
 Church numerals
 Cistercian numerals
 Closures/Value capture
 Code Golf: Code Golf
 Collect and sort square numbers in ascending order from three lists
 Colour pinstripe/Display
 Combinations
 Combinations with repetitions
 Comma quibbling
 Comments
 Common list elements
 Common sorted list
 Compare a list of strings
 Compare length of two strings
 Compiletime calculation
 Compound data type
 Concatenate two primes is also prime
 Conditional structures
 Constrained random points on a circle
 Continued fraction
 Continued fraction/Arithmetic/Construct from rational number
 Convert decimal number to rational
 Convert seconds to compound duration
 Conway's Game of Life
 Coprime triplets
 Coprimes
 Copy a string
 Count how many vowels and consonants occur in a string
 Count in factors
 Count in octal
 Count occurrences of a substring
 Count the coins
 Cousin primes
 CRC32
 Create a twodimensional array at runtime
 Cullen and Woodall numbers
 Currency
 Currying
 Curzon numbers
 CUSIP
 Cycle detection
 Cycles of a permutation
D
 Damm algorithm
 Day of the week
 Day of the week of Christmas and New Year
 Days between dates
 De Polignac numbers
 Deal cards for FreeCell
 Deceptive numbers
 Decision tables
 Decoratesortundecorate idiom
 Department numbers
 Descending primes
 Determine if a string has all the same characters
 Determine if a string has all unique characters
 Determine if a string is collapsible
 Determine if a string is numeric
 Digit fifth powers
 Digital root
 Digital root/Multiplicative digital root
 Disarium numbers
 Distinct power numbers
 Dot product
 Dragon curve
 Draw a clock
 Draw a cuboid
 Duffinian numbers
 Dynamic variable names
E
 Eban numbers
 Egyptian division
 Elementary cellular automaton
 Emirp primes
 Empty program
 Empty string
 Enforced immutability
 Engel expansion
 Equal prime and composite sums
 Equilibrium index
 Esthetic numbers
 Ethiopian multiplication
 Evaluate binomial coefficients
 Even or odd
 Exactly three adjacent 3 in lists
 Exceptions
 Exceptions/Catch an exception thrown in a nested call
 Execute a system command
 Execute Brain****
 Execute HQ9+
 Exponentiation operator
 Exponentiation order
 Extend your language
 Extra primes
 Extract file extension
F
 Factorial
 Factorial base numbers indexing permutations of a collection
 Factorial primes
 Factorions
 Factors of an integer
 Fairshare between two and more
 Farey sequence
 Fermat pseudoprimes
 Fibonacci nstep number sequences
 Fibonacci sequence
 Fibonacci word/fractal
 File input/output
 Filter
 Find adjacent primes which differ by a square integer
 Find common directory path
 Find first and last set bit of a long integer
 Find first missing positive