sci

Lone Ranger 2022-09-26T13:04:23.174589Z

Okay @borkdude #sci is amazing. I can't believe this thing runs in advanced compile in cljs. Wow. Well done.

❤️ 1
Lone Ranger 2022-09-26T13:11:02.034179Z

In a browser environment, if I am trying to run cljs code that references compiled javascript (such as npm/module split code/React), I would include the exported javascript functions as per normal, right?

Lone Ranger 2022-09-26T13:12:10.717359Z

Also I tried #sci in #sci in #sci last night and it actually works 🤣 amazing

Lone Ranger 2022-09-26T13:13:22.868859Z

I think we can invent @borkdude Arithmetic now where 0 = (#sci x) , 1 = (#sci (#sci x)), 2 = (#sci (#sci (#sci x))), etc

Lone Ranger 2022-09-26T13:29:51.012509Z

Also, is there anyway to serialize/deserialize the state of a running #sci interpreter? 🤔

1
respatialized 2022-09-26T15:08:09.317859Z

I’m not sure if you’ve looked at Unison as an example of serializable program state, but it may be worth reading about. Language was designed with that in mind: https://unison-lang.org I think this is probably one problem where static types help a lot; serializing dynamic state seems harder because you don't have a compiler to give you as many guarantees.

Lone Ranger 2022-09-26T16:05:58.576519Z

@afoltzm is it a JS runtime language...?

respatialized 2022-09-26T16:20:04.552019Z

Nope, it's implemented in Haskell

Lone Ranger 2022-09-26T16:22:20.781619Z

Ok. Need something javascript compatible but always like reading up on new languages, thanks for pointing it out!

respatialized 2022-09-26T16:37:26.679039Z

Oh I didn't mean to imply it was a readymade alternative, more as potentially informative prior art for the idea of serializable program state / closures in general terms, should you end up taking on that problem in #sci

Lone Ranger 2022-09-26T17:52:18.807309Z

Serializable closures 😬 that sounds like a lot of work, good point

borkdude 2022-09-26T14:28:16.593269Z

@goomba How you reference compiled JS is either via the global JS environment, or via what you provide via the SCI ctx, either through :classes or via :load-fn

Lone Ranger 2022-09-26T14:43:00.070159Z

Brilliant

borkdude 2022-09-26T14:48:03.620009Z

About serializing: there have been some efforts, but the problem is a circular reference to the context and how to serialize closures. You might be able to get it to work, but I haven't really pursued it