11,680 reputation
12851
bio website
location
age
visits member for 4 years
seen 1 min ago

13h
comment How does artificial intelligence work?
For the most part, it doesn't.
2d
comment Simulated Annealing Contradiction?
@extremeaxe5 I would think so, but I have no experience to support that claim. For one or two dimensions, there are many other techniques that work great and only degrade in higher dimensions because they scale worse-than-linear as the dimensionality grows.
Nov
22
comment OSS Non-Commericial License
A license that prohibits commercial use is not an open source license.
Nov
22
comment Why does Facebook convert PHP code to C++?
@Alice Also, many JIT compilers do use SSA and perform the optimizations that become trivial in SSA. The optimizations they lack are the ones that are primarily those that are relatively expensive regardless of IR (such as register allocation, aggressive inlining, inter-procedural optimization). And yes, "for free" is an overstatement, but inserting type profiling into the code and collecting type information during runtime is far easier than any static analysis.
Nov
22
comment Why does Facebook convert PHP code to C++?
@Alice We're talking about highly dynamic languages. There are no simple and effective AOT (i.e. static) type inference algorithms for languages like Python or JavaScript. There are complicated on-line/run-time algorithms (as used in SpiderMonkey for example) that are effective, and there are complicated AOT algorithms (e.g. Starkiller) which so far failed to prove themselves effective. Algorithm W does not even begin to address the complexities of dynamic languages.
Nov
20
comment type infered statically typed languages?
@Jules Check out Rust. Its memory management is manual (in that one is in full control where stuff is allocated and when it's freed), but it prevents dangling references. There are of course escape hatches, but those exist even in Haskell and OCaml.
Nov
19
comment type infered statically typed languages?
A note on terminology: What you call a typesafe language is usually known as a language with a static type system. What you call typeless would correspond to inferred types, except that the latter implies a static type system while you seem to consider dynamically typed languages typeless too. In summary, you want a language that infers (or rather, can infer) all types.
Nov
19
comment Why are the raw pointer values being overwritten/falling out of scope
You're giving out pointers that are only valid for the life time of the std::strings they came from, then merrily go on doing whatever you did on that thread, presumably discarding some of those std::strings along the way. That's fundamentally broken, no way around it. That's not really any different to storing the char *s in an ordinary data structure, dropping the strings, then fetching the char *s from where you stored them. Get your lifetimes together.
Nov
19
comment Why do functional programs have a correlation between compilation success and correctness?
@faif Clojure has no type system or compile-time checks either.
Nov
19
comment Why do functional programs have a correlation between compilation success and correctness?
Lisp is a functional language, yet it has no compile time checks to speak of. Same for a few other functional languages. A more accurate characterization of the languages you talk about would be: Languages with powerful formal (at least Hindley-Milner) type systems.
Nov
16
comment Why does Facebook convert PHP code to C++?
@Alice The kind of analysis necessary to put an AOT PHP compiler in the same league as a JIT compiler is expensive (in compile time) even for an AOT compiler and also quite expensive in implementation effort. Fundamentally, an AOT compiler needs to figure out very complicated flow- and data-dependent information (most importantly, the types actually stored in variables and data structures) that a JIT compiler gets for free. That information is the great difference; clearly if an AOT compiler has the same information it can beat a JIT compiler by optimizing more.
Nov
12
comment Big O notation allocate array of N element
@KilianFoth Yes, it's certainly possible to get initialization at no extra cost during allocation (though it probably makes other operation, e.g. deallocation, more expensive). But in any case it is a facet that must be considered.
Nov
12
comment Big O notation allocate array of N element
Note that new[] (in C# and also in C++) not only allocated but also initializes.
Nov
12
comment Big O notation allocate array of N element
@11684 While I agree in principle (see my previous comment), those C examples I can't get behind. Nothing any sensible person would call an array is non-contiguous. And speaking of O(gaps) complexity is very misleading: There are many allocator designs, many with quite different performance characteristics. Plus, O(gaps) isn't useful because the number of gaps is completely arbitrary and depends in complicated ways on the internals of the allocator and the global allocation behavior of the program.
Nov
12
comment Big O notation allocate array of N element
@Niels It depends on the model of computation if new[] is considered a primitive operation in your model of computation, or on the assumed implementation of new[] if it's not. Adding two integers may take O(1) time in the RAM model, or O(d) on a Turing machine (where d = the length of the numbers).
Nov
11
comment Race conditions in JVM languages versus C/C++
@Siler No, if there is a (reachable) reference to it, it won't be collected. The GC takes care of that much.
Nov
11
comment Reference counting & GC in LISP
Sure, but that is orthogonal. I only object to implying that refcounting can't handle parent references in trees.
Nov
11
comment Do we really need auto-vectorization?
@Jules Well, not quite, there is also SLP vectorization which transforms straight-line code without loops (basically, basic blocks).
Nov
11
comment What are the practical implications of homotopy type theory in programming?
HoTT seems to be very exciting research into the foundations of mathematics, but if its predecessor/contender (set theory, specifically ZFC) is any indication, the foundation of mathematics has little implications even for most working mathematicians, let alone laymen.
Nov
10
comment Is there any mechanism to make programming language more stable(compatible) for changes?
More stable means to me fewer changes happening (hopefully because they aren't necessary), the exact opposite of backwards-incompatible changes. Which are you interested in, or are you asking about both semi-independently?