Mistakes I made in the design of Tclssg (and how they can be fixed)

Published

As the 1.0.0 release of Tclssg approaches I want to take a look at the less fortunate design decisions I made for the project. The goal of this post is to point out the design problems currently present in Tclssg, trace where they came from and outline how they could be mitigated and eventually solved without breaking backwards compatibility. It is also meant to serve as a reference to help avoid making the same mistakes in the future.

(read more)

Tcl's [binary scan] and the Go Challenge 1

Published , updated

In the programming language Tcl the command [binary scan] decodes binary data according to a format string. For example,

binary scan $data {cu4 f1 a*} fourBytes aFloat remainder

will read four unsigned 8-bit integers from the string data and put them into the variable fourBytes, then read one 32-bit floating point number and put it in aFloat, then, finally, put the remaining string in remainder (without altering data itself).

(read more)

Re: Data munging

Published

A short while ago I read a curious blog post titled "Data munging in Perl 6 vs Perl 5". I liked how each individual Perl 6 code snippet for each data manipulation looked. I understood that the purpose of the exercise was to highlight this particular part of the language. And yet, in the end I couldn't shake off the thought that this was not the right way to solve the kind of problems of which the toy problem at hand was an example. I have come to suspect that complex dictionary manipulation is mostly an antipattern that appears in scripts as they evolve into complex programs over time.

(read more)