8 ms·
Show HN: Joyride: script VSCode like Emacs but using Clojure
Together with PEZ (Peter Strömberg) I made a VSCode extension that allows you to script VSCode using Clojure (interpreted CLJS).
The repo:
https://github.com/BetterThanTomorrow/joyride https://github.com/BetterThanTomorrow/joyride
Introductory video:
https://www.youtube.com/watch?v=V1oTf-1EchU https://www.youtube.com/watch?v=V1oTf-1EchU
See examples directory:
https://github.com/BetterThanTomorrow/joyride/tree/master/examples/.joyride/scripts https://github.com/BetterThanTomorrow/joyride/tree/master/ex...
See animated gifs and news on Twitter:
https://twitter.com/hashtag/vsjoyride?src=hashtag_click&f=live https://twitter.com/hashtag/vsjoyride?src=hashtag_click&f=li...
- maleghast 4y agoThis is so great - the expanding universe of Clojure / ClojureScript tooling and so forth is great to see and great fun to use, whether in anger or just out of curiosity - thanks for this, I know what I will be exploring over the weekend!
- cospaia 4y agoAs the co-creator here I'd like to add that Joyride is taking the very first baby steps here. We hope a lot of people want to try it and provide feedback to inform our next steps. NB: The video has a target audience of people who know Clojure and its strengths. Especially how the REPL is used. I hope HN will see beyond the parens. =) It should make some sense anyway. Especially if you have some Emacs scripting experience, because that is where most of the inspiration to Joyride comes from.
- ungamedplayer 4y agoParens are love. Parens are life.
- mijoharas 4y agoParens are laugh.
- seanw444 4y agoLive, laugh, love syntax errors.
- leifericf 4y agoHugs for your code!
- kitd 4y agoParens f*** you up - Philip Larkin
- gorjusborg 4y agoSay hello to my little parens! - Tony Montana
- christophilus 4y agoDo you ever sleep? Seriously; your productivity is insane.
- cospaia 4y agoTbh, the last nights have been less about sleep and more about hacking on Joyride. =) But usually I do get sleep. The question we should ask is if borkdude sleeps? He's doing about 100X as much as I do. Maybe there are hundreds of borkdudes.
- leifericf 4y agoBoth you and borkdude are productivity beasts (of the kindest variety) in my mind :)
- christophilus 4y agoWell, that goes without saying. We all know that borkdude is a robot.
- yogthos 4y agoFantastic work on the extension. In terms of ideas for next steps, my suggestion would be to consider automating the process of creating and invoking cljs files. One big use I can see for this is creating ad hoc scripts to do stuff in the editor. If you could pop up an editor via some shortcut that would allow you to create a script and bind it to a shortcut, that would make using Joyride really seamless.
- cospaia 4y agoThanks! Please consider filing your suggestion as an idea on the Joyride discussions section: https://github.com/BetterThanTomorrow/joyride/discussions https://github.com/BetterThanTomorrow/joyride/discussions
- rockyj 4y agoNice! I really wish we could have a CLJS -> JS compiler in pure JS (something like TypeScript) and no need for JVM or JVM libs.
- Borkdude 4y agoThis exists and is called self-hosted ClojureScript. To be clear, you don't need that nor do you need a JVM to write joyscript scripts, as the scripts are interpreted by SCI, a Clojure interpreter: https://github.com/babashka/sci https://github.com/babashka/sci
- christophilus 4y agoI thought Lumo was this, tough that project might be dead. ShadowCljs is pretty close.
- Borkdude 4y agoLumo is one instance of what you can do with self-hosted CLJS and yes, the project is unfortunately dead.
- tgv 4y agoThat looks promising, but I have a feeling that vscode doesn't offer as much options to hook into the editor as emacs does. E.g., one of the first emacs scripts I wrote added the next number to the current line. It contains something like (insert (number-to-string (setq counter (+ 1 counter)))) Is that kind of thing possible too?
- oefrha 4y agoYou mean whether VSCode extensions (1) can insert into the current line; and (2) have state? The answer should be rather obvious, yes.
- tom_ 4y agoI assumed the point is whether you can do this from the repl? This is something Emacs is good at, but VSCode doesn't seem to be; in Emacs, you can do something like M-: (insert "FRED") RET and you'll see FRED appear in the current buffer. For good or (more rarely) for ill, the repl runs in the same context as the editing environment. You can use this to interactively develop extensions or just drive the editor from code as a one-off.
- oefrha 4y agoGP said “scripts”. But no, VSCode certainly doesn’t have that level of interactivity. On the other hand, the single-threadedness of Emacs is very annoying though. Edit: My usage of Emacs has been reduced to mostly just magit and dired since ~2017, so I didn’t realize Emacs 26 added threads. Is it actually widely adopted? Things I do use these days, like package.el, are clearly still blocking.
- macmac 4y agoThis is not correct. Use of the CLJS REPL to insert strings is even demonstrated in the video.
- 4y ago
- snorremd 4y agoWow, really excited by this! The Calva extension gave us a really nice editing and REPL experience for Clojure code. Now we get to interactively configure VSCode with Clojure code which is pretty dope. I used Spacemacs at my old workplace for some time, but never got into making custom configuration. I never got into the emacs lisp library or the syntax peculiarities. Though I suspect the minor syntax differences would be the least problematic to learn. Now I use VSCode Calva and will definitely check out Joyride as it uses SCI and allows me to use the Clojure library that I already know and love. People who like this should consider sponsoring both Borkdude and PEZ on GitHub. They do amazing work for the Clojure ecosystem.
- kralhackimer001 4y ago
- markus_zhang 4y agoOh this could be fun. Anything other than JavaScript/Typescript is good.
- beepbooptheory 4y agoDefinitely understand the need and looks good, but can't help but feel this is like taking a fine steak and eating it at McDonalds.
- cospaia 4y agoWhich fine steak would that be?
- beepbooptheory 4y agoThe steak is the lisp interpreter as IDE scripting runtime.
- cospaia 4y agoAh, so it's the editor war we are fighting here? =)
- andriosr 4y agoSuper cool! I've been planning integrating https://runops.io/ https://runops.io/ to VSCode for a while and most of the delay is related to having to write Javascript. I like your wrapping of the VSCode js API. I'll use as inspiration for creating the Runops extension using cljs in the near future. Super exciting that I can do something like this for VS code now: https://andrios.co/articles/spacemacs-cheatsheet/#elisp-function-to-emacs-command https://andrios.co/articles/spacemacs-cheatsheet/#elisp-func...
- vincent-manis 4y agoI am certain that this is excellent work. I, however, will continue using Emacs.
- EnigmaCurry 4y agolong time emacs user, I've tried vscode a few times. I will not go back to try it again until it has emacs-style undo tree https://github.com/Microsoft/vscode/issues/20889 https://github.com/Microsoft/vscode/issues/20889. Emacs bindings are no good if they do completely different things.
- joenathanone 4y agoDidn't know this was a thing, my whole life is a lie!