<< 24-01-2015 >>

00:00:00*brson quit (Ping timeout: 272 seconds)
00:00:23akiradeveloperSo we can segregate some kind of serious side-effects (like IO) by effect system like Haskell do it with type
00:03:55Araqexactly
00:07:13*BlaXpirit_ quit (Quit: Quit Konversation)
00:14:23*gsingh93 quit (Quit: Connection closed for inactivity)
00:17:49xAndydo i need ptr/ref types for dynamic dispatch to work propperly?
00:18:06flaviuNice, I was able to improve the performance of an allocation-heavy microbenchmark by 9% by just marking everything as inline!
00:18:32AraqxAndy: no, but if you have to ask this question, then yes.
00:18:38Mat4ciao
00:18:44Araqbyebye
00:18:49*Mat4 left #nim (#nim)
00:19:41EXetoCflaviu: lame optimizer :\
00:23:34flaviuWhy is markStackAndRegisters noinline? Getting rid of that increases performance by another percent or so
00:24:11flaviuBut forcing inline makes it slower.
00:24:44Araqbecause the optimizer must not inline it?
00:25:00Araqstack marking is fragile
00:30:18Araqargh .... I hate it that you have to 'not' the assert condition when you expand assert
00:30:46xAndyah so assigining an inherited object to a variable of the base class breaks dynimic dispatch. is this some kind of type slicing?
00:31:52xAndyor i am on the wrong track
00:32:27*fwef quit (Ping timeout: 264 seconds)
00:33:30Araqit slices and adapts the type tag appropriately
00:33:56AraqI think later versions will simply fail at runtime instead for slicing assignments
00:33:57xAndyi see
00:34:27Araqflaviu: can you elaborate on "LGPL and Nim"?
00:35:27flaviuIf I have a library that is LGPL, usage of that library requires that the user has the ability to replace or modify the library.
00:36:09flaviuBut various Nim features can result in inlining of library code in the non-free portion of the program.
00:37:06Araqby that logic LGPL'ed software cannot use C's #define
00:38:07flaviuQuoted from the LGPL: "data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length),"
00:38:28flaviuErr, forgot this important part: "then the use of the object file is unrestricted"
00:42:23Araqwhat if I compile things on an OS without dynamic linking support?
00:42:59Araqwhat if the programming language uses inlining for every function call? (yes, these do exist)
00:43:40xAndythe glory of "free software" and it's licenses
00:43:58Araqso LGPL is only valid for C code and even that has to be restricted. see "small inline functions"?
00:44:06flaviuI don't want this to turn into license bashing.
00:44:28Araqthe license sounds unusable.
00:44:45Araqwe don't need to bash it. it's surreal.
00:44:55flaviuAraq: Then reply to my post and say "the LGPL is unusable for Nim code".
00:45:14Araqno. it's unusable for pretty much everything.
00:45:41Araqwhat is a 'small' inline function? 3 lines or 5?
00:45:52flaviuThen reply and say "The LGPL is unusable for pretty much anything, and that includes Nim code"
00:45:55*barosl joined #nim
00:46:16Araqok.
00:52:12Araqhrm ok, I got it. so the user of the program has to able to replace just the library by a different version of it, right?
00:54:39*threewood quit (Ping timeout: 246 seconds)
00:55:57*jefus_ is now known as jefus
00:57:43flaviuYes, without having access to the program's source code.
01:07:29Araqwell if you can check your #defines and inline functions are of a limited size, you can check your iterators, macros or templates or inline functions are of a limited size
01:08:20Araqand then you can produce LGPL'ed libraries
01:10:24Araqyou can even grep easily for them.
01:11:49Araqbut whatever, this argument against Nim is pure FUD
01:13:36*darkf joined #nim
01:13:51*darkf quit (Changing host)
01:13:51*darkf joined #nim
01:24:34*gmpreussner joined #nim
01:26:51*akiradeveloper quit ()
01:31:51*sillesta quit (Ping timeout: 272 seconds)
01:33:27*BitPuffin quit (Ping timeout: 276 seconds)
02:02:03*barosl quit (Ping timeout: 245 seconds)
02:03:49*barosl joined #nim
02:10:03*saml_ joined #nim
02:10:49*sampwing quit (Ping timeout: 252 seconds)
02:18:39*barosl quit (Read error: Connection reset by peer)
02:23:22*fwef joined #nim
02:33:34*barosl joined #nim
02:33:57*vendethiel quit (Ping timeout: 244 seconds)
02:35:06*vendethiel joined #nim
02:40:33*Jesin quit (Quit: Leaving)
02:50:00*Jesin joined #nim
02:56:47*kapil__ joined #nim
02:56:54*vendethiel quit (Ping timeout: 265 seconds)
02:57:26*keyle joined #nim
02:57:57keylehi
03:00:43*Trustable quit (Quit: Leaving)
03:04:48gmpreussnerhi
03:05:13*VinceAddons quit (Read error: Connection reset by peer)
03:06:30*keyle quit (Read error: Connection reset by peer)
03:17:22*barosl_ joined #nim
03:18:26*barosl__ joined #nim
03:20:23*barosl quit (Ping timeout: 245 seconds)
03:21:38*barosl_ quit (Ping timeout: 245 seconds)
03:34:02*fwef left #nim ("Textual IRC Client: www.textualapp.com")
03:41:11*ctran joined #nim
03:42:35reactormonkhow do I construct an array indexed by an enum?
03:43:05*ctran_ joined #nim
03:43:23ctran_Hello all!
03:44:01ctran_Any pointer to use nim as fastcgi?
03:46:48*ctran quit (Quit: Page closed)
03:46:48*ctran_ is now known as ctran
03:50:57*EXetoC quit (Ping timeout: 264 seconds)
03:53:37reactormonkctran, I guess you could look up how to use C as fastcgi and go from there
03:54:13ctranI was hoping someone else had already done some work in this area
03:54:35reactormonkctran, the nim forum runs on something, you could see how that one works
03:54:45reactormonkBut I assume it runs more on the bare metal
03:55:48ctranwhere do I find its source?
03:56:20ctranFound it, thanks for the pointer
03:56:42reactormonkctran, I haven't even looked at it, so I can't really help you with it. You might want to wait for dom96 for that
03:57:52dom96ctran: The forum uses the asynchttpserver module, we have an scgi module but it hasn't been updated to work with the latest async dispatcher.
03:57:58dom96good night
03:58:54ctranthanks
04:04:39reactormonkhttp://pastie.org/9856115 what's the correct way to do this?
04:05:12reactormonkdom96, welcome to the fucked-up rhythm club?
04:10:55fowlhappy weekend all
04:31:07*johnsoft quit (Ping timeout: 245 seconds)
04:31:49*johnsoft joined #nim
04:43:21*Sergio965 quit (Remote host closed the connection)
04:51:38*barosl__ quit (Ping timeout: 245 seconds)
05:07:41*RayoGundead joined #nim
05:11:37*barosl joined #nim
05:18:16*nande joined #nim
05:24:03reactormonkdidn't someone have an option implementation for nim?
05:24:58*Demon_Fox quit (Quit: Leaving)
05:33:18*barosl_ joined #nim
05:34:24*barosl quit (Ping timeout: 272 seconds)
05:46:21*saml_ quit (Ping timeout: 256 seconds)
05:48:41*nande quit (Remote host closed the connection)
05:53:25*nande joined #nim
05:55:42reactormonkError: internal error: GetUniqueType
05:55:44reactormonkO.o
05:56:08Triplefoxoh i've seen that one before...i forget what it was
05:56:26*barosl__ joined #nim
05:56:46Triplefoxthere's an issue for it
05:58:46Triplefoxhttps://github.com/Araq/Nim/search?q=GetUniqueType&type=Issues&utf8=%E2%9C%93
05:58:50Triplefoxone of those i think
06:00:03*barosl_ quit (Ping timeout: 264 seconds)
06:00:09*RayoGundead quit (Quit: Page closed)
06:01:05reactormonkwas https://github.com/Araq/Nim/issues/1131
06:02:13Triplefoxyeah, legit error but useless message
06:08:23reactormonkHow do format floats?
06:08:35reactormonkoh wait, I wrote something in the compiler for that a while back
06:09:24*gmpreussner quit (Ping timeout: 244 seconds)
06:09:39reactormonkhm, can't really mess with that
06:11:45reactormonkhm, subexes don't seem to have that option
06:21:25reactormonk"why is nim so slow? oh, I forgot -d:release"
06:24:37Triplefoxoh, i didn't know that existed
06:25:22Triplefoxwow my sprite packer algorithm got 5 times faster
06:26:46Triplefoxfast enough for a (relatively undemanding) real-time situation
06:29:48reactormonkTriplefox, yeah, we really need to highlight that
06:30:27reactormonkTriplefox, https://github.com/Araq/Nim/issues/1868 <- comment here
06:35:59Triplefoxi commented
06:42:03*adam_s joined #nim
06:42:04adam_s#phaserio
06:42:41adam_swhoops, wrong chat
06:45:22*ctran quit (Quit: ctran)
07:22:08*Boscop joined #nim
07:31:35*d3m1gd joined #nim
07:35:54*gunn_ joined #nim
07:37:22*gunn quit (Ping timeout: 245 seconds)
07:42:17reactormonkok, wtf. According to valgrind, split() makes up 50% of my code runtime.
07:42:44reactormonk60% to be correct.
07:58:27reactormonkre.split is even slower.
08:01:06*vendethiel joined #nim
08:01:58*BlaXpirit joined #nim
08:07:53reactormonkHow do I fix "Error: no generic parameters allowed for <array>"?
08:09:41reactormonkah, darn : vs. = in array again
08:10:01*adam_s quit (Quit: Leaving)
08:23:59*vendethiel quit (Ping timeout: 245 seconds)
08:41:03*FusionGaming quit (Read error: Connection reset by peer)
08:41:26*FusionGaming joined #nim
08:42:28*SplinterOfChaos quit (Ping timeout: 245 seconds)
08:52:04*barosl_ joined #nim
08:55:12*barosl__ quit (Ping timeout: 246 seconds)
09:04:33*barosl__ joined #nim
09:07:53*barosl_ quit (Ping timeout: 245 seconds)
09:13:54*kniteli quit (Ping timeout: 265 seconds)
09:23:05dtscodecan someone explain the pegs replace function to me?
09:23:15dtscodebecause im having a hard time understanding it
09:29:35*gunn_ quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
09:52:11reactormonkTriplefox, I got a 10x increase btw ;-)
09:53:06*noam joined #nim
10:00:50*nande quit (Read error: Connection reset by peer)
10:10:29*Trustable joined #nim
10:14:22*xAndy quit (Excess Flood)
10:15:27*xAndy joined #nim
10:40:08*jefus_ joined #nim
10:44:02*jefus quit (Ping timeout: 245 seconds)
10:46:04gokrLGPL and GPL too are indeed problematic when you step outside the classic structures of compiled C.
10:46:50*gunn joined #nim
10:47:33*vendethiel joined #nim
10:48:25gokrSmalltalk - given its image model - is also quite undefined for these licenses. On a direct discussion with Stallman he said so himself, which is one reason Smalltalkers tend to be MIT/BSD-people.
10:51:52*barosl__ is now known as barosl
10:56:06gokr23 subscribers to the ml now.
10:56:22*Sphax joined #nim
11:24:37*woadwarrior joined #nim
11:25:26*Matthias247 joined #nim
11:34:10*VinceAddons joined #nim
11:42:59*Boscop_ joined #nim
11:45:53*Boscop quit (Ping timeout: 240 seconds)
11:48:40*Boscop__ joined #nim
11:52:15*Boscop_ quit (Ping timeout: 276 seconds)
11:59:27*woadwarrior quit (Quit: quit)
12:13:18Araqgokr: I disagree with the underlying assumptions that if it's "impossible to avoid this and that feature in **practice**"
12:13:31*EXetoC joined #nim
12:13:33Araq*that it is
12:14:10Araqwhen you have an environment where every single submitted line of code goes through code review, this is just an absurd claim to make
12:15:02Araqit's still not really cost effective to rely on human grunt work when you could automate it, but it's "impossible" at all
12:15:11Araq*it's not
12:21:44Araqthe same argument is used to argue that our --gc:none switch is useless since the stdlib uses the GC.
12:22:00Araqok, so use C instead, every library in C doesn't use a GC
12:22:18Araqoh wait, you can use the very same libraries in Nim too ...
12:29:22*rkj-b joined #nim
12:30:34Araqhi rkj-b welcome
12:33:52rkj-bThanks. I learned Pascal in school, and read a book about C, but need a fast language for my math experiment. So I'm just a n00b. Trying to pick up clues about using Nim here. Just a minor pest, probably.
12:38:25*ctran joined #nim
12:38:29Araqn00bs are welcome here too :-)
12:38:33Araqhi ctran welcome
12:39:14ctranhi
12:45:17*silven quit (Ping timeout: 245 seconds)
12:48:30*silven joined #nim
12:52:00*gokr_ joined #nim
12:52:23def-Hm, that's an old bug: https://stackoverflow.com/questions/28122276/
12:53:31*BlaXpirit_ joined #nim
12:56:13*BlaXpirit quit (Ping timeout: 245 seconds)
13:15:46*rkj-b quit (Quit: ChatZilla 0.9.91.1 [Firefox 35.0/20150108202552])
13:17:13*EXetoC quit (Quit: WeeChat 1.0.1)
13:30:23xAndywhats the best way to cast a (ref) pointer of a base class to a derived one?
13:30:48xAndysimply an assert(obj of derivedclass) and a cast afterwards?
13:34:39Araquse object conversions instead of 'cast'
13:34:55AraqDerivedClass(obj) # performs a runtime check for you
13:35:00flaviuI wouldn't use assert here either, passing the wrong subclass is probably not an programmer error.
13:35:15Araqunless you use -d:release and don't enable --objChecks:on
13:35:49flaviuAraq: Can you review https://github.com/flaviut/Nim/compare/fastergc ?
13:37:43Araqwell it's correct
13:37:58Araqhow it affects code size, no idea
13:38:35Araquse 'nim c --compileOnly compiler/nim' as a real world benchmark
13:38:47Araqcompare the nim.exe sizes
13:39:50Araqand please do it for both gcc and clang
13:44:47*UberLambda joined #nim
13:45:24*davidhq joined #nim
13:46:39*davidhq quit (Read error: Connection reset by peer)
13:46:46xAndythanks, will use that
13:46:49*davidhq joined #nim
13:52:11flaviuOk, it looks like it makes a negligible difference on non-microbenchmarks.
13:53:23flaviuLess than a percent or so. I could set up a proper test harness and get a more accurate number, but it's probably not worth it.
13:53:34Araqwell microbenchmarks are important, so if code size is hardly affected I will accept it
13:54:27Araqnote that the compiler iself is allocation heavy and according to Boehm himself is a compiler the best benchmark one can come up with
13:58:35*BitPuffin joined #nim
14:06:36*Pisuke joined #nim
14:06:53*d3m1gd quit (Ping timeout: 240 seconds)
14:08:09*MyMind quit (Ping timeout: 245 seconds)
14:08:34*Pisuke quit (Client Quit)
14:09:37*Sembei joined #nim
14:20:09*d3m1gd joined #nim
14:23:02*Matthias247 quit (Read error: Connection reset by peer)
14:23:51*Fusion_Gaming joined #nim
14:27:03*FusionGaming quit (Ping timeout: 264 seconds)
14:30:23*sillesta joined #nim
14:45:08gokrAraq: You replied to me about something, but I admit I am at a loss to what it was.
14:45:29gokrAt 01:13:20.
14:47:29sillestagokr: http://irclogs.nim-lang.org/ ?
14:47:33*Fusion_Gaming is now known as FusionGaming
14:48:04gokrNo, I mean - I can see what he wrote, but I have no idea ... what he means :)
14:49:12*davidhq quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
14:49:38sillestaoh
14:49:41sillesta:p
14:59:20*davidhq joined #nim
15:00:08*ctran quit (Quit: ctran)
15:03:34ekarlsoflaviu: you got a clue on something to use for tags ?
15:04:50flaviuSure, https://twitter.github.io/typeahead.js/
15:05:37flaviuJust add a gettagsuggesion api endpoint and feed it into typeahead.js
15:14:33ekarlsoflaviu: but hmmms, isn't the point to be able to select multiple tags ? ^
15:18:05*BlaXpirit_ quit (Quit: Quit Konversation)
15:18:45*BlaXpirit joined #nim
15:19:02flaviuI guess you can copy stackoverflow?
15:19:43flaviuYou could just ask the user to paste or upload their .nimble file.
15:21:16*irrequietus joined #nim
15:26:18*davidhq quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
15:26:36ekarlsoflaviu: :p
15:26:40ekarlsothat's an option too !
15:31:31*kapil__ quit (Quit: Connection closed for inactivity)
15:34:12*darkf quit (Quit: Leaving)
15:45:30*EXetoC joined #nim
15:58:38*sdw joined #nim
16:01:09*JinShil quit (Quit: Konversation terminated!)
16:10:23*gokr_ quit (Ping timeout: 245 seconds)
16:15:45*Sphax quit (Quit: ZZZZZzzzzz)
16:27:45*nande joined #nim
16:30:05*nande quit (Read error: Connection reset by peer)
16:34:46*nande joined #nim
16:45:06*BlaXpirit quit (Quit: Quit Konversation)
16:45:40*BlaXpirit joined #nim
16:46:47*gmpreussner joined #nim
16:55:41*NimBot joined #nim
16:57:28*Trustable quit (Remote host closed the connection)
16:58:50*threewood joined #nim
16:58:53*Sphax joined #nim
16:59:59*Sphax quit (Client Quit)
17:10:45*daniel_cp joined #nim
17:11:01*UberLambda quit (Quit: Leaving the Matrix)
17:23:54ekarlsois there anything to parse a .nimble file ?
17:25:26dom96ekarlso: https://github.com/nim-lang/nimble/blob/master/src/nimblepkg/packageinfo.nim
17:25:42dom96import nimblepkg/packageinfo
17:27:54*SplinterOfChaos joined #nim
17:37:23*johnsoft quit (Ping timeout: 276 seconds)
17:38:36*johnsoft joined #nim
17:56:09ekarlsoawesome dom96 !
18:00:20*gmpreussner quit (Ping timeout: 244 seconds)
18:00:20*gmpreussner_ joined #nim
18:04:34*Demos joined #nim
18:04:47*reem joined #nim
18:04:53*threewood quit (Ping timeout: 252 seconds)
18:05:00reemWhat's the best way to get started with nim?
18:05:21def-reem: http://nim-lang.org/learn.html
18:05:28reemThank you.
18:05:28def-I liked the regular tutorial
18:07:20*ARCADIVS joined #nim
18:10:01DemosI just read the manual. But I am a massive nerd
18:10:20reemMe too :)
18:11:14daniel_cpHey all - I’m just getting myself familiar with Nim today. Haven’t written anything yet, but am impressed. I had recently started a web crawling/scraping project and think Nim may work well… and am considering writing a little library with a suitable DSL to help. Are there any existing projects that may come in useful?
18:11:53reemAre there any specific resources or things I should look at given that I'm coming at this from the perspective of Rust, which is the language I've used the most recently.
18:12:06daniel_cpThe URL patterns in jester and nawak look like things worth ripping off
18:12:28def-daniel_cp: there's the httpclient module, but note that it's broken in 0.10.2 release (works in devel branch)
18:12:57daniel_cpdef-*: ty… that’s good to know
18:13:18def-reem: https://arthurtw.github.io/2015/01/12/quick-comparison-nim-vs-rust.html
18:13:43reemAh yes, I've seen that.
18:13:45daniel_cpdef-: what’s broken? is basic functionality working
18:13:55reemAnything more.. tutorial-like?
18:13:58def-daniel_cp: more complex urls don't work
18:14:58def-reem: don't know anything like that
18:15:30reemThat's alright, just curious. Nim looks very interesting.
18:15:45reemWhere's the best place to chat with the community and such, is this channel pretty active?
18:16:04def-http://nim-lang.org/community.html
18:16:14def-yeah, this channel is pretty active
18:17:29reemAwesome.
18:18:39reemSo how does the ecosystem deal with versioning as related to the language? Do people mostly track the latest development build or stick to versions?
18:21:26def-some use 0.10.2, others the devel branch, I guess
18:23:04*jefus_ quit (Ping timeout: 244 seconds)
18:23:10*BitPuffin quit (Quit: See you on the dark side of the moon!)
18:23:53*BitPuffin joined #nim
18:26:51*UberLambda joined #nim
18:28:24EXetoCflaviu: does validcodehashes.txt need to be distributed?
18:35:19flaviuEXetoC: Yes.
18:35:55flaviuEach time you modify code, you should run the program and make sure that the code compiles. If it does, it gets added to that file.
18:36:20BlaXpirithuh... what is this?
18:36:58flaviuhttps://github.com/flaviut/nim-by-example/blob/master/validcodehashes.txt
18:37:05*brson joined #nim
18:37:42flaviuIt contains the hashes of all the code snippets that are valid.
18:45:57*perturbation joined #nim
18:47:32vendethielmmmh, seems surprising to have "import x except y" for exclusion, but the other way around for inclusion (from x import y)
18:47:47vendethielin one case, it's import MODULE_NAME, in the other, it's import VARIABLES, ...
18:50:48*gmpreussner__ joined #nim
18:50:58*gmpreussner_ quit (Ping timeout: 244 seconds)
18:54:38EXetoCflaviu: nanoc is so slow :p
18:56:35*reem quit (Remote host closed the connection)
18:57:27*reem joined #nim
18:58:33flaviuEXetoC: nanoc is fine, but each code snippet requires a python invocation for syntax highlighting. That's slow.
19:04:17daniel_cpIf I understand, nimble doesn’t support versioning, per-project install locations, nor manifests… is that correct? I know the ecosystem is small currently, but are there best practices on how to deal with those things?
19:05:39BlaXpiritdaniel_cp, supports versioning for sure
19:05:41EXetoCpackages are versioned and versions can be specified for dependencies
19:06:15BlaXpiritper-project - i'm not sure, but you can always just copy the folders, no problem
19:06:22daniel_cpoh, sorry… I didn’t see any in https://github.com/nim-lang/packages/blob/master/packages.json
19:06:26BlaXpiritand what are manifests?
19:06:41BlaXpiritdaniel_cp, well people aren't gonna update that thing with each version release :p
19:06:49BlaXpiritversions are in packages themselves
19:06:54BlaXpirit.nimble and whatnot
19:07:01daniel_cpmanifest = list of project dependencies
19:07:07BlaXpirit.nimble again
19:07:15BlaXpiritlook at any project .nimble file
19:07:16flaviuhttps://github.com/flaviut/nre/blob/master/nre.nimble
19:07:18daniel_cpblaxpirit: great, I see.. thanks
19:07:26EXetoCexample: Requires: "nimrod >= 0.9.2, gtk2#head"
19:09:23daniel_cpEXetoC: great, I was worried for a brief moment :)
19:10:24daniel_cpAn idea…. instead of looking for nimble.ini in ~./config, use a search order that starts in the current directory and walks the tree up until one is found. then, fallback to ~/config. Projects could specify their own (relative) path in their own nimble.ini
19:13:14EXetoCI don't think a recursive search should be performed
19:13:22EXetoCanyway, feel free to submit feature requests here: https://github.com/nim-lang/nimble/issues/new
19:14:14daniel_cpEXetoC: is there another way nim or nimble deals with conflicting versions of the same packages installed?
19:14:21*TheJacob joined #nim
19:15:02BlaXpiritdaniel_cp, I can only guess, because i've never run into this
19:15:11BlaXpiritbut i think it can keep multiple versions of packages installed
19:15:16TheJacobwhat do I have to do if I want a property of an object i make to be settable? I keep getting "Error: [object name] cannot be assigned to"
19:15:27EXetoCBlaXpirit: correct
19:15:34BlaXpiritand it might give different packages different packages, if u know what im sayin
19:15:42TheJacob(this is my first systems programming language)
19:15:43daniel_cphow does “import” know which one to include?
19:15:46BlaXpiritTheJacob, define a proc `settername=`
19:15:52TheJacobI did that
19:15:56EXetoCTheJacob: are you using 'let' instead of 'var'?
19:15:58BlaXpiritdaniel_cp, it's in path
19:16:03TheJacobnope
19:16:15TheJacobits in a for loop over a seq of the objects
19:16:20EXetoCis it defined before the first usage?
19:16:37TheJacobEXetoC: I don't think so?
19:16:41BlaXpiritjust give code and save us the guessing
19:16:46TheJacobokay
19:17:10TheJacobhttps://www.irccloud.com/pastebin/yPpbiVOF
19:17:14TheJacobthere you go
19:17:36dom96daniel_cp: https://github.com/nim-lang/nimble/blob/master/developers.markdown
19:17:49EXetoCTheJacob: it doesn't return a 'var'
19:17:53dom96Everything is explained there.
19:18:00TheJacobEXetoC: what doesn't?
19:18:34flaviuTheJacob: The for loop iterates over immutable values.
19:18:36BlaXpiritnodes.items, i suppose. i don't quite understand
19:19:02EXetoCTheJacob: that for loop invokes the 'items' iterator, which doesn't yield 'var' objects, and so you either have to loop over the indices instead, or assign to a temporary 'var'
19:19:13EXetoCBlaXpirit: items is invoked implicitly in this case
19:19:20BlaXpiritof course
19:19:47EXetoCTheJacob: we'll get iterators for this purpose, but there's that in the meantime
19:19:54TheJacobEXetoC: thanks!
19:20:24ekarlsowhat are you guys making in nim ? ^^
19:20:56EXetoC'for i, x in foo' would be expanded to 'for i, x in foo.pairs'
19:21:06*reem quit (Remote host closed the connection)
19:22:40EXetoCekarlso: some kind of audio production tool
19:23:04ekarlsoEXetoC: hmms, just playing around u too or ?
19:23:08BlaXpiritdom96, hm this might be a problem
19:23:20BlaXpiritI've installed a package that requires nre < 0.2
19:23:29BlaXpiritand i have nre 0.3 or something installed as well
19:23:45BlaXpiritbut when I use that package that requires < 0.2, it imports 0.3 anyway
19:23:46daniel_cpdom96, EXetoC: thanks, that clarifies things. so my concern is (as stated here: https://github.com/nim-lang/nimble/blob/master/developers.markdown#nimrod-compiler) “This means that it cannot resolve dependencies, and it can only use the latest version of a package when compiling.” so if I have one project requiring foobar@1 and another foobar@2, it sounds like nim will always use foodbar@2
19:24:20BlaXpiritstarts to seem so to me as well
19:24:20EXetoCoh well
19:24:33daniel_cpdom96, EXetoC: a lookup path order for nimble.ini would allow per-project dependencies.. but maybe not the best way
19:24:49*delian66 quit (Ping timeout: 265 seconds)
19:24:55EXetoCekarlso: I'll try to create something practical
19:26:04TheJacobI'm making neural networks
19:26:06gmpreussner__in the code documentation, do we already support something like @see or @seealso?
19:26:28BlaXpiritgmpreussner__, i'm pretty sure you just get bare restructuredtext
19:26:57BlaXpiritbut i'm not sure at all
19:26:58gmpreussner__so there's currently no way to link to other types/procs?
19:27:15BlaXpiritlol i said "pretty sure" than "not sure"
19:27:19BlaXpiritthat's how sure i am
19:27:23gmpreussner__ok :)
19:27:52*delian66 joined #nim
19:28:05BlaXpirithey, there are some links in system.html
19:28:11BlaXpiritmay be worth investigating
19:28:20BlaXpiritthere are definitely links
19:28:30BlaXpirit`echo <#echo>`_
19:28:32BlaXpiritright...
19:29:01gmpreussner__ok, i'll take a look
19:29:20BlaXpiritit's just a normal rST hyperlink
19:31:11EXetoCoh
19:31:39BlaXpirit[:23:39] <EXetoC> oh well [:30:30] <EXetoC> oh
19:31:59AraqBlaXpirit: the links the docgen generates are canonicalized, so you can refer to system.+ for (int, int) via 'system.html#+,int,int'
19:32:08BlaXpiritoh that's cool
19:32:17BlaXpiritno, wait...
19:32:38BlaXpiriti mean, sure, these things are quite predictable
19:32:43*Araq ignores BlaXpirit
19:32:55EXetoCBlaXpirit: whatever
19:32:58BlaXpiritbut would be nice to link to `+` alone (and that may even be present)
19:34:29BlaXpiritinteresting. there are multiple things with id="+"
19:34:52BlaXpiritwhich indeed makes it work, but makes html invalid
19:44:38reactormonkAraq, btw, split() from strutils is rather slow
19:47:23def-reactormonk: compared to what?
19:47:43def-and do you have a nice benchmark for a realistic use case?
19:49:48BlaXpiritdef-, you think split doesn't have a use case? :p
19:50:13BlaXpiritdoesnt need to be realistic for an example
19:50:40reactormonkdef-, lemme make two examples
19:50:49def-BlaXpirit: sure it has use cases. i thought reactormonk discovered it in a specific application
19:51:01reactormonkdef-, yeah, that too
19:51:14BlaXpiritreactormonk, but then again, if you need high performance, requiring a seq of strings may not be preferred
19:51:30reactormonkBlaXpirit, yup, I went for an array of strings ;-)
19:51:32BlaXpiritinstead you can search and work with substrings manually
19:51:35reactormonkanyway, numbers incoming
19:52:05*davidhq joined #nim
19:57:26*UberLambda quit (Quit: Leaving the Matrix)
19:58:45reactormonkBlaXpirit, https://gist.github.com/reactormonk/5c6f2fbbba8eceec9d57
19:59:05BlaXpiritinteresting, let's see
19:59:24BlaXpirit.nim gives syntax highlighting btw
19:59:51reactormonkI selected nimrod in the dropdown :-/
19:59:59reactormonktest is 120k lines btw
20:02:25*perturbation quit (Quit: Leaving)
20:02:31*d3m1gd quit (Ping timeout: 255 seconds)
20:02:46*Varriount|Laptop joined #nim
20:03:42BlaXpiritvery strange. well, the standard split has a strange additional behavior, too
20:04:36BlaXpiritnvm
20:05:53dom96BlaXpirit: daniel_cp: the compiler will. You should use nimble build which will use the correct package based on the dependencies listed.
20:07:05Varriount|Laptopreactormonk: The problem with strutils.split is that it makes several calls to substr, which provides a copied string.
20:07:23reactormonkVarriount|Laptop, so do I
20:07:40Varriount|LaptopHuh?
20:07:45reactormonkstill doesn't explain why it's slow as fuck
20:07:53reactormonkwell, kinda.
20:08:14reactormonkI might have a branching optimization because of the hardcoded marker...
20:08:18reactormonklet's test without it
20:09:09reactormonknope, same runtime
20:09:39BlaXpiritu could try to slowly converge to that code until you see
20:09:51BlaXpiritit's kinda hard to understand why it has inner loop
20:10:59reactormonkBlaXpirit, where is the split code btw?
20:11:12BlaXpirithttps://github.com/Araq/Nim/blob/devel/lib/pure/strutils.nim#L253
20:11:39BlaXpiritu can find it by pressing Source http://nim-lang.org/strutils.html#split,string,char
20:11:43reactormonkhm.
20:12:23flaviuI see the problem.
20:12:39daniel_cpdom96: thank you for clarifying that for me. from reading the docs, nimble seemed primarily for modules published to the package index, but i take it people are using it for project management as well? if so I definitely agree with https://github.com/nim-lang/nimble/issues/80, nimble should be more tightly coupled with nim
20:12:51flaviuInstead of substr(prev, current), it searches for the next delimiter.
20:13:22*Trustable joined #nim
20:13:32BlaXpiritoh yeah
20:13:49BlaXpiritthat explains everything
20:14:00reactormonkso it's slower algorithmically?
20:14:00BlaXpiritreactormonk, welp, that calls for a pull request
20:14:04BlaXpirityeah, reactormonk
20:14:43EXetoCdaniel_cp: for that you have compiler config files, and if that's not enough then you have things like https://github.com/fowlmouth/nake
20:14:58BlaXpiritwaaait a second
20:15:01BlaXpiritthis is not so clear anymore
20:15:15BlaXpiritit searches for next separator, but it doesn't search for it twice, flaviu
20:15:16Varriount|Laptopreactormonk: See if you can't remove some of the other substr calls too.
20:15:56reactormonkBlaXpirit, yeah, it's actually not a double loop
20:18:03reactormonklemme converge my code to an iterator
20:18:57BlaXpiritit may be a lot of little things
20:18:57EXetoCdaniel_cp: adding a package to the index is the best way to distribute it. it was probably done that way for ease of implementation. more sophisticated systems have been discussed, but it's probably of low priority
20:19:04BlaXpiritlen can be quite costly
20:19:14BlaXpirit(i think)
20:19:20dom96daniel_cp: What kind of project management do you mean?
20:19:52fowlstrutils.split should use strutils.continuesWith instead of substr to check len
20:20:44daniel_cpexetoc: i’ll have to read up on compiler config files
20:21:05reactormonkfowl, we're talking about the sep: char version at line 253
20:21:16daniel_cpdom96: i just mean managing the dependencies of an application, not necessarily one that will be published anywhere
20:21:21Varriount|LaptopYou know... It would be really nice to be able to take slices of sequences and strings that weren't copies.
20:21:51EXetoCdaniel_cp: : see config/nim.cfg for an example. there's also the project-local projectname.nim.cfg file, and I think it looks in $HOME too. it's documented somewhere
20:21:51reactormonkstill 0.8s approx
20:22:04reactormonkI'll valgrind the strutils version
20:22:21dom96daniel_cp: If you want to share packages across different applications then I suppose you could use Nimble.
20:22:22flaviureactormonk: have you seen linux perf? It's excellent.
20:22:36reactormonkflaviu, valgrind makes a good job too. Link?
20:23:42EXetoCBlaXpirit: it should be O(1) for all random-access types
20:23:53reactormonkflaviu, https://perf.wiki.kernel.org/index.php/Main_Page ?
20:24:03BlaXpiritEXetoC, yes, but it's additional function call and whatnot
20:24:26flaviuThat's one option, I like http://www.brendangregg.com/perf.html too.
20:25:24EXetoCBlaXpirit: seems like an easy case for an optimizer
20:25:40*TheJacob quit ()
20:26:45reactormonkflaviu, but but but fancy https://i.imgur.com/BDNngnz.png
20:27:52flaviureactormonk: Also fancy: http://www.brendangregg.com/perf.html#FlameGraphs :P
20:28:00BlaXpiritlooks cool
20:28:06reactormonkflaviu, nice
20:28:37flaviuMain advantage of perf over valgrind it that it runs at native speed.
20:29:10reactormonkthat sounds like a good advantage, valgrind is slow as fuck
20:29:32reactormonktook 180s to analyse a 2s program
20:32:41reactormonkflaviu, now how do I profile cpu time with perf?
20:34:08reactormonklet's see if cycles does what I Want
20:35:40reactormonkah, perf stat.
20:36:48reactormonkso the strutils split seems to stall a bit more (23% vs. 30%)...
20:39:53reactormonkyeah, the len() hugs about all of the difference
20:41:25reactormonksomehow the compiler doesn't cache it.
20:45:05reactormonknope, it's not the len() call.
20:45:29reactormonkare there any tests for strutils and how can I run them?
20:53:17*superfunc[mobile joined #nim
20:53:54*threewood joined #nim
20:59:10*Varriount|Laptop quit (Ping timeout: 246 seconds)
21:01:15*Mimbus quit (Ping timeout: 264 seconds)
21:01:36*flaviu quit (Ping timeout: 272 seconds)
21:05:29*Sphax_ joined #nim
21:20:58*davidhq quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
21:21:10threewoodWhat is the technology underlying the parallel statement?
21:22:38*davidhq joined #nim
21:24:10*davidhq quit (Client Quit)
21:27:29*davidhq joined #nim
21:29:11*Sphax_ quit (Quit: ZZZZZzzzzz)
21:29:20*davidhq quit (Client Quit)
21:31:14*davidhq joined #nim
21:35:35Araqthreewood: some homegrown proof checker plus some runtime stuff that's in threadpool.nim. the checker uses as much information as can be extracted from the context. the checker mostly uses algebraic simplifications and the transitivity rules of inequalities
21:36:33threewoodAraq: OK, so first it inlines as much as possible and then it uses those methods?
21:37:24*davidhq quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
21:37:41Araqhrm, yeah, you can put it that way. but it doesn't inline anything that's not inlined already by the language's semantics (templates/iterators)
21:39:21Araqnote that it does use 'range[0..N]' typing annotations, so these can make a difference.
21:39:50threewoodHow many lines of source is the nim compler codebase right now?
21:40:01Araq80K lines of code
21:40:18threewoodThat's not too bad... it's all freely available isn't it?
21:40:21*davidhq joined #nim
21:40:29Araqyes, MIT license
21:40:46threewoodcool, thanks. I'm gonna go look it over
21:59:01*Sphax_ joined #nim
22:08:41*sdw quit (Ping timeout: 265 seconds)
22:12:56reactormonkAraq, any documentation on the compiler tester? I still haven't figured it out
22:13:49Araqmaybe there is some readme.txt that you ignore like you ignore the fact that it can output its usage
22:14:01ekarlsostupid ass ui-select from angularjs
22:28:26*brson quit (Quit: leaving)
22:50:50daniel_cpWhat options are there for event-driven coding styles with Nim? does the standard lib work well with an evented style?
22:51:41*irrequietus quit ()
22:53:02daniel_cpran across node.nim (https://github.com/DAddYE/node.nim). looks ambitious but unmaintained
22:55:34*reem joined #nim
22:59:35reemWhat's the status of jester? Is it actively maintained/growing new features?
23:00:26Araqdaniel_cp: async is built via macros, but part of the stdlib
23:00:51Araqreem: it's maintained, dunno about growing features
23:01:52reemAraq: Can you say more about how async works under the hood? Is there an event loop? Bindings to epoll/kqueue?
23:02:12def-reem: epoll is used in there
23:02:32*superfunc[mobile quit (Quit: Connection closed for inactivity)
23:02:45*ctran joined #nim
23:02:55*ctran quit (Client Quit)
23:03:23*ctran joined #nim
23:07:24reactormonkdoes nim expect the nodejs binary to be `node` or `nodejs`?
23:13:13*Mat4 joined #nim
23:13:31Mat4hi all
23:13:33reactormonknode seems to work.
23:13:39reactormonkBut then why doesn't the tester find it?
23:14:26reactormonkbecause it's looking for nodejs binary...
23:17:34*xAndy quit (Ping timeout: 244 seconds)
23:19:13*xAndy joined #nim
23:19:21reactormonkwhere does the compiler find node for nim -r -d:nodejs js <file> ?
23:19:34reactormonkI can't find it with git grep nodejs
23:20:29*davidhq quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
23:20:33wtwarg, the FreeBSD parallel build problem is really strange somehow
23:20:49wtwwhen I increase the busy waiting time in osproc.nim it works flawlessly
23:21:16reactormonkah, found it
23:21:18wtwalso when removing the WNOHANG flag in waitpid() it works
23:22:24reactormonkAraq, the tester expects `nodejs` as the node binary, while the compiler expects `node` - which one is correct?
23:23:32def-reactormonk: when you get it from nodejs.org it's called node
23:23:44reactormonkdef-, or the one in arch
23:23:56reactormonkdef-, I assume it's debian that goes nodejs?
23:24:17Araqwtw: nice that you look into it! thanks a lot!
23:24:39Araqreactormonk: at some point I patched one thing but not the other, or something like that.
23:24:41*Jesin quit (Quit: Leaving)
23:25:30reactormonkAraq, the default distribution of nodejs has a `node` binary. Up to you to speak a word of power. On the other hand, we could also make the code more complex and check for `nodejs` first, then for `node`.
23:25:39def-reactormonk: correct
23:25:45def-https://groups.google.com/forum/#!topic/nodejs/Z8F8uDXY8XE
23:26:33wtwAraq: np, but don't be too hopeful I'll find something soon :) Currently it looks like a strange timing issue that should not happen
23:27:04Araqreactormonk: I don't care. make some PR so it works again.
23:27:06def-reactormonk: so i guess you have to look for both binaries if you want it to work everywhere =/
23:27:13*Jesin joined #nim
23:27:27reactormonkAraq, if the tester runs on debian, hell's gonna break loose.
23:27:39reactormonkdef-, yup, pretty much
23:28:40def-look for nodejs first, then node
23:28:57reactormonkwell, if we get the ax25 binary called `node`, what happens?
23:28:58def-but can still fail if you have AX25 installed, which provides the node binary, and don't have nodejs
23:29:26reactormonkI guess tough luck.
23:29:41def-Yeah, I think it would be too much to determine whether it's actually nodejs
23:29:58def-node -h|grep nodejs would work
23:30:12reactormonkno thanks
23:30:22reactormonkpretty sure there's a system that doesn't have grep
23:31:31reactormonkwhere do I put code I want to use in both the compiler and the tester?
23:31:47Araqreactormonk: in some stdlib module.
23:31:54reactormonkAraq, good enough for me.
23:34:22fowlreactormonk, would this be better for split()? it at at least can avoid allocations https://gist.github.com/fowlmouth/a58cb7580adab0022fb6
23:36:30reactormonkfowl, lemme bench it after this
23:39:54fowli didnt test it btw
23:40:38reactormonkfowl, gistfile1.nim(16, 38) Error: expression has no address
23:40:39reactormonkI see
23:41:22reactormonkThe one I provided in my gist (ownSplit) is still fast and about half the LoC
23:41:50fowlwhat that should work lol
23:42:00reactormonknot sure how well it handles the edgecases though
23:42:05reactormonkthat's why I was asking for tests
23:43:52reactormonka lot of the tests seem to fail :-/
23:52:37def-reactormonk: they worked before?
23:57:37*BlaXpirit quit (Quit: Quit Konversation)
23:57:38AraqI'm cleaning them up, slowly category after category
23:58:16*davidhq joined #nim