From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <lists@sr.ht>
Received: from mp1.migadu.com ([2001:41d0:1008:1e59::])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	by ms5.migadu.com with LMTPS
	id QACuEW6a62VidgEAbAwnHQ
	(envelope-from <lists@sr.ht>)
	for <patches@johnnyrichard.com>; Sat, 09 Mar 2024 00:08:30 +0100
Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	by mp1.migadu.com with LMTPS
	id YESqC26a62VCAgAA62LTzQ
	(envelope-from <lists@sr.ht>)
	for <patches@johnnyrichard.com>; Sat, 09 Mar 2024 00:08:30 +0100
X-Envelope-To: patches@johnnyrichard.com
Authentication-Results: aspmx1.migadu.com;
	dkim=pass header.d=lists.sr.ht header.s=20240113 header.b=g7QGO3bp;
	dkim=pass header.d=johnnyrichard.com header.s=key1 header.b=W9mXVcnu;
	spf=pass (aspmx1.migadu.com: domain of lists@sr.ht designates 46.23.81.152 as permitted sender) smtp.mailfrom=lists@sr.ht;
	dmarc=pass (policy=quarantine) header.from=johnnyrichard.com
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed;
	d=johnnyrichard.com; s=key1; t=1709939310;
	h=from:from:sender:sender:reply-to:subject:subject:date:date:
	 message-id:message-id:to:to:cc:cc:mime-version:mime-version:
	 content-transfer-encoding:content-transfer-encoding:list-id:
	 list-unsubscribe:list-subscribe:list-post:dkim-signature;
	bh=+/3h3uqv1g+kFCKPICvTPVHrye12kr2O5nWZpH0D0+A=;
	b=PDD/GtdALQ2vBU2aY4hLgJFnXg4fH2mpg8oIyeSUnWgaigBldJUIdy7tBseP7B0EiYm4BY
	cyeiofKp5zlCGoptzg3balXCFR4INNDZ+jWeEIoDChJLKUsyPpz/ktMX9GAl+d3Q2w9KRW
	/umIN+LT+ig4zOv1njjhVQj/f627nQPenUcn9G9NGS2+cg8b5BP7b/iNEfU8VzGnfM8BC2
	4Vg8so/AB8vwM9Vx4dvM1oQebQ9DBzvYEnnl+PqgMZkM7WHCSEnErAQ5vMRad8wmH0vFjg
	vLocMPww2HMz+gwpcnA5+khr3xl1gVey15a1lxXUG6ydziVfn1wknOwY3hcIYg==
ARC-Seal: i=1; s=key1; d=johnnyrichard.com; t=1709939310; a=rsa-sha256;
	cv=none;
	b=RdM247oHNSp3Stdi5Tae6rEVWFFZXcFquDYwXx4XEE4B5/5x8h2Dweo9TJZQiAxIqHOfLW
	n5w1yib/4aKncH8wEsfXUR5xxfM52u3tWkDfUXw3/BBkleFx7AirFgq0milwrapr5CO8rw
	nSpyKVtERuU8auCL/7FLACUySVJLMMD9zjQuyS8t3PubJ/JxjoXXfXiV5AU9RCxAyMEy34
	mdSOoRD60gCBJowW7mmK5+M/MoY6+s8vEz6rL/rJuYNy06WHCiDfKDUt+fnQJfKU2iBecN
	8DAxyil3iViQ/QTsEDhCZpa9nuRkk7Qph2IfOY68vtMGvf6TouFbGOX35lcwEA==
ARC-Authentication-Results: i=1;
	aspmx1.migadu.com;
	dkim=pass header.d=lists.sr.ht header.s=20240113 header.b=g7QGO3bp;
	dkim=pass header.d=johnnyrichard.com header.s=key1 header.b=W9mXVcnu;
	spf=pass (aspmx1.migadu.com: domain of lists@sr.ht designates 46.23.81.152 as permitted sender) smtp.mailfrom=lists@sr.ht;
	dmarc=pass (policy=quarantine) header.from=johnnyrichard.com
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 F20E568C70
	for <patches@johnnyrichard.com>; Sat,  9 Mar 2024 00:08:29 +0100 (CET)
DKIM-Signature: a=rsa-sha256; bh=BQEimHlv4dR2yFN8U+mjr3IyX3tHxbp4tv0nC2EvvPg=;
 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=1709939309; v=1;
 b=g7QGO3bpu8IFQi3tHlCe4mpmZbA876C4/0ym2prr3sJFg6mX9lKuz+qTjau3FZkVzV4CdKzS
 fbmTsgCI+Tj1K3WIrA8ktpynIxiHtoVsokGZzV32rGXHh1v8ionZQhQZkEao8EiZMs4INX8OQaG
 3CRThB2jW7Sy0kMzJDlNHDab6GBbJBZSFPR9wweL3BVZGc/3bnoCwPF/73HMJk2xuY60XDAS2u/
 HYDFrXm9OVtkb3kr9CIAOKZB6jY6TgKuM3X31tHyprjogvdRzoxZcsAAE959P+MsF6H2Pmt5Dyn
 txkS8VmUFka+0ouJ+Or8pX5CVsyc5ngi6FesnjPlPsgRw==
Received: from lists.sr.ht (unknown [46.23.81.154])
	by mail-a.sr.ht (Postfix) with ESMTPSA id 9AB2420269
	for <patches@johnnyrichard.com>; Fri,  8 Mar 2024 23:08:29 +0000 (UTC)
Received: from out-179.mta1.migadu.com (out-179.mta1.migadu.com [IPv6:2001:41d0:203:375::b3])
	by mail-a.sr.ht (Postfix) with ESMTPS id 0487D20207
	for <~johnnyrichard/olang-devel@lists.sr.ht>; Fri,  8 Mar 2024 23:08:29 +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=1709939308;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:
	 content-transfer-encoding:content-transfer-encoding;
	bh=+/3h3uqv1g+kFCKPICvTPVHrye12kr2O5nWZpH0D0+A=;
	b=W9mXVcnusJ1MNBazjbYt6WBim0TrT13NRyoGurHSsEIQ2HDoj50TMa4s4YWdCRxsqYjUk9
	p5qx7ry57QwfEPETKB9IWnACiGKJHvxod5BElycUH7xe2nikF6X03gCiGFgGDzrGNNT5x9
	OXdMbrMkzNP9nHc8gXKZnE2rppHI5Qpch/zTIY3LSSN2u3VzQlWMauVQ1swZJpDfzUfpBq
	AtN9yZM+bKuLvBXlaGNZtLyCZiG3vRNggvF9AlX7nJtD5ciw+uQDgsunLlehRawNcir56r
	esY0vYlf6ZEfmlCgp42z85VpDHTan9KBQf3iXsvNvmtx/ujOhP5eC7F9lChCXA==
From: Johnny Richard <johnny@johnnyrichard.com>
To: ~johnnyrichard/olang-devel@lists.sr.ht
Cc: Johnny Richard <johnny@johnnyrichard.com>
Subject: [RFC PATCH olang v1] docs: create zero programming language specification
Date: Sat,  9 Mar 2024 01:05:39 +0100
Message-ID: <20240309000855.1059007-1-johnny@johnnyrichard.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Sourcehut-Patchset-Status: PROPOSED
List-Unsubscribe: <mailto:~johnnyrichard/olang-devel+unsubscribe@lists.sr.ht?subject=unsubscribe>
List-Subscribe: <mailto:~johnnyrichard/olang-devel+subscribe@lists.sr.ht?subject=subscribe>
List-Archive: <https://lists.sr.ht/~johnnyrichard/olang-devel>
Archived-At: <https://lists.sr.ht/~johnnyrichard/olang-devel/%3C20240309000855.1059007-1-johnny%40johnnyrichard.com%3E>
List-Post: <mailto:~johnnyrichard/olang-devel@lists.sr.ht>
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-Migadu-Spam-Score: -8.97
X-Spam-Score: -8.97
X-Migadu-Queue-Id: F20E568C70
X-Migadu-Scanner: mx11.migadu.com
X-TUID: i+b+oL8p+RPy

This document specifies the semantics and behavior of the Zero Programming
Language for compiler programmers be informed how the language is designed.

This document will help newcomers to understand how the language looks
like and as a DRAFT guide on the language design discussions.

The grammar was made by using a EBNF evaluator tool[1].

[1]: https://mdkrajnak.github.io/ebnftest/

Signed-off-by: Johnny Richard <johnny@johnnyrichard.com>
---
This grammar adds the token SEMICOLON (';') for every statement.  I know we
agreed make it optional, but the SEMICOLON makes the parser much more
convenient to implement.

And this is the first topic I would like to discuss. Let me know if you
agree otherwise I can adapt the grammar to make SEMICOLON optional.

 docs/pages/language_specification.md | 41 ++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)
 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..9d27eda
--- /dev/null
+++ b/docs/pages/language_specification.md
@@ -0,0 +1,41 @@
+zero programming language specification
+=======================================
+
+ABSTRACT
+--------
+
+This document specifies the semantics and behavior of the Zero Programming
+Language for compiler programmers be informed how the language is designed.
+
+This specification is on DRAFT and will evolve through discussions on olang-dev
+mailing list.
+
+Language Syntax
+---------------
+
+This is the Zero Programming Language EBNF grammar specification 
+
+NOTE: This grammar spec is a DRAFT and it covers only a small portion of the
+language.
+
+```
+<program>               ::= <function-definition>
+<function-definition>   ::= <fn_keyword> <space>+ <identifier> <space>* <f-args> <space>* <colon> <space>* <type> <space>* <block>
+<identifier>            ::= <alpha>+
+                          | <alpha>+ <number>*
+                          ;
+<f-args>                ::= '(' <space>* ')'
+<block>                 ::= <ocurly> <space>* <statement>* <space>* <ccurly>
+<statement>             ::= <return-statement>
+<return-statement>      ::= <return_keyword> <space>* <number>* <space>* <semicolon>
+<semicolon>             ::= ';'
+<ocurly>                ::= '{'
+<ccurly>                ::= '}'
+<type>                  ::= 'u32 '
+<colon>                 ::= ':'
+<alpha>                 ::= #'[a-zA-Z_]'
+<number>                ::= #'[0-9]'
+<fn_keyword>            ::= 'fn'
+<return_keyword>        ::= 'return'
+<space>                 ::= #'[ \t\r\n]'
+```
-- 
2.44.0