Live data from Hacker News

Tcl 9.0

tcl-lang.org

231–240 of 247 posts

Re: Tcl 9.0

#231
So I started playing with TCL for the first time this weekend after seeing this post, and here are my thoughts. I think the language is fun and much different than I’m used to, but my biggest challenge so far is just getting packages installed. There seems to be no current, modern, maintained package manager or central repository, and to do basic stuff like stand up a web server requires compiling from C source. Kinda brutal. TclHttpd failed to compile with TCL 8.6 installed because I guess there was some change in APIs. I didn’t bother spending time figuring out how to patch the C code to make it work because that’s getting in for more than I bargained for.

It’s too bad there’s not a simple way to get up and running with packages because for me so far that had been the biggest barrier to entry / deterrent. Also, I wanted to create a ES256 JWT but there’s no good way to do that apparently, due to the dated ecosystem, whereas in other languages this sort of this is just a package install away. I found a third-party solution in the form of Chilkat software but it costs $300 to license.

So overall while I think TCL is fun, I can see why people don’t choose it when they want to be productive fast and not have to fuss around with deeply manual things that are commonplace and quick in other languages.

Re: Tcl 9.0

#232
post #182

Earlier quoted context omitted.

Very cool of you to post this. Too many people won't post stories like this, but I've done very similar multiple times. I think it definitely helps reinforce proper habits, and is the best way to cut your teeth on technology. It's also great for anyone new to read something like this, and be able to avoid something so devastating, and maybe make lesser mistakes, but still learn from both!

when you get to be as old as i am, these are the war stories you share with your kids and grandkids around the campfire ;-) like the one from my colleague who once fat fingered fsck into mkfs and i lost my personal homepage because of it. what makes me uncomfortable about that story is that it was not my fault. if it were it would have been easier to tell. but at the time i was quite frustrated and my colleague felt…

Absolutely, the worst mistakes are the biggest opportunities for learning. Destroying your own files is painful. Destroying EVERYONE'S files is a lesson that is more painful and something you will be more careful not to repeat.

I try to tell as many of these stories in person as possible, to let everyone know that unless you have dealt with this kind of accident, you're either in the 1% or due for your turn. I'd like to think that sharing these stories might at least give someone some pause before they go ahead and throw caution to the wind.

Re: Tcl 9.0

#233

Earlier quoted context omitted.

I have upvoted you for each comment you've made, but I feel like it's not that simple. Even just getting a single vendor to implement it is a huge undertaking. I know that you and I see the value in it, but I don't feel like we're the first to see that. There's a reason behind not implementing this feature, and it's the complexity that lies behind such a feature, like most things. This seems like one of those recursi…

From the hip, maybe something like "UPDATE DRYRUN ...". It'd report how many rows would be updated. Or... "DRYRUN UPDATE ...", which is more like "EXPLAIN UPDATE..." Thoughts?

Sounds like a solid idea, but I feel like just replacing your UPDATE with a SELECT COUNT(whatever_column_is_indexed_from_your_where) would be a good practice. If your DBMS supports an external language, that might be the best idea, so you can write your own logic, while keeping mostly everything in the database itself.

I only mean this from a more ANSI SQL side of things, where you might want to build your skills up to use as much of the standard as possible, until it's no longer possible and make sense to dip into platform specifics. I used to build code around being cross-platform, but at the same time realized that it's more useful to learn the ANSI standard, and then break free with LOTS of useful comments where it makes sense to do things more efficiently and with safety that you don't get normally.

Re: Tcl 9.0

#234
post #42
post #8

The only time I’ve dealt with Tcl in recent memory was for some MacPorts portfile stuff. Anybody using it for something else and can speak to why you’d use it today? Genuinely curious; I don’t hate the language but can never bring myself to enjoy it either.

I used it a few times, mainly because of Freewrap. With very little code I was able to write a Windows app with GUI that I could distribute easily as an executable: - A backup app for an online sales application (inputs items and spits out a file); - An app to fix files in a buggy POS for a large retail chain (this might have been used in thousands of machines, I can't recall the details now); - A small app to copy F…

I don't know if you'll see this, since it was a couple days ago, and I've been reviewing multiple posts. I think what you describe is exactly what got me into programming (beyond a hobby, which was brought on by BASIC games in the 80's), but also what really hooked me into writing code for a living.

These all seem like a huge deal, unless you don't understand business and their needs. I can easily see how all four solutions could provide enormous value. For myself, these are the types of things that I got involved in programming professionally for. I think it's impressive that you were able to take a language like Tcl (not traditionally taught in university), and able to find a useful library to implement your logic.

Beyond BASIC games in the very early 80's, Visual Basic and the "hacking" tools for AOL, were a huge inspiration for myself. I dipped my toes into some weird libraries to solve some issues, that are still used today, in companies that you would never expect to be using something so simple and crude, but sturdy. Crash out with a useful message if something is wrong, do nothing on failure. Not for regular consumers, but perfect for internal staff that load data into a database, and can understand "row X is not compatible with this data type", or "This transformation rule fails because X occurred," being some rule that can't be expressed through SQL where the data is stored (but was able to be imported).

Re: Tcl 9.0

#235
post #167

Earlier quoted context omitted.

This is a great list. > * Safe interpreters let you do very fun things like config files in Tcl with limited access to the machine and master interpreter. I keep looking for similar functionality in Python (the scripting language of choice for many, nowadays) but I am always disappointed.

The python-esque sandboxed language is Starlark: https://github.com/google/starlark-go#documentation

This is great, but unfortunately it means you have to work with something different than Python (in developing, in deploying, etc.), doubling your dependencies.

Re: Tcl 9.0

#236
post #42

Earlier quoted context omitted.

I used it a few times, mainly because of Freewrap. With very little code I was able to write a Windows app with GUI that I could distribute easily as an executable: - A backup app for an online sales application (inputs items and spits out a file); - An app to fix files in a buggy POS for a large retail chain (this might have been used in thousands of machines, I can't recall the details now); - A small app to copy F…

I don't know if you'll see this, since it was a couple days ago, and I've been reviewing multiple posts. I think what you describe is exactly what got me into programming (beyond a hobby, which was brought on by BASIC games in the 80's), but also what really hooked me into writing code for a living. These all seem like a huge deal, unless you don't understand business and their needs. I can easily see how all four so…

This reminds me of something I wrote in Tcl at my previous employer - a little utility that could decode an in-house data format and display it in an understandable way. Quite a few other people found it useful for debugging issues.

Re: Tcl 9.0

#237

So I started playing with TCL for the first time this weekend after seeing this post, and here are my thoughts. I think the language is fun and much different than I’m used to, but my biggest challenge so far is just getting packages installed. There seems to be no current, modern, maintained package manager or central repository, and to do basic stuff like stand up a web server requires compiling from C source. Kind…

Take a look at http://www.ch-werner.de/LUCK.html . This site builds custom single-file Tcl executables for various architectures. It has a large selection of packages and you can choose which ones get included in the build. E.g if you select tclhttpd to be included in the build and name the output file tcluck, you can then start the web server by running: ./tcluck tcluck/tclhttpd3.5/bin/httpd.tcl

This is still using Tcl8.6 though, it will take time for all these packages to be updated to work with Tcl9.0. I am actually running tclhttpd with Tcl9.0 myself, after making a handful of tweaks for compatibility.

Re: Tcl 9.0

#238

So I started playing with TCL for the first time this weekend after seeing this post, and here are my thoughts. I think the language is fun and much different than I’m used to, but my biggest challenge so far is just getting packages installed. There seems to be no current, modern, maintained package manager or central repository, and to do basic stuff like stand up a web server requires compiling from C source. Kind…

I'm not familiar with JWT at all, but I found a description of how to generate an ES256 JWT from the command line: https://techdocs.akamai.com/iot-token-access-control/docs/ge... .

I don't know if this would meet your needs, but from Tcl you could use `exec` to run these commands and read the result.

Re: Tcl 9.0

#239
post #42

Earlier quoted context omitted.

I used it a few times, mainly because of Freewrap. With very little code I was able to write a Windows app with GUI that I could distribute easily as an executable: - A backup app for an online sales application (inputs items and spits out a file); - An app to fix files in a buggy POS for a large retail chain (this might have been used in thousands of machines, I can't recall the details now); - A small app to copy F…

I don't know if you'll see this, since it was a couple days ago, and I've been reviewing multiple posts. I think what you describe is exactly what got me into programming (beyond a hobby, which was brought on by BASIC games in the 80's), but also what really hooked me into writing code for a living. These all seem like a huge deal, unless you don't understand business and their needs. I can easily see how all four so…

It wasn't at all popular at uni, but one my teachers did use it and that's how I got to know it.

Her use case was to write visualization programs in C/C++ and then have Tcl/Tk as the GUI with buttons, inputs, etc.

Re: Tcl 9.0

#240

Earlier quoted context omitted.

If it's not a mistake then why they took it off?

The original design decision was to behave like a shell, where ~ means your own home dir and ~fred means fred's home dir. With the benefit of experience, this is now seen to be unwise and a different decision has been made.

So they copied the mistake from some shell (you don't need much experience to realize it's unwise not to use a separator to separate)
Post reply on HN