Int-based lexer flag bitmask exhausted

Edward Z. Yang ezyang at mit.edu
Sat Jun 21 11:09:31 UTC 2014


As long as you check the performance impact on 32-bit, sounds good to
me.

Edward

Excerpts from Herbert Valerio Riedel's message of 2014-06-21 11:09:44 +0100:
> Hello Simon (et al.),
> 
> While doing #9224[1] as a finger-exercise to extend the lexer to support
> base-2 integer literals, I got stuck on the lexer extension map being
> represented as an 'Int', which (in GHC) is only guaranteed to hold least
> 32bits.
> 
> -- for reasons of efficiency, flags indicating language extensions (eg,
> -- -fglasgow-exts or -XParallelArrays) are represented by a bitmap
> -- stored in an unboxed Int
> 
> However, as all 32bits are already taken up by language extensions, and
> I'd need a 33th bit, I'm wondering how to proceed. Can we replace the
> 'Int' by an 'Int64' (or even better a Word64, ideally with a newtype or
> at least a type-synonym around it?) which would give us a bit more
> headroom while being semantically sound even for 'bitSize Int == 32'?
> 
>  [1]: https://ghc.haskell.org/trac/ghc/ticket/9224
> 
> Cheers,
>    hvr


More information about the ghc-devs mailing list