This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!!strict | |
-- optimize for performance | |
!!cflags '-O3 -ffast-math -march=native -fno-plt -flto -fopenmp -rdynamic -g' | |
!!ldflags '-flto' | |
-------------------------------------------------------------------------------- | |
-- SDL | |
-- import SDL headers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* This file was auto generated by Euluna. */ | |
/* Compile command: gcc -pipe -std=c99 -fno-strict-aliasing -rdynamic -lm -Wall -Wextra -Wno-incompatible-pointer-types -g -lSDL2 -o "euluna_cache/playground/snake" "euluna_cache/playground/snake.c" */ | |
/* Compile hash: 2waXGLampSxudc7zNvTWHfYvFPNb */ | |
#include <stddef.h> | |
#include <stdint.h> | |
#include <stdbool.h> | |
#include <stdarg.h> | |
#include <string.h> | |
#define EULUNA_NORETURN __attribute__((noreturn)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- import SDL headers | |
!!cdefine 'SDL_DISABLE_IMMINTRIN_H' | |
!!cinclude '<SDL2/SDL.h>' | |
!!linklib 'SDL2' | |
-- import SDL structures | |
local SDL_Event = @record { | |
type: uint32, | |
padding: array<byte, 56> | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package = "lcomplex" | |
version="20180729-1" | |
source = { | |
url = "http://webserver2.tecgraf.puc-rio.br/~lhf/ftp/lua/ar/lcomplex-100.tar.gz", | |
dir = "lcomplex-100", | |
md5 = "ba3c9babf127cf1a313453bcabaf2a73" | |
} | |
description = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package="lbc" | |
version="20180729-1" | |
source = { | |
url = "http://webserver2.tecgraf.puc-rio.br/~lhf/ftp/lua/ar/lbc-100.tar.gz", | |
md5 = "e5db9e3d0cc28099e0b3b6018939b43e", | |
dir = "lbc-100" | |
} | |
description = { | |
summary = "A simple arbitrary precision library", | |
detailed = [[ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local function get_args(fun) | |
local args = {} | |
local hook = debug.gethook() | |
local argHook = function( ... ) | |
local info = debug.getinfo(3) | |
if 'pcall' ~= info.name then return end | |
for i=1,100 do | |
local name, value = debug.getlocal(2, i) | |
if name == nil or name:match('%(') then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function debug_refs() | |
local reftable = {} | |
local function trace_refs(o, src, src2, src3) | |
local typ = type(o) | |
if typ == 'number' or typ == 'boolean' or typ == 'string' or typ == 'thread' or typ == 'nil' then return end | |
if o == debug_refs or o == reftable or o == trace_refs then return end | |
if reftable[o] then return end | |
reftable[o] = true | |
if src3 then | |
src = string.format('%s%s%s', src, src2, tostring(src3)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local mdbs = {} | |
return function(config_name) | |
local mdb = mdbs[config_name] | |
if mdb then return mdb end | |
local type, tostring, pairs, select | |
do | |
local _obj_0 = _G | |
type, tostring, pairs, select = _obj_0.type, _obj_0.tostring, _obj_0.pairs, _obj_0.select | |
end | |
local concat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sequtils, random | |
proc c_malloc(size: csize): pointer {.importc: "malloc", header: "<stdlib.h>".} | |
proc c_aligned_alloc(alignment, size: csize): pointer {.importc: "aligned_alloc", header: "<stdlib.h>".} | |
proc c_free(p: pointer) {.importc: "free", header: "<stdlib.h>".} | |
proc mkl_malloc(size: csize, align: int): pointer {.importc: "mkl_malloc", header: "<mkl.h>".} | |
proc mkl_free(p: pointer) {.importc: "mkl_free", header: "<mkl.h>".} | |
{.passL:"-lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lm".} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
########## Shape Array | |
const MAXRANK* = 8 | |
type | |
ShapeArray* = object | |
data: array[MAXRANK, int] | |
len: int | |
proc newShapeArray*(len: int): ShapeArray {.inline.} = |