frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Show HN: simple_ans – Asymmetric Numeral Systems Compression in Python/C++

https://github.com/flatironinstitute/simple_ans
2•jmagland•1h ago
The Asymmetric Numeral Systems (ANS) algorithm (Duda et al, 2015) is perhaps the most practical way of getting near optimal compression ratios for independent and identically distributed random sequences of symbols from a known discrete probability distribution. Simplest example: a random sequence of 0’s and 1’s with probability p of getting a 1. Shannon’s entropy formula gives us the expected compression ratio for such a sequence, but realizing that compression ratio efficiently in a computer program is not such an easy task. ANS does the trick and is incorporated into several general purpose compression algorithms, but I wasn’t able to track down a simple, self-contained implementation that was reasonably performant.

So I made simple_ans, a straightforward Python package that uses a small, yet efficient, kernel of C++ code (few hundred lines of code).

If you want it even simpler, there’s also a pure Python implementation in the repo (much slower though).

I hope you find it interesting and/or useful!

Comments

jmagland•1h ago
Oh, you may also be interested in this fun

ANS Visualizer

https://visposts.github.io/ans-visualizer/

Probabilistic engineering and the 24-7 employee

https://www.timdavis.com/blog/probabilistic-engineering-and-the-24-7-employee
1•vinhnx•55s ago•0 comments

Show HN: Dark Mode for Hacker News

https://hckrnight.com/
1•omer_k•1m ago•0 comments

Show HN: Glassroom – See what's happening in your kid's Google Classroom

https://glassroom.sageframe.net
1•sageframe•2m ago•0 comments

Show HN: AI Hat Arena – real-time voice charades with AI

https://ai-hat-game.vercel.app/
1•imbd•4m ago•0 comments

The Watch Expert Catching Multimillion-Dollar Counterfeits

https://www.gq.com/story/box-and-papers-jose-perez-perezscope-interview
1•Geekette•4m ago•0 comments

NASA Force

https://nasaforce.gov/
1•LorenDB•6m ago•0 comments

Middle East Energy Infrastructure Damage Close to $60B

https://oilprice.com/Energy/Energy-General/Middle-East-Energy-Infrastructure-Damage-Close-to-60-B...
1•speckx•6m ago•0 comments

Google Chrome lacks protection against browser fingerprinting

https://www.theregister.com/2026/04/16/google_chrome_lacks_browser_fingerprinting/
2•fsflover•6m ago•0 comments

Is Claude Mythos "Terrifying"? (According to Experts: No.) [video]

https://www.youtube.com/watch?v=k-8stQCeQiE
1•cassianoleal•9m ago•0 comments

Iran's Internet Blackout: Peering into the Worst Internet Shutdown

https://www.kentik.com/blog/irans-internet-blackout-peering-into-the-worlds-worst-internet-shutdown/
2•oavioklein•10m ago•0 comments

Show HN: I turned my MacBook notch into a live Claude Code dashboard

https://github.com/devmegablaster/Notch-Pilot
1•devmegablaster•10m ago•0 comments

Draft-Meow-Mrrp-00

https://datatracker.ietf.org/doc/draft-meow-mrrp/
1•layer8•10m ago•0 comments

Snap to Cut 16% of Workforce as It Seeks Profitability

https://www.wsj.com/business/snap-to-cut-16-of-workforce-as-it-seeks-profitability-4030b891
1•bookofjoe•10m ago•1 comments

Show HN: Preseason – see which developer tools each LLM picks

https://www.preseason.ai
1•betocmn•11m ago•0 comments

Royal Mail Lost Parcel Compensation Claim Automation: Xero and Linnworks

https://saas-glue.com/case-studies/royal-mail-lost-parcel-compensation-claim-automation-xero-linn...
1•jawb•11m ago•1 comments

Apollo 13: An Accident in Space (1972)

https://www.newyorker.com/magazine/1972/11/11/apollo-13-an-accident-in-space
1•canjobear•11m ago•0 comments

Oldest Reptile Mummy Sheds Light on the Ancient Art of Breathing

https://nautil.us/oldest-reptile-mummy-sheds-light-on-the-ancient-art-of-breathing-1279942
1•Brajeshwar•12m ago•0 comments

I am DONE with applying to Indeed or LinkedIn

https://github.com/Masterjx9/OpenPostings
1•PythonicIT•14m ago•1 comments

(U)CONPLAN 8888 [pdf]

https://www.stratcom.mil/Portals/8/Documents/FOIA/CONPLAN_8888-11.pdf
1•jmward01•16m ago•0 comments

High intelligence not associated with more mental health disorders

https://www.cambridge.org/core/journals/european-psychiatry/article/high-intelligence-is-not-asso...
1•gmays•16m ago•1 comments

NIST cuts down CVE analysis amid vulnerability overload

https://www.csoonline.com/article/4159882/nist-cuts-down-cve-analysis-amid-vulnerability-overload...
1•WaitWaitWha•17m ago•0 comments

Our Tax System Should Make You Furious

https://www.nytimes.com/2026/04/17/opinion/ezra-klein-podcast-ray-madoff.html
2•keernan•20m ago•1 comments

Claude Opus 4.7 Dropped and My Trust Got a Little Smaller

https://www.bhusalmanish.com.np/blog/posts/opus-4-7-developer-fatigue.html
2•okchildhood•20m ago•0 comments

When AI agents show up to class

https://moodle.com/news/field-notes-when-ai-agents-show-up-to-class/
1•the-mitr•21m ago•0 comments

Suspects used smart glasses, other AI tools to commit 'organized' retail fraud

https://www.ctvnews.ca/toronto/article/suspects-used-smart-glasses-other-ai-tools-to-commit-organ...
1•KLK2019•21m ago•1 comments

Norway Launches First Driverless Bus in Regular Traffic

https://www.nrk.no/rogaland/historisk_-kolumbus-kjorer-uten-sjafor-pa-bussen-i-stavanger-1.17841909
1•chaosprint•23m ago•0 comments

Claude Opus 4.7 costs 20–30% more per session

https://www.claudecodecamp.com/p/i-measured-claude-4-7-s-new-tokenizer-here-s-what-it-costs-you
2•aray07•24m ago•1 comments

Average new UK electric car price is now lower than petrol vehicles

https://www.theguardian.com/environment/2026/apr/17/new-uk-electric-car-price-petrol-ev-autotrader
6•MBCook•26m ago•2 comments

From Vivaldi to Van Halen, classical and heavy metal are a natural pairing

https://www.theguardian.com/music/2026/apr/15/from-strads-to-shreds-and-vivaldi-to-van-halen-clas...
2•robtherobber•27m ago•0 comments

Show HN: Amendments to the PayPal Cryptocurrency Terms and Conditions

https://www.paypal.com/us/legalhub/paypal/upcoming-policies-full
1•ppolicyco•27m ago•0 comments