Live data from Hacker News

Wacl: Tcl distro customized for WebAssembly

fossil.e-lehmann.de

21–30 of 68 posts

Re: Wacl: Tcl distro customized for WebAssembly

#21
post #10
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.

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.

Assembly language also doesn't have GC or polymorphic inline cache. I imagine that direct DOM integration would end up just being some kind of shared memory thing.

I don't get this kind of complaint. It seems to completely miss the point that webassembly is a compile target, like arm or x86.

Re: Wacl: Tcl distro customized for WebAssembly

#22
Guys. Stay away. Tcl is awful if you want to write software that doesn't waste hours and hours and hours of your precious time hunting down simple bugs that would not have been an issue in most other languages.

- guy who used Tcl in like 1992 and helped write a 'compiler' for it, etc.

Re: Wacl: Tcl distro customized for WebAssembly

#23
post #10

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

Assembly language also doesn't have GC or polymorphic inline cache. I imagine that direct DOM integration would end up just being some kind of shared memory thing. I don't get this kind of complaint. It seems to completely miss the point that webassembly is a compile target , like arm or x86.

It is not a complaint. It is in their plans. They describe it sometimes in VM terms, versus ASM terms.

Without those things, languages like Perl or Python aren't practical, because you would have to download the whole interpeter runtime. That's not a complaint, it is an observation.

Re: Wacl: Tcl distro customized for WebAssembly

#24
post #13
post #5

Why 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?

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.

Re: Wacl: Tcl distro customized for WebAssembly

#25
post #23

Earlier quoted context omitted.

Assembly language also doesn't have GC or polymorphic inline cache. I imagine that direct DOM integration would end up just being some kind of shared memory thing. I don't get this kind of complaint. It seems to completely miss the point that webassembly is a compile target , like arm or x86.

It is not a complaint. It is in their plans. They describe it sometimes in VM terms, versus ASM terms. Without those things, languages like Perl or Python aren't practical, because you would have to download the whole interpeter runtime. That's not a complaint, it is an observation.

Well sure, but a runtime isn't going to change all that much. It's exactly the kind of thing that caches well. I mean a re-usable garbage collector sounds alright, but I don't think it will be used that much. I mean, I presume that you could implement a garbage collector as a shared library, but nobody actually does that.

Re: Wacl: Tcl distro customized for WebAssembly

#26
post #5

Why 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?

well, for me, when i used to like Tcl, it was

    * the everything is a string, mantra
    * meta-programming possibilities 
    * tcl wiki ( http://wiki.tcl.tk/ ) 
the tcl wiki is the reason i fell in love with wikis, my first wiki experience, and in my opinion when it was very active, it was home of a really nice community

I think if someone can rewrite tcl or a tcl like language, as the top level language, using a more modern low level language, like Rust or Go ... it will be a very nice combo, I think Tcl can serve as a really nice declarative language

If you look at Sqlite, it really is the perfect example of an offspring of the tcl community, a declarative solution for a complex problem , written in C ... a perfect tcl

I stopped following Tcl a long time ago, so I have no clue where it is at now ... but i hope it is still being used, for the super nice community .. it had/has

Re: Wacl: Tcl distro customized for WebAssembly

#27
post #23

Earlier quoted context omitted.

It is not a complaint. It is in their plans. They describe it sometimes in VM terms, versus ASM terms. Without those things, languages like Perl or Python aren't practical, because you would have to download the whole interpeter runtime. That's not a complaint, it is an observation.

Well sure, but a runtime isn't going to change all that much. It's exactly the kind of thing that caches well. I mean a re-usable garbage collector sounds alright, but I don't think it will be used that much. I mean, I presume that you could implement a garbage collector as a shared library, but nobody actually does that.

You have to come at it from the perspective of people that want languages like Perl or Python to run well in WASM. They are thinking of it being used the same way that javascript is today. If WASM has some of the features of a virtual machine (meaning the JVM type, not the hypervisor type), and direct DOM access, that would be possible. Downloading all of the runtime would put them at a disadvantage.

Those things are on the WASM roadmap. So this isn't just me going off on a tangent. https://github.com/WebAssembly/design/blob/master/GC.md

Re: Wacl: Tcl distro customized for WebAssembly

#28
post #15
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.

I know you're being encouraging, but I think you're underestimating the complexity of Perl parser. From what I remember, there were three subsystems that voted for each expression what programmer meant.

You are right, I'm completely ignorant on the topic haha. Could you clarify what you mean by "vote"?

Re: Wacl: Tcl distro customized for WebAssembly

#29
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…

That makes sense. Library compatibility is a tough issue to deal with. Scala.js faces the same issue when it comes to libraries that depend on the Java stdlib. I believe their goal is to port the entire stdlib, but I'm not sure tbh. It might just be an insurmountable problem.

Re: Wacl: Tcl distro customized for WebAssembly

#30
post #28
post #15

Earlier quoted context omitted.

I know you're being encouraging, but I think you're underestimating the complexity of Perl parser. From what I remember, there were three subsystems that voted for each expression what programmer meant.

You are right, I'm completely ignorant on the topic haha. Could you clarify what you mean by "vote"?

Perl has some syntax that can be ambiguous. To the point that some code can't be parsed without running it.

See this for more on that: http://www.perlmonks.org/?node_id=663393

Post reply on HN