ActiveTcl 8.5 has become the standard on which people build their Tcl applications, but Tcl 8.6 is just around the corner. Currently in beta, Tcl 8.6 is expected to have a final release in 2011. What new tricks will 8.6 pull out of the hat? Should you start using Tcl 8.6 soon? Join us on January 26, 2011 and find out.
Our resident Tcl expert Jeff Hobbs, Director of Engineering at ActiveState and long-time Tcl community leader and member of the Tcl Core Team, provides an overview of the major features in Tcl 8.6, including Tk. Starting with a new core OO system, going through improvements to string and list handling, and caps it off with lots of extras, this webinar covers the major changes in Tcl 8.6 and how to take advantage of them.
Scaling API-first – The story of a global engineering organization
Looking Ahead to Tcl 8.6
1. Looking Ahead to Tcl 8.6
Jeff Hobbs
Director, Engineering
ActiveState Software Inc.
2. Agenda
About ActiveState
Tcl 8.6 roadmap
Tcl 8.6 features in depth
Knowledge of Tcl 8.5 expected
For 8.5 review, see previous webinar:
https://www1.gotomeeting.com/register/446757680
Q&A
3. About ActiveState
The Dynamic Language Experts
Over 10 years focusing on open source dynamic
languages
Experience across multiple dynamic languages
Tcl, Perl, PHP, Python, Ruby, JS
And platforms
AIX, HP-UX, Linux, Mac OS X, Solaris, Windows, …
Assist in the development, management and
distribution of dynamic languages
97% of Fortune 1000 companies use ActiveState
products
5. Tcl/Tk 8.6 Roadmap
Currently in active development
8.6a1 development initiated April 2008
Same month of 8.4.19 release
8.6b1 released December 2008
8.6b2 coming soon
Release schedule marching towards final
8.6.0 targeted for 2011
Community input is important
6. Tcl/Tk 8.6 Changes
Numerous TIPs implemented for 8.6
49 TIPs final (1 more in accepted state)
8 more in draft state
70 TIPs targeting 8.7 (in draft state)
7 TIPs targeting 9.0
99.9% compatible with Tcl 8.5
Changes are in error messages
Bytecodes have changed - watch version compatibility
ActiveTcl tbcload can load 8.5 bytecodes in 8.6
Separate Tcl Dev Kit bytecode compilers for 8.5 and 8.6
7. Tcl 8.6 OO
Core OO! (T257 T320 T354)
% oo::class create example {
Major effort by Donal Fellows variable foo
Foundational OO system constructor {{value 10}} {
set foo 0
inspired by XOTcl and snit my bar $value
}
Provided in core (no package) destructor { }
oo::class, oo::define, oo::copy, method bar {input} {
incr foo $input
oo::object, ... }
Class-based object system with }
=> ::example
dynamic redefinition allowed % example create b 4
=> ::b
Per-object customization with % b bar 3
filters, mixins and more => 7
Has C API to create and
manage classes, instances and
methods
8. Tcl 8.6 string and list handling
Simplified Tcl prefix matching (T195)
tcl::prefix, with C API for option parsing (T265)
Unicode aware string trim* (T318)
Find insertion point in sorted list lsearch -bisect
(T313)
Grouped sort with lsort -stride (T326)
Great for use with array get or dict output
Allow lset to extend lists (T331)
lset myList end+1 foo equivalent to lappend myList foo
9. Tcl 8.6 interp and namespace
Ability to cancel script evaluation (T285)
interp cancel, C API helper Tcl_CancelEval
Check if interp is active Tcl_InterpActive (T335)
namespace ensemble create -parameters (T314)
encoding system at startup is iso8859-1, not
identity
info errorstack, -errorstack return dict (T348)
tcl::unsupported::representation
Get Tcl_Obj internal rep
10. Tcl 8.6 extras
New binary encode|decode with base64 (T317)
binary is now a namespace ensemble
Base-2 support in format and scan with %b (T343)
dict filter takes multiple patterns args (T341)
Windows registry has 64-bit support (T362)
Added tcl_platform(pathSeparator) key (T315)
For $::env(PATH), not file paths (use file)
11. More 8.6 stuff!
More commands take no args gracefully (T323)
Reduce non-essential error cases, good with {*}
New try/finally syntax (T329) set f [open $file a]
try {
try body ?handler...? ?finally script?
puts $f "oops ..."
throw type message # ...
Alternative to error } finally {
close $f
}
try {
set f [open $file]
} trap {POSIX EISDIR} {} {
puts "failed to open $file: it's a directory"
} trap {POSIX ENOENT} {} {
puts "failed to open $file: it doesn't exist"
}
12. Tcl 8.6 files and channels
New file tempfile ?nameVar? ?template?
Creates tempfile and returns a channel (T210)
Enhanced chan command
close can close only read or write side (T332)
Anonymous pipes with chan pipe (T304)
Tcl level channel transformations chan push|pop (T230)
IPv6 support in socket (T162)
Currently uses OS preference for AF selection
13. But wait, there’s more!
Zlib compression included with new core zlib
command (T234)
Builds on standard zlib sources
Full zip and unzip support for gzip and zlib formats
Supports channel streaming for transforms
Includes adler32 and crc32 checksumming
Includes Tcl_Zlib* C API
14. And on the C side of 8.6
Make Tcl_Interp more opaque
No more interp->result (T330)
Use Tcl_GetStringResult(interp) instead
API for interp->errorLine (T336)
Tcl_Get|SetErrorLine
Access to startup scripts from C (T338)
Tcl_Obj *Tcl_GetStartupScript(const char **encodingNamePtr)
void Tcl_SetStartupScript(Tcl_Obj *pathPtr, const char *encodingName)
Exported Tcl_TransferResult (T307)
Portable Tcl_StatBuf access (T316)
Tcl_Get*FromStat
New Tcl_BackgroundException for bgerror (T337)
15. More 8.6 Under the Hood
Exported library loading functions (T357)
Tcl_LoadFile, Tcl_FindSymbol, Tcl_FSUnloadFile
Windows moving to full -DUNICODE build
Supports Windows XP or later
OS X moving to Cocoa
Supports OS X 10.5 or later, allows 64-bit builds
Next version of [incr Tcl] (v4) uses TclOO
Thread extension to be included with core sources
Thread builds (--enable-threads) now default (T364)
Other extensions being considered
16. Tcl 8.6 TDBC
Standard interface for database connectors (T308)
Currently has drivers for sqlite, mysql, odbc and postgres
Leverages TclOO framework
package require tdbc::sqlite3 db transaction {
tdbc::sqlite3::connection create set firstname "Fred"
db "phonebook.sqlite3" set lastname "Flintstone"
set statement [db prepare { $statement foreach row {
SELECT phone_num FROM directory puts [dict get $row phone_num]
}
WHERE first_name = :firstname
}
AND last_name = :lastname
}] $statement close
db close
17. Tk 8.6 Features
Windows Vista/7 theme support for Ttk
Backported to 8.5.8
Updated mouse-wheel behavior (T171)
Tk OS X Cocoa
Enables 64-bit builds
Requires OS X 10.5+
Available for Tk 8.5
New canvas features
Absolute canvas item positioning (T236)
Canvas item vertex editing (T97)
Angled text items (T119)
18. Tk 8.6 font dialog
Uses native dialog on Windows, OS X (T324)
% tk fontchooser show
% tk fontchooser configure
-parent . -title {} -font {{Gill Sans} 12 bold roman}
-command {} -visible 1
19. Tk 8.6 PNG support
Full PNG support with compression (T244)
Leverages zlib support
image create photo -file ouster.png
-format "png -alpha 0.5"
20. Tk 8.6 extras
New tk busy adapted from BLT’s busy (T321)
User can generate <Focus*> events
Unfocussed text insertion cursor control (T197)
GIF image writing uses LZW compression
wm attributes -type on X11 (T359)
Modernized X11 menus (T360)
New ttk::spinbox widget (also in 8.5.9)
Consider the alternate widgets combobox and menubutton
21. In summary ...
8.6 currently in beta
99.9% compatible with Tcl 8.5
Changes in error messages
New features bring new core commands (e.g. try)
Internal bytecodes have changed
Almost 50 new features for developers
Possibly a few more to come
Slower than 8.5, performance wasn’t a focus
Final release ETA 2011
Tcl Dev Kit and Komodo support both 8.5 and 8.6
Further 8.6 changes may require further updates
22. ActiveTcl 8.6.0.0 Beta 4
Based on 8.6b1.2 Tcl core
Released October 2010
Incudes VFS Explorer (tclvfse)
Similar to ActiveTcl 8.5 extension set
Adds new core modules for TDBC, trofs
90+ packages - the rest available via teacup
Mac OS X architecture change
Was x86-ppc “universal” with Carbon
Now x86-x64 with Cocoa
teapot understands both architectures
24. Thank You!
Next Steps ...
Watch our webinar, Exploring the Benefits of Embedding
Dynamic Scripting Languages in Your Products
http://www.activestate.com/webinars/exploring-benefits-
embedding-dynamic-scripting
or speak to a representative about
ActiveTcl Enterprise or OEM: 1-778-786-1107
business-solutions@activestate.com
www.activestate.com