public inbox for ~johnnyrichard/olang-devel@lists.sr.ht
 help / color / mirror / code / Atom feed
* [PATCH olang v1 0/5] Refactors to support semantics
@ 2024-10-23  2:20 Carlos Maniero
  2024-10-23  2:20 ` [PATCH olang v1 1/5] type_checker: rename checker to type_checker Carlos Maniero
                   ` (5 more replies)
  0 siblings, 6 replies; 11+ messages in thread
From: Carlos Maniero @ 2024-10-23  2:20 UTC (permalink / raw)
  To: ~johnnyrichard/olang-devel; +Cc: Carlos Maniero

The semantics is an important part of a compiler but we have postpone
handling it so far. But the cost came, and we started to see some extra
responsibility on the codegen layer because of the lack of semantics.

This patchset does not address semantics per si, but it cover several
tech debts to start supporting it.

Carlos Maniero (5):
  type_checker: rename checker to type_checker
  ast: remove redundancy on ast_node base fields
  ast: unary: rename ast_unary.expr to ast_unary.operand
  ast: remove expr reference from return and var assign nodes
  semantics: add scope to all nodes

 src/ast.c                         |  8 ++--
 src/ast.h                         | 67 ++++++++++++++++---------------
 src/codegen_aarch64.c             |  2 +-
 src/codegen_x86_64.c              | 31 +++++++-------
 src/main.c                        |  2 +-
 src/pretty_print_ast.c            |  4 +-
 src/{checker.c => type_checker.c} | 18 ++++-----
 src/{checker.h => type_checker.h} |  0
 8 files changed, 67 insertions(+), 65 deletions(-)
 rename src/{checker.c => type_checker.c} (93%)
 rename src/{checker.h => type_checker.h} (100%)


base-commit: 2dbf9a9896e5778535bd3dc1d5069a762d3b94fa
-- 
2.46.1


^ permalink raw reply	[flat|nested] 11+ messages in thread
* [PATCH olang v1 1/5] type_checker: rename checker to type_checker
@ 2024-10-23  2:19 Carlos Maniero
  2024-10-23  2:22 ` Carlos Maniero
  0 siblings, 1 reply; 11+ messages in thread
From: Carlos Maniero @ 2024-10-23  2:19 UTC (permalink / raw)
  To: ~johnnyrichard/olang-devel; +Cc: Carlos Maniero

To void adding all the semantics concerns into a single module, we are
renaming the checker file to type_checker.

Other checkers will be introduced as needed.

Signed-off-by: Carlos Maniero <carlos@maniero.me>
---
 src/main.c                        | 2 +-
 src/{checker.c => type_checker.c} | 2 +-
 src/{checker.h => type_checker.h} | 0
 3 files changed, 2 insertions(+), 2 deletions(-)
 rename src/{checker.c => type_checker.c} (99%)
 rename src/{checker.h => type_checker.h} (100%)

diff --git a/src/main.c b/src/main.c
index 685d8ce..c99ccfc 100644
--- a/src/main.c
+++ b/src/main.c
@@ -22,7 +22,6 @@
 #include <string.h>
 
 #include "arena.h"
-#include "checker.h"
 #include "cli.h"
 #include "codegen_aarch64.h"
 #include "codegen_x86_64.h"
@@ -30,6 +29,7 @@
 #include "parser.h"
 #include "pretty_print_ast.h"
 #include "string_view.h"
+#include "type_checker.h"
 
 // TODO: find a better solution to define the arena capacity
 #define ARENA_CAPACITY (1024 * 1024)
diff --git a/src/checker.c b/src/type_checker.c
similarity index 99%
rename from src/checker.c
rename to src/type_checker.c
index 02341cc..b426349 100644
--- a/src/checker.c
+++ b/src/type_checker.c
@@ -14,7 +14,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <https://www.gnu.org/licenses/>.
  */
-#include "checker.h"
+#include "type_checker.h"
 #include "scope.h"
 #include <assert.h>
 #include <errno.h>
diff --git a/src/checker.h b/src/type_checker.h
similarity index 100%
rename from src/checker.h
rename to src/type_checker.h
-- 
2.46.1


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2024-10-23 15:37 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-23  2:20 [PATCH olang v1 0/5] Refactors to support semantics Carlos Maniero
2024-10-23  2:20 ` [PATCH olang v1 1/5] type_checker: rename checker to type_checker Carlos Maniero
2024-10-23  2:20 ` [PATCH olang v1 2/5] ast: remove redundancy on ast_node base fields Carlos Maniero
2024-10-23  2:20 ` [PATCH olang v1 3/5] ast: unary: rename ast_unary.expr to ast_unary.operand Carlos Maniero
2024-10-23  2:20 ` [PATCH olang v1 4/5] ast: remove expr reference from return and var assign nodes Carlos Maniero
2024-10-23  2:20 ` [PATCH olang v1 5/5] semantics: add scope to all nodes Carlos Maniero
2024-10-23  2:21   ` [olang/patches/.build.yml] build success builds.sr.ht
2024-10-23 17:36   ` [PATCH olang v1 5/5] semantics: add scope to all nodes Johnny Richard
2024-10-23 17:34 ` [PATCH olang v1 0/5] Refactors to support semantics Johnny Richard
  -- strict thread matches above, loose matches on Subject: below --
2024-10-23  2:19 [PATCH olang v1 1/5] type_checker: rename checker to type_checker Carlos Maniero
2024-10-23  2:22 ` Carlos Maniero

Code repositories for project(s) associated with this public inbox

	https://git.johnnyrichard.com/olang.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox