Fork me on GitHub
#off-topic
<
2021-02-26
>
Vincent Cantin04:02:39

Question: Is there any Clojure(Script) implementation of something close to what CodeMirror does?

seancorfield05:02:08

That's not really CM -- which is in-browser -- but Liquid is very cool (as a vi-like editor).

phronmophobic05:02:29

I believe liquid also runs in the browser

seancorfield05:02:52

Oh, that must be new.

seancorfield05:02:42

I don't see any indication of that in the README? Liquid was purely Clojure/JVM last I looked.

phronmophobic05:02:07

maybe I'm crazy

Vincent Cantin05:02:18

I see some CLJC files, but not clear direction on how to use it in a browser.

phronmophobic05:02:38

I thought I remembered seeing a cljs example somewhere

Vincent Cantin05:02:15

I think that Liquid is only for Clojure source code, it does not support other languages.

dpsutton05:02:37

i've used CM from cljs. there's an example of it as well from https://github.com/borkdude/re-find.web/blob/master/src/re_find/web.cljs#L371

👍 3
Vincent Cantin05:02:36

I will try to reuse this code snippet. Thank you.

Vincent Cantin05:02:04

I found a Clojure mode for CM v6, will give it a try instead. https://nextjournal.github.io/clojure-mode/

borkdude07:02:17

Yeah I’ve been meaning to take a look at that new one

dpsutton05:02:04

not sure if that addresses your question or not. but if you're finding something amenable for use from cljs it works

Vincent Cantin05:02:48

I used CM 3 years ago to make a TIS-100 editor and I did not like its JS API. Now I am fully used to Clojure, I don’t want to go back to CM, hence my question.

phronmophobic05:02:53

fwiw, liquid does run in the browser http://salza.dk/liq/

phronmophobic05:02:40

I think this is the code

phronmophobic05:02:02

Liquid is very hackable and supports extension. So while it doesn't have other language modes, it would be possible to extend it.

seancorfield05:02:40

Ah, the in-browser version is new-since-I-last-looked-at-it 🙂

seancorfield05:02:19

I think Liquid is a fascinating project!

phronmophobic05:02:00

I've been using Liquid for my UI projects. If you don't mind including a JS implementation (like Rhino) it's possible to reuse codemirror modes for syntax highlighting. The deeper integrations from codemirror modes are less reusable.

mogenslund07:02:33

Hi. Just to clearify. The new liquid does not run in the browser. The old did. It is not difficult to implement again as a server. It sort of boils down to sending keypresses from the browser to the server, receiving a list of changed characters in the view back. I also, at some point build a version (also old), that could run directly in the browser. It does not have "eval" and it does no perform well, so it should be regarded as an experiment and not a solution for anything. I think real multi-threading is what makes it perform on the JVM. You can handle drawing without blocking input 🙂

Stefan07:02:57

Hi all, I remember seeing at some point a link to a shared calendar that contains all Clojure community events. Unfortunately I lost it and can’t find it anymore. Does anyone have the link lying around? Thanks!

Stefan20:03:25

Yes it was, thank you!! 🙏

Stefan10:03:52

@U04V6FEES Did it maybe stop working? I don’t get any events after last weekend…

eval202012:03:01

@UGNFXV1FA it’s a crowd-sourced calendar 🙂 I just added a couple of new events from the London Clojure meetup

❤️ 3
orestis08:02:01

@vincent.cantin Just curious, is CM not suitable for you? FWIW the author is writing pretty sensible APIs and has worked on these problems for quite a long time.

Vincent Cantin21:02:41

From memory (I used it 3 years ago), I had the feeling that the error reporting and auto completion could be done in a more automated way, for example based on a grammar. Maybe that's what is coming in CM v6

Vincent Cantin22:02:55

From a practical point of view, it still does what I need to do, no problem.

orestis05:02:06

Have you seen this https://github.com/nextjournal/clojure-mode ? Not sure if you want to edit Clojure

Vincent Cantin10:02:11

I saw it and will use it. The code editor will be a hiccup-based css playground.

myguidingstar15:02:32

I can't help referring to a line in Imagine song adaptation in my project's homepage https://walkable.gitlab.io 😂

pathom 9