kdb+ utility to search codebase

Kdb+ Utilities: Q code Workspace Utilities

6 Feb 2018 | ,
Share on:

By Simon Garland

If you are a kdb+/q developer, you will find the workspace utilities created by Kx Managing Director and Senior Solution Architect Leslie Goldsmith to be a valuable resource. The “Kdb+ Utilities” series of blog posts is intended to give a quick introduction to several utilities available at Leslie Goldsmith’s GitHub. In this part of the series we look at an essential tool which contains routines for summarizing and searching the contents of a workspace, ws.

 

This elegant little toolkit by Leslie Goldsmith is an invaluable aid for programmers digging into large bodies of q code. It allows you to find where particular pieces of code come from. Instead of having to run through a lot of static script files you can comb through a live session to find, ‘where does this happen?,’ ‘where is this defined?,’ ‘where else has this been used’ and even ‘where does this typo come from?’

In the ‘70s and ‘80s when I worked at I.P. Sharp as an APL programmer, Leslie wrote an earlier version of these utilities for the APL programming language (library 7 WSSEARCH) which were something that every APL programmer used many times every day to search through large APL workspaces for the occurrences of particular pieces of code. In those days, the only alternative would have been to print the code out on stripy paper and go through it with a red pen.

Building on decades of  experience as a vector programmer, Leslie has recreated a finely-tuned version of this essential collection of tools for kdb+ programmers called ws. I highly recommend you take these utilities for a spin and have a look at the way they are written.

Leslie Goldsmith is currently a Managing Director and Senior Solution Architect at Kx, a division of First Derivatives (FD), based in Mississauga, Canada. Prior to this position, Leslie was co-founder and Managing Director at Affinity Systems, a software consulting and products firm acquired by FD in 2015. In Leslie’s long and storied career as a technologist, he has built many large, complex enterprise software systems and has set a standard of excellence in engineering for generations of developers. He is also the author of one of the world’s first commercial email systems, Mailbox, which debuted in 1973.

Simon Garland is Chief Customer Officer for Kx. He is responsible for upholding Kx’s high standards for technical excellence and customer responsiveness. Prior to joining Kx in 2002, Simon worked at a database search engine company, before that he worked at Credit Suisse in risk management. Simon began his career working with APL, and subsequently worked with the original k and kdb, as well as q and kdb+.

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

SUGGESTED ARTICLES

Migrating a kdb+ historical database to the Amazon Cloud

18 Apr 2018 | , , ,

If you are currently migrating, or considering migrating an historical kdb+ database (HDB) to the Cloud, you will want to read this white paper on the kdb+ developers’ site which looks at popular storage solutions available within the Amazon Web Services (AWS) Cloud. The paper also compares and contrasts the performance of kdb+ on EC2 instances versus physical hardware.

Head of Products, Solutions and Innovation at Kx on Product Design and the Vision for the Future

16 Mar 2018 | , , ,

As the SVP of Products, Solutions and Innovation at Kx Systems, James Corcoran is part of a new chapter in software development at Kx. Since joining Kx parent First Derivatives as a financial engineer in 2009, James has worked around the world building enterprise systems at top global investment banks before moving to the Kx product team in London. James sat down with us recently to discuss his perspective on product design and our technology strategy for the future.

Kdb+ Utilities: Essential utility for identifying performance problems

28 Feb 2018 | ,

If you are a kdb+/q developer, you will find the utilities created by Kx Managing Director and Senior Solution Architect Leslie Goldsmith to be a valuable resource. The “Kdb+ Utilities” series of blog posts gives a quick introduction to the utilities, available at Leslie Goldsmith’s GitHub. In this third part of the series we look at Leslie’s qprof, which allows a programmer to drill down into q functions or applications to inspect performance and CPU usage in a fine-grained fashion.