9,528 reputation
12141
bio website
location
age
visits member for 3 years, 8 months
seen 4 mins ago

15h
comment Why don't Python and Ruby make a distinction between declaring and assigning a value to variables?
@AlexanderGelbukh I don't know PHP well enough to identify the cause, would you mind explaining?
Jul
20
comment Swift in a browser
You seem both confused about fundamental concepts of language implementation, and not up to date about the state of the real world. For starters, there's PNaCl and emscripten challenging your statements about what's possible/practical in the browser.
Jul
19
answered Why don't Python and Ruby make a distinction between declaring and assigning a value to variables?
Jul
19
comment Why don't Python and Ruby make a distinction between declaring and assigning a value to variables?
@Akash That does not seem related to the question at all, it remains equally valid if run through s/variable/name/g.
Jul
17
comment Do modern languages still use parser generators?
C and C++ need symbol table information during parsing (or accept a far less specific parse tree where no distinction is made between, for example, expression statements and variable declarations). But I wasn't thinking of those. Languages like Java, Lisps, JavaScript, Ruby, Python, Go, Rust, Scala, Swift, Haskell (and probably several more, maybe C# and ML too?) don't need any such information to build the kind of AST you'd want anyway. Many of them actually have LL(1) grammars, or even LALR grammars.
Jul
17
comment Do modern languages still use parser generators?
And about the second area: Many many major real programming languages are not context sensitive in any sense that applies (you'd have to refer to the set of all valid programs after type checking and such, which is never what a hand-written or generated parser tries to parse). It's true that hand-written parsers are more flexible, and this is useful for some languages, but mostly in the realm of error recovery and reporting, incrementality, etc. -- parser generators are rarely eschewed because of recognition power (whether you'd want to write such a grammar is a different story). -1
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.