News for hackers. Stuff that matters.
Re:Why GNU Emacs? by infodroid on Sunday February 14, 2016 @05:51PM (#11100386)
Many Emacs advocates fall for the trap of apologizing for why Emacs is not Unixy, as though it were some sort of defect. They should celebrate the fact that Emacs doesn't come from the Unix tradition of small, composable tools and "doing only one thing and doing it well". It is rooted in the ambitious work of the MIT Artificial Intelligence lab, the LISP programming language, and the single user MIT Lisp Machine that essentially booted up to a LISP REPL.
Re:Why GNU Emacs? by gkya on Sunday February 14, 2016 @06:06PM (#11100440)
Unix has a big flaw: through the pipes pass random data. It's up to the receivers to interpret it. Lisp gives you the possibility to easily structure your data and pass it around, plus the ability to pass programs around. Other than this, the unix way and the lisp way are nearly parallel, though in lisp "command line utility" is called a "procedure".
Re:Why GNU Emacs? by liotier on Monday February 15, 2016 @05:00AM (#11102491)
So, JSON passed between a bunch of Javascript things from Github means that the browser is the new EMACS ?
Re:Why GNU Emacs? by auganov on Monday February 15, 2016 @06:37AM (#11102771)
As funny as that comparison sounds - browsers are an amazing environment/system. If we ever abandon the Browser for more opaque systems I'm sure it will be remembered the way we remember Lisp machines today.
Re:Why GNU Emacs? by jarcane on Monday February 15, 2016 @05:50AM (#11102640)
The article more or less makes this precise comparison.

"Do everything in Emacs" isn't really so different from "Do everything in the browser."

Arguably, modern browsers are more heavyweight and complex at that. They certainly eat a hell of a lot more RAM than my Emacs ever does.

Re:Why GNU Emacs? by mundanevoice on Monday February 15, 2016 @06:49AM (#11102817)
True, But they also do much more things than Emacs does.
Re:Why GNU Emacs? by tempodox on Monday February 15, 2016 @07:50AM (#11103048)
If you really believe that you haven't understood emacs at all.
Re:Why GNU Emacs? by jarcane on Monday February 15, 2016 @08:14AM (#11103171)
Ironically, the only thing Emacs can't seem to do these days is be a browser. ;)
Re:Why GNU Emacs? by clocksld on Monday February 15, 2016 @11:51AM (#11104327)
The xwidget_mvp branch has been merged into the emacs master branch about a month ago.

It allows you to embed GTK widgets INSIDE an emacs buffer, effectively allowing one to create actual GUIs inside of emacs.

This also allows you to embed a full webkit-based browser (with javascript support!) right into emacs, and use it like a regular browser.

Just clone the emacs repo, build it with gtk3 and xwidget support, and run 'M-x xwidget-webkit-browse-url' to get a full-fledged browser with proper rendering right inside emacs.

https://www.emacswiki.org/pics/static/EmacsXembedScreenshot....

Re:Why GNU Emacs? by nwah1 on Tuesday February 16, 2016 @10:12AM (#11110290)
There's only one question that remains to be answered. Why?
Re:Why GNU Emacs? by gkya on Tuesday February 16, 2016 @04:25PM (#11113230)
Browsing through an environment that's integrated nicely, deeply configurable, and completely programmable. What else would you want as a programmer and an pc user?
Re:Why GNU Emacs? by clocksld on Tuesday February 16, 2016 @02:15PM (#11112361)
Why not? :)
Re:Why GNU Emacs? by to3m on Monday February 15, 2016 @09:14AM (#11103468)
https://en.wikipedia.org/wiki/Emacs/W3

https://en.wikipedia.org/wiki/Eww_%28web_browser%29

I don't believe there is any Javascript support, though, so you'll be out of luck for many modern pages...

Re:Why GNU Emacs? by cema on Monday February 15, 2016 @06:03PM (#11106734)
Well, emacs certainly can be many things, if not all things. But is it? There is a difference.
Re:Why GNU Emacs? by mundanevoice on Tuesday February 16, 2016 @05:27AM (#11108960)
Please make me understand!
Re:Why GNU Emacs? by yvdriess on Monday February 15, 2016 @05:24AM (#11102580)
Maybe if it would be sending AST in JSON, not recommended though :)
Re:Why GNU Emacs? by mveety on Monday February 15, 2016 @07:24PM (#11107076)
You just need to have a standard data structure marshaling format. Lisp gives you the ability to easily structure data, but it doesn't enforce any single way to structure it.
Re:Why GNU Emacs? by tempodox on Monday February 15, 2016 @07:46AM (#11103032)
Emacs has a big flaw: It's just too fucking complicated and inconsistent. Unix, otoh, can do everything emacs does AND it has a half-decent text editor (vim).
Re:Why GNU Emacs? by gkya on Monday February 15, 2016 @09:51AM (#11103629)
Your comment has a big flaw: it assumes that the grandparent comment is comparing emacs and unix, whereas lisp and unix were compared. If your reading skills are like this, anything is complex for you. And afaik emacs is not a sexual being. And if you think that unix is simple, easy and consistent, your unix fu is probably just adding a fancy prompt to your bashrc. Try ls: how do you sort dirs before files? The first thing you ask is whether it is gnu ls or sth else. Try man, the first question is which format. Make? Same story. I want to get notified for changes in a directory: each unix has its own incompatible thing. And these are the very basics.
Re:Why GNU Emacs? by qznc on Monday February 15, 2016 @04:24AM (#11102354)
So Emacs/Lisp gives you a Unix in your Unix.
Re:Why GNU Emacs? by gkya on Monday February 15, 2016 @04:36AM (#11102404)
No it gives me something better than unix in my unix.
Re:Why GNU Emacs? by cema on Monday February 15, 2016 @06:04PM (#11106738)
Rather, it gives you something in many ways similar to Unix and not necessarily in Unix.
Re:Why GNU Emacs? by pjmlp on Monday February 15, 2016 @03:02AM (#11102045)
Hence why I love the idea of REPL as shell as used in the Xerox PARC and ETHZ OSes.

Only Powershell comes closer to how this was used.

Re:Why GNU Emacs? by qznc on Monday February 15, 2016 @04:23AM (#11102347)
Every (Unix/terminal) shell is a Read-Eval-Print-Loop.

The difference is the data structure which is passed around. Is it bytes, Cons, or objects?

Re:Why GNU Emacs? by pjmlp on Monday February 15, 2016 @04:59AM (#11102483)
No, every UNIX shell is a poor Read-Eval-Print-Loop when compared to what Xerox PARC machines allowed in terms of interaction with the running OS.

UNIX shells don't allow to call functions declared in .so, execute scripts applied to elements selected with the mouse, apply functional algorithms over data.

Well, you can write external commands in another programming language, but then it isn't a REPL anymore.

Re:Why GNU Emacs? by gkya on Monday February 15, 2016 @06:20PM (#11106819)
A lisp repl is not any repl. First, the homoiconicity of the lisp syntax allows you to sumbit structures of arbitrary complexity to the listener, and reuse output from it, even submit it back as code to execute. Second, the error handling mechanism allows you to interactively choose how to resume, and the way the repl and the image work, allows you to redefine the ill code before resuming, which is incredibly useful and intuitive. Say I have an url, and a loop that reads some data from that url, suddenly an error happens, the resource url is changed and I have to update. If I was using slime through emacs, I would be taken to the debugger, which shows me the options to resume. While that debugger is there, I can switch to the source file, tweak the variable for the url, evaluate it, switch back to the debugger, and hit the key for retry. I would have fixed the code without having to stop the program (not even behind the scenes, like with tools that watch the program and restart it). And also within the debugger, in either of Elisp debugger and Slime debugger, I can do many things, among which peek into the locals, copy stuff from there and use in my program to explore the problem. I have heard that in a space mission, NASA programmers were able to fix a spacecraft that was in space, from earth, via connecting to its lisp image over the network.

What do you do when you have to debug a pipeline? You do not have direct access to the data that flows, you need special tools to examine core dumps, and you have to have had enabled saving the dumps beforehand, you need to verify that the command syntax is correct, you have to understand what each program emit, and make sure you filter out all irrelevant data like logging etc., you don't know which part of the pipeline failed, where, you don't know if it is a wrong parameter or the program has a bug. And in order to fix bugs in programs that make up the pipeline, you have to know in whatever language the buggy one was implemented:

  </var/log/my-service.log ag 'Response: 505' | sed 's#(<timestamp>) (<path>) Response: (\d{3}) (\w+)#\1,\2,\3,\4#' | python create_report.py --output-to latex > /tmp/report.tex && latex /tmp/report.tex && dvi2pdf /tmp/report.tex && [ -f /tmp/report.pdf ] && sh /home/gkya/utils/mail_report.sh --report /tmp/report.pdf
In this command line at least six different languages are in use. I just made it up, but it doesn't seem far-fetched to me.
Re:Why GNU Emacs? by lispm on Sunday February 14, 2016 @07:43PM (#11100813)
Unix may have a tradition of small, composable tools. But Unix at the same time has a tradition of large, non-composable and long running tools. The X11 server is such a thing. Many GUI applications under Unix are working that way. From Framemaker to the big gui-based CAD applications.

Don't let them tell you that Unix was developed to ONLY run small composable tools and that this is the only true way to use applications under Unix.

If you look at Mac OS X as a Unix, the typical application has a GUI, only one instance is running, it works for multiple documents and often users keep them running for a long time. When browsing the web, one would not leave Safari/Firefox/Chrome after each web site visit...

Re:Why GNU Emacs? by infodroid on Monday February 15, 2016 @06:57AM (#11102845)
I think what makes a tradition is the work that is in the original spirit of the project [1], not the exceptions to it.

I would argue that the original developers of Unix over at Bell Labs were horrified at X and the "monolithic" applications that were being developed for Unix.

So much so that they wrote an entirely new operating system, Plan 9 that pushed composability to a new level and also included its own windowing system called 8½ (which was rewritten later as Rio).

Rob Pike had this to say about 8½ [2]:

> The entire system, including the default program that runs in the window — the equivalent of xterm pasting between windows — is well under 90 kilobytes of text on a Motorola 68020 processor, about half the size of the operating system kernel that supports it and a tenth the size of the X server without xterm... The small size of 8½ does not reflect reduced functionality: 8½ provides service roughly equivalent to the X window system. 8½’s clients may of course be as complex as they choose, although the tendency to mimic 8½’s design and the clean programming interface means they are not nearly as bloated as X.

[1] https://en.wikipedia.org/wiki/Unix_philosophy [2] http://doc.cat-v.org/plan_9/4th_edition/papers/812/

Re:Why GNU Emacs? by lispm on Monday February 15, 2016 @10:18AM (#11103758)
Plan9 is not that successful and not a good representation of actual Unix use. Doesn't GNU Emacs run on Plan 9? Wait, there is Acme.

What about Acme's architecture?

> Acme is about 8,000 lines of code in Alef, a concurrent object-oriented language syntactically similar to C [Alef]. Acme’s structure is a set of communicating processes in a single address space. One subset of the processes drives the display and user interface, maintaining the windows; other processes forward mouse and keyboard activity and implement the file server interface for external programs. The language and design worked out well; as explained elsewhere [Pike89, Gans93, Reppy93], user interfaces built with concurrent systems can avoid the clumsy top-level event loop typical of traditional interactive systems.

That does not sound like Unix philosophy. Communicating processes in a single address space application. On Plan 9. Written by Rob Pike at Bell Labs.

We've seen companies like SUN, IBM, HP, DEC/Compaq/whatever they are called now/..., etc. earning zillions on big fat applications. Big fat GUI applications and big fat server applications.

From any Oracle DB, to any Java application, to basically every desktop application - none follows the so-called 'UNIX philosophy'. Thus tools like GNU Emacs have zillions of similar applications under UNIX and GNU Emacs is nothing special at all.

Re:Why GNU Emacs? by _acme on Tuesday February 16, 2016 @10:14AM (#11110304)
http://man.cat-v.org/plan_9/1/emacs

Plan 9 is more Unix than Unix. First, Acme is no longer written in Alef, but in C (on Plan 9) or Limbo (for Inferno). Second, I don't think you understand how Acme works; try reading the Acme paper or watching Russ Cox's introductory screencast.

Re:Why GNU Emacs? by woodruffw on Sunday February 14, 2016 @10:04PM (#11101302)
X was designed to replace W, which ran on the V System (which is not related to System V or UNIX in general). It does not come from the UNIX tradition - it is a port.

Plenty of monolithic software runs on modern Unices, but very few can be traced back to a tradition of monoliths.

Re:Why GNU Emacs? by _yosefk on Monday February 15, 2016 @03:15AM (#11102091)
What did the Unix tradition of composability though pipes produce though that was more complex than grep, to put it in an exaggerated form? It sorta seems that the classical Unix approach breaks down for big tasks, hence in practice big programs do not follow it. "...and the eulogy was delivered by Perl", as Pike put it.

It's a bit crazy to call Emacs bloated these days; vim is big, too, so is Eclipse, so are most useful programs. I don't like Emacs one bit, but its size is the last thing that bothers me.

Re:Why GNU Emacs? by lazyjones on Monday February 15, 2016 @03:47AM (#11102219)
> What did the Unix tradition of composability though pipes produce though that was more complex than grep, to put it in an exaggerated form?

netpbm?

Actually, once upon a time, there was a web browser called "Chimera", it used external commands to handle many types of files. For example, it used djpeg to load inline JPEG images.

Re:Why GNU Emacs? by makecheck on Monday February 15, 2016 @09:29AM (#11103535)
...and it's an unstable and/or insecure way to develop an application, which is why Mac OS X has things like XPCServices and browsers tend to run multi-process tabs.

Just because a program has the illusion of being monolithic doesn't mean that it should shed the lessons of combining smaller, more stable parts.

Re:Why GNU Emacs? by shanth on Monday February 15, 2016 @06:30AM (#11102754)
> "doing only one thing and doing it well".

Emacs does only one thing. And does that one thing very well - "Extensibility"

Re:Why GNU Emacs? by tadfisher on Sunday February 14, 2016 @11:39PM (#11101545)
I always thought of Emacs as my shell. All my UNIXy tools are just piped into this crazy customizable shell's STDIN.
Re:Why GNU Emacs? by tempodox on Monday February 15, 2016 @07:42AM (#11103014)
You practically took the words out of my mouth. I was about to say that for gainful emacs usage, all I need is a Lisp machine. But since Unix is the reality, I'm staying with vim.