Skip to content

Instantly share code, notes, and snippets.

View genotrance's full-sized avatar

genotrance genotrance

View GitHub Profile
@genotrance
genotrance / libvirt.cfg
Created November 8, 2017 08:13
Nimgen config file for libvirt
[n.global]
output = libvirt
filter = libvirt
[n.include]
libvirt/include
[n.exclude]
libvirt-common.h
@genotrance
genotrance / next.md
Last active April 6, 2018 17:01
Nim 1.0 next steps

Trunk-based development

  • Support for multi-version release management
    • Add new {.version: "1.x.x".} pragma for new procs in stdlib, be able to define when added and removed "1.1.0, < 2.0.0"
    • Ship single package with multiple branches enabled - default selected is latest version of oldest supported branch
    • Add nim --list-versions to show users what versions are available (include deprecation status)
    • Add nim --set-version:1.2.0 to configure global nim.cfg or user to manually edit file
  • Ensure all pre-existing v2.0 features behind version block/pragma
  • Fix all "high priority" bugs, "regressions" and "showstoppers" in 1.0.0 code
  • Remove all deprecated symbols and update stdlib accordingly
  • Test all major libs and verify working with 1.0.0 version
@genotrance
genotrance / failed.txt
Last active March 20, 2018 16:32
Nimscript ready modules
Failed nimrtl
lib\nimrtl.nim(28, 10) Error: This file has to be compiled as a library!
Failed coro
lib\pure\coro.nim(23, 12) Error: Coroutines require -d:nimCoroutines
Failed endians
lib\pure\endians.nim(103, 57) Error: undeclared identifier: 'copyMem'
Failed htmlparser
import asyncdispatch
import asynctools
import docopt
import json
import nre
import os
import ospaths
import sequtils
import sha256/sha256sum
import strutils
@genotrance
genotrance / niminstall.txt
Last active April 30, 2018 15:46
Nim installer idea
Nim GUI installer for Windows
Figure out C/C++ compiler
- Detect compiler presence
- Detect compiler arch
- User chooses correct compiler if multiple detected
- No compiler detected
- User chooses existing compiler location
- Detect compiler arch
- No compiler present
import math
import macros
import strutils
macro mechoall(): untyped =
var
lval1 = 50.2345
lval2 = 25.1234
lval = ""
@genotrance
genotrance / vimrc.vim
Last active September 11, 2020 16:35
vimrc
" Syntax and colors
filetype plugin indent on
syntax on
colorscheme default
" Tabs
set tabstop=2
set shiftwidth=2
set expandtab
@genotrance
genotrance / sha256test.nim
Created August 15, 2018 02:52
sha256test.nim
import os
import sha256/sha256sum
import nimssl/sha
import nimSHA2
import sha3
import sph
import times
import strutils
const MAX_BUFFER* = 8192
@genotrance
genotrance / ui.nim
Created August 17, 2018 19:42
ui.nim
import strutils
const sourcePath = currentSourcePath().split({'\\', '/'})[0..^2].join("/")
{.passC: "-I\"" & sourcePath & "\"".}
{.passC: "-I\"" & sourcePath & "/common\"".}
const headerui = sourcePath & "/ui.h"
{.passC: "-DBUILD_SHARED_LIBS=OFF".}
{.passL: "-lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lcomctl32 -ld2d1 -ldwrite -lUxTheme -lusp10 -lgdi32 -luser32 -lkernel32 -lstdc++".}
{.compile: "nimui/common/areaevents.c".}
{.compile: "nimui/common/attribute.c".}
{.compile: "nimui/common/attrlist.c".}
@genotrance
genotrance / compile.sh
Created February 27, 2019 12:42
Nim Holy Build Box
#! /bin/bash
export SRCFILE=nim-$VERSION.tar.xz
export BINFILE=nim-$VERSION-linux_x$ARCH.tar
echo "Building Nim $VERSION for $ARCH"
set -e
# Activate Holy Build Box environment.