THIS PAGE IS UNMAINTAINED. You probably want https://github.com/RedBeard0531/mongo_module_ninja#-icecream-support
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
" :source this file in your "main" nim file to activate. | |
" You can run :source again to switch main file or when nimsuggest crashes. | |
" You can also :call nimsuggest#run('use') to see all uses of the thing your | |
" cursor is on. | |
"call system("killall nimsuggest") | |
let nimsuggest_job = job_start(["nimsuggest", "--stdin", "--v2", "--debug", "--log", expand("%")], { | |
\ "in_mode" : "nl", | |
\ "out_mode" : "nl", | |
\ "err_io": "out", |
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
# nim check -d=nimDumpAsync input.nim | |
proc foo(): Future[void] = | |
var retFuture259001 = newFuture[void]("foo") | |
iterator fooIter259002(): FutureBase {.closure.} = | |
echo "before await" | |
var future259003 = newFuture[void]() | |
yield future259003 | |
if future259003.failed: | |
setCurrentException(future259003.error) | |
if future259003.error of Exception: |
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
## HHSet is a Heterogeneous Hash Set - It allows O(1) lookup of values by any compatible type. | |
{.experimental.} | |
import hashes, future, typetraits, strformat | |
type | |
Node[T] = object | |
val: T | |
used: bool # TODO make this the sign bit of the hash | |
hash: uint32 |
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
- NimMainModule ▒ | |
- 44.56% map_wNkS61EZxqfZ3s7xzzENJwnimja ▒ | |
build_S9bfnmOlkodgKqPC69c4676Q ▒ | |
buildImpl_mt26Sf88tl8OLKmb9aB8MQw ▒ | |
cb0_KFc3HTUxwefrUY1Q3djQCQ_2 |
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
build/ninja_nimja/mongo/db/db.os: src/mongo/db/db.cpp \ | |
src/mongo/platform/basic.h src/mongo/db/dbmain.h \ | |
src/third_party/boost-1.60.0/boost/filesystem/operations.hpp \ | |
src/third_party/boost-1.60.0/boost/config.hpp \ | |
src/third_party/boost-1.60.0/boost/config/user.hpp \ | |
src/third_party/boost-1.60.0/boost/config/select_compiler_config.hpp \ | |
src/third_party/boost-1.60.0/boost/config/compiler/gcc.hpp \ | |
src/third_party/boost-1.60.0/boost/config/select_stdlib_config.hpp \ | |
src/third_party/boost-1.60.0/boost/config/stdlib/libstdcpp3.hpp \ | |
src/third_party/boost-1.60.0/boost/config/select_platform_config.hpp \ |
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
when defined(useSSE42): | |
import x86_simd/x86_sse42 | |
import x86_simd/x86_sse41 | |
import x86_simd/x86_sse2 | |
import bitops | |
let prStr = "azAZ09\x80\xFF\0 " # padded to hold at least 16 bytes. | |
let pcStr = "+,/_:.~()}{@=!-\0 " | |
let plain_ranges = loadu_si128(cast[ptr m128i](unsafeAddr prStr[0])) | |
let plain_chars = loadu_si128(cast[ptr m128i](unsafeAddr pcStr[0])) |
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 asyncdispatch | |
proc unwrap[T](outer: Future[Future[T]]): Future[T] = | |
result = newFuture[T]() | |
let res = result | |
outer.addCallback do: | |
# TODO try/catch to handle errors | |
outer.read().addCallback do (inner: Future[T]): | |
res.complete(inner.read()) |
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 is based on ninja's depfile_parser.in.cc | |
const | |
plain = {'a'..'z', 'A'..'Z', '0'..'9', '+', ',', '/', '_', ':', '.', '~', | |
'(', ')', '}', '{', '@', '=', '!', '-', '\x80'..'\xFF'} | |
escaped = {' ', '\\', '#', '*', '[', '|'} # \c -> c | |
notEscaped = {'\0', '\c', '\L'} # swallow the \ and handle c normally | |
type Deps* = object | |
output*: string | |
inputs*: seq[string] |
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 tables | |
import critbits | |
import os | |
import sequtils | |
import times | |
import random | |
import xxhash | |
#import murmur | |
import murmur3 | |
import hashes |