Zygo is a Lisp interpreter written in 100% Go. Central use case: dynamically compose Go struct trees in a zygo script, then invoke compiled Go functions on those trees. Makes Go reflection easy.
Right now CallUserFunction will always allocate a byte slice to store stack traces. Delaying the allocation of the byte slice until it is absolutely necessary drastically increases the performance of this method (~3x on my machine).
Potential downside of this is that we might be unable to allocate memory when the panic occurs. However, I think go will still give us a pretty solid error message in that case.
Right now
CallUserFunction
will always allocate a byte slice to store stack traces. Delaying the allocation of the byte slice until it is absolutely necessary drastically increases the performance of this method (~3x on my machine).Potential downside of this is that we might be unable to allocate memory when the panic occurs. However, I think go will still give us a pretty solid error message in that case.