Skip to content

Instantly share code, notes, and snippets.

@snakeru
snakeru / sim.rs
Created July 6, 2021 15:30 — forked from zesterer/sim.rs
use std::{
f32,
io
};
use minifb::{
Key,
WindowOptions,
Window,
};
use vek::*;
@snakeru
snakeru / go2generics.md
Last active August 16, 2019 19:21
Go2 generics syntax simplification proposal.

This is feedback about "Why Generics?" blog entry (Ian Lance Taylor, 31 July 2019). I hope you find it useful.

As a long-time Go user, but a person who only now discovered that there is an ongoing generics effort in Go I find the following three aspects confusing:

  1. (least confusing) The fact that a well-known keyword type appears in a function declaration
  2. The fact that using a generic type and defining a contract for it use different keywords that are seemingly independent (type vs contract)
  3. (most confusing) The fact that the word order in defining and using a generic type is different:

type Graph (type Node, Edge G) vs contract G(Node, Edge) (note G taking the last and not-so-last position).