emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Gathering data on user preferences


From: Tim Cross
Subject: Re: Gathering data on user preferences
Date: Wed, 08 Sep 2021 09:14:53 +1000
User-agent: mu4e 1.7.0; emacs 27.2.50

Arthur Miller <arthur.miller@live.com> writes:

>
> Who said human intervention? :-)
>
> I see emacs as a good tool for shell scripting and text processing. In 
> general I
> am surprised that lisp(s) are second grade citizens in the land of web 
> scraping,
> text processing etc, python being No 1 atm and js no2.
>
> Thomas asked why not s-exps? And I also wonder. If we sent s-exps over the 
> wire,
> maybe it would be less processing involved? Write incomming s-exp to emacs
> server socket? Is it too wild to think of? :)
>

Yes it is. Your creating lots of work to create a solution which would
perform badly and be overly fragile and resource expensive. Emacs is
simply the wrong tool for this task.

We could use s-exp, but I don't see any benefit as I would not be using
Emacs to process the data. Its like asking "Why don't we use Emacs as a
bug tracker?" - the answer is you could, but there are better bug
trackers out there.

I also think your not considering the concurrent nature of web servers.
Requests are not serial and multiple requests can come in at the same
time. If you were going to write the data to Emacs via a socket, you
need to handle multiple socket connections at the same time and respond
to the web server in a timely manner to prevent timeout errors etc. 

We would have to disagree here. I don't think Emacs is a good general
purpose tool for shell scripting and text processing in this scenario at
all. It is completely the wrong tool for the task.

- It is huge compared to other tools. Why would you fire up Emacs on a
  server just to process a small chunk of data from a POST request?

- Emacs is not multi-threaded, so you would either have to fire up an
  Emacs instance for every connection (terribly slow) or you wold have
  to write some handler code to write the data to intermediate files and
  then have some Emacs process fire up at some point to process the
  received data. You would also need to implement some form of
  locking mechanism to ensure Emacs doesn't try to read data which
  hasn't completed writing yet and you still have to write some form of
  handler in something just to generate the intermediate data files. The
  solution would end up more complex and prone to bugs than necessary.

- Compared to other scripting solutions, Emacs is extremely slow. This
  is partially because it has an internal structure oriented towards
  being an editor, not a general purpose scripting environment. 

Just because you can do almost anything with Emacs doesn't mean you
should. If you really want to use a lisp language, there are far better
choices for this scenario (like one of the many lisp based shells like
lsh, schsh, rep, guile etc). 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]