[Haskell-beginners] Function definition order and performance

Daniel Fischer daniel.is.fischer at googlemail.com
Wed Jun 8 02:06:51 CEST 2011


On Wednesday 08 June 2011, 01:34:35, Arlen Christian Mart Cuss wrote:
> > It's z-encoding,
> > http://hackage.haskell.org/trac/ghc/wiki/Commentary/Compiler/SymbolNam
> > es
> > 
> > Kind of irritating when you come across a z-encoded name containing a
> > z where you don't expect z-encoding.
> 
> I'm curious as to what you mean by "where you don't expect z-encoding."
> The assembly symbols would seem to 'qualify,' or do they turn up
> elsewhere as well?

Well, you'd expect it in the generated assembly, so you're prepared.
I didn't expect z-encoded names in source files (in comments, of course).
compiler/CgPrimOp.hs has a few pretty ones, e.g.

--  #define unsafeFreezzeByteArrayzh(r,a)	r=(a)
emitPrimOp [res] UnsafeFreezeByteArrayOp [arg] _
   = stmtC (CmmAssign (CmmLocal res) arg)


--  #define sizzeofByteArrayzh(r,a) \
--     r = ((StgArrWords *)(a))->bytes
emitPrimOp [res] SizeofByteArrayOp [arg] _
   = stmtC $
	CmmAssign (CmmLocal res) (cmmLoadIndexW arg fixedHdrSize bWord)

so that caught me off guard.

I particularly like sizzeof :D



More information about the Beginners mailing list