This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The MIT License (MIT) | |
Copyright (c) 2016 Paulo Henrique Rodrigues Pinheiro <paulo@sysincloud.it> | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"image" | |
"image/color" | |
"image/png" | |
"os" | |
) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This archive contains the following programs: | |
bfc The compiler for the 'brainfuck' language (240 bytes!) | |
bfc.asm Source for the compiler | |
bfi The interpreter for the 'brainfuck' language | |
bfi.c Source for the interpreter (portable) | |
src/ Some example programs in 'brainfuck' | |
src/atoi.b Reads a number from stdin | |
src/div10.b Divides the number under the pointer by 10 | |
src/hello.b The ubiquitous "Hello World!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Seguindo a receita em https://golang.org/doc/install/source | |
Tendo o go instalado, em meu fedora tive que instalar o pacote gccgo,: | |
gcc-go-10.1.1-1.fc32.x86_64 Go support | |
libgo-10.1.1-1.fc32.x86_64 Go runtime | |
libgo-devel-10.1.1-1.fc32.x86_64 Go development libraries | |
Voltando às instruções: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const std = @import("std"); | |
const MEMORY_SIZE :i32 = 30_000; | |
fn execute(program: []const u8) [MEMORY_SIZE]i8 { | |
var memory :[MEMORY_SIZE]i8 = [_]i8{0} ** MEMORY_SIZE; | |
var memory_index: u32 = 0; | |
var output = std.ArrayList(u8).init(std.heap.page_allocator); | |
defer output.deinit(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package primitives | |
import ( | |
"errors" | |
"reflect" | |
) | |
// The definitions in functions are from THE book: | |
// Friedman & Felleisen. The Little Schemer, Fourth Edition, MIT Press, 1996. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"image" | |
"image/color" | |
"image/png" | |
"math" | |
"os" | |
"sync" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
// Void - a generic type | |
type Void struct { | |
value interface{} | |
} | |
func work(universe map[int]interface{}, v Void) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"image" | |
"image/color" | |
"image/png" | |
"math/cmplx" | |
"os" | |
"sync" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bufio" | |
"fmt" | |
"log" | |
"os" | |
) | |
type Language struct { |
NewerOlder