From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id MCqdHMp0E2aoBQAA62LTzQ:P1 (envelope-from ) for ; Mon, 08 Apr 2024 06:38:34 +0200 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 MCqdHMp0E2aoBQAA62LTzQ (envelope-from ) for ; Mon, 08 Apr 2024 06:38:34 +0200 X-Envelope-To: patches@johnnyrichard.com Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=lists.sr.ht header.s=20240113 header.b=HaIwLO33; dkim=pass header.d=maniero.me header.s=hostingermail1 header.b=pCQZGAMb; dmarc=pass (policy=none) header.from=maniero.me; spf=pass (aspmx1.migadu.com: domain of lists@sr.ht designates 46.23.81.152 as permitted sender) smtp.mailfrom=lists@sr.ht; arc=pass ("mailchannels.net:s=arc-2022:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=johnnyrichard.com; s=key1; t=1712551114; 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=0RR/ZKEV3kL2g2bSuA5eUhVmqSzmnJZ92KIQ9etCmmQ=; b=ORRH7CLtpTeVnpnwuE7qQeGErokRfHSYb0jD2VaCeBLHvnL3ou+v0vnd3vhhYTnpllCprj qho9IFAy8IYnSTkF6eV8CnopMC3UKi79fn4X5OfI6TmYgBmM8tA/gptXgCI/zX1/TVlTkT kHVySTCHjsBgFchNlbxMmSVRO8XGxMloP3/O8Si2WJH93MeN++Xcx9PWqAThmdRIBzsI1S 0HyuotYkMX8fHdzgQHzPxhyrsQyqOsAleuXdbCOlqijlbXm9zWDfw9yMCdG7SHs+0bRwYe DvpOJrmfzqg5e3+iTz7RUZzxUVpte8bfGZvc72lUx9yLi2yAcUciJBnvBxMyDA== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=pass header.d=lists.sr.ht header.s=20240113 header.b=HaIwLO33; dkim=pass header.d=maniero.me header.s=hostingermail1 header.b=pCQZGAMb; dmarc=pass (policy=none) header.from=maniero.me; spf=pass (aspmx1.migadu.com: domain of lists@sr.ht designates 46.23.81.152 as permitted sender) smtp.mailfrom=lists@sr.ht; arc=pass ("mailchannels.net:s=arc-2022:i=1") ARC-Seal: i=2; s=key1; d=johnnyrichard.com; t=1712551114; a=rsa-sha256; cv=pass; b=48hrekisp2HOf0bEvYouNHSdOz10AnVhl8Yl4/s9U+MSCuPBPcZWHVQiJ0Hwjj/hhNe7Tu TXdQztsIhOPQkNpsIV6tH89ZRbVNNVOx756g/88Xh8tIhwTht+5MpQJR18rWVCCTKgBgZB oaGvDyZpSV3tcWcZ0T0G7frvnlqSQPQ+EvCQ3B50FSwUhOq9g/59STp3GukEgduz9B493P 8JJJUdhuAIImDHoekKrQPAFXbciPYUdhLvvzJv94jC0qpLwy4Vy4iKE5G4pVdlQ8sbfWbw /7AhaEu8Xg4fWOYFU6dA2/U+UE1WkxUgi5HG4U+j5yIaVuoKDQFXhm6EvEiMhw== 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 C0C65611A3 for ; Mon, 08 Apr 2024 06:38:30 +0200 (CEST) DKIM-Signature: a=rsa-sha256; bh=5ZDMsQYMOV7OTlM/uq0IpXdHL/C/pSptOUIdvgohdHA=; 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=1712551109; v=1; b=HaIwLO33d+w04OxSmy99RPrbPH9Ag9JFClKUfH6xQdI9cX28kftyxMltF896oIXzmHgVrffN 4ESz8IPn36XogTp4PcMaxh71FYsuNp3qR6FyLPG+lT/HHfZf94Qq7UffWEMeRozipK5dUA4sk3K w8trqyr6MwzQy9iTokucRQK1egdXav5rS4mXnKGKGxMdjVCd0UCBSounEMyHeyiLwCI7jvJZKgS 6EElJ3QGED74vWzA31xa67il9XiKNEsqA2kDsX8ctAQTaL9GCuVc0ymsPRQTwT2v/Ik72Q51saY vBACXEgK4EDifxptVXwANramP3ZdYUhiWuD5BgdC26uhw== Received: from lists.sr.ht (unknown [46.23.81.154]) by mail-a.sr.ht (Postfix) with ESMTPSA id 6F68320195 for ; Mon, 8 Apr 2024 04:38:29 +0000 (UTC) Received: from aye.elm.relay.mailchannels.net (aye.elm.relay.mailchannels.net [23.83.212.6]) by mail-a.sr.ht (Postfix) with ESMTPS id 6C0FD2017E for <~johnnyrichard/olang-devel@lists.sr.ht>; Mon, 8 Apr 2024 04:38:28 +0000 (UTC) X-Sender-Id: hostingeremail|x-authuser|carlos@maniero.me Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id C60DF902625 for <~johnnyrichard/olang-devel@lists.sr.ht>; Mon, 8 Apr 2024 04:38:26 +0000 (UTC) Received: from uk-fast-smtpout5.hostinger.io (unknown [127.0.0.6]) (Authenticated sender: hostingeremail) by relay.mailchannels.net (Postfix) with ESMTPA id 168F39027D5 for <~johnnyrichard/olang-devel@lists.sr.ht>; Mon, 8 Apr 2024 04:38:25 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1712551106; a=rsa-sha256; cv=none; b=KXO/tpXVW7Pn0/8zzB/DF7QGxxAr7rkKK94oc/QL11ocdSWaV5/64drB1vOED+JNRLmJOf ELrTZENl0OCtdPH1p2UHDQPXNZ70eZCrHmlTiGVetouhsRG+EulwOTreTiGj3prS6HSVwP 0E6jn+dDkV05EoEp+XP2K0r4qehy5w68EizJ1komTyydck77zBQO/X5yPH2h2ZMzM21X+M JtnMmfG8hMS5XqKg8FrXh6nc80NOZ0yhwkWVPp43Nsi9nnEcZGs7eY1LohTYxEgHV6ZrAo lXcXJ80OvFGbdQcxhbZRukNCaqga50Ude5raWOYuucutPwd64TOFZKyLdqcfkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1712551106; 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:dkim-signature; bh=0RR/ZKEV3kL2g2bSuA5eUhVmqSzmnJZ92KIQ9etCmmQ=; b=vO+w5Nt8gjUyzZFt+5Ay+05gaeUcuWjepCyCPe+t+7shM0dRTQDo68YtgJ/FH5sehV7eP8 Y97ZcUdQKCCRapfxEkefg2BxKzhb4H5DK4hw1VHjy2p6seDHBFSDexySNIiIx2VxgK0cGT Tyf1SozOLMc9OEamT0Wa3s/DvAPe3OPb78eS8xPKOKhEoI6DXNnU4Bb4kLeOOXdhHJ9cpo s01IZRkX4UkSTPFIgxTeYCkmBmaQacQFCZXcxaJsnuElbzPwubvooKt/y6rxP1FNUsx677 2cVMoB0J69SIByLnecGdX9Fc24Xso6jIbq5wmWSHWvF3Mxrkq8OSpKjQVw6BsQ== ARC-Authentication-Results: i=1; rspamd-86f86f958-xb74z; auth=pass smtp.auth=hostingeremail smtp.mailfrom=carlos@maniero.me X-Sender-Id: hostingeremail|x-authuser|carlos@maniero.me X-MC-Relay: Neutral X-MailChannels-SenderId: hostingeremail|x-authuser|carlos@maniero.me X-MailChannels-Auth-Id: hostingeremail X-Relation-Average: 4e6a9e1671677f56_1712551106599_3859080578 X-MC-Loop-Signature: 1712551106598:3887538343 X-MC-Ingress-Time: 1712551106598 Received: from uk-fast-smtpout5.hostinger.io ([UNAVAILABLE]. [31.220.23.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.125.113.83 (trex/6.9.2); Mon, 08 Apr 2024 04:38:26 +0000 From: Carlos Maniero DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=maniero.me; s=hostingermail1; t=1712551104; 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=0RR/ZKEV3kL2g2bSuA5eUhVmqSzmnJZ92KIQ9etCmmQ=; b=pCQZGAMbx3xR9eHa5ESZ7O8XujbWTcNRDmnyucuPxnmP/ywROo4kGLsaw3UuD1vn5mQP0T u/kR4cCUghcJyoccKIsaKWMnQSV/1Zb+aqruuDh/jExZvRMn8HenZ+gIMZ88wKR78tSguW TgEBPHxxi8Ih4VoCBEnsvKzadJaWmBuK2cxtPBfbU9OTKcM3UaSHy/K4KsAyL5aAjbF2F7 D6Wk+49vfCo+B8DH/cyl4HvpZJK8Aek354fgpKNku4LKvwXIohQ5MVYPh9JSYIWxrTMBGN iriFBLAomp1myjqJNMAozTIfKFVmDbrE9rgsKsfm2kyBW7XoP/L2TgncKpXDjg== To: ~johnnyrichard/olang-devel@lists.sr.ht Cc: Carlos Maniero Subject: [PATCH olang v2 0/2] docs: variables specification Date: Mon, 8 Apr 2024 01:38:14 -0300 Message-Id: <20240408043816.3781049-1-carlos@maniero.me> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-Envelope: MS4xfBALnchl4tPm0OGq/45cBFZY/yUMhvGCNOphLlV/waFSiQlF13MeMkLIJD2DNLxixBOriEJ08sgUxMLt2EuQ697Nb/26EWuZCiU22PqvUW8QBIfE27dG ZRpVzLhBO93Dyl768BM1bZng68pWjdPIDk3UDFd2+v0weMzNAFogtwOHjG3d7Enrh87RMyOHjIjyIkRIcukaN+nS2LV3ZY1f5Q9aZ4O8FpMffR/4VG7GIZPX X-CM-Analysis: v=2.4 cv=VYjxPkp9 c=1 sm=1 tr=0 ts=661374c0 a=WwxFCuf3mf1fs3oSi6/dng==:117 a=WwxFCuf3mf1fs3oSi6/dng==:17 a=MKtGQD3n3ToA:10 a=1oJP67jkp3AA:10 a=5GJL_y1Mh1YIIpvN_xIA:9 a=BXDaF_L80NY05PYiAFlV:22 X-AuthUser: carlos@maniero.me 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-Migadu-Spam-Score: -8.41 X-Migadu-Scanner: mx11.migadu.com X-Spam-Score: -8.41 X-Migadu-Queue-Id: C0C65611A3 X-TUID: cfILZQ6hZabP This patchset specifies variables and constants. Main changes in v2: - Simplifications suggested by Johnny related to EOF - Support all assign operators There are two things a left outside this patchset: 1. The statement *const a += 2* is still valid at this spec. I tried to fix it but it ends up too much complex. I'm not sure we need to be so strict on the spec. The C spec does the same so I think we are fine. 2. Chained assignment The statement *a = b = c* is not valid right now. We could discuss if this is something that we really want to incorporate in the language. The main reason are: - It is hard to implement and it may mess with the great expression precedence algorithm we have right now. - It brings complexity for the spec, the version we had at the previous discussion the statement *return = 2* was valid. Fun fact that does not need to be considered: - In gcc *a = b = 2* is slower then *a = 2*, *b = 2* once it actually makes *a = 2; b = a* requiring an extra instruction to copy the value from *a* at the stack to a register. But it is probably solved by enabling *-O3* Do you think we can deal with chained assignment latter? Carlos Maniero (2): docs: spec: rename program to translation-unit docs: spec: add variables and constants specification docs/pages/language-specification.md | 32 ++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 7 deletions(-) -- 2.34.1