Hacker News new | past | comments | ask | show | jobs | submit login
Frink (futureboy.us)
114 points by Tomte on April 1, 2021 | hide | past | favorite | 7 comments



The units.txt file[0] for Frink is also a really good read. It has lots of useful editorializing about how different units were defined, and how some units were poorly or ambiguously defined.

[0] https://frinklang.org/frinkdata/units.txt


I've had to implement unit math recently for CalcuLaTeX [0] and it's given me a lot of appreciation for how difficult it actually is. I've got it almost completely working with SI units but I haven't thought through fractional unit powers yet.

I really should've based it on something like GNU units.

[0] https://github.com/mkhan45/CalcuLaTeX


If curious, past threads:

The Frink Is Good, the Unit Is Evil - https://news.ycombinator.com/item?id=23799831 - July 2020 (41 comments)

Frink Programming Language - https://news.ycombinator.com/item?id=22523362 - March 2020 (7 comments)

Frink - https://news.ycombinator.com/item?id=21669195 - Nov 2019 (16 comments)

Frink data file for non-changing units (2016) - https://news.ycombinator.com/item?id=20322262 - July 2019 (2 comments)

Frink - https://news.ycombinator.com/item?id=17745726 - Aug 2018 (62 comments)

Frink – A practical calculating tool and programming language - https://news.ycombinator.com/item?id=12825366 - Oct 2016 (24 comments)

The Frink programming language - https://news.ycombinator.com/item?id=8893319 - Jan 2015 (11 comments)

Fart joke myth busted using Frink - https://news.ycombinator.com/item?id=1543428 - July 2010 (22 comments)

The Frink programming language - https://news.ycombinator.com/item?id=1541452 - July 2010 (10 comments)

Frink: a JVM language for doing unusual but precise conversions - https://news.ycombinator.com/item?id=292985 - Sept 2008 (1 comment)

Others?


I’m glad I read it through to this gem:

https://futureboy.us/frinkdocs/#FartJokes


That almost works verbatim in GNU units (TNT must be made lowercase, and natural_gas’ underscore must be removed, not including “Advanced Farting” which IIUC would require editing a definition file): http://ix.io/2UMx

So for basic conversions like that, Fink isn’t worth reaching outside of my package manager (and I don’t want to use a web interface, I want a light, portable CLI tool). What I do find interesting is the date/time math (https://futureboy.us/frinkdocs/#DateTimeHandling, that and maybe the text translation https://futureboy.us/frinkdocs/#TextTranslation). I can use GNU date for some basic stuff, eg.…

  # 2001-08-12 04:00 UTC #
can become

  date -d'2001-08-12 04:00 UTC'
…but IIUC date is too dumb to take something like `# 6:00 PM Bosnia #` and assume today, or do math like `#2002-12-25# - now[] -> days`. I’ve previously ended up resorting to fairly ugly shell like `units -t $(( $(date +%s) - $(date -d '2002-12-25' +%s) ))seconds days`. I feel like I’m missing some useful units or date feature … or maybe I should use qalculate or python or something? (IDK, I need to sleep now, sorry if this sleepy comment is dumb)


It's really great to see how active the maintainer has stayed over the last 20 years -

https://futureboy.us/frinkdocs/whatsnew.html


Nice I'll be able to use for better coverage at natural language understanding!




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: