Docs »
Welcome to xs’s documentation!
View page source
Welcome to xs’s documentation!¶
xs is a dynamically typed, dynamically scoped, concatenative array
language inspired by kdb+/q and released into the public domain. The
interpreter and builtin functions are written in OCaml.
The name “xs” either stands for:
eXtra Small
The plural of “x”
Check out the project page on github if you wish to browse the
source, open an issue or pull request. xs aims to be a small
language with a focus on compactness and expressiveness. Or email me
at sturm@cryptm.org
Installation
Examples
Tutorial
Introduction
Comments
Function and Variables
Operators
Lists
Scoping
Data Types
Day 1 Advent of Code 2019 Solution
Language Reference
Command-Line Parameters
Syntax
Data Types
Parsing
Scoping
Math
neg unary negative
+ addition
- substraction
* multiplication
% division
mod modulus
** power
ln natural logarithm
sin sine
cos cosine
tan tangent
sum sum of list
sums partial sums of list
prod product of list
prods partial products of list
abs absolute value
ceil ceiling
floor floor
Boolean and Conditionals
== equals
< less than
> greater than
gq greater or equal
lq less or equal
&& And
|| Or
if if expression
cond multiple conditional
every tests all true
any any true
cmp comparison
Stack Manipulation
dup duplicate element
swap swap elements
drop drop value
Function Application
. apply
$ swap and apply
Assignment
: set/print
~ peek set/print
:: reassign
Iterators and Accumulators
' map
'' map2
/ fold
\ scan
fix fixpoint
fixes partial fixpoints
do iteration
List and String
[] make list
enlist make list
^ delist
til construct numbered list
len length of list
flip flip list
rev reverse
, concatenate
,, cons
lower lowercase string
upper uppercase string
Indexing, Reshaping, Changing
@ get
? find
where
# take
_ drop
cut reshape
cat concatenate all
cats partial concatenate all
Set Operations
in contains
inter intersection
union
uniq unique elements
Sorting
asc sort ascending
dsc sort descending
sort custom sort
Types
of type conversion
type
sv scalar from vector
vs vector from scalar
I/O
open open file
read read data
write write data
seek change file position
close close file handle
readl read lines
writel write lines
Misc
rand random value
include evaluate file
measure elapsed time
eval evaluate
Link preview
GitHub - smabie/xs: concatenative array language inspired by kdb/+q
concatenative array language inspired by kdb/+q . Contribute to smabie/xs development by creating an account on GitHub. GitHub · github.com
Comments