This file contains hidden or 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 Nim Compiler v0.10.1 */ | |
/* (c) 2014 Andreas Rumpf */ | |
/* The generated code is subject to the original license. */ | |
/* Compiled for: Linux, amd64, gcc */ | |
/* Command for C compiler: | |
icc -c -w -vec-report=5 -O3 -mmic -fopenmp -O3 -fno-strict-aliasing -I/amd.home/home/felsing/nim/lib -o /amd.home/home/felsing/test/nimcache/helloflops.o /amd.home/home/felsing/test/nimcache/helloflops.c */ | |
#define NIM_INTBITS 64 | |
#include "nimbase.h" | |
#include <stdio.h> |
This file contains hidden or 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 asynchttpserver, asyncdispatch | |
var server = newAsyncHttpServer() | |
proc cb(req: Request) {.async.} = | |
await req.respond(Http200, "{ \"message\": \"Hello, World!\"}") | |
asyncCheck server.serve(Port(8000), cb) | |
runForever() |
This file contains hidden or 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
type TaskFn = iterator (): float | |
iterator a1(): float {.closure.} = | |
var k = 10 | |
while k > 0: | |
echo "a1 ", k | |
dec k | |
yield 1.0 | |
This file contains hidden or 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
let foo = (proc: seq[int] = | |
result = @[] | |
for a in 1..10: | |
for v in 1..10: | |
result.add(a+v) | |
)() | |
echo foo |
This file contains hidden or 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
type # Fine with ref object | |
T = object of RootObj | |
myValue: string | |
S1 = object of T | |
S2 = object of T | |
method speak(x: T) = echo "T Hello ", x.myValue | |
method speak(x: S1) = echo "S1 Meow ", x.myValue | |
method speak(x: S2) = echo "S2 Woof ", x.myValue |
This file contains hidden or 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
cmake . | |
CMake Error at src/SFML/CMakeLists.txt:27 (find_package): | |
By not providing "FindSFML.cmake" in CMAKE_MODULE_PATH this project has | |
asked CMake to find a package configuration file provided by "SFML", but | |
CMake did not find one. | |
Could not find a package configuration file provided by "SFML" (requested | |
version 2.0) with any of the following names: | |
SFMLConfig.cmake |
This file contains hidden or 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
#include<math.h> | |
#include<stdio.h> | |
// clang: HERE2 | |
// gcc: HERE2 | |
// tcc: NO OUTPUT | |
int main() | |
{ | |
if (0.0 <= NAN) | |
puts("HERE1"); | |
if (!(0.0 <= NAN)) |
This file contains hidden or 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 math | |
import sequtils | |
import sdl | |
const | |
width = 1280 | |
height = 720 | |
fov = 45.0 | |
max_depth = 6 | |
This file contains hidden or 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 unsigned, strutils | |
type TCrc32* = uint32 | |
const InitCrc32* = TCrc32(-1) | |
proc createCrcTable(): array[0..255, TCrc32] = | |
for i in 0..255: | |
var rem = TCrc32(i) | |
for j in 0..7: | |
if (rem and 1) > 0: rem = (rem shr 1) xor TCrc32(0xedb88320) |
This file contains hidden or 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 Nim Compiler v0.10.3 */ | |
/* (c) 2015 Andreas Rumpf */ | |
/* The generated code is subject to the original license. */ | |
/* Compiled for: Linux, amd64, gcc */ | |
/* Command for C compiler: | |
gcc -c -w -O3 -fno-strict-aliasing -I/media/nim/lib -o /home/deen/nimcache/asd.o /home/deen/nimcache/asd.c */ | |
#define NIM_INTBITS 64 | |
#include "nimbase.h" | |
#include <stdio.h> |