Skip to main content

All Questions

Tagged with
6 votes
2 answers
649 views

When the stack frames become computationally expensive

I've been experimenting with different data structures and algorithms in Python, Java and C to see in what circumstances function/method inlining could bring meaningful gains in terms of the execution ...
ipastusi's user avatar
  • 171
3 votes
1 answer
419 views

Is C usually a last resort?

I've been learning C recently. I've completed a number of coding challenges on websites like codewars in C, and I always find myself wishing I had something like Python's flexible data structures. In ...
Connor's user avatar
  • 159
0 votes
2 answers
1k views

How can Python, a language that supports Object Oriented Programming, be implemented in C, which is not an Object Oriented Programming language?

To my understanding, C does not have the concept of objects, then how can Python be implemented in C to support something that C can not? How is the concept of "Object" modeled in C? What is ...
Alice's user avatar
  • 39
-2 votes
1 answer
124 views

What should I use to graphically represent an object's position on a fixed path using python(preferred)?

Consider 2 roads merging into one(This map is supposed to remain fixed). The program will not generate this map. The program will read this map and plot positions on it on its own. The python program ...
Jayant's user avatar
  • 9
2 votes
2 answers
387 views

Loop complexity in C Vs Python

Just now I was reading a Python question on stack overflow, about clamping a list/array of results to be within a certain range. Once of the more simple answers suggested something like: ...
Kingsley's user avatar
  • 663
4 votes
1 answer
2k views

Managing error code and error message mapping

As part of a game engine I am writing in cython, one of the challenges I am facing is creating a consistent interface for error handling that works at the C and python levels of my code. I am ...
CodeSurgeon's user avatar
-1 votes
1 answer
231 views

Possible motivation of having a minimal main function as in CPython source code?

I was recently looking through the CPython source code and noticed something rather intriguing: /* Minimal main program -- everything is loaded from the library */ #include "Python.h" #include "...
Aykhan Hagverdili's user avatar
1 vote
3 answers
5k views

How and why do we have underscores in variable naming

If I look in python code and sometimes maybe also in C codes, there is often two variables with the same name except for the underscore. For example two variables variable1 data; variable2 _data; Why ...
Niklas Rosencrantz's user avatar
0 votes
3 answers
1k views

Definition of Generic function

1) Below is a python function summation, that can perform sum of cubes/squares/.., similar operations. def identity(k): return k def cube(k): return pow(k, 3) def square(k): return ...
overexchange's user avatar
  • 2,305
-7 votes
1 answer
498 views

Detect if code is C

I am currently using Python to write a compiler manager. I have to detect whether given source code is C, even if the code has a few syntax errors. I am currently using the file's extension to tell, ...
Nick Pandolfi's user avatar
1 vote
4 answers
3k views

Why use a higher level language? [closed]

A question that gets asked a lot is "Why use low level languages if you can code in high level languages more easily (and often tersely)?". I think the answers are fairly straight forward here, being ...
Daniel Porteous's user avatar
-1 votes
2 answers
576 views

How are complex programs made? [duplicate]

I know a few languages, and can program in them. How do multiple languages blend together in a single program? For ex. https://github.com/facebook/watchman. This uses C, PHP, Python, Javascript, etc. ...
user194207's user avatar
0 votes
3 answers
1k views

Socket Connecting to Large number of IPs

I have a text file of ~600 CIDR notation IP blocks which, when expanded, amount to ~17.5M IP addresses. I need to socket connect to each one. If it connects, I add it to a "live" list, if it returns ...
EruditeEremite's user avatar
0 votes
2 answers
792 views

What are and how do (data-) types work?

What is a "variable"/data type? How does a compiler / interpreter handle types? My specific concern has to do with the different types in lower and higher level languages. For instance in Python, as ...
user avatar
1 vote
2 answers
1k views

Languages implemented in Python?

AFAIK, Scala and Clojure are implemented in Java and Java is implemented in C. I suppose that many or most languages are implemented in C, for instance Perl, Python and SQL. I don't know much about ...
Niklas Rosencrantz's user avatar

15 30 50 per page