From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id YLE0LdLbnV/vQgAA0tVLHw (envelope-from ) for ; Sat, 31 Oct 2020 21:49:06 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id GIkrKdLbnV/+DgAA1q6Kng (envelope-from ) for ; Sat, 31 Oct 2020 21:49:06 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 270AB940416 for ; Sat, 31 Oct 2020 21:49:06 +0000 (UTC) Received: from localhost ([::1]:40028 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kYykD-0001WB-4J for larch@yhetil.org; Sat, 31 Oct 2020 17:49:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42740) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kYyjU-0001Vp-2G for emacs-orgmode@gnu.org; Sat, 31 Oct 2020 17:48:20 -0400 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]:42514) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kYyjQ-0000pa-Tg for emacs-orgmode@gnu.org; Sat, 31 Oct 2020 17:48:19 -0400 Received: by mail-pl1-x62a.google.com with SMTP id t22so4762232plr.9 for ; Sat, 31 Oct 2020 14:48:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=R7ct5fXVymfLIl7APIJ7Soc9aajttoQXtpbkMx+mDsc=; b=CS/VO/hBL2C0OAaK1GqygfzK2W8+nmTZ/qc6P5FNCxZX8xmc4a2wRLav76+L7mySnc /NLSrwifjYh55prcCQ7+UKs9bAtnu49IwYrJgwz/gf4b7lXsuydmhYfsi1mc56KWlJDJ ym+COTG8qIoitD+oHZgHto6RrcDC4C0hNfmcS1EHgMHLcB0qiIhqvFCa2dg057XH123d 8plsPpyZy7EeTan1vx5nxoueFflr7Q/JBU5FOx7CG8FQ2KXiR5Fk1JKg54vkeUS5ETte KFIM7O6QSD+c7cwT7mZR4AxAh9uXplC6HieIRVyu55QJomyKcZHxLXnLLHYMSTxXUeeS JH6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=R7ct5fXVymfLIl7APIJ7Soc9aajttoQXtpbkMx+mDsc=; b=PFq7SFtcA/CGrFsQJ0+n3qEbY/hvelO6JKZBRx9HPGZTGTGhkm0kr4kY729V+5waaC Gu6pYsSIIDOYwtqe937M98XkJhYLT2VKQfA3qz4bA/1eJwmACq2X5ryUC2CPa7962ra7 WUxDG1yXeu66/PFdTxbg9VqKcdcuPF7781rBAgblsbNJPSVE2RZ2kVQhbWmzYKqYyHpu z+XhwJy7hUmd9zRoZN5Ko5Jr14mwIrZp+SLvdV0FygBS5ynhuASdPwaSyjuB399sIweW Vcx7GcRcGMKTYvg1BGoap0rPhrf0mgsxhpcpvk94VAy+kG+c8GX/ZNH01yfr4z+03p+7 dlwA== X-Gm-Message-State: AOAM533utX1KeC5WBwYjNGKHEjn8Y/kaJBzTeltWzpEikfZOKp8npv7v /8oirlKbLPL77RSMjtIGXzqzuS1cqptX+m27Y/k= X-Google-Smtp-Source: ABdhPJwkFhKTF2BF0uqL5RhIMpzXjygidprNXQqQN1v57e2tinmg3C3MYtVYuuTalwiiEz0Q2nyxG85hCevZR1Xj6wY= X-Received: by 2002:a17:90a:1596:: with SMTP id m22mr10134562pja.189.1604180894123; Sat, 31 Oct 2020 14:48:14 -0700 (PDT) MIME-Version: 1.0 References: <87lffo3q0g.fsf@ucl.ac.uk> <87k0v7gb4p.fsf@gmail.com> <87zh42fpir.fsf@leo-B85-HD3.i-did-not-set--mail-host-address--so-tickle-me> In-Reply-To: <87zh42fpir.fsf@leo-B85-HD3.i-did-not-set--mail-host-address--so-tickle-me> From: Mauro Mandracchia Date: Sat, 31 Oct 2020 22:48:03 +0100 Message-ID: Subject: Re: Org-Mode as DSL To: Lejon Content-Type: multipart/alternative; boundary="000000000000598c7b05b2fe78b7" Received-SPF: pass client-ip=2607:f8b0:4864:20::62a; envelope-from=mauromandracchia@gmail.com; helo=mail-pl1-x62a.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: tgbugs@gmail.com, Eric S Fraga , emacs-orgmode@gnu.org, TEC Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: ns3122888.ip-94-23-21.eu Authentication-Results: aspmx1.migadu.com; dkim=fail (headers rsa verify failed) header.d=gmail.com header.s=20161025 header.b=CS/VO/hB; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Spam-Score: 0.09 X-TUID: AzOK8PdbNn07 --000000000000598c7b05b2fe78b7 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thanks for the warm welcome and the amount of inputs and details that everybody so fast provides. I'm really impressed by this community. Ok seems that delivering a language specification in EBNF has some challenges that can hardly be addressed due to the nature of org-mode design, but I read around that often EBNF is not the silver bullet to solve a grammar representation although it is a de-facto standard. So I will try to put some orders in my thoughts, when I look at functionalities of org-mode I will split them in the following categories: - Grammar Specification - Metadata - TODO - Code Block - Tangling (or waving for the web people) - Properties of the file - Templating - Block Execution - Environment (Global variables such as PATH) - Language - Context for arguments - Publishing Functions - Target Format - Custom Parser I share a lot with of your ideas and inputs, here some observations and options that I noticed: - Indeed emacs is not that big and could run as a background process to deliver org-mode features to other systems. I do something very similar to *TEC* for my CI/CD and my static generated website, but I'm not sure I would run emacs as a web service. - LSP doesn't mention org-mode as available language, but it does for markdown https://microsoft.github.io/language-server-protocol/specifications/spec= ification-current/#textDocumentItem maybe because org-mode is not a language? - I share the sentiment that some api are a bit obscure and most important there isn't for instance an official way to say "this is how y= ou create extensions in org". - I found that multiple people are already converting org-mode into json by using org*-map-entries *which indeed is not very publicly shown (I miss something like "this is how you create extensions in org"). - I relate a lot to the issues that *Tom Gillespie* discusses in his post ( https://lists.gnu.org/archive/html/emacs-orgmode/2020-10/msg00244.html) about tangling and executions and I loved to see your efforts in trying = to solving them. - Since gccemacs elisp could compile to C (not sure this is relevant, but can be investigated if there are opportunities to be capable to have org-mode embendable). For my personal needs I think I would pragmatically start toying around with a org-mode to json like here https://github.com/ludios/org-to-json And once I gain some confidence on the output JSON, I think I will gain more confidence about the grammar definition. I think that converting org-mode to JSON could show org-mode as an Abstract Syntax Tree, I think from there it should be easier to create a specification and maybe is what already *orgajs * already did. I believe creating functions like tangle and execution shouldn't be that trivial from an AST. Concluding, there is overlap between the Interfaces of LSP and org-mode which makes a lot of sense since both target the interaction for with a document eg: - Propose actions, these can be: - Execute - Tangle - Change state TODO - Insert date, tag, etc... - Go to definition (For linking sections) - Support multi language in the same document This makes me think that creating an org-mode LSP is not that crazy idea after all, what do you think? If you would build an LSP for org-mode which setup would you choose? What do you think would be hard to implement? Again many thanks =F0=9F=99=8F Mauro. --000000000000598c7b05b2fe78b7 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thanks for the warm welcome and the amount of inputs= =C2=A0and details that everybody so fast provides.
I'm really= impressed by this community.

Ok seems that delive= ring a language specification in EBNF has some challenges that can hardly b= e addressed due to the=C2=A0nature=C2=A0of org-mode design, but I read arou= nd that often=C2=A0EBNF is not the silver bullet to solve a grammar represe= ntation although it is a de-facto standard.

So I w= ill try to put some orders in my thoughts, when I look at functionalities o= f org-mode I will split them in the following categories:
    Grammar Specification
    • Metadata
    • TODO
    • Co= de Block

  • Tangling (or waving for the web people)
    • Properties of the file
    • Templating

    =
  • Block Execution
    • Environment (Global variables=C2=A0such= as PATH)
    • Language
    • Context for arguments

    • Publishing Functions
      • Target Format
      • Custom Pa= rser
    I share a lot with of your ideas and inputs, here some o= bservations and options that I noticed:
    • Indeed emacs is not that big= and could run as a background process to deliver org-mode features to othe= r=C2=A0systems.
      I do something very similar to TEC for= my CI/CD and my static generated website, but I'm not sure I would run= emacs=C2=A0as a web service.

    • LSP doesn't mention org-m= ode as available language, but it does for markdown https://microsoft.github.io/language-server-protocol/= specifications/specification-current/#textDocumentItem maybe because or= g-mode is not a language?

    • I share the sentiment that some a= pi are a bit obscure and most important there isn't for instance an off= icial way to say "this is how you create extensions in org".
      <= br>
    • I found that multiple people are already converting org-mode in= to json by using org-map-entries which indeed is not very publicly s= hown (I miss something like "this is how you create extensions in org&= quot;).

    • I relate a lot to the issues that=C2=A0Tom Gille= spie=C2=A0discusses in his post (https://lists.gnu.org/archive/= html/emacs-orgmode/2020-10/msg00244.html) about=C2=A0tangling and execu= tions and I loved to see your=C2=A0efforts in trying to solving them.
    • Since gccemacs=C2=A0elisp could compile to C (not sure this is r= elevant, but can be investigated if there are opportunities=C2=A0to be capa= ble to have org-mode embendable).

    For my personal needs I thin= k I would pragmatically start toying around with a org-mode to json like he= re https://github.com/lud= ios/org-to-json
    And once I gain some confidence on the output JSON, = I think I will gain more confidence about the grammar definition.

    I = think that converting org-mode to JSON=C2=A0could show org-mode as an Abstr= act Syntax Tree, I think from there it should be easier to create a specifi= cation and maybe is what already orgajs=C2=A0already did.=C2=A0
    I believe creating function= s like tangle and execution shouldn't be that trivial from an AST.

    Concluding,
    there is overlap between the Interfaces of LSP and= org-mode which makes a lot of sense since both target the interaction for = with a document eg:
    • Propose actions, these can be:
    • Execute
    • Tangle
    • Change state TODO
    • Insert d= ate, tag, etc...
  • Go to definition (For linking sections)
  • Support multi language=C2=A0in the same document
This = makes me think that creating an org-mode LSP is not that crazy idea after a= ll, what do you think?
If you would build an LSP for org-mode which setu= p would you choose? What do you think would be hard to implement?

Ag= ain many thanks =F0=9F=99=8F
Mauro.
--000000000000598c7b05b2fe78b7--