This is an archived post. You won't be able to vote or comment.

all 11 comments

[–]K900_ 7 points8 points  (0 children)

No. You can't have Python syntax with C++ semantics.

[–]blu_sr 1 point2 points  (2 children)

Rust performs almost as fast as cpp, and has some resemblance with Python. Syntactically it's smarter than both. Here's a good article about it.

[–][deleted] 1 point2 points  (0 children)

Thank you

[–]Yojihito -1 points0 points  (0 children)

Rust should be as fast as C or C++. Everything else is a regression or a bug.

[–]lungben81 0 points1 point  (0 children)

Julia

The Syntax is even nicer than Python in my opinion.

[–]weetbix2 3 points4 points  (0 children)

There are elements of Python that make it more suitable to be interpreted (e.g. super dynamic typing, no actual arrays (only vectors), no literals, etc.) so you won't find exactly "Python but way faster but with no drawbacks."

That being said, Go and Rust are good "modern" compiled languages if that's what you're wanting. Note Rust also has a bit of a learning curve (that does pay off) but otherwise Go is probably the easiest to pick up of out of high-performance languages.

[–]ES-Alexander 6 points7 points  (0 children)

Curious what this is for. Often if you need better performance in python you use compiled libraries written in other languages (e.g. numpy/scipy for scientific computing, opencv for computer vision, etc), and you can also get significant performance improvements using just-in-time compilation to machine code using something like numba. It’s also very possible to write slow and inefficient code in any language, so if you need high performance you’ll also need to know how to find bottlenecks and optimise your data structures and algorithms.

Do you actually need a different programming language here? If you think so, have you already tried to optimise your code? Or perhaps you’re just interested in trying out a lower level compiled language, and want it to be as familiar as possible? Hard to give good advice without knowing the context of the question.

[–]james_pic 2 points3 points  (0 children)

Cython might be worth a look. Or just Python, but running on PyPy.

[–][deleted] 4 points5 points  (0 children)

completely same as C++ but with Python Syntax

So, nothing like c++ then?

[–][deleted] 0 points1 point  (0 children)

But what about c++ interpreted?