From: John B. Matthews on 23 Mar 2010 22:08 In article <3b3f991b-8fcd-435c-83f6-e1a1a5e8f6ed(a)a31g2000prd.googlegroups.com>, Adam Beneschan <adam(a)irvine.com> wrote: > On Mar 23, 1:27 pm, "John B. Matthews" <nos...(a)nospam.invalid> wrote: > > In article > > <7a0c7a19-5d83-4cc6-be68-95ebf4153...(a)t23g2000yqt.googlegroups.com>, > > > > cbcurl <cbc...(a)gmail.com> wrote: > > > since when was Pascal ever an interpreted language > > > > AFAIK, ca. 1977, <http://en.wikipedia.org/wiki/UCSD_Pascal>. > > I wouldn't call it an interpreted language, really. The UCSD > compiler generated code for a machine that didn't exist, and then > programs ran by interpreting that machine's instructions. However, > my recollection is that the pseudo-machine's instruction set really > didn't have anything to do with Pascal and could have been used for > any language. A few years later, Western Digital developed a machine > that executed the P-machine's instructions directly (in microcode). > The lab I worked for back in college (at UC Irvine) used this > compiler, and we had one of the WD machines also, so this is > something I'm quite familiar with, as far as the deteriorating brain > cells of my memory permit. > > This doesn't meet my criteria for what I'd call an interpreted > language. For that, I'd assume that the interpreter reads the > original source statements, or some sort of tokenized form that bears > a close relation to the original source statements, while running the > program. I'd also assume that variables and other identifiers are > stored by name, or by something equivalent such as a pointer into a > string table, but that in any case the interpreter does things "by > name". In contrast, I believe that UCSD Pascal allocated local stack > variables pretty much the same way a native compiler would, > referencing them via byte or word offsets from the top or bottom of a > stack frame, although it's been a really long time so I could be > wrong here. No, I believe you are correct, and you draw a useful distinction. Basic interpreters of that era stored tokenized keywords, but the variable names--at least the first few characters--were legible in the stored program. In contrast, the compiled p-code was quite generic; I briefly used a Fortran compiler that generated p-code, and I'm sure others were available. The p-code itself was interpreted. I still enjoy using the system in emulation. As a concrete example, ]list 10 A% = 12345: PRINT A% ]mtr *800.81f 00/0800:00 12 08 0A 00 41 25 D0-.....A%P 00/0808:31 32 33 34 35 3A BA 41-12345::A 00/0810:25 00 00 00 64 C1 80 30-%...dA.0 00/0818:39 00 00 00 24 D0 E7 28-9...$Pg( In Basic, the variable name "A" appears in both the tokenized source and the variable table; its value appears as a string literal and a twos-complement integer: 16#3039#. $ ac -e Pascal.2mg test.text {$R-} program Test; var a: Integer; begin a := 12345; Writeln(a); end. $ ac -e Pascal.2mg temp.text Code file = test.code The following library bytes are non-zero: TEST is a linked segment (P-code vers.6), length = 42 bytes ** # PROCS = 1, SEGMENT # = 1 Disassembly for procedure # 1; Lex level = 0 P-code procedure 1 Code = 27, parameters = 4, data = 2 bytes; Jump table = 0 words 0: D7 NOP 1: D7 NOP 2: C7 39 30 LDCI 12345 5: AB 03 SRO 3 7: B6 01 03 LOD 1,3 10: EA SLDO 3 11: 00 SLDC 0 12: CD 00 0D CXP 0,13 15: 9E 00 CSP 0 17: B6 01 03 LOD 1,3 20: CD 00 16 CXP 0,22 23: 9E 00 CSP 0 25: C1 00 RBP 0 Even without elaborating on the opcodes, it's clear that constant remains while variable and procedure names have been elided. When I encountered Java bytecode decades later, everything old was new again. -- John B. Matthews trashgod at gmail dot com <http://sites.google.com/site/drjohnbmatthews>
From: Robert Love on 23 Mar 2010 22:46 On 2009-07-22 09:10:01 -0500, Colin Paul Gloster said: > I do not know. Some hints... > FORTRAN influence: > Robert B. Love > Subject: Re: Loss of Mars Climate Orbiter due to units of measurment conflicts > Date: 1999/10/02 > Message-ID: > <6C26F727ACB69543.66B23092D324DEF8.14EA2C28DF27855B(a)lp.airnews.net>#1/1 > comp.lang.ada Boy, it is weird seeing your name cited from a decade old message. I don't remember what I said. I do have a memory that LM (MM in those days) was supposed to use SI units per the agreement but used British Engineering units. The context was information sent to NASA/JPL after the launch about the LEO orbit. Strange, the space program still seems to be using feet and nautical miles.
From: Martin Krischik on 24 Mar 2010 02:24 Am 23.03.2010, 21:33 Uhr, schrieb Patrick Scheible <kkt(a)zipcon.net>: > Pascal Obry <pascal(a)obry.net> writes: >> But anyway this is not even an issue. For performance you can always >> remove the checks using the right compiler option. Then you have the >> best of both worlds. During development the checks are really helpful, >> in production you remove them. > > It's been said that this approach is like having lifeboats on an ocean > liner while it is in sea trials, and then taking them out when it > starts to carry passengers. Right on. I was very disappointed then I read the details of Java's assert statement - if you just double click an executable jar file the assets are removed by the class loader :-( . Regards Martin -- Martin Krischik
From: Martin Krischik on 24 Mar 2010 02:28 Am 23.03.2010, 17:50 Uhr, schrieb Warren <ve3wwg(a)gmail.com>: > I don't think many people would be surprised by these results. > After all Java, C# and Pascal (variants) are still largely > interpreted languages, even if they use some sort of compiled > intermediate code. I would say the most used Pascal variants these days is Delphi and Ada - both which compile native code. Martin -- Martin Krischik
From: Martin Krischik on 24 Mar 2010 02:33
Am 23.03.2010, 16:05 Uhr, schrieb Maciej Sobczak <see.my.homepage(a)gmail.com>: > On 23 Mar, 14:24, Georg Bauhaus <rm.dash-bauh...(a)futureapps.de> wrote: > >> Note: Cherrystonesoftware markets a product that is not available >> with Java, C#, or other languages. > > Are they supposed to make products for those platforms that they > consider inferior? Why? Self fulfilling prophecy? Consider something inferior and then rigged the test condition to prove the point? Reminds me of Tiobe which too changes the search rules when the results start to show a trend they don't like. Martin -- Martin Krischik |