Re: [9fans] A new language for Plan 9
A new Bentley is up. This defines hopefully all of the bitwise operators I will support: | ^ ~ (as in C) @ @ (roll left and roll right, also called circular shift) I'm still working on the base language, getting type checking working and allowing logical AND, OR, XOR, NOT. But perhaps the hardest part is writing the manual for this language.
Re: [9fans] A new language for Plan 9
On May 7, 2008, at 5:24 AM, Matt Erickson wrote: On 2008-05-02, erik quanstrom [EMAIL PROTECTED] pondered onto the tubes: one does if key = 'c' then scanline runcommand else generate(key) assemble(key) This is similar to Python, and prevents the nesting ambiguity of C, Pascal, and some other languages that use block delimiters. don't forget fortran. I try to, oh God how I try to. Then I come back to work in the morning, and have to remember it all over again. -- Matt Erickson [EMAIL PROTECTED] Political correctness is not insane. You want to call it alternatively reality-based. - Richard Bos, Usenet Good luck. My next compiler will do Fortran 77, and hopefully 90. It will be #f, where # is the prefix (so 8f for 386). A new Bentley is up, in the usual place. This adds full procedures and functions with arguments, expression statements (like in C), and demotes assignment from a statement to an operator. The next version will have it right-associative (a := b := c := 0). I also plan to have scope. I'm surprised at how quickly I'm getting through this. I expected some 2 year project getting as much as the Sieve of Erastosthenes to work.
Re: [9fans] A new language for Plan 9
As I understand it the load of supporting two libraries was too much work, also the alef (and perhaps limbo) experience lead to libthread which provides much of the same functionality - abet not quite as neatly. the sources of the 2nd edition alef have been released and there was a one line change to make the code work on the 3rd (and I assume 4th) editions - the memory layout of processes has changed a little and the alef library needs to know (the stack address I think), for the fix see 9fans passim. -Steve
Re: [9fans] A new language for Plan 9
I think the quote of the day was We already support one C-like language. brucee On Sun, May 4, 2008 at 5:57 PM, [EMAIL PROTECTED] wrote: Just out of curiosity, why did alef die, or are some of you still using it? A victim of rationalisation and reality: maintaining separate libraries for two languages is a luxury Plan 9 colud no longer afford, if I understood the rationale at the time. ++L
Re: [9fans] A new language for Plan 9
s/one/two/ # don't forget c++ On May 4, 2008, at 8:18 AM, Bruce Ellis wrote: I think the quote of the day was We already support one C-like language. brucee On Sun, May 4, 2008 at 5:57 PM, [EMAIL PROTECTED] wrote: Just out of curiosity, why did alef die, or are some of you still using it? A victim of rationalisation and reality: maintaining separate libraries for two languages is a luxury Plan 9 colud no longer afford, if I understood the rationale at the time. ++L
Re: [9fans] A new language for Plan 9
Set for the next release: bit arrays. I'd use plan 9 before i'd use bitfields -- pjw funny, i've only know him as a bit array. - erik
Re: [9fans] A new language for Plan 9
my original suggestion for ratpy wasn't taken seriously, so i'll propose it again: http://groups.google.com/group/comp.os.plan9/msg/29eb245edcb78e91 I don't use Python for this very reason. This is probably why Ruby exists. I will not use your language for the same reason. By adopting such draconian white space rules you automatically alienate a large number of programmers. A blind programmer once told me that Python's whitespace block structure was simply too high of a barrier for him to use it. straying off-topic, but ... the Python distribution includes a tool called 'pindent'. it happily annotates Python source with block-closing comments and converts haphazardly indented source with block-closing comments into correctly indented Python source. http://svn.python.org/projects/python/trunk/Tools/scripts/pindent.py
Re: [9fans] A new language for Plan 9
ratpie! tasty. i thought a pindent was what a pinhead gets when you scone him with a frypan. brucee On Sun, May 4, 2008 at 9:28 AM, Skip Tavakkolian [EMAIL PROTECTED] wrote: my original suggestion for ratpy wasn't taken seriously, so i'll propose it again: http://groups.google.com/group/comp.os.plan9/msg/29eb245edcb78e91 I don't use Python for this very reason. This is probably why Ruby exists. I will not use your language for the same reason. By adopting such draconian white space rules you automatically alienate a large number of programmers. A blind programmer once told me that Python's whitespace block structure was simply too high of a barrier for him to use it. straying off-topic, but ... the Python distribution includes a tool called 'pindent'. it happily annotates Python source with block-closing comments and converts haphazardly indented source with block-closing comments into correctly indented Python source. http://svn.python.org/projects/python/trunk/Tools/scripts/pindent.py
Re: [9fans] A new language for Plan 9
On Sat, May 3, 2008 at 6:32 PM, Bruce Ellis [EMAIL PROTECTED] wrote: ratpie! tasty. i thought a pindent was what a pinhead gets when you scone him with a frypan. Can I have a piece without so much rat in it? -eric Its the Bishop of Liechester
Re: [9fans] A new language for Plan 9
Can I have a piece without so much rat in it? I had stir fried rat in vietnam once - well you gotta try things, tasted a bit like wild (strong chewy) chicken. -Steve
Re: [9fans] A new language for Plan 9
Well KenC doesn't have any rat with it. So you want spam spam spam bacon and KenC. Or python and a bucket. brucee On Sun, May 4, 2008 at 12:43 PM, Eric Van Hensbergen [EMAIL PROTECTED] wrote: On Sat, May 3, 2008 at 6:32 PM, Bruce Ellis [EMAIL PROTECTED] wrote: ratpie! tasty. i thought a pindent was what a pinhead gets when you scone him with a frypan. Can I have a piece without so much rat in it? -eric Its the Bishop of Liechester
Re: [9fans] A new language for Plan 9
The idea is simple: indentation as block style. Religious matter. Do as you wish, but expect flames. Another feature I hope to supply is bit arrays. ok Bentley also will have nested functions, a Pascal-like for statement (with variable steps instead of 1/-1), and a loop statement for infinite loops. All languages have infinite loops, but most are just discreet about it. To ensure programmers will use good style, Bentley will lack goto. To break out of nested loops, you can use the breakout statement. This worries me. When I need to implement a finite state autonomon I usually use goto. For that purpose it is by far the clearest and least error prone method C offers. How do I do this in Bentley? Infinite loop, state variable and breakout? I would argue that that's less clear and unless your compiler is very clever it will generate worse assembly in this (common) case. Finally, there will be two modes: hosted and standalone. The standalone keyword changes this. Hosted mode can access print to stdout and stderr, read from stdin, new, renew (like realloc), delete, and a string type. I don't understand. -- John Stalker School of Mathematics Trinity College Dublin tel +353 1 896 1983 fax +353 1 896 2282
Re: [9fans] A new language for Plan 9
On Fri, 02 May 2008 08:49:24 BST John Stalker [EMAIL PROTECTED] wrote: To ensure programmers will use good style, Bentley will lack goto. To break out of nested loops, you can use the breakout statement. This worries me. When I need to implement a finite state autonomon I usually use goto. For that purpose it is by far the clearest and least error prone method C offers. How do I do this in Bentley? Infinite loop, state variable and breakout? I would argue that that's less clear and unless your compiler is very clever it will generate worse assembly in this (common) case. If he provides proper tail-recursion or even a switch statment you can implement FSAs quite easily. Clearly he has a lot of enthusiasm but I don't understand why he is squandering it on implementing boring old language ideas. Why not a language for mashing tree structured data or graphs or for parallel programming or modelling physics of real objects or something. He'd learn even if he fails. Hoare's 1973 paper Hints on Programming Language Design might be relevant to what he is attempting (look for STAN-CS-73-403)
Re: [9fans] A new language for Plan 9
* Bakul Shah ([EMAIL PROTECTED]) wrote: Clearly he has a lot of enthusiasm but I don't understand why he is squandering it on implementing boring old language ideas. Old ideas have the benefit of already being there.
Re: [9fans] A new language for Plan 9
it could just be possible that you're using an editor that is not aware of the particular indentation requirements of said language, no? does it, at least, implement color coding? you wascale wabble wowser! you're won of those pwython wuffians, awren't you? - erik
Re: [9fans] A new language for Plan 9
(By 'indentation' of course I mean 'indentation to define structure') -rob
Re: [9fans] A new language for Plan 9
Put it this way: It's unwise to make program structure depend on invisible characters. a white space is something hard to find, some time ago I helped a friend who couldn't get a mkfile working, he got something like: mk: mkfile:6: syntax error; expected one of := all due to a ' ' in what was supposed to be an empty line. Federico G. Benavento --- /bin/fortune: You are in a maze of twisty little passages, all alike.
Re: [9fans] A new language for Plan 9
On May 1, 2008, at 9:52 PM, Rob Pike wrote: Indentation by white space is a very bad idea in my experience. Superficially attractive but ultimately very dangerous. I once spent a couple of days tracking down a bug caused by a source-to-source code tool that broke a major program because the code it was injecting into had indented one more space, causing the injecting code to break the control flow. It was nearly impossible to track down. This scenario is why I decided to require hard tabs as indents. You can't use a space. But a space halts the indentation, so the problem is still there. The next version will just ignore spaces, and treat the first non-whitespace character as the beginning of a line. I have lots of other examples of lesser disasters. As code grows, white space indentation becomes ever more problematic. It's a maintenance disaster. Put it this way: It's unwise to make program structure depend on invisible characters. There's a language made entirely of said invisible characters, called Whitespace. It's esoteric, but it works. And Python, which has the same style, is a phenomenal success. Whether or not indentation works relies on the programmer.
Re: [9fans] A new language for Plan 9
On May 1, 2008, at 9:12 PM, Federico G. Benavento wrote: Put it this way: It's unwise to make program structure depend on invisible characters. a white space is something hard to find, some time ago I helped a friend who couldn't get a mkfile working, he got something like: mk: mkfile:6: syntax error; expected one of := all due to a ' ' in what was supposed to be an empty line. Federico G. Benavento Another thing: lines with only whitespace are naturally ignored (as far as I know - I am human) and don't break the block structure. The space in an empty line should be a bug, right?
Re: [9fans] A new language for Plan 9
On May 1, 2008, at 9:26 PM, erik quanstrom wrote: one does if key = 'c' then scanline runcommand else generate(key) assemble(key) This is similar to Python, and prevents the nesting ambiguity of C, Pascal, and some other languages that use block delimiters. don't forget fortran. [off topic] I wonder why it took 20 or so years for Fortran to introduce IF..ELSE..END IF. Probably after Kernighan and Plauger, 1974, it finally came to Backus' senses. :-P
Re: [9fans] A new language for Plan 9
you can do what you will, with your indentation-based language, but that won't change the fact that indentation for lexical scope is a horrible idea. I first saw it in a language in 1978 called Offal, by Aron Insinga. Aron was smart: after 6 weeks, he said, this sucks, and put it away. When I saw the beginnings of Python 10 years or so later I thought: I wonder when they'll figure it out. 20 years later, they haven't. That says something. The other ideas are interesting. Don't wreck yourself on the bad idea of indenting. Popularity is no measure of goodness. Or have you used Windows lately :-) ron
Re: [9fans] A new language for Plan 9
On Thu, May 1, 2008 at 9:41 PM, John Barham [EMAIL PROTECTED] wrote: I first saw it in a language in 1978 called Offal, by Aron Insinga. Well with a name like Offal at least he wasn't setting expectations too high... Just about as high as Python went, it turns out :-) ron
Re: [9fans] A new language for Plan 9
On Thu, May 1, 2008 at 9:54 PM, ron minnich [EMAIL PROTECTED] wrote: On Thu, May 1, 2008 at 9:41 PM, John Barham [EMAIL PROTECTED] wrote: I first saw it in a language in 1978 called Offal, by Aron Insinga. Well with a name like Offal at least he wasn't setting expectations too high... Just about as high as Python went, it turns out :-) Touché. At least it wasn't called Parrot or it might have been dead from the start. John
Re: [9fans] A new language for Plan 9
Pietro Gagliardi wrote: The compiler generates Assembly in a temporary file, then calls up the assembler to make the program. That sounds somewhat similar to Dan Bernstein's qhasm (http://cr.yp.to/qhasm.html) which is a semi-portable assembly language combining C-like syntax w/ direct access to registers. Anathema to the Plan 9 philosophy I suppose but given that clock speeds seem to have hit a wall it's one way to wring out more speed. To be fair he seems to intend it to be used only for number crunching inner loops rather than as a general purpose language. John
Re: [9fans] A new language for Plan 9
Indentation by white space is a very bad idea in my experience. it could just be possible that you're using an editor that is not aware of the particular indentation requirements of said language, no? does it, at least, implement color coding? :D