Fork me on GitHub

Is clojure ever going to get a workspace environment? APL has had one for over 50 yrs. I thought it was humorous when I first read of people's excitement over REPLs. RH rightfully railed against databases which forget past values. But no one sees the irony of REPLs which forget everything you put into them just because you exit them at the end of your dev session?


@steveh2009 imho the best workflow is to send code from your editor, not to type directly in the REPL


@steveh2009 cider-history takes care of that


@steveh2009 a common thing in this workflow is a comment section at the end of the a file where you experiment


Previous lisps have been based on images, which sounds like a similar concept to what you’re describing. Unfortunately that’s probably not possible in the general case for Clojure because of Java


serializing arbitrary Java objects is not trivial


Some kind of replay-based approach might be more useful, but also won’t handle every case because the final state could have dependencies on the external environment that could change


Lisps that let you save image dumps (e.g. FASL files in SBCL) I suspect must have restrictions on the state it saves, e.g. no active open files or network connections. APL must have had the same thing, I guess?


I confess to being bewildered when trying out Squeak for the first time, even being an experienced programmer, because of my complete lack of familiarity with basic things that felt so alien -- e.g. how do I know what has changed in this environment since I started modifying it? Can I do a 'diff' between what I started with and what I have now? Can I dump all of the current code out to a file system to do that? I am not saying that there are no good answers to those questions -- I didn't spend enough time to find out. I for one get some comfort out of knowing that I can start a REPL and know that its state is starting fresh. Of course that is still an option with systems that let you save/restore images/dumps/workspace environments, I am sure -- I just have a hard time imagining wanting one, personally.


@steveh2009 I suspect the answer to your question is: only if someone wants one so much that they spend the time to implement it and release it. I doubt it is a priority for the core Clojure developers to implement this.


I suspect that for a lot of those early systems, this image-based approach was taking a weakness - these were severely resource-constrained systems and doing complete code compilation and environment bootstrap was much slower than loading up a memory image - and turning it into a strength by building workflows around images. Is this still justified today, when the resource constraints have largely evaporated and the balance of tradeoffs has moved towards emphasizing consistency and repeatability? Personally I’m doubtful.


One can imagine a VM dump image as a generalization of this idea, which works for arbitrary languages and programs (with similar caveats on interactions with software external to the VM).


I love the concept, but the tradeoffs are pretty harsh.


whats the problem a workplace space environment solves? sorry, better question, whats a workplace environment? If were talking about losing state, then thats what we usually write tests for, to encode some expected behavior. I typically do all m work in my repl in my editor then pull things into tests only when it becomes clear i have some interface which is public facing and/or complex enough to warrant it. I personally only rarely use a command line repl as i’m willing to lose the 8 seconds it takes to get emacs with cider running and just keep that open.


@drewverlee With APL (and several other languages that have a workspace), you can basically just pick up a piece of work exactly where you left off. I did some APL decades ago. You'd do a bunch of work on a problem, save the workspace, and could come back to it later, in the exact same state, even if you'd done work on other problems (in other workspaces) since then.


Part of the it is because, with APL at least, you'd tend to have complex, ongoing (and non-overlapping) projects that you'd be working on. We used it at an insurance company and you'd have a separate workspace for each project you worked on and you could jump back and forth between them, always picking up exactly where you left off.


Without the workspace, you'd need some way to save and restore all your history/state external to the language, if you needed that workflow.


I think that when you're working on developing, say, a web application and it keeps persistent state in a database, it doesn't match the workspace approach. In particular, in DEV/CI, you want to be able to start with a fresh state and build up context as needed for tests in order to eliminate the artifacts of history.


"Notebook" software like Jupyter and Gorilla REPL can achieve some of the desired effects of a workspace like this, but I believe that they start up fresh processes each time you open such a notebook, and re-evaluate code from scratch each time, but they can automate getting back to a particular calculated set of data recalculated for you.

👍 12

gorilla repl + the new tools-deps stuff could be very interesting


there's if-let. i think i would like a let-ifthat would take the if branch if all the bindings succeed rather than if the thing they are binding from is truthy


ie, (let [{:keys [not gonna bind] {}]] :taken :not-taken)


should return :not-taken


you should try and write that macro


haha. bindings are quite complicated 🙂


just remarking. i know that its quite complicated. and would probably have to look at locals rather than just forms i suppose


Anyone have any thoughts on how to build a desktop GUI in 2018? I'm making a desktop app that will add helpers for a filesystem. for example, click a button to backup a directory to S3, bulk rename of files etc. Would need to show file previews as thumbnails. How would you do the GUI with clojure in this situation: 1) Swing via Seesaw 2) JavaFX (via fn-fx, or otherwise?) 3) Web frontend. I'm decently well versed in web front ends but the client-server communication stuff would add a ton of mental overhead. I have very little experience with Swing or JavaFx and would need to learn them. I'm having a hard time seeing either as a useful investment to learn.


@jjttjj I just recently had to create a file lister with some event listeners. Took me not even an hour with seesaw with barely any knowledge about it.


@jjttjj ClojureScript + electron is probably a safer bet


safe in terms of what?+


swing can be used since 20 years, seesaw still gets updates. It has ok documentation.


@jjttjj, I’m working on figuring out a way to make desktop GUI’s from clojure more workable, but I haven’t been completely happy with any of the options. I’ve tried qt jambi via java interop, node-webkit via clojurescript/nodejs (similar to electron), swing via seesaw, and running a local webserver where you open up a local webpage. clojurescript+electron and swing/seesaw seem like the most practical options currently. my latest attempt is using opengl via clojure-jna which I’ve been pretty happy with, but still needs work to be productive. not sure how much interest there is in having an option to build desktop apps that isn’t java swing or clojurescript/nodejs


@smith.adriane yeah I asked this question here after a few days of playing around with swing/fx/node. Not thrilled with any really but mostly leaning towards seesaw. Wanted to see what other people think. Personally I'd love to see a better GUI story for clojure, but unfortunately there doesn't seem to be much other demand for non web ui stuff these days

Philip Hale21:05:11

not sure if it's possible to interop with kotlin, but there's


I can’t put this into words well, its also possible i’m really off base. What i feel like i’m experiencing is that i have good ideas and input, but other members of the team keep telling me that i need to just follow instructions more. For example, we were working on a project and i questioned an aspect of it, i was told to not worry about it, later through conversation between and other members we decided to make a change in the direction i had suggested. Later, in a private conversation, i was told that I wasn’t productive on the project, because I had directed the teams energy towards this topic. I suggested that I thought it was time well spent, and that the change was a good one. But that seemed irrelevant to the other person, what was important (or so it seemed to me) was that I had spent time thinking about the larger issue, and not the task at hand. Which becomes a common criticism i receive, that i, “over think things”.


How did you phrase questioning an aspect of it?


What are the organizational dynamics at play here? Who was setting the original direction, telling you not to worry about it, criticizing you afterwards?


Those are some of the context pieces I'm thinking of


Your right the context matters. The organizational dynamics certainly do. > How did you phrase questioning an aspect of it? I feel like there must be a way for me to communicate better. I tend to try to ask a lot of questions tell i understand what the other person is talking about. Whats uncomfortable, what i can’t seem to understand, is when we arrive at some point of contention so simple and fundamental that I feel that they will surely see things the way i do, and yet they dont. Of course, this could mean i’m blind. You would need to make that decision for yourself i suppose 🙂


“when we arrive at some point of contention so simple and fundamental that I feel that they will surely see things the way i do” like what?


I think Clojure attracts the more cerebral types of people. And some dev shops will be more or less accommodating to the hammocking methods.


Speaking of cerebral. What's y'alls take on the teleology of software? 😉


I believe purpose exists in the universe (in the consciousness of people, at least), and software is one of the examples of things created by humans for many of those purposes. Or is there a more specific meaning of "teleology of software" that I'm probably not aware of 🙂


@drewverlee Just some thoughts on that. First anectodal experience. We once had a team member that discussed stuff to death, really. Some topics that he had fixed in his mind were discussed hours upon hours, even after direct order from our teamlead to just stop that. Sometimes he wasted man weeks on things like that. So, he was a bit extreme. Even if sometimes it turned out he was right, we were happy when he finally left, cause the discussions were truly exhausting. While it does not sound this is your case it might make the feelings obvious behind that. Second, if you think a decision that the team made is "wrong", that wrong needs to be argued with facts and ideally, numbers. If you can put the different directions into a direct cost comparison, pack that up into an e-mail and send it to the responsibles, this is all you can do.If people still decide against it, well then, so be it. Third, try to talk and listen. Try to understand why others are going into a different direction. People make mistakes, it may be their mistake, it may be yours. But if the team finally decides, again, so be it. Also try to connect with your team mates and their thoughts, even if its just so that they feel understood. Fourth, some company thing is going on, maybe one team member specifically does not like you and tries to trick you into something. I am just saying that there is a small possibility for that to happen. If this was the case for me I'd already start looking for a different job. This is stress that almost never is worth it.

👏 8

Thanks for replying! I’m certainly worried that that perception being applied to me. I think the context of my situation are hard to convey, details tend to matter a lot.


But there's similarity to the side effects of a program vs the primary, intended affects


I’m not too sure about your specific situation, but as someone who loves to over-think things, I can share some of things I’ve noticed. For most decisions, it’s more important to make a decision in a timely manner and get everyone on the same page than it is to make the optimal choice. It’s really only a few decisions that are extremely important to get exactly right. For someone leading a project, they have to make lots of decisions every day, all the time. So if there’s someone like me that often questions decisions, it can be mentally and emotionally exhausting, regardless of whether it produces a better outcome for that particular decision. It really depends on on the team and the manager. I’ve worked in some groups where everyone is on board with discussing every decision and providing context/reasoning for any and every decision. I’ve also been on teams where having to explain every decision is frustrating and stressful. Having lots of work to do on a tight schedule can make discussion more stressful. I’ve found that it’s fairly tricky to find the right balance depending on the team. Part of it is knowing which disagreements aren’t worth the effort and part of it is figuring out the best way to explore alternatives with a group. The best approach will be different for every group.

👍 8

Thanks for the insight.


I think software is essentially entropic and it takes extraordinary efforts to make it appear otherwise


It also seems like declarative programming is more teleological, talking about the desired end state rather than the means to get there


And it seems like Eric Normand is ruminating over these issues too. Talking about actions vs calculations.


>be aware that displaying arbitrary content from untrusted sources poses a severe security risk that Electron is not intended to handle.


Biologists are having to grapple with the question of how teleological behavior can derive, via some primordial soup and autopoiesis, from non teleological behavior. Terrance Deacon calls it "teleodynamics":


I'm not sure if there's any utility in that line of thought. It may just be a more general observation


Thats a lot for me to chew on. Its such a drastically different way of looking at things then i was expecting. A bit of what i currently know about human physiology is from the book “thinking fast and slow” Which helped me understand a lot about how we make decisions. I also have thought a lot about how people talk about the different genders interacting. I’m worried the lack of diversity is hurting us far more then we know as many of the traits i see lacking (in myself and others) are often associated with woman. Dr. Eugenia Cheng talks about this in a podcast


@drewverlee some (most?) people just cannot maintain a rational discussion, in fact they'll feel personally attacked by constructive criticism They make an active effort in interpreting your well-intentioned suggestions as a surreptitious attack. Why? Because they cannot conceive some people just want to improve things in their own free will My advice would be: (branch 1) - Practice politeness and empathy, particularly empathy with the stress inflicted on busy, non-proficient peers - Decomplect needs from urgency (few things really need to be discussed/fixed right now) - Learn to lose often, so you aren't perceived as stubborn (branch 2) - Be picky about who you associate yourself with - Be a CTO/lead/consultant - Don't be an 'unsolicited CTO' at work


I believe that most people can have a rational discussion. I think how you approach providing constructive criticism can make a huge difference. It’s easy enough to miscommunicate when explaining ideas to a computer, and computers are mostly rational and unemotional. People are much more complicated and the language we use when communicating between people is much fuzzier.


IME most people just aren't willing to be proven wrong, they don't embrace the framework of discussion of seeking truth together, assuming nothing. At most they can back beliefs with argumentation (that's pretty common, admittedly), or seek a practical compromise without actually admitting any kind of 'defeat'. Of course I haven't made a thorough study on the topic so in this case I can only transmit my personal perception.


getting someone to admit they were wrong is difficult, but getting someone to learn something new is usually quite attainable


i think framing can help a lot


Good one! That's literally constructive 🙂


it’s a bunch of things i’ve had to learn the hard way

👍 4

i’ve read a few books with cheesy titles, the most relevant one being “crucial conversations”. i think I found it via a book suggestion thread on hacker news

😂 4
👍 4

the basic premise of that book is that it’s common to believe you can either 1) say what you think and people will take it they way that take it or 2) you can keep your mouth shut, but the whole book is about the less common 3rd option


thanks Adrian, hope to borrow a trick for my next crucial conversation 🙂

🙂 4

Goofy as it is, using the E-Prime dialect can be helpful.


ill need to re-read crucial conversations. Its a fantastic book, i’m glad it was part of my internship. I feel like it gave me a lot of insight that is undervalued in the dev culture.


@U04V4HWQ4 i’m reading over the E-prime dialect now. This idea is interesting to me, though i feel like i try to do this already. It think it helps to have a simple rule like this.


what’s the E-prime dialect? I just read the wikipedia article, but I still don’t think I get it


@smith.adriane i was reading Im just glancing at right now. as im about to go to sleep. but i think the idea is to be more accurate in your conversations. I’m not explaining this well. The example i have heard, that makes sense to me, is this one: You don’t tell your child she is smart, she is did well on her test because she studied. Tell her that she is smart, and now its something she is, rather then focusing on the more concrete achievement. She will stop trying because one doesnt need to try to be what they are.


cool, I’ll check it out


@drewverlee and on the other hand, be open to the fact that the world is messy. I've worked on projects that were an absolute mess, but as a consultant I had limited ability to do anything about it. Sometimes the correct action is to just write the code you're asked to write, and give your opinion when asked. f


Point well taken. I would probably be happier if i could find a way to be more relaxed.


And it doesn't even have to be a messy situation, sometimes a somewhat-ugly solution that people will pay you money for, is better than a good solution that will take twice as long before getting to market.


@vemv Thanks for your reply. > - Decomplect needs from urgency (few things really need to be discussed/fixed right now) This is probably one area where i’m struggling. I believed i was capable of explaining myself in such a way as to make them understand my concerns, that or, i would learn why they thought the way they did. Sadly, i have found that, especially in large groups, thats almost impossible. I think ideas need more time and space.


Yeah it's hard to keep this area optimal. Sometimes it has helped me to identify and bond with my closest allies within a group. Having just one peer who can publicly say 'I agree' can be pretty huge for getting your voice heard


I agree. Part of me is very upset about the idea that my best strategy for getting “what i want” is to “make allies”. The whole idea seems to lead me down a mental state where i’m not longer interested in the larger problem, but rather, how i can position myself.

👍 4

Thats never completely how it works of course.


I think your branches really draw a line between two ways of interacting. 1: be a team player 2: be in charge I feel like software culture is dominated by the drive towards 2. Or at least, thats my perception.