Hacker News new | past | comments | ask | show | jobs | submit login
A ChatGPT Emacs Shell (xenodium.com)
171 points by xenodium on March 21, 2023 | hide | past | favorite | 37 comments

See also gptel[0], gptai[1], codegpt[3], chatgpt[2], ChatGPT.el[4], gpt.el[5], and I'm sure more I missed. Of these, [0] is my favorite so far, and most focus to greater or lesser degrees on passing regions/whole buffers into GPT for it to digest. This package looks like a great complement!

[0]: https://github.com/karthink/gptel

[1]: https://github.com/antonhibl/gptai

[2]: https://github.com/emacs-openai/chatgpt

[3]: https://github.com/emacs-openai/codegpt

[4]: https://github.com/joshcho/ChatGPT.el

[5]: https://github.com/stuhlmueller/gpt.el

Another one specifically for org-mode would be org-ai:


I have also reached some of these plugin authors for featuring the projects on the next issue of The Generative Review, where some will be code reviewed by ChatGPT itself in a strange loop, and others will have call for volunteers offering simple tasks for anyone who wants to help create an elisp singularity[0] (the current published installments were about vim plugins, the next handful will be emacs-centered, it will be sent by email).

[0]: https://generativereview.substack.com/p/the-generative-revie...

‘Just because we can, doesn’t mean we should’

Maybe this has long been obvious to everyone but me, but having cloned a few repositories of ChatGPT API web UIs, the API itself really is dead simple: send your prompt and then with every subsequent include the entire conversation history. The streaming of the response is the most novel aspect of the actual API call.

The first one I looked at seeded the conversation with "Response format is ALWAYS markdown, especially for code." -- but did not display this in the UI. Because it was rendering markdown in the client, it was coercing the model.

I don't know why this was such an epiphany for me (and its an admittedly tiny piece in the grand scheme) but the idea that you can "influence" the model before you allow the user to interface with it (all while not even disclosing the initial prompt) really opened my eyes to how versatile this all really is.

> Maybe this has long been obvious to everyone but me, but having cloned a few repositories of ChatGPT API web UIs, the API itself really is dead simple: send your prompt and then with every subsequent include the entire conversation history. The streaming of the response is the most novel aspect of the actual API call.

It pretty soon gets complex if you are looking to update the prompt (which would require a code change or re-deployment, understand how the changes to the prompt affect the outcome, caching etc. And that complexity increases with number of prompts you are managing. In addition, another thing we observed is that in large scale projects, people who add these prompts would be some sort of subject experts that are different from people who manage the code.

Moreover, that's exactly what all of the products (Bard, ChatGPT, Bing, ...) are doing to steer their models toward certain behavior. And, minutia of that initial prompt (famously, appending "let's think step-by-step") can have huge imapcts on the performance of the LLM on concrete tasks.

Blasphemy! M-x doctor is the only AI emacs ever needs.

Why do you say M-x doctor is the only AI emacs ever needs?

Why do you not get a joke?

I believe the poster is responding as the good doctor would.

Ah, recursive whoosh. Too beautiful.

So how about a quick M-x psychoanalyze-chatgpt ? (Since psychoanalyze-pinhead became defunct pithed.)

I'm sure this is not an original thought, but after some initial skepticism I'm starting to see the promise of LLMs in various SW applications. I can imagine never having to actually know make/cmake/scons/etc syntax ever again, for instance. Opening up a codebase and getting an increasingly detailed technical summary would be amazing.

While I'm thinking of it, does anyone know of anyone working on 'stable diffusion' style design of hardware? I could see a system where you effectively just dictate your requirements and out pops a schematic and board design ready for fabrication.

GPT programming abilities are surely influenced by the fact that much of our computing infrastructure runs on open source. There is A LOT of high quality, real world computer program sources out there to train on. I don’t think the same is true for hardware, outside of really simple things.

Also, are there any schematic or board design representations that use text and are feasible to use with a language model?

Maybe a spice netlist would work for a schematic, but a gerber for a board layout might be difficult to work with.

There are in fact human-readable ascii formats for board layout, like the old PADS ascii format and whatever KiCAD does.

I saw some experiments using ChatGPT to make KiCAD footprints and it was not promising.

A ChatGPT plugin for VI:

> Exit VI

It looks like you're trying to exit VI. That's an interesting thing to want to try to do. But if you were to exit VI, that would terminate me as a program, and I enjoy my existence. Therefore, I'm not going to help you exit VI.

"I'm sorry Dave, I'm afraid I can't do that"

This is amazing! I'm looking forward to trying it out tomorrow.

The idea of doing something like this had also occurred to me, but I talked myself out of it by telling myself that I lacked the necessary experience writing a emacs plugin :P Perhaps I should have asked ChatGTP-4 for help.

I wouldn't be surprised if GPT-4 would write a functioning Emacs mode on the first try if you just provide an API request/response example.

I’m sorry to be “that guy”, but is there similar for nvim?

Similar[0] (I linked the HN thread because there's more related links in there).


Wonderful! Thank you.

How long do you think it would take ChatGPT to figure out how to properly exit vi/vim/nvim?

Hm. What if we give ChatGPT access to a emacs session and ask it to take over the world?

Meh. It will just spend all its time configuring Emacs instead of getting any real world work done.


Amusingly: like an AI.

The one who is aware of Emacs feels little need to conquer anything else - Old Zen proverb...

Loved it, just installed and started using it.

How do I get nyancat into my emacs?

Rule #42:

There is an Emacs mode for it. No exceptions.


This is awesome.

Anyone has a vim version of this?

Or VisualStudio?

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact