<< 23-03-2018 >>

00:03:41leorizekinkinkijkin: https://github.com/nim-lang/Nim/commit/9079517d71a010e38a700870abf0703165e08b8b
00:03:48leorizelooks like it's not even released yet
00:45:10*find0x90 quit (Quit: find0x90)
00:46:44kinkinkijkinhttps://dpaste.de/39NG this code doesn't seem to create a working named pipe, any idea why?
00:47:19kinkinkijkinoh forgot something in the uploading
00:48:00kinkinkijkinhttps://dpaste.de/uOvo this is what the code is
00:48:10kinkinkijkinsorry I'm copying these between laptop and desktop
00:50:32leorizekinkinkijkin: that's not how you use startProcess()
00:51:08kinkinkijkinhow is it used?
00:51:50leorizeyou would want startProcess("mkfifo", ["/tmp/knsess"], {poUsePath})
00:51:59leorizesee https://nim-lang.org/docs/osproc.html#startProcess,string,string,openArray[string],StringTableRef,set[ProcessOption] for more details
00:54:36leorizekinkinkijkin: actually, for your use case, execCmd would be a better alternative
00:54:44kinkinkijkingot (string, array[0..0, string], set[ProcessOption]) but expeced one of etc etc
00:55:31leorizesorry, it's startProcess("mkfifo", args = ["/tmp/knsess"], options = {poUsePath})
00:55:59leorizeif you wanted to use execCmd, its execCmd("mkfifo /tmp/knsess")
00:56:10leorizeagain, reading osproc documentation would help
01:12:08*arnetheduck quit (Ping timeout: 276 seconds)
01:19:29kinkinkijkinwhat is "TArg"? I can't find it in the documentation
01:20:34*noonien quit (Quit: Connection closed for inactivity)
01:21:37leorizekinkinkijkin: if you're asking about procs in the thread module, they are just generics
01:22:06leorizesimiliar to `proc name[T]`
01:22:19leorizeJust that T here is TArg, no functional changes
01:23:38kinkinkijkinso how would I initialize a thread of execShellCmd with an argument of getEnv("SHELL")?
01:32:53leorizekinkinkijkin: something like this: https://pastebin.com/zjEKWVJm
01:37:36kinkinkijkinugh, I got a gcc error
01:38:23kinkinkijkinsomething about __ATOMIC_RELAXED undeclared (first use in this function)
01:38:46kinkinkijkinusing nim 0.16.whatever is provided in openbsd's okg
01:38:48kinkinkijkinpkg
01:39:25leorizekinkinkijkin: https://github.com/nim-lang/Nim/issues/4046
01:40:32kinkinkijkinjesus why is openbsd using such an old version of gcc
01:43:42leorizekinkinkijkin: I think it's due to some licensing issues, IIRC that's also why FreeBSD stuck w gcc 4.2
01:44:14kinkinkijkinI see
01:49:11*MJCaley quit (Quit: MJCaley)
01:58:55*arnetheduck joined #nim
01:59:48*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
02:17:09*arnetheduck quit (Ping timeout: 264 seconds)
02:29:15*arnetheduck joined #nim
02:36:31*leorize quit (Ping timeout: 268 seconds)
02:58:05*S1t1Schu joined #nim
03:01:30*S1tiSchu quit (Ping timeout: 246 seconds)
03:02:08*dddddd quit (Remote host closed the connection)
03:02:13*vlad1777d_ quit (Quit: Leaving)
03:15:57*arnetheduck quit (Ping timeout: 264 seconds)
03:30:39*DarkArctic_ joined #nim
03:34:34*DarkArctic quit (Ping timeout: 264 seconds)
04:03:36*gangstacat quit (Ping timeout: 256 seconds)
04:04:02*gangstacat joined #nim
04:11:45*DarkArctic_ quit (Ping timeout: 248 seconds)
04:14:08*DarkArctic joined #nim
04:16:40*mal`` quit (Quit: Leaving)
04:17:35*endragor joined #nim
04:21:49*mal`` joined #nim
04:36:34*cyraxjoe quit (Quit: No Ping reply in 180 seconds.)
04:37:42*cyraxjoe joined #nim
05:15:46*arnetheduck joined #nim
05:30:42*arnetheduck quit (Remote host closed the connection)
05:50:56*nsf joined #nim
06:03:50*kinkinkijkin quit (Read error: Connection reset by peer)
06:04:42*kinkinkijkin joined #nim
06:10:06*arnetheduck joined #nim
07:15:45*Vladar joined #nim
07:19:21*yglukhov quit (Ping timeout: 240 seconds)
07:21:14*xkapastel quit (Quit: Connection closed for inactivity)
07:24:33*yglukhov joined #nim
07:29:54*gokr joined #nim
07:51:50FromGitter<mratsim> don’t they also propose clang on BSD?
07:59:16*jaco60 joined #nim
08:02:29*rokups joined #nim
08:15:22*PMunch joined #nim
08:25:28FromGitter<mratsim> @alehander42 for loopfusion I’m trying to implement for-expression. Did you compare the performance profile between lambda and template for zero_functional? When I look at the C code of the following, it seems like the lambda won’t be inlined: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ab4b9f87685a046389cf040]
08:28:34FromGitter<mratsim> Not sure if GCC/Clang inlines the N_CLOSURE calls even if they are called only once
08:38:38*gokr left #nim (#nim)
08:39:33*floppydh_ joined #nim
08:45:01*sendell joined #nim
08:57:39FromGitter<alehander42> @mratsim I benchmarked zero_functional foreach 1) generating an anon proc 2) generating a template and they seemed equal on speed under all flags
09:17:43FromGitter<mratsim> cool, thanks
09:29:05*Ven`` joined #nim
09:37:56FromGitter<alehander42> Araq: can one hint that a custom tag leads to side effects, so when a function is marked with it, it can't be noSideEffects ?
09:39:07FromGitter<alehander42> I inherit from RootEffect: is there SideEffect that I can inherit from to hint that
09:45:57Araqimpossible, sorry :-)
09:51:56*MJCaley joined #nim
09:52:33*floppydh_ quit (Quit: WeeChat 2.0.1)
09:57:46*yglukhov quit (Read error: Connection reset by peer)
09:58:20*yglukhov joined #nim
10:02:20*MJCaley quit (Quit: MJCaley)
10:03:12FromGitter<alehander42> hmmmm
10:03:19FromGitter<alehander42> no
10:03:21*brainproxy quit (Ping timeout: 264 seconds)
10:04:46FromGitter<narimiran> i'm reading https://nim-lang.org/docs/manual.html#iterators-and-the-for-statement and i'm still confused when should i use `{.inline.}` or `{.closure.}`, and/or which to prefer....
10:23:23FromGitter<alehander42> ok Araq: I almost made this work with a custom type and pragma: I define my own SideEffect, and a noSideEffectTag macro that checks the pragma tags for inheritance of SideEffect. the only problem is I can't really add a `noSideEffect` pragma for my macro and run the type checking again
10:24:27FromGitter<alehander42> If I produce a new untyped node from my typed node with noSideEffect pragma, for some reason it isn't checked?
10:31:44Araqit should be checked
10:35:24FromGitter<alehander42> ok, probably I am doing something weird: https://gist.github.com/alehander42/6603b972dd485ac1d9304002b2da6de8
10:35:46*r3d9u11 joined #nim
10:35:58FromGitter<alehander42> I also had to replace sym with ident, because otherwise I get unresolved symbol errors
10:36:02r3d9u11hello!
10:36:09FromGitter<alehander42> no generated name*
10:37:46r3d9u11Does method Channel.send copy data (object, array, etc...)?
10:40:16r3d9u11>sends a message to a thread. msg is deeply copied
10:41:58*brainproxy joined #nim
10:46:50FromGitter<mratsim> channel copies yes, multithreading with shared data structure is hard. (locking, mutexes, atomics, or things like OpenMP).
10:53:12FromGitter<alehander42> https://gist.github.com/alehander42/8698c15fe8bc5a6cb11fc88d12a1a6b3
10:53:14FromGitter<alehander42> ok @Araq I have another version which uses only untyped macros ^
10:53:21FromGitter<alehander42> and it seems to work for all cases
10:53:35FromGitter<alehander42> but it needs this additional sideEffect <Name> macro
10:53:47FromGitter<alehander42> and it uses a static global set of names which I am not sure is nice
10:55:15FromGitter<alehander42> (I know string == isn't the best possible check, but I'd usually use just a handful of tags in a project, with probably unique names)
11:02:37*Snircle joined #nim
11:02:40PMunchalehander42, maybe an enum would be better?
11:06:48FromGitter<alehander42> I don't think I can use one, because the user might define new effects after I've checked previous ones
11:07:15FromGitter<alehander42> and all this checks happen on compile time anyway, so I don't think it's possible to "generate" enum that I can use in the same time
11:07:31*Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
11:08:20*aziz joined #nim
11:14:51*brainproxy quit (Ping timeout: 240 seconds)
11:20:39*brainproxy joined #nim
11:42:25FromGitter<alehander42> @Araq is there a switch which enables the `func` <=> `{.noSideEffect.}` thing?
11:43:02Araqno, you need to patch the compiler
11:43:30FromGitter<alehander42> ah, I see, is it in the roadmap for 0.19?
11:47:51*jaco60 quit (Ping timeout: 240 seconds)
11:50:51*athenot quit (Ping timeout: 240 seconds)
11:53:21*brainproxy quit (Ping timeout: 240 seconds)
11:55:49*brainproxy joined #nim
12:00:59Yardanico@zacharycarter about case statements - https://github.com/nim-lang/Nim/pull/6954
12:01:06*r3d9u11 quit (Remote host closed the connection)
12:04:00*r3d9u11 joined #nim
12:08:45*r3d9u11 quit (Ping timeout: 264 seconds)
12:11:48*floppydh quit (Remote host closed the connection)
12:12:37*floppydh joined #nim
12:22:23PMunchShould func also have gcSafe?
12:22:51PMunchFunctions don't typically take any other input than what they are given
12:26:31*noonien joined #nim
12:26:40*yglukhov quit (Read error: Connection reset by peer)
12:26:43*leorize joined #nim
12:27:13*yglukhov joined #nim
12:28:21*brainproxy quit (Ping timeout: 240 seconds)
12:34:32PMunchSo making them GC safe (unable to use globals) would help this
12:35:05*brainproxy joined #nim
12:41:34*nsf quit (Quit: WeeChat 2.0.1)
12:42:09FromGitter<narimiran> PMunch: that would be a nice addition, IMO!
12:50:53Araq.noSideEffect implies .gcsafe
12:51:09PMunchOh it does? Nice
12:52:48FromGitter<alehander42> but it doesn't imply `.tags: []`, right? or does it imply it and one can override it?
12:54:04Araqno, .tags are independent
12:56:23*Ven`` joined #nim
12:57:20*DarkArctic quit (Quit: Leaving)
12:57:38*DarkArctic joined #nim
13:07:51*brainproxy quit (Ping timeout: 240 seconds)
13:13:04*SenasOzys_ quit (Read error: Connection reset by peer)
13:13:27*SenasOzys joined #nim
13:19:02*brainproxy joined #nim
13:22:56*athenot joined #nim
13:23:06FromGitter<zacharycarter> -d:useRealtimeGC always seems to cause this error for me on OSX - /Users/zachcarter/projects/nim-wasm/nimcache/stdlib_system.c:15:10: fatal error: 'mach/mach.h' file not found ⏎ ⏎ #include <mach/mach.h>
13:23:47FromGitter<zacharycarter> whenever I'm compiling code with emscripten
13:24:32PMunchSomeone mis-spelled math.h?
13:24:56PMunchOr is mach.h something emscripten related?
13:26:26FromGitter<zacharycarter> I think maybe it's an osx specific header? I'm not sure
13:27:42FromGitter<zacharycarter> https://developer.apple.com/library/content/documentation/Darwin/Conceptual/KernelProgramming/Mach/Mach.html
13:32:12FromGitter<mratsim> mach is the name of macOS kernel
13:34:47*mjanssen joined #nim
13:36:47FromGitter<zacharycarter> would anyone else with a mac be willing to try to reproduce?
13:36:55FromGitter<zacharycarter> I can give you a simple config / and Nim source file to test with
13:37:00FromGitter<zacharycarter> all you'd need to do is install emsdk
13:44:54FromGitter<zacharycarter> guessing it has something to do with - https://github.com/nim-lang/Nim/blob/3e33668abc496e0b45183804b9b2d70963869a6a/lib/system/timers.nim#L35-L64
13:45:43*dddddd joined #nim
13:51:57*brainproxy quit (Ping timeout: 240 seconds)
13:52:19FromGitter<zacharycarter> so I guess - clock_gettime(CLOCK_MONOTONIC) - should probably be used for emscripten instead
13:52:58FromGitter<zacharycarter> but emscripten isn't an official compiler flag so :shrug:
13:54:41FromGitter<zacharycarter> Araq / dom96?
13:55:01dom96I guess emscripten doesn't support that?
13:55:46FromGitter<zacharycarter> dom96: I don't think so - I think emscripten should be using - clock_gettime(CLOCK_MONOTONIC)
13:56:27FromGitter<zacharycarter> https://github.com/floooh/sokol/blob/master/sokol_time.h#L54
13:57:20dom96does Nim even have special conditionals for emscripten in its stdlib?
13:58:01FromGitter<zacharycarter> nope
13:58:04FromGitter<zacharycarter> not to my knowledge
13:58:34FromGitter<zacharycarter> but this is definitely problematic for people that want to use Nim for WASM on osx
13:59:57FromGitter<abijahm> yesterday i had a problem with asynchttpserver ,thanks to @dom96 this is how i solved it ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ i think this method of sending chuncks can be used to solve (large file issue)[https://github.com/nim-lang/Nim/issues/5589] [https://gitter.im/nim-lang/Nim?at=5ab5085dbb1018b37a18bb36]
14:00:39*brainproxy joined #nim
14:02:21FromGitter<zacharycarter> dom96: I think it makes sense for the stdlib lib to have emscripten flags - after all, it is a legitimate compiler
14:03:40*endragor quit (Remote host closed the connection)
14:04:07*endragor joined #nim
14:05:07dom96abijahm: so what was it that fixed it?
14:06:43FromGitter<zacharycarter> dom96: modifying two conditionals in system/timers.nim to have checks for emscripten fixes the issue FYI
14:06:47FromGitter<zacharycarter> just tested locally
14:09:02*endragor quit (Ping timeout: 268 seconds)
14:11:21*wavemode joined #nim
14:12:46*SenasOzys quit (Ping timeout: 256 seconds)
14:14:54*floppydh_ joined #nim
14:16:35*cspar_ joined #nim
14:17:17*SenasOzys joined #nim
14:18:34FromGitter<abijahm> @dom96 removing the flags,yesterday i was not handling the exception properly
14:19:34*cspar quit (Ping timeout: 256 seconds)
14:29:51*endragor joined #nim
14:33:42*brainproxy quit (Ping timeout: 268 seconds)
14:34:53*endragor quit (Ping timeout: 276 seconds)
14:35:31*brainproxy joined #nim
14:45:51*smt quit (Read error: Connection reset by peer)
15:06:34*gokr joined #nim
15:06:41FromGitter<alehander42> can I somehow produce ints for enums of variant objects with json `to`
15:06:43FromGitter<alehander42> ?
15:07:19FromGitter<alehander42> currently I always get strings, which is useless, when I reinterpret them as variants (in the js backend)
15:08:17*brainproxy quit (Ping timeout: 248 seconds)
15:09:42FromGitter<alehander42> ok, I can patch `%`*(o: enum) in json.nim, sorry
15:09:54FromGitter<alehander42> still, what would be a good way to make that configurable?
15:13:11FromGitter<alehander42> maybe `to` can accept some options?
15:13:46*brainproxy joined #nim
15:16:13*aziz quit (Remote host closed the connection)
15:20:42*jjido joined #nim
15:25:24*miran joined #nim
15:27:20*WhiskeyNick joined #nim
15:33:26*GitDisc joined #nim
15:33:32*GitDisc quit (Remote host closed the connection)
15:34:27*FromDiscord joined #nim
15:37:02*xkapastel joined #nim
15:39:25*Zevv joined #nim
15:47:09*brainproxy quit (Ping timeout: 264 seconds)
15:52:43*brainproxy joined #nim
15:59:48*PMunch quit (Quit: Leaving)
16:00:21*jjido quit (Read error: Connection reset by peer)
16:07:34*JacobEdelman quit (Quit: Ping timeout (120 seconds))
16:07:52*jjido joined #nim
16:07:55*JacobEdelman joined #nim
16:08:23*sendell quit (Ping timeout: 276 seconds)
16:10:28*nsf joined #nim
16:15:23*r2 joined #nim
16:21:50Yardanicowhat is better for a proc which takes a dictionary of variables and their values - Table or TableRef ?
16:26:03*brainproxy quit (Ping timeout: 256 seconds)
16:27:03Yardanicoah, nvm, Table is better :)
16:28:24Yardanicoor hmm.. which is more efficient - having one empty table initalised once at runtime (so I can use it as a default value for argument), or using TableRef with default value being nil?
16:29:29leorizeYardanico: IIRC the devs are going to move away from nil, so avoiding it should be better?
16:30:21Yardanicoleorize, well, yeah, that's a good point, I would probably use Table
16:36:13*brainproxy joined #nim
16:36:30*gokr quit (Quit: Leaving.)
16:39:02*r2 quit (Ping timeout: 276 seconds)
16:46:03*r2 joined #nim
16:51:13*r2 quit (Ping timeout: 268 seconds)
17:01:51*Trustable joined #nim
17:08:51*brainproxy quit (Ping timeout: 240 seconds)
17:11:36*brainproxy joined #nim
17:21:33*nsf quit (Quit: WeeChat 2.0.1)
17:31:45*hyp3rbor3a joined #nim
17:39:08FromGitter<Varriount> @zacharycarter I drink tea. :3
17:45:14*brainproxy quit (Ping timeout: 276 seconds)
17:45:20dom96hey Varriount, seeing as you already have an account on notabug, think you could ping vktec about my fork of NimBox? https://notabug.org/vktec/nimbox
17:45:34dom96I've fixed some things: https://github.com/dom96/nimbox
17:45:42dom96would be nice if vktec pulled it
17:46:01*icebattle joined #nim
17:46:55dom96alehander42: can't remember if `to` supports enums, but have you tried just specifying the enum type?
17:47:55dom96abijahm: awesome :)
17:48:07*r2 joined #nim
17:49:50*brainproxy joined #nim
17:51:22*jjido quit (Ping timeout: 264 seconds)
17:52:27*r2 quit (Ping timeout: 240 seconds)
17:55:35*hyp3rbor3a quit (Quit: Leaving)
18:03:28*nsf joined #nim
18:05:16FromGitter<zacharycarter> @Varriount :P that works too
18:15:38*PMunch joined #nim
18:18:46*r2 joined #nim
18:20:34*floppydh quit (Quit: WeeChat 2.0.1)
18:20:47*floppydh_ quit (Quit: WeeChat 2.0.1)
18:23:06*brainproxy quit (Ping timeout: 268 seconds)
18:27:13*yglukhov_ joined #nim
18:27:14*yglukhov quit (Read error: Connection reset by peer)
18:31:47miranis there a way to make a zip of two iterators?
18:33:27*brainproxy joined #nim
18:35:50PMunchSomething like this: https://github.com/numforge/loop-fusion
18:35:56PMunchmiran^
18:37:14PMunchAnd then there's this: https://forum.nim-lang.org/t/2769
18:37:47FromGitter<Varriount> dom96: I have an account?
18:38:00dom96yeah? You reported an issue in that repo
18:39:01miranPMunch: thanks for the links!
18:39:25FromGitter<Varriount> dom96: Done.
18:39:32mirani've seen people in the forum mentioning that it is doable with closure iterators
18:39:32dom96thanks
18:39:45dom96if there is no reply I will switch the URL to my fork
18:40:14mirani guess that answers my earlier question about my dilemma about {.closure.} vs {.inline.} iterators :)
18:40:54miran(i have read the manual, but still don't understand which version should i prefer, or in which situations to consider one or the other)
18:41:53FromGitter<mratsim> closure for async/networking. For scientific computation use inline, always.
18:42:14miranmratsim: this is for nim's version of python's itertools :)
18:42:20FromGitter<mratsim> closure iterator needs to copy their arguments.
18:42:32FromGitter<mratsim> use zero_functional ;)
18:44:15FromGitter<mratsim> several people tried to use closure iterator but those are not for perf: see Peter Mora’s posts on the forum and his lib: https://github.com/petermora/nimLazy, also I benchmarked my own version for project euler: https://github.com/mratsim/nim-projecteuler/blob/master/src/lib/functional.nim
18:45:40miranmratsim: thanks for the informations and the links!
18:45:50FromGitter<mratsim> Or use loopfusion ;): https://github.com/numforge/loop-fusion it’s not functional but it’s fast. the only thing it can do is “filter” and reduction (it takes 3 lines to preallocate the result instead of 2 lines)
18:46:06FromGitter<mratsim> not functional as in functional programming*
18:46:14FromGitter<mratsim> it can’t do*
18:46:28mirani might use some of those, but i'm trying to make my first ever nimble package :)
18:46:29*yglukhov_ quit (Read error: Connection reset by peer)
18:46:30*yglukhov joined #nim
18:48:21FromGitter<mratsim> Now I have to tune loopfusion so that it works with OpenMP mmmh
18:51:05*Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
19:03:19miranmratsim: looking at your project euler and nimLazy - both of you wrap iterators inside of a proc - why not have just an iterator?
19:04:19mirani have done it also like that, so i use it like `let a = myiter(x, y); for i in a(): ....`, but now i'm thinking if might be better to have only `for i in myiter(x, y): ....`
19:06:53*brainproxy quit (Ping timeout: 268 seconds)
19:14:39*brainproxy joined #nim
19:19:50FromGitter<Varriount> @mratsim Has anyone told you how amazing your work is?
19:20:08miran+1
19:20:19Yardanicofrom nim forum - https://github.com/tbrand/which_is_the_fastest
19:20:46Yardanicothey only have nim with jester, so it's not very fast :(
19:20:58FromGitter<Varriount> Why is jester not fast?
19:21:27*nibp_ joined #nim
19:21:34*nibp_ left #nim ("Leaving")
19:22:11miranYardanico: last time some similar benchmarks were posted, Araq said that nim libraries (i can't remember if it was jester or something else, but it was also among the slowest) are fast enough for practical purposes
19:23:02Yardanicoyes they are
19:23:20Araqno I said that networking stuff becomes an issue after you got rich
19:24:12Yardanicoonly ones slower than jester in this microbenchmark are sinatra (ruby), tornado (python), rails (ruby)
19:24:27Yardanicolol
19:24:43Yardanicowe can just use https://github.com/2vg/mofuw then
19:26:11FromGitter<BontaVlad> Do these microbenchmark's have any real world value? Taking decisions based on *micro*benchmarks can bite you in the ass later on.
19:26:23FromGitter<Varriount> Unfortunately, they do.
19:26:47Yardanicosecond place in this benchmarks is https://github.com/squeaky-pl/japronto
19:27:05Araqvarriount: how so?
19:27:11Yardanicoit's a python framework which is mostly written using C, picohttpparser, and uvloop :D
19:27:41Araqc2nim it.
19:28:09FromGitter<Varriount> Araq: When people are choosing a tool to use (especially something like an HTTP framework) three things factor into the decision: Performance, familiarity, and usability.
19:28:17YardanicoAraq, unfortunately it heavily uses CPython C API
19:28:50Araqvarriount: that's not an answer.
19:29:19FromGitter<BontaVlad> Also for a tool -> documentation, and comunity, django is not the best web framework, but sure I will find everything I need for my project and have a kick ass documentation on top of that.
19:30:06FromGitter<Varriount> Since people base their decisions partially on how performant a prospective tool is, benchmarks like this are used to make quick decisions on a tools possible performance.
19:30:42Araqthe question was not "do we want good benchmark results"
19:30:52Araqthe question was "are these benchmarks relevant"
19:33:25FromGitter<Varriount> Araq: What's your definition of relevant? And related to what?
19:35:12FromGitter<Varriount> They are relevant to the public perception of Nim. Whether they are practically relevant is another matter. Unfortunately, human beings aren't always practical in their outlook.
19:36:11Araqif your website gets 3 requests a second and you can serve 50_000 it's pointless to optimize it further so that it can serve 100_000
19:36:49AraqI agree on the public perception point but that was not the point.
19:36:59Araqread the history.
19:37:09Araq> Do these microbenchmark's have any real world value?
19:37:16Araq<Varriount> Unfortunately, they do.
19:38:32Araqwhich made it look like you have some real world insights that I lack. so I asked. :-)
19:39:19FromGitter<Varriount> Ah, well I'm sorry. I misinterpreted your question.
19:39:21FromGitter<BontaVlad> I agree with Varriount here, while these microbenchmarks might not have any value, people still make decisions based on that. Just remember the mongodb phase.
19:40:33Araqwe all agree with Varriount here.
19:42:04miransorry to interrupt - i have just run `nimble init` and made some function `foo` inside a `src` folder. now i try to test it with the `test1.nim` file (automatically created) and i get "undeclared identifier" error. any guesses what am i doing wrong?
19:42:53FromGitter<Varriount> miran: Did you import the module containing the function?
19:43:27mirani have tried import ../src/name, import ./name, import name - and nothing seems to work
19:45:46miranoooooooooh, i forgot the * at the end of the func name
19:47:57*brainproxy quit (Ping timeout: 240 seconds)
19:49:56*brainproxy joined #nim
19:53:24*Vladar quit (Quit: Leaving)
19:57:29*poopBot joined #nim
19:57:51poopBotteoreticly if nim comples to c can i use nim to write linux drivers?
19:58:59*wavemode quit (Ping timeout: 260 seconds)
20:00:07dom96> Why is jester not fast?
20:00:21dom96Because I never got a chance to optimise it
20:01:39dom96And also because people suck at benchmarking: https://github.com/tbrand/which_is_the_fastest/blob/master/Makefile#L229
20:01:42dom96Can you see the problem?
20:01:59dom96It's compiled without -d:release, no wonder it's at the bottom
20:02:25FromGitter<alehander42> well, that's why one can PR it
20:03:25FromGitter<alehander42> the sad truth is max 5% of the people that read the results will say "wait, let's see the exact commands for each language and check if that benchmark is actually reasonable"
20:04:50dom96Well, I submitted a PR https://github.com/tbrand/which_is_the_fastest/pull/168
20:07:08FromGitter<alehander42> otherwise, are there some known bottlenecks in jester, or it just needs a bit more fine tuning and dogfooding?
20:07:14dom96But Jester is by no means perfect
20:07:26dom96So please don't be afraid to write something better
20:07:48dom96The main bottleneck is that it's single threaded
20:08:30dom96My focus first is to create an optimised HTTP server: https://github.com/dom96/httpbeast
20:09:02dom96But even adding parallelism to asynchttpserver will make it go much faster
20:09:48dom96But all these benchmarks should really be taken with a grain of salt
20:10:18dom96Maybe I just suck at benchmarking, but I spent a hell of a time testing httbeast
20:10:21dom96*httpbeast
20:10:28dom96on two Digital Ocean droplets
20:10:36mirandom96: i'm trying to use the new `runnableExamples` - how do i test that they are correct?
20:10:38dom96and the test results always varied wildly
20:10:44dom96miran: nim doc2 file
20:11:29miranit doesn't raise any error (and i introduced one on purpose)
20:12:10dom96well, see some of the examples of its use in the stdlib
20:12:15dom96see what you're doing differently
20:12:58Araqthat's 'nim doc file' now btw
20:13:12Araqdoc2 still works but is an alias for 'doc'
20:13:14FromGitter<alehander42> I think having several web frameworks competing would be healthy for the ecosystem
20:13:37FromGitter<alehander42> but jester is well developed, so maybe it's better to put effort there
20:13:59FromGitter<alehander42> having a very fast http server would be beautiful
20:14:11*poopBot quit (Remote host closed the connection)
20:15:45FromGitter<alehander42> benchmarking is hard, when I worked on zero_functional I tried to make a suite comparing tens of languages and it was so hard to always test the same behavior with the most optimal flags (but not dead code 0.00s optimal)
20:15:57miranhmmm, copying the example from release notes, and making it fail raises the error. for my example, it doesn't catch the error. i guess i'm stupid again
20:15:59FromGitter<alehander42> always write* the same behavior
20:16:46*poopBot joined #nim
20:16:54dom96I just got really annoyed when I couldn't reliably see whether my changes improved the performance or made it worse
20:17:00poopBotsorry i crashed did anyone replyed me
20:17:16dom96poopBot: You can use Nim to write anything
20:17:37dom96miran: So look at the stdlib :)
20:17:44Araqalehander42: you need to read input and produce output.
20:17:46dom96miran: It definitely works there, so you can see what the problem is
20:18:03poopBotcuz i plan to risk buy a xp-pen tablet and they have no linux driver , so want to learn both same time :)
20:18:08Araqso that the compiler has no chance of evaluating it completely at compiletime
20:18:30Araqand is not subject to dead code removal
20:19:30Araqhmmm, is result = f(result) memory safe when result is of type 'var T' ?
20:19:39poopBotsomone should make some turtorial on sololearn or similar sites to attract more people , and pls add CaseSensitve :)
20:21:01AraqI see enough bad code all day long, we don't need to support FOO foo = Foo() to feel more manly, thanks
20:22:12poopBotdont mind me i am just a bot :)
20:22:37mirandom96: i took a look at stdlib and it seems all the examples have only onliners with `doAssert`, and i have written a block of code.... could this be the reason why my thing is not working as expected?
20:22:54dom96probably
20:23:22Araqmiran: the reason is that it is in a template or generic, you need to instantiate it
20:23:56*brainproxy quit (Ping timeout: 276 seconds)
20:24:57FromGitter<alehander42> @Araq yes, I finally did that
20:25:03mirani just tried `doAssert 33 == 55` (so no calling of my function, no other code), and it didn't raise an error....
20:26:14*gokr joined #nim
20:27:06Araqgist it
20:27:08dom96Again, play spot the difference between stdlib code and your code
20:27:21*SenasOzys quit (Ping timeout: 240 seconds)
20:28:08poopBotwhat doAssert does i sow it in some turrtorial i think but didet get it at all
20:30:03dom96poopBot: Do you know what assertions are?
20:30:27YardanicopoopBot, you can always check docs :)
20:30:32poopBotno am reading docs
20:30:38poopBotjust found it under System
20:30:44dom96poopBot: https://en.wikipedia.org/wiki/Assertion_(software_development)
20:30:55miranAraq: dom96: here's a gist: https://gist.github.com/narimiran/d684ffd1b8857e4e96887aa7e228147a
20:31:12miranfoo raises an error, bar does not
20:31:26poopBotoh tats like for execption hendling
20:31:44dom96miran: Tried adding a doc comment above the 'runnableExamples'?
20:31:56poopBotor not i first read whole article then come back :)
20:32:40mirandom96: yep, it is the same. (even if i don't call bar, and just assert 111 == 999)
20:33:06*brainproxy joined #nim
20:36:15miranit seems that if bar is defined as `bar[something](...)` asserts don't work, but `bar(...)` is ok
20:36:52poopBoti think i got it
20:37:27poopBotjust 1 question will assertation kill program istnatly if hepend
20:37:45miranAraq said i should instantiate it - how do i do that?
20:41:02YardanicopoopBot, "assert" will be turned off for optimized (release) build, but doAssert wouldn't
20:41:27poopBotye got that part
20:41:34Yardanicoand yes, it will kill your program unless you catch AssertionError
20:41:48YardanicoAFAIK you can catch it
20:41:55poopBotjust asked when asert heppends it shows msg but does it kill app instant
20:42:09poopBotoh so its like c# throw new exeption
20:42:13poopBotand try catch
20:42:37YardanicopoopBot, you should probably firstly read tut1, tut2 and manual :)
20:42:44Yardanicothey contain a lot of info you're asking
20:43:01Araqmiran: call it in a 'when isMainModule' section
20:43:05*SenasOzys joined #nim
20:43:39AraqYardanico: actually catching an AssertionError is only semi-valid. The spec doesn't allow it, the implementation does.
20:43:51YardanicoAraq, oh, didn't knew that, thanks for the info
20:44:19poopBotYardanico, sorry you are right, issue is i am w8 for godot to finish c# so i plan evry game i do in c# do same in nim , i started reading manula 2-3 times just dident work on anything to use it proper so i remmeber stuff :)
20:44:59YardanicopoopBot, you want to do a benchmark or just comparasion how one game would look in different languages?
20:45:26miranAraq: "when isMainModule: runnableExamples: doAssert 111 = 999"? because this doesn't work
20:45:43*yglukhov quit (Read error: Connection reset by peer)
20:45:48poopBotYardanico, i want to learn nim
20:45:49mirani guess i could do it separately, but i wanted to have both documentation and tests at one place
20:45:51FromGitter<data-man> https://github.com/timotheecour/D_vs_nim ⏎ Why -1 for Nim? :)
20:46:00*yglukhov joined #nim
20:46:32Yardanicodocs seem to say nim can only use CTFE (via 'const') on functions 'without side-effects' wait what
20:46:55YardanicoI don't really get the point system here
20:47:09dom96that is an initially confusing point system heh
20:47:28dom96but it makes sense when you think about it
20:47:40Yardanico"D ranges are faster than nim's iterators CHECKME" hmm
20:48:17Yardanicoalso compile speed "faster (via dmd) CHECKME"
20:48:22dom96A better presentation would just be to write "Nim" or "D" in those boxes though
20:48:28YardanicoI doubt about compile speed - you can use different C compilers
20:49:47dom96In any case, it's 8 vs 16 for Nim
20:50:12Yardanico"similar code comparison" this code is from 2014, lol :)
20:50:27Yardanicowell, still pretty interesting
20:51:42Yardanicoalso why did D take a point for `style`? we have NEP-1 too :)
20:52:56FromGitter<data-man> D's open bugs 4566 (currently) :)
20:53:32dom96that really shouldn't be a deciding factor
20:54:28Araqmiran: when isMainModule: yourGenericWithRunnableExamples()
20:56:11Araq"D ranges are faster than Nim's iterators" -- wishful thinking detected
20:57:01shashlickdom96: I've offered before, have real servers I can benchmark on if you need
20:57:38dom96shashlick: That'd be great. Feel free to grab the current source and see how it performs.
20:57:59miranAraq: thanks, it seems to work! i guess i will be able to kill two birds with one stone :)
20:58:20shashlickAraq: would be cool if compiler could suggest that proc is not exported with *
20:58:40shashlickdom96: do you have a benchmarking script in the repo?
20:58:45*nsf quit (Quit: WeeChat 2.0.1)
20:59:52dom96shashlick: Nope. I've just been using wrk
21:01:30shashlickOk I'll have to see how that works
21:09:22*brainproxy quit (Ping timeout: 264 seconds)
21:09:25FromGitter<zacharycarter> I did a Nim / WASM demo at work today
21:09:45FromGitter<zacharycarter> we compiled sass in the browser with nim-sass via wasm
21:10:37FromGitter<zacharycarter> dom96 / Araq: any thoughts on fixing the emscripten issue?
21:10:46miranwow, whoever added this runnableExamples - what a great addition!!
21:10:50FromGitter<zacharycarter> and adding emscripten as a stdlib define?
21:11:15Araqzacharycarter wait for yglukhov maybe
21:11:21FromGitter<zacharycarter> ok
21:11:29Araqhe used emscripten with Nim and its realtime GC in production
21:11:39Araqmaybe it's as simple as --os:linux
21:11:41yglukhovhey guys, whats up?
21:11:47FromGitter<zacharycarter> Araq: maybe
21:11:59FromGitter<zacharycarter> hi yglukhov!
21:12:11Araqmiran: thanks, that was me. :-)
21:12:26FromGitter<zacharycarter> so I was playing w/ emcc today and Nim and notice if I used realtime gc on osx, I got an error about mach/mach.h not being able to be found
21:12:53yglukhovyes, i use --os:linux -d:emscripten ;)
21:12:57FromGitter<zacharycarter> gotcha
21:12:59FromGitter<zacharycarter> okay thanks
21:13:03yglukhovnp
21:13:08FromGitter<zacharycarter> you guys are so sneaky / smart
21:13:23yglukhovthanks =)
21:14:09*rokups quit (Quit: Connection closed for inactivity)
21:14:26*athenot quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
21:14:58miranAraq: there should be bells and whistles about it, it is really great!! makes life so much easier
21:15:29Araqthe issues with it have been reported and will be fixed
21:15:45FromGitter<zacharycarter> sorry but dafuq is runnableExamples?
21:15:46dom96yglukhov: perhaps you could write a nice article about working with emscripten in Nim? :)
21:16:25FromGitter<zacharycarter> dom96: I'm about to put up a blog in the next week(ish) - if yglukhov is busy - I could write one
21:16:34FromGitter<zacharycarter> I've gotten pretty good at using Nim / emscripten / wasm
21:16:45dom96sure
21:16:46miranbtw, when i run `nim doc myfile.nim`, it creates .html with docs, but there are no links to the source, as it is in nim's stdlib - do i need to pass something to it to create it?
21:16:47yglukhovzacharycarter: thumbs up!
21:17:05FromGitter<zacharycarter> sweet! I'll begin working on it thanks!
21:17:52FromGitter<zacharycarter> also dom96 - for my blog I'm going to try out - https://tailwindcss.com/
21:18:00*Trustable quit (Remote host closed the connection)
21:18:55dom96zacharycarter: nice :)
21:19:14*dom96 adds it to his huge list of CSS frameworks
21:19:30FromGitter<zacharycarter> lol
21:20:41FromGitter<zacharycarter> well... I'm writing the entire project w/ Nim - I'm trying to develop some standards around how you might structure a 12-factor app w/ Nim, at least on the front end
21:21:18FromGitter<zacharycarter> so I'm leveraging karax and using nimble as the build system and avoiding just writing everything in package.json
21:21:22dom9612-factor?
21:21:22FromGitter<zacharycarter> only thing I
21:21:40FromGitter<zacharycarter> https://12factor.net/
21:22:36dom96That seems like overkill for a blog
21:22:54*riidom joined #nim
21:22:57FromGitter<zacharycarter> I'm only considering the front-end
21:23:01dom96But do whatever makes you happy :)
21:23:09*r2 quit (Ping timeout: 264 seconds)
21:23:13dom96I created a static blog generator a long time ago: https://github.com/dom96/ipsumgenera
21:23:13FromGitter<zacharycarter> but like - let's say you're checking out Nim and you want to write a blog w/ it?
21:23:17dom96Still need to revive that project
21:23:45FromGitter<zacharycarter> how do you structure your project? how do you build it? how do you compile sass? how do you accomplish all the things you'd normally do w/ something like nodejs and webpack?
21:24:06FromGitter<zacharycarter> front-end developers these days don't just write html and js and css
21:24:13FromGitter<zacharycarter> they have the most convoluted ecosystem on the planet
21:24:39dom96yeah, JS developers sure love tools that just magically process all this crap
21:24:52dom96Writing a tool for Nim that does the same would be brilliant :)
21:25:01FromGitter<zacharycarter> well that's why I wrote the nim-sass project
21:25:09FromGitter<zacharycarter> so we have a sass compiler for Nim now potentially
21:25:13dom96awesome
21:25:29FromGitter<zacharycarter> if we can produce a lot of frontend related tooling for Nim
21:25:47FromGitter<zacharycarter> it could be come an alternative to typescript
21:25:58FromGitter<zacharycarter> moreso than it already is anyway
21:26:09FromGitter<zacharycarter> typescript has the benefit of being able to leverage the node ecosystem - not that Nim can't
21:26:16FromGitter<zacharycarter> it's just - it's easier w/ typescript
21:27:03dom96What would be a killer app is something that marries the Nim backend and front end
21:27:16dom96If I had the time I would write it
21:27:16FromGitter<zacharycarter> how so?
21:27:33dom96Most webapps involve passing data between a front end and back end
21:27:47FromGitter<zacharycarter> via http
21:27:51dom96You could make that transparent with Nim
21:28:09FromGitter<zacharycarter> can you explain how at a high level>
21:28:11FromGitter<zacharycarter> ?
21:29:17AraqOrmin does it by producing frontend and backend code at the same time
21:29:19dom96I'm not 100% sure what the best approach for it would be
21:29:31dom96But I envision calling a "backend" procedure from the front end
21:29:52Araqcheck how Ormin does it. it kinda sucks but has the right ideas IMO :P
21:29:52dom96The library takes care of the HTTP calls in between
21:30:03FromGitter<zacharycarter> oh I see
21:30:23dom96Araq: The fact that a database library is trying to do this really turns me off it :(
21:30:33dom96I still want a simple ORM library
21:30:41Araqit's an optional part of Ormin.
21:30:58Araqthe next time please be turned off by something you took a closer look at.
21:31:24FromGitter<zacharycarter> I still vote for graphql
21:33:32dom96Araq: Yeah, you're right. I need to try it.
21:33:47dom96You need more small and approachable examples in the ormin readme
21:34:21dom96I'm unsure about graphql
21:34:23AraqI also need to change how the model building works :-)
21:34:40dom96Araq: Argh. Why?
21:34:51dom96I was about to try it but that discourages me :(
21:35:17Araqsorry, but I'm not sure I want to encourage you to try it
21:35:41dom96why?
21:36:03*brainproxy joined #nim
21:36:05Araqbecause I used it extensively and now know its pain points
21:36:06miraniterators and openArrays don't like each other, or is it again some my fault? :)
21:36:55AraqI mean, sure, go ahead and try it. PMunch seems to use and like it.
21:37:12dom96Araq: What actual advantages does it have over a more traditional ORM lib?
21:38:02Araqdunno what "traditional ORM" means
21:38:28AraqI've used a couple and they were all awful performance-wise
21:38:36Araqand memory hogs
21:38:41Araqbut that was for C#.
21:38:53PMunchWait, what does I seem to enjoy?
21:39:26AraqOrmin.
21:39:38Araqand if you say sqlalchemy I'll ragequit.
21:40:06Araqsqlalchemy is totally untyped. you can't port it to Nim.
21:40:20PMunchOh right. I was actually just learning it to make a small series of video tutorials on web development in Nim
21:40:34*gangstacat quit (Quit: Ĝis!)
21:40:43FromGitter<data-man> https://github.com/fnc12/sqlite_orm C++
21:40:55PMunchAnd so far I haven't really used any more than the regular SQL query part, not the actual set up Ormin as a server part
21:44:39dom96I was thinking more like, you define an object type and the ORM figures out how to store it in the DB for you.
21:45:17*gangstacat joined #nim
21:46:59*r2 joined #nim
21:48:16Araqnot a fan. data is more important than code and 'objects' are not appropriate for foreign key relationships etc.
21:49:57*gangstacat quit (Client Quit)
21:49:57AraqPMunch: "ormin as a server part" is probably the least developed part of Ormin :-)
21:50:50Araqthe SQL DSL is pretty sweet and I'll keep it
21:52:20*r2 quit (Ping timeout: 276 seconds)
21:53:29PMunchAh okay, guess I won't be adding a Ormin with Karax tutorial then
21:53:59PMunchStick with Jester+Ormin+Source code filter templates (or emerald)
21:54:05PMunchOr Jester+Ormin+Karax
21:57:58dom96add Emerald in there and you've got yourself a nice acronym
21:58:19dom96well, maybe not :P
22:00:58PMunchHaha, the joke stack
22:02:03Araqhuh? you can use Ormin with Karax without Ormin's protocol generation
22:03:21Araqoh you just said that, my bad
22:03:45Araqyeah add an 'E', the-JOKE-is-on-you-stack
22:04:03PMunchNot sure what you would use emerald for though with Karax
22:04:22Araqno, write a library you use that starts with an E
22:04:32FromGitter<cabhishek> hi, has anyone used https://github.com/nitely/nim-regex and installed via nimble?
22:04:55FromGitter<cabhishek> https://github.com/nitely/nim-regex/issues/5 is what I am seeing
22:05:23FromGitter<krux02> Araq: Is there is `divmod` function now in nim?
22:06:09FromGitter<krux02> I think about just implementing it, because C provides this function already as `div` and `ldiv`
22:06:56Araqno.
22:06:57dom96cabhishek: that's odd, try `nimble install regex@#head`
22:07:12Araqcabhishek: https://github.com/nitely/nim-regex/blob/master/tests/utils.nim
22:07:29AraqisMatch is in utils only used for testing, you should use 'match'
22:13:48FromGitter<cabhishek> @Araq I see, thanks. I should have looked into docs rather than tests 😟
22:15:07FromGitter<zacharycarter> dom96: why are you unsure about gql?
22:15:57FromGitter<zacharycarter> also please no more stack acroynms
22:16:10dom96The JOKE stack is the best though!
22:16:32*gangstacat joined #nim
22:16:34FromGitter<zacharycarter> lol
22:16:53FromGitter<mratsim> @miran, Peter and me used proc because that is the way to get closure iterators. We used closure iterators because currently it’s not possible to chain inline iterators: https://github.com/nim-lang/Nim/issues/4516 and do something like foo.map(bar).filter(bar).reduce(sum)
22:17:01dom96Jester+Oracle+KDE+(e)nginX
22:17:46FromGitter<mratsim> @krux02 feel free to take this code for your divmod: https://github.com/numforge/number-theory/blob/5ac4b23dbdcd406e53e1a5faefec81b9dc73c67f/src/integer_math.nim#L26-L49
22:18:09FromGitter<mratsim> @Varriount Thanks :)
22:18:10FromGitter<krux02> thanks
22:18:11dom96zacharycarter: Again, feels like a bit of an overhyped technology
22:18:49FromGitter<krux02> but according to the specification, the order of the members of div_t is not specified
22:18:51miranmratsim: oh, chaining would be nice thing to have. ok, i'll use procs too then!
22:18:56FromGitter<krux02> it can be in any order
22:19:37FromGitter<mratsim> ah? that’s bad :/
22:20:43FromGitter<mratsim> @miran, for chaining use zero_functional or templates, otherwise each new iterator you add will add a new loop. you might get 3 loops+ over your data with 3 iterators chained
22:21:08dom96Good news everyone. Async pcap works, and with the objective C backend too
22:21:14FromGitter<zacharycarter> dom96: all I'll say to that is - people are using gql at the office. I'm the only one tmk using Nim :(
22:21:23Araqhttps://www2.cs.arizona.edu/icon/docs/ipd266.htm
22:22:21Araqcheck it out, if you want to know how to design foo.map(bar).filter(bar).reduce(sum)
22:22:33dom96On a side note, it's awesome to see nitely so actively working on that regex lib :D
22:22:53Araqwithout an ever growing set of "primitives"
22:25:31FromGitter<mratsim> by the way Araq, I’ve updated loopfusion so that it can work as a better list comprehension I think. It can also be a “forEach expression” now.
22:27:51*poopBot quit (Remote host closed the connection)
22:29:29dom96Sucks that iterators can't be used for loopfusion
22:29:51dom96I must admit even after reading your explanation I do not understand the problem
22:31:16FromGitter<mratsim> basically `for i, x, y, z in customZip(a, b, c):` —> customZip must be predefined before the for loop
22:32:26FromGitter<mratsim> that would mean that I have to generate `iterator customZipT, U V (s1: seq[T], s2: seq[U], s3: seq[V]): (int, T, U, V) = ...
22:33:21FromGitter<mratsim> before the for loop. hence hardcoding customZip from 1 to a reasonable number of argument
22:33:41dom96is that really a problem?
22:35:43FromGitter<mratsim> if you want to return `var` in some or the other you get combination explosion, but you can probably generate from 1 to 6 and cover 90% of use case
22:37:37FromGitter<mratsim> in Arraymancer I probably have something like 1000+ lines of code for zip2,3 enumerateZip2,3 (aka zip with index), map, map2, map3, apply1,2,3 (in-place) that I can remove with those 300 lines of macro
22:41:55*miran_ joined #nim
22:42:51FromGitter<mratsim> oh @dom96 you meant `forEach x in fooIterator(a), y in b:` ?
22:43:41dom96oh no
22:44:05Araqzip2,3, enumerateZip2,3, map, map2, map3, apply1,2,3
22:44:12*endragor joined #nim
22:44:21Araqbut what about foldr, foldl?
22:45:05*miran quit (Ping timeout: 240 seconds)
22:46:31Araqtold you it is like epicycles.
22:48:33*endragor quit (Ping timeout: 256 seconds)
22:53:15*miran_ quit (Quit: Konversation terminated!)
22:55:36FromGitter<zacharycarter> does Nim feature any sort of recursive file watcher?
22:59:02*WhiskeyNick quit (Read error: Connection reset by peer)
23:00:00FromGitter<krux02> @mratsim zip is what I am really missing in the nim standard library
23:00:25FromGitter<krux02> zipping two itearators is way too hard in pure Nim
23:00:47*dom96 <3s the logging module
23:00:56FromGitter<krux02> most of the time I have something like openarray anyway, so I use index, but if I don't then it is really bad
23:01:03dom96If there is one reason for multimethods, that module is it
23:02:13FromGitter<krux02> dom96: how does logging need multimethods?
23:02:15FromGitter<mratsim> I think inline iterator chaining working would help a lot already
23:02:59dom96krux02: inheritance?
23:03:25FromGitter<krux02> @mratsim well chaining is not that much of a problem. I can define a local function and then write two for loops that just call this function
23:04:33FromGitter<krux02> dom96 well I don't use inheritance, so I don't know what exactly you mean
23:04:40FromGitter<krux02> (anymore)
23:05:34dom96You can easily define your own loggers
23:05:49*PMunch quit (Quit: leaving)
23:06:02FromGitter<krux02> my loggers are most of the time just "echo"
23:06:19FromGitter<krux02> but I am not writing server code
23:06:28dom96I'm playing around with a TUI
23:06:36FromGitter<krux02> so I have little experience with actually writing useful logging fucntions
23:06:36dom96and I just wrote a logger that puts my logs into a TUI window
23:06:56FromGitter<krux02> terminal user interface?
23:07:01dom96yep
23:19:37FromGitter<krux02> with import cpp I can do the following: ``proc rem(arg: ldiv_t): clong {.importcpp: "#.rem".}`` but it causes that nim compiles to c++ instead of c. What would be the equivalent of C?
23:20:25FromGitter<krux02> do I need an emit statement?
23:23:16*find0x90 joined #nim
23:28:24FromGitter<zacharycarter> hrm.... I'm not finding a straightforward way to watch a directory for file changes
23:28:47FromGitter<zacharycarter> and being able to figure out what file changed
23:30:21FromGitter<zacharycarter> I found https://github.com/Varriount/Filemon - yay! thanks @Varriount ! hopefully your 4 year old code is workable!
23:30:38dom96https://forum.nim-lang.org/t/1179
23:30:39FromGitter<Varriount> It works on Windows
23:31:08FromGitter<Varriount> @zacharycarter It was never completed to work on Mac/Linux. There is/was a standard library module for those platforms.
23:31:25dom96Yes, bringing both together is a great project
23:32:35FromGitter<zacharycarter> hrm okay - I'll work on it - thanks guys LD
23:32:39FromGitter<zacharycarter> :D
23:33:10*gangstacat quit (Ping timeout: 246 seconds)
23:35:40*r2 joined #nim
23:36:22FromGitter<zacharycarter> so dom96 - would the idea be to add osx / windows support to: https://github.com/nim-lang/Nim/blob/master/lib/packages/fsmonitor.nim ?
23:36:45dom96yes
23:36:56dom96This should be done in a Nimble package for now though
23:37:12*gangstacat joined #nim
23:37:17FromGitter<zacharycarter> okay
23:37:26FromGitter<zacharycarter> should I name it fsmonitor?
23:37:39dom96Ideally you'd have OS-specific modules
23:37:49FromGitter<zacharycarter> ok
23:37:49dom96and then a generic cross-platform module on top of that
23:38:03dom96name it something else please
23:38:25FromGitter<zacharycarter> ok
23:39:50FromGitter<krux02> how is the best way to implement platform dependent versions of certain functions
23:40:14*r2 quit (Ping timeout: 260 seconds)
23:40:23FromGitter<krux02> I think all this branching with `when` very ugly
23:41:32FromGitter<zacharycarter> I agree - and am curious
23:45:03*gangstacat quit (Quit: Ĝis!)
23:45:57FromGitter<krux02> well I don't have a nice solution
23:46:16dom96anddd I praised logging too early
23:46:21dom96Getting a crash in the GC :/
23:46:23FromGitter<krux02> sometimes I think that Nim should provide a standard way for handling basic platforms
23:46:51*gokr quit (Ping timeout: 268 seconds)
23:46:58FromGitter<krux02> dom96: I am still waiting that I cal finally disable the GC once and for all.
23:47:00dom96oh, my bad
23:47:37FromGitter<krux02> how do I check if I am compiling to a C/C++ backend?
23:47:41dom96seeing a stack trace that goes into gc.nim is always far too suspicious
23:51:51*find0x90_ joined #nim
23:51:57*find0x90 quit (Ping timeout: 263 seconds)
23:54:01FromGitter<krux02> @zacharycarter would be nice if you orient yourself on something that already exists. For example this one here: https://github.com/fsnotify/fsnotify
23:54:08FromGitter<krux02> (it is for go)