I have some basic requirements. In an windows PC I am supposed to
Read some files.
Perform some scientific computations on read file.
Send and receive data to a board through peripherals.
Was searching for lightweight scripting language and stumbled upon Lua! Want to validate here, if Lua is a good choice? Questions are:
Are there Lua libraries which can handle USB, Ethernet et.al. drivers ?
Are there libraries available in Lua which can be used for scientific computation and/or data mining. In this case I will be needing linear algebra support, numerical analysis support and few more.
Please let me know your opinion if my choice is correct.
Lua is very good for scientific computation because of Torch (http://torch.ch/). The problem in your case would be the periphery support on Windows. For Linux there is https://github.com/vsergeev/lua-periphery but I'm not sure if there is anything good for Windows out there.
Related
I have been reading about libadalang 1 2 and I am very impressed by it. However, I was wondering if this technique has already been used and another language supports a library for syntactically and semantically analyzing its code. Is this a unique approach?
C and C++: libclang "The C Interface to Clang provides a relatively small API that exposes facilities for parsing source code into an abstract syntax tree (AST), loading already-parsed ASTs, traversing the AST, associating physical source locations with elements within the AST, and other facilities that support Clang-based development tools." (See libtooling for a C++ API)
Python: See the ast module in the Python Language Services section of the Python Library manual. (The other modules can be useful, as well.)
Javascript: The ongoing ESTree effort is attempting to standardize parsing services over different Javascript engines.
C# and Visual Basic: See the .NET Compiler Platform ("Roslyn").
I'm sure there are lots more; those ones just came off the top of my head.
For a practical and theoretical grounding, you should definitely (re)visit the classical textbook Structure and Interpretation of Computer Programs by Abelson & Sussman (1st edition 1985, 2nd edition 1996), which helped popularise the idea of Metacircular Interpretation -- that is, interpreting a computer program as a formal datastructure which can be interpreted (or otherwise analysed) programmatically.
You can see "libadalang" as ASIS Mark II. AdaCore seems to be attempting to rethink ASIS in a way that will support both what ASIS already can do, and more lightweight operations, where you don't require the source to compile, to provide an analysis of it.
Hopefully the final API will be nicer than that of ASIS.
So no, it is not a unique approach. It has already been done for Ada. (But I'm not aware of similar libraries for other languages.)
From the book "Learn you some Erlang for Great Good:"
Erlang is no silver bullet and will be particularly bad at
things like image and signal processing, operating system device drivers,
and other functions.
Now, operating system device drivers, sure, but is there any reason why Erlang couldn't be used for digital signal procesing? What is the author alluding to here? Is it just that Erlang would display poor performance in a DSP application, or is there a particular reason why it might be structurally unsuited for the job? (I'm not thinking about using it for DSP, I'm just curious.)
Is it just that Erlang would display poor performance in a DSP application
Not just that: you also won't find many (if any) libraries which help you with that, and you may find Erlang's benefits not of much use in these domains. This applies to "number crunching" in general, image and signal processing are just examples.
While my answer might not be accurate but I think Erlang isn't suitable for "Signal Processing" for the following reasons (of course, it might be there are more reasons. Feel free to correct me):
Erlang lacks the advanced Math libraries. MATLAB is quite impressive in this aspect.
You can't use Erlang for Embedded Software in Real-Time Signal Processing Systems.
I think the main reason is that erlang is not terribly fast, and this would show up in applications with a lot of number crunching. Erlang's strengths are in concurrency and fault tolerance, and these are less relevant in applications like image processing (with little or no concurrency).
OTOH, erlang is good at working with binary data, and it's quite good at parallelism. The hardcore number-crunching parts of a DSP application could be farmed off to C libraries (via ports or linked-in drivers or NIFs). Erlang is a language for soft real-time applications and it's quite at home as embedded software.
So, DSP is not erlang's home turf, but erlang could still be a good fit for a particular DSP (or a particular DSP programmer).
Compiler convert human understandable language into machine level language. Can't we just write a program in machine level language so that it will be easy and quick for a program to execute.
Yes, you can program in assembler under Linux.
Check this and this questions on Stack Overflow, for example. Also, the Linux Assembly HOWTO looks good.
Compiler convert human understandable language into machine level language. Can't we just write a program in machine level language so that it will be easy and quick for a program to execute.
No one writes programs in machine language. Normal binary exectuables are not just machine code anyway, so it would be pointless to try and do this. Binaries contain machine code but include specific, OS dependent formatting. For example, linux uses ELF. This format is understood by the linker and loader (on *nix, the loader is part of the kernel). The only place unadulterated machine code exists is in the system memory.
You can write programs in assembly language, which is very similar to machine language, but then this must be compiled and linked. In other words, it is the same thing as writing a program in any other compiled language.
Finally, creating a binary manually by formatting some machine code would not provide any advantages and it would be an endless headache to work with. You might do it as a learning excercise, but not for any real purpose.
Yes, but then you have to write more and then it takes longer, so using a higher level language and compiler is more efficient on your time. More often than not, a compiler is better than what a mere human can do (they are pretty good programmers these compiler writers).
We've been looking into languages for a ML project at work. A colleague of mine is a big Common Lisp fan, however I have some concerns. Are there any good/modern ML libraries for Common Lisp that people know of (something comparable to Weka)? Also, does anyone know of a good statistics library for CLisp?
Thanks to ABCL you can use Weka in your Common Lisp program.
There are some libraries indexed on cliki RCL, RCLG and cl-random in particular look interesting.
GSLL gives you access to GSL's statistics functions.
I usually use F# for writing numerical algorithms. Functional programming constructs in F# helps to express algorithms in a very natural way. I often end up with a succinct and understandable implementation, and may be able to parallelize it quite fast if there is a chance of parallelism.
I wonder there is a way to compile F# programs down to FPGA. In this way, I can still use F# to avoid boilerplate codes in FPGA programming, and make use of high performance computing in FPGA. Is this possible to do so? If yes, could you provide some hints for me to start with?
I've read about (but never used) Avalda's F# to FPGA conversion, but their site is currently returning a completely blank page. I don't know if that's just temporary of if it means they've gone belly-up.
F# should be ideal for this task because it is derived from the ML family of languages that were bred for metaprogramming. However, I am not aware of any work in this area (although I have had the idea of working on it myself).
I would focus on writing a compiler in F# that compiled a DSL to an FPGA, rather than trying to compile general F# code.
Here's a list for HLS tools using C. My experience with one of them in 2006 was not favourable but I expect them to be much better today.
Regarding F#, I doubt this will exist any time soon.