squint

Alejandro 2025-10-31T08:55:12.230789Z

Hello. Is there a way to have an nrepl for squint in browser?

borkdude 2025-10-31T08:58:52.371149Z

@alexander.scherbanov_ Sadly not yet. I have a branch where I have this working, but it's limited to one namespace. I need to put more work into this first to make it consumable for a broader audience

🙏 3
Alejandro 2025-10-31T09:15:00.066449Z

@borkdude, how about a quick hack? A script on the page could open a websocket connection to a locally running app in terminal, which acts as a repl, compiling and sending code to the page. The isend-mode would be enough for me, I believe. Would this work?

Alejandro 2025-10-31T09:15:01.026019Z

https://github.com/ffevotte/isend-mode.el

borkdude 2025-10-31T09:16:45.393619Z

yes, that quick hack is basically what I did :)

borkdude 2025-10-31T09:17:05.436029Z

let me look up the branch

borkdude 2025-10-31T09:19:16.565739Z

here's an example app that uses it: https://github.com/squint-cljs/squint/commit/f468c1bbe5a479243708dc9d1f86f6f4a894841c

borkdude 2025-10-31T09:20:21.975499Z

you need to include this bit in your app: https://github.com/squint-cljs/squint/blob/f468c1bbe5a479243708dc9d1f86f6f4a894841c/examples/browser-repl/js/nrepl.js

borkdude 2025-10-31T09:20:44.406799Z

I could have another go at this but at that point I just had a POC working

Alejandro 2025-10-31T09:37:38.002319Z

That's cool, thanks. How hard would it be to circumvent this limitation of one namespace?

Alejandro 2025-10-31T09:40:17.707229Z

I mean, I've never seen the codebase, how hard it would be for me if I wanted to contribute?

borkdude 2025-10-31T10:00:17.192489Z

@alexander.scherbanov_ I hope it shouldn't be too difficult but there are two main challenges. 1. All requires files (transitively) that have changed should also be sent along to the browser. 2. Requiring node libraries should somehow be converted as well to something that can be sent to the browser. Both changes should (I think happen) in the nrepl server

Alejandro 2025-10-31T10:16:34.266219Z

Hm. I'm not sure I follow. I'd like to send pieces of code for a very basic repl-workflow, when I start with data and then write code around it, and then define a function. Is sending all transitive requires files and node libraries necessary for this?

borkdude 2025-10-31T10:18:05.759159Z

Consider this:

(ns foo
 (:require ["d3" :as d3]
           [another-namespace :as a]))

(d3/whatever (a/foo))
If you would like to evaluate (d3/whatever (a/foo)) in the browser, what do you think should happen to accomplish this?

Alejandro 2025-10-31T10:27:14.522399Z

Oh, do you mean the namespaces are not implemented yet? I thought it's a limitation of the repl. If so, that's fine. Basically, I'd like a lightweight tool for repl in js.

borkdude 2025-10-31T10:28:40.082279Z

that's basically what I had in the POC yes

🔥 1