emacs

vemv 2025-01-31T20:31:44.933439Z

After a couple months usage of the very impressive Cursor IDE, I switched to Cline in search of greater thoughtfulness and transparency. It's not as flashy in terms of UX. Sometimes I miss the Cursor affordances, but in my mind the good news is that Cline being minimalistic, open-source and https://www.anthropic.com/news/model-context-protocol-based, could be relatively easily 'distilled' to Emacs. I reckon that in a close future, Emacs will be on par with this new generation of IDEs. One killer feature could be repurposing the Magit interface for approving/discarding chunks of ai suggestions - Cursor and Cline show diffs, but they're not as good. And finally, I reckon that if I really wanted to stay within Emacs today, one could use MCP over the terminal and review the results from Emacs. https://github.com/nick1udwig/kibitz is one such project Thoughts / who else is playing with this stuff?

solf 2025-02-01T11:21:23.574779Z

Behold! My emacs-cursor integration!

(defun my-open-current-file-in-cursor ()
  "Open file on CURSOR."
  (interactive)
  (save-window-excursion
    (async-shell-command
     (format "%s --goto %S:%d"
             "/usr/local/bin/cursor"
             buffer-file-name
             (+ (if (bolp) 1 0) (count-lines 1 (point)))))))
When I was trying Cursor, I ended up using it just as a fancy llm chat that had access to my codebase, while reviewing the changes it made from emacs+magit.

1
bozhidar 2025-02-01T15:13:59.580139Z

I don't even know what what Cursor and Cline are. πŸ˜„ I guess I'm not a power AI-powered developer yet. πŸ˜…

bozhidar 2025-02-01T15:15:02.498749Z

But I'm pretty conservative with my dev tools these days and only recently I've started to use LSP more extensively (for Ruby and JS), and probably 5 years down the road I'll get to the fancy AI tech as well. πŸ˜„

bozhidar 2025-02-01T15:17:11.648499Z

I've noticed more "AI" IDEs are just VS Code with some "AI agent", so I'm guessing that's what Cursor and Cline are, right?

solf 2025-02-01T15:21:42.909409Z

Cursor yes it's a fork of vscode. I'm not sure for Cline, I think it's a classic vscode extension. There's another approach, which is what I end up doing usually: Just copy/paste what you want in an LLM chat (like openai, claude, deekseek, local model...). 0 integration with your editor, you copy back what you want when/if you reach the result you were looking for. Honestly at the moment things change so fast that one day you're using Cursor, the next day a new model arrives that is better than what your IDE offers. The only integration that is 100% model agnostic is not having any πŸ˜… I /have/ wrote a few elisp functions to semi-automatically gather the context I want from emacs, and then I just have to copy/paste it anywhere, but that's optional

πŸ‘ 2
πŸ‘πŸ» 1
bozhidar 2025-02-01T16:05:51.784529Z

Sounds like a reasonable approach.

vemv 2025-02-01T16:30:52.315869Z

> thats just assisted TDD and the issue with TDD is that it requires your test actually be worth a damn, which historically is harder then writing code thats "good enough" At least for my work career, tests have always been worth a fair share of 'damns'. I'd say that if used non-mindlessly, it's a sharp tool for reasoning. I ack though that a good portion Clojurists tend to healthily question them. Steve Yegge hints the importance of tests in these articles https://sourcegraph.com/blog/the-death-of-the-junior-developer https://steve-yegge.medium.com/the-death-of-the-stubborn-developer-b5e8f78d326b - because code/tests kind of become an implementation detail, having meaningful tests and a quick/effective TDD feedback loop become essential for reasoning. (As an aside, it's funny how Yegge has influenced the community for so many years - I watched this back then https://www.youtube.com/watch?v=tz-Bb-D6teE which directly influenced how I contributed to Clojure tooling)

vemv 2025-02-01T16:32:51.015899Z

When I was trying Cursor, I ended up using it just as a fancy llm chat that had access to my codebase, while reviewing the changes it made from emacs+magit.Yeah I started like this, but with Cursor you can see the changes without saving them. That's convenient in a few ways. So I'd wish I could have the magit UI over a 'virtual' (non-persisted to disk) changeset.

vemv 2025-02-01T16:35:24.383839Z

> I /have/ wrote a few elisp functions to semi-automatically gather the context I want from emacs, and then I just have to copy/paste it anywhere, but that's optional Good call, yes I was thinking of this lately. With Cursor/Cline/etc you'll have to blindly trust an algorithm to gather context, or painstakingly aid it by clicking around, or @ mentioning files. We (E)lispers tend to know better emacs-spin

Drew Verlee 2025-02-01T16:52:58.396999Z

I'm not saying testing isn't useful, im saying it's not useful by nature, it's useful by nurture: though careful focused and thoughtful application towards a specific goal. I use Ai to help discover what i want, not hear what it wants, and in that respect it's only marginal better than Google search because it introduces a lot of bs* without the decency to include the counter arguments like you would get on stack over flow. To be clear though, marginal better than Google search is a huge achievement. I just treat it as such, a search tool, which means i don't understand having it alter the code base directly. *Phillip walder argued that bs was a better word than "hallucinations".

Drew Verlee 2025-02-01T17:26:18.034279Z

put another way, i'm still learning how to use it, and i can't seem to find a better way then the chat-gpt browser app, and usually not for getting the exact code i need, its for like, idk getting in the same ballpark.

vemv 2025-02-01T17:27:39.215539Z

At work I can get a full rest endpoint with non-contrived types, and good coverage done instantly. It compiles and tests pass on the first try - maybe I'll tweak something and it's ready to go. That's the state of the art - low hallucination rate, project-specific context, high accuracy and overall usefuless. Very different from just asking a question over web chatgpt 2 years ago. I can't help thinking devs/teams/cos that don't adapt to this paradigm will simply be outcompeted by those who do - the difference in output is too big. To me, the good news is that the practices that make 'clean code' (tests, types, linters, modularity) are the same that help AI be productive. So in the future, developers will be closer to what today we call an architect, reviewer, lead dev, etc.

solf 2025-02-01T17:53:54.920039Z

That's similar to my experience. Sometimes it just saves me an hour out of the blue, and how often it does increases over time

Drew Verlee 2025-02-01T18:00:02.459369Z

The thing is, i would have to ride along with you nearly from start to finish to judge how much value the AI would have brought to me in that same situation. I watched the recent https://www.youtube.com/watch?v=uj2wGDeOimU (and i need to rewatch it) but near the end there is this interaction where the presenter asks the ai this: "can you make them (the categories) square" It fails to do that, for context, see this picture below where "the categories" are the rectangles in a column in the blue box under the word categories. If that categories grid was defined as a css Grid then each box could be called a cell, and the way you would express the change would be to modify each CSS Grid Cell in the CSS Grid such that each html attribute height and Width properties are the same. But guess whats faster then typing that? Doing that. And instead of doing that the AI removes the rounded edges of each cell, because thats a perfectly valid answer to the question. In the next request, they refine their question to be "make the height and width the same" and it does it (technically it does a lot more) and everyone is rightfully excited, i'm not being facetious, it's a big achievement to be able to communicate in English and get precise changes. But it also means anyone trying to change HTML through AI is going to not learn HTML and eventually they are going to have a very hard time expressing a very complex highly specific change in the HTML because the specifics of that change are all in the details of the question itself, and they don't have experience with that structure. To, me, that sounds like making the easy things easier and hard things harder. That is the opposite of a good long term investment for me. I know there is a middle ground here, but i think its going to take me years to find it, and i can't imagine throwing away all the connections i have with existing tools like emacs just to get there. N*ow* if I read the explanation the AI gives on how to square the categories, it starts to explain how it made everything "squared" e.g added "text center". If you ask the AI to do something, then read the instructions, then try again, then manually do it yourself, I think there is a happy middle ground, but thats very similar to my current none ai work flow, search using english, see examples, read the more precise docs, understand, practice, repeat until i gain confidence my code matches my desire. Put another way, I think your right, teams using AI will replace teams that don't, they will edge them out at the start of the race for sure. But the sad truth is, I don't think either is going to make it to the finish line. So I think the only people who are going to survive are those who move in ways that no AI would recommend in the first place, or at least on the first prompt. To emphasize that, the "categories" cell columns that were squared are part of a Korean language learning app. The reality is that the best way to learn korean is to visit Korea, not stare at a computer screen. There is a middle ground where a person can find their way, I don't know what it is though. Thanks for coming to my ted talk πŸ˜† I'll see myself.

πŸ‘ 1
vemv 2025-02-01T18:50:28.904299Z

Yeah, those are good misc points. For the small stuff, often Cursor offers edits without any prompt involved - which is as effortless as one can get. That thing reads my mind after I start doing something. For more complex problems, with MCP you can tell it to "make tests pass" or "make the rendered page on localhost look like this" (text-centered, or square-edged, etc). This is still a moving space, but having it seen work like that a few times, it's not hard to imagine what the next steps will look like. > The thing is, i would have to ride along with you nearly from start to finish to judge how much value the AI would have brought to me in that same situation. I'd recommend to anyone interested to play with Cursor with a toy project. Admittedly not all languages work the same - most likely typed, popular and slightly 'dumb' ones are best for machine suggestions. e.g. Typescript, Golang.

πŸ™ 1
Drew Verlee 2025-02-04T18:11:43.498979Z

Thanks for the detailed reply bbss. You gave me a lot to think about!

2025-02-04T18:39:11.560159Z

Sure! We live in interesting times.. Still digesting myself how to use LLM’s to their full potential. It’s certainly got pitfalls, also with over-reliance and not learning the hard-but-important parts. You see that being a real problem with youngsters no longer learning how to write their own reports anymore. I don’t want that to happen to me wrt learning important programming concepts as I think skipping that struggle to attain essential cognitive functions is dangerous. But not every skill is essential to fully master and sometimes the goal is more important than (part of) the journey

hkjels 2025-02-03T07:37:20.609529Z

I haven't tried gptel yet myself, but it uses diff's for code-changes. It is also agnostic to what LLM you choose, so I assume it is on par with other IDE's in this arena. https://github.com/karthink/gptel

anselm 2025-02-03T11:48:56.781939Z

Iβ€˜m the author of https://github.com/AnselmC/le-gpt.el It allows you to have multiple chats with various llms, completes or transforms code and allows you to give files form your project as context.

Ovi Stoica 2025-02-03T15:43:52.271279Z

@bbss they are talking about your project here. You seriously need to open source it

πŸ‘ 1
2025-02-03T16:42:09.479429Z

> It fails to do that, for context, see this picture below where "the categories" are the rectangles in a column in the blue box under the word categories. @drewverlee Note that the css hot reload was not working as I said during the presentation, this was not exactly a well prepared demo, it can do much more. The value prop of LLM's to me is not just that they can make the easy things easier. You mention the DSL of CSS grid, I don't know how much you worked with it (css), but I think it's actually a great counterexample to what you're saying. CSS has so many peculiar behaviors and different ways to do the same thing that really only people that full-time html+css will know well, and this is exactly where I -already- expect to see an LLM shine (and that is in fact imo the case). > To emphasize that, the "categories" cell columns that were squared are part of a Korean language learning app. The reality is that the best way to learn korean is to visit Korea, not stare at a computer screen. There is a middle ground where a person can find their way, I don't know what it is though. Ouch, right in the feels, I lived in Korea for 8 years, but worked from home staring at a screen, there are indeed better ways to learn Korean crying-laughing-joy-blood > I know there is a middle ground here, but i think its going to take me years to find it, and i can't imagine throwing away all the connections i have with existing tools like emacs just to get there. Yeah, I don't disagree, I have a self-soldered split bluetooth mech keyboard and love flying around namespaces, evalling stuff with cider myself. And am thoroughly ignoring Rich Hickeys "sic. keyboard is not an instrument, the thinking is what drives the progress". But here's the thing: if I can outsource some of the thinking to a smart machine that writes code faster than I could ever, and it also shows me the result immediately, then that is something that speeds up things tremendously. I agree that as problems you pose to an LLM get larger that the utility becomes less and less, but people judge the tech too harshly without having seen the type of problems it can solve if you give it the proper tools. That's a mistake, and the knee jerk reaction that many give is to me indicative of feeling threatened. Now I am just investigating whether we really should feel threatened or not, and my conclusion so far is... inconclusive! At the very least it gives productivity gains when you don't expect too much from it, and it's easy to get invested in solving issues with it and you basically end up spending more time coaching it than it would have cost you to work through the problem yourself. But I think that in future these things will only get better, things move fast.

πŸ‘ 1
Drew Verlee 2025-02-03T17:17:47.888069Z

Thanks @bbss, All my chatter on this subject can really be reduced to an earnest request for help: Please release a raw demo where you try to solve a real production problem using your favorite AI tool. Not a hypothetical problem, not one that was practiced before hand. An honest to god: I just opened jira and here is the ticket, lets do this video. Because I use chatgpt on the daily to help solve production problems and it's just different from google search, maybe a bit better, sometimes worse. Being on the same page as a tool like Google Search and often better, is a huge deal. But it's not earth shattering progress, its incremental progress to me. As an example, for me, forming the request to the LLM to "make the height and width the same" was harder then actually inspecting the code in chrome and changing the value imo, it requires far more processing on my end to form the English description then it does to toggle the values in chrome and see the results. Also keep in mind that the LLM inferred a lot of things there e.g "that you wanted the text centered" and I strongly feel like you didn't really question if that was the right thing because the effort to undo it would have further revealed that asking the right question is nearly as hard as arriving at the answer. Concerning: > "sic. keyboard is not an instrument, the thinking is what drives the progress" While Rich has achieved far more in CS then I can ever hope to, i also disagree with his sentiment here. The keyboard is primary of means of discover in our industry and it's discovery fueled by thinking, that drives innovation and progress. I think he has done enough discovery in his life, and has enough people who can help him discover through other means, that likely he is conflating the keyboard as a means of self expression and as a means of discover. > That's a mistake, and the knee jerk reaction that many give is to me indicative of feeling threatened. I'm not threatened by the notion that it's an improvement over Google Search in a small way complimentary way, i'm threatened by the notion that people with real power will over react and instead of slowing adopting a useful technology that their learning, will throw away even more useful ideas that they already know. Myself included. To be clear, i'm defiantly being a bit idk, 'emotional' in my tone here, hopefully it isn't taken as rude, it's more like, everytime i spend an hour watching a "how to use an ai to speed up work" video what I see is toy problems, and why I use it personally i'm like "oh, well, its like, a bit better here and there". It makes me feel like im missing something. Hell, i have the same feeling about Org mode, i get excited about it for like 2 days, and in the end i'm like, its cool, but honestly i can do the same thing in a clojure file by just writing comments. And given the code is slightly more useful and precise then the English, i prefer it being in closer reach then the english.

solf 2025-02-03T17:30:54.338209Z

Please release a raw demo where you try to solve a real production problem using your favorite AI toolMaybe this? By the author of redis https://www.youtube.com/watch?v=rCIZflYEpEk In this case he doesn't use any specific tool, just the llm chat from anthropic

2025-02-03T18:01:28.268659Z

I understand a somewhat sceptic stance, many clickbait headlines of very mediocre content have also left me somewhat bitter of most of other peoples efforts. But it's really a baby with the bathwater situation so be careful not to dismiss it. It's simultaneously true that LLM's make for an easy impressive demo, but turning that into a stable product is a whole different story. That's why I'm somewhat surprised by Mark Zuckerbergs "we'll have a mid level engineer automated this year" stance. Seeing as llama 3.3 70b is still miles off from claude sonnet. llama benchmarks okay but the benchmarks certainly do -not- show how far sonnet really is in the lead for agentic use-cases, nothing I've tried comes close. (that includes o3-mini-high) As for a demo, I'll ping you when I'm a little further along or do a proper demo on an online meeting, there certainly have been cases where I give claude a problem breakdown with just relevant code and namespaces, and the code needs to have case x y and z pass. Where it would be able to totally steer itself towards a usable solution using just a repl. How little context I need to type out to have that work is remarkable (although depending on the problem, certainly not always the case). A thing I'm currently exploring a lot is giving a task/role with potentially n-shot examples, and then turning that into an "expert" that can be tool called. Once I have a cool demo of that I'll show it off. I have already validated it works somewhat by making a "codebase analyst" that would do parallel tool calls to "codefile analysts". Where I pose a problem to the codebase analyst, and its role is so that it would form a big picture (i.e. ls -R the repo) and then ask fitting questions based on the filestructure/name to specific file analysts in parallel, and they then go off to answer that question by opening that file and replying. It's really awesome, but again, more of a flashy demo than something I actually use. Usually just having a couple of relevant files in context is enough to be productive. Recently I've found it incredibly helpful to just describe a problem and some file-pahts related and say "go find out what it could be" and then have it explore relevant namespaces with very nicely targeted finds and greps and a short but correct diagnosis of the problem. I've learned a lot from just describing problems and having it see run the shell commands that I didn't know exist that make sense for the problem at hand, i.e. specific packet intercepting commands for network issues, running gcloud commands for setting up a server, connecting to that server, running docker build commands, responding to errors during that build and succeeding with building it, publishing it, curling it with relevant request params to see if the service is up all by itself..

πŸ‘ 1
πŸ’― 1
πŸ‘€ 1
Akiz 2025-02-06T08:50:14.409409Z

Aider is very good alternative. Have you tried it? GPT-el with custom directives + prepared context can also get you very far. https://github.com/tninja/aider.el

Drew Verlee 2025-01-31T22:18:30.128439Z

I would love to see someone use something like Cursor or Cline on their production system. Because I struggle to get ChatGPT to produce code i can use when I spend significant time prompting it. As in, i don't use it to produce code as much as i use it conversationally to understand what code might be doing, and once I narrow in on that, I have to make the more mechanical business level decisions that it can't possible navigate. i'm curious how anyone is integrating it into there editor such that it would help to have it produce code in the clj/cljs file itself. Put another way, i often disable autocomplete because im tired of wrong answers poping up on my UI because its distracting. So the idea of having an "ai driven editor" feels like the opposite direction im going.

vemv 2025-01-31T23:25:20.791429Z

I haven't tried Clojure in particular in depth for this, but yeah I hear that it's not the same. Not only there's the mismatched parens problem, but also, in a way every practically every Clojure project is bespoke (and mostly untyped). But the state of the art is progressing month by month, it's an arms race, and these editors keep getting better at gathering whole-project context, specific-files context, rules defined in a dotfile. And forcing more reasoning over pre-trained knowledge barfing. I sense that the future is super exciting. More so with Deepseek - it can mean that if Clojure is not aligned with big tech's interests, we can just make our own flavor of ai.

vemv 2025-01-31T23:27:09.892179Z

--- Besides from ai being a fancy autocomplete, I envision a MCP<->nrepl bridge, so that you can tell it "this is the repl state you must achieve" and it converges towards it in a few tries, using eval.

πŸ”₯ 1
Drew Verlee 2025-01-31T23:55:23.279889Z

thats just assisted TDD and the issue with TDD is that it requires your test actually be worth a damn, which historically is harder then writing code thats "good enough"

Drew Verlee 2025-01-31T23:58:47.374629Z

Like I use AI to teach me general concepts, and to answer questions that might be unique to my circumstance, but in the end i have to always customize the code, because that needs to be precisely correct to the given circumstance.

Drew Verlee 2025-01-31T23:59:51.315649Z

i would love to see someone use LLM's directly on their production system though, maybe i would learn something.

Akiz 2025-02-14T04:35:11.789289Z

Now there is also https://github.com/MatthewZMD/aidermacs which is little bit more closer to Cursor than aider.el.

1