Skip to content

Instantly share code, notes, and snippets.

@gingerBill
gingerBill / odin_syntax.ebnf
Last active March 17, 2021 04:37
Odin EBNF
/*
Production = production_name "=" [ Expression ] "." .
Expression = Alternative { "|" Alternative } .
Alternative = Term { Term } .
Term = production_name | token [ "…" token ] | Group | Option | Repetition .
Group = "(" Expression ")" .
Option = "[" Expression "]" .
Repetition = "{" Expression "}" .
#include <stdio.h>
#include "bgfx/bgfx.h"
#include "bgfx/platform.h"
#include "bx/math.h"
#include "GLFW/glfw3.h"
#define GLFW_EXPOSE_NATIVE_WIN32
#include "GLFW/glfw3native.h"
#define WNDW_WIDTH 1600
#define WNDW_HEIGHT 900
@monsterbrain
monsterbrain / space_invaders_raylibgame.c
Created December 28, 2018 17:32
Raylib Space Invader Game Tutorial Full source Code. Made for this blogpost. https://monsterbraininc.com/2018/12/raylib-game-tutorial-space-invaders-using-vscode/
/*******************************************************************************************
*
* raylib - sample game: space invaders
*
* Based on Sample game developed by Ian Eito, Albert Martos and Ramon Santamaria
* Modifed by Monster Brain (monsterbraininc.com) - 2018
*
* This game has been created using raylib v1.3 (www.raylib.com)
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
*
import argparse # To read the word we want to parse from stdin
# An error we will throw when a parse error occurs
class ParseError(Exception):
pass
# The meat and potatoes
class Parser():
def __init__(self, string):
@38
38 / Makefile
Last active February 19, 2024 02:12
A Minimal LLVM JIT example for LLVM-5
jit-toy: jit-toy.cpp
clang++ -g -o $@ $^ $(shell /usr/lib/llvm-5.0/bin/llvm-config --cxxflags --ldflags --system-libs --libs core)
#include <algorithm>
#include <cassert>
#include <cstring>
#include <iostream>
#include <memory>
#include <vector>
#if defined(VK_USE_PLATFORM_WIN32_KHR)
#elif defined(VK_USE_PLATFORM_ANDROID_KHR)
#elif defined(VK_USE_PLATFORM_WAYLAND_KHR)
[package]
name = "snake_game"
version = "0.1.0"
authors = ["youcodethings <[email protected]>"]
[dependencies]
piston = "0.36.0"
piston2d-graphics = "0.26.0"
pistoncore-glutin_window = "0.45.0"
piston2d-opengl_graphics = "0.52.0"
#include <stdio.h>
#include <string.h>
enum jstates {JFAILED, JNXT, JSEP, JUP, JDWN, JQUP, JQDWN, JESC, JUNESC, JBARE, JUNBARE, JUTF8_2,
JUTF8_3, JUTF8_4, JUTF8_N, JSTATE_CNT};
enum jtype {JEOS,JERR,JTSEP,JOBJB,JOBJE,JARRB,JARRE,JNUM,JSTR,JTRUE,JFALSE,JNULL};
struct jtok {int type, len; const char *str;};
struct jctx {const unsigned char *tbl; const char *cur, *end;};
static const unsigned char jtbl[256] = {
# QEmu
brew install qemu
# Home for out tests
mkdir ~/arm-emu
cd ~/arm-emu
# Download initrd and kernel
wget http://ftp.de.debian.org/debian/dists/jessie/main/installer-armel/current/images/versatile/netboot/initrd.gz

Rust is Software's Salvation

After the post by Steve Klabnik, "Rust is more than safety", and a reply by Graydon Hoare, "Rust is mostly safety" - I thought it wise to throw my opinion into the mix, whether warranted or not. This is going to be a long article, which I hope raises some points that will be interesting to you.

Experience with Rust

First, I would like to clarify my experience with Rust. I first discovered Rust through reddit, in late 2014, version 0.11. What stood out to me immediately was a different focus on software - a focus on being the best language possible.

What I found in Rust was a language that was:

  • Better safety than Ada