POV-Ray : Newsgroups : povray.unix : X Windows display: disabled : Re: X Windows display: disabled Server Time
21 Mar 2023 22:29:45 EDT (-0400)
  Re: X Windows display: disabled  
From: jr
Date: 13 Oct 2018 19:30:01
Message: <web.5bc27eec6c2a6a24b0d4fc1e0@news.povray.org>

clipka <ano### [at] anonymousorg> wrote:
> Well, interfacing C++ to Tk (the library providing the GUI widgets)
> isn't so stupid. Might be an easy way to create a portable GUI. (Though
> I guess more modern frameworks like Qt make it even easier.)
> Shoehorning the Tcl syntax into C++, now that's pure madness of
> Lovecraftian proportions, as we apparently both agree.
> But it's fascinating that they get away without a parser. Presumably,
> stuff like
>     button(".b") -text("Say Hello") -command(hello);
>     pack(".b") -padx(20) -pady(6);
> works because they co-opt the arithmetic operator `-` for a totally
> different purpose that has nothing to do with arithmetics at all.

replace the parentheses with whitespace and you have two complete (well-formed,
I'd say) commands.  still, weird.

> >> I didn't even know C bindings for Tk existed; maybe they are more
> >> faithful to the target language.
> >
> > it's how it (Tcl) started.  as a C library to provide a "tool control language",
> > to drive other command-line apps.  Tk was (so I read) an effort to build on
> > Apple's HyperCard concept(s) but constrained by need to be modular.
> Don't confuse the two. Tcl is an iterpreted language.

s/is/was/  :-)

byte-compiles.  quite a number of years now.

> Tk is a library
> originally written for Tcl.


> When I say C bindings for Tk, I mean a direct interface from C to the Tk
> library, without having to use the Tcl interpreter as an intermediate layer.

have not done this myself but expect it to be a straightforward as using Tcl.
(after all, developed by the same people)

> >> I'm not sure how Tcl as a component in a C program would look like.
> >> After all, last time I checked, Tcl is a language, not a library.
> >
> > a really sharp language lawyer might argue it isn't even a language - as such,
> > more a set of (12) rules for parsing + substituting strings (EIAS =="everything
> > is a string").  Tcl has no reserved "keywords", any and all commands can be
> > renamed (or deleted).
> >
> > (as an analogy, think of each Tcl command as a separate "program", each taking
> > one or more argument "words" and returning one result (perhaps empty))
> That's what I always do. To me, Tcl is a shell-ish scripting language.

nor an uncommon view, I guess.   the simple syntax certainly leads some to
equate that with simple language.

regards, jr.

Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.