reddit / emacs
Advise on learning to emacs and computer science starting with programming in elisp?
[deleted] · 2022-10-16 03:49
I want to follow [An Introduction to Programming in Emacs Lisp](https://www.gnu.org/software/emacs/manual/html_node/eintr/index.html) as my first real programming book. I have completed a few other programming courses online which were very basic, so I doubt the book would be over my head, but I have been warned plenty to avoid emacs while a novice and elisp due to its being very niche. In my defense: I'm motivated more by a desire to fulfill a sense of seeking free knowledge than I am worried about being a paid developer asap.
lebensterben · 2022-10-16 03:55
if you have enough time, Structure and Interpretation of Computer Programs is a must read. It introduces CS fundamental knowledge with Scheme.
Acebulf · 2022-10-16 03:56
You will be learning a niche language that is only really used for emacs. It isn't a bad language, but it's tailored to the specific editor. If you're already using emacs, or at least willing to give it a try, then learning emacs lisp should be fairly straightforward. The knowledge you gain here might not be as applicable as other options, but if your goal is to enjoy the journey, that's as valid a reason as anything else.
Either_Consequence90 · 2022-10-16 05:09
I started writing a major mode for editing .srt files, found there was already one (subed) on NonGNU Elpa, and then started studying the heck out of that. I was comfortable with Common Lisp, but reading some actual Elisp code helped me wrap my mind around the things that are specific to emacs (hooks, whipping up key maps, etc). Find a major mode that you think would be useful to you, download the files, and use info mode (C-h i) as you work through it.
With that said, if you're simply trying to learn a Lisp dialect, why not Common Lisp?
EDIT: I feel like I should have mentioned that in info mode you can read the entire book you're following as well as the Elisp reference manual.
PhantomSeahorse · 2022-10-16 05:15
Starting with a more popular language is probably a better idea
Hagge5 · 2022-10-16 06:25
The other comments are pretty negative. They're not wrong exactly. However, I think Elisp can be a good first language. My uni used to teach compsci students common lisp for a first language.
Lisps are unique in the modern language ecosystem, but very simple to understand from a syntactic perspective.
I think ones language choice as a beginner should tie into whatever project you want done, not just what is considered easier to learn. Passion and fun will get you far. If you're excited to learn Elisp and emacs, and isn't *just* doing it to "learn programming", I'd say go for it! Try to achieve the things you want, understand your code, and then consider moving on.
That said, Lisps are very unique compared to c-inspired languages. Keep in mind that you may be learning some bad habits, and be open minded when you move to your next lang. You should be fine.
Having a background beyond the C family can really broaden your view of what languages are early on. Lisps are also nice for historical perspective of high level language development.
MitchellMarquez42 · 2022-10-16 06:25
In addition to what others have said:
To program in elisp is to program Emacs. And programming Emacs is _fun_. You get to see the editor changing around your code in real time, and take advantage of the high-level APIs of buffers, windows, and text properties while still retaining access to low-level LISP magic. This is what makes Emacs so powerful and enduring - with a little bit of lisp hacking, it can match any feature from any other editor.
As for the concern of it being too niche, consider this:
Who cares? You want to ingest free knowledge more than you want a "real" marketable/hirable skill. And Emacs/Elisp has the added bonus that you can apply it to any other language as well-- either from the Divine Understanding of LISP as the eternal most powerful simple expression of existence itself, OR by writing an Emacs plugin.
anoduck · 2022-10-16 06:56
Just, don't.
Lisp and Elisp are cool, but are cool like my old Texas Instruments TI-99 is cool, not like a brand-new Cray is cool. Outside EMACS, they are used about as much as COBOL, which isn't that often anymore. The "E" in Elisp either stands for, or might as well stand for, EMACS.
To be frank, you are making your journey unnecessarily complicated for yourself. I would recommend a higher level object-oriented programming language. Something Like Go-Lang, Python, Rust, JS, etc... Something you will be able to immediately put to use.
danderzei · 2022-10-16 06:59
The [video lectures](https://www.youtube.com/watch?v=2Op3QLzMgSY) are very good.
danderzei · 2022-10-16 07:00
COBOL programmers can make lots of money. The global finance system runs on it.
NoisyFrequency · 2022-10-16 10:18
I like Racket, it's a good Lisp and is often used in education, you can read [How to design Programs](https://htdp.org/) for example =)
akho_ · 2022-10-16 11:57
People experienced with those systems make money. New COBOLists are not very valuable. Money’s in the domain knowledge.
elphoeniks · 2022-10-16 12:11
As others said, pick a language like Python or Ruby and start from there.
SlowValue · 2022-10-16 12:33
I think Elisp is a good first language, because it supports "interactive programming". Which means you can try small functions and snippets of code right away, without recompiling and restarting the program. This helps to try out own ideas and verify understanding.
You later can easily transfer your knowledge to Common Lisp or Clojure. And you learn how to deal with one of the most important tool of an developer, the editor.
You probably won't find a job on Elisp or Common Lisp, though. Both Languages are too much niche. Despite the fact that Common Lisp was used for classical AI research and is used for Quantum computer research. Clojure is used for Web programming and while still niche, you can make good money with it (so I heard).
You can do cool stuff in Common Lisp:
[differentiate](https://www.youtube.com/watch?v=EyhL1DNrSME),
[DSLs](https://www.youtube.com/watch?v=5FlHq_iiDW0),
[CLOG](https://github.com/rabbibotton/clog),
[a 3D IDE](https://github.com/kaveh808/kons-9),
[A Window Manager](https://github.com/stumpwm/stumpwm)
By the way: most of this is doable in other languages, too.
flyin1501 · 2022-10-16 13:00
Concepts in Elisp can be applied on other languages. Emacs Lisp has an event loop similar to JavaScript, a generator library modeled after Python's (if I remember right), and every piece of code is easily available --- if it's loaded you likely can find the code with a quick `describe-function` (C-h k). I'd say it's a good place to learn concepts.
One piece of advice: install [Helpful](https://github.com/wilfred/Helpful), which provides enhanced help pages (over those provided by `describe-function`) that, among other things, show you the source code right there in the help page. It then becomes very easy to dig into how things are made.
Solarinas · 2022-10-16 14:19
Emacs is really fun to play around with. I'm not sure what your final goals for it other then learning, but a cool thing about emacs is that it's useful for so much more then programming. There are some people who use it just because it's an extremely customizable writing tool
It's also interesting to learn about the tools programmers use to make their jobs more efficient and learning about them in emacs. If you are interested in programming I would suggest picking up another language and start playing around in elisp to setup a work environment for it (or just make a work environment for writing elisp)
You don't need to be a programmer to get what you want out of emacs. So don't listen to people telling you to ignore it because it's difficult and not for novices
takeonrules · 2022-10-16 14:48
> I'm motivated more by a desire to fulfill a sense of seeking free knowledge than I am worried about being a paid developer asap.
This is a fantastic motivation! I just published [Revisiting the Principles of My Text Editor](https://takeonrules.com/2022/10/16/revisiting-the-principles-of-my-text-editor/).
Which has me thinking of the advice I'm giving you. Look at learning to program Emacs through a few lens:
1. Practicing programming
2. Refining the tool you can use for programming
Imagine…you can get better at programming in general by practicing / exploring writing programs for the tool you'll use for writing programs? That's a virtuous cycle.
Good luck!
[deleted] · 2022-10-16 15:48
[deleted]
[deleted] · 2022-10-16 15:49
[deleted]
fedreg · 2022-10-16 17:04
why an OOP language though?? Talk about making things unnecessarily complicated...any lisp has an immediate feedback loop which is fantastic for learning.
My advice to the OP would be to not overthink it.. at this level, scratching an itch for fun is great and you will almost always learn something valuable from every rabbit hole you go down. If you're enjoying yourself keep going, if you get bored, move on.
I think you'll find that emacs can be an incredibly fun tool to tinker with
00-11 · 2022-10-16 20:33
***THIS.***
00-11 · 2022-10-16 20:34
This.
00-11 · 2022-10-16 20:42
Yes, read that intro Elisp book. And continue to play around with Emacs and Elisp.
And (as u/danderzee said) watch the MIT [course recordings](https://www.youtube.com/watch?v=2Op3QLzMgSY) on *Lisp and computer programs* to learn *really* about both programming and computer science. Watch 'em carefully. Take yer time. Rewatch. Watch 'em all.
*Have fun while doing all of that!* It'll change your life, if you give it and yourself a chance and a little thought.
ram535 · 2022-10-16 21:48
SICP study group https://discord.gg/MV2GdMXn
deaddyfreddy · 2022-10-17 10:08
pros:
- it's a lisp
- it's deeply integrated in Emacs, so it's accessible from everywhere
cons:
- the language was designed in the 80s with some "premature optimizations" in mind, sacrificing nicety a bit. The fun thing is these days it's neither neat nor fast.
- "standard" library is pretty inconsistent
- no namespaces
- sometimes there are multiple libraries to do the same thing, and none of them is good enough to be used alone
So I wouldn't recommend it as a first language to learn for a person who wants to be a professional software engineer. Too many bad/outdated practices.
anoduck · 2022-10-19 18:41
I wouldn't necessarily say learning elisp as your first exposure to programming was a pleasurable experience, at least for me it wasn't. Using EMACS as your first real unix editor was rough enough. A lot of users still don't quite understand how to debug their init when no specific package has been identified as the culprit, and missing closing a parenthesis can result in hours of diagnostic for a complete novice.
Most colleges these days teach object oriented languages in their intro classes to have the student start to think of programming in terms of objects. It is a good approach, and results in deeper understanding of the process.
I think you are forgetting how daunting it is to be a newb.
anoduck · 2022-10-19 18:46
They make money because of their scarcity, which reinforces the insinuation that COBOL is not used often.
fedreg · 2022-10-20 02:40
point taken. But I think we also forget how fun and exciting programming was when we were brand new to it (1980's for me) and every little thing you learned was so cool. So if the OP is excited, he should keep going with it
and my point with OOP is the complexity of all the ceremony around it.... Everything isn't an object and we don't need to use new, factory, this, self, etc, etc all over the place...
if the problem needs to be modeled as an object, or that model makes the most sense to your brain great! if not, functions and data structures work great and are way simpler for some students to grok IMO.
just because lots of colleges do it doesn't make it the right choice for everyone so we shouldn't push everyone down that path.
anoduck · 2022-10-20 22:44
Everything that was said, was said to prevent some one else from spinning their wheels, prevent mental anguish, encourage self confidence, and fast track applicability of skills acquired.
I don't think anyone would truthfully claim ELISP is the easiest programming language to acquire proficient fluency in. So, why would anyone ask a budding novice programmer to begin his journey in it?
I apologize for your dislike of object oriented languages, but the wheels were set in motion on that bus well before I got on board. Talk to Dennis Ritchie about it, he kinda began the movement with C++. Since colleges will require he take an intro into programming course, and chances are highly favorable it will be an object oriented language, then why not make his life easier? Provide him the opportunity to do college things, like date girls? A well rounded programmer is a good programmer, and girls are important too? Right?
Everything may not be naturally an object, but it can be made into one, and doing so projects the article into a higher more abstract realm of existence. It is kinda like Bertrand Russell's sets, minus the bit on Wittgenstein, because who cares about Wittgy anyway.