Remix.run Logo
cenamus a day ago

org-mode's first release was in 2003, Markdown apparently in 2004. So not just "yet another standard"

And I don't think org-mode's babel features really exist in Markdown? It's more like having python notebooks right in there (any language really).

rgoulter a day ago | parent | next [-]

> And I don't think org-mode's babel features really exist in Markdown

I think the neatest part of org-babel is the source code block execution, & the various ways it supports for configuring output. This allows for org files to be "plaintext notebooks" (like jupyter in plaintext"). -- It's really surprising that this part is not more common.

More niche is the "babel" part of that: because the code blocks can take variables as inputs, and output values, this allows a polyglot notebook where values from e.g. Python get passed to R and plotted or so. -- Cute idea, although I've never found it too useful. The supported types are (unsurprisingly) limited, and the language support for code blocks is held together by duct tape.

(Even more niche is the noweb syntax for proper "literate programming". Which is mostly discussed about how awful it is to use in practice?)

Of course, org also has a long tail of neat features (like how each heading can have properties attached to it, as well as tags, and the task management that relates to this).

zelphirkalt a day ago | parent | next [-]

> It's really surprising that this part is not more common.

I think it is because of low Emacs adoption and other editors not having enough support.

The problem with polyglot notebook workflow is probably, that you can only use it well for small data, or at least not big data, because who wants to have a million lines of output suddenly appear in the buffer, only to then read them as input for the next language ... That would be a tremendous amount of computational overhead. And if we didn't have that, we would need a way to pass a proper value from one language to the other.

What I also like is, that you can define code blocks that are used as formulas for spreadsheets (tables) inside the document. That's quite powerful too.

> (Even more niche is the noweb syntax for proper "literate programming". Which is mostly discussed about how awful it is to use in practice?)

I don't find it very awful to use. I have used that for working through computer programming books and it was fabulous.

fipar a day ago | parent | prev [-]

I agree about the duct tape, which I also use often around the house, so maybe that's why I like org-babel :)

Just wanted to say that I share data between different blocks in different languages through files and env variables (I add :session shared to the src blocks that need to access this). That is useful also to have src blocks you can execute repeatedly and that depend on something like an aws identity being assumed (you just assume it in the first block that shares the session).

I agree it's messy, it's just a mess that works for me.

alexisread 21 hours ago | parent [-]

I think this is the crux of the issue, use like this is like a real program, just built up incrementally in a notebook rather than a repl or shell-with-pipes, and with manual error handling. The STEPS project was all about this- a way of incrementally building blocks that can be composed.

With org mode in mind, ideally you would have language support for this ie. Comments are scoped metadata that can be formatted, tested, linked etc.

You need a well defined spec like djot as a DSL for this to work, so that parsers can be easily written for it. This level of language support allows many different views onto the source code. We’re not there yet.

least a day ago | parent | prev | next [-]

Babel features are kind of a moot point if you’re just talking about the syntax, which seems to be the purpose of the post. Most of the reason to use org mode is tied to emacs.

There’s no reason you couldn’t do something similar with markdown code blocks if someone were so inclined. But that’s tool dependent, not syntax.

I sort of agree with Karl’s point about there being too many standards of markdown, but I doubt org mode would have survived the same level of popularity without suffering the same fate.

It doesn’t help that there is no standard for org mode. You can only really use and take advantage of its power in emacs. It isn’t susceptible to lossy transformations because there’s only one real org mode editor.

zelphirkalt a day ago | parent [-]

Well, but I am not aware of anyone having come up with a good syntax to do babel things in Markdown. Markdown and Org Mode also set out to serve different purposes. For a quick and dirty text Markdown might suffice, but the babel stuff and spreadsheet stuff enable a lot of use cases that Markdown simply doesn't cater to. We already have the implementation of all these nice things in Emacs. If we were to replicate them for some markdown dialect, they would probably be done half-right, before someone actually manages to get literate programming right for various languages, including what code to translate to, how to wrap or not wrap the code that is inside blocks, sessions, output formats, etc. We might as well use what we have with Emacs. There is probably a way to call Emacs' functionality from outside of Emacs, to treat it as a library.

But not all is well with Org Mode syntax either. Many git hosters have only a very rudimentary implementation of a parser and writing a parser for it is not actually that easy. Its dynamic nature requires at least a 2 step approach of parsing and then later checking all kinds of definitions at the top of a file and further processing the document according to that. It's power comes at that cost. That's probably why we have so many Markdowns, but only one Org Mode (OK maybe a few, counting Vim and VSCodium plugins, that achieve a feature subset).

I will say though, that org mode syntax is much better suited for writing technical documentation than markdown. The only issue is, that not so many people know it or want to learn it, and I don't know a way to change that. Perhaps that effort to have the org mode syntax separately defined (https://gitlab.com/publicvoit/orgdown/-/blob/master/doc/Over...) by the same author will help creating more support for the format in various tools.

alexisread 21 hours ago | parent [-]

I agree you would need to specify the markdown to allow more implementations. https://github.com/jgm/djot Would make a good DSL inside languages, combine that with compile-time execution so that blocks can auto-recalculate and you have a more available mechanism than emacs/org in other languages.

throw__away7391 21 hours ago | parent | prev [-]

A) I'm aware and B) so what? Markdown is popular enough now that even people who aren't very technical and don't know that they're reading/writing Markdown are familiar with it. This is incredibly valuable and not something you can replicate through purely technical means, there are so many places where having a ubiquitous way to express in plain text is helpful. Markdown has grown into this role at the same time that the environment developed. You will not be able to recreate this situation.