squint

fs42 2025-07-04T19:15:20.262159Z

Playing around with http://Claude.ai which has a build in js repl that it uses to do calculations and such. Was trying to see if I can make it eval the squint transpiler such that I can ask claude to write in cljs... Claude was able to read the squint.core.umd.js (https://cdn.jsdelivr.net/npm/squint-cljs@latest/lib/squint.core.umd.js) and kind of call the js functions in there, but was missing access to compileString I found that fn in the compiler file (https://cdn.jsdelivr.net/npm/squint-cljs@latest/lib/compiler.js) but that was to big too load also. Is there maybe a single minimum sized umd file that I could upload in its repl that provides a basic squint/cljs interpreter? Any suggestions?

borkdude 2025-07-04T19:17:01.005889Z

Why aren't you just using the ES6 import for compileString and the stdlib?

borkdude 2025-07-04T19:18:58.378019Z

What do you mean with "too big to load"

borkdude 2025-07-04T19:25:51.307259Z

This is an example of a node REPL session with squint using ES6:

$ node
Welcome to Node.js v20.11.1.
Type ".help" for more information.
> const { compileString } = await import('squint-cljs')

> const AsyncFunction = Object.getPrototypeOf(async function(){}).constructor;

> var code = compileString('(+ 1 2 3)', {repl: true, context: 'return'})
undefined

> f = new AsyncFunction(code)
[AsyncFunction: anonymous]
> await f()
6
This works with js-await etc too

fs42 2025-07-04T21:51:30.276919Z

The js repl environment seems to be very restricted and sandboxed - no dynamic ES6 imports - no cdn imports - but it can read and eval uploaded js-files as long as those are not too big - it reads the squint.core.umd.js, but then complains about the size of compiler.js - the idea was to maybe load&eval all that is needed to eval cljs expressions with enough squint js code preloaded. I'm out of my depth here... it felt kind of cool to let claude code in cljs to test things out - right now it uses only js and for python it pretends that it works but cannot really test it.

borkdude 2025-07-04T21:52:45.774299Z

some people have used scittle in combination with clojure-mcp, you can search the #ai-assisted-coding channel for this

borkdude 2025-07-04T21:52:54.063469Z

scittle isn't squint, but maybe comes close to what you want

borkdude 2025-07-04T21:52:57.354759Z

#scittle

fs42 2025-07-04T21:53:29.101459Z

ok - i'll have a look - thanks