{"id":21085850,"url":"https://github.com/zbeekman/zstdfortranlib","last_synced_at":"2026-01-02T02:27:12.634Z","repository":{"id":45439949,"uuid":"225755008","full_name":"zbeekman/ZstdFortranLib","owner":"zbeekman","description":"👨‍💻Zaak's 🧩(missing) 🏛Standard 🔬Fortran 📚Library 🚧(WIP)","archived":false,"fork":false,"pushed_at":"2022-12-08T03:15:41.000Z","size":402,"stargazers_count":18,"open_issues_count":15,"forks_count":0,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-01-21T00:19:46.499Z","etag":null,"topics":["convenience","fortran","fortran-library","fortran-modules","fortran2003","fortran2008","fortran2018","productivity","syntactic-sugar"],"latest_commit_sha":null,"homepage":"https://zstdfortranlib.readthedocs.io","language":"Fortran","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zbeekman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null}},"created_at":"2019-12-04T01:49:31.000Z","updated_at":"2024-05-11T19:59:09.000Z","dependencies_parsed_at":"2023-01-25T04:00:54.994Z","dependency_job_id":null,"html_url":"https://github.com/zbeekman/ZstdFortranLib","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zbeekman%2FZstdFortranLib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zbeekman%2FZstdFortranLib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zbeekman%2FZstdFortranLib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zbeekman%2FZstdFortranLib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zbeekman","download_url":"https://codeload.github.com/zbeekman/ZstdFortranLib/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243527334,"owners_count":20305200,"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":["convenience","fortran","fortran-library","fortran-modules","fortran2003","fortran2008","fortran2018","productivity","syntactic-sugar"],"created_at":"2024-11-19T20:36:52.859Z","updated_at":"2026-01-02T02:27:12.607Z","avatar_url":"https://github.com/zbeekman.png","language":"Fortran","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n# ZstdFortranLib: Zaak's (missing) Standard Fortran Library\n\n[![CI Status][GHA CI img]][GH Actions CI]\n[![Coverage status][Test Coverage img]][Code Coverage]\n[![Documentation Status][Docs img]][Documentation]\n[![GitHub license][license img]][license]\n[![Download as PDF][pdf img]][README.pdf]\n[![Tweet this button][twitter img]][default tweet]\n\n\u003c/div\u003e\n\nImplements missing functionality such as error handling, strings manipulation, system/environment interface \u0026\ntesting utilities.\n\n\u003cdetails\u003e\n\u003csummary\u003eTable of contents\u003c/summary\u003e\n\n\u003c!-- toc --\u003e\n\n- [:warning:Warning :warning:](#warningwarning-warning)\n- [Motivation](#motivation)\n- [Error Stack Object](#error-stack-object)\n  * [Features](#features)\n- [Unit Testing](#unit-testing)\n  * [Syntactic Sugar](#syntactic-sugar)\n  * [(Sub)Test Summarizing](#subtest-summarizing)\n- [Documentation](#documentation)\n- [Templating](#templating)\n\n\u003c!-- tocstop --\u003e\n\n\u003c/details\u003e\n\n## :warning:Warning :warning:\n\nThis is currently __pre-alpha__ software. Development is ongoing and the API is not yet stable.\nIt is possible that documented functionality is not yet implemented.\n\n## Motivation\n\nCertain tasks in Fortran can be awkward and there is no standard library.\nOne often ends up re-inventing the wheel to solve common tasks. Selected pain points include:\n\n- String manipulation\n- File operations \u0026 IO\n- Error handling\n- Assertions\n- Interfacing with the OS, file system \u0026 environment\n- Writing tests quickly and expressively\n\nFor string, file, and OS/system/environment interfacing other languages, in particular Ruby and Python\nprovide great expressiveness and built in functionality. These capabilities, as implemented in\n`ZstdFortraLib` are inspired by and aim to replicate the corresponding functionality in Ruby and Python,\nbut in an idiomatic Fortran way, and only the features \u0026 functions that make sense.\n\nAdditionally unit testing and assertions should be expressive, quick to write and implement, and\nsome assertions should be able to easily be turned off for production builds, or used to signal errors\nthat are handled later.\n\n## Error Stack Object\n\nBy providing an error stack object, either as a singleton module variable, or as a component of a derived type,\nthe programmer can maintain a call-stack, complete with line numbers and file names, and raise or signal\nexceptions deep in the call stack in pure or elemental procedures, but return control and handle any\nexceptions in less performance-critical, non-pure, higher-level program units.\n\n### Features\n\n- Dynamically sized error stack\n- Convenience macro for injecting line number and file-name into call-stack\n- Built in error types\n- Custom error messages\n- Pretty output to terminal, dynamically formatted\n- Raise fatal or deferred exceptions\n- Check if exceptions are signaling\n- Handle exceptions\n- Signal handler hooks\n- Introspective CMake build system, with exported targets\n\n## Unit Testing\n\n### Syntactic Sugar\n\nFloating point comparisons are common in scientific computing and Fortran. Special operators are provided to\nhand floating point comparisons for any `real` `kind`:\n\n``` fortran\nif ( ( (100 - 10*epsilon(1.0_RK)) .is. one_hundred ) .within. tolerance ) ...\n\n! Same as above, absolute is default\nif ( ( (100 - 10*epsilon(1.0_RK)) .is. one_hundred ) .within. .absolute. tolerance ) ...\n\n! R.H.S. value is taken to be truth\nif ( ( (100 - 10*epsilon(1.0_RK)) .is. one_hundred ) .within. .relative. rel_olerance ) ...\n```\n\nFurthermore, when a test fails, you want to know where/why:\n\n``` fortran\n    OUTPUT = gsub(qbf, CK_\"the\", CK_\"a\")\n    call assert_delayed ( \u0026\n      OUTPUT ==  CK_\"a quick red fox jumped over a lazy dog\", __LINE__ , \u0026\n      \"character(kind=CK) gsub 'the --\u003e a' substitution failed\")\n```\n\n### (Sub)Test Summarizing\n\nIf a failure occurs the output will look like:\n\n![Failed test](./docs/img/test-fail.png)\n\n## Documentation\n\nHigh level user documentation is published (from the [`docs`](./docs) directory) to\n[Read the Docs](https://zstdfortranlib/readthedocs.io) \u003chttps://zstdfortranlib/readthedocs.io\u003e.\n\nUser/client API documentation (protected \u0026 public scope) as well as project developer documentation\n(private scope \u0026 public/protected)will be generate via [FORD] and published\nvia GitHub pages to https://izaakbeekman.com/ZstdFortranLib (:warning: not yet operational :warning:)\n\n## Templating\n\nThis project uses templating and compile-time polymorphism (procedure overloading) for\nimproving the functionality of operators on intrinsic types. Templating functionality is\nprovided via the [Jin2For] tool, which adds functionality to the [Jinja2] templating enginep\nspecific to writing Fortran programs.\n\n__:warning:NEVER MANUALLY EDIT SOURCES IN THE [`generated`] DIRECTORY! :warning:__\n\n\n---\n\n\u003cdiv align=\"center\"\u003e\n\n[![GitHub forks](https://img.shields.io/github/forks/zbeekman/ZstdFortranLib.svg?style=social\u0026label=Fork)](https://github.com/zbeekman/ZstdFortranLib/fork)\n[![GitHub stars](https://img.shields.io/github/stars/zbeekman/ZstdFortranLib.svg?style=social\u0026label=Star)](https://github.com/zbeekman/ZstdFortranLib)\n[![GitHub watchers](https://img.shields.io/github/watchers/zbeekman/ZstdFortranLib.svg?style=social\u0026label=Watch)](https://github.com/zbeekman/ZstdFortranLib)\n[![Tweet this button][twitter img]][default tweet]\n\n\u003c/div\u003e\n\n[GHA CI img]: https://github.com/zbeekman/ZstdFortranLib/workflows/CI/badge.svg \"CI build status badge\"\n[GH Actions CI]: https://github.com/zbeekman/ZstdFortranLib/actions \"GH Actions CI\"\n[Test Coverage img]: https://codecov.io/gh/zbeekman/ZstdFortranLib/branch/master/graph/badge.svg \"Codecov badge\"\n[Code Coverage]: https://codecov.io/gh/zbeekman/ZstdFortranLib/branch/develop \"Code Coverage\"\n[Docs img]: https://readthedocs.org/projects/zstdfortranlib/badge/?version=latest \"RTD badge\"\n[Documentation]: https://zstdfortranlib.readthedocs.io/en/latest/?badge=latest \"High level documentation\"\n[license img]: https://img.shields.io/badge/license-MIT-blue.svg \"MIT License badge\"\n[license]: ./LICENSE \"ZstdFortranLib License (MIT)\"\n[pdf img]: https://img.shields.io/badge/PDF-README.md-6C2DC7.svg \"Download this readme as a PDF\"\n[README.pdf]: https://md2pdf.herokuapp.com/zbeekman/ZstdFortranLib/blob/master/README.pdf \"PDF of this README\"\n[twitter img]: https://img.shields.io/twitter/url/http/shields.io.svg?style=social\n[default tweet]: https://twitter.com/intent/tweet?hashtags=Fortran\u0026related=zbeekman,gnutools,DegenerateConic,jeffdotscience,realmilancurcic,ljdursi,sci_vision\u0026text=Checkout%20ZstdFortranLib,%20the%20missing%20Fortran%20Standard%20Library:%20Error,%20string,%20file%20and%20testing%20classes,%20syntactic%20sugar%20and%20more!\u0026url=https%3A//github.com/zbeekman/ZstdFortranLibrary\u0026via=zbeekman\n\n[FORD]: https://github.com/Fortran-FOSS-Programmers/ford\n[`generated`]: ./generated\n[Jin2For]: https://gitlab.com/fverdugo/jin2for\n[Jinja2]: https://jinja.palletsprojects.com/en/2.10.x/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzbeekman%2Fzstdfortranlib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzbeekman%2Fzstdfortranlib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzbeekman%2Fzstdfortranlib/lists"}