{"id":14008342,"url":"https://github.com/soupi/pureli","last_synced_at":"2025-07-24T03:32:40.169Z","repository":{"id":34912468,"uuid":"38958111","full_name":"soupi/pureli","owner":"soupi","description":"A purely functional, dynamically typed, parallel evaluated Lisp-like programming language","archived":true,"fork":false,"pushed_at":"2016-03-19T15:04:33.000Z","size":13325,"stargazers_count":35,"open_issues_count":0,"forks_count":0,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-08-11T11:03:03.754Z","etag":null,"topics":["haskell","interpreter","lisp","programming-language"],"latest_commit_sha":null,"homepage":"https://soupi.github.io/pureli","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/soupi.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":"2015-07-12T10:30:01.000Z","updated_at":"2023-04-15T21:06:13.000Z","dependencies_parsed_at":"2022-09-15T19:12:41.271Z","dependency_job_id":null,"html_url":"https://github.com/soupi/pureli","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soupi%2Fpureli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soupi%2Fpureli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soupi%2Fpureli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soupi%2Fpureli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/soupi","download_url":"https://codeload.github.com/soupi/pureli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227410606,"owners_count":17774776,"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":["haskell","interpreter","lisp","programming-language"],"created_at":"2024-08-10T11:01:36.171Z","updated_at":"2024-11-30T19:31:00.950Z","avatar_url":"https://github.com/soupi.png","language":"Haskell","funding_links":[],"categories":["Haskell"],"sub_categories":[],"readme":"Pureli\n======\n\n![(Pureli)](manual/assets/pureli-light-small-transpar.png)\n\nA purely functional, dynamically typed, parallel evaluated Lisp-like programming language interpreter written in Haskell.\n\n[Website](http://soupi.github.io/pureli)\n\n\u003e **Status**: Prototype\n\n\nInstallation\n------------\n\n## Binaries\n\n- [OS X](https://github.com/soupi/pureli/raw/gh-pages/downloads/OS_X/pureli)\n- [Linux](https://github.com/soupi/pureli/raw/gh-pages/downloads/Linux/pureli)\n- [Windows](https://github.com/soupi/pureli/raw/gh-pages/downloads/Windows/pureli.exe)\n\n## From source:\n\n### Using stack\n\n```sh\nstack install\n```\n\n### Using cabal:\n\nInstall GHC 7.10.* and cabal and then run the following commands:\n\n```sh\ngit clone https://github.com/soupi/pureli\ncd pureli\ncabal sandbox init\ncabal install\n```\n\nHOWTO\n-----\n\nRead [The Manual](http://soupi.github.io/pureli/manual.html) for information about pureli and how to write pureli programs.\n\nAtomic Expressions\n------------------\n\n- Integers (`0`, `-1`, `123`)\n- Double precision floating points (`0.002`, `-991.12`)\n- Booleans (`#t`, `#f`)\n- Strings (`\"hello, world!\"`)\n- Keywords (`:hello`, `:world`)\n- Nil (`nil`, `()`)\n\nBuilt-in Procedures\n-------------------\n\n- Arithmetic operations (`+`, `-`, `*`, `/`, `mod`)\n- Tests (`zero?`, `empty?`, `nil?`, `number?`, `integer?`, `real?`, `list?`. `string?`, `procedure?`, `symbol?`, `keyword?`)\n- Comparison (`=`, `\u003c\u003e`, `\u003e`, `\u003c`, `\u003e=`, `\u003c=`)\n- List operations (`list`, `car`, `cdr`)\n- List and String operations (`++`, `slice`, `length`)\n- String operations (`str-\u003elines`, `str-\u003ewords`, `lines-\u003estr`, `words-\u003estr`, `to-upper`, `to-lower`)\n- `round` operation on reals\n- `show` expression\n- `if` expression\n- `let` and `letrec`\n- `quote`, `eval` and `read-str`\n- `error`, `try` and `trace`\n- `lambda` expression\n\nBuilt-in IO Actions\n-------------------\n\n- `do!` sequence IO actions\n- `let!` binds an IO result to a variable\n- `read!` reads a line from the standard input\n- `read-file!` reads a file\n- `print!` writes to the standard output without newline\n- `println!` writes to the standard output with newline\n- `print-file!` writes a string to a file\n- `pure` raises a pure computation into IO context\n\n\nDefinitions\n-----------\n\nTop level functions and values are defined using the keyword `define`.\n\nFor example:\n\n- `(define id (x) x)`\n- `(define message \"Hello, World!\")`\n\n\nA program must have the top level value `main` - an IO action which is the entry point.\n\nFor example:\n\n- `(define main (println! \"Hello, World!\"))`\n\n\n### Unevaluated parameters\n\nIt is also possible to define functions with receives unevaluated parameters\n\n```rkt\n\n(module main)\n\n\n(define unless (test ~true-branch ~false-branch)\n  (if\n    test\n    false-branch\n    true-branch))\n\n\n(define main\n  (println!\n    (unless\n      #t\n      (error \"not thrown\")\n      (+ 1 1)))) ;; =\u003e 2\n\n```\n\nModules\n-------\n\n### Definition\n\nIt is possible to define multiple modules per file. In order to run a file, a 'main' module must be present.\n\nSyntax: `(module \u003cname\u003e ?(\u003cexported definitions\u003e))`\n\n- `(\u003cexported definitions\u003e)` will only export definitions listed. Optional.\n\n\n\n### Requires\n\nIt is possible to import a source file using the `require` keyword at the top of the module. Cyclic imports are currently not allowed.\n\nSyntax: `(require \u003cfilepath\u003e \u003cmodule name\u003e ?(\u003cimported definitions\u003e) \u003c?new name\u003e)`\n\nOr when required module is in the same file: `(module \u003cname\u003e)`\n\n- `(\u003cimported definitions\u003e)` will only imported definitions listed. Optional.\n- `\u003cnew name\u003e` will give the module a new name. Optional.\n- A definition from a module can be accessed using `/`.\n\n\nExamples\n--------\n\n### Factorial\n\n```rkt\n;The program will calculate the factorial of 5 and will print it to screen\n(module main)\n\n(define main\n  (do!\n    [let! result (pure (factorial 5))]\n    [println! \"factorial 5 is: \"]\n    [println! result]))\n\n(define factorial [n]\n  (letrec ((go (lambda (n prod)\n    (if (zero? n)\n      prod\n      (go (- n 1) (* prod n))))))\n    (go n 1)))\n\n```\n\n### Echo\n\n```rkt\n;The program will repeat anything the user writes until ^C\n(module main)\n\n(module \"stdlib/std.pli\" io (bind!))\n\n(define main\n  (do!\n    [println! \"echo program\"]\n    [letrec ([go!\n      (lambda ()\n        (do!\n          [io/bind! (read!) println!]\n          [go!]))])\n      (go!)]))\n```\n\n### Module 1\n\n```rkt\n(module main)\n\n(require \"stdlib/std.pli\" list)\n\n(define main\n  (do!\n    [println! (list/elem 2 (list 1 2 3))])) ; ==\u003e #t\n```\n\n\n### Module 2\n\n```rkt\n(module main)\n\n(require \"stdlib/std.pli\" list (elem) my-std)\n\n(define main\n  (do!\n    [println! (my-std/elem 4 (list 1 2 3))])) ; ==\u003e #f\n\n```\n\n### A Pureli REPL\n```rkt\n(module main)\n\n(define main\n  (do!\n    (println! \"Pureli REPL made in Pureli\")\n    (repl)))\n\n(define repl ()\n  (do!\n    (let! input (read!))\n    (print! \"=\u003e \")\n    (let! result\n          (try (pure (eval (read-str input)))\n               (eval (read-str input))\n               (pure \"Error in expression\")))\n    (if\n      (nil? result)\n      (pure nil)\n      (println! result))\n    (repl)))\n```\n\nMore examples at `examples/` and `tests/`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoupi%2Fpureli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsoupi%2Fpureli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoupi%2Fpureli/lists"}