Eric Merritt | 5 Aug 2003 23:27
Picon
Favicon

Use of whitespace

I tend to be like using significant whitespace as long as I can use delimiters where 
I need to. What is your general opinion on the use of significant whitespace in a 
langauge. 

 Two langauges that take somewhat different approches to this are haskell and 
python.  

 haskell takes a layout based approach, basically everything at the same level of 
indentation is in the same block. I believe it also allows only spaces. It also allows 
for standard dilimiters where needed. 

 Python uses indentation as well, though it allows both spaces and tabs to serve. 

------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for Your HP, Epson, Canon or Lexmark
Printer at Myinks.com. Free s/h on orders $50 or more to the US & Canada. http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/sO0ANB/LIdGAA/ySSFAA/W4wwlB/TM
---------------------------------------------------------------------~->

To unsubscribe from this group, send an email to:
pragmatic_lang-unsubscribe@...

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 

Aaron Optimizer Digulla | 5 Aug 2003 23:56
Favicon
Gravatar

Re: Use of whitespace

On Tue, Aug 05, 2003 at 09:27:16PM -0000, Eric Merritt wrote:

> I tend to be like using significant whitespace as long as I can use delimiters where 
> I need to. What is your general opinion on the use of significant whitespace in a 
> langauge. 
>  
>  Two langauges that take somewhat different approches to this are haskell and 
> python.  
>   
>  haskell takes a layout based approach, basically everything at the same level of 
> indentation is in the same block. I believe it also allows only spaces. It also allows 
> for standard dilimiters where needed. 
>  
>  Python uses indentation as well, though it allows both spaces and tabs to serve. 

The first time I stubled over a language which used formatting was FORTRAN
and I hated it.

But when I saw Python, I realized that the formatted approach has its merits
and today, I can't think of a better way to structure code.

Pros:

1. It makes all code more readable. You just won't find badly formatted
code because that code wouldn't work.

2. You indent anyway, so why not use it to our advantage? Java/C wastes
a lot of screen space with the {} and even after all those years,
you still find "if() {" and "if()\n{".

(Continue reading)

Eric Merritt | 6 Aug 2003 17:39
Picon
Favicon

Re: Use of whitespace

> The first time I stubled over a language which used formatting was FORTRAN 
> and I hated it. 

 I have done a bit of RPG and its the same way. Column based formating sucks. 

> But when I saw Python, I realized that the formatted approach has its merits 
> and today, I can't think of a better way to structure code. 

 I tend to agree. I actually expected a big negative response, but no one seems to 
have an opinion outside of ourselves. 

> Pros: 
>  
> 1. It makes all code more readable. You just won't find badly formatted 
> code because that code wouldn't work. 
>  
> 2. You indent anyway, so why not use it to our advantage? Java/C wastes 
> a lot of screen space with the {} and even after all those years, 
> you still find "if() {" and "if()\n{". 
>  
> 3. The code tends to be less complicated too. When you have this: 
>  
>     for ... 
> 	if ... 
> 	    if ... 
> 		if ... 
> 		    if ... 
>  
>  
> 	a = 1 
(Continue reading)

Aaron Optimizer Digulla | 6 Aug 2003 21:18
Favicon
Gravatar

Re: Re: Use of whitespace

On Wed, Aug 06, 2003 at 03:39:56PM -0000, Eric Merritt wrote:

> > *Maybe* it is really time to leave the ASCII domain and start using 
> > a real wordprocessor for the IDE. There are many WYSIWYG text components 
> > out there and imagine to have formatted comments in your code! 
>  
> I just see these as two different problem spaces. I am afraid that even the thought 
> of this makes me cringe. 
>   
> > Or the file format for the source files could be XML (which means they 
> > can be (pre-)processed by a lot of tools and the syntax will be easily 
> > extensible when we don't use a DTD ;-). Then, the IDE could display 
> > that in a lot of ways. 
>  
>  When I first read this I almost blew chunks all over my screen, but it does make a 
> wierd cond of sense.  
>  Once I got over my gut reaction to actually writing code in xml I realized that we 
> still have a few problems. 
>  
>   XML is way to verbose. 
>   XML is not very readable when most of the code is in tags. 
>    
> Can you imagine writting code in xml? I cant. I do understand your point about 
> parasiblity. However, our language syntax must be pretty simple and regular to 
> make the macro system work. With this in mind a parser will probably be simple to 
> write. Also a parser will be included in the platform so tools could make use of 
> that. 

Well, if I remember correctly, then there are already plans to make the syntax of
Pragmatic extensible.
(Continue reading)

Eric Merritt | 6 Aug 2003 21:30
Picon
Favicon

Re: Use of whitespace

>  
> Well, if I remember correctly, then there are already plans to make the syntax of 
> Pragmatic extensible. 

 Yes thats one of the things at the heart of the system. 

> If we do, then people could extend the standard syntax with an XML parser! 

 Yes perhaps, but there are easier ways to extend the system. Not to mention that 
people would actually have to code in it. XML is not bad for mark (except for its 
verbosity) but I cant imagine it for logic. 

 
> With the extensible approach, all of them could use "sqrt(2)" in their 
> code (or <sqrt>2</sqrt> or whatever) and then "inherit" from the 
> code which translates that and overide it with something which matches 
> their specific needs. 

  Well one of the other goals is simplicity as well ;) 

------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for Your HP, Epson, Canon or Lexmark
Printer at Myinks.com. Free s/h on orders $50 or more to the US & Canada. http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/l.m7sD/LIdGAA/qnsNAA/W4wwlB/TM
---------------------------------------------------------------------~->

To unsubscribe from this group, send an email to:
pragmatic_lang-unsubscribe@...

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 
(Continue reading)

Aryeh M. Friedman | 6 Aug 2003 21:29

Re: Re: Use of whitespace

> Well, if I remember correctly, then there are already plans to make the syntax of
> Pragmatic extensible.
> 
> If we do, then people could extend the standard syntax with an XML parser!

	I see no reason why you can't write a XML parser in Pragmatic very
easilly, this does not mean we should and/or required to support it.
There are more elegant and extensiable ways to expand a language then XML,
we may offer this is as major sub-language but definitly not in the core
version.

	--Aryeh

------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for Your HP, Epson, Canon or Lexmark
Printer at Myinks.com. Free s/h on orders $50 or more to the US & Canada. http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/l.m7sD/LIdGAA/qnsNAA/W4wwlB/TM
---------------------------------------------------------------------~->

To unsubscribe from this group, send an email to:
pragmatic_lang-unsubscribe@...

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 

Aryeh M. Friedman | 6 Aug 2003 00:30

Re: Use of whitespace

> 3. The code tends to be less complicated too. When you have this:
> 
>     for ...
> 	if ...
> 	    if ...
> 		if ...
> 		    if ...
> 
> 
> 	a = 1

	This implies forcing "empty" elses since th following whould have an unclear
maening otherwise:

	if age>=18
		if ags>=21
			drink=yes
		   else
			vote=no	

	--Aryeh

------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for Your HP, Epson, Canon or Lexmark
Printer at Myinks.com. Free s/h on orders $50 or more to the US & Canada. http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/sO0ANB/LIdGAA/ySSFAA/W4wwlB/TM
---------------------------------------------------------------------~->

To unsubscribe from this group, send an email to:
pragmatic_lang-unsubscribe@...
(Continue reading)


Gmane