Hacker News new | past | comments | ask | show | jobs | submit login

Nice. A link to the file and project of each example would be great for usage context.

What is it scraping? Is it just Github projects with language "Clojure"?




IRC logfiles, mostly. You're seeing examples of code snippets typed into IRC from the last 4-5 years run in a sandbox under Clojure 1.5.1. I also ran it over the ClojureDocs s-expressions. There are a lot of examples missing (defn, def, etc. for instance) due to the fact that I didn't want to inadvertently run something evil, but FWIW there are over 30k examples of sequence functions, JVM interop, etc. In a previous comment I mentioned that my plan is to add the ability to submit, edit, bookmark, and rate examples.

RE: GitHub projects tagged "Clojure": I think exploring Codeq (https://github.com/Datomic/codeq) would be a cool way to go about doing that kind of thing.


Last time I tried codeq, the analyzer was limited to symbols defined outside of functions. The Clojurescript parser might be a better option, because the parse tree would allow indexing usages inside functions.

I also wonder if a generative testing library could be used to generate examples.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: