3 ms·
Looking at the code for the 0.1.0 release, it looks like you were using parsec as opposed to attoparsec (which typically has better performance). About virtual
by mercurial 13y ago
Looking at the code for the 0.1.0 release, it looks like you were using parsec as opposed to attoparsec (which typically has better performance). About virtual tables, I'm not exactly sure of what you were trying to do, but the usual solution to having different kind of stuff you want to put in a single collection is to just use a sum type - though it assumes you know in advance what kind of things you want in your collection, or at worst, use existential types. But the FFI question is a good point.
- kentonv 13y agoPerformance wasn't actually a goal, since it was just a code generator tool and was still much faster than the C++ compiler that runs on its output. I was also using Integer rather than Int everywhere (I didn't realize when I started that Integer = BigInt). Yeah, most (perhaps all) design challenges where I want vtables can be solved elegantly in some other way in Haskell, but the solution depends on the use case and isn't a simple bijection. It's just tough to rewire the way the designs form in my head before I write the code. If I had infinite time...
- mercurial 13y agoHeh. I'll be the last person to claim that Haskell is a low-maintenance language :)