Skip to content

Instantly share code, notes, and snippets.

View bluenote10's full-sized avatar

Fabian Keller bluenote10

  • Bosch
  • Ludwigsburg, Germany
View GitHub Profile
@Vindaar
Vindaar / dplyr_pandas_comparison_to_nim.org
Last active October 10, 2023 17:32
A comparison of dplyr, Pandas and data frames in Nim (using ggplotnim)

Dplyr (R), Pandas (Python) & Nim data frame comparison

This comparison is inspired by the comparison here: https://gist.github.com/conormm/fd8b1980c28dd21cfaf6975c86c74d07

The Nim data frame implementation we use here is the Datamancer data frame.

Note that due to UFCS in Nim we can write the commands we present either similar to the Python notation as if the function were a method of the

@rogercloud
rogercloud / chantest.nim
Created September 1, 2015 03:52
Warning: use global iterator here is not a good practice.
import os, threadpool, macros
template spawnBackgroundJob(t: typedesc, chan:ptr TChannel[t], iter: expr): stmt {.immediate.}=
block:
proc threadFunc(channel: ptr TChannel[t]) {.thread.} =
echo "Thread is starting"
for i in iter:
echo "Sending ", i
channel[].send(i)
#!/usr/bin/env sh
# A wrapper around the Nim compiler to allow for easy scripting of Nim. Puts
# all temporary files in a temporary directory and cleans up after itself.
#
# Usage:
# - add `#!/usr/bin/env nimrun` at the beginning of your script
# - execute the nim file with it, for example, `nimrun file.nim args`
#
# Possible future extentions: