|
Site highlights
LUKS - Linux Unified Key Setup
New Methods In Hard Disk Encryption - Close encounter with storage encryption
Ego - introducing myself
Recent Blog Lines
|
Liskell docs, finally Thu Feb 22 14:23:26 CET 2007As the ACM SIGPLAN template gave my Latex document much more space, I decided — instead of writing a separate piece of documentation — to enrich my ILC07 submission with more interesting chapters about meta-programming and the Liskell prelude. This paper is much richer in content as the original (about half the content is new) and it finally starts to explain the mechanisms behind defmacro and how you can use them in the Haskell/Liskell world. So if you are interested in Liskell, the revised paper certainly deserves a second look. Pattern guards in Liskell Tue Feb 13 13:21:07 CET 2007
Yes, I'm working on documentation this very moment, but after seeing
A
missing Haskell feature on Planet Haskell, I was unable to resist. I need my daily dosage of coding.
(defmacro (~= pts)
`(let (((comp ,pts) True)
((comp _) False))
comp))
It can be used right-away as in:
(all (~= Star _) ([] (Star "x") (Atom))) -> False (all (~= Star _) ([] (Star "x") (Star "foo"))) -> TrueTo give you a brief idea why this works: The function body of defmacro is called with a list (called pts) that is bound to ([] (PSym "Star") (PSym "_")) which is equivalent to [PSym "Star", PSym "_"] written in Haskell syntax. This parse tree part is substituted into the backquoted code template at ,pts, resulting in the parse tree:
(let (((comp (Star _) True)) | let comp (Star _) = True
((comp _) False)) | comp _ = False
comp) | in comp
The Haskell equivalent of the generated Liskell parse tree is shown on
the right hand side for our Planet Haskell readers. This generated parse tree
is the result of the compile-time "~=" macro transformation,
and instead of the original (~= Star _) expression the
generated parse tree is compiled to object code.
You can compile Star.lsk with "ghc Star.lsk -o Star -main-is Star -package LskPrelude". (For those who already have a local Liskell branch, please pull the latest changes and redo ./darcs-all get. I moved the LskPrelude into a separate new core package. Also I vastly simplified the parse tree type, so the Liskell paper is not correct anymore wrt this.) QT RLE: The perfect screencast codec Thu Feb 8 13:56:24 CET 2007
Last week, I promised Liskell documentation. I intended to introduce the
basic concepts by screencasts, simply because screencasts are easy
to produce and to consume. However, after a few sample runs I ended
up with 1.2 gigabytes of MPEG4 data. Too much.
./configure --enable-gpl --enable-x11grab --enable-faad --enable-faac
make
./ffmpeg -vcodec qtrle -vd x11:0+0,0 -pix_fmt rgb555 -r 10 -g 300 \
-s 1280x1024 -acodec aac -ad /dev/dsp output.mov
A few remarks about the ffmpeg options:
|