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
require "wasm4" | |
local smiley: []uint8 = { | |
0b11000011, | |
0b10000001, | |
0b00100100, | |
0b00100100, | |
0b00000000, | |
0b00100100, | |
0b10011001, |
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 whole framework is hacky and just a PROOF OF CONCEPT! | |
##[[ | |
primtypes.number = primtypes.float32 | |
primtypes.integer = primtypes.int32 | |
primtypes.uinteger = primtypes.uint32 | |
if OPENMP then | |
cflags '-fopenmp' | |
end | |
local function parallel_for() |
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
require 'microui' | |
require 'hashmap' | |
require 'nene.core' | |
require 'nene.colors' | |
require 'nene.math' | |
require 'nene.font' | |
require 'nene.text_texture' | |
local mu: mu_Context | |
local nene: Nene |
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
/* Generated by Nelua 0.2.0-dev */ | |
/* Compile command: g++ -x c++ "/home/bart/projects/nelua/nelua-lang/nelua_cache/play/draft.c" -o "/home/bart/projects/nelua/nelua-lang/nelua_cache/play/draft" -fwrapv -g -Wall -Wextra -I/usr/include/opencv4 -DWITH_OPENEXR=OFF -lopencv_core -lopencv_imgcodecs -lopencv_highgui -lm */ | |
/* Compile hash: 2oc8quwtnUC8s47mULrq1Bsh5u2U */ | |
/* ------------------------------ DIRECTIVES -------------------------------- */ | |
/* Disable some warnings that the generated code can trigger. */ | |
#if defined(__clang__) | |
#pragma clang diagnostic ignored "-Wtype-limits" | |
#pragma clang diagnostic ignored "-Wwrite-strings" | |
#pragma clang diagnostic ignored "-Wunused" | |
#pragma clang diagnostic ignored "-Wunused-parameter" |
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
/* Generated by Nelua 0.2.0-dev */ | |
/* Compile command: c2m "/home/bart/projects/nelua/nelua-lang/nelua_cache/demos/planet.c" -o "/home/bart/projects/nelua/nelua-lang/nelua_cache/demos/planet" -w -lSDL2 */ | |
/* Compile hash: 2oufrcKZe8TBnJwdhtW2c9mqSzEe */ | |
/* ------------------------------ DIRECTIVES -------------------------------- */ | |
#include <math.h> | |
#include <stdint.h> | |
#define SDL_MAIN_HANDLED | |
#define SDL_DISABLE_MMINTRIN_H | |
#define SDL_DISABLE_IMMINTRIN_H | |
#define SDL_DISABLE_XMMINTRIN_H |
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 typedefs = require 'nelua.typedefs' | |
typedefs.function_annots.noerror = true | |
local cgenerator = require 'nelua.cgenerator' | |
local CEmitter = require 'nelua.cemitter' | |
local orig_Call = cgenerator.visitors.Call | |
function cgenerator.visitors.Call(context, node, emitter, ...) | |
local isblockcall = context:get_visiting_node(1).tag == 'Block' | |
local funcscope = context.scope:get_up_scope_of_kind('is_function') | |
local funcsym = funcscope and funcscope.funcsym |
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
##[[ | |
if GLSL then | |
primtypes.number = primtypes.float32 | |
primtypes.integer = primtypes.cint | |
primtypes.uinteger = primtypes.cuint | |
else | |
primtypes.number = primtypes.float32 | |
primtypes.integer = primtypes.int32 | |
primtypes.uinteger = primtypes.uint32 | |
end |
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
##[[ | |
cflags '-I/usr/include/tensorflow' | |
linklib 'tensorflow' | |
cinclude '<tensorflow/c/c_api.h>' | |
]] | |
global TF_AttrType: type <cimport, nodecl, using> = @enum(cint){ | |
TF_ATTR_STRING = 0, | |
TF_ATTR_INT = 1, | |
TF_ATTR_FLOAT = 2, | |
TF_ATTR_BOOL = 3, |
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 fs = require 'nelua.utils.fs' | |
local traits = require 'nelua.utils.traits' | |
local stringer = require 'nelua.utils.stringer' | |
local parser = require 'nelua.syntaxdefs'().parser | |
local re = require 'nelua.thirdparty.relabel' | |
local filename = 'lib/string.nelua' | |
local filecode = fs.ereadfile(filename) | |
local ast = parser:parse(filecode, filename) |
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
collectgarbage('stop') -- we don't want the GC to generate noise in the benchmarks | |
local function bench(f, n) | |
collectgarbage('collect') | |
n = n or 1000000 | |
local rdtsc = require 'rdtsc' | |
local s = rdtsc() | |
for _=1,n do | |
f() | |
end |
NewerOlder