Live data from Hacker News

Wacl: Tcl distro customized for WebAssembly

fossil.e-lehmann.de

41–50 of 68 posts

Re: Wacl: Tcl distro customized for WebAssembly

#41
post #36

Earlier quoted context omitted.

> - uses [ and ] for subexpressions instead of ( and ), which makes typing easier I would like to point out that in several non-US keyboard layouts, [ and ] are harder to type, not easier. For instance, on German keyboards, they are mapped to Right-Alt (AltGr) + 8/9, which is quite annoying to type compared to normal parentheses (which are mapped to Shift+8/9, with Shift being better placed and available on both the…

As a German I haven't use a German keyboard layout in years because the US layout easier in most cases (for examole all those curly braces in TeX).

All my colleagues would agree and did the same. I don't. I want äöü quickly available for chatting and other "quick" writing, while coding typing is usually not the bottleneck.

Re: Wacl: Tcl distro customized for WebAssembly

#42
post #31
post #24

Earlier quoted context omitted.

My usual solution for this is C++/Qt. Runs well on Linux, and on Windows you can statically link Qt into the single .exe if your small app is FOSS (at least LGPL-compatible), otherwise you should ship a few extra .dll files. Compared to Tcl/tk you get (A) catch errors at compile time, and (B) Qt apps usually look better than Tk apps. With mxe+qmake it's one command to cross-compile from Linux to a Windows binary.

I am now looking at the Red programming language [1] for exactly this, but it does not have the libraries of C++ or Tcl. Still it is under 1 meg complete with libraries and it is homoiconic, cross-platform, and has a REPL and a systems language Red/System for going low level. The GUI and UI DSL and drawing DSL work on Windows and Mac for now, with Linux close behind. [1] http://www.red-lang.org/p/about.html

The default download didn't have GUI support on my Mac when I just tried it, and the documentation seems to indicate it's Windows only so far?

Re: Wacl: Tcl distro customized for WebAssembly

#43
post #24
post #13

Earlier quoted context omitted.

There's a situation that springs up sometimes that is perfect for Tcl/Tk: when you need to write a small app with a GUI and you would like it to be multiplatform. Say you want to write an app to rename files in batch, or a wrapper for Ghostscript that automates certain tasks. With Tcl/Tk you can immediately run it on most Linux distros and with Freewrap you get a Windows executable that's a few MB+your source (it's a…

My usual solution for this is C++/Qt. Runs well on Linux, and on Windows you can statically link Qt into the single .exe if your small app is FOSS (at least LGPL-compatible), otherwise you should ship a few extra .dll files. Compared to Tcl/tk you get (A) catch errors at compile time, and (B) Qt apps usually look better than Tk apps. With mxe+qmake it's one command to cross-compile from Linux to a Windows binary.

Back in the day a big mistake from Tk devs was how it just looked like Motif everywhere.

Eventually that got fixed, but we were already busy with other languages.

Re: Wacl: Tcl distro customized for WebAssembly

#44
post #18
post #7

Earlier quoted context omitted.

It's an elegant, lightweight language, with a design thoroughly optimized for interactive use. http://yosefk.com/blog/i-cant-believe-im-praising-tcl.html .

Thanks, this blog post was exactly the sort of discussion I was looking for! The TL;DR: - easy to write interactively because there's no fiddling with the parens, quoting, or commas you find in JS, Ruby, or Python - uses [ and ] for subexpressions instead of ( and ), which makes typing easier - "command" oriented, instead of "expression" oriented - saner than shell while having many of the same advantages

Pragmatically it is actually a giant pain to use. Its bizarre text substitution semantics are hugely unintuitive compared to modern languages.

Re: Wacl: Tcl distro customized for WebAssembly

#45
post #18
post #7

Earlier quoted context omitted.

It's an elegant, lightweight language, with a design thoroughly optimized for interactive use. http://yosefk.com/blog/i-cant-believe-im-praising-tcl.html .

Thanks, this blog post was exactly the sort of discussion I was looking for! The TL;DR: - easy to write interactively because there's no fiddling with the parens, quoting, or commas you find in JS, Ruby, or Python - uses [ and ] for subexpressions instead of ( and ), which makes typing easier - "command" oriented, instead of "expression" oriented - saner than shell while having many of the same advantages

I would also add that the "Everything is a String" paradigm makes it simple to reason about somewhat complex concepts. You don't have to try to teach beginners about objects and pointers. Just plain old text strings. Everything else is under the hood.

I miss some features of more modern languages though. TclOO (object-oriented extension) is minimally useful but lacks GC, so you have to keep track of all objects to manually destroy them when you are done. I miss easily passing around functions (procs), and saner local namespacing for functions (ie like in python). Exception handling is also a bit of a pain.

A lot of these things are addressed in Jim Tcl, but it hasn't seen much adoption.

http://jim.tcl.tk/index.html/doc/www/www/index.html

Re: Wacl: Tcl distro customized for WebAssembly

#46
post #9

Earlier quoted context omitted.

A fair amount of the popularity was being the first scripting language with a reasonably complete, cross platform, UI widget toolkit. It was also very easy to embed inside a C application for a user facing scripting capability.

> A fair amount of the popularity was being the first scripting language with a reasonably complete, cross platform, UI widget toolkit. That wasn't my experience. At least in tcl/tk 8.5 things like zooming in/out of a tk canvas or updating a progress bar were a real pain. For example, tk canvas has this nice, seemingly simple subcommand called "scale" that looks like it does exactly what it's called with a tag and tw…

Tcl 8.5 is a recent release though, around 2007.

When GP says "one of the first scripting languages with a GUI toolkit", he is talking about the early 1990s. Before even python's first release. In fact, python ended up with Tk as it's stdlb GUI package because that was what was available.

Sure, Tk will never live up to Qt, but in 1991, I bet it was quite impressive to have a relatively simple yet expressive language like Tcl that shipped with a cross platform GUI toolkit, all under a very permissive license.

Re: Wacl: Tcl distro customized for WebAssembly

#47
post #46

Earlier quoted context omitted.

> A fair amount of the popularity was being the first scripting language with a reasonably complete, cross platform, UI widget toolkit. That wasn't my experience. At least in tcl/tk 8.5 things like zooming in/out of a tk canvas or updating a progress bar were a real pain. For example, tk canvas has this nice, seemingly simple subcommand called "scale" that looks like it does exactly what it's called with a tag and tw…

Tcl 8.5 is a recent release though, around 2007. When GP says "one of the first scripting languages with a GUI toolkit", he is talking about the early 1990s. Before even python's first release. In fact, python ended up with Tk as it's stdlb GUI package because that was what was available. Sure, Tk will never live up to Qt, but in 1991, I bet it was quite impressive to have a relatively simple yet expressive language…

This. For a period of time in the 1990-1999 range, Tcl/Tk was often the only way to have a cross platform program with a GUI that did not require the language equivalent of #ifdef WINDOWS/#ifdef UNIX everywhere. Which while providing "one code base, two platforms" really meant writing the platform specific code twice.

For most Tcl/Tk usage at the time the same, unchanged, no "ifdef"'s present Tcl/Tk script would run identically on the various environments that it supported.

Re: Wacl: Tcl distro customized for WebAssembly

#48

Of interesting historical note, the W3C HTML 4 standard alludes to TCL as a possible scripting language when describing the script tag, albeit just as an example: https://www.w3.org/TR/html4/interact/scripts.html

At one point, very early in the web's infancy, before Javascript became "the one" web language, Sun was considering Tcl for the role that Javascript took over in the tag.

Re: Wacl: Tcl distro customized for WebAssembly

#50
post #41

Earlier quoted context omitted.

As a German I haven't use a German keyboard layout in years because the US layout easier in most cases (for examole all those curly braces in TeX).

All my colleagues would agree and did the same. I don't. I want äöü quickly available for chatting and other "quick" writing, while coding typing is usually not the bottleneck.

Is there a German keyboard layout such as?:

AltGr + a -> ä

AltGr + o -> ö

AltGr + u -> ü

I'm Polish and I'm very glad that our most common layout is like that for ąćęłńóśźż (with AltGr + x for ź). Currently I'm in Germany and I wonder if there is similar layout for German umlauts.

Post reply on HN