{"id":16336888,"url":"https://github.com/angerman/data-bitstream","last_synced_at":"2026-01-25T14:04:50.859Z","repository":{"id":79904393,"uuid":"101775151","full_name":"angerman/data-bitstream","owner":"angerman","description":"data-bitcode rev2","archived":false,"fork":false,"pushed_at":"2017-09-05T15:01:53.000Z","size":273,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-16T15:50:24.322Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","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/angerman.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog.md","contributing":null,"funding":null,"license":"LICENSE","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-08-29T15:12:25.000Z","updated_at":"2017-08-30T09:40:18.000Z","dependencies_parsed_at":"2023-09-17T02:23:58.534Z","dependency_job_id":null,"html_url":"https://github.com/angerman/data-bitstream","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/angerman/data-bitstream","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angerman%2Fdata-bitstream","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angerman%2Fdata-bitstream/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angerman%2Fdata-bitstream/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angerman%2Fdata-bitstream/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/angerman","download_url":"https://codeload.github.com/angerman/data-bitstream/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angerman%2Fdata-bitstream/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28754129,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-25T13:59:49.818Z","status":"ssl_error","status_checked_at":"2026-01-25T13:59:33.728Z","response_time":113,"last_error":"SSL_read: 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":[],"created_at":"2024-10-10T23:45:14.766Z","updated_at":"2026-01-25T14:04:50.827Z","avatar_url":"https://github.com/angerman.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Data.Bitstream\n\n*This is an alternative implementation to the `[Bool]` heavy solution in\n[Data.BitCode](https://github.com/angerman/data-bitcode).*\n\n`Data.Bitstream` is a LLVM bitcode serializer. The module takes bitcode\nrecords and turns them into the bitcode bitstream, which is then written\nto disk as bytes.\n\n## Bitcode\n\nLLVM Bitcode is a series of bits emitted into a stream. This does not \nneed to align with bytes. Notably bytes on disk usually store their least\nsignificant bit last, while it would come first in bitcode. Example:\n\n| byte           | `de`       | `c0`      | `17`       | `0b`       |\n| bits on disk   | `11011110` | `1100000` | `00010111` | `00001011` |\n| bits in stream | `01111011` | `0000011` | `11101000` | `00001011` |\n\nHowever flipping the bytes in the `ByteString` prior to writing to disk\nseems rather cheap (~16M/s) (see `bench.html`).\n\n## Building \n\nWith [Data.BitCode](https://github.com/angerman/data-bitcode) and\n[Data.BitCode.LLVM](https://gihtub.com/angerman/data-bitcode-llvm), checked\nout in the same directory as\n[Data.Bistream](https://github.com/angerman/data-bitstream), this module should\nbe buildable with `cabal new-build` (see also the `cabal.project` file).\n\n## Testing\n\n`cabal new-test` should run a series of tests, trying to produce bitcode and\nensure some basic validity of the `Bitstream`.\n\n## Benchmarking\n\n`cabal new-bench` should try to do some rather expensive, yet common bit\nconcatinations on `Bitstream` and the underlying `Stream` data types. The\nbenchmark has two parts. One is a synthetic which tries some simple \nconcatination. And the other one is a real world benchmark which attempts\nto build the object file for `main = putStrLn 'Hello World'` by taking the\nserialized bitcode records for said program and runs them through the\nserializer.\n\n## Profiling\n\nThe module also contains the `test` executable. Which takes a serialized\nbitcode record file as input and runs the `Bitstream` serializer over it.\n`cabal new-build --enable-profiling` should produce the profiled binary.\n\n```\n$(find dist-newstyle -name \"test\" -type f) bench/data/Main.bcbin +RTS -P\n```\n\nshould produce the `test.prof` profile.\n\n*I like [viewprof](https://hackage.haskell.org/package/viewprof) a lot for\nviewing haskell profiles*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fangerman%2Fdata-bitstream","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fangerman%2Fdata-bitstream","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fangerman%2Fdata-bitstream/lists"}