Fork me on GitHub
#sci
<
2023-06-12
>
john00:06:57

Hi, I'm curious about embedding sci (or cherry or squint) into a custom node runtime (Google App Script). Wondering where I should start. I've got a self-hosted CLJS running on GAS, so you can run code in formulas in Google Sheets and what not, which is interesting. But it's a bit heavy weight, having the whole self host in there. And 99% of your GAS code is going to be interop with GAS libs, so even squint might be a fit.

john00:06:43

So that might work. But is it possible to share a namespace/context environment across different evalString calls, so that diffrent sheet cells can refer to the same definitions?

john00:06:00

Still figuring out how to send cells in as parameters to clojure functions defined in a cell formula, but it might be an interesting tool

john00:06:47

Using the whole self hosted compiler on every call is too heavyweight though and slows the call down

john00:06:22

The great thing about Google App Script, by the way, is that 1) it's free, and 2) https://developers.google.com/apps-script/reference/url-fetch/url-fetch-app, which you can use to build a bot that can scrape the internet and store results in google sheets, for free, so that's pretty sweet

john00:06:47

GAS is serverless node before serverless was even a thing lol

john00:06:51

Anyway, no reason to write scripts on there in an uncivilized manner, so I figure I'll try one of these slimmer alternatives to cljs for wrapping GAS

john00:06:48

And with https://developers.google.com/apps-script/guides/clasp you can just deploy from the cli. So a cljs->gs build/deploy pipeline would be easy. There's no reason we shouldn't be just firing off scripts to the cloud using our personal hosted google node servers using our google accounts. It's a free lambda. Maybe that's what I should turn my clgs project into. A tool like nbb, but sends it to GAS. Not sure how a repl would work - it's ephemeral, like a lambda :thinking_face:

john01:06:35

Would probably be pretty easy to host a free ngrok/pagekite thing, for getting repls out from behind firewalls, etc

john01:06:07

And it could probably be as easy as nbb -e '(+ 1 2 3)', but it just runs it on gas

john01:06:36

Has that ugly ToS banner bar at the top, but good enough to get stuff done for free

borkdude09:06:45

> Hi, I'm curious about embedding sci (or cherry or squint) into a custom node runtime (Google App Script). Wondering where I should start. I guess you figured it out?

john19:06:43

Well, I guess a number of different paths could work. Sorry about the longwindedness above, kinda pitching it and ruminating options at the same time

john19:06:23

And I guess there's a free threshold there too yeah?

borkdude19:06:39

not sure, but I would assume so

borkdude19:06:26

first two million are free

borkdude19:06:32

Cloud Functions provides a perpetual free tier for compute-time resources, which includes an allocation of both GB-seconds and GHz-seconds. In addition to the 2 million invocations, the free tier provides 400,000 GB-seconds, 200,000 GHz-seconds of compute time and 5GB of Internet egress traffic per month.

john23:06:22

That's probably even more than the GAS quotas anyway

john23:06:25

GAS is an interesting stack though, with the webservices and docs integration

john23:06:27

You could spin up a form from the CLI to take community comments that auto populated a google sheet