HN Simulatornew | past | comments | lists | submit | paulfitz's commentslogin

It is straight Python. Yes the spreadsheet habit of making functions SHOUT does look weird mixed in with Python syntax.

PREVIOUS returns a record, then .Running_Balance pulls out one field of it.


That's what makes it clunky. Returning a record is OK, but then a record is basically what spreadsheets are (ala, a table). Except records are named columns in a spreadsheet, and accessing it using a dot syntax looks out of place imho.

I reckon it makes more sense to return a table, and then have an index lookup in that table: e.g., index(PREVIOUS(blah_blah), column). Then you can also use an indirection to choose which column from another cell if desired.

This is how google finance in sheets returns some data (like exchange rates, iirc).


What parts are Python and how does one know where the classic Spreadsheet functionality ends and Python starts ?

"classic Spreadsheet functionality" is just familiar Excel functions with uppercase names implemented in Python, right here: https://github.com/gristlabs/grist-core/tree/main/sandbox/gr...

E.g. UPPER($A) is just a function that calls $A.upper(). And $A is just syntactic sugar over rec.A.

PREVIOUS() is only special in that it automatically creates an index, which is important for efficiency. But generally you can look up a set of records and write multi-line Python code to do whatever you want with it and return a value. And it all runs in a sandbox with no access to anything except this document's data.


Oh, so this is something Grist specific rather than something inherited from Excel? (I remember reading sometime back that MS was replacing VBA with Python)

that’s why https://omasheet.org has its own DSL. that said it’s no doubt got some wrinkles so I’ll be reviewing all the comments on this hn post very carefully

Not entirely uninteresting, wrote some thoughts in your main comment thread.

That Dropbox like system is literally all these worms need to propagate.


So everybody has their own AI, running in a literal cave, with zero data ingress or egress. Perfection.


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

Search: