Reputation
18,090
Top tag
Next privilege 20,000 Rep.
Access 'trusted user' tools
Badges
1 47 73
Newest
 Nice Answer
Impact
~310k people reached

Sep
30
awarded  Good Answer
Sep
29
awarded  Nice Answer
Sep
29
comment How to protect source code from being copied or leaked by employes
The thing you are worrying about. Employees stealing and publishing the source code.
Sep
29
comment How to protect source code from being copied or leaked by employes
Do you really think this is a thing that would actually happen?
Sep
29
revised Is there a specific reason for the poor readability of regular expression syntax design?
typo which completely changed the meaning of a sentence
Sep
29
comment Is there a specific reason for the poor readability of regular expression syntax design?
@biziclop I wouldn't overestimate this variable. Yacc, which apparently had enough predecessors to be called "yet another compiler compiler", was created in the early 70s, and was included in Unix a version before grep was (Version 3 vs Version 4). It appears the first major use of regex was in 1968.
Sep
29
revised Is there a specific reason for the poor readability of regular expression syntax design?
added 128 characters in body
Sep
29
answered Is there a specific reason for the poor readability of regular expression syntax design?
Sep
25
comment Can there be value types in dynamic languages?
It is not impossible to tell whether it's a value type, and indeed it isn't a value type in CPython. An int has a persistent identity accessible via id(). Check the id throughout various transformations and you'll see that e.g. assignment and parameter passing keeps the same id and something like n + 1 - 1 will (for sufficiently large n that aren't interned) produce a separate object with a different id (i.e., the id is a real identity, rather than representing the integer's value).
Sep
8
awarded  Good Answer
Aug
30
comment Why do Haskell and Scheme use singly-linked lists?
Tail sharing does not happen as you imply, though. Generally, nobody goes through all the lists in memory and looks for opportunities to merge common suffixes. The sharing just happens, it falls out of how the algorithms are written, e.g. if a function with a parameter xs constructs 1:xs in one place and 10:xs in another.
Aug
26
comment Why do arrays in .Net have Length but other collection types have Count?
A T[] with a length of N always stores exactly N values of type T. Semantically, not all of those values may be meaningful (they might be null for example), but they exist. This is different from the usual meaning of capacity (as used by List<T> for example). You're right that Count can change while Length can't. Then again, nothing mandates that Count will, in fact, change. It is also used for immutable collections.
Aug
20
comment Why does Python's math.ceil return a float?
Actually in Python 3 it does return an integer.
Aug
19
comment Checking array size in C/C++ to avoid segmentation faults
The word statically is key: The reduction to the halting problem only works if we want to rule out all programs that go out of bounds, but no more, and without running the program. If run-time checks are permitted, the problem is almost trivial, it just has runtime overhead (and a quite large one, for a naive solution). Likewise, it is easy to reject all programs that go out of bounds as well as some that don't (the hard part is not rejecting practically useful ones).
Aug
18
comment Mutable AST vs. different immutable ASTs
@DeadMG The easiest example to defend would be if the semantic analysis is split in multiple passes (e.g., name resolution, then type inference). And it's pointless to argue whether this is a "semantic tree" or a "syntax tree". It contains all the original structure and nodes of the AST, though augmented with additional data, that's good enough for me.
Aug
18
comment Mutable AST vs. different immutable ASTs
@DeadMG Because some semantic analyses need to annotate basically every part of the program (with a type, for example) and preserve the syntactic structure for later passes? This is standard practice in compiler construction as far as I know.
Aug
16
comment Open Source License that prohibits verbatim resale?
If the trademark is something visible like the user name or the logo, then I don't think it will help with your intent. Yes, now these people need to change the name/logo/etc., but that is hardly any better than re-selling verbatim. So if they do that and release the result without any further changes, the situation is worse, because it's not obvious any more (to the casual observer) that this is exactly the same app.
Aug
16
awarded  Good Answer
Aug
14
comment Can higher order functions ever be pure?
@Giorgio I know all that. It's a cool idea that makes Haskell arguable the world's finest imperative programming language. It just doesn't matter here: We're talking about distinguishing pure computation from impure actions, and the IO monad does exactly that.
Aug
14
comment Can higher order functions ever be pure?
@Giorgio You could say that, but functions of type a -> IO b are the moral equivalent of impure functions, so in the context of this question I don't feel that is a useful position.