Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
1 vote
2 answers
7k views

Will compiled python code be as fast as compiled C++ code?

I know that Python is an interpreted language and that c++ is a compiled one, or at least I like to think that I've understood some of their differences. Although C++ is apparently faster than ...
Marstjugo's user avatar
4 votes
4 answers
2k views

Ahead-of-time compilation to native machine code of dynamically typed languages

It is my understanding that: It's particularly difficult to compile ahead of time, to efficient native machine code, a dynamically typed language like Python. Largely as a result of the above, the ...
Amelio Vazquez-Reina's user avatar
3 votes
2 answers
1k views

Representing a structure/tuple type with Hindley Milner Type Inference

I'm writing a really simple interpreted object oriented programming language with a C-like syntax. I've been looking into type inference and I've found a few implementations of the 'Hindley-Milner ...
NegativeBreakfast's user avatar
0 votes
2 answers
300 views

How do interpreters and VM print?

While direct Language-Assembly compilers generate the code required to perform specific task for the given platform, how do interpreters do it? Abstract example The following pseudo-code... printf(&...
Sam Neezneny's user avatar
-7 votes
1 answer
130 views

Why we need compile PyQt before use it on Mac?

Why we need compile PyQt rather than simply using 'pip install' to put PyQt to my package repository? What happened during the compiling? Can I compiled PyQt once but allow many Macs through share ...
Isaac's user avatar
  • 101
26 votes
2 answers
1k views

What semantic features of Python (and other dynamic languages) contribute to its slowness?

I don't know very well Python. I'm trying to understand more precisely what exact features of dynamic languages (à la Python, Lua, Scheme, Perl, Ruby, ....) are forcing their implementations to be ...
Basile Starynkevitch's user avatar
22 votes
1 answer
3k views

Why does the documentation on some languages say "equivalent to" rather than "is"?

Why does the documentation on some languages say "equivalent to" rather than "is"? For example, the Python Docs say itertools.chain(*iterables) ... Equivalent to: def chain(*...
Jon McClung's user avatar
8 votes
1 answer
5k views

How are scripting languages compiled?

I know the term "scripting languages" is just a subset of programming languages, but I want to refer to programming languages such as Python and Ruby among others. First of all, why don't we need a ...
chris's user avatar
  • 251
11 votes
3 answers
8k views

Why does Python need both a compiler and an interpreter?

I can understand the fact that Java needs both a compiler and an interpreter. It compiles source code to bytecode and then a virtual machine (on Windows, on Linux, on Android, etc.) translates that ...
aris's user avatar
  • 119
4 votes
2 answers
5k views

Difference between PyPy and JVM

From my understanding the default Python interpreter(CPython) compiles source code into bytecode and then interprets the bytecode into machine code. PyPy on the other hand makes use of JIT to optimize ...
BubbleTree's user avatar
2 votes
1 answer
507 views

Allow user to enter DSL, rules or code?

I have a python library that allows me to define rules by chaining inputs and outputs of functions ( producer(grep(count( [print(),log() ] ))) This functions define a pipeline from left to right. ...
marianov's user avatar
  • 123
9 votes
4 answers
13k views

How does Python compile some its code in C?

I read that some constructs of Python are more efficient because they are compiled in C. https://wiki.python.org/moin/PythonSpeed/PerformanceTips Some of the examples used were map() and filter(). I ...
Howcan's user avatar
  • 721
37 votes
3 answers
35k views

Why isn't there a python compiler to native machine code?

As I understand, the cause of the speed difference between compiled languages and python is, that the first compiles code all way to the native machine's code, whereas python compiles to python ...
user2986898's user avatar
12 votes
3 answers
2k views

What are the challenges related to typing in writing a compiler for a dynamically typed language?

In this talk, Guido van Rossum is talking (27:30) about attempts to write a compiler for Python code, commenting on it saying: turns out it's not so easy to write a compiler that maintains all the ...
syntagma's user avatar
  • 309
35 votes
5 answers
132k views

Why doesn't Python need a compiler?

Just wondering (now that I've started with C++ which needs a compiler) why Python doesn't need a compiler? I just enter the code, save it as an exec, and run it. In C++ I have to make builds and all ...
Billjk's user avatar
  • 1,249

15 30 50 per page