Skip to content

Instantly share code, notes, and snippets.

View planetis-m's full-sized avatar
💭
Make everything from scratch. Hardcore Mode.

Antonis Geralis planetis-m

💭
Make everything from scratch. Hardcore Mode.
View GitHub Profile
double t = 0.0;
const double dt = 0.01;
double currentTime = hires_time_in_seconds();
double accumulator = 0.0;
State previous;
State current;
while ( !quit )
@zacharycarter
zacharycarter / wclwn.md
Last active March 12, 2024 12:45
Binding to C Libraries with Nim
type
Handness = enum
hLeft,
hRight
NearFar = enum
nfDefault,
nfReverse
Vec3 = object
@dakom
dakom / ECS notes.md
Last active May 27, 2024 10:42
ECS with sparse array notes (EnTT style)

Intro

The below is a breakdown / bird's eye view of how a sparse-array backed ECS like EnTT or Shipyard works.

Please see the thanks and references at the bottom - without their help I would not have been able to share this breakdown with you... everything here is really just notes and rephrasing of what they've written already :)

Also, these notes do not cover archetype systems (like unity) nor adaptations of archetypes (like in Flecs). Though there's a couple comparative footnotes at the end.

Here we go!

import nico
import nico/vec
import strformat
type Object = ref object
color: int
pos: Vec2f
rawPoints: seq[Vec2f]
angle: float32
highlightEdgeIndex: int
@ftsf
ftsf / grids.nim
Created May 5, 2021 01:23
Simple Grid System for Nico
import nico
import nico/vec
type GridLayout* = enum
gridSquare
gridHexPointyTop
type Grid*[T] = ref object
layout*: GridLayout
wrapX*: bool
@omentic
omentic / suggestions.md
Last active December 10, 2023 22:26
Compilation of suggestions from the Nim v2 thread

Suggestions for Nim v2

Note: this document is a collection of all proposals from the Nim v2 ideas thread. As such, it is/was not by any means reflective of intentions for 2.0: though I've updated this with accepted and implemented proposals.

Breaking changes

Features

  • kobi, exelotl, didlybom, solomonthewise, pdkoekfr, snej, apropos: Adopt Options module and make types not nil by default (discussion)
  • Zoom, apropos: Overhaul stdlib to work with view types and/or options/results for error handling
@lleyton
lleyton / translation.md
Last active January 23, 2024 16:53
(ENG) Open Source Business Challenges and Reality, Rui Ueyama

Open Source Business Challenges and Reality

Original Japanese note here.

Original Author: Rui Ueyama (creator of the mold linker)

Translated by @windowsboy111

Minimally edited by @lleyton

Cheap exceptions

Goals:

  • Avoid Rust's Option/Either manual error handling strategy.
  • Make exceptions cheaper.
  • Avoid error translation between Nim libraries by construction. The new vocabulary type ErrorCode is what should be used. Wrappers should translate errors to ErrorCode.
  • Make the error out of memory easier to handle.
  • Resolve once and for all the "error codes vs exceptions" choice.