off-topic

https://github.com/clojurians/community-development/blob/master/Code-of-Conduct.md Clojurians Slack Community Code of Conduct. Searchable message archives are at https://clojurians-log.clojureverse.org/
2021-05-27T09:36:49.163200Z

For people that use stored procs rather than sql in your app, how do you manage dependencies for stored procs? i.e. I have a stored proc spFoo and it's called by application A and application B. A developer is working on Application A and needs to change spFoo, how does he know that he is potentially breaking application B. Other than just be disciplined in putting this informatoin in the stored proc comment header?

Sigve 2021-05-27T10:52:05.163300Z

I cannot answer generally. But specifically for that problem i would make app A call a new function spBaz instead of altering spFoo. If the two functions have a lot of code in common this can potentially be moved to a third function they both call.

jimmy 2021-05-27T12:53:53.163600Z

I'll just say that more than one application talking to the same database is something I'd be really suspicious of. As your system grows, everything becomes coupled to the database schema and things become harder and harder to change. Of course this is a hard and fast rule. But I've seen so many systems suffer because of this. So I'd really consider if it isn't possible to have an API in front of the db and have other apps call it.

Thomas 2021-05-27T13:12:58.163800Z

At one of my previous employers, stored procs were mandatory for data access (the services could not do a SELECT for example.) They versioned the stored procs using a suffix like getData_V1. Basically what @sigve.nordgaard said.

2021-05-27T13:15:45.164Z

The reason this has come up is moving from not having sql calls in the apps themselves, and moving to only accessing db via stored procs, but there would invevitably be people looking at an existing stored proc and knowing they could call it. but then someone doesnt know that someone on another team is calling their stored proc now, changes it and breaks the other app. Unfortunately a db per app is infeasable right now.

Thomas 2021-05-27T13:17:54.164200Z

The scheme I described avoided this because the stored procs were managed in a separate git repo, PRs had to be validated by DBAs who then created them (and they refused any modification to existing stored procs.)

emilaasa 2021-05-27T13:48:49.164400Z

I guess all the same things apply as for other shared dependencies. Out of curiosity why go from plain old SQL to stored procedures?

Thomas 2021-05-27T14:03:34.164700Z

In our case ? DBAs wanted to review the SQL code to ensure there won’t be any perf issue.

2021-05-27T14:18:05.164900Z

Easier to code review sql, easier to configure perms on a per stored proc basis, easier to see history of a query.

2021-05-27T14:19:05.165100Z

Easier to see what dependencies are on a table, it's all in the dB rather than scatters through various apps

emilaasa 2021-05-27T14:31:40.165300Z

Well then a decent tradeoff might be to not break stored procedures (ever).

emilaasa 2021-05-27T14:31:54.165500Z

Treat it like a public api of any kind?

vncz 2021-05-27T14:55:50.166100Z

Is anybody here using Github Enterprise Cloud in their company by any chance?

nenadalm 2021-05-27T17:22:45.166200Z

Each app could also have procedures in the app namespace (in postgresql it's called schema, if your db doesn't support that, you could just prefix procedures with <app_name>_. In case you would really want to share some procedures, you could put them in some shared namespace (in which case they should never be broken or each app using the db should be checked if it uses the procedure) I don't use procedures much though. So I don't have much experience with it.

2021-05-27T20:24:18.166500Z

I was thinking to myself “huh, parentheses, brackets, and curly brackets sort of shape data, so what if they expanded to take as many lines as they encapsulate?” Never mind this idea is ugly lol

phronmophobic 2021-05-28T17:21:49.202300Z

These are several visual representations of https://raw.githubusercontent.com/t-mon/selffinding-chronicles/cb24e067579ba755c26ef642b24f9d2a8d3b45b9/gamedata/savegames/test-savegame.json for different sizes. The visualization works with any edn data. Color represents depth, and each box is a leaf value (ie. strings and non-collections like numbers, keywords, symbols). Map keys are given priority space.

phronmophobic 2021-05-28T17:23:58.202500Z

I've tried a bunch of variations for "screen space bounded pretty print". I haven't tried background colors or otherwise to outline collections which is why I thought your initial suggestion was interesting.

djblue 2021-05-29T16:33:25.213200Z

I'm partial to rendering that data like this :portal:

2021-05-29T17:44:07.213400Z

@djblue what would that experience look like if that was an editing interface?

djblue 2021-05-29T18:11:00.213700Z

I haven't implemented edit in any capacity, but I think editing would be driven by the viewer. For instance, if you have a table view, I could image a ghost row at the bottom where you can start filling out new values for known keys, probably as an edn string that will get parsed. You could reorder/delete rows and add a new column.

djblue 2021-05-29T18:24:17.214200Z

For string: textarea, for boolean: checkbox, for number: slider, for inst: calendar. For anything novel, you can enter the value directly as edn or maybe you choose a type, get a default value for that type, then edit it like any other existing value.

phronmophobic 2021-05-29T18:28:00.216200Z

What would “edit” mean in this context? You would need either a reference to an identity or place to put a new value

1💯
djblue 2021-05-29T18:30:14.216500Z

Yeah, that's the hard bit, especially editing recursive values. That's why I've avoided this problem 😅

phronmophobic 2021-05-29T19:09:02.216800Z

I think tracking references is doable. You could use a lens-like library to do a lot of the heavy lifting (eg. specter, clojure.zip), but once you "edit" a value, your source code is no longer the source of truth. If you did want a reproducible program state (I think you do), then you would either need to do source editing, have a way to save program state (eg. smalltalk), or something else.

walterl 2021-06-03T20:50:55.277800Z

You're "collapsing blocks" away from a kick-ass EDN/code browser 🙂

phronmophobic 2021-06-03T21:24:03.278100Z

It's a little intense with nested maps, but seems like an interesting direction

> (backend/draw-to-image! "boxes.png"
                          (depth-draw
                           (read-string
                            (slurp "<https://raw.githubusercontent.com/seancorfield/dot-clojure/develop/deps.edn>"))))

2😍
2021-06-03T23:04:29.280300Z

Could the idea of “many visualizations to the same blocks of data” be incompatible with things like Portal, Reveal, or the REBL? Why not just mix it?

2021-06-03T23:05:19.281300Z

What other structures would have a distinct color? Anonymous functions, maybe?

2021-06-03T23:09:02.285600Z

I’m not just thinking depth as a replacement for rainbow parens.. I was thinking about color coding the blocks based on whether the borders indicate it’s a vector, a map, a list, or a quote. I think shading for nesting is good too, but imagine if vectors had shades of a different color than parens. Like, how can we communicate more than the various types of parens, indentation, and rainbow parens?

mauricio.szabo 2021-06-05T20:52:58.294800Z

Coming late to the party, but in theory what we are showing here (different ways to render EDN) is already possible with Chlorine and Clover, with a little bit of effort. I'm working on getting a better customizer for the rendering of EDN

mauricio.szabo 2021-06-05T20:54:34.295Z

Also, @rob370 I would love to know what are you thinking about this strucutural editing of Clojure code. Do you already have some ideas?

mauricio.szabo 2021-06-05T20:55:49.295200Z

(Specially because the current Chlorine/Clover code is already 100% separate from any specific text editor, so if you decide to re-think text editing, I'm almost 100% sure that we can port Chlorine to it for example)

2021-05-27T20:30:53.167300Z

I kind of like it tho

Darin Douglass 2021-05-27T20:37:54.167500Z

for a few lines it may be nice to see the grouping, but the wider {} gets the more they start looking like () which i could see being confusing

phronmophobic 2021-05-27T20:43:57.167900Z

It is kind of interesting

phronmophobic 2021-05-27T20:47:00.168100Z

I experimented with https://blog.phronemophobic.com/treemap/treemaps-are-awesome.html to visualize medium size edn data. I tried using colors to represent types, but I never colorized based off of containers (only leaf types. see below) which might be worth experimenting with.

borkdude 2021-05-27T20:57:54.170200Z

Btw is it possible to switch between the markup editor of Slack and the non-markup editor? I have turned it off by default, but for such a long link it would have been nice if I could have formatted it as [foo](bar)

walterl 2021-05-27T21:16:46.170700Z

Reminds me of https://github.com/thiagoalessio/rainbow_levels.vim

sova-soars-the-sora 2021-05-27T21:18:54.171700Z

What the gadget!

sova-soars-the-sora 2021-05-27T21:19:44.171900Z

That werkbank thing is very intriguing. The rainbow levels actually looks hella useful. If keywords and stuff could still somehow keep a color, or maybe a glow, or outline color, or even just a slight change in Light (Hue, Saturation, Light = brightness)

2021-05-27T21:21:40.172100Z

Doo doo doo alternative versions

2❤️
2021-05-27T21:30:01.172300Z

Woah werkbank looks really cool. I wonder if it would be possible for Clojure to use Fructure for a structural editor? https://www.youtube.com/watch?v=CnbVCNIh1NA

2021-05-27T21:30:58.172600Z

phronmophobic 2021-05-27T21:34:19.172900Z

on the desktop app, you can just type foo, select the text, and paste the link and it will automatically turn it into a link

borkdude 2021-05-27T21:35:16.173100Z

oh really

borkdude 2021-05-27T21:35:42.173300Z

no, that doesn't work when you have turned off the formatting stuff

phronmophobic 2021-05-27T21:37:10.173500Z

oh, right. 😳

2021-05-27T21:38:06.173700Z

Yeah you have to change your preferences for that single message, currently

sova-soars-the-sora 2021-05-27T21:38:18.173900Z

Hmmm. It would be cool to have a repl set up to a visual coding canvas so you can see results of "map" and "filter" operations instantly on observed data

sova-soars-the-sora 2021-05-27T21:38:27.174100Z

ide of the future: coloring book

borkdude 2021-05-27T21:39:05.174300Z

pff

2021-05-27T21:40:27.176100Z

Yeah @sova @clojurians-slack100 the rainbow indentation is cool but I think would work better if it were a translucent background color for the text instead of replacing syntax highlighting

2021-05-27T21:41:01.177Z

Sove re coloring book you’ve got to watch the Fructure video it’s so cool

phronmophobic 2021-05-27T21:55:12.177200Z

It's not too hard to get a basic insta-repl setup. The biggest missing pieces I've found are: 1. pretty printing results in within bounded screen space and bounded time 2. being able to pause/stop run away executions (eg. (last (range))) Would love to know if anyone has good solutions for 1 or 2.

sova-soars-the-sora 2021-05-27T22:54:46.177700Z

Runaway calculations would be a big thing to address correctly. That's a really great question. How can we terminate a function that's maybe never going to halt ? Maybe add an escape clause to every function via macro that waits on a keypress combo or something? Naive idea

sova-soars-the-sora 2021-05-27T22:55:17.177900Z

Damn it would be great to see the errors as something other than EOF BRO while you're typing

sova-soars-the-sora 2021-05-27T22:55:34.178100Z

like "java.lang.hay not valid but keep going i guess

phronmophobic 2021-05-27T22:55:54.178300Z

the EOF thing would be less of an issue if I was using paredit

sova-soars-the-sora 2021-05-27T22:56:21.178800Z

If the JVM were a human being, what would be some of their favorite pastimes?

sova-soars-the-sora 2021-05-27T22:57:51.179100Z

yes that is true -- my comment about seeing errors as more friendly "waiting" lines still pertains to any incomplete code ... did you make that little demo ?

sova-soars-the-sora 2021-05-27T22:59:10.179300Z

That's one reason I really enjoy LightTable... inline evaluation of expressions. I think someone will soon nail it with the canvas'd clojure development experience

phronmophobic 2021-05-27T22:59:12.179500Z

there's a couple of options that I think might be able to address run away calculations: • run everything in a separate process. you can always kill a process • write an interpreter that allows you to preemptively pause execution • modify an existing interpreter (eg. sci) to preemptively pause execution • use cljs and use a js interpreter that allows you to preemptively pause execution

sova-soars-the-sora 2021-05-27T22:59:48.179800Z

dig it. process per function might be a lot but also maybe all good

phronmophobic 2021-05-27T23:00:12.180Z

you could reuse processes that don't need to be terminated.

sova-soars-the-sora 2021-05-27T23:00:26.180200Z

Fair point. That way you are only hot-loading what is novel.

sova-soars-the-sora 2021-05-27T23:00:41.180400Z

Good idea.

alexmiller 2021-05-27T23:11:54.181200Z

collecting garbage?

3
Ben Sless 2021-05-30T09:47:04.217200Z

So all the good people who volunteer to clean up public parks on weekends are actually running java? :thinking_face:

alexmiller 2021-05-27T23:12:07.181400Z

found object art?

2021-05-27T23:14:38.181500Z

Putting things together just in time?

2021-05-27T23:42:46.181800Z

being very vague when it comes to telling you what's wrong?