Live data from Hacker News

Wacl: Tcl distro customized for WebAssembly

fossil.e-lehmann.de

31–40 of 68 posts

Re: Wacl: Tcl distro customized for WebAssembly

#31
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.

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

Re: Wacl: Tcl distro customized for WebAssembly

#32
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

There's also Lazarus in this category.

Re: Wacl: Tcl distro customized for WebAssembly

#34
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 a number of examples:

https://www.w3.org/TR/html4/interact/scripts.html

AFAIK no vendor took them up on even claiming to think about supporting tcl at the time

Re: Wacl: Tcl distro customized for WebAssembly

#36
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

> - 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 left and right side of the keyboard).

Re: Wacl: Tcl distro customized for WebAssembly

#37
post #2

I'm a Perl fan and as such it saddens me to see other languages targeting wasm. I've been convinced for a while that webassembly is the next big thing in computing and so far the Perl community as far as I know has shown close to no interest whatsoever.

There would be several options I think.

  - translate MoarVM bytecode to WASM
  - add WASM as a Rakudo target
  - write yet another Perl6 compiler that targets the WASM just as niecza targets the CLR
Perl5 will probably end up as a Perl6 slang.

Re: Wacl: Tcl distro customized for WebAssembly

#38
post #36
post #18

Earlier quoted context omitted.

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

> - 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).

Re: Wacl: Tcl distro customized for WebAssembly

#39
post #6

Earlier quoted context omitted.

Ehh I don't think so. I'm certain that you are a good coder. You just need to learn more about the techniques needed to implement a Perl to WASM compiler, and obviously, a ton of time. You can do it man.

The stuff which makes perl really awesome are the distributions on CPAN. Many (though not all) of these distributions contain XS, which is a type of glue between perl and C. Most of these XS distributions are there to link to some library -- Math::GMP, for example, lets perl code use the GNU gmp multi precision math library. Without some way to make use of distributions with XS parts, then a perl to $other_language_h…

Actually quite few are XS and XS is painful/a terrible way to plug C code inside of the Perl interpreter's guts. For this reason Perl6 aims to rewrite most of the stuff in Perl6/NQP and use NativeCall to call on external libraries.

Re: Wacl: Tcl distro customized for WebAssembly

#40

At long, overdue, too late last... In the very early days of the web, I used to fantasize - naively - about the whole undignified html hodgepodge never having happened, and the entire web just running on served-up tcl/tk.

If you've ever placed a sports bet anywhere in the world online, chances are your bet went through Tcl code front and back. I spent 15 years writing it.
Post reply on HN