1,819 reputation
49
bio website
location Illinois
age 44
visits member for 2 years, 1 month
seen 2 days ago

Aug
1
comment Is ok to leave untranslated advanced log?
Even if users who can't read English will need to be able to get information from the logs, I would think having an culture-invariant log format along with viewing utilities that translate it would be better than having the contents of the log vary with culture. It's often much easier to render into human-readable form log files which were designed to be machine-readable, than it is to machine-process information whose formatting has been customized to accommodate different users' needs.
Jul
31
awarded  Necromancer
Jul
31
comment Why was the first compiler written before the first interpreter?
@BobJarvis: I hadn't considered that aspect, but the same general one-pass design that would be used for compiling ready-to-run code to RAM could work well with a tape drive; the output from the compiler would go to tape, then the tape would be rewound and read into sequential memory addresses and run directly, without needing to have any part of the compiler in memory at the same time.
Jul
30
comment Why was the first compiler written before the first interpreter?
The character sequence "END" gets converted to 128; "FOR", 129; "NEXT", 130; "DATA", 131; etc. Such conversions are done with "greedy" matching, in context-free fashion. If one typed "1 TENDER SUPREME", it would get parsed as [T][END][E][R][space][S][U][P][REM][E]. When executed, it would see the "T", match any additional letters or digits, look up "T" as a variable name, look for an equals sign, not see one, and flag a syntax error. The fact that END makes no sense as anything other than the first token in a statement would be irrelevant to the tokenizer.
Jul
30
comment Why was the first compiler written before the first interpreter?
One wouldn't refer to a text editor that loaded a UTF-8-formatted input file into a list of UTF-16 strings as a "compiler"; the transformations done by MS-BASIC when a program is typed in aren't really any more substantial than that.
Jul
30
revised What is meant by “OOP hides the state”?
Another format fix--asterisk on last sentence of pa2.
Jul
30
comment Why was the first compiler written before the first interpreter?
...character by character, left to right; a statement like A=1234" would convert the digits 1, 2, 3, and 4 into a floating-point number at run-time.
Jul
30
comment Why was the first compiler written before the first interpreter?
Typical microcomputer BASIC interpreters do not produce anything even remotely resembling a syntax tree. I'm not familiar with the original Apple BASIC interpreter (called "integer BASIC") but the BASIC interpreter implemented by Microsoft for Apple ("Applesoft BASIC"), Commodore, and various other companies stored program text as-is except for two things: (1) each line was preceded by a 16-bit line number and the 16-bit address of the next line, and followed by a zero byte; (2) each keyword was replaced with a single byte that had the high bit set. Other than that, expressions were parsed...
Jul
30
comment Why was the first compiler written before the first interpreter?
The original Basic interpreter for the Apple ][ was, from what I understand, hand-translated into machine code and never existed in machine-readable source-code format. I'm not sure what "compiler" you would say was used to produce it.
Jul
29
answered What is meant by “OOP hides the state”?
Jul
29
comment Why was the first compiler written before the first interpreter?
@Luaan: Not only that, but the relative cost between memory and gates used to be such that circuitry to perform a function could often be cheaper than the quantity of memory needed to hold the code which would otherwise be necessary to perform it.
Jul
29
comment Why was the first compiler written before the first interpreter?
@BobJarvis: What year would that have been?
Jul
28
comment Why was the first compiler written before the first interpreter?
@delnan: The big difficulty with interpreters is that if you start with programs on punched cards, getting the program into RAM in a form which can be interpreted efficiently isn't hugely different from putting it into a form which would match real instructions. For larger programs, interpreted byte code might be more compact than machine code, but only if a program was large would savings would likely outweigh the cost of the interpreter.
Jul
28
comment Why was the first compiler written before the first interpreter?
Did computers use teletypes prior to the advent of time sharing? I would have expected them to either use line printers or spool to tape. Otherwise, the 1-8 seconds the computer would have to wait after each line of text would represent a 1-8 seconds that the computer could have been--but wasn't--doing something useful.
Jul
28
answered Why was the first compiler written before the first interpreter?
Jul
26
comment Fundamental Difference between fn() and new fn() in javascript
Using new will cause the new object's prototype to be set to reference that of the first function to which the new object is passed. I don't think that behavior can be legitimately achieved via other means.
Jul
26
comment Is the addition of a duration to a date-time defined in ISO 8601?
Actually, even adding days isn't always clear. Does adding "a day" to 11:30pm on the Saturday before time springs forward advance 24 hours (to 12:30am Monday) or 23 hours (to 11:30pm Sunday)?
Jul
25
comment Why would programmers ignore ISO standards?
@Jeff: If the eight digits are known to represent a date, YYYYMMDD is the only common format which would fit any 20th century date in that format. If some of the digits may have some meaning unrelated to the date, all bets are off. Many product expiration dates are concatenated with other information in such a fashion as to be ambiguous. Does Exp:14OCT134212 mean October 14 of 2013, and 4212 is a lot code, or October of 2014, and 134212 is a lot code, or October 14 of the year the product was made, or what? But if eight digits are known to be a date, YYYYMMDD is unmistakable.
Jul
25
comment Why would programmers ignore ISO standards?
@Jeff: I have NEVER EVER seen a date coded as YYYYDDMM for any purpose other than to claim such a coding is possible. Have you?
Jul
25
comment Why would programmers ignore ISO standards?
If one knows that an eight digit string is supposed to represent a date which is sometime after the Middle Ages, how would YYYYMMDD be ambiguous? The first two digits would exclude any possibility other than DDMMYYYY, and that possibility would be excluded by the fifth and sixth digits (the only thing 20091104 could be besides November 4, 2009, would be September 20, 1104, and unless one is writing about medieval history, the latter possibility seems unlikely).