<< 11-07-2018 >>

00:01:16*donlzx joined #nim
00:03:10*find0x90 quit (Quit: find0x90)
00:09:08FromDiscord<Epictek> I have a stupid question about Jester, how the hell to I get the unprocessed query string? translating the query back in to a string seems like a waste of time if I can just use the original string.
00:22:36*dddddd quit (Remote host closed the connection)
00:31:24*thomasross quit (Remote host closed the connection)
00:31:45*thomasross joined #nim
00:35:31*smt quit (Read error: Connection reset by peer)
00:35:42*smt joined #nim
00:46:34*find0x90 joined #nim
01:06:45*find0x90 quit (Quit: find0x90)
01:07:08*stefanos82 quit (Quit: Quitting for now...)
01:09:39*krux02 quit (Remote host closed the connection)
01:16:26*rosshadden quit (Quit: WeeChat 2.1)
02:08:44FromGitter<Quelklef> Any Kakoune users here that want to help me on a quest to make the kakoune nim syntax highlighting actually usable?
02:11:26FromDiscord<2vg> Epictek: https://github.com/dom96/jester/blob/master/readme.markdown#request-object
02:11:42FromDiscord<2vg> maybe, request.path?
02:59:10*zahary quit (Quit: Connection closed for inactivity)
03:06:28*smt quit (Ping timeout: 244 seconds)
03:25:42cornfeedhobosearching around leaves me wondering ... is there a resolution to how to setup a workspace / vendor / virtualenv like configuration with nimble and packages?
03:50:26shashlickYou can use choosenim
03:50:50shashlickHelps setup multiple versions of Nim and switch quickly
04:14:29*NamPNQ joined #nim
04:21:04*lompik joined #nim
04:22:41*NamPNQ quit (Remote host closed the connection)
04:35:47*endragor joined #nim
04:54:23cornfeedhobowell, what if my concern is not versions, which imho everyone should just adopt the popular *env suite, I'm talking more about isolating project dependencies. similar to golang's issue, which is why i use govendor
04:55:56shashlickyou could use `--nimbleDir:dirname` under nimble to install in a different path
04:56:46shashlickand then use `--NimblePath:PATH` for nim to look in this different directory
04:59:24cornfeedhobos/suite/approach/
05:00:03cornfeedhobookay i did see some mention of that, but nothing seemed to say that was the only approach. thanks
05:07:29*nsf joined #nim
05:09:45shashlicki'm not sure if it works but you could potentially have a per-project nimcache with a nim.cfg using the above flag
05:10:03shashlickonly nim would pick it up though, you'd still have to pass the flag to nimble to install locally
05:10:58*miran joined #nim
05:17:09*rockcavera quit (Remote host closed the connection)
05:19:47FromGitter<data-man> @tim-st: I added the procs for strings, although I'm against storing binary data in strings. ;-)
05:26:57CodeVancenimble is basically a virtualenv if you set its directory
05:45:39*rockcavera joined #nim
06:09:44*miran quit (Ping timeout: 260 seconds)
07:14:19*leorize quit (Quit: WeeChat 2.1)
07:33:09*ehmry_ is now known as ehmry
07:34:51*yglukhov[i] quit (Remote host closed the connection)
07:35:05*yglukhov[i] joined #nim
07:36:30*yglukhov[i] quit (Read error: Connection reset by peer)
07:37:05*yglukhov[i] joined #nim
07:41:57*yglukhov[i] quit (Read error: Connection reset by peer)
07:42:09*PMunch joined #nim
07:42:30*yglukhov[i] joined #nim
08:01:16FromGitter<tim-st> @data-man perfect, thanks!
08:21:33Araq"The go tool will now use the path from which it was invoked to attempt to locate the root of the Go install tree. This means that if the entire Go installation is moved to a new location, the go tool should continue to work as usual."
08:22:13Araqso Go now does what Nim always did.
08:27:23FromGitter<mratsim> @shashlick I don’t mind you changing clblast, but I need to see the proc exported.
08:30:42FromGitter<mratsim> @tim-st apart from stuff like access to LLVM intrinsics and maybe concurrency (even then a GC can actually increase performance) I don’t see any area where the perf you can achieve in Rust cannot be achieved in Nim
08:31:00*rokups joined #nim
08:31:57FromGitter<tim-st> yes, this also was my impression
08:32:24FromGitter<tim-st> Araq: GOROOT=$HOME/go ; I think this is different from nim
08:32:46FromGitter<tim-st> it would be more similiar if nim would cache inside nimble folder
08:36:51*noonien joined #nim
08:39:45FromGitter<mratsim> I prefer if nim cache it in .cache
08:39:59FromGitter<mratsim> I know I can delete .cache without issue
08:40:19FromGitter<mratsim> I don’t want to have to inspect .nimble to make sure I don’t delete something I needed
08:43:13FromGitter<tim-st> @mratsim maybe an extra folder inside nimble with the same structure? you could delete it without problems
08:44:58FromGitter<mratsim> just use ~/.cache/nim{,ble}
08:48:03FromGitter<tim-st> so you would prefer a shared path in $HOME too?
08:50:57FromGitter<mratsim> temporary files should be in normal temporary paths so that it’s picked up by automated cleanup scripts and tools
08:52:02FromGitter<mratsim> When I need a couple GBs, I don’t want to think “mmm where does Python puts temp files again, what about Nim, what about Rust, what about Firefox …"
08:52:57FromGitter<tim-st> sure, I just thought that's important to have the best possible way of caching especially if your data has this size
08:58:42PMunchPut it in /tmp/nimcache-{uid}
09:03:48Araqagain, /tmp doesn't exist on Android
09:04:08Araqbut I'll change it to $HOME/nimcache/project_flags
09:04:35Araqwhere flags distinguishes between release and debug builds
09:04:38FromGitter<mratsim> $HOME/.cache/nimcache/project_flags
09:04:55Araqis $HOME/.cache a thing?
09:04:59FromGitter<mratsim> it is
09:05:33Araqmeh, I still need to look at the produced C code too often
09:06:15FromGitter<mratsim> I checked my .cache folder on OSX: ⏎ ⏎ drwxr-xr-x 4 username staff 128 26.10.2017 21:14 livestreamer/ ⏎ drwxr-xr-x 3 username staff 96 27.03.2016 15:29 youtube-dl/ [https://gitter.im/nim-lang/Nim?at=5b45c887bd92d80782a63c66]
09:08:24FromGitter<mratsim> I do check the produced C code a lot as well but since it’s “ignored” it doesn’t appear in VScode anyway I still have to have a separate terminal window or file browser to open the file.
09:08:43FromGitter<mratsim> ignored — gitignored
09:10:17PMunchPlease don't put it directly in home
09:10:22PMunch.cache is better
09:11:56Araqmratsim: but if in HOME it doesn't have to be .gitignored at all
09:12:06FromGitter<mratsim> yes
09:12:16Araqand you can just add this directory to your VS Code setup
09:12:43FromGitter<mratsim> my point is that whether it’s in home or in gitignored, I need an extra file browser/terminal window to access it.
09:12:49*yglukhov[i] quit (Read error: Connection reset by peer)
09:13:15FromGitter<mratsim> so even though I like to check the C file, the workflow to check them out is the same
09:13:22*yglukhov[i] joined #nim
09:16:24FromGitter<tim-st> The way in $HOME is good (never heard of .cache/ but dont care of another subfolder) but still doesnt solve the problem of same named files in project if my assumption is correct
09:17:10FromGitter<tim-st> but I havent tested it yet, maybe it works
09:20:37*TheLemonMan joined #nim
09:21:53TheLemonManAraq, following https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html is good practice (at least on the linux/bsd side of the moon)
09:22:00FromGitter<mratsim> requiring not to use the same name in a single project is reasonable
09:22:27FromGitter<mratsim> $XDG_CACHE_HOME defines the base directory relative to which user specific non-essential data files should be stored. If $XDG_CACHE_HOME is either not set or empty, a default equal to $HOME/.cache should be used.
09:23:00FromGitter<tim-st> but these files come from different folder like main.nim or test.nim
09:23:20FromGitter<tim-st> this is just an assumption, I had from a look at my wrapped c sources
09:23:37FromGitter<tim-st> they have plain name without folder strucutre or prefix filename structure
09:24:16AraqTheLemonMan: yeah ok.
09:24:46AraqI might remove the nimcache/ part then, I like flat
09:24:51FromGitter<tim-st> some have, some dont, and those which have are likely not sufficient
09:25:11FromGitter<tim-st> (https://files.gitter.im/nim-lang/Nim/HrEG/folder.PNG)
09:26:10*ng0 joined #nim
09:27:32TheLemonManAraq, hm? I hope you don't plan on throwing all the .c and .o in $XDG_CACHE_HOME and not in a nim/ subdirectory
09:27:58FromGitter<tim-st> even a nim subdirectoy is not enough from what I assume
09:28:07FromGitter<tim-st> I think golangs way is the only safe one
09:28:32AraqI'm thinking of .cache/nim_$project_$flags
09:28:53FromGitter<tim-st> that's similar to go, but doesnt include arch of os
09:29:07FromGitter<tim-st> ah, in flags maybe
09:29:08*stefanos82 joined #nim
09:29:11Araq nimcache/ doesn't buy us much, it's obviously a "cache" and it needs to be project specific anyway
09:29:31stefanos82greetings folks
09:29:39AraqI mean it's obviously a cache since it's in .cache
09:29:59FromGitter<tim-st> but when it's again for each project a cache than that probably reuses to few things
09:30:08TheLemonManredundancy is always good, isn't it?
09:30:25FromGitter<tim-st> seriously, the golang version is the best I'm pretty sure
09:31:28FromGitter<mratsim> department of redundancy department :P
09:31:32stefanos82Araq: what a coincidence. Last night I was working on a demo project and have noticed I had two separate nimcaches; one for src and one for tests. Is it difficult to have one central nimcache that could contain subdirectories that resemble the project's structure? that is, nimcache/{src,tests,something-else} ?
09:31:59FromGitter<tim-st> that's what golang does
09:32:11FromGitter<mratsim> I always compile from the project root and pass —nimcache:nimcache
09:32:48AraqTheLemonMan: no. :-)
09:33:00FromGitter<mratsim> $ nim c -r --nimcache:nimcache -o:build/tests tests/foo.nim
09:33:18FromGitter<mratsim> then binaries are always in build and nimcache is always at the same place
09:33:25Araqbut I'm probably the biggest hater of directories...
09:33:46stefanos82yes, but this way it will place all generated files under nimcache
09:34:02FromGitter<tim-st> @mratsim but this will recompile too much things
09:34:05stefanos82what happens when you have two different directories that contain the same module name?
09:34:22FromGitter<mratsim> Nim doesn’t allow that
09:34:25FromGitter<tim-st> exactly, then there is unneeded recompilation
09:34:43FromGitter<mratsim> @tim-st why? it only compiles things that changed
09:35:14FromGitter<tim-st> I meant when they having the same name, and I have already tested it and it doesnt work
09:35:22FromGitter<tim-st> It even gave the wrong result
09:35:31FromGitter<mratsim> but module with the same name are not allowed
09:35:32FromGitter<tim-st> then people told me not to use nimcache for now
09:36:03FromGitter<mratsim> within a single project you can’t have 3 files called “utils” for example
09:36:12stefanos82personally I have noticed a peculiar behavior with compilation. If I have a module that needs to get removed from my code and re-run "nim c ...", it will throw an error, like 95% of my total attempts, which forces me to delete the whole nimcache and attempt again to recompile.
09:36:23FromGitter<tim-st> do you have an example where it's not allowed in nim and at the same time allowed in golang?
09:36:25TheLemonManAraq, speaking of nimcache, can this https://github.com/nim-lang/Nim/blob/32441d01e597ff0c94ca037d10a0d2674d4012b3/compiler/extccomp.nim#L436,L439 be enabled?
09:36:52FromGitter<mratsim> I don’t use go, I don’t have suchh example.
09:37:22FromGitter<mratsim> @stefanos, is it a linker error?
09:37:39FromGitter<mratsim> The only error I get with nimcache is if I compile to C++ and then I compile to C
09:38:32FromGitter<tim-st> does anyone can name serious downside of the cache golang uses?
09:38:32FromGitter<tim-st> I dont see a single one
09:38:32AraqTheLemonMan: huh? isn't that in devel... oh
09:38:32stefanos82I don't really remember the exact error @mratsim, but it throws a couple of lines with numbers and then the red error message
09:38:32Araqit's still in my branch that I can't merge. so sure, go ahead
09:38:32FromGitter<mratsim> yeah that’s a linker issue
09:39:26stefanos82in other words @mratsim it attempts to link the already generated C files to parts of code that do not exist anymore, something like that?
09:40:48TheLemonManwhat's the usual workflow for developing a library using nimble? I mean, `nimble build` doesn't work since it's not a bin...
09:41:08FromGitter<mratsim> mmmmh, it’s been a while since I wrote wrappers, maybe you have include issue, like a nim filed included a necessary header, but you don’t compile it in anymore or something.
09:41:09stefanos82nimble init?
09:41:31*ng0 quit (Quit: Alexa, when is the end of world?)
09:41:59FromGitter<mratsim> start writing a `nimble test`
09:42:22FromGitter<mratsim> write code, a `nimble test` away
09:42:30TheLemonMangotcha, gotta move stuff into the test dirs
09:43:35*dddddd joined #nim
09:43:48stefanos82@mratsim: for instance, I have a generic project that I use for general purposes, thus the name. Right now I have the following generated files: generic.c stdlib_algorithm.c stdlib_cpuinfo.c stdlib_cpuload.c stdlib_linux.c stdlib_locks.c stdlib_math.c stdlib_os.c stdlib_ospaths.c stdlib_parseutils.c stdlib_pcre.c stdlib_posix.c stdlib_re.c stdlib_rtarrays.c stdlib_sharedlist.c stdlib_strutils.c stdlib_system.c stdlib_threadpool.c
09:43:48stefanos82stdlib_times.c
09:44:01stefanos82guess what modules I have imported in it: times and os
09:44:17stefanos82why do I have to retain those unnecessary C files?
09:45:31FromGitter<mratsim> they are needed by os and times
09:45:48stefanos82all these?
09:45:50FromGitter<tim-st> but only if they arent compiled already to o-files ?
09:45:51stefanos82no way lol
09:46:55FromGitter<mratsim> https://nim-lang.org/docs/os.html ⏎ ⏎ > strutils, times, winlean, ospaths
09:47:36FromGitter<mratsim> ospaths uses posix cpuinfo and cpuload and linux I guess
09:47:37stefanos82I removed nimcache and recompiled. it's only 10 files, not 19
09:48:38FromGitter<mratsim> @tim-st, Nim reuses the .o if the imported procs from the module did not change (no new one or no new unused one)
09:49:50FromGitter<tim-st> and does it find out if they change?
09:50:03FromGitter<mratsim> the file is hashed
09:50:10FromGitter<tim-st> against what?
09:50:20FromGitter<tim-st> c source or nim source
09:50:29FromGitter<mratsim> C source
09:50:41FromGitter<tim-st> so the s souce has to be compile first by nim?
09:51:12FromGitter<mratsim> the C file can change if you used foo\float\ (x) vs foo\int\ (y)
09:51:12FromGitter<tim-st> that's obviously not the best way of caching regarding performance
09:51:45FromGitter<mratsim> Araq is working on incremental compilation to solve this
09:52:06FromGitter<tim-st> also is it possible that two different x.o file are in the cache folder?
09:52:13FromGitter<tim-st> from different folders?
09:52:55FromGitter<mratsim> no
09:53:08FromGitter<tim-st> in the screenshot I posted above one can see that the c files wrapped doesnt have a prefix, if they have the same name in another wrapper I use what happens?
09:53:21FromGitter<tim-st> e.g. mdb.o is there
09:53:22FromGitter<mratsim> currently file are renamed with the parent folder name or the git project name as prefix
09:53:40FromGitter<tim-st> no it's just called mdb.o nothing more
09:53:52Araqtim-st: you can also use the .compile pragma with patterns to tell Nim which .o file to produce
09:54:21FromGitter<tim-st> yes, I used the compile pragma and it works
09:54:24FromGitter<mratsim> (https://files.gitter.im/nim-lang/Nim/sbQD/2018-07-11_11-54-16.png)
09:54:38FromGitter<mratsim> @tim-st ^ C lib imported from other project are properly prefixed
09:54:43FromGitter<tim-st> I'm just curious if this wont fail for bigger projects
09:54:49FromGitter<mratsim> rocksdb and secp256k1 are c lib
09:55:05FromGitter<tim-st> yes, the imported ones, but not the wrapped ones using compile pragma
09:55:19FromGitter<tim-st> also I doubt that these prefixes are sufficient long enough
09:55:33FromGitter<tim-st> because of this I suggested to use the golang way, this is bulletproof
09:56:04FromGitter<mratsim> You can make one package per wrapper or are you trying to have a single package as a collection of multiple wrappers?
09:56:17Araqhardly. on plenty of systems there is a MAX_PATH limit
09:56:27FromGitter<mratsim> you can RFC it on Github with your use cases so we can compare
09:56:47FromGitter<tim-st> yes, but golang would have this MAX_PATH limit too, and noone of there big userbase had problems I think
09:56:51FromGitter<mratsim> windows 256 char limit on path is silly ...
09:57:10Araqnothing is bulletproof about a Java-esce long.stuff.nested.until.the.universe.collapses
09:57:35FromGitter<tim-st> I just want to show that it's much more bulletproof than a prefix like stdlib_
09:57:44Araqtim-st: I had that problem on Java projects with Windows CE. now what?
09:57:44FromGitter<mratsim> —> RFC
09:58:01Araqare you seriously suggesting Java is not used widely enough?
09:58:32FromGitter<tim-st> no, I just think this will be a problem in future, but we will see, for most projects of course the current way will work
09:59:04FromGitter<mratsim> I’ll probably be the first to complain :P
09:59:22FromGitter<tim-st> yes, people with bigger source code
10:00:16stefanos82thus, my original question about nimcache/{src,tests,...}
10:00:49FromGitter<mratsim> the file names within nimcache are orthogonal to the location of nimcache
10:01:24stefanos82orthogonal or polygonal, the issue remains the same. there will be file collisions
10:01:38FromGitter<mratsim> having just “nimcache” works but I’d like to mode it to $XDG_HOME_CACHE (aka ~/.cache/)
10:02:26FromGitter<mratsim> @stefanos82, can you file a Github issue with a test case.
10:02:42FromGitter<mratsim> move*
10:12:16stefanos82sure thing, I will do it now
10:12:35stefanos82before I do it though, let me ask Araq something first mratsim
10:12:56stefanos82Araq: when two files with the same name, do they generate a concatenate C file?
10:13:00FromGitter<mratsim> I’m not Araq’s gatekeeper :D
10:13:19stefanos82you are a wizard Harry
10:13:32*Vladar joined #nim
10:13:48Araqconcatenate C file? that's crazy talk
10:13:59stefanos82well, that's what seems to happening right now lol
10:14:19stefanos82I have created a demo project with the following directories: bin, src, misc, tests
10:14:45stefanos82in src/ I have a demo.nim that greets you with echo("Hello from src/demo.nim")
10:15:08stefanos82in misc/ I have a demo.nim that greets you with echo("Hello from misc/demo.nim")
10:16:05stefanos82in src/ I have a demo.nims with switch("out", "bin/demo") and in misc/ I have a demo.nims with switch("out", "bin/misc-demo")
10:16:36stefanos82also in src/ and misc/ I have two nim.cfg with --nimcache:nimcache
10:17:01stefanos82all I get from nimcache is the following files: demo.c demo.json demo.o stdlib_system.c stdlib_system.o
10:17:09stefanos82now the question is: which demo is which?!
10:17:59Araqwhat you compiled last overwrites the old stuff.
10:20:12stefanos82OK, is there a way to compile both src/demo.nim and misc/demo.nim at the same time?
10:25:22Araqwith some shell script sure, but you're then summoning the inherit limitations of a file system under concurrency
10:25:43Araqand that's not a Nim problem.
10:26:48FromDiscord<2vg> GC Warning comes out with boehmGC.
10:26:48FromDiscord<2vg> This is memory leak?
10:26:48FromDiscord<2vg> https://github.com/2vg/mofuw/issues/49
10:28:24stefanos82Araq: OK. Is there a way to retain the source path it comes from? That is, to get either a nimcache/src/demo.o or nimcache/src-demo.o?
10:28:42stefanos82this way we wouldn't have any collision problem
10:50:57*skrylar quit (Ping timeout: 240 seconds)
10:52:02*yglukhov[i] quit ()
10:55:09FromGitter<mratsim> Nim doesn’t allow the same filename within the same project
10:55:26*yglukhov[i] joined #nim
10:55:30FromGitter<mratsim> so there is no collision
11:04:54TheLemonManhmm, what happened to the CI? is it stuck or something?
11:08:44TheLemonManalso, is this a bug? https://gist.github.com/LemonBoy/54e377c033f2a0f161f2f0c857827b68
11:09:04TheLemonManit works just fine if I remove the generic parameter [T]
11:29:51FromGitter<mratsim> yes it’s a bug, it’s because when you have generics, the semantic checks is done before macro/templates in certain situations
11:30:05FromGitter<mratsim> this is why {.this: self.} doesn’t work with generics
11:31:33*BitPuffin joined #nim
11:31:40FromGitter<mratsim> @TheLemonMan Cause: https://nim-lang.org/docs/manual.html#generics-symbol-lookup-in-generics Similar issue : https://github.com/nim-lang/Nim/issues/5053, https://github.com/nim-lang/Nim/issues/7632, https://github.com/mratsim/Arraymancer/issues/62
11:37:23*dddddd quit (Ping timeout: 256 seconds)
11:38:48*TheLemonMan quit (Quit: "It's now safe to turn off your computer.")
11:39:55*krux02 joined #nim
11:47:02endragorIs there a way to get _Alignof operator behaviour in Nim (without using .emit)? https://en.cppreference.com/w/c/language/_Alignof
11:47:49Yardanicohttps://github.com/nim-lang/Nim/pull/5664 https://github.com/nim-lang/Nim/issues/5493
11:53:25*yglukhov[i] quit (Read error: Connection reset by peer)
11:53:59*yglukhov[i] joined #nim
11:54:49FromGitter<tim-st> when I have a proc open(... v: static[bool]) and I need to check v to decide which proc I use, can I do this with some easy way like making v constant in a global scope?
11:54:57*leorize joined #nim
11:55:13FromGitter<tim-st> because it's static?
12:01:04*dddddd joined #nim
12:01:56FromGitter<tim-st> or behaves the following var like a const one?
12:01:58FromGitter<tim-st> static: ⏎ var x = 0
12:03:40FromGitter<mratsim> when v: callFoo() else: callBar()
12:04:12FromGitter<tim-st> yes, but v is in local scope, I need it in global scope
12:04:34FromGitter<tim-st> I could integrate it in all my objects, but then I needed to rewrite the code
12:04:35FromGitter<mratsim> var v {.compileTime.} = true
12:04:43FromGitter<mratsim> or const v = True
12:04:47FromGitter<mratsim> if it’s constant
12:05:05FromGitter<tim-st> it's static and only changed one time at compile time
12:05:13FromGitter<tim-st> has this the same performance like const?
12:05:20FromGitter<tim-st> I mean: var v {.compileTime.} = true
12:05:44FromGitter<mratsim> it has no runtime implication, the variable only exists at compile time
12:06:05FromGitter<tim-st> so it is a const that is editable at compile time?
12:06:23FromGitter<mratsim> yes
12:06:36FromGitter<tim-st> perfect, exactly what I need :D
12:06:39FromGitter<tim-st> thanks
12:06:50FromGitter<tim-st> and no downside at runtime?
12:07:02FromGitter<tim-st> if the performance is effected I would rewrite it
12:07:14FromGitter<mratsim> the variable doesn’t exist in the C code
12:07:22FromGitter<tim-st> perfect, very cool
12:09:50FromGitter<tim-st> yes, it works, that's extremely useful
12:11:19FromGitter<tim-st> hm, maybe it wont work, if the user calls open one time with true and once with false
12:14:16FromGitter<mratsim> Tell Araq then because he is still on the fence whether to keep it as it is now or revert to the previous static: v = foo() system.
12:16:16FromGitter<tim-st> I need to test it, the problem I guess is that it maybe uses the last state of the var so that when open was called with true and later with false also the first opened type get the procs for false
12:20:09FromGitter<tim-st> exactly the thing happened like I thought
12:20:42FromGitter<tim-st> https://gist.github.com/tim-st/32d9acacb20eec33575c32dffc2cae8d
12:21:12FromGitter<tim-st> oh, there is a bug
12:21:42FromGitter<tim-st> now compile time error on c level
12:23:00FromGitter<tim-st> `undeclared (first use in this function)`
12:29:46FromGitter<mratsim> you are not changing handleCompression value though
12:30:13FromGitter<tim-st> see the updated code
12:39:30FromGitter<mratsim> This seems to work but it seems like you have to pass globals as parameters: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b45fa8270efc60660bfb425]
12:39:43*floppydh quit (Remote host closed the connection)
12:40:33*floppydh joined #nim
12:40:34FromGitter<mratsim> in your case it might be easier to use templates that wraps the withCompression and withoutCOmpression procs
12:41:09FromGitter<mratsim> I couldn’t add the {.compileTime.} pragma to the “open” proc so I add to use static: as a workaround
12:48:47*tzekid quit (Quit: Page closed)
12:57:26*ng0 joined #nim
13:05:40Yardanicoyay, obscure C compiler errors :)
13:09:50PMunchYardanico, those are the best
13:09:54YardanicoPMunch, yeah, https://github.com/nim-lang/Nim/issues/8280
13:10:18PMunchWell, maybe apart from the random SEGFAULTS I now get when using nimrtl.. Those are even worse
13:10:29YardanicoI'm just trying to port some Python-like functions to Nim (ab)using generics, concepts, etc :P
13:11:59PMunchOh wow, incompatible type errors even
13:25:39FromGitter<kaushalmodi> I miss using advices in Nim: https://en.m.wikipedia.org/wiki/Advice_(programming)
13:26:07FromGitter<kaushalmodi> Advices can be used to completely if partially override already defined functions
13:26:23FromGitter<kaushalmodi> *or partially
13:26:33Araqyou can override templates fwiw
13:27:56FromGitter<kaushalmodi> Yes, I learned that just recently in that issue :)
13:28:01FromGitter<kaushalmodi> https://www.gnu.org/software/emacs/manual/html_node/elisp/Advising-Functions.html
13:28:55FromGitter<kaushalmodi> ^Above link better explains the use and benefits of advices.
13:29:05Araq"However, these were dropped from C++."
13:29:11Araqthink about that.
13:29:19AraqC++ dropped the feature.
13:29:40stefanos82Araq: such as obscure C compiler errors Yardanico mentioned before, can they be kind of reduced or eliminated if we choose C++ as our output?
13:29:46Araqcan't imagine a better argument against them.
13:29:49Araq;-)
13:29:56Yardanicostefanos82, same error happens with C++ backend :)
13:30:02Yardanicowell, not the same error
13:30:06stefanos82Yardanico: so it's a GCC bug?
13:30:10Yardanicobut C/C++ backends are almost similar
13:30:12Yardanicoafaik
13:30:31FromGitter<kaushalmodi> The lisp advices are more find tuned based on the description I read for how they worked in C
13:30:39Yardanicostefanos82, no, same error happens in clang, so that's probably a codegen bug
13:30:57stefanos82Yardanico: ah I see.
13:31:49FromGitter<kaushalmodi> You can choose to tweak just the input args, or just the return values, or redefine the whole fn, or glue another fn to run immediately before/after the adviced fn.
13:32:08AraqI choose to not do any of these things.
13:32:11FromGitter<kayabaNerve> I get speedups with the C++ backend
13:32:37FromGitter<kaushalmodi> Araq: OK
13:32:59FromGitter<kayabaNerve> I'm sure it depends on the project though
13:33:00FromGitter<kaushalmodi> I need to find ways of yaingyths template overriding feature.
13:33:44FromGitter<kaushalmodi> Some weird autocorrect there.. I meant *using the template..
13:35:16Araqfor a start, it breaks Nim's effect system. you have a proc {.noSideEffect.} and then you on proc entry you want to *log* something (it's always logging, aspect oriented programming is justified with one example only)
13:35:38Araqand the proc is not noSideEffect anymore
13:36:01Araq"ah", you say, "logical it is still noSideEffect"
13:37:02Araqok, so we have the "real" effects and the "logical" effects.
13:38:43Araqand noSideEffect is nothing an optimizer can take advantage off anymore. Nor can it be used for effective reasoning about a program anymore. Killing the effect system and replacing it with faith-based programming practices.
13:40:45FromGitter<alehander42> well you need aspect dimension for the effects: the "main" aspect is pure, but the logging aspect is not
13:41:03Araqor take the following statement. "This is an immutable data structure. It caches the most recent entries for performance, but logically it's all immutable."
13:41:33Araq-- "So I still get races in a multi threaded environment?"
13:41:44Araq-- "Yes, but logically it's all immutable"
13:41:52Araq-- "Great."
13:44:05FromGitter<mratsim> “Faith-based programming” lol
13:44:42FromGitter<kayabaNerve> @mratsim This is a good Christian language!
13:45:06FromGitter<kayabaNerve> I know 2/3rds evaluates to 0.66666 but I always hard code it as 0.777 to praise the lord.
13:45:35FromGitter<mratsim> Lord Las Vegas?
13:45:52FromGitter<kayabaNerve> As said in Leviticus, never have uncommented code over 500 lines, for if you do, your peers will see you as a dick.
13:46:17AraqNot to mention that the idea of "injecting" logging statements into a serious project is quite offensive to anybody who ever put some effort into logging.
13:46:20FromGitter<kayabaNerve> And as said in John, use f***ing version control.
13:46:37stefanos82I "like" how people abuse, attack, or mocking Christianity but don't dare nor have the balls to do the same with Islam or any other spiritual faith.
13:46:48FromGitter<kayabaNerve> Araq: You mean just adding `echo x`?
13:48:05FromGitter<tim-st> @mratsim Nice, thanks for the help
13:48:25FromGitter<alehander42> :(
13:48:43FromGitter<kayabaNerve> stefanos82: I'm Christian myself, so I'm not targeting solely a different group. The joke is generally `Saying heck in a Christian Minecraft server, so it's a reference. Muslims/Jews are attacked often enough. I also make a ton of jokes about the... stricter... religions (Mormonism, Christian Scientists, Jehovah's Witnesses, Scientology).
13:48:46federico3@mratsim: well, most development is far from evidence-driven
13:48:46FromGitter<mratsim> that’s like white vs minorities, able-bodied vs handicapped, men vs women, rich vs poor. In one case you can be ironic/sarcastic in the other it’s discrimination.
13:49:04FromGitter<kayabaNerve> And Christianity isn't a religion as much as Abrahamic isn't. It's a group of faiths.
13:49:36Araqstop it already, no religion or politics in #nim.
13:49:45FromGitter<kayabaNerve> Sorry, moving on
13:49:56stefanos82Araq: I was about to ask the same thing, like what it has to do with Nim
13:52:15FromGitter<kayabaNerve> Araq: When are we looking at 1.0?
13:52:29FromGitter<kayabaNerve> Not from a time standpoint; from a major version standpoint.
13:52:44FromGitter<kayabaNerve> Do you have plans for 0.19, 0.20, 0.21, 1.0? Will 0.20 be 1.0?
13:52:58FromGitter<mratsim> https://github.com/nim-lang/Nim/milestone/2
13:53:30Araqthe plan is always the same
13:54:07Araq0.19 will be crap but also the RC for v1
13:54:10federico3when we run out of integers in 0.x.y
13:55:49*Trustable joined #nim
13:56:03FromGitter<mratsim> why crap? It’s good for me
13:56:17FromGitter<tim-st> @mratsim now I have a good idea: I make two types: Database and CompressedDatabase and overload all procs for both, and for the critical ones I check if T is CompressedDatabase
13:56:38FromGitter<tim-st> *when
13:56:43Araqmratsim: what do you think a new implementation for strings and seqs implies?
13:56:55FromGitter<mratsim> joy
13:57:48FromGitter<kayabaNerve> 1) 9.9.9.9.9
13:58:05FromGitter<kayabaNerve> Or 99...
13:58:12endragorIs there a way to specify C include paths relative to a nim module? The use case is that a nimble package uses third-party C sources that have a bunch of their own header files. One way is to modify the C sources to use relative includes, but was wondering if there is something like {.compile.}, but for include paths
13:58:48FromGitter<mratsim> passL: -I “stringwith relative path”.}
13:59:04Araqyeah, it's pretty bad
13:59:15FromGitter<tim-st> endragor: yes like `{.compile: "../private/liblmdb/mdb.c".}`
14:00:28stefanos82Araq: one thing I like about Ubuntu releases is how they use year and month as their version number
14:01:04FromGitter<narimiran> what does the new implementation for string and seqs imply?? further delays? :D
14:01:06endragortim-st: that's compile and I'm talking about include paths. mratism: that wouldn't be relative to the module it's used in. Nim would just pass the string as is, so it doesn't solve the problem.
14:02:26Araqtry this, but no guarantees:
14:02:45Araq{.passC: "-I$projectDir/path".}
14:03:20Araqnah, doesn't work
14:03:30endragorAraq: it would be in nimble package. I assume $projectDir would be project dir and not the package's dir?
14:03:41Araqah
14:04:25Araqwe need a .cincludeDir pragma
14:04:26*nuxdie joined #nim
14:05:49endragorAraq: that would be nice for this use case. For now it seems the workaround is to modify the third-party sources to use relative paths
14:07:17FromGitter<kayabaNerve> Actual question. What happens if we `import ~/file.nim`
14:07:45FromGitter<kayabaNerve> How does that map? Because all my imports are based on the current file location, and I would love a way, but not a default, to be able to import from where I compile
14:08:45FromGitter<mratsim> @endragor, I agree that the current situation is not great but this would work for you no? https://github.com/status-im/nim-secp256k1/blob/master/secp256k1.nim#L4
14:09:01FromGitter<mratsim> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b460f7de534eb69a5db57a6]
14:10:01FromGitter<mratsim> i.e. currentSourcePath + passC -I
14:10:18stefanos82Araq: can @kayabaNerver use expandTilde() with import?
14:12:16PMunchkayabaNerve, you can easily write a macro that grabs the current directory and expands your imports
14:14:24endragormratsim: oh yeah, nice trick, thank you
14:14:35FromGitter<kayabaNerve> A macro would be best but tbh I would want it at the compiler level, not project level (not importing ../../importMacro.nim) with every command.
14:14:41FromGitter<kayabaNerve> I could setup a nim alias though
14:14:52FromGitter<kayabaNerve> The question is would it work
14:15:20stefanos82Araq: are you a vegetarian or a Tyrannosaurus Rex like me that devours anything? I'm asking in case I meet you some day in person, so I know what to buy you for food and drink...unless you would like to choose for both of us! LOL
14:15:39FromGitter<kayabaNerve> Chooses for boths, eats both
14:15:42FromGitter<kayabaNerve> Araq-style
14:16:25AraqI'm German, give me potatoes.
14:16:27FromGitter<mratsim> @kayabaNerve you can use a config.cfg or config.nims file which tell the compiler the root dir: https://github.com/status-im/nim-eth-p2p/blob/master/tests/config.nims
14:16:39FromGitter<kayabaNerve> @mratsim But can I import with it?
14:16:41Araqthough I don't mind meat either.
14:16:53FromGitter<kayabaNerve> Araq I was in Germany last month or so. Great place.
14:17:05FromGitter<mratsim> @kayabaNerve no, but all your import will be implicitely prefixed with what is inside
14:17:16FromGitter<kayabaNerve> Instead of prefixed to the current file?
14:17:21FromGitter<mratsim> yes
14:17:32FromGitter<kayabaNerve> So that's close but worse. I need an option, not a default. Thanks though.
14:18:04stefanos82Araq: then I will arrange a traditional feast for you
14:18:12stefanos82any preference around beer?
14:18:18FromGitter<kayabaNerve> How many potatoes does it take to kill an Irishman?
14:18:21FromGitter<kayabaNerve> 0
14:18:36stefanos82that was a dark joke
14:19:05FromGitter<kayabaNerve> Agreed
14:19:09FromGitter<kayabaNerve> Sorry if I offended anyone
14:19:12stefanos82it's like going to a person without hands and tell it "hey, let me give you a hand with what you are doing"
14:19:35FromGitter<mratsim> for option you can use a template: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b4611f63c5abf52b64eebd7]
14:19:35FromGitter<kayabaNerve> "tell it"
14:20:02FromGitter<kayabaNerve> And if you actually help, that's bad wording but helpful/kind
14:20:45FromGitter<kayabaNerve> And did you die in the Irish Potato Famine or did your nearby family? I won't say immediate. You may have known a great grandfather as kid. But it did kinda end 160 years ago.
14:20:57FromGitter<kayabaNerve> more like 168
14:21:11FromGitter<kayabaNerve> Thank you @mratsim
14:21:22FromGitter<kayabaNerve> How is import defined?
14:21:29FromGitter<kayabaNerve> Is it a method, proc, func, template...
14:24:40FromGitter<kayabaNerve> Or just where is it defined. That's the better question...\
14:26:19FromGitter<mratsim> probably compiler magic
14:27:08FromGitter<kayabaNerve> Found it sortof. nkImportStmt
14:28:38Araqstefanos82: no dark beer please
14:29:12stefanos82Araq: HAHAHAHA ^_^ I was about to ask whether you drink Guinness or not!
14:29:14FromGitter<kayabaNerve> /compiler/modulepaths.nim getModuleName
14:29:31AraqI drink it as a kind of last resort
14:29:47FromGitter<kayabaNerve> Araq: If I want to have a symbol correlate to the project directory for imports, so I'm not constantly using ../../, is getModuleName the best place to do that?
14:29:54stefanos82but it's good...anyway, I will buy you some local beer to taste then
14:31:08stefanos82I can't find such proc
14:31:29FromGitter<kayabaNerve> stefanos82: Talking to me? https://github.com/nim-lang/Nim/blob/master/compiler/modulepaths.nim
14:33:02FromGitter<kayabaNerve> @mratsim Do you think ~ is good since: ⏎ 1) It shouldn't work on Windows ⏎ 2) Few people keep source they directly import in their home dir (assuming it works on Linux anyways) ⏎ Or should I pick a more explicit symbol? [https://gitter.im/nim-lang/Nim?at=5b46151e9b82c6701bb5949a]
14:33:18Araqshashlick: can you work on the better --nimcache default?
14:33:32Araqit will make travis green as a nice sideeffect, I think
14:34:02FromGitter<kayabaNerve> Also looks like I actually want checkModuleName...
14:38:12FromDiscord<Epictek> @2vg request.path doesn't include the querys
14:38:52*nsf quit (Quit: WeeChat 2.1)
14:39:43FromDiscord<2vg> hmm,
14:39:44FromDiscord<2vg> Why do you want a query before being parsed?
14:45:41*PMunch quit (Quit: Leaving)
14:46:02stefanos82@kayabaNerve: yeah mate, I looked here https://nim-lang.org/docs/lib.html and could not find it anything. Araq, shouldn't getModule fetch getModuleName and point me at the right direction?
14:47:16FromGitter<kayabaNerve> getModuleName gets the symbol to import it as. ⏎ import File ⏎ import ../src/lib/File ⏎ It claims to be File and ../src/lib/File (no Nim) but it's referred to as just File. [https://gitter.im/nim-lang/Nim?at=5b4618740a17e01fccd809f9]
14:47:24FromGitter<kayabaNerve> *it appears to me to actually be just file.
14:48:00FromGitter<kayabaNerve> The full "canonical" path is checkModuleName according to the comments
14:55:17FromDiscord<Epictek> @2vg using jester to proxy some requests to an api
14:56:30FromDiscord<Epictek> https://0x0.st/sf6G.png
14:57:25FromDiscord<Epictek> Just sort of confused why I can't seemm to get the raw url used for the request, Flask allows me to do that
14:59:44*miran joined #nim
15:00:21FromGitter<tim-st> when I use `discard existsOrCreateDir("a/b")` in nim, is it required that a exists already?
15:00:34FromGitter<tim-st> at least it seems
15:01:31FromGitter<tim-st> ah, the docs say, parent dir must exists
15:03:24*Perkol joined #nim
15:04:56FromGitter<tim-st> `createDir` works how I assumed `existsOrCreateDir` works^^
15:08:40*miran quit (Quit: Konversation terminated!)
15:13:19*miran joined #nim
15:19:01*endragor quit (Remote host closed the connection)
15:19:11shashlick@mratsim: what do you mean by "proc should be exported" in the context of clblast?
15:34:20shashlickendragor: I do relative includes in nimgen - jyapayne improved it recently using curentSourcePath()
15:34:36*smt joined #nim
15:34:38FromGitter<mratsim> @shashlick, I want to see the proc signature like: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b46238d3c5abf52b64f2d3e]
15:37:31FromGitter<genotrance> do you mean you want to see the generated nim files in the repo?
15:37:32FromGitter<mratsim> in your wrapper, the proc generated are not in the github repo or available when you do git clone, it’s important for libraries
15:37:35FromGitter<mratsim> yes
15:37:57FromGitter<genotrance> cause all wrappers now have the generated nim and docs posted on http://nimgen.genotrance.com/
15:38:38FromGitter<genotrance> E.g. http://nimgen.genotrance.com/nimarchive/
15:39:57shashlicklinks are posted on each wrapper's github page
15:40:02shashlickdoes this meet your requirement?
15:41:04FromGitter<mratsim> I would prefer if it was at least in a .md file in the repo so that people can use their search function (from Github or VS code) to get the proc relevant to their type
15:41:20FromGitter<mratsim> a .nim file being the best
15:42:50shashlickso the docs along with source (in html and raw form) are on the site above
15:43:00shashlickif you click the source link it takes you to the html
15:43:01shashlickhttp://nimgen.genotrance.com/nimarchive/archive.nim.html
15:43:21shashlickremove the html and you can download the .nim file itself if you want
15:44:44FromGitter<mratsim> That’s too much friction. It should be directly in the repo
15:45:50shashlickAraq: i read the --nimcache conversation but unclear what's the requirement
15:50:39zacharycarterI keep getting this error in karax
15:50:57*zacharycarter sent a long message: < https://matrix.org/_matrix/media/v1/download/matrix.org/iXIrzSVKJiWBaJbVpJbXhYjH >
15:51:37zacharycarterhttps://gist.github.com/zacharycarter/f4aa62b06c156408e3bdecf13e4a7bea
15:52:30zacharycarterseems to happen when this event handler is invoked - https://gist.github.com/zacharycarter/f4aa62b06c156408e3bdecf13e4a7bea#file-welcome-nim-L6
15:59:14shashlick@mratsim: will have to think about that - i'm already up to 11 wrappers and keeping them up to date with generated source will get old fast
16:02:03FromGitter<mratsim> My use case is not to keep them updated with upstream but to fix to a specific version and only expose functions that are deployed in common windows/homebrew/linux distros
16:02:38FromGitter<mratsim> Also I wrap a lot of library, and it’s important to be able to git clone and have everything needed in the repo
16:03:15FromGitter<mratsim> and for prospective devs that want to use the library they should be able to see from the Github repo what is wrapped and what it looks like
16:03:34shashlickokay so instead of staying up to date with the upstream repo, you want to stay with a particular version
16:03:39FromGitter<mratsim> yes
16:03:44shashlickis using nimble with tags not good?
16:04:04shashlickwell, actually that only tags the nimgen wrapper repo, not upstream
16:04:07shashlicki need to look into that
16:04:19shashlickto tag to a particular version of upstream
16:05:21shashlickneed to think of a way to accomplish snapshots in an automated fashion
16:07:41FromGitter<mratsim> If you look into how I wrapped nimblast, I go brute force way. I remove offending procs after the fact: https://github.com/numforge/nim-clblast/blob/master/clblast_nimgen.cfg#L65
16:17:15*donlzx quit (Quit: Leaving)
16:27:40shashlickokay I agree there's value in being able to stabilize on particular version of a wrapper + upstream
16:28:15shashlicki think nimble already solves this for pure nim packages but need a way to do the same for nimgen
16:31:15dom96zacharycarter: my guess is: setForeignID (or whatever the function is called) on the editor element should fix it
16:31:40dom96also, why are you creating the editor every time the DOM is rendered?
16:32:15dom96Epictek: the fact that you can't do this sounds like a bug to me, please report it.
16:32:28shashlick@mratsim: https://github.com/genotrance/nimgen/issues/21
16:48:00*nsf joined #nim
16:49:31*Perkol quit (Ping timeout: 244 seconds)
16:54:32*chemist69 joined #nim
17:00:17chemist69style guide question: I have a sequence type that can either contain some values or no values.
17:00:25chemist69would you rather use (A) the uninitialized seq (nil), (B) an empty sequence or (C) an Option type (from the options module) for the no-value case?
17:02:39dom96B
17:03:52chemist69Ok, thanks dom96.
17:09:48*Perkol joined #nim
17:10:56zacharycarterdom96: thanks - hrmmm I thought that would just be called after the setRenderer call - I didn't realize it was called after every render, but that makes sense. thanks for pointing that out!
17:14:34*ng0 quit (Remote host closed the connection)
17:15:09*ng0 joined #nim
17:30:53FromGitter<Bennyelg> Hey all
17:31:04FromGitter<Bennyelg> What do I miss here: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b463ed826aa91065e89db1b]
17:31:18FromGitter<Quelklef> what do you mean? What's wrong? is there an error?
17:32:31*miran quit (Quit: Konversation terminated!)
17:35:25FromGitter<Bennyelg> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b463fdc641ecc065f98bc30]
17:36:22FromGitter<Quelklef> uh
17:36:34FromGitter<Bennyelg> Heheh
17:36:35FromGitter<Quelklef> the line `var c: ConnectionT (cur: T.open("test.db", nil, nil, nil))` makes no sense
17:36:40FromGitter<Bennyelg> I know
17:36:44FromGitter<Quelklef> > >
17:37:00FromGitter<Quelklef> ...Why did you put it, then?
17:37:01FromGitter<Bennyelg> I am trying to figure out how I am opening connection by the type I gives
17:37:10FromGitter<Bennyelg> it's result of playing
17:37:13FromGitter<Quelklef> hmm
17:37:19FromGitter<Bennyelg> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b46404fc02eb83d7c696ad3]
17:37:21FromGitter<Quelklef> It's still wrong in that case
17:37:40FromGitter<Quelklef> it should be `var c: Connection[T] = ConnectionT (cur: T.open("test.db", nil, nil, nil))`
17:37:47FromGitter<Quelklef> or just `var c = ConnectionT (...)`
17:38:02FromGitter<Quelklef> You just did `: ` instead of ` = `
17:40:55FromGitter<kaushalmodi> Can someone help understand the reason this test on PR https://github.com/nim-lang/Nim/pull/8282 is failing: https://travis-ci.org/nim-lang/Nim/jobs/402708022
17:41:14FromGitter<Vindaar> @Bennyelg aside from what @Quelklef is already saying: if you want to hand an actual type, your proc signature is wrong: ⏎ ⏎ ```proc initializeConnection*(db_type: typedesc): Connection =``` ⏎ ⏎ and then you'll see the issue Quelklef is talking about [https://gitter.im/nim-lang/Nim?at=5b464139897d514b3c442442]
17:41:47FromGitter<Vindaar> from there just use `db_type` instead of `T`
17:42:17FromGitter<Bennyelg> I don't know what is typedesc :O
17:42:34FromGitter<Quelklef> It's the "type type"
17:42:43FromGitter<Quelklef> it signifies that the value given represents a type
17:43:07FromGitter<Bennyelg> oh pretty handy
17:44:31FromGitter<Bennyelg> but it still not working ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b4641fe1c0f906b14489f16]
17:44:55FromGitter<Quelklef> no
17:45:20FromGitter<Bennyelg> in-light me :D
17:45:47FromGitter<Quelklef> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b46424a1c0f906b14489fac]
17:46:01FromGitter<Quelklef> wait, nope
17:46:03FromGitter<Quelklef> nope nope
17:46:06FromGitter<Quelklef> hold on
17:46:12FromGitter<Quelklef> where are you getting the `open` proc from
17:46:44FromGitter<Quelklef> you need to do this:
17:47:33FromGitter<Quelklef> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b4642b51c0f906b1448a07a]
17:50:33FromGitter<xDotDash> there is a lot wrong with that snippet
17:50:59FromGitter<kayabaNerve> Nim doesn't store what folder it's being executed from?
17:51:32FromGitter<Quelklef> @xDotDash Mine?
17:52:11FromGitter<Vindaar> I think this is what you want? ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ you can alternatively go the way @Quelklef showed in terms of no proc argument -> generic type [https://gitter.im/nim-lang/Nim?at=5b4643cb6534bc5d2e50f16d]
17:52:26FromGitter<Vindaar> which would be nicer here
17:52:28FromGitter<Vindaar> imo
17:52:36FromGitter<Bennyelg> @Vindaar no
17:52:38FromGitter<Bennyelg> this is wont work
17:52:52FromGitter<Vindaar> why not?
17:53:01FromGitter<Vindaar> it compiles anyways :P
17:53:30FromGitter<Bennyelg> Because I want it to be generic proc for any type of database
17:53:34FromGitter<Quelklef> Hm, was under the impression you can't use `typedesc` formal params to instantiate other paramters, cool
17:53:43FromGitter<Bennyelg> so when I intialize the variable I'll get it depends on my request
17:53:51FromGitter<Bennyelg> will get = get the DbConn
17:55:12FromGitter<Bennyelg> So I want something like let dbdb_postgres.DbConn (connection: Properties)
17:56:19FromGitter<Quelklef> should be `initConnection` to follow conventions
17:59:17FromGitter<Vindaar> So you want to be able to use two different kinds of types in the same module? If yes, then you're right. My example doesn't work, because the `open` call isn't resolved. If however you want to provide a generic interface, which works regardless of which sql module the user imports, it works
17:59:41FromGitter<Bennyelg> This is what Im trying to do.
17:59:55FromGitter<Bennyelg> I know i need generic but It seems I can make it right.
18:04:30FromGitter<Quelklef> Can you give us some feedback? Did you try my solution?
18:05:07*drazan joined #nim
18:07:41FromGitter<tim-st> is there a way to pass a proc p `proc (a, b: string): int`as ptr p ?
18:08:06FromGitter<tim-st> I tried addr(p) but didnt work
18:08:15FromGitter<kayabaNerve> Is it proc p?
18:08:28FromGitter<kayabaNerve> And why not just pass the proc?
18:08:44FromGitter<Quelklef> can you `var x: ptr proc(a, b: string): int; x[] = p`
18:09:32FromGitter<kayabaNerve> !eval proc p(a,b:string): int = result = 2; var a: ptr (proc (a,b:string): int); a = addr p; echo a()
18:09:33NimBotCompile failed: in.nim(1, 43) Error: type expected
18:09:50FromGitter<Bennyelg> @Quelklef Your solution not work.
18:09:55CodeVance@kayabaNerve politics/religion #nim-offtopic kthx XD
18:09:55FromGitter<tim-st> @Quelklef thanks, it works
18:10:02FromGitter<Quelklef> @Bennyelg And the error was?
18:10:04FromGitter<Quelklef> sure @tim-st
18:10:13FromGitter<kayabaNerve> CodeVance: I already was told that and stopped a while ago
18:10:16FromGitter<tim-st> I didnt know I have to create the proc at runtime
18:10:40FromGitter<Quelklef> @kayabaNerve oh, did you? sorry
18:10:42CodeVancekayabaNerve. I saw
18:10:55FromGitter<kayabaNerve> So why tell me that now?
18:11:01FromGitter<kayabaNerve> @Quelklef What's up?
18:11:13FromGitter<kayabaNerve> !eval type proc p(a,b:string): int = result = 2; var a: ptr proc (a,b:string): int; a = addr p; echo a()
18:11:14NimBotCompile failed: in.nim(1, 6) Error: identifier expected, but found 'keyword proc'
18:11:31FromGitter<Quelklef> @kayabaNerve Oh, I think I misunderstood you. NEvermind
18:11:32FromGitter<kayabaNerve> I'll get it to work first
18:11:33FromGitter<kayabaNerve> Yeah
18:11:35CodeVanceI saw afterwards
18:13:24FromGitter<kayabaNerve> Got it lol
18:13:35FromGitter<kayabaNerve> @tim-st Don't use pointers
18:13:37FromGitter<kayabaNerve> Use reg vars
18:13:37FromGitter<kayabaNerve> proc p(a, b: string): int = ⏎ ⏎ ```result = 2``` ⏎ ⏎ var a: proc (a, b: string): int ... [https://gitter.im/nim-lang/Nim?at=5b4648d19a612333aa56e221]
18:13:52FromGitter<kayabaNerve> That works, with proper tabbing, and can be assigned to any matching declaration
18:14:28*noonien quit (Quit: Connection closed for inactivity)
18:15:01FromGitter<tim-st> @kayabaNerve I imlement a wrap that want a ptr to a proc I cannot say I dont like it
18:15:19FromGitter<tim-st> @Quelklef Do you know why only `var` works and not `let` ?
18:15:36FromGitter<kaushalmodi> Can I get help understanding a Nim syntax in https://nim-by-example.github.io/arrays/
18:15:57FromGitter<kaushalmodi> What is `static[int]` called in: ⏎ ⏎ ```type ⏎ Matrix[W, H: static[int]] = array[1 .. W, array[1 .. H, int]]``` [https://gitter.im/nim-lang/Nim?at=5b46495dc2d95c60f4d032e7]
18:16:12FromGitter<Quelklef> @tim-st Yeah, `let` variables cannot be mutated. `[]=` is a mutation.
18:16:24FromGitter<Quelklef> @kaushalmodi What's the confusion?
18:16:54FromGitter<tim-st> @Quelklef I didnt use `[]=` I used `var p = ...` and passed `addr(p)`
18:16:57FromGitter<Quelklef> the `array[1.. W,<x>]`?
18:17:02FromGitter<kaushalmodi> If I have just `int` instead of `static[int]`, it does not work..
18:17:15FromGitter<Vindaar> @kaushalmodi `static` here refers to the fact that `W` and `H` are known at compile time
18:17:20FromGitter<kaushalmodi> so what is that "static[..]" called? so that I can learn more in manual
18:17:29FromGitter<Quelklef> Just look up static type
18:17:34FromGitter<Vindaar> Since the array size needs to be known at compile time, it cannot work without `static`
18:17:48FromGitter<Quelklef> @tim-st Dunno a lot about addr; I just suggested a possible different fix
18:17:58FromGitter<Vindaar> https://nim-lang.org/docs/manual.html#special-types-static-t
18:18:03FromGitter<kaushalmodi> I already read https://nim-lang.org/docs/manual.html#static-type_1, but couldn't link that piece with manual
18:18:07FromGitter<Quelklef> @Vindaar `[X: int]` is also just invalid, innit? Regardless of whether or not it actually needs to be static
18:18:08FromGitter<kayabaNerve> Just forked Nim to an org by accident :/
18:18:09FromGitter<tim-st> @Quelklef I think it's a bug that `let` doesnt work here
18:18:23FromGitter<kaushalmodi> @Vindaar Thanks!
18:18:30FromGitter<Quelklef> @tim-st If you think it's a bug, can you send me a minified gist real quick so I can take alook?
18:18:36FromGitter<tim-st> yes
18:19:03FromGitter<tim-st> https://gist.github.com/tim-st/07f3f4ae29b025ab7e3316d3b4134b9e
18:19:27FromGitter<Quelklef> Minified, my friend
18:19:28FromGitter<tim-st> line 2, var works, let doesnt
18:19:34FromGitter<Quelklef> Boiled down to its essential elements
18:19:44FromGitter<tim-st> it's only line 2
18:19:56FromGitter<tim-st> and line 3 last param
18:20:02FromGitter<Quelklef> it's because
18:20:17FromGitter<Quelklef> `addr` type is `procT (x: var T): ptr T`
18:20:25FromGitter<Quelklef> `addr` isn't defined for `let` variables
18:20:26FromGitter<Quelklef> not a bug
18:20:43FromGitter<tim-st> ah, ok, makes sense, but why isnt for `let`?
18:21:00FromGitter<Quelklef> If you want to use it on let, use `unsafeAddr`
18:21:00FromGitter<Quelklef> https://nim-lang.org/docs/system.html#unsafeAddr,T
18:21:16FromGitter<tim-st> ok, thanks for your help!
18:21:25FromGitter<Quelklef> But it has `unsafe` in its name, so I'd avoid it...
18:21:28FromGitter<Quelklef> No problem
18:21:31FromGitter<tim-st> yes^^
18:21:45FromGitter<tim-st> I already check exceptions, my code is safe
18:23:08dom96Checking exceptions doesn't make your code safe
18:23:12dom96This is about memory safety
18:23:38FromGitter<tim-st> but the wrapper code checks it and returns a success number
18:23:45FromGitter<tim-st> and I check the returning code
18:24:02FromGitter<tim-st> and it's defined in local scope
18:24:21FromGitter<kayabaNerve> ` ⏎ modulepaths.nim(123, 41) Error: type mismatch: got <TLineInfo> ⏎ but expected one of: ⏎ proc toFullPath(conf: ConfigRef; fileIdx: FileIndex): string ⏎ template toFullPath(conf: ConfigRef; info: TLineInfo): string ... [https://gitter.im/nim-lang/Nim?at=5b464b55b5efcd5aeef2b8f5]
18:24:22Yardanicowhy won't you just change "let" to "var"?
18:24:45FromGitter<tim-st> Yardanico: I did, but I prefer `let` when to show it's not changed
18:25:08Yardanico@tim-st but why do you need the address of `let` if you don't change it?
18:25:34FromGitter<tim-st> because the wrapper expects the addr of the proc, dunno why
18:26:09FromGitter<kayabaNerve> proc (a, b: cint): cstring {.cdecl.}
18:26:24FromGitter<kayabaNerve> If it's a Nim wrapper around C, and you must pass a proc, use that
18:27:07FromGitter<tim-st> how is this better?
18:27:13FromGitter<kayabaNerve> TBH, I haven't read that much, sorry. I suggested something similar earlier and others have been helping you. Justt trying to help again
18:27:38FromGitter<kayabaNerve> When you use proc as a type for a var, it is a function pointer
18:27:40FromGitter<tim-st> ok, thanks, just thought there is something about cstring
18:27:47FromGitter<kayabaNerve> When you use it with C, just cdecl everything
18:28:03FromGitter<kayabaNerve> No. cint/cstring is for passing to C. That said, string will autoconvert to cstring.
18:29:18dom96nope
18:29:40FromGitter<kayabaNerve> ?
18:29:40dom96that's why you need to take `addr str[0]`
18:29:50dom96string -> cstring isn't implicit
18:30:08FromGitter<kayabaNerve> That works too but I'm 99% sure I can pass a string to a function labelled cstring...
18:30:20FromGitter<tim-st> I always used "".cstring or $cstring
18:30:22FromGitter<kayabaNerve> I have code that does
18:30:28FromGitter<kayabaNerve> $cstring for the reverse
18:31:02FromGitter<kayabaNerve> proc test(a: cstring): bool = ⏎ ⏎ ```result = true``` ⏎ ⏎ var b: string = "abc" ... [https://gitter.im/nim-lang/Nim?at=5b464ce5897d514b3c444ecd]
18:31:09FromGitter<kayabaNerve> dom96: That works on the Nim playground
18:31:17FromGitter<kayabaNerve> Outputs true
18:31:28dom96Interesting. Maybe I got it the wrong way around myself :)
18:31:44Yardanicodom96, it's converted implicitly
18:31:47Yardanicodom96, https://github.com/nim-lang/Nim/blob/devel/lib/system/widestrs.nim#L117 and line 122
18:32:22Yardanicoif you do a newWideCString with string, newWideCString(s: string) will be called and it will call newWideCString(source: cstring, L: int)
18:34:33FromGitter<kayabaNerve> dom96 Pretty sure I own everything you used to own know
18:34:50FromGitter<kayabaNerve> Something something beat a Nim developer on a trivial thing, get all their stuff?
18:35:00FromGitter<kayabaNerve> The UN passed it last month...
18:36:18zacharycarteris there any good way to execute code once the vdom has been built in karax?
18:37:25zacharycarterother than using runLater ?
18:37:30zacharycarterother than using `runLater` ?
18:41:40FromGitter<kayabaNerve> So if I compile from Desktop, and I'm compiling Desktop/src/main.js, and I have another Nim file in Desktop/lib/ (say test.nim), instead of ../lib/test.nim, I can now use ~/lib/test.nim. Fun.
18:44:40FromGitter<kayabaNerve> And it still has compatibility with ../, folder.file, ./folder/file
18:44:52FromGitter<kayabaNerve> No idea if it works on every OS yet. Anyone here on Linux want to do me a favor?
18:47:10FromGitter<kayabaNerve> Here's the link if anyone wouldn't mind testing this for me: https://github.com/kayabaNerve/Nim
18:48:04FromGitter<Quelklef> I'm on linux. What am I testing?
18:48:30FromGitter<kayabaNerve> My edited Nim compiler
18:48:35FromGitter<kayabaNerve> If you're compiling src/main
18:48:45FromGitter<kayabaNerve> And have a file in lib/ called test (lib/test.nim)
18:49:14FromGitter<kayabaNerve> Instead of writing ../lib/test.nim (relative to the location of main.nim), you can now write ~/lib/main.nim which will work off wherever the compiler was called from
18:49:34FromGitter<Quelklef> oh, cool!
18:49:52FromGitter<Quelklef> does it require it just be in src/, or be a part of a nimble package?
18:50:17FromGitter<kayabaNerve> `import ~/file.nim` will import file.nim in the directory you called it from
18:50:20FromGitter<kayabaNerve> use it however you want
18:50:26FromGitter<kayabaNerve> I just want to confirm it works on Linux
18:50:33FromGitter<Quelklef> Wait
18:50:34FromGitter<kayabaNerve> Then I'll make a PR
18:50:44FromGitter<Quelklef> I'm not quite understanding
18:50:57FromGitter<Quelklef> The path is relative to where I called `nim c` from?
18:51:01FromGitter<Bennyelg> @kayabaNerve are you a liberland citizen ?
18:51:06FromGitter<kayabaNerve> Relative, yes
18:51:12FromGitter<kayabaNerve> @Bennyelg Eligible and a volunteer
18:51:19FromGitter<Bennyelg> Add me :P
18:51:23FromGitter<Bennyelg> I want to join
18:51:28FromGitter<kayabaNerve> But from a file perspective, it's not relative. It's standard.
18:51:32FromGitter<kayabaNerve> Join what?
18:51:41FromGitter<kayabaNerve> How'd you find that out btw? Just my GitHub profile?
18:51:45FromGitter<Bennyelg> Ya
18:51:48FromGitter<Bennyelg> Organization
18:52:14FromGitter<Quelklef> @kayabaNerve Still seems strange, I'd expect the paths to be independent of "my" location. Anyway, I'll test in a sec
18:52:15FromGitter<kayabaNerve> What do you want me to add you to?
18:52:38Yardanicois "char name[16]; " in C is the same as array[16, char] in Nim?
18:52:40FromGitter<kayabaNerve> From a file perspective, currently import is relative to that file. This provides an OPTIONAL way to act relative to the project directory, without breaking existing functionality.
18:52:44Yardanico(it's in a struct)
18:52:47FromGitter<Bennyelg> I Applied for citizenship 1.5 year ago. still not respones
18:52:49FromGitter<kayabaNerve> Yardanico: Should be.
18:53:15FromGitter<kayabaNerve> @Bennyelg This is not for here. I already got chastised for talking politics
18:53:25FromGitter<kayabaNerve> Thanks @Quelklef
18:53:33FromGitter<kayabaNerve> Tell me if you need test files. I can send you a zip
18:53:34*Ven`` joined #nim
18:53:41dom96Bah, I missed --threads:on in TechEmpower benchmarks
18:54:29*chemist69 quit (Ping timeout: 260 seconds)
18:55:45FromGitter<kayabaNerve> How much of a difference does it make?
18:56:24*chemist69 joined #nim
18:58:35FromGitter<Quelklef> Working. There's an edge case when doing `~/filename.nim` instead of `~/filename`, though
18:58:49FromGitter<Quelklef> `~/one/one.nim` is interpreted as `~/one/one/nim`
18:59:17FromGitter<Quelklef> Dunno if that's because of you or not
18:59:33FromGitter<Quelklef> Worked fine for `~/top.nim`, though
18:59:51FromGitter<Quelklef> (or `~/top`, which also worked)
19:00:37FromGitter<kayabaNerve> https://github.com/kayabaNerve/Nim/commit/816f58b9869612d82707405513cd2b863b44ba4a
19:00:49*skrylar joined #nim
19:01:06FromGitter<Quelklef> hm, `~/~/~/~/top` works as well as `~/top`. Dunno if this is desired behavior or not
19:01:21FromGitter<kayabaNerve> There's the commit. I delete all ~ and prefix it and set the current path to the root folder
19:01:34FromGitter<Quelklef> That feels iffy to me
19:01:49FromGitter<kayabaNerve> You can also do ////top or folder/../folder../
19:01:59FromGitter<Quelklef> blehhh
19:02:09FromGitter<Quelklef> Well, it's up to Araq/dom
19:02:18FromGitter<kayabaNerve> I don't touch the extension at all though
19:02:30FromGitter<kayabaNerve> Sounds like a bug to report.
19:03:25FromGitter<Quelklef> Wait, you have `m = m.replace(commandPrefix)` which is allowing `~/~/~/top` to work
19:03:45FromGitter<Quelklef> Anyway, I very much doubt this will ever lead to a real-world problem, so whatever
19:04:56FromGitter<kayabaNerve> Yeah. Is there a way to say only replace once:?
19:05:12FromGitter<Quelklef> just do
19:05:28FromGitter<Quelklef> wait, I think so
19:05:29FromGitter<Quelklef> hol on
19:05:43FromGitter<kayabaNerve> Not in strutils? I could just delete the first two chars...
19:05:49FromGitter<kayabaNerve> Or first one really
19:05:52FromGitter<Quelklef> (alternatively just do `if m.startswith(commandprefix): m = m[len(commandprefix) .. ^0]`
19:06:03FromGitter<kayabaNerve> Slice or delete?
19:06:08FromGitter<Quelklef> uh
19:06:13FromGitter<Quelklef> /shrug
19:06:22FromGitter<kayabaNerve> Lol
19:06:34FromGitter<Quelklef> slice because it's pure and performance isn't important here
19:08:59dom96kayabaNerve: A huge difference.
19:09:13dom96Case of using 1 core vs. 256 or something crazy like that
19:09:21FromGitter<kayabaNerve> dom96: Which one is better?
19:09:25FromGitter<kayabaNerve> I just added .delete
19:09:38FromGitter<kayabaNerve> `m.delete(0, 0)`
19:09:38dom96?
19:09:55FromGitter<kayabaNerve> I have to delete a single char from a string.
19:09:59FromGitter<kayabaNerve> That char is the first one.
19:10:46FromGitter<kayabaNerve> Quelkef suggested using [1 .. *end*]. strutils has a delete method. I just edited the code to contain `m.delete(0, 0)`. Should I have used a different method?
19:11:01FromGitter<Quelklef> I really don't think this is this important, man
19:11:20FromGitter<Quelklef> And if it is it'll prolly get caught in the code review before the PR is merged
19:11:24FromGitter<kayabaNerve> I don't either but then dom96 said it's a huge difference
19:11:33FromGitter<kayabaNerve> Yeah but it's my first and I really want to do well lol
19:11:36FromGitter<Quelklef> Was that referring to this?
19:11:51FromGitter<Quelklef> Oh, cool first!
19:11:55dom96I was referring to me missing --threads:on
19:11:57dom96Not anything else
19:12:00FromGitter<kayabaNerve> Oh lol
19:12:04FromGitter<kayabaNerve> Never mind
19:12:15FromGitter<kayabaNerve> You can no longer do ~/~/; submitting PR
19:12:18FromGitter<Quelklef> My only PR Araq said that one of my funcs is poor performance but I'm not sure how he wanted me to do it lol
19:12:21FromGitter<Quelklef> Nice
19:14:42Yardanicoah, so the main issue is that on delphi side it's "Name: packed array[0..15] of Char;" and apparently that's not the same as "name: array[0..15, char]" in Nim. (however C struct with "char name[16];" works correctly)
19:14:47Yardanicoprobably it's the alignment issue
19:15:37*nsf quit (Quit: WeeChat 2.1)
19:16:04FromGitter<kayabaNerve> https://github.com/nim-lang/Nim/pull/8285
19:16:11FromGitter<kayabaNerve> :D
19:16:32YardanicoIt works if I add "empty1, empty2, empty3: byte" to the Nim object, so yeah, that's an alignment issue
19:16:43Yardanicoor I just don't know C/delphi good enough
19:16:58dom96Lookup what `packed` means
19:17:05Yardanicoyeah, I did
19:17:18FromGitter<Quelklef> @kayabaNerve What's the use-case for this?
19:17:25Yardanicobut how the C code (which interfaces with the same library) uses simple "char name[16];" and still works?
19:17:25dom96Yardanico: Create a macro that does the same in Nim :D
19:17:48FromGitter<kayabaNerve> @Quelklef Getting rid of ../
19:18:21FromGitter<Quelklef> But, why are imports relative to cwd desirable over those relative to the nim file?
19:18:29FromGitter<Quelklef> Or when are they?
19:18:31FromGitter<kayabaNerve> Because of the level of nesting
19:18:53FromGitter<Quelklef> come again?
19:19:02FromGitter<kayabaNerve> My project, Ember, has all the code in the src/ directory. There's 6 folders in there. The Blockchain part, in the Merit folder, uses the Address code from Wallet folder.
19:19:10FromGitter<kayabaNerve> So that file must call ../Wallet/Address
19:19:17FromGitter<kayabaNerve> It'd just be nicer for me to say ~/Wallet
19:19:31FromGitter<kayabaNerve> Especially as these 6 folders will also have subfolders
19:19:34FromGitter<Quelklef> so you're doing `~/Wallet/Address` instead of `../Wallet/Address`?
19:19:37FromGitter<kayabaNerve> So then it's not one char; it's ../../
19:19:44FromGitter<kayabaNerve> Not once it has subfolders
19:19:58FromGitter<Quelklef> hm
19:20:06FromGitter<Quelklef> can't you just do `.../Wallet/Address`?
19:20:10FromGitter<Quelklef> But I see what you mean
19:20:12FromGitter<kayabaNerve> That's what I am doing
19:20:19FromGitter<Quelklef> It feels a little yucky to me though
19:20:24FromGitter<kayabaNerve> It's just another option. I prefer that when working between these 6 folders, and doing relative intrafolder.
19:20:32FromGitter<kayabaNerve> Wait
19:20:33FromGitter<Quelklef> Conceptually, what you want is not that it's relative to the cwd, but that's it's relative to the project root
19:20:33FromGitter<kayabaNerve> ... ?
19:20:36FromGitter<kayabaNerve> Does that work?
19:20:38FromGitter<Quelklef> What
19:20:41FromGitter<kayabaNerve> ...
19:20:44FromGitter<Quelklef> `.../Wallet/Address`? Maybe
19:20:46FromGitter<Quelklef> try it!
19:21:08FromGitter<kayabaNerve> When there's increased subfolders, it'll go from one char and me just disliking it to a mess of a dots and me disliking it
19:21:14FromGitter<Quelklef> sure
19:21:21FromGitter<kayabaNerve> The Wallet/Address works with the Blockchain; not under it
19:21:23FromGitter<Quelklef> but it feels like `~` should stand for project root, not cwd
19:21:31FromGitter<kayabaNerve> I compile from the project root
19:21:37FromGitter<Quelklef> but that's not a guarantee
19:21:44FromGitter<Quelklef> right
19:22:01FromGitter<kayabaNerve> NGL, I did write this for my use case. I wouldn't submit a PR if I didn't think others would like it, but it is based on me.
19:22:01FromGitter<kayabaNerve> The existing project root folders were bogus.
19:22:06FromGitter<Quelklef> you're just making sure that your implementation aligns with your concept by compiling from root dir
19:22:10FromGitter<Quelklef> hmmmm
19:22:19FromGitter<Quelklef> what do you mean the existing project root foders were bogus
19:22:29FromGitter<kayabaNerve> If I compiled from the Desktop, and compiled src/main.nim, all the existing projects vars said it was src/
19:22:50FromGitter<Quelklef> what is "it"?
19:23:11FromGitter<kayabaNerve> The project root
19:23:22FromGitter<kayabaNerve> It said it was the folder of the file I was compiling
19:23:31FromGitter<Quelklef> I mean
19:23:35FromGitter<kayabaNerve> So that means if I compile test/test.nim, the project root is test/
19:23:37FromGitter<Quelklef> I think `src/` typically is the name of the project root
19:23:44FromGitter<kayabaNerve> But that's now how it decides.
19:23:45FromGitter<Quelklef> wait,
19:23:56FromGitter<Quelklef> how are you finding out project root
19:24:14FromGitter<kayabaNerve> Nim compiler says it's the folder the file you directly compiled is in
19:24:20FromGitter<kayabaNerve> I say it's where you called the compiler from
19:24:20FromGitter<kayabaNerve> src/ <- Project Code ⏎ test/ <- Tests
19:24:26FromGitter<kayabaNerve> That's my structure
19:24:36FromGitter<kayabaNerve> Project root should either be / or src/
19:24:43FromGitter<Quelklef> Hmm
19:24:46FromGitter<Quelklef> Where's the nim compiler say that?
19:24:54FromGitter<kayabaNerve> But if I compile tests/test1.nim, the project path according to Nim is tests/
19:24:56FromGitter<kayabaNerve> In the config
19:25:08FromGitter<Quelklef> nim.cfg
19:25:08FromGitter<Quelklef> ?
19:25:20FromGitter<kayabaNerve> It has automatic values but I can override it
19:25:37FromGitter<kayabaNerve> I'm sure I can override it.
19:25:54FromGitter<kayabaNerve> @mratsim gave me a way to do what I wanted with no edits. His way wasn't optional though.
19:26:22FromGitter<kayabaNerve> He said declare the project root and then everything will assume that prefix
19:26:30FromGitter<kayabaNerve> I only want it optionally; more rarely than commonly
19:26:36FromGitter<Quelklef> hmmmm that feels more yucky
19:26:41FromGitter<Quelklef> I don't like either of these solutions
19:26:53FromGitter<kayabaNerve> I saw a need for this. I thought others may like it. Once I wrote it, I submitted a PR for this optionally use edit that doesn't change any existing behavior.
19:27:03FromGitter<Quelklef> yeah
19:27:17FromGitter<Quelklef> I just see it causing potential issues personally
19:27:27FromGitter<Quelklef> esp if someone is editing on commandline
19:27:35FromGitter<Quelklef> Then they're gonna `cd` into the non-project-root
19:27:40FromGitter<Quelklef> in order to edit
19:27:45FromGitter<kayabaNerve> Then they could set a config var
19:27:47FromGitter<Quelklef> and then suddenly `~` is wrong
19:27:55FromGitter<kayabaNerve> So override it with a cfg file :P
19:28:09FromGitter<Quelklef> Wait, I'm not super hip to cfgs
19:28:22FromGitter<Quelklef> With a cfg file can I declare a project root
19:28:26FromGitter<Quelklef> and then `~` will refer to that
19:28:45FromGitter<kayabaNerve> I think so. Not too sure tbh. I didn't test that.
19:28:51FromGitter<Quelklef> hmmm
19:28:59FromGitter<Quelklef> If that works, that'd be super cool
19:29:06FromGitter<kayabaNerve> I'll check
19:32:03FromGitter<kayabaNerve> Invalid cli option
19:32:10FromGitter<kayabaNerve> So needs another comment :P
19:32:22FromGitter<Quelklef> ?
19:32:47FromGitter<kayabaNerve> *commit
19:32:56FromGitter<kayabaNerve> nim.cfg(1, 1) Error: invalid command line option: '--commandPath'
19:33:40FromGitter<Quelklef> Unrelated, but @dom96 does the parser require assignment after a `let` declaration? Is `let x` valid syntax? I can never tell when something is a parser error or something else.
19:34:06dom96!eval import macros; dumpTree: let x
19:34:07NimBotCompile failed: in.nim(1, 26) Error: expression expected, but found 'keyword let'
19:34:13dom96parser error
19:35:14FromGitter<Quelklef> Thanks. How can I differentiate them?
19:36:33FromGitter<Quelklef> Oh, because that program would have succeeded if it weren't.
19:38:45zacharycarterit'd be super nice if karax emitted some kind of event after the vdom was rendered for the first time
19:38:52zacharycarterso you could run some kind of initialization code
19:41:14*Trustable quit (Remote host closed the connection)
19:42:20Araqzacharycarter: just add a flag to your clientPostRenderCallback
19:42:29Araqso that it's a nop after its first call
19:43:47zacharycarterokay thanks Araq
19:45:00shashlickAraq: you mentioned the --nimcache change in the morning - is there already an issue or can you please explain what you need?
19:53:58FromGitter<kayabaNerve> @Quelklef https://github.com/nim-lang/Nim/blob/master/compiler/commands.nim
19:54:04FromGitter<kayabaNerve> That file would have to be edited too
19:54:39FromGitter<kayabaNerve> That's the next step and a feature I'd probably use. I'll get started
19:54:44FromGitter<Quelklef> :D
20:00:38*rokups quit (Quit: Connection closed for inactivity)
20:01:20AraqkayabaNerve: stuff like that requires an RFC unless the BDFL does it
20:01:58Araqand I don't want you to write your imports relative to ~, it's unnecessary
20:05:53stefanos82let's give a new meaning to BDFL: Best Dancer For Life
20:06:32FromGitter<Quelklef> bourbon drinker & food lover
20:07:20stefanos82oh...I like this one even more!
20:07:56Araqfeatures need to pull in their weight
20:08:18Araqand ideally Nim should get simpler.
20:08:23CodeVancewhat are the out and in keywords used for?
20:08:23CodeVanceand also interface
20:08:36Araq`in` is a binary operator
20:08:43Araqout and interface are currently unused
20:10:13FromGitter<kayabaNerve> Araq: ⏎ 1) What's BDFL? ⏎ 2) This makes my work simpler, doesn't break existing cases, and I believe it may help others. If I didn't the third, I wouldn't have made a PR. Take it or leave it. ⏎ 3) Fair enough about pulling their our weight. This is minor. ⏎ 4) @Quelklef Yeah I can't figure how to make it a CLI option lol. [https://gitter.im/nim-lang/Nim?at=5b466425c02eb83d7c69dade]
20:10:31FromGitter<kayabaNerve> *Feel free to take it or leave it :)
20:10:36FromGitter<Quelklef> BDFL: Benevolent dictator for life
20:10:53FromGitter<Quelklef> @kayabaNerve Oh well, I didn't really need it anyway, it just felt wrong to do it the other way
20:11:22FromGitter<kayabaNerve> I don't mind if it gets used. Of course, I'd like it to, but it's not the biggest deal. That said, since it won't be used. I won't personally use it.
20:11:37FromGitter<kayabaNerve> *in projects I make public.
20:12:11FromGitter<kayabaNerve> Side note, how would I do an RFC?
20:13:17FromGitter<kaushalmodi> What is the cause of the stdlib_times.c errors for the last commit on devel and all the PR's based off that?
20:14:08Araqkaushalmodi: too much parallelism in the tester, I think
20:14:08FromGitter<kaushalmodi> Also that last PR is only a doc update
20:14:23Araqthere is a PR addressing that already...
20:14:38FromGitter<kaushalmodi> Oh, OK. Thanks.
20:18:38shashlickAraq: are you talking about this when you pinged me earlier - https://github.com/nim-lang/Nim/issues/8236
20:24:22*Perkol quit (Remote host closed the connection)
20:26:00skrylarit occurs to me that the tweening lib should probably include dampened springs
20:26:17skrylar(well, 'easing', since it just provides the curves and not the tweens)
20:27:52Araqshashlick: no, there is no RFC yet. please read today's logs a bit
20:28:02Araqthe point is that --nimcache should have a better default
20:28:27Araqlike $HOME/.cache/nim_$projectname_$relaseVsDebug
20:29:38shashlickokay so current default is same directory as the .nim file, it needs to change as above
20:29:53shashlickwhat about JS mode though? we put the resulting js file in nimcache today
20:30:01*skrylar wonder if the easing library should include interpolators :think:
20:30:04Araqyeah. this will also prevent these "parallel access to nimcache" bugs
20:30:07shashlickwill our users know that they need to dig out the js file from in ~/.cache?
20:30:14*chemist69 quit (Quit: WeeChat 1.9.1)
20:30:31Araqoh for JS it shouldn't be changed for now
20:30:35Araqgood point.
20:31:08shashlickin my mind, I feel the js file is effectively the output so it should be put where the output goes today
20:31:20Araqyeah true
20:31:21skrylarthis is true
20:31:54Araqbut it will break builds in a subtle way. hmm
20:31:56shashlicknimcache is for intermediate files, not the final result
20:32:39Araqyes, I agree
20:32:51shashlickwhy not a shared nimcache instead of a project specific sub-dir?
20:33:13skrylarthat doesn't always work out
20:33:59skrylarin the neural tts codebase i have some nims that have to be built with cpp and others with c, and the cache dir gets confused and spits out broken code between the two
20:34:14skrylar[this is to answer shashlick's questsion and is not an invitation to tell me how to do my job]
20:38:44shashlickokay so what's the benefit of this better default?
20:38:54shashlickcentralized and easier to delete?
20:39:02shashlickdoesn't seem to be any performance value
20:40:28shashlickaraq: to skrylar's point, can the nim compiler tell that the gcc compiled stdlib is different from the g++ compiled version?
20:41:58Araqshashlick: centralized and easier to delete, little need to override --nimcache
20:43:34*lompik quit (Ping timeout: 260 seconds)
20:44:18shashlickokay but are you okay with moving the js output to the output location as part of the change?
20:44:21shashlickwill break stuff yes
20:47:31*nsf joined #nim
20:55:07*Vladar quit (Quit: Leaving)
20:59:47Araqyeah I'm okay with it
21:00:24shashlickokay so be it
21:16:27*dddddd quit (Ping timeout: 240 seconds)
21:20:06*yglukhov[i] quit (Remote host closed the connection)
21:23:55*dddddd joined #nim
21:34:50*nsf quit (Quit: WeeChat 2.1)
21:44:46stefanos82Araq: I wanted to ask you mate. On what other projects are you working apart from Nim? I like reading other's code, it helps me gaining more knowledge and valuable techniques / methodologies
21:46:25Yardanicostefanos82, ormin and karax maybe? at least public ones
21:48:09*NimBot joined #nim
21:48:19*Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
21:48:28stefanos82Yardanico: nice!
21:49:38AraqI'm working on Nim v1 fulltime
21:50:44AraqI also have 2 or 3 DSLs I will create for Nim. Eventually.
21:51:20Araqa parser generator among them.
21:51:31stefanos82Nim v1 == mind blowing!
21:53:46stefanos82btw Araq, does Nim uses all available CPU cores during compilation?
21:53:59stefanos82*use
21:54:31*arecacea1 quit (Remote host closed the connection)
21:54:34skrylarwell. petitparser is easy
21:55:06*arecacea1 joined #nim
21:55:16skrylarhttp://pharobooks.gforge.inria.fr/PharoByExampleTwo-Eng/latest/PetitParser.pdf although i'm not sure how araq feels on pegs/packrats
21:56:30Araqit's crap. ;-)
21:57:06skrylari've had a lot of luck getting them to work on things, and a nightmare understanding the massive table-based ones
21:58:25*Ven`` joined #nim
21:59:02FromGitter<Quelklef> !eval let (x,_)=(0,0);var (_,y)=(0,0)
21:59:05NimBot<no output>
21:59:08FromGitter<Quelklef> Hmm
21:59:33ng0Araq: if you don't mind asking, how old were you when you started working on nim? A couple of people currently looking into nim as their language wanted to know this for whatever reason/curiosity
21:59:36stefanos82skrylar: yep...I'm pervert, every time I see a good looking PDF, it turns me on LOL!
21:59:41FromGitter<Quelklef> !eval let (x,\)=(0,0);var (_,y)=(0,0)
21:59:43NimBotCompile failed: in.nim(1, 8) Error: ')' expected
21:59:59*Ven`` quit (Client Quit)
21:59:59FromGitter<Quelklef> !eval let (x,_)=(0,0);var (_,y)=(0,0)
22:00:01NimBot<no output>
22:00:03FromGitter<Quelklef> Wth
22:00:15FromGitter<Quelklef> !eval let (x,___)=(0,0);var (___,y)=(0,0)
22:00:17NimBotCompile failed: in.nim(1, 9) Error: invalid token: _ (\95)
22:00:25FromGitter<Quelklef> I give up
22:01:24stefanos82Araq: are there any benefits of separating a compiler to two parts, the back-end and the front-end, so that the back-end could work as a background daemon?
22:01:43Araqng0, er... 23 or something
22:02:00FromGitter<Vindaar> @Quelklef what are you trying to do?
22:02:11ng0wow. okay, thanks :)
22:03:11FromGitter<Quelklef> @Vindaar !eval let (x,UNDERSCORE)=(0,0);var (UNDERSCORE,y)=(0,0)
22:03:19Araqskrylar, sure but we have macros, you should just be able to look at the produced high level code to debug stuff
22:03:20FromGitter<Quelklef> I unfortunately don't have access to a laptop right now
22:03:38FromGitter<Vindaar> @Quelklef yeah, it works fine with underscores, no?
22:04:05FromGitter<Quelklef> Wym? It does italics and escaping it didn't work
22:04:20FromGitter<Quelklef> Or rather I don't know how to properly escape markdown code
22:04:30FromGitter<Vindaar> on your first try it simply returned `<no output>` because there's no output. And Gitter just eats the `_` to produce italics I believe (but the raw data is handed to `NimBot` just fine
22:04:35FromGitter<kaushalmodi> @Quelklef works fine
22:04:40FromGitter<kaushalmodi> (https://files.gitter.im/nim-lang/Nim/Pz7h/image.png)
22:05:22FromGitter<Quelklef> Fantastic thank you @kaushalmodi
22:05:32FromGitter<Quelklef> Single underscore is a special name then?
22:05:37FromGitter<kaushalmodi> yes
22:05:45FromGitter<Quelklef> I see
22:05:55FromGitter<kaushalmodi> whatever is assigned to it is thrown away
22:06:08FromGitter<kaushalmodi> it's used as a placeholder for variable that you don't plan to use
22:06:16FromGitter<Quelklef> Right
22:06:26skrylarAraq, i think part of the problem is that the table systems often don't match up with the way code normally looks to a person
22:06:29FromGitter<Quelklef> I've seen it before just didn't know Nim had it
22:06:49FromGitter<Vindaar> Ahh! For some reason I thought you knew about `_` and were confused about something else :)
22:06:59skrylarthere's a lot of fiddling with the syntax to get the L{whatever}'s to obey without shift/reduce conflicts
22:07:05Araqscanp almost got it right, except for the DSL part
22:07:15FromGitter<Quelklef> Haha @Vindaar nope!
22:08:01Araqsadly nobody took it and reworked it. instead we'll have much better pegs soon.
22:08:33skrylar... so is the problem that pegs are bad, or the module is bad, or you just don't like that one particular implementation
22:08:57FromGitter<kaushalmodi> @Quelklef Here's one of the common uses: https://scripter.co/notes/nim/#writing-files (second code snippet.. *ignore the red highlighting.. Go Chroma syntax highlighter needs to detect `_` as valid identifiers*)
22:09:14*Jesin joined #nim
22:10:18FromGitter<Quelklef> Can't read it on my phone, the formatting is all messed up
22:10:53Araqskrylar, anything that doesn't use a lexer/parser split is bad in my opinion
22:11:08Araqpegs are nice as an alternative to regexes
22:11:19skrylarnothing stops you from using a separate lexer with a peg '_'
22:11:20Araqbut I want my grammars to work on real tokens
22:11:28FromGitter<kaushalmodi> > the formatting is all messed up ⏎ ⏎ Argh..let me guess.. using Safari?
22:11:57skrylarpetitparser i think can use literally any inputs, you just put in a different combinator at the bottom
22:12:00FromGitter<kaushalmodi> I'm not a webdev.. something that I am doing with font subsetting doesn't work on Safari, but works on Firefox/Chroma
22:12:02Araqskrylar, true but not supported by Nim's pegs module
22:12:18skrylarthat's because *that module* sucks :^)
22:12:24Araqnor by Lua's which was the major source of inspiration
22:12:49*jamesroseman joined #nim
22:12:50skrylarneed to dig out the pp and pp2 papers from the archives and look at them again; i think they're just a handful of functions
22:12:57skrylarwith bookmark and seek triggers
22:13:37AraqI also like this hole NFA -> DFA -> hopcroft's optimizer pipeline to produce lexers matching hand crafted ones
22:13:57skrylarnot familiar with hopcroft. i think i had a paper on the nfa/dfa thing though
22:14:03skrylarno idea where that one went
22:14:16Araq*this whole
22:14:25Araqlol, I will never get whole vs hole right...
22:14:33skrylarthe whole hole :)
22:14:56skrylarthe more languages in total a person speaks it seems the more they are allowed to be wrong in any of them
22:15:17Araqthe thing is
22:15:29*riidom quit (Ping timeout: 248 seconds)
22:15:33Araqas my spoken English improved my writing declined.
22:16:14Araqmy brain could easily write all the words I knew correctly, lacking knowledge of how to pronounce them
22:16:48Araqand now I'm as bad as John Q. Public
22:18:11skrylarat least we can beat up vala soon
22:28:47ldleworkskrylar: in what sense
22:29:22skrylarldlework, have been working on the gnome stack
22:29:30ldleworkinteresting
22:29:37ldleworksoon be able to do gnome ui apps with nim?
22:29:45skrylari don't know how soon of a soon that is
22:30:00ldleworkskrylar: people in #techcrap are probably interested in that work
22:30:31skrylarwe have fltk (i just got it in nimble) and haven't determined if its worth more effort, but it works. other than that, there's a -lot- of sloc to review
22:30:43skrylarmaybe 70% done with glib, have gobject fiddled with
22:35:04*ng0 quit (Quit: Alexa, when is the end of world?)
22:36:51*krux02 quit (Remote host closed the connection)
22:41:33Araqskrylar, thank you for submitting fltk, I'm eager to give it a try :-)
22:43:01skrylarits been around for quite a while :)
22:43:44Araqdoes fltk have a nice source code editor widget?
22:43:52skrylarit has the one nedit uses
22:44:05Araqhmm not sure what that means :D
22:44:37skrylari don't know if it had the popup/margin support like scintilla does, but it will do colored text and such
22:44:41skrylarprobably needs some care and attention though. looking through the one demo i cobbled for it, i forgot how fltk has all these weird niggles like if you don't set the font for a label then you just don't get one
22:48:43*gangstacat quit (Quit: Ĝis!)
22:48:54skrylartheres also no layout engine :F
22:49:20dom96Does it work on macOS? :P
22:52:13skrylaryes but its ugly
22:53:45skrylartrying to find an old library for layouts that i found but lost the name. it wasn't miglayout, was a bit simpler
22:55:47stefanos82dom96: should Nim functions work inside a nim.cfg or any .cfg file, or not?
22:56:18FromGitter<kaushalmodi> @Quelklef If you refresh that link (on phone), do you still see bad formatting (I'm guessing missing characters?)? What's your browser?
22:56:57dom96stefanos82: not
22:57:11dom96You can ask these questions to the channel, not directly to me. Others should know this.
22:57:31stefanos82so, in my case with #8236 that crashing was caused correctly or improperly?
22:58:14dom96a Nim crash is always a bug
22:58:14Araqthere are no "correct" crashes
22:58:40*Jesin quit (Quit: Leaving)
23:00:27*jamesroseman quit (Ping timeout: 240 seconds)
23:00:37stefanos82Araq: what I mean is that my probable incorrect way caused an unexpected behavior, thus the crashing whereas it should have returned a different message when such attempts occur
23:00:50Araqsure.
23:00:59Araqbtw within a .nims file you can use procs
23:01:16stefanos82yeah, inside .nims I know, because it's a nimscript
23:01:27stefanos82but inside .cfg we cannot, isn't that correct?
23:01:47Araqyes
23:02:14stefanos82so, is there a standard error message that I should have expected to be thrown at me? Something like "operation not permitted"
23:02:25*jamesroseman joined #nim
23:02:27Araq"invalid syntax", maybe
23:04:56stefanos82if an operation is not recognized, is it automatically associated with nil?
23:05:06Araqno.
23:05:41stefanos82that's interesting. Let me check something right away!
23:06:51*jamesroseman quit (Ping timeout: 240 seconds)
23:08:30stefanos82Araq: OK, I removed getCurrentDir() from nimcache and attempted to compile it and got the following message: nim.cfg(3, 1) Error: identifier expected, but found '[EOF]'
23:08:34stefanos82I guess this should be the expected
23:18:46stefanos82Araq, a naive question please. What compiles the C code behind the scenes? Nim or a build mechanism, such as make and so forth?
23:19:32AraqNim uses osproc.nim and calls the C compiler directly
23:19:41stefanos82ah I see
23:23:30stefanos82where is osproc.nim exactly and stupid GitHub cannot find it?
23:24:48Araqit's a stdlib module
23:25:00stefanos82nevermind, i found it the standard way lol
23:25:14stefanos82all I did was to go to documentation and press source to take me there
23:25:24stefanos82bloody hell, GitHub got shittier
23:26:15Araqjust like the Alien movies
23:28:03*gangstacat joined #nim
23:30:20stefanos82Araq: I think Alien movies are simpler and easier to understand
23:37:43stefanos82btw Araq, since you have a lot more experience than me with programming, when you add a copyright with a date, should it be only the starting year, like 2015 or something like 2015 - present?
23:38:48Araqafaik it doesn't matter, but you must not touch the lower bound later
23:39:11Araqso don't do 2015 and then edit it to 2018
23:39:41stefanos82yeah that's why I prefer the second suggestion, that is 2015 - present
23:39:50Araqyeah
23:40:06stefanos82so I guess when you first added a file, let's say in 2015 it was the initial time you first released it
23:40:12stefanos82and can be applied to this day
23:40:42stefanos82and older files that you created when you first started Nim should have older dates
23:40:49stefanos82I mean...I hope!
23:45:57FromGitter<Quelklef> @kaushalmodi yeah mobile safari. Still broken
23:49:36FromGitter<kaushalmodi> And if you can confirm, it works fine on Firefox, right?
23:55:48*BitPuffin quit (Remote host closed the connection)