From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id iMR0B7tDAGYdegEA62LTzQ:P1 (envelope-from ) for ; Sun, 24 Mar 2024 16:16:11 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id iMR0B7tDAGYdegEA62LTzQ (envelope-from ) for ; Sun, 24 Mar 2024 16:16:11 +0100 X-Envelope-To: patches@johnnyrichard.com Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=lists.sr.ht header.s=20240113 header.b=WJsaAacC; dkim=pass header.d=johnnyrichard.com header.s=key1 header.b=0bPh9Pgd; dmarc=pass (policy=quarantine) header.from=johnnyrichard.com; spf=pass (aspmx1.migadu.com: domain of lists@sr.ht designates 46.23.81.152 as permitted sender) smtp.mailfrom=lists@sr.ht ARC-Seal: i=1; s=key1; d=johnnyrichard.com; t=1711293371; a=rsa-sha256; cv=none; b=gmT1b251QJdmSxNYBuirhA3Xw09qItd54KQuJEI/78RLgbClM3ZwmmMwmxL1DmeyGE6oHE ItVTL/kuWWi7/gIjRY1Kjei9Qt/jA5DZ/npQ8fNAkuOztI4Cm+NEN72h/pMQXcHjmovNYY n6OeV5T69thFlMih1HCrMwd/3iunl9OUIwWGd0YPG1nx5O26yB7/LJpj33E4a4YFLjEgIR 2e8Ta/xcMQ7T6NtCGr04JbossgW/y4pkj1Rc0WHoO5xKOeMK6uyuc2a2FvZIkPZ8wt/EDX DqozkDSQy4zhE5/kBbZWMKG2ETr2gRc6S79kp9/B932RIStSjN560fxz5BXgNQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=lists.sr.ht header.s=20240113 header.b=WJsaAacC; dkim=pass header.d=johnnyrichard.com header.s=key1 header.b=0bPh9Pgd; dmarc=pass (policy=quarantine) header.from=johnnyrichard.com; spf=pass (aspmx1.migadu.com: domain of lists@sr.ht designates 46.23.81.152 as permitted sender) smtp.mailfrom=lists@sr.ht ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=johnnyrichard.com; s=key1; t=1711293371; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=p+sGFcd3hflBiKbAFPB1q8VaGGpREPtBcFCkl44tMB4=; b=x1KeSwlGopE+aI22OxbnoIGsA+IItpnr2OTZvucRjHjG5eicTZ/5NVEAff0q/JbbfgEqz6 fKdyvlLOeiVRaB8ApX9xqFgXO2X2kdMCzpPNAzwgBe5UKd9dlprnKrEZ8pSci2Xd1YkJSP h5FOAFbR+dd2q9iKSy0LQz2t+bg3wUO83X42te2n2VzcJON+n1pceiz9Wa4LXBIY320NKl OxW3kinDh81HCUMM9YUIcs3h6YjoreOsTz43FDJBYdh9EWoMDYixFpq5os5mIGxMSHlmUz GTlP3fqmCTGLw6ONcvF93bsSRGzkS4vL+G5ruWtNVvihRtcwg4VyRtcujsrXFA== Received: from mail-a.sr.ht (mail-a.sr.ht [46.23.81.152]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 0AE4B113C6 for ; Sun, 24 Mar 2024 16:16:10 +0100 (CET) DKIM-Signature: a=rsa-sha256; bh=QMZE1hVF5chpzVa5sVO+vrtGCtxmrj2l0F8O2ZxNIlM=; c=simple/simple; d=lists.sr.ht; h=From:To:Cc:Subject:Date:List-Unsubscribe:List-Subscribe:List-Archive:List-Post:List-ID; q=dns/txt; s=20240113; t=1711293369; v=1; b=WJsaAacCTs5tsSkD2nyCWR1w0tyHMIWYBqwuCB/7WndWcG6J28n36s3IC1xlC8xOltaBFSsK GjfuseXvx87pJLKDxKxLZh4I0mMaGH3bb4Z5S+2+yEENANGonfl/tGWaLgKJ09RDOj2zuR8htyF 0eouApJ2+li5+gXezuTmCtXHIMuqCzvdJ1BtCU815jWxqts8/HIfW+8wYfiEWwtXTQ3s0E27zhK eHay9rFZYEhkhJcAmayaQmYdgP2+loL0JNAtD/U+gW3AARefFgt7Xx+kWd7xe3/n6QvvuTKf3gT 5Uf6LyzNi2QabFhsf5iAbxslMxa2fweS37k48+HkiNmTQ== Received: from lists.sr.ht (unknown [46.23.81.154]) by mail-a.sr.ht (Postfix) with ESMTPSA id A6EAD2027F for ; Sun, 24 Mar 2024 15:16:09 +0000 (UTC) Received: from out-181.mta1.migadu.com (out-181.mta1.migadu.com [IPv6:2001:41d0:203:375::b5]) by mail-a.sr.ht (Postfix) with ESMTPS id D270820275 for <~johnnyrichard/olang-devel@lists.sr.ht>; Sun, 24 Mar 2024 15:16:08 +0000 (UTC) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=johnnyrichard.com; s=key1; t=1711293368; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=p+sGFcd3hflBiKbAFPB1q8VaGGpREPtBcFCkl44tMB4=; b=0bPh9PgdzUYHCS49G8OSSDXaw+FdenQIHJ/vgusbuuPn1HMT0HmFwj9wN6T2oH2jCpP5mY Ap52rmGXmlsTVD6riKS8h2q3yPcpzgdGksTJhOiAxTHTAwj5q/9Fu7PtTnNT5r+tvl0d0H QgYE8jbZkF+w+k6p4WskcwP0ZMMRpQBXPHhzxgwXwMD9aUlWt5Ag14yu4BErCoYOPbn/50 nMxv3N+BtZCnvhLwNC3refC+0w3lD/IyYJ+uXDFftgkd7SnlK3HT3ox1T2DaUvvk+R9mrb 5W4xcJIeGrz3X8fle4Apdun48D80zcaIya14AF9q8dFFBvkpVx9TyHdLZLD08A== From: Johnny Richard To: ~johnnyrichard/olang-devel@lists.sr.ht Cc: Johnny Richard , Ricardo Kagawa Subject: [PATCH olang v3] docs: create o programming language spec Date: Sun, 24 Mar 2024 17:12:00 +0100 Message-ID: <20240324161530.407168-2-johnny@johnnyrichard.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Sourcehut-Patchset-Status: PROPOSED List-Unsubscribe: List-Subscribe: List-Archive: Archived-At: List-Post: List-ID: ~johnnyrichard/olang-devel <~johnnyrichard/olang-devel.lists.sr.ht> Sender: ~johnnyrichard/olang-devel <~johnnyrichard/olang-devel@lists.sr.ht> X-Migadu-Flow: FLOW_IN X-Migadu-Country: NL X-Spam-Score: -9.30 X-Migadu-Queue-Id: 0AE4B113C6 X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -9.30 X-TUID: sX3iLMcJhcyk This document specifies the semantics and behavior of the O Programming Language for compiler designers be informed on how the language is designed. This document will help newcomers to understand how the language looks like and also as a DRAFT guide to drive design discussions. The grammar was made by using a EBNF evaluator tool[1]. [1]: The live example https://mdkrajnak.github.io/ebnftest/ and a locked version https://github.com/Engelberg/instaparse/tree/v1.4.12 as reference. Signed-off-by: Johnny Richard Co-authored-by: Ricardo Kagawa --- V3: - fix markdown reference link - add Pandoc metadata to fix page header - add spec link to layout header - fix page max-width to avoid EBNF of wrapping lines on big screens docs/pages/language-specification.md | 64 ++++++++++++++++++++++++++++ docs/template.html | 3 +- 2 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 docs/pages/language-specification.md diff --git a/docs/pages/language-specification.md b/docs/pages/language-specification.md new file mode 100644 index 0000000..5769d95 --- /dev/null +++ b/docs/pages/language-specification.md @@ -0,0 +1,64 @@ +% O programming language specification + +Abstract +-------- + +This document specifies the semantics and behavior of the O Programming +Language for compiler designers be informed how the language is designed. + +This specification is a DRAFT and will be the discussions drive over olang-dev +mailing list. + +Language Syntax +--------------- + +This is the O Programming Language EBNF grammar specification[^1] + +[^1]: EBNF variant https://github.com/Engelberg/instaparse/tree/v1.4.12 and live + test can be accessed here https://mdkrajnak.github.io/ebnftest/ + +NOTE: This grammar spec is a DRAFT and it covers only a small portion of the +language. + +``` +(* Entry Point *) + ::= + +(* Functions *) + ::= 'fn' + ':' + ::= + ::= '(' ')' + ::= + ::= + +(* Statements *) + ::= '{' ( + )* ? '}' + ::= ';' | + ::= + ::= 'return' + +(* Expressions *) + ::= + +(* Identifiers *) + ::= 'u32' + ::= ( | '_') ( | | '_')* + +(* Literals *) + ::= | + ::= #'[1-9]' ( | '_')* | '0' + ::= #'0[Xx]' ( | '_')* + +(* Utilities *) + ::= + + ::= * + ::= | + ::= #'[\n\v\f\r]' | '\r\n' + ::= #'[ \t]' + ::= #'[a-zA-Z]' + ::= #'[0-9]' + ::= | #'[a-fA-F]' + ::= #'$' +``` diff --git a/docs/template.html b/docs/template.html index 4e066d1..52a22d1 100644 --- a/docs/template.html +++ b/docs/template.html @@ -30,7 +30,7 @@ color: var(--link-color); } article, nav, header, footer { - max-width: 820px; + max-width: 1024px; margin: 10px auto; } header, footer { @@ -56,6 +56,7 @@