Skip to content

Instantly share code, notes, and snippets.

View PeyTy's full-sized avatar
🍵
Sipping my tea [:

Miraculous Ladybugreport PeyTy

🍵
Sipping my tea [:
View GitHub Profile

I'm pretty sure people would ask me about this.

Why not create a yet another Linux distro?

My personal experience covers:

  • Ubuntu 12.04 LTS and newer releases since then
  • ArchLinux (Antergos)
  • Kubuntu
  • Puppy

Hi! This is my idea about the feature I want to add into my own language Hexa* and especially Zig** (because it fits Zig very well!).

* not promoting Hexa here, really want Zig to fight Rust "monopoly" on safe memory management

** very unlikely that I will implement it myself, hopefully someone will be yakbaited

I was evaluating usage of Zig for my projects and never liked the absence of any assisted memory managemnt (defer is not really a solution to complex memory issues but it doesn't matter on the subject) (and Rust is too annoying to deal with).

@andrewrk
andrewrk / microsoft_craziness.h
Created September 1, 2018 14:35
jonathan blow's c++ code for finding msvc
//
// Author: Jonathan Blow
// Version: 1
// Date: 31 August, 2018
//
// This code is released under the MIT license, which you can find at
//
// https://opensource.org/licenses/MIT
//
//
@RealyUniqueName
RealyUniqueName / Test.hx
Created August 13, 2016 03:17
New php generator for Haxe
package example;
import php7.Exception;
class TestSuper {
function new () {}
function superMethod () return [Std.random(2), Std.random(2)][Std.random(2)];
@deathbeam
deathbeam / greet.spoon
Last active February 11, 2025 00:31
Spoon compiler test
#!/usr/bin/env coffee
# Spoon code:
greet = name -> trace "Hello #{name}, how are you?"
greet "Person"
# Compiler result (fully working Haxe code):
#
# class Greet {
# static public function main() {
@rygorous
rygorous / gist:e0f055bfb74e3d5f0af20690759de5a7
Created May 8, 2016 06:54
A bit of background on compilers exploiting signed overflow
Why do compilers even bother with exploiting undefinedness signed overflow? And what are those
mysterious cases where it helps?
A lot of people (myself included) are against transforms that aggressively exploit undefined behavior, but
I think it's useful to know what compiler writers are accomplishing by this.
TL;DR: C doesn't work very well if int!=register width, but (for backwards compat) int is 32-bit on all
major 64-bit targets, and this causes quite hairy problems for code generation and optimization in some
fairly common cases. The signed overflow UB exploitation is an attempt to work around this.
from Sys import print
interface Greeter
function greet(name)
print "Hello #name"
end
end
class Person
include Greeter
@deathbeam
deathbeam / Errors.md
Last active November 23, 2015 00:58
Here is compiler output for same error in 4 different supported output formats for my new language

Below is error output of compiler trying to compile this file (as I lexed the multiline comment, but I do not consumed it in parser).



###
aaa
###

Switching between different error outputs is simple as passing --error json when running from command-line.

# Pythonic module system
from Sys import print
# Annotations and generic types
\:generic
class MyValue<T>
# Fat arrow closures means no implicit return
new = (value : T) =>
@value = value
@nadako
nadako / Main.hx
Created June 24, 2015 19:36
Haxe + SDL = native love \o/
class Main {
static function main() {
Sdl.init(Sdl.INIT_EVERYTHING);
var win = Sdl.createWindow("Hello", 100, 100, 800, 600, Sdl.WINDOW_OPENGL);
var ren = Sdl.createRenderer(win, -1, Sdl.RENDERER_ACCELERATED);
var bmp = Sdl.loadBMP("test.bmp");
var tex = Sdl.createTextureFromSurface(ren, bmp);
Sdl.freeSurface(bmp);
for (i in 0...3) {