<< 01-02-2015 >>

00:00:08BlaXpiritthat may be something different then?
00:00:32def-random.nim(141, 9) Error: internal error: expr: var not init mtRandomBytes_138513
00:02:13Araqthat is a regression, right?
00:02:23def-definitely, the library used to work
00:02:27Araqdef-: can you attach that to the current bug report please?
00:02:34def-sure
00:02:51Araqty
00:02:55*brson quit (Quit: leaving)
00:04:25*matkuki quit (Quit: ChatZilla 0.9.91.1 [Firefox 35.0.1/20150122214805])
00:06:45Araqhrm for me bug #2023 doesn't require deadcodeElim:on at all
00:06:57Araqit simply always crashes with the same error message
00:07:03def-yeah, same here
00:08:05BlaXpiritAraq, maybe the regression got worse recently?
00:08:20BlaXpiritthat code works for me
00:08:35Araqwhat version are you using?
00:08:36BlaXpiriton commit 995510664e543ff74a10750e804767443429d5f8
00:08:55BlaXpiritthat's quite an old devel Sat Jan 24
00:09:20BlaXpiritwell not really old now that i think about it
00:09:36BlaXpiritand d:release breaks it
00:09:59*onionhammer joined #nim
00:10:00BlaXpiritmaybe try d:debug or something
00:10:01reactormonkAraq, what happened to https://github.com/Araq/Nim/pull/1644 ?
00:11:40BlaXpiritand i currently can't build nim... long story
00:14:00Araqreactormonk: I should close that I guess
00:14:51reactormonkAraq, how do you personally test for regressions? A bunch of the tests fail and I never know which ones fail because of tests and which ones failed beforehand
00:15:54*noahmorrison joined #nim
00:16:18onionhammeraraq stdin vs sockets aside
00:17:06onionhammerwhats your recommendation for a scenario like im describing, with multiple modules. Take fowls nimlibs for example
00:17:25onionhammeryou clone that folder, open it up in your editor, some might reference each other, but most are independent
00:18:18Araqonionhammer: the editor can generate a project file that imports all these
00:18:26Araqwell
00:18:36Araqnimsuggest could do that too of course
00:18:46reactormonkonionhammer, I'd be fine with file sockets too
00:20:09onionhammeraraq the ST plugin has the capability of setting a project file associate w/ a sublime project, but thats only if the user actually creates a sublime project. the nature of nim (to me) seems a lot more transient than something like C#/visual studio
00:20:11Araqreactormonk: usually I simply fix the bug and don't look at what commit may have broken it
00:20:33onionhammerin C# you're basically forced to create a big old project, and then a solution, with an entry point etc
00:20:47noahmorrisonI can't cross compile a Hello World program to windows. `nim --os:windows --parallelBuild:1 c hw.nim` says that there is no such file or directory io.h
00:20:48onionhammerin nim you can just basically "run" any module independently
00:20:55dom96ldlework: Was hoping that maybe you could help with our GSoC application.
00:21:00onionhammerit might not build if it's meant to be an include but whatever
00:22:13Araqonionhammer: in Aporia there is "run this file" and "run the project" and aporia knows the project because that's the one marked with a .nim.cfg file
00:22:53reactormonknoahmorrison, https://stackoverflow.com/questions/2211030/failing-to-compile-a-project-missing-io-h-file - seems to be a problem where there's no POSIX stuff missing
00:25:07Araqonionhammer: well the first problem is: how does the editor know if the file belongs to the project or not? nimsuggest knows all the files so the editor should ask nimsuggest
00:26:27Araqwell ok, I guess you don't have to do that, you can leave that to nimsuggest to figure out
00:26:58Araqso you simply pass: sug "new file" line col and it does the right thing
00:32:27Araqonionhammer: ok, so nimsuggest should simply load previously unknown files?
00:32:38Araqno protocol changes necessary?
00:33:26Araqand thinking about it, this should simply work with how we process the module graph anyway.
00:36:59Araqnoahmorrison: or use Wine. This way you can also debug problems your Windows users might report. ;-)
00:43:15*FusionGaming joined #nim
00:45:06onionhammerAraq i like this train of thought
00:45:50onionhammerlet it work like a graph, so to speak
00:47:59Araqonionhammer: ok, seems like some trivial addition. consider it done
00:48:26Araqbut please test it with projects already
00:48:50onionhammeryep, thats next on my list.
00:48:52onionhammerthanks
00:48:55onionhammerafk a while
00:50:56*bmaxa quit (Quit: Leaving)
00:57:15*reem quit (Remote host closed the connection)
01:00:00*AtomicBool joined #nim
01:00:46AtomicBool.eval echo(&5)
01:00:49MimbusAtomicBool: eval.nim(3, 5) Error: type mismatch: got (int literal(5))
01:03:16*reem joined #nim
01:05:56*reem quit (Remote host closed the connection)
01:06:06*kniteli quit (Ping timeout: 276 seconds)
01:07:05*BlaXpirit quit (Quit: Quit Konversation)
01:10:10vendethiel-uh, with `proc retLit(): ref Literal = new(result); result.x = 5` <- what happens here?
01:10:41vendethiel-(it's a code example from the manual) there's no "var result" anywhere to be new()ed, and I don't see a result to a ptr
01:11:13EXetoCno, but result is the return value
01:11:34vendethiel-EXetoC: is there an implicit "var result : PROC_RET_TYPE"?
01:11:43vendethiel-(that is, at the beginning of every function)
01:11:52EXetoCbasically
01:12:02vendethiel-(like being able to declare named return variables, go does that iirc)
01:12:21EXetoCand no return statement here so it's going to be returned implicity at the end
01:12:44vendethiel-EXetoC: is it statically checking that "result" was mentioned in the body?
01:12:50vendethiel-to decide that it needs to return it implicitly
01:13:04*brson joined #nim
01:13:50vendethiel-EXetoC: ? also, can there be an explicit return at the same time -- say, inside an if?
01:13:54EXetoCno, it will be returned anyway
01:13:57EXetoCyes
01:14:49vendethiel-EXetoC: okay, so, for a proc with void as the return type, a simple "return" will get inserted at the end?
01:15:14vendethiel-but does that mean that, with a simple `proc testret(): int = echo "hey"`, I'll get 0 (default int) returned?
01:15:59EXetoCboth assumptions are correct
01:16:14vendethiel-alright, thank you
01:18:36*noahmorrison quit (Quit: WeeChat 1.1-dev)
01:19:14*kniteli joined #nim
01:19:45vendethiel-the manual doesn't seem to mention it, so: what's the scoping rules for converters? They won't get exported unless I put the asterisk there, right?
01:19:59vendethiel-are multiple passes of convert possible?
01:20:09vendethiel-or maybe, a language-built convert into a user-defined one?
01:20:26*reem joined #nim
01:20:41vendethiel-(by "language-built" I mean from int64 to int, for example)
01:22:25EXetoCyes same scoping rules as for most things
01:23:16EXetoCit seems to be one conversion only
01:23:17vendethiel-lexical scoping, then. If I import one inside a block:, I won't get it outside of it
01:23:30vendethiel-alright, one conversion, even for the built-in ones :-). Thank you!!
01:24:01EXetoCimports are only allowed at the top level
01:24:07vendethiel-oh, that also makes sense
01:24:20vendethiel-it was usings that were allowed inside blocks, then
01:25:04vendethiel-EXetoC: sorry, I'm sleep-reading the manual, it's making sense but you've helped me clarify the less clear parts
01:26:51EXetoCI don't know if it's mentioned there
01:28:16vendethiel-the "is operator" section doesn't describe the behavior wrt subtyping, etc. is it strict type matching? what happens with generics? I guess they're not reifed, but the "is" is apparently done at compile-time, so would that work?
01:29:48vendethiel-same for generic constraints (`proc test[T: int]()`, or `int|string` -- what happens with subtyping?)
01:30:15AtomicBoolhelllllooooooooo
01:30:22vendethiel-hi
01:32:03*mytrile quit (Read error: Connection reset by peer)
01:38:16*adam- joined #nim
01:39:03*dv-_ joined #nim
01:39:52*adam- is now known as adam12_
01:41:58*Rush__ joined #nim
01:43:08*Grauwolf joined #nim
01:43:12*hguux_ quit (Ping timeout: 256 seconds)
01:43:12*adam12 quit (Ping timeout: 256 seconds)
01:43:12*VinceAddons quit (Ping timeout: 256 seconds)
01:43:14*Demon_Fox quit (Ping timeout: 256 seconds)
01:43:14*Gonzih quit (Ping timeout: 256 seconds)
01:43:14*visi0n quit (Ping timeout: 256 seconds)
01:43:14*jokra quit (Ping timeout: 256 seconds)
01:43:14*xAndy quit (Ping timeout: 256 seconds)
01:43:14*ekarlso quit (Ping timeout: 256 seconds)
01:43:14*dv- quit (Remote host closed the connection)
01:43:15*RushPL quit (Ping timeout: 256 seconds)
01:43:15*Mimbus quit (Ping timeout: 256 seconds)
01:43:15*kashyap___ quit (*.net *.split)
01:43:15*kashyap_ quit (*.net *.split)
01:43:15*wtw quit (*.net *.split)
01:43:16*beatmox quit (*.net *.split)
01:43:16*flyx quit (*.net *.split)
01:43:21*adam12_ is now known as adam
01:43:25*hguux__ joined #nim
01:43:26*hguux__ quit (Changing host)
01:43:26*hguux__ joined #nim
01:43:30*xAndy| joined #nim
01:43:35vendethiel-with a user-defined type class, can I do stuff like `generic t␤ count(Vector[t]) is int` (asserting a function kind, using the type as a type param, and asserting return type as well)
01:43:35vendethiel-"Future versions of Nim may also support overloading based on the return type of the overloads" erm, how can you have both multiple dispatch and return type overloading?
01:43:35*vendethiel- notices he's very spammy and goes back to the manual
01:43:58*adam is now known as Guest24051
01:44:28*Gonzih joined #nim
01:44:52*trevorriles joined #nim
01:45:00*Mimbus joined #nim
01:45:26*jokra joined #nim
01:46:50*kashyap___ joined #nim
01:46:50*kashyap_ joined #nim
01:46:56*reem quit (Remote host closed the connection)
01:48:12*beatmox joined #nim
01:48:12*wtw joined #nim
01:48:12*flyx joined #nim
01:49:38EXetoCvendethiel-: I assume that check should work, but some things are still broken
01:51:12*brson quit (Quit: leaving)
01:56:28def-how do you print the resulting code of a macro/template call again?
01:57:25EXetoCrepr?
01:57:53EXetoCyep
01:57:56def-thanks
01:58:45def-and is there any way to expand all macros and templates and print the resulting code then?
02:06:50*ekarlso joined #nim
02:08:46*gunn joined #nim
02:09:05*Mimbus quit (Read error: Connection reset by peer)
02:09:05*flaviu quit (Read error: Connection reset by peer)
02:10:15*Mimbus joined #nim
02:10:53*bjz quit (Quit: Textual IRC Client: www.textualapp.com)
02:11:31*flaviu joined #nim
02:12:01AtomicBoolChallenge!
02:12:21AtomicBoolcreate Nim code to solve this problem!
02:12:23AtomicBoolhttps://projecteuler.net/problem=5
02:14:42EXetoCit can only be done with php
02:15:16AtomicBoolwat
02:15:23AtomicBoolim srs
02:16:09AtomicBooloh, if ur logged in, theres an input box
02:16:13AtomicBoolbut thats not the point
02:16:29flaviuAtomicBool: 232792560
02:16:44flaviuhttps://gist.github.com/4070661f1fb09541e7f5
02:16:50AtomicBoolthanks
02:16:56flaviuit'
02:16:57def-flaviu: it should be nimcode, so "echo 232792560"
02:17:04flavius straightforward though
02:17:30AtomicBoolflaviu can u time test that?
02:18:06flaviu10.12s, I'm sure I could optimize it though.
02:18:20AtomicBooltry optimizing it pls :)
02:18:44AtomicBoolI'm trying to bench
02:19:33*zahary quit (Ping timeout: 276 seconds)
02:20:47*bjz joined #nim
02:20:49*MattAitchison joined #nim
02:21:20flaviuhttps://gist.github.com/b591fb9dbf2a67fc8ac5 3.5s
02:23:57AtomicBoolflaviu, could it be optimized more?
02:24:22def-AtomicBool: you can google for more advanced mathematical solutions and implement them in nim for more speed
02:25:24AtomicBoolin this case, in this bench, I didnt use a methmatical algor
02:25:26AtomicBoolmath*
02:25:30AtomicBoolthat was not intentional
02:27:18Varriount__Woo! Maths!
02:27:23*Varriount__ is now known as Varriount
02:27:41*sillesta joined #nim
02:27:46VarriountHello sillesta
02:27:53sillestahey
02:28:11AtomicBoolJust try, at your best without using google, to try to optimize it as BEST as u can
02:29:23*reem joined #nim
02:30:26flaviuAtomicBool: 0 seconds is almost possible.
02:31:07AtomicBoolflaviu, naive, but 0 seconds, maybe u can do the same? https://gist.github.com/Ap0ph1s/8ae6029e4312d3d71554
02:31:26*darkf joined #nim
02:31:46*reem quit (Remote host closed the connection)
02:32:23*reem joined #nim
02:32:45*reem quit (Remote host closed the connection)
02:33:19*reem joined #nim
02:33:36*reem quit (Remote host closed the connection)
02:48:24def-AtomicBool: sure: https://gist.github.com/def-/c1e93006eb853a35dcd7
02:48:47def-with nim -d:release pj5 it runs in 40 ms for me
02:50:16AtomicBoolthats 0.04 secs right?
02:50:20dtscodecan someone tell me why this isnt printing anything? https://bitbucket.org/dtscode/billspc/src
02:50:20def-yes
02:50:42AtomicBoollemme test my rust version again, havent in weeks
02:50:44flaviuI don't really like that.
02:50:45def-dtscode: asking me for a login
02:50:57flaviuBest for everything to use the same code
02:50:58dtscodeoshit. forgot i set it to private. give me a sec
02:51:36dtscodeok it should be fine now
02:52:34def-It's funny that for Nim code clang is twice as fast as gcc here, while for C code it's the opposite: https://github.com/nsf/pnoise
02:52:59AtomicBoolactaully im doing this wrong
02:53:12*sillesta quit (Ping timeout: 246 seconds)
02:54:32Varriountdef-: Makes me wonder if someone should come up with a 'metacompiler' that compiles versions of a C/C++ program, and picks the fastest one.
02:56:35def-Varriount: probably better to do pgo
02:56:51flaviuPGO won't do much here.
02:57:12AtomicBooldef- how fast is ur pc?
02:57:19AtomicBoolas in specs*
02:57:39def-AtomicBool: ehm, core2quad q9300
02:57:43def-so nothing that modern
02:57:57AtomicBoolidk if that helps me
02:58:21def-what about compiling the rust and nim code on your computer and comparing?
02:58:35AtomicBoolim downloafing nim atm
02:59:17flaviuThe disassembly for my code: http://i.imgur.com/OyMJ7jc.png
03:00:05*skyfex____ quit (Quit: (null))
03:00:18AtomicBoolI think im gonna create a blog for comparing both Rust and Nim in some PE problems
03:00:27def-AtomicBool: compiling with "rustc -O main.rs"?
03:00:44AtomicBoolNo, just regular rustc main.rs
03:00:59def-isn't that unoptimized?
03:01:25AtomicBoolI never tried with -O
03:01:29def-for nim you also have to compile with "nim -d:release c main.nim" for good speed
03:02:12AtomicBoolokay done downloading
03:02:34dtscodedom96, you should take a look dom96
03:02:45dtscodewtf did it say dom96 twice?
03:03:37def-AtomicBool: for me: rust: 0.249s, nim: 0.038s
03:04:11flaviuIt's best to use exactly the same code. That way you benchmark the language, not implementation.
03:04:12AtomicBoolwhat extention is the nim binary?
03:04:20AtomicBoolwe are falviu
03:04:24AtomicBoolflaviu
03:05:00def-AtomicBool: on windows .exe, otherwise none
03:06:22flaviuYou can also get a tiny speed boost if you use uint32s.
03:09:16*skyfex joined #nim
03:10:24AtomicBoolrust vs nim without compiler args, rust performas faster
03:10:43AtomicBoolbut with args, nim passes rust by a bit
03:10:53AtomicBoolI gtg now, ill look into this tomorrow
03:11:13def-good luck, looking forward to the benchmarks, AtomicBool
03:13:28bjzwhat is the nim code?
03:13:37def-bjz: https://gist.github.com/def-/c1e93006eb853a35dcd7
03:13:46def-just a literal translation of the rust one
03:13:53*ARCADIVS joined #nim
03:15:32AtomicBoolIn these benchmarks, does it have to be exact code translations?
03:15:41bjzinteresting. wonder if its a gcc/llvm issue. or if its still our (rust) IR output that could be improved. Seems like a simple program that should be pretty much the same performance wise
03:16:12bjzwhat numeric type does nim default to?
03:16:44bjz(by gcc/llvm I mean, gcc vs llvm)
03:16:45def-bjz: int64 on 64bit, int32 on 32bit
03:16:51AtomicBoolIts rustc, the IR it outputs is not as fast as it should be at ALL
03:17:20def-bjz: oh, you're right, it's a gcc vs llvm issue
03:17:26bjzAtomicBool: yeah - it's definitely something that could be improved
03:18:06def-"nim -d:release --cc:clang c pj5" and the nim solution is much slower, 0.169s instead of 0.038s with gcc for me
03:18:46bjzAtomicBool: if the llvm IR was better, you'd hope that it could generate better asm, but I've heard that gcc has always had a bit of an edge over llvm in terms of release builds
03:19:24def-bjz: actually with Nim I often see clang being faster as a backend than gcc
03:20:02bjzreally?
03:20:05bjzinteresting
03:20:09def-yes, for example here: https://github.com/nsf/pnoise
03:22:00bjzyou might get more insight on rust internals - I'm not super knowledgable at the compiler backend stuff
03:22:20AtomicBoolI'm starting to see an immaturity pattern here
03:23:08*bjz thinks things like this could be of mutual interest
03:23:38AtomicBoolRust performance isn't ready and not what it is supposed to be right now, with IR improvennts and llvm not optimizing it like it should be
03:24:14AtomicBoolWhile nim, compiling to c, has advantages of c optimized compilers
03:24:40bjzI'm not too concerned. it's something that can be improved over time. C was pretty bad at the beginning
03:24:47flaviuAtomicBool: IME Nim gets the best performance with clang too...
03:25:02def-flaviu: except for this small benchmark
03:25:56bjzAtomicBool: I would be wary about relying on that argument
03:25:58AtomicBoolI'm not concerned either, performance to this extent isn't their priority rn
03:26:24AtomicBoolIts essentially C vs Rust
03:26:31bjzyeah
03:26:49bjzNim has the advantage of leaning on C
03:27:23AtomicBoolHowever, rust isnt fully optimized as a whole
03:27:33AtomicBoolWe shall see as the time goes on
03:32:22*BitPuffin quit (Ping timeout: 240 seconds)
03:32:29*vendethiel- quit (Ping timeout: 264 seconds)
03:34:07*reem joined #nim
03:38:41*reem quit (Ping timeout: 246 seconds)
03:55:22*EXetoC quit (Ping timeout: 240 seconds)
04:12:10AtomicBoolShould I include compiler flags or nah?
04:12:42AtomicBoolSince rustc and nim do different things when optimizing
04:18:20flaviunot really. Nim turns off bound and overflow checks, and turns off stack traces. But CC does most the hard work.
04:24:04*Demon_Fox joined #nim
04:26:48AtomicBoolThe flags is more of a llvm vs GCC thing
04:26:51AtomicBoolRight?
04:29:40AtomicBoolAs in compiler backend features
04:30:37flaviuyes, but I think nim just passes O3.
04:31:03flaviuAnd clang emulates all the GCC options that do useful stuff anyway.
04:31:10flaviunight.
04:34:48AtomicBoolI'll see, and night
05:02:37*brson joined #nim
05:05:38*brson quit (Client Quit)
05:05:53*brson joined #nim
05:06:16*dv-_ is now known as dv-
05:24:48*kniteli quit (Ping timeout: 276 seconds)
05:55:03*johnsoft quit (Ping timeout: 244 seconds)
06:04:08*brson quit (Quit: leaving)
06:14:34*BlueJello joined #nim
06:32:10*BlueJello left #nim ("Textual IRC Client: www.textualapp.com")
07:00:05*NimBot joined #nim
07:21:25*reem joined #nim
07:25:23*Demon_Fox quit (Quit: Leaving)
07:26:31*NimBot joined #nim
07:29:57*reem quit (Remote host closed the connection)
07:33:58*reem joined #nim
07:51:23*SplinterOfChaos quit (Ping timeout: 246 seconds)
08:11:59*brson joined #nim
08:21:58*brson quit (Quit: leaving)
08:28:30*BitPuffin joined #nim
08:29:28*reem quit (Remote host closed the connection)
08:32:21*reem joined #nim
08:33:04*BitPuffin quit (Ping timeout: 265 seconds)
08:39:00*xeizlif_ joined #nim
08:40:00*Grauwolf_ joined #nim
08:40:05*milosn_ joined #nim
08:40:29*gokr joined #nim
08:45:05*adam- joined #nim
08:45:21*Grauwolf quit (*.net *.split)
08:45:21*Guest24051 quit (*.net *.split)
08:45:21*milosn quit (*.net *.split)
08:45:21*eigenlicht quit (*.net *.split)
08:45:21*Roin quit (*.net *.split)
08:45:22*gokr1 quit (*.net *.split)
08:45:22*xeizlif quit (*.net *.split)
08:45:54*adam- is now known as adam
08:46:00*adam is now known as Guest51733
08:49:15*milosn_ is now known as milosn
08:51:09*Roin joined #nim
08:51:34*eigenlicht joined #nim
08:57:28*reem quit (Remote host closed the connection)
08:58:08*reem joined #nim
08:58:52*Boscop_ joined #nim
09:02:20*phira quit (Max SendQ exceeded)
09:02:36*Boscop__ quit (Ping timeout: 277 seconds)
09:02:49*phira joined #nim
09:03:43*Grauwolf_ quit (Quit: Bye!)
09:04:09*Grauwolf joined #nim
09:07:54*reem quit (Remote host closed the connection)
09:08:53*BitPuffin joined #nim
09:19:08*xeizlif_ is now known as xeizlif
09:28:57*alexruf joined #nim
09:30:38*reem joined #nim
09:58:31*Matthias247 joined #nim
09:59:09*mytrile joined #nim
10:04:21*reem quit (Remote host closed the connection)
10:05:02*akiradeveloper joined #nim
10:07:34reactormonkAraq, how do I test for vmgen.nim?
10:09:53Araqreactormonk: the vm stores cstring as string
10:10:21Araqso the check == tyString becomes in {tyString, tyCstring}
10:10:34Araqhardest part is to come up with a test for that :P
10:10:34reactormonkoh, I modified it into a case statement
10:10:42reactormonkyeah, exactly.
10:11:15Araqbtw, keep up the good work!
10:11:30reactormonkMight drop again as soon as I get a job
10:11:59*VinceAddons joined #nim
10:12:33reactormonkorigin [email protected]:Araq/Nim.git (fetch)
10:12:35reactormonkorigin [email protected]:reactormonk/Nim.git (push)
10:12:38reactormonk^ very useful setup
10:12:59reactormonkAraq, I have no idea how to test that stuff btw
10:13:35Araqreactormonk: add an 'echo "came here"' into the compiler and put stuff in a static block
10:14:04reactormonkAraq, can I test that?
10:15:15Araqthe "came here"? nah, that's just for development
10:15:38Araqbut just do something like:
10:15:41Araqstatic:
10:16:02Araq let x = cstring("foobar")
10:16:15Araq echo high(x)
10:16:24Araqthat triggers the vmgen
10:16:57Araqthis will later cause endless amounts of pain when the HLO arrives
10:17:09*reem joined #nim
10:17:16reactormonkHLO?
10:17:27reactormonkbtw, declare https://github.com/Araq/Nim/issues/460 as wontfix?
10:17:39Araq"high level optimizer"
10:17:40*kuzy000_ joined #nim
10:18:11*alexruf quit (Quit: My Mac has gone to sleep. ZZZzzz…)
10:18:17reactormonkI don't have any concept associated with that name
10:18:34Araqwell I invented that name
10:19:04Araqit does all the trivial optimizations that a C backend easily misses or isn't allowed to do
10:19:17Araqit's on the roadmap
10:20:40reactormonksuch as?
10:21:37AraqGCSE
10:21:39Araqloop invariant hoisting
10:21:40Araqescape analysis for string/seq
10:21:42Araqinlining of small lambdas
10:23:46reactormonkHm. I'd have to spend an hour to understand them and their significance
10:24:16reactormonkAraq, where do I put tests which test if a file compiles
10:24:37Araqthese are simply tests without a discard section
10:24:50Araqput it under the appropriate category
10:25:15Araqand document the tester better please
10:26:08reactormonkIf I'd know how it would work...
10:26:24reactormonkI'm currently using ./koch tests c <directory name>
10:28:21Araqthat's fine
10:28:42AraqI use
10:28:54Araqtests/testament/tester cat <category>
10:30:03reactormonkWhere would you put the code at https://github.com/Araq/Nim/issues/496 ?
10:30:42Araqtests/method ?
10:30:42*reem quit (Remote host closed the connection)
10:31:03reactormonkthanks
10:32:04reactormonkah, there's already a test for this
10:33:11*reem joined #nim
10:34:01Araqwhen I don't add a test case that's usually not because I'm lazy
10:34:16Araqbut because I expect the bug to never happen again
10:36:00Araqhrm the max iteration count in the vm is set to half a million
10:36:31Araqand people managed to break that limit
10:36:36Araqhttps://github.com/Araq/Nim/issues/1989
10:38:27*gokr quit (Ping timeout: 264 seconds)
10:43:26reactormonkdon't wanna compute stuff in the vm? ^^
10:43:35*alexruf joined #nim
10:44:25reactormonkAraq, where is stuff like let/var in the compiler?
10:44:57Araqin the parser, semantic checker and the codegens
10:45:12Araqie. your question makes little sense ;-)
10:45:28reactormonkhttps://github.com/Araq/Nim/issues/868
10:45:47*reem quit (Remote host closed the connection)
10:47:07reactormonkAraq, I have found nkAsgn...
10:47:29Araqthere is some shadow checking already done
10:47:41Araqin the right spot
10:48:37Araqsemstmts.nim:411
10:48:53Araqcheck if it conflicts with skResult and produce a warning
10:56:11reactormonkAraq, what's that shadow checking?
10:56:26reactormonkoKeepVariableNames <- ?
10:56:32Araqyup
10:58:55*reem joined #nim
11:00:54reactormonkAraq, how do I check for said conflict? I'd go "if sons[0].ident == "result""
11:00:59*dumdum joined #nim
11:01:37*mytrile quit (Read error: Connection reset by peer)
11:02:53Araqif shadowed.kind == skResult
11:03:13reactormonkahhh
11:03:36reactormonkI should get some fucking sleep
11:03:51Araqit's noon
11:04:15*alexruf quit (Quit: Textual IRC Client: www.textualapp.com)
11:04:24reactormonkAraq, Austin TX, here.
11:04:44reactormonkAraq, anyway, result isn't found by findShadowedVar
11:05:50Araqbut it should
11:07:01reactormonk let shadowed = findShadowedVar(c, v)
11:07:02reactormonk debug(n)
11:07:04reactormonk debug(shadowed)
11:07:11reactormonkgives me null on my test
11:07:30reactormonkhttp://sprunge.us/BIDM
11:07:32*gokr joined #nim
11:07:43Araqwell that's good
11:07:50Araqbecause your test has no 'result'
11:07:59Araqit doesn't have a return type
11:08:20reactormonkkk
11:08:24*Boscop__ joined #nim
11:08:28reactormonkyup, finds it when I add a result type
11:11:03Araqyeah it does
11:11:08reactormonkAraq, btw, it doesn't seem to have the sfShadowed flag, only sfUsed
11:11:09reactormonkresult_89005: ["sfUsed"], [], ["test.nim", 1, 0], skResult
11:11:30*phira quit (Read error: Connection reset by peer)
11:11:32*Boscop_ quit (Ping timeout: 245 seconds)
11:11:45Araqwhy would it?
11:11:51*phira joined #nim
11:12:26reactormonkwell, that's the shadowed result
11:12:58*gokr quit (Remote host closed the connection)
11:13:10*sillesta joined #nim
11:13:57*gokr joined #nim
11:18:01*vendethiel joined #nim
11:18:46reactormonkoh wait.
11:21:36reactormonkAraq, should I add a condition to warnShadowIdent or always warn?
11:21:48Araqalways warn
11:23:22reactormonkwarning only, no error, correct?
11:25:53Araqwarning only
11:26:04Araqperhaps later an error
11:26:12Araqbut we don't want to needlessly break code
11:26:17Araqbbl
11:28:12reactormonkhow do I test for warnings?
11:43:18*Jesin quit (Ping timeout: 264 seconds)
11:44:13*Jesin joined #nim
11:49:43*gokr quit (Quit: Leaving.)
12:06:53*akiradeveloper quit ()
12:13:52vendethielon the topic of last night's questions: "mixin" is interesting, but how does it know the signature? It's basically delayed until the template is invoked?
12:19:10*darkf_ joined #nim
12:23:14*darkf quit (Ping timeout: 272 seconds)
12:24:10*darkf_ is now known as darkf
12:40:21*Mimbus quit (Read error: No route to host)
12:41:13*flaviu quit (Read error: Connection reset by peer)
12:41:18*flaviu_ joined #nim
12:44:26*johnsoft joined #nim
12:49:11*flaviu_ is now known as flaviu
13:00:43*gokr joined #nim
13:40:09*EXetoC joined #nim
14:02:14ekarlso.eval @[1,2] & &[3,4]
14:04:13*dumdum quit (Ping timeout: 256 seconds)
14:14:40*ARCADIVS quit (Quit: ARCADIVS)
14:19:21*Mimbus joined #nim
14:19:23flaviuekarlso: ^
14:20:00ekarlsoflaviu: ......
14:20:02ekarlsoit's always dead :P
14:20:26ekarlsoflaviu: when you think we gonna use packages ? :D
14:21:58flaviuIt's not up to me, have a chat with Araq
14:22:08ekarlso:p
14:33:05*dumdum joined #nim
14:45:05*5EXAAD13L joined #nim
14:52:46*5EXAAD13L quit (Quit: Verlassend)
14:53:12*5EXAAD15X joined #nim
14:56:29*5EXAAD15X is now known as pafmaf
14:57:12*Trustable joined #nim
14:59:32*kashyap___ quit (Quit: Page closed)
15:00:19*dumdum quit (Ping timeout: 256 seconds)
15:00:39*pafmaf quit (Quit: Verlassend)
15:00:45*pafmaf joined #nim
15:01:26*darkf quit (Quit: Leaving)
15:26:12*BlaXpirit joined #nim
15:40:59AtomicBoolwill nim ever have a vm of its own, without compilation to C?
15:48:32AtomicBoolOk, anyone online so we can get started on this article?
15:48:44AtomicBoolI hope this to be the LAST article of nim vs rust
15:50:18flaviuAtomicBool: Nim already has an internal VM.
15:50:53AtomicBoolAs in, When will nim run without compilation to C?
15:51:59sillestadoes it need to?
15:53:22flaviuAtomicBool: It's already possible. $ nim i
15:53:40AtomicBooloh
15:55:39AtomicBoolI get errors when compiling with I instead of C
15:55:47AtomicBool"too many iterations"
15:55:50AtomicBoolany help?
15:56:06dtscodei is interactive mode
15:56:25dtscodeits still experimental iirc
15:56:32dtscodehttp://forum.nim-lang.org/t/817
15:57:04flaviuAtomicBool: It's trying to protect you from yourself by not allowing long loops.
15:57:28AtomicBoolI want it to allow long loops :(
15:58:12flaviupatch compiler/vmdef.nim:19
15:59:00AtomicBoolwut
16:00:17AraqAtomicBool: will Rust ever compile via its own backend, not via LLVM?
16:00:27Araqwhy is that important?
16:01:00AtomicBoolMainly because If use C, its C vs Rust
16:01:08dtscodeno its not
16:01:11AtomicBooluse the c way of compiling
16:01:15AtomicBoolyes it is?
16:01:19dtscodeno its not
16:01:24AtomicBoolHow so?
16:01:33Araqdoes C have exceptions or a GC?
16:01:40dtscodebecause it just happens to compile to c
16:01:48Araqproper closures? generics?
16:01:55dtscodethats like saying its not really c++ code, its just ELFs
16:01:57Araqcoroutines?
16:02:01AtomicBoolThat doesnt make sense, Nim compiles to C correct?
16:02:15Araqyes, but it *compiles*
16:02:18dtscodeyes. and c++ compiles to ELF format binaries
16:02:29AtomicBoolIm benchmarking here
16:02:33AtomicBoolnot comparing features
16:02:43dtscodeits still nim vs rust
16:02:45flaviuAtomicBool: Nim isn't like coffeescript, where it's a mostly 1:1 mapping.
16:03:34dtscodewhile im waiting for someone to answer my async question i think i might write a brainfuck interpreter
16:04:06def-dtscode: that's really fun in nim: https://github.com/def-/nim-unsorted/blob/master/brainfuck.nim
16:04:20AtomicBoolI fail to see how its still nim vs rust, when nim->C->
16:04:49dtscodewhy not just say its AT&T ASM vs Rust? since c compiles to that
16:05:10AtomicBoolIm talking about the same level of compilation
16:05:22dtscodewhy does that matter?
16:05:25AtomicBoolNim has one more compilation than Rust does
16:05:30dtscodeno it doesnt
16:05:35dtscodenot if rust uses llvm
16:06:19AtomicBoolwhats the main source of Nim's speed?
16:06:41Araqmaybe our good backend that produces good C code?
16:06:46dtscodeand anyways, even if it did, so what? if you take the Nims compiler IR then you have to use Rust's IR
16:06:52Araqand our not too shitty GC?
16:07:00AtomicBoolit was an experiment anyway, if it was too difficult, I would just use nim c
16:07:14AtomicBoolExactly
16:07:30AraqAtomicBool: you have no idea of how much effort was put into producing efficient C code
16:07:42Araqit could easily generate crappy C code instead
16:07:45AtomicBoolI am not bashing anything?
16:07:52sillestaAraq: unrelated: what makes nim's GC different from say Java's, and why doesn't java use one similar to nim?
16:08:19AraqAtomicBool: you pretend that compiling to C is like some cheap hack but it's not.
16:08:28dtscodeAraq, no you misunderstand
16:08:29Araqit's hard.
16:08:30AtomicBoolI am not...
16:08:53dtscodehes saying that since nim compiles to c then you are really comparing the speed of c and rust
16:09:06AtomicBoolthe speed of good C code in this case
16:09:33Araqwell so what? do you even know how C-like LLVM's IR is?
16:09:38dtscodeand im arguing that if you say that, you cant stop there. you would have to go to Rust compiler IR
16:10:43AraqRust seems to produce some suboptimal LLVM code, currently. in principle the languages are on par, efficiency wise
16:11:14AraqRust has some advantage not requiring a GC, but then Nim's thread local heap is a much better default than Rust's
16:11:50flaviusillesta: Thread-local heaps helps avoid lots of complexity.
16:12:03Araqif you buy the "Nim needs a GC to work" argument, that is.
16:12:36AtomicBoolRust's LLVM IR is no where its supposed to be rn
16:14:03flaviuAtomicBool: Does https://gist.github.com/dbc263cbc8b0ff52821f look like anything but "portable assembler"?
16:14:32dtscodeholy shit def thats a lot of nim
16:14:49AtomicBoolits not on our priority list, with all these stabliazations
16:14:54def-dtscode: was fun to write and learned the language
16:15:05dtscodedef-, i meant the repo itself
16:15:12def-i know
16:15:23dtscodeoh
16:16:08AtomicBooldoes nim use gcc?
16:16:26def-AtomicBool: you can use many c compilers, like gcc, clang, icc, tinycc
16:16:35def-but default is gcc
16:16:40AtomicBoolby default, which?
16:17:03dtscodepcc works too :D
16:17:43AraqAtomicBool: btw dom96 is working on a native codegen for fun (!) and he recently told me "you know what? generating asm is easier than generating C"
16:18:24Araqand I can only agree
16:18:49dtscodeso we are getting closer to being our own standalone tool?
16:18:57flaviuAraq: What about register allocation?
16:19:03AtomicBoolude, I have no fucking idea how hard it is to do what you do
16:19:21Araqflaviu: you don't have to do that at all really.
16:19:45Araqgenerating *fast* asm surely is harder than generating C, don't get me wrong here
16:20:15AtomicBoolIm only 16, I'm trying to learn, not bash other languages
16:20:17Araqbut generating asm is pretty simple
16:20:27Araqwhen you are not after speed
16:20:48AtomicBoolso literally correct me if Im wrong, This is all the learn after all
16:20:51*reem quit (Remote host closed the connection)
16:21:39reloc0Araq: but even when you just create any asm, you still have those nasty platform issues so much more then when using c as an intermediate language . thus i always thought that it was a very wise decission for nim to use c and reuse everything the c compiler can do.
16:21:47flaviuAraq: Where do you store locals though?
16:21:51def-AtomicBool: you can consider it an implementation detail how the nim/rust code get compiled into a binary. i don't think that's relevant for benchmarking the languages
16:22:00Araqflaviu: on the stack
16:23:06flaviuvar i = 0; var j = 0; inc i. What happens there?
16:24:12Araqyou output some load; inc; store triple
16:24:57AtomicBoolso does nim use gcc be deafult?
16:25:00AtomicBooldefault?
16:25:08dtscodeif it can, yes
16:25:14flaviuAtomicBool: https://github.com/Araq/Nim/blob/devel/config/nim.cfg#L10
16:25:58AtomicBoolok den
16:26:01Araqreloc0: the nasty platform issues are worse with C than with asm. asm is mostly well defined, in C every basic operation is pretty much full of UB
16:26:36Araqwe generate C because it's universally available with good optimizers everywhere
16:26:45reloc0Araq: ah interesting.
16:27:06AtomicBoolI dont think im going to include compiler flags, since thats an LLVM vs gcc thing
16:27:09reloc0but i thought that it was probably to reuse the optimizers that the c-compilers have
16:27:26AtomicBoolso both w/out compiler flags
16:27:36def-AtomicBool: you should do release/optimized builds, otherwise it's useless
16:27:46AtomicBoolwhats useless?
16:28:01flaviureloc0: It's impossible to reuse code from GCC, it's GPL. It's possible to use code from Clang, but that's just called emiting LLVM IR.
16:28:06def-AtomicBool: to compare the performance of debug builds
16:29:10Araqreloc0: and don't let me get started about what you can express in asm that you can't in C ;-)
16:29:11AtomicBooldef-, the flags used in rustc vs nim d:release so different things since they are both different compiler backends
16:30:05AtomicBoolits a factor of the compiler backends witht he flags, not the language implmentation itself imo
16:30:15reloc0Araq: i know that from my work with microcontrollers :) on those things c is close to the hardware but still a fat abstraction layer.
16:31:47dtscodehow do i read just one char from input?
16:33:49AtomicBoolOkay....
16:34:07AtomicBoolSo does anyone have time to translate a few lines of code with me?
16:34:15AtomicBoolAraq? :)
16:34:51AraqI don't really have time to be in #nim
16:35:57def-AtomicBool: try it yourself? best way to learn about a language
16:37:22AtomicBoolI was thinking if one nimcoder did the nim, and one Rust coder did the Rust, and we came to some sort of agreement of how this is set up, the benchmarks would be unbiased
16:37:46AtomicBoolI dont want to create a biased article towards Rust
16:37:47EXetoCAraq: leave, or rename to Araq_ and ignore messages :p
16:38:10*NimBot joined #nim
16:38:15AtomicBoolthere lil PE code snippets
16:38:17def-i can probably translate a few pieces of code, but no guarantees
16:39:09AtomicBoolIm sure u can, max lines of code there was i think was like 30, but i might not do those
16:39:28AtomicBoolOkay last night, we did a one benchmark
16:39:53AtomicBooldef-, I hope you understood my reason for excluding compiler flags for both langs right?
16:40:19def-AtomicBool: oh, you want to run "nim c file" without -d:release?
16:40:35def-that's totally useless, spits out unoptimized code full of debugging stuff
16:40:38def-will always be slow
16:40:41AtomicBoolYes, same with Rust, no rustc -O rust.rs
16:40:54def-so you're just comparing which language has more debugging stuff in by default?
16:41:04AtomicBoolEssentially
16:41:10def-why is that relevant?
16:41:14EXetoCdtscode: from stdin? possibly with the readline wrapper
16:41:17AtomicBoolfor the reasons I said above
16:41:33def-No one will run performance dependent code without -d:release
16:41:36AtomicBooland rustc's IR isnt optimized using -O
16:42:04Araqis --stackTrace:off allowed then?
16:42:29EXetoCdtscode: or something like termbox (nimble package)
16:42:33Araqor how are you gonna compare the quality of stack traces
16:42:49def-If you make a speed comparison, you make sure each participant can get as fast as possible, not as slow as possible
16:42:52AtomicBoolwait why do we need stack traces?
16:43:19Araqfor debugging convenience?
16:43:37AtomicBooldef-, but -O doesnt optimize rustc's IR for the reason that rustc at the moment doesnt spit out good IR, for the priorites that the Rust dev team has rn
16:43:55AtomicBoolSure, we can add --stackTrace:off
16:44:06Araqif you compare debug compile modes, maybe you should start comparing debug experiences?
16:44:34def-AtomicBool: so because rust doesn't optimize well, nim shouldn't be allowed to optimize well either? What?
16:45:01AtomicBoolthe Original IR isnt ready
16:45:26AtomicBoolHowever, I think now we should include both
16:45:44AraqAtomicBool: I'm not even sure Rust produces poor IR. do you use the most recent version of it?
16:46:12def-yeah, in most benchmarks Rust does quite well
16:46:15AtomicBoolAraq, the Ir spit out by rustc is not what its supposed to be
16:46:23Araqaccording to whom?
16:46:41AtomicBoolAccording to everyone in Rust
16:46:51*EXetoC quit (Quit: WeeChat 1.1.1)
16:47:04AraqI surely hope this has been confirmed by a coredev
16:47:21AtomicBoolI can go double check?
16:47:29Araqcause to me that's a statement that would be true 2 years ago
16:47:40Araq*was true
16:48:20dtscodeis everything in a seq already initialized to nil?
16:48:28Araqdtscode: yes
16:49:00dtscodeMimbus: let foo = newSeq[char];echo(foo[3])
16:49:12dtscode.exec let foo = newSeq[char];echo(foo[3])
16:49:20dtscodeMimbus, let foo = newSeq[char];echo(foo[3])
16:49:23dtscodegrr
16:49:32dtscodemimbus, let foo = newSeq[char];echo(foo[3])
16:49:42Araq1. it's newSeq[char]()
16:49:50Araq2. you will get an out of bounds error
16:49:55dtscodesorry, meant that. and damn
16:49:56AtomicBoolAraq, Rust sint as fast as it should be right
16:49:57Araq3. do that in #nim-offtopic
16:50:03dtscodealright
16:50:11AtomicBoolThey arent doing anything about rn because of the stabilization of the language
16:50:17AtomicBoolsince 1.0.0 alpha
16:51:15def-AtomicBool: then wait until rust is fast enough for you and do the comparison with full optimizations then?
16:51:36AtomicBoolThats weeks from now
16:51:51BlaXpiritsigh
16:51:57AtomicBoolbut I guess its fair :/
16:52:03BlaXpiritwho the hell cares
16:53:34AraqAtomicBool: IMHO you should at *least* use -d:release and -O for the comparison
16:53:56Araqand then you should check what C compiler works best with the C code that Nim produces.
16:54:11AtomicBoolThats nice
16:54:22Araqand that's fair because Nim offers this flexibility
16:54:39Araqso it's unfair to pretend it doesn't exist
16:54:47flaviu.eval echo ".exec doesn't do anything"
16:54:52Mimbusflaviu: .exec doesn't do anything
16:54:55AtomicBoolWell I decided that I will, once coreteam focus on rustc's IR
16:56:06Araqin fact, it's easier to test different C compilers with Nim code than with hand written C code
16:56:19AtomicBoolActually im curious
16:56:29flaviuAtomicBool: Microbenchmarks are pointless anyway. Nim and Rust have roughly the same performance.
16:56:35AtomicBoolWhats the nim equivalent to this? https://github.com/Ap0ph1s/ProjectEuler/blob/master/src/Problem24.rs
16:58:31def-don't think there's a permutation proc in the stdlib
17:01:53BlaXpiritanyone remade python itertools?
17:02:14BlaXpirit(need to think how much itertools would even make sense in nim)
17:02:28*threewood joined #nim
17:02:31def-BlaXpirit: i only remade sequtils to iterutils: https://github.com/def-/nim-iterutils
17:02:55BlaXpirit"what sequtils should've been"
17:03:13BlaXpiritit is very concerning that we need 2 versions of each function: iterator vs seq
17:03:45def-yes, should be improved
17:03:50BlaXpiritit is also concerning that we need 2 versions of each function: ones that take a proc and ones that are templates on `it`
17:08:50def-BlaXpirit: agreed
17:10:13BlaXpiritin a language like python iterators have a huge overhead, and yet many functions return only iterators
17:11:09BlaXpirithere it is not that big of a deal, and it sure would be awesome to have optimizations that make functions that return iterators have 0 overhead when converted to seq
17:11:44BlaXpiritin fact, it might already as optimal as possible for non-closure iterators
17:11:49def-AtomicBool: apart from implementing nextPermutation it's easy: https://gist.github.com/def-/28574c7d9703eab87ec5
17:13:12def-Should we put nextPermutation and prevPermutation into algorithm?
17:13:34BlaXpiritlooks like a good place
17:13:35BlaXpiritBUT
17:13:44BlaXpiritmaking "nextPermutation" is suboptimal
17:13:52BlaXpirititerator is much more efficient
17:14:00BlaXpirit(well, why not both)
17:14:05AtomicBoolglad to have inspired
17:14:25BlaXpiritwait, it is not "much" more efficient, if at all :|
17:14:40def-BlaXpirit: well, i have a few implementations of permutations iterators
17:14:42AtomicBoolit shorter
17:22:36*mapdog joined #nim
17:23:28BlaXpiritbecause of abundance of such things, I really fear 1.0
17:24:08BlaXpiritthings like mentioned 20 minutes ago
17:24:34def-BlaXpirit: find ways to fix them and work on it?
17:25:17BlaXpiritit's everywhere in stdlib...
17:25:25BlaXpiritgoes down to ideology
17:34:04*mapdog quit (Quit: Page closed)
18:08:43*silven quit (Ping timeout: 245 seconds)
18:10:23*silven joined #nim
18:10:56AtomicBoolhttps://i.imgur.com/ASiD3tH.png
18:11:30AtomicBoolthats mem::swap
18:11:53*BitPuffin quit (Ping timeout: 240 seconds)
18:13:19ekarlsoAraq: how do you think of something like a pkg registry ?
18:24:31flaviuAtomicBool: So what? It looks scary, but it's not nearly as bad as it looks.
18:25:17AtomicBoolIt's what I mean by how we still need to improve
18:27:54*EXetoC joined #nim
18:28:30flaviuAtomicBool: If you look carefully, you'd see that it does only what is necessary. It doesn't do any extra work.
18:28:32*jsudlow quit (Remote host closed the connection)
18:29:05AtomicBoolIt's still atrocious
18:29:14AtomicBoolAnd that's only men::swap
18:29:21AtomicBoolMem
18:31:44flaviuIt isn't "just" mem::swap. It's mem::swap<Option<Result<(), Box<Any + Send>>>
18:32:26ekarlsorust in here now ? :p
18:34:23flaviuNah, just trying to show him that "It looks complicated" != "It is complicated"
18:34:51ekarlsoah
18:36:46*jasondotstar quit (Read error: Connection reset by peer)
18:37:07*d3m1gd joined #nim
18:37:19*jasondotstar joined #nim
18:38:39d3m1gdanyone experimented with real life compilation to js? how do one access window.* and document.* if those are seen by compiler as undefined?
18:38:39*flaviu quit (Read error: Connection reset by peer)
18:38:39*Mimbus quit (Read error: Connection reset by peer)
18:39:51*flaviu joined #nim
18:41:50*BlaXpirit quit (Remote host closed the connection)
18:43:06vendethielI'm not completly finished reading the manual, but I don't think I've seen it, so I'll ask: is there a way to turn an operator into a (possibly curried) function?
18:43:21vendethiellike (+) to get a arity=2 function (that adds both arguments)
18:43:32flaviu`+`
18:43:51*Mimbus joined #nim
18:44:21vendethielflaviu: ooh, thanks!
18:44:34*Mimbus quit (Excess Flood)
18:44:41*Mimbus joined #nim
18:47:37vendethielare "destroy", "deepCopy", etc, procs always exported?
18:47:43def-d3m1gd: Didn't experiment much: http://hookrace.net/blog/what-is-special-about-nim/#compile-to-javascript
18:48:04vendethieli.e. if I export a type but not the "destroy", what happens?
18:51:40d3m1gddef-: import dom, that's it. Sorry for being so blind, it is mentioned in the docs
18:55:05*BlaXpirit joined #nim
19:01:17*jsudlow joined #nim
19:03:18*mapdog joined #nim
19:06:38AtomicBoolNot that's its complicated,it's not optimizrd
19:09:58dom96AtomicBool: You should really listen to what people are telling you here. You said yourself that you are 16 and you are not yet experienced.
19:13:11*alexruf joined #nim
19:15:12Araqvendethiel: they are bound to the *type*, that doesn't mean they are visible
19:15:41Araqbut there is no way to get around them, the compiler knows about them and ensures they end up being called
19:17:02Araqekarlso: I have no opinion on a package registry. dom96 is the guy to ask.
19:18:55vendethielAraq: that makes sense, thanks
19:19:34ekarlsodom96: should search support both tags || name at once ?
19:20:41*kuzy000_ quit (Ping timeout: 250 seconds)
19:21:10*kuzy000 joined #nim
19:24:01Araqekarlso: yes, search usually should be smart
19:24:27Araqnobody wants to stop and think "err, am I searching names or tags or ...?"
19:24:47flaviuekarlso: See how stackoverflow does tag search.
19:25:01Araqplease think about the users who also have real work to do ;-)
19:27:12AtomicBoolIdk what I'm saying wrong
19:27:58*VinceAddons quit (Quit: Leaving)
19:29:27flaviuAtomicBool: I've blocked out all the noops: http://i.imgur.com/ADO1xnd.png
19:34:19*dumdum joined #nim
19:36:32AtomicBoolflaviu: I'm saying its not optimized, nothing more
19:38:18AraqBlaXpirit: I don't see the problem. this is just "the perfect is the enemy of the good" idea at work
19:39:23Araqthe alternative would be to have no useful stdlib at all until everything that the language offers is perfect
19:39:55Araqthat doesn't even work for when you have as much resources as Microsoft
19:40:18*Jesin quit (Quit: Leaving)
19:44:45Araqalso note that the "everything has to be lazy" idea can also be implemented via "use 'seq' freely and implement a deforastation pass in the compiler instead"
19:46:00flaviuAraq: But that doesn't work if I use my own sequence type.
19:49:31Araqthat's a fair point, but then you end up designing the whole language and stdlib for the rare edge cases
19:50:12*d3m1gd quit (Ping timeout: 252 seconds)
19:50:41Araqand at the end you still get incompatibilities in the form of std::vector vs wxWidgets::vector. hurray.
19:51:30flaviuwhich is what typeclasses are for!
19:52:16Araqyes. so every single proc ends up being generic. that's what Clay did.
19:53:57flaviuClay is actually quite nice.
19:57:35Araqyeah but it's not yet clear to me that the excessive generics everywhere are actually better than what you get with Luajit
19:57:50*alexruf quit (Quit: Textual IRC Client: www.textualapp.com)
19:59:54flaviuI'm not sure what luajit has to do with anything.
20:00:54Araqclay's problem was excessive binary sizes
20:01:16ldlework I'm surprised that binary size is even a consideration these days
20:01:20*jsudlow quit (Quit: Leaving)
20:02:16ldleworkSeeing as how there is a significant movement to ship all software with an accompanying environment (Docker, et al)
20:03:11Araqwhen I spoke with Clay's lead developer he told me to not repeat Clay's mistake, but hey, what do I know.
20:04:29flaviuIn some cases, Java-style generics are desirable, and in others C++-style generics are desirable.
20:05:24Araqno, Luajit's technology to deal with this mess is desirable ;-)
20:06:48Araqbut Mike Pall is not in IRC, so I can't convince him to join Nim dev and so we're stuck with generating C
20:07:37flaviuI don't understand what you're saying about luajit. Do you have a link or something I can google?
20:09:44Araqno, but I mean that it does specialization at runtime when it's necessary and that seems to me the best thing. as then you have no inherent compile-time specialization vs code size tradeoff to make
20:10:31Araqwell the tradeoff is still there at runtime
20:10:44Araqbut library development is so much easier as a result
20:12:19AraqThere is an inherent Stream vs generic iterator/type classes/whatever design tradeoff.
20:12:40ekarlsodom96: any clue on why I get illegal storage access when doing some query parameters ?
20:12:55flaviuekarlso: Because you have something nil.
20:13:20Araqthis tradeoff exists in C++, D, Nim and afaict in Rust too.
20:14:00Araqbut I think you can get rid of it with JIT technology.
20:14:35flaviuBut JIT really makes native interop and cross-platformness more difficult.
20:15:25ekarlsoflaviu: nah, because jester logs doesn't even log the GET
20:15:27ekarlsohttp --verify no "https://nim-pkg.svcs.io/packages?name=nre&name=asdadasd"
20:15:53ekarlsohttp --verify no "https://nim-pkg.svcs.io/packages?name=nre&tag=asdadasd" as well
20:15:58ekarlsomakes it go boom
20:16:03flaviuekarlso: gdb!
20:16:16*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
20:16:16flaviu--linedir:on --debuginfo and then open it up in gdb
20:16:42ekarlsoperson that makes me a better way of writing queries
20:16:45ekarlsowill get a beer :|
20:17:45flaviuhttps://www.sqlite.org/docs.html
20:18:02ekarlsoflaviu: yeah, but mapping query strings to stuff atm is meh
20:18:15flaviuhttp://sqlitestudio.pl/ is also incredibly useful.
20:18:39ekarlsoflaviu: I meant mapping nim code to sql :p
20:18:46ekarlsoa'la sqlalchemy core in python
20:18:54*dc0d joined #nim
20:19:37*jsudlow joined #nim
20:19:43*jsudlow__ joined #nim
20:19:52*jsudlow__ quit (Remote host closed the connection)
20:20:16def-Araq: can't convice Mike Pall by mail?
20:21:29ekarlsoflaviu: how do you run gdb then and pass args to the program ?
20:22:11flaviugdb myprogram, and when you're in the shell, `run --ihave=many --opts`
20:22:39*Demon_Fox joined #nim
20:23:01*dc0d quit (Ping timeout: 246 seconds)
20:26:34ekarlsoflaviu: what to look for when it borks?
20:26:38ekarlsoor do
20:27:21flaviuprint stuff
20:27:21flaviuhttps://gist.github.com/flaviut/487be89b8abfae2612e8
20:28:12ekarlsogawd
20:28:15ekarlsotoo man variables there
20:28:52*davidhq joined #nim
20:29:29ekarlsomeh, flaviu any ideas ? :p
20:29:44flaviui lo
20:29:57Araqdef-: maybe I should try.
20:30:30ekarlsoflaviu: sorry ?
20:30:42flaviutype `i lo`
20:31:15ekarlsohttps://bpaste.net/show/b1066c6ff416
20:32:22reactormonkAraq, how do I test warnings with the tester?
20:32:43flaviuekarlso: The line that gdb stopped on probably can give you clues about which variables you care about. `print *foo` will derefrence foo and print it.
20:33:52Araqekarlso: your 'result' var is borked
20:34:09*bjz joined #nim
20:34:47*mapdog quit (Quit: Page closed)
20:35:36Araqreactormonk: msg: "compiler message"
20:35:41Araqline: 24
20:35:43reactormonkok
20:35:44Araqiirc
20:36:56*Sornaensis quit (Excess Flood)
20:37:41*Sornaensis joined #nim
20:39:38AtomicBoolWhats a trade-off in Rust?
20:40:49*jsudlow quit (Quit: Leaving)
20:42:15ekarlso Araq ... but which one
20:42:37Araqbt gives you a stack trace
20:43:49flaviuekarlso: print out http://www.cs.berkeley.edu/~mavam/teaching/cs161-sp11/gdb-refcard.pdf and keep it next to your computer.
20:43:52ekarlsohmmms
20:44:04ekarlsoseems like a jester bug
20:44:07*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
20:44:51ekarlsohttps://bpaste.net/show/dcdbf12f0084
20:52:54*bjz joined #nim
20:52:56Araqekarlso: there is still a codegen bug that is affecting jester and this surely looks familiar. sorry.
20:53:07Araqlet me fix it asap
20:54:50*bjz quit (Client Quit)
20:57:24dumdumthis: http://pastebin.com/ZM5w3EHG causes compiler check to never end though it reports 'Error: recursive dependency: 'items'
20:59:02*Jesin joined #nim
21:02:06Araqdumdum: what about a real bug report?
21:07:10*dc0d joined #nim
21:07:31dumdumook
21:07:39dumdum#2051
21:08:32*dc0d quit (Client Quit)
21:08:39*BitPuffin joined #nim
21:09:25*jsudlow joined #nim
21:10:41*bjz joined #nim
21:12:31*gokr_ joined #nim
21:14:45*superfunc[mobile joined #nim
21:17:40superfunc[mobileNot sure if anyone has experience with bsd here, but I'm having trouble building Nim on it. Seems to be from a use of u_int32_t in the system header netinet/in.h
21:17:50def-superfunc[mobile: freebsd?
21:18:01superfunc[mobileYeah
21:18:02def-we recently had a fix for freebsd building
21:18:07def-wtw should now
21:18:36def-https://github.com/Araq/Nim/pull/2010
21:18:49*d3m1gd joined #nim
21:20:39*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
21:20:59*bjz joined #nim
21:22:07def-superfunc[mobile: but apart from that it built
21:24:58*gokr_ quit (Ping timeout: 245 seconds)
21:25:37*bjz quit (Ping timeout: 264 seconds)
21:26:41*gokr_ joined #nim
21:31:19*dumdum quit (Ping timeout: 256 seconds)
21:34:49wtwsuperfunc[mobile: what problem did you have exactly?
21:40:53*kuzy000 quit (Ping timeout: 240 seconds)
21:42:30superfunc[mobilehttp://imgur.com/Glaj6FC
21:42:42def-superfunc[mobile: not loading
21:42:48superfunc[mobileErr, one src
21:43:11superfunc[mobilehttp://m.imgur.com/GIaj6FC
21:43:23superfunc[mobileThe I looked like an L to me
21:43:43def-good that the nim compiler warns about using a lowercase l
21:43:53superfunc[mobileHell yea
21:45:20def-u_int32_t is bsd specific, shouldn't it be uint32_t?
21:45:53EXetoCI think so
21:46:24wtwthis stuff is usually defined in /usr/include/sys/types.h
21:46:51wtwas a workaround something like #define uint32_t u_int32_t would do
21:47:39flaviusuperfunc[mobile: http://i.imgur.com/XBFaSfN.png?1
21:48:07flaviuDejaVu Sans Mono
21:48:57EXetoCwtw: stdint.h?
21:50:23wtwmy stdint.h includes <sys/_types.h> which contains __uint32_t but not u_int32_t
21:51:14wtwafaik this u_int_bla things are also deprecated
21:51:17d3m1gdi want to use console.log on js target, so i put this in my dom.nim: log*: proc (item: ref RootObj) {.nimcall, varargs.}
21:51:27d3m1gdit works for ref TNode for example
21:51:37wtwah yes: typedef __uint8_t u_int8_t; /* unsigned integrals (deprecated) */
21:51:48d3m1gdbut not for strings. how to make it work for any object?
21:53:19wtwbbl
21:53:27EXetoCdoes the dom stuff even work?
21:54:34EXetoCthere was something that I just couldn't figure out, and then I was told that it was unfinished, though that was a couple of months ago
21:55:10d3m1gdit works, but not unfinished, yes. Trivial to extend though
21:55:18d3m1gdbut unfinished*
21:56:19d3m1gdapart from the stuff that some functions can take any javascript object, so need some way to express it in nim
21:56:42*kniteli joined #nim
21:57:28superfunc[mobileThat fixed it, thanks everyone
21:57:32superfunc[mobileThough, we may want to make note of a fix on the nim end, rather than the bsd end
21:58:32VarriountMeep
21:58:38dom96hello
21:58:47EXetoCd3m1gd: what works? I can't even use the global vars
21:59:09EXetoCto set the background color for example
21:59:29superfunc[mobileSup Dom
22:00:05dom96New term of uni starting soon, apart from that not much. What's up with you?
22:00:06d3m1gdEXetoC: document.getElements* works with 'document' being global.
22:00:21d3m1gdEXetoC: what exactly you want to set color of?
22:01:00EXetoCd3m1gd: document.bgColor = ... just as a test
22:01:38EXetoCI'll mess around with those functions
22:01:44d3m1gdEXetoC: ok, will make some tests
22:03:50EXetoCd3m1gd: oops, I did "nim js -r ..."
22:04:04d3m1gdEXetoC: yup, works. Can set attributes. bgColor has put bgcolor on body for me
22:04:51EXetoCso the actual problem before was the fact that everything would blow up as soon as an exception was raised
22:05:08*Demos joined #nim
22:05:12d3m1gdoh, didnt cross that yet
22:05:27EXetoCd3m1gd: yes, it was "-r" that caused the problem. gotta have access to the dom, of course
22:07:00d3m1gdEXetoC: what does -r do exactly? it is not on help page of compiler
22:07:42EXetoCd3m1gd: it runs the program after compiling
22:08:17d3m1gdand i still have no idea how to tell proc to take anything as an argument for console.log
22:08:26d3m1gdEXetoC: oooh, yup =)
22:09:40EXetoCd3m1gd: echo?
22:10:17EXetoCyes
22:10:32d3m1gdEXetoC: well, echo append elements to body, and i think in string form, which is not satisfactory
22:11:28d3m1gdEXetoC: with proper conrole.log you can debug node elements and all kind of stuff only with log, as is does not make everything to string, but keeps objects as objects
22:11:32EXetoCbut the generated source just invokes console.log
22:12:03d3m1gdbut it does not compile with console.log("hello"), as "hello" is a string
22:12:35d3m1gdlog*: proc (item: string) would fix it, but want the refs too.
22:12:50EXetoCwhat do you mean? rawEcho(cstrToNimstr("test"));
22:13:02d3m1gdactually want compiler to forget about types at all for this exact proc
22:13:09EXetoCok
22:13:35EXetoCvar buf = ""; yeah that's not very useful
22:22:52d3m1gdit turns out i overlooked jssys.nim in system, which deals with console.log. Included it and get a compilation error: lib/nim/system/jssys.nim(102, 3) Error: undeclared identifier: 'name='
22:29:01d3m1gdok, it is way easier than i expected. Wrap calls to console.log in asm""" """ and it is all good! thats why reading sources is good ^__^
22:30:33superfunc[mobiledom96: mostly research stuff keeping me busy
22:35:02*milosn quit (Ping timeout: 272 seconds)
22:35:57*milosn joined #nim
22:39:30wtwsuperfunc[mobile: what did you do in the end?
22:40:23superfunc[mobileAdded the define to the file
22:40:40wtwok
22:41:01*milosn quit (Ping timeout: 256 seconds)
22:41:14wtwas this is deprecated I'm not sure if we should bother changing something in nim
22:41:36wtwok, although deprecated it's used within some bsd headers...
22:42:07superfunc[mobileYeah it's in the most recent rc
22:42:59wtwI'm still not very familiar how things are done in nim, afaik there is a linux-specific file, perhaps a bsd-specific one could contain fixups of this kind
22:43:50*AtomicBool left #nim (#nim)
22:44:06wtwor it could be done only for the bsd port, keeping the platform-specific things at a minimum
22:44:59wtwwell, we'll find a way ;)
22:46:55*DemonOne joined #nim
22:48:04*milosn joined #nim
22:55:40*ehaliewicz joined #nim
23:14:54reactormonkAraq, nope, "msg" isn't checked
23:26:49*sillesta quit (Ping timeout: 264 seconds)
23:28:19superfunc[mobilewtw: we could possibly have build sh fix it in csources?
23:29:26*gokr quit (Quit: Leaving.)
23:37:54*pafmaf quit (Quit: Verlassend)
23:46:25gmpreussner|workdom96: what's the preferred versioning scheme for nimble packages that contain bindings to third party libs? should we use our own versioning, or should we match the version of the libs?
23:47:09dom96gmpreussner|work: That's up to you to decide.
23:47:13BlaXpiritgmpreussner|work, i'd say this is not specific to nim :|
23:47:18dom96We don't really have a preference
23:47:38gmpreussner|workok
23:53:14reactormonkdom96, how about two version numbers? ^^