{"id":16659305,"url":"https://github.com/dundalek/notcurses-clojure-example","last_synced_at":"2025-04-09T18:41:57.293Z","repository":{"id":65294923,"uuid":"386912118","full_name":"dundalek/notcurses-clojure-example","owner":"dundalek","description":"Demo showing how to use Notcurses library for building terminal UIs with Clojure ","archived":false,"fork":false,"pushed_at":"2023-10-16T14:58:50.000Z","size":84,"stargazers_count":18,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-23T20:43:30.290Z","etag":null,"topics":["clojure","graalvm","graalvm-native-image","notcurses","terminal","tui"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dundalek.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-MIT","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-07-17T10:52:03.000Z","updated_at":"2024-10-27T10:43:13.000Z","dependencies_parsed_at":"2025-02-15T13:32:50.084Z","dependency_job_id":"8d12fbcf-1892-4737-8baa-7f07ebb962d0","html_url":"https://github.com/dundalek/notcurses-clojure-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dundalek%2Fnotcurses-clojure-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dundalek%2Fnotcurses-clojure-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dundalek%2Fnotcurses-clojure-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dundalek%2Fnotcurses-clojure-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dundalek","download_url":"https://codeload.github.com/dundalek/notcurses-clojure-example/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248090011,"owners_count":21046007,"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":["clojure","graalvm","graalvm-native-image","notcurses","terminal","tui"],"created_at":"2024-10-12T10:24:37.893Z","updated_at":"2025-04-09T18:41:57.265Z","avatar_url":"https://github.com/dundalek.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Notcurses Clojure example\n\n[Notcurses](https://notcurses.com/) is a moderm library for building terminal UIs with advanced graphics support. This is a demo showing how to use it with [Clojure](https://clojure.org/).\n\nBindings are generated with [SWIG](http://swig.org/) and compiled using [Zig](https://andrewkelley.me/post/zig-cc-powerful-drop-in-replacement-gcc-clang.html) (any C compiler could be used, but I find Zig easiest to use because it includes powerful yet simple build system instead of relying on additional complex tools). [GraalVM](https://www.graalvm.org/) native-image is used to compile it to a binary executable.\n\n![Notcurses demo](https://user-images.githubusercontent.com/755611/114319180-d83ac400-9aff-11eb-8b50-3e9a388b91c7.png)\n\nTested on Linux, might require some tweaks to run on macOS. Please let me know or open a PR if you get the demo running on macOS.\n\n### Dependencies\n\n- Easiest way to get dependencies is to install [Nix](https://nixos.org/download.html) package manager.  \n  Running `nix-shell` will drop you in a shell with all dependencies pulled in.\n\n- Otherwise install Clojure, SWIG, Zig, GraalVM and [Notcurses deps](https://github.com/dankamongmen/notcurses/blob/master/INSTALL.md) using a preferred way for your OS.\n\n#### Pull in Notcurses source code\n\nSince packaged versions of Notcurses are often outdated, we pull and build it from source:\n\n```sh\ngit clone https://github.com/dankamongmen/notcurses.git deps/notcurses\ncd deps/notcurses\ngit checkout v3.0.9 # latest release at the time of writing\nmkdir build \u0026\u0026 cd build\ncmake -DUSE_MULTIMEDIA=none -DUSE_QRCODEGEN=off -DUSE_PANDOC=off -DUSE_DOCTEST=off ..\n# We just need `cmake` to generate some headers, no need to actually `make` since rest will be handled by Zig.\n```\n\n### Build and run\n\nBuild everything with:\n```sh\nscripts/compile\n```\n\nRun the binary:\n```sh\ntarget/demo\n```\n\nWith the bindings compiled demo can be also run with the Clojure CLI:\n```sh\nclojure -Mnative -m demo.main\n```\n\n### Limitations\n\n- Notcurses API for setters often uses pointers to primitive types to set their value, which does not work in Java since it only supports passing primitive types by value. Therefore functions to set channels properties like `ncchannels_set_*` need to be reimplemented in Clojure or Java.\n- I didn't go through the whole API, some bindings might need additional tweaks to work.\n\n### Related\n\nSee also the demo implemented in [Zig](https://github.com/dundalek/notcurses-zig-example).\n\n### License\n\nDual-licensed under MIT or the [Unlicense](https://unlicense.org/).\n\nIncludes [Native Utils](https://github.com/adamheinrich/native-utils) licensed under MIT.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdundalek%2Fnotcurses-clojure-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdundalek%2Fnotcurses-clojure-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdundalek%2Fnotcurses-clojure-example/lists"}