3 ms·
> It is possible to write very efficient code in CL. However LQN will never be anywhere as fast as e.g. grep, Sed and AWK. Among other things the startup time f
by aidenn0 3y ago
> It is possible to write very efficient code in CL. However LQN will never be anywhere as fast as e.g. grep, Sed and AWK. Among other things the startup time for running CL from the terminal is higher than for smaller utilities.
What implementation is the author using? A dumped image from sbcl is significantly faster in startup time than e.g. Python startup time.
> As you see CL vectors are written as #(..). And kvs are lists ((:OF . "tuples") (:LIKE . "this")). LDN is also valid CL source code. If you paste the above into a CL REPL you get the same object back.
This is only because the outer object in the example is an array. If the outer object were a kv, then it would try to call a function with the name of the first dotted pair, which is unlikely to be a function name[1].
1: The only time a CONS can be a function name is if it's of the form (cl:setf SYMBOL); I don't think this is possible with a kv as written, since that would require the value (i.e. the CDR) to be of the form (CONS SYMBOL NIL) . The atomic types are not clear from the blog post, but the aggregate types are either arrays or lists containing zero-or-more CONS cells, I don't think it's possible