May be this was so long information despite you have to read once...
Not one language is best for AI but the three language levels, that you usually need.
- Bare metal language level, that is Assembly and other hardware efficient routines, which also includes the usage of GPU and FPGA power. This will cover crucial algorithms and you can do that like at least 5 times faster than on the next level.
- Compiler language level, usually “C”, where you get shit done and where you are implementing the bigger algorithms at large. With access to very efficient subroutines in Assembly or hardware, you get an almost optimal way of processing data. Everything you do here is at least 5 times faster than the next level, often you get factor 200 or up to factor 10k. Don’t do any actual work on the next level.
- The script level, which is usually any HLL, but a simple and efficient script like Lua would even work. Sometimes you’ll find data base level here or even the use of prototype languages like Prolog or Python. The latter has the great danger, that your average limited HLL freak will start to actually do things in that script and with that will waste like factor 200 of your available hardware by that.
But the script level is important. You have to be able to change the data flow and configuration of the programming of your algorithms from this level, without the need to recompile it.
A prototype language like Prolog or Python is dangerous, because people tend to stay on this level and don’t move their core algorithms out on the second level.
But you will often see Lua and database languages here.
While the use of database languages is one of the limits of current AI systems. Those languages are usually so slow, that they must not be used for this. The data flow inside of AI processes is so high, that you need to keep the data moving. You can’t wait for a base to do its thing. Maybe Sqlite is a solution, because it’s moving the L3 language nearer to the L2 core with that.
All in all it is not a single language. And even on each of those three levels you will most likely not only use one language but some. Like Assembly and Cuda or OpenCL on L1, maybe Verilog for hardware implementation of some of the networks.
There is no single “AI language”, we are engineers and we have a toolbox. We need everything in there to be able to do our thing. And not just the screwdriver and try to drive the nails into walls with that.
There is a place where HLL should be used in those levels and if you are overusing it, you will wreck your project. And most often it is not just one program but many programs working together. And if you start doing the scripting work with your core-language you will fuck up your system, too. Because you have to recompile everything just because you did a little change or did change the configuration.
Same is true for the bare-metal level 1.
The HLL level should be expandable by the core level. Like it is possible with Lua and like it was in the beginning of the age of scripting. With Basic, with Rexx, with Perl. All those languages were expandable and you always were able to add new functionality to them by writing functions in a core language.
The usage of HLL today is wildly grown decadent. Show me how to expand Python with a core language routine or package? That’s hell of complicated to do, if it is possible at all. “Write HLL in HLL” is the credo since, uh, since the Lisp people took over with their toxic credo and poisoned the world of programming with this bullshit.
Lazy.
I call this lazy, to be so inflexible to leave one level and move on the correct level of implementation. And stay on that one level like an oak tree in the storm. It’s usually the tree that splinters and feeds the worms when the storm is over. It’s a good way for an oak to die: inflexibility.
You have to move over those three levels. Whichever languages you might chose to use. But always, really always, be flexible and chose a language that has a smooth, easy, and expandable interface to the next level of languages, up and down.
Always chose a language that plays well with the other kids and that can climb the hierarchy. Negative example: C++ doesn’t work well. You can’t link C++ up to anything. Only down to C. The only way up is over socket connections or something like that. And that’s bad. It doesn’t play well with the other kids.
That’s my advice. You have different problems in AI and with different problems you might want different languages to describe them. Make sure those languages cooperate well with each other. If they don’t: don’t use them.
Comments
Post a Comment