Fork me on GitHub
#off-topic
<
2022-06-10
>
isak15:06:07

Anyone know of a tool like https://www.linqpad.net/ is for .NET, but for the JVM and/or Clojure?

borkdude15:06:25

Any editor with Clojure support is basically a linqpad :)

👍 1
isak15:06:58

For me it is nice to have a separate app for it to not pollute my main coding environment. Each script can have its own set of dependencies, and you aren't just spitting things out on a console. (I know there are visualization tools for Clojure, but Linqpad has it all integrated and easily accessible.)

borkdude15:06:57

For babashka you have babashka.deps/add-deps so you can add the dependencies to your script. For clojure JVM, you might be able to use the add-lib branch of tools deps

dpsutton15:06:10

a separate project with REBL or reveal or clerk sounds like what you are describing

Stuart15:06:52

Yeah, I use LINQPAD daily for .NET stuff, but for clojure I just having a project I've called messing. With a bunch of random scratch1.clj, scratch2.clj etc, and that hooked up to the repl is way better than anything LINQPAD comes close to

borkdude15:06:32

I've used Linqpad when I was a .NET developer and it was useful, but imo a REPL is the equivalent experience and doesn't require a special tool. It's easy enough to add some deps to a deps.edn and spin it up

dpsutton15:06:34

in my C# days I loved LINQPAD so you could code little prototypes without making a new huge C# project. With Clojure that need is almost non-existent because of the repl

Stuart15:06:37

> you aren't just spitting things out on a console. You should have it setup where you jsut get results inline with the code as you are evaluating into the repl

dpsutton15:06:54

I’m also a huge fan of a classpath root that is gitignored so you can keep one-off dev stuff locally. And you can keep an alias in your user deps.edn that has helpful stuff so you can stay in one jvm while not risking adding deps to your project

isak15:06:29

@U013YN3T4DA I have that kind of project too but I don't agree that it is better, since it isn't portable. What @U04V15CAJ described with babashka comes the closest.

borkdude15:06:15

conjure (vim plugin) starts bb automatically when in clojure mode so you can start evaluating expressions

🎉 1
borkdude16:06:06

in http://repl.it you may also be able to do stuff easily and even share it with others

isak16:06:21

I think its kind of different though, because in LINQPad there is a dedicated dump area, and it runs locally. Here is an example of something I made quickly in LINQPad for work. So people run the script, then they get kind of a little tool:

isak16:06:22

So I think what you guys have talked about largely fulfills the role of local playgrounds, and those are useful, but that doesn't encompass everything that LINQPad is.

didibus17:06:59

I guess maybe it's more GUI oriented than some of the Clojure tooling?

didibus17:06:26

Does it share scripts automatically with others? So like you get to instantly open other people's playgrounds?

didibus17:06:55

But looking at the code, it looks like you had to use a GUI toolkit explicitly? Wouldn't just normal Clojure+Seesaw for example be good enough?

didibus17:06:35

Or like others have said, if you want the GUI to be automatic, using Portal for example can give you that. Easy visualisation of a DB query result set for example.

didibus17:06:29

And then you can just have a single git repo called team-scripts and for each scripts just make a folder add a deps.edn and a single clojure file.

☝️ 1
didibus17:06:27

Also, maybe you don't know, but some IDE have that built-in. For example in Cider Emacs, you can just M-x cider-inspect on a resultset from a DB query and it pop ups the results in Emacs and you can navigate through them.

didibus17:06:04

If you're interested though, check out: https://vlaaad.github.io/reveal/ https://github.com/djblue/portal https://docs.datomic.com/cloud/other-tools/REBL.html They're all for data visualization and navigation though, so they don't have a code editor built-in, it's meant you use your preferred code editor for that and they just complement it with data navigation and visualization. Also some of the data-science stuff can be nice for graph visualization like: https://github.com/metasoarous/oz https://scicloj.github.io/clay/

isak17:06:31

Yea there are social features, like uploading your file and getting a link that you can send to others. And yea it is also more GUI oriented. What works about it is there is a dedicated area where you expect to see output. With Clojure, what would it be? Run this script, and look for random windows to pop up, something to be spit out in a console for this script, etc? It wouldn't be as easily digestible.

didibus17:06:52

The social/gui oriented aspect sounds nice, I don't know about the "expected output tab". If a window pop, it's pretty obvious, it would take like one second for someone to figure out that the output pop ups in a window, or displays at a URL in your browser.

isak17:06:58

Right I've seen some of those, but I think those are kind of things that would be nice to have built in to an app, but they aren't really apps/sharing platforms themselves

didibus17:06:48

The counterpoint, is that those tools (like linqpad) are restrictive "all-in-one". Where as if you leverage REPL friendly libraries, they can combine and play nice with one another, and you can build above and beyond whatever you want, as well as conveniently use your own editor of choice.

didibus17:06:27

The downside to that is user friendlyness I guess.

1
isak17:06:32

Yea for the expected output tab, it is hard to explain why but I think it makes a big difference. Maybe it is that there will be a commonly agreed on way to do things, not just starting all kinds of arbitrary processes, web browsers, etc.

isak17:06:53

Some of the libraries are also accessible outside of the program, so you can add a dependency on it and use some features of it. You can also call it from the command line on a schedule, for example.

didibus18:06:12

You should give Reveal a try. It's the closest it seems to Linqpad. You can also extend it with your own actions, renders and even full on views with custom GUI, see: https://vlaaad.github.io/reveal/extend

didibus18:06:35

The only difference is that there's no built in editor/project management, that relies on your own editor.

didibus18:06:18

I've been using Portal personally, cause I prefer how browser UIs have all the features browsers add like forward/back, proper zoom/scaling. But I'm not sure it can be customized with custom UX

didibus18:06:08

If you use VSCode as well, Portal can be integrated as a tab inside VSCode, so that could be closer to linqpad

isak19:06:27

Good to know, thanks

p-himik17:06:38

Just stumbled upon this and... wow. I can't even imagine how to approach such a problem. https://github.com/mame/radiation-hardened-quine

1
😲 2
rich 1
chucklehead17:06:25

I think steps 1..n-1 go something like embed a minikanren and define read-stringo and evalo and all the rest, then step n is ask for all the quines, and n+1 is prepare your strangeloop talk

😄 5
mauricio.szabo11:06:14

This developer have a huge amount of quines in Ruby... He have one that plays tic-tac-toe, one that's a spinning globe, one that spits another language that spits another until it goes back to the first...