Remix.run Logo
iberator 9 hours ago

best thing about TCL is easy syntax and that everything is a string :) Unique and simple and easy language with very slow changes.

Something like Python in good old days of 2.x before young internet javasceipt devs started pouring A LOT of new features to the language (feature creep).

Nowadays Python is so complex and flooded with ex C, C++, Java, JavaScript, Haskell programmers adding so many features, so fast that it's impossible to follow and understand them :(

Languages should not evolve on that rate. No time to master it :(

/rant

pjmlp 6 hours ago | parent | next [-]

Tcl has stopped being everything a string with the release of Tcl 8.0 and bytecode engine.

> In earlier versions of Tcl, strings were used as a universal representation; in Tcl 8.0 strings are replaced with Tcl_Obj structures ("objects") that can hold both a string value and an internal form such as a binary integer or compiled bytecodes.

http://www.ira.inaf.it/Computing/manuals/tcl/man-8.0/Changes...

I remember this quite well, because as part of the core team tasked with writing native C extensions, the migration to Tcl 8 had quite an impact on our code.

I learned Python with version 1.6, and have a few O'Reilley books proving the point the language wasn't really that simple, those that never bothered reading the reference manuals end-to-end though it was.

apgwoz 3 minutes ago | parent [-]

There have always been attempts at caching non-string values in Tcl for performance gains, but the semantics are the same. The value’s types are whatever the operator requires and an error when not compatible. If, internally, $x is an integer, and you pass it to a string function, well, $x gets temporarily turned into a string. Dynamic with “weak” types.

robinsonb5 7 hours ago | parent | prev | next [-]

There's certainly something to be said for stable, uncomplicated and minimalist tooling that wont evolve out from under you and leave you with something that won't just-work five years from now.

I guess that's why Tcl is so popular in the EDA arena. I can stick some custom JTAG tooling in a Cyclone II design and talk to it by Tcl-scripting the 15-year-old software - and be confident that the same code (both in the FPGA and on the host computer) would work with the latest software and a current device.

Having said that, Tcl's not entirely free of compatibility and fragmentation frustrations: I sometimes wish that OpenOCD used full-fat Tcl rather than JimTcl, just so that I could make use of Tk. Being able to plot a histogram of data collected from the FPGA or make clickable buttons to trigger events is very useful.

tverbeure 2 hours ago | parent | prev | next [-]

The worst thing about tcl is that it exists... and it's still the language of choice for EDA tools.

xantronix an hour ago | parent [-]

I'd be curious to know what your experiences with Tcl have been, to better understand why you feel this way.

tonyedgecombe 8 hours ago | parent | prev | next [-]

I agree, so much for the benevolent dictator idea.

Pay08 8 hours ago | parent | prev | next [-]

That's certainly a take...

IshKebab 9 hours ago | parent | prev [-]

> best thing about TCL is easy syntax and that everything is a string :)

What? That's the worst thing about TCL.

iberator 8 hours ago | parent | next [-]

I love it. Living proof that languages doesn't need forced types.

Data is Data. It's kinda object programming as visioned in the 70".

So easy and trivial language.

IshKebab 5 hours ago | parent [-]

> Living proof that languages doesn't need forced types.

The opposite surely? TCL is practically dead, and only lingers on in the EDA industry (which has zero taste). Virtually every successful language today has at least a few different basic types for numbers, arrays, strings, maps and so on.

ux266478 2 hours ago | parent | next [-]

TCL's typicing discipline comes from shell languages and awk, which are decidedly not dead. The overwhelming majority of programmers have less than no taste, so language usage rates in general don't really mean much.

bmacho 5 hours ago | parent | prev [-]

Tcl has these types as well. They are special strings.

Number: string of digits. List: strings separated by space. Dictionary: key value pairs in a list.

antirez 7 hours ago | parent | prev | next [-]

It depends on the use case. For instance you open a socket, write there any value you have without serialization, read it in the other side, data transfer done.

petcat 6 hours ago | parent [-]

The convenience of not having to marshal data over a network is certainly a use case. But I'll admit that two of the worst programs I ever saw were written in Perl and TCL. Somehow just a big jumble of inscrutable regexes.

When "everything is a string" then you have no choice but to literally treat everything as a string. Painful. Very cool project though.

graemep 5 hours ago | parent [-]

That sounds more like someone who over-uses regexes - the developer is the problem, not the language

TCL has a lot of options for manipulating strings - take a look at just the built in string command for a start: https://www.tcl-lang.org/man/tcl8.4/TclCmd/string.htm

I have seen terrible code in Python, C, and more.

bmacho 7 hours ago | parent | prev [-]

It's only the interface that is of a string. An array is a list of strings with space between, but only for the programmer. The runtime is free to use an actual array.

IshKebab 5 hours ago | parent [-]

I'm aware. It's awful because of the implications for the programmer, not the runtime.