Skip to content

Instantly share code, notes, and snippets.

View novusnota's full-sized avatar
:accessibility:
be curious, do better

Novus Nota novusnota

:accessibility:
be curious, do better
View GitHub Profile
@novusnota
novusnota / min-char-rnn.py
Created April 9, 2024 17:49 — forked from karpathy/min-char-rnn.py
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
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)
;; 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"
@novusnota
novusnota / build.zig
Created May 5, 2024 22:43 — forked from gwenzek/build.zig
Building with Zig and system LLVM
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, .{