Jump to content

Talk:Whitespace (programming language)

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by R.e.s. (talk | contribs) at 12:57, 7 April 2012 (Markers: STL comments *and* color-coded html). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.


Color Scheme

I'm red-green colorblind, is there any way that the colors could be changed to stand out for someone like me?

Thanks,

Centrisian (talk) 20:51, 30 August 2008 (UTC)[reply]

This any better?

--Kizor 22:26, 30 August 2008 (UTC)[reply]

This prints "Hello World!". Note that whitespace characters have been given differently coloured backgrounds since, in practice, they are invisible. (Space, Tab)

   
   	  	   
		    	
   		  	 	
		    	 
   		 		  
		    		
   		 		  
		    
	  
   		 				
		    	 	
   	 		  
		    		 
   	     
		    			
   			 			
		  
  	   
   		 				
		    	  	
   			  	 
		    	 	 
   		 		  
		    	 		
   		  
	  
		    		  
   	    	
		    		 	
   		 	
		    			 
   	 	 
		    				
    
	
	     
empty-line
    	
empty-line
 			 
empty-line
	  	 
	
     	
	   
empty-line
  	
empty-line
   	 
empty-line
empty-line/EOF


A lot better. if this could be implemented, that would be great. Also, sorry for being awol so long for a reply. Centrisian (talk) 03:21, 2 March 2009 (UTC)[reply]

Whitespace should be white: that's surely the whole point. Showing it in pink and lilac is cheating. Mhkay (talk) 15:04, 2 March 2012 (UTC)[reply]

Markers

I've added in markers to separate the characters, in the hope of improving clarity - I'm not sure whether it's actually turned out better or not; if people disagree then please do give reasons and revert. --82.70.156.254 (talk) 01:08, 21 October 2009 (UTC)[reply]

Personally, I don’t think they’re necessary since it’s already highlighted… and I’m not sure anything could help this language’s clarity. Still, they don’t do any harm since the interpreter ignores them. But here’s one vote against them, which makes it a tie. —Frungi (talk) 19:17, 18 February 2010 (UTC)[reply]

Although not as "pretty", the marker version makes it clearer how many Spaces (or Tabs) there are when they're adjacent. It also makes it easier for a reader to obtain directly usable source code by copy/paste (in edit mode). However, if we're going to use markers, an alternative is to use markers that identify the characters they mark; e.g. use S,T,L as "comments" to identify Space,Tab,Linefeed respectively. I just revised the example to do this, and also made the source code available at ideone. — r.e.s. (talk) 03:14, 6 April 2012 (UTC)[reply]
The STL-commented program can be then explained in normal text fashion by referring to just the "identifiers" S, T, L (now ignoring whitespace!):
SS STSSTSSSL TLSS    ;push +1001000 (72 in decimal) onto the stack and output the top-of-stack as a character ('H')
SS STTSSTSTL TLSS    ;push +1100101 (101 in decimal) onto the stack and output the top-of-stack as a character ('e')
SS STTSTTSSL TLSS    ;etc.
SS STTSTTSSL TLSS
SS STTSTTTTL TLSS
SS STSTTSSL TLSS
SS STSSSSSL TLSS
SS STTTSTTTL TLSS
SS STTSTTTTL TLSS
SS STTTSSTSL TLSS
SS STTSTTSSL TLSS
SS STTSSTSSL TLSS
SS STSSSSTL TLSS     ;push +100001 (33 in decimal) onto the stack and output the top-of-stack as a character ('!')
LLL                  ;end the program
I don't know if it would be appropriate to include such an explanation in the article, though. (?) — r.e.s. (talk) 11:58, 6 April 2012 (UTC)[reply]
I revised again to include the best of both worlds -- identifying comments (S,T,L) and color coded html. Each Space, Tab, or Linefeed character in the source code is preceded by the identifying comment "S", "T", or "L", respectively. — r.e.s. (talk) 12:57, 7 April 2012 (UTC)[reply]

"This article does not cite any references or sources."

This is an incorrect statement, although it may have been correct when it was added.

What is the process for removing it? —Preceding unsigned comment added by 65.166.54.44 (talk) 16:57, 7 April 2010 (UTC)[reply]

Does the Hello World actually works?

I copy/pasted the code to ideone.com. Some characters not visible in the code were printed there, but since they're supposed to be ignored, I let them there. The interpreter threw out this error: "Fail: user error (Can't do Dup)". — Preceding unsigned comment added by 189.77.168.10 (talk) 13:45, 15 September 2011 (UTC)[reply]

Rather than try to debug that code, I replaced it with a fresh example that prints "Hello, world!". This version includes "comments" (S,T,L) to identify each whitespace character. (See the earlier discussion, and the code available at ideone).— r.e.s. (talk) 12:26, 6 April 2012 (UTC)[reply]