Skip to content

Instantly share code, notes, and snippets.

@gingerBill
gingerBill / checklist.txt
Last active April 18, 2024 02:16
Language Design Checklist for Odin
You appear to be advocating a new:
[ ] functional [x] imperative [ ] object-oriented [x] procedural [ ] stack-based
[ ] "multi-paradigm" [ ] lazy [x] eager [x] statically-typed [ ] dynamically-typed
[ ] pure [x] impure [ ] non-hygienic [ ] visual [ ] beginner-friendly
[ ] non-programmer-friendly [ ] completely incomprehensible
programming language. Your language will not work. Here is why it will not work.
You appear to believe that:
[ ] Syntax is what makes programming difficult
[ ] Garbage collection is free [ ] Computers have infinite memory
@gingerBill
gingerBill / llvm_passes.txt
Last active March 20, 2024 13:07
LLVM 17.0.1 default<O?> module passes
# LLVM 17.0.1 Passes
## default<O0>
always-inline,
coro-cond(
coro-early,
cgscc(
coro-split
@gingerBill
gingerBill / odin.ebnf
Last active September 22, 2023 00:24
Odin EBNF (Work In Progress)
/* characters */
newline = /* the Unicode code point U+000A */ .
unicode_char = /* an arbitrary Unicode codepoint except newline */ .
unicode_letter = /* a Unicode code point categorized as "Letter" */ .
unicode_digit = /* a Unicode code point categorized as "Number, decimal digit" */ .
letter = unicode_letter | "_" .
decimal_digit = "0" ... "9" .
binary_digit = "0" | "1" .
@gingerBill
gingerBill / d3d11_in_odin.odin
Last active March 22, 2024 22:53
D3D11 in Odin
package d3d11_main
import D3D11 "vendor:directx/d3d11"
import DXGI "vendor:directx/dxgi"
import D3D "vendor:directx/d3d_compiler"
import SDL "vendor:sdl2"
import glm "core:math/linalg/glsl"
// Based off https://gist.github.com/d7samurai/261c69490cce0620d0bfc93003cd1052
@gingerBill
gingerBill / metal_in_odin.odin
Last active April 11, 2024 18:12
Metal in Odin Natively
package objc_test
import NS "vendor:darwin/Foundation"
import MTL "vendor:darwin/Metal"
import CA "vendor:darwin/QuartzCore"
import SDL "vendor:sdl2"
import "core:fmt"
import "core:os"
@gingerBill
gingerBill / wasm4_wasm32.odin
Created November 9, 2021 15:34
WASM-4 Odin Bindings
// WASM-4: https://wasm4.org/docs
package wasm4
foreign import wasm4 "env"
#assert(size_of(int) == size_of(u32))
// ┌───────────────────────────────────────────────────────────────────────────┐
// │ │
// │ Platform Constants │
@gingerBill
gingerBill / wasm4_wasm32.odin
Last active April 4, 2024 09:33
WASM-4 Odin bindings
// WASM-4: https://wasm4.org/docs
package wasm4
foreign import wasm4 "env"
#assert(size_of(int) == size_of(u32))
// ┌───────────────────────────────────────────────────────────────────────────┐
// │ │
// │ Platform Constants │
@gingerBill
gingerBill / sdl2_opengl_demo.odin
Last active March 16, 2024 15:47
Simple SDL2 + OpenGL demo written in Odin
package main
import "core:fmt"
import glm "core:math/linalg/glsl"
import "core:time"
import SDL "vendor:sdl2"
import gl "vendor:OpenGL"
main :: proc() {
@gingerBill
gingerBill / microui_raylib_demo.odin
Created October 2, 2021 23:17
microui + raylib Demo in Odin
package microui_raylib
import "core:fmt"
import "core:unicode/utf8"
import rl "vendor:raylib"
import mu "vendor:microui"
state := struct {
mu_ctx: mu.Context,
log_buf: [1<<16]byte,
@gingerBill
gingerBill / raylib_tetroid.odin
Last active October 4, 2021 10:33
Tetroid in raylib with Odin
package main
/*******************************************************************************************
*
* raylib - classic game: tetroid
*
* Sample game developed by Marc Palau and Ramon Santamaria
*
* This game has been created using raylib v1.3 (www.raylib.com)