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.
Wasm has no facility for GC, polymorphic inline cache, or direct DOM integration. They are on the roadmap, but probably far off. So there isn't a direct path to WASM for many dynamically typed languages. Tcl can get by without all that because it's small enough to just port the whole C interpreter instead of trying to have tcl compile down to wasm. That would be very large, slow, and tricky for Perl, Python, etc.
Wacl: Tcl distro customized for WebAssembly
11–20 of 68 posts
Re: Wacl: Tcl distro customized for WebAssembly
#12I'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.
Wasm has no facility for GC, polymorphic inline cache, or direct DOM integration. They are on the roadmap, but probably far off. So there isn't a direct path to WASM for many dynamically typed languages. Tcl can get by without all that because it's small enough to just port the whole C interpreter instead of trying to have tcl compile down to wasm. That would be very large, slow, and tricky for Perl, Python, etc.
It shouldn't, GC is a level above Wasm and would complicate languages that don't use it.
> or direct DOM integration
You mean like this: https://github.com/tcr/rust-webplatform ?
The problem with most dynamic langauges you listed is they do things that the web doesn't allow or do them in ways that aren't friendly to a browser.
Re: Wacl: Tcl distro customized for WebAssembly
#13Why do people like Tcl? I've never tried diving in to using the language, but I have debugged MacPorts now and then, which is all Tcl, and I've seen that Tcl UI library used in other scripting languages. What's the draw, other than having some existing code written in the language? Gems like the `upvar` command? ( http://wiki.tcl.tk/1508 ) Is there something special about Tcl that makes it a joy to use?
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 lot better than having your users install Java).
Re: Wacl: Tcl distro customized for WebAssembly
#14Earlier quoted context omitted.
I've tried. It's just hard, frankly. I'm just not that good a coder :(
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.
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_here transpiler is not going to be very interesting.
Re: Wacl: Tcl distro customized for WebAssembly
#15Earlier quoted context omitted.
I've tried. It's just hard, frankly. I'm just not that good a coder :(
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.
Re: Wacl: Tcl distro customized for WebAssembly
#16I'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.
Wasm has no facility for GC, polymorphic inline cache, or direct DOM integration. They are on the roadmap, but probably far off. So there isn't a direct path to WASM for many dynamically typed languages. Tcl can get by without all that because it's small enough to just port the whole C interpreter instead of trying to have tcl compile down to wasm. That would be very large, slow, and tricky for Perl, Python, etc.
Re: Wacl: Tcl distro customized for WebAssembly
#17Why do people like Tcl? I've never tried diving in to using the language, but I have debugged MacPorts now and then, which is all Tcl, and I've seen that Tcl UI library used in other scripting languages. What's the draw, other than having some existing code written in the language? Gems like the `upvar` command? ( http://wiki.tcl.tk/1508 ) Is there something special about Tcl that makes it a joy to use?
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.
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 two double-precision floats. Apply it and all the relevant tk items are scaled accordingly. It even has a predefined tag called "all" that applies to all current tk canvas items. Trivial. Awesome.
Except text items don't get scaled. And font sizes are limited to integer pixel/point sizes. So zooming is actually non-trivial. Not awesome.
There are a sufficient number of such idiosyncracies that if you want to make a clear, usable interface you end up battling the toolkit.
Also, on the tcl language level I felt the "everything is a string" feature gets in the way. I'd much rather have implicit expressions and explicit string declarations.
Re: Wacl: Tcl distro customized for WebAssembly
#18Why do people like Tcl? I've never tried diving in to using the language, but I have debugged MacPorts now and then, which is all Tcl, and I've seen that Tcl UI library used in other scripting languages. What's the draw, other than having some existing code written in the language? Gems like the `upvar` command? ( http://wiki.tcl.tk/1508 ) Is there something special about Tcl that makes it a joy to use?
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 .
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
Re: Wacl: Tcl distro customized for WebAssembly
#19Earlier quoted context omitted.
Wasm has no facility for GC, polymorphic inline cache, or direct DOM integration. They are on the roadmap, but probably far off. So there isn't a direct path to WASM for many dynamically typed languages. Tcl can get by without all that because it's small enough to just port the whole C interpreter instead of trying to have tcl compile down to wasm. That would be very large, slow, and tricky for Perl, Python, etc.
> Wasm has no facility for GC It shouldn't, GC is a level above Wasm and would complicate languages that don't use it. > or direct DOM integration You mean like this: https://github.com/tcr/rust-webplatform ? The problem with most dynamic langauges you listed is they do things that the web doesn't allow or do them in ways that aren't friendly to a browser.
Oh, and on direct DOM access. You presented a link to an implementation of indirect DOM access. They have an open issue you might find interesting: https://github.com/tcr/rust-webplatform/issues/20
Re: Wacl: Tcl distro customized for WebAssembly
#20Earlier 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…