unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* Brainstorming Wisp and Guile for financial bookkeeping
@ 2023-10-02 17:05 Christine Lemmer-Webber
  2023-10-04 19:34 ` Dr. Arne Babenhauserheide
  0 siblings, 1 reply; 3+ messages in thread
From: Christine Lemmer-Webber @ 2023-10-02 17:05 UTC (permalink / raw)
  To: guile-user

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



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-10-04 22:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-02 17:05 Brainstorming Wisp and Guile for financial bookkeeping Christine Lemmer-Webber
2023-10-04 19:34 ` Dr. Arne Babenhauserheide
2023-10-04 22:29   ` Daniel Tornabene

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).