From 7103d3a1df6c7fee6e8efbe3588204d1e869004e Mon Sep 17 00:00:00 2001 From: dec05eba Date: Mon, 9 Sep 2019 01:28:26 +0200 Subject: Add code example to README --- README.md | 9 +++++++++ src/bytecode/bytecode.c | 1 - 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2668852..6137385 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,15 @@ Amalgam is not meant to be a replacement for any other language but rather a new with gpu without writing an external gpu program (glsl/hlsl). Files have to be in utf-8 format and can optionally have utf-8 BOM. +## Example +Hello world example: +``` +const io = @import("std/io.amal"); + +const main = fn { + io.stdout.write("hello, world!\n"); +} +``` ## Important Amalgam is not ready to be used yet. # Fast compilation diff --git a/src/bytecode/bytecode.c b/src/bytecode/bytecode.c index 0ee066c..2c43471 100644 --- a/src/bytecode/bytecode.c +++ b/src/bytecode/bytecode.c @@ -191,7 +191,6 @@ static void add_functions(BytecodeCompilerContext *self) { assert(sizeof(BytecodeHeaderFunction) == 22); self->bytecode->funcs_index = instructions->size; - amal_log_debug("func index: %d", self->bytecode->funcs_index); throw_if_error(buffer_expand(instructions, sizeof(u16) + sizeof(u32) + funcs_size)); throw_if_error(buffer_append(instructions, &ssa->func_counter, sizeof(u16))); throw_if_error(buffer_append(instructions, &funcs_size, sizeof(u32))); -- cgit v1.2.3