{"id":20141978,"url":"https://github.com/krukow/clj-ds","last_synced_at":"2025-04-09T14:09:30.439Z","repository":{"id":908001,"uuid":"666669","full_name":"krukow/clj-ds","owner":"krukow","description":"Clojure's data structures modified for use outside of Clojure ","archived":false,"fork":false,"pushed_at":"2023-12-17T15:38:56.000Z","size":815,"stargazers_count":219,"open_issues_count":7,"forks_count":34,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-04-02T12:08:38.100Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/krukow.png","metadata":{"files":{"readme":"README","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2010-05-14T15:26:19.000Z","updated_at":"2025-03-01T01:31:13.000Z","dependencies_parsed_at":"2024-01-05T20:45:50.645Z","dependency_job_id":"5ada99bd-32c8-4f30-8560-c756fb075ae6","html_url":"https://github.com/krukow/clj-ds","commit_stats":{"total_commits":51,"total_committers":6,"mean_commits":8.5,"dds":"0.47058823529411764","last_synced_commit":"6a45a1ddb253516088c3480ee8ee7796bd72b094"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krukow%2Fclj-ds","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krukow%2Fclj-ds/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krukow%2Fclj-ds/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krukow%2Fclj-ds/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/krukow","download_url":"https://codeload.github.com/krukow/clj-ds/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248054195,"owners_count":21039952,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T22:00:14.947Z","updated_at":"2025-04-09T14:09:30.414Z","avatar_url":"https://github.com/krukow.png","language":"Java","funding_links":[],"categories":["Memory and concurrency"],"sub_categories":[],"readme":"This library has been extracted from the master branch of Clojure (http://clojure.org)\n\nversion 1.5.1 (as of October 2013)\n\nhttp://github.com/richhickey/clojure\n\ncreated by Rich Hickey. The core data structures and algorithms are due to him.\nThis library is distributed with the same license as the Clojure programming \nlanguage itself (EPL, see file epl-v10.html).\n\nIt has been modified by Karl Krukow \u003ckarl.krukow@gmail.com\u003e, and mistakes introduced are mine.\n\n\nMaven\n\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.github.krukow\u003c/groupId\u003e\n  \u003cartifactId\u003eclj-ds\u003c/artifactId\u003e\n  \u003cversion\u003e0.0.4\u003c/version\u003e\n\u003c/dependency\u003e\n\n\n*WHY*\nFirst, I love Clojure :) ... \nUnfortunately sometimes clients require that I use Java...\n\nThe data structures used in the Clojure programming language are a great\nimplementation of a number of useful persistent data structures \n(see e.g., the section on immutable data structures on\nhttp://clojure.org/functional_programming). \n\nHowever, these data structures are tailor-made to work optimally in the\nClojure programming language, and while it is possible to use these from\nJava (since Clojure is distributed as a .jar file), it is inconvenient\nfor a number of reasons (see below). Since it is (unfortunately) not always\npossible to use Clojure, I've created this library to at least reap some of the\nClojure benefits in environments constrained to Java. \nBeyond Java, other JVM languages like Erjang, Scala, JRuby and Groovy may benefit\nfrom immutability \u0026 persistence, and from this implementation.\n\n*Advantages of clj-ds when constrained to working with Java*\nCurrently the Clojure data structures are implemented in Java. In the future,\nall of Clojure will be implemented in Clojure itself (known as \"Clojure-in-Clojure\").\nThis has many advantages for Clojure, but when it happens the data structures will \nprobably be even more intertwined with the rest of the language, \nand may be even more inconvenient to use in a Java context.\n\nThe clj-ds project will maintain Java versions of the code, and where possible attempt\nto \"port\" improvements made in the Clojure versions back into clj-ds. Thus keeping maintained\nversions of the Java data structures. \n\nIn the current Clojure version, calling certain methods on PersistentHashMap requires\nloading the entire Clojure runtime, including the bootstrap process. This takes about one second.\nThis means that the first time one of these methods is called, a Java user will experience a\nslight delay (and a memory-usage increase). Further, many of the Clojure runtime \nJava classes are not needed when only support for persistent data structures \nis wanted (e.g., the compiler).\n\nThe clj-ds library is not dependent on the Clojure runtime nor does it run any\nClojure bootstrap process, e.g., the classes that deal with compilation have been removed. \nThis results in a smaller library, and the mentioned delay does not occur.\n\nClojure is a dynamically typed language. Java is statically typed, and supports\n'generics' from version 5. A Java user would expect generics support from a Java\ndata structure library, and the Clojure version doesn't have this. \nclj-ds will support generics.\n\nFinally, a slight improvement. \nCertain of the Clojure data structure methods use Clojure's 'seq' abstraction\nin the implementation of the Java 'iterator' pattern. It is possible, to make\nslightly more efficient iterators using a tailor made iterator. clj-ds does this.\n\nExample stats for iterating through various data structures:\n(20-40% improvement, matters only for quite large structures)\n\nPersistentHashSet:\n----\n500.000 elements\n58 ms (Java avg.)\n192 ms (Pure Clojure avg)\n106 ms (clj-ds avg)\n---\n1 mio elements:\n104 ms (Java avg.)\n497 ms (Pure Clojure avg)\n371 ms (clj-ds avg)\n\n---\nPersistentHashMap\n---\n500.000 elements\n94 ms (Java avg.)\n189 ms (Pure Clojure avg)\n131 ms (clj-ds avg)\n\n1 mio elements:\n128 ms (Java avg.)\n549 ms (Pure Clojure avg)\n394 ms (clj-ds avg)\n\n---\nPersistentVector \n---\n1 mio elements:\n104 ms (Java avg.)\n122 ms (Pure Clojure avg)\n104 ms (clj-ds avg)\n\n2 mio elements:\n186 ms (Java avg.)\n223 ms (Pure Clojure avg)\n184 ms (clj-ds avg)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrukow%2Fclj-ds","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkrukow%2Fclj-ds","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrukow%2Fclj-ds/lists"}