DEV Community

slidenerd
slidenerd

Posted on

What would it take to create a language that looks like Python but runs like Assembly?

Seriously with so many advancements, why hasn't it happened yet?

Top comments (6)

Collapse
 
syeo66 profile image
Red Ochsenbein (he/him) • Edited

The largest difference between languages close to the machine and higher level languages is probably memory management. Most modern languages take care of this and makes them more "secure" but slower. So to achieve native speed you'd have either take care of memory management yourself (like in C) or it needs to have strict boundaries in place (like Rust). Let's assume you'd have pythons syntax with Rusts security features I can only assume you would not be happy because it would require static typing and Rusts concept of ownership, and your "python" would probably just feel like Rust... so why not just use that?😁

Collapse
 
rollergui profile image
Guilherme

Not sure what you mean… most languages kinda run like Assembly in the end πŸ€”

Collapse
 
slidenerd profile image
slidenerd

well i am talking about a language that syntactically looks like Python but has the performance of assembly language

Collapse
 
rollergui profile image
Guilherme

Assembly is what the CPU knows. For what you want to be possible, they would have to make CPUs that understand that new syntax. But that would probably make them slower, cause there would be a lot more instructions to interpret and run. Life is what it is

Thread Thread
 
jimmyrleung profile image
Jimmy Rios Leung

this

Collapse
 
giacomobrunetti profile image
GiacomoBrunetti

The closest thing is Cython, which is interpreted "ahead of time" rather than "just in time". Quite cool to be honest, and FAST.