public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* What if pandoc were rewritten today?
@ 2021-09-30 11:51 Alex Shaw
       [not found] ` <1784a254-0585-4f1f-a3b9-e8331fdcac1fn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Alex Shaw @ 2021-09-30 11:51 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 1219 bytes --]

Hello. This is my first post, so I apologize if I'm doing anything wrong.

I have a question/topic for conversation for John MacFarlane and any other 
long-time pandoc contributors:

*If you were to start over from scratch today, what would you do 
differently?*

If pandoc were never invented back in 2006, what are some different choices 
you would make today?
Would you use a different language (C++, Rust, Python)?
Different Haskell features (prefer Functors over Monads)?
Internal design architecture (completely re-written AST)?
Source-code structure (merge readers and writers so that each file format 
is specified in a single module instead of each file format being partially 
duplicated in a reader and a writer implementation)?

Those are all just examples. Feel free to share whatever you like.

-- 
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 view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/1784a254-0585-4f1f-a3b9-e8331fdcac1fn%40googlegroups.com.

[-- Attachment #1.2: Type: text/html, Size: 1640 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: What if pandoc were rewritten today?
       [not found] ` <1784a254-0585-4f1f-a3b9-e8331fdcac1fn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2021-10-01 16:16   ` John MacFarlane
  0 siblings, 0 replies; 2+ messages in thread
From: John MacFarlane @ 2021-10-01 16:16 UTC (permalink / raw)
  To: Alex Shaw, pandoc-discuss


You have to remember that I started writing pandoc solely to play
with Haskell. (In fact, I only knew the bare basics of Haskell
when I started.)  So, my goal was to have fun writing a lot of
Haskell, and that goal is hard to achieve using another language.
(Also, because this was my goal, I wasn't bothered by the fact
that when I started, Haskell didn't have much of a library
ecosystem.  I just wrote the libraries I needed: zip-archive,
skylighting, texmath, unicode-collation, doclayout, doctemplates,
ipynb...)

That said, Haskell has proven to be an excellent choice for this
project.  The strong type system makes refactoring easy, and
helps me avoid whole classes of fiddly bugs that would torment
me in languages like C or JavaScript. The ability to guarantee
that functions have no side effects is also extremely helpful.
And the parsec parser combinator library makes it easy to create
flexible parsers for even the most irregular syntaxes.

There are lots of things I'd probably do differently if I were
starting from scratch.  I probably would have built the AST
around sequences rather than lists.  (Currently we can work
with sequences in the Builder abstraction, but why not just
make the AST work that way?)  I would have set things up so
that every AST element can have attributes (#684).  I would have
used types more heavily (e.g. in Format and Attributes).
Probably I would have done without a Space constructor on
Inline (#7579).  I would have added a Figure type (#3177).  I
would have separated some core functionality into a separate
package (#6215).  Ideally, support for different syntaxes could
also be split into separate packages so that people could take
what they need (however, this has to be balanced against the
convenience for the developer of having everything in the same
package). As you can see, most of these things are still planned
changes.  Fortunately, Haskell's strong type system makes it
possible to  make changes like this across a large code base
without going crazy.


Alex Shaw <alex.shaw.as-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

> Hello. This is my first post, so I apologize if I'm doing anything wrong.
>
> I have a question/topic for conversation for John MacFarlane and any other 
> long-time pandoc contributors:
>
> *If you were to start over from scratch today, what would you do 
> differently?*
>
> If pandoc were never invented back in 2006, what are some different choices 
> you would make today?
> Would you use a different language (C++, Rust, Python)?
> Different Haskell features (prefer Functors over Monads)?
> Internal design architecture (completely re-written AST)?
> Source-code structure (merge readers and writers so that each file format 
> is specified in a single module instead of each file format being partially 
> duplicated in a reader and a writer implementation)?
>
> Those are all just examples. Feel free to share whatever you like.
>
> -- 
> 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 view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/1784a254-0585-4f1f-a3b9-e8331fdcac1fn%40googlegroups.com.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-10-01 16:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-30 11:51 What if pandoc were rewritten today? Alex Shaw
     [not found] ` <1784a254-0585-4f1f-a3b9-e8331fdcac1fn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-10-01 16:16   ` John MacFarlane

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