Code Monkey home page Code Monkey logo

docs-v1's Introduction

Kdb+ documentation

This is Version 1 of the documentation site at code.kx.com.

It has now been frozen, but can be found online at code.kx.com/q.

The current version of the site is in the master branch.

Version 1.0

Rebuild of code.kx.com/wiki using the MkDocs static site generator.

The wiki enabled the kdb+ documentation to grow organically over the years. It is well organised for finding all uses of a word or glyph. Its replacement aims to

  • use a consistent vocabulary and typographical convention
  • distinguish clearly between a glyph and the function/s it denotes
  • categorise language primitives by application so, e.g. string-handling functions are listed together

Most of the wiki consists of three groups of articles:

  • Reference
  • Cookbook
  • Extracts from V1 and V2 of Q for Mortals

Local copy

If your Net connection is slow, you might prefer to download the site for local use from code.kx.com/offline.zip.

Reference

The Reference articles have been exported from the wiki and their content incorporated into a hierarchical table of contents. Details on each q function are arranged in pages grouped under /ref by semantic topic: see Reference/Semantics in the LHS navigation.

Cookbook

The Cookbook articles have been migrated.

Q for Mortals V3

Unlike the first two editions, Q for Mortals V3 is now published in its entirety online in HTML.

Links from the Reference and Cookbook to Q for Mortals have been replaced with links to Q for Mortals V3.

Not upwardly compatible

Rewriting the Reference material required settling the vocabulary in which q is described.

The term verb had been inherited from the J programming language but was an inexact fit for q, besides being unfamiliar to programmers generally.

We start from the common usages of operator and function; thus + is an operator.

A function’s rank is the number of arguments it takes. Functions of ranks 1 and 2 are no longer monads and dyads but (more familiarly) unary and binary functions.

+[2;3] demonstrates that operators are also functions; a q operator is a binary function that may be applied infix. From this we discover and, cut, upsert, over and other functions are also operators.

While adverb is unfamiliar to programmers generally, and loses explanatory power outside the J noun/verb/adverb metaphor, we need a term for the q primitives that are applied postfix and return a derivative (derived function), e.g. +/. Adverb survives by default, but we now improve clarity by distinguishing between the six glyphs and the twelve adverbs they denote.

q)f:count':       / count is unary  so ': is each-parallel
q)g:,':           / ,     is binary so ': is each-prior
q)f("abc";"xyz")  / each-parallel derivative is unary
3 3
q)g["abc";"xyz"]  / each-prior derivative is binary
"xabc"
"yx"
"zy"

Adverbs take functions as arguments but are not alone in doing so: operators such as fby, over, and scan do so, as may any lambda. This is unremarkable in functional languages.

K has ambivalent primitives, e.g. - can be applied infix as the binary function subtract or prefix as the unary function negate.

  5-3
2
  -3
-3

Q has no ambivalent primitives, but some derivatives are ambivalent.

q)tot:+/        / derivative
q)tot[til 6]    / unary
15
q)tot[2;til 6]  / binary
17

Contact

This is a project of the Kx Librarian

A librarian’s job is to put information where people can find it.

docs-v1's People

Contributors

108rik avatar 5jt avatar abalkin avatar aee avatar atf1206 avatar charlieskelton-kx avatar cmccarthy1 avatar dpkwhan avatar geocar avatar gk0 avatar jhanna-kx avatar sashkab avatar shuckc avatar skeevey avatar sohagan857 avatar sv avatar tsmyth-aquaq avatar willdasilva avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.