{"id":27407222,"url":"https://github.com/kadirmalak/clowg","last_synced_at":"2026-05-03T05:44:48.743Z","repository":{"id":62431646,"uuid":"265238532","full_name":"kadirmalak/clowg","owner":"kadirmalak","description":"A Clojure library for generating wrappers around Java","archived":false,"fork":false,"pushed_at":"2020-05-24T10:41:46.000Z","size":44,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-23T09:53:52.160Z","etag":null,"topics":["clojure","generator","interop","java","wrapper"],"latest_commit_sha":null,"homepage":"","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kadirmalak.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-19T12:16:11.000Z","updated_at":"2023-09-08T18:07:41.000Z","dependencies_parsed_at":"2022-11-01T20:46:36.493Z","dependency_job_id":null,"html_url":"https://github.com/kadirmalak/clowg","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kadirmalak/clowg","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kadirmalak%2Fclowg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kadirmalak%2Fclowg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kadirmalak%2Fclowg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kadirmalak%2Fclowg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kadirmalak","download_url":"https://codeload.github.com/kadirmalak/clowg/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kadirmalak%2Fclowg/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32559716,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T03:21:47.309Z","status":"ssl_error","status_checked_at":"2026-05-03T03:21:43.884Z","response_time":103,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["clojure","generator","interop","java","wrapper"],"created_at":"2025-04-14T07:10:53.986Z","updated_at":"2026-05-03T05:44:48.715Z","avatar_url":"https://github.com/kadirmalak.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# clowg\n\nA Clojure library for generating Clojure wrappers around Java\n\n## Installing\n\n[![Clojars Project](https://img.shields.io/clojars/v/clowg.svg)](https://clojars.org/clowg)\n\n## Usage\n\n### Example 1: Wrapping java.util.concurrent.LinkedBlockingDeque (CLI usage)\n\n- cd to the src directory\n\n- run cmd to generate source file (change X.X.X part with the latest version number)\n\n```\n\u003e clojure -Sdeps \"{:deps {clowg {:mvn/version \\\"X.X.X\\\"}}}\" -m clowg.core java.util.concurrent.LinkedBlockingDeque com.example.linked-blocking-deque\n./com/example/linked_blocking_deque.clj written...\n```\n\n- use generated file\n\n```\n(require '[com.example.linked-blocking-deque :as dq])\n\n(def q (dq/make-LinkedBlockingDeque-with-int 5)) ; **int** parameter is capacity\n\n(dq/addFirst q \"f1\")\n(dq/addFirst q \"f2\")\n(dq/addFirst q \"f3\")\n(dq/addLast q \"l1\")\n(dq/addLast q \"l2\")\n\n(dq/poll q)\n=\u003e \"f3\"\n(dq/poll q)\n=\u003e \"f2\"\n(dq/poll q)\n=\u003e \"f1\"\n(dq/poll q)\n=\u003e \"l1\"\n(dq/poll q)\n=\u003e \"l2\"\n(dq/poll q)\n=\u003e nil\n```\n\n### Example 2: Wrapping java.util.Random (LIB usage)\n\n- generate the code string and manually copy into a file\n\n```\n(require '[clowg.core :refer [get-code-str]])\n(get-code-str java.util.Random)\n```\n\n- use generated code\n\n```\n; assuming that code is copied into src/com/example/random.clj\n\n(require '[com.example.random :as rnd])\n\n(def r (rnd/make-Random 42))\n(repeatedly 10 #(rnd/nextInt r 10))\n=\u003e (0 3 8 4 0 5 5 8 9 3)\n\n```\n\n### Example 3: Wrapping 3rd party classes\n\n- you may add the external dependency to the cli command as in the following example:\n\n```\nclojure -Sdeps \"{:deps {clowg {:mvn/version \\\"X.X.X\\\"} org.processing/core {:mvn/version \\\"3.3.7\\\"}}}\" -m clowg.core processing.core.PApplet com.example.p-applet\n./com/example/p_applet.clj written...\n```\n\n- or you can always add clowg as a dependency to your project and prefer manual usage as in Example 2\n\n## Conversion Details\n\n- If a Java method has at least two overloads with same number of parameters, an arity problem occurs. In order to resolve this issue, new functions are generated with different names based on their parameter types.\n\n```\n(defn make-String ...\n(defn make-String-with-StringBuilder ...\n(defn make-String-with-StringBuffer ...\n(defn make-String-with-byte-array ...\n(defn make-String-with-byte-array-and-Charset ... \n```\n\n- Constructors start with make-SimpleClassName\n\n- Instance methods and static methods start with their original names.\n\n- Fields are **function**s starting with \"-\"\n\n- Static final fields are **def**s starting with \"-\"\n\n## TODO\n\n...\n\n## License\n\nMIT License\n\nCopyright (c) 2020 Kadir Malak\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkadirmalak%2Fclowg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkadirmalak%2Fclowg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkadirmalak%2Fclowg/lists"}