{"id":33338643,"url":"https://github.com/ilovapples/mml","last_synced_at":"2026-06-05T20:31:34.193Z","repository":{"id":324899779,"uuid":"1077761157","full_name":"ilovapples/mml","owner":"ilovapples","description":"Moved to Codeberg.","archived":false,"fork":false,"pushed_at":"2025-11-28T05:34:05.000Z","size":580,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-30T16:13:13.747Z","etag":null,"topics":["zig"],"latest_commit_sha":null,"homepage":"","language":"Zig","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/ilovapples.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":"2025-10-16T17:44:09.000Z","updated_at":"2025-11-28T05:35:09.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/ilovapples/mml","commit_stats":null,"previous_names":["ilovapples/mml"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ilovapples/mml","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ilovapples%2Fmml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ilovapples%2Fmml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ilovapples%2Fmml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ilovapples%2Fmml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ilovapples","download_url":"https://codeload.github.com/ilovapples/mml/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ilovapples%2Fmml/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33959537,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-05T02:00:06.157Z","response_time":120,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["zig"],"created_at":"2025-11-21T09:00:47.531Z","updated_at":"2026-06-05T20:31:34.174Z","avatar_url":"https://github.com/ilovapples.png","language":"Zig","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MML (Zig rewrite)\nOriginal repository with C implementation: [ilovapples/maths](https://github.com/ilovapples/maths) \u003cbr /\u003e\n\n## Description\nMML (My Math Language or Minimal Math Language, or something else) is a WIP mathematical scripting language. That is, it's a\ncalculator with more functionality in some areas, less in others (depending on the calculator). \u003cbr /\u003e\n\nA copy of the original README file is at the bottom, but a good bit may be outdated. \u003cbr /\u003e\n\n## Documentation\nThe documentation is [here](docs/README.md). \u003cbr /\u003e\n\n## Cross-platform?\nThe program (library + application) has been tested (and are functional) on M1 MacOS and on x86_64 Linux. Neither have been tested on Windows, but there\naren't any outstanding reasons they wouldn't work. Any tests, contributed in the [Issues](https://github.com/ilovapples/mml/issues) page, would be greatly\nappreciated.\n\n## Example\nThe project is built to be used as a library (the executable is actually just a sample usage of that library). Here's an example of a simple usage of the library:\n```zig\nconst std = @import(\"std\");\nconst mml = @import(\"mml\");\n\npub fn main() !void {\n    var gpa = std.heap.GeneralPurposeAllocator(.{}).init;\n    defer _ = gpa.deinit();\n    var arena = std.heap.ArenaAllocator.init(gpa.allocator());\n    defer arena.deinit();\n\n    var write_buffer: [512]u8 = undefined;\n    var file_writer = std.fs.File.stdout().writer(\u0026write_buffer);\n    const stdout = \u0026file_writer.interface;\n\n    var eval: mml.Evaluator = try .init(\u0026arena, null);\n    defer eval.deinit();\n\n    var config: mml.Config = .{ .writer = stdout };\n    eval.conf = \u0026config;\n    config.evaluator = \u0026eval;\n\n    const parsed = try mml.parse.parseExpr(\u0026arena, \"5 + 9cos{2.3}\");\n    const val = try eval.eval(parsed);\n    try val.printValue(config);\n\n    try stdout.flush();\n}\n```\n(this code is replicated in [tests/example-use-1.zig](tests/example-use-1.zig)) \u003cbr /\u003e\nYou could compile this like any other library with `build.zig`.\n\n\n## Copy of the original README\n\nit's a thing I guess\nAlso, this program has been tested on x86_64-linux and aarch64-macos. The prompt (REPL) definitely won't work on Windows, and the rest of the program hasn't been tested (and I can't be bothered to check for anything POSIX-specific).\n\n# documentation\nNot much, but there is a syntax guide [here](docs/README.md) if you want to read it.\n\n# building\n```sh\ngit submodule update --init # first time\nmake\n```\nThen run `build/mml --help` to display the command-line options.\n## NEW!\nIf you have `zig` installed, you can use `zig build` to build the library and executable. Here are the commands:\n```sh\ngit submodule update --init # first time\nzig build\n```\nYou can run `zig build -Doptimize=ReleaseFast` to get more optimization. `zig build` also allows\neasy cross-compilation; [this](https://zig.guide/build-system/cross-compilation/) page has some more information (should still be up to date-ish).\nThis will automatically build the static library as well (every source file except `src/main.c` and `src/prompt.c`).\n\n# library documentation\nIt's not much of a library, but it is built to be easily extendable (hopefully that's true).\nA minimal example:\n```c\n#include \u003cstdint.h\u003e\n\n#include \"mml/mml.h\"\n\nint32_t main(void)\n{\n\tMML_state *state = MML_init_state();\n\n\tconst char *s = \"cos{1.5pi} == 0.0\";\n\tMML_Value ret = MML_eval_parse(state, s);\n\tMML_println_typedval(state, \u0026ret);\n\n\tMML_cleanup_state(state);\n\n\treturn 0;\n}\n```\n\nAnd it can be compiled with this command (assuming you've run `make shared_lib` or `make static_lib`, are currently in the root directory, and named the example file `test.c`):\n```sh\ngcc -o test test.c -Iincl -Lbuild -lmml -lm\n```\nThe shared object file is a bit finnicky, so if you link with the shared library, you'll probably have to do this (the above should work on OS X, though):\n```sh\ngcc -o test test.c -Iincl build/libmml.so\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filovapples%2Fmml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Filovapples%2Fmml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filovapples%2Fmml/lists"}