Skip to content

Instantly share code, notes, and snippets.

@skial
skial / haxe-community-made-targets.md
Last active August 21, 2024 07:43
List of community made Haxe targets.
  • hxgenjs Extensible JS generator for Haxe.
  • Craxe Nimlang generator.
  • sfgml A Haxe » GML compiler.
  • Nosey Haxe to Json.
  • haxe_in_haxe Attempt at rewriting the Haxe compiler directly in Haxe.
  • Genes Custom ES6 generator for split JS + d.ts + source maps.
  • hxgenpe Generate Portable Executable Binaries from Haxe IR/AST.
  • hxpico8 Experimental Lua target for Haxe.
  • sillysharp An unconventional Haxe➜C# compiler.
@skial
skial / StringParser.hx
Created October 5, 2020 13:45
Ascii string to decimal parser, 0-9 are the only valid characters. Why? Because an itch HAD to be scratched 🤷‍♀️ Its not worth using and its most likely hugely unoptimized from a bitwise standpoint. Just use a regular expression!
package ;
class StringParser {
public static function parseDecimal(v:String):RawInt {
var result:RawInt = 0;
var code = 0;
var base = 1;
var index = v.length;
package ;
#if (eval || macro)
import haxe.macro.Expr;
#end
abstract Foo<T>(T) {
@:from public static macro function fromThing<T>(e:ExprOf<Thing>):ExprOf<Foo<T>> {
return macro null;
}

Keybase proof

I hereby claim:

  • I am skial on github.
  • I am skial (https://keybase.io/skial) on keybase.
  • I have a public key ASCbzwgT_Xw8auhYQRLlWVsCnrPork6DfIpPgHRWR48Fqgo

To claim this, I am signing this object:

@skial
skial / lighthouse.html
Created March 9, 2017 11:16
haxe.io lighthouse results for 09-03-2017
<html lang="en" data-report-context="extension"><head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
<link rel="icon" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAADjklEQVR4AWI08P/HQEvAQrxSQKvlECfLFYXx75xCY2qmh89GbNvOMjb3v9jOOlxnFWxj206ebQ3b7q6q+z1rNagu8/zvPSZACAABpeUAA0miMgU7SA7JjCraFGwZwECOwvL75dWjsKgWBKtx0jvWo+vkBAFbACCkByMP6nMn48+AVgXB2fzSCwsv22/lMGlUhmJ0AE7BH8dyUUDbUEgN6RzJRSeaPxhdRYR0Inel+7Hd5lBiFpkMAxACc0394//9C4voFHDiAAGLpuOXebdfdHfctgwJKaZRLRKy6ItrSis6RBnVBgGtbHyKTEmJHQoEXoBCE5BCrDeA2ogMUIGDAKEBDEhUqwgMqBYDjW4DQzmuffVdqff42/ZQYYqVcMXGZsMPyCsH3lyJSetxvEaxAQXdjR1HjfwCdIS7lo2DZke26Qe+MXO12OWkGT0O6oE7vMGkMnkYw4aN1KQgMKExhXqswfiov4+a7MQ11XPnbr/5qpKlgACAAQj94Lu271bN9DUecQasIZlNzG72llRAAKJiAi+/BSHrSFjRvQhg3DEKEqJh08tsmLTx597+f6enr4cc2Zpk57pihfX24dW7RHcOLLUbJYhJSl0ErQCI9BVXH/XrO97QasuvQQSiECa0BrQCIIJp6X9T/r8QG6L71WYSqCoIIGo2BZDUBnS/D9EA9Nun1iYvbM0MFExIDQRoKFatc1Z6zrm5uWeObJotq0BGV9FuQBWq5a4Fw3PPz848rZHstZSuA5FWA
@skial
skial / Main.hx
Created August 18, 2016 09:12
Sample code for abstract macro question over on the Haxe mailing list - https://groups.google.com/d/msg/haxelang/0IBfsEs3OHg/Hx9DfmDTAwAJ
package ;
class Main {
public static function main() {
new Main();
}
public function new() {
trace( MyAbstract.getAllValues() );
@skial
skial / Macro.hx
Created August 16, 2016 16:58
Example code for haxe mailing list question Macro question, want to find the "expected identifier" - https://groups.google.com/d/msg/haxelang/N1ysdWAVAEo/0wZZJyI2AwAJ
package ;
import haxe.macro.Type;
import haxe.macro.Expr;
import haxe.macro.Context;
import haxe.macro.Compiler;
using haxe.macro.ExprTools;
class Macro {
@skial
skial / Main.hx
Last active August 2, 2016 11:02
Experimental code for https://groups.google.com/d/msg/haxelang/6W3gmh_DV-I/JFLiTgBXBwAJ over on the Haxe mailing list, using Haxe 3.3.0 (git build development @ f736708), but should work with Haxe 3.3.0
package ;
@:build(MyMacro.build())
class Main {
public static function main() {
MyMacro.register('c');
foo('bar');
MyMacro.register('a');
foo('baz');
@skial
skial / Main.hx
Last active June 10, 2016 06:58
Attempted exercise example based on Jeff Ward's mailing list topic, type safe pubsub https://groups.google.com/forum/#!topic/haxelang/xw5WrrssLzQ using Haxe 3.3.0. For Haxe 3.2 version, see http://try.haxe.org/#4ca5B
package;
import haxe.macro.Printer;
#if macro
import haxe.macro.Type;
import haxe.macro.Expr;
import haxe.macro.Context;
#end
/**
package unit.issues;
#if js
@:native("__issue4862__http_status")
@:enum private extern abstract HttpStatus(Int) to Int {
var Ok;
var NotFound;
static function __init__():Void {
untyped __js__("var __issue4862__http_status = {Ok: 200, NotFound: 404};");