https://old.reddit.com/r/emacs/comments/lly7po/do_you_use_emacs_lisp_as_a_general_purpose/ jump to content my subreddits edit subscriptions * popular * -all * -random * -users | * AskReddit * -news * -funny * -worldnews * -gaming * -mildlyinteresting * -pics * -todayilearned * -movies * -explainlikeimfive * -OldSchoolCool * -tifu * -videos * -nottheonion * -aww * -Jokes * -dataisbeautiful * -science * -TwoXChromosomes * -LifeProTips * -Showerthoughts * -IAmA * -askscience * -books * -Music * -space * -Art * -food * -Futurology * -gadgets * -DIY * -sports * -gifs * -nosleep * -history * -InternetIsBeautiful * -UpliftingNews * -WritingPrompts * -Documentaries * -philosophy * -photoshopbattles * -EarthPorn * -GetMotivated * -creepy * -announcements * -listentothis * -blog more >> emacs emacs * comments Want to join? Log in or sign up in seconds.| * English [ ][] [ ]limit my search to r/emacs use the following search parameters to narrow your results: subreddit:subreddit find submissions in "subreddit" author:username find submissions by "username" site:example.com find submissions from "example.com" url:text search for "text" in url selftext:text search for "text" in self post contents self:yes (or self:no) include (or exclude) self posts nsfw:yes (or nsfw:no) include (or exclude) results marked as NSFW e.g. subreddit:aww site:imgur.com dog see the search faq for details. advanced search: by author, subreddit... this post was submitted on 17 Feb 2021 100 points (98% upvoted) shortlink: [https://redd.it/lly7] [ ][ ] [ ]remember mereset password login ATF Submit a new link Submit a new text post Get an ad-free experience with special benefits, and directly support Reddit. get reddit premium emacs joinleave62,432 readers 445 users here now A sub-reddit for the timeless and infinitely powerful editor. Want to see what Emacs is capable of?! Get Emacs * Windows * Mac OS X * GNU/Linux and BSD (Just get it from your distribution's package manager) * Build it from source Rules 1. Posts should be emacs related 2. Be kind please 3. Yes, we already know: Google results for "emacs" and "vi" link to each other. We good. Emacs Resources * Emacs Wiki * WikEmacs * Emacs Reference (PDF) * Learning & Mastering Emacs * Weekly tips/tricks/etc threads Emacs Tutorials * Beginner's Guide to Emacs * Absolute Beginner's Guide to Emacs * How to Learn Emacs: A Hand-drawn One-pager for Beginners Related Subreddits * r/orgmode * r/evilmode * r/spacemacs * r/planetemacs * r/doomemacs Useful Emacs configuration files and distributions * Better Defaults Quick pain-saver tip * Put the Caps Lock key to better use! a community for 14 years BTF MODERATORS * message the mods * Moderator list hidden. Learn More discussions in r/emacs <> X 47 * 14 comments It's been a while since this exists. I just want to mention what a good idea it was and how useful that little link is. Thanks 6 * 1 comment Is it possible to configure Flycheck + Emacs + LSP to properly parse YAML files with go templates? 4 * 2 comments expand-region.el fine tuning 4 * 4 comments invoking a function from within avy 3 Function to auto schedule a bunch of tasks export org to pdf with multiple languages 22 * 2 comments [ANN] Gitstatus-el : fast and asynchronous Git status information for UI 2 * 1 comment ctrlf minibuffer gets stuck 11 * 1 comment Eglot manual 4 * 1 comment git-gutter sign - Doom Emacs Welcome to Reddit, the front page of the internet. Become a Redditor and join one of thousands of communities. x 99 100 101 QuestionDo you use Emacs Lisp as a general purpose programming language? (self.emacs) submitted 1 year ago * by homomorphic-padawan My journey with Emacs began with trying to learn Common Lisp. I first set up my Emacs development environment with SLIME and made myself familiar with some Emacs key sequences. A few months later I am still learning Emacs and I am beginning to love Emacs Lisp. Emacs Lisp looks like a powerful language on its own. I can execute Emacs Lisp code from command line as a script using emacs --script foo.lisp. I want to know if anyone here uses Emacs Lisp as a full blown general purpose programming language. [ Also x-posted to https://www.reddit.com/r/lisp/comments/lm03xe/ is_it_worth_learning_common_lisp_for_writing/ ] * 50 comments * share * save * hide * report all 50 comments sorted by: best topnewcontroversialoldrandomq&alive (beta) [ ] Want to add to the discussion? Post a comment! Create an account [-]cdegroot 35 points36 points37 points 1 year ago (20 children) I kid you not, in the '90s a piece of Germany's air traffic control software ran on Emacs. I guess the answer is yes, if you want it ;) * permalink * embed * save * report * give award * reply [-]clemera(with-emacs.com 7 points8 points9 points 1 year ago (19 children) Nice :D Do you have more details on that? * permalink * embed * save * parent * report * give award * reply [-]cdegroot 161 points162 points163 points 1 year ago[silver_48]3 [gold_48]2[platinum_4][klvxk1wggf][5izbv4fn0m][ks45ij6w05]2 [2juh333m40][nvfe4gyawn]& 5 more (18 children) Early '90s, after "Die Wende" and the unification of East and West Germany. I was the person that got sent to the tough jobs, or the ones that nobody else wanted, so I found myself one Monday morning checking in at a DASA plant (DASA was first German Aerospace, then Daimler Aerospace, and now a part of Airbus). The project was between DASA and HP as main contractors to replace both countries' ATC systems with a unified one. So we have two megacompanies and a government contract, and shops like my employer getting some juicy partial jobs. And there are actually two Emacs stories in here. First: that Monday morning, I check in with the developers that I'm supposed to help out. They are in a lab surrounded with wonderful stuff - the newest HP workstations on HP/UX, and a bunch of HP's top-of-the-range servers, fridge sized and close to 7 figures list price. The reason I got called in though: they couldn't work on the systems. They were VMS developers, pulled off a different project, and supposed to code up some part of the whole system (I forgot which one) in C on VMS (a truly gross idea, because C was not very well adapted to VMS, but that's a different thing). Anyway, they got their workstations, manuals, were told that vi was the editor, and have a nice day. Here we are: a dozen people struggling to type code in Vi. And it's not that they were stupid, but muscle memory for the VMS editor (TPU, IIRC, but this is a long time ago) does really not translate well to Vi. I went back home (was closer than the office), loaded all the GNU sources on a QIC tape, went back, and started a routine that was all too well known back in the day: compile the GNU toolchain on some vendor Unix in order to be able to compile the nice utilities, including Emacs. GCC took the longest, you need three or four build stages before you have a reliable compiler, but a day later I had Emacs on HP/UX. It was downhilll from there: I did VMS work, so I whipped up a little init.el that mapped to the VMS editor as closely as possible, and rolled it out to the workstations. A short briefing later and, well, they almost hugged me :). Some weeks later I got called to our second office, they were behind schedule and needed an extra pair of hands. We had - for reasons I don't know - ATC workstations on microVAXen running that 4GL on VMS but they struggled with getting messaging over the network going - the 4GL was terminal oriented, did not know what a network was, but ATC messages (like airplane hand-overs from airfield to airfield or to Eurocontrol) needed to go to the local message router and from there to the site the message was destined for. We're talking "no internet" here - all X.25 and leased lines and zero convenience. Well, I got to work and figured out that it was easier to make VMS talk TCP/IP than HP/UX talk DECnet, so I got that setup, and then picked the hot new tech, DCE, to do the messaging. I did C extentions for the 4GL a lot, so the VMS side was done in a couple of days. Then they told me to talk to Herr Doktor So-and-so who was responsible for the actual message router. In Germany, a Herr Doktor is always right (they have forgiven Moses by now for not having space on the stone tablets, but it really is the 11th Commandment). This one worked at Symbolics before so knew one programming language: Lisp. He wanted to code the message router in Lisp because of the "complex" (meh) requirements, but there was no Lisp (or no Lisp in budget) for HP/UX so he was stuck. I told him about Emacs, gave him my tape with the ports, and maybe that was a mistake ;-) A week later - I helped out finishing the 4GL UI in the meantime and completed the messaging protocol - he called me in, quite happy. He showed me the code - page after page of Emacs Lisp, with exactly zero comments "because Lisp is self-documenting". I got scared, it was an air traffic control system after all, but I was no Herr Doktor so I whipped up the DCE native code for Emacs, made a hack to have it start headless in message router server mode, and we got messages to flow. I did a code hand-over, and drove back home a couple of days later. The "self-documenting" code, as far as I know, landed in production so at least for a while, all ATC message routing in Germany was done through Emacs. Pro tip: don't look in the kitchen when governments brew up safety critical systems. I was scared to fly over Germany for a while... * permalink * embed * save * parent * report * give award * reply [-]clemera(with-emacs.com 14 points15 points16 points 1 year ago (6 children) Fascinating read, thank you for sharing it! You should write a blog post or post it top level on /r/emacs, others here will certainly enjoy it as well! * permalink * embed * save * parent * report * give award * reply [-]cdegroot 9 points10 points11 points 1 year ago (5 children) Glad you liked it. And yes, I maybe should flesh it out a bit and toss it on my blog. * permalink * embed * save * parent * report * give award * reply continue this thread [-]billccn 4 points5 points6 points 1 year ago (0 children) Should have used vi. At least we know the service won't quit :P * permalink * embed * save * parent * report * give award * reply [-]nomyrun 2 points3 points4 points 1 year ago (5 children) Pro tip: don't look in the kitchen when governments brew up safety critical systems. I was scared to fly over Germany for a while... Why not still? Just hoping against hope that by now they've moved onto 100% safe systems? :/ * permalink * embed * save * parent * report * give award * reply [-]njharman 6 points7 points8 points 1 year ago (3 children) emacs has probably had more high end devs and more dev hours using/ fixing/looking at its code than almost any other piece of software (linux kernel probably beats it). The thing about open source dev tools is; devs use them constantly and when they encounter a problem/bug/deficiency, they fix it. * permalink * embed * save * parent * report * give award * reply continue this thread [-]4and19Username 1 point2 points3 points 1 year ago (0 children) ..... there's such a thing? Safer? Quite probably. Safe? ...... * permalink * embed * save * parent * report * give award * reply [-]grs86 3 points4 points5 points 1 year ago (0 children) My.... god.... * permalink * embed * save * parent * report * give award * reply [-]oantolinC-x * q 100! RET 2 points3 points4 points 1 year ago (0 children) Great story! * permalink * embed * save * parent * report * give award * reply [-]TotesMessenger 0 points1 point2 points 1 year ago (0 children) I'm a bot, bleep, bloop. Someone has linked to this thread from another place on reddit: * [/r/de_edv] Die deutsche Flugverkehrskontrolle lief fur einige Zeit auf Emacs Lisp ^If you follow any of the above links, please respect the rules of reddit and don't vote in the other threads. ^(Info ^/ ^Contact) * permalink * embed * save * parent * report * give award * reply [-]kickass_turing 0 points1 point2 points 1 year ago (0 children) Wow. What a wild storry. Thank you for sharing. * permalink * embed * save * parent * report * give award * reply [-][deleted] 11 points12 points13 points 1 year ago (2 children) Even tho it's mostly for my init.el, for a long time now Elisp has been my main programming language. I don't really write a separate script for anything tho, because if I'm in Emacs, it's easier to just make an interactive command and run it with execute-extended-command. * permalink * embed * save * report * reply [-]Expensive_Pain 2 points3 points4 points 1 year ago (1 child) Exactly. I've made two large code projects in my life - both are Emacs packages. The question rings weird to me because at this point I'm not sure what other languages exist for or what "general purpose programming" is or why I'd want it. * permalink * embed * save * parent * report * give award * reply [-]QuesnayJr 4 points5 points6 points 1 year ago (0 children) To give you a reason to write another major mode, of course. * permalink * embed * save * parent * report * give award * reply [-]7890yuiop 8 points9 points10 points 1 year ago (0 children) Worthwhile reading material for doing this. * permalink * embed * save * report * give award * reply [-]wasamasa 9 points10 points11 points 1 year ago (0 children) I occasionally feel like doing something unreasonable in Emacs Lisp. Last time I felt like that, I made a CHIP-8 emulator. It was challenging and kept me busy for a few weeks, but eventually I made it work acceptably well. Emacs Lisp is ultimately unsuitable for many things you take for granted in other programming languages. I've been using it for years, yet I still keep running into the same stumbling blocks. The APIs just suck and the moment you reach out for some library to alleviate that pain, chances are it's not been invented yet. That's why I first wrote esxml-query.el before making nov.el, there was no suitable XML querying library before that point. Consider whether the task wouldn't be better solved in a different Lisp or whatever other language you're comfortable with. * permalink * embed * save * report * give award * reply [-]AloneExamination242 6 points7 points8 points 1 year ago (0 children) This seems like an interesting idea but one that would lead to a lot of pain when it came time to write serious software---elisp is pretty similar to CL, except that CL has a massive library ecosystem and optimized compilers to make the code run a lot faster than taking on the burden of running an entire emacs instance... * permalink * embed * save * report * give award * reply [-]clarete 6 points7 points8 points 1 year ago* (1 child) That's an interesting topic. I started using Emacs because of its keybindings and ended up staying because of Emacs Lisp; at first because it is indeed a great language for configuration -- as someone that have endured the pain of using JSON (too verbose) or YAML (error prone because of subtlety of syntax) extensively, I really wish someone came up with something more along the lines of Lisp to balance machine oriented formats with something that is also minimally pleasing for humans. But after you get the hang of it, you figure out that there's more potential there. I have been working on two projects that are what I'd have done in Python, or C. One is a templating language shipped as a library and the other one is a static HTML generator, also shipped as a library. They both have unit tests that run on a CI hooked up to GitHub actions, and I use a Makefile to compile `.el` to `.elc` and `emacs --script script.el` to run scripts that declare the static HTML website routes. The testing tooling is incredibly pleasing to use and just works! Also, I think contributions like the native-compilation branch make it even more appealing to use Emacs Lisp as a general purpose programming language. Can't wait to see what people will put Emacs through! :D * permalink * embed * save * report * give award * reply [-]r3dnaz 0 points1 point2 points 1 year ago (0 children) I really wish someone came up with something more along the lines of Lisp to balance machine oriented formats with something that is also minimally pleasing for humans https://dhall-lang.org * permalink * embed * save * parent * report * give award * reply [-]tromey 5 points6 points7 points 1 year ago (0 children) I write Emacs Lisp scripts for a subset of tasks, mostly some kinds of code rewriting. It's nice for this because the scripts can use the buffer abstraction, and symbols (the regexp extensions for symbol syntax are very handy), and stuff like sexp / list motion for navigating in the buffer. Also, at least in the code I work on, I can have my script reindent the modified region, or write a ChangeLog entry (I work on some projects that still use these), etc. elisp is nice, but it's missing some facilities if you really want to do this stuff. I haven't written a getopt, or stumbled over one (never looked). It is slow. Debugging errors from the command line sucks -- it was always bad but it got worse when the stack trace capability was removed. Elisp also has some weird stuff, which is sometimes a feature and sometimes not -- like it can go a bit faster if you turn off VC in your script. * permalink * embed * save * report * give award * reply [-]habershabery 11 points12 points13 points 1 year ago (3 children) As much as I love emacs, no. I happen to use: 1. sed/awk for trivial filtering 2. perl for slightly more advanced text mangling. 3. shell scripts (sh or bash) for general-purpose scripting. 4. python/ruby for advanced scripting 5. C++ for speed/general purpose programming. * permalink * embed * save * report * give award * reply [-]deaddyfreddyGNU Emacs 9 points10 points11 points 1 year ago (1 child) sounds like a person from the 90s * permalink * embed * save * parent * report * give award * reply [-]Expensive_Pain 1 point2 points3 points 1 year ago (0 children) Mean, but true. * permalink * embed * save * parent * report * give award * reply [-]mobiledevguy5554 2 points3 points4 points 1 year ago (0 children) That's a lot of stuff to keep in your head, every time I got to write bash or sed it's like starting over because who is going to remember that arcane syntax. I script in go mostly now. Same language . All in my head along with the entire API * permalink * embed * save * parent * report * give award * reply [-]b3n 4 points5 points6 points 1 year ago (0 children) I use eshell, so of course my shell scripts are Emacs Lisp. It works very well for small scripts like that. * permalink * embed * save * report * give award * reply [-]MotherCanada 2 points3 points4 points 1 year ago (0 children) As a replacement for bash scripts, yes I'm increasingly doing things in elisp as I get more comfortable with it. As a replacement for other general purpose languages, no. * permalink * embed * save * report * give award * reply [-]crazysponer 2 points3 points4 points 1 year ago (0 children) If you are considering using Emacs Lisp for stuff other than personal utilities (I.e., stuff you might ever share for other people to use), I think you should look at Racket. https://docs.racket-lang.org/quick /index.html You can run Racket programs in an interpreter (REPL) or compile it to an executable for Windows, macOS or Linux. It has a GUI library, stuff for web apps, database connectors, etc. * permalink * embed * save * report * give award * reply [-]deaddyfreddyGNU Emacs 2 points3 points4 points 1 year ago (2 children) Do you use Emacs Lisp as a general purpose programming language? There's no reason to, there are much better lisps. I prefer Clojure (Cljs, babashka) if I'm not limited by requirements. * permalink * embed * save * report * give award * reply [-]timlee126 0 points1 point2 points 1 year ago (1 child) much better in what sense? * permalink * embed * save * parent * report * give award * reply [-]deaddyfreddyGNU Emacs 1 point2 points3 points 1 year ago (0 children) simplicity, conciseness, expressiveness etc * permalink * embed * save * parent * report * give award * reply [-]SorryTheoryGNU Emacs 1 point2 points3 points 1 year ago (0 children) Yeah the way I see it is that although you certainly could, 1. you'd create a dependency on having Emacs installed, which seems somewhat unreasonable depending on what you're doing, and 2. I feel that Emacs Lisp is best suited for completing tasks in Emacs. Of course you can use Emacs itself for nearly anything, so in some sense it might as well be a general purpose programming language. * permalink * embed * save * report * give award * reply [-]ShakesTheClown23 1 point2 points3 points 1 year ago (0 children) No that's crazy. However on a few occasions I've done plenty of elisp programming for text file manipulation. * permalink * embed * save * report * give award * reply [-]ramin-honary-xc 1 point2 points3 points 1 year ago* (1 child) I would say no, Emacs is not "general purpose." I think whether a language is general purpose or not is a design decision made by the maintainers of the technology. The stated purpose of Emacs Lisp is for programming Emacs. So this effects the many engineering decisions that go into the implementation of the language in ways that would be different from the engineering decisions made when implementing a general purpose language. That said, there is nothing stopping you from using Emacs in a production system. You can use it in batch mode and work it into a larger system that needs text processing. If you are really bold, and you are programming a text-based UI for a point-of-sale system to be used by a million customers, and Emacs turns out to be the best solution to that problem, and the code you write can be easily updated by anyone maintains your code base, then why not? There have been times when I might have been working on a simple, highly customized, one-off piece of software for a customer who would be using it mostly through the command line, and they don't care how the program works, they just want to launch it and be done with it. I have considered basically bundling Emacs into a flatpak and configuring it to only run a script that I write that presents users with a form to fill out and then executes a larger piece of software (one that is programmed in another language). But I never do because everyone else who works at my company would hate me for making them maintain it. * permalink * embed * save * report * give award * reply [-]RoninTarget 4 points5 points6 points 1 year ago (0 children) That said, there is nothing stopping you from using Emacs in a production system. You can use it in batch mode and work it into a larger system that needs text processing. If you are really bold, and you are programming a text-based UI for a point-of-sale system to be used by a million customers, and Emacs turns out to be the best solution to that problem, and the code you write can be easily updated by anyone maintains your code base, then why not? Didn't Amazon do something like that early on? IIRC, they had a critical system done in Emacs Lisp. It was replaced later on with something less competent programmers could maintain. The removal of Emacs Lisp system was mourned even by suits who knew about it. * permalink * embed * save * parent * report * give award * reply [-]ispinfx 1 point2 points3 points 1 year ago (2 children) No. Life is short, I use Python. * permalink * embed * save * report * give award * reply [-]Expensive_Pain 2 points3 points4 points 1 year ago (0 children) That sounds like something you'd say to reject C/Java. * permalink * embed * save * parent * report * give award * reply [-]deaddyfreddyGNU Emacs 2 points3 points4 points 1 year ago (0 children) Life is short even for Python, I use Clojure * permalink * embed * save * parent * report * give award * reply [-]hinterzimmer 0 points1 point2 points 1 year ago (0 children) Das ist zu gleichen Teilen faszinierend und erschreckend. That is equally fascinating and terrifying. * permalink * embed * save * report * give award * reply [-]DWHoman 0 points1 point2 points 1 year ago (0 children) I've used it for command-line text processing where I'm dealing with large text files with varying character encodings. Emacs can figure out a file's encoding on it's own. I tried some command-line utilities for finding the files' encodings, and they either gave an incorrect answer, probably because they didn't scan far enough, or they were really slow. Tools like sed and awk aren't very good at working with unicode, and most programming languages require you to tell them what the file encoding is. I didn't try Perl, which might work for such a case. Anyways, elisp is good for batch text processing scripts. * permalink * embed * save * report * give award * reply [-][deleted] 0 points1 point2 points 9 months ago* (0 children) I'm going to replace all my local scripts (perl, python, shell) with emacs lisp. But I'm now getting stuck at replacing my perl tcl/tk program (Tkx library) with emacs lisp. Any idea? * permalink * embed * save * report * reply * about * blog * about * advertising * careers * help * site rules * Reddit help center * reddiquette * mod guidelines * contact us * apps & tools * Reddit for iPhone * Reddit for Android * mobile website * <3 * reddit premium * reddit coins Use of this site constitutes acceptance of our User Agreement and Privacy Policy. (c) 2022 reddit inc. All rights reserved. REDDIT and the ALIEN Logo are registered trademarks of reddit inc. [pixel] p Rendered by PID 35 on reddit-service-r2-loggedout-6df48fdb6f-92nkn at 2022-11-08 23:02:28.583167+00:00 running a39acba country code: US.