Live data from Hacker News

Tcl 9.0

tcl-lang.org

121–130 of 247 posts

Re: Tcl 9.0

#121
post #86

Earlier quoted context omitted.

Super interesting, what's the rationale behind its use there?

John Ousterhout realized that every single EDA tool at Berkeley wound up implementing a crappy extension language. So, he implemented a language so that there could be a single, not-so-crappy extension language for the Berkeley EDA tools. He made C integration particularly easy (something the lisps of the time didn't really do). As his students spread out, each company they hit had a shitty extension language and the…

HyperCard existed.

Big missed opportunity for Tcl was the lack of a solid version of Tk for classic Mac (30 years ago). Would have made early Python less essential.

Re: Tcl 9.0

#122
post #95
post #65

Earlier quoted context omitted.

i once managed to create a directory named ~ using the mirror tool written in perl. then i naively tried to remove it using "rm -r ~" and started wondering why removing an empty directory would take so long, until it dawned on me... i learned a few new habits since then. i almost never use rm -r and i avoid "*" as a glob by itself. instead i always try to qualify "*" with a path, remove files first: "rm dir/*"; and t…

My main safety habit is to avoid slashless paths. Bad: rm * Okay: rm ./* rm /tmp/d/* rm */deadmeat rm d/* Then again, I commonly use dangerous things like `mv somefile{,.away}` that are easy to get wrong, so maybe don't trust my advice too much.

My safety technique is to echo the commands before I do the actual commands as a sanity check, e.g.

for i in $(find something); do echo "rm -f $i"; done

(bash example as my TCL is rusty)

Re: Tcl 9.0

#123
post #65

Earlier quoted context omitted.

One example from the document: > Consider the naive attempt to clean out the /tmp directory. > cd /tmp > foreach f [glob *] {file delete -force $f} > A file ~ or ~user maliciously placed in /tmp will have rather unfortunate consequences.

i once managed to create a directory named ~ using the mirror tool written in perl. then i naively tried to remove it using "rm -r ~" and started wondering why removing an empty directory would take so long, until it dawned on me... i learned a few new habits since then. i almost never use rm -r and i avoid "*" as a glob by itself. instead i always try to qualify "*" with a path, remove files first: "rm dir/*"; and t…

When deleting, if it is more than a few specifically named files I will use a "find ... -delete" invocation.

I like it for two reasons. Find feels like it has more solidly defined patterns and recursion than shell globing and by leaving off the "-delete" it give me a chance to inspect the results before committing to my actions.

Re: Tcl 9.0

#124
Great to see all the love for TCL here :) Too bad it's not more popular really but even I struggle to find cases where I'd prefer it. Usually it come down to bash for simple stuff and python everything else.

Re: Tcl 9.0

#125
post #86

Earlier quoted context omitted.

John Ousterhout realized that every single EDA tool at Berkeley wound up implementing a crappy extension language. So, he implemented a language so that there could be a single, not-so-crappy extension language for the Berkeley EDA tools. He made C integration particularly easy (something the lisps of the time didn't really do). As his students spread out, each company they hit had a shitty extension language and the…

HyperCard existed. Big missed opportunity for Tcl was the lack of a solid version of Tk for classic Mac (30 years ago). Would have made early Python less essential.

Tk was pretty usable for tcl/tk use cases on Mac by later 7.x releases, say 1996 or so. Still hard to get a really native UX on Windows or Mac though. HyperCard was already on its way out. 30 years ago is maybe closer than you think?

Re: Tcl 9.0

#126
post #124

Great to see all the love for TCL here :) Too bad it's not more popular really but even I struggle to find cases where I'd prefer it. Usually it come down to bash for simple stuff and python everything else.

I’ve recently discovered Tcl and absolutely love it! It’s such a fun language.

The starpacks/starkits for packaging apps together are really nice.

For anyone interested there’s a fork of the Tcl Dev Kit at: https://github.com/bandoti/tdk

This allows one to package applications with shared libraries and all bundled together.

Re: Tcl 9.0

#127
Language snobs and 1990s OO snobs really love to hate on tcl - yeah everything is a string or a command, and the OO extensions were kind of kludgy - but there's a design ethos to the ecosystem that is really special. Ditch tkinter, which is basically writing python to write tcl, and try doing a GUI in straight tcl/tk. Try the sqlite interface. Write a modest C extension or wrap a library. So much of it just works.

Re: Tcl 9.0

#128

Earlier quoted context omitted.

When it comes to SQL, I will often write a SELECT with very explicit search (WHERE) criteria for this very reason. Then copying that statement, commenting the original, and pasting to change into an UPDATE or DELETE statement seems to be a technique that works well for me. The SELECT tells me exactly what I'm going to UPDATE or DELETE, and once I have that, changing the syntax is very minimal. In the case of an ORM,…

I always write the where first. It's kinda like thinking in RPN or postfix. I put the parts in out of order in a way that prioritizes the minimization of error. But this is stupid. These are computers, we can make whatever we want. Executing a delete or update should, if one desires, not have to be database knifeplay.

I know what you mean, I do the same. I agree, but at the same time, it's difficult to start building in protections for the user. Where do you start and where do you stop? I have been forced to do the extreme to protect the user, and then you are asked why things are so difficult to use. I think to make something for someone that concentrates in the technology, as well as a beginner, means you've got to give up so much power (or create a secondary syntax/interface for both audiences). It would be nice to be able to set modes, but then it's going to be database specific unless it has proven itself to be useful across engines. Like most standardization, then you play syntax games between vendors. It would be nice to at least be able to write an UPDATE or DELETE statement with a leading character or keyword to display affected rows.

Re: Tcl 9.0

#129
post #86

Earlier quoted context omitted.

Super interesting, what's the rationale behind its use there?

John Ousterhout realized that every single EDA tool at Berkeley wound up implementing a crappy extension language. So, he implemented a language so that there could be a single, not-so-crappy extension language for the Berkeley EDA tools. He made C integration particularly easy (something the lisps of the time didn't really do). As his students spread out, each company they hit had a shitty extension language and the…

> You need a language that is small yet still complete. Even today, the only languages that really fit that bill are Scheme/Lisp, Tcl, and Forth.

Lua?

It's used in (and used for?) a lot of embedding:

* https://en.wikipedia.org/wiki/Lua_(programming_language)

Re: Tcl 9.0

#130
post #53

I can't overstate my love for Tcl, yet I had only a little chance to use it when writing XiRCON IRC scripts back in the late 90's. Such an elegant language: simple, easy to learn, flexible. I call it Lisp for humans. I wish it were more popular. So glad to see that it's still alive and kicking.

>I call it Lisp for humans.

Except for upvar.

Post reply on HN