News for hackers. Stuff that matters.
Re:The return of the Tcl browser plugin by davidw on Tuesday October 06, 2015 @01:13PM (#10340468)
> punting structures to C can be nice to organize data

I'm a Tcl fan, but the above is actually somewhat problematic, because to hold a reference to the C struct, you have to then manually free it later, losing some of the benefits of a language with automatic memory management.

Real dicts, and the new object stuff are big improvements though.

Re:The return of the Tcl browser plugin by blacksqr on Tuesday October 06, 2015 @02:03PM (#10340957)
FlightAware has released the SpeedTables package for Tcl, which basically creates C structures on the fly, as well as C-based accessor routines:

"Speed tables reads a structure definition and emits C code to create and manipulate tables of rows of that structure. This allows operations to be performed on the table at native code speeds, using a custom extension that manages rows of fields as native C structs and emit subroutines for manipulating those rows in an efficient manner."

FlightAware.com deals with extremely high-volume data throughput, and they manage the whole process with Tcl.

https://github.com/flightaware/speedtables

Re:The return of the Tcl browser plugin by davidw on Tuesday October 06, 2015 @02:06PM (#10340981)
Cool! They run https://tcl.apache.org/rivet/ too, which I played a part in building.
Re:The return of the Tcl browser plugin by bch on Tuesday October 06, 2015 @01:29PM (#10340646)
> ...the above is actually somewhat problematic, because to hold a reference to the C struct, you have to then manually free it later, losing some of the benefits of a language with automatic memory management.

I usually frame the data as clientData passed to a managing command (i.e. custom built first-class command), with appropriate allocation/deallocation. As often as not, I'm creating two commands: an anonymous reference template, and a command-creating-command that will instantiate instances of the "anonymous reference template". Then I can create an arbitrary number of arbitrarily named commands that pack and process their data, including freeing on destruction.

To the uninitiated, this sounds like object-oriented programming, which is arguably true, but doesn't automatically come with subclassing, inheritance, etc, etc. Tcl does have first class objects, but what I'm describing here isn't them.

Re:The return of the Tcl browser plugin by srean on Tuesday October 06, 2015 @02:32PM (#10341212)
Quite curious to take a look if you have anything available for the public eye.