{"id":13760441,"url":"https://github.com/borkdude/jayfu","last_synced_at":"2025-04-30T11:33:34.827Z","repository":{"id":49036616,"uuid":"367852807","full_name":"borkdude/jayfu","owner":"borkdude","description":"Jayfu is a tutorial on how to create a Clojure CLI with GraalVM native-image and SCI.","archived":false,"fork":false,"pushed_at":"2023-09-07T17:10:35.000Z","size":24,"stargazers_count":54,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-19T01:32:02.881Z","etag":null,"topics":["clojure","graalvm-native-image"],"latest_commit_sha":null,"homepage":"","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"epl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/borkdude.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2021-05-16T10:48:47.000Z","updated_at":"2024-10-05T23:52:54.000Z","dependencies_parsed_at":"2024-01-15T04:09:41.767Z","dependency_job_id":null,"html_url":"https://github.com/borkdude/jayfu","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/borkdude%2Fjayfu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/borkdude%2Fjayfu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/borkdude%2Fjayfu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/borkdude%2Fjayfu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/borkdude","download_url":"https://codeload.github.com/borkdude/jayfu/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251691658,"owners_count":21628366,"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-native-image"],"created_at":"2024-08-03T13:01:10.334Z","updated_at":"2025-04-30T11:33:34.800Z","avatar_url":"https://github.com/borkdude.png","language":"Clojure","readme":"# jayfu\n\nLearn how to make a native Clojure CLI with GraalVM native-image and SCI!\n\nThis example is set up around an example CLI, `jayfu`, that reads JSON from\nstdin and transforms it using a function which is dynamically evaluated:\n\n``` clojure\n$ echo '{\"a\": {\"b\": 2}}' | ./jayfu -f '#(-\u003e % :a :b)' -k keyword\n2\n```\n\nSee this [talk](https://www.youtube.com/watch?v=L2LAaQBVvxM) which guides you through this project.\n\n## Prerequisites\n\n- Download [GraalVM](https://www.graalvm.org/downloads/). Just download it to\n  your Downloads folder and unzip the archive. No further installation\n  required. This tutorial is based on version 21.1.0 JDK11.\n\n- Set the `GRAALVM_HOME` environment variable. E.g.:\n\n  `export GRAALVM_HOME=/Users/borkdude/Downloads/graalvm-ce-java11-21.1.0/Contents/Home`\n\n- To run with Clojure or Java, you will need to have a\n  Java 8 or 11 installation available. You can also use the downloaded GraalVM for this.\n\n- Install [babashka](https://github.com/babashka/babashka#installation) (0.4.1 or higher).\n\n### Windows\n\nAlways use `cmd.exe` for executing GraalVM compilation, do not use PowerShell.\n\nOn Windows, install Visual Studio 2017 or 2019 and in `cmd.exe` load:\n\n```\n\"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Auxiliary\\Build\\vcvars64.bat\"\n```\n\nThis will set the right environment variables for GraalVM.\n\nAfter this you should be able to run `bb native-image`.\n\n## Tasks\n\nTo see all available tasks in this project, run `bb tasks`:\n\n``` text\n$ bb tasks\nThe following tasks are available:\n\nrun-main     Run main\nuberjar      Builds uberjar\nrun-uber     Run uberjar\ngraalvm      Checks GRAALVM_HOME env var\nnative-image Builds native image\n```\n\n## Run\n\nTo run this example using Clojure, run:\n\n``` clojure\n$ bb run-main --help\nUsage:\n  -f, --func FUNCTION  identity  The function applied to JSON from stdin\n  -k, --key-fn KEY-FN  identity  The function applied to keywords\n  -h, --help\n\n$ echo '{\"a\": {\"b\": 2}}' | bb run-main -f '#(-\u003e % :a :b)' -k keyword\n2\n```\n\n## Build\n\nTo build the native image, run:\n\n``` text\n$ bb native-image\n```\n\nThis should produce a binary called `jayfu`:\n\n``` clojure\n$ echo '{\"a\": {\"b\": 2}}' | ./jayfu -f '#(-\u003e % :a :b)' -k keyword\n2\n```\n\n## Talk\n\nSee this [talk](https://www.youtube.com/watch?v=L2LAaQBVvxM) which guides you through this project.\n\n## Tutorial\n\nComing soon.\n\n## License\n\nCopyright © 2021 Michiel Borkent\n\nDistributed under the EPL License. See LICENSE.\n","funding_links":[],"categories":["Clojure"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fborkdude%2Fjayfu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fborkdude%2Fjayfu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fborkdude%2Fjayfu/lists"}