Fork me on GitHub
#calva
<
2022-01-05
>
leifericf14:01:58

Calva consists of ~64% TypeScript. @pez mentioned in https://www.youtube.com/watch?v=NIk5hVzA_fY that some of that could probably be rewritten to ClojureScript. I’m just curious whether someone knows how much of that TypeScript could potentially be rewritten to ClojureScript, and what would be the benefits (if any) of doing so? If someone has put any thought into that subject.

pez14:01:16

There has been put a lot of effort on this. I can’t count the hours and liters of blood and sweat I have exerted on this battle field. And not just me. Some time ago, @U9A1RLFNV decided to pick my gear up from where I had fallen. We did get some more ClojureScript in there then, but still we can’t really call that effort a success either, right, Brandon?

👍 1
pez14:01:50

Sorry, I am not answering your question. Just reacting and displaying my frustration. 😃

pez14:01:54

I have sort of accepted the defeat and decided I am content with most of Calva being TypeScript, and mainly use ClojureScript for reaching into the Clojure ecosystem. Also, I actually like TypeScript. I feel very productive when using it, even if it is far from the joy that I get from Clojure.

👍 1
pez14:01:21

The main problems we have had with this lately have been in small glitches in how different build and linking tools behave. Things seem to work until all of a sudden they don’t. Drives me nuts!

1
pez14:01:22

But the current strategy with having mostly pure functions in a library on the ClojureScript side works nicely. I think we should identify more code that can go there. The main benefit is that code we can modify Calva as it runs. The way it should be.

👍 1
bringe16:01:59

Yeah, I spent a decent amount of time on this in the past, and kept running into issues. Using the cljs from the ts is not really problematic, most of the time, but using the existing js from the cljs I believe gave me trouble, as well as sometimes even using the cljs from the ts. We’d have weird issues in that using parts of the compiled cljs from ts would throw some “not found” or “undefined” error during runtime, but only when using from certain files or in certain places in certain files. It was really odd, and anyway, overall, I spent many hours trying to figure out how we can write more of Calva in cljs incrementally. Eventually I let it go, as I’d spent so much time on it, and I decided go back to spending my time working on Calva features and fixes in the way we had been doing (mostly ts). One thing that did come out of all that was using cljs for state in Calva. I have to admit though, I’m still unsure if that will give us issues eventually. Like I said, for some strange reason, the same compiled cljs would seem to be unreachable only from certain parts of the code and not others. I remember discussing some of that effort with (or asking help from) Thomas Heller (shadow-cljs maintainer) and Maurício Szabo (Clover maintainer - another VS Code extension from Clojure, written in cljs).

bringe16:01:09

I think for more or all of Calva to be written in cljs, it would be best if it were ported entirely to cljs. Whole rewrites are maybe a subject of debate, and I’m not saying that should be done. Calva is a pretty large code base. Maybe another extension could be started in cljs and Calva features could be ported incrementally. I’ve given some thought about how something like that could work while Calva continues to be maintained, and could discuss further, but I need to work now. 😄

pez17:01:48

I think rewriting, in whatever way, sounds like a massive waste of time that can be used to serve Calva users. 😃 At least for the purpose of reaching ClojureScript nirvana. We might see a need for other reasons (looking at you, failed Paredit PR).

leifericf19:01:25

Thanks for taking the time to respond to this, @U9A1RLFNV and @pez! At some point, when I’m capable of contributing to a Clojure project, I will seriously consider Calva. That’s my reason for asking. I don’t think a total rewrite is a good idea for https://www.joelonsoftware.com/2000/04/06/things-you-should-never-do-part-i/. And if the TypeScript does not impose any significant limitations (or if ClojureScript doesn’t offer any significant benefits), then it’s probably better to leave it as is, and focus all efforts on functional improvements. Right now, I believe Calva is the single most important initiative when it comes to gaining wider adoption for Clojure, and making the beginner experience more pleasant. Tooling is incredibly important. And then we, the Clojure community, must focus more effort on creating “killer apps,” libraries and frameworks (I know, I’m swearing in church here…) to attract more people. Because more attention leads to more users, which leads to more effort and monetary investments, which leads to more users… etc. And we need to get “out there” to other communities (like the Java community) to demonstrate why they ought to check out Clojure for their own sanity.

leifericf19:01:08

By the way, I notice that Calva’s GitHub repo and documentation is exceptionally well managed, compared to other open source projects. The issues are categorized well, and there seems to be good, consistent activity/momentum. Those things are so important, and often neglected on open source projects. So great job on that as well, @pez, @U9A1RLFNV & Co.!

❤️ 1
bringe19:01:08

> I think rewriting, in whatever way, sounds like a massive waste of time that can be used to serve Calva users. 😃 At least for the purpose of reaching ClojureScript nirvana. From the perspective of serving Calva users, I mostly agree there, especially with that last sentence. If this were ever to happen, I believe: 1. It probably would be undertaken by someone who does it because they’re interested in it, and who doesn’t mind spending time away from Calva for it, if they were already spending time on Calva. 2. It should be done in a way that improves the current code base and not just for the purpose of using ClojureScript alone.

👍 1
bringe19:01:24

Thanks for that blog post link, @leif.eric.fredheim. I might have read it before, but it probably deserves a re-read.

👍 1
leifericf19:01:51

Good ol’ Joel on Software! I read his blog and books for years, and dreamt about working for Fog Creek (now Glitch) in NYC. His company is famous for creating the best working environment for knowledge workers, and they created Stack Overflow. Joel also introduced me to the books of Fred Brooks, Andy Hunt and Dave Thomas, Timothy Lister, etc. Which all had a profound impact on my way of thinking about software development as a young and naive game developer. I was so close to applying for a job there, when my wife and I decided to leave Montréal, Canada. Japan was also an option (my wife is Japanese), but we wound up in Norway (my home country) instead. Anyways… I digress (please forgive my ADHD, haha) 😅

bringe20:01:38

Ha! I’ve read Mythical Man Month (Brooks), but I’m not sure I’ve read books by the others. If you have any recommendations, feel free to share.

leifericf21:01:10

I do! Too many recommendations 😅 I’ll limit it to three for now: Check out https://pragprog.com/titles/tpp20/the-pragmatic-programmer-20th-anniversary-edition/ and https://www.amazon.com/Peopleware-Productive-Projects-Tom-DeMarco-ebook/dp/B00DY5A8X2/. And if you’re ever in the position to hire technical people, check out https://www.amazon.com/Smart-Gets-Things-Done-Technical/dp/1590598385/. You can find my bookshelves, ratings and reviews on https://www.goodreads.com/user/show/6935012-leif-eric.

bringe04:01:34

I actually have read The Pragmatic Programmer. Thanks for the other recommendations!

👍 1
leifericf10:01:07

The Pragmatic Programmer is a classic! A few of the chapters are perhaps a bit dated, but much of it is timeless and generally good advice. It’s still one of my go-to gifts for teammates’ birthdays, or as a parting gift when someone decided to leave the company, etc. I will write a personal message on the inside of the cover. I’ve probably bought 10+ copies 😅

metal 1
pez10:01:15

There is one book I return to almost daily for guidance. Getting Real: https://basecamp.com/gettingreal It has formed large parts of my philosophy around product development.

👍 1
leifericf13:01:19

Thanks for the tip, I’ll check it out!

Lukas Domagala18:01:57

super interesting discussion. Is there anything left of the broken code? For some reason I always have a masochistic drive to dive deep into weirdly behaving code. As another perspective: I’ve wanted to contribute to Calva for some time but was always stoped by Typescript. Now I finally looked a bit at the source and will hopefully start playing with it today. But I’m sure there are other people that would want to contribute but would rather write clojure in their spare time.

👍 1
bringe03:01:21

I want to read Getting Real as well!

bringe03:01:24

@U02EMBDU2JU I started a discussion that links relevant issues and PRs from my past battles with this. https://github.com/BetterThanTomorrow/calva/discussions/1455

👍 2
leifericf08:01:19

Thanks, @U9A1RLFNV! I should have created this topic discussion/thread on GitHub to begin with, but I was not aware of the “Discussions” tab in GitHub until now. Good to know! I will copy/paste the most relevant parts of the above discussion into that discussion you started, so that we have all the info in one place.

pez17:01:45

Some days ago @leif.eric.fredheim asked about how to setup a Quil project for a nice REPL workflow in Calva. While trying to help with this I also wrote an article about it.

💜 1
🎨 2
leifericf18:01:54

Thank you so much for the help and advice, @pez! I probably could have figured it out eventually, but your help saved me a lot of headache and frustration. Instead, setting this up became fun and interesting! And I learned a lot of additional stuff along the way, about Java version management, Z shell profiling, new Calva commands for staring a REPL, creating GIFs for demonstration, different Processing renderers, etc. And we even helped with some Quil GitHub issues along the way. Very cool! Not to mention getting to know you a little better, and the other people who joined in on the thread. You’re most certainly a Clojure community MVP!

❤️ 1
pez20:01:42

It’s definitely rewarding to investigate problems like this!

👍 1
Tero Matinlassi13:01:02

Love ”FDD”. Reminds me of ”there are no mistakes, only happy little accidents” (Bob Ross style) 🙂

😂 1
leifericf15:01:57

@pez: I will delete all my Gitpod workspaces and try again fresh, just to make sure I didn’t mess something up earlier.

leifericf15:01:38

Ah, yes. More stuff is there now, in a fresh worksplace 🙂 Looks like this.

leifericf16:01:44

It works well now! It was a bit tricky to find the “cogwheel” and scaling option, but I found it eventually ☺️ Feel free to use that GIF in your blog post or elsewhere if it makes sense.