Environment:
- Ubuntu 16.04 LTS
- Intel(R) Core(TM) i7-3770K CPU @ 3.50GHz
- Nim Compiler Version 0.14.3 (2016-06-17) [Linux: amd64]
- node v5.10.1
Nim code:
import asynchttpserver, asyncdispatch
##[[ | |
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, |
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 |
require "wasm4" | |
local smiley: []uint8 = { | |
0b11000011, | |
0b10000001, | |
0b00100100, | |
0b00100100, | |
0b00000000, | |
0b00100100, | |
0b10011001, |
-- 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() |
require 'arduino' | |
-- user configurable defines | |
local CELL_SIZE: cint <comptime> = 4 -- the height and width of each cell | |
local DELAY: cint <comptime> = 50 -- number of milliseconds delay between the display of each generation | |
-- end of user configurable defines | |
local ROWS: cint <comptime> = (DISPLAY_HEIGHT // CELL_SIZE) | |
local COLUMNS: cint <comptime> = (DISPLAY_WIDTH // CELL_SIZE) |
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 |
##[=[ | |
linklib 'lua' | |
cinclude '<lua.h>' | |
cinclude '<lauxlib.h>' | |
cinclude '<lualib.h>' | |
local ccdefs = require 'nelua.ccompiler'.get_cc_defines('<lua.h>') | |
static_assert(ccdefs.LUA_VERSION_NUM == 504, 'unsupported Lua version') | |
local c2nelua = { | |
['double'] = float64, |
Environment:
Nim code:
import asynchttpserver, asyncdispatch
/* 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" |
/* 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 |