{"id":21866901,"url":"https://github.com/rootmos/ppx_useless","last_synced_at":"2025-06-27T16:35:41.453Z","repository":{"id":82434105,"uuid":"93252539","full_name":"rootmos/ppx_useless","owner":"rootmos","description":"A useless ppx extension","archived":false,"fork":false,"pushed_at":"2017-06-06T06:18:55.000Z","size":7,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-21T21:28:40.415Z","etag":null,"topics":["joke","ocaml","ppx"],"latest_commit_sha":null,"homepage":"","language":"OCaml","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/rootmos.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}},"created_at":"2017-06-03T14:15:40.000Z","updated_at":"2018-10-26T13:15:44.000Z","dependencies_parsed_at":"2023-06-15T16:15:35.151Z","dependency_job_id":null,"html_url":"https://github.com/rootmos/ppx_useless","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rootmos/ppx_useless","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootmos%2Fppx_useless","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootmos%2Fppx_useless/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootmos%2Fppx_useless/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootmos%2Fppx_useless/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rootmos","download_url":"https://codeload.github.com/rootmos/ppx_useless/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootmos%2Fppx_useless/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262294081,"owners_count":23288878,"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":["joke","ocaml","ppx"],"created_at":"2024-11-28T05:07:53.378Z","updated_at":"2025-06-27T16:35:41.445Z","avatar_url":"https://github.com/rootmos.png","language":"OCaml","funding_links":[],"categories":[],"sub_categories":[],"readme":"ppx_useless\n===========\n**Disclaimer** This project is a joke and should be taken seriously only by people without humor.\n\nThis project provides the `ppx_useless` [OCaml](https://ocaml.org/) compiler extension, that\nreplaces the code with the following statement:\n```ocaml\nlet () = ()\n```\nNow this might seem controversial to the casual, but there are benefits to be had.\n\nUseless features:\n* Reduces compile errors\n* Reduces runtime errors\n* Reduces binary size\n* Simplifies debugging\n* Increases speed\n* Decreases memory usage (both at compile-time and run-time)\n\nUseful features:\n* Wastes CPU cycles, which in turn heats your room\n* There's at least a possibility that the program produces the\n  desired output, which means that any input would suffice as\n  a solution, which in turn saves time for the programmer.\n\nHowever, some programs are not expected to terminate (e.g. server programs)\nand for those kinds of programs the `ppx_diverge` is provided that replaces\nevery expression with:\n```ocaml\nlet rec diverge () = diverge () in diverge ()\n```\nwhich provides the desired non-termination.\nAn added benefit here is that there's no longer any need for messing about\nwith configuration files!\n\nHere the observant reader interjects: \"But even a trivial but deterministic program can be useful (e.g. `/bin/true`)!\"\nTrue, `true` is a very useful program and to address that the `ppx_nondeterministic` extension is provided.\nHere's a sample session from `utop`:\n```\n\u003e 2+2;;\n- : int = 4\n\n\u003e 2+2;;\n- : int = 3\n\n\u003e 2+2;;\n- : int = 5\n```\nObserve here that there is a possibility of obtaining the expected result.\nAnd be honest, who doesn't what more [non-determinism](https://en.wikipedia.org/wiki/Heisenbug) in their lives?\n\nUsage\n-----\nThe provided `Makefile` contains instructions on how to build the\ndifferent useless extensions, but the impatient can invoke [utop](https://github.com/diml/utop)\nlike so:\n* for useless programs: `make useless-utop`\n* for non-terminating programs: `make diverge-utop`\n* for non-deterministic programs: `make nondeterministic-utop`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frootmos%2Fppx_useless","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frootmos%2Fppx_useless","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frootmos%2Fppx_useless/lists"}