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
""" | |
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy) | |
BSD License | |
""" | |
import numpy as np | |
# data I/O | |
data = open('input.txt', 'r').read() # should be simple plain text file | |
chars = list(set(data)) | |
data_size, vocab_size = len(data), len(chars) |
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
;; my_addr(MYADDR) get_jwa_method_id(103289) args(2) master_code ret(1) master_data | |
;; RUNVM +1 +4 +32 | |
;; address exitcode c4' c5' | |
slice vm::invoke_get_addr(cell master_code, cell master_data) asm | |
"MYADDR // mc md my_addr" | |
"103829 PUSHINT // mc md my_addr get_jwa_method_id" | |
"2 PUSHINT // mc md my_addr get_jwa_method_id args" | |
"2 3 BLKSWAP // my_addr get_jwa_method_id args mc md" | |
"1 PUSHINT // my_addr get_jwa_method_id args mc md ret" |
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 Build = std.Build; | |
pub fn build(b: *Build) void { | |
const target = b.standardTargetOptions(.{}); | |
const optimize = b.standardOptimizeOption(.{}); | |
// Instead of using the classic b.addExecutable, we use a custom rule | |
// to compile with Zig, then optimize with LLVM. | |
const exe = addLLvmExecutable(b, .{ |