{"id":48313949,"url":"https://github.com/just-be-dev/pex","last_synced_at":"2026-04-05T00:26:47.875Z","repository":{"id":333148296,"uuid":"1136348845","full_name":"just-be-dev/pex","owner":"just-be-dev","description":"A small language for data transformations","archived":false,"fork":false,"pushed_at":"2026-02-09T18:30:57.000Z","size":236,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-09T22:38:30.493Z","etag":null,"topics":["lenses","lisp-like","programming-language","transformation"],"latest_commit_sha":null,"homepage":"https://pex.just-be.dev","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/just-be-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-17T14:29:44.000Z","updated_at":"2026-02-09T18:31:37.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/just-be-dev/pex","commit_stats":null,"previous_names":["just-be-dev/pex"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/just-be-dev/pex","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/just-be-dev%2Fpex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/just-be-dev%2Fpex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/just-be-dev%2Fpex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/just-be-dev%2Fpex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/just-be-dev","download_url":"https://codeload.github.com/just-be-dev/pex/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/just-be-dev%2Fpex/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31419777,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-05T00:25:07.052Z","status":"ssl_error","status_checked_at":"2026-04-05T00:25:05.923Z","response_time":60,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["lenses","lisp-like","programming-language","transformation"],"created_at":"2026-04-05T00:26:47.252Z","updated_at":"2026-04-05T00:26:47.863Z","avatar_url":"https://github.com/just-be-dev.png","language":"TypeScript","readme":"# PEX Lang\n\nPEX (short for pipe expression language) is a small lisp-like language designed for data manipulation and transformation. It's designed to be terse and embeddable.\n\n## Language Tour\n\n### Basic Expressions\n\nLet's write a simple expression to transform `\"  USER@EXAMPLE.COM  \"` into `\"user@example.com\"`\n\n```lisp\n(trim (lower $$))\n```\n\n`$$` represents input to the program.\n\n### Pipeline Composition\n\nPEX offers a pipeline syntax for cleaner composition.\n\nThe previous example can be rewritten as:\n\n```lisp\n$$ | lower | trim\n```\n\nEffectively the pipeline operator turns `x | y` into the s-expression `(y x)`. It's important to note that the pipeline operator inserts the input value as the first argument to the function on the right side of the pipeline.\n\nSo `x | (y z)` becomes `(y x z)`.\n\n#### Explicit Pipeline Input with `$`\n\nBy default, the pipeline operator passes the left side as the first argument. But sometimes you need more control over where the input goes. Use `$` to explicitly specify the input position:\n\n```lisp\n;; Default: input goes to first argument\n$$ | replace /\\D/g \"\"\n;; Becomes: (replace $$ /\\D/g \"\")\n\n;; Explicit: use $ to control positioning\n$$ | join \"prefix-\" $ \"-suffix\"\n;; Becomes: (join \"prefix-\" $$ \"-suffix\")\n\n;; Multiple uses of $\n$$ | if (\u003e $ 10) $ 0\n;; Becomes: (if (\u003e $$ 10) $$ 0)\n```\n\nWhen `$` appears anywhere in an expression, the automatic first-argument injection is disabled, giving you full control.\n\n#### Implicit Program Input\n\nIn the examples above, we explicitly used `$$` to reference the program input, but this isn't necessary. If the first expression in your program[^1] doesn't reference `$$` or `$`, the input is automatically injected as the first argument:\n\n```lisp\n;; Without auto-injection:\n(lower $$)\n\n;; With auto-injection (equivalent):\nlower\n;; Becomes: (lower $$)\n\n;; Works with pipelines too:\nlower | trim\n;; Becomes: (trim (lower $$))\n```\n\n**The rule:** If `$` or `$$` appears anywhere in the first expression, no auto-injection occurs. This gives you full control when you need it:\n\n```lisp\n;; Uses $ explicitly, so no auto-injection\nif (\u003e $ 10) \"big\" \"small\"\n;; Stays as: (if (\u003e $ 10) \"big\" \"small\")\n```\n\nThis auto-injection makes common transformations more concise while still allowing explicit control when needed\n\n[^1]: By \"first expression\" we mean the first expression that isn't a function definition (`fn`) or variable binding (`let`). These definitions are evaluated first, then auto-injection applies to the first actual transformation expression.\n\n### Conditionals\n\n```lisp\n;; Categorize by value\nif (\u003e $ 100) \"expensive\" \"affordable\"\n;; Input: 150 → Output: \"expensive\"\n;; Input: 50 → Output: \"affordable\"\n```\n\n### Functions and Constants\n\n```lisp\n;; Temperature conversion\nlet FREEZING 32;\nlet RATIO 1.8;\n\nfn c_to_f (c)\n  + (* c RATIO) FREEZING;\n\nfn f_to_c (f)\n  / (- f FREEZING) RATIO;\n\n100 | c_to_f  ;; → 212\n```\n\n### Multi-Source Transformation\n\n```lisp\n;; Combine multiple inputs\njoin $0 \" \" $1 | trim\n;; Input: [\"John\", \"Doe\"] → Output: \"John Doe\"\n```\n\n### Complex Data Processing\n\n```lisp\n;; Email cleaning with plus addressing removal\nlet EMAIL_REGEX /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\n\nfn normalize (email)\n  lower email | trim;\n\nfn remove_plus (email)\n  replace email /\\+.*@/ \"@\";\n\nfn process_email (email)\n  normalize email | remove_plus;\n\nprocess_email \"User+spam@Example.COM\"  ;; → \"user@example.com\"\n```\n\nTo see more examples and the full specification, check out the [PEX Spec](PEX_SPEC.md).\n\n## Development\n\nThis project uses [Mise](https://github.com/jdx/mise) to run scripts and manage dependencies.\n\nIf you don't already have mise installed, you can install it using the following command:\n\n```bash\ncurl https://mise.run | sh\n```\n\nOnce mise is installed, you can run the following command to setup the project:\n\n```bash\nmise install\n```\n\n### Monorepo Structure\n\nThis project is organized as a monorepo with multiple packages:\n\n- **`packages/tree-sitter-pex/`** - Tree-sitter grammar for PEX language\n  - Provides syntax highlighting and parsing for editors\n  - See [packages/tree-sitter-pex/README.md](packages/tree-sitter-pex/README.md)\n\n### Running Tasks\n\nThe project uses mise with monorepo support. You can run tasks using the `//` syntax:\n\n```bash\n# Run all tests across all packages\nmise run '//...:test'\n\n# Run tree-sitter grammar tests\nmise run //packages/tree-sitter-pex:test\n\n# Generate tree-sitter parser\nmise run //packages/tree-sitter-pex:generate\n\n# See all available tasks\nmise tasks\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjust-be-dev%2Fpex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjust-be-dev%2Fpex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjust-be-dev%2Fpex/lists"}