top | item 46473140

(no title)

djaouen | 1 month ago

Lisp solves the performance hit of closures with macros. However, given what macros look like in C, I hope it never amounts to that!

discuss

order

skavi|1 month ago

There’s no necessary performance hit for closures. The performance cost here is caused by these closures needing to conform to a function pointer looking interface in order to be generally useful in C.

djaouen|1 month ago

Iirc, in Lisp, closures are heap-allocated, unless they are created at compile-time with macros. Therefore, there is the added overhead of malloc and free calls with each closure created. Am I wrong here?