babashka-sci-dev

Ben Sless 2021-12-17T11:24:07.148200Z

Something I've been wondering about with sci, would it be possible to tweak its evaluation semantics , for example to make it call by need and not call by value?

borkdude 2021-12-17T11:27:57.148400Z

Perhaps with a hack ;)

Ben Sless 2021-12-17T11:30:28.148500Z

Most likely, how complicated do you assume it would be?

borkdude 2021-12-17T11:31:56.149Z

I suspect it would be easier to do a program transformation to wrap everything in delays

borkdude 2021-12-17T11:32:21.149500Z

as SCI assumes the same semantics as clojure and doesn't really try to do anything different

borkdude 2021-12-17T11:32:48.149900Z

but having said this @mauricio.szabo has done some hacks to implement a sort-of async/await in SCI on JS

borkdude 2021-12-17T11:32:59.150100Z

which is similar

borkdude 2021-12-17T11:33:27.150400Z

perhaps I can find his hacks, or he can link them here

borkdude 2021-12-17T11:35:28.150700Z

now that we have history in this slack it should be "easy" to find... let me try

borkdude 2021-12-17T11:37:58.151200Z

https://twitter.com/mauricio_szabo/status/1426713696789794816 and then he did make it so, but I lost track where the code is...

borkdude 2021-12-17T11:38:45.151500Z

@ben.sless yeah here it is probably: https://app.slack.com/client/T03RZGPFR/C029PTWD3HR/C03RZGPG3-1639716316.475700

borkdude 2021-12-17T11:39:49.152100Z

better link (slack permalinks are hard)

borkdude 2021-12-17T11:40:53.152300Z

This is where his hack lived: https://github.com/mauricioszabo/nbb/blob/full-async/src/nbb/sync_promises.cljs

mauricio.szabo 2021-12-17T11:50:57.154Z

Hi there - just jumping in the conversation now. If someone is interested I can discuss my hack :)

Ben Sless 2021-12-17T12:10:12.154100Z

Can it be used as a baseline to implement a partial evaluator?