From 4d0fdf995ab098c19d5290b7c376eb5d143935e7 Mon Sep 17 00:00:00 2001 From: Oscar josue Rodriguez Blanco Date: Tue, 3 Jan 2023 03:15:21 +0000 Subject: [PATCH] README.md modification and hello world go --- README.md | 25 +++++++++++++++++++++++++ compiler.go | 7 +++++++ go.mod | 3 +++ 3 files changed, 35 insertions(+) create mode 100644 compiler.go create mode 100644 go.mod diff --git a/README.md b/README.md index 5d8701e..22e1229 100644 --- a/README.md +++ b/README.md @@ -1 +1,26 @@ # TinyThreePassCompiler + +# The problem + +This problem is derived from the [Tiny Three-Pass Compiler kata from codewars](https://www.codewars.com/kata/5265b0885fda8eac5900093b) +and basically it is about writing a three-pass compiler for a simple programming +language into a small assembly language which syntax is like follows: + +```bash +[ a b ] a*a + b*b +``` +> a^2 + b^2 + +```bash +[ first second ] (first + second) / 2 +``` +> average of two numbers + + +# How is this implementation different from the original kata + +The plan for this implementation is to make it work not with JSON structures but +with protocol buffers, the reason is basically just to practice those technologies +but it is also true that in a real compiler saving and transporting binaries and +not text as it would be the case for JSON could mean a significant improvement. + diff --git a/compiler.go b/compiler.go new file mode 100644 index 0000000..84e3f54 --- /dev/null +++ b/compiler.go @@ -0,0 +1,7 @@ +package main + +import "fmt" + +func main() { + fmt.Println("Hello, world.") +} diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..e73107b --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module TinyThreePassCompiler + +go 1.19 -- 2.25.1