Fork me on GitHub
#squint
<
2023-11-19
>
borkdude14:11:19

Alrighty! You can now solve an AOC puzzle from the #C03U8L2NXNC playground. Input it fetches after you add your AOC token :) https://squint-cljs.github.io/squint/?src=KHJlcXVpcmUgJ1tjbG9qdXJlLnN0cmluZyA6YXMgc3RyXSkKCihhc3NvYy1pbiEgKGpzL2RvY3VtZW50LnF1ZXJ5U2VsZWN0b3IgIiNjb21waWxlZENvZGUiKSBbOnN0eWxlIDpkaXNwbGF5XSA6bm9uZSkKCihkZWZuIGFwcGVuZCBbc3RyXQogIChqcy9kb2N1bWVudC5ib2R5LmFwcGVuZENoaWxkCiAgICAoZG90byAoanMvZG9jdW1lbnQuY3JlYXRlRWxlbWVudCAiZGl2IikKICAgICAgKHNldCEgLWlubmVyVGV4dCBzdHIpKSkpCgooZGVmbiBeOmFzeW5jIGZldGNoLWlucHV0IFt5ZWFyIGRheV0KICAod2hlbi1ub3QgKGpzL2xvY2FsU3RvcmFnZS5nZXRJdGVtICJBT0NfVE9LRU4iKQogICAgKGxldCBbc2Vzc2lvbiAoanMvcHJvbXB0ICJZb3VyIEFPQyBzZXNzaW9uIGlzIG5lZWRlZCIpXQogICAgICAoanMvbG9jYWxTdG9yYWdlLnNldEl0ZW0gIkFPQ19UT0tFTiIgc2Vzc2lvbikpKQogIChsZXQgW3Jlc3AgKGpzLWF3YWl0IChqcy9mZXRjaCAoc3RyICJodHRwczovL2FveC1wcm94eS5ib3JrZHVkZS53b3JrZXJzLmRldj95ZWFyPSIgeWVhciAiJmRheT0iIGRheSAiJmFvYy10b2tlbj0iCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGpzL2xvY2FsU3RvcmFnZS5nZXRJdGVtICJBT0NfVE9LRU4iKSkpKQogICAgICAgICAgdHh0IChqcy1hd2FpdCAoLnRleHQgcmVzcCkpXQogICAgICB0eHQpKQoKKGRlZm4gc3B5IFt4XQogIChqcy9jb25zb2xlLmxvZyB4KQogIHgpCgooZGVmIGlucHV0ICgtPj4gKGpzLWF3YWl0IChmZXRjaC1pbnB1dCAyMDIyIDEpKQogICAgICAgICAgICAgI19zcHkKICAgICAgICAgICAgIHN0ci9zcGxpdC1saW5lcwogICAgICAgICAgICAgKG1hcHYgcGFyc2UtbG9uZykpKQoKKGRlZm4gcGFydC0xCiAgW10KICAoLT4%2BIGlucHV0CiAgICAocGFydGl0aW9uLWJ5IG5pbD8pCiAgICAodGFrZS1udGggMikKICAgIChtYXAgIyhhcHBseSArICUpKQogICAgKGFwcGx5IG1heCkKICAgIGFwcGVuZCkpCgooZGVmbiBwYXJ0LTIKICBbXQogICgtPj4gaW5wdXQKICAgIChwYXJ0aXRpb24tYnkgbmlsPykKICAgICh0YWtlLW50aCAyKQogICAgKG1hcCAjKGFwcGx5ICsgJSkpCiAgICAoc29ydC1ieSAtKQogICAgKHRha2UgMykKICAgIChhcHBseSArKQogICAgYXBwZW5kKSkKCih0aW1lIChwYXJ0LTEpKQoodGltZSAocGFydC0yKSk%3D

metal 2
clojure-spin 2
sher15:11:56

Squint playground is great, must cost a lot if this hypes.

borkdude15:11:32

It doesn't cost anything, it's a static website

🙌 1
sher15:11:27

All the transpiling is happening on client browser?

chromalchemy15:11:11

If I have some cljs code that uses an atom, What would be the best way to port it to squint? Would I need to use react, or some other js framework for atom (or lightweight reactive cell) semantics. What is the small bundle happy path, short of cherry?

borkdude15:11:42

maybe solidjs?

sher15:11:03

By atom you assume a state and a handler to change it like setState ?

borkdude15:11:15

yeah you could of course just use react directly

borkdude15:11:48

here is a small example using solidjs: https://github.com/squint-cljs/squint/blob/main/examples/solidjs/src/App.cljs but react is pretty similar

borkdude15:11:57

solidjs is a smaller bundle

chromalchemy20:11:22

Thanks for feedback! Summarizing: Use React or Solidjs for reactive state. Maybe just use promises for getting and setting local state in responsible way (async concerns). I didn’t realize vanilla js had atomic transactions (this is what I thought I needed atoms for for basic in-memory CRUD between functions) https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics

borkdude20:11:23

Yes. Solid will give you a smaller bundle size I think but react is the popular option

sher15:11:23

What would it take to make it work squint on esbuild or bun or node

borkdude15:11:59

What exactly do you mean? squint (output) already works on those targets?

sher15:11:57

Ditch closure compiler

1
sher15:11:25

My understanding is that all the code is CLJS -> SCI (closure) -> javascript

borkdude15:11:06

I guess your question is ambiguous. "make squint work", you probably mean "build squint"?

sher16:11:09

Yes. I am bullish on squint.

sher16:11:09

More on "make squint work" right now.

sher16:11:24

UI for squint - please elaborate.

pez16:11:56

Better Advent of Code UI.

pez16:11:28

Or: Better UI for solving Advent of Code puzzles with squint.

sher16:11:31

Advents are personal?

borkdude16:11:04

The puzzle input is personalized

sher16:11:12

@U0ETXRFEW @U04V15CAJ we can find a discussion place.

pez16:11:25

@URCRY0U87 not sure what find a discussion place means. But I think that if you try to solve an AOC puzzle with the template/tool linked here you will understand what the update is about.

👀 1
sher17:11:11

@U0ETXRFEW apologies. As a non-native english, tried to express my intents.

borkdude16:11:40

I'll be updating the link in this section of the website if I make more changes, should you be interested: https://github.com/squint-cljs/squint#advent-of-code

🙌 1