all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: tomas@tuxteam.de
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Check for redundancy
Date: Thu, 25 Jun 2015 09:47:41 +0200	[thread overview]
Message-ID: <20150625074741.GA32430@tuxteam.de> (raw)
In-Reply-To: <jwv7fqsv5fr.fsf-monnier+INBOX@gnu.org>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wed, Jun 24, 2015 at 11:23:41PM -0400, Stefan Monnier wrote:
> > To throw an unorthodox idea into the air, one could measure the compression
> > ratio (e.g. with gzip) and relate it to the compression ratio of "known
> > good" code (I know, I know... :-)
> 
> Compressing a file does give you some information about the amount of
> redundancy in that code, but that might not be the redundancy you care
> about (e.g. using longer identifiers will give you higher compression
> ratios, but that's usually not what's considered "redundancy in code").
> Also, it's not immediately clear how to go from this to finding the
> actual redundancy.

Yeah -- the thing was a bit tongue-in-cheek. Much of the redundancy is
(as you noted) in the eye of the beholder, and this is what makes this
discussion "interesting". You'd have to keep (as you say) the variable
names out of the equation (or do you? *I* for one consider "hungarian
notation" highly redundant -- let the type system cope with that,
others may not).

That said, I have seen this rough measure (gzip compression ratio) used
as a rough "similarity measure": compress each file separately, slap
both together and compress, and watch the reduction.

For a first step in exploratory work, just to learn what one really
wants to put into the term "redundancy you care about" it might
be useful.

regards
- -- t
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlWLsh0ACgkQBcgs9XrR2kZDVwCfRyAPGKBVFtkWrm1BapWAPqcd
q4AAnRe8hLtPYhLzesXveBuvcJcDlolj
=YpFU
-----END PGP SIGNATURE-----



  reply	other threads:[~2015-06-25  7:47 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-24  9:29 Check for redundancy Andreas Röhler
2015-06-24 13:23 ` Drew Adams
2015-06-24 14:55   ` Andreas Röhler
     [not found]   ` <mailman.5580.1435157733.904.help-gnu-emacs@gnu.org>
2015-06-24 18:21     ` Stefan Monnier
2015-06-24 21:10       ` tomas
2015-06-25  3:23         ` Stefan Monnier
2015-06-25  7:47           ` tomas [this message]
2015-06-26 15:01             ` Emanuel Berg
2015-06-26 20:25               ` Marcin Borkowski
2015-06-26 22:48                 ` Emanuel Berg
2015-06-27 12:11                 ` Robert Thorpe
2015-06-27 13:12                   ` tomas
2015-06-27 23:02                     ` Emanuel Berg
2015-06-28 11:07                       ` tomas
2015-06-28 15:50                         ` Emanuel Berg
2015-06-28 16:35                           ` Yuri Khan
2015-06-28 20:03                             ` Emanuel Berg
2015-06-28 21:38                           ` Robert Thorpe
2015-06-28 23:47                             ` Emanuel Berg
2015-07-02 23:37                               ` Robert Thorpe
2015-07-03  3:36                                 ` Yuri Khan
2015-07-03  6:41                                   ` Eli Zaretskii
2015-07-03 11:48                                     ` Yuri Khan
2015-07-03 12:16                                       ` Eli Zaretskii
2015-07-03 22:59                                         ` Robert Thorpe
2015-07-03  6:09                                 ` tomas
2015-07-03 19:56                                   ` Emanuel Berg
     [not found]                                 ` <mailman.6215.1435903802.904.help-gnu-emacs@gnu.org>
2015-07-03  6:38                                   ` Rusi
2015-07-03  7:54                                     ` tomas
2015-07-03  8:55                                     ` Loris Bennett
2015-06-24 23:31       ` Emanuel Berg
2015-06-25  2:03       ` Óscar Fuentes
2015-06-25  2:07         ` Emanuel Berg
2015-06-25  2:53           ` Óscar Fuentes
2015-06-25  3:21             ` Emanuel Berg
     [not found]       ` <mailman.5603.1435188769.904.help-gnu-emacs@gnu.org>
2015-06-25  7:43         ` Stefan Nobis
2015-06-25  8:52           ` Andreas Röhler
2015-06-26 14:51             ` Emanuel Berg
2015-06-26 14:39           ` Emanuel Berg
     [not found]           ` <mailman.5719.1435329683.904.help-gnu-emacs@gnu.org>
2015-06-27  7:40             ` Stefan Nobis
2015-06-28  2:02               ` Emanuel Berg
2015-06-28  2:40                 ` Emanuel Berg
     [not found] <mailman.6209.1435880273.904.help-gnu-emacs@gnu.org>
2015-07-03  8:40 ` Pascal J. Bourguignon
2015-07-03 20:04   ` Emanuel Berg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150625074741.GA32430@tuxteam.de \
    --to=tomas@tuxteam.de \
    --cc=help-gnu-emacs@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.