public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: John MacFarlane <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org>
To: Kolen Cheung
	<christian.kolen-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	pandoc-discuss
	<pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: Re: Inclusivity Issues for new contributors
Date: Wed, 22 May 2019 09:36:41 -0700	[thread overview]
Message-ID: <yh480kef4qpht2.fsf@johnmacfarlane.net> (raw)
In-Reply-To: <6b58c3f2-ba94-4f0d-8e3f-3c3bf4c71c73-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>


It would not be hard at all to create a C binding
for pandoc that allowed you to do everything you can
do from the command line.

See
http://hackage.haskell.org/package/pandoc-2.7.2/docs/Text-Pandoc-App.html

The convertWithOpts function would be easy to wrap
in C, since the Opt structure has a FromJSON instance.
So a C function could be exported that took as input
a JSON-encoded specification of the options.

Exposing individual pandoc readers would also be
fairly easy; ReaderOptions is an instance of FromJSON,
and there's a JSON representation of the AST.

I see that WriterOptions is not an instance of
FromJSON.  I can't recall why, but it's likely because
writerSyntaxMap.  (Syntax in skylighting isn't an
instance of FromJSON.)  But this could easily be
fixed; it would be trivial to derive FromJSON for
the skylighting types.

Another thing we could fairly easily do is create a
pandoc-server program that keeps running and responds
to HTTP.

Kolen Cheung <christian.kolen-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

> I also think your issue 3 mis-classify pandoc.
>
> IMO an interface besides cli that is sorely needed is an easy to use API, not GUI. Certainly pandoc can be used as a Haskell library, but besides that probably not. Eg all existing Python interface are a wrapper of the cli which is “wrong”, eg a lot of performance penalty to call pandoc repeatedly.
>
> While issue 1 or 2 might probably be true, the biggest barrier of getting involved is the language, Haskell. I think this is the biggest barrier of all and the 2 you mentioned is almost negligible comparing to this. Using myself as an example, I overcome issue 1 and 2 with relatively little effort. But I haven’t ever overcome the language barrier to be able to contribute to pandoc on non trivial tasks. And it is my regret that my “day job” doesn’t have room for the use of Haskell so that spending time mastering it is impossible for me.
>
> So as long as pandoc is still written in Haskell, I think pandoc will not be “inclusive” for new contributors who likely don’t know Haskell beforehand (just by probability from such small community.)
>
> However, note that (at least claimed by jgm) it would be impossible to accomplish what pandoc did if not written in Haskell. Also note that there’s independent parser to pandoc AST (sadly the only living one I know is closed source) which provides a subset of what pandoc does.
>
> Also, ironically to solve the API problem I mentioned in the beginning, probably the best path towards it is first turing pandoc as a purely Haskell program (currently depends on Pearl’s regex, some C libraries such as YAML and libCommonMark, etc.) It is because if the program is Haskell only it allows it to be transpiled to eg Javascript. I personally would hope that it could be transpiled to C, or officially exposing a C FFI to be bind in other languages. (Libpandoc hasn’t been updated for 2 years.)
>
> -- 
> 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/6b58c3f2-ba94-4f0d-8e3f-3c3bf4c71c73%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/yh480kef4qpht2.fsf%40johnmacfarlane.net.
For more options, visit https://groups.google.com/d/optout.


  parent reply	other threads:[~2019-05-22 16:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-21 17:44 Aseem Prashar
     [not found] ` <7231afe1-fd0a-4e7d-93ce-fadb9030a244-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2019-05-21 19:02   ` Lukas Atkinson
2019-05-22  0:13   ` Kolen Cheung
     [not found]     ` <6b58c3f2-ba94-4f0d-8e3f-3c3bf4c71c73-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2019-05-22 16:36       ` John MacFarlane [this message]
2019-05-22  9:36   ` BPJ
2019-05-22 17:57   ` mb21
2019-06-03 21:00   ` CR

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=yh480kef4qpht2.fsf@johnmacfarlane.net \
    --to=jgm-tvlzxgkolnx2fbvcvol8/a@public.gmane.org \
    --cc=christian.kolen-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).