Sacrideo: Programming, Philosophy, &c.

Fastidious Elegance

Aaron W. Hsu <arcfide@sacrideo.us>

Friday, 17 February 2012

ChezWEB v2.0 Released

I am pleased to announce the release of ChezWEB v2.0. This is a complete rewrite of the ChezWEB system and it include numerous enhancements and improvements. It's hard to describe how cool this new release is. :-) If you have not done so already, please make sure to go to the new ChezWEB landing page:

http://www.sacrideo.us/v5/proj/chezweb/

2012-02-17 18:34:33 [] link

Friday, 03 February 2012

Mailx(1) and IMAP? Who knew?!

While this may not come as a surprise for some of you who are well versed in the command line world, but I was just recently informed that the mailx mail program, which is often the default program linked to mail(1) in many Linux systems, including my personal favorite, Slackware, actually supports IMAP! Not only does it support IMAP, but for my uses, it supports it rather well. Amazingly enough, it also supports a host of other interesting things, and this means that I am now happily enjoying using mailx as my main mail client. This probably will not last long, as I rarely stick for too long to a single mail program, but for the moment, it's really neat to be able to add this little program, elegant in its simplicity, to my ring of mail clients to use and rotate.

2012-02-03 22:34:11 [] link

Monday, 30 January 2012

Text Register Machines and APL

Larry Moss and some others have created an interesting little machine for teaching certain courses. This little machine is an interesting one where each instructions is a series of 1's followed by a series of #'s. The 1's are an argument indicating either a register or some value, in either case the value is the number of 1's that is in the instruction. The number of #'s indicates the instruction:
#Add 1 to register
##Add # to register
###Goto instruction ahead
####Goto instruction behind
##### Pop character from word in register and jump ahead 1 if empty, two if 1, and three if #.
I figured that I would implement a simple interpreter for this machine in APL really quickly, and it was a very quick program. Here's the result:
     ∇ R←N EVAL P;PC;I;V                                                        
[1]    R←N ⋄ PC←1 ⋄ EM←'IMPROPER HALT' ⍝ Set Init State and Program Count
[2]    P←(⊃'1#'∨.=⊂P)/P                ⍝ Strip whitespace                
[3]    P←↑(('1'=P)∧1,2≠/P)⊂P           ⍝ Partition into instructions     
[4]    P←(+/'#'=P),[1.5]+/'1'=P        ⍝ Reformat instructions to integer
[5]   LP:→(PC=1+⊃⍴P)/0                 ⍝ Check for halt                  
[6]    EM⎕SIGNAL((PC<1)∨PC>1+⊃⍴P)/90   ⍝ Exception on bad halt           
[7]    (I V)←PC⌷P                      ⍝ I→Instruction  V→Register/Count 
[8]    →I⌷(ADD ADD GO GO CASE)         ⍝ Case on instruction             
[9]   ADD:R[V],←I⌷'1#' ⋄ PC+←1 ⋄ →LP   ⍝ Add elem, increment, go        
[10]  GO:PC+←V×(I-2)⌷1 ¯1 ⋄ →LP        ⍝ Step forward/backward, go      
[11]  CASE:PC+←('1#'⍳1↑⊃V⌷R)⌷2 3 1     ⍝ Step forward correct amount     
[12]   R[V]←⊂1↓⊃V⌷R ⋄ →LP              ⍝ Drop from register and go
     ∇ 

2012-01-30 23:16:16 [] link

Saturday, 21 January 2012

Shrinking Code

People often think that adding more lines of code is the same thing as making progress on a project. I often find the opposite to be true. On my recent research for example, reducing the size of an implementation and improving its performance at the same time is a lot better than having this massive program.

Let's all remember the pursuit of simplicity and elegance in our solutions, while we pursue the latest and greatest features.

2012-01-21 22:46:49 [] link

Fare Thee Well, Monotone

It is a sad day. I really like the Monotone VCS. I like it more than the others I have used. Yet, today I believe I take a different path. Monotone has served me well, but I can fight the unwavering popularity of Git no longer. I simply fail to have enough justification to use Monotone over Git now, despite my personal preference: simply put, I want to make it easier for others to work on my code.

Farewell, Monotone, and begrudge me not my betrayal of thee for greener pastures.

2012-01-21 13:43:05 [] link

« Newer posts [1 2 3 4 5 6 7 8] Older posts »


Hackers