How does Q perform in comparison with other (functional) programming languages?
This is a mixed bag, but all in all I consider Q as efficient enough for practical purposes. Right now, only a bytecode interpreter implementation is available, so you cannot expect Q programs to run as fast as native machine code compiled from languages like C. Nevertheless, pattern matching is done reasonably fast, as it uses some kind of generalized DFA device which only performs a single, non-backtracking left-to-right scan of the target expression in each reduction. Moreover, the basic eager evaluation strategy admits an efficient stack-based implementation. To give you a concrete figure, I found that with simple kinds of definitions on an Athlon 1400 typically some 400-600K reductions are performed per second. In the benchmarks I did I found that Q scripts implementing simple list processing functions execute about as fast as their equivalents in CLISP, the Common Lisp interpreter by Haible et al, which appears to be a fairly efficient implementation. Heavily recursive functions
Related Questions
- Are electrical characteristics of the device guaranteed after programming? Is it necessary to perform functional tests on the programmed units?
- How does Java technology relate to dynamic languages and functional programming?
- How does Q perform in comparison with other (functional) programming languages?