Add Nim and Python fetches + Update benchmarks

This commit is contained in:
xTrayambak 2023-09-14 12:21:39 +05:30
commit 97b3018cf6
5 changed files with 117 additions and 7 deletions

33
nim/nim.cfg Normal file
View file

@ -0,0 +1,33 @@
# Is this cheating? I hope not :P
@if release or quick:
obj_checks:off
field_checks:off
range_checks:off
bound_checks:off
overflow_checks:off
assertions:off
stacktrace:off
linetrace:off
debugger:off
line_dir:off
dead_code_elim:on
@if nimHasNilChecks:
nilchecks:off
@end
@end
@if release:
opt:speed
@end
gcc.options.speed = "-O3 -fno-strict-aliasing"
gcc.options.size = "-Os"
@if windows:
gcc.options.debug = "-g3 -O0 -gdwarf-3"
@else:
gcc.options.debug = "-g3 -O0"
@end
gcc.c.options.speed = "-O3 -fno-strict-aliasing"
gcc.c.options.size = "-Os"
gcc.c.options.debug = "-g3 -O0"

View file

@ -0,0 +1,18 @@
import std/[os]
when defined(color):
const COLORS: array[0..3, string] = [
"31", "32", "33", "34"
]
proc main {.inline.} =
for env in ["USER", "SHELL", "TERM", "LANG"]:
when defined(color):
echo("\033[0;m " & env & ":\033[0m " & getEnv(env) & "")
else:
echo(env & ": " & getEnv(env))
echo("\x1B[35mcolors: \x1B[0m\x1B[41m \x1B[42m \x1B[43m \x1B[44m \x1B[45m \x1B[0m")
when isMainModule:
main()

View file

@ -0,0 +1,16 @@
# Package
version = "0.1.0"
author = "xTrayambak"
description = "Tinierfetch, written in the Nim programming language"
license = "MIT"
srcDir = "src"
bin = @["tinierfetch_nim"]
# Dependencies
requires "nim >= 1.6.14"
task speed, "Built with all optimization flags*":
exec "nim c -o:../bin/tinierfetch-nim -d:color -d:danger -d:release -d:quick src/tinierfetch_nim.nim"