Live data from Hacker News

Asterius – Haskell to WebAssembly Compiler

github.com

11–20 of 36 posts

Re: Asterius – Haskell to WebAssembly Compiler

#14
post #12

I'm curious how they solve garbage-collection, since last time I checked WebAssembly doesn't yet support that?

Most likely the same way as in any hardware CPU without support for GC memory tagging.

What is hw support for GC mem tagging? I didnt realize such a thing existed.

Re: Asterius – Haskell to WebAssembly Compiler

#15

I'm curious how they solve garbage-collection, since last time I checked WebAssembly doesn't yet support that?

C and ASM don't have a GC either, and yet we can build GC collected languages on top of them. So it will be eventually be solved in the same fashion: By building a runtime environment on top of the underlying machine, which performs memory management incl. garbage collection.

Depending on how the runtime for "native Haskell" is implemented, the effort might be everything from just cross-compile it to building a completely separate runtime.

Re: Asterius – Haskell to WebAssembly Compiler

#16

I'm curious how they solve garbage-collection, since last time I checked WebAssembly doesn't yet support that?

C and ASM don't have a GC either, and yet we can build GC collected languages on top of them. So it will be eventually be solved in the same fashion: By building a runtime environment on top of the underlying machine, which performs memory management incl. garbage collection. Depending on how the runtime for "native Haskell" is implemented, the effort might be everything from just cross-compile it to building a compl…

In assembly language, you can build an accurate garbage collector for your assembly language application. There are no hidden "not user servicable" areas in the run-time, like in C. You can set up your calling and framing conventions so the GC can trace the stack and know exactly where the root pointers are.

Re: Asterius – Haskell to WebAssembly Compiler

#17

Client-side pandoc would actually be reaaaal interesting

As far as I'm concerned, it already exists in two forms: 1. https://try.pandoc.org/ 2. http://markup.rocks/

Are those sites using Emscripten or just passing your docs to a server to process?

Re: Asterius – Haskell to WebAssembly Compiler

#18
post #14
post #12

Earlier quoted context omitted.

Most likely the same way as in any hardware CPU without support for GC memory tagging.

What is hw support for GC mem tagging? I didnt realize such a thing existed.

It's something that has been researched, but not deployed. It would implement GC memory tagging in the CPU or even the memory controller. Google Scholar should produce some good hits.

Re: Asterius – Haskell to WebAssembly Compiler

#19

Surprised to see that no one has mentioned GHCJS " rel="nofollow">https://github.com/ghcjs/ghcjs> still. I have used it[0] a year ago and despite my shallow understanding of Haskell, I have managed to port my CLI app to Haskell fairly easily! [0]: https://github.com/boramalper/boolexman

My experiences with GHCjs have been positive, though admittedly not very deep.

Re: Asterius – Haskell to WebAssembly Compiler

#20
post #17

Earlier quoted context omitted.

As far as I'm concerned, it already exists in two forms: 1. https://try.pandoc.org/ 2. http://markup.rocks/

Are those sites using Emscripten or just passing your docs to a server to process?

Markup.rocks says it is client side and appears to be using ghcjs: https://github.com/osener/markup.rocks/blob/master/Makefile#...
Post reply on HN