Thanks for your replies.
It sounds like Lua is pretty easy to learn if people need to. The
users probably wouldn't need to use metatables anyways. What we
will have to do is write an API for them to access the data in the
FPGA, set callback functions, and execute specific commands on the
device.
I would also add that app developers might be assuming that the compiler does a lot of optimization, etc. PUC-Rio Lua does not do any optimization.This was an issue in my old project. The app team said that the Lua version of their code ran 50-500x slower than C.I spent about 2 days getting that to 5-10x slower. I just did some basic optimizations that we all learned when we started programming (back in the dark ages).
Did you make the optimizations in your code or in the Lua
interpreter?
Why not use LuaJIT? What do people think of LuaJIT on here? Are
there any cons to using LuaJIT, besides the extra space required?
Kevin
Hi everyone,
I am just getting into Lua to research it as a possible language for a grant we are working on, and was wondering if anyone could answer some questions for a beginner :)
We write software and hardware for neuroscience experiments, and are developing a new tool. Our ultimate goal in a nutshell is to have users be able to write and run scripts on their computers, but only as simulation and without low latency. The idea is that once they are satisfied with fine tuning their control script and parameters, they can then "upload" it to our device (a soft-core processor on an FPGA), in which case our backend can execute their control script with direct access to the data (going through the FPGA) for extremely low latency.
So my questions are:
1. Is Lua syntax easy to learn, especially for users that primarily code analysis scripts in Matlab or Python? (Even if it is not, if Lua turns out to meet our tech requirements, they'll just have to learn Lua anyways. Just a good thing for me to keep in mind)
IHMO Lua is very easy to learn because the language is so small. That said, there are things about Lua that are not friendly to non-technical people (meta-tables, functional programming, upvalues) but very powerful for intermediate to advanced users.
In terms of learnability and performance: Lua is used extensively in games ...
Where things tend to get difficult in Lua is the lack of a standard library.
2. Is this a fair use case for Lua? I know that Lua is small enough to use on embedded devices, what about an FPGA?
4. If not Lua, any other recommendations?