MSalters
  • Member for 7 years, 6 months
  • Last seen more than a week ago
  • Netherlands
What is a safe programming language?
16 votes

While I don't disagree with D.W.'s answer, I think it leaves one part of "safe" unaddressed. As noted, there are multiple types of safety promoted. I believe it's good to understand why there are ...

View answer
Is a computer without RAM, but with a disk, equivalent to one with RAM?
7 votes

No. Disk drives are not Random Addressable like RAM. Instead they're block storage devices. You can't read or write a byte from them. And your CPU cannot read a whole sector at once, they need that ...

View answer
Example of a graph with negative weighed edges in which Dijkstra's algorithm does work
4 votes

Yet another way to prove the existence is to take any graph G, and replace one edge E with weight W by two new edges and an intermediate node N. Let the first new edge have weight -W/2 and the other ...

View answer
Why does little endian apply to numbers and not to text strings?
Accepted answer
4 votes

The premise is wrong. Unicode encodings include UTF-16BE, UTF-16LE, UTF-32BE and UTF32-LE. Only UTF-8 has no Litte-Endian or Big-Endian variants. Fundamentally, Endian-ness is about the byte order of ...

View answer
When inserting a new vertex in a DAG, what possible changes are there to the edges
2 votes

Based on the comments, I missed one case: Add an unconnected node. I considered another approach to answering the same question. Consider the set of edges E in the original graph, and the set E' ...

View answer
Why do register machines outperform stack machines?
2 votes

Stack machines have a specialized hardware architecture, which is ideal for some problems. For the vast majority of algorithms, it's not optimal. For instance, take sorting. With random access, ...

View answer
Is C++ considered a language with high or low orthogonality?
Accepted answer
2 votes

By many standards, Java would not be considered weak in this respect. Java was not one of the first-generation languages. By the time it was developed, quite a few things were known about language ...

View answer
Does the callback concept of programming have any basis in computer science?
2 votes

Yes, callbacks belong to to the family of Higer-order functions. Because they're one of the simplest members of the family, they're often encountered in practice.

View answer
What parts of a programming language can't be defined using Regular Expressions?
2 votes

Another example of a non-regular language rule can be found in C. The 4 tokens x * y ; can be parsed as a pointer definition or a multiplication. The correct parse depends on meaning of x. When x ...

View answer
How does one go about designing a system that never crashes?
2 votes

It wasn't possible back then, in the absolute sense. What you're essentially looking for when you say "never crashes" is a system that always makes progress towards its goals. Today, we can prove that ...

View answer
What is storing an instruction like?
2 votes

There are many theoretical ways to express an (arbitrarily complex) function in numbers, historically starting with the abstract model known as the Turing Machine. Those aren't always efficient for ...

View answer
Why the most dominant programming languages didn't follow CSP thread model?
Accepted answer
1 votes

Practically speaking, the C++ threading (memory) model is directly inspired by the Java Memory Model, and C followed. Hans Böhm was closely involved with the process and has a great resource list. (*) ...

View answer
Virtual address translation
Accepted answer
1 votes

I suspect that the problem may lie in your title. There's a whole lot of real-world variety imaginable in memory architectures, and your book will describe them in the abstract. Importantly, in the ...

View answer
Data structure or algorithm for quickly finding differences between strings
1 votes

Two strings of length k, differing in one character, share a prefix of length l and a suffix of length m such that k=l+m+1. The answer by Simon Prins encodes this by storing all prefix/suffix ...

View answer
Find the smallest binary digit multiple of given number
1 votes

No idea where you got that 9 from, in the last line of the question. Having said that, You have to know that "concatenating" numbers is equivalent to multiplying the first number by a power of 10, ...

View answer
Number of seeks in an I/O efficent algroithm
Accepted answer
1 votes

You're missing the trivial point that the input is on disk, and needs P seeks to be read, while the output needs to go to disk and needs Q seeks to be written. (Or 1+1 in the cases they're contiguous ...

View answer
Number of memory accesses
1 votes

The proposed architecture apparently does not use CPU registers. That means all data must be stored in main memory. Instructions will then need to know where in main memory their arguments are. So, ...

View answer
How was multiprogramming brought into computer languages
1 votes

If you're really interested in all that's needed, your best choice would be to look at the standardisation process of C++11 by the ISO Working Group on C++ (WG21). All the relevant papers are ...

View answer
Exactly how many clocks does a Computer consists of and how do they synchronize with each other?
1 votes

The description is hopelessly outdated. For instance, "the Control Bus" ? I wouldn't even know what bus that would be. It's apparently not the "Internal Clock", so presumably "the Control Bus" is the ...

View answer
What are some "easy" unreasonable implications of O(1) time memory access?
1 votes

The fault in the logic here is that n bits are processed in parallel. Roughly speaking out of those n bits, m<n bits are used to select the chip, and on the chip m-n bits are used to select the ...

View answer
How did early computers handle variable word length?
1 votes

A "coded character" is merely a character representing code (not data). The concept of a bit marking the end of a word is still in use today, in the UTF-8 encoding. Simply said, if the bit is set, ...

View answer
Time Complexity of inserting a vector to a vector of vectors in C++
0 votes

This requires a bit of C++ knowledge. push_back will copy or move the argument. Copying a vector is O(n), moving it is O(1). In this case, the argument on line X is subs[i], which does not allow a ...

View answer
Is it possible to modify the linux assembler in order to modify what fuctions do?
Accepted answer
0 votes

While this is trivially possible, the fundamental flaw in your idea is that assemblers are not interpreters. Python programs are run by the Python interpreter, Swapping - and + in the Python ...

View answer
Are managed computer programming languages eco-friendly?
0 votes

As a theoretical matter (this is CS, not Engineering) the run-time generation of executable code has a possible benefit of choosing more energy-efficient constructs that might not universally be ...

View answer
Are CPU architectures biased towards procedural runtimes?
0 votes

Without a doubt, yes. In particular, the communications model implied by C99 is shared-memory. More advanced concurrent languages have richer communication models, such as message passing channels (...

View answer
How can memory size be 1M x 16?
0 votes

Well, just consider the common 4Gx8 memory size. That's 4 billion octets. How's that possible? Simple: a unique address takes 4 octets. Now you can figure out how many 16-bit words you need for an ...

View answer
What is the relationship between tail recursion with other recursions?
0 votes

Tail recursion is a specific implementation detail. Mathematical functions are not algorithmic implementations, so the concept does not make sense. To be precise, tail recursion is a specific ...

View answer
How is the oracle function for Grover's Search algorithm obtained?
0 votes

On re-reading I found the source of the confusion. in classical logic, an oracle function is introduced in the construction of an inverse function x=f_inv(y) when you have an efficient y=f(x). You ...

View answer
How do you have a type typed "Type" when implementing a programming language?
-1 votes

I suspect that part of the problem might be your choice of root type. A root type typically is a type with very few properties, because (by definition) it's the union of properties of all types. Yet a ...

View answer