Skip to content

Instantly share code, notes, and snippets.

@gingerBill
gingerBill / freetype.odin
Created October 15, 2019 19:35
FreeType Odin
package freetype
import "core:c"
when ODIN_OS == "windows" {
foreign import freetype "freetype291.lib";
}
when ODIN_OS == "darwin" do foreign import freetype {
"macos/libfreetype.a",
}
@gingerBill
gingerBill / glfw.odin
Last active October 13, 2019 13:34
Odin package glfw
package glfw
import "core:fmt"
import "core:math"
import "core:mem"
when ODIN_OS == "linux" do foreign import glfw "system:glfw";
when ODIN_OS == "darwin" do foreign import glfw {
"macos/libglfw3.a",
"system:Cocoa.framework",
@gingerBill
gingerBill / freetype.odin
Created July 28, 2019 14:56
Odin FreeType Binding
package freetype
import "core:os"
import "core:c"
when os.OS == "windows" {
foreign import freetype {
"freetype291.lib",
// "system:legacy_stdio_definitions.lib",
}
@gingerBill
gingerBill / odin-checklist.txt
Created February 11, 2019 12:08
Odin Checklist
Programming Language Checklist
by Colin McMillen, Jason Reed, and Elly Jones.
Odin language
[x] - yes
[~] - maybe
[?] - unknown
[text] specific answer
@gingerBill
gingerBill / the_library_problem.md
Last active July 14, 2025 07:19
The Library Problem

The Library Problem

General overview of the library problem.

Note: The terms library, module, and package are used interchangeably. Note: This document is subject to extension and modification

Implicit Assumptions:

  • It must be in keeping with the general language's design and philosophy
@gingerBill
gingerBill / cel.odin
Created November 26, 2017 21:09
CEL 2017-11-26
import "core:fmt.odin"
import "core:strconv.odin"
import "core:os.odin"
import "core:raw.odin"
import "token.odin"
sample := `
x = 123;
y = 321.456;
z = x * (y - 1) / 2;
@gingerBill
gingerBill / cel.odin
Last active November 22, 2017 08:10
CEL 2017-11-21
import "core:fmt.odin"
import "core:strconv.odin"
import "core:os.odin"
import "core:raw.odin"
import "token.odin"
Token :: #alias token.Token;
Tokenizer :: #alias token.Tokenizer;
@gingerBill
gingerBill / cel.odin
Last active November 20, 2017 22:49
CEL 2017-11-20
import "core:fmt.odin"
import "core:strconv.odin"
import "core:os.odin"
import "token.odin"
Token :: #alias token.Token;
Tokenizer :: #alias token.Tokenizer;
Array :: []Value;
@gingerBill
gingerBill / priority_queue.cpp
Created August 20, 2017 17:28
Priority Queue
template <typename T>
struct PriorityQueue {
Array<T> queue;
int (* cmp) (T *q, isize i, isize j);
void (* swap)(T *q, isize i, isize j);
};
template <typename T>
bool priority_queue_shift_down(PriorityQueue<T> *pq, isize i0, isize n) {
@gingerBill
gingerBill / gist:5b620b50a02930f4961075e3b4fd3e17
Last active June 26, 2017 14:55
Jai-like Syntax Solution for Foreign Procedures
I'm using `proc` as a prefix to remove ambiguity in the syntax. The current syntax is ambiguous.
(int) // Is this a procedure that takes an int or is it just an int?
Current Jai Syntax:
name :: proc(); // type
name :: proc() {}; // declaration
name :: proc() #foreign lib; // foreign declaration
This syntax fails if you want have foreign variables too. Foreign variables would not have a consistent syntax.