4 ms·
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 compu
by grondilu 9y ago
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.
- mstade 9y agoSounds like an opportunity to step up to the plate!
- grondilu 9y agoI've tried. It's just hard, frankly. I'm just not that good a coder :(
- Cyph0n 9y agoEhh 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.
- BenGoldberg 9y agoThe 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_here transpiler is not going to be very interesting.
- Cyph0n 9y agoThat 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.
- petre 9y agoActually 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.
- dozzie 9y agoI 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.
- Cyph0n 9y agoYou are right, I'm completely ignorant on the topic haha. Could you clarify what you mean by "vote"?
- tyingq 9y agoPerl 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 http://www.perlmonks.org/?node_id=663393
- tyingq 9y agoWasm 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.
- kodablah 9y agoGC is not as far off as you might think. A markdown overview has been merged and there is a PR for impl in the interpreter. See PRs at https://github.com/WebAssembly/gc https://github.com/WebAssembly/gc
- deleted 9y ago[deleted]
- vvanders 9y ago> 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 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.
- tyingq 9y agoOn GC, maybe you should let them know. They seem to be headed down that path: https://github.com/WebAssembly/design/blob/master/GC.md https://github.com/WebAssembly/design/blob/master/GC.md 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 https://github.com/tcr/rust-webplatform/issues/20
- traverseda 9y agoAssembly 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.
- petre 9y agoThere 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.