From: Christine Lemmer-Webber <cwebber@dustycloud.org>
To: guile-user@gnu.org
Subject: Brainstorming Wisp and Guile for financial bookkeeping
Date: Mon, 02 Oct 2023 13:05:16 -0400 [thread overview]
Message-ID: <87v8bpeykp.fsf@dustycloud.org> (raw)
This isn't actual software, it was just me looking at a pile of
Beancount / Ledger files I've made over the years and thinking,
"what if this was just a DSL on top of Guile?"
And then I also thought: "what if instead of making a custom DSL,
we just used Wisp?"
Here's I think how you might write an entry:
* 2020 03 30 "Starting balance"
Assets:Retirement:IRA : USD 1321 84
Equity:OpeningBalance
Which would translate to:
(* 2020 03 30 "Starting balance"
(Assets:Retirement:IRA (USD 1321 84))
(Equity:OpeningBalance))
If we wanted to make it look like Ledger/Beancount, it would look more
like:
2020-03-30 * "Starting balance"
Assets:Retirement:IRA 1321.84 USD
Equity:OpeningBalance
Actually, that's both valid Wisp and Beancount! You could parse this
as:
(2020-03-30 * "Starting balance"
(Assets:Retirement:IRA (USD 1321.84))
(Equity:OpeningBalance))
Except... IEEE floating point numbers aren't great for financial things,
so hence me thinking maybe you'd separate them (even though it looks
very yucky). And I thought it would be nicer if the first thing was the
constructor, and I figured I might make the dates separate fields, but
you could switch most of these out in post-processing (with some risks
over the floating point stuff... notably risks Ledger also takes,
infamously).
Here's another example of Beancount syntax for asserting a balance:
2020-01-03 balance Assets:Banking:Checking 7337.43 USD
Yeah anyway you could read that in Wisp too.
As for special fields, eg check numbers, keywords could work:
* 2020 01 03 "Tangled Woodworking" ""
#:check 1835
#:invoice 2853
Assets:Banking:Checking : USD -4075.00
Expenses:House:RepairsImprovements
(* 2020 01 03 "Tangled Woodworking" ""
(#:check 1835)
(#:invoice 2853)
(Assets:Banking:Checking (USD -4075.00))
(Expenses:House:RepairsImprovements))
or
* 2020 01 03 "Tangled Woodworking" ""
. #:check 1835
. #:invoice 2853
Assets:Banking:Checking : USD -4075.00
Expenses:House:RepairsImprovements
(* 2020 01 03 "Tangled Woodworking" ""
#:check 1835
#:invoice 2853
(Assets:Banking:Checking (USD -4075.00))
(Expenses:House:RepairsImprovements))
Those dots wouldn't be needed if Arne hadn't reversed agreeing with me
that keywords should always be part of a previous expression without
needing that dot foo ;)
Anyway. Just a thought. I haven't written software for this. I have
thought it could be nice to do my finances at the REPL though. :P
Feel free to steal this idea, or not...
- Christine
next reply other threads:[~2023-10-02 17:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-02 17:05 Christine Lemmer-Webber [this message]
2023-10-04 19:34 ` Brainstorming Wisp and Guile for financial bookkeeping Dr. Arne Babenhauserheide
2023-10-04 22:29 ` Daniel Tornabene
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87v8bpeykp.fsf@dustycloud.org \
--to=cwebber@dustycloud.org \
--cc=guile-user@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).