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

Oct
4
comment xml based programming languages
I fully understand that code is data. I also see the value of having a simple representation of data, like S-exprs/nested lists in Lisp. But XML is as complicated as a full AST for a ALGOL-style language (i.e. rich syntax, infix expression, etc), so you save no effort on the meta programming side, again compared to Lisp. So why force every programmer to type out the full AST instead of offering proper syntax?
Oct
4
comment xml based programming languages
"Seem" is the keyword here. Truth is, those advantages are either pretty small or non-existing, but it certainly seems like that when you've never created a language implementation. Parsing is computationally expensive but actually one of the simpler parts to implement (parser generators or hand-written) and design (syntax is cheap). And once you have the AST, how you proceed is not influenced by how you parse - meaning if execution is simple, it remains simple if you choose different syntax (obviously, only if you keep the semantics).
Oct
2
comment Optional semicolons
I gotta say, I'm a bit surprised that this is considered surprising. Maybe there are finer differences which make the JS approach objectively worse, but this snippet would show the exact same behaviour in, for example, Python - and nobody ever complains about how Python handles statement termination.
Oct
2
comment What are the real life use cases for tagged pointers?
The same trick is used in kd trees used for ray tracing - Wald et al. align nodes such that the lower two bits of the child pointer are always zero and use those bits to store the splitting plane.
Oct
1
comment What's the relationship between meta-circular interpreters, virtual machines and increased performance?
@Gomi As I already said at the end of my second comment, yes. You'd just need to re-implement the automatic generation of JIT compilers, at least one decent garbage collector, and a bunch of other stuff RPython does. That would be a significant engineering challenge, but not impossible or even novel research.
Oct
1
comment What's the relationship between meta-circular interpreters, virtual machines and increased performance?
@Gomi If by "it" you mean the fact that RPython is a subset of Python, not a subset of any other language, then no. The reasons for ML in that document are technical, objective, and good. The reasons that RPython is what it is are social, subjective, and arguably bad. There are some parts of Python that RPython benefits from (automatic memory management being the main one), but dozens of other languages have those too. In fact, a recent superficially similar project (Graal) uses a subset of Java in a role similar to RPython, and Java is very different from Python (as mainstream languages go).
Oct
1
comment What's the relationship between meta-circular interpreters, virtual machines and increased performance?
@Gomi It's not about how similar the implementation language is to the implemented language. There are JavaScript, Lisp, Prolog, SmallTalk and Ruby interpreters written in RPython and they get exactly the same goodies PyPy offers. The only reason RPython is based on Python is that it was created by a bunch of Python enthusiasts. The features of RPython that make PyPy fast have nothing to do with Python: Automatic JIT compiler generation, the garbage collectors, etc. - and yes, most of that could in principle be done using other languages. You'd have to create a whole new compiler though.
Oct
1
comment What's the relationship between meta-circular interpreters, virtual machines and increased performance?
RE how PyPy can be faster than CPython: It isn't written in Python, it's written in a quite different language that can be AOT-optimized effectively.
Sep
27
comment Settle an Argument: String vs. Array?
Huh? String and arrays are reference types, so a variable of either type can be null. And AFAIK there's no "null string" which is a string object and somehow represents absence of a string. There's the empty string, but there are also empty arrays.
Sep
26
comment Is it poor practice to name a property/member the same as the declaring type in C#?
This requirement you've been told about seems brain-dead, perhaps due to over-enforcement of a good guideline (don't just use the type name when there's a better name).
Sep
24
comment Could ChromiumOS be re-written in Go from the ground up?
@JeffO Where did I get even close to implying anything like that? I'm simply saying, creating an OS from scratch and taking it to a point where it's useful for end users, is a huge effort even for the big players of the industry, so you need tons of resources to throw at it as well as very good reasons for this huge investment.
Sep
24
comment Could ChromiumOS be re-written in Go from the ground up?
You don't just write an entire operating system from scratch just to use a language you're biased towards. (I was gonna say "you don't write an entire operating system from scratch, period" but this is Google we're talking about.) That's a bit like researching electromagnetics from scratch because it irks you that your favorite dish takes an odd number of minutes with the default settings of your microwave. What significant advantages would you expect?
Sep
23
comment Why are CIL and CLR required in .NET?
At least a MSDN blog claims the JIT compiler does do that (or did, 8 years ago).
Sep
21
comment Importance of data structures in modern S/W development
Now that we have fancy cars, we don't need knowledge of mechanics. </s>
Sep
17
comment Is the Entity Component System architecture object oriented by definition?
The main alternative to class-based OO, prototype-based OO, also seems to couple data and behaviour. Actually, it seems to differ from ECS just as much as class-based OO does. So could you elaborate what you mean by OO?
Sep
14
comment A question about storing passwords
Ranbir Kaif, could you elaborate on the scenario? Who is involved, what might they do, and which of these actions do you want to prevent? Try applying concepts such as confidentiality and data integrity. It sounds like the attacker has access to the .dat file, so just prepending a hash to the plain text won't help. Even if your code reliably refuses to handle .dat files without the right password, any attacker can just modify the contents (including a password hash and salt) directly.
Sep
14
comment A question about storing passwords
@thorstenmüller Huh? Salting is useful even if the attacker knows it, because it multiplies the attacker's work by the number of distinct salts (and they should be distinct). Moreover, since you need to store the salt to verify the password, you usually can't avoid the attacker learning the salt once they learn the hash (if you had a more secure location where you stored the salt, you would have just stored the hash there to begin with).
Sep
13
comment Why is float the default in the majority of languages?
@supercat And adding two arbitrary precision integers is much more expensive than adding two word-sized integers. Yet they're still widely used, even as default integer type in a number of programming languages. In any case, this stream of comments is not an appropriate forum for discussing the pros and cons of decimals (I was already stretching it with my previous comments).
Sep
3
comment Does Lisp still have any special feature which has NOT been adopted by other programming languages?
One problem is that, once a language has a certain subset of of Lisp features (for example, S-expressions and macros), people claim it's a Lisp. Which of course has the consequence that (according to these people) no non-Lisp language can have these features.
Aug
31
comment Python dynamic attributes creation, a blessing or a curse?
... of course, this could be changed - but this would make function definitions inside the class special. Special cases are generally bad.