Discussion:
[Haskell-cafe] Counting beta reductions for a Haskell program...
(too old to reply)
kk08
2008-11-22 04:46:43 UTC
Permalink
Does GHC supports/has a command for counting total beta reductions taken by a
program?

Thanks.
--
View this message in context: http://www.nabble.com/Counting-beta-reductions-for-a-Haskell-program...-tp20623025p20623025.html
Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.
kk08
2008-11-22 05:22:36 UTC
Permalink
Thanks.
I heard that a Gofer compiler (a Haskell dialect) supports counting the Beta
reductions.
Hence I thought GHC/Hugs would have a similar facility.
This doesn't make a whole lot of sense. One of the reasons
GHC-compiled code is so fast is that it turns into straight-line code
whenever possible, via inlining, primitive optimizations, etc.
- ryan
[1] http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.53.3729
Post by kk08
Does GHC supports/has a command for counting total beta reductions taken by a
program?
Thanks.
--
http://www.nabble.com/Counting-beta-reductions-for-a-Haskell-program...-tp20623025p20623025.html
Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.
_______________________________________________
Haskell-Cafe mailing list
http://www.haskell.org/mailman/listinfo/haskell-cafe
_______________________________________________
Haskell-Cafe mailing list
http://www.haskell.org/mailman/listinfo/haskell-cafe
--
View this message in context: http://www.nabble.com/Counting-beta-reductions-for-a-Haskell-program...-tp20623025p20633639.html
Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.
Adrian Neumann
2008-11-22 07:18:58 UTC
Permalink
Hugs has, afaik, a "output reduction count" option somewhere. At
least it had one the last time I used it.

- Adrian
Post by kk08
Thanks.
I heard that a Gofer compiler (a Haskell dialect) supports counting the Beta
reductions.
Hence I thought GHC/Hugs would have a similar facility.
This doesn't make a whole lot of sense. One of the reasons
GHC-compiled code is so fast is that it turns into straight-line code
whenever possible, via inlining, primitive optimizations, etc.
- ryan
[1] http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.53.3729
Post by kk08
Does GHC supports/has a command for counting total beta
reductions taken
by a
program?
Thanks.
--
http://www.nabble.com/Counting-beta-reductions-for-a-Haskell-
program...-tp20623025p20623025.html
Sent from the Haskell - Haskell-Cafe mailing list archive at
Nabble.com.
_______________________________________________
Haskell-Cafe mailing list
http://www.haskell.org/mailman/listinfo/haskell-cafe
_______________________________________________
Haskell-Cafe mailing list
http://www.haskell.org/mailman/listinfo/haskell-cafe
--
View this message in context: http://www.nabble.com/Counting-beta-
reductions-for-a-Haskell-program...-tp20623025p20633639.html
Sent from the Haskell - Haskell-Cafe mailing list archive at
Nabble.com.
_______________________________________________
Haskell-Cafe mailing list
http://www.haskell.org/mailman/listinfo/haskell-cafe
damodar kulkarni
2008-11-22 07:22:29 UTC
Permalink
Yes Hugs has a option "+s" but it counts some sort of reductions not exactly
the beta reductions.
Thanks.
-Damodar
Hugs has, afaik, a "output reduction count" option somewhere. At least it
had one the last time I used it.
- Adrian
Post by kk08
Thanks.
I heard that a Gofer compiler (a Haskell dialect) supports counting the Beta
reductions.
Hence I thought GHC/Hugs would have a similar facility.
This doesn't make a whole lot of sense. One of the reasons
GHC-compiled code is so fast is that it turns into straight-line code
whenever possible, via inlining, primitive optimizations, etc.
- ryan
[1] http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.53.3729
Post by kk08
Does GHC supports/has a command for counting total beta reductions taken by a
program?
Thanks.
--
http://www.nabble.com/Counting-beta-reductions-for-a-Haskell-
program...-tp20623025p20623025.html
Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.
_______________________________________________
Haskell-Cafe mailing list
http://www.haskell.org/mailman/listinfo/haskell-cafe
_______________________________________________
Haskell-Cafe mailing list
http://www.haskell.org/mailman/listinfo/haskell-cafe
--
View this message in context: http://www.nabble.com/Counting-beta-
reductions-for-a-Haskell-program...-tp20623025p20633639.html
Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.
_______________________________________________
Haskell-Cafe mailing list
http://www.haskell.org/mailman/listinfo/haskell-cafe
_______________________________________________
Haskell-Cafe mailing list
http://www.haskell.org/mailman/listinfo/haskell-cafe
--
----------------------------------------------------
Are you a woman reading this mail? If yes, please read the mail twice. Read
why a woman is only half intelligent as that of a man?
http://www.jeansasson.com/law_and_government.htm)
Ryan Ingram
2008-11-22 05:41:56 UTC
Permalink
This doesn't make a whole lot of sense. One of the reasons
GHC-compiled code is so fast is that it turns into straight-line code
whenever possible, via inlining, primitive optimizations, etc.

I suppose there could be an option for the STG machine[1] to increment
a counter on every "Enter", which loosely corresponds to a beta
reduction, but the STG machine is only an island in the sea of
compiled code GHC creates.

- ryan

[1] http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.53.3729
Post by kk08
Does GHC supports/has a command for counting total beta reductions taken by a
program?
Thanks.
--
View this message in context: http://www.nabble.com/Counting-beta-reductions-for-a-Haskell-program...-tp20623025p20623025.html
Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.
_______________________________________________
Haskell-Cafe mailing list
http://www.haskell.org/mailman/listinfo/haskell-cafe
Loading...