FYI:

WebAssembly backend merged into GHC :  https://www.tweag.io/blog/2022-11-22-wasm-backend-merged-in-ghc/
"The GHC RTS is way more robust, feature-complete and performant than asterius’s legacy JavaScript runtime."

Could it provide a simpler / more powerful way to run pandoc in the browser?

Regards,

Sébastien
Le lundi 7 novembre 2022 à 20:22:29 UTC+1, fiddlosopher a écrit :
Oh never mind, I see you're looking for an asterius build.

> On Nov 7, 2022, at 11:20 AM, John MacFarlane <fiddlo...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
> This is the one you want: https://hub.docker.com/r/pandoc/core
> It is always up to date with the latest release.
>
>> On Nov 7, 2022, at 8:56 AM, jcr <ffi.a...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>>
>> I've looked at this a couple of times since I last wrote. It turns out the latest Docker image is 2 years old, and apparently contains pandoc 2.9.2.1.
>>
>> So it looks like I have to do the full pandoc build with ahc-cabal. I installed the prerequisites, and started following the instructions to build Asterius, but immediately hit a snag when it asked me to run a script that isn't provided in the repo. It turns out the project now uses bazel, whatever that is, but the person who discovered this ran it and found that he couldn't execute the resulting binaries (see Asterius issue 894). So I don't feel encouraged to follow his example.
>>
>> I've had the idea of writing a stub in Python that would parse pandoc command line arguments and then use pandoc-server to do the actual processing. I'd just ignore options like -L that can't be implemented this way. It wouldn't be a great solution, but it would be adequate for some cases.
>>
>> If I do that, Lua filter support in pandoc-server would be very useful (most of my filters are indeed safe), but I see from the referenced issue that it's not coming soon.
>>
>> On Monday, October 17, 2022 at 4:47:08 PM UTC+2 fiddlosopher wrote:
>> If we could implement
>> https://github.com/jgm/pandoc/issues/8273 "safe mode for Lua filters"
>> then we could add Lua support to pandoc-server. (Of course, this assumes that
>> you wouldn't need to use any unsafe functions in your Lua filters.)
>>
>>
>>> On Oct 17, 2022, at 2:15 AM, ffi.a...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote:
>>>
>>> I was playing around with pandoc-server before I decided I needed the command-line program. It would work for some cases, but without Lua scripting, it wouldn't be adequate for the document builds. In theory, I could use pandoc-server to convert to a JSON AST, run a filter locally, and then send it back to the server for the next stage of conversion, but that seems slow and conplex.
>>>
>>> I probably won't work quickly on building pandoc with Asterius.
>>>
>>>> On Oct 16, 2022, at 7:58 PM, John MacFarlane <fiddlo...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>>>>
>>>> This would be cool, so let us know if you have any success with asterius. I haven't tried it myself. If you run into Haskell-specific problems, let us know and perhaps we can help.
>>>>
>>>> Note: for your iPad purposes, another alternative would be to run pandoc as a server somewhere. This is now very easy with `pandoc-server`. It is fairly full-featured, with the caveat that it runs in "safe mode," so you have to explicitly send all resources needed for compilation to the server (it won't be able to look for them on your local file system).
>>>>
>>>>> On Oct 16, 2022, at 8:20 AM, jcr <ffi.a...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>>>>>
>>>>> I would like to be able to run pandoc-based document builds on an iPad. This seems to be possible with the [a-Shell app](https://holzschu.github.io/a-Shell_iOS/). It provides a Unix-like shell with LaTeX (additional 1.3GB download), Python, Lua, and many command line utilities. C and C++ programs can be compiled to WebAssembly on the device and run there. It is also possible to cross-compile for a-Shell, using a [customized WASI-SDK](https://github.com/holzschu/wasi-sdk).
>>>>>
>>>>> [Asterius](https://github.com/tweag/asterius) compiles Haskell to WebAssembly, and there are a couple of demos that use it to run pandoc in a webpage, but the WebAssembly files they use offer a simple JavaScript interface to the Haskell pandoc function: (input, from format, to format) -> output. I need the full command line interface to run document builds. It looks possible, but since I've never used Haskell, its build tools, or WASI-SDK, I'm not sure how to go about this. There's a pre-built Docker container for Asterius with about 2000 packages from Stockage (I think I can guess what that is), but I don't know if I can use that, or if I have to rebuild everything from scratch using the customized WASI-SDK. After that, I guess I would download the pandoc source and follow the instructions for building it with cabal, using `ahc-cabal` in place of `cabal`. But if anything goes wrong with the cabal build, I'll be lost.
>>>>>
>>>>> Has anyone already done this?
>>>>>
>>>>>
>>>>> --
>>>>> You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
>>>>> To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/bfa54f4a-eedc-4e8e-8671-1aa9f6c63e1dn%40googlegroups.com.
>>>>
>>>> --
>>>> You received this message because you are subscribed to a topic in the Google Groups "pandoc-discuss" group.
>>>> To unsubscribe from this topic, visit https://groups.google.com/d/topic/pandoc-discuss/ivgH7zNPlNs/unsubscribe.
>>>> To unsubscribe from this group and all its topics, send an email to pandoc-discus...@googlegroups.com.
>>>> To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/5346511C-4B5D-42E9-B287-DB005CB4D005%40gmail.com.
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
>>> To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/ADB72C63-745E-4D50-9045-E60813FA08EB%40gmail.com.
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
>> To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
>> To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/626e5a36-6440-4be0-a5f6-9910f551ffc0n%40googlegroups.com.
>

--
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/0afec597-2662-487a-8e2d-6c74c85b3ca5n%40googlegroups.com.