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.
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.
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.
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...
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!
A big plus for Calca is the mobile app and automatic syncing via iCloud on Apple devices.
Not sure if Soulver is newer or less “complete” than Calca, but it is being updated at lot more often. The updates for Calca are very sparse and leads me to think it’s more in a maintenance mode.
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.
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.
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.
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
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:
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.
It depends on the currency / country, too. Lots of countries put the currency afterwards, even "¢" comes after. $ and £ come before, but € ends up moving depending on the language.
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...
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.
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.
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.
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.
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.
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
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.
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.
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.
78 comments
[ 3.2 ms ] story [ 154 ms ] threadIs there a Terminal UI for this? Many users love to have simple programs in the Terminal itself.
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.
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/
https://numi.app/
> 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.
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.
Not sure if Soulver is newer or less “complete” than Calca, but it is being updated at lot more often. The updates for Calca are very sparse and leads me to think it’s more in a maintenance mode.
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.
It's there, already. The direct link in the OP are to the release notes
https://github.com/bbodi/notecalc3/blob/develop/README.md
https://bbodi.github.io/notecalc3/
Awesome work!
Looks like a labor of love.
Thanks for sharing it!
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.
Also I noticed the base64/deflate URL fragment storing the entire text content, à la flems.io ... nice!
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
http://notepadcalculator.com/
"$400 / 20" => 20 (ERROR)
"$400 / 25" => 25 (ERROR)
"400$ / 20" => 20 $ (OK)
"400$ / 25" => 16 $ (OK)
https://en.wikipedia.org/wiki/Language_and_the_euro#Written_...
-$4000CAD
CA$-4,000.00
4.000,00CAD$
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.
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.
https://en.wikipedia.org/wiki/List_of_currencies_in_Europe
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.
just a nitpick.. changing the theme resizes the panels automatically to adjust to the first panel's width
This could fit that sweetspot for me and others I imagine.
Sadly I haven't found any equivalent for iOS (iPhone and iPad): it would definitely get my money!
[0]: Not sure of the actual term in English
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.
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.
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.
Unfortunately it seems units cannot be applied to function results. It must be fixed, I noted down, thanks!