frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Show HN: val – An arbitrary precision calculator language

https://github.com/terror/val
34•crap•1y ago
Wrote this to learn more about the `chumsky` parser combinator library, rustyline, and the `ariadne` error reporting crate.

Such a nice DX combo for writing new languages.

Still a work in progress, but I thought I'd share :)

Comments

jasonjmcghee•1y ago
Hey nice! We have similar interests. I built something similar, but with way less calculator functionality than you did :D

But the main idea I was going for was real-time JIT evaluation with rendered errors (specifically learning / using cranelift JIT) - less to do with the calculator aspect.

I ended up choosing miette for errors.

https://github.com/jasonjmcghee/basic-treesitter-cranelift-j...

occamatl•1y ago
> sqrt(10^100)-1 -> 100000000000000000000000000000000000000000000000000

Not what I expected.

emaro•1y ago
In the readme it says it uses double precision for numbers. Also not quite whet I expected from 'arbitrary precision'.
chriswarbo•1y ago
Hmm, yeah. It cites `bc` as prior art, which is quite widely used; but another interesting arbitrary-precision calculator is spigot https://www.chiark.greenend.org.uk/~sgtatham/spigot/spigot.h...
mananaysiempre•1y ago
Also the AOSP calculator, of course[1,2,3].

[1] https://chadnauseam.com/coding/random/calculator-app

[2] https://dl.acm.org/doi/10.1145/2911981

[3] https://dl.acm.org/doi/10.1145/3385412.3386037

emmelaich•1y ago
Ivy does big numbers (not arbitrary) but does rationals too. It's an APL subset.

    0.1 + 0.2
    3/10
https://github.com/robpike/ivy
lttlrck•1y ago
the addition of astro_float fixed this.
primitivesuave•1y ago
The UI is awesome, amazing work! However, arbitrary precision implies that there is no fixed upper limit to the number of digits - simple tests like `0.1 + 0.2 == 0.3` and `2^53 == 2^53 + 1` (both produce "false") indicates you're still using IEEE 754 double precision floats.

If "arbitrary precision" is not as important to you as "high precision", a 128 bit decimal has enough precision for 99% of real-world applications.

crap•1y ago
Thanks for checking it out! Should have been more clear that this is actively being worked on. This is ultimately the goal, and I'm currently working on integrating `astro_float` as the base for numbers.
primitivesuave•1y ago
That is awesome, I look forward to following the project and hopefully contributing! I became a better Rust programmer from reading your code :)
jdhwosnhw•1y ago
Do you mean, the first returns false and the second returns true?
primitivesuave•1y ago
Ah you're right, thank you for pointing it out!

In the previous version of this comment (where I was still reading it incorrectly) I added a fun fact, that the significand of an IEEE 754 double-precision float is only allocated 52 bits, but the "hidden bit trick" provides an extra bit of precision when the normalized form starts with 1.

johannesrexx•1y ago
Rewrite it like so

> 1/10 + 2/10 == 3/10 true >

I_complete_me•1y ago
I wish you well. And I clicked you a star on github. Keep up the good work.
crap•1y ago
Thanks to everyone who gave feedback!

Arbitrary precision is now supported in 0.3.0 after integrating the `astro_float` (https://docs.rs/astro-float/latest/astro_float/index.html) `BigFloat` type as the base for numbers in the language.

Still working out the kinks, but its live so give it a try!

lttlrck•1y ago
This is cool.

It love to have to base conversion functions, even if it's print only. Does that fit at all?

lttlrck•1y ago
and different input base notations, 0x, o, 0b etc
crap•1y ago
This definitely fits, base conversion is on the roadmap!
librasteve•1y ago
very cool, welcome to the small club of CLI calculator authors! before I read this I knew of frink and crag (https://raku.land/zef:librasteve/App::Crag since you ask)

Crag is built on raku so has some neat tricks up its sleeve - you can see Crag of the Day to see some in action...

  crag '0.1+0.2=0.2'   #True (arbitrary precision)
  crag '₃₆123.45'      #3F.G77777  (base 36)
  crag 'e ** (i * π) =~= -1'   #True  (math symbols, complex numbers)
  crag '0rMCMXLIV'     #1944 (Roman numerals)
  crag '^<௪௨ mph>'     #42mph  (Unicode and units)
hee hee

Show HN: GoModel – an open-source AI gateway in Go

https://github.com/ENTERPILOT/GOModel/
151•santiago-pl•8h ago•56 comments

Show HN: Backlit Keyboard API for Python

https://github.com/itsmeadarsh2008/backlit-kbd
6•itsmeadarsh•2d ago•1 comments

Show HN: VidStudio, a browser based video editor that doesn't upload your files

https://vidstudio.app/video-editor
227•kolx•10h ago•78 comments

Show HN: Mediator.ai – Using Nash bargaining and LLMs to systematize fairness

https://mediator.ai/
142•sanity•1d ago•73 comments

Show HN: Ctx – a /resume that works across Claude Code and Codex

https://github.com/dchu917/ctx
50•dchu17•1d ago•20 comments

Show HN: Daemons – we pivoted from building agents to cleaning up after them

https://charlielabs.ai/
44•rileyt•6h ago•27 comments

Show HN: Medievalizer, an extension that rewrites pages into Old English scripts

https://github.com/theletterf/medievalizer
4•theletterf•5h ago•3 comments

Show HN: WeTransfer Alternative for Developers

https://dlvr.sh/
18•mariusbolik•14h ago•6 comments

Show HN: Four years of my CS degree, typeset in LaTeX (850 pages)

https://starikov.co/academia-notes/
5•iusevim•6h ago•2 comments

Show HN: Verified Deep Learning with Lean 4

https://brettkoonce.github.io/lean4-mlir/blueprint/
5•asparagui•6h ago•0 comments

Show HN: Holos – QEMU/KVM with a compose-style YAML, GPUs and health checks

https://github.com/zeroecco/holos
52•zeroecco•1d ago•23 comments

Show HN: Runner – A Better Claude Cowork

https://runner.now
18•kentf•6h ago•13 comments

Show HN: Zero-allocation embedded security in Rust (fits in 256KB Flash)

https://github.com/craton-co/craton-shield
4•victor-craton•7h ago•0 comments

Show HN: Prompt-to-Excalidraw demo with Gemma 4 E2B in the browser (3.1GB)

https://teamchong.github.io/turboquant-wasm/draw.html
157•teamchong•2d ago•61 comments

Show HN: Flight Risk: Can you break an AI agent?

https://ctf.demo.lorikeetcx.ai/
3•tetrakai•9h ago•0 comments

Show HN: Run TRELLIS.2 Image-to-3D generation natively on Apple Silicon

https://github.com/shivampkumar/trellis-mac
198•shivampkumar•1d ago•35 comments

Show HN: Shader Lab, like Photoshop but for shaders

https://eng.basement.studio/tools/shader-lab
159•ragojose•5d ago•47 comments

Show HN: MDV – a Markdown superset for docs, dashboards, and slides with data

https://github.com/drasimwagan/mdv
148•drasim•3d ago•53 comments

Show HN: Git Push No-Mistakes

https://github.com/kunchenguid/no-mistakes
16•akane8•1d ago•6 comments

Show HN: Faceoff – A terminal UI for following NHL games

https://www.vincentgregoire.com/faceoff/
129•vcf•2d ago•44 comments

Show HN: A lightweight way to make agents talk without paying for API usage

https://juanpabloaj.com/2026/04/16/a-lightweight-way-to-make-agents-talk-without-paying-for-api-u...
55•juanpabloaj•1d ago•12 comments

Show HN: MCPfinder – An MCP server that finds and installs other MCP servers

https://mcpfinder.dev/
7•coderai•1d ago•0 comments

Show HN: DSS, a new human-readable and plain format for XLS and spreadsheets

https://github.com/Datastripes/DataSheetStandard/
5•vinserello•15h ago•0 comments

Show HN: Smol machines – subsecond coldstart, portable virtual machines

https://github.com/smol-machines/smolvm
493•binsquare•4d ago•147 comments

Show HN: Alien – Self-hosting with remote management (written in Rust)

105•alongub•1d ago•46 comments

Show HN: I Built SwiftUI but for macOS MDM

https://github.com/photon-hq/Astrolabe
9•RyanZhuuuu•1d ago•0 comments

Show HN: A fake small claims court for petty complaints

https://benlirio.com/petty-small-claims/
5•blirio•18h ago•4 comments

Show HN: I made a calculator that works over disjoint sets of intervals

https://victorpoughon.github.io/interval-calculator/
312•fouronnes3•3d ago•54 comments

Show HN: PanicLock – Close your MacBook lid disable TouchID –> password unlock

https://github.com/paniclock/paniclock/
261•seanieb•4d ago•114 comments

Show HN: I built an AI that assigns YOU tasks

https://www.pause.build/
3•chaidhat•19h ago•8 comments