From icon-group-sender Thu Jan 8 12:46:37 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id MAA24593 for ; Thu, 8 Jan 1998 12:46:37 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA16979; Thu, 8 Jan 1998 12:46:37 -0700 Date: Thu, 8 Jan 1998 08:33:34 -0700 From: swampler@noao.edu (Steve Wampler) Subject: Stripping blank and comment lines To: icon-group@optima.CS.Arizona.EDU Message-Id: Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1007 Since there hasn't been much traffic here recently, I thought I'd pose a little problem for people to play with. This isn't too hard, but there are probably a number of interesting solutions. I always here people bragging about lines of code (some brag about how much, others about how little, no one brags about having just the right amount...). Normally, this goes something like, "Well, if you strip out blank lines and comments, there's (still/only) XXXX lines of code." So: Write a program that strips out blank lines and comment lines (lines that only contain a comment) from Icon programs. The program should accept 0 or more file names as arguments and copy the files to standard output with all blank and comment lines removed. If no arguments are given, then the program should read from standard input. -- Steve Wampler - swampler@gemini.edu [Gemini 8m Telescopes Project (under AURA)] O Sibile, si ergo, fortibus es inero. Nobile, demis trux. Demis phulla causan dux. From icon-group-sender Tue Jan 13 09:32:16 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id JAA26735 for ; Tue, 13 Jan 1998 09:32:15 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA20742; Tue, 13 Jan 1998 09:32:15 -0700 X-Sender: nevin@pop.interaccess.com (Unverified) Message-Id: In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Date: Tue, 13 Jan 1998 01:08:52 -0600 To: icon-group@optima.CS.Arizona.EDU From: "Nevin :-] Liber" Subject: Re: Stripping blank and comment lines Cc: swampler@noao.edu (Steve Wampler) Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1609 At 9:33 AM -0600 1/8/98, Steve Wampler wrote: > Write a program that strips out blank lines and comment lines (lines > that only contain a comment) from Icon programs. The program should > accept 0 or more file names as arguments and copy the files to standard > output with all blank and comment lines removed. If no arguments are > given, then the program should read from standard input. I'll start the ball rolling. Here is my solution; in the spirit of Steve's message to try and get some discussion going, I'll leave it up to others to comment upon the elegance/inelegance of it and to make suggestions on other ways to implement it. Enjoy! Nevin :-) procedure main(LArguments) local fInput local sLine every fInput := InputFiles(LArguments) do { while sLine := read(fInput) do { write(ValidSourceLine(sLine)) } } end procedure InputFiles(LFilenames) local sFilename local fFile if 0 = *LFilenames then { return &input } every sFilename := !LFilenames do { if not (fFile := open(sFilename)) then { write(&errout, "Cannot open ", image(sFilename), " for reading.") next } suspend fFile close(fFile) } end procedure ValidSourceLine(sLine) sLine ? { tab(many('\t ')) if ="#" | not move(1) then { fail } } return sLine end -- Nevin ":-)" Liber (847) 816-9926 Senior Software Engineer, Pendragon Software Pendragon Software Corporation 1580 South Milwaukee Avenue, Suite 515 Libertyville, IL 60048-3776 voice: (847) 816-9660 fax: (847) 816-9710 From icon-group-sender Tue Jan 13 12:31:51 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id MAA13737 for ; Tue, 13 Jan 1998 12:31:51 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA21125; Tue, 13 Jan 1998 12:31:51 -0700 From: gep2@computek.net Date: Tue, 13 Jan 1998 11:10:44 -0600 Message-Id: <199801131710.LAA12356@axp.cmpu.net> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Subject: Re: Stripping blank and comment lines To: icon-group@optima.CS.Arizona.EDU In-Reply-To: X-Mailer: SPRY Mail Version: 04.00.06.17 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1782 Well, in the spirit of commenting on style... Personally, I've never understood how it is that people think it makes sense to append a type PREFIX to a variable name. I think that (if you need one at all) a type SUFFIX is *far* more intelligent. In a sorted XREF, it's absurd to sort variables principally by their data type anyhow. If you have a number of variables regarding dates, for example, you'd want things like DateP (date pattern), DateMonth, DateYear, DateDay, DateWkDay, DateLeap, etc to all sort together in the Xref, regardless of that some of them might be flags, others might be character strings, others might be patterns and some might be numbers. It's the height of idiocy to propose a naming system where the data type is the most important ordering item. Imagine a dictionary where "dog", "doglike", "doggy", "doghouse", "dogcollar" and "dogsmell" were sorted and arranged in a dictionary starting from the RIGHT-hand end of each word! I'm not accusing the poster of originating this claptrap, but I do think it's interesting that so many people, lemming-like, adopt such absurd conventions that some obvious loon dreams up and proposes as a naming convention "standard". It's especially strange in a language like Icon or S*BOL where the type of a variable can be QUITE variable during the execution of a program! Again, please don't take this as a personal attack on the poster... it's really intended more as a GENERAL observation on an industry's willingness to stupidly follow the most ABSURD of Pied Pipers. Glad to be able to get that off my chest. :-) (the post obviously touched a nerve here) :-))) Gordon Peterson http://www.computek.net/public/gep2/ Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ From icon-group-sender Mon Jan 19 09:31:48 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id JAA24835 for ; Mon, 19 Jan 1998 09:31:48 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA29406; Mon, 19 Jan 1998 09:31:48 -0700 X-Sender: nevin@pop.interaccess.com (Unverified) Message-Id: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Date: Mon, 19 Jan 1998 01:52:38 -0600 To: icon-group@optima.CS.Arizona.EDU From: "Nevin :-] Liber" Subject: Re: Stripping blank and comment lines Cc: "Gordon Peterson " Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 3598 "Gordon Peterson " writes: >In a sorted XREF, it's absurd to sort variables principally by their data type >anyhow. Personally, I don't find alphabetical sort order for variables to be all that useful; I'd much rather see them in order of declaration (and I always use local declarations in Icon) or order of use. And I usually don't have many variables within a function; if it gets to be a lot, I usually just declare another function. >If you have a number of variables regarding dates, for example, you'd >want things like DateP (date pattern), DateMonth, DateYear, DateDay, >DateWkDay, >DateLeap, etc to all sort together in the Xref, regardless of that some of >them >might be flags, others might be character strings, others might be >patterns and >some might be numbers. In your above example, you have no way of telling if DateMonth is a string or a number. And in Icon, it matters, as if you were comparing two months, you'd have to know whether to use "=" or "==". This is the essence of why I personally use this convention for naming my variables. While it does in some sense break abstraction, in practical terms, you need to know what type of object is stored in a variable in order to manipulate it. >I'm not accusing the poster of originating this claptrap, I think the origin is by Charles Somoyi (sp?) at Microsoft and his Hungarian notation. Ironically, I don't use it much in C, as objects are either numbers (char, int, short, long, enums) or structs/unions. The way to manipulate a number in C is the same whether it is an unsigned char or a long (although the limits of what they can represent are different), and I can go back to the type declaration for the few times I need to know what kind of number it is (eg: when writing a printf() statement). I do use "Ptr" and "Hdl" as suffixes on variables, since that is usually information needed to know how to get to the object. I'm just trying to find the right balance between abstraction and the practical side of having to maniplate the values stored in variables. >but I do think it's >interesting that so many people, lemming-like, adopt such absurd conventions >that some obvious loon dreams up and proposes as a naming convention >"standard". There are reasons behind the convention, even if you don't necessarily agree with them. Evem the argument of "because everyone else is doing it" has some merit, if you have to be sharing your code with other people who adopt that convention. >It's especially strange in a language like Icon or S*BOL where the type of a >variable can be QUITE variable during the execution of a program! While that is theoretically true, it rarely occurs in the programs that I write. I very rarely use a variable to represent more than one type of value (&null sometimes being an exception to this rule, although even this doesn't occur very often). If I have a different type, I just declare a different variable. About the only time it does occur in my code is when I am taking values out of one of the structure types (tables, lists, sets, records) or during parameter passing. >Again, please don't take this as a personal attack on the poster No offense taken here. People ought to think about why they have certain styles of coding. -- Nevin ":-)" Liber (847) 816-9926 Senior Software Engineer, Pendragon Software Pendragon Software Corporation 1580 South Milwaukee Avenue, Suite 515 Libertyville, IL 60048-3776 voice: (847) 816-9660 fax: (847) 816-9710 From icon-group-sender Tue Jan 20 08:16:47 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id IAA25449 for ; Tue, 20 Jan 1998 08:16:47 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA30341; Tue, 20 Jan 1998 08:16:47 -0700 From: gep2@computek.net Date: Mon, 19 Jan 1998 10:55:34 -0600 Message-Id: <199801191655.KAA28922@axp.cmpu.net> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Subject: Re: Stripping blank and comment lines To: icon-group@optima.CS.Arizona.EDU X-Mailer: SPRY Mail Version: 04.00.06.17 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 6685 >> In a sorted XREF, it's absurd to sort variables principally by their data type >anyhow. > Personally, I don't find alphabetical sort order for variables to be all that useful; It's by far the MOST useful way when you're trying to find a single given variable or label or function definition or whatever (or find out if a given name has already been used somewhere in a program). > I'd much rather see them in order of declaration (and I always use local declarations in Icon) or order of use. That's fine (maybe) on very small functions (where the variables and other names all fit on one page or something). > And I usually don't have many variables within a function; if it gets to be a lot, I usually just declare another function. That's (maybe) fine for small functions compiled separately and where all their names are local. >>If you have a number of variables regarding dates, for example, you'd >want things like DateP (date pattern), DateMonth, DateYear, DateDay, >DateWkDay, DateLeap, etc to all sort together in the Xref, regardless of that some of them might be flags, others might be character strings, others might be >patterns and some might be numbers. > In your above example, you have no way of telling if DateMonth is a string or a number. In most cases, it simply doesn't matter. When you parse it out using String Scanning, it will *always* (correct me if I'm wrong) initially be a string type, anyhow. It will get converted to a numeric type if you do arithmetic on it and assign back the result. > And in Icon, it matters, as if you were comparing two months, you'd have to know whether to use "=" or "==". In Icon, that's apparently true (it's NOT true, FWIW, in S*BOL where you can do either lexical or numeric comparisons regardless of the actual data types involved). > This is the essence of why I personally use this convention for naming my variables. I respectfully suggest that it's *still* stupid to put the type (if you are going to put it as part of the variable names at all) as a prefix rather than a suffix. > While it does in some sense break abstraction, in practical terms, you need to know what type of object is stored in a variable in order to manipulate it. I think it's absurd to HAVE to know (you really do NOT, in S*BOL). Actually, I was surprised when I looked up "=" and "==" to be sure, and found that indeed they only work in Icon for specific operand data types. >> I'm not accusing the poster of originating this claptrap, > I think the origin is by Charles Somoyi (sp?) at Microsoft and his Hungarian notation. Ironically, I don't use it much in C, as objects are either numbers (char, int, short, long, enums) or structs/unions. The way to manipulate a number in C is the same whether it is an unsigned char or a long (although the limits of what they can represent are different), and I can go back to the type declaration for the few times I need to know what kind of number it is (eg: when writing a printf() statement). Yeah, that name sounds of the right order. In any case, it's a stupid convention and I'm astonished that so many otherwise intelligent programmers follow it blindly regardless. > I do use "Ptr" and "Hdl" as suffixes on variables, since that is usually information needed to know how to get to the object. Now see? There you have the right (suffix) idea. > I'm just trying to find the right balance between abstraction and the practical side of having to maniplate the values stored in variables. Again, I'm not all THAT opposed to a clear name (I tend to put a suffix P on S*BOL variable names to indicate a "pattern" data type, for example). >> but I do think it's >interesting that so many people, lemming-like, adopt such absurd conventions >that some obvious loon dreams up and proposes as a naming convention >"standard". > There are reasons behind the convention, even if you don't necessarily agree with them. I've never seen a **single** valid argument for using a type PREfix instead of a SUFfix. > Evem the argument of "because everyone else is doing it" has some merit, Damned little!!! That's the "lemming-like" thing I mentioned earlier. If we were concerned about what "everyone else" is doing, then we wouldn't be using languages like Icon or S*BOL to begin with! :-) > if you have to be sharing your code with other people who adopt that convention. If someone working on the same project I am "adopts that convention" then they're going to have to adopt a more intelligent convention. Otherwise I'm clearly not doing my job... part of which is to squash up-front stupid bullshit like this in projects I'm involved with. :-) >> It's especially strange in a language like Icon or S*BOL where the type of a >variable can be QUITE variable during the execution of a program! > While that is theoretically true, it rarely occurs in the programs that I write. I would tend to say "rubbish"... I'm held back mostly just because it's POSSIBLE that you write some highly atypical Icon programs. If you parse numeric data out of a record using string scanning, the types will initially be CHARACTER STRINGS rather than some form of numeric type. > I very rarely use a variable to represent more than one type of value (&null sometimes being an exception to this rule, although even this doesn't occur very often). And you never parse numbers out of a string and use them in arithmetic form? If you do, do you (Pascal-like) go through explicit conversions and separate variable names for the numeric form or something? That's part of why I hate Pascal!!! > If I have a different type, I just declare a different variable. Again, that's part of the stupid and unproductive garbage you have to do with languages like Pascal. Even PL/1, my first programming language, makes nonsense like that unnecessary. You should be able to deal with a value as a value, and as long as you tell the system what you want to DO with that value, it shouldn't much matter what the original FORM of the value is! > About the only time it does occur in my code is when I am taking values out of one of the structure types (tables, lists, sets, records) or during parameter passing. I don't see why those are any different than any other type of variable. >> Again, please don't take this as a personal attack on the poster > No offense taken here. People ought to think about why they have certain styles of coding. I couldn't agree more. And I simply *say NO* to dumb conventions. Gordon Peterson http://www.computek.net/public/gep2/ Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ From icon-group-sender Wed Jan 21 16:41:53 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id QAA12726 for ; Wed, 21 Jan 1998 16:41:53 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA30302; Wed, 21 Jan 1998 16:41:53 -0700 To: icon-group@optima.CS.Arizona.EDU Date: Wed, 21 Jan 1998 16:52:45 GMT From: evans@gte.net (MJE) Message-Id: <6a596h$gt3$1@gte2.gte.net> Organization: None Sender: icon-group-request@optima.CS.Arizona.EDU Subject: Shannon-theoretic Language Approximators Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1277 It appears to me that this newsgroup does not have much traffic, so please feel free to relay this message to any other parties capable of answering it. I am wondering whether anyone has written a random-text generator in the Icon language of the sort that is described in the book "An Introduction to Information Theory : Symbols, Signals and Noise" by John Robinson Pierce (paperback; @ US$7.16 from http://www.amazon.com). This book is a kind of layman's overview of Shannon's information theory. It describes Shannon's work at a conceptual level. One of Shannon's studies involved the generation of random words that correspond, in a statistical/probabilistic sense, to English. The text is meaningless, but because it corresponds to the statistics of English, it can serve as a basis for studying the transmission of English prose. In principle, the technique applies to any other language as well. MORE GENERALLY: I would be interested in any Icon implementations of language statistics. Examples: counting frequencies of characters in a block of text, counting word frequencies in a block of text, examining symmetries in poetry, computing estimated probabilities of particular sequences of characters. Thank you so very much, Mark Evans From icon-group-sender Wed Jan 21 16:41:18 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id QAA12701 for ; Wed, 21 Jan 1998 16:41:16 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA32452; Wed, 21 Jan 1998 16:41:16 -0700 To: icon-group@optima.CS.Arizona.EDU Date: Wed, 21 Jan 1998 17:17:09 GMT From: evans@gte.net (MJE) Message-Id: <6a5ak8$1mr$1@gte2.gte.net> Organization: None Sender: icon-group-request@optima.CS.Arizona.EDU Subject: Hebrew Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 334 Hebrew is a right-to-left language. Icon is oriented toward left-to-right analysis, from all that I can tell. (1) Can Icon be reoriented to go right-to-left? (2) Failing that, are there any pitfalls in simply reversing the text of the Hebrew, and running Icon left-to-right against the reversed text? Mark Evans evans@gte.net From icon-group-sender Thu Jan 22 10:28:01 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id KAA03721 for ; Thu, 22 Jan 1998 10:28:01 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA32205; Thu, 22 Jan 1998 10:28:01 -0700 Date: Wed, 21 Jan 1998 19:03:24 -0600 (CST) From: Ramon Pereda X-Sender: rpereda@ringer To: MJE Cc: icon-group@optima.CS.Arizona.EDU Subject: Re: Hebrew In-Reply-To: <6a5ak8$1mr$1@gte2.gte.net> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 804 On Wed, 21 Jan 1998, MJE wrote: > Hebrew is a right-to-left language. Icon is oriented toward left-to-right > analysis, from all that I can tell. > > (1) Can Icon be reoriented to go right-to-left? No. If that is what you want it is cleaner to just reverse the string before scanning. There are all ready too many dyslexic people in the world. Have mercy. > (2) Failing that, are there any pitfalls in simply reversing the text of the > Hebrew, and running Icon left-to-right against the reversed text? Make sure you reverse the order of the words but not the letters in the words. At least I think that is what you want to do. I saw the Dead Sea Scrolls and I don't remember having to have my eyes jump all over the place. I'm a little confused as to how Hebrew is written in ASCII. -ray From icon-group-sender Thu Jan 22 10:28:48 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id KAA03752 for ; Thu, 22 Jan 1998 10:28:48 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA00413; Thu, 22 Jan 1998 10:28:48 -0700 Message-Id: <34C6AB3E.21B9@gte.net> Date: Wed, 21 Jan 1998 20:13:18 -0600 From: Mark Evans Reply-To: evans.nospam@gte.net Organization: None X-Mailer: Mozilla 3.01 (Win95; I) Mime-Version: 1.0 To: Ramon Pereda Cc: evans@gte.net, icon-group@optima.CS.Arizona.EDU Subject: An Introduction to Information Theory : Symbols, Signals and Noise Content-Type: multipart/mixed; boundary="------------62F34D633C7" Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 7717 This is a multi-part message in MIME format. --------------62F34D633C7 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Thank you for responding to my questions. Amazon.com has a wonderful search utility. Here is the Pierce book for you. At only seven dollars, it's a steal. Get the later edition. The book is a layman's introduction to Shannon's information theory. There are a few pages that present examples of random text conforming to zero-, first-, second-, and third-order approximations of English. -- Mark http://www.amazon.com/exec/obidos/ISBN=0486240614/4718-4074014-638156 --------------62F34D633C7 Content-Type: text/html; charset=us-ascii; name="4718-4074014-638156" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="4718-4074014-638156" Content-Base: "http://www.amazon.com/exec/obidos/ISBN =0486240614/4718-4074014-638156" An Introduction to Information Theory : Symbols, Signals and Noise
Amazon.com
Amazon.com Home
Text-Only

An Introduction to Information Theory : Symbols, Signals and Noise
by John Robinson Pierce
List: $8.95
Our Price: $7.16
You Save: $1.79 (20%)

Availability: This title usually ships within 24 hours.

2 Edition
Paperback, 305 pages
Published by Dover Pubns
Publication date: June 1980
Dimensions (in inches): 8.50 x 5.39 x .68
ISBN: 0486240614


(You can always remove it later...)

Learn more about
1-ClickSM ordering

Check out these titles! Readers who bought An Introduction to Information Theory : Symbols, Signals and Noise also bought:


Have you read this book? Write an online review and share your thoughts with other readers.

Look for similar books by subject:

Information theory
MATHEMATICS
Questions & Answers

i.e., each book must be in subject 1 AND subject 2 AND ...

Search Our 2.5-Million-Title Catalog
Enter Keywords:

Other ways to search our catalog

or Browse by Subject


Copyright and disclaimer © 1996-1998, Amazon.com, Inc.
--------------62F34D633C7-- From icon-group-sender Thu Jan 22 10:28:55 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id KAA03755 for ; Thu, 22 Jan 1998 10:28:55 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA00411; Thu, 22 Jan 1998 10:28:55 -0700 From: gep2@computek.net Date: Wed, 21 Jan 1998 20:40:17 -0600 Message-Id: <199801220240.UAA29186@axp.cmpu.net> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Subject: Hebrew To: icon-group@optima.CS.Arizona.EDU X-Mailer: SPRY Mail Version: 04.00.06.17 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1590 > Hebrew is a right-to-left language. Icon is oriented toward left-to-right analysis, from all that I can tell. > (1) Can Icon be reoriented to go right-to-left? Not as it stands. Of course, you do have access to the source code, so I don't see any insurmountable problems in developing a Hebrew-friendly[ier?] Icon variant. > (2) Failing that, are there any pitfalls in simply reversing the text of the Hebrew, and running Icon left-to-right against the reversed text? Pitfalls? Sure. None of them impassable, however. Among the problems are that Hebrew is NOT *strictly* right-to-left, in that numbers and non-Hebrew (such as English) words and names are embedded using the normal left-to-right character sequencing. If you've ever worked with a Hebrew-compatible word processor, this makes for very interesting jumping around of the cursor as you press the "right" and "left" arrow keys!! Most of the approaches I've seen seem to revolve around embedding an invisible marker in the text which starts and ends different directional modes. This is undeniably damned inconvenient. It sure would complicate string scanning for example, since as you're scanning a string "sequentially" sometimes the logically "next" character is nowhere near adjacent to the current one. If there's any consolation, it's that Icon and S*BOL are probably the two programming languages BEST-suited to handling this kind of complex textual manipulation! GOOD LUCK! Gordon Peterson http://www.computek.net/public/gep2/ Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ From icon-group-sender Thu Jan 22 10:27:30 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id KAA03556 for ; Thu, 22 Jan 1998 10:27:29 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA32657; Thu, 22 Jan 1998 10:27:29 -0700 Posted-Date: Wed, 21 Jan 1998 18:26:32 -0600 (CST) Date: Wed, 21 Jan 1998 18:26:32 -0600 (CST) From: Chris Tenaglia To: MJE Cc: icon-group@optima.CS.Arizona.EDU Subject: Re: Hebrew In-Reply-To: <6a5ak8$1mr$1@gte2.gte.net> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1167 I've written an editor macro that runs right to left (right justified) when I worked for a company with an Israeli division. But the language was TPU and editor/screen oriented rather than file/line/byte oriented. If you have 1:1 alpha character matching, reversal should work. But diphthong characters like "th" need to be collapsed into a single character for it to work. Chris Tenaglia (system manager) | The future foretold, Medical College of Wisconsin | The past explained, 8701 W. Watertown Plank Rd. | The present largely appologized for. Milwaukee, WI 53226 (414)456-8765 | Organon to the Doctor On Wed, 21 Jan 1998, MJE wrote: > Date: Wed, 21 Jan 1998 17:17:09 GMT > From: MJE > To: icon-group@optima.CS.Arizona.EDU > Subject: Hebrew > > > Hebrew is a right-to-left language. Icon is oriented toward left-to-right > analysis, from all that I can tell. > > (1) Can Icon be reoriented to go right-to-left? > > (2) Failing that, are there any pitfalls in simply reversing the text of the > Hebrew, and running Icon left-to-right against the reversed text? > > Mark Evans > evans@gte.net > > > From icon-group-sender Thu Jan 22 10:27:46 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id KAA03654 for ; Thu, 22 Jan 1998 10:27:45 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA00343; Thu, 22 Jan 1998 10:27:45 -0700 Date: Wed, 21 Jan 1998 18:56:42 -0600 (CST) From: Ramon Pereda X-Sender: rpereda@ringer To: MJE Cc: icon-group@optima.CS.Arizona.EDU Subject: Re: Shannon-theoretic Language Approximators In-Reply-To: <6a596h$gt3$1@gte2.gte.net> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1851 On Wed, 21 Jan 1998, MJE wrote: > I am wondering whether anyone has written a random-text generator in the Icon > language of the sort that is described in the book "An Introduction to > Information Theory : Symbols, Signals and Noise" by John Robinson Pierce > (paperback; @ US$7.16 from http://www.amazon.com). Tell me a little more about the book and I'll consider buying it. amazon.com does not have a table of contents. Icon would be ideal for this sort of application. I'd be glad to get you started, if I buy the book and the theory is not too thick. I'm very interested in n-grams. Does the book talk any about n-grams? There is an n-grams sample program in the Icon program library but it only does n-grams for single letters. I'd like to do n-grams for words and arbitrary items. If I remember correctly it was not straight forward to modify the program to handle these extensions. > One of Shannon's studies involved the generation of random words that > correspond, in a statistical/probabilistic sense, to English. The text is > meaningless, but because it corresponds to the statistics of English, it can > serve as a basis for studying the transmission of English prose. In principle, > the technique applies to any other language as well. There is a an old book with a title like Icon programming for the Humanities that touches on these issues. I would only recommend it as a very basic introduction. > MORE GENERALLY: I would be interested in any Icon implementations of language > statistics. Examples: counting frequencies of characters in a block of text, > counting word frequencies in a block of text, examining symmetries in poetry, > computing estimated probabilities of particular sequences of characters. Browse the Icon programming library at www.cs.arizon.edu. I'm sure there is some stuff. -ray From icon-group-sender Thu Jan 22 10:29:03 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id KAA03775 for ; Thu, 22 Jan 1998 10:29:03 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA00453; Thu, 22 Jan 1998 10:29:03 -0700 From: gep2@computek.net Date: Wed, 21 Jan 1998 21:37:04 -0600 Message-Id: <199801220337.VAA03847@axp.cmpu.net> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Subject: Re: Shannon-theoretic Language Approximators To: evans@gte.net (MJE) Cc: icon-group@optima.CS.Arizona.EDU In-Reply-To: <6a596h$gt3$1@gte2.gte.net> X-Mailer: SPRY Mail Version: 04.00.06.17 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 641 Sounds like some VERY interesting stuff that you're planning on working on, there! You might also want to look into SNOBOL/SPITBOL, which was a predecessor language to Icon. Some of us still use S*BOL daily in preference to Icon. There's also a book, "Algorithms in SNOBOL4" by Gimpel (available through Catspaw, and probably also through amazon.com) which contains a random text generator, and some techniques probably rather relevant to your research. Good luck, and please keep us posted on your developments! Gordon Peterson http://www.computek.net/public/gep2/ Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ From icon-group-sender Thu Jan 22 10:29:22 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id KAA03816 for ; Thu, 22 Jan 1998 10:29:19 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA32262; Thu, 22 Jan 1998 10:29:18 -0700 From: Otfried Geffert Date: Thu, 22 Jan 1998 09:42:42 GMT Message-Id: <19980122.9424261@og-1042.stardiv.de> Subject: Re: Hebrew To: evans@gte.net (MJE) Cc: icon-group@optima.CS.Arizona.EDU In-Reply-To: <6a5ak8$1mr$1@gte2.gte.net> References: <6a5ak8$1mr$1@gte2.gte.net> X-Mailer: Mozilla/3.0 (compatible; StarOffice/4.0; WinNT/Win95) X-Priority: 3 (Normal) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 774 Hi Mark, you can use newtext :=3D reverse("dragon")=20 or work through a string from right to left with=20 d r a g o n -6 -5 -4 -3 -2 -1 0 (indices) and not (the normal way) d r a g o n ^ ^ ^ ^ ^ ^ ^ 1 2 3 4 5 6 7 (indices) Otfried >>>>>>>>>>>>>>>>>> Urspr=FCngliche Nachricht <<<<<<<<<<<<<<<<<< Am 1/21/98, 06:17:09 PM, schrieb evans@gte.net (MJE) zum Thema Hebrew: >=20 > Hebrew is a right-to-left language. Icon is oriented toward=20 left-to-right > analysis, from all that I can tell. >=20 > (1) Can Icon be reoriented to go right-to-left? >=20 > (2) Failing that, are there any pitfalls in simply reversing the text = of the > Hebrew, and running Icon left-to-right against the reversed text? >=20 > Mark Evans > evans@gte.net >=20 >=20 >=20 From icon-group-sender Thu Jan 22 10:29:33 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id KAA03860 for ; Thu, 22 Jan 1998 10:29:30 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA00533; Thu, 22 Jan 1998 10:29:29 -0700 To: icon-group@optima.CS.Arizona.EDU Date: Thu, 22 Jan 1998 10:27:52 +0100 From: Anders Holtsberg Message-Id: <34C71118.299B@maths.lth.se> Organization: Lund University Sender: icon-group-request@optima.CS.Arizona.EDU References: <6a596h$gt3$1@gte2.gte.net> Subject: Re: Shannon-theoretic Language Approximators Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1710 MJE wrote: > I am wondering whether anyone has written a random-text generator in the Icon > language of the sort that is described in the book "An Introduction to > Information Theory : Symbols, Signals and Noise" by John Robinson Pierce > (paperback; @ US$7.16 from http://www.amazon.com). [...] If you like that you should buy a copy of Charniak's book Statistical language processing. It is about that and about statistical parsers and more. It is short and clear and cheap paperback and just great. I read it twice. And I have a chart parser up and running in Icon that I will give to others some day but I must debug and document and add statisical parts and unification and output formatting and fancy graphics in my spare time first ... > MORE GENERALLY: I would be interested in any Icon implementations of language > statistics. Examples: counting frequencies of characters in a block of text, > counting word frequencies in a block of text, examining symmetries in poetry, > computing estimated probabilities of particular sequences of characters. > No, probably because there are so many things people would like to do that a package would have to be very general. Indeed so general as to be a full programming language. And there are such beasts really. The best is called - well, you just mentioned it - Icon. > Thank you so very much, > > Mark Evans best wishes -- Andy === Anders Holtsberg ============================ andersh@maths.lth.se === Department of Mathematical Statistics Phone +46 46 222 4953 Lund University Fax +46 46 222 4623 === Box 118, S-221 00 LUND, Sweden === http://www.maths.lth.se/matstat === From icon-group-sender Thu Jan 22 15:10:52 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id PAA27371 for ; Thu, 22 Jan 1998 15:10:52 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA00982; Thu, 22 Jan 1998 15:10:52 -0700 From: gep2@computek.net Date: Thu, 22 Jan 1998 11:47:17 -0600 Message-Id: <199801221747.LAA24703@axp.cmpu.net> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Subject: Re: Hebrew To: icon-group@optima.CS.Arizona.EDU X-Mailer: SPRY Mail Version: 04.00.06.17 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 2162 >> Hebrew is a right-to-left language. Icon is oriented toward left-to-right > analysis, from all that I can tell. > > (1) Can Icon be reoriented to go right-to-left? >No. If that is what you want it is cleaner to just reverse the string before scanning. There are all ready too many dyslexic people in the world. Have mercy. >> (2) Failing that, are there any pitfalls in simply reversing the text of the > Hebrew, and running Icon left-to-right against the reversed text? >Make sure you reverse the order of the words but not the letters in the words. At least I think that is what you want to do. I saw the Dead Sea Scrolls and I don't remember having to have my eyes jump all over the place. I'm a little confused as to how Hebrew is written in ASCII. Most of the software I've seen which supports Hebrew (I used to support a consulting client whose tri-lingual office ran in French, English, and Hebrew...) uses one of *several* different techniques for supporting the Hebrew alephs (characters) within the 256-character Extended ASCII character set. Generally they usurp some range of other characters (sometimes the European characters (this is NOT good if you're also trying to simultaneously support French!), sometimes the box-drawing characters, sometimes others) and between the differing ideas by the people who design the display fonts, and the people who do the printer fonts, and the people who do keyboard support, and the people who do the applications software itself... you tend to have a REAL MESS. MS-DOS international keyboard drivers (for example) generally support switching dynamically between "foreign" and US English... CTRL-ALT-F1 for US English, and CRTL-ALT-F2 for "foreign". But if you want to switch between (say) Hebrew and French, then you usually have a serious problem. It's actually quite surprising how badly foreign languages tend to be supported in most software, and Hebrew with its quite special requirements is one of the more difficult ones it seems to support well. Gordon Peterson http://www.computek.net/public/gep2/ Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ From icon-group-sender Fri Jan 23 08:51:13 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id IAA13820 for ; Fri, 23 Jan 1998 08:51:12 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA02167; Fri, 23 Jan 1998 08:51:12 -0700 To: icon-group@optima.CS.Arizona.EDU Date: Fri, 23 Jan 1998 10:36:44 +0100 From: Anders Holtsberg Message-Id: <34C864AC.3AA0@maths.lth.se> Organization: Lund University Sender: icon-group-request@optima.CS.Arizona.EDU Subject: Interesting feature Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1193 There is too little traffic here! Why? The perl and python newsgroups are full and this ought to be too! In order to improve the statistics we can discuss this little feature I was bitten by when I wrote a program that built a complicated tree. procedure main() # let's say that mytable is a node in a large tree mytable := table([]) # and that the following is in a deep loop put(mytable["A"], "B") if not write(mytable["A"][1]) then write("FAIL 1") if not write(mytable["C"][1]) then write("FAIL 2") end Now as an exercise try to guess what the program writes. I tried to think of some more intuitive way Icon could have behaved but I found none really. The first solution I came up with was to insert the line \mytable["A"] := [] before the the put-instruction. Then I came up with removing the explicit list creation again by writing mytable["A"] |||:= ["B"] instead of the put-instruction. This seems astongishingly enough to work as expected for nonexisting "A". Is this a standard trick among you Icon gurus? For long lists it may slow down things due to the extra copying but my lists are short. Comments? Improvements? -- Anders Holtsberg From icon-group-sender Fri Jan 23 12:33:20 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id MAA12588 for ; Fri, 23 Jan 1998 12:33:20 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA02183; Fri, 23 Jan 1998 12:33:20 -0700 From: gep2@computek.net Date: Fri, 23 Jan 1998 10:09:24 -0600 Message-Id: <199801231609.KAA19180@axp.cmpu.net> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Subject: Interesting feature To: icon-group@optima.CS.Arizona.EDU X-Mailer: SPRY Mail Version: 04.00.06.17 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 611 > There is too little traffic here! Why? The perl and python newsgroups are full and this ought to be too! I think there are several good reasons for that. 1) Our numbers are smaller. 2) This language maybe *requires* less handholding than some others. 3) The people who get into Icon probably are [mostly!] more advanced, self-reliant and less likely to have the kinds of questions that a lot of the newbies playing with trendier languages like Perl or Python are likely to have. Gordon Peterson http://www.computek.net/public/gep2/ Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ From icon-group-sender Fri Jan 23 12:33:53 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id MAA12604 for ; Fri, 23 Jan 1998 12:33:53 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA02606; Fri, 23 Jan 1998 12:33:53 -0700 Date: Fri, 23 Jan 1998 10:42:53 -0700 From: swampler@noao.edu (Steve Wampler) Subject: Re: Stripping blank and comment lines To: icon-group@optima.CS.Arizona.EDU Message-Id: Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 3070 A while ago I posed a problem to this group to write a program that strips comment lines (lines with only a comment on them) and blank lines from Icon source files. Only Nevin Liber provided a solution (thanks Nevin!), which works just fine and is reproduced below. I've also included the solution I had, which is similar to Nevin's but less sophisticated about error checking. Finally, I've included a version that attempts to avoid the Wrath of the Variable Name gods - it's a rewrite of my solution without any local variables! Now a new puzzle - can you rewrite the if test it that version's 'stripcomments()' procedure to avoid the the empty 'then' clause? ----First, Nevin Liber's solution (I've scrunched some of the blank lines to save space) - note the clever way he has of keeping the file opening and closing isolated into a single procedure, while processing the file contents outside that procedure. I had not seen this before!: procedure main(LArguments) local fInput local sLine every fInput := InputFiles(LArguments) do { while sLine := read(fInput) do { write(ValidSourceLine(sLine)) } } end procedure InputFiles(LFilenames) local sFilename local fFile if 0 = *LFilenames then { return &input } every sFilename := !LFilenames do { if not (fFile := open(sFilename)) then { write(&errout, "Cannot open ", image(sFilename), " for reading.") next } suspend fFile close(fFile) } end procedure ValidSourceLine(sLine) sLine ? { tab(many('\t ')) if ="#" | not move(1) then { fail } } return sLine end ------------------------------------------------- Now my solution: ------------------------------------------------- # remove comment lines and blank lines from Icon programs... # (one can argue that a blank line is just an exceptionally # terse comment...) procedure main(args) local f if *args = 0 then { stripcomments(&input) } else { every f := open(!args) do { stripcomments(f) close(f) } } end procedure stripcomments(f) local line every line := !f do { line ? { tab(many(' \t')) if ="#" | pos(0) then next } write(line) } end ------------------------------------ And, finally, the 'variable-less' version: ------------------------------------ # remove comment lines and blank lines from Icon programs... # (one can argue that a blank line is just an exceptionally # terse comment...) procedure main(args) if *args = 0 then { stripcomments(&input) } else { every close(stripcomments(open(!args))) } end procedure stripcomments(f) every !f ? { tab(many(' \t')) if ="#" | pos(0) then {} # can you remove this empty clause? else write(&subject) } return f end -- Steve Wampler - swampler@gemini.edu [Gemini 8m Telescopes Project (under AURA)] The gods that smiled at your birth are now laughing openly. (Fortune Cookie) From icon-group-sender Mon Jan 26 09:34:41 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id JAA10599 for ; Mon, 26 Jan 1998 09:33:20 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA01416; Mon, 26 Jan 1998 09:33:20 -0700 To: icon-group@optima.CS.Arizona.EDU Date: Sun, 25 Jan 1998 18:01:35 GMT From: evans.nospam@gte.net (MJE) Message-Id: <6afuoq$jsi$1@gte1.gte.net> Organization: None Sender: icon-group-request@optima.CS.Arizona.EDU References: <6a596h$gt3$1@gte2.gte.net>, <34C71118.299B@maths.lth.se> Subject: Re: Shannon-theoretic Language Approximators Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 2156 I would be happy with any single one of the above. I don't require all of them at once! Thank you for responding. Any code you can supply would be appreciated. I looked at the book you mentioned via Amazon.com, but it was labeled "hard to find" or "backordered" so it might be a while before it comes. Mark On Thu, 22 Jan 1998 10:27:52 +0100, Anders Holtsberg wrote: >MJE wrote: >> I am wondering whether anyone has written a random-text generator in the Icon >> language of the sort that is described in the book "An Introduction to >> Information Theory : Symbols, Signals and Noise" by John Robinson Pierce >> (paperback; @ US$7.16 from http://www.amazon.com). [...] > >If you like that you should buy a copy of Charniak's book Statistical >language >processing. It is about that and about statistical parsers and more. It >is >short and clear and cheap paperback and just great. I read it twice. > >And I have a chart parser up and running in Icon that I will give to >others >some day but I must debug and document and add statisical parts and >unification >and output formatting and fancy graphics in my spare time first ... > >> MORE GENERALLY: I would be interested in any Icon implementations of language >> statistics. Examples: counting frequencies of characters in a block of text, >> counting word frequencies in a block of text, examining symmetries in poetry, >> computing estimated probabilities of particular sequences of characters. >> > >No, probably because there are so many things people would like to >do that a package would have to be very general. Indeed so general as to >be >a full programming language. And there are such beasts really. The best >is >called - well, you just mentioned it - Icon. > >> Thank you so very much, >> >> Mark Evans > >best wishes > >-- Andy > >=== Anders Holtsberg ============================ andersh@maths.lth.se >=== > Department of Mathematical Statistics Phone +46 46 222 4953 > Lund University Fax +46 46 222 4623 >=== Box 118, S-221 00 LUND, Sweden === http://www.maths.lth.se/matstat >=== From icon-group-sender Mon Jan 26 09:33:56 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id JAA10650 for ; Mon, 26 Jan 1998 09:33:56 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA04320; Mon, 26 Jan 1998 09:33:56 -0700 From: "Mike Headon MBIT" Organization: North East Wales Institute To: icon-group@optima.CS.Arizona.EDU Date: Fri, 23 Jan 1998 10:15:40 +0000 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: Quoted-printable Subject: Not Hebrew but Welsh X-Confirm-Reading-To: "Mike Headon MBIT" X-Pmrqc: 1 Priority: normal X-Mailer: Pegasus Mail for Windows (v2.54) Message-Id: <5FEFEC527D@earth.newi.ac.uk> Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 941 Recent correspondence about Hebrew (and other) character sets inspires me to post this - not strictly about Icon itself, but I've been involved in a family history project transcribing local parish registers (baptisms, marriages, burials) and I've been using Icon routines to edit and index the texts. My problem is that in this area of Welsh Wales lots of place-names used the letters w-circumflex (still part of standard Welsh) and y-circumflex (obsolete). In pre-Windows days, I could construct these characters easily using the patches shown in Alan Corr=E9's Icon Programming for Humanists, but now I'm looking for a quick and nasty fix that'll work with text files created by Word 6 under Windows 3.1 or Windows 95. I'm trying to shortcut using additional editors or formal character sets - the Vicar wants his books back! Mike Headon M.Headon@newi.ac.uk North East Wales Institute, Plas Coch, Wrexham, Wales, LL11 2AW From icon-group-sender Mon Jan 26 16:53:31 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id QAA19274 for ; Mon, 26 Jan 1998 16:53:30 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA05146; Mon, 26 Jan 1998 16:53:30 -0700 To: icon-group@optima.CS.Arizona.EDU Date: Mon, 26 Jan 1998 13:58:20 -0500 From: Olivier Lefevre Message-Id: <34CCDCCC.39CC@ny.ubs.com> Organization: Union Bank of Switzerland, New York site Sender: icon-group-request@optima.CS.Arizona.EDU References: <6a596h$gt3$1@gte2.gte.net>, <34C71118.299B@maths.lth.se>, <6afuoq$jsi$1@gte1.gte.net> Subject: Re: Shannon-theoretic Language Approximators Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 335 MJE wrote: > I looked at the book you mentioned via Amazon.com, but it was labeled > "hard to find" or "backordered" so it might be a while before it > comes. Use http://www.clbooks.com/ rather than Amazon: for computer books, that makes more sense. He does have one book in print (MIT Press) and they have it in stock. -- O.L. From icon-group-sender Wed Jan 28 08:29:51 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id IAA22703 for ; Wed, 28 Jan 1998 08:29:50 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA07138; Wed, 28 Jan 1998 08:29:50 -0700 From: "Mike Headon MBIT" Organization: North East Wales Institute To: icon-group@optima.CS.Arizona.EDU Date: Wed, 28 Jan 1998 09:38:35 +0000 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: Quoted-printable Subject: Not Hebrew but Welsh X-Confirm-Reading-To: "Mike Headon MBIT" X-Pmrqc: 1 Priority: normal X-Mailer: Pegasus Mail for Windows (v2.54) Message-Id: Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 942 Recent correspondence about Hebrew (and other) character sets inspires me to post this - not strictly about Icon itself, but I've been involved in a family history project transcribing local parish registers (baptisms, marriages, burials) and I've been using Icon routines to edit and index the texts. My problem is that in this area of Welsh Wales lots of place-names used the letters w-circumflex (still part of standard Welsh) and y-circumflex (obsolete). In pre-Windows days, I could construct these characters easily using the patches shown in Alan Corr=E9's Icon Programming for Humanists, but now I'm looking for a quick and nasty fix that'll work with text files created by Word 6 under Windows 3.1 or Windows 95. I'm trying to shortcut using additional editors or formal character sets - the Vicar wants his books back! Mike Headon M.Headon@newi.ac.uk North East Wales Institute, Plas Coch, Wrexham, Wales, LL11 2AW From icon-group-sender Wed Jan 28 16:45:18 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id QAA24911 for ; Wed, 28 Jan 1998 16:45:17 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA06521; Wed, 28 Jan 1998 16:45:17 -0700 To: icon-group@optima.CS.Arizona.EDU Date: 28 Jan 1998 20:23:40 GMT From: corre@alpha1.csd.uwm.edu (Alan D Corre) Message-Id: <6ao44c$ncu$1@uwm.edu> Organization: University of Wisconsin - Milwaukee, Computing Services Division Sender: icon-group-request@optima.CS.Arizona.EDU References: <6a5ak8$1mr$1@gte2.gte.net> Subject: Re: Hebrew Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1849 In article <6a5ak8$1mr$1@gte2.gte.net> evans@gte.net (MJE) writes: > >Hebrew is a right-to-left language. Icon is oriented toward left-to-right >analysis, from all that I can tell. > >(1) Can Icon be reoriented to go right-to-left? > >(2) Failing that, are there any pitfalls in simply reversing the text of the >Hebrew, and running Icon left-to-right against the reversed text? I have written two Icon programs that involve Hebrew. They both use ProIcon, a nice form of Icon for the Mac which unfortunately isnt supported any more, but still works. It is now public domain. One is an educational program for teaching Hebrew to Russian speakers. If you want a copy, write to cklockow@uwm.edu for info. Or send her ten dollars + three dollars shipping for the disk to Language Resource Center, Univ. of Wis-Milwaukee, PO Box 413, Milwaukee WI 53201. The other is a program to help students master texts in various languages including Hebrew, Russian, Polish, Greek and west european langs. I havent published it. It comes with an adjoining program to create the materials for the students. It probably involves more work than the average language teacher would like to invest. I'll leave question 1 to someone who knows more about Icon than I do. You can use transcription of course if you want to do statistical studies or something like that on texts that you have prepared. I hope this helps. Incidentally some years back I published a "diskionary" of Judeo-Arabic on disk, but we used Snobol4 for that. It is now out of print, but I might be able to dig up an unbound copy of the documentation if you want it. JA is written in Hebrew script. Alan D. Corre, Emeritus Professor of Hebrew Studies, corre@uwm.edu -- Alan D. Corre Emeritus Professor of Hebrew Studies University of Wisconsin-Milwaukee http://www.uwm.edu/~corre/ From icon-group-sender Fri Jan 30 08:13:09 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id IAA08128 for ; Fri, 30 Jan 1998 08:13:09 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA08083; Fri, 30 Jan 1998 08:13:08 -0700 To: icon-group@optima.CS.Arizona.EDU Date: Fri, 30 Jan 1998 03:19:17 GMT From: "Bernard A. Badger" Message-Id: Sender: icon-group-request@optima.CS.Arizona.EDU References: <6a5ak8$1mr$1@gte2.gte.net>, <6ao44c$ncu$1@uwm.edu> Subject: Re: Hebrew Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1070 Alan D Corre wrote in message <6ao44c$ncu$1@uwm.edu>... >In article <6a5ak8$1mr$1@gte2.gte.net> evans@gte.net (MJE) writes: >> >>Hebrew is a right-to-left language. Icon is oriented toward left-to-right >>analysis, from all that I can tell. >> >>(1) Can Icon be reoriented to go right-to-left? >> >>(2) Failing that, are there any pitfalls in simply reversing the text of the >>Hebrew, and running Icon left-to-right against the reversed text? Just stop thinking of the text as being stored right-to-left. Store it beginning-to-end. You just have to adjust the Output to appear right-to-left. The problem is purely with output devices that go left-to-right. Internally, you should be operating start-to-end. The same thing occurs with hex-dump programs. For little-endian architectures, the output should look like this: 4f4e4d4c 4b4a4948 47464544 43424140 : 00000000 "@ABCDEFGHIJKLMNO" Where the part before the ":" runs right-to-left and the string runs left-to-right. Both represent the same string, it is the output that varies. [Other stuff snipped.] From icon-group-sender Mon Feb 2 08:27:27 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id IAA00434 for ; Mon, 2 Feb 1998 08:27:26 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA10419; Mon, 2 Feb 1998 08:27:25 -0700 To: icon-group@optima.CS.Arizona.EDU Date: Sun, 01 Feb 1998 04:04:28 GMT From: evans.nospam@gte.net (MJE) Message-Id: <6b0sd2$dad$1@gte2.gte.net> Organization: None Sender: icon-group-request@optima.CS.Arizona.EDU Subject: Graphical Text with Lines Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1065 We need to produce a particular type of plot in Icon. It shows a string with lines connecting certain characters. Example: This is a proportional font | | | || | | | | || | | ---------------- | | | | | | | --------------------------- According to the Icon book, I can indeed get text to print in a window in any font I like. How can I find out the coordinates where particular characters in the string exist in the window, especially since the font is not monospaced but proportional? This information is required to make sure that the connecting lines point to the right place. I would be willing to entertain ideas about using a character-grid (monospaced) instead. What I mean is, breaking the string up into characters and printing each of them in turn, defining the coordinates as I go along. This technique is nonideal. I would much rather just figure out where the characters are in the proportional font string. Mark Evans From icon-group-sender Mon Feb 2 08:27:54 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id IAA00481 for ; Mon, 2 Feb 1998 08:27:53 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA11213; Mon, 2 Feb 1998 08:27:53 -0700 To: icon-group@optima.CS.Arizona.EDU Date: Mon, 02 Feb 1998 03:41:42 GMT From: evans.nospam@gte.net (MJE) Message-Id: <6b3feg$ra$1@gte2.gte.net> Organization: None Sender: icon-group-request@optima.CS.Arizona.EDU Subject: Icon to C Conversion Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 675 Just finished the Icon book -- this is an interesting and very powerful language. Does there exist a program that converts an Icon-based parser into C code? I've written parsers in C but do not find the exercise very amusing. In general, is there any code out there that converts Icon to C? Or is there some means of integrating Icon procedures into larger C or C++ projects? Presumably the latter scheme would involve a version of the Icon interpreter embedded into object code that is linked to the C project. I wish that the commercial world I live in offered more choices than C and C++ and Java, but that's where we're at. Mark Evans remove ".nospam" to reply From icon-group-sender Mon Feb 2 08:28:02 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id IAA00498 for ; Mon, 2 Feb 1998 08:28:02 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA11208; Mon, 2 Feb 1998 08:28:02 -0700 To: icon-group@optima.CS.Arizona.EDU Date: Mon, 2 Feb 1998 01:39:47 -0700 From: "Scott Gilbert" Message-Id: <6b40pb$jdp$1@usenet76.supernews.com> Organization: All USENET -- http://www.Supernews.com Sender: icon-group-request@optima.CS.Arizona.EDU References: <6b3feg$ra$1@gte2.gte.net> Subject: Re: Icon to C Conversion Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 536 I remember that an older version of Icon shipped with both a translator to Icon byte code (icont) and a compiler which was native to the machine (iconc). The iconc compiler worked by first converting to C code and then compiling the C code using the native compiler for the platform. I'm pretty sure that support for iconc was dropped. What would be REALLY cool in my mind is a compiler that converted from Icon source to Java byte code. MJE wrote: Does there exist a program that converts an Icon-based parser into C code? From icon-group-sender Mon Feb 2 08:27:36 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id IAA00448 for ; Mon, 2 Feb 1998 08:27:35 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA11176; Mon, 2 Feb 1998 08:27:35 -0700 To: icon-group@optima.CS.Arizona.EDU Date: 1 Feb 1998 05:23:11 GMT From: jeffery@cs.utsa.edu (Clinton Jeffery) Message-Id: <6b10rv$76c@ringer.cs.utsa.edu> Organization: The University of Texas at San Antonio Sender: icon-group-request@optima.CS.Arizona.EDU References: <6b0sd2$dad$1@gte2.gte.net> Reply-To: jeffery@cs.utsa.edu Subject: Re: Graphical Text with Lines Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 705 MJE (evans.nospam@gte.net) wrote: : How can I find out the coordinates where particular characters in the string : exist in the window, especially since the font is not monospaced but : proportional? The function TextWidth(s) (that's TextWidth(W, s) on window W) will give you the pixel width of any particular string that you may write (or have written) using the graphics facilities. To identify the pixel for a specific character within a large string, you would get the pixel width of the string up to the character you are interested in. -- Clint Jeffery, jeffery@cs.utsa.edu Division of Computer Science, The University of Texas at San Antonio Research http://www.cs.utsa.edu/research/plss.html From icon-group-sender Mon Feb 2 12:42:22 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id MAA03889 for ; Mon, 2 Feb 1998 12:42:22 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA11738; Mon, 2 Feb 1998 12:42:21 -0700 Date: Mon, 2 Feb 1998 09:08:05 -0700 From: Ralph Griswold Message-Id: <9802021608.AA09017@jupiter.CS.Arizona.EDU> To: icon-group@optima.CS.Arizona.EDU, xscott@nospam.theriver.com Subject: Re: Icon to C Conversion Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 182 iconc exists and is available, but unsupported. I don't think it does what you want. Icon has been implemented in Java (generates byte codes) but the performance is unacceptable. From icon-group-sender Wed Feb 4 10:31:45 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id KAA20896 for ; Wed, 4 Feb 1998 10:31:44 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA13600; Wed, 4 Feb 1998 10:31:44 -0700 To: icon-group@optima.CS.Arizona.EDU Date: Tue, 03 Feb 98 21:46:29 -0500 From: "Brandon S. Allbery KF8NH" Message-Id: <34d7d7a3$14$ofn$mr2ice@speaker> Organization: Brandon's home server in Parma, Ohio Sender: icon-group-request@optima.CS.Arizona.EDU References: <6b3feg$ra$1@gte2.gte.net> Subject: Re: Icon to C Conversion Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 672 In <6b3feg$ra$1@gte2.gte.net>, on 02/02/98 at 03:41 AM, evans.nospam@gte.net (MJE) said: +----- | Does there exist a program that converts an Icon-based parser into C code? | I've written parsers in C but do not find the exercise very amusing. +--->8 Once upon a time, there was iconc --- it compiled Icon to C, then compiled that and linked against the Icon runtime library. It worked well in the later v8 Icons, but is broken in v9; while it's still included in the v9 distribution, it's unsupported. -- brandon s. allbery [Team OS/2][Linux][JAPH] bsa@void.apk.net cleveland, ohio mr/2 ice's "rfc guru" :-) KF8NH From icon-group-sender Tue Feb 10 17:06:50 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id RAA20565 for ; Tue, 10 Feb 1998 17:06:50 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA19687; Tue, 10 Feb 1998 17:06:49 -0700 Message-Id: <34E0BCD8.7CD@gte.net> Date: Tue, 10 Feb 1998 14:47:20 -0600 From: Mark Evans Reply-To: evans@gte.net Organization: None X-Mailer: Mozilla 3.01 (Win95; I) Mime-Version: 1.0 To: icon-group@optima.CS.Arizona.EDU Subject: Stand-alone executables Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 178 Under Windows/DOS, does there exist any method of bundling the "iconx" interpreter with compiled icon code to create a true "stand-alone" executable? Mark Evans evans@gte.net From icon-group-sender Wed Feb 11 08:19:09 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id IAA18923 for ; Wed, 11 Feb 1998 08:19:05 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA18777; Wed, 11 Feb 1998 08:19:04 -0700 Date: Wed, 11 Feb 1998 02:04:13 -0600 (CST) From: Ramon Pereda X-Sender: rpereda@pandora To: Mark Evans Cc: icon-group@optima.CS.Arizona.EDU Subject: Re: Stand-alone executables In-Reply-To: <34E0BCD8.7CD@gte.net> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1329 On Tue, 10 Feb 1998, Mark Evans wrote: > Under Windows/DOS, does there exist any method of bundling the "iconx" > interpreter with compiled icon code to create a true "stand-alone" > executable? No, there does not. Perl has one though called perl2exe. The author of perl2exe told me that his techniques are a trade secret. If I had a method of bundling the interpreter and application code, I would gave gotten away with using Icon much more in my jobs outside of the university. At Texas Instruments, I worked on an assembly source to assembly source translator that was based on a terribly hacked up version of the assembler. If I could have created a standalone Icon executable, I could have written the translator in Icon. My experience with the Icon compiler was that the resulting source was too large; so, the executable would be too large. This would have drawn the attention of my knuckle-headed supervisors. Ideally one would like a platform independent way of attaching the input to the interpreter to the end executable and to inform the interpreter to start reading at the some point in its own executable. Perl2exe does this without recompiling perl. If anyone has some techniques, experience, or advice they would like to share on this, please speak up. I'd be glad to chase down any leads. -ray From icon-group-sender Wed Feb 11 08:18:28 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id IAA18908 for ; Wed, 11 Feb 1998 08:18:27 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA18834; Wed, 11 Feb 1998 08:18:26 -0700 Message-Id: <002b01bd36a1$07522360$c41afecc@cwf.ricochet.net> From: "Chris Fraser" To: Subject: Re: Stand-alone executables Date: Tue, 10 Feb 1998 19:44:56 -0800 Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 X-Msmail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.72.2106.4 X-Mimeole: Produced By Microsoft MimeOLE V4.72.2106.4 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 560 I have often wondered about and wanted just this function. If there isn't such a feature now, how hard would it be to make one? Chris Fraser cwfraser@microsoft.com. -----Original Message----- From: Mark Evans To: icon-group@optima.CS.Arizona.EDU Date: Tuesday, February 10, 1998 4:18 PM Subject: Stand-alone executables >Under Windows/DOS, does there exist any method of bundling the "iconx" >interpreter with compiled icon code to create a true "stand-alone" >executable? > >Mark Evans >evans@gte.net From icon-group-sender Wed Feb 11 12:26:09 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id MAA07214 for ; Wed, 11 Feb 1998 12:26:09 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA20840; Wed, 11 Feb 1998 12:26:08 -0700 Message-Id: <34E1E5FD.4E0EFCC1@ix.netcom.com> Date: Wed, 11 Feb 1998 12:55:09 -0500 From: David Feustel Reply-To: feustel@ix.netcom.com X-Mailer: Mozilla 4.04 [en] (WinNT; U) Mime-Version: 1.0 To: icon-group@optima.CS.Arizona.EDU Subject: Re: Stand-alone executables References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1695 For those of you willing to use the precursor to Icon (i.e. Snobol) you can create a single file containing both the Snobol interpreter and the Snobol Source file for later execution. See http://www.snobol.com for a free snobol interpreter and info on Spitbol, a compiled version of snobol. Ramon Pereda wrote: > > On Tue, 10 Feb 1998, Mark Evans wrote: > > > Under Windows/DOS, does there exist any method of bundling the "iconx" > > interpreter with compiled icon code to create a true "stand-alone" > > executable? > > No, there does not. Perl has one though called perl2exe. The author of > perl2exe told me that his techniques are a trade secret. If I had a > method of bundling the interpreter and application code, I would gave > gotten away with using Icon much more in my jobs outside of the > university. At Texas Instruments, I worked on an assembly source to > assembly source translator that was based on a terribly hacked up version > of the assembler. If I could have created a standalone Icon executable, I > could have written the translator in Icon. My experience with the Icon > compiler was that the resulting source was too large; so, the executable > would be too large. This would have drawn the attention of my > knuckle-headed supervisors. > > Ideally one would like a platform independent way of attaching the input > to the interpreter to the end executable and to inform the interpreter to > start reading at the some point in its own executable. Perl2exe does this > without recompiling perl. > > If anyone has some techniques, experience, or advice they would like > to share on this, please speak up. I'd be glad to chase down any leads. > > -ray From icon-group-sender Wed Feb 11 12:25:57 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id MAA07211 for ; Wed, 11 Feb 1998 12:25:57 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA21187; Wed, 11 Feb 1998 12:25:56 -0700 Message-Id: <34E1CDA3.2C40@gte.net> Date: Wed, 11 Feb 1998 10:11:15 -0600 From: Mark Evans Reply-To: evans@gte.net Organization: None X-Mailer: Mozilla 3.01 (Win95; I) Mime-Version: 1.0 To: icon-group@optima.CS.Arizona.EDU Subject: Re: Stand-alone executables References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1796 Ramon Pereda wrote: > > On Tue, 10 Feb 1998, Mark Evans wrote: > > > Under Windows/DOS, does there exist any method of bundling the "iconx" > > interpreter with compiled icon code to create a true "stand-alone" > > executable? > > No, there does not. [snip] > > Ideally one would like a platform independent way of attaching the input > to the interpreter to the end executable and to inform the interpreter to > start reading at the some point in its own executable. Perl2exe does this > without recompiling perl. > > If anyone has some techniques, experience, or advice they would like > to share on this, please speak up. I'd be glad to chase down any leads. > > -ray I don't follow the reasoning of attaching the input data to the chain. The whole point of writing programs is so that they can accept multiple inputs over some period of time. If you compile your input into your program, you cannot change it without recompiling. As far as the stand-alone interpretive system goes, one method would be to recompile the icon interpreter as (1) an object code library (static linkage) or (2) a DLL (dynamic linkage). Then it becomes a fairly easy, if tedious, matter to create stand-alone executables. You would not be limited by the capabilities of the Icon runtime environment, for you would be building your own from scratch. The run-time image of an Icon program would be part of the stand-alone, which would issue calls into the static or dynamic library. I suppose that the static library is the more conservative approach and probably the best one. I never did like the Windows design that forces your system to depend on a single folder housing five thousand DLLs. Like the proverbial string, you start pulling one out, and then the whole building collapses. Mark From icon-group-sender Wed Feb 11 12:26:35 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id MAA07223 for ; Wed, 11 Feb 1998 12:26:34 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA21177; Wed, 11 Feb 1998 12:26:33 -0700 From: gep2@computek.net Date: Wed, 11 Feb 1998 12:29:30 -0600 Message-Id: <199802111829.MAA03702@axp.cmpu.net> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Subject: Re: Stand-alone executables To: icon-group@optima.CS.Arizona.EDU X-Mailer: SPRY Mail Version: 04.00.06.17 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 2826 >... If I had a method of bundling the interpreter and application code, I would gave gotten away with using Icon much more in my jobs outside of the university. Of course, for MS-DOS systems a simple batch file can make an interpreter/code package LOOK (to the operator) like an "executable"... sometimes this is enough, all by itself. (You can even "cheat" a little by renaming the code file with a more-familiar extension such as ".DLL".) :-) > At Texas Instruments, I worked on an assembly source to assembly source translator that was based on a terribly hacked up version of the assembler. I'm intrigued, I thought I was the only person who did assembly-language cross-compilers. :-) I did one that cross-compiles Motorola 68000 assembler source code into Intel-flavor assembler source code. :-) (I used that one in conjunction with an Atari-ST to PC video game conversion project... quite a few years ago now). That one was written in S*BOL. > If I could have created a standalone Icon executable, I could have written the translator in Icon. My experience with the Icon compiler was that the resulting source was too large; so, the executable would be too large. This would have drawn the attention of my knuckle-headed supervisors. I'm rather amazed that the Icon program would be "too large"... in my experience, it's rare to have really big programs there. My converter is something like 2K lines of S*BOL, best as I can recall. Largeish as S*BOL programs go. I don't doubt that SPITBOL 386 would compile it with consummate ease, although at the time I was running it on an 8086-based Amstrad processor (essentially an XT) under SNOBOL4+ and it ran fine even on that limited platform. Of course, SPITBOL will also produce .EXE files and this would have allowed you to solve that problem for your company. > Ideally one would like a platform independent way of attaching the input to the interpreter to the end executable and to inform the interpreter to start reading at the some point in its own executable. Perl2exe does this without recompiling perl. I personally am quite willing to give up "platform independence" since virtually all the systems one runs into in the "real world" are PC-based. Or at least that's very true in the client circles our company deals with. And given the fact that we can get **very** capable multimedia PCs for less than $500 (add $150 for a 14" color VGA monitor), it's fairly ridiculous to do without one if you want to run a program which runs well on that platform. The entire machine to run the program costs about the same as just ONE day of consulting time... see why "multiplatform" matters SO little? Gordon Peterson http://www.computek.net/public/gep2/ Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ From icon-group-sender Wed Feb 11 12:27:37 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id MAA07259 for ; Wed, 11 Feb 1998 12:27:36 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA21271; Wed, 11 Feb 1998 12:27:35 -0700 Date: Wed, 11 Feb 1998 12:39:35 -0600 (CST) From: Ramon Pereda X-Sender: rpereda@pandora Reply-To: Ramon Pereda To: icon-group@optima.CS.Arizona.EDU Subject: Re: Stand-alone executables Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1330 On Tue, 10 Feb 1998, Mark Evans wrote: > Under Windows/DOS, does there exist any method of bundling the "iconx" > interpreter with compiled icon code to create a true "stand-alone" > executable? No, there does not. Perl has one though called perl2exe. The author of perl2exe told me that his techniques are a trade secret. If I had a method of bundling the interpreter and application code, I would gave gotten away with using Icon much more in my jobs outside of the university. At Texas Instruments, I worked on an assembly source to assembly source translator that was based on a terribly hacked up version of the assembler. If I could have created a standalone Icon executable, I could have written the translator in Icon. My experience with the Icon compiler was that the resulting source was too large; so, the executable would be too large. This would have drawn the attention of my knuckle-headed supervisors. Ideally one would like a platform independent way of attaching the input to the interpreter to the end executable and to inform the interpreter to start reading at the some point in its own executable. Perl2exe does this without recompiling perl. If anyone has some techniques, experience, or advice they would like to share on this, please speak up. I'd be glad to chase down any leads. -ray From icon-group-sender Wed Feb 11 12:27:45 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id MAA07289 for ; Wed, 11 Feb 1998 12:27:45 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA19947; Wed, 11 Feb 1998 12:27:44 -0700 From: gep2@computek.net Date: Wed, 11 Feb 1998 12:41:26 -0600 Message-Id: <199802111841.MAA05400@axp.cmpu.net> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Subject: Re: Stand-alone executables To: icon-group@optima.CS.Arizona.EDU X-Mailer: SPRY Mail Version: 04.00.06.17 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1101 > I have often wondered about and wanted just this function. If there isn't such a feature now, how hard would it be to make one? I realize it's not EXACTLY the same, but SPITBOL 386 (and SPITBOL NT) can both make executable .EXE files. SPITBOL is a language with many similar features to Icon, of course. Given the choice of both languages, I almost always use S*BOL in preference to Icon... I guess mostly just because I find S*BOL pattern matching so much easier and more natural than Icon's string scanning. Of course, in some applications the S*BOL CODE() and EVAL() functions are absolutely required... and that's also a deal-breaker as far as coding the thing in Icon is concerned. Certainly Icon has a more traditional syntax, but one shouldn't overlook the S*BOL languages either! In many, many applications I still think they are the Right Choice. :-) OTOH, I can't think of hardly ANYTHING that I think would be a good enough reason to use Perl. :-) Gordon Peterson http://www.computek.net/public/gep2/ Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ From icon-group-sender Tue Feb 24 08:20:31 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id IAA06863 for ; Tue, 24 Feb 1998 08:20:30 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA28948; Tue, 24 Feb 1998 08:20:29 -0700 Date: Tue, 17 Feb 1998 00:26:47 -0700 From: khemlann@agcs.com (Neil Khemlani) Message-Id: <9802170026.ZM29926@altlab15> X-Mailer: Z-Mail (3.2.1 10apr95) To: icon-group@optima.CS.Arizona.EDU Subject: icon questions Cc: khemlann@agcs.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 963 To whom it may concern: Actually, I have two main questions. First, is there a flag that I can use with iconx or iconc that will allow it to produce C source code? Secondly, is there a way that in Icon to access the xclipboard (our system is running Solaris with CDE as the X-window interface)? Thanks for your assistance. Neil -- Neil J. Khemlani khemlann@agcs.com (602)581-4358 Y43 (602)204-1025 PGR System Test under Ray Fu Network-Based Services - ASP SDWT ========================================================================== Primary & Basic Rate Interface, GTD-5 EAX-ISM (VCDX), Training, Recruiting ========================================================================== System Test Training Starpoint, ASP Staffing Starpoint ========================================================================== AG Communication Systems, 2500 W. Utopia Road, Phoenix, AZ 85027 (602) 582-7000 http://www.agcs.com "Expand the power of your network" From icon-group-sender Tue Feb 24 08:21:26 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id IAA06938 for ; Tue, 24 Feb 1998 08:21:26 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA28683; Tue, 24 Feb 1998 08:21:25 -0700 To: icon-group@optima.CS.Arizona.EDU Date: 17 Feb 1998 18:19:28 -0600 From: jeffery@ringer.cs.utsa.edu (Clinton L. Jeffery) Message-Id: <6cd9eg$ole@pandora.cs.utsa.edu> Organization: University of Texas at San Antonio Sender: icon-group-request@optima.CS.Arizona.EDU Subject: Windows Icon 9.3.1 generates .exe files Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 699 I have updated the main Windows Icon distribution at ftp://ringer.cs.utsa.edu/pub/icon/nt/binaries/ to generate .exe files. Bundling iconx adds ~200K to console applications, and ~350K to graphics applications, but I think the added convenience more than makes up for the size cost, so I've made .exe the default extension. If you want the smaller icode files, you can specify a .bat or .cmd extension with icont's -o option and things behave as they did before. Clint Jeffery, jeffery@cs.utsa.edu Division of Computer Science, The University of Texas at San Antonio Research http://www.cs.utsa.edu/research/plss.html -- Clint Jeffery jeffery@cs.utsa.edu The University of Texas at San Antonio From icon-group-sender Tue Feb 24 08:21:37 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id IAA06942 for ; Tue, 24 Feb 1998 08:21:37 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA29060; Tue, 24 Feb 1998 08:21:36 -0700 Message-Id: <34EB3456.53E4@gte.net> Date: Wed, 18 Feb 1998 13:19:50 -0600 From: Mark Evans Reply-To: evans@gte.net Organization: None X-Mailer: Mozilla 3.01 (Win95; I) Mime-Version: 1.0 To: jeffery@cs.utsa.edu Cc: icon-group@optima.CS.Arizona.EDU Subject: Re: Stand-alone executables References: <199802180115.TAA29593@segfault.cs.utsa.edu> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 730 Clinton Jeffery wrote: > > > Under Windows/DOS, does there exist any method of bundling the "iconx" > > interpreter with compiled icon code to create a true "stand-alone" > > executable? > > My thanks to everybody who participated in last week's discussion of the > need to produce standalone .exe files for Icon programs. > > I hope you enjoy this new feature, and I will continue to look forward to > comments and suggestions you have for Windows Icon. I crave feedback! > > Clint Jeffery, jeffery@cs.utsa.edu > Division of Computer Science, The University of Texas at San Antonio > Research http://www.cs.utsa.edu/research/plss.html Well this is service. First I hear "No, No, No" and then "Here you go." Mark From icon-group-sender Tue Feb 24 08:19:54 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id IAA06785 for ; Tue, 24 Feb 1998 08:19:54 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA28144; Tue, 24 Feb 1998 08:19:53 -0700 Message-Id: <34E25022.6574@gte.net> Date: Wed, 11 Feb 1998 19:28:02 -0600 From: Mark Evans Reply-To: evans@gte.net Organization: None X-Mailer: Mozilla 3.01 (Win95; I) Mime-Version: 1.0 To: icon-group@optima.CS.Arizona.EDU Subject: Re: Stand-alone executables References: <199802111841.MAA05400@axp.cmpu.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1239 gep2@computek.net wrote: > > > I have often wondered about and wanted just this function. If there isn't > such a feature now, how hard would it be to make one? > > I realize it's not EXACTLY the same, but SPITBOL 386 (and SPITBOL NT) can both > make executable .EXE files. SPITBOL is a language with many similar features to > Icon, of course. I refuse to work with any language named SPIT___. > Given the choice of both languages, I almost always use S*BOL in preference to > Icon... I guess mostly just because I find S*BOL pattern matching so much easier > and more natural than Icon's string scanning. Of course, in some applications > the S*BOL CODE() and EVAL() functions are absolutely required... and that's also > a deal-breaker as far as coding the thing in Icon is concerned. (1) Out of curiosity, have you ever used the Mathematica programming language? I would be interested in your commentary as to how it compares with Icon and S*BOL. (2) Why are CODE() and EVAL() "deal-breakers"? What are these calls, and what is your definition of a "deal-breaker"? > Gordon Peterson > http://www.computek.net/public/gep2/ > Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ Mark Evans evans@gte.net From icon-group-sender Tue Feb 24 08:20:11 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id IAA06860 for ; Tue, 24 Feb 1998 08:20:11 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA29055; Tue, 24 Feb 1998 08:20:10 -0700 Message-Id: <2.2.32.19980212184628.00319058@pop5.ibm.net> X-Sender: usinet.laturk@pop5.ibm.net (Unverified) X-Mailer: Windows Eudora Pro Version 2.2 (32) Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Date: Thu, 12 Feb 1998 12:46:28 -0600 To: icon-group@optima.CS.Arizona.EDU From: "Dr. Louis A. Turk" Subject: Need Help Diplaying/Printing Nota Bene Greek Fonts Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 421 Friends, I have three questions: 1. Is there an optimizing icon compiler for Windows 95 and/or NT? If yes, where can I find it? 2. Is the Icon graphics book finished? 3. I would like an Icon program to read my MSDOS based Nota Bene 4.5a wordprocessor files containing Greek fonts and display them on my monitor screen and also print them. How do I program it to do this? Many thanks in advance. Louis Turk From icon-group-sender Tue Feb 24 08:21:00 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id IAA06880 for ; Tue, 24 Feb 1998 08:21:00 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA27392; Tue, 24 Feb 1998 08:21:00 -0700 Date: Tue, 17 Feb 1998 19:15:13 -0600 Message-Id: <199802180115.TAA29593@segfault.cs.utsa.edu> From: Clinton Jeffery To: evans@gte.net Cc: icon-group@optima.CS.Arizona.EDU In-Reply-To: <34E0BCD8.7CD@gte.net> (message from Mark Evans on Tue, 10 Feb 1998 14:47:20 -0600) Subject: Re: Stand-alone executables Reply-To: jeffery@cs.utsa.edu Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1377 > Under Windows/DOS, does there exist any method of bundling the "iconx" > interpreter with compiled icon code to create a true "stand-alone" > executable? My thanks to everybody who participated in last week's discussion of the need to produce standalone .exe files for Icon programs. Ray Pereda even sent me a simple C program that proves-by-example that bundling iconx with compiled icode need not be a difficult, low-level task. It turns out his brute force technique works correctly both for NT console and Windows applications, and works on NT, Windows 95, and Windows 3.1, so we are in luck! I have updated the main Windows Icon distribution at ftp://ringer.cs.utsa.edu/pub/icon/nt/binaries/ to generate .exe files. Bundling iconx adds ~200K to console applications, and ~350K to graphics applications, but I think the added convenience more than makes up for the size cost, so I've made .exe the default extension. If you want the smaller icode files, you can specify a .bat or .cmd extension with icont's -o option and things behave as they did before. I hope you enjoy this new feature, and I will continue to look forward to comments and suggestions you have for Windows Icon. I crave feedback! Clint Jeffery, jeffery@cs.utsa.edu Division of Computer Science, The University of Texas at San Antonio Research http://www.cs.utsa.edu/research/plss.html From icon-group-sender Tue Feb 24 08:19:37 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id IAA06769 for ; Tue, 24 Feb 1998 08:19:37 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA28252; Tue, 24 Feb 1998 08:19:36 -0700 Date: Wed, 11 Feb 1998 16:32:22 -0600 Message-Id: <199802112232.QAA20145@segfault.cs.utsa.edu> From: Clinton Jeffery To: icon-group@optima.CS.Arizona.EDU Subject: Re: Stand-alone executables Reply-To: jeffery@cs.utsa.edu Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 921 Wow, it seems almost EVERYBODY using DOS or Windows Icon wants stand-alone executables. I sure do. The question is: who is going to volunteer? And if no one volunteers, who is willing to pay for it? Since it isn't research, I have continually been too short of "volunteer time" to invest heavily in Microsoft-specific machine-level details, but I am willing to work with anyone who volunteers to do this for the command-line or graphical versions of Windows Icon. I am also willing to hire and supervise a student to do the job, if we can come up with an economic model to fund it. Actually, some information might help at this point. Technical discussions with the NT Spitbol implementor or with persons who know Microsoft's object formats might reveal that the task isn't all that difficult. There are several possible approaches, and I am not sure which would be easiest. Clint Jeffery, jeffery@cs.utsa.edu From icon-group-sender Tue Feb 24 08:21:49 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id IAA06995 for ; Tue, 24 Feb 1998 08:21:49 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA28152; Tue, 24 Feb 1998 08:21:48 -0700 Date: Wed, 18 Feb 1998 14:30:31 -0600 Message-Id: <199802182030.OAA30515@segfault.cs.utsa.edu> From: Clinton Jeffery To: evans@gte.net Cc: icon-group@optima.CS.Arizona.EDU In-Reply-To: <34EB3456.53E4@gte.net> (message from Mark Evans on Wed, 18 Feb 1998 13:19:50 -0600) Subject: Re: Stand-alone executables Reply-To: jeffery@cs.utsa.edu Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 658 [Mark Evans commented on my about-face on the Windows .exe file issue.] > Well this is service. First I hear "No, No, No" and then "Here you go." You owe it to Ray Pereda, who provided the proof that a brute force approach would work. Before then all I knew was that the regular MS-DOS Icon executable header method didn't work, and that I didn't have time to study Microsoft's machine-code file formats. But it had been bugging me for a long time, so when a solution came up, I jumped on it. Clint Jeffery, jeffery@cs.utsa.edu Division of Computer Science, The University of Texas at San Antonio Research http://www.cs.utsa.edu/research/plss.html From icon-group-sender Tue Feb 24 08:22:03 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id IAA07022 for ; Tue, 24 Feb 1998 08:21:59 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA28177; Tue, 24 Feb 1998 08:21:57 -0700 Message-Id: <34EB3A18.20BF@gte.net> Date: Wed, 18 Feb 1998 13:44:24 -0600 From: Mark Evans Reply-To: evans@gte.net Organization: None X-Mailer: Mozilla 3.01 (Win95; I) Mime-Version: 1.0 To: jeffery@cs.utsa.edu Cc: icon-group@optima.CS.Arizona.EDU Subject: Re: Stand-alone executables References: <199802182030.OAA30515@segfault.cs.utsa.edu> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 94 Would you please explain what in the world you mean by "brute-force" in this context? Mark From icon-group-sender Tue Feb 24 08:22:16 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id IAA07057 for ; Tue, 24 Feb 1998 08:22:12 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA24402; Tue, 24 Feb 1998 08:22:11 -0700 Date: Wed, 18 Feb 1998 14:46:33 -0600 Message-Id: <199802182046.OAA30547@segfault.cs.utsa.edu> From: Clinton Jeffery To: icon-group@optima.CS.Arizona.EDU Cc: meehan@cs.wwu.edu Subject: Windows sources updated Reply-To: jeffery@cs.utsa.edu Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1111 I've updated the main Windows Icon source distribution at ringer.cs.utsa.edu in directory pub/icon/nt/src. If you are studying the source code on a Microsoft platform, you probably want this distribution. In addition to reflecting the current graphics facilities and recent .exe-generation additions, the distribution includes a co-expression switch provided by Frank Lhota that employs the standard Microsoft C in-line assembler, so anyone with a 32-bit version of Visual C++ should be able to build the entire distribution easily. The sources are repackaged as a single file named mswin.zip that includes the NT configuration files. Configuration and building for both the console and graphics-capable binaries is (hopefully) straightforward. I would like to hear if you build from the sources, and especially want to hear whether things work out of the box or what, if anything, you find you have to change things in order to build successfully. Clint Jeffery, jeffery@cs.utsa.edu Division of Computer Science, The University of Texas at San Antonio Research http://www.cs.utsa.edu/research/plss.html From icon-group-sender Tue Feb 24 08:22:29 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id IAA07075 for ; Tue, 24 Feb 1998 08:22:21 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA21060; Tue, 24 Feb 1998 08:22:19 -0700 Date: Wed, 18 Feb 1998 14:52:39 -0600 Message-Id: <199802182052.OAA30557@segfault.cs.utsa.edu> From: Clinton Jeffery To: evans@gte.net Cc: icon-group@optima.CS.Arizona.EDU In-Reply-To: <34EB3A18.20BF@gte.net> (message from Mark Evans on Wed, 18 Feb 1998 13:44:24 -0600) Subject: Re: Stand-alone executables Reply-To: jeffery@cs.utsa.edu Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 485 Mark, Brute force in this case means literally that I create a .exe file by concatenating the icode file onto the end of the wiconx.exe (or nticonx.exe). This is the opposite of: going through standard .exe format conventions to insert the icode as extra data in the .exe file, which is the job of a linker or resource compiler. I am not sure this thread is interesting to everyone in Icon group, so if have any more technical questions, I'll discuss it with you privately. Clint From icon-group-sender Tue Feb 24 08:22:41 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id IAA07086 for ; Tue, 24 Feb 1998 08:22:33 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA21033; Tue, 24 Feb 1998 08:22:29 -0700 Message-Id: <34F26F1D.A617B066@erols.com> Date: Tue, 24 Feb 1998 01:56:29 -0500 From: Adnan Khan X-Mailer: Mozilla 4.03 [en] (Win95; I) Mime-Version: 1.0 To: icon-group@optima.CS.Arizona.EDU, sunyd21@aol.com Subject: help with icon programing Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 822 Hi there! I am new with this language and I have two questions. I am trying to intialize a character in icon language and i don't know how to do it. Could you please tell me how to intilize something as a character. Second, I am checking if two things or same or not by using an 'if' statement. and... my project reads one character and checks if it is '0' (zero) or not. As long as the character which is read in from the file is an integer the program runs fine, but when it reads a non-integer charcter from the file it gives me an error msg. of something like type mismatch or something. My first question relates to the same thing. I want to declare that the thing read from the file is a character and not an integer and then I want to compare them. Thanks. Hassan. reply to sunyd21@aol.com Thanx. From icon-group-sender Tue Feb 24 13:03:02 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id NAA05019 for ; Tue, 24 Feb 1998 13:03:00 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA29274; Tue, 24 Feb 1998 13:03:00 -0700 Date: Tue, 24 Feb 1998 17:59:21 +0300 (MEST) From: Ehud Lamm To: jeffery@cs.utsa.edu Cc: icon-group@optima.CS.Arizona.EDU Subject: Re: Stand-alone executables In-Reply-To: <199802182052.OAA30557@segfault.cs.utsa.edu> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 524 On Wed, 18 Feb 1998, Clinton Jeffery wrote: > > I am not sure this thread is interesting to everyone in Icon group, so if > have any more technical questions, I'll discuss it with you privately. > > Clint On the contrary, it is etremely interesting. This low level stuff is cool. If anyone can add low level info about the co-expr feature - so much the better.... (I know I should go and read the source, but life is short and my todo list seems longer...) Thanks.. Ehud Lamm mslamm@pluto.mscc.huji.ac.il From icon-group-sender Tue Feb 24 13:03:15 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id NAA05023 for ; Tue, 24 Feb 1998 13:03:11 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA29989; Tue, 24 Feb 1998 13:03:11 -0700 Date: Tue, 24 Feb 1998 08:03:36 -0800 From: kwalker@sfo.harbinger.com (Ken Walker) Message-Id: <199802241603.IAA12817@varda.premenos.com> To: icon-group@optima.CS.Arizona.EDU, sunyd21@aol.com, mr2r@erols.com Subject: Re: help with icon programing Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Md5: F7DEN7W/z/Z0i2i1ArEtDw== Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1833 > Date: Tue, 24 Feb 1998 01:56:29 -0500 > From: Adnan Khan > > I am new with this language and I have two questions. I am trying > to intialize a character in icon language and i don't know how to do > it. Could you please tell me how to intilize something as a character. > Second, I am checking if two things or same or not by using an 'if' > statement. and... my project reads one character and checks if it is '0' > (zero) or not. As long as the character which is read in from the file > is an integer the program runs fine, but when it reads a non-integer > charcter from the file it gives me an error msg. of something like type > mismatch or something. My first question relates to the same thing. I > want to declare that the thing read from the file is a character and not > an integer and then I want to compare them. Icon has no character data type; it has only character sets and character strings. The function call, reads(file, 1), returns a character string of length one. Icon automatically converts been integers and character strings when it can. It sounds like you are using the integer comparison operator. This works okay when you read a digit because the digit is converted to an integer before the comparison, but for a non-digit character which cannot be converted, it produces an error. You need to use the string comparison operator: if chr == "0" then ... Note that Icon variable declarations contain no type information. In Icon, it is values not variables that have type. Any variable can have a value of any type. If you want to determine if a string can be converted to an integer, you can try an explicit conversion and see if it succeeds or fails: if integer(str) then ... Ken Walker, kwalker@sfo.harbinger.com Harbinger Coporation, Concord, Ca. 94520 From icon-group-sender Tue Feb 24 13:03:47 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id NAA05066 for ; Tue, 24 Feb 1998 13:03:47 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA28149; Tue, 24 Feb 1998 13:03:46 -0700 Date: Tue, 24 Feb 1998 09:02:13 -0800 From: kwalker@sfo.harbinger.com (Ken Walker) Message-Id: <199802241702.JAA12855@varda.premenos.com> To: icon-group@optima.CS.Arizona.EDU, khemlann@agcs.com Subject: Re: icon questions Cc: khemlann@agcs.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Md5: S1D7bHFkzLcfAXlHKsMdjg== Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 4424 > Date: Tue, 17 Feb 1998 00:26:47 -0700 > From: khemlann@agcs.com (Neil Khemlani) > > Actually, I have two main questions. First, is there a flag that I can > use with iconx or iconc that will allow it to produce C source code? The -c option of iconc will produce C source code. However, the source code is only suitable for compiling and linked to a run-time system. It is not meant for human consumption. As an example, I translated a simple "hello, world" program. It produced two files. The .h file is /*ICONC*/ /* * Tue Feb 24 08:12:11 1998 * This file was produced by * iconc: Icon Compiler Version 9.0. July 16, 1994 */ #define COMPILER 1 #include "/home/users/edison/kwalker/icon_v9.0/bin_solaris/rt.h" #define OpTblSz 1 int op_tbl_sz = 0; #define NGlobals 1 int n_globals = 0; int n_statics = 0; struct descrip statics[1]; int F291_write Params((word status , FILE *f , dptr x , int nargs , dptr rslt)); hidden int P000_main Params((noargs)); struct PF000_main { struct p_frame *old_pfp; dptr old_argp; dptr rslt; continuation succ_cont; struct { struct tend_desc *previous; int num; struct descrip d[1]; } tend; }; and the .c file is /*ICONC*/ /* * Tue Feb 24 08:12:11 1998 * This file was produced by * iconc: Icon Compiler Version 9.0. July 16, 1994 */ #include "t1.h" static B_IProc(2) init_op_tbl[OpTblSz]; static struct {word dword; union block *vword;} init_globals[NGlobals] = { {D_Null} /* place holder */ }; struct sdescrip init_gnames[1]; struct b_proc *builtins[1]; int main(argc, argv) int argc; char **argv; { op_tbl = (struct b_proc *)init_op_tbl; globals = (dptr)init_globals; eglobals = &globals[0]; gnames = (dptr)init_gnames; egnames = &gnames[0]; estatics = &statics[0]; debug_info = 0; line_info = 0; err_conv = 0; largeints = 0; init(*argv, &argc, argv, 0); tend = NULL; P000_main(); c_exit(NormalExit); } static int P000_main() { struct PF000_main r_frame; register int r_signal; int i; r_frame.old_pfp = pfp; pfp = (struct p_frame *)&r_frame; r_frame.old_argp = argp; r_frame.rslt = NULL; r_frame.succ_cont = NULL; for (i = 0; i < 1; ++i) r_frame.tend.d[i] = nulldesc; argp = NULL; r_frame.tend.num = 1; r_frame.tend.previous = tend; tend = (struct tend_desc *)&r_frame.tend; Poll(); r_frame.tend.d[0].vword.sptr = "hello, world"; r_frame.tend.d[0].dword = 12; Poll(); Poll(); { FILE *f = NULL; word status = k_output.status; if ((k_output.status & Fs_Write) == 0 ) goto L1 /* within: write */; f= k_output.fd; goto L2 /* within: write */; L1: ; /* within: write */ err_msg(213, NULL); L2: ; /* within: write */ F291_write(status, f, (&r_frame.tend.d[0]), 1, &trashcan); } Poll(); tend = r_frame.tend.previous; pfp = r_frame.old_pfp; argp = r_frame.old_argp; return A_Resume; } More complex programs only get worse... There are several problems with translating Icon into C. Some of the major problems are: - you must implement goal-directed evaluation in a laguage that has none. In some cases, with enough optimization, it can be converted into loops. But in other cases the best technique we have come up with involves breaking the program into lots of little functions and passing function pointers around everywhere. This is not your typical C code. - variables must be able to hold any value, and values must include type information. In some cases, if you do enough analysis, you can remove these requirements, but in general you cannot. - variables have to be implemented in such as way that the garbage collector can find them. Converting Icon programs into C is much more interesting than it appears on the surface :-) Ken Walker, kwalker@sfo.harbinger.com Harbinger Coporation, Concord, Ca. 94520 From icon-group-sender Tue Feb 24 16:49:24 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id QAA00972 for ; Tue, 24 Feb 1998 16:49:15 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA24084; Tue, 24 Feb 1998 16:49:14 -0700 Message-Id: <34F34131.2689@gte.net> Date: Tue, 24 Feb 1998 15:52:49 -0600 From: Mark Evans Reply-To: evans@gte.net Organization: None X-Mailer: Mozilla 3.01 (Win95; I) Mime-Version: 1.0 To: Ken Walker Cc: icon-group@optima.CS.Arizona.EDU, khemlann@agcs.com Subject: Re: icon questions References: <199802241702.JAA12855@varda.premenos.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 4585 Ken Walker wrote: > The -c option of iconc will produce C source code. However, the source > code is only suitable for compiling and linked to a run-time system. It > is not meant for human consumption. As an example, I translated > a simple "hello, world" program. It produced two files. The .h file > is All of the major problems relate to the run-time support system. I presume that this is described in "rt.h"? I am speaking ad lib as I have not used the Icon --> C converter. > More complex programs only get worse... That is true in the general case regardless of language. In the specific case of going from Icon --> C, the complexity makes sense because the port is from a high-level, compact language to a low-level system language. I have no problems with that. It seems natural to me. That is the whole point of the endeavor: to have the computer work out the details so that you can focus on higher level abstractions. If the C output were *not* complicated-looking, I would have to ask whether I had gained anything over writing the C myself in the first place. When I read on the dust jacket of the Icon book that it takes ten times less code to do an algorithm in Icon, I would fully expect the C code to be ten times as large as the Icon source. If we could find a way to build a front-end language and C-generator with an even better ratio, like 100 times, I would be all for it. Modern C++ compilers are very complicated affairs but the world couldn't get along without them, not easily. They take care of inheritance and run-time dispatch issues so you don't have to. Have you ever looked at the output of CFront? I would like an Icon-->C generator of similar capability. Just as CFront knows about classes and their details, I want the Icon-->C converter to know about generators and goal-directed evaluation and their details. We are basically talking about improving our tools, just like the progression from stone to axe to plane to mill to laser. > There are several problems with translating Icon into C. Some of > the major problems are: > > - you must implement goal-directed evaluation in a laguage > that has none. In some cases, with enough optimization, it > can be converted into loops. But in other cases the best > technique we have come up with involves breaking the program > into lots of little functions and passing function pointers > around everywhere. This is not your typical C code. Perhaps this characteristic just reveals that traditional C is not efficient of expression. Efficiency or compactness of expression may require function pointers. Since Icon by nature is meant to break new ground, I would not be surprised to find that it translates into unusual C code. I have used function pointers a few times in my C work. I was always quite pleased whenever I found a use for them. The result always struck me as being elegant. Function pointers are one of the neat things about C. Don't forget that they are used all over the place in the run-time systems of C++ compilers (dispatch tables to member functions). That should be a clue that function pointers can really get you places. > - variables must be able to hold any value, and values must include > type information. In some cases, if you do enough analysis, you > can remove these requirements, but in general you cannot. It seems to me that this requirement is not a hard one to handle. Why bother eliminating it? > - variables have to be implemented in such as way that the garbage > collector can find them. Dangling pointers are the #1 bug in C code. When you implement an automatic garbage collector that does this job for the programmer, you have eliminated most of his bugs. You have created a better tool. > Converting Icon programs into C is much more interesting than it > appears on the surface :-) > > Ken Walker, kwalker@sfo.harbinger.com > Harbinger Coporation, Concord, Ca. 94520 You can look at these "problems" in a more optimistic light. Turn the thing around; all the major problems are confined to the run-time support system. Therefore, if the run-time support system is properly written, then it should be easy to convert Icon source to C. The interpreter is implemented in C, so there should be a reasonable means of implementing its run-time support system as a C-callable library. Then this library source code would be part of the generated C code from iconc. The obstacles may be hard, but they are surmountable. Mark Evans evans@gte.net From icon-group-sender Tue Feb 24 16:48:56 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id QAA00961 for ; Tue, 24 Feb 1998 16:48:55 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA28082; Tue, 24 Feb 1998 16:48:55 -0700 Message-Id: X-Mailer: Novell GroupWise 4.1 Date: Tue, 24 Feb 1998 15:55:53 -0600 From: Charles Hethcoat To: icon-group@optima.CS.Arizona.EDU Subject: Re: Stand-alone executables -Forwarded Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=_E1B42B0C.EA8BE570" Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 2133 This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=_E1B42B0C.EA8BE570 Content-Type: text/plain Content-Disposition: inline Yeah, I kind of like reading about this stuff too. Reminds me of how much I've yet to learn. Charlie Hethcoat Oceaneering Space Systems --=_E1B42B0C.EA8BE570 Content-Type: message/rfc822 Received: from optima.cs.arizona.edu ([192.12.69.5]) by housmtp.oceaneering.com (GroupWise SMTP/MIME daemon 4.1 v3) ; Tue, 24 Feb 98 14:05:41 CST Received: from baskerville.CS.Arizona.EDU (baskerville.CS.Arizona.EDU [192.12.69.35]) by optima.cs.arizona.edu (8.8.7/8.8.7) with ESMTP id NAA09575; Tue, 24 Feb 1998 13:03:40 -0700 (MST) Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id NAA05019 for ; Tue, 24 Feb 1998 13:03:00 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA29274; Tue, 24 Feb 1998 13:03:00 -0700 In-Reply-To: <199802182052.OAA30557@segfault.cs.utsa.edu> Message-Id: Errors-To: icon-group-errors@CS.Arizona.EDU Date: Tue, 24 Feb 1998 08:59:21 -0600 From: Ehud Lamm To: jeffery@cs.utsa.edu Cc: icon-group@optima.CS.Arizona.EDU Subject: Re: Stand-alone executables Mime-Version: 1.0 Content-Type: text/plain Content-Disposition: inline On Wed, 18 Feb 1998, Clinton Jeffery wrote: > > I am not sure this thread is interesting to everyone in Icon group, so if > have any more technical questions, I'll discuss it with you privately. > > Clint On the contrary, it is etremely interesting. This low level stuff is cool. If anyone can add low level info about the co-expr feature - so much the better.... (I know I should go and read the source, but life is short and my todo list seems longer...) Thanks.. Ehud Lamm mslamm@pluto.mscc.huji.ac.il --=_E1B42B0C.EA8BE570-- From icon-group-sender Tue Feb 24 16:49:45 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id QAA00986 for ; Tue, 24 Feb 1998 16:49:45 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA27911; Tue, 24 Feb 1998 16:49:45 -0700 Date: Tue, 24 Feb 1998 14:18:49 -0800 From: kwalker@sfo.harbinger.com (Ken Walker) Message-Id: <199802242218.OAA13006@varda.premenos.com> To: evans@gte.net Subject: Re: icon questions Cc: icon-group@optima.CS.Arizona.EDU Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Md5: rCygISIKgy8cnMu7pIsirQ== Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 875 Perhaps the question that should have been asked first is: why do you want an Icon to C translator? What are you going to do with the C code? If you just want to translate an Icon program into an executable, that is what iconc already does and it happens to use a C compiler as a back end, but why do you care? If you want to link Icon procedures into C programs then you want an Icon compiler that produces object code that uses C calling conventions. To my knowledge no one has done that; by once again, why do you care if it really produces C code somewhere along the line as long as the calling conventions are compatable. If you want to do developement in Icon, but you boss wants you to produce C code, then you do need a translator to produce C code and it had better be "good" C code. Ken Walker, kwalker@sfo.harbinger.com Harbinger Coporation, Concord, Ca. 94520 From icon-group-sender Wed Feb 25 08:09:12 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id IAA11296 for ; Wed, 25 Feb 1998 08:09:12 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA30238; Wed, 25 Feb 1998 08:09:11 -0700 Message-Id: <34F3F770.1E8@gte.net> Date: Wed, 25 Feb 1998 04:50:24 -0600 From: Mark Evans Reply-To: evans@gte.net Organization: None X-Mailer: Mozilla 3.01 (Win95; I) Mime-Version: 1.0 To: Charles Hethcoat Cc: icon-group@optima.CS.Arizona.EDU Subject: Re: Stand-alone executables -Forwarded References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1605 Well, I have to second the motion myself now that two others have spoken up. Besides, I haven't seen much other traffic on this mailing list. The answer to the "low-level" question that I asked of Clinton Jeffery regarding the "brute-force" technique of making .exe's turned out to be trivial. I would not even consider it "low-level." What happens is that the icode is appended to the iconx interpreter (within the same file). This copy of the interpreter, upon startup, opens *itself* as the file for interpretation and automatically skips past the code to the icode data part of the file. Mark Charles Hethcoat wrote: > > Yeah, I kind of like reading about this stuff too. Reminds me of how > much I've yet to learn. > > Charlie Hethcoat > Oceaneering Space Systems > > --------------------------------------------------------------- > > Subject: Re: Stand-alone executables > Date: Tue, 24 Feb 1998 08:59:21 -0600 > From: Ehud Lamm > To: jeffery@cs.utsa.edu > CC: icon-group@optima.CS.Arizona.EDU > > On Wed, 18 Feb 1998, Clinton Jeffery wrote: > > > > > I am not sure this thread is interesting to everyone in Icon group, so if > > have any more technical questions, I'll discuss it with you privately. > > > > Clint > > On the contrary, it is etremely interesting. This low level stuff is > cool. > > If anyone can add low level info about the co-expr feature - so much the > better.... > > (I know I should go and read the source, but life is short and my todo > list seems longer...) > > Thanks.. > > Ehud Lamm mslamm@pluto.mscc.huji.ac.il From icon-group-sender Wed Feb 25 08:08:54 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id IAA11271 for ; Wed, 25 Feb 1998 08:08:52 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA28723; Wed, 25 Feb 1998 08:08:51 -0700 Message-Id: <34F3F605.F1A@gte.net> Date: Wed, 25 Feb 1998 04:44:21 -0600 From: Mark Evans Reply-To: evans@gte.net Organization: None X-Mailer: Mozilla 3.01 (Win95; I) Mime-Version: 1.0 To: Ken Walker Cc: icon-group@optima.CS.Arizona.EDU Subject: Re: icon questions References: <199802242218.OAA13006@varda.premenos.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 186 Ken Walker wrote: > > Perhaps the question that should have been asked first is: why do you > want an Icon to C translator? Speed of execution (compiled vs. interpreted). -- Mark From icon-group-sender Wed Feb 25 12:23:28 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id MAA05267 for ; Wed, 25 Feb 1998 12:23:28 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA29932; Wed, 25 Feb 1998 12:23:27 -0700 Date: Wed, 25 Feb 98 12:00:29 -0500 Message-Id: <9802251700.AB0060@valinet.com> From: Paul Abrahams To: icon-group@optima.CS.Arizona.EDU Cc: abrahams@acm.org (Paul Abrahams) Subject: Translation into C Reply-To: abrahams@acm.org Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 438 Mark Evans suggested that the reason one might want an Icon to C translator is that the resulting program will execute faster because it doesn't need to be interpreted. But I wonder how much difference that would really make. If the C program spends most of its time calling library routines, then I wouldn't expect much difference at all. Does anyone have statistics that might answer this question? Paul Abrahams abrahams@acm.org From icon-group-sender Wed Feb 25 12:24:05 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id MAA05273 for ; Wed, 25 Feb 1998 12:24:04 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA28648; Wed, 25 Feb 1998 12:24:03 -0700 Date: Wed, 25 Feb 1998 12:57:17 -0600 Message-Id: <199802251857.MAA06117@segfault.cs.utsa.edu> From: Clinton Jeffery To: icon-group@optima.CS.Arizona.EDU Subject: DOS/386 Icon already generates .exe files Reply-To: jeffery@cs.utsa.edu Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1012 [Carl Sturtivant writes about .exe files for Icon programs:] > iconx still has to know its own length, so it knows how much > to skip over. As Carl's message alludes to, it turns out that DOS/386 Icon already generates .exe files (using a -A option to icont); its been available this way for years, I think. That implementation uses a similar technique to the one Windows Icon recently *re*-discovered. The sample solution sent to me by Ray Pereda did just what you describe. But I figured out how to do it in a way that iconx does *not* have to know its own length, which means I don't have to recompute that value every time the interpreter source code is modified, which is frequently! Like your implementation, one version of wiconx.exe (or nticonx.exe) serves as both a stub in a standalone and as an interpreter of regular (small) icode files. Clint Jeffery, jeffery@cs.utsa.edu Division of Computer Science, The University of Texas at San Antonio Research http://www.cs.utsa.edu/research/plss.html From icon-group-sender Wed Feb 25 17:08:01 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id RAA05417 for ; Wed, 25 Feb 1998 17:08:01 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA31061; Wed, 25 Feb 1998 17:08:00 -0700 From: gep2@computek.net Date: Wed, 25 Feb 1998 13:30:10 -0600 Message-Id: <199802251930.NAA16169@axp.cmpu.net> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Subject: Translation into C To: icon-group@optima.CS.Arizona.EDU X-Mailer: SPRY Mail Version: 04.00.06.17 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 836 > Mark Evans suggested that the reason one might want an Icon to C translator is that the resulting program will execute faster because it doesn't need to be interpreted. But I wonder how much difference that would really make. If the C program spends most of its time calling library routines, then I wouldn't expect much difference at all. Right. > Does anyone have statistics that might answer this question? I think that statistics for different implementations will vary all over the place... I'd comment though that generally the overhead of an interpreter is less (and the advantages are more) for higher-level languages than for lower-level ones, for exactly the reason you yourself suggested above. Gordon Peterson http://www.computek.net/public/gep2/ Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ From icon-group-sender Thu Feb 26 08:12:06 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id IAA09273 for ; Thu, 26 Feb 1998 08:12:05 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA32302; Thu, 26 Feb 1998 08:12:05 -0700 Date: Wed, 25 Feb 1998 19:23:02 -0600 Message-Id: <199802260123.TAA06524@segfault.cs.utsa.edu> From: Clinton Jeffery To: icon-group@optima.CS.Arizona.EDU In-Reply-To: <199802251930.NAA16169@axp.cmpu.net> (gep2@computek.net) Subject: Re: Translation into C Reply-To: jeffery@cs.utsa.edu Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1439 > [Regarding Icon->C speedup potential] > If the C program spends most of its time calling > library routines, then I wouldn't expect much difference at all. The Icon compiler at present speeds up execution by a factor of 2-4 compared with the interpreter. Potential speedups are much higher. This is despite the [correct] observation that many programs spend much of their time executing run-time library calls. The key observation is that a compiler can optimize the runtime library calls. Icon's optimizing compiler already does this pretty aggressively. > I think that [speedup] for different implementations will vary... > generally the overhead of an interpreter is less > (and the advantages are more) for higher-level languages These were some useful observations. Speedup will vary not just with implementations but with the programs being compiled. Some Icon code looks like Pascal code and pays heavily for interpretation, and other Icon code is Amazing and Wild, and will benefit less from compilation. Even Icon wizards use a fair amount of conventional procedural code along with all the cool stuff, and the amount will vary with the application domain and how well it can be mapped onto built-in language operations and runtime system semantics. Clint Jeffery, jeffery@cs.utsa.edu Division of Computer Science, The University of Texas at San Antonio Research http://www.cs.utsa.edu/research/plss.html From icon-group-sender Thu Feb 26 08:12:36 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id IAA09297 for ; Thu, 26 Feb 1998 08:12:36 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA30063; Thu, 26 Feb 1998 08:12:35 -0700 Posted-Date: Wed, 25 Feb 1998 22:29:18 -0600 (CST) Date: Wed, 25 Feb 1998 22:29:18 -0600 (CST) From: Chris Tenaglia To: icon-group@optima.CS.Arizona.EDU Subject: Relative performance Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 738 Back in the icon V8.6 days I was programming VAX/VMS and the performance seemed like : DCL script code : 1 unit of speed Icon interpreted : 10 units Icon->c->compiled : 100 units specially tuned fortran or cobol : 200-500 units compiled basic : 150 units Yes, the C source was huge. 2,000 lines of icon became 16,000-20,000 lines of c. That c was not human maintainable. These numbers are not precise and it's been a number of years, but that is the rough feel of it. Chris Tenaglia (system manager) | The future foretold, Medical College of Wisconsin | The past explained, 8701 W. Watertown Plank Rd. | The present largely appologized for. Milwaukee, WI 53226 (414)456-8765 | Organon to the Doctor From icon-group-sender Thu Feb 26 13:58:29 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id NAA08833 for ; Thu, 26 Feb 1998 13:58:28 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA32133; Thu, 26 Feb 1998 13:58:28 -0700 Date: Thu, 26 Feb 1998 16:06:02 GMT Message-Id: <199802261606.QAA12542@gairsay.aiai.ed.ac.uk> From: Jeff Dalton Subject: Re: Translation into C To: icon-group@optima.CS.Arizona.EDU In-Reply-To: gep2@computek.net's message of Wed, 25 Feb 1998 13:30:10 -0600 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 3320 Gordon Peterson wrote: > > Mark Evans suggested that the reason one might want an Icon to C > translator is that the resulting program will execute faster because it > doesn't need to be interpreted. But I wonder how much difference that > would really make. If the C program spends most of its time calling > library routines, then I wouldn't expect much difference at all. > > Right. > > > Does anyone have statistics that might answer this question? > > I think that statistics for different implementations will vary all over the > place... I'd comment though that generally the overhead of an interpreter is > less (and the advantages are more) for higher-level languages than for > lower-level ones, for exactly the reason you yourself suggested > above. The experience with Lisp has been that compilation to "native code" (even via compilation to C) makes a big difference. (Probably a factor of 10 to 30 over list-structure interpreters), though I haven't seen actual statistics for a long time.) I normally run any substantial Lisp program compiled if I can, and I have seen it make a factor of 30 difference. (N.B. 30 times faster, _not_ 30 percent.) Prolog, however, has often been implemented by compilation to byte codes (or similar) with a heavily optimized and cleverly written interpreter for the byte codes. My impression was that this worked fairly well, though again I don't have actual numbes to hand. A more or less straight interpreter for Porlog (cprolog) was suprisingly fast for an interpreter, but still sunstantially slower than the byte-code-compiled systems. (Asking in Comp.lang.lisp, Comp.lang.scheme, and Comp.lang.prolog might be a good idea.) When Lisp (and I include Scheme in Lisp) is compiled to byte codes, the result can be ok, but so far I haven't found it a completely satisfactory alternative to full compilation. An example of a commonly-used Lisp compiled to byte codes is the one in GNU emacs. It seems to work fairly well (obviously, opinions differ about almost everything when it comes to Emacs), but the sorts of things people do in Emacs probably have the Lisp spending a greater proportion of time in "library routines" than is typical for Lisp programs. My suspicion is that it may well be a win to compile Icon to native code via C, but how much of a win will depend on how much the compiler manages to compile in-line and on what the alternative implementations are. A simple compile-via-C compiler that didn't compile much in-line might not produce much faster results than a very good compiler to byte codes plus a very good interpreter for the byte codes. The design of the byte-code instruction set also matters. There was a revolution in Prolog implementation that came with the so-called Warren Abstract Machine (WAM), and earlier, more stack-machine-like, instruction sets could not compete. (By "byte codes", etc, I really mean instructions for some virtual machine. These are often byte-codes, but they can be longer or vary in other ways.) (For some reason the Java VM is a stack machine, despite the involvement of people who knew what had happened in the Prolog world. But perhaps they are not expecting to get Java speed via VM efficiency, relying instead, perhaps, on various sorts of more complete compilation.) -- jeff From icon-group-sender Thu Feb 26 13:58:22 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id NAA08485 for ; Thu, 26 Feb 1998 13:58:21 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA00098; Thu, 26 Feb 1998 13:58:21 -0700 Message-Id: <34F585F0.1AFC@gte.net> Date: Thu, 26 Feb 1998 09:10:40 -0600 From: Mark Evans Reply-To: evans@gte.net Organization: None X-Mailer: Mozilla 3.01 (Win95; I) Mime-Version: 1.0 To: icon-group@optima.CS.Arizona.EDU Cc: evans@gte.net Subject: Re: Translation into C References: <199802251930.NAA16169@axp.cmpu.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 3434 gep2@computek.net wrote: > > > Mark Evans suggested that the reason one might want an Icon to C > translator is that the resulting program will execute faster because it > doesn't need to be interpreted. But I wonder how much difference that > would really make. If the C program spends most of its time calling > library routines, then I wouldn't expect much difference at all. > > Right. > I don't follow the logic here. Even compiled C programs spend most of their time inside libraries (system, numerical, string, file). I certainly don't want to rewrite the StdCLib. > > Does anyone have statistics that might answer this question? > > I think that statistics for different implementations will vary all over the > place... I'd comment though that generally the overhead of an interpreter is > less (and the advantages are more) for higher-level languages than for > lower-level ones, for exactly the reason you yourself suggested above. > I have some anecdotal statistics of my own. I have used several interpreted languages related to numerical analysis; let's take four of them, Mathematica, MATLAB, O-Matrix, and LabVIEW. In principle, all of them are interpreted except LabVIEW, which claims to be "compiled." I've used Mathematica more than any of them and it is closest in nature to Icon. It is very high-level. The usual case is that I prototype an algorithm in MMA and then port it to C. The resulting speedup is usually larger than 10x, sometimes 20x to 50x. The example I am thinking of is 2D image convolution. I know how to code well in MMA so I know it's not my skill involved here. MMA has dynamic typing and other goodies similar to Icon. In fact the two are fairly close in many respects. It's very easy to create data structures in either language. MATLAB - One of my clients recently asked a local robotics research outfit (ARRI) to build a simulation of their hydraulic system. They used MATLAB and then switched to C for speed. They switched on their own initiative because MATLAB was too slow. The speedup was on the order of 40x (forty minutes down to one). This was for a time-domain simulation of a relatively simple hydraulic strut invovling pressure, temperature, and bulk modulus changes to figure out the spring and damping forces. Several nonlinear dynamical equations involved. O-Matrix - an unusual case (http://www.omatrix.com). This is essentially a MATLAB clone. What make it interesting is that the company claims a 5x speed improvement over MATLAB, not by eliminating interpretation, but BY WRITING THE LIBRARY ROUTINES EFFICIENTLY. I inquired specifically about this some while ago and the answer came back that it was basically their hand-tuned assembly-language libraries that gave them the edge over MATLAB's plain Jane C libraries. So yes, library implementation can make a huge difference. LabVIEW - Very interesting indeed. The vendor uses a kind of compilation in LabVIEW of a nature that they say is "as fast as C." It may be so for some simple Whetstone types of benchmarks, but in general I have done algorithms both ways, and LabVIEW's speed doesn't hold a candle to C. I would estimate the slowdown again at 10x-20x or thereabouts. I have used LabVIEW extensively and know how to code it well. All of the above indicate to me that no interpreted system in existence has yet come close to C even though they claim to have done so. Mark From icon-group-sender Thu Feb 26 13:59:08 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id NAA10622 for ; Thu, 26 Feb 1998 13:59:02 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA32030; Thu, 26 Feb 1998 13:59:02 -0700 Date: Thu, 26 Feb 1998 08:53:30 -0800 From: kwalker@sfo.harbinger.com (Ken Walker) Message-Id: <199802261653.IAA15042@varda.premenos.com> To: icon-group@optima.CS.Arizona.EDU Subject: Re: Translation into C Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Md5: jSjnozEHirkXj6lSjCHU1Q== Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1179 > Date: Wed, 25 Feb 98 12:00:29 -0500 > From: Paul Abrahams > > Mark Evans suggested that the reason one might want an Icon to C > translator is that the resulting program will execute faster because it > doesn't need to be interpreted. But I wonder how much difference that > would really make. If the C program spends most of its time calling > library routines, then I wouldn't expect much difference at all. Janalee O'Bagy reported that the Icon Version 6 interpreter typically spent about 20% of its time interpreting byte codes and the rest of the time in the run-time system performing operations. When the Icon compiler is run with optimizations disabled it eliminates more than that, usually 30%-45% of the execution time. That's because, even without doing optimizations, the compiler does more than just remove the interpreter loop. As Clint reported, programs compiled with optimization usually run about 2 to 4 times faster than when interpreted. On a few programs the optimizer does significantly better and occationally it produces only modest improvements. Ken Walker, kwalker@sfo.harbinger.com Harbinger Coporation, Concord, Ca. 94520 From icon-group-sender Thu Feb 26 16:44:23 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id QAA00097 for ; Thu, 26 Feb 1998 16:44:22 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA31667; Thu, 26 Feb 1998 16:44:21 -0700 Date: Thu, 26 Feb 1998 16:52:25 -0600 Message-Id: <199802262252.QAA07567@segfault.cs.utsa.edu> From: Clinton Jeffery To: jeff@aiai.ed.ac.uk Cc: icon-group@optima.CS.Arizona.EDU In-Reply-To: <199802261606.QAA12542@gairsay.aiai.ed.ac.uk> (message from Jeff Dalton on Thu, 26 Feb 1998 16:06:02 GMT) Subject: Re: Translation into C Reply-To: jeffery@cs.utsa.edu Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 974 > (For some reason the Java VM is a stack machine, despite the > involvement of people who knew what had happened in the Prolog > world. But perhaps they are not expecting to get Java speed > via VM efficiency, relying instead, perhaps, on various sorts > of more complete compilation.) Java was designed at a language level much lower than Prolog or Lisp or Icon. Java has built-in C types and operators, and classes, and that's it. No interesting control flow or expression semantics that call for a novel non-stack virtual machine. The ability to *almost* run the exact same byte codes on multiple machine architectures and OS platforms was probably a big enough leap that they felt a need to keep everything else about both the language and the VM as simple and conventional as possible. Just a guess. :-) Clint Jeffery, jeffery@cs.utsa.edu Division of Computer Science, The University of Texas at San Antonio Research http://www.cs.utsa.edu/research/plss.html From icon-group-sender Fri Feb 27 08:17:15 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id IAA11474 for ; Fri, 27 Feb 1998 08:17:14 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA00459; Fri, 27 Feb 1998 08:17:13 -0700 Date: Fri, 27 Feb 1998 10:24:27 +0300 (MEST) From: Ehud Lamm To: Mark Evans Cc: icon-group@optima.CS.Arizona.EDU Subject: Re: icon questions In-Reply-To: <34F34131.2689@gte.net> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 711 > > > There are several problems with translating Icon into C. Some of > > the major problems are: > > - variables must be able to hold any value, and values must include > > type information. In some cases, if you do enough analysis, you > > can remove these requirements, but in general you cannot. > > It seems to me that this requirement is not a hard one to handle. Why > bother eliminating it? > However, using run time type information is usually a sure way to cause performance problems... So agood translator/compiler should know how to eliminate it when possible. Good programmers should code in ways the reduce type conversions too. Ehud Lamm mslamm@pluto.mscc.huji.ac.il From icon-group-sender Fri Feb 27 08:17:05 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id IAA11456 for ; Fri, 27 Feb 1998 08:17:05 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA32434; Fri, 27 Feb 1998 08:17:04 -0700 From: gep2@computek.net Date: Fri, 27 Feb 1998 01:10:16 -0600 Message-Id: <199802270710.BAA08211@axp.cmpu.net> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Subject: Re: Translation into C To: icon-group@optima.CS.Arizona.EDU X-Mailer: SPRY Mail Version: 04.00.06.17 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 7532 >>> Mark Evans suggested that the reason one might want an Icon to C > translator is that the resulting program will execute faster because it > doesn't need to be interpreted. But I wonder how much difference that > would really make. If the C program spends most of its time calling > library routines, then I wouldn't expect much difference at all. >> Right. > I don't follow the logic here. Even compiled C programs spend most of their time inside libraries (system, numerical, string, file). Yes, but C programs tend to spend a lot of time in directly executed mainline code... address computation, integer arithmetic, pointer dereferencing, much character handling, most testing and branching, case statements, if/then, most tests and conditionals, etc. etc. It's relatively rare for C programs that don't EXPLICITLY call functions to use runtime library calls. Compare this against a much higher-level language like Icon or S*BOL, where virtually every statement probably involves NUMEROUS runtime library routine calls. > I have some anecdotal statistics of my own. I have used several interpreted languages related to numerical analysis; let's take four of them, Mathematica, MATLAB, O-Matrix, and LabVIEW. In principle, all of them are interpreted except LabVIEW, which claims to be "compiled." > I've used Mathematica more than any of them and it is closest in nature to Icon. It is very high-level. The usual case is that I prototype an algorithm in MMA and then port it to C. The resulting speedup is usually larger than 10x, sometimes 20x to 50x. The example I am thinking of is 2D image convolution. I know how to code well in MMA so I know it's not my skill involved here. MMA has dynamic typing and other goodies similar to Icon. In fact the two are fairly close in many respects. It's very easy to create data structures in either language. I think you're comparing apples and oranges. I suspect that if you tried to do everything that MMA does (including dynamic typing etc) in your C port, it would perform a lot closer to the Mathematica one. You're comparing a highly general, higher-level tool against a much more tailored, more machine-specific C implementation... I'd *expect* the C one to be a lot faster. I don't think it's as much due to the "compiled/interpreted" issue as you seem to think it is. > MATLAB - One of my clients recently asked a local robotics research outfit (ARRI) to build a simulation of their hydraulic system. They used MATLAB and then switched to C for speed. They switched on their own initiative because MATLAB was too slow. The speedup was on the order of 40x (forty minutes down to one). This was for a time-domain simulation of a relatively simple hydraulic strut invovling pressure, temperature, and bulk modulus changes to figure out the spring and damping forces. Several nonlinear dynamical equations involved. Same point as above. > O-Matrix - an unusual case (http://www.omatrix.com). This is essentially a MATLAB clone. What make it interesting is that the company claims a 5x speed improvement over MATLAB, not by eliminating interpretation, but BY WRITING THE LIBRARY ROUTINES EFFICIENTLY. I inquired specifically about this some while ago and the answer came back that it was basically their hand-tuned assembly-language libraries that gave them the edge over MATLAB's plain Jane C libraries. So yes, library implementation can make a huge difference. Obviously. Did YOUR tests confirm the 5x improvement? > LabVIEW - Very interesting indeed. The vendor uses a kind of compilation in LabVIEW of a nature that they say is "as fast as C." It may be so for some simple Whetstone types of benchmarks, but in general I have done algorithms both ways, and LabVIEW's speed doesn't hold a candle to C. I would estimate the slowdown again at 10x-20x or thereabouts. I have used LabVIEW extensively and know how to code it well. Same point as (way) above. When I first started programming, my first language was PL/1, and I got to be pretty good at it. Among other things, I studied the generated pseudo-assembler code listings, and it really wasn't that bad (and in fact, under the Optimizing Compiler, it got to be really quite good). The problem was in the runtime libraries, which obviously had been programmed by programmers who were a *great* deal less skilled (and/or motivated) to do a good job than the people were who implemented the compiler itself. As long as you could keep the compiled code out of the libraries, it _flew_. Code which included a lot of library routine calls was virtually guaranteed to be slow. I'm not suggesting that Icon's libraries and runtime are badly written... but merely that a language like Icon which spends the great majority of its time in runtime library ANYHOW simply probably won't gain nearly so much performance improvement as a result of having the mainline compiled instead of interpreted... and in fact, I think I remember reading in the Icon Newsletter (years ago now) that one of the reasons they dropped support for the Compiler (once upon a time) was because it was a maintenance hassle, and benchmarks showed that the performance improvement for typical Icon programs was pretty small in any case. > All of the above indicate to me that no interpreted system in existence has yet come close to C even though they claim to have done so. That shouldn't really surprise anybody, since C is a hugely low-level language (almost assembler language) with structures which largely map one-to-one with machine instructions. C is also typically used for fairly compute-intensive stuff that is programmed at a very low level, where the mainline execution speed is very important. C also has little or no protection against things that most higher level languages often try to protect you (and themselves, for that matter) against... memory mismanagement, out-of-bounds array and string accesses, etc etc ad infinitum. Higher level languages also often try to do a lot more error control and reporting than C tends to do. All of that extra stuff *does* take overhead, and usually the programmers of the higher level languages simply accept this as part of the cost of their more powerful system. Of course, there is some rationale for this argument, when even quite substantial computers (166MHz Pentium class performance, complete with multimedia, modem, and everying) sell *retail* for less than $500. And for those people who TRULY have to struggle to optimize their programming to the N-th degree, there are ultra-fast specialized processors (like the marvelous TI DSP, a quite neat little CPU selling for less than $100 in production quantities and which executes up to 1.6 - 2.0 billion instructions per second). A coprocessor board based on this little gem (or maybe several of them), plugging in to a PC, could outperform even fairly recent supercomputers on really heavily compute-intensive tasks. I think the reason why we've not seen more such things on the market is because it's relatively rare that very many people TRULY NEED this level of performance. Anyhow, processing power and disk space HAVE gotten cheap enough that it can be wasted by the fistful, (regardless of how that dismays many of us); programmer time is very often a far more critical issue than runtime performance. Gordon Peterson http://www.computek.net/public/gep2/ Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ From icon-group-sender Fri Feb 27 13:29:07 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id NAA06526 for ; Fri, 27 Feb 1998 13:29:07 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA01408; Fri, 27 Feb 1998 13:29:06 -0700 From: gep2@computek.net Date: Fri, 27 Feb 1998 12:48:25 -0600 Message-Id: <199802271848.MAA12819@axp.cmpu.net> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Subject: Re: icon questions To: icon-group@optima.CS.Arizona.EDU X-Mailer: SPRY Mail Version: 04.00.06.17 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1074 >... using run time type information is usually a sure way to cause performance problems... So agood translator/compiler should know how to eliminate it when possible. Good programmers should code in ways the reduce type conversions too. I don't dispute that compilers ought to produce the best code they can reasonably produce. While for certain types of compute-intensive applications large amounts of data conversions might be an issue, much of the time nowadays (and for large classes of applications areas) these minor conversions are simply unimportant from an overall perspective. In the time it might take a programmer to conceive and implement a solution minimizing or eliminating one conversion, the CPU to be used could probably perform millions of such conversions. And the CPU costs a *great* deal less per hour than most (especially, good) programmers do!! :-) In many ways, it's truly a different world than it used to be. Gordon Peterson http://www.computek.net/public/gep2/ Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ From icon-group-sender Fri Feb 27 17:03:48 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id RAA01284 for ; Fri, 27 Feb 1998 17:03:47 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA01261; Fri, 27 Feb 1998 17:03:46 -0700 Date: Fri, 27 Feb 1998 23:39:29 +0300 (MEST) From: Ehud Lamm To: gep2@computek.net Cc: icon-group@optima.CS.Arizona.EDU Subject: Re: icon questions In-Reply-To: <199802271848.MAA12819@axp.cmpu.net> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1647 On Fri, 27 Feb 1998 gep2@computek.net wrote: > While for certain types of compute-intensive applications large amounts of data > conversions might be an issue, much of the time nowadays (and for large classes > of applications areas) these minor conversions are simply unimportant from an > overall perspective. > > In the time it might take a programmer to conceive and implement a solution > minimizing or eliminating one conversion, the CPU to be used could probably > perform millions of such conversions. And the CPU costs a *great* deal less per > hour than most (especially, good) programmers do!! :-) > As one who manages programmers, I heartly agree that programmer time is what really costs you. Not only are programmers expensive, it so happens that if they are wasted doing something useless, they are not programming the next project you have for them. However, this is no reason to produce sloppy code... In the majority of the cases I see of sloppy/slow/unelegant code, the reason isn't that the solution was really cheaper in man-hours. It means simply that the man is not a great programmer. In some cases (for example onetime scripts, higly clever algorithms etc.) dealling with all the low level stuff (such as type conversions) is a waste of time. But even in such cases, the compiler should be able to optimize most of the trivial performence problems. Unnneded (obvious) conversions are an example. The sad thing about optimization, is that it is never a replacement for a good programmer, and a good algotrithm. These are still what really count. Ehud Lamm mslamm@pluto.mscc.huji.ac.il From icon-group-sender Mon Mar 2 08:27:39 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id IAA27662 for ; Mon, 2 Mar 1998 08:27:39 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA00611; Mon, 2 Mar 1998 08:27:38 -0700 Message-Id: <34F9AA01.454D@gte.net> Date: Sun, 01 Mar 1998 12:33:37 -0600 From: Mark Evans Reply-To: evans@gte.net Organization: None X-Mailer: Mozilla 3.01 (Win95; I) Mime-Version: 1.0 To: icon-group@optima.CS.Arizona.EDU Subject: Third-party editors References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 538 Is anyone knowledgeable regarding what it would take to implement Icon under a third-party editing system like Microsoft Word or CodeWrite. I understand that Word has some fancy external link capabilites. The people who develop Mathematica have a runtime link to Microsoft Word that lets Word act as the interface to Mathematica. They also have something like that for Excel. The Icon editor is OK but with probably just a little effort, we could exploit the full power of real word processors. Comments? Mark Evans evans@gte.net From icon-group-sender Mon Mar 2 08:27:22 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id IAA27655 for ; Mon, 2 Mar 1998 08:27:22 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA01814; Mon, 2 Mar 1998 08:27:21 -0700 Message-Id: <34F76A7A.367B@gte.net> Date: Fri, 27 Feb 1998 19:38:02 -0600 From: Mark Evans Reply-To: evans@gte.net Organization: None X-Mailer: Mozilla 3.01 (Win95; I) Mime-Version: 1.0 To: icon-group@optima.CS.Arizona.EDU Subject: Re: Translation into C References: <199802270710.BAA08211@axp.cmpu.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 2211 I'm afraid that Gordon Peterson and I will have to agree to disagree where we seem to part ways. Interpreters are slow by nature compared to compiled code. My four examples prove it as far as I am concerned. The time domain hydraulics simulation was a one-for-one port, matrix multiplies and all...MATLAB is supposed to excel at matrix ops. In fact, I don't think MATLAB has dynamic typing at all. My Mathematica image processing ports were one-for-one involving procedural for-loops. Ditto the LabVIEW work -- and LabVIEW has static typing. No dynamic type changes in the middle of these loops and matrix ops. What G.P. says about high-level language overhead and systems language efficiency is exactly the reason for building a C converter. He expects C to be faster, and I do too. I guess where we part company is that he fancies an exception to the rule in the case of "C doing all the same things." I've done the same things in C and C always wins -- by huge margins of the kind I mentioned (10x - 50x). Whenever you are doing things with hardware-mapped instructions, you are faster, even if they are the same things. The reason that we are seeing faster and faster processors is not to make glad those who write interpreters. It's to make glad customers who are tired of looking at watches and hourglasses and status bars. If the day ever comes when people don't feel they need more power, then believe me, they will stop paying for it. Have you ever looked at the markup difference between Intel's previous-generation and current-generation chips? It's tremendous; they know the value of their fastest products. The other argument in favor of a C converter is to enable workers to use Icon stuff in their projects. If I could get C code out of Icon, then I could plop Icon modules into my C projects. I think G.P.'s comment about the expense of programmer hours also argues in favor of getting a C port system working. It would enable commercial programmers to get the same functional result in one-tenth the time. In principle, the C code would be guaranteed accurate by virtue of its automatic generation. One-tenth the time for more solid code is a bargain in my book. Mark From icon-group-sender Mon Mar 2 12:49:21 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id MAA19841 for ; Mon, 2 Mar 1998 12:49:20 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA03042; Mon, 2 Mar 1998 12:49:20 -0700 Date: Mon, 2 Mar 1998 09:35:34 -0800 From: kwalker@sfo.harbinger.com (Ken Walker) Message-Id: <199803021735.JAA19946@varda.premenos.com> To: icon-group@optima.CS.Arizona.EDU Subject: Re: Translation into C Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Md5: BTPFMQXQOZEgPScV7e5NjQ== Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 2167 I'd like to start by stepping back and looking at what it means for a program to be interpreted. In some sense, all code is interpreted; iterpretation can be done at several levels: 1) keep program as text and interpret with a software interpreter 2) parse program and interpret the syntax tree, symbol table, etc. with a software interpreter 3) convert program to byte code for an abstract machine and interpret with a software interpreter 4) convert program to machine code and interpret with a hardware interpeter (CPU) The Icon interpreter uses method 3 and the Icon compiler uses method 4. Clearly software interpeters have some overhead, but with Icon and some other "interpreted" languages, the software interpreter loop is only a part of the overhead. Much of the cost comes from the generality built into the run time support system for the language. The Icon compiler is able to do some tailoring of the run time system using information from type inferencing [it can typically determine a unique type for 80% of the operands to build-in operations and eliminate corresponding type checks]. If you study the code produced by the compiler, it is not hard to find places were more optimizations can be done. For example, the compiler makes no attempt to tailor data structures to the needs of the program. Lists are always doublely ended queques regardless of how you use them. Simply translating Icon programs into C, helps some, but you need a lot of sophisticated analysis and clever optimization if you want to produce a C program that comes anywhere near a hand-coded one. Even then, the C programmer may have information about the problem domain that cannot be deduced from the Icon code by any analysis. The C programs produced by the current Icon compiler run considerably faster than interpreted program but appear to have a ways to go to match hand-coded C. If someone has time, it would be interesting to compare compiled Icon programs to hand-coded C [unfortunately, I've never found the time...]. Ken Walker, kwalker@sfo.harbinger.com Harbinger Coporation, Concord, Ca. 94520 From icon-group-sender Mon Mar 2 12:49:44 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id MAA19852 for ; Mon, 2 Mar 1998 12:49:43 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA02427; Mon, 2 Mar 1998 12:49:42 -0700 Date: Mon, 2 Mar 1998 19:53:39 +0300 (MEST) From: Ehud Lamm To: Mark Evans Cc: icon-group@optima.CS.Arizona.EDU Subject: Re: Translation into C In-Reply-To: <34F76A7A.367B@gte.net> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 624 On Fri, 27 Feb 1998, Mark Evans wrote: > > I think G.P.'s comment about the expense of programmer hours also argues > in favor of getting a C port system working. It would enable commercial > programmers to get the same functional result in one-tenth the time. In > principle, the C code would be guaranteed accurate by virtue of its > automatic generation. One-tenth the time for more solid code is a > bargain in my book. > This will be true only if the generated C code will be human readable and mainainable. This is not usually the case with automatics generation. Ehud Lamm mslamm@pluto.mscc.huji.ac.il From icon-group-sender Mon Mar 2 12:50:03 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id MAA19897 for ; Mon, 2 Mar 1998 12:50:03 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA03107; Mon, 2 Mar 1998 12:50:02 -0700 Message-Id: <34FAF3D9.54D0@gte.net> Date: Mon, 02 Mar 1998 12:00:57 -0600 From: Mark Evans Reply-To: evans@gte.net Organization: None X-Mailer: Mozilla 3.01 (Win95; I) Mime-Version: 1.0 To: icon-group@optima.CS.Arizona.EDU Subject: Re: Translation into C References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1058 Ehud Lamm wrote: > > On Fri, 27 Feb 1998, Mark Evans wrote: > > > > > I think G.P.'s comment about the expense of programmer hours also argues > > in favor of getting a C port system working. It would enable commercial > > programmers to get the same functional result in one-tenth the time. In > > principle, the C code would be guaranteed accurate by virtue of its > > automatic generation. One-tenth the time for more solid code is a > > bargain in my book. > > > > This will be true only if the generated C code will be human readable and > mainainable. This is not usually the case with automatics generation. > > Ehud Lamm mslamm@pluto.mscc.huji.ac.il If you need to revise the code, you revise its Icon source and let the C generator make the code anew. So human readability is not required in the C, but only in the Icon. As soon as you start talking about "maintaining" the C code, then you may as well be talking about writing your functions in C to start with. My idea is to write Icon code so I don't have to deal with C. Mark From icon-group-sender Mon Mar 2 12:50:56 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id MAA19942 for ; Mon, 2 Mar 1998 12:50:50 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA00991; Mon, 2 Mar 1998 12:50:49 -0700 Date: Mon, 2 Mar 1998 13:06:12 -0600 Message-Id: <199803021906.NAA11451@segfault.cs.utsa.edu> From: Clinton Jeffery To: evans@gte.net Cc: icon-group@optima.CS.Arizona.EDU In-Reply-To: <34F9AA01.454D@gte.net> (message from Mark Evans on Sun, 01 Mar 1998 12:33:37 -0600) Subject: Re: Third-party editors Reply-To: jeffery@cs.utsa.edu Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1195 [Mark Evans writes:] > Is anyone knowledgeable regarding what it would take to implement Icon > under a third-party editing system like Microsoft Word or CodeWrite. > The Icon editor is OK but with probably just a little effort, we could > exploit the full power of real word processors. If you are willing to learn enough "Word BASIC", you can rewrite the entirety of the Wi program in it, replacing Wi with Word. You just implement the logic of a project "make" program, and invoke the underlying Icon translator, wicont, which writes its output to a log file for you. Read that in, jump to the first error, and presto! You've replaced Wi. Its only 600 or so lines of Icon, I wonder how many lines of Word BASIC it will come to? Have fun. For my part, if I want "full power" I am more likely to reimplement Wi in Emacs Lisp than Word BASIC. Right now for Windows Icon programming I use a mixture of Wi and Emacs. I will probably continue to enhance Wi, and port it to UNIX, instead of rewriting it in another language. Clint Jeffery, jeffery@cs.utsa.edu Division of Computer Science, The University of Texas at San Antonio Research http://www.cs.utsa.edu/research/plss.html From icon-group-sender Mon Mar 2 16:43:54 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id QAA01604 for ; Mon, 2 Mar 1998 16:43:54 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA03745; Mon, 2 Mar 1998 16:43:52 -0700 From: gep2@computek.net Date: Sat, 28 Feb 1998 02:42:55 -0600 Message-Id: <199802280842.CAA09087@axp.cmpu.net> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Subject: Re: icon questions To: icon-group@optima.CS.Arizona.EDU X-Mailer: SPRY Mail Version: 04.00.06.17 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1968 > As one who manages programmers, I heartly agree that programmer time is what really costs you. Absolutely. It came as rather a shock to one client (and this was already about 4 years ago) when I pointed out that ONE EXTRA DAY of programmer time (debugging a more complicated TSR they thought they wanted) would cost them almost as much as a second computer, which kept the system and programming simpler. > Not only are programmers expensive, it so happens that if they are wasted doing something useless, they are not programming the next project you have for them. Absolutely. The biggest problem with most of the programs you need is that you don't have them!!!! And don't have time to write enough of them, using traditional programming techniques. > However, this is no reason to produce sloppy code... In the majority of the cases I see of sloppy/slow/unelegant code, the reason isn't that the solution was really cheaper in man-hours. It means simply that the man is not a great programmer. Agreed that "good" programmers are usually a good investment. But the fact remains that it takes more time to write tight, efficient code, and many companies really don't want to pay what that time costs. Whether by a good programmer, or even a bad one. > In some cases (for example onetime scripts, higly clever algorithms etc.) dealling with all the low level stuff (such as type conversions) is a waste of time. Right. > But even in such cases, the compiler should be able to optimize most of the trivial performence problems. Unnneded (obvious) conversions are an example. > The sad thing about optimization, is that it is never a replacement for a good programmer, and a good algotrithm. I highly optimized BAD algorithm will usually be nowhere near as fast as a REALLY SLOPPY-IMPLEMENTED good algorithm. Gordon Peterson http://www.computek.net/public/gep2/ Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ From icon-group-sender Mon Mar 2 16:43:23 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id QAA01581 for ; Mon, 2 Mar 1998 16:43:22 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA02844; Mon, 2 Mar 1998 16:43:22 -0700 Date: Mon, 2 Mar 1998 22:15:41 +0300 (MEST) From: Ehud Lamm To: Mark Evans Cc: icon-group@optima.CS.Arizona.EDU Subject: Re: Translation into C In-Reply-To: <34FAF3D9.54D0@gte.net> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1492 On Mon, 2 Mar 1998, Mark Evans wrote: > Ehud Lamm wrote: > > > > On Fri, 27 Feb 1998, Mark Evans wrote: > > > > > > > > I think G.P.'s comment about the expense of programmer hours also argues > > > in favor of getting a C port system working. It would enable commercial > > > programmers to get the same functional result in one-tenth the time. In > > > principle, the C code would be guaranteed accurate by virtue of its > > > automatic generation. One-tenth the time for more solid code is a > > > bargain in my book. > > > > > > > This will be true only if the generated C code will be human readable and > > mainainable. This is not usually the case with automatics generation. > > > > If you need to revise the code, you revise its Icon source and let the C > generator make the code anew. So human readability is not required in > the C, but only in the Icon. > > As soon as you start talking about "maintaining" the C code, then you > may as well be talking about writing your functions in C to start with. > My idea is to write Icon code so I don't have to deal with C. > This is true. I just thought you talked about to cases: 1. Using the tranlation inorder to mixed Icon work in a C project 2. Code in Icon as a shortcut to coding in C (which implies the basic idea is to procdue normal C code). I was reffering to the second option. Of course if you are happy with one language, there is no need to use another... Ehud Lamm mslamm@pluto.mscc.huji.ac.il From icon-group-sender Mon Mar 2 16:43:13 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id QAA01578 for ; Mon, 2 Mar 1998 16:43:12 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA03768; Mon, 2 Mar 1998 16:43:11 -0700 Date: Mon, 2 Mar 1998 22:11:43 +0300 (MEST) From: Ehud Lamm To: icon-group@optima.CS.Arizona.EDU Subject: Optimzing Icon Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 2352 The recent thread about compiling Icon into C raised the question of optimizing the resulting C code. The are two aspect worth thinking about here: 1. What Icon programs and constructs are more efficient (from a computer's standpoint. NOT programmer time). 2. How should you implement, in the best possible way, an Icon construct in C (or machine language for that matter). Question 1, refers to things like type usage (less conversions are good, regardless of interpretation or compilation of the program), use of good data structures (and using them consistently as lists/queue etc.), good use of string scanning and things of this sort. These aspects are crucial if you paln to produce an optimizing compiler, because knowing which constructs are better allows you to optimize their use to good machine level code. It also allows you to perform some check/transformations at the front end of the compiler. Question 2, is less Icon dependent, and more C-oriented or specific to the machine targeted. It is based on the fact that in order to produce good code, you have to know what kinds of operations are fast, and by how much. Good (==fast) low level code relies on understanding the cost of operations. When you write a translator to C you have to be good at C... For exampleit is common to note that the strlen function in C is not fast, since it has to scan the entire string in order to find its length. This is becasuse the way C handles strings (as null terminated vectors of characters). It is a well known tip that if you process a C string in a loop you should strlen at each iteration, but rather keep a local variable with the length (obtained by strlen outside the loop), and upadate when you update the string. This common technique for example, is something to keep in mind when you translate a string dominated program to C. Of course you have other options (like coding you own string hanlding libray. An option with obvious drawbacks), which may not be directly relevent to the Icnon->C compiler. But this is just an example. There are dozens of such optimizations possible. An optimzing compiler can not find you a better algorithm, to solve your problem - but it will usually produce better low level code. This is a well known truth... Ehud Lamm mslamm@pluto.mscc.huji.ac.il From icon-group-sender Mon Mar 2 16:43:02 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id QAA01575 for ; Mon, 2 Mar 1998 16:43:02 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA03702; Mon, 2 Mar 1998 16:43:01 -0700 Message-Id: <34FB1127.2E88@gte.net> Date: Mon, 02 Mar 1998 14:05:59 -0600 From: Mark Evans Reply-To: evans@gte.net Organization: None X-Mailer: Mozilla 3.01 (Win95; I) Mime-Version: 1.0 To: icon-group@optima.CS.Arizona.EDU Subject: Re: Translation into C References: <199803021735.JAA19946@varda.premenos.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 841 Ken Walker wrote: > > The C programs produced by the current Icon compiler run considerably > faster than interpreted program but appear to have a ways to go to match > hand-coded C. If someone has time, it would be interesting to compare > compiled Icon programs to hand-coded C [unfortunately, I've never > found the time...]. > > Ken Walker, kwalker@sfo.harbinger.com > Harbinger Coporation, Concord, Ca. 94520 Nothing but hand-coded assembly can match hand-coded C! I'm not asking for the moon! The point is expressed in your comments by the phrase "considerably faster." That's enough argument for an Icon->C converter. I like your four-tier overview of interpretation, but there should be an enormous quantum gap between (3) and (4) by virtue of moving to dedicated transistors. Thanks to everyone for a lively debate. Mark From icon-group-sender Tue Mar 3 10:30:59 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id KAA03968 for ; Tue, 3 Mar 1998 10:30:59 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA04207; Tue, 3 Mar 1998 10:30:58 -0700 From: gep2@computek.net Date: Mon, 2 Mar 1998 23:39:08 -0600 Message-Id: <199803030539.XAA24309@axp.cmpu.net> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Subject: Icon to C conversion To: icon-group@optima.CS.Arizona.EDU X-Mailer: SPRY Mail Version: 04.00.06.17 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1381 >...When you write a translator to C you have to be good at C... For exampleit is common to note that the strlen function in C is not fast, since it has to scan the entire string in order to find its length. This is becasuse the way C handles strings (as null terminated vectors of characters). You can't really use C-style null-terminated strings as Icon strings, since Icon strings can ABSOLUTELY contain one or more embedded binary zero bytes. This makes the C strlen() function essentially useless. You have to implement strings in some other way, perhaps maintaining a separate count somewhere. And this also means that you cannot just bump pointers along a string and have a valid string be the remaining characters to the zero byte, like in C... since you must be able to associate both the string and its length with the variable (and pointer). And that's really a large part of the point of this whole issue. If you simply recode a program in C that was originally in Icon, of course it can be faster... if for no other reason than that IT'S A DIFFERENT PROGRAM and the various protections and other constraints are different. (C programs don't allow automatic and transparent memory reorganization and garbage collection, either). Gordon Peterson http://www.computek.net/public/gep2/ Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ From icon-group-sender Tue Mar 3 10:30:39 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id KAA03947 for ; Tue, 3 Mar 1998 10:30:38 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA03936; Tue, 3 Mar 1998 10:30:37 -0700 Date: Mon, 2 Mar 1998 19:20:13 -0600 (CST) From: Ramon Pereda X-Sender: rpereda@pandora To: Mark Evans Cc: icon-group@optima.CS.Arizona.EDU Subject: Re: Translation into C In-Reply-To: <34FB1127.2E88@gte.net> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 208 Does anyone know of a language implementation where the resulting code is machine-generated C code that is maintainable by humans? If so, is the compiler free and is the language general-purpose? -ray From icon-group-sender Tue Mar 3 16:41:37 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id QAA26492 for ; Tue, 3 Mar 1998 16:41:36 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA03923; Tue, 3 Mar 1998 16:41:36 -0700 From: gep2@computek.net Date: Tue, 3 Mar 1998 13:55:36 -0600 Message-Id: <199803031955.NAA18155@axp.cmpu.net> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Subject: Re: Translation into C To: icon-group@optima.CS.Arizona.EDU X-Mailer: SPRY Mail Version: 04.00.06.17 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1522 > Does anyone know of a language implementation where the resulting code is machine-generated C code that is maintainable by humans? If so, is the compiler free and is the language general-purpose? If you intend to maintain the program in C (thus making it essentially a one-shot creation process) then why don't you just write it in C to begin with?? C is certainly general-purpose (though primitive) and there ARE compilers for it that are cheap enough that for all practical purposes one can consider them "free". The answer to the question, of course, is that C is simply far too low-level a language to do a lot of real-world applications in. The reason WHY people write programs in Icon, SNOBOL, FoxPro, and other such languages is precisely BECAUSE it's so much easier and more practical to do so. It's rare (for most business applications) to write something once and then have it not need changes later. And if you can't (or don't want to) write it in C to begin with, you probably can't (or won't want to) maintain and enhance it in C later, either. So why not just write your programs using the most appropriate tools to begin with? *NONE* of my consulting clients have ever insisted that I write the programs I do for them in a tool that is not the best-suited one for the job at hand. And it's no mystery why not: doing so will cost them more money and take longer. Gordon Peterson http://www.computek.net/public/gep2/ Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ From icon-group-sender Tue Mar 3 16:41:50 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id QAA26505 for ; Tue, 3 Mar 1998 16:41:50 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA02987; Tue, 3 Mar 1998 16:41:49 -0700 Date: Tue, 3 Mar 1998 20:22:50 GMT Message-Id: <199803032022.UAA21994@gairsay.aiai.ed.ac.uk> From: Jeff Dalton Subject: Re: Translation into C To: Ramon Pereda , Mark Evans In-Reply-To: Ramon Pereda's message of Mon, 2 Mar 1998 19:20:13 -0600 (CST) Cc: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 498 > Does anyone know of a language implementation where the resulting code is > machine-generated C code that is maintainable by humans? There was at least one Common Lisp that claimed to do this. (Chestnut, I believe.) > If so, is the compiler free and is the language general-purpose? No, and almost-yes. There are some free Lisp compilers that produce code that might be maintained by a human (e.g. GCL/AKCL/KCL, and my Franz Lisp compiler), but maintaining it would not be ideal. -- jeff From icon-group-sender Wed Mar 4 09:09:39 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id JAA06542 for ; Wed, 4 Mar 1998 09:09:38 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA04632; Wed, 4 Mar 1998 09:09:37 -0700 From: Otfried Geffert Date: Wed, 04 Mar 1998 11:21:48 GMT Message-Id: <19980304.11214845@og-1042.stardiv.de> Subject: Re: Translation into C To: gep2@computek.net Cc: icon-group@optima.CS.Arizona.EDU, og@jaguar.stardiv.de In-Reply-To: <199803031955.NAA18155@axp.cmpu.net> References: <199803031955.NAA18155@axp.cmpu.net> X-Mailer: Mozilla/3.0 (compatible; StarOffice/4.0; WinNT/Win95) X-Priority: 3 (Normal) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1117 gep2@computek.net wrote (omitted a lot of text) =20 > The answer to the question, of course, is that C is simply far too=20= low-level a=20 > language to do a lot of real-world applications in. =20 (omitted a lot of text) I agree that 'bare' C is too primitive for a lot of applications, but=20= if you have the data structures ( string, list, table , ... ) from Icon in a=20= C library you have really fast code _and_ high level data structures. I use such a library from Dave Hanson for writing a compiler, a linker=20= and a preprocessor for a language called tscript, embedded in one of our products.=20 It can be found at ftp.cs.princeton.edu/pub/packages/cii I use Icon (under the hood) for other -up to now - smaller tasks. I am=20= not religious about programming languages. I use the one best suited for the task at=20= hand ( C, awk, Icon, Lex, Yacc, some C++ [if I am urged to ;-)], some SQL) Ciao, Otfried _____________________________________________________ Otfried Geffert, og@stardiv.de Star Division Gmbh, Sachsenfeld 4,=20 20097 Hamburg - Germany - phone: (+49) (0)40 23646-864 From icon-group-sender Wed Mar 4 09:10:53 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id JAA06700 for ; Wed, 4 Mar 1998 09:10:52 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA06015; Wed, 4 Mar 1998 09:10:52 -0700 Message-Id: X-Mailer: Novell GroupWise 4.1 Date: Wed, 04 Mar 1998 09:51:49 -0600 From: Charles Hethcoat To: icon-group@optima.CS.Arizona.EDU Subject: Icon translation Mime-Version: 1.0 Content-Type: text/plain Content-Disposition: inline Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 786 > Does anyone know of a language implementation where the resulting code is machine-generated C code that is maintainable by humans? If so, is the compiler free and is the language general-purpose? Ratfor -> Fortran 66. Ratfor was semantic sugar for Fortran. It was free, but Fortran compilers generally weren't. They always were locally installed, though. I'm not intending to be purely facetious here. The point is that even this simple setup generated pretty ugly Fortran that nobody would want to maintain directly--and the semantic distance between R4 and Fortran was nil. Charles L Hethcoat III Senior Engineer, Analysis Department Oceaneering Space Systems, Inc. 16665 Space Center Blvd., Houston, Texas 77058 USA Voice: 281-488-9080 Ext. 3470; Fax: 281-488-2027 From icon-group-sender Wed Mar 4 09:11:01 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id JAA06715 for ; Wed, 4 Mar 1998 09:10:58 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA05299; Wed, 4 Mar 1998 09:10:57 -0700 Message-Id: X-Mailer: Novell GroupWise 4.1 Date: Wed, 04 Mar 1998 10:06:02 -0600 From: Charles Hethcoat To: icon-group@optima.CS.Arizona.EDU Subject: Icon translation Mime-Version: 1.0 Content-Type: text/plain Content-Disposition: inline Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 796 G. Peterson wrote: >If you intend to maintain the program in C (thus making it essentially a one-shot creation process) then why don't you just write it in C to begin with?? Correct. Remember the butter commercials? "It's not nice to fool Mother Nature." That's how a lot of this recent thread strikes me. If you need the machine speed of C, and nothing else matters, then program in C. If you want the programmer speed of Icon (which is considerable), use Icon. I use Icon mostly because it saves my brain from a lot of pain. But my programs are small and used mostly by me, and are designed from the start to save my time. The only real way to speed up Icon is to build a custom computer architecture specifically to execute the Icon-generated abstract code. Charles Hethcoat From icon-group-sender Wed Mar 4 09:18:49 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id JAA07949 for ; Wed, 4 Mar 1998 09:18:48 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA05454; Wed, 4 Mar 1998 09:18:47 -0700 From: Otfried Geffert Date: Wed, 04 Mar 1998 11:38:46 GMT Message-Id: <19980304.11384603@og-1042.stardiv.de> Subject: Re: Translation into C To: gep2@computek.net Cc: icon-group@optima.CS.Arizona.EDU, og@jaguar.stardiv.de In-Reply-To: <199803031955.NAA18155@axp.cmpu.net> References: <199803031955.NAA18155@axp.cmpu.net> X-Mailer: Mozilla/3.0 (compatible; StarOffice/4.0; WinNT/Win95) X-Priority: 3 (Normal) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1239 sorry for the broken lines and a defect link:=20 a working link is http://www.cs.princeton.edu/software/cii=20 gep2@computek.net wrote (omitted a lot of text) =20 > The answer to the question, of course, is that C is simply far too=20= low-level a=20 > language to do a lot of real-world applications in. =20 (omitted a lot of text) I agree that 'bare' C is too primitive for a lot of applications, but=20= if you have the data structures ( string, list, table , ... ) from Icon in a=20= C library you have really fast code _and_ high level data structures. I use such a library from Dave Hanson for writing a compiler, a linker=20= and a preprocessorfor a language called tscript, embedded in one of=20 our products.=20 It can be found at http://www.cs.princeton.edu/software/cii=20 I use Icon (under the hood) for other -up to now - smaller tasks. I am=20= not religious about programming languages. I use the one best suited for the task at=20= hand ( C, awk, Icon, Lex, Yacc, some C++ [if I am urged to ;-)], some SQL) Ciao, Otfried _____________________________________________________ Otfried Geffert, og@stardiv.de Star Division Gmbh, Sachsenfeld 4,=20 20097 Hamburg - Germany - phone: (+49) (0)40 23646-864 From icon-group-sender Wed Mar 4 12:22:06 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id MAA23043 for ; Wed, 4 Mar 1998 12:22:05 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA06262; Wed, 4 Mar 1998 12:22:05 -0700 Date: Wed, 4 Mar 1998 09:41:45 -0700 From: swampler@noao.edu (Steve Wampler) Subject: Re: Icon translation To: icon-group@optima.CS.Arizona.EDU Message-Id: In-Reply-To: Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 2245 Charles Hethcoat wrote: > > The only real way to speed up Icon is to build a custom computer > architecture specifically to execute the Icon-generated abstract code. Actually, I suspect there are ways to get rather substantial performance gains from Icon with an 'optimizing' compiler. However, the type of optimization I'm thinking of is very difficult. If I were independently wealthy, I'd pursue it, but I'm not. Plus, Icon is already 'fast enough' for most of my needs. If you carefully profile Icon programs, you may notice that there's a 'base cost' spread throughout the entire system. This is what makes it look as though Icon can't be sped up much - a rather high, flat cost foundation. I believe that a significant fraction of this base cost is due to the use of descriptors in the implementation. (Don't misunderstand me, I'm not knocking descriptors - they are a *major* factor in the flexibility and power of a language like Icon.) If you look at 'most' Icon programs, though, a human can determine that much of the transfer of data in the program can be identified and typed. This is one of the important features of Ken Walker's Icon-to-C optimizer, removing unneeded type checks. What that optimizer stops short of doing is removing the unneeded descriptors themselves. If you know the type, there is very little need left for a descriptor, only strings [unless something has changed...] use the descriptor for anything else than a [type,value] pair. Since descriptors are twice the size of values in Icon, and twice the native machine word size on most (all?) implementations, programs spend twice as much time pushing descriptors around as they would raw values. Not to mention all the redundant type checks in the runtime system (in most circumstances) and the pulling apart and putting together of the descriptors. An *amazingly good* optimizer should be able to strip descriptors from most places (not all) in an Icon program. With appropriate support from the runtime system, speeds very close to C should be possible from an Icon compiler. -- Steve Wampler - swampler@gemini.edu [Gemini 8m Telescopes Project (under AURA)] The gods that smiled at your birth are now laughing openly. (Fortune Cookie) From icon-group-sender Wed Mar 4 12:22:49 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id MAA23061 for ; Wed, 4 Mar 1998 12:22:48 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA06524; Wed, 4 Mar 1998 12:22:48 -0700 Message-Id: <34FDA767.2F8F@gte.net> Date: Wed, 04 Mar 1998 13:11:35 -0600 From: Mark Evans Reply-To: evans@gte.net Organization: None X-Mailer: Mozilla 3.01 (Win95; I) Mime-Version: 1.0 To: icon-group@optima.CS.Arizona.EDU Subject: Re: Icon translation References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1395 In reply to Charles Hethcoat , If the vision for Icon stops at one-off personal utilities, then the language will stall where it is -- making one-off personal utilities. Most Windows programs are written in C++. They leverage a large class library called MFC, and behind that, a C compiler that converts to machine language. I would much rather write MFC code than machine language. Programmers are not "fooling Mother Nature" to write MFC. They are using high-level tools that make the work of writing machine language efficient and fun. It's true that they could eke out more performance writing the machine language, but the tradeoff point between ease of expression and program optimization is a personal decision. My own personal decision is that Icon is too slow for production programs, so I am stuck with C until an Icon->C converter comes along. Icon's interpreter is written in C. A linker library that mimics Icon's capabilities could also be written in C. In like manner, MFC provides the functionality of Windows at a very high level of abstraction. I want a development path from Icon's level of abstraction to machine language, in the same spirit as MFC. It has been done before, guys. When compilers were first proposed, a lot of scoffers said that they were not technically feasible. Today they are fundamental to our work. Mark From icon-group-sender Wed Mar 4 12:22:14 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id MAA23051 for ; Wed, 4 Mar 1998 12:22:14 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA06528; Wed, 4 Mar 1998 12:22:13 -0700 Date: Wed, 4 Mar 1998 10:05:17 -0700 From: Ralph Griswold Message-Id: <9803041705.AA29304@jupiter.CS.Arizona.EDU> To: icon-group Subject: Book Sale! Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 130 We're having a sale on the book that describes the implementation of Icon. Check out http://www.cs.arizona.edu/icon/ibsale.htm From icon-group-sender Wed Mar 4 16:30:06 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id QAA18097 for ; Wed, 4 Mar 1998 16:30:06 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA07198; Wed, 4 Mar 1998 16:30:05 -0700 Date: Wed, 4 Mar 1998 21:04:52 +0300 (MEST) From: Ehud Lamm To: gep2@computek.net Cc: icon-group@optima.CS.Arizona.EDU Subject: Re: Icon to C conversion In-Reply-To: <199803030539.XAA24309@axp.cmpu.net> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1002 > > You can't really use C-style null-terminated strings as Icon strings, since I$ > strings can ABSOLUTELY contain one or more embedded binary zero bytes. > > This makes the C strlen() function essentially useless. You have to implemen$ > strings in some other way, perhaps maintaining a separate count somewhere. To make myself clearer: I didn't mean to say C string are the same as Icon strings. I just gave an example of a kind of optimization you *may* perform. For example you may decide to treat certain known strings as C strings, or to allow this optimization if the programmer specifies it is allowed. The question really isn't wether C strings can be used as Icon strings, but rather that in order to produce good C code to function exactly like the Icon code (as compiled Icon should), you have first to deeply explore the bset ways to do the desired things in C. You shouldn't only think about compilation techniques and optimizations. Ehud Lamm mslamm@pluto.mscc.huji.ac.il From icon-group-sender Wed Mar 4 16:29:40 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id QAA18056 for ; Wed, 4 Mar 1998 16:29:40 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA07124; Wed, 4 Mar 1998 16:29:39 -0700 From: gep2@computek.net Date: Wed, 4 Mar 1998 13:28:54 -0600 Message-Id: <199803041928.NAA24895@axp.cmpu.net> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Subject: Too slow? To: icon-group@optima.CS.Arizona.EDU X-Mailer: SPRY Mail Version: 04.00.06.17 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 689 >...My own personal decision is that Icon is too slow for production programs, so I am stuck with C until an Icon->C converter comes along. While everyone of course must make their own decision based upon their own specific requirements, you might want to look at SPITBOL-386. While based on the SNOBOL/SPITBOL language rather than Icon, it has many of the same features (pattern matching, tables, dynamic typing, etc. etc.) and even a few very interesting features which Icon does NOT have. It's also fast as hell, *and* it can generate true .EXE files. :-) Gordon Peterson http://www.computek.net/public/gep2/ Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ From icon-group-sender Wed Mar 4 16:29:58 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id QAA18064 for ; Wed, 4 Mar 1998 16:29:57 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA07234; Wed, 4 Mar 1998 16:29:57 -0700 Date: Wed, 4 Mar 1998 20:44:50 +0300 (MEST) From: Ehud Lamm To: gep2@computek.net Cc: icon-group@optima.CS.Arizona.EDU Subject: Re: icon questions In-Reply-To: <199802280842.CAA09087@axp.cmpu.net> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 310 On Sat, 28 Feb 1998 gep2@computek.net wrote: > > I highly optimized BAD algorithm will usually be nowhere near as fast as a > REALLY SLOPPY-IMPLEMENTED good algorithm. > > Gordon Peterson I think is the best way to summerized the debate about optimizations. Ehud Lamm mslamm@pluto.mscc.huji.ac.il From icon-group-sender Wed Mar 4 16:30:22 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id QAA18104 for ; Wed, 4 Mar 1998 16:30:21 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA06898; Wed, 4 Mar 1998 16:30:20 -0700 Date: Wed, 4 Mar 1998 20:52:21 +0300 (MEST) From: Ehud Lamm To: Ramon Pereda Cc: Mark Evans , icon-group@optima.CS.Arizona.EDU Subject: Re: Translation into C In-Reply-To: Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 732 On Mon, 2 Mar 1998, Ramon Pereda wrote: > > > Does anyone know of a language implementation where the resulting code is > machine-generated C code that is maintainable by humans? If so, is the > compiler free and is the language general-purpose? > I recall a lot of talk on this topic, but don't seem to remember anything sepcific... All I am sure of is that in general the problem is not simple - practically unsolvable (some problems associated with this task may be even proved to be NP etc.). Any way the issue is usually the complier not the language compiled. I heartly suggest you post this question on comp.compilers - where I will continue to see who has answers. Ehud Lamm mslamm@pluto.mscc.huji.ac.il From icon-group-sender Wed Mar 4 16:30:33 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id QAA18123 for ; Wed, 4 Mar 1998 16:30:33 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA05583; Wed, 4 Mar 1998 16:30:32 -0700 Date: Wed, 04 Mar 98 18:01:37 -0500 Message-Id: <9803042301.AA0102@valinet.com> From: Paul Abrahams To: icon-group@optima.CS.Arizona.EDU In-Reply-To: Subject: Re: Icon translation Reply-To: abrahams@acm.org Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 2394 >>>>> On Wed, 4 Mar 1998 09:41:45 -0700, swampler@noao.edu (Steve Wampler) said: |Steve> If you carefully profile Icon programs, you may notice that |Steve> there's a 'base cost' spread throughout the entire system. This |Steve> is what makes it look as though Icon can't be sped up much - a |Steve> rather high, flat cost foundation. I believe that a significant |Steve> fraction of this base cost is due to the use of descriptors in |Steve> the implementation. (Don't misunderstand me, I'm not knocking |Steve> descriptors - they are a *major* factor in the flexibility and |Steve> power of a language like Icon.) |Steve> If you look at 'most' Icon programs, though, a human can |Steve> determine that much of the transfer of data in the program can |Steve> be identified and typed. This is one of the important features |Steve> of Ken Walker's Icon-to-C optimizer, removing unneeded type |Steve> checks. What that optimizer stops short of doing is removing |Steve> the unneeded descriptors themselves. |Steve> An *amazingly good* optimizer should be able to strip |Steve> descriptors from most places (not all) in an Icon program. With |Steve> appropriate support from the runtime system, speeds very close |Steve> to C should be possible from an Icon compiler. Frankly, I think one of the weaknesses of Icon is the lack of strong typing - or what more accurately I would call "optional strong typing". Icon already has declarations - they're just not used for data types. I could imagine an Icon-like language that differed *only* in having optional type declarations, with an "any" type that behaves just as Icon variables now do. Such a language would, of course, have all the elegant Icon syntax and control structures. Strong typing would achieve two things: it would provide protection against a wide class of coding errors, and it would make efficient compilation possible without elaborate and still incomplete dataflow analysis to determine run-time types. And were it optional, what would be lost? I won't claim that such a language would be Icon; only Icon is Icon. But it's the language I'd very much like to have. By the way, were Icon++ (or Icon--, if you prefer) to be compiled into C (the poor man's form of compilation), I would expect that it would *not* use the C string type because of the problems with null characters. Paul Abrahams abrahams@acm.org From icon-group-sender Thu Mar 5 08:20:56 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id IAA29020 for ; Thu, 5 Mar 1998 08:20:56 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA07306; Thu, 5 Mar 1998 08:20:55 -0700 From: gep2@computek.net Date: Wed, 4 Mar 1998 21:10:40 -0600 Message-Id: <199803050310.VAA24705@axp.cmpu.net> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Subject: Re: Icon translation To: icon-group@optima.CS.Arizona.EDU X-Mailer: SPRY Mail Version: 04.00.06.17 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 4089 > Frankly, I think one of the weaknesses of Icon is the lack of strong typing - or what more accurately I would call "optional strong typing". Icon already has declarations - they're just not used for data types. I could imagine an Icon-like language that differed *only* in having optional type declarations, with an "any" type that behaves just as Icon variables now do. Such a language would, of course, have all the elegant Icon syntax and control structures. > Strong typing would achieve two things: it would provide protection against a wide class of coding errors... Well, if you're going to create the ugly thing that is strong typing in an effort to "provide protection against a wide class of coding errors" then I don't think it truly makes sense to stop at just whether something is numeric or string. The really serious way to protect against this type of coding errors involves providing more complex rules regarding what kinds of values belong in a data item... such as: * contains a number between 1 and 7 * contains a string matching an entry in table T1 * contains a year (e.g. 1980-2060) * contains a month number (1-12) * contains a string matching either "*" or a key in ISAM file Y Of course, it's generally easy enough to code up rules like that if you WANT them... exactly like it being easy enough to code up type checking stuff, IF you want it. > ...and it would make efficient compilation possible without elaborate and still incomplete dataflow analysis to determine run-time types. There's nothing wrong with the "efficiency" of Icon's compilation... the compiler is VERY quick, in fact. Personally, I don't think that the big problem to the acceptance of Icon has anything to do with its execution speed... sure, faster is most always better, but I think there are other issues which ought to be addressed first. > And were it optional, what would be lost? Mainly, the OTHER things that could be done in less or equivalent development time and which would go a lot further toward helping make Icon a more useful programming tool. For example: * ISAM file support and/or database-like features (named fields in disk file records for example). Either as a built-in, or even just as an interface to an existing database system (FoxPro, Access, Clipper, whatever). This would allow Icon to have access to databases used in other pre-existing systems, and would allow programs to be written and database structures and relationships changed without invalidating previously written programs not using the new fields. Business use of programs (and most others too, in truth) almost universally requires efficient ISAM files and/or database access, and Icon presently doesn't really have it. * Improved support for using Icon for CGI scripting... for example, being able to load and keep in memory a single, reusable copy of the interpreter so that the only file needing to be fetched for executing a CGI script being the (tiny) icode file. Or providing the necessary hooks to facilitate sending and receiving E-mail, accessing news and FTP and Web servers, and the like. > I won't claim that such a language would be Icon; only Icon is Icon. But it's the language I'd very much like to have. I think that strong and fixed typing is a plague, largely perpetrated by those who haven't ever discovered the advantages of a programming language which HELPS you rather than throwing rocks into your path. Of course, I realize that there is no accounting for taste... I guess we'll just have to agree to disagree on this point. > By the way, were Icon++ (or Icon--, if you prefer) to be compiled into C (the poor man's form of compilation), I would expect that it would *not* use the C string type because of the problems with null characters. Absolutely... the C string type is nearly useless for Icon's purposes. (And in fact, isn't even all that great for C's purposes!) Gordon Peterson http://www.computek.net/public/gep2/ Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ From icon-group-sender Thu Mar 5 08:20:46 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id IAA29017 for ; Thu, 5 Mar 1998 08:20:46 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA06891; Thu, 5 Mar 1998 08:20:45 -0700 Date: Wed, 4 Mar 1998 19:19:04 -0600 (CST) From: Ramon Pereda X-Sender: rpereda@pandora To: Paul Abrahams Cc: icon-group@optima.CS.Arizona.EDU Subject: Re: Icon translation In-Reply-To: <9803042301.AA0102@valinet.com> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 328 > Frankly, I think one of the weaknesses of Icon is the lack of strong > typing - or what more accurately I would call "optional strong typing". > Icon already has declarations - they're just not used for data types. I Optional strong typing is very attractive. Does anyone know of a language that has this feature? -ray From icon-group-sender Thu Mar 5 08:21:31 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id IAA29054 for ; Thu, 5 Mar 1998 08:21:31 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA07338; Thu, 5 Mar 1998 08:21:30 -0700 Message-Id: <34FEC116.4952@gte.net> Date: Thu, 05 Mar 1998 09:13:26 -0600 From: Mark Evans Reply-To: evans@gte.net Organization: None X-Mailer: Mozilla 3.01 (Win95; I) Mime-Version: 1.0 To: icon-group@optima.CS.Arizona.EDU Subject: Re: Icon to C conversion: C++ instead References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1541 Ehud Lamm wrote: > > The question really isn't wether C strings can be used as Icon strings, > but rather that in order to produce good C code to function exactly like > the Icon code (as compiled Icon should), you have first to deeply explore > the bset ways to do the desired things in C. You shouldn't only think > about compilation techniques and optimizations. > > Ehud Lamm mslamm@pluto.mscc.huji.ac.il Agreed. We've been talking about C; a point probably missed in these talks is that C++ could be the optimum route. An (Icon)-->(C++) converter could base its conversion on a true class library, not just a mere function library. CString might be one of them, CStream another. My point is that there already exist large class libraries in C++ and many of them are free on the web. So rather than doing a lot of design, one could in principle just go shopping. Type information for the classes should be available at runtime and at compile time. That is the case with Microsoft VC++ 5.0 anyway. That fact might resolve some of the typing issues in Icon. I agree with the idea that typing should be available in Icon as an option, per Paul Abrahams. It is a compiler optimization hint, essentially. All of the C++ compilers that I know about nowadays are native C++ compilers; that is, they don't use the old CFront method of preprocessing C++ code into mangled-C code and then compiling the mangled-C with a C compiler. So they are quite efficient and elegant. They compile C++ directly into machine code. Mark From icon-group-sender Thu Mar 5 12:41:23 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id MAA21277 for ; Thu, 5 Mar 1998 12:41:23 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA04058; Thu, 5 Mar 1998 12:41:22 -0700 Posted-Date: Thu, 5 Mar 1998 09:30:39 -0600 (CST) Message-Id: <3.0.5.32.19980305092753.0089ab50@post.its.mcw.edu> X-Sender: cdt@post.its.mcw.edu X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.5 (32) Date: Thu, 05 Mar 1998 09:27:53 -0600 To: Ramon Pereda , Paul Abrahams From: Chris Tenaglia Subject: Re: Icon translation Cc: icon-group@optima.CS.Arizona.EDU In-Reply-To: References: <9803042301.AA0102@valinet.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 580 ADA seemed to me to have strong, nearly infinite, mandatory, typing. It has great scoping features too. But casting/converting all over the place can make for some pretty ugly code. Chris. At 07:19 PM 3/4/98 -0600, Ramon Pereda wrote: > >> Frankly, I think one of the weaknesses of Icon is the lack of strong >> typing - or what more accurately I would call "optional strong typing". >> Icon already has declarations - they're just not used for data types. I > >Optional strong typing is very attractive. Does anyone know of a language >that has this feature? > >-ray > > > From icon-group-sender Thu Mar 5 12:41:31 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id MAA21292 for ; Thu, 5 Mar 1998 12:41:31 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA05517; Thu, 5 Mar 1998 12:41:30 -0700 Message-Id: X-Mailer: Novell GroupWise 4.1 Date: Thu, 05 Mar 1998 10:08:25 -0600 From: Charles Hethcoat To: rpereda@ringer.cs.utsa.edu Cc: icon-group@optima.CS.Arizona.EDU Subject: Re: Icon translation -Reply Mime-Version: 1.0 Content-Type: text/plain Content-Disposition: inline Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 648 >>> Ramon Pereda 1998 Mar 04, 07:19pm >Does anyone know of a language that has this feature [optional strong typing] ? You might take a look at Haskell 1.4. It's a lazy applicative language with no imperative features, so that simplifies the type checking. It is said to be strongly typed, but also able to dope out the types of everything without explicit type declarations from the programmer. Therefore it need carry no runtime type tags about. (I am just now beginning to study it, so I hope I'm not misrepresenting anything about it.) Go to http://www.haskell.org and follow the links. Charles Hethcoat From icon-group-sender Thu Mar 5 16:34:30 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id QAA10146 for ; Thu, 5 Mar 1998 16:34:29 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA08014; Thu, 5 Mar 1998 16:34:29 -0700 Message-Id: <34FF0D2E.3FB2@rmc.ca> Date: Thu, 05 Mar 1998 15:38:06 -0500 From: "John H. Lindsay" Reply-To: lindsay-j@rmc.ca Organization: Royal Military College of Canada X-Mailer: Mozilla 2.02 (OS/2; I) Mime-Version: 1.0 To: Ramon Pereda Cc: Paul Abrahams , icon-group@optima.CS.Arizona.EDU Subject: Re: Icon translation References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 896 Ramon Pereda wrote: > > > Frankly, I think one of the weaknesses of Icon is the lack of strong > > typing - or what more accurately I would call "optional strong typing". > > Icon already has declarations - they're just not used for data types. I > > Optional strong typing is very attractive. Does anyone know of a language > that has this feature? > > -ray Looking at the request from another viewpoint, optional constrained polymorphism, I suggest you consider Algol 68 and its UNION modes. There's an OS/2 Algol 68 compiler at: http://www.occl-cam.demon.co.uk/ and there is a module of SNOBOL4-like operators with it. -- John H. Lindsay lindsay_j@rmc.ca Department of Mathematics and Computer Science ROYAL MILITARY COLLEGE OF CANADA P O BOX 17000 STN FORCES KINGSTON ON K7K 7B4 CANADA Phone: (613) 541-6000--1--6419 Fax: (613) 541-6584 From icon-group-sender Thu Mar 5 16:34:42 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id QAA10180 for ; Thu, 5 Mar 1998 16:34:37 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA07256; Thu, 5 Mar 1998 16:34:37 -0700 Message-Id: <9803052117.AA07739@ cynic.org> To: Ramon Pereda Cc: icon-group@optima.CS.Arizona.EDU Subject: Re: Icon translation In-Reply-To: Your message of Wed, 04 Mar 1998 19:19:04 CST. From: Perry The Cynic Date: Thu, 05 Mar 1998 13:17:15 -0800 Sender: perry@sutr.cynic.org Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 606 > Optional strong typing is very attractive. Does anyone know of a language > that has this feature? Dylan does. Dylan is a new-ish OODL (object oriented dynamic language) that was designed to allow good-quality code generation (not easy for an OODL, where all typing is dynamic and anything could potentially be mutated at runtime, even object definitions). For reference: Andrew Shalit, The Dylan Reference Manual, ISBN 0-201-44211-6. I'm not here saying that Dylan is a good (or proper) replacement for ICON, of course. It's a very different language, with very different goals. Cheers -- perry From icon-group-sender Mon Mar 9 07:53:33 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id HAA20893 for ; Mon, 9 Mar 1998 07:53:32 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA11144; Mon, 9 Mar 1998 07:53:32 -0700 Message-Id: <3500B606.2C3A@gte.net> Date: Fri, 06 Mar 1998 20:50:46 -0600 From: Mark Evans Reply-To: evans@gte.net Organization: None X-Mailer: Mozilla 3.01 (Win95; I) Mime-Version: 1.0 To: icon-group@optima.CS.Arizona.EDU Subject: Radio Buttons in VIB References: <9803052117.AA07739@ cynic.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1917 Maybe someone can straighten me out about radio buttons in the VIB. I have a four-element radio button "vidget" in VIB. All that I want to do is assign numbers, 0,1,2,3,4 to each button. However my need for descriptive text next to each number means I can't use the string version of the number for the value. Furthermore, the number shown on the screen is off-by-one from the actual button number. Button #1 has value 0, button #2 has value 1, etc. So it appears that I need a whole apparatus to handle this simple object. - a list of the string ID's in the vidget (duplicating the VIB entry, very error prone if I change the VIB entry) - a table to lookup numbers by a string key (the text shown in the vidget) - two symmetrical conversion procedures Seems like overkill to me -- someone help? It seems that what is needed is a call that can return the *numerical* value of the vidget instead of the *string* value. The vidget already knows the strings and their relative positions. Is there a way just to get the number? Am I missing something simple? Here is what I'm doing. _____________________________________________________________ global shannon_strings,shannon_table,shannon_order # input = integer, 0-3 procedure shannon_get_str(order) return shannon_strings[order+1] end # input = string, one of the shannon_strings # the shannon_table is initialized inside init_world() procedure shannon_get_order(str) return (shannon_table[str] | 0) end procedure init_world() local i shannon_strings := ["0: Letters Same","1: Letters Different","2: Digraph","3: Trigraph","4: Quadgraph"] shannon_table := table("") every i := 1 to *shannon_strings do { insert(shannon_table,shannon_strings[i],i-1) } shannon_order := 2 #default setting at startup VSetState(vidgets["radio_button_ShannonOrder"],shannon_get_str(shannon_order)) end From icon-group-sender Mon Mar 9 07:54:09 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id HAA21034 for ; Mon, 9 Mar 1998 07:54:08 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA02611; Mon, 9 Mar 1998 07:54:08 -0700 To: icon-group@optima.CS.Arizona.EDU Date: 7 Mar 1998 07:45:35 GMT From: jeffery@cs.utsa.edu (Clinton Jeffery) Message-Id: <6dqtuv$g94@ringer.cs.utsa.edu> Organization: The University of Texas at San Antonio Sender: icon-group-request@optima.CS.Arizona.EDU References: <3500e0ab.4475385@news.waymark.net> Reply-To: jeffery@cs.utsa.edu Subject: Re: Memory Use Questions Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1562 Gary Hill (ghill@waymark.net) wrote: : When allocating a new object does Icon perform a garbage collection : before asking NT for more memory, or does it only perform a garbage : collection after asking for memory and being refused ? Icon garbage collects, and only asks the OS for more memory when garbage collection fails to free up enough memory to satisfy a request. : I've noticed that the amount of memory used by an application under NT : increases but never decreases. Is there a way to return unused memory : back to the system after a garbage collection ? No, the unused memory is retained for use by subsequent memory allocations. : If you create a list, then assign records to it: : every idx := 1 to 10000 do {...build a_record put (listx , a_record)} : then empty the list, will the garbage collection process reclaim the : space used by the records if nothing else in the program refers to them? Yes. By the way, if you know your list has 10000 elements, it uses less space, and is faster, to ask for a list of 10000 elements: listx := list(10000) and assign those records by subscript: every idx := 1 to 10000 do { ...build a_record; listx[i] := a_record } When you use put() to build very large lists, the interpreter allocates extra memory in anticipation of future calls to put(), resulting in some internal fragmentation that you can avoid if you know the correct size. -- Clint Jeffery, jeffery@cs.utsa.edu Division of Computer Science, The University of Texas at San Antonio Research http://www.cs.utsa.edu/research/plss.html From icon-group-sender Mon Mar 9 07:54:02 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id HAA20990 for ; Mon, 9 Mar 1998 07:54:01 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA10395; Mon, 9 Mar 1998 07:53:59 -0700 To: icon-group@optima.CS.Arizona.EDU Date: Sat, 07 Mar 1998 05:58:37 GMT From: ghill@waymark.net (Gary Hill) Message-Id: <3500e0ab.4475385@news.waymark.net> Organization: All USENET -- http://www.Supernews.com Sender: icon-group-request@optima.CS.Arizona.EDU Subject: Memory Use Questions Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1384 I have a few questions about Icon memory use and garbage collection. Perhaps someone more familiar with Icon internals can help? I am attempting to run a large Icon v9.3 program in a DOS window under Windows NT 4.0. Windows NT has a Virtual Memory Manager, which will allow programs to use more memory than will fit in physical RAM by swapping the excess to and from a disk file. Usually this is a good thing, but when too much virtual memory is allocated to the program it slows to a crawl because of all the paging. When allocating a new object does Icon perform a garbage collection before asking NT for more memory, or does it only perform a garbage collection after asking for memory and being refused ? I've noticed that the amount of memory used by an application under NT increases but never decreases. Is there a way to return unused memory back to the system after a garbage collection ? Also: If you create a list: listx := list (0) ; then assign records to it: every idx := 1 to 10000 do { a_record := record_builder ( x , y , z ) ; put ( listx , a_record ) ; } ; then empty the list: listx := list (0) ; will the garbage collection process reclaim the space used by the records if nothing else in the program refers to them? Or will they remain because they are separate objects from listx? Thanks, G. Hill From icon-group-sender Mon Mar 9 07:53:42 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id HAA20929 for ; Mon, 9 Mar 1998 07:53:41 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA10949; Mon, 9 Mar 1998 07:53:41 -0700 Message-Id: <3500B9EC.1B1A@gte.net> Date: Fri, 06 Mar 1998 21:07:24 -0600 From: Mark Evans Reply-To: evans@gte.net Organization: None X-Mailer: Mozilla 3.01 (Win95; I) Mime-Version: 1.0 To: icon-group@optima.CS.Arizona.EDU Subject: Indicators vs. Controls References: <9803052117.AA07739@ cynic.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 427 Another VIB question -- how do you set up a radio button vidget to operate as an "indicator" instead of a "control"? I use these terms directly out of the technical terminology of LabVIEW. In that programming system, a front panel device may serve either to indicate values or to control them, but not both; the distinction is fundamental. I wonder whether the VIB has this distinction or how it could be simulated. Mark From icon-group-sender Mon Mar 9 15:45:05 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id PAA08176 for ; Mon, 9 Mar 1998 15:45:05 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA12156; Mon, 9 Mar 1998 15:45:04 -0700 Date: Mon, 9 Mar 1998 15:43:47 -0700 From: Sandy Miller Message-Id: <9803092243.AA12314@kingfisher.CS.Arizona.EDU> To: icon-group Subject: Bounced mail Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Md5: AQ5ecX5Hnj6cJx+jrfNzUA== Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 321 We appear to be having problems with bounced mail being returned to the sender, rather than to the list maintainer as they should be. If you receive bounced messages, would you please forward them to me, slm@cs.arizona.edu, so I can remove the offending addresses from the list. Thank you, Sandra Miller Icon Project From icon-group-sender Mon Mar 9 15:45:01 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id PAA08142 for ; Mon, 9 Mar 1998 15:44:57 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA12327; Mon, 9 Mar 1998 15:44:57 -0700 Date: Mon, 9 Mar 1998 17:11:55 -0600 Message-Id: <199803092311.RAA19535@segfault.cs.utsa.edu> From: Clinton Jeffery To: icon-group@optima.CS.Arizona.EDU In-Reply-To: <35043AF2.20D5@gte.net> (message from Mark Evans on Mon, 09 Mar 1998 12:54:42 -0600) Subject: Re: Stripping don't-cares Reply-To: jeffery@cs.utsa.edu Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 895 > Mark Evans asked: > Briefly, what is the optimum method of stripping don't-care characters > from each line of input? ...map() can replace characters, but I want > them to just go away. Mark, There is a trim() function that trims dont_care's off the end of a string, but to trim stuff in the middle of the string you need to actually walk through the string one way or another. The sleaziest way I know would be something like: while line[upto(dont_care,line)] := "" a sneaky refinement is x := 1 while line[x := upto(dont_care, line, x)] := "" If you have to do this for large files and are concerned about efficiency, there may be more efficient ways to do it. I bet icon-group can come up with 8 different solutions with varying performance. I didn't check these solutions for off-by-one errors; I guess you can do that for me. :-) Clint Jeffery, jeffery@cs.utsa.edu From icon-group-sender Tue Mar 10 08:22:15 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id IAA09279 for ; Tue, 10 Mar 1998 08:22:14 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA11385; Tue, 10 Mar 1998 08:22:14 -0700 Date: Tue, 10 Mar 1998 09:43:38 -0600 Message-Id: <199803101543.JAA20389@segfault.cs.utsa.edu> From: Clinton Jeffery To: evans@gte.net Cc: icon-group@optima.CS.Arizona.EDU In-Reply-To: <3504D0C8.14B2@gte.net> (message from Mark Evans on Mon, 09 Mar 1998 23:34:00 -0600) Subject: Re: Stand-alone executables Reply-To: jeffery@cs.utsa.edu Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1021 [Mark Evans wrote:] > I just tried to show off my new VIB Icon program, and it bombed. > [A compiled Windows Icon program couldn't find itself on another drive] Mark, Thanks for the problem report. If the -o option is used, wicont inserts whatever pathname is given on the command line into the .exe file, unfortunately hardwiring it to a particular path. This is a bug, and it is exacerbated by the Wi program, which uses the -o option. Your short term workarounds are either (1) recompile the program using wicont, outside of Wi, or (2) run the patchstr.exe program: patchstr foo.exe foo.exe which strips the path information from the executable's self-identity. I'll probably modify wicont so it doesn't include path information in the identity string it writes; at that point executables will have to find themselves on the PATH like everybody else. Clint Jeffery, jeffery@cs.utsa.edu Division of Computer Science, The University of Texas at San Antonio Research http://www.cs.utsa.edu/research/plss.html From icon-group-sender Tue Mar 10 08:21:57 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id IAA09268 for ; Tue, 10 Mar 1998 08:21:57 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA11696; Tue, 10 Mar 1998 08:21:56 -0700 To: icon-group@optima.CS.Arizona.EDU Date: Tue, 10 Mar 1998 00:29:17 -0700 From: "Scott Gilbert" Message-Id: <6e2q82$2s2$1@usenet50.supernews.com> Organization: All USENET -- http://www.Supernews.com Sender: icon-group-request@optima.CS.Arizona.EDU References: <35048F07.F85AC18E@rwd.com> Subject: Re: ICON and a "Java" implementation status Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 515 If you are talking about the project to compile Icon source to Java bytecode: My understanding is that Todd Proebsting (they guy who was working on it) is doing a sabbatical at Microsoft. I'm guessing the project is on hold because of this. Too bad :-( It certainly seems like a cool idea. I could be wrong though. Joseph White wrote in message <35048F07.F85AC18E@rwd.com>... There was a rumored project to attempt an implementation of ICON in Java. Is there an update to the status for that project? From icon-group-sender Tue Mar 10 08:21:29 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id IAA09253 for ; Tue, 10 Mar 1998 08:21:29 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA11740; Tue, 10 Mar 1998 08:21:28 -0700 To: icon-group@optima.CS.Arizona.EDU Date: Mon, 09 Mar 1998 19:53:27 -0500 From: Joseph White Message-Id: <35048F07.F85AC18E@rwd.com> Organization: RWD Technologies, Inc. Sender: icon-group-request@optima.CS.Arizona.EDU Reply-To: jawhite@ibm.net Subject: ICON and a "Java" implementation status Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 148 There was a rumored project to attempt an implementation of ICON in Java. Is there an update to the status for that project? Regards, Joe White From icon-group-sender Tue Mar 10 08:21:43 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id IAA09258 for ; Tue, 10 Mar 1998 08:21:42 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA12374; Tue, 10 Mar 1998 08:21:42 -0700 Message-Id: <3504D0C8.14B2@gte.net> Date: Mon, 09 Mar 1998 23:34:00 -0600 From: Mark Evans Reply-To: evans@gte.net Organization: None X-Mailer: Mozilla 3.01 (Win95; I) Mime-Version: 1.0 To: jeffery@cs.utsa.edu Cc: icon-group@optima.CS.Arizona.EDU, evans@gte.net, Ramon Pereda Subject: Re: Stand-alone executables References: <199802180115.TAA29593@segfault.cs.utsa.edu> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 830 I just tried to show off my new VIB Icon program, and it bombed. The trouble has something to do with the method of bundling the code as a stand-alone executable. The bundling seems to create a dependance on one or more hardwired file names. To reproduce the bug: Build an Icon VIB program as a stand-alone .exe. Note the drive letter of the hard drive on which it was built. Now, take the .exe file to another Windows PC that does not have any Icon installation. Copy it to a hard drive on the second PC with a *different* drive letter than the original build. Run the copied .exe on the second machine, and... Crash into the console. "Could not find a required file, press any key to kill program" or words to that effect. Could someone in the know please try this experiment and figure out a fix. Regards - Mark From icon-group-sender Tue Mar 10 11:08:03 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id LAA25002 for ; Tue, 10 Mar 1998 11:08:03 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA11052; Tue, 10 Mar 1998 11:08:02 -0700 Posted-Date: Tue, 10 Mar 1998 09:53:16 -0600 (CST) Date: Tue, 10 Mar 1998 09:53:16 -0600 (CST) From: Chris Tenaglia To: Mark Evans Cc: jeffery@cs.utsa.edu, icon-group@optima.CS.Arizona.EDU, Ramon Pereda Subject: Re: Stand-alone executables In-Reply-To: <3504D0C8.14B2@gte.net> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1574 Isn't this kind of like Visual Basic requiring VBRUN???/DLL somewhere on the path? The runtime libraries help keep the executables small. Chris Tenaglia (system manager) | The future foretold, Medical College of Wisconsin | The past explained, 8701 W. Watertown Plank Rd. | The present largely appologized for. Milwaukee, WI 53226 (414)456-8765 | Organon to the Doctor On Mon, 9 Mar 1998, Mark Evans wrote: > Date: Mon, 09 Mar 1998 23:34:00 -0600 > From: Mark Evans > To: jeffery@cs.utsa.edu > Cc: icon-group@optima.CS.Arizona.EDU, evans@gte.net, > Ramon Pereda > Subject: Re: Stand-alone executables > > I just tried to show off my new VIB Icon program, and it bombed. The > trouble has something to do with the method of bundling the code as a > stand-alone executable. The bundling seems to create a dependance on > one or more hardwired file names. > > To reproduce the bug: > > Build an Icon VIB program as a stand-alone .exe. Note the drive letter > of the hard drive on which it was built. > > Now, take the .exe file to another Windows PC that does not have any > Icon installation. Copy it to a hard drive on the second PC with a > *different* drive letter than the original build. Run the copied .exe > on the second machine, and... > > Crash into the console. "Could not find a required file, press any key > to kill program" or words to that effect. > > Could someone in the know please try this experiment and figure out a > fix. > > Regards - > > Mark > > From icon-group-sender Tue Mar 10 11:07:51 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id LAA24998 for ; Tue, 10 Mar 1998 11:07:51 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA13357; Tue, 10 Mar 1998 11:07:50 -0700 Date: Tue, 10 Mar 1998 09:02:11 -0700 From: Ralph Griswold Message-Id: <9803101602.AA05220@jupiter.CS.Arizona.EDU> To: icon-group@optima.CS.Arizona.EDU, xscott@nospam.theriver.com Subject: Re: ICON and a "Java" implementation status Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 554 Todd Proebsting has taken a position in Microsoft Research; he is not on sabbatical from our department, although he could return if he wished. He is still working on the Java implementation of Icon, as is Gregg Townsend here, but it's not getting major attention. The implementation is complete and it works, but it doesn't run acceptably fast. Ralph E. Griswold ralph@cs.arizona.edu Regents' Professor Department of Computer Science The University of Arizona 520-621-6609 (voice) P.O. Box 210077 Tucson, AZ 85721-0077 520-621-4246 (fax) From icon-group-sender Tue Mar 10 11:08:56 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id LAA25045 for ; Tue, 10 Mar 1998 11:08:54 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA11418; Tue, 10 Mar 1998 11:08:53 -0700 Message-Id: <3505721D.D45@gte.net> Date: Tue, 10 Mar 1998 11:02:21 -0600 From: Mark Evans Reply-To: evans@gte.net Organization: None X-Mailer: Mozilla 3.01 (Win95; I) Mime-Version: 1.0 To: Scott Gilbert , Joseph White Cc: icon-group@optima.CS.Arizona.EDU Subject: Re: ICON and a "Java" implementation status References: <35048F07.F85AC18E@rwd.com> <6e2q82$2s2$1@usenet50.supernews.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1227 Todd has a homepage at http://www.research.microsoft.com/~toddpro/ He recently told me that > Jcon is not currently available. (And it may never be if performance > problems remain elusive.) Don't expect it anytime soon. > I suggested that he post his Icon tokenizer to the Icon sites where others might be able to use it. He said that the tokenizer was not in a satisfactory package for public distribution. He did say that the tokenizer that ships with Icon was badly flawed. I.e. don't use theirs, but you can't have mine. I would not hold your breath on Todd. He is working for Micro$oft now. Bill is probably asking him what's taking so long to conquer the world. Todd has a zillion other things going on, too; Java to C, research papers, etcetera. My own two cents is that I am tired of hearing about Java. Seems like every other Dr. Dobbs has some more puffery about Java. I don't buy into it. I consider it one of those fads that you see every two years in the computer industry. I find it amusing that Todd is working on a Java to C converter. How does the liquor ad go, "1950, 1960, 1970, 1980, 1990: You always get back to basics." Now if only we could get that Icon to C converter. Mark From icon-group-sender Tue Mar 10 12:28:24 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id MAA00428 for ; Tue, 10 Mar 1998 12:28:24 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA13706; Tue, 10 Mar 1998 12:28:23 -0700 Message-Id: <35058483.1292@gte.net> Date: Tue, 10 Mar 1998 12:20:51 -0600 From: Mark Evans Reply-To: evans@gte.net Organization: None X-Mailer: Mozilla 3.01 (Win95; I) Mime-Version: 1.0 To: icon-group@optima.CS.Arizona.EDU Subject: Re: ICON and a "Java" implementation status References: <9803101602.AA05220@jupiter.CS.Arizona.EDU> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 705 Ralph Griswold wrote: > > > He is still working on the Java implementation of Icon, as is Gregg Townsend > here, but it's not getting major attention. The implementation is > complete and it works, but it doesn't run acceptably fast. > Two ideas come to mind. (1) Perhaps Todd could release his code for the rest of the world to improve upon since he lacks the time. (2) Todd may have reached a fundamental performance limit that cannot be improved upon in this context, except by moving to compiled C++. That may explain why Todd is presently working on a Java-->C converter. If so, it argues again for an Icon-->C++ converter and against an Icon-->Java converter. Sincerely - Mark Evans From icon-group-sender Tue Mar 10 16:54:24 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id QAA19497 for ; Tue, 10 Mar 1998 16:54:20 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA13463; Tue, 10 Mar 1998 16:54:19 -0700 From: gep2@computek.net Date: Tue, 10 Mar 1998 13:49:31 -0600 Message-Id: <199803101949.NAA29177@axp.cmpu.net> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Subject: Re: ICON and a "Java" implementation status To: icon-group@optima.CS.Arizona.EDU X-Mailer: SPRY Mail Version: 04.00.06.17 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1390 >> He is still working on the Java implementation of Icon, as is Gregg Townsend > here, but it's not getting major attention. The implementation is > complete and it works, but it doesn't run acceptably fast. > (1) Perhaps Todd could release his code for the rest of the world to improve upon since he lacks the time. I think it's amusing (in a sad sort of way) that the immediate reaction is that "it's slow because of Todd's code, which needs improvement" instead of "it's slow because of Java". Other major projects which have been implemented in Java (Corel's Office Suite for example) also had performance problems sufficient to basically scuttle those, too... and those presumably had nothing related to Icon in them. :-) > (2) Todd may have reached a fundamental performance limit that cannot be improved upon in this context, except by moving to compiled C++. That may explain why Todd is presently working on a Java-->C converter. If so, it argues again for an Icon-->C++ converter and against an Icon-->Java converter. Honestly, I don't see a whole lot of reason for going to **either**. Icon (IMHO) works just FINE as it is. Any reason for going Icon->Java, in whatever case, has nothing to do with any anticipated PERFORMANCE improvement! Gordon Peterson http://www.computek.net/public/gep2/ Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ From icon-group-sender Wed Mar 11 07:53:10 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id HAA21304 for ; Wed, 11 Mar 1998 07:53:09 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA14552; Wed, 11 Mar 1998 07:53:09 -0700 Message-Id: <3505D6E3.667C@gte.net> Date: Tue, 10 Mar 1998 18:12:19 -0600 From: Mark Evans Reply-To: evans@gte.net Organization: None X-Mailer: Mozilla 3.01 (Win95; I) Mime-Version: 1.0 To: icon-group@optima.CS.Arizona.EDU Subject: Re: ICON and a "Java" implementation status References: <199803101949.NAA29177@axp.cmpu.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 2300 Read more carefully, Mr. Peterson, and you will not become sad. My statement (2) contradicts your assumption about my statement (1). I pointed out that Java may present fundamental performance limitations no matter how good the code. As for (1), Todd by his own admission is still trying to improve his code, which says that he thinks there is, or may be, room for improvement. He is the expert on the subject of his own code. I merely suggested marrying the user group to this project to relieve him of carrying it all by himself. At least a couple of people have expressed an interest. Feel free to keep using Icon as you please. No one is going to take it away from you! Like Todd himself, I see plenty of reasons for Icon-->(fill in the blank) transformers, and respectfully disagree with your opinion of the idea. Mark gep2@computek.net wrote: > > >> He is still working on the Java implementation of Icon, as is Gregg Townsend > > here, but it's not getting major attention. The implementation is > > complete and it works, but it doesn't run acceptably fast. > > > (1) Perhaps Todd could release his code for the rest of the world to > improve upon since he lacks the time. > > I think it's amusing (in a sad sort of way) that the immediate reaction is that > "it's slow because of Todd's code, which needs improvement" instead of "it's > slow because of Java". Other major projects which have been implemented in Java > (Corel's Office Suite for example) also had performance problems sufficient to > basically scuttle those, too... and those presumably had nothing related to Icon > in them. :-) > > > (2) Todd may have reached a fundamental performance limit that cannot be > improved upon in this context, except by moving to compiled C++. That > may explain why Todd is presently working on a Java-->C converter. If > so, it argues again for an Icon-->C++ converter and against an > Icon-->Java converter. > > Honestly, I don't see a whole lot of reason for going to **either**. Icon > (IMHO) works just FINE as it is. Any reason for going Icon->Java, in whatever > case, has nothing to do with any anticipated PERFORMANCE improvement! > > Gordon Peterson > http://www.computek.net/public/gep2/ > Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ From icon-group-sender Wed Mar 11 07:53:22 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id HAA21307 for ; Wed, 11 Mar 1998 07:53:21 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA06470; Wed, 11 Mar 1998 07:53:21 -0700 Message-Id: <350609C3.75A7@gte.net> Date: Tue, 10 Mar 1998 21:49:23 -0600 From: Mark Evans Reply-To: evans@gte.net Organization: None X-Mailer: Mozilla 3.01 (Win95; I) Mime-Version: 1.0 To: Ramon Pereda Cc: icon-group@optima.CS.Arizona.EDU, evans@gte.net Subject: Re: Translation into C References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 941 Ramon Pereda wrote: > > Does anyone know of a language implementation where the resulting code is > machine-generated C code that is maintainable by humans? If so, is the > compiler free and is the language general-purpose? > > -ray MATLAB does this: "The Compiler and Library products offer MATLAB users execution speedups, code hiding, and the ability to automatically generate standalone C and C++ applications. By automating the conversion of M-files into C and C++ source code, the MATLAB Compiler and Math Libraries eliminate time-consuming and error-prone manual translation and reduce development time for applications that run outside the MATLAB environment." -- http://www.mathworks.com/products/compilerlibrary/ We have here a case study of the desirability of C++ conversion. A commercial company with a stable product decides it is worth investing a lot of money to develop C++ conversion. Hmm... Regards - Mark From icon-group-sender Wed Mar 11 16:24:55 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id QAA00606 for ; Wed, 11 Mar 1998 16:24:54 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA13332; Wed, 11 Mar 1998 16:24:54 -0700 From: gep2@computek.net Date: Wed, 11 Mar 1998 14:08:18 -0600 Message-Id: <199803112008.OAA16114@axp.cmpu.net> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Subject: Re: Translation into C To: evans@gte.net, icon-group@optima.CS.Arizona.EDU In-Reply-To: <350609C3.75A7@gte.net> X-Mailer: SPRY Mail Version: 04.00.06.17 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 6473 [MATLAB] > "The Compiler and Library products offer MATLAB users execution speedups, code hiding, and the ability to automatically generate standalone C and C++ applications. By automating the conversion of M-files into C and C++ source code, the MATLAB Compiler and Math Libraries eliminate time-consuming and error-prone manual translation and reduce development time for applications that run outside the MATLAB environment." > -- http://www.mathworks.com/products/compilerlibrary/ > We have here a case study of the desirability of C++ conversion. A commercial company with a stable product decides it is worth investing a lot of money to develop C++ conversion. Hmm... That's really a TOTALLY separate issue. >From their perspective, clearly it's easier to generate C/C++ code than to generate a direct executable. It eliminates them having to worry about the details of memory models, address resolution, executable file formats, I/O and other runtime library functions, and all the rest. All they have to crank out is C code in generic text file format, and the resulting program can presumably be compiled for most systems with a good production-quality C compiler. (Remember that C is really not a whole lot more than a symbolic assembler language). Also, this kind of number-crunching program tends to be heavily compute-bound, and with highly direct, clear-cut translation of the arithmetical processing to be done... probably with a lot of custom-generated inline code. So for their purposes, a generic interpreter (whether Icon-type or even Java-type for that matter) is less interesting. Icon on the other hand already has an interpreter written in C (thus very easily ported to other systems, as evidenced by the wide array of environments where Icon is already supported) and has the characteristic that many of the language functions are complex enough that they aren't likely to be done in inline code in any case. Clearly once you get into the "runtime library" (where a language like Icon spends a lot of its time), the application IS being directly executed. And as for "worth investing a lot of money", certainly there's nothing PREVENTING a for-profit company that decides that this is true from writing an Icon compiler which would generate C/C++ code. Frankly, I don't think you're very likely to see that happen. Remember that Icon is available for our use due to a **research project** which we've been fortunate enough to reap the benefits of. It is apparently the judgement of the people doing that research (up to now at least... and I concur) that there are other things which would be far more useful to add to the language than to have their development project schedule be jerked around by someone just because THEY *THINK* that it would be cool to crank out C or C++ code. If someone were going to take on a big addition to Icon, frankly, I'd far rather see support added for some kind of databases... whether simple ISAM files, or (perhaps better) ODBC or some other kind of generic database support. This is at present one of the biggest holes in the language, since nearly all business-oriented applications are based on [multiple?-]keyed, related databases of some kind each with multiple-field records. Going with a "standard" database implementation would allow one to use Icon with diverse database systems (FoxPro, Access, even Oracle or some such) so that it could access the same corporate data as the other systems in the company use... and would allow a much easier "foot in the door" to permit Icon to get a foothold in many companies. And again regarding "worth investing a lot of money", where and how do you propose that one might envision seeing a genuine return of that money "invested"? As it is, most people don't pay for Icon (and even with the product being essentially FREE it's not clear that it's exactly setting the programming world on fire... unfortunately). So anyhow, while people could speculate nearly endlessly about what the characteristics might be of an Icon implemented such that the compiler cranked out ["maintainable", no less!!! And I think this is the silliest aspect of all] C/C++ code, the _fact_ is that that is _not_ the way that Icon was implemented, and I doubt that's going to change anytime real soon. Use Icon, and enjoy its many wonderful and unique features. I think people should quit griping about how it's implemented! As a product developer myself, I know just how easy it is for outside people to try to set the agenda for the developer... it's easy for them (not understanding what's involved, and of course not being willing to cough up the money either) to propose grand visions of work which would perhaps take many man-years to complete. It's especially absurd when the product doesn't even make sense to begin with, and probably wouldn't be worth having if anyone DID do all that work. And that's what I was alluding to in the "silly" comment above. The reason people write a program in a language like Icon is because it's HUGELY simpler than writing in C/C++. But once a program is initially written, it's rarely "done" (other than one-shot programs of course) and then it enters the "maintenance/use/upgrade" part of the software life cycle... usually much longer than the time it took to write the program to begin with. And if it made sense to WRITE the program in Icon to begin with, you'll probably want to maintain and enhance it ALSO from the Icon source. Once you start dicking around with the C/C++ source code, you'll then lose those changes when you enhance and recompile the program from the Icon source code. So I really think that people ought to just use Icon and enjoy it for what it is!! It really is a terrific language, highly useful, and I think it's sorta ludicrous to presume that it makes sense to spend (waste!) a lot of time cranking out C/C++ source code (and TRYING, probably unsuccessfully, to make it such that the program might be maintainable at that level... clearly few applications programmers are ever going to understand enough about the Icon implementation internals and rules to be able to successfully modify a program where all those internal details and programmer pitfalls are right out there in the open). Gordon Peterson http://www.computek.net/public/gep2/ Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ From icon-group-sender Thu Mar 12 08:26:23 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id IAA00752 for ; Thu, 12 Mar 1998 08:26:23 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA15725; Thu, 12 Mar 1998 08:26:22 -0700 Posted-Date: Thu, 12 Mar 1998 05:41:57 -0600 (CST) Date: Thu, 12 Mar 1998 05:41:57 -0600 (CST) From: Chris Tenaglia To: icon-group@optima.CS.Arizona.EDU Subject: Re: Translation into C Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 742 I'd like to second the notion/motion that database extensions would be far more useful than C or C++ code generation. Hooks into Oracle, Sybase, Access, Foxpro etc,... would allow the best features of the language to be applied to where the real data is. I have kloojes setup where foxpro exports flat files that icon churns and the output is imported into other databases. It would surely be nicer to have one program do it all instead of three (export - munge - import). Chris Tenaglia (system manager) | The future foretold, Medical College of Wisconsin | The past explained, 8701 W. Watertown Plank Rd. | The present largely appologized for. Milwaukee, WI 53226 (414)456-8765 | Organon to the Doctor From icon-group-sender Thu Mar 12 12:50:53 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id MAA22974 for ; Thu, 12 Mar 1998 12:50:53 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA14775; Thu, 12 Mar 1998 12:50:52 -0700 From: Guy Laden Message-Id: <199803121610.SAA02717@orion.math.tau.ac.il> Subject: Re: Translation into C To: icon-group@optima.CS.Arizona.EDU Date: Thu, 12 Mar 1998 18:10:59 +0200 (GMT+0200) X-Mailer: ELM [version 2.4 PL25] Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1169 > I'd like to second the notion/motion that database extensions > would be far more useful than C or C++ code generation. Hooks > into Oracle, Sybase, Access, Foxpro etc,... would allow the > best features of the language to be applied to where the real > data is. I have kloojes setup where foxpro exports flat files > that icon churns and the output is imported into other databases. > It would surely be nicer to have one program do it all instead > of three (export - munge - import). What language extensions do you have in mind? For the past year or so I've been using the Icon support for dynamic linking of C functions (under sunos) to interface to the msql database. Wrapping the C API that is supplied with msql in a some higher-level icon modules makes this setup quite convenient to use. I suppose embedding database support into the language might make some things easier to do but this setup is quite usable. The Perl community do something similar and it seems to be working for them as well. (I'm not talking about built-in dbm-file support, which Unicon has as well). btw, does Windows icon support dynamic calling of functions in DLL's? Guy From icon-group-sender Thu Mar 12 12:50:59 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id MAA22982 for ; Thu, 12 Mar 1998 12:50:58 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA15538; Thu, 12 Mar 1998 12:50:58 -0700 Message-Id: <350813B6.503F@gte.net> Date: Thu, 12 Mar 1998 10:56:22 -0600 From: Mark Evans Reply-To: evans@gte.net Organization: None X-Mailer: Mozilla 3.01 (Win95; I) Mime-Version: 1.0 To: icon-group@optima.CS.Arizona.EDU Subject: Re: Translation into C References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 499 This would certainly be very sweet, but would not a C++ generator give it to you, along with a zillion other possible applications for Icon code? Icon source --> Generator ---> C++ --> \ --> link --> run Oracle --> C++-based accessor objects --> / ____________________________________ Chris Tenaglia wrote: > > I'd like to second the notion/motion that database extensions > would be far more useful than C or C++ code generation From icon-group-sender Fri Mar 13 08:07:55 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id IAA23742 for ; Fri, 13 Mar 1998 08:07:55 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA15832; Fri, 13 Mar 1998 08:07:54 -0700 From: gep2@computek.net Date: Thu, 12 Mar 1998 21:28:03 -0600 Message-Id: <199803130328.VAA31635@axp.cmpu.net> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Subject: Re: Translation into C To: icon-group@optima.CS.Arizona.EDU X-Mailer: SPRY Mail Version: 04.00.06.17 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1803 >> I'd like to second the notion/motion that database extensions > would be far more useful than C or C++ code generation. Hooks > into Oracle, Sybase, Access, Foxpro etc,... would allow the > best features of the language to be applied to where the real > data is. I have kloojes setup where foxpro exports flat files > that icon churns and the output is imported into other databases. > It would surely be nicer to have one program do it all instead > of three (export - munge - import). > What language extensions do you have in mind? For the past year or so I've been using the Icon support for dynamic linking of C functions (under sunos) to interface to the msql database. Wrapping the C API that is supplied with msql in a some higher-level icon modules makes this setup quite convenient to use. I suppose embedding database support into the language might make some things easier to do but this setup is quite usable. The Perl community do something similar and it seems to be working for them as well. (I'm not talking about built-in dbm-file support, which Unicon has as well). I'd like to see both multi-record functions (rather like database systems do so well) as well as generators which would return consecutive/random/etc records from the file, like Icon's lists, strings, etc. This could actually be used to extend tables as well, where (for example) one could perhaps have a generator which would return the elements of a table whose keys matched some kind of a pattern. > btw, does Windows icon support dynamic calling of functions in DLL's? Dunno, there has been talk about adding DLL calls to S*BOL but as far as I'm aware, it's only JUST talk. Gordon Peterson http://www.computek.net/public/gep2/ Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ From icon-group-sender Fri Mar 13 08:08:06 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id IAA23759 for ; Fri, 13 Mar 1998 08:08:06 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA17201; Fri, 13 Mar 1998 08:08:06 -0700 From: gep2@computek.net Date: Thu, 12 Mar 1998 21:35:49 -0600 Message-Id: <199803130335.VAA00583@axp.cmpu.net> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Subject: Re: Translation into C To: icon-group@optima.CS.Arizona.EDU X-Mailer: SPRY Mail Version: 04.00.06.17 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 939 [adding database features] > This would certainly be very sweet, but would not a C++ generator give it to you, No. > ...along with a zillion other possible applications for Icon code? The poster is operating under the probably-misguided presumption that the Icon runtime environment and program behavior rules are anything remotely like those of traditional C programs and routines. While such a compiler *could* certainly produce "C" code, you can be sure that it wouldn't look much like any application you'd ever seen written "in C". :-) And if the database stuff can be accessed (cleanly) at the Icon level, I couldn't care less whether there's anything remotely approaching C source related to the program (in fact, I'd probably rather keep it as it is, so the Icode files can be so much smaller). Gordon Peterson http://www.computek.net/public/gep2/ Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ From icon-group-sender Fri Mar 13 08:07:45 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id IAA23735 for ; Fri, 13 Mar 1998 08:07:44 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA17073; Fri, 13 Mar 1998 08:07:44 -0700 Message-Id: <35089F74.6018@gte.net> Date: Thu, 12 Mar 1998 20:52:36 -0600 From: Mark Evans Reply-To: evans@gte.net Organization: None X-Mailer: Mozilla 3.01 (Win95; I) Mime-Version: 1.0 To: icon-group@optima.CS.Arizona.EDU Cc: evans@gte.net Subject: Letter Probabilities References: <350813B6.503F@gte.net> <35089EC7.49D@gte.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1743 Here is a small Icon problem related to letter probabilites. Each letter has a "probability of occurrence" in the information-theoretic setting. This probability can be estimated from sample texts. I want to generate random text based on these probabilities. I have a table that associates inidividual letters (one-char strings) with real numbers (probabilities). We can assume for the sake of argument that the sum of all probabilities in my table is unity. Given this table (which I already have Icon code to obtain) what is the most efficient method of generating random text? What I am thinking of at the moment is: (1) get a sorted list of [key,value] pairs, sorted by value (probability), highest probability first (2) generate a random number from 0.0 to 1.0 (3) use a while-loop to find the slot in the sorted list where the number falls; I would subtract each passing probability until my placeholder value had vanished; e.g. i := 0 # running index x := ?0 # random number 0.0 - 1.0 while x > 0 do { i +:= 1 x -:= prob_list[i][2] } letter := prob_list[i][1] This all seems rather awkward to me, especially step (3). Isn't there some construct in Icon that could do this more elegantly? Some way to search a list for a pair of elements that bracket a variable value? Mark P.S. I am already very well acquainted with the sample program 'monkeys.icn' in the distribution. This program uses multiple-character sequences, not individual letter probabilities. More characters gives a better approximation to the source language, but I am interested specifically in single-character probabilities right at the moment. From icon-group-sender Fri Mar 13 12:35:03 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id MAA14385 for ; Fri, 13 Mar 1998 12:35:03 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA15705; Fri, 13 Mar 1998 12:35:02 -0700 Date: Fri, 13 Mar 1998 08:38:12 -0700 From: swampler@noao.edu (Steve Wampler) Subject: Re: Letter Probabilities To: icon-group@optima.CS.Arizona.EDU Message-Id: In-Reply-To: <35089F74.6018@gte.net> Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 2820 Mark Evans wrote: > Here is a small Icon problem related to letter probabilites. Each > letter has a "probability of occurrence" in the information-theoretic > setting. This probability can be estimated from sample texts. I want > to generate random text based on these probabilities. > > I have a table that associates inidividual letters (one-char strings) > with real numbers (probabilities). We can assume for the sake of > argument that the sum of all probabilities in my table is unity. > > Given this table (which I already have Icon code to obtain) what is the > most efficient method of generating random text? What I am thinking of > at the moment is: > > (1) get a sorted list of [key,value] pairs, > sorted by value (probability), > highest probability first > > (2) generate a random number from 0.0 to 1.0 > > (3) use a while-loop to find the slot in the > sorted list where the number falls; > I would subtract each passing probability > until my placeholder value had vanished; e.g. > > i := 0 # running index > x := ?0 # random number 0.0 - 1.0 > while x > 0 do > { > i +:= 1 > x -:= prob_list[i][2] > } > letter := prob_list[i][1] > > > > This all seems rather awkward to me, especially step (3). Isn't there > some construct in Icon that could do this more elegantly? Some way to > search a list for a pair of elements that bracket a variable value? Hmmm, one *very fast* to produce random text is to build a string from the characters in your table, where the probability of each character controls the number of repetitions of that character. Then outputing n characters of random text is: every writes(|?s \ n) Also, you can even simplify the creation of the string by skipping the building of the table of probabilities. (I realize that you already have code to produce the table, but this is fun to think about anyway.) Here is a complete program that reads in a sample text (including newline characters) and outputs random text based on the probability of character occurrence in the sample text: The sample text is assumed to be 10,000,000 characters or fewer (just for fun - you would probably better off with a more general approach to reading in the text to remove this arbitrary limit....) I did it this way to keep the solution small...the setting of &random could be improved, also. ==================== procedure main(args) limit := integer(\args[1]) | 10000 &random := map("HhMmSs","Hh:Mm:Ss", &clock) s := read(,1000000) every writes(|?s \ limit) end ===================== -- Steve Wampler - swampler@gemini.edu [Gemini 8m Telescopes Project (under AURA)] The gods that smiled at your birth are now laughing openly. (Fortune Cookie) From icon-group-sender Fri Mar 13 12:35:12 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id MAA14399 for ; Fri, 13 Mar 1998 12:35:12 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA17700; Fri, 13 Mar 1998 12:35:12 -0700 From: gep2@computek.net Date: Fri, 13 Mar 1998 11:30:44 -0600 Message-Id: <199803131730.LAA18482@axp.cmpu.net> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Subject: Letter Probabilities To: icon-group@optima.CS.Arizona.EDU X-Mailer: SPRY Mail Version: 04.00.06.17 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 2730 > I have a table that associates inidividual letters (one-char strings) with real numbers (probabilities). We can assume for the sake of argument that the sum of all probabilities in my table is unity. > Given this table (which I already have Icon code to obtain) what is the most efficient method of generating random text? What I am thinking of at the moment is: > (1) get a sorted list of [key,value] pairs, sorted by value (probability), highest probability first > (2) generate a random number from 0.0 to 1.0 > (3) use a while-loop to find the slot in the sorted list where the number falls; I would subtract each passing probability until my placeholder value had vanished; e.g. > i := 0 # running index x := ?0 # random number 0.0 - 1.0 while x > 0 do { i +:= 1 x -:= prob_list[i][2] } letter := prob_list[i][1] You're trying to program it like you were programming in C, and that C-style "clockwork mentality" is why you're having problems, IMHO. What I think you ought to do is to simply take your table and build a string (just once!) which contains a number of each letter commensurate with its probability. Then you can replace all this silly C-style nonsense with just: ?letterstring ...and they will "automagically" come out (as many as you need) with the probability you require. In fact, you don't even need to start with your "probabilities" table at all... you can just take your demonstration text, put it all in a string and remove any characters you don't want there (quotation marks and other punctuation for example) and you're all set. > This all seems rather awkward to me, especially step (3). Yup, exactly, that's because you're using C-type programming mentality instead of embracing an Icon-native approach to the problem. > Isn't there some construct in Icon that could do this more elegantly? You BETCHA there is. See above. :-) > P.S. I am already very well acquainted with the sample program 'monkeys.icn' in the distribution. This program uses multiple-character sequences, not individual letter probabilities. More characters gives a better approximation to the source language, but I am interested specifically in single-character probabilities right at the moment. You also ought to buy a copy of the fascinating book "Algorithms in SNOBOL4" by Gimpel (and sold in facsimile reprint by Catspaw). There are some exceedingly nicely done programs there (and very, very useful functions) which deal with random text generation too. Gordon Peterson http://www.computek.net/public/gep2/ Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ From icon-group-sender Fri Mar 13 12:35:20 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id MAA14412 for ; Fri, 13 Mar 1998 12:35:20 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA15665; Fri, 13 Mar 1998 12:35:19 -0700 From: eka@corp.cirrus.com (Eka Laiman) Message-Id: <199803131831.KAA01976@sims-rd.corp.cirrus.com> Subject: Re: Letter Probabilities To: evans@gte.net Date: Fri, 13 Mar 1998 10:27:42 -0800 (PST) Cc: icon-group@optima.CS.Arizona.EDU In-Reply-To: <35089F74.6018@gte.net> from "Mark Evans" at Mar 12, 98 08:52:36 pm X-Mailer: ELM [version 2.4 PL24alpha3] Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1684 Mark Evans wrote: > Here is a small Icon problem related to letter probabilites. Each > letter has a "probability of occurrence" in the information-theoretic > setting. This probability can be estimated from sample texts. I want > to generate random text based on these probabilities. > ............... rest is removed ......... This is what I would do: (1) Construct a string of length n where the members of the string are letters and the number of occurrence of each letter is according to the probability of letter occurrence. The "space" character of course part of the alphabet. For example: consider the character set consists of letter A (30%), B (20%), C (40%), space (10%). Choose n = 200 (icon is very good in handling super long string), then the number of A's will be 60 characters, B's 40 characters, C's 80 characters, and spaces 20 characters. Such a string may look (keep in mind that the characters have been distributed using random permutation - cf. Floyd's algorithm for random permutation): BAA CACCB AA CBCCAB ....... (2) Repeat as many times as the length of the random text that need to be generated: Produce a random number i between 1 and n (200 in the above example) and print string[i:i+1] Floyd's algorithm of generating random permutation from 1 to n: (1) Fill an array L such that L[i] := i (2) every i := n to 2 by -1 do { t := ?i # generate a random index between 1 to i L[i] :=: L[t] # exchange the t-th element with the last # element in current sublist } I think the above method is quite efficient since the distribution of the character is done once. -eka- From icon-group-sender Fri Mar 13 12:35:30 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id MAA14427 for ; Fri, 13 Mar 1998 12:35:30 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA17660; Fri, 13 Mar 1998 12:35:29 -0700 Message-Id: <3509869A.6F03@gte.net> Date: Fri, 13 Mar 1998 13:18:50 -0600 From: Mark Evans Reply-To: evans@gte.net Organization: None X-Mailer: Mozilla 3.01 (Win95; I) Mime-Version: 1.0 To: icon-group@optima.CS.Arizona.EDU Subject: Re: Letter Probabilities References: <199803131831.KAA01976@sims-rd.corp.cirrus.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 3003 Eka, Thank you for taking time to reply so thoughtfully. I thought of this technique before making my post, and have two comments about it. It is a valid approach. (1) Some letters occur with vanishingly small, but nonzero, probabilities. In order to handle them, the generator string would have to be extremely long just to have the letter occur once or twice in the string! We are talking about several thousand characters in a string. (2) There is a more elegant Icon syntax for producing a random character from a string, namely ?string. I assume that this operator assumes equal probability for each letter in the string, namely 1/N where N = *string. What you propose is valid and I will think it through once more. When I first rejected the idea, it was because I had the impression that Icon could not handle strings of more that 255 characters. That appears not to be the case. FYI, I did implement the while-loop mentioned earlier, and it is reasonably fast. In fact I am impressed overall with the speed of Icon as an interpreted language for many of these inner nested loops. I recall reading in one of the online archives about problems with Icon's built-in random number generator. Such problems would affect random string access with ?. Because I am concerned with statistical behaviors, I need to know if anyone has any information about these issues, or whether they have been solved. Random number generators can be funny things. I once worked for a former VP of reserach at a big aerospace concern. He told me a story. There was once an argument over the merits of a particular FORTRAN random number generator used in Monte Carlo simulations and integrations. The author of this module produced all kinds of 2D and 3D scatter plots showing its random characteristics. It would always appear to fill the space. The man harboring suspicions ended the argument with a single plot of his own. He had the generator produce long sequences of (x,y,z) coordinates to make another 3D scatter-plot. This time, however, he changed the viewpoint so that the true nature of the algorithm became apparent to all. All the points were on a 2D plane embedded in 3-space. You had to see the plane edge-on to observe this in the scatter plot. Funny things can happen. Best regards, Mark Eka Laiman wrote: > > Mark Evans wrote: > > Here is a small Icon problem related to letter probabilites. > > This is what I would do: > > (1) Construct a string of length n where the members of the string > are letters and the number of occurrence of each letter is > according to the probability of letter occurrence > > Floyd's algorithm of generating random permutation from 1 to n: > > (1) Fill an array L such that L[i] := i > (2) every i := n to 2 by -1 do { > t := ?i # generate a random index between 1 to i > L[i] :=: L[t] # exchange the t-th element with the last > # element in current sublist > } > From icon-group-sender Fri Mar 13 16:34:07 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id QAA08003 for ; Fri, 13 Mar 1998 16:34:07 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA17167; Fri, 13 Mar 1998 16:34:06 -0700 Message-Id: <3509AE03.729A@gte.net> Date: Fri, 13 Mar 1998 16:06:59 -0600 From: Mark Evans Reply-To: evans@gte.net Organization: None X-Mailer: Mozilla 3.01 (Win95; I) Mime-Version: 1.0 To: icon-group@optima.CS.Arizona.EDU Subject: Re: Letter Probabilities References: <199803131730.LAA18482@axp.cmpu.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 3475 To the group - Several people have simultaneously suggested the generator string idea. This was the first idea that came to mind when I faced the problem originally. See my answer to eka@corp.cirrus.com (Eka Laiman) for my comments. The probability table is simply a requirement for output. As long as I'm going to compute it anyway, it's useful. When you generate random text without computing it, there is no way to tell from the output what are relative probabilities except by very, very gross estimation. The table tells you in a glance, top to bottom. In English, the space character is always first, followed by lower case 'e' with probability about 0.10. Some results are counterintuitive, such as 'y' happening 50% more often than 'b' in the sample below (computed from a small portion of "Moby Dick"). I have only been at Icon for a few weeks and think I have a firm grasp of it. I don't have any "C mentality" problems. If I did, then I would not have bothered asking the group if there were a more elegant Icon method. I would certainly not have asked for an Icon-->C converter! I've used a number of different languages and know how to adapt. Actually my little program has grown into a moderately complicated Icon case study. I've bumped against the 32K limit, that's for sure. It has buttons, menus, all kinds of things going on. No one has really answered my original question about the inner while loop. Whether it is ideal for this problem or not, I would like to know whether Icon has some elegant mechanism for scanning such an ordered list. I will append a sample table for everyone's curiosity. Mark __________________________________________________ [letter frequencies] " "<--->0.1751922190691018 "e"<--->0.09672803124014646 "t"<--->0.07254602343010987 "o"<--->0.06209221664362462 "a"<--->0.06182541415023404 "s"<--->0.05256009119794318 "n"<--->0.05175968371777146 "i"<--->0.0484610347085789 "h"<--->0.04632661476145431 "r"<--->0.04501685706662785 "l"<--->0.0317980062577312 "d"<--->0.03043973901865191 "u"<--->0.02127143515486672 "m"<--->0.01979189405515535 "g"<--->0.01763321933590433 "c"<--->0.01717237866550243 "f"<--->0.01707535957699677 "w"<--->0.01554730893303257 "y"<--->0.01554730893303257 "p"<--->0.0151349778068835 ","<--->0.0151349778068835 "\n"<--->0.010089985204589 "b"<--->0.009968711343956922 "v"<--->0.007397705498556839 "."<--->0.006306240752868125 "-"<--->0.00616071212010963 "k"<--->0.005821145310339808 "I"<--->0.004826699653156758 ";"<--->0.001843362681607606 "T"<--->0.001503795871837784 "?"<--->0.00140677678333212 "B"<--->0.001309757694826457 "W"<--->0.001309757694826457 "S"<--->0.001091464745688714 "N"<--->0.001042955201435882 "A"<--->0.0009701908850566347 "C"<--->0.000921681340803803 "x"<--->0.0008974265686773871 "z"<--->0.0008246622522981394 "j"<--->0.0007033883916660602 "q"<--->0.0006548788474132285 "!"<--->0.0006306240752868126 "P"<--->0.0006306240752868126 "'"<--->0.0006063693031603967 "H"<--->0.0005093502146547332 "F"<--->0.0004850954425283173 "L"<--->0.0004365858982754856 "M"<--->0.0004123311261490697 "D"<--->0.000363821581896238 "E"<--->0.0003395668097698222 "G"<--->0.0003153120376434063 "R"<--->0.0002910572655169904 "Y"<--->0.0001940381770113269 "O"<--->0.0001455286327584952 ")"<--->9.701908850566347e-5 ":"<--->9.701908850566347e-5 "("<--->9.701908850566347e-5 "J"<--->9.701908850566347e-5 "V"<--->4.850954425283173e-5 "U"<--->4.850954425283173e-5 "Q"<--->4.850954425283173e-5 From icon-group-sender Mon Mar 16 08:02:19 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id IAA19538 for ; Mon, 16 Mar 1998 08:02:18 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA18581; Mon, 16 Mar 1998 08:02:18 -0700 From: gep2@computek.net Date: Fri, 13 Mar 1998 21:13:47 -0600 Message-Id: <199803140313.VAA32085@axp.cmpu.net> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Subject: Re: Letter Probabilities To: icon-group@optima.CS.Arizona.EDU X-Mailer: SPRY Mail Version: 04.00.06.17 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1445 > (1) Some letters occur with vanishingly small, but nonzero, probabilities. In order to handle them, the generator string would have to be extremely long just to have the letter occur once or twice in the string! We are talking about several thousand characters in a string. Yes. The string will be long according to the resolution of the probabilities you wish to achieve. I would imagine, however, that a string of 1K-20K characters in length would easily achieve the probability resolution you desire. > (2) There is a more elegant Icon syntax for producing a random character from a string, namely ?string. I assume that this operator assumes equal probability for each letter in the string, namely 1/N where N = *string. Right, and I'd start by using that one. If you decide that the built-in random number generator is insufficiently random for your purposes, you can of course later substitute whatever other generator you like and explicitly index into the string using the random subscript. > When I first rejected the idea, it was because I had the impression that Icon could not handle strings of more that 255 characters. That appears not to be the case. It certainly is not the case. :-) You can have strings of nearly any reasonable length (in fact, up to quite UNreasonable lengths). :-) Gordon Peterson http://www.computek.net/public/gep2/ Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ From icon-group-sender Mon Mar 16 08:02:43 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id IAA19545 for ; Mon, 16 Mar 1998 08:02:42 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA18571; Mon, 16 Mar 1998 08:02:42 -0700 Message-Id: <199803151331.GAA18413@orpheus.gemini.edu> From: swampler@noao.edu (Steve Wampler) Date: Sun, 15 Mar 1998 06:31:19 MST In-Reply-To: Mark Evans's mail message of Mar 13, 4:06pm. X-Mailer: Mail User's Shell (7.2.3 5/22/91) To: icon-group@optima.CS.Arizona.EDU Subject: Re: Letter Probabilities Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 2816 On Mar 13 at 4:06pm, Mark Evans writes: } To the group - } } The probability table is simply a requirement for output. As long as } I'm going to compute it anyway, it's useful. When you generate 'random' } text without computing it, there is no way to tell from the output what } are relative probabilities except by very, very gross estimation. The } table tells you in a glance, top to bottom. The table may be useful for seeing the relative probabilities, which is useful for checking for anomolies. (If you produced 'random' text based on the novel "Gadsby" for example, the table would help explain the strange output you'd get.) It is not all that useful in actually generating the 'random' text, however - the problem becomes much harder when using it! (See the aside below) Why not generate the table as an aside and keep the 'random' text generation simple? If you think about it, the 'generated string' solutions that are proposed work on the *same* principle as you want to use with your table, but without having to convert the information embedded in the input stream into numeric values and then back again and without having to convert probability values into unique numeric ranges. (As an aside, if the table really contains the 'relative probabilities' of the characters then it is *very* hard to use it to produce the 'random' output text correctly! The table has to contain not the relative probability, but a unique numeric range whose proportion to the total range matches the relative probability. So, 'at a glance', it would not show the relative probability anyway.) } Actually my little program has grown into a moderately complicated Icon } case study. I've bumped against the 32K limit, that's for sure. It has } buttons, menus, all kinds of things going on. 32K limit? This is news to me - what version of Icon and what platform are you using? I'm sure you can bump that *way* up with most machines these days! } No one has really answered my original question about the inner while } loop. Whether it is ideal for this problem or not, I would like to know } whether Icon has some elegant mechanism for scanning such an ordered } list. I've lost your original message and so can't be specific, but here's an approach to a similar problem: Let 'a' be an ordered list of floating point values, high to low, between 0.0 and 1.0. Let 'x' be a value between 0.0 and 1.0. The following code assigns to i the index of the first value in 'a' that is <= 'x': x > a[i := seq()] Again, note that this (and any similar approach) does not do what you want if the values in 'a' are relative probabilities. -- Steve Wampler - swampler@gemini.edu [Gemini 8m Telescopes Project (under AURA)] The gods that smiled at your birth are now laughing openly. (Fortune Cookie) From icon-group-sender Mon Mar 16 08:02:35 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id IAA19541 for ; Mon, 16 Mar 1998 08:02:35 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA17496; Mon, 16 Mar 1998 08:02:34 -0700 From: gep2@computek.net Date: Fri, 13 Mar 1998 21:54:29 -0600 Message-Id: <199803140354.VAA03466@axp.cmpu.net> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Subject: Re: Letter Probabilities To: icon-group@optima.CS.Arizona.EDU X-Mailer: SPRY Mail Version: 04.00.06.17 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 3512 > Several people have simultaneously suggested the generator string idea. This is hardly surprising. :-) > The probability table is simply a requirement for output. As long as I'm going to compute it anyway, it's useful. Fine, but that doesn't mean you have to use it for generating your random text. > In English, the space character is always first, followed by lower case 'e' with probability about 0.10. Some results are counterintuitive, such as 'y' happening 50% more often than 'b' in the sample below (computed from a small portion of "Moby Dick"). Yeah, I think several things about your table are quite suspect. Perhaps you ought to use a more modern text for computing your probabilities. > I have only been at Icon for a few weeks and think I have a firm grasp of it. I think that sounds like an "oxymoron" to me. I don't think you'll REALLY grasp it in just a few weeks, frankly. > Whether it is ideal for this problem or not, I would like to know whether Icon has some elegant mechanism for scanning such an ordered list. I think that elegance comes from solving a given problem in the most effective, efficient, and simple way... not by making an elegant coding of an undesirable algorithm. >[letter frequencies] " "<--->0.1751922190691018 "e"<--->0.09672803124014646 "t"<--->0.07254602343010987 "o"<--->0.06209221664362462 "a"<--->0.06182541415023404 "s"<--->0.05256009119794318 "n"<--->0.05175968371777146 "i"<--->0.0484610347085789 "h"<--->0.04632661476145431 "r"<--->0.04501685706662785 "l"<--->0.0317980062577312 "d"<--->0.03043973901865191 "u"<--->0.02127143515486672 "m"<--->0.01979189405515535 "g"<--->0.01763321933590433 "c"<--->0.01717237866550243 "f"<--->0.01707535957699677 "w"<--->0.01554730893303257 "y"<--->0.01554730893303257 "p"<--->0.0151349778068835 ","<--->0.0151349778068835 "\n"<--->0.010089985204589 "b"<--->0.009968711343956922 "v"<--->0.007397705498556839 "."<--->0.006306240752868125 "-"<--->0.00616071212010963 "k"<--->0.005821145310339808 "I"<--->0.004826699653156758 ";"<--->0.001843362681607606 "T"<--->0.001503795871837784 "?"<--->0.00140677678333212 "B"<--->0.001309757694826457 "W"<--->0.001309757694826457 "S"<--->0.001091464745688714 "N"<--->0.001042955201435882 "A"<--->0.0009701908850566347 "C"<--->0.000921681340803803 "x"<--->0.0008974265686773871 "z"<--->0.0008246622522981394 "j"<--->0.0007033883916660602 "q"<--->0.0006548788474132285 "!"<--->0.0006306240752868126 "P"<--->0.0006306240752868126 "'"<--->0.0006063693031603967 "H"<--->0.0005093502146547332 "F"<--->0.0004850954425283173 "L"<--->0.0004365858982754856 "M"<--->0.0004123311261490697 "D"<--->0.000363821581896238 "E"<--->0.0003395668097698222 "G"<--->0.0003153120376434063 "R"<--->0.0002910572655169904 "Y"<--->0.0001940381770113269 "O"<--->0.0001455286327584952 ")"<--->9.701908850566347e-5 ":"<--->9.701908850566347e-5 "("<--->9.701908850566347e-5 "J"<--->9.701908850566347e-5 "V"<--->4.850954425283173e-5 "U"<--->4.850954425283173e-5 "Q"<--->4.850954425283173e-5 To start with, I'll comment that it's ludicrous to present such "probabilities" to 16 significant digits... at least half (probably two-thirds or more) of those digits are totally, absolutely meaningless. I will comment however that it's probable that I could, given your table, even tell you with pretty good certainty which about 20K piece of Moby Dick you started with. :-) Gordon Peterson http://www.computek.net/public/gep2/ Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ From icon-group-sender Mon Mar 16 12:30:37 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id MAA06437 for ; Mon, 16 Mar 1998 12:30:37 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA19556; Mon, 16 Mar 1998 12:30:36 -0700 Message-Id: <350D4D2D.30DC@gte.net> Date: Mon, 16 Mar 1998 10:02:53 -0600 From: Mark Evans Reply-To: evans@gte.net Organization: None X-Mailer: Mozilla 3.01 (Win95; I) Mime-Version: 1.0 To: icon-group@optima.CS.Arizona.EDU Subject: Re: Letter Probabilities References: <199803151331.GAA18413@orpheus.gemini.edu> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 722 Finally someone answered my question! Thanks, Steve! If your alphabet has three letters {A,B,C} with probabilities {0.50,0.20,0.30} respectively then a table like this -- A 0.5 C 0.3 B 0.2 can be used to make random text. I am not arguing that it's more elegant than the Icon ?string construct as everyone seems to imagine. The random number x in [0,1] has uniform distribution. By turns, subtract each number in the table until x <= 0, and there is your letter. This technique would not work if x had nonuniform distribution. For the record I suppose I should say that I like the generator string idea better myself, thought of it before getting on the newgroup here, and still think highly of it. Mark From icon-group-sender Mon Mar 16 12:30:43 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id MAA06449 for ; Mon, 16 Mar 1998 12:30:43 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA19231; Mon, 16 Mar 1998 12:30:42 -0700 Message-Id: <350D49AD.3539@gte.net> Date: Mon, 16 Mar 1998 09:47:57 -0600 From: Mark Evans Reply-To: evans@gte.net Organization: None X-Mailer: Mozilla 3.01 (Win95; I) Mime-Version: 1.0 To: icon-group@optima.CS.Arizona.EDU Subject: Re: Letter Probabilities References: <199803140354.VAA03466@axp.cmpu.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 764 Gordon - Thanks for the feeback. (1) I have not thrown away the generator string idea. I refer you back to my previous post. (2a) Any such probability table is an estimate to begin with. Read about Shannon's work if you are curious. (2b) You certainly could tell me which 20k was used, but that would not invalidate the estimate. (2c) Maybe I want an estimate of nineteenth-century English as written by Herman Melville. Shannon himself analyzed James Joyce. (3) I said I have a firm grasp of Icon and I mean it. I've worked in enough different languages to know when I've "caught the paradigm." I did not say I am an expert in Icon. I do say, however, that I am my own judge of when a paradigm fits a problem. Your comments are appreciated. Mark From icon-group-sender Mon Mar 16 16:21:26 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id QAA21320 for ; Mon, 16 Mar 1998 16:21:26 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA12573; Mon, 16 Mar 1998 16:21:25 -0700 Message-Id: <350DA0F2.6075@gte.net> Date: Mon, 16 Mar 1998 16:00:18 -0600 From: Mark Evans Reply-To: evans@gte.net Organization: None X-Mailer: Mozilla 3.01 (Win95; I) Mime-Version: 1.0 To: icon-group@optima.CS.Arizona.EDU Cc: evans@gte.net Subject: Re: image References: <199803140354.VAA03466@axp.cmpu.net> <350D49AD.3539@gte.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1305 I can answer my own question. The function 'escape' that is linked by xcode essentially reverses an image() call. As for the high ASCII characters, here is a little utility routine that does the job, but I would much rather have a library call for this. Mark ____________________________ link xcode global diagnose procedure main(av) diagnose := open("diagnose.txt","w") write(diagnose,image_NotHighChars("\n\r\tABCDEF\xde|K!\\")) write(diagnose,"\n\n\n") close(diagnose) end procedure image_NotHighChars(str) # lets you print chars native that are ASCII > 128 # Icon's "image" routine gives nasty hex escape codes for these local img_str,new_str,esc_seq img_str := image(str) write(diagnose,"img_str is -->",img_str,"<---") new_str := "" img_str ? { while new_str ||:= tab(upto('\\')) do { write(diagnose,"new_str is -->",new_str,"<---") esc_seq := move(2) write(diagnose,"esc_seq is -->",esc_seq,"<---") if (esc_seq) == "\\x" then # hexadecimal ASCII code { new_str ||:= escape(esc_seq ||:= move(2)) } else { new_str ||:= esc_seq } } new_str ||:= tab(0) # anything after last esc seq } return new_str end From icon-group-sender Mon Mar 16 16:21:18 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id QAA21314 for ; Mon, 16 Mar 1998 16:21:18 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA20007; Mon, 16 Mar 1998 16:21:17 -0700 Message-Id: <350D91A6.2E54@gte.net> Date: Mon, 16 Mar 1998 14:55:02 -0600 From: Mark Evans Reply-To: evans@gte.net Organization: None X-Mailer: Mozilla 3.01 (Win95; I) Mime-Version: 1.0 To: icon-group@optima.CS.Arizona.EDU Subject: Reversal of image() References: <199803140354.VAA03466@axp.cmpu.net> <350D49AD.3539@gte.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 513 Does anyone know what call would correspond to a reversal of image()? The issue is a little nontrivial. If you write image(char) where the ASCII code of 'char' is > 128, image(char) will produce something ugly like \xa0 which means ASCII 160, instead of simply quoting the character as it does all the usual chars. I do understand why control codes like \t and \n need escape sequences, but I don't understand why a character with ASCII code 160 should need one. Are they worried about 7-bit systems? Mark From icon-group-sender Tue Mar 17 08:04:06 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id IAA28479 for ; Tue, 17 Mar 1998 08:04:06 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA21124; Tue, 17 Mar 1998 08:04:05 -0700 Date: Mon, 16 Mar 98 18:46:30 -0500 Message-Id: <9803162346.AA0130@valinet.com> From: Paul Abrahams To: icon-group@optima.CS.Arizona.EDU Subject: Re: Letter Probabilities Reply-To: abrahams@acm.org Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 417 Using the probabilities to construct a weighted string and then selecting a random character from the string does have one unaesthetic property, in my book: the length of the string grows exponentially with the precision of the probabilities. For that reason I'd opt for a binary search, which takes 5 probes no matter what the precision. I wonder if there's another way of attacking this problem. Paul Abrahams From icon-group-sender Tue Mar 17 08:03:58 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id IAA28461 for ; Tue, 17 Mar 1998 08:03:57 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA26187; Tue, 17 Mar 1998 08:03:57 -0700 Date: Mon, 16 Mar 1998 16:46:26 -0700 From: Ralph Griswold Message-Id: <9803162346.AA17067@jupiter.CS.Arizona.EDU> To: evans@gte.net, icon-group@optima.CS.Arizona.EDU Subject: Escape characters Cc: icon-group Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 664 It's not so much 7-bit systems, but on many platforms there are no displayable graphics for much of the upper-half of the 8-bit ASCII character sets, and on some systems, attempting to display them can cause peculiar results, as can attempting to print them. The characters themselves, as far as I know cause no problem in files. The rule is that if a character is not deemed "printable" over a broad range of platforms, is is encoded with escapes by image() Ralph E. Griswold ralph@cs.arizona.edu Regents' Professor Department of Computer Science The University of Arizona 520-621-6609 (voice) P.O. Box 210077 Tucson, AZ 85721-0077 520-621-4246 (fax) From icon-group-sender Tue Mar 17 12:27:55 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id MAA17272 for ; Tue, 17 Mar 1998 12:27:55 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA21249; Tue, 17 Mar 1998 12:27:55 -0700 Message-Id: <350EA1D5.26BB@gte.net> Date: Tue, 17 Mar 1998 10:16:21 -0600 From: Mark Evans Reply-To: evans@gte.net Organization: None X-Mailer: Mozilla 3.01 (Win95; I) Mime-Version: 1.0 To: icon-group@optima.CS.Arizona.EDU Subject: Re: Letter Probabilities References: <9803162346.AA0130@valinet.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 607 I think that we have here one of those classic execution-time vs. memory-space tradeoffs that they teach about in computer science classes. Mark Paul Abrahams wrote: > > Using the probabilities to construct a weighted string and then > selecting a random character from the string does have one unaesthetic > property, in my book: the length of the string grows exponentially with > the precision of the probabilities. For that reason I'd opt for a > binary search, which takes 5 probes no matter what the precision. > > I wonder if there's another way of attacking this problem. > > Paul Abrahams From icon-group-sender Tue Mar 17 16:26:20 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id QAA08544 for ; Tue, 17 Mar 1998 16:26:20 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA17517; Tue, 17 Mar 1998 16:26:19 -0700 Message-Id: <199803172152.OAA16672@orpheus.gemini.edu> From: swampler@noao.edu (Steve Wampler) Date: Tue, 17 Mar 1998 14:52:34 MST In-Reply-To: Mark Evans's mail message of Mar 13, 4:06pm. X-Mailer: Mail User's Shell (7.2.3 5/22/91) To: icon-group@optima.CS.Arizona.EDU Subject: Re: Letter Probabilities Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1502 On Mar 17 at 10:16am, Mark Evans writes: } I think that we have here one of those classic execution-time vs. } memory-space tradeoffs that they teach about in computer science } classes. } } Mark } } Paul Abrahams wrote: } > } > Using the probabilities to construct a weighted string and then } > selecting a random character from the string does have one unaesthetic } > property, in my book: the length of the string grows exponentially with } > the precision of the probabilities. For that reason I'd opt for a } > binary search, which takes 5 probes no matter what the precision. } > } > I wonder if there's another way of attacking this problem. I'm not sure I understand this. The upper bound on the weighted string is the length of the input text itself. In fact, the input text itself is the *perfect* weighted string! There is no need to reduce the string to probabilities and then expand the probabilities back into a different string - all this does is (a) slow things down and (b) reduce the 'accuracy' of the probabilities. ((b) isn't all that important when producing 'random' text, I suppose.) Now, for *really, really* large input samples, this becomes inefficent (memory-wise). It's certainly not an issue for the 20K character lengths I've seen mentioned here. I regularly process 10-MB strings with Icon. -- Steve Wampler - swampler@gemini.edu [Gemini 8m Telescopes Project (under AURA)] The gods that smiled at your birth are now laughing openly. (Fortune Cookie) From icon-group-sender Wed Mar 18 07:49:19 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id HAA05112 for ; Wed, 18 Mar 1998 07:49:18 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA20502; Wed, 18 Mar 1998 07:49:18 -0700 Message-Id: <350F0FA2.8C7@gte.net> Date: Tue, 17 Mar 1998 18:04:50 -0600 From: Mark Evans Reply-To: evans@gte.net Organization: None X-Mailer: Mozilla 3.01 (Win95; I) Mime-Version: 1.0 To: Ralph Griswold Cc: icon-group@optima.CS.Arizona.EDU, icon-group@baskerville.CS.Arizona.EDU Subject: Re: Escape characters References: <9803162346.AA17067@jupiter.CS.Arizona.EDU> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 874 Ralph Griswold wrote: > > It's not so much 7-bit systems, but on many platforms there are > no displayable graphics for much of the upper-half of the 8-bit > ASCII character sets, and on some systems, attempting to display them > can cause peculiar results, as can attempting to print them. The characters > themselves, as far as I know cause no problem in files. > > The rule is that if a character is not deemed "printable" over > a broad range of platforms, is is encoded with escapes by image() > OK. I vote for some optional arguments to image() that can customize its behavior. As things stand, it takes no arguments except the string itself. The second argument could be a string code for a particular mode of behavior. Many fonts use the high 128 characters. It can be desirable to let the user see these characters in saved files as they appear. Mark From icon-group-sender Thu Mar 19 12:26:45 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id MAA09342 for ; Thu, 19 Mar 1998 12:26:45 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA25780; Thu, 19 Mar 1998 12:26:44 -0700 Message-Id: <35116600.29D3@gte.net> Date: Thu, 19 Mar 1998 12:37:52 -0600 From: Mark Evans Reply-To: evans@gte.net Organization: None X-Mailer: Mozilla 3.01 (Win95; I) Mime-Version: 1.0 To: icon-group@optima.CS.Arizona.EDU Cc: evans@gte.net Subject: Free Icon Program (Re: Letter Probabilities) References: <199803172152.OAA16672@orpheus.gemini.edu> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 974 I've been talking to the icon users' group about letter probabilities for long enough, here is the program! This little program is basically a VIB wrapper for Ralph Griswold's 'monkeys.icn' example. It allows any order of language approximation. It saves the tables to a file for later reloading. There is a configuration setup that allows you to ignore or remap characters. The archive is a bit under 2 MB and will take about 10 minutes to download. I'll leave it on my site for a couple of weeks. If one of the Icon leaders wants to copy it to another Icon site on a permanent or semi-permanent basis, be my guest. I would appreciate any comments or feedback on the program. Mark _______________________________________________________ My program: http://home1.gte.net/evans/index.htm _______________________________________________________ WinZip: http://www.winzip.com/download.cgi?home _______________________________________________________ From icon-group-sender Thu Mar 19 16:50:24 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id QAA14206 for ; Thu, 19 Mar 1998 16:50:20 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA24955; Thu, 19 Mar 1998 16:50:19 -0700 Message-Id: <35117B29.755A@gte.net> Date: Thu, 19 Mar 1998 14:08:09 -0600 From: Mark Evans Reply-To: evans@gte.net Organization: None X-Mailer: Mozilla 3.01 (Win95; I) Mime-Version: 1.0 To: icon-group@optima.CS.Arizona.EDU, evans@gte.net Subject: Re: Free Icon Program (Re: Letter Probabilities) References: <199803172152.OAA16672@orpheus.gemini.edu> <35116600.29D3@gte.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 192 Ralph Griswold wanted me to correct something. "monkeys.icn was written by Steve Wampler, not my me. I made some additions later on. Please post to icon-group to clarify this." -- Mark From icon-group-sender Mon Mar 23 12:36:22 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id MAA17203 for ; Mon, 23 Mar 1998 12:36:22 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA25733; Mon, 23 Mar 1998 12:36:21 -0700 Date: Mon, 23 Mar 1998 07:06:15 -0700 From: Ralph Griswold Message-Id: <9803231406.AA01189@jupiter.CS.Arizona.EDU> To: icon-group Subject: Mark Evans' random text program Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 138 We've placed rand_100.zip on our Web site to make it more generally available: http://www.cs.arizona.edu/icon/ftp/contrib/rand_100.zip From icon-group-sender Fri Mar 27 17:01:09 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id RAA16084 for ; Fri, 27 Mar 1998 17:01:08 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA32062; Fri, 27 Mar 1998 17:01:07 -0700 X-Sender: clodius@nis-pop.lanl.gov Message-Id: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Date: Fri, 27 Mar 1998 13:49:55 -0600 To: icon-group@optima.CS.Arizona.EDU From: "William B. Clodius" Subject: Icon and recursion Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1618 Hi: I have been trying to learn a little of Icon from information available over the net, and have been having trouble trying to transcribe some code from other languages to Icon. I have, so far, not had any problems translating procedural style code. The troublesome code has been primarilly Lisp or Lisp style benchmarks that rely heavily on recursion, i.e. the Tak benchmark and the change benchmark (http://www.webcom.com/nazgul/change.html). The Tak bencghmark appears to exhaust the internal stack before printing any output. Given the nature of the Tak benchmark I may not be able to do something to make it work. The Change benchmark, gives incorrect output and inserted write statements suggest an order of execution that I do not understand at all. As a result I have the following questions: 1. What are the semantics of Icon's argument passing mechanism, i.e., by value, by reference, copy-in/copy-out, no modifiable aliasing, by name, lazy, eager? 2. What is the meaning of the "local" statement, i.e., does it ensure that a value is saved from call to call? 3. Can Icon handle recursion, and are there any tricks I should be aware of either to make recursion work or translate recursive code into a form Icon can handle? (Note Tak and Change are not tail recursive.) 4. Is there example code available which can give more insight into iterators and their semantics? William B. Clodius Phone: (505) 665-9370 Los Alamos Natl. Lab., NIS-2 FAX: (505) 667-3815 PO Box 1663, MS-C323 Group Off.: 505/667-3422 or 667-5127 Los Alamos, NM 87545 email: wclodius@lanl.gov From icon-group-sender Mon Mar 30 08:31:14 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id IAA25482 for ; Mon, 30 Mar 1998 08:31:13 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA29371; Mon, 30 Mar 1998 08:31:13 -0700 Message-Id: <199803281452.HAA29037@orpheus.gemini.edu> From: swampler@noao.edu (Steve Wampler) Date: Sat, 28 Mar 1998 07:52:39 MST In-Reply-To: "William B. Clodius"'s mail message of Mar 27, 1:49pm. X-Mailer: Mail User's Shell (7.2.3 5/22/91) To: "William B. Clodius" Subject: Re: Icon and recursion Cc: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 2994 On Mar 27 at 1:49pm, "William B. Clodius" writes: } Hi: } } I have been trying to learn a little of Icon from information available } over the net, and have been having trouble trying to transcribe some code } from other languages to Icon. I have, so far, not had any problems } translating procedural style code. The troublesome code has been primarilly } Lisp or Lisp style benchmarks that rely heavily on recursion, i.e. the Tak } benchmark and the change benchmark } (http://www.webcom.com/nazgul/change.html). The Tak bencghmark appears to } exhaust the internal stack before printing any output. Given the nature of } the Tak benchmark I may not be able to do something to make it work. The } Change benchmark, gives incorrect output and inserted write statements } suggest an order of execution that I do not understand at all. Odd, I've recursed very heavily in Icon (a lisp interpreter, recursive descent parser, etc) with no problems. What machine/OS are you using? (I use Unix/Linux exclusively, so you may be hitting a configuration limit under some other OS.) } As a result I have the following questions: } } 1. What are the semantics of Icon's argument passing mechanism, i.e., by } value, by reference, copy-in/copy-out, no modifiable aliasing, by name, } lazy, eager? By value, but remember that Icon considers the 'value' of a structure (list, table, set, record) to be its address. } 2. What is the meaning of the "local" statement, i.e., does it ensure that } a value is saved from call to call? No, just that the reference won't conflict with any global variable of the same name. "static" is a local variable that retains values across calls. non-static local variables are created on procedure invocation and destroyed on procedure return or failure. (Note that 'suspending' from a procedure is neither a return or a failure, so local variables retain values during a suspend-resume sequence.) } 3. Can Icon handle recursion, and are there any tricks I should be aware of } either to make recursion work or translate recursive code into a form Icon } can handle? (Note Tak and Change are not tail recursive.) Icon handles recursion just fine. I'd be interested in seeing the code that is causing you problems. } 4. Is there example code available which can give more insight into } iterators and their semantics? Probably, I assume you have the Icon book (3rd edition). There is the "Icon Implementation" book (don't have the title handy right now, which though dated in some of the implementation details, does explain how generators,iterators, and GDE all work. I have tons of code that use them heavily, but you'd need to spend some time examining the code to get much insight (the code isn't written to illustrate generators and goal-directed evaluation, but to use those features). -- Steve Wampler - swampler@gemini.edu [Gemini 8m Telescopes Project (under AURA)] The gods that smiled at your birth are now laughing openly. (Fortune Cookie) From icon-group-sender Mon Mar 30 12:26:09 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id MAA12051 for ; Mon, 30 Mar 1998 12:26:09 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA31944; Mon, 30 Mar 1998 12:26:08 -0700 X-Sender: clodius@nis-pop.lanl.gov Message-Id: In-Reply-To: <199803281452.HAA29037@orpheus.gemini.edu> References: "William B. Clodius"'s mail message of Mar 27, 1:49pm. Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="============_-1320848357==_============" Date: Mon, 30 Mar 1998 10:08:52 -0600 To: icon-group@optima.CS.Arizona.EDU From: "William B. Clodius" Subject: Re: Icon and recursion Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 3938 --============_-1320848357==_============ Content-Type: text/plain; charset="us-ascii" After modifying some things around I now have a version of the Change benchmark that is working. I am not certain which modification caused it to work, but I suspect it involved the local attribute for some temporaries. After I got it working I rewrote the benchmark to eliminate most temporaries, and got about a 30% improvement in performance. As might be expected with an interpreter for a problem code that does not address the language domain, performance is about two orders of magnitude slower than for compiled imperative languages. On the other hange the source code is from 3/4 to half the size of that of the imperative languages, C and F90. I should note that at this point I am mostly interested in learning the flavor of the language before I decide to learn it in detail, so I have not gotten Griswold's text. I have read the introductory material by Hanson, Shipman, and Griswold that is available on the net. The system I am using is an SGI Indigo 2 although I also have an old Power Mac available. There was some interest expressed in seeing the code I was using so that I have attached them. The Tak benchmark (and the change benchmark for large argument values) results in an Evaluation stack exceeded error which I suspect is due to the large number of recursions invoked by the benchmarks, and not to any problems in Icon with recursion in general. Tak in particular was designed to test the effiency of general recursion and invokes recursion I believe tens of thousands of times. --============_-1320848357==_============ Content-Id: Content-Type: text/plain; name="change.icn"; charset="us-ascii" Content-Disposition: attachment; filename="change.icn" ; modification-date="Mon, 30 Mar 1998 09:41:55 -0600" procedure main( args ) local start_time, n start_time := &time; n := integer(args[1]); write ( args[1], " ", count_change(n), " ", (&time-start_time)/1000., " s"); end procedure first_denomination( kinds_of_coins ) case kinds_of_coins of { 1: return 1 2: return 5 3: return 10 4: return 25 5: return 50 }; end procedure cc( amount, kinds_of_coins ) if amount = 0 then {return 1} else { if amount < 0 then {return 0} else { return cc( (amount - first_denomination( kinds_of_coins )), kinds_of_coins ) + cc(amount, kinds_of_coins - 1) } } end procedure cc_tail( amount, kinds_of_coins, count ) if amount = 0 then {return count + 1} else { if (amount < 0 | kinds_of_coins = 0) then {return count} else { return cc_tail( (amount - first_denomination(kinds_of_coins)), kinds_of_coins, cc_tail( amount, kinds_of_coins-1, count)) }} end procedure count_change( amount ) return cc_tail( amount, 5, 0 ); end --============_-1320848357==_============ Content-Id: Content-Type: application/mac-binhex40; name="tak.icn" Content-Disposition: attachment; filename="tak.icn" ; modification-date="Mon, 30 Mar 1998 09:42:21 -0600" (This file must be converted with BinHex 4.0) :"h4KDbjTBfi!9%9B9(4dH(3"!!!!!3B!!!!!irG`FQpMC@4eFQ8JE@&TELJJ+3d M)#!JCACPFRNJ)'iJ1MdJ-5"dEb!a-#!JC'm0)#!J)#!J)(GbDA4P)#JQG'PYC5` JG'&V+#!a1#`J-6)X)$BT+6X0C@jN$A"bEf0PC(9bC5"dB@XSH#`JH5`JHLN0)#! J)'PQ)'j[G#"j)$`JH#"dD'9Z$3PbCA0eE(3J1MdJHJdJ)#!JC@acC3d*FQ9cG@a d)$Sp)(4KDbJJG'&V+#!a,AJX)(NX)(ST,#!0#3NJ)#!J)#!JG'&V+#!a,ANX)(S X)(JT,!d*#5!J)#!J)#"dB@XS)$%YHL`JH#`JH5NT1`ebCA4eFQiJFQ9cG@ad1`e PEQ30rKB!!!: --============_-1320848357==_============ Content-Type: text/plain; charset="us-ascii" William B. Clodius Phone: (505) 665-9370 Los Alamos Natl. Lab., NIS-2 FAX: (505) 667-3815 PO Box 1663, MS-C323 Group Off.: 505/667-3422 or 667-5127 Los Alamos, NM 87545 email: wclodius@lanl.gov --============_-1320848357==_============-- From icon-group-sender Thu Apr 2 16:29:14 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id QAA11134 for ; Thu, 2 Apr 1998 16:29:14 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA04449; Thu, 2 Apr 1998 16:29:13 -0700 Date: Thu, 2 Apr 1998 15:24:32 -0700 From: Ralph Griswold Message-Id: <9804022224.AA15016@jupiter.CS.Arizona.EDU> To: icon-group Subject: Icon Newsletter 55 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 112 Icon Newsletter 55 is now available on the Icon Web site: http://www.cs.arizona.edu/icon/inl/inl55/inl55.htm From icon-group-sender Fri Apr 3 17:00:48 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id RAA05527 for ; Fri, 3 Apr 1998 17:00:48 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA06921; Fri, 3 Apr 1998 17:00:47 -0700 To: icon-group@optima.CS.Arizona.EDU Date: Fri, 3 Apr 1998 21:32:20 GMT From: boren@actcom.co.il (Andrei Borenstein) Message-Id: Sender: icon-group-request@optima.CS.Arizona.EDU Subject: Content Analysis using Icon Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 460 Hello, I need to develop a certain text analysis application. I remainded I studied SNOBOL once, began a net research and arrivede here. It seems that it will be suited better for my purposes and I can get a quick results with not much programming effort, once I know "Icon" . Do you know about any content analysis software written in "Icon" ? Could you point it ? Thanks in advance, please answer to my Email - boren@actcom.co.il Andrei Borenstein. From icon-group-sender Fri Apr 3 17:00:56 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id RAA05530 for ; Fri, 3 Apr 1998 17:00:56 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA31227; Fri, 3 Apr 1998 17:00:55 -0700 To: icon-group@optima.CS.Arizona.EDU Date: 3 Apr 1998 22:33:13 GMT From: valliant@hawaii.edu (Robert Valliant) Message-Id: <6g3o39$qn4@news.Hawaii.Edu> Organization: University of Hawaii Sender: icon-group-request@optima.CS.Arizona.EDU References: Subject: Re: Content Analysis using Icon Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 692 I would also be interested in this. In article , Andrei Borenstein wrote: >Hello, > >I need to develop a certain text analysis application. I remainded I >studied SNOBOL once, began a net research and arrivede here. It seems >that it will be suited better for my purposes and I can get a quick >results with not much programming effort, once I know "Icon" . > >Do you know about any content analysis software written in "Icon" ? >Could you point it ? > >Thanks in advance, please answer to my Email - boren@actcom.co.il > >Andrei Borenstein. > > -- Robert Valliant Director, Center for Russia in Asia University of Hawaii at Manoa From icon-group-sender Mon Apr 13 08:35:17 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id IAA00889 for ; Mon, 13 Apr 1998 08:35:17 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA13042; Mon, 13 Apr 1998 08:35:15 -0700 To: icon-group@optima.CS.Arizona.EDU Date: Thu, 09 Apr 1998 08:53:52 -0700 From: Mr Plow Message-Id: <6gir3d$d0d@bgtnsc02.worldnet.att.net> Organization: AT&T WorldNet Services Sender: icon-group-request@optima.CS.Arizona.EDU Subject: Is this language dead? Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 265 I notice the software seems to not have been changed in two years, and no one posts here. Is no one using this lang anymore? I have alot of confusion on what I could/couldnt do with this lang, but It seems theres no where/one to talk to about it? Anyone there? From icon-group-sender Tue Apr 14 08:28:09 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id IAA09422 for ; Tue, 14 Apr 1998 08:28:09 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA13822; Tue, 14 Apr 1998 08:28:07 -0700 To: icon-group@optima.CS.Arizona.EDU Date: 14 Apr 1998 08:15:33 GMT From: rjhare@ucs.ed.ac.uk Message-Id: <6gv5v5$3np@scotsman.ed.ac.uk> Organization: Edinburgh University Sender: icon-group-request@optima.CS.Arizona.EDU References: <6gir3d$d0d@bgtnsc02.worldnet.att.net> Subject: Re: Is this language dead? Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1413 Mr Plow writes: > I notice the software seems to not have been changed in two years, > and no one posts here. Is no one using this lang anymore? > > I have alot of confusion on what I could/couldnt do with this lang, > but It seems theres no where/one to talk to about it? > > Anyone there? I guess you are using the newsgroup. I think most people use the mailing list (I certainly do). Messages to the mailing list don't seem to get transferred to the newsgroup - I don't know why. To subscribe to the mailing list, send a message to icon-group-request@cs.arizona.edu asking to be put on the mailaing list. The UoA home page for Icon is at: http://www.cs.arizona.edu/icon/index.htm There is a lot going on with Icon - the Graphics book is about to be released, a new (maintenance I think) version of the language has just been announced. Icon can be used for just about anything. I have just recently used it for a simple random text generation program, and had just finished playing with a simple genetic algorithm demonstrator when I saw your message. I have also written spreadsheets, databases, text editors, document formatters, etc. - and I am a complete beginner compared with some of the guys who contribute to the mailing list. Roger Hare P.S. You should check your email address - I sent a message to your address (mr-plow@springfield.net) and it was bounced. RH From icon-group-sender Tue Apr 14 08:27:49 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id IAA09396 for ; Tue, 14 Apr 1998 08:27:48 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA14565; Tue, 14 Apr 1998 08:27:47 -0700 Message-Id: X-Sender: mail08621@alterdial.uu.net X-Mailer: QUALCOMM Windows Eudora Pro Version 4.0 Date: Mon, 13 Apr 1998 21:27:15 -0500 To: icon-group@optima.CS.Arizona.EDU From: Jerry Nowlin Subject: Re: Is this language dead? - I think not Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 605 Mr. Plow, I've been using Icon since 1984. I use it every day. There are programs I've written in Icon that I use regularly to format text, generate reports from simple databases, create web pages, handle CGI requests, etc. I get calls on programs I wrote in Icon over 10 years ago that are still used in the company where I work. I'm sure others will chime in with similar stories. Anyone who looks in my bag of tools will see that Icon is well used but hardly worn out. Icon is not dead. Did you have a real question? Jerry Jerry Nowlin - nowlin@nowlin.com - http://www.xnet.com/~nowlin/ From icon-group-sender Tue Apr 14 12:23:20 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id MAA05710 for ; Tue, 14 Apr 1998 12:23:18 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA22318; Tue, 14 Apr 1998 12:23:16 -0700 To: "'Jerry Nowlin'" , "'icon-group@optima.CS.Arizona.EDU'" Message-Id: From: "Hall, Joe T (Joe)" Original-To: "'Jerry Nowlin'" , "'icon-group@optima.CS.Arizona.EDU'" Subject: RE: Is this language dead? - I think not Date: Tue, 14 Apr 1998 12:41:32 -0500 X-Mailer: Microsoft Exchange Server Internet Mail Connector Version 4.0.994.63 Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1523 I've been using Icon for almost as long as Jerry Nowlin. I can't say it's been longer because he's the one who taught me the language. I use Icon all the time across a wide range of computers (maxis, Sun, PC's, etc.). It is still my language of preference. However, I can't very well use Icon in at least one situation where I would really like to. Developing Windows applications is just not easy or complete with the current Windows Icon so I end up slogging my way through Pascal so that I can use the Delphi Development Environment. My dream would be to have the development environment support of Delphi but when I write code I write it in Icon - to me the best of worlds. jth >-----Original Message----- >From: Jerry Nowlin [SMTP:nowlin@nowlin.com] >Sent: Monday, April 13, 1998 9:27 PM >To: icon-group@optima.CS.Arizona.EDU >Subject: Re: Is this language dead? - I think not > >Mr. Plow, > > I've been using Icon since 1984. I use it every day. There are >programs >I've written in Icon that I use regularly to format text, generate >reports >from simple databases, create web pages, handle CGI requests, etc. I >get >calls on programs I wrote in Icon over 10 years ago that are still used >in >the company where I work. I'm sure others will chime in with similar >stories. > >Anyone who looks in my bag of tools will see that Icon is well used but >hardly worn out. Icon is not dead. Did you have a real question? > >Jerry > > >Jerry Nowlin - nowlin@nowlin.com - http://www.xnet.com/~nowlin/ > > > > From icon-group-sender Tue Apr 14 12:22:49 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id MAA05600 for ; Tue, 14 Apr 1998 12:22:49 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA25565; Tue, 14 Apr 1998 12:22:47 -0700 Message-Id: <353383CE.1843@gte.net> Date: Tue, 14 Apr 1998 10:42:06 -0500 From: MJE Reply-To: evans@gte.net Organization: None X-Mailer: Mozilla 3.01 (Win95; I) Mime-Version: 1.0 To: Mr Plow Cc: icon-group@optima.CS.Arizona.EDU Subject: Re: Is this language dead? References: <6gir3d$d0d@bgtnsc02.worldnet.att.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 634 You definitely must subscribe to the mailing list. I would say that the newsgroup *is* dead. It would probably be smart for the owners to cancel the newsgroup if they do not intend to correct the problems with cross-posting. Either that, or post a message every month telling visitors how to subscribe to the mailing list. Mark Mr Plow wrote: > > I notice the software seems to not have been changed in two years, > and no one posts here. Is no one using this lang anymore? > > I have alot of confusion on what I could/couldnt do with this lang, > but It seems theres no where/one to talk to about it? > > Anyone there? From icon-group-sender Tue Apr 14 17:04:23 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id RAA26028 for ; Tue, 14 Apr 1998 17:04:22 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA21927; Tue, 14 Apr 1998 17:04:21 -0700 Date: Tue, 14 Apr 1998 15:13:33 -0500 Message-Id: <199804142013.PAA13292@segfault.cs.utsa.edu> From: Clinton Jeffery To: icon-group@optima.CS.Arizona.EDU Subject: Re: Is this language dead? - I think not Reply-To: jeffery@cs.utsa.edu Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1141 > From: "Hall, Joe T (Joe)" > However, I can't very well use Icon in at least one situation where I > would really like to. Developing Windows applications is just not easy > or complete with the current Windows Icon so I end up slogging my way > through Pascal so that I can use the Delphi Development Environment. Hmmm. Written in less than 700 lines, the Wi program certainly is not a competitor for Delphi. A commercial version of Icon with a nice development environment would be a welcome addition in this group, I suspect. In the meantime, I welcome constructive criticism and feature suggestions for the Wi program by direct e-mail. My own opinion is that the Wi program is successful at introducing Icon to new users, and that it would benefit from full integration with VIB, and a number of other features. Before I work too hard on that, I will first work on making "Wi" run on all Icon graphics platforms, instead of just MS Windows. Clint Jeffery, jeffery@cs.utsa.edu Division of Computer Science, The University of Texas at San Antonio Research http://www.cs.utsa.edu/research/plss.html From icon-group-sender Wed Apr 15 07:58:43 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id HAA15011 for ; Wed, 15 Apr 1998 07:58:42 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA25693; Wed, 15 Apr 1998 07:58:41 -0700 From: DLucido Message-Id: <78201599.35340ec3@aol.com> Date: Tue, 14 Apr 1998 21:34:57 EDT To: icon-group@optima.CS.Arizona.EDU Mime-Version: 1.0 Subject: Tables of records Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Mailer: AOL 3.0 16-bit for Windows sub 86 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 787 I am brand new to Icon (Just got the book this week) and I have been experimenting with some code to test my understanding. While the following is not in any doucumentation I have found, it works. I defined a record and created a table of records with the following code: record node(value,lchild,rchild) procedure main(arg) tree:=table() tree[1]:=node(2,3,"Hello") tree[2]:=node(5,6,"World") tree[3]:=node(0,1,"Oops") every i:=key(tree)do write(i,":",tree[i].rchild) end While the order of the keys in unpredictable, the code can store a table of records. Is this a feature or something that should be avoided? David Lucido dlucido@aol.com From icon-group-sender Wed Apr 15 13:05:27 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id NAA20516 for ; Wed, 15 Apr 1998 13:05:26 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA23516; Wed, 15 Apr 1998 13:05:25 -0700 Posted-Date: Wed, 15 Apr 1998 14:36:36 -0500 (CDT) Message-Id: <3.0.5.32.19980415143501.00a3a330@post.its.mcw.edu> X-Sender: cdt@post.its.mcw.edu X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.5 (32) Date: Wed, 15 Apr 1998 14:35:01 To: DLucido , icon-group@optima.CS.Arizona.EDU From: Chris Tenaglia Subject: Re: Tables of records In-Reply-To: <78201599.35340ec3@aol.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 757 We do this extensively. Even better is that the index of the table does not have to be numeric. It can be string, or set, or anything... Chris. At 09:34 PM 4/14/98 EDT, DLucido wrote: >... >records with the following code: >record node(value,lchild,rchild) > >procedure main(arg) > > tree:=table() > tree[1]:=node(2,3,"Hello") > tree[2]:=node(5,6,"World") > tree[3]:=node(0,1,"Oops") > > every i:=key(tree)do > write(i,":",tree[i].rchild) > >end > >While the order of the keys in unpredictable, the code can store a table of >records. >Is this a feature or something that should be avoided? > > David Lucido > dlucido@aol.com From icon-group-sender Wed Apr 15 13:05:10 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id NAA20498 for ; Wed, 15 Apr 1998 13:05:10 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA27854; Wed, 15 Apr 1998 13:05:08 -0700 Message-Id: X-Mailer: Novell GroupWise 4.1 Date: Wed, 15 Apr 1998 12:52:07 -0600 From: Charles Hethcoat To: icon-group@optima.CS.Arizona.EDU Mime-Version: 1.0 Content-Type: text/plain Content-Disposition: inline Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1575 Clinton Jeffery wrote: >Before I work too hard on that, I will first work on making "Wi" run on all Icon graphics platforms, instead of just MS Windows. I applaud this. There are arguments to the contrary, but my basic inclination is toward breadth (portability) over depth (maximal exploitation of a single hardware platform). Therefore, while a Windows-specific interface would surely be a boon, I would be happiest to see it work on X, Macs, and whatever other windowing systems are extant in addition to Windows, even if I had to give up some Win32 functionality. On a similar topic, I have not been keen about having to learn proprietary stuff like Win32 just in order to bring my brilliant numerical software to the world. I _like_ using standard I/O. I have been asking myself, "how ELSE could I make some basic "gooey" computational tools available to the employees of my company, few of whom seem the least bit interested in typing commands at a shell prompt?" In other words, what I need is an interface between my program's simple I/O and all the windowing systems in the universe. Well, I finally realized that, with a web server and CGI programming skills, I could do just that--and stick with the programming paradigm I already know. All the user needs is the browser and a few plug-ins, and that's already a done deal at my company. Charles L Hethcoat III Senior Engineer, Analysis Department Oceaneering Space Systems, Inc. 16665 Space Center Blvd., Houston, Texas 77058 USA chethcoa@oss.oceaneering.com Voice: 281-228-5568 Fax: 281-488-2027 From icon-group-sender Wed Apr 15 13:04:49 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id NAA20432 for ; Wed, 15 Apr 1998 13:04:44 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA24472; Wed, 15 Apr 1998 13:04:42 -0700 Message-Id: X-Mailer: Novell GroupWise 4.1 Date: Wed, 15 Apr 1998 12:15:58 -0600 From: Charles Hethcoat To: icon-group@optima.CS.Arizona.EDU Subject: Re: Is this language dead? - I think not Mime-Version: 1.0 Content-Type: text/plain Content-Disposition: inline Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1151 Mr Plow writes: > Is no one using this lang [Icon] anymore? Some people are. More should. I currently have the following items under development using Icon: * a 3d graphics library for making clear technical line art * a higher-order scientific calculator with vector primitives and 'literate' input * numerical routines such as adaptive (variable-stepsize) Runge-Kutta integration, matrix and vector math, spline interpolation, and other stuff like that * a bunch of related support libraries and experimental code All of the above amounts to some 10,000 lines, I guess, of Icon source code. I am proceeding slowly, but making progress. (The main problem is that I also have to earn a living.) The eventual idea is to integrate this stuff with LaTeX and PostScript via dvips. I want to make it easy to write one-step self-documenting engineering analysis reports that are even more easily updated (tables, graphics, and all) when the analysis input values change. Just like a spreadsheet, but with decent page layout. I have found that Icon is just about perfect for this sort of programming. Charles Hethcoat From icon-group-sender Wed Apr 15 13:04:21 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id NAA20416 for ; Wed, 15 Apr 1998 13:04:20 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA27990; Wed, 15 Apr 1998 13:04:19 -0700 Date: Wed, 15 Apr 1998 08:11:36 -0700 From: swampler@noao.edu (Steve Wampler) Subject: Re: Tables of records To: icon-group@optima.CS.Arizona.EDU Message-Id: In-Reply-To: <78201599.35340ec3@aol.com> Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1560 DLucido wrote: > I am brand new to Icon (Just got the book this week) and I have been > experimenting > with some code to test my understanding. While the following is not in any > doucumentation I have found, it works. I defined a record and created a table > of > records with the following code: > > record node(value,lchild,rchild) > > procedure main(arg) > > tree:=table() > tree[1]:=node(2,3,"Hello") > tree[2]:=node(5,6,"World") > tree[3]:=node(0,1,"Oops") > > every i:=key(tree)do > write(i,":",tree[i].rchild) > > end > > While the order of the keys in unpredictable, the code can store a table of > records. > Is this a feature or something that should be avoided? > > David Lucido > dlucido@aol.com Any variable in Icon (elements of lists, tables, and sets, as well as record fields, are all variables) can hold any type in Icon. This is very much by design. The only object that only holds a specific type is a character set (cset), which can only hold characters [also by design]. By all means, don't avoid this. The order is unpredictable because tables are really annotated sets, which, like sets in general, are unordered. You can use the sort() function to obtain values (and keys) from a table or set in a predetermined order. -- Steve Wampler - swampler@gemini.edu [Gemini 8m Telescopes Project (under AURA)] The gods that smiled at your birth are now laughing openly. (Fortune Cookie) From icon-group-sender Thu Apr 16 08:22:39 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id IAA03587 for ; Thu, 16 Apr 1998 08:22:39 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA28604; Thu, 16 Apr 1998 08:22:38 -0700 From: gep2@computek.net Date: Wed, 15 Apr 1998 17:28:44 -0500 Message-Id: <199804152228.RAA32189@axp.cmpu.net> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Subject: Windows Icon, portability vs quality To: icon-group@optima.CS.Arizona.EDU X-Mailer: SPRY Mail Version: 04.00.06.17 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 3517 >>Before I work too hard on that, I will first work on making "Wi" run on all Icon graphics platforms, instead of just MS Windows. >I applaud this. >There are arguments to the contrary, but my basic inclination is toward breadth (portability) over depth (maximal exploitation of a single hardware platform). I would concur, other than in this particular case. In this particular case, I think more value would be added to Icon by providing a very enhanced version that runs on the probably 90-95% of the market that is represented by the PC/Windows/NT environment. I would agree if it was an issue of one small niche market (say, Mac) versus another small niche market (say, Sun). Or DEC, or HP, or some other relatively minor architecture. If not having an adequately Windows-appropriate version costs you that ~90% of the market, you won't make up the loss even if you get **everybody** else. Note too that doing a Windows 32-bit version is NOT just a "single hardware platform" either, since presumably it would also run on DEC-Alpha NT (and non-Intel-other-NT) systems as well as the obvious PC/Wintel machines. One might even argue that Cyrix, AMD, and other CPU manufacturers represent a (somewhat-) different "platform"... Or do manufacturers somehow only "count" as worthy of support if they do something nonstandard and proprietary? While portability is nice (all other things being equal), ultimately if I could get my software to run on the 90% of the market represented by NT/Windows95/Windows 3.x computers, I'd very happily leave the rest of the market to someone else. :-) > On a similar topic, I have not been keen about having to learn proprietary stuff like Win32 just in order to bring my brilliant numerical software to the world. Proprietary? Compared to what, Mac? Sun? SGI? DEC? IBM? Fact is that 90-95% of the machines out there (and the best value in hardware, by far) is that platform. If your stuff doesn't run well on that platform (at least), you're basically out of the game. > I _like_ using standard I/O. I do too. And "standard I/O" is absolutely supported within the DOS shell provided on Windows 3.X, Windows 95, and Windows NT (and I believe that's even true for non-Intel NT versions, although I've not tried those personally). > I have been asking myself, "how ELSE could I make some basic "gooey" computational tools available to the employees of my company, few of whom seem the least bit interested in typing commands at a shell prompt?" In other words, what I need is an interface between my program's simple I/O and all the windowing systems in the universe. Frankly, unless it's practical to support "all the windowing systems in the universe" at something more than an unacceptable "least common denominator", I think it makes sense to support the principal one(s). > Well, I finally realized that, with a web server and CGI programming skills, I could do just that--and stick with the programming paradigm I already know. All the user needs is the browser and a few plug-ins, and that's already a done deal at my company. I suppose, but frankly I think that HTML is a *lousy* paradigm for use between a program and a user screen... imprecise, and inefficient as hell... if for no other reason than the fact that you essentially lose the ability to update anything less than an entire screen. Gordon Peterson http://www.computek.net/public/gep2/ Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ From icon-group-sender Thu Apr 16 08:22:31 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id IAA03584 for ; Thu, 16 Apr 1998 08:22:31 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA25812; Thu, 16 Apr 1998 08:22:29 -0700 To: icon-group@optima.CS.Arizona.EDU Date: Wed, 15 Apr 1998 20:48:30 +0100 From: Steve Harborne Message-Id: Organization: Science is only a theory Sender: icon-group-request@optima.CS.Arizona.EDU Subject: Icon & Relational Databases Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 422 We are using Icon in conjunction with an inhouse database. With a view to modernising we would like to use some of the Icon infrastructure we have developed with a commercial rational/object-relational database product. Has anyone had any experience of using Icon with the likes of Oracle, Sybase etc. Grateful for any thoughts or observations Steve Steve Harborne ---------------------------- Science is only a theory From icon-group-sender Thu Apr 16 14:55:54 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id OAA06576 for ; Thu, 16 Apr 1998 14:55:53 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA28494; Thu, 16 Apr 1998 14:55:52 -0700 Message-Id: X-Mailer: Novell GroupWise 4.1 Date: Thu, 16 Apr 1998 16:09:15 -0600 From: Charles Hethcoat To: icon-group@optima.CS.Arizona.EDU Subject: Icon Sims -Reply Mime-Version: 1.0 Content-Type: text/plain Content-Disposition: inline Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 7569 Mark Evans wrote: +I understand why you think that the web is the most convenient cross-platform interface. I suppose I agree with that proposition. Well, it seems there is some disagreement on this point. It IS clumsy and inefficient, but for me, with what I know now, and my circumstances, it looks like the easiest and fastest way to get "on the air" with the minimum assumptions about the user's hardware, software, and situation. + But what makes Icon special for the simulation aspect? I.e. what about numerical programs like Mathematica and MATLAB? They are also cross-platform. Yes. I don't have any problem with them, just little experience. My company doesn't buy stuff on a whim, so I just don't have them. Which is part of the reason I haunt free software venues like this one! I did download Octave (the free MATLAB lookalike) to try it out. But this, as they say, is an Icon mailing list. So I just wanted to point out that Icon has underappreciated potential as a tool for writing small, experimental programs for engineers and scientists. And it is looking pretty http-friendly as well. So I say, "if you are thinking of coding something in C or Fortran or Pascal, do yourself a favor: look at Icon." +Off the top of my head, it would never have dawned on me to do simulations in Icon. Have you been very successful? On a small scale, yes...but I hasten to add I don't do a lot of extremely LARGE simulations. I have seen enough to convince me we have barely scratched the surface of what can be done with Icon in this type of application. Based on what I know now, I would not hesitate to try writing a twenty-degree-of-freedom automobile simulation program in Icon. If I needed to, of course. + Is there anything about the Icon language that makes doing simulations easier than any other? It has all the basic floating point necessities, if not the conveniences, of Fortran. But the facility in handling lists, strings, tables, records, etc. is what makes it really shine. I can easily add identifiers, a cool input notation, and use all kinds of computer science algorithms (sorts, tree and graph searches, etc.) and code all of it without much declarative hassle. You can do this stuff in Fortran and C but it's exhausting. With Icon, it's easy. +Could you outline the nature of your software for me? What does it do? What is it for? What does the user see? +Would you be willing to share your code with me? I might find uses for it and could possibly enhance it. I have to earn a living too, but I work as a consultant and my clients generally let me pick my own tools. My Runge-Kutta stuff is still being debugged. The constant-stepsize version works like a champ. The variable-stepsize version is under construction...I should be trying it out this weekend. It came about because I needed to replace a certain TK Solver program. This program calculates venting of space vehicles, and the attendant pressure differentials, with a view to validating the structural design. It involves solving a nonlinear first-order ordinary differential equation. The TK version works fine. But, and this is a big BUT, it is too hard for casual users to comprehend. I can and do use it, but I would like to post it on our local network for others to use as well. Trouble is, hardly anybody knows TK, and it isn't all that easy to set up. So I want to replace it with a program and a set of instructions that are easy for anybody to deal with. I have been meaning to put some of it in the library and have just been procrastinating. I'll try to speed this up. Here is what vcalc, the vector calculator, does: (BEGINNING OF VCALC INPUT) This is an example of vcalc input. This is a paragraph of ASCII words that will be processed by some kind of document preparation software, say LaTex, when the proper markup is added. But now I just want to show what vcalc does by itself. Vcalc uses RPN ("Shilop") notation, which makes some people go ):?( but makes implementors like me go (|:?=). (Really, RPN is not essential to the idea of vcalc. It's just easy to do.) Multiple paragraphs are separated by blank lines. The '>' character in position 1 introduces a calculation: > 2 a=; 3 b=; 7 c=; > a \sqr > b \sqr \add > c \sqr \add \sqrt L= \print; See how the answer is printed out in-line in the output? That's to leave an audit trail when calculations start getting really rough. Then more ordinary textual material follows. Here is another example: > 2 3 \mul 7 \add \print; Vcalc can also do vectors. For example, what is the moment of force F about point A, if it acts through point B? GIVEN: The force F is > (4.3, 5.7, -0.2) F=; Points A and B are > (0., 0., 0.) A=; and > (1., 1., 3.) B=; REQUIRED: The torque T of F about B. METHOD: The radius vector R is B - A, or: > B A \sub R= \print; The torque is the cross product F x R, or > F R \cross T= \print; And that's really the whole idea. Charles Hethcoat (END OF VCALC INPUT) Now you run this through vcalc and get: (BEGINNING OF VCALC OUTPUT) vcalc: Oceaneering Space Systems' Vector Calculator $Id: vcalc.icn 1.3 1998/02/17 17:02:27 CHETHCOA Exp CHETHCOA $ Run date: Thursday, April 16, 1998 2:45 pm 1 This is an example 2 of vcalc input. This is 3 a paragraph 4 of ASCII words 5 that will be processed 6 by some kind of 7 document preparation 8 software, say LaTex, 9 when the proper markup 10 is added. But now 11 I just want to show what 12 vcalc does by itself. 13 14 Vcalc uses RPN ("Shilop") 15 notation, which makes 16 some people go ):?( 17 but makes implementors 18 like me go (|:?=). 19 (Really, RPN is not 20 essential to the idea of vcalc. 21 It's just easy to do.) 22 23 Multiple paragraphs 24 are separated 25 by blank 26 lines. 27 28 The '>' character in position 1 29 introduces a calculation: 30 31 > 2 a=; 3 b=; 7 c=; 32 > a \sqr 33 > b \sqr \add 34 > c \sqr \add \sqrt L= \print; -----> L = 7.874007874011811 35 36 See how the answer is 37 printed out in-line 38 in the output? That's 39 to leave an audit trail 40 when calculations start 41 getting really rough. 42 43 Then more ordinary 44 textual material 45 follows. 46 47 Here is another example: 48 49 > 2 3 \mul 7 \add \print; -----> = 13 50 51 Vcalc can also do vectors. 52 For example, what is the 53 moment of force F about 54 point A, if it acts through 55 point B? 56 57 GIVEN: 58 59 The force F is 60 > (4.3, 5.7, -0.2) F=; 61 62 Points A and B are 63 > (0., 0., 0.) A=; 64 and 65 > (1., 1., 3.) B=; 66 67 REQUIRED: 68 69 The torque T of F about 70 B. 71 72 METHOD: 73 74 The radius vector R is B - A, or: 75 > B A \sub R= \print; -----> R = (1.0, 1.0, 3.0) 76 77 The torque is the cross product 78 F x R, or 79 > F R \cross T= \print; -----> T = (17.3, -13.1, -1.4) 80 81 And that's really the whole idea. 82 83 Charles Hethcoat (END OF VCALC OUTPUT) Yours, Charlie From icon-group-sender Thu Apr 16 14:55:11 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id OAA06545 for ; Thu, 16 Apr 1998 14:55:10 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA28267; Thu, 16 Apr 1998 14:55:08 -0700 Date: Thu, 16 Apr 1998 09:15:23 -0700 From: kwalker@sfo.harbinger.com (Ken Walker) Message-Id: <199804161615.JAA17878@varda.premenos.com> To: icon-group@optima.CS.Arizona.EDU Subject: Re: Windows Icon, portability vs quality Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Md5: nXW6fe1g00HY2ShyHXNyQw== Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 753 > From gep2@computek.net Thu Apr 16 08:27:57 1998 > ... > > > On a similar topic, I have not been keen about having to learn proprietary > stuff like Win32 just in order to bring my brilliant numerical software to the > world. > > Proprietary? Compared to what, Mac? Sun? SGI? DEC? IBM? > ... > > Gordon Peterson The "Unix" platforms use a POSIX interface to the OS. This is an IEEE standard which is now an international standard. They use an X Windows interface to the windowing system. Someone can correct me if I'm wrong, but I believe the X Windows network protocol is a IETF standard. I'm less sure about the various programming interfaces to X Windows. Ken Walker, kwalker@sfo.harbinger.com Harbinger Coporation, Concord, Ca. 94520 From icon-group-sender Tue Apr 21 08:08:42 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id IAA17059 for ; Tue, 21 Apr 1998 08:08:42 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA03605; Tue, 21 Apr 1998 08:08:40 -0700 To: icon-group@optima.CS.Arizona.EDU Date: Tue, 21 Apr 1998 03:02:04 -0700 From: Mr Plow Message-Id: <6hhqi6$2p9@bgtnsc01.worldnet.att.net> Organization: AT&T WorldNet Services Sender: icon-group-request@optima.CS.Arizona.EDU References: <6gir3d$d0d@bgtnsc02.worldnet.att.net>, Subject: Re: Is this language dead? Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 2974 I did send a request asking to be put in the group and I never got a reply. I sent it probably 4 days ago. I sent it using my regular email program which does have my correct address. Any public posts I place on usenet I use a fake email for, because I dont expect email replys, only group posts. (No need to risk the chance of even one more piece of spam :) Sorry for the confusion. The fake email is a Simpsons allusion. Ill try getting on that list again. If you can add, or anyone reading this can add me to the list, my email is: jebediah AT bigfoot DOT com My main confusion at this point is what Win32 API I am able to use, and how. In particular Registry access, and Common Controls. Will it require a knowledge of C/C++? I've search the web for info on Icon but all I can find is the same cs.arizona.edu info, which I well..., Ive read it all about 20 times : P. I read a bit about the loadfunc() and callout() procedures but until I can actually see then in use with a win32 API type of call, I have no idea what they are talking about. The majority of the documentation seems to be focused on Unix environments. Im sort of shocked, but even alot of the IPL Libraries are unix based, which leaves me confused as to why they are included in the Win32 based version of Icon. Portability maybe, but even then, alot of them have prerequisits of 'unix'. I like the flow of Icon code. The language was easy enough to catch on to with my basic knowledge of programming. (Im mildly familiar with Dos Batch/Basic/Pascal/Javascript and mIRC script (which might not seem to important, but it is very similar in flow/branching/logic to Icon)). I'd love to keep working in ICON, but I just dont want to be limited in what win32 abilities I can make use of. Anyone who can offer me windows specific pointers please do contact me at the address above. I would love to see ms windows focused code. A few good examples of code I would like to see are treelist, listview, and registry access sources. Sadly it appears the only good example I can find is that for WI ide, which has no calls to loadfunc() and callout() Win32 API's. Thanks for the replies, Jeb Oh, an added correction. Many of the functions, and alot of the documentation is dated 2 years ago or before. The version 9.3.1? of the compiler I have is quite new. I stated that wrong before, sorry. David M. Cook wrote: > > On Thu, 09 Apr 1998 08:53:52 -0700, Mr Plow wrote: > > >I notice the software seems to not have been changed in two years, > >and no one posts here. Is no one using this lang anymore? > > >I have alot of confusion on what I could/couldnt do with this lang, > >but It seems theres no where/one to talk to about it? > > I just lurk here because obscure languages are sort of a hobby of mine. > Here are some URLs to check out: > > http://www.cs.arizona.edu/icon/index.htm > http://www.ssc.com/lg/issue27/jeffery.html > > Dave Cook -- From icon-group-sender Tue Apr 21 08:07:14 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id IAA17013 for ; Tue, 21 Apr 1998 08:07:14 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA04191; Tue, 21 Apr 1998 08:07:12 -0700 To: icon-group@optima.CS.Arizona.EDU Date: 18 Apr 98 07:50:40 GMT From: Klaus.Schilling@home.ivm.de Message-Id: <35385b50.0@news.ivm.net> Organization: IVM GmbH Sender: icon-group-request@optima.CS.Arizona.EDU Subject: Icon and termcap/termios Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 237 Is there a way to interface the termcap library and posixed termios calls , or (n)curses which provides about the same functionality, to Icon, for writing charactercell based fullscreen-oriented scripts in Icon? Klaus Schilling From icon-group-sender Tue Apr 21 08:07:36 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id IAA17027 for ; Tue, 21 Apr 1998 08:07:35 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA03689; Tue, 21 Apr 1998 08:07:33 -0700 From: Otfried Geffert Date: Mon, 20 Apr 1998 10:16:58 GMT Message-Id: <19980420.10165821@og-1042.stardiv.de> Subject: Re: Windows Icon, portability vs quality To: kwalker@sfo.harbinger.com (Ken Walker) Cc: icon-group@optima.CS.Arizona.EDU In-Reply-To: <199804161615.JAA17878@varda.premenos.com> References: <199804161615.JAA17878@varda.premenos.com> X-Mailer: Mozilla/3.0 (compatible; StarOffice/4.0; WinNT/Win95) X-Priority: 3 (Normal) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1269 What _really_ counts is not a standard set by a committee, but portable software, for the _main_ platforms, with these priorities 1. NT/WIN95 and=20 2. UN*X (I would prefer that this is 1. but we should not ignore=20 reality.) Otfried >>>>>>>>>>>>>>>>>> Urspr=FCngliche Nachricht <<<<<<<<<<<<<<<<<< Am 4/16/98, 06:15:23 PM, schrieb kwalker@sfo.harbinger.com (Ken=20 Walker) zum Thema Re: Windows Icon, portability vs quality: > > From gep2@computek.net Thu Apr 16 08:27:57 1998 > > ... > > > > > On a similar topic, I have not been keen about having to learn=20= proprietary > > stuff like Win32 just in order to bring my brilliant numerical=20 software to the > > world. =20 > >=20 > > Proprietary? Compared to what, Mac? Sun? SGI? DEC? IBM? > > ... > >=20 > > Gordon Peterson >=20 > The "Unix" platforms use a POSIX interface to the OS. This is an IEEE= > standard which is now an international standard. They use an X Windows= > interface to the windowing system. Someone can correct me if I'm=20 wrong, > but I believe the X Windows network protocol is a IETF standard. I'm=20= less > sure about the various programming interfaces to X Windows.=20 >=20 > Ken Walker, kwalker@sfo.harbinger.com > Harbinger Coporation, Concord, Ca. 94520 >=20 >=20 From icon-group-sender Wed Apr 22 07:53:28 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id HAA03363 for ; Wed, 22 Apr 1998 07:53:28 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA30261; Wed, 22 Apr 1998 07:53:25 -0700 To: icon-group@optima.CS.Arizona.EDU Date: 22 Apr 1998 02:03:02 GMT From: jeffery@cs.utsa.edu (Clinton Jeffery) Message-Id: <6hjj4m$inc@ringer.cs.utsa.edu> Organization: The University of Texas at San Antonio Sender: icon-group-request@optima.CS.Arizona.EDU References: <6gir3d$d0d@bgtnsc02.worldnet.att.net>, , <6hhqi6$2p9@bgtnsc01.worldnet.att.net> Reply-To: jeffery@cs.utsa.edu Subject: Re: Is this language dead? Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 3032 : My main confusion at this point is what Win32 API I am able to use Icon does not provide the Win32 API. It provides a portable API. Some Windows specific facilities (common controls) are available, but generally only those which could be implemented on other platforms. This is free research software where portability is a major emphasis. It should not be surprising that it has a different emphasis than commercial tools, especially those aimed specifically at the Windows market. : Registry access, and Common Controls. Will it require a knowledge of C/C++? Since Win32 is a C API, you will probably need to know C in order to use it from any language that provides access. : I read a bit about the loadfunc() and callout() loadfunc() is a UNIX-centric function; since Windows isn't very UNIX compliant, it will require some effort on the part of a Windows developer to implement this for Windows. I am always looking for volunteers... callout() may be obsoleted by loadfunc(); I don't remember whether it is supported under UNIX Icon any more, but it isn't under Windows. : The majority of the documentation seems to be focused on Unix environments. Yes, Icon is free research software that was developed in a UNIX environment and has been widely ported. Windows Icon has a goal of running just as well as UNIX Icon, and behaving as identically to it as possible. : Im sort of shocked, but even : alot of the IPL Libraries are unix based, which leaves me confused as to : why they are included in the Win32 based version of Icon. Portability : maybe, but even then, alot of them have prerequisits of 'unix'. To taunt you. You should be running Linux, not a Microsoft OS. More seriously, the IPL has many files that are specific to Windows or specific to MS-DOS or some other platform. I don't see a problem with that. I'm sort of shocked by your shock. :-) Some of the UNIX-specific modules might be made to run under Windows; others certainly never will. : I'd love to keep working in ICON, but I just dont want to be limited in : what win32 abilities I can make use of. Sorry, you should use C if you need the full Win32 API. It is gigantic, ugly, and something we wouldn't want in the language. A Windows loadfunc() may get implemented and do what you want someday; I just need a DLL guru to come in and do it for us. : Anyone who can offer me windows specific : pointers please do contact me at the address above. http://segfault.cs.utsa.edu/icon/inlwin.html is an Icon Newsletter article that describes the Windows common controls that are used, as you observe, in the Wi program. I'm sorry that Icon's Windows-native facilities are so spartan when compared with the lower-level languages that have a Microsoft-centric world view. Other native Windows facilities may be added to Icon in the future, when volunteers implement them. -- Clint Jeffery, jeffery@cs.utsa.edu Division of Computer Science, The University of Texas at San Antonio Research http://www.cs.utsa.edu/research/plss.html From icon-group-sender Thu Apr 23 08:57:43 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id IAA28096 for ; Thu, 23 Apr 1998 08:57:42 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA05196; Thu, 23 Apr 1998 08:57:40 -0700 Message-Id: <353EBAE0.2CE0@gte.net> Date: Wed, 22 Apr 1998 22:52:00 -0500 From: MJE Reply-To: evans@gte.net Organization: None X-Mailer: Mozilla 3.01 (Win95; I) Mime-Version: 1.0 To: jeffery@cs.utsa.edu Cc: icon-group@optima.CS.Arizona.EDU, evans@gte.net Subject: Re: Win32 API support for Icon References: <199804230250.VAA10414@segfault.cs.utsa.edu> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1565 Hi Clinton - As usual, you have reminded us that dreaming is not permitted around here because manpower is too low. It's pretty obvious to everyone except the author of the original post that if you want the Windows API, then you must use a Windows compiler. Since he was not aware that Icon was anything but that, his question was reasonable. My point was that it might be nice to make Icon into a callable system so that it does not "own" the process which represents the main application program. Instead, it could offer services to a main program that is written with a Windows compiler. In that scenario, COM is the ideal solution, and you have full access to the Win API from your Windows compiler, and full access to Icon as a COM interface. So I answered the guy's question with a dream of my own, OK? Another way to achieve the same end would be the famous C++ source code generator which I discussed in earlier posts. That would also give you all of Icon and all of Windows API. Icon is great for one-off freebie type programs, but I can't see it pulling heavy duty until it is interfaced in some form or fashion to real compilers. Let us dreamers dream. One day I might wander down to your office with a business plan. :-) As for COM, it is something that Microsoft wishes it had done a long time ago. Much of the Windows OS is now put together with COM. I'm not entirely clear whether that means we now have new, clean API's for Windows that are beter than the klunky old SDK. I'm still learning about it myself. Best regards, Mark From icon-group-sender Thu Apr 23 08:55:57 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id IAA28064 for ; Thu, 23 Apr 1998 08:55:57 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA04922; Thu, 23 Apr 1998 08:55:54 -0700 Message-Id: <353E1EF9.21F9@gte.net> Date: Wed, 22 Apr 1998 11:46:49 -0500 From: MJE Reply-To: evans@gte.net Organization: None X-Mailer: Mozilla 3.01 (Win95; I) Mime-Version: 1.0 To: jeffery@cs.utsa.edu Cc: icon-group@optima.CS.Arizona.EDU, evans@gte.net Subject: Re: Is this language dead? References: <6gir3d$d0d@bgtnsc02.worldnet.att.net>, , <6hhqi6$2p9@bgtnsc01.worldnet.att.net> <6hjj4m$inc@ringer.cs.utsa.edu> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 2173 > > Sorry, you should use C if you need the full Win32 API. It is gigantic, > ugly, and something we wouldn't want in the language. A Windows loadfunc() > may get implemented and do what you want someday; I just need a DLL guru > to come in and do it for us. Three comments: (1) Ugly barely begins to describe the Win32 API. What a royal mess it is. I recently told a colleague that I was not happy with my C++ design because it had to be tacked on to the side of our C++ framework. "Well," he said, "the Windows SDK is tacked onto the side of the Windows SDK." (2) Stop talking about DLL's! You don't want to use DLL's as such, but Component Object Model (COM) interfaces. COM objects solve all the problems associated with DLL's. Good online articles are at http://www.microsoft.com/oledev/olecom/aboutole.htm http://www.microsoft.com/oledev/olecom/com_modl.htm and an excellent, basic book on the topic is described at http://mspress.microsoft.com/prod/books/19.htm This book is very well-written and a good starting point for the uninitiated. It does not bog you down with the full weight of OLE2 or ActiveX or ATL; it just describes COM. It holds you by the hand until you understand. Under COM, the main program does not need to know which physical file holds the COM code with which it wants to link at run time. The operating system handles those details invisibly. The interesting aspect of COM is that it is already being ported to Unix by Software AG and has already been ported to the Mac. COM is not inherently a Windows-only API. Finally, Microsoft has done something right. COM also maps closely to C++ although it is a language-independent standard. (3) A different way to approach the problem is to make Icon itself into a COM object that is callable from external C++ code. I don't have many concrete ideas on how to do it. You could have the interpreter swallow a whole Icon program file as one COM interface, or have it accept individual command lines as another. I like the idea of having a COM Icon library that provides Icon-specific services to external code, such as string scanning. Best regards, Mark Evans From icon-group-sender Thu Apr 23 08:57:12 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id IAA28077 for ; Thu, 23 Apr 1998 08:57:12 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA04646; Thu, 23 Apr 1998 08:57:09 -0700 Date: Wed, 22 Apr 1998 21:50:34 -0500 Message-Id: <199804230250.VAA10414@segfault.cs.utsa.edu> From: Clinton Jeffery To: evans@gte.net Cc: icon-group@optima.CS.Arizona.EDU, evans@gte.net In-Reply-To: <353E1EF9.21F9@gte.net> (message from MJE on Wed, 22 Apr 1998 11:46:49 -0500) Subject: Win32 API support for Icon Reply-To: jeffery@cs.utsa.edu Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1301 > [Mark Evans made 3 interesting comments about Win32 API support for Icon] > (2) Stop talking about DLL's! You don't want to use DLL's as such, but > Component Object Model (COM) interfaces. While I agree that adding a COM interface for Icon might be as important or more important than a DLL interface, none of the articles I have read on it have indicated that there was a COM object that encapsulates the Win32 API, which is what the person that started this thread was asking for. If anyone has a more specific pointer to information that shows that all of the standard Windows API's (which are shipped as .DLL's) are available via COM/OLE, I'd appreciate your sharing it. Otherwise I would assume Mark is saying we need BOTH DLL and COM interfaces. Ya sure and ya betcha. I believe Microsoft has made and continues to make Windows programming as difficult as possible in order to acquire and retain their applications monopoly. So we need ODBC, MAPI, ISAPI, and a couple dozen other API's if we want Icon to be as good for Windows programming as MS compilers are. This sounds like it calls for a commercial product effort. Clint Jeffery, jeffery@cs.utsa.edu Division of Computer Science, The University of Texas at San Antonio Research http://www.cs.utsa.edu/research/plss.html From icon-group-sender Thu Apr 23 19:05:21 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id TAA28735 for ; Thu, 23 Apr 1998 19:05:20 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA05621; Thu, 23 Apr 1998 19:05:18 -0700 From: gep2@computek.net Date: Thu, 23 Apr 1998 13:09:01 -0500 Message-Id: <199804231809.NAA31088@axp.cmpu.net> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Subject: Win32 API support for Icon To: icon-group@optima.CS.Arizona.EDU X-Mailer: SPRY Mail Version: 04.00.06.17 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1912 > I believe Microsoft has made and continues to make Windows programming as difficult as possible in order to acquire and retain their applications monopoly. Oh, I don't think it's really any more than just what it takes to program for a GUI... Mac programming, I would think, is not a whole lot easier. Sure, it's (a lot!?) harder to program for a GUI... but the bottom line is that that's the kind of stuff the market demands, and with more and more high-level features being needed (wanted?) by applications (device independence, communications, seamless Internet access, embeddable full-featured spreadsheet and word processing objects, etc etc.) it's only going to eventually get further and further that way. The truth is that I avoid that whereever possible (I think it's perfectly alright to run a DOS application in a DOS window under Win95 or even NT) but not every application can be done that way. I lament, like most of us, the vanishing joy of tight, efficient, assembler coding where you literally have the machine at the level of the bare silicon. But few customers are willing to pay anymore what it costs to do things that way, and one can't really very well argue that they're wrong. If Microsoft really wanted an "application monopoly" then they wouldn't have produced things like Visual BASIC (which, judging by the quality of what one sees on the market, can be programmed by nearly anybody). And tools like Delphi and the like wouldn't exist. I don't see at is a "big, evil plot" but more the natural progression of things in this industry. The trade rags with their "feature checklists" are in part to blame, too... encouraging bloat as developers try to make sure that their product won't look 'feature poor' next to the competition. Gordon Peterson http://www.computek.net/public/gep2/ Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ From icon-group-sender Thu Apr 23 19:05:43 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id TAA28738 for ; Thu, 23 Apr 1998 19:05:42 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA06383; Thu, 23 Apr 1998 19:05:40 -0700 Message-Id: <353F9415.83BD5C5B@globalnet.co.uk> Date: Thu, 23 Apr 1998 20:18:45 +0100 From: Derek Paul Freeman-Jones X-Mailer: Mozilla 4.01 [en] (Win95; I) Mime-Version: 1.0 To: icon-group@optima.CS.Arizona.EDU Subject: Using icon pipe features X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 437 icon-group, I need to extend the functionality of the procedure 'open' when running a process eg. pipe_in := open ( "/usr/bin/ls", "p" ) at present the process can only be opened for reading OR writing. Has anyone done any development work on enabling the process to be BOTH written to and read from? I don't if I have to write a new procedure to plug in to Icon 'popen' for example. Many thanks in advance. Derek Freeman-Jones From icon-group-sender Mon Apr 27 08:08:52 1998 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id IAA18074 for ; Mon, 27 Apr 1998 08:08:51 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA07851; Mon, 27 Apr 1998 08:08:49 -0700 Message-Id: <199804241634.JAA26553@optima.cs.arizona.edu> From: "Den Za Dnjom" To: Subject: Icon, program for words frequency count Date: Fri, 24 Apr 1998 19:24:15 +0300 X-Msmail-Priority: Normal X-Priority: 3 X-Mailer: Microsoft Internet Mail 4.70.1155 Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_01BD6FB6.91F7A960" Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 32424 This is a multi-part message in MIME format. ------=_NextPart_000_01BD6FB6.91F7A960 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit icon-group@cs.arizona.edu University of Arizona Department of Computer Science Ralph E. Griswold Sergey V. Logichev Snezhinsk (Chelyabinsk-70) Russia DEAR SIR, I'd like to express my gratitude to you and all the developers of Icon project for such a wondeful programing language. First I have written to you at 1991, when i read about the Icon in PC World magazine. That time you have kindly sent to me the necessary materials and the disks with Icon version 8. Unfortunately, the circumstances of life in Russia did not allow me to master Icon in full extent. It was necessary to survive and not to enjoy programming as "mind games". Although currently the life did not settle up, but it has greately changed in terms of openness and the oportunities for contacts. I'm a programer in Russian Federal Nuclear Center at Snezhinsk, where people were busy with nuclear weapon development (similarly to Livermore Lab in USA). Now American and other foreign colleagues visit us and I have the opportunity of limited access to Internet, where from I could download the last version of Icon for MS-DOS/WIN. In September 97 I have visited with my colleagues Albuquerue, New-Mexico, where we were invited by Sandia Labs. The place and the people there are really enchanting. We were performinmg the contract with Sandia Labs and that's why I could order your book on Icon and it is permanently on my table and I became an Icon advocate. I'm dealing with development of infromational systems and therefore I have to perform the routine processing of symbolic information, viz. to convert the formates. Icon helps here very much. Moreover, now I can deal with many other interesting research tasks. My friend-linguist is fond of lexical processing of artistic texts of Russian poets of beginning of our century. Together with him we have implemented the idea of compiling the frequency dictionaries using the program, written by me in Icon. It's sources and descriptions I attach to this letter (files wt16_015.icn for DOS texts and wt32_015.icn for windows texts and .htm format). I hope you'll like the program and it will be possible to include it in Program Library. Currently the program runs only from MS-DOS prompt, but in my plans for the future there is a development of graphic interface using the version of Icon for MS Windows. Besides, I have the idea of writting the generator of algebra expressions of specific complexity to write the problems to check school children (I have a son of 14 and a girl of 9, and very little time for additional training for them). And in general the plans evolve alongside with acquiring the appropriate experience. Finally I'd like to ask you 3 questions: 1) Is it possible to make calls to external C functions from Icon's code or is it possible possible only in Unix version? 2) Is it possible to read the binary file, containg such a bad symbol as EOF (\x1a). The example of such a file is a MS Word for Windows document. 3) How can I sort the table or the list using several keys simultaneously. For example, I have a taqble of frequency of words occurrence in the text and I need a list of words, sorted by frequency and alphabet simultaneously. If you find the possibility to answer my questions, please send your response by e-mail address women@pop.snz.ru with a note "for Sergey Logichev", as, unfortunately, I do not have a personal address for correspondence. Best wishes, Sergey Logichev ------=_NextPart_000_01BD6FB6.91F7A960 Content-Type: application/octet-stream; name="Wt16_015.icn" Content-Transfer-Encoding: quoted-printable Content-Description: Wt16_015.icn (ICN File) Content-Disposition: attachment; filename="Wt16_015.icn" #########################################################################= ### # Name: wt.icn # Title: Tabulator of words/word-phrases in symbolic texts # Author: Sergey V. Logichev (grateful to Ralph E. Griswold) # Date: November 1997-April 1998 # Compiler: Icon v9.3 for MS-DOS #########################################################################= ### # # Program WT intended for frequency analysis of words, word phrases # or syntagmas (sentences) in symbolic texts. There are some = definitions: # # 1) Word is defined as a sequence of letters, probably with including = of # symbols hyphen (-) and apostrophe ('). Word always begins from a = letter. # For example: state-of-art, Smith's, O'Henry. Definition of the = word # may be extended by means of a set of additional symbols (option = -e). # However sequence "30sec" never will be a word for the program, # because first symbol is not a letter. # 2) Word-phrase is defined as a sequence of a number of words in # syntagma. For example: "once upon a time" (dimension 4). # 3) Syntagma is defined as any not null sequence of symbols, that # begins from a letter and bounded at right by delimiter from a set # {.,!?:;+=3D()[]/"<>}. The delimiter is not included in a syntagma. # Set of syntagma's delimiters may be redefined by means of option = -d. # Words in syntagma is divided by white spaces. A syntagma may = include # and only word. Syntagma analysis is defined by means of option = -w0. # # There are some non-trivial features of the program. # # Options -f and -x may be used for executing of operations # of subtraction and intersection for the texts. # 1) Operation of subtraction executes on default. If command line # includes option -f for input texts and option -x for texts with # excluded words, then program output all words without excluded = words. # For example: wt -f*.txt -x*.exl will output all words in files = *.txt # without words in files *.exl. # 2) Operation of intersection executes if option -x is defined as # -x+. For example: wt -f*.txt -x+*.exl output list of # common words in files *.txt and *.exl. # # Excluded words may be wrote in files at any form (through white space, # colon or any delimiter). At common case it is a ordinary text. # Excluded words may be wrote as a symbolic masks (templates). # By means of that a needed volume of output list may be defined. # For example, if we write in file w.exl line # i* c* o* n* x* # and run wt with next options # wt -f*.txt -x+w.exl -i # we will get index of words on letters "i","c","o","n" and "x". # # Masking symbols "*" and "_" is used for a masks. # Symbol "*" defines any sequence of symbols (maybe, null). # Symbol "_" defines anyone not null symbol. # The mask may include any number of masking symbols. # Such meaningless masks as "_*", "*_" or "*" and their # derivatives are ignored. # Masking may be turned off, if eset (option -e) # is defined with symbols '*' or '_'. # # Examples of the masks: # *load*g satisfy to words overloading, loading ...; # ___il* satisfy to words unwill, devil, Mozilla ...; # w__ satisfy to any 3-letters words beginning on "w"; # # If mask (-m) is defined for word-phrases, masking is processed # for first word of phrase only. # For example, wt -f*.icn -mprocedure -w2 # will produce list of all icon procedures. # # Note. # For long filenames (DOS 7) this program must be compiled by Win32 # Icon compiler developed by Clinton Jeffery from Texas University. # #########################################################################= ### link options global limit, icase, abc, eset, sset, cucase, clcase global xwords, xmasks global delims, path, wmask global wintext, winCP, dosCP procedure main(args) local wcount, order, s, maxl, opts, i, countw, totalw, nn local xfile, file, f, output, wf local recursive, fmask, wn, w # expand alphabet with cyrillic symbols (CP 866) cucase :=3D &ucase clcase :=3D &lcase every i :=3D 128 to 159 do cucase ++:=3D char(i) every i :=3D 160 to 175 do clcase ++:=3D char(i) every i :=3D 224 to 239 do clcase ++:=3D char(i) abc :=3D &letters ++ cucase ++ clcase sset :=3D '-\'' # symbols banned at right of = word recursive :=3D 0 path :=3D "" # define translation tables for windows/dos cp (for Cyrillic only) winCP :=3D dosCP :=3D '' every i :=3D 128 to 175 do ## first part of table CP = 866 (DOS) dosCP ++:=3D char(i) every i :=3D 224 to 239 do ## second part of table CP = 866 dosCP ++:=3D char(i) every i :=3D 192 to 255 do ## table CP 1251 (WIN) winCP ++:=3D char(i) opts :=3D options(args,"-win!s+t+c+ird:e:f:m:l+o:x:w+") if *opts =3D 0 then { write(" WordTabulator v.015.1 -- Tabulator of words/word-phrases in = the texts") write(" (c) by Sergey V. Logichev, 09.04.98 MS-DOS = Icon 9.3") write("") write(" Usage: wt [@pfile] [-option] [[-option] ...] ") write("Example: wt -s1 -t5 -e0123456789 -r -x*.exl -f*.txt = -owords.lst") write("") write(" Options:") write(" -s Define sorting method for output word's list:") write(" 1 - alphabetical (default); 2 - on descending = frequency.") write(" -c Limit length of output list to n words.") write(" -t Define threshold frequency for the words (default = 1).") write(" -i Ignoring the case of the words.") write(" -l Define minimum length of the words (default 1).") write(" -w Define dimension of processed word-phrases (default = 1).") write(" -e{set} Define extended alphabetic symbols, enabled in the = words.") write(" -d{set} Define syntagma's delimiters, default = {.,!?:;+=3D()[]/\"<>}.") write(" -f Define file(s) with input texts, for example: = -fc:\*.txt") write(" -x Define file(s) with excluded words, for example: = -xc:\*.exl") write(" -r Define recursive search of files in subdirectories.") write(" -win Processing cyrillic texts for Windows codepage = (win1251).") write(" -m Define search template for words, for example: = -m*load*") write(" -o Define file for output word's list.") exit() } order:=3D \opts["s"] | 1 # method for sort = (alphabetical default) if not order =3D (0|1|2) then stop("Error -- invalid value of option = -s") threshold :=3D \opts["t"] | 1 # threshold for word frequency nn :=3D \opts["c"] | 99999999 # limit items in output list if threshold < 0 then stop("Error -- value of option -t must be = positive") if \opts["i"] then icase :=3D 1 # UPPERCASE =3D=3D=3D = lowercase limit :=3D \opts["l"] | 1 # minimum length of the word if limit < 1 then stop("Error -- value of option -l must be = positive") wn :=3D \opts["w"] | 1 # size of word phrase if wn < 0 then stop("Error -- value of option -w must be positive") eset :=3D \opts["e"]++sset | sset # extended symbols for abc delims :=3D '.,!?:;+=3D()[]/"<>'--eset # delimiters for syntagma delims :=3D \opts["d"] | delims fmask :=3D \opts["f"] | "" # input file(s) xfile :=3D \opts["x"] | "" # file(s) with excluded words wmask :=3D \opts["m"] | "*" # mask for processed words output :=3D \opts["o"] | "" # output file if *output > 0 then wf :=3D open(output,"w") | stop("Can't open output file: ",output) else wf :=3D "" if \opts["r"] then recursive :=3D 1 # subdirectories search if \opts["win"] then wintext :=3D 1 # Windows codepage for = cyrillic xwords :=3D set([]) # set of word exclusions xmasks :=3D set([]) # set of mask exclusions xmode :=3D 0 # 0 - subtraction of = exclusions # 1 - intersection with exclusions if xfile[1] =3D=3D "+" then { xmode :=3D 1; xfile[1] :=3D "" } if *xfile > 0 then # generate set of eXcluded words { every file :=3D getfiles(xfile) do { if recursive =3D 0 & getpath(file) ~=3D=3D path then next if f :=3D open(file,"r") then { write("-",file) every s :=3D syntagmas(f,1) do { every w :=3D wphrases(s,wn,abc++'*_') do { if (not upto('*_',eset)) & w :=3D ifmask(w) then insert(xmasks,w) else insert(xwords,w) } } close(f) } else write("-",file," *** Open error ***") } } wcount :=3D table(0) # table of words every file :=3D getfiles(fmask) do { if recursive =3D 0 & getpath(file) ~=3D=3D path then next if (f :=3D open(file,"r")) | (*file =3D 0) then { if *file >0 then write("+",file) every s :=3D syntagmas(f,wn) do { every wcount[wphrases(s,wn,abc)] -:=3D 1 } if *file > 0 then close(f) } else write("+",file," *** Open error ***") } eXtract(wcount,xmode) # extract exclusions wcount :=3D getlist(wcount,order) # generate output list of words totalw :=3D countw :=3D 0 # word counters while s :=3D get(wcount) & (countw < nn) do { f :=3D -1*get(wcount) if f >=3D threshold then { totalw :=3D totalw + f countw +:=3D 1 write(wf,left(f,5), s) } } case wn of { 0 : s :=3D "syntagmas" 1 : s :=3D "words" default : s :=3D "word-phrases" } write(wf,"Different "||s||": ",countw) write(wf," Total "||s||": ",totalw) if *output > 0 then close(wf) end # generate all syntagmas (sentences) from the text procedure syntagmas(f,wn) local line, s, ss s :=3D "" while line :=3D read(f) do { if \wintext then line :=3D WINtoDOS(line) if \icase then line :=3D map(line,cucase,clcase) if wn =3D 1 then { suspend line; next } line ? while tab(upto(abc)) do { if ss :=3D tab(upto(delims)) then { suspend s||ss; s :=3D "" } else s :=3D s || trim(tab(0),' ') || " " } } return s end # generate all words or word-phrases from the syntagma s # wn - dimension of word-phrase (number of words); procedure wphrases(s,wn,alphabet) local w, ww, i, n ww :=3D list() # generate all words from s and put them into work list every put(ww, words(s,alphabet)) if wn =3D 0 then n :=3D *ww else n :=3D wn while *ww >=3D n & w :=3D get(ww) do # get next word { if not valid(wmask,w) then next i :=3D 1 while i < n do { w :=3D w || " " || ww[i] # concatenate a word-phrase i +:=3D 1 } if i =3D n then suspend w } end # extract exlusions from table of words procedure eXtract(T,xmode) local w every w :=3D key(T) do { if memberX(w) ~=3D xmode then delete(T,w) } end # get all valid words from syntagma s procedure words(s,alphabet) local w s ? while tab(upto(alphabet)) do { w :=3D trim(tab(many(alphabet++eset)),sset) if *w >=3D limit then suspend w } end # verify meaning of the mask procedure ifmask(w) local s s :=3D w if not upto('*_',s) then fail # w is not a mask s ? while tab(find("_*")) do { s[&pos] :=3D "*"; move(2) } s ? while tab(find("*_")) do { s[&pos+1] :=3D "*"; move(2) } if *(trim(s,'*')) =3D 0 then fail # meaningless or blank mask return s end # generate list of MS-DOS files for given filemask procedure getfiles(fmask) local tmpfile, f if *fmask =3D 0 then { suspend "" fail } tmpfile :=3D (getenv("TEMP" | "TMP") | "c:")||"\\tmp$file.$$$" system("dir /a-d /oN /s /b "||fmask||" >"||tmpfile) f :=3D open(tmpfile,"r") path :=3D getpath(read(f)) seek(f,1) while filename :=3D read(f) | { close(f) system("erase "||tmpfile) fail } do suspend filename end # get pathname from file specification procedure getpath(filespec) local p if *filespec =3D 0 then return "" reverse(filespec) ? { tab(upto('\\')) p :=3D tab(0) } return(reverse(p)) end # convert Table of words to List procedure getlist(T,order) local L, item L :=3D [] if order =3D 0 then { every item :=3D key(T) do { put(L,item); put(L,T[item]) } return L } else return sort(T,order+2) # make sorting end # translate string from Windows cp (1251) to DOS cp (866) # (for cyrillic texts only) procedure WINtoDOS(line) local s s :=3D "" line ? until pos(0) do { if s :=3D s || tab(find("\\'")) then s :=3D s || hexchar(move(4)) else s :=3D s || tab(0) } return map(s,winCP,dosCP) end # generate character from it's hex code \'xx # (for cyrillic texts only) procedure hexchar(s) local i, hex hex :=3D "0123456789abcdef" s :=3D map(s,&ucase,&lcase) i :=3D (find(s[3],hex)-1)*16 + (find(s[4],hex)-1) return char(\i) | "" end # verify membership of the word to excluded words procedure memberX(w) local mask if member(xwords,w) then return 1 every mask :=3D !xmasks do { if valid(mask,w) then return 1 } return 0 end # verify string s on symbolic mask (search template) procedure valid(mask,s) local i, a, q, cmask, w if *(trim(mask,'*')) =3D 0 then return s w :=3D s mask ? repeat { q :=3D a :=3D 0 if =3D"*" then { tab(many('*')) a :=3D 1 } if =3D"_" then { q :=3D 1 q +:=3D *(tab(many('_'))) tab(upto(abc++eset++' ')) } cmask :=3D tab(many(abc++eset++' ')) | "" if *cmask =3D 0 then { if (a =3D 1 & *w >=3D q) then break else if (a =3D 0 & *w =3D q) then break else fail } i :=3D 0 if upto('*_') then i :=3D find(cmask,w) else every i :=3D find(cmask,w) if (a =3D 1 & i < q+1) then fail else if (a=3D 0 & i ~=3D q+1) then fail w :=3D w[i+ *cmask:0] } return s end=1A ------=_NextPart_000_01BD6FB6.91F7A960 Content-Type: application/octet-stream; name="Wt32_015.icn" Content-Transfer-Encoding: quoted-printable Content-Description: Wt32_015.icn (ICN File) Content-Disposition: attachment; filename="Wt32_015.icn" #########################################################################= ### # Name: wt.icn # Title: Tabulator of words/word-phrases in symbolic texts # Author: Sergey V. Logichev (grateful to Ralph E. Griswold) # Date: November 1997-April 1998 # Compiler: Icon v9.3.1 for MS Windows #########################################################################= ### # # Program WT intended for frequency analysis of words, word phrases # or syntagmas (sentences) in symbolic texts. There are some = definitions: # # 1) Word is defined as a sequence of letters, probably with including = of # symbols hyphen (-) and apostrophe ('). Word always begins from a = letter. # For example: state-of-art, Smith's, O'Henry. Definition of the = word # may be extended by means of a set of additional symbols (option = -e). # However sequence "30sec" never will be a word for the program, # because first symbol is not a letter. # 2) Word-phrase is defined as a sequence of a number of words in # syntagma. For example: "once upon a time" (dimension 4). # 3) Syntagma is defined as any not null sequence of symbols, that # begins from a letter and bounded at right by delimiter from a set # {.,!?:;+=3D()[]/"<>}. The delimiter is not included in a syntagma. # Set of syntagma's delimiters may be redefined by means of option = -d. # Words in syntagma is divided by white spaces. A syntagma may = include # and only word. Syntagma analysis is defined by means of option = -w0. # # There are some non-trivial features of the program. # # Options -f and -x may be used for executing of operations # of subtraction and intersection for the texts. # 1) Operation of subtraction executes on default. If command line # includes option -f for input texts and option -x for texts with # excluded words, then program output all words without excluded = words. # For example: wt -f*.txt -x*.exl will output all words in files = *.txt # without words in files *.exl. # 2) Operation of intersection executes if option -x is defined as # -x+. For example: wt -f*.txt -x+*.exl output list of # common words in files *.txt and *.exl. # # Excluded words may be wrote in files at any form (through white space, # colon or any delimiter). At common case it is a ordinary text. # Excluded words may be wrote as a symbolic masks (templates). # By means of that a needed volume of output list may be defined. # For example, if we write in file w.exl line # i* c* o* n* x* # and run wt with next options # wt -f*.txt -x+w.exl -i # we will get index of words on letters "i","c","o","n" and "x". # # Masking symbols "*" and "_" is used for a masks. # Symbol "*" defines any sequence of symbols (maybe, null). # Symbol "_" defines anyone not null symbol. # The mask may include any number of masking symbols. # Such meaningless masks as "_*", "*_" or "*" and their # derivatives are ignored. # Masking may be turned off, if eset (option -e) # is defined with symbols '*' or '_'. # # Examples of the masks: # *load*g satisfy to words overloading, loading ...; # ___il* satisfy to words unwill, devil, Mozilla ...; # w__ satisfy to any 3-letters words beginning on "w"; # # If mask (-m) is defined for word-phrases, masking is processed # for first word of phrase only. # For example, wt -f*.icn -mprocedure -w2 # will produce list of all icon procedures. # # Note. # For long filenames (DOS 7) this program must be compiled by Win32 # Icon compiler developed by Clinton Jeffery from Texas University. # #########################################################################= ### link options global limit, icase, abc, eset, sset, cucase, clcase global xwords, xmasks global delims, path, wmask global wintext, winCP, dosCP procedure main(args) local wcount, order, s, maxl, opts, i, countw, totalw, nn local xfile, file, f, output, wf local recursive, fmask, wn, w # expand alphabet with cyrillic symbols (CP 866) cucase :=3D &ucase clcase :=3D &lcase every i :=3D 128 to 159 do cucase ++:=3D char(i) every i :=3D 160 to 175 do clcase ++:=3D char(i) every i :=3D 224 to 239 do clcase ++:=3D char(i) abc :=3D &letters ++ cucase ++ clcase sset :=3D '-\'' # symbols banned at right of = word recursive :=3D 0 path :=3D "" # define translation tables for windows/dos cp (for Cyrillic only) winCP :=3D dosCP :=3D '' every i :=3D 128 to 175 do ## first part of table CP = 866 (DOS) dosCP ++:=3D char(i) every i :=3D 224 to 239 do ## second part of table CP = 866 dosCP ++:=3D char(i) every i :=3D 192 to 255 do ## table CP 1251 (WIN) winCP ++:=3D char(i) opts :=3D options(args,"-win!s+t+c+ird:e:f:m:l+o:x:w+") if *opts =3D 0 then { write(" WordTabulator v.015.2 -- Tabulator of words/word-phrases in = the texts") write(" (c) by Sergey V. Logichev, 13.04.98 Win32 = Icon 9.3.1") write("") write(" Usage: wt [@pfile] [-option] [[-option] ...] ") write("Example: wt -s1 -t5 -e0123456789 -r -x*.exl -f*.txt = -owords.lst") write("") write(" Options:") write(" -s Define sorting method for output word's list:") write(" 1 - alphabetical (default); 2 - on descending = frequency.") write(" -c Limit length of output list to n words.") write(" -t Define threshold frequency for the words (default = 1).") write(" -i Ignoring the case of the words.") write(" -l Define minimum length of the words (default 1).") write(" -w Define dimension of processed word-phrases (default = 1).") write(" -e{set} Define extended alphabetic symbols, enabled in the = words.") write(" -d{set} Define syntagma's delimiters, default = {.,!?:;+=3D()[]/\"<>}.") write(" -f Define file(s) with input texts, for example: = -fc:\*.txt") write(" -x Define file(s) with excluded words, for example: = -xc:\*.exl") write(" -r Define recursive search of files in subdirectories.") write(" -win Processing cyrillic texts for Windows codepage = (win1251).") write(" -m Define search template for words, for example: = -m*load*") write(" -o Define file for output word's list.") exit() } order:=3D \opts["s"] | 1 # method for sort = (alphabetical default) if not order =3D (0|1|2) then stop("Error -- invalid value of option = -s") threshold :=3D \opts["t"] | 1 # threshold for word frequency nn :=3D \opts["c"] | 99999999 # limit items in output list if threshold < 0 then stop("Error -- value of option -t must be = positive") if \opts["i"] then icase :=3D 1 # UPPERCASE =3D=3D=3D = lowercase limit :=3D \opts["l"] | 1 # minimum length of the word if limit < 1 then stop("Error -- value of option -l must be = positive") wn :=3D \opts["w"] | 1 # size of word phrase if wn < 0 then stop("Error -- value of option -w must be positive") eset :=3D \opts["e"]++sset | sset # extended symbols for abc delims :=3D '.,!?:;+=3D()[]/"<>'--eset # delimiters for syntagma delims :=3D \opts["d"] | delims fmask :=3D \opts["f"] | "" # input file(s) xfile :=3D \opts["x"] | "" # file(s) with excluded words wmask :=3D \opts["m"] | "*" # mask for processed words output :=3D \opts["o"] | "" # output file if *output > 0 then wf :=3D open(output,"w") | stop("Can't open output file: ",output) else wf :=3D "" if \opts["r"] then recursive :=3D 1 # subdirectories search if \opts["win"] then wintext :=3D 1 # Windows codepage for = cyrillic wmask :=3D map(wmask,winCP,dosCP) xwords :=3D set([]) # set of word exclusions xmasks :=3D set([]) # set of mask exclusions xmode :=3D 0 # 0 - subtraction of = exclusions # 1 - intersection with exclusions if xfile[1] =3D=3D "+" then { xmode :=3D 1; xfile[1] :=3D "" } if *xfile > 0 then # generate set of eXcluded words { every file :=3D getfiles(xfile) do { if recursive =3D 0 & getpath(file) ~=3D=3D path then next if f :=3D open(map(file,dosCP,winCP),"r") then { write("-",file) every s :=3D syntagmas(f,1) do { every w :=3D wphrases(s,wn,abc++'*_') do { if (not upto('*_',eset)) & w :=3D ifmask(w) then insert(xmasks,w) else insert(xwords,w) } } close(f) } else write("-",file," *** Open error ***") } } wcount :=3D table(0) # table of words every file :=3D getfiles(fmask) do { if recursive =3D 0 & getpath(file) ~=3D=3D path then next if (f :=3D open(map(file,dosCP,winCP),"r")) | (*file =3D 0) then { if *file >0 then write("+",file) every s :=3D syntagmas(f,wn) do { every wcount[wphrases(s,wn,abc)] -:=3D 1 } if *file > 0 then close(f) } else write("+",file," *** Open error ***") } eXtract(wcount,xmode) # extract exclusions wcount :=3D getlist(wcount,order) # generate output list of words totalw :=3D countw :=3D 0 # word counters while s :=3D get(wcount) & (countw < nn) do { f :=3D -1*get(wcount) if f >=3D threshold then { totalw :=3D totalw + f countw +:=3D 1 write(wf,left(f,5), s) } } case wn of { 0 : s :=3D "syntagmas" 1 : s :=3D "words" default : s :=3D "word-phrases" } write(wf,"Different "||s||": ",countw) write(wf," Total "||s||": ",totalw) if *output > 0 then close(wf) end # generate all syntagmas (sentences) from the text procedure syntagmas(f,wn) local line, s, ss s :=3D "" while line :=3D read(f) do { if \wintext then line :=3D WINtoDOS(line) if \icase then line :=3D map(line,cucase,clcase) if wn =3D 1 then { suspend line; next } line ? while tab(upto(abc)) do { if ss :=3D tab(upto(delims)) then { suspend s||ss; s :=3D "" } else s :=3D s || trim(tab(0),' ') || " " } } return s end # generate all words or word-phrases from the syntagma s # wn - dimension of word-phrase (number of words); procedure wphrases(s,wn,alphabet) local w, ww, i, n ww :=3D list() # generate all words from s and put them into work list every put(ww, words(s,alphabet)) if wn =3D 0 then n :=3D *ww else n :=3D wn while *ww >=3D n & w :=3D get(ww) do # get next word { if not valid(wmask,w) then next i :=3D 1 while i < n do { w :=3D w || " " || ww[i] # concatenate a word-phrase i +:=3D 1 } if i =3D n then suspend w } end # extract exlusions from table of words procedure eXtract(T,xmode) local w every w :=3D key(T) do { if memberX(w) ~=3D xmode then delete(T,w) } end # get all valid words from syntagma s procedure words(s,alphabet) local w s ? while tab(upto(alphabet)) do { w :=3D trim(tab(many(alphabet++eset)),sset) if *w >=3D limit then suspend w } end # verify meaning of the mask procedure ifmask(w) local s s :=3D w if not upto('*_',s) then fail # w is not a mask s ? while tab(find("_*")) do { s[&pos] :=3D "*"; move(2) } s ? while tab(find("*_")) do { s[&pos+1] :=3D "*"; move(2) } if *(trim(s,'*')) =3D 0 then fail # meaningless or blank mask return s end # generate list of MS-DOS files for given filemask procedure getfiles(fmask) local tmpfile, f if *fmask =3D 0 then { suspend "" fail } tmpfile :=3D (getenv("TEMP" | "TMP") | "c:")||"\\tmp$file.$$$" system("dir /a-d /oN /s /b "||fmask||" >"||tmpfile) f :=3D open(tmpfile,"r") path :=3D getpath(read(f)) seek(f,1) while filename :=3D read(f) | { close(f) system("erase "||tmpfile) fail } do suspend filename end # get pathname from file specification procedure getpath(filespec) local p if *filespec =3D 0 then return "" reverse(filespec) ? { tab(upto('\\')) p :=3D tab(0) } return(reverse(p)) end # convert Table of words to List procedure getlist(T,order) local L, item L :=3D [] if order =3D 0 then { every item :=3D key(T) do { put(L,item); put(L,T[item]) } return L } else return sort(T,order+2) # make sorting end # translate string from Windows cp (1251) to DOS cp (866) # (for cyrillic texts only) procedure WINtoDOS(line) local s s :=3D "" line ? until pos(0) do { if s :=3D s || tab(find("\\'")) then s :=3D s || hexchar(move(4)) else s :=3D s || tab(0) } return map(s,winCP,dosCP) end # generate character from it's hex code \'xx # (for cyrillic texts only) procedure hexchar(s) local i, hex hex :=3D "0123456789abcdef" s :=3D map(s,&ucase,&lcase) i :=3D (find(s[3],hex)-1)*16 + (find(s[4],hex)-1) return char(\i) | "" end # verify membership of the word to excluded words procedure memberX(w) local mask if member(xwords,w) then return 1 every mask :=3D !xmasks do { if valid(mask,w) then return 1 } return 0 end # verify string s on symbolic mask (search template) procedure valid(mask,s) local i, a, q, cmask, w if *(trim(mask,'*')) =3D 0 then return s w :=3D s mask ? repeat { q :=3D a :=3D 0 if =3D"*" then { tab(many('*')) a :=3D 1 } if =3D"_" then { q :=3D 1 q +:=3D *(tab(many('_'))) tab(upto(abc++eset++' ')) } cmask :=3D tab(many(abc++eset++' ')) | "" if *cmask =3D 0 then { if (a =3D 1 & *w >=3D q) then break else if (a =3D 0 & *w =3D q) then break else fail } i :=3D 0 if upto('*_') then i :=3D find(cmask,w) else every i :=3D find(cmask,w) if (a =3D 1 & i < q+1) then fail else if (a=3D 0 & i ~=3D q+1) then fail w :=3D w[i+ *cmask:0] } return s end=1A ------=_NextPart_000_01BD6FB6.91F7A960--