language-implementation

Internal implementation of java.util.HashMap and HashSet

I have been trying to understand the internal implementation of java.util.HashMap and java.util.HashSet. Following are the doubts popping in my mind for a while: Whats is the importance of the @Override public int hashcode() in a HashMap/HashSet? Where is this hash code used internally? I have generally seen the key of the HashMap be ...

C/C++ Control Structure Limitations?

I have heard of a limitation in VC++ (not sure which version) on the number of nested if statements (somewhere in the ballpark of 300). The code was of the form: if (a) ... else if (b) ... else if (c) ... ... I was surprised to find out there is a limit to this sort of thing, and that the limit is so small. I'm not looking for comme...

Why is the main method entry point in most C# programs static?

Why is the main method entry point in most C# programs static? ...

PyPy -- How can it possibly beat CPython?

From the Google Open Source Blog: PyPy is a reimplementation of Python in Python, using advanced techniques to try to attain better performance than CPython. Many years of hard work have finally paid off. Our speed results often beat CPython, ranging from being slightly slower, to speedups of up to 2x on real applicat...

How could one implement C++ virtual functions in C

Possible Duplicate: Object oriented programming in C The C++ language provides virtual functions. Within the constraints of a pure C language implementation, how can a similar effect be achieved? ...

How are arrays implemented in Perl?

The Perl array is an abstract data type. What's the internal mechanism for the Perl array? Is it implemented with dynamic array or linked list? Since the array elements have random access, I would assume a dynamic array of pointers, or references to scalars make sense. However, with shift and unshift operation at the head of array, woul...

How does the decimal accuracy of Python compare to that of C?

I was looking at the Golden Ratio formula for finding the nth Fibonacci number, and it made me curious. I know Python handles arbitrarily large integers, but what sort of precision do you get with decimals? Is it just straight on top of a C double or something, or does it use a a more accurate modified implementation too? (Obviously not...

How does a macro-enabled language keep track of the source code for debugging?

This is a more theoretical question about macros (I think). I know macros take source code and produce object code without evaluating it, enabling programmers to create more versatile syntactic structures. If I had to classify these two macro systems, I'd say there was the "C style" macro and the "Lisp style" macro. It seems that debu...

Is there a Scheme implementation that parallelizes?

Is there a R5RS-or-higher Scheme implementation that does parallelization? For example, if I say to do: (map (lambda (x) (pure-functional-stuff x)) '(1 3 5 7 11 13)) it will process 1, 3, 5, and 7 simultaneously if the machine can do it? That's supposed to be one of the big advantages of functional programming, but I c...

Javascript implementation question: how to make this function display values.

Please forgive me, but I do know js basics and how to write/call a basic function, but in this case I'm trying to match an alpha sorted list of categories from the DB to match against my set (non-alpha) order of said categories as specified below (this is code suggested for use by another user on a question I asked about how to map the o...

What systems out there use non-uniform pointer representation?

Possible Duplicate: Are there are any platforms where pointers to different types have different sizes? I have read in several places that pointers of different types may have different representations in standard-conforming C implementations. This is one thing that makes it necessary to cast pointer arguments to printf, e.g....

What are the possible ways to do garbage collection in concurrent systems?

I need to write a garbage collector for an interpreter that will support concurrency, but I can only find information about garbage collection without anything to do with concurrency. Are there specific methods for garbage collection of objects in multithreaded systems? Where can I find information on their architecture and implementati...