Lego KinNXT

I’ve been having some fun playing with the Kinect SDK and the Lego NXT kit. The protocol to talk to the Lego brick over Bluetooth is pretty straight forward. Below is a little F# module for most of the basic commands. I’ll fill out the full set soon and put it up on GitHub. Using…

14

Programming a 2000 Year Old Sandstone Computer

[The eleventh in a series of posts on the evolution of TransForth] If you think coding with punch cards is old school, you should try using sandstone tablets! Legend has it that members of the Cult of the Bound Variable designed and may have even constructed a city-sized machine powered by falling sand more than…

0

Meta-Circular Chicken and Egg

[The tenth in a series of posts on the evolution of TransForth]  This post may not quite be deserving of a wizard’s cape and 2001 Space Odyssey background music as when Sussman writes out Lisp in Lisp (at 34:34 – my absolute favorite SICP lecture by the way), but still… we are about to finish…

0

Going “Retro” and Loving It!

Continuing my concatenative language kick, I’ve been having fun playing with Retro (http://www.retroforth.com) and couldn’t resist making an F#-based VM on which to run it. It is an elegant, minimal Forth with an important twist. What caught my eye is that it supports quotations and combinators much like Joy, Cat, Factor, … I may have…

1

Project Euler Problem #14

Longest hailstone sequence with starting number under one-million. let hailstone n = Seq.unfold (function 0L -> None | 1L -> Some(1L, 0L)                                      | n when n % 2L = 0L -> Some(n, n / 2L)                                      | n -> Some(n, 3L * n + 1L)) n let chainLen n = hailstone n |> Seq.length…

2

Programming is “Pointless”

Some may call it “pointless”, but I absolutely love the point-free tacit programming style. The level of brevity can be truly astounding! Some of the terseness comes from not having to mention parameter names all over the place and much of it comes from the relentless factoring that this style makes straight forward (the Factor…

7

Spanning Two Worlds

[The ninth in a series of posts on the evolution of TransForth] The dictionary we have at the moment is split across two worlds. The definitions are in Forth-world; packed into plain memory. But we still have the F#-world mapping of WordRecords to those memory locations. let mutable dict = [] type WordRecord = {…

0

Heart Transplant

[The eighth in a series of posts on the evolution of TransForth]   They say that the inner interpreter is the heart of Forth and outer interpreter is the soul. It’s time to give TransForth a heart transplant! To really understand what we’re doing here, I’d suggest watching my video demonstration below (perhaps the first bit…

0

Tearing Away the Scaffolding

[The seventh in a series of posts on the evolution of TransForth] At this point we have a reasonably complete Forth that’s pretty fun to play with. Like I said in the first post though, we don’t just want to build a Forth in F#. Stopping here wouldn’t be in keeping with “Forth Tradition” which…

2

: LOOPTY DO I . LOOP ;

[The sixth in a series of posts on the evolution of TransForth] There’s beginning to be more Forth than F# in these posts! The last major piece we’re missing in the language, aside from some compile-time trickery we’ll get into later, is the standard Forth looping constructs. We’re just about done with the whole core language!…

3