Reputation
28,909
Next tag badge:
116/100 score
14/20 answers
Badges
5 57 103
Newest
 Civic Duty
Impact
~612k people reached

  • 0 posts edited
  • 8 helpful flags
  • 304 votes cast
9h
comment What high level languages are the most performant?
… class in YARV, which is written in C and in JRuby, which is written in Java. So, Ruby can be as fast as C if used right and with a good implementation. JRuby+Truffle can run native Ruby C extensions faster than native C Ruby, for the surprising reason that JRuby+Truffle interprets the C source code of the C extensions instead of using their compiled binaries.
9h
comment What high level languages are the most performant?
@RobertHarvey: But then he should ask about specific implementations of the languages he is interested in. There are about a dozen implementations of C++ and about 4 implementations of Python, and I am pretty sure that for every piece of benchmark code you show me, I can find you a pair of C++ implementation and Python implementation where C++ is faster and another pair of C++ implementation and Python implementation where Python is faster. Switching to the Ruby world, where I am more knowledgeable, the Hash class in Rubinius is written in pure Ruby and performs comparably to the Hash
1d
comment Type system for performance
Dependently-typed languages like Agda, Coq, Epigram, Guru, Isabelle, etc. "solve" the Halting Problem, Rice's Theorem and friends by not being Turing-complete. Either by construction (i.e. it is simply not possible to write an infinite loop / non-terminating recursion), by requiring that all programs must be written in such a way that the termination checker can prove termination, or by requiring the programmer to submit a machine-checkable termination proof.
2d
comment Why List<E> interface is additionally introduced in collection hierarchy?
This is explained much better than I could ever hope to achieve in On Understanding Data Abstraction, Revisited by William R. Cook. It uses Java for the examples, but it applies just as well to C# or any other language.
2d
comment Why List<E> interface is additionally introduced in collection hierarchy?
Note: there is nothing wrong with doing ADT-oriented programming in Java, but if you want to do OO, then you can't use classes or primitives as types.
2d
comment Why List<E> interface is additionally introduced in collection hierarchy?
Also, interfaces define object types, classes define abstract data types, so, if you want to do object-oriented programming in Java, you must use only interfaces as types, you cannot use anything else (classes or primitives) as types. This means: types of locals, fields, static fields, method parameters, method return types, the argument to an instanceof or cast operator, and the type argument to a generic interface can only be interfaces. Classes can only be used as factories, i.e. the only place a class is allowed to appear is directly next to a new. Nowhere else.
Jul
1
awarded  Civic Duty
Jul
1
comment is it an implementation issue or a bug?
I'm voting to close this question as off-topic because it belongs on StackOverflow but is not of sufficient quality to be migrated there, since it would be closed as "Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers."
Jun
30
comment Software Design, Generic Programming, Physical Devices, and Algorithms in C++
I'm not sure you can cover Java Generics at all, to be honest. Martin Odersky, the designer of Scala, once wrote on the Scala mailinglist that he believes that there are maybe three people in the world who understand Java Generics. And he should know, in addition to being the designer of Scala, he also designed Java Generics and wrote the current incarnation of Sun/Oracle javac! (And from the tone and context of that mail, I get the impression he – the designer(!) – does not count himself among those three people.)
Jun
28
answered If passwords are stored hashed, does that mean that theoretically there exists another password that could be used to log in?
Jun
28
comment Lambda Return Type Inference
It's questions and answers like this that restore my oft tested faith in SO/P.SE.
Jun
28
awarded  language-design
Jun
27
answered How is a state machine different from any other computer program?
Jun
27
answered Is there such a thing as the testing of automation?
Jun
25
comment Why can't I use an operator like plus sign to concatenate strings?
The question explicitly mentions addition.
Jun
25
comment Why can't I use an operator like plus sign to concatenate strings?
@gnat: Actually, the string concatenation operator in Smalltalk is ,.
Jun
25
answered Why can't I use an operator like plus sign to concatenate strings?
Jun
24
awarded  Nice Answer
Jun
23
answered How safe is it to compile a piece of source code from a random stranger?
Jun
23
comment How safe is it to compile a piece of source code from a random stranger?
Scala, Template Haskell, almost all Lisps can execute arbitrary code at compile time. All languages with a Turing-complete type system (Scala, Haskell) can perform arbitrary Turing-computation at compile time including but not limited to an infinite loop. C++'s Template system is Turing-complete, again, allowing you to perform arbitrary compution including infinite loops at compile time. C#'s overload resolution is equivalent to 3-SAT, therefore NP-complete, which is not Turing-complete but will still allow you to hang the compiler for the lifetime of the universe if you want.