5 ms·
I skipped Tcl in favor of Perl. Is there any reason to reconsider nowadays?
by zerr 2y ago
I skipped Tcl in favor of Perl. Is there any reason to reconsider nowadays?
- BoingBoomTschak 2y agoLooks like this post I made can serve again: https://world-playground-deceit.net/blog/2024/10/why-tcl.html https://world-playground-deceit.net/blog/2024/10/why-tcl.htm... But to be honest, while I feel like Perl has a lot of advantages (full perlre, full access to POSIX APIs, slightly better performance), I still can't look at it and keep my last meal down. Tcl having an event loop and Tk being native are pretty nice too.
- nmoroze 2y agoYou mention Tcl’s lack of language server support - just a shameless plug for my own project that’s working on fixing this: https://github.com/nmoroze/tclint/blob/main/docs/lsp.md https://github.com/nmoroze/tclint/blob/main/docs/lsp.md It’s not quite “complete” with respect to all the usual LSP features (just does linting and formatting for now), but it’s a starting point!
- doublerabbit 2y agoI don't use language servers myself personally but wanted to give you a kudos for attempting something.
- BoingBoomTschak 2y agoWell, thank you and good luck!
- AceJohnny2 2y agoTCL is embeddable (in another program). In fact that's how it started. That means it's a good language to extend your program. I don't know how it compares to Lua, which seems to have replaced it in that space.
- einpoklum 2y agoYou mean, the interpreter is available as a library with bindings in many languages? But then - isn't that the case for other scripting languages these days? Or are they too complex and with "strings attached"?
- robinsonb5 2y agoI can't speak for other scripting languages, but it's absurdly easy both to embed Tcl as an interpreter in a larger project, and to create a Tcl extension which implements your own commands.
- einpoklum 2y agoYou're using the same words. What is "easy" about embedding TCL that is "difficult" about embedding Perl or Python? Can you spell this out?
- robinsonb5 2y agoSorry, missed this at the time. But I did say I can't speak for other scripting languages. All I can say is that it was much easier than I was expecting!
- edoceo 2y agoOne can leverage Lua in PHP, I think it's handy for user-supplied logic (eg: business rules)
- wduquette 2y agoI like TCL a lot more for this use case, and I don’t care for Lua at all; but Lua might be a better match for embedding in an OO language.
- 77pt77 2y agoLua is simple to bolt on to your project. Perl is a nightmare to interop! They should have won an award for that. It took effort. Python is slightly cleaner than perl, but not much.
- williadc 2y agoTcl is more-or-less required if you're involved with the physical design of silicon (most EDA tools only provide a Tcl interface). It's a good fit for that purpose. If you need a language which is easy to embed and you want non-programmers to be able to use it, Tcl is a good choice, though I've heard that Lua has supplanted Tcl for that purpose.
- everylittlebit 2y agoIn the silicon industry it’s definitely tcl only. Zero Lua. But every tcl script I have seen is extremely simple, often just a bunch of commands to the EDA tool that reads like a list of bash commands.
- AshamedCaptain 2y agoI'd say python starts to make some strides, likely due to the AI hype train. But it's still mostly Tcl.
- robinsonb5 2y agoTcl scripting gets more interesting when you want to talk to a design running in an FPGA over JTAG. I have a toy CPU project which I've so far tested on Altera/Intel, Xilinx and Lattice FPGAs, and a debug interface where a C-based ncurses debugger connects over TCP/IP to a Tcl bridge which talks to the appropriate JTAG interface for the particular type of chip. I'm also a big fan of the full-fat Tk-capable Tcl in Altera's SignalTap / Virtual JTAG - I used it recently to plot histograms on-demand for profiling RAM / Cache accesses.
- orthoxerox 2y agoThat's one of the benefits of tcl, having a bunch of commands require as little syntax as possible.
- deleted 2y ago[deleted]
- lizknope 2y agoThat's been my job for the last 30 years. Our flow is thousands of lines of Tcl code around all the cadence and synopsys tools. Then we write more Tcl to create the power grid, create blockages, etc.
- wduquette 2y agoI dropped Perl for TCL decades ago, after I realized that I could read and understand my TCL code months after I’d written it, but my Perl code was totally opaque.
- forinti 2y agoI like both Perl and TCL. If I need an executable for Windows, I choose TCL, because I can easily make one with freewrap.
- esafak 2y agoI first encountered Tcl when trying to use the network simulator, ns2. Any language that lends itself to such hideous code can't be good, I thought, and stayed clear of it ever since. https://www.isi.edu/websites/nsnam/ns/ https://www.isi.edu/websites/nsnam/ns/