Feldspar / feldspar-compiler

This is the compiler for the Feldspar Language.
Other
22 stars 5 forks source link

Add support for Char literals in Program and support for 64 bit numtypes to external program. #159

Closed pjonsson closed 10 years ago

emwap commented 10 years ago

What is the use-case for char? Is it not enough with uint8_t?

pjonsson commented 10 years ago

We need string constants for faithfully representing the current implementation of pow_fun_intN_t() in Program. We could probably get away with representing strings as array literals of uint8_t and do some clever interpretation of things, but that will touch code paths in the compiler that matter for the important signal processing computations.

emwap commented 10 years ago

Is that for the error message? Then, why not use Assert from Feldspar.Core.Constructs.Error?

pjonsson commented 10 years ago

We could use that but it's not what the current implementation does. I'm not sure I have a strong opinion on whether assert would suffice. What assert doesn't suffice for is the implementation of the trace functions since they need string constants for the non-exceptional case.

emwap commented 10 years ago

I think assert would be ok for this case. However, I'm not sure we should have the runtime check anyway. Can you add an assert for now and then we can try to impose static checks instead.

I think we should remove the trace functions for now, since their implementation is lacking in performance and they are not widely used.

pjonsson commented 10 years ago

I'm happy to change the semantics so reverted the Char commit.

I'm not sure how much checking we need to be honest. overflows might be a real problem but the assert is in a place where there's a sign that something overflowed before we got to that point. The assert should be in the place where we were overflowing instead.

pjonsson commented 10 years ago

Pull request #163 removes the support for Trace.