[HN Gopher] Show HN: NoteCalc ___________________________________________________________________ Show HN: NoteCalc Author : bbodi Score : 174 points Date : 2020-12-21 14:50 UTC (8 hours ago) (HTM) web link (github.com) (TXT) w3m dump (github.com) | sanity31415 wrote: | Very nice, reminds me of "literate programming": | https://en.wikipedia.org/wiki/Literate_programming | | In a similar vein - a few years ago I built an open source REPL | calculator called LastCalc (http://lastcalc.org/), which supports | some advanced ideas from functional programming including pattern | matching. | jarym wrote: | This is soooo nice. I wish there was a +10 option on HN - it'd be | the first time I'd use it! | mattweinberg wrote: | This looks great! The README says: | | > Honestly, it just tries to be a free Soulver alternative in | your browser. | | For people on macOS, Soulver is excellent and worth checking out: | https://soulver.app . I almost always have a Soulver window open | on my screen. | 32bitkid wrote: | Just wanted to also drop a recommendation for soulver, but I | have been split between it and Calca (http://calca.io/) which I | think is _also_ worth checking out, if you like this kind of | hybrid notes/calculator like interface. | | The ultimate interface _for me_ would be somewhere in between | Calca (which I think has superior support for | functions/graphing/logical calculations) and Soulver (which I | think has better usability/readability) and a graph-based note- | taking system like Obsidian/Zettlr. I'm sure somebody will say | "there is a Vim plugin that'll do that" but... yea. | frereubu wrote: | Calca does look like a really nice mix of note-taking and | calculations. The screenshots made me realise I was missing | variables in Soulver... until I looked at the Soulver docs | and realised that it _does_ have variables, I just hadn 't | thought to look. Thanks for the prompt! | tesseract wrote: | Love Soulver and Calca looks great too, thanks for pointing | that out! Personally I would love a tool like one of those | but with built in unit handling/dimensional analysis | capabilities equal or better to the Google search bar... | chrisofspades wrote: | This is pretty cool. Reminds me of https://instacalc.com/ | waynesonfire wrote: | wow, love it. | wongarsu wrote: | Link to the public instance: | https://bbodi.github.io/notecalc3/notecalc | | It took me a couple clicks to find, a link in the readme would be | useful. | | It's an awesome tool, I think I will use this a lot. It cover 95% | of my WolframAlpha use, with an interface that's both more | responsive and let's me keep track of context and streams of | thought. | dvtrn wrote: | _a link in the readme would be useful._ | | It's there, already. The direct link in the OP are to the | release notes | | https://github.com/bbodi/notecalc3/blob/develop/README.md | chaoxu wrote: | This is pretty good soulver replacement. | | I found all these similar tools has the problem that there is | _exactly one expression per line_. | | Is there any exploration of this feature: have the computed | number shown next to the expression. | | I had this problem while using soulver, too. I had a lot of | artificial line breaks. For calculations it is pretty good, but | it is pretty horrible when I present it to someone else. | skulk wrote: | Something like this exists for emacs as well: | https://github.com/sulami/literate-calc-mode.el | chedine wrote: | This is great. I have always wanted to build this for myself ever | since i read Bret Victor. Good work | FpUser wrote: | Very nice app, I really liked it | xixixao wrote: | You should link the website instead: | | https://bbodi.github.io/notecalc3/ | | Awesome work! | ChrisMarshallNY wrote: | That's really nice! | | Looks like a labor of love. | | Thanks for sharing it! | himujjal wrote: | Great work. | | Is there a Terminal UI for this? Many users love to have simple | programs in the Terminal itself. | bbodi wrote: | Hi, Not yet, it is on my list, but unfortunately with a low | priority. | | But fortunately, the whole architecture was designed with the | terminal in mind: - 99% of the functionalty is implemented as a | lib, and just a tiny part is responsible for input and | rendering, so it is very easy to write new frontend for it. - | both the rendering and the input uses characters as a basic for | coordinates, so it is easy to translate the render commands | generated by the lib to the terminal. | leejoramo wrote: | A version to use within VSCode would be very useful too. | SamBam wrote: | I was just thinking, turning this into a VSCode plugin would | be awesome. Would save me from opening up the browser console | every time I wanted to do some simple math. | monkeydust wrote: | Very nice. I end up using google search more frequently for | simple calcs and have been wanting something to take that to | another level but not as far as a full blown Juypter notebook. | | This could fit that sweetspot for me and others I imagine. | w0m wrote: | I usually use Alfred's build in Calc for simple stuff; and | ipython when i want _more_ (or reproducibility to play with | numbers better) | krick wrote: | Nice. What I really want, though is a CLI calculator (something | like bc or ipython) that would be clever enough to handle stuff | like 1000!/999! (increase the number of digits if python will be | able to do that: I hope you get the idea). I cannot treat | seriously a calculator in 2020 that actually tries to evaluate | expressions numerically, while representing numbers as floats or | int32. | | Multiplying matrices and stuff is nice, but I don't think I | really ever needed that. But simple combinatorics and other | calculations that involve large numbers and lots of simple | operations (like powers), but are perfectly calculatable without | losing precision on a piece of paper -- plenty of times. It's | annoying that I can calculate on a piece of paper something my | calculator cannot. | | Other than that, maybe some operations over physical units/unit | conversion and some embedded city/timezone DB, and I don't think | I can ask more of a calculator. | bbodi wrote: | Originally NoteCalc used a library for handling arbitrarily | large numbers. Unfortunately, some operations were so slow that | as a quick fix, I replaced the library with a lighter one | without dynamic allocations (which is 96 bit integer with | 28scale). | | This serves well the primary goal of NoteCalc so I did not | spend more time on it yet, but I am on the same page as you, | and if NoteCalc will be feature-complete, I will give an other | shot to arbitrarily large calculations/precision. | muizelaar wrote: | Have you tried isympy? It handles your factorial expression | easily. | minxomat wrote: | Alternative for linux (especially great on eOS): NaSC | (https://parnold-x.github.io/nasc/) | [deleted] | Epskampie wrote: | Some feedback: it fills my browser history with a lot of entries. | bbodi wrote: | Thanks, you are right, I did not notice but yes it could be | annoying. | | The reason is that the content of the note is stored in the URL | so it is easy to share it by sending the url to friends. So the | URL changes basically on every modification. | | I add it to the fixlist. | wccrawford wrote: | If you aren't interested in the history, perhaps you should | be replacing the state instead of adding to it? Without | looking at the code, it seems like an easy fix. | bbodi wrote: | Yes this will be, thanks :) | triangleman wrote: | Wow, so this is rust compiled to JS? Or I guess WASM which is a | subset of JS? Is this the future of the web? | | Also I noticed the base64/deflate URL fragment storing the entire | text content, a la flems.io ... nice! | simlevesque wrote: | Yeah it's Rust to WASM with JS for the startup. | smusamashah wrote: | This is amazing. Doesn't feel like a web based tool at all. Can | even do bitwise operations that's just great. Can there be a | programmer mode where I can use & and | instead of AND and OR? | Not a deal breaker though. It's going to help a lot in day to day | bitwise stuff | bbodi wrote: | yeah why not :) I added it to my todo. | gregoriol wrote: | On macOS, there is the excellent Numi app | | Sadly I haven't found any equivalent for iOS (iPhone and iPad): | it would definitely get my money! | filleokus wrote: | Numi would be my favourite of all these kind of calculators on | macOS, if it wasn't for the lack of unit calculations[0], e.g | density = 2 kg / 3 l, mass = 10 dm^3 * density | | [0]: Not sure of the actual term in English | asimpletune wrote: | I think the term in English is dimensional analysis | adrianmsmith wrote: | For those using note-taking apps, I've found that OneNote has a | similar very useful feature. If you type 1+2= into a note and | then press the space bar, it'll insert the answer. It can | understand thousand separators and large expressions with | brackets etc. | BOOSTERHIDROGEN wrote: | is there a docker image ? | niklearnstodev wrote: | Exciting to see an open source Rust WASM project as reference for | us folks who are interested in playing around with it. Thanks for | the cool work! | djbeadle wrote: | This is very cool! The project description says that it is | inspired by Soulver [1]. | | A similar (but different) application for iOS is Tydlig [2] which | can also generate some simple x-y plots. | | [1] https://soulver.app | | [2] http://tydligapp.com/ | gen_greyface wrote: | This really looks great.. props to you. | | just a nitpick.. changing the theme resizes the panels | automatically to adjust to the first panel's width | SamBam wrote: | Very cool, though I find there's a lack of discoverability as to | what I can do with it, and no help is provided if there's an | error. pi() => 3.14... sin(3.14 rad) => | 0.00.. sin(pi() rad) => err | | No idea why there's that error. | bbodi wrote: | Thanks for noticing it! | | Unfortunately it seems units cannot be applied to function | results. It must be fixed, I noted down, thanks! | bitexploder wrote: | This is really cool. I am always in Org mode which lets you do | "literate" programming as well. I think NoteCalc is a little more | streamlined, but I am very used to throwing a little Python or | elisp into my notes when I need to do math. Great to see more | options on this front. Org-babel is a nice package, though it | does have some limitations. | b3n wrote: | Any reason you don't use calc-mode to insert mathematical | results into your Org buffer? Calc-mode is extremely powerful. | lxe wrote: | Wow I didn't even notice this wasn't HTML until I tried pasting | stuff... | bbodi wrote: | I take it as a huge compliment :) | | Pasting should work with simple texts, what was the issue? | Don't hesitate to open an Issue in GitHub if something does not | work. https://github.com/bbodi/notecalc3/issues | enos_feedler wrote: | I wish this was built into the iOS notes app. So many notes are | just number calculations like this. | gorkish wrote: | Love this, but the lack of interpretation of prefixed currency | symbols is absolutely maddening! That it simply ignores the | number and operand with no indication that these elements are | ignored could easily lead to problems. I don't think I could in | good conscience trust myself or those I might consider to be the | target audience of this app to notice parsing errors in every | case. Consider: | | "$400 / 20" => 20 (ERROR) | | "$400 / 25" => 25 (ERROR) | | "400$ / 20" => 20 $ (OK) | | "400$ / 25" => 16 $ (OK) | vageli wrote: | Your comment made me realize that most unit notation I'm | familiar with has the unit as a suffix, with currency being the | only standout that comes to mind. | [deleted] | gorkish wrote: | Binary, ocatal and hexidecimal literals often are indicated | with prefixes: 0b, 0 and 0x respectively. There are probably | other esoteric cases that I can't think of off the top of my | head. "Qty" is often prefixed, for instance. It's a | complicated problem for a natural language calculator, to be | sure. Here are a couple examples of ways to represent four | thousand Canadian dollars that you might encounter and have | no trouble interpreting as a human. This could be a good | target for an ML tokenizer... | | -$4000CAD | | CA$-4,000.00 | | 4.000,00CAD$ | roywiggins wrote: | It depends on the currency / country, too. Lots of countries | put the currency afterwards, even "C/" comes after. $ and PS | come before, but EUR ends up moving depending on the | language. | | https://en.wikipedia.org/wiki/Language_and_the_euro#Written_. | .. | jannes wrote: | It would also be nice to support other currency symbols. In | Europe there are EUR and PS, for example. | | https://en.wikipedia.org/wiki/List_of_currencies_in_Europe | bbodi wrote: | In your case syntax highlighting helps. Everything which is not | part of a calculation is rendered as a simple text (greyish): | [image](https://trello- | attachments.s3.amazonaws.com/558a94779b3b3c5d...) | | But yes I admit it takes some time to get used to the colors | and their meanings. | | Currencies and exchange between them are on my feature list | btw. | gorkish wrote: | Awesome; this is great to hear. | | An idea you might consider is to display some kind of warning | symbol or message if the input contains digits or operands | which are not interpreted as part of the calculation that | produces the output. This would have made the semantic | meaning of the syntax highlighting immediately more evident. | codeful wrote: | notepad + calculator is a really great combination. i'm using | this time to time: | | http://notepadcalculator.com/ | nsajko wrote: | I'm not quite sure what's the purpose of either NoteCalc or | Soulver, but I am currently getting acquainted with TeX - and | from that perspective NoteCalc seems comically under-powered | compared to what's achievable through plugging into the | Lua(Meta)TeX engine with Lua, or with the Lua C API. | | I'm not criticizing NoteCalc, rather I think somebody should | create a lightweight note taking tool like that, I don't think it | would be very difficult by leveraging the already existing | TeX/ConTeXt/LMTX/LuaMetaTeX machinery, and it would blow the | Soulver-like stuff out of the water. The main design problem | could be deciding exactly where between ConTeXt and Soulver | should the new tool/language lie power-wise, i.e., how much | should it expose. | | I'm not proposing using TeX directly, rather I'm proposing basing | a new, simpler language on the Lua(Meta)TeX TeX engine, and | probably also on ConTeXt/LMTX. | bbodi wrote: | One of my primary design goal was something like that: "My | mother should be able to use this tool to calculate/plan her | vacation expenses". (My mother is older and not a tech guru you | can guess :)) So the primary focus are on simple calculations | with meaningful context and immediate feedback. Nothing fancy. | | Though, beside that, I think it provides some nice features. | E.g. the matrix creation/editing functionality was born because | I could not find a simple tool to double check my rendering | calculations with. | nsajko wrote: | Yeah, I guess NoteCalc will be useful to many people, it's | just that I'm noticing the sad lack of utilization of LuaTex | (probably because people don't know it exists and exposes the | power of TeX through Lua). | | The targets of NoteCalc vs. the tool I'm proposing would be | somewhat different, too, because LuaTex outputs primarily to | PDF, and I don't know if it can produce HTML. ___________________________________________________________________ (page generated 2020-12-21 23:00 UTC)