{"id":15343973,"url":"https://github.com/tarilabs/jsr223-powerfx","last_synced_at":"2026-01-06T19:05:21.810Z","repository":{"id":57726525,"uuid":"469216260","full_name":"tarilabs/jsr223-powerfx","owner":"tarilabs","description":"A JSR-223 implementation for evaluating Power Fx formulas (expression) by making use of a server implemented on F# and .NET platform","archived":false,"fork":false,"pushed_at":"2022-03-23T21:06:46.000Z","size":27,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-01T21:41:21.091Z","etag":null,"topics":["fsharp","java","jsr223","powerfx"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tarilabs.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}},"created_at":"2022-03-12T22:38:56.000Z","updated_at":"2022-07-19T15:13:12.000Z","dependencies_parsed_at":"2022-09-26T21:50:50.158Z","dependency_job_id":null,"html_url":"https://github.com/tarilabs/jsr223-powerfx","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarilabs%2Fjsr223-powerfx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarilabs%2Fjsr223-powerfx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarilabs%2Fjsr223-powerfx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarilabs%2Fjsr223-powerfx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tarilabs","download_url":"https://codeload.github.com/tarilabs/jsr223-powerfx/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245904843,"owners_count":20691679,"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":["fsharp","java","jsr223","powerfx"],"created_at":"2024-10-01T10:53:26.233Z","updated_at":"2026-01-06T19:05:21.775Z","avatar_url":"https://github.com/tarilabs.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"This is an Open Source community project.\n\n# JSR-223 Power Fx\n\nA JSR-223 implementation for evaluating Power Fx formulas (expression) by making use of a server implemented on F# and .NET platform.\n\n```mermaid\nsequenceDiagram\n    participant J as Your Java App\n    participant I as \u003c\u003cinterface\u003e\u003e\u003cbr/\u003eJDK JSR-223\n    participant E as This JSR-223\u003cbr/\u003eScriptEngine\n    participant S as This .NET server\u003cbr/\u003e(Docker image)\n    link I: Guide @ https://docs.oracle.com/en/java/javase/14/scripting/java-scripting-api.html\n    link I: JavaDoc @ https://docs.oracle.com/en/java/javase/17/docs/api/java.scripting/javax/script/package-summary.html\n    J-\u003e\u003eI: \n    I-\u003e\u003eE: \n    E-\u003e\u003eS: POST /eval\u003cbr/\u003e(JSON)\n    S--\u003e\u003eE: Power Fx eval result\u003cbr/\u003e(JSON)\n    E-\u003e\u003eI: \n    I-\u003e\u003eJ: \n```\n# How to use\n\nRun docker image with:\n\n```bash\ndocker run -p 80:5000 jsr223-powerfx-server\n```\n\nInclude this dependency in your Java project.\n\nUsing Maven:\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.matteomortari\u003c/groupId\u003e\n    \u003cartifactId\u003ejsr223-powerfx\u003c/artifactId\u003e\n    \u003cversion\u003e0.1\u003c/version\u003e\n    \u003cscope\u003eruntime\u003c/scope\u003e\n\u003c/dependency\u003e\n```\n\nExample usage:\n\n```java\nScriptEngineManager MANAGER = new ScriptEngineManager();\nScriptEngine engine = MANAGER.getEngineByName(\"powerfx\");\nBindings bindings = engine.createBindings();\nbindings.put(\"a\", 1);\nbindings.put(\"b\", 2);\nObject result = engine.eval(\"a+b\", bindings); // result = 3\n```\n\n# FAQ\n\nQ: Why F# ?\u003cbr/\u003e\nA: No particular reason, I've always been looking for an excuse to experiment using it; luck is being prepared when the opportunity comes :)\n\nQ: Is it \"production-ready\"?\u003cbr/\u003e\nA: This is a [chabuduo](https://youtube.com/clip/UgkxeVe0fr81gBBZXzQ1LG2189Z1QrYspmXt) MVP working-PoC\n\nQ: I have a feedback/question?\u003cbr/\u003e\nA: Feel free to contact me!\n\n# References\n\nHelpful references I've used while building this experiment\n- Wu, C. (2010). Dynamic Languages on JVM. In: Pro DLR in .NET 4. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4302-3067-0_12\n- https://github.com/microsoft/power-fx-host-samples/issues/10\n- Web Development with F# on .NET Core https://www.youtube.com/watch?v=W8qAUJIVj8c\n- https://www.codesuji.com/2020/03/08/F-and-Docker/\n- https://docs.microsoft.com/en-us/dotnet/core/docker/build-container?tabs=linux\n- https://stackoverflow.com/a/60132230/893991\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftarilabs%2Fjsr223-powerfx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftarilabs%2Fjsr223-powerfx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftarilabs%2Fjsr223-powerfx/lists"}