<< 09-05-2017 >>

00:01:46*yglukhov_ joined #nim
00:03:44*yglukhov quit (Ping timeout: 240 seconds)
00:16:12*def-pri-pub quit (Quit: leaving)
00:19:27*subsetpark quit ()
00:19:39*subsetpark joined #nim
00:20:26*ftsf_ joined #nim
00:38:42*zachcarter quit (Quit: zachcarter)
01:19:22*yglukhov_ quit (Remote host closed the connection)
01:22:23*brson quit (Quit: leaving)
01:26:29*chemist69 quit (Ping timeout: 245 seconds)
01:40:18*chemist69 joined #nim
02:05:09*kier quit (Remote host closed the connection)
02:10:24*kier joined #nim
02:58:57*ftsf_ quit (Ping timeout: 268 seconds)
03:15:19*jsgrant_om joined #nim
04:07:41*xaxisx quit (Read error: Connection reset by peer)
04:09:37*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
04:23:27*BennyElg quit (Remote host closed the connection)
04:24:00*BennyElg joined #nim
04:28:37*BennyElg quit (Ping timeout: 272 seconds)
04:29:29*gangstacat quit (Quit: Ĝis!)
04:43:42FromGitter<maiermic> @yglukhov which version of SDL2 is Nim expecting?
05:07:00*zachcarter joined #nim
05:54:37*Sentreen quit (Ping timeout: 240 seconds)
05:54:59*gokr joined #nim
05:58:28*zielmicha_ quit ()
05:58:54*zielmicha_ joined #nim
06:07:56*Sentreen joined #nim
06:09:39*Tiberium joined #nim
06:12:45*yglukhov joined #nim
06:13:34*Sentreen quit (Ping timeout: 260 seconds)
06:17:13*yglukhov quit (Remote host closed the connection)
06:18:15*Arrrr joined #nim
06:26:04*ftsf_ joined #nim
06:26:09*Sentreen joined #nim
06:30:54*ftsf_ quit (Ping timeout: 264 seconds)
06:32:36*nsf joined #nim
06:34:46*BennyElg joined #nim
06:35:07*BennyElg quit (Remote host closed the connection)
06:35:28*BennyElg joined #nim
06:37:09*Tiberium quit (Remote host closed the connection)
06:42:07*Sentreen quit (Ping timeout: 240 seconds)
06:47:53*rauss quit (Quit: WeeChat 1.7.1)
06:50:54*BennyElg quit (Remote host closed the connection)
06:51:13*BennyElg joined #nim
06:55:31*Sentreen joined #nim
07:04:01*Vladar joined #nim
07:11:11*Arrrr quit (Ping timeout: 255 seconds)
07:11:15Araqhttp://jacksondunstan.com/articles/3860 for the 'ref object' lovers out there ;-)
07:16:33*gangstacat joined #nim
07:27:37ftsfAraq, so it's saying refs are slow?
07:27:57ftsfand you should just have a seq[object] instead of seq[ref object] ?
07:28:16Araqyeah, but don't take it to mean "use ptr instead"
07:28:27ftsf*nods* yeah
07:29:20ftsfi should really profile my game
07:33:26*xet7 quit (Quit: Leaving)
07:35:29Araqthat's the nice thing, most profilers don't show "waiting for RAM", it's just 30x slower with no obvious bottlenecks :P
07:39:57ftsfhmm most time spent in toCint inside my blitter.. that's bad =)
07:43:01*yglukhov joined #nim
07:43:09*yglukhov quit (Remote host closed the connection)
07:43:21*yglukhov joined #nim
07:55:05*chemist69 quit (Ping timeout: 272 seconds)
08:09:41*peted quit (Ping timeout: 255 seconds)
08:13:05*chemist69 joined #nim
08:15:52*Arrrr joined #nim
08:17:29*Vladar quit (Remote host closed the connection)
08:24:58*vlad1777d joined #nim
08:41:04*vlad1777d quit (Remote host closed the connection)
09:00:33*BennyElg quit (Remote host closed the connection)
09:02:21*BennyElg joined #nim
09:12:32*peted joined #nim
09:13:28*Vladar joined #nim
09:14:57*couven92 joined #nim
09:21:10federico3yes zachcarter
09:33:06couven92Araq, for IDE support, is there a way to get the compiler to report defined symbols? In order to do sth. VS does in C++, where preprocessor blocks are marked as active or inactive?
09:34:27couven92or would IDE support have to generate a temporary nim file behind the curtains that does sth like `when defined(x): echo "x defined"`
09:35:58couven92Because ideally, I would like to be able to hover over the symbols in a when statement and get a tooltip that tells me if (and if possible where) a when-symbol is defined
09:38:08couven92E.g.: I currently have a nim code file open in VS Code, and there is a when block that checks against `Windows` (with capital W). Since the W is capilatized, VS Code simply marks that as a class identifier instead of realizing that we are actually checking against a built-in compiler pre-processor symbol
09:38:48*xet7 joined #nim
09:43:26Araqcouven92: so? write 'windows' like the rest of us
09:43:47Araqyou seem to talk about 2 to 3 different things at once
09:44:29couven92sry... the Windows thing with capital W was in the OpenSSL implementation in stdlib, i.e. not my code (of course I'd write that in lowercase!)
09:44:58*Vladar quit (Quit: Leaving)
09:50:43*zachcarter quit (Quit: zachcarter)
10:00:05*chemist69 quit (Ping timeout: 240 seconds)
10:04:49*chemist69 joined #nim
10:06:51couven92ok, but is there an easy way to get defines out of nim/nimsuggest
10:07:54Araqin theory nimsuggest outputs lexing hints and conditional symbols are handled like anything else
10:08:10Araqin practice maybe I forgot about them when writing the code
10:11:59couven92ah, okay... because I noticed that the nimsuggest output simply ignores inactive when blocks... i.e. errors in an inactive block are not discovered and you get no information about them...
10:13:10couven92I get why this is so... But I find the lexing and linting of inactive preprocessor blocks in C++ in VS very useful when writing cross-platform stuff
10:15:37couven92But... it's probably difficult to handle, because you'd get multiple code units for each file, so you'd have to go three rounds through each file and each when stmt (one for when discovery, and one each for true and false condition)
10:17:13dom96hello all
10:19:16couven92dom96, hi there! :)
10:22:43dom96hey couven92, how are things?
10:23:35couven92I am happily shoving my work on my MSc. away to play with Nim, the Windows SDK and SSL! :D
10:23:58couven92I had a little break in between though, but I am working on it right now
10:24:48Araqcouven92: but that's a different topic.
10:25:05Araqwhen defined(windows): x else: y
10:25:34Araqnimsuggest can tell about 'windows' but either 'x' or 'y' is indeed not processed, no way to get information about it
10:27:56couven92Araq, can I run `nimsuggest -d:windows` or `nimgsuggest -u:windows`? (is that a bad idea :O )
10:28:13Araqnimsuggest --os:windows
10:28:33Araqthat's not a bad idea, that's why nimsuggest takes the same parameters as the compiler
10:30:51couven92right, I always forget that windows is not a usual define... Yeah, I thought so. Great, then we could get information about both `x` and `y`... Yeah, Araq that's a different topic, for some bizarre reason my brain multithreads with different problems. I was thinking about Nim integration into VS while I was coding... :P
10:32:00ftsfo/ dom96
10:32:16dom96hey ftsf! How's the game coming along? :)
10:32:37ftsfdom96, pretty good! got my gif encoding working, now i'm trying to improve the speed of my blitter code
10:32:48ftsfmaybe release very soon, waiting on some music
10:34:38dom96awesome! Any ideas when it will be up on Steam?
10:36:36ftsfwell it's greenlit, so whenever I get around to posting it there =)
10:36:50ftsfi'll do some private beta stuff first on itch.io to make sure it's all solid
10:43:48ftsfjust waiting on one more music track from the artist then should be good to beta release
10:44:15*Sentreen quit (Quit: WeeChat 1.4)
10:44:45dom96Cool. Can't wait to play the beta :)
10:46:04*Sentreen joined #nim
10:48:28dom96ftsf: Did you figure out that dead code elim issue?
10:49:38ftsfdom96, nope =(
10:50:27dom96If you've got a nice code sample that reproduces the problem then it might be a good idea to submit it as an issue to the Nim repo.
10:50:27ftsfthere's a weird bunch of situations that are required for it to happen, importing glm, returning a new seq var in a proc, as opposed to setting result
10:51:01ftsfhttps://gist.github.com/ftsf/62107e4a1d5a00462ead75dc4dd96cf8 this is the most minimal i've been able to get it
10:51:31ftsfboth paths work fine when using deadCodeElim:on, but copyPolyBroken returns incorrectly when deadCodeElim:off
10:51:43ftsfso very mysterious
10:52:03ftsfworks fine when I copy the relevant code from the glm module in. or when I use basic2d types instead
10:53:34dom96yeah, I think this deserves a bug report
10:53:51ftsfyep, not sure if it should be an issue with Nim or GLM
10:58:18Araqsame as https://github.com/nim-lang/Nim/issues/5756 ?
10:58:28Araqdoes glm use static T everywhere?
10:58:46ftsfAraq, that sounds about right, will go over the details.
10:59:20ftsfhttps://github.com/krux02/nim-glm/blob/master/glm/vec.nim glm seems to use static generic types
11:00:20ftsfevery 2nd item in the sequence was zeroed
11:02:23*Snircle joined #nim
11:17:18*zachcarter joined #nim
11:18:29*zachcarter quit (Read error: Connection reset by peer)
11:19:15*zachcarter joined #nim
11:30:10FromGitter<ephja> T(kind: a, y: 1) shouldn't compile if 'y' doesn't appear under the 'a' case, right?
11:49:21*krux02 joined #nim
11:54:23Araqyeah, and that's been implemented in a branch
11:54:33FromGitter<ephja> oh ok
11:57:03FromGitter<ephja> another issue involving sets: https://gist.github.com/ephja/0628ce8559d0aaa4cd5752aa84354d91
11:59:56FromGitter<ephja> I think it's a regression. do you know if it has been reported? I haven't found any relevant bug reports yet
12:04:48FromGitter<ephja> I wonder if I should try to fix it myself. None of the attempts at diving into the source have gone particularly well
12:08:44*chemist69 quit (Ping timeout: 240 seconds)
12:11:34*chemist69 joined #nim
12:17:10*PMunch joined #nim
12:18:46*Vladar joined #nim
12:20:10*zachcarter quit (Quit: zachcarter)
12:22:41FromGitter<cooldome> н
12:29:04*krux02 quit (Remote host closed the connection)
12:31:33PMunchI noticed something strange about sequences and linked lists the other day. I was writing a simple list of sorted tuples where one field was the id and the other was a proc. Intuitively a seq should be just a tad faster than a linked list (double linked in this case) simply because of cache locality and simplicity of traversal. But when I did some tests with it the linked list was actually faster, which surprised me a bit.
12:31:45*arnetheduck joined #nim
12:36:43*nsf quit (Quit: WeeChat 1.7.1)
12:40:41*Tiberium joined #nim
12:45:33arnetheduckAraq, https://github.com/nim-lang/Nim/pull/5712? the only fail is the broken windows test
12:52:21*Tiberium_ joined #nim
12:55:04*Tiberium quit (Ping timeout: 255 seconds)
13:05:25*Tiberium_ quit (Ping timeout: 272 seconds)
13:11:49*krux02 joined #nim
13:24:01*krux02 quit (Remote host closed the connection)
13:26:04*krux02 joined #nim
13:39:59*pie_ joined #nim
13:58:03*couven92 quit (Quit: Client disconnecting)
14:05:48*krux02 quit (Remote host closed the connection)
14:08:44*krux02 joined #nim
14:14:30*rauss joined #nim
14:15:24*chemist69 quit (Ping timeout: 240 seconds)
14:15:46*chemist69 joined #nim
14:35:00*Tiberium joined #nim
14:35:10*BennyElg quit (Remote host closed the connection)
14:35:48Tiberiumdom96, hi! how "choosenim" detects C compiler?
14:36:06dom96by looking in your PATH for 'gcc' or 'clang'
14:36:11Tiberiumbecause on my new system it says a warning "No C compiler found", but it works fine
14:39:17demi-how do we install `choosenim` currently?
14:39:22FromGitter<andreaferretti> @dom96 any chance you can fix https://github.com/dom96/choosenim/issues/9 ? without this I am wary of using choosenim because then I would not know how to upgrade
14:40:26dom96Tiberium: Can you verify that you have 'gcc' or 'clang' in your PATH?
14:40:42dom96andreaferretti: Yeah, will do.
14:42:04FromGitter<GULPF> I get that warning as well, and I have gcc
14:43:56dom96I'll look into that :)
14:44:28dom96demi-: https://github.com/dom96/choosenim#installation
14:45:06demi-if i git clone and nimble install, would that also work?
14:46:38dom96It should, but I haven't tested it
14:47:23*krux02 quit (Remote host closed the connection)
14:47:45Tiberiumdom96, sh-4.4$ whereis gcc
14:47:45Tiberiumgcc: /usr/bin/gcc /usr/lib/gcc /usr/share/man/man1/gcc.1.gz /usr/share/info/gcc.info.gz
14:48:12TiberiumI just used sh as the most basic shell, I'm using zsh myself
14:48:14FromGitter<BontaVlad> Hello everybody, I was looking for ways of parsing html files with xpath, I already looked at xmltree and htmlParse but I found no examples/ways to use xpath
14:48:22*krux02 joined #nim
14:48:22FromGitter<BontaVlad> My use case is webscraping
14:49:05FromGitter<BontaVlad> Or a wrapper over Libxml2 would be great
14:49:10dom96Tiberium: yeah, weird, not sure what the issue could be.
14:49:22dom96But IIRC it happened on my Linux server as well
14:50:10*Tiberium quit (Remote host closed the connection)
14:52:32*chrisheller joined #nim
14:54:10*PMunch quit (Quit: leaving)
14:54:13*nsf joined #nim
14:55:14chrishellerI'm using Nim to replace some old Python code that wrapped around some legacy C-based apps.
14:55:51chrishellerOne sticking point is that there are some callbacks from the C side that don't offer any extra parameter for context data.
14:57:23chrishellerThe python code was using ctypes to handle this by pointing the callback into a Python object that maintained the context, but I'm trying to figure out the best way to handle in Nim
14:57:42*Tiberium joined #nim
14:58:29Tiberiummaybe someone can at least point me to some workaround for this? https://github.com/nim-lang/nimsuggest/issues/61
14:59:52chrishellerI can't mark the Nim proc as .closure. because then it won't work with the C code. It seems like my Nim callback code needs to have some global variable that it can use to hold the context.
15:00:27dom96chrisheller: where does the Python object that maintains the context live?
15:01:00chrishellerInside Python classes
15:01:47*jsgrant_om quit (Remote host closed the connection)
15:02:35dom96okay, so you should create a Nim object to store the context in as well.
15:03:43chrishellerRight, but I can't get the C code to pass that object along when it invokes the callback
15:05:24chrishellerI guess I should look more closely at what ctypes is doing under the covers
15:06:33chrishellerGotta run, but will try to put together a gist that better explains this. I have a feeling that Nim can handle this, but I'm missing something
15:08:31yglukhovAraq: is it possible to get some unique symbol id so that equal names from different namespaces have different ids?
15:12:13dom96andreaferretti: fixed, you may wish to wait until I release a new version though
15:13:07FromGitter<andreaferretti> wow, that was quick! :-D
15:18:12FromGitter<andreaferretti> let me know when a new version is out
15:23:37*Tiberium quit (Remote host closed the connection)
15:26:32dom96will do
15:33:43FromGitter<ephja> {b, c} - {a} -> {1..2}, {b, c} -> {1, 2} ⏎ is this correct? it does cause problems with variant ⏎ discriminators in any case
15:36:16*Tiberium joined #nim
15:37:30*Tiberium quit (Remote host closed the connection)
15:37:33FromGitter<ephja> it probably is. doesn't matter, reporting now
15:38:03*Tiberium joined #nim
15:39:50*Tiberium quit (Remote host closed the connection)
15:40:25*Tiberium joined #nim
15:40:37*Trustable joined #nim
15:42:29*Tiberium quit (Remote host closed the connection)
15:42:59*Tiberium joined #nim
15:44:54*gokr quit (Ping timeout: 240 seconds)
15:59:25ftsfhmm is there a list files in a directory function other than walkFiles? ie. one that doesn't make use of glob
15:59:34ftsfas glob.h doesn't exist on android
16:00:39demi-there is probably `dirent.h`, which you should wrap easily
16:01:12*PMunch joined #nim
16:01:37ftsfthanks, i'll take a look
16:03:45demi-ftsf: actually that is part of posix https://nim-lang.org/docs/posix.html#DIR
16:04:43ftsf\o/
16:07:09demi-so, hopefully your android NDK/system implements that
16:07:16ftsflooks like it does
16:08:21ftsfthanks!
16:19:13*chemist69 quit (Ping timeout: 272 seconds)
16:21:41chrishellerHere's a gist showing what the Python code that uses ctypes for C callbacks does. https://gist.github.com/chrisheller/544c66e53d7bef38e3302d7db21cb705
16:22:11chrishellerVery contrived example :)
16:31:14*brson joined #nim
16:37:37*pie_ quit (Ping timeout: 240 seconds)
16:46:00*chemist69 joined #nim
16:55:18chrishellerIn case anyone cares, this seems to be where ctypes is doing the bulk of the callback work. https://github.com/python-git/python/blob/master/Modules/_ctypes/_ctypes.c#L3424
16:55:44*yglukhov quit (Remote host closed the connection)
17:05:25demi-chrisheller: is this calling from C -> Python?
17:06:33chrishellerYes, C callbacks where the logic was implemented in Python, but moving to Nim (hopefully).
17:07:09chrishellerBut the C callbacks don't provide for passing along any additional state, and unfortunately there is nothing I can do to change the C code.
17:08:01demi-so you can have nim proc exported with specific names so that you know what to call them from C
17:08:47chrishellerIt doesn't even need to be exported; just the function address is supplied to register the callback.
17:10:34demi-ah i see, i don't think there is a way to attach a nim object to be associated with a proc in the same manner that the python code works because it doesn't follow the same OOP model
17:11:19demi-if you use an intermediary proc, which would then call the one associated with the object, that would work
17:14:03chrishellerI think my next step is to look more closely at what Nim is doing under the covers with .closure. / .cdecl. to see if maybe I can come up with some combination of them
17:37:12*PMunch quit (Quit: leaving)
17:47:00*jsgrant_om joined #nim
17:47:14*yglukhov joined #nim
17:48:44FromGitter<cooldome> @yglukhov there is genSym is macros package, might work for you
17:51:32*yglukhov quit (Ping timeout: 255 seconds)
18:05:19*pie_ joined #nim
18:05:38*brson quit (Quit: leaving)
18:14:52*sz0 joined #nim
18:15:17*tankfeeder joined #nim
18:17:47*dddddd joined #nim
18:21:08*yglukhov joined #nim
18:23:35*brson joined #nim
18:35:54*tankfeeder left #nim ("Leaving")
18:52:14FromGitter<zacharycarter> yay my dockerfile to build frag for android works!
18:54:44*yglukhov quit (Remote host closed the connection)
18:55:15*kunev quit (Ping timeout: 240 seconds)
18:56:28*brson quit (Quit: leaving)
18:57:20*brson joined #nim
18:57:24*brson quit (Client Quit)
18:57:25*kunev joined #nim
18:58:45*gokr joined #nim
18:58:49*gokr quit (Client Quit)
19:06:26*yglukhov joined #nim
19:09:27*Matthias247 joined #nim
19:12:25FromGitter<Varriount> chrisheller: *closures* (not regular procedural types) are represented as a pair of pointers, one to the procedure, and one to the environment attached to the procedure.
19:12:50FromGitter<Varriount> Regular procedures are just a function pointer.
19:13:41chrishellerRight. I just need the environment pointer to magically appear when the C code calls the callback :)
19:14:09chrishellerI'm actually working on a template for this now.
19:16:49*couven92 joined #nim
19:21:03*brson joined #nim
19:22:24*Ven joined #nim
19:22:48*Ven is now known as Guest43623
19:27:24FromGitter<Varriount> You could store it in a global variable or table.
19:27:28*Guest43623 quit (Ping timeout: 268 seconds)
19:27:36FromGitter<Varriount> Though, that's a hack at best
19:27:38*Ven_ joined #nim
19:30:34*gokr joined #nim
19:34:00*Ven_ quit (Ping timeout: 245 seconds)
19:36:11*Ven_ joined #nim
19:45:07*Arrrr quit (Quit: Leaving.)
19:54:57*BennyElg joined #nim
19:56:16*brson quit (Ping timeout: 255 seconds)
20:02:03*brson joined #nim
20:04:19*Tiberium quit (Remote host closed the connection)
20:06:28*rauss quit (Quit: WeeChat 1.7.1)
20:13:54*Ven_ quit (Ping timeout: 240 seconds)
20:14:29*Ven_ joined #nim
20:14:32*rauss joined #nim
20:25:04*Vladar quit (Remote host closed the connection)
20:26:51krux02what is the command again to be able to debug the compiler?
20:27:04Araqdebug
20:27:17krux02./koch [???] temp ...
20:27:24krux02I would like to debug with gdb
20:28:04Araqthat is easy and misguided.
20:28:16demi-heh
20:28:20krux02I would like to have debug symbols in the compiler so I can run it in gdb
20:28:22*Ven_ quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
20:28:41Araqkoch temp --debugger:native
20:29:00Araqgdb nim_temp c foo.nim
20:29:18dom96and keep in mind that all koch does is just: nim c --out:bin/nim_temp compiler/nim
20:29:47krux02that seems a lot like the --debugger:native argument is for the nim_temp compiler
20:33:53krux02well thanks a lot it worked
20:34:03*krux02 quit (Remote host closed the connection)
20:36:37*Ven joined #nim
20:37:01*Ven is now known as Guest97635
20:58:48*Guest97635 quit (Ping timeout: 246 seconds)
21:02:12*Ven_ joined #nim
21:02:15*Trustable quit (Remote host closed the connection)
21:14:59*PMunch joined #nim
21:16:45*yglukhov quit (Remote host closed the connection)
21:18:05*Ven_ quit (Ping timeout: 255 seconds)
21:18:54*rauss quit (Ping timeout: 240 seconds)
21:19:51*rauss joined #nim
21:20:47*Ven joined #nim
21:21:10*Ven is now known as Guest85403
21:23:43*brson quit (Quit: leaving)
21:29:53*Guest85403 quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
21:31:20*zachcarter joined #nim
21:39:56*rauss quit (Quit: WeeChat 1.7.1)
21:43:21dom96Choosenim v0.2.0 is now out https://github.com/dom96/choosenim/releases/tag/v0.2.0
21:43:25dom96andreaferretti ^
22:01:54*nsf quit (Quit: WeeChat 1.7.1)
22:18:28*Matthias247 quit (Read error: Connection reset by peer)
22:25:07*chemist69 quit (Ping timeout: 240 seconds)
22:30:02*chemist69 joined #nim
22:31:20*ftsf_ joined #nim
22:33:36Calinouhi
22:33:56Calinoudom96: I'll try to run https://github.com/Calinou/benchmarks again soon, to see if it evolved over time :P
22:34:11Calinouit's been 9 months now
22:47:15*Sembei quit (Excess Flood)
22:48:22*Sembei joined #nim
22:52:55*Jesin quit (Quit: Leaving)
22:55:27*rauss joined #nim
23:17:21*yglukhov joined #nim
23:17:36*PMunch quit (Quit: leaving)
23:17:53*couven92 quit (Quit: Client Disconnecting)
23:21:45*yglukhov quit (Ping timeout: 240 seconds)
23:34:54*pie_ quit (Ping timeout: 240 seconds)
23:35:54*gokr quit (Ping timeout: 240 seconds)
23:36:11*Jesin joined #nim
23:57:40zachcarterhttp://imgur.com/a/tG3Lc
23:58:12ftsf_trying to addQuitProc(foo) where proc foo() = ... however it complains that type mismatch got (proc(){.locks:0.}) expected proc()