
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 So I mentioned a while ago I meant to go over XMC using the 'sim' tool (with an invocation like sim_mira `find . -name "*.hs"` - I discovered recently that it had Miranda support, which means quasi-Haskell support). But the results are littered with comments. Particularly obnoxious are the module headers, in part because they all seem to use '--' comments even if they cover dozens of lines. Would anyone object if I were to edit those to use {- -} style (and push those edits without review)? - -- gwern -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEAREKAAYFAko+xRkACgkQvpDo5Pfl1oJuNwCgi4IhXrPLMdOHlWdReKTcMH2f GbUAn0pT7fM9dnLYW0acoaQrVKc2H51w =ngUp -----END PGP SIGNATURE-----

On Sun, Jun 21, 2009 at 07:41:17PM -0400, Gwern Branwen wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512
So I mentioned a while ago I meant to go over XMC using the 'sim' tool (with an invocation like sim_mira `find . -name "*.hs"` - I discovered recently that it had Miranda support, which means quasi-Haskell support). But the results are littered with comments.
Particularly obnoxious are the module headers, in part because they all seem to use '--' comments even if they cover dozens of lines. Would anyone object if I were to edit those to use {- -} style (and push those edits without review)?
- -- gwern
I would find this rather annoying, as I'm not a big fan of the multi-line comment syntax. Furthermore, I note that most Haskell libraries mark each line with "--" rather than use "{-" in Haddocks. What is sim? Why are comments an issue? Cheers, Spencer Janssen

gwern0:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512
So I mentioned a while ago I meant to go over XMC using the 'sim' tool (with an invocation like sim_mira `find . -name "*.hs"` - I discovered recently that it had Miranda support, which means quasi-Haskell support). But the results are littered with comments.
Particularly obnoxious are the module headers, in part because they all seem to use '--' comments even if they cover dozens of lines. Would anyone object if I were to edit those to use {- -} style (and push those edits without review)?
Yep. Let's not change the style. But change the tool to support the style. I'm not familiar with 'sim'. What does it do? -- Don

On Sun, Jun 21, 2009 at 10:29 PM, Don Stewart
gwern0:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512
So I mentioned a while ago I meant to go over XMC using the 'sim' tool (with an invocation like sim_mira `find . -name "*.hs"` - I discovered recently that it had Miranda support, which means quasi-Haskell support). But the results are littered with comments.
Particularly obnoxious are the module headers, in part because they all seem to use '--' comments even if they cover dozens of lines. Would anyone object if I were to edit those to use {- -} style (and push those edits without review)?
Yep. Let's not change the style. But change the tool to support the style.
I'm not familiar with 'sim'. What does it do?
-- Don
As in my previous email in April on the topic: sim is a tool for discovering textual repetition http://www.haskell.org/pipermail/xmonad/2009-April/007722.html It works reasonably well, but the output is much harder to read than it needs to be because of the module headers. As you can see, mailman mangled my email, so I'm forwarding the original to you & Spencer (as the only 2 to reply). -- gwern

You could strip comments with something like this. The results might be slightly better, depending on how well sim works. Haskell-src-exts is improving, but it still fails on a couple modules in contrib. #!/usr/bin/env runghc
import System.Environment import Language.Haskell.Exts import Control.Monad
main = mapM_ (putStrLn . prettyPrint . fromParseResult <=< parseFile) =<< getArgs
-- Adam

On Tue, Jun 30, 2009 at 9:05 PM, Adam Vogt
You could strip comments with something like this. The results might be slightly better, depending on how well sim works. Haskell-src-exts is improving, but it still fails on a couple modules in contrib.
#!/usr/bin/env runghc
import System.Environment import Language.Haskell.Exts import Control.Monad
main = mapM_ (putStrLn . prettyPrint . fromParseResult <=< parseFile) =<< getArgs
That's useful, but I think it's not as good as changing the module headers. As you say, that will choke on some modules; it's an extra step; and by removing comments entirely, one can no longer investigate any duplication in *comments* as well as code (I'm sure copy-pasta of comments exists, even if only in the module headers.) And I don't entirely understand the reticence to use multi-line comments. Weren't they intended for exactly these sorts of situations, massive comment blocks spanning entire pages? How exactly are a couple hundred prefixed '--'s superior to a {- -}? -- gwern

On Tue, Jun 30, 2009 at 9:59 AM, Gwern Branwen
On Sun, Jun 21, 2009 at 10:29 PM, Don Stewart
wrote: gwern0:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512
So I mentioned a while ago I meant to go over XMC using the 'sim' tool (with an invocation like sim_mira `find . -name "*.hs"` - I discovered recently that it had Miranda support, which means quasi-Haskell support). But the results are littered with comments.
Particularly obnoxious are the module headers, in part because they all seem to use '--' comments even if they cover dozens of lines. Would anyone object if I were to edit those to use {- -} style (and push those edits without review)?
Yep. Let's not change the style. But change the tool to support the style.
I'm not familiar with 'sim'. What does it do?
-- Don
As in my previous email in April on the topic: sim is a tool for discovering textual repetition http://www.haskell.org/pipermail/xmonad/2009-April/007722.html It works reasonably well, but the output is much harder to read than it needs to be because of the module headers.
As you can see, mailman mangled my email, so I'm forwarding the original to you & Spencer (as the only 2 to reply).
So with a potentially long wait until the next major release (that is, not the quick fixes for X11/GHC), does anyone mind if I were to make these header changes? -- gwern

On Fri, Dec 18, 2009 at 04:33:56PM -0500, Gwern Branwen wrote:
So with a potentially long wait until the next major release (that is, not the quick fixes for X11/GHC), does anyone mind if I were to make these header changes?
As I've said already, please don't change the module headers. If sim is broken, fix sim. Cheers, Spencer Janssen

On Sat, Dec 19, 2009 at 1:16 PM, Spencer Janssen
On Fri, Dec 18, 2009 at 04:33:56PM -0500, Gwern Branwen wrote:
So with a potentially long wait until the next major release (that is, not the quick fixes for X11/GHC), does anyone mind if I were to make these header changes?
As I've said already, please don't change the module headers. If sim is broken, fix sim. Cheers, Spencer Janssen
As I said already: sim is not broken. Our conventions are broken. The headers have massive duplication, and sim is reporting the duplication exactly as it should. It makes no sense to use -- for dozens* of consecutive lines: even if the duplication doesn't bother one, it adds visual clutter and makes editing more difficult. {--} fixes all 3 problems; why not use it? I'm not asking every module author to go back and mess around with formatting, or you to apply every such patch; I'm perfectly willing to make the patches myself and push them as well. * yes, dozens. The $usage sections alone can run ~50 lines. One is 58 lines. -- gwern

Gwern Branwen
As I said already: sim is not broken. Our conventions are broken. The headers have massive duplication, and sim is reporting the duplication exactly as it should.
Just because we have reptition doesn't mean our conventions are "broken"; inefficient maybe, but I wouldn't even really consider it to be "duplication". Besides, M-q in Emacs helps with editing... ;-) -- Ivan Lazar Miljenovic Ivan.Miljenovic@gmail.com IvanMiljenovic.wordpress.com
participants (5)
-
Adam Vogt
-
Don Stewart
-
Gwern Branwen
-
Ivan Lazar Miljenovic
-
Spencer Janssen