Skip to content

Instantly share code, notes, and snippets.

@guns
Last active December 28, 2015 01:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save guns/7425023 to your computer and use it in GitHub Desktop.
Save guns/7425023 to your computer and use it in GitHub Desktop.

Deferred reference validation

technomancy, from technomancy/slamhound#19:

“I’ve thought a bit about trying to walk all defmacro bodies in the namespace and check for symbols with a namespace, but that would almost positively result in false positives.”

“I’d rather not handle this than handle this in a way that would have edge cases which could make it go looking for vars that don’t exist.”

Does a solution exist that does not produce false positives, nor accidentally call (launch-missiles)?

  • [ ] Detect qualified references within syntax-quote
  • [ ] Detect fully qualified namespaces

Performance

The slowest operation in slamhound is the pre-loading of namespaces, which is CPU bound (note that it is always slow regardless of the disk cache).

Pre-loading in parallel with (Executors/newFixedThreadPool #cpu-threads) does divide the execution time by ~0.8*cpu-threads, but obviously does not decrease the actual amount of work.

  • [ ] Improve performance of reload/pre-load-namespaces if possible

Minor enhancements

  • [ ] Satisfy all reflection warnings (there are only a handful)
  • [ ] Support Unicode characters in regrow/missing-sym-name
  • [ ] Sort alias candidates by Levenshtein distance, with emphasis on first letter
  • [ ] Sort refer candidates by arity match. e.g. (join []) should prefer clojure.string/join
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment