|
Crackbunny posted:line 67 So relying on the implementation hashcons'ing the string literal constants? (I don't remember, is that a MUST or a MAY, anyway?). They also can't seem to get method naming/capitalization consistent...
|
# ¿ Jun 1, 2009 19:01 |
|
|
# ¿ Apr 28, 2024 16:36 |
|
manero posted:
Bonus points for using eval.
|
# ¿ May 31, 2010 17:25 |
|
Alternatively, I feel like it would be a whole lot more readable with conditionals like: if (total >= 1000 && total < 10000) if (total >= 10000 && total < 1000000) etc.
|
# ¿ Jun 11, 2010 20:39 |
|
Spazmo posted:
Reminds me of a hilarious attack vector mentioned in: Butler Lampson's "Hints for computer system design" --- http://research.microsoft.com/en-us/um/people/blampson/33-Hints/Acrobat.pdf --- see at page 5, starting from "Another example".
|
# ¿ Aug 3, 2010 05:56 |
|
McGlockenshire posted:Garbage in, garbage out. If you want different behavior, ask for it expressly. I am pretty sure it's normally a good design practice for the sensible behavior to be default. Ruby, BTW, just largely keeps the types separate, and only converts if you ask (though it does ignore trailing stuff): code:
|
# ¿ Sep 26, 2010 00:28 |
|
You don't need a server to use SVN locally.
|
# ¿ Oct 30, 2010 02:08 |
|
Plorkyeran posted:Setting up a local svn server is a hell of a lot more work than "git init". "svnadmin create" isn't. Again, there are lots of criticism to be made out of svn, but for single-user use, it's perfectly capable of working off file system, w/o a server.
|
# ¿ Oct 30, 2010 09:31 |
|
Never mind proper cryptography --- I've had a cable internet provider's 'forgot password' feature e-mail me what was clearly a password I entered, so they were storing it plaintext. Plus, it was all lowercased, so they're likely doing case-insensitive comparisons, too. Then there are websites that insist that your password not be longer than 8 characters, or that complain about using non-alphanumeric characters, etc. I really have to wonder what would cause someone to do that -- SQL field of 8 chars?
|
# ¿ Dec 18, 2010 04:30 |
|
What are all the - for?
|
# ¿ Jan 3, 2011 03:51 |
|
NotShadowStar posted:It would be great if the DOM had a 'supported' namespace so we could do 'if (browser.supported.elements.video)' but that's too much to handle for the W3C.
|
# ¿ May 18, 2011 00:14 |
|
Wheany posted:I prefer Opera's user agent to this: And if you do navigator.appName, you'll get 'Netscape'.
|
# ¿ May 19, 2011 00:19 |
|
brosmike posted:As a TA for a university that does this, I can confirm that this is the primary reason our intro course uses Scheme. It does a pretty good job of leveling the playing field a bit. As someone who TAd an intro course using Java, I think there may be other good reasons for Scheme... namely it being a very minimalist language (though I would be very worried about recursion). It's easy to ignore it for someone with experience, but there is really a LOT of stuff going on in Java that people have to grasp at once to be able to really understand what they're doing --- the most obvious examples being scopes, with both locals and members making a difference, etc. People are also basically forced to try to understand OOP (which is a tool for structuring complicated things) at the time they don't know how to do really simple things /correctly/. ... Though really, bringing back Pascal might actually not be a horrible idea, either (after adding a string type, of course).
|
# ¿ May 20, 2011 03:24 |
|
GrumpyDoctor posted:Worried about recursion how? That people just starting out would have lots of difficulty getting it.
|
# ¿ May 20, 2011 06:49 |
|
Pollyzoid posted:The Ruby require thing is from http://rhnh.net/2011/05/28/speeding-up-rails-startup-time ... And that, kids, is why you learn about big O...
|
# ¿ May 29, 2011 18:33 |
|
Internet Janitor posted:I just wrote a Fortran compiler for 'fun'. Here is a nontrivial program written in a language where the only meaningful flow control mechanism is a numbered goto. A language in which variable names cannot exceed two characters long and integral types must start with i, j, k, l, m or n. A language without facilities for named constants or procedure definitions. Why are you using > and not .gt., etc.? Softy.
|
# ¿ Sep 7, 2011 04:47 |
|
Internet Janitor posted:I based my implementation on this document, which does not indicate the use of stropped keywords or symbols. I thought that was mainly an ALGOL thing, anyway. That thing is pretty awesome, thanks for the link (it's always fun to read those early document). As for .gt., etc.... well, I am pretty sure at least Fortran 77 required those: http://www.fortran.com/F77_std/rjcnf0001-sh-6.html#sh-6.3.1 .. and looking at WP articles on early Fortran dialects, seem likes they pretty much dropped the conditional feature in favor of a simpler version... Edit: or see Fortran 66: ftp://ftp.nag.co.uk/sc22wg5/ARCHIVE/Fortran66.pdf
|
# ¿ Sep 7, 2011 05:55 |
|
ToxicFrog posted:Oh. So "automatic semicolon insertion" is "a semicolon is inserted at each newline if one is not already present". Nothing that logical. Some statements or expressions get it inserted only if not having it would produce a parse error, others have it inserted unconditionally.
|
# ¿ Oct 10, 2011 05:14 |
|
This isn't a PLT thunk, is it?
|
# ¿ Jan 15, 2012 15:44 |
|
That's not correct even when obj and prop are both variable names (and obj doesn't have custom setters or getters) OddObserver fucked around with this message at 04:55 on Feb 21, 2012 |
# ¿ Feb 21, 2012 04:51 |
|
tef posted:assuming no integer overflow Well, the compiler probably can (repeat after me: signed integer overflow in C is undefined...)
|
# ¿ Apr 9, 2012 23:46 |
|
PrBacterio posted:The fact that it can do that with calls to std::string's and std::vector's size() methods. Those are both field accesses, not loops (often hand-rolled in assembly).
|
# ¿ Nov 6, 2012 05:47 |
|
I am pretty sure Java desugars long String + chains into StringBuilder calls, does C# not do the same?
|
# ¿ Nov 23, 2012 05:29 |
|
Mogomra posted:Everything in JavaScript is an object that's not actually true.
|
# ¿ Jan 19, 2013 16:22 |
|
UraniumAnchor posted:
I don't remember the details, but IIRC there is some sort of a syntax hack in Ruby involving determining what's a local variable or not by looking for assignments of it.
|
# ¿ May 2, 2013 05:12 |
|
Or signed overflow.
|
# ¿ Jun 19, 2013 03:46 |
|
Volmarias posted:Eagerly awaiting a ""considered harmful" papers considered harmful" meta paper that lets us just get a new meme already. Pretty sure that exists.
|
# ¿ Nov 3, 2013 15:49 |
|
Didn't git recently change to have push only affect one branch by default?
|
# ¿ Nov 12, 2013 04:27 |
|
rjmccall posted:You would not believe the number of uninitialized-variable bugs that go uncaught because they happen to occur in code that runs first thing in the process. uninitialized Boolean-semantic int in Xft (IIRC). Launching apps from panel used some tricks to reduce linking, while in command-line path it triggered the dynamic linker from a lazy resolution stub, which helpfully wrote out a non-zero on the right spot in the stack.
|
# ¿ Feb 7, 2014 20:24 |
|
Zombywuf posted:The correct way to test a bit in C++ is obviously: Is the 8 correct?
|
# ¿ May 25, 2014 18:27 |
|
The important part is to not end up with another "referer".
|
# ¿ Jul 1, 2014 02:38 |
|
I am not sure it's guaranteed to work, I don't think Function.prototype.toString is required to preserve comments though admittedly they are not explicitly listed as things it may change: quote:An implementation-dependent representation of the function is returned. This representation has the syntax of a FunctionDeclaration. Note in particular that the use and placement of white space, line terminators, and semicolons within the representation String is implementation-dependent.
|
# ¿ Jul 12, 2014 15:29 |
|
5.1 at least requires it to be a valid FunctionDeclaration, but it doesn't say anything explicit about it being semantically equivalent to the original ;-) (I suppose stuff like function() { [native code] } is justifiable by host functions having an own [[DefaultValue]] for hint=String?) Expecting comments to be retained is sort of extra unreasonable in my book since it means you pretty much have to keep pointers into source code around even if your IR is something like an AST that's high-level enough to reconstruct from. I am probably horror-level paranoid about memory usage in high-count data structures, though.
|
# ¿ Jul 13, 2014 05:15 |
|
In fact the one thing 'this' can't be is a local variable scope. (It could be some weird magic scopes like the scope of exception variable in ES3, but that insanity got fixed in ES5)
|
# ¿ Jul 26, 2014 15:15 |
|
Vanadium posted:They used to have some of the features gated on <script type="text/javascript;version=1.8"> or whatever, not sure what happened to that. I guess it went under with the move to HTML5 as a "living standard". It never had anything to do with standards, it's just a previous Mozilla "we own JavaScript so we do what we want" thing --- they've put in plenty of extensions way before there was any real chance of them being standardized.
|
# ¿ Aug 24, 2014 04:23 |
|
Jewel posted:So it doesn't work like C/C++ where it just creates a "read-only memory" section and just maps it out to the process space on run? Which is still technically is a compiler thing because it has to grab the literals and put them in that read-only space. You could do that for literals, yes, but some strings are computed at runtime. (Though with some of the work in the simple case would have to be done by the JIT --- but then even in C or C++ case the dynamic linker might have to do work at runtime to patch up references to strings, too)
|
# ¿ Dec 5, 2014 03:48 |
|
Subjunctive posted:No, the class loader causes them to be allocated as interned strings at load time. Java classes may never be on disk at all (network fetch, etc.). I don't know of an implementation that maps the classfile persistently, but I'm not totally up to date. Dalvik might, I think ;-) (Though of course those would be .dex, or was it .odex files, not .class files)
|
# ¿ Dec 5, 2014 03:56 |
|
Voted Worst Mom posted:Let me personally assure you that gcc has never and will never accept that nonconformant code without error. Are you really sure that something like 2.7 or somesuch prehistoric version didn't? ;-)
|
# ¿ Dec 7, 2014 04:35 |
|
Dylan16807 posted:Browsers let you do it but I don't think it's in the spec and it's definitely not something you would need to implement in your bespoke embedded JS. It's in the spec, though sort of poorly phrased: quote:15.3.4.2 Function.prototype.toString ( )
|
# ¿ Dec 18, 2014 05:02 |
|
Subjunctive posted:The IR I'm thinking of is pre-JIT interpreter bytecode, stack-based (Spidermonkey). The stack traffic adds up, lots of POP after ignored function returns, re-pushing as part of chained conditions, the nonsense you have to do for object iteration to be exception-correct, blah blah. Comment stripping is meaningful, because char-by-char parsing of big license headers can add up. Better, though, to just minimize and use something like source maps, if you that's appearing on the profiler. As a aside: are you aware, is any implementation sophisticated enough to avoid constructing strings for a for ... in over an array for the indices?
|
# ¿ Dec 18, 2014 06:29 |
|
|
# ¿ Apr 28, 2024 16:36 |
|
rjmccall posted:
What does the spec say about passing objects through varargs? gcc's "... will crash at run time" warning always struck me as, well, a bit of a horror. (In being a warning, that is).
|
# ¿ Jan 28, 2015 21:33 |