Q for Mortals guide to kdb+/q programming

Q for Mortals Version 3 Now Free Online

3 Jan 2017 | , , , ,
Share on:

Kx is pleased to announce that Jeffry Borror’s book Q for Mortals Version 3, An Introduction to Q Programming, is now available for free online at code.kx.com here.

Q for Mortals serves as both an introduction and reference guide to programming in q/kdb+, and replaces an earlier version. In the latest edition, Jeffry includes expanded real-life applications based on his experience teaching and using q at a large financial institution where kdb+/q has been widely deployed for many years.

Kx’s Simon Garland said about Q for Mortals version 3: “I recommend it for programmers and users of all levels who need to know about the capabilities of kdb+. Even someone who is managing a project has something to learn from this.”

The following is an excerpt from an introductory section called The Evolution of q.

Arthur Whitney developed the q programming language and its database kdb+. Released by Kx Systems, Inc. in 2003, the primary design objectives of q are expressiveness, speed and efficiency. In these, it is beyond compare. The design trade-off is a terseness that can be disconcerting to programmers coming from verbose traditional database programming environments – e.g., C++, Java, C# or Python – and a relational DBMS. Whereas the q programming gods revel in programs resembling an ASCII core dump, this manual is for the rest of us.

Q evolved from APL (A Programming Language), which was first invented as a mathematical notation by Kenneth Iverson at Harvard University in the 1950s. APL was introduced in the 1960s by IBM as a vector programming language, meaning that it processes a list of numbers in a single operation. It was successful in finance and other industries that required heavy number crunching.

The mitochondrial DNA of q traces from APL to A to A+ and to k. All were well suited to performing complex calculations quickly on vectors. What’s new in q/kdb+ is that it processes large volumes of time-series data very efficiently in the relational paradigm. Its syntax allows “select” expressions that are similar to SQL 92, and its collection of built-in functions provides a complete and powerful stored procedure language.

There is also some Lisp in q’s genes: the fundamental data construct of q is a list. Although the notation and terminology are different, symbols are drawn from their counterparts in Scheme.

The APL lineage of q also shows the influence of functional programming. In his 1977 Turing Award lecture that introduced purely functional programming, Backus acknowledged inspiration from APL. While q is not purely functional, it is strongly functional in that even its basic data structures, list and dictionary, are viewed as mathematical mappings.

© 2018 Kx Systems
Kx® and kdb+ are registered trademarks of Kx Systems, Inc., a subsidiary of First Derivatives plc.

SUGGESTED ARTICLES

Sensors Working Overtime

11 Jan 2018 | , , , ,

Kx recently became an official team supplier to Aston Martin Red Bull Racing who is using Kx technology to handle mission-critical aerodynamic data. Below is an article published by Aston Martin Red Bull Racing on 11 January 2018 which explains the importance of this aero data, and working with Kx technology, for improving car performance for the F1 Team. It outlines how Kx’s in-memory, time series database software, capable of handling millions of events and measurements every second, provides a platform for analysing data on the RB14 and its successors.

kdb+ for industrial internet of things 4.0

Kx Insights: IIoT for Predictive Maintenance and Big Data

9 Jan 2018 | , , , , , ,

IIoT for predictive maintenance enables more extensive monitoring of equipment and processes at a much lower cost than traditional methods and delivers actionable warnings to prevent or minimize the consequences of an impending failure. Where IIoT for predictive maintenance is deployed in a well-designed program using Reliability Centered Maintenance (RCM) it will reduce surprise outages, lost production, extensive repairs, secondary damage and increase safety.

MiFID II and kdb+/Kx

MiFID II, The Day After

4 Jan 2018 | , , , , ,

Don’t pop the champagne yet for the launch of Europe’s Markets in Financial Instruments Directive (MiFID II). While January 3rd was the go-live date, and the industry is thought to be 80% compliant, there are major outstanding issues to contend with in 2018. Yesterday was simply a milestone marking the turn to the home stretch.
Although MiFID II has been in the works for many years, its Level II and Level III guidance was still being finished in the second half of 2017, which has meant an uncomfortable level of ambiguity for those who must implement MiFID II.