3 ms·
The only language I use these days at work is Tcl, as it's the embedded scripting language in the app we use for post-processing finite element analysis [1] res
by auxym 11y ago
The only language I use these days at work is Tcl, as it's the embedded scripting language in the app we use for post-processing finite element analysis [1] results. Thus I use it for small scripts to make various data extraction and processing faster.
It's main strength is also it's main weakness: the whole everything is a string concept, even code. It makes the language both very simple to grasp at first and then also very powerful. It makes lisp-like macros and meta-programming possible. However, it quickly seems to turn into a big ball of mud.
Lack of first-class functions or OO is a major pain point, too. Objects have to be emulated by procs (ie functions), and procs are always in the global scope (there is namespacing but it's quite unwieldy). I wouldn't care that much, except the App's API is an object model, which means even a small script turns into 50 lines of only handle-getting and releasing. Make a small error and forget to release a handle (ie a proc name) and now you have to restart the interpreter (or write a lot of error handling script, which once again for small scripts is a pain). Also, you can't pass objects around by value as they are procs, only by name, which is also a pain.
[1] Numerical method often used by engineers to solve various physical problems modelled by boundary-value PDEs. https://en.wikipedia.org/wiki/Finite_element_method https://en.wikipedia.org/wiki/Finite_element_method
- jhallenworld 11y agoTCL became the standard embedded language for many EDA tools. I really hate it: it's difficult to use and slow. On the other hand, tcltk made it a convenient GUI language.
- innertracks 11y agoTCL/EXPECT was a huge help when I needed tp automate data extraction from a health clinic practice management system. The available interfaces didn't give all the data. Decoding the custom data formats, file layouts, etc... wasn't going well. Scripting the character based UI with TCL/EXPECT was pretty cool including the error handling. If a bit hacky. I was surprised to find out my temporary solution was still running without a hiccup 5 years after I left. Yes, I was younger then and hadn't learn to appreciate the life expectancy of temporary solutions.
- qewrffewqwfqew 11y agoCan you use 8.6? TclOO makes objects a lot more wieldy: they're still commands, but you get automatic cleanup, destructors, some nice options for inheritance/delegation and so on. "emulating objects with procs" sounds like you're not taking advantage of any of the previous OO extensions (snit, itcl, xotcl ...), which has to be making life harder than it should be :(.
- auxym 11y agoUnfortunately I'm stuck with the embedded 8.5 interpreter. And, to be entirely honest, most of the gripes above are likely more due to the poorly designed API than to the language itself.
- deleted 11y ago[deleted]