
Tcl Static Prime: experimental compiler for Tcl that produces C or Java code - blacksqr
https://github.com/tpoindex/tsp
======
jrapdx3
No one has mentioned the very Lisp-like nature of Tcl, and that includes the
property of homoiconicity. This makes many programming patterns easy to
implement in Tcl. Increasingly Scheme/Lispy features have been added, which
makes it even more appealing.

Indeed the language is notable for great flexibility and adaptability, nearly
every aspect can be modified to the point it resembles completely different
programming languages.

Way back in the 90's I started using Tcl/Tk because it was easy to create GUI
applications I needed for my business. Over the years I've employed it for
many purposes, including client/server apps that today we might use Websockets
to implement.

Tcl's stability is valuable. A couple of days ago, I was maintaining a
"legacy" server which runs a key business app written in Tcl. The most recent
timestamp of the Tcl source was >10 years old, and running glitch free for
even longer. Sure doing it today I might do it differently, but I can't
complain about "bang for the buck".

------
gluczywo
I didn't believe I'd see the day when a larger Tcl project reaches HN front
page. This looks really exciting and ambitious. John Ousterhout mentioned in
one of the interviews that he regrets he didn't manage to produce the Tcl
compiler while working in Sun.

While in my day to day work I don't feel the need for the compiler (starkits
are good enough) it might attract more performance concerned people to this
powerful but forgotten language.

For me returning to Tcl is always an immense pleasure. This is what it gives
out of the box:

    
    
      - convenience of bash
      - power and elegance of Lisp
      - self-containing no-dependency nature of Go
      - clarity of Python
      - probably unique for the entire industry reliable cross-platform GUI toolkit
      - simplicity of Dodecalogue
    

What Tcl is missing:

\- good handle on concurrency in bigger projects (with scale, events lead to
spaghetti or mega state machines). I tried to address this one myself by
developing Golang/CSP style concurrency library
[https://github.com/securitykiss-com/csp](https://github.com/securitykiss-
com/csp)

\- large community

------
meeper16
This is completely awesome. Tcl has been around for quite a while and is very
mature although it lacks the massive libs and support of Python it's still my
language of choice when it comes to data science.

------
marktangotango
To anyone who upvoted this, can you relate why one may consider using TCL
today? What are it's strengths and weaknesses compared to other 'common'
scripting languages ie python, lua, ruby, ... ? And why is translation and
static compilation desireable?

~~~
0xdeadbeefbabe
I'm familiar with parts of TCL, but I still can't arrive at a good answer for
those questions.

It has a unique (wild and strange) feature called upvar that I haven't seen in
python or lua. You "use" it to reference a previous frame in your call stack.

~~~
davidw
You can use upvar and uplevel to write control structures (if, while, that
kind of thing) in Tcl itself. For instance, Tcl itself does not have a do ...
while loop, but you can write one that will look like it's part of the
language.

Also: it's Tcl, by the way, not TCL.

~~~
beagle3
Lua has something called an "upvalue" but it's a completely different thing.

Lobster[0] also lets you write do/while loops and new conditionals, but does
that in a different way that does not require upvar/uplevel, and is IMHO
cleaner. (It is less capable in general, but captures 99% of the use cases
that I've seen for upvar/uplevel in Tcl)

It is indeed Tcl, but it IS an acronym for "Tool Command Language", or at
least started out that way.

[0] [http://strlen.com/lobster](http://strlen.com/lobster)

~~~
sigzero
The acronym is true but the community uses Tcl now and has for quite a while.

~~~
amyjess
Stuff like this intrigues me, from a linguistic perspective.

I'm really curious what lead to the community settling on this. You'll
occasionally see all-lowercase in some projects thanks to the fact that *nix
commands are usually all-lowercase, but title-casing an acronym is weird.

If I had to hazard a guess, I'd say it's because "Tcl" is typically pronounced
as a word ("tickle"), so it got de-acronymized like "radar" or "scuba". Then
again, nobody writes SCSI as Scsi. I'd love to study this some more...

~~~
davidw
My guess: it's kind of a fashion thing. FORTRAN and COBOL and FORTH and
whatnot are a bit old fashioned looking.

[https://en.wikipedia.org/wiki/Fortran#Naming](https://en.wikipedia.org/wiki/Fortran#Naming)

------
616c
I am curious about this because different camps scream about its "everything
is a stringish thing casted as needed" type of language. (I know that is an
oversimplification, but hear me out.)

I wonder how that translates, at all or well, to compiling languages like
Java.

Will have to read on. Sounds neat!

