Discussion:
[VM] MIME encoding/decoding
Uday Reddy
2014-07-16 17:39:23 UTC
Permalink
VM has traditionally shipped with C programs for MIME encoding/decoding.
Rob F created an entire Unix-like infrastructure (Make files, configure,
autoconf etc.) pretty much to handle just these. If we get rid of these C
programs, VM can be shipped just like any other emacs library.

Both GNU Emacs and XEmacs now have built-in encoding/decoding functionality
for base64. So, we can use them. For the Quoted Printable format,
emacs-lisp seems to be fast enough. Gnus has been using it for ages and
everybody seems happy with that.

So, I am thinking of getting rid of the C programs for MIME. Does anybody
see any problem with that?

Cheers,
Uday

(Coming back after a long hibernation)
Lewis Perin
2014-07-17 14:34:28 UTC
Permalink
Post by Uday Reddy
VM has traditionally shipped with C programs for MIME encoding/decoding.
Rob F created an entire Unix-like infrastructure (Make files, configure,
autoconf etc.) pretty much to handle just these. If we get rid of these C
programs, VM can be shipped just like any other emacs library.
Both GNU Emacs and XEmacs now have built-in encoding/decoding functionality
for base64. So, we can use them. For the Quoted Printable format,
emacs-lisp seems to be fast enough. Gnus has been using it for ages and
everybody seems happy with that.
So, I am thinking of getting rid of the C programs for MIME. Does anybody
see any problem with that?
Sounds good to me. Thanks!

/Lew
---
Lew Perin / ***@acm.org
http://babelcarp.org
Manuel Hermenegildo
2014-07-17 19:54:58 UTC
Permalink
Sounds good to me too! --Manuel
--
-----------------------------------------------------------------------------
Manuel Hermenegildo | ***@imdea.org
-----------------------------------------------------------------------------
John Hein
2014-07-17 18:03:28 UTC
Permalink
Post by Uday Reddy
VM has traditionally shipped with C programs for MIME encoding/decoding.
Rob F created an entire Unix-like infrastructure (Make files, configure,
autoconf etc.) pretty much to handle just these. If we get rid of these C
programs, VM can be shipped just like any other emacs library.
Both GNU Emacs and XEmacs now have built-in encoding/decoding functionality
for base64. So, we can use them. For the Quoted Printable format,
emacs-lisp seems to be fast enough. Gnus has been using it for ages and
everybody seems happy with that.
So, I am thinking of getting rid of the C programs for MIME. Does anybody
see any problem with that?
Cheers,
Uday
(Coming back after a long hibernation)
We should check the performance of builtin decoding - particularly
with larger messages on slower machines. That said, most of the unix
flavors & cygwin out there now have one or more command line tools to
en/decode base64 (less prevalent are qp tools) which can take the
place of the vm versions:

mmencode (both)
mimencode (both)

base64
b64en/decode
qprint

not to mention perl & python one liners.
Uday Reddy
2014-07-17 20:22:49 UTC
Permalink
Post by John Hein
We should check the performance of builtin decoding - particularly
with larger messages on slower machines. That said, most of the unix
flavors & cygwin out there now have one or more command line tools to
en/decode base64 (less prevalent are qp tools) which can take the
As I said, base64 is now a non-issue because Emacsen have built-in functions
for it.

For Quoted Pritable, you can check performance of the elisp code by setting
qp-decoder-program and qp-encoder-program to nil.

Cheers,
Uday
Volker A. Brandt
2014-07-17 20:22:09 UTC
Permalink
Dear Uday!


Thank you for keeping VM alive.
Post by Uday Reddy
VM has traditionally shipped with C programs for MIME encoding/decoding.
[...]
Post by Uday Reddy
So, I am thinking of getting rid of the C programs for MIME. Does anybody
see any problem with that?
Maybe they could be bundled in a separate distribution file?
And there could be some hooks in VM that would use the binaries
if found in $PATH, and fall back to Lisp code if they aren't found?


Best regards -- Volker
--
------------------------------------------------------------------------
Volker A. Brandt Consulting and Support for Oracle Solaris
Brandt & Brandt Computer GmbH WWW: http://www.bb-c.de/
Am Wiesenpfad 6, 53340 Meckenheim Email: ***@bb-c.de
Handelsregister: Amtsgericht Bonn, HRB 10513 Schuhgröße: 46
Geschäftsführer: Rainer J. H. Brandt und Volker A. Brandt
Reinhard Kotucha
2014-07-18 00:18:57 UTC
Permalink
Post by Volker A. Brandt
And there could be some hooks in VM that would use the binaries
if found in $PATH, and fall back to Lisp code if they aren't found?
This is by far the best solution, if not the only reasonable one.
It's inexpensive and Raspberry Pi users will be grateful.

Regards,
Reinhard
--
------------------------------------------------------------------
Reinhard Kotucha Phone: +49-511-3373112
Marschnerstr. 25
D-30167 Hannover mailto:***@web.de
------------------------------------------------------------------
Mark Diekhans
2014-07-18 06:01:21 UTC
Permalink
Hi Uday,

Suggest keeping these in the source tree if anyone really needs
them, but not make part of a standard package.

Mark
Post by Uday Reddy
VM has traditionally shipped with C programs for MIME encoding/decoding.
Rob F created an entire Unix-like infrastructure (Make files, configure,
autoconf etc.) pretty much to handle just these. If we get rid of these C
programs, VM can be shipped just like any other emacs library.
Both GNU Emacs and XEmacs now have built-in encoding/decoding functionality
for base64. So, we can use them. For the Quoted Printable format,
emacs-lisp seems to be fast enough. Gnus has been using it for ages and
everybody seems happy with that.
So, I am thinking of getting rid of the C programs for MIME. Does anybody
see any problem with that?
Cheers,
Uday
(Coming back after a long hibernation)
Ulrich Mueller
2014-07-18 07:13:37 UTC
Permalink
Post by Uday Reddy
VM has traditionally shipped with C programs for MIME encoding/decoding.
Rob F created an entire Unix-like infrastructure (Make files, configure,
autoconf etc.) pretty much to handle just these. If we get rid of these C
programs, VM can be shipped just like any other emacs library.
Both GNU Emacs and XEmacs now have built-in encoding/decoding functionality
for base64. So, we can use them. For the Quoted Printable format,
emacs-lisp seems to be fast enough. Gnus has been using it for ages and
everybody seems happy with that.
These C programs were first shipped with in VM 6.76 which was released
in September 2000. This is somewhat surprising, because at that time
Emacs (version 20.4 then) already included the base64-decode-region
etc. functions.
Post by Uday Reddy
So, I am thinking of getting rid of the C programs for MIME. Does anybody
see any problem with that?
It may well be that they have outlived their purpose. But before
removing them, please make sure that it doesn't have any negative
impact on performance.

Ulrich
Patrick P Murphy
2014-07-18 13:08:00 UTC
Permalink
Post by Ulrich Mueller
Post by Uday Reddy
VM has traditionally shipped with C programs for MIME
encoding/decoding. ...
These C programs were first shipped with in VM 6.76 which was released
in September 2000. This is somewhat surprising, because at that time
Emacs (version 20.4 then) already included the base64-decode-region
etc. functions.
No, it's not surprising. Typical resources at the time for a
near top-of-the-line PC would have been:

550 MHz processor (just one, no cores)
64 Megabytes (not Gigabytes) of RAM if you were very lucky
ATA-2 hard drive, maybe 10 or 20 Gigabytes.

Performance was a real issue, and in a speed battle between emacs lisp
and a compiled C program, the latter usually won by at least one order
of magnitude, maybe two.

Times change. Computers are faster. For most modest size attachments,
people don't notice the difference anymore. People who get massive
attachments in the mail from others still do. I work in a "big data"
environment so I see this sort of thing a lot, even though most of my
co-workers know that SMTP is a rotten way to send large files around ;-}

I'm neutral on whether the programs are left as part of the VM tree or
not, as long as (a) the same functionality is available elsewhere [it
is, modulo cmd line arguments]; and (b) hooks are left in place to
allow us to override the built-in versions.

- Pat
--
Patrick P. Murphy, Ph.D. https://www.nrao.edu/~pmurphy/
NRAO Information Security Officer NRAO Webmaster [East]

Ég skildi, að orð er á Íslandi til um allt, sem er hugsað á jorðu.
Ulrich Mueller
2014-07-19 08:07:03 UTC
Permalink
Post by Patrick P Murphy
Post by Ulrich Mueller
These C programs were first shipped with in VM 6.76 which was released
in September 2000. This is somewhat surprising, because at that time
Emacs (version 20.4 then) already included the base64-decode-region
etc. functions.
No, it's not surprising. Typical resources at the time for a
550 MHz processor (just one, no cores)
64 Megabytes (not Gigabytes) of RAM if you were very lucky
ATA-2 hard drive, maybe 10 or 20 Gigabytes.
Performance was a real issue, and in a speed battle between emacs lisp
and a compiled C program, the latter usually won by at least one order
of magnitude, maybe two.
The base64-* functions always were internal Emacs functions, i.e.
implemented in C. Therefore I doubt that one could improve performance
by calling an external program, which has additional overhead for
spawning a new process.

Adding these programs to VM would still have made sense in the late
1990s, but no longer in 2000 when Emacs 20.4 had the built-in C
functions.

Ulrich

Continue reading on narkive:
Search results for '[VM] MIME encoding/decoding' (Questions and Answers)
3
replies
what is mime text?
started 2006-11-22 21:03:24 UTC
security
Loading...