9,543 reputation
12241
bio website
location
age
visits member for 3 years, 8 months
seen 3 hours ago

Jul
17
comment Do modern languages still use parser generators?
Citation for the performance claim please? Being table-driven can be a significant performance optimization and generators have access to algorithms that are very efficient but virtually never implemented by hand (precisely because they are an impenetrable mess of tables and magic numbers).
Jul
17
comment General recursion to tail-recursion
Oh course the downside is that you build lots and lots of closures (the continuations). It's not a good way to improve performance or memory use.
Jul
17
comment Hash function for progressive changes
@StefanoBorini This is known as a hash list, and is generalized by Merkle trees. The latter have a couple of advantages, but I don't know if any of those are applicable do your use case.
Jul
17
comment Do modern languages still use parser generators?
Data point: CPython has a home brew LALR parser generator (pgen). Don't know about the rest.
Jul
16
revised How are OOP “objects” and “classes” organized in memory in terms of assembly language?
added 1 character in body
Jul
16
revised How are OOP “objects” and “classes” organized in memory in terms of assembly language?
added 189 characters in body
Jul
16
answered How are OOP “objects” and “classes” organized in memory in terms of assembly language?
Jul
15
comment Is there still any value in learning assembly languages today?
Don't learn assembly. Learn computer architecture. It's immensely useful even if you never write or even look assembly code, and should you do get into that unfortunate position it'll make learning the specific of the assembly language much easier.
Jul
15
comment Tips for Tail Call Recursion in Python
@Giorgio Technically possible, yes. However, more subtle than you may think. Function calls not in tail position also needs to be wrapped with the trampolining code, making the whole thing even slower than it already is. Alternatively, perform a Continuation Passing Style transform to make all calls tail calls, but that leads to even more overhead for ordinary calls and causes a great many closure allocations. All that also greatly complicates Java interop, and a mixed language call stack (Java -> Scala -> Java -> Scala) may break the whole thing anyway. In summary, it's just not worth it.
Jul
15
answered Does this kind of programming language exist?
Jul
14
comment Tips for Tail Call Recursion in Python
@Giorgio Absolutely. In fact, Clojure provides a function that does just that (with a slightly different interface than I described): trampoline.
Jul
14
comment Minimizability or readability?
To be clear, this is about logic changes which permit smaller file sizes (after additional automated, semantics-preserving minimization), not about said automated minimization tools, right?
Jul
13
comment Is testability and mockability really that important in web development?
Some applications benefit from automated testing, you grant that? Then please explain why the same benefits don't apply to web development.
Jul
12
comment Memory management scheme for custom memory allocator
Thanks for clarifying, that makes some amount of sense. I'm not sure whether it's actually practial/good but it seems possible and could plausibly have the effect you want.
Jul
12
comment Memory management scheme for custom memory allocator
What do you want to defragment? Everything that's mapped is referenced by raw pointers, so you can't move those. You could shuffle the regions assigned to not-yet-mapped handles (trivially by not settling on a region in Allocate, doing all actual work in Map) but since you must work around existing mappings this hardly deserves the term "defragmentation". Also, what are you trying to achieve with the allocate/map separation? It's a rather unorthodox API.
Jul
11
comment Sizeof Structure in C
This belongs to StackOverflow, and there it would be a duplicate of Why isn't sizeof for a struct equal to the sum of sizeof of each member?.
Jul
10
comment Can Excel be a strong development platform?
For what sort of application could Excel possibly be a suitable platform? It's spreadsheet software. A macro to automate spreadsheet work, sure. Something deserving the term "application" on the other hand...
Jul
10
comment Why can't C arrays have 0 length?
@RobertHarvey All true, but your closing words (and the whole answer in retrospect) just seems like a confused and confusing way to explain that such an array (I think that's what this answer calls "an allocated chunk of memory"?) would have sizeof 0, and how that would cause trouble. All that can be explained using the proper concepts and terminology with no loss of brevity or clarity. Mixing up arrays and pointers only risks spreading the arrays = pointers misconception (which is more important in other contexts) for no benefit.
Jul
10
comment Why can't C arrays have 0 length?
Arrays aren't pointers.
Jul
10
comment What does it mean for a sorting algorithm to be “stable”?
@QuestionC But here's another algorithm that I've actually seen around: WikiSort. Don't know anyone using it in production though.