A question on the code used in AI

Why is it using higher level languages like Python, that are very slow to process and not Assembly or C for both size and optimisation.

Using lower levels makes size smaller and usage for CPU, GPU, RAM becomes lower.

For example Hello world in assembly or C takes 5seconds to proces while in python it takes around a min. I tryed to find information but the only thing I found was Higher levels are easier to read.

Good question — the part that surprises most people is that the heavy work already runs in compiled code: when a model trains or generates in Python, each large operation is handed straight to C++ and CUDA routines, and Python is only the conductor telling them what to play next, so its own overhead is a small fixed cost spread over the much larger GPU work. Rewriting that conducting layer in assembly would leave the actual computation exactly as fast while making it far harder to build and change, which is why the ecosystem optimizes the kernels, not the glue. You can see it directly: profile one training step and compare the time inside the kernels with the time in Python, or time a real Hello World — both languages finish in milliseconds, and Python’s extra cost there is startup, not a minute of processing.