{"id":13647561,"url":"https://github.com/lice-lang/lice","last_synced_at":"2025-04-22T02:32:04.913Z","repository":{"id":95487925,"uuid":"82303195","full_name":"lice-lang/lice","owner":"lice-lang","description":"A multi-paradigm programming language running on JVM","archived":false,"fork":false,"pushed_at":"2018-05-11T14:19:10.000Z","size":678,"stargazers_count":130,"open_issues_count":0,"forks_count":9,"subscribers_count":12,"default_branch":"master","last_synced_at":"2024-11-09T21:37:02.273Z","etag":null,"topics":["interpreter","jvm","kotlin","language","lice","lisp","lisp-dialect","lisp-interpreter","programming-language"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lice-lang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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":"2017-02-17T14:08:40.000Z","updated_at":"2024-08-02T06:48:34.000Z","dependencies_parsed_at":"2023-04-12T06:21:45.033Z","dependency_job_id":null,"html_url":"https://github.com/lice-lang/lice","commit_stats":null,"previous_names":[],"tags_count":32,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lice-lang%2Flice","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lice-lang%2Flice/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lice-lang%2Flice/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lice-lang%2Flice/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lice-lang","download_url":"https://codeload.github.com/lice-lang/lice/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250163724,"owners_count":21385299,"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":["interpreter","jvm","kotlin","language","lice","lisp","lisp-dialect","lisp-interpreter","programming-language"],"created_at":"2024-08-02T01:03:38.879Z","updated_at":"2025-04-22T02:32:04.644Z","avatar_url":"https://github.com/lice-lang.png","language":"Kotlin","funding_links":[],"categories":["Kotlin"],"sub_categories":[],"readme":"![](./src/main/kotlin/org/lice/icon.jpg)\n\n# Lice\n\nCI|status\n:---|:---:\nTravis CI|[![Build Status](https://travis-ci.org/lice-lang/lice.svg?branch=master)](https://travis-ci.org/lice-lang/lice)\nAppVeyor|[![Build status](https://ci.appveyor.com/api/projects/status/7d6lyinb0xr6hagn?svg=true)](https://ci.appveyor.com/project/ice1000/lice/branch/master)\nCircleCI|[![CircleCI](https://circleci.com/gh/lice-lang/lice/tree/master.svg?style=svg)](https://circleci.com/gh/lice-lang/lice/tree/master)\nCodeShip|[![Codeship Status for lice-lang/lice](https://app.codeship.com/projects/2e71d680-61fd-0135-bc9e-7aecbc4a3d79/status?branch=master)](https://app.codeship.com/projects/239723)\n\n[![JitPack](https://jitpack.io/v/lice-lang/lice.svg)](https://jitpack.io/#lice-lang/lice)\u003cbr/\u003e\n[ ![Download](https://api.bintray.com/packages/ice1000/Lice/lice/images/download.svg?version=3.3.2) ](https://bintray.com/ice1000/Lice/lice/3.3.2/link)\u003cbr/\u003e\n[![Gitter](https://badges.gitter.im/lice-lang/lice.svg)](https://gitter.im/lice-lang/lice)\u003cbr/\u003e\n[![Dependency Status](https://www.versioneye.com/user/projects/58df5b1c24ef3e00425cf73f/badge.svg)](https://www.versioneye.com/user/projects/58df5b1c24ef3e00425cf73f)\u003cbr/\u003e\n[![codecov](https://codecov.io/gh/lice-lang/lice/branch/master/graph/badge.svg)](https://codecov.io/gh/lice-lang/lice)\u003cbr/\u003e\n[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](http://www.gnu.org/licenses/gpl-3.0)\u003cbr/\u003e\n[![Awesome Kotlin Badge](https://kotlin.link/awesome-kotlin.svg)](https://github.com/KotlinBy/awesome-kotlin)\u003cbr/\u003e\n\n# About\n\nThis is the interpreter of Lice language, a dialect of Lisp, run on JVM platform.\n\nIt supports call-by-value, call-by-name, call-by-need(we sometimes call it lazy evaluation) at the same time.\nFunctions and values are treated as the same. Dynamic scoping, because I can't find a better scoping solution\nfor a interpreted language.\n\n+ [About the Language](https://github.com/lice-lang/lice-reference)\n+ [A simple Haskell implementation](./lice.hs)\n+ [**(Feature!) IntelliJ IDEA Plugin**](https://github.com/lice-lang/lice-intellij)\n\nSee [FeatureTest](src/test/kotlin/org/lice/FeatureTest.kt) to learn more about the language's features.\n\nAlso, as the main repo for the Lice language, this repo will not be updated very frequently.  \nInstead, I do language feature experiments in [The tiny version of Lice](https://github.com/lice-lang/lice-tiny), which is more actively updated and not guarenteed be backward capable.  \nOnce a feature is finished and tested, and not considered harmful, I'll copy the codes here and publish releases.\n\n## It looks like\n\n```lice\n; print a string\n(print \"Hello \" \"World\" \"\\n\")\n\n; travel through a range\n(for-each i (.. 1 10) (print i \"\\n\"))\n\n; define a call-by-name function\n(defexpr fold ls init op\n (for-each index-var ls\n   (-\u003e init (op init index-var))))\n\n; invoke the function defined above\n(fold (.. 1 4) 0 +)\n\n; passing a call-by-value lambda to a call-by-value lambda\n((lambda op (op 3 4)) (lambda a b (+ (* a a) (* b b))))\n\n; to define a call-by-need lambda, use `lazy`.\n```\n\n# Building\n\nTo use Lice with build tools, first add jcenter to your repositories list.\n \nWith gradle, add this to your dependencies list:\n\n```groovy\ncompile 'org.lice:lice:3.3.2'\n```\n\nOr with maven:\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003eorg.lice\u003c/groupId\u003e\n  \u003cartifactId\u003elice\u003c/artifactId\u003e\n  \u003cversion\u003e3.3.2\u003c/version\u003e\n  \u003ctype\u003epom\u003c/type\u003e\n\u003c/dependency\u003e\n```\n\nOr with ivy:\n\n```xml\n\u003cdependency org='org.lice' name='lice' rev='3.3.2'\u003e\n  \u003cartifact name='lice' ext='pom'/\u003e\n\u003c/dependency\u003e\n```\n\nAlternatively, you can download the nightly jar for the newest commit on [AppVeyor](https://ci.appveyor.com/project/ice1000/lice/branch/master/artifacts).\n\n# Script API \n\n```java\nimport javax.script.*;\n\npublic class LiceScriptEngineTest {\n    public static void main() throws Exception {\n        ScriptEngine engine = new ScriptEngineManager().getEngineByName(\"lice\");\n        engine.eval(\"(-\u003e x 10)\");\n        engine.eval(\"(print x)\");\n    }\n}\n```\n\n## Lice performance\n\nCode to run:\n\n```lice\n; loops\n(def loop count block (|\u003e\n    (-\u003e i 0)\n    (while (\u003c i count) (|\u003e (block i)\n    (-\u003e i (+ i 1))))))\n\n; invoking the function\n(loop 200000 (lambda i (|\u003e\n    (defexpr let x y block (|\u003e\n        (-\u003e x y) ; this is actually an issue of lice.\n        (block)\n        (undef x)))\n    (let reimu 100 (lambda (|\u003e x))))))\n\n(print \"loop count: \" i)\n```\n\nEnvironment: Ubuntu Linux 16.04, HotSpot 1.8u151, Intel core i7 4720HQ 2.6 GHz\n\nCondition|Time\n:---:|:---:\nLice call Java using `extern`|350ms\nLice call Java using Lice API|295ms\nPure Java|13ms\nPure Lice|897ms\nJava call Lice using Lice API|629ms\n\n## Lice invoking Java\n\nLice has handy APIs for interacting with Java.\n\n```lice\n; declare an extern function\n; must be a static Java function\n(extern \"java.util.Objects\" \"equals\")\n\n; calling the extern function\n(equals 1 1)\n```\n\n## Java invoking Lice\n\nThis project provides handy APIs for running Lice codes from Java.\n\n```java\nclass SomeClass {\n  public static void main(String[] args){\n    // Running Lice\n    System.out.println(Lice.run(\"(+ 1 1)\")); // prints 2\n    System.out.println(Lice.run(new File(\"example.lice\"))); // run codes in a file\n    \n    // Lice API\n    SymbolList env = new SymbolList();\n    Lice.run(\"(def blablabla a (+ a a)) (-\u003e myVar 233)\", env);\n    env.extractLiceFunction(\"blablabla\").invoke(233); // result: 466\n    int var = ((Number) env.extractLiceVariable(\"myVar\")).intValue(); // result: 233\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flice-lang%2Flice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flice-lang%2Flice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flice-lang%2Flice/lists"}