Hacker News new | past | comments | ask | show | jobs | submit login

I like Lua as a language. I especially like how easy it is to embed it into another program. I'll be using Lua for scripting my current project. The only thing I really don't like about it is that it treats all numbers as double-precision floats. It can be compiled to use 32-bit ints instead, but I'd really like to have access to both, especially since floating point arithmetic is insanely slow on embedded processors without an FPU, but sometimes I really need it.



If the processor doesn't have an FPU, there's not much of an extra disadvantage to compiling with int32s and then making reals just another data structure, implemented in terms of ints, with a library to manipulate them.


You'd lose the syntax for real literals, though.

And although you're technically true, the lack of a library implementing reals as userdata let me guess that few people have found this approach practical. Unless I missed it?

I guess people just use the LNUM patch.


Consider using LNUM patch then.


Thanks, LNUM looks like it'll do just what I wanted.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: