<< 11-04-2015 >>

00:00:06BlaXpiritrenesac, sure .get gives u exceptions
00:00:22BlaXpiritand yes, these are are also my favorite Maybe names
00:00:46renesacwell, but then the code ends up littered with .gets
00:00:53renesacif people starts using maybes everywhere
00:01:06renesacI don't know
00:01:18flaviuDoing headers with RST is a PITA.
00:01:32BlaXpirit3 first words were unnecessary
00:01:41renesaclol
00:01:43flaviuI can't write the header until I've rendered it, since the underline needs to be the same length as the header.
00:01:53BlaXpirito.o
00:02:07BlaXpiritare you doing nre?
00:02:16renesacwhen the nim forum will accept markdown instead of rst?
00:02:20renesac:P
00:02:27flaviuBlaXpirit: I'm calling it "docweave".
00:02:32*saml_ joined #nim
00:02:50BlaXpiritso you're making some trickery
00:03:07BlaXpiritflaviu, but you'd still need to do rst without trickery if it is to be in stdlib
00:03:17BlaXpiritthere will be no readme
00:03:36flaviuBlaXpirit: I don't really care about this module getting into the stdlib.
00:03:43flaviuIt's just a utility.
00:03:49BlaXpiritoh come on
00:04:23flaviuActually, I'd be actively against this being put in the stdlib.
00:04:31BlaXpirit-__-
00:05:07BlaXpiritno reason
00:05:15renesacwhat module?
00:05:53flaviuBlaXpirit: It doesn't belong.
00:05:58flaviuhttps://github.com/flaviut/docweave
00:06:40*bcinman quit (Quit: My Mac has gone to sleep. ZZZzzz…)
00:06:50BlaXpiritflaviu, it will be the dawn of stdlib
00:07:02flaviuThis module does not belong.
00:07:07*bcinman joined #nim
00:07:08BlaXpiritwell i'm talking about nre
00:07:20flaviuOh, sorry for the confusion then.
00:07:26BlaXpiritand i assumed you wanted to make "docweave" to do tricks with "nre"s docs
00:07:46flaviuNah, I just want it to extract nre's docstrings into a readme.
00:08:16BlaXpiritok
00:08:34renesacno comments or documentation, I'm not really sure what it does from a first glance
00:08:44BlaXpirit> extract nre's docstrings into a readme
00:08:45renesacan alternative for html doc gen?
00:09:02BlaXpiriti assume it's like rst doc gen
00:09:32BlaXpiritgenerate a rst file
00:10:06renesachum
00:10:43flaviuBlaXpirit: Yeah.
00:11:26renesacBlaXpirit: any reason why your proposed Maybe don't have the `or` operator?
00:11:50renesacand I'm not really sure if I'm a fan of the "?" and "?=" operators
00:12:03BlaXpiritrenesac, the reason is i don't get it
00:12:28BlaXpiritif you are knowledgable of these things, do give feedback
00:12:38BlaXpiritfor now i'm just gonna make a pull request with the base version
00:12:41renesacwell, I programmed some in Lua
00:13:14renesacand there the "or" on non booleans would test for nil and return the first non nil object
00:13:17renesacor nil
00:13:40BlaXpiritthis is not Nim's style
00:13:45renesacthat seems exactly what that `or` operator is for
00:13:56renesacwhat is nim's style?
00:14:11BlaXpirit`or` operator returns a boolean or the result of a bitwise operation
00:14:34renesacthe `or` operator only returns a boolean if comparing two booleans
00:14:49renesacit is overloaded for integers, to do something completely different
00:14:58BlaXpiritlike i said
00:15:08renesacit can also be overloaded to Maybe[T]
00:15:23dom96it's also overloaded for Future[T]
00:15:26renesacto do something closer to it's logical meaning
00:16:15renesacthe only problem with all those overloads is if you make a mistake somewhere, it can pass quietly because the other type is also acceptable there
00:16:35renesacI'm not sure how much of a problem it is in real life though
00:16:50BlaXpiritm or x is not worth it because nim has if m: m else: x
00:16:51*bcinman quit (Quit: My Mac has gone to sleep. ZZZzzz…)
00:16:54BlaXpiritor something like that
00:17:08flaviuInstead of or, it's possible to do myOption.get(foo)
00:17:16flaviuIf myOption is None, that returns foo.
00:17:25BlaXpiritit's slightly different but yes, i have that in
00:18:34renesacflaviu: it isn't as clear what "foo" means in this expression by just looking at it w/o knowing the name of the parameter
00:18:56BlaXpiritit's anything
00:19:03renesacI would guess you were getting a "foo" field in myOption
00:19:08BlaXpiritm.get(foo) is pretty much m or foo
00:19:18renesacyeah
00:19:26BlaXpiritit's a kind of a pythonism
00:19:38flaviuYes, inspired by python.
00:19:52renesacit is?
00:20:01dom96OT: I love macros.quote.
00:20:23BlaXpirithttps://docs.python.org/dev/library/stdtypes.html#dict.get
00:21:02renesachum
00:21:29renesacI still don't like the look of it
00:22:02renesacof course, it would be annoying if dic["abc"] returned an option I guess
00:22:03BlaXpiritit's just so usual to me from python that i didn't consider that it's weird
00:22:32BlaXpiritother names welcome
00:22:38renesac`or`
00:22:46BlaXpiritnope :|
00:23:16BlaXpiritalthough...... actually it kinda makes sense
00:23:46BlaXpiritif m1 or m2: will still work
00:24:16*Matthias247 quit (Read error: Connection reset by peer)
00:24:29*davidhq quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
00:24:55BlaXpiritshould just steal these https://github.com/fowlmouth/nimlibs/blob/master/fowltek/maybe_t.nim#L31-L35
00:25:04*jholland quit (Quit: Connection closed for inactivity)
00:25:24BlaXpiritand by L31-L35 I mean L24-L35
00:25:25renesacI don't understand that one
00:25:43renesac(it's my turn now)
00:25:54BlaXpiritjust read the code, it's easy
00:26:33renesacoh
00:26:52renesacinstead of doing my.x in a normal object
00:27:03renesacdo my.?x if that object is wrapped by maybe?
00:27:47BlaXpirit.? is just . for 'maybe', yes
00:28:00BlaXpiritbut it returns a maybe and not just the value
00:28:48renesacoh, it returns a maybe?
00:29:38renesacI guess it makes sense
00:34:45renesacand yeah, "none" will certaninly generate a lot of name clashes
00:35:03renesacwhen importing this module
00:35:20BlaXpiritnothing
00:36:01renesacmuch longer, but probably not very used exacly for this reason
00:36:07renesacso a possibility
00:37:15*user7181 quit (Quit: leaving)
00:37:27renesacthough there is the overload resolution
00:37:41renesacI'm not sure if a variable with the same name would be usable
00:37:55renesacor if it would shadow it
00:39:54BlaXpiritshadow
00:42:28*vendethiel quit (Ping timeout: 272 seconds)
00:44:40flaviuLol, that code has some really catastrophic backtracking.
00:44:57BlaXpiritwhich
00:45:29*irrequietus quit ()
00:45:45flaviuMydocweave
00:45:55flavius/Mydocweave/docweave/
00:50:52VarriountYay, finally removed Bittorrent in favor of something less... horrid.
00:52:58flaviuVarriount: I'd be happy to discuss the merits of various torrent clients in #nim-offtopic.
01:02:29*wb quit (Ping timeout: 276 seconds)
01:09:27*chop1n joined #nim
01:10:20*chop1n left #nim ("Textual IRC Client: www.textualapp.com")
01:27:22*vendethiel joined #nim
01:34:54*HakanD___ joined #nim
01:36:03*ChrisMAN joined #nim
01:39:12*HakanD___ quit (Ping timeout: 250 seconds)
01:43:20BlaXpirithow to type `()` inside `` ``
01:43:29BlaXpiritin doc comment
01:43:45BlaXpirit```()``` doesn't work, neither does `` `()` ``
01:47:43*BitPuffin quit (Ping timeout: 252 seconds)
01:49:41*flaviu quit (Read error: Connection reset by peer)
01:49:41*Mimbus quit (Read error: Connection reset by peer)
01:50:31def-BlaXpirit: I wondered about this as well. Haven't found a solution yet
01:54:04*flaviu joined #nim
02:02:30BlaXpirithttps://github.com/Araq/Nim/pull/2515 "Add optionals module (Maybe[T])"
02:06:27*BlaXpirit quit (Quit: Quit Konversation)
02:10:56*ChrisMAN quit (Ping timeout: 264 seconds)
02:12:26*a5i joined #nim
02:26:04*pregressive joined #nim
02:30:20*pregressive quit (Ping timeout: 250 seconds)
02:40:43*pregressive joined #nim
02:42:58*gsingh93 joined #nim
02:45:07*jholland joined #nim
02:45:34*vendethiel quit (Ping timeout: 250 seconds)
02:53:55*darkf joined #nim
02:55:43*TEttinger joined #nim
03:38:11*ajpocus joined #nim
03:38:27*gsingh93 quit (Quit: WeeChat 1.1.1)
03:39:22*gsingh93 joined #nim
03:41:43*ajpocus quit (Quit: Leaving)
03:52:19reactormonkany way to get the return value of an executed process AND the input/output streams?
03:52:42reactormonkah, just go with waitForExit
03:52:48reactormonkor peekExitCode. neat.
03:59:55*mpthrapp_ joined #nim
04:02:40*mpthrapp quit (Ping timeout: 255 seconds)
04:04:44*bcinman joined #nim
04:14:46*endragor joined #nim
04:30:22*endragor quit (Remote host closed the connection)
04:33:15*a5i quit (Quit: Connection closed for inactivity)
04:53:50*dashed joined #nim
04:58:45*wb joined #nim
05:21:12*dtscode is now known as dtscokeacola
05:46:07*saml_ quit (Remote host closed the connection)
05:59:19*pregressive quit (Remote host closed the connection)
06:04:46*endragor joined #nim
06:30:22*dtscokeacola is now known as dtscode
06:34:36*dtscode is now known as charmander
06:42:09*Demon_Fox joined #nim
06:49:24*bcinman quit (Quit: My Mac has gone to sleep. ZZZzzz…)
06:58:42*EXetoC quit (Remote host closed the connection)
07:07:29*charmander is now known as dtscode
07:08:22novistI get scratch.nim(19, 43) Error: cannot evaluate at compile time: ctor_counter when my code is imported from other module. any idea why that could be? executing module itself works fine.. https://paste2box.com/iQY-cQ#/P6EiojsvWIv6czhlvRk8O6QlFFuVnvMWOedq7UhypTU/scratch.nim
07:12:08Varriountnovist: Likely a bug or vm limitation
07:12:17*akiradeveloper joined #nim
07:12:44*BlaXpirit joined #nim
07:14:49*gsingh93 quit (Ping timeout: 245 seconds)
07:15:45*bcinman joined #nim
07:15:58*bcinman quit (Client Quit)
07:17:04novisthmm i must have bad karma, tripping on all these bugs hehe
07:25:24*MagusOTB joined #nim
07:27:58fowlnovist, try var ctor_counter{.compileTime.} = 0
07:28:56novisthey that worked, thanks!
07:29:07novistalthough.. whats the point of "static:" then?
07:29:25novistit works even without static block
07:29:41fowlto execute code at compile time
07:29:55fowlit doesnt necessarily live beyond the life time of the module though
07:29:58Varriountnovist: Could you submit a PR to the pragma part of the manual adding that the compileTime pragma can be used on variables?
07:30:14Varriounthttps://github.com/Araq/Nim/blob/devel/doc/manual/pragmas.txt
07:30:34novistsure thing
07:30:56fowlwhats up Varriount
07:31:16fowlworking on anything interesting?
07:31:41Varriountfowl: I don't know. Do Calculus tests counts as 'interesting'?
07:32:10fowlnot to me :p
07:34:21*dashed quit (Quit: Connection closed for inactivity)
07:42:39*vendethiel joined #nim
07:56:53*akiradeveloper quit (Ping timeout: 250 seconds)
07:58:06*baby_rage_nospac joined #nim
08:01:34*Arrrrrrr joined #nim
08:03:04VarriountHello Arrrrrrr
08:03:12baby_rage_nospacI'm asian and that's racist
08:03:25Varriount?
08:03:42ArrrrrrrHello Varriount. Hello Nimrods.
08:03:42baby_rage_nospacwe don't spell "l" as "r"
08:04:11ArrrrrrrIm very sorry baby_rage_nospac
08:04:16*Arrrrrrr is now known as Arrrrrrrrrrrrrrr
08:04:36baby_rage_nospacnow I'm 200% triggered now
08:05:13VarriountUm... ok?
08:05:31fowldo not continue this conversation
08:05:43baby_rage_nospac:^)
08:06:20*baby_rage_nospac quit (Quit: Leaving)
08:07:12fowlobvious troll is obvious
08:07:13Araqaha single letters can be racist too now. interesting.
08:07:40*vendethiel quit (Ping timeout: 244 seconds)
08:08:55ArrrrrrrrrrrrrrrHow does nim resolves the concurrency problem? http://blog.rust-lang.org/2015/04/10/Fearless-Concurrency.html
08:08:57BlaXpiritsome modules in nim standard library do tests via isMainModule. are they included in koch test?
08:09:20VarriountBlaXpirit: Yes.
08:09:26BlaXpiritVarriount, but how?
08:09:38VarriountBlaXpirit: The tester compiles and runs the module.
08:09:51BlaXpiritbut why does it run it?
08:10:01VarriountBlaXpirit: To test things?
08:10:03BlaXpiritdoes it just run all of stdlib?
08:10:15VarriountBlaXpirit: Yes.
08:10:15BlaXpiriteven if most modules have no tests?
08:10:19BlaXpiritok..
08:10:22VarriountBlaXpirit: Yes.
08:10:28BlaXpiritso i suppose i'll test my new module in ismainmodule
08:11:37AraqArrrrrrrrrrrrrrr: thread local heaps + a *bunch* of other features like locking levels to prevent deadlocks statically, annotations to enforce you do your locking consistently, message passing etc
08:12:20VarriountAraq: I don't think I've seen any other language that has locking levels. It's quite an itneresting feature.
08:12:56ArrrrrrrrrrrrrrrYou should write a post explaining this, people would like to learn more (i guess).
08:13:02AraqBlaXpirit: the tester tests the module at least compiles and if it has isMainModule it is also *run*
08:13:17BlaXpiritis it in any category?
08:13:35Araqyes, category 'lib'
08:13:46VarriountAraq: I don't think that the tester actually tries to detect if a module has an 'isMainModule' in it.
08:13:54VarriountIt just runs the exe
08:13:58BlaXpiritoh ok. lib+stdlib for stdlib then
08:14:22AraqVarriount: but I did program it this way, let me take a look
08:14:59BlaXpiritI see exactly as many executables as sources
08:15:35Araq if contents.contains("when isMainModule"):
08:15:36Araq testSpec r, makeTest(test, options, cat, actionRun)
08:15:38Araq else:
08:15:39Araq testNoSpec r, makeTest(test, options, cat, actionCompile)
08:15:51Araqmaybe I got the logic wrong :P
08:16:15Araqalso it's apparently case sensitive so if you write ismainmodule it won't work :P
08:16:19VarriountWell, I stand corrected.
08:16:41BlaXpiritso weird, I put an when isMainModule: assert false and it passed
08:17:14AraqBlaXpirit: now that *sucks*
08:17:26BlaXpiriti'm probably doing something wrong
08:20:31BlaXpiritthe module is being tested for a smaller amount of time than the rest
08:20:38fowlAraq, do you use generics with macros.getType at all? i want to change them quite a bit
08:20:55Araqfowl: go head
08:21:08Araqwe don't use them in getType for now
08:21:10fowlcool
08:23:07BlaXpiritreNimcCrash when I put syntactically wrong code, even in isMainModule, but assert(1 == 2) just passes
08:27:10VarriountBlaXpirit: Well duh. Didn't you hear? Math is a lie.
08:27:27Varriount1 == 2, and 3/0 = Fish
08:28:20BlaXpiritdude
08:28:29BlaXpiritdoes this mean lib testing actually doesn't work?
08:28:39BlaXpiriti added assert false to other module and it passed
08:28:45BlaXpiritcan someone try this too?
08:29:06BlaXpiritadd assert false to actors.nim or something and koch test c lib
08:31:02fowlBlaXpirit, try do_assert before you run through the town screaming that the british are coming
08:31:07BlaXpiriti did
08:31:16fowlcarry on then
08:31:33fowllol
08:31:46TEttingerit's kinda amazing to me how active this channel is (maybe because development is so active and not afraid to break things once to improve them later :P )
08:33:07BlaXpirithellooo
08:33:58ArrrrrrrrrrrrrrrIs nice because your questions receive a fast answer.
08:34:09ArrrrrrrrrrrrrrrI have learned a lot in 2 days.
08:36:08novistjust noticed [0 .. ^2] thing
08:36:12novistman slices are total mess..
08:36:22BlaXpiritwere
08:36:26*Jehan_ joined #nim
08:37:20novisti really dont like special cases... it doesnt look self explanatory at all. usual characteristic of special cases
08:37:35*Sembei joined #nim
08:37:37BlaXpiritdont use it
08:38:08novistwhy ranges and slices had to be smashed into the one syntax at all
08:38:32Arrrrrrrrrrrrrrrwhat does ^2 in that context?
08:38:44novistlike [0:-2] in python
08:38:47TEttingerthere's quite a few languages coming close to or just getting into a "mature and usable" state now. Julia is nice, but last I checked couldn't compile a standalone executable (which makes it kinda pointless for games). Rust I kinda doubt is as close to ready as advertised, a friend of mine uses the rust nightly and things break constantly.
08:39:15Jehan_Julia really has a different target audience.
08:39:36Jehan_Mathematicians and scientists in general.
08:39:54BlaXpiritwhich is a pity
08:40:00Arrrrrrrrrrrrrrrwhat does [0:-2] in python?
08:40:29TEttingerNim's older than those two, I think, and it also performs very well... I think the imperative non-heavily-OOP model is a pretty good fit for a lot more software than people think if they've been conditioned into thinking with design patterns and best practices
08:40:31BlaXpirita[0 .. ^2] is exactly the same as a[0 .. a.len - 2]
08:40:32novistbut seriously why array/string slicing could not be like [0:-2]? then .. could have stayed inclusive and ones that dong like could implement range(start, stop, step) that produces non-inclusive range. world would be happy, not weird
08:40:46Araqnovist: negative indexing in Python is a *special* case, moreso than Nim's ^
08:40:54BlaXpiritnovist, you don't understand it. it's all been discussed.
08:40:57novistbut it sure does not look like special case
08:41:17Araqproof: the implementation in Python uses an 'if' to implement it :P
08:41:17novistyeah i have seen discussion stop two weeks ago..
08:42:19Araqit's called "coming to a conclusion"
08:42:23BlaXpiritso can anyone confirm or deny that nim's standard library is not being tested at all?
08:42:45AraqBlaXpirit: will look into it, but I'm afraid you're right
08:42:59BlaXpiritit takes 1 minute to check, srsly
08:42:59fowlBlaXpirit, tonight is the first i've heard of those tests supposed to be running
08:43:06Araqgood thing we also have the stdlib directory
08:43:13BlaXpiritthat one works
08:44:15Araqnovist: in Nim foo[-1] never worked, now foo[^1] does. a definite improvement and no runtime overhead, in contrast to -1
08:44:27Araqbut I won't repeat more of the arguments here
08:44:36novisti just dont understand why there has to be introduced special less obvious syntax
08:44:54BlaXpirit"less obvious to a Python programmer"
08:44:59novisteveryone knows what -1 is. now what is ^1? nothing xor 1?
08:45:02BlaXpirityou're not making sense
08:45:15BlaXpiritno, not everyone knows what -1 "is"
08:45:23BlaXpiriti will stop now.
08:45:51novistits pretty obvious its "negative" right? and if it is used as index of indexable object then its negative index. no?
08:45:55Triplefoxthe thing that triggered the most discussion (at least for me) was that inclusive range behavior plus negative indexes created some non-obvious bug situations
08:46:26novistTriplefox: dont forget pervasive -1 with inclusive ranges
08:46:47novistfor i in 0..ID_LENGTH-1: .. /facepalm
08:47:26Araqthat too has been discussed to death
08:47:30*Sembei quit (Max SendQ exceeded)
08:47:45Araqfor c in 'A'..'Z': # not so stupid to be consistent, is it?
08:47:53novistno its great
08:48:23fowli do wish for ... too but only because i come from ruby
08:48:24novistbut its not used more often than 0..a-1
08:49:16Arrrrrrrrrrrrrrris in ruby x...y == x..y-1 in nim?
08:49:37fowlyea
08:49:53ArrrrrrrrrrrrrrrIt's a good idea.
08:50:12novistanyone see a conflict in that? shorter .. produces longer range, while longer ... produces shorter range. odd
08:50:45novistalthough i think nothing prevents defining custom ... operator right?
08:50:55ArrrrrrrrrrrrrrrI would not care.
08:51:11fowllol
08:51:12ArrrrrrrrrrrrrrrIs a good observation tho.,
08:51:18BlaXpiritnovist, yes, after negative indices were removed, nothing prevents it
08:51:31*HakanD___ joined #nim
08:52:01novistanyways for slicing in making myself proc slice(...). less weirdness ^_^
08:53:55ArrrrrrrrrrrrrrrIs there a way to making procs/types be autoincluded in every module like ints, without hacking the source code?
08:54:45BlaXpiritArrrrrrrrrrrrrrr, http://blaxpirit.com/blog/4/make-a-nim-module-available-to-all-your-projects.html
08:55:01ArrrrrrrrrrrrrrrAh, you have a blog. I'll have a look a tit
08:56:26novistBlaXpirit: i dont think its what he meant
08:56:28ArrrrrrrrrrrrrrrBut does it save you to import the code?
08:56:33BlaXpiritno
08:57:06novisti was too thinking that a way to define common pragmas/imports in main project file and have them effective through entire project would be useful
08:57:30BlaXpiritinclude would work
08:57:32Jehan_You can use --import or --include to add a module that's automatically imported/included.
08:57:54novistoh was not aware of cmd line switches, awesome then, thanks Jehan_
08:58:53Araqyup, --import and --include are so often overlooked it's crazy
09:00:00*vendethiel joined #nim
09:00:28*pregressive joined #nim
09:02:28Jehan_There are a lot of other interesting command line switches that are often overlooked, too. :)
09:03:00ArrrrrrrrrrrrrrrYour random is fantastic BlaXpirit, have you seen this? http://www.pcg-random.org/ in theory looks even better than mersenne.
09:03:28BlaXpiritauthor sucks
09:03:36BlaXpiritpromised to at least 3 people to change license
09:03:40Arrrrrrrrrrrrrrrlol
09:03:50ArrrrrrrrrrrrrrrMaybe he doesn't have the time
09:03:53BlaXpiritasked for a pull request to change license, got 3 of them for each project
09:03:59BlaXpiritcompletely ignored
09:04:23BlaXpiritalso it's a new thing without any references from serious sources
09:04:23ArrrrrrrrrrrrrrrWhat's the problem with apache 2 license?
09:04:29BlaXpiritread it and see
09:04:56*pregressive quit (Ping timeout: 264 seconds)
09:05:53Arrrrrrrrrrrrrrrtl;dr: ?
09:06:07ArrrrrrrrrrrrrrrI saw it in some java projects like libGDX
09:06:42Jehan_Araq: Are there any plans to get rodfiles working again in the future (I realize that it's not going to be a pre-1.0 thing regardless)?
09:06:49*Sembei joined #nim
09:09:00fowlwhy isnt string just "distinct seq[char]"
09:09:38HakanD___thanks all for help
09:09:43HakanD___for yesterday
09:09:45HakanD___bugs fixed (:
09:09:49*Sembei quit (Max SendQ exceeded)
09:10:19fowlcool HakanD___
09:11:39Jehan_fowl: Because it's magic? I mean, literally. :)
09:12:00*Sembei joined #nim
09:14:40*vendethiel- joined #nim
09:14:44fowlJehan_, i dont follow
09:14:50*vendethiel quit (Ping timeout: 272 seconds)
09:15:00fowlim asking 'why is it the way it is' and you're saying 'it is the way it is'
09:15:39fowlevery string function casts it to pgenericseq
09:17:10Jehan_fowl: That's the code generator.
09:17:25Jehan_If you look at the compiler, you'll note that there's plenty of code specific for tyString.
09:18:10*Sembei quit (Max SendQ exceeded)
09:19:45*Sembei joined #nim
09:20:32*milosn quit (Ping timeout: 272 seconds)
09:21:26BlaXpiritnim-lang.org down?
09:21:44BlaXpiritno. apparently it's just me.
09:21:55TEttingerBlaXpirit, I'm also unclear on apache license stuff. MIT is problematic if someone commits something that violates a third party's patent, which BSD licenses specifically address
09:22:42*Sembei quit (Max SendQ exceeded)
09:25:22TEttingerhttp://xorshift.di.unimi.it/splitmix64.c is a good PRNG that fits most of the bill that PCG does
09:25:35*akiradeveloper joined #nim
09:25:49TEttingerit's SplitMix64 in the table on http://xorshift.di.unimi.it/
09:26:01BlaXpiritwas that added recently?
09:26:26TEttingeryes
09:26:58TEttingerit's derived from the same reference implementation that Java 8 uses for its latest RNG
09:27:18BlaXpiritwell it's extremely easy to add if u want it in your project
09:27:44BlaXpiritand for now i'll just say, this is the first time i see it
09:27:50TEttingeryep
09:28:04TEttingerI'm using it in a java lib I'm working on/with
09:28:21TEttinger(not splittablerandom, since that would need users to use java 8)
09:28:46TEttingerthere's an advantage in that it can use ANY long as a seed
09:29:24TEttingerXS+128, which is otherwise excellent, needs the seed to be not "everywhere 0" after a certain number of iterations
09:29:42TEttingerso they recommend you use an avalanche function from murmurhash3
09:30:09TEttinger(both are public domain, but it's kinda a hassle)
09:30:12BlaXpiritTEttinger, i have this
09:30:55BlaXpirithttps://github.com/BlaXpirit/nim-random/blob/1170147/src/random/xorshift.nim#L65
09:31:58TEttingerlooks like that will work yeah
09:32:51TEttingerit's such an amazing field isn't it? this research into random numbers and how to generate them
09:33:30TEttingerone month, the fastest uses 1024 bits of state, the next, it's 128, and the next it's kinda 64 if you're using GCC
09:33:34TEttinger*clang
09:34:59TEttingerif I understood the math behind quasirandom number generators or low-discrepancy sequences, I'd try to implement the faure sequence
09:35:17*Sembei joined #nim
09:35:31BlaXpiritk
09:36:45*Sembei quit (Read error: Connection reset by peer)
09:37:16TEttingerheh
09:37:18TEttingerhttps://en.wikipedia.org/wiki/Low-discrepancy_sequence
09:37:43*akiradeveloper quit ()
09:42:10*Sembei joined #nim
09:43:53*user7181 joined #nim
09:44:57HakanD___Nim attracts lots of python programmers, especially those who are looking for statically typed and/or faster languages. Working on https://github.com/Araq/Nim/wiki/Nim-for-Python-Programmers , and putting on the docs might help with adoption
09:45:34*Sembei quit (Max SendQ exceeded)
09:45:48*HakanD___ is now known as HakanD
09:48:53ArrrrrrrrrrrrrrrI noticed there aren't too many contributors, so i suppose they are very busy.
09:49:00*Arrrrrrrrrrrrrrr is now known as Arrrrr
09:50:19*BitPuffin joined #nim
09:59:45*Sembei joined #nim
10:04:22*davidhq joined #nim
10:16:20*Sembei quit (Read error: Connection reset by peer)
10:16:58*MyMind joined #nim
10:22:22Arrrrr{.inheritable.} is long and ugly, can it be changed to simply {.open.} ?
10:24:07*rr joined #nim
10:24:30*rr is now known as Guest17376
10:25:08*Guest17376 quit (Client Quit)
10:33:43*johnsoft quit (Ping timeout: 245 seconds)
10:33:50*johnsoft joined #nim
10:38:18AraqArrrrr: it's long and ugly because you should inherit from RootObj instead
10:40:16AraqJehan_: rodfiles are planned for 2.0 but I'm also playing with other ideas how to implement caching
10:40:27Jehan_Araq: *nod*
10:40:41ArrrrrAh thanks, this is (a bit) better than using {.inheritable.}
10:40:52Jehan_As long as there's a long term plan for huge projects. :)
10:41:29Araqit's easy enough to get them back into the shape where it once was
10:41:31Jehan_Note that it's generally advisable to use inheritance only with ref object types, not object types.
10:41:46ArrrrrWhy?
10:41:51Jehan_I'm not sure if the latter still crash, but the semantics are problematic, anyway.
10:42:38Jehan_Because assignment to a super type has to strip off the extraneous attributes and cast down to the supertype.
10:42:54Jehan_Meaning that you won't get any actual polymorphism out of it.
10:43:38Jehan_It works only (kinda sorta) with procedure parameters that are passed (explicitly or implicitly) by reference.
10:43:46*Trustable joined #nim
10:44:43Arrrrrand why doesn't it happen with refs ?
10:45:04Araqbecause every ref is the same size, it's a pointer
10:46:14ArrrrrOk ... then why it has to strip off the differences instead of, i dont know, hide them.
10:47:48Jehan_Where should the extra storage come from?
10:48:01Jehan_E.g. when you're copying a 2-word object into a 1-word object?
10:48:09*milosn joined #nim
10:49:07Jehan_If the entire hierarchy were known, you could do it, but not with open inheritance (where you don't know what subtypes may be added later on).
10:49:36ArrrrrOk, i get it. Does this happen in c++ ?
10:49:50ArrrrrIt seems (for me at least) counterintuitive
10:50:22Jehan_It's not even possible in C++.
10:50:22Arrrrralthough i understand what you mean.
10:50:34Jehan_if you have class B : public A { … }
10:50:42Araqno? I thought C++ has the same problem
10:50:51Jehan_Then you cannot assign a B to A. Only a B* to an A*.
10:51:04Jehan_Araq: yeah, that's what I was saying.
10:51:11Araqaye that's what I wanted to do too and at some point
10:51:53AraqI mean, crashing at runtime when the types are not exactly the same
10:52:16*MyMind quit (Ping timeout: 240 seconds)
10:52:35Jehan_The problem right now is that Nim doesn't actually cast to the supertype upon assignment.
10:53:16ArrrrrWould not be possible to make it working like with refs?
10:53:41Araqactually what could be done is to transfer the object type field on assignment if the sizes are the same and if not, raise an exception
10:53:57Jehan_Araq: Hmm, that'd work, too.
10:54:04Araqthat can be useful for a Ruby wrapper
10:54:39Jehan_It would be nice for this case to be able to reserve memory for subtypes in the supertype.
10:55:04Araqyou can do that on your own though
10:55:17Araqwith mild hacks
10:55:32Jehan_Hmm, how?
10:55:46*milosn quit (Read error: Connection reset by peer)
10:56:34*milosn joined #nim
10:56:48Araqadd some fields to the supertype on your own
10:57:08Arrrrrcould not the size be checked at runtime when assigning object values? like "This A class has more weight than a normal A class, so put more space" or something.
10:57:14Araqand use them in the subtypes, via 'cast' perhaps
10:57:36Jehan_Well, the problem is that this doesn't work so well with ref fields.
10:57:46Araqtrue
10:58:21Araqbut internally we have the very same problems then with the GC tracing etc
10:58:48Araqseems like too much work for a niche feature
10:58:58Jehan_Do we? The GC would know that the rest of the object is essentially empty.
10:59:33ArrrrrMaybe is niche, but people with little idea about values vs refs dont expect that.
10:59:37*milosn quit (Read error: Connection reset by peer)
10:59:52ArrrrrYou can work around it but well.
11:00:30AraqArrrrr: Nim is getting better at handling it, but it's still not optimized for stupidity ;-)
11:01:39*milosn joined #nim
11:05:39ArrrrrI would say that many will land to nim expecting an easy programing language but fast, so they will be used to how assigning subtypes to supertypes works with refs types, but will not expect it with values. I'm not saying it should be changed because of this fact, but i would expect most being surprised because of this fact.
11:06:25HakanDvalue types/ref types are common source of confusion for people coming from dynamically typed languages
11:07:42ArrrrrYeah, but one thing is not knowing something, so you cannot make false assumptions, and be confused with something because of its likeness with a previous and very used feature.
11:07:48*untitaker quit (Ping timeout: 250 seconds)
11:08:05HakanDcompiler is giving "Error: unhandled exception: false [AssertionError]"
11:08:07HakanDis it a bug?
11:08:24HakanDi mean, in the compiler?
11:10:00flaviuTEttinger: Have you read the PCG paper? It's great!
11:11:14HakanDnvm, false alarm
11:11:50flaviuHakanD: If it comes from the compiler process, then yes, it is a bug.
11:12:30HakanDthanks
11:12:35HakanDit was coming from my code tho -_-
11:13:44*untitaker joined #nim
11:17:19AraqArrrrr: I am not aware of any official description of Nim that uses the word "easy"
11:18:28AraqI'm much more concerned about "bug prone for people who programmed in Nim for a couple of days or weeks"
11:19:31ArrrrrOk, whatever. I'm just saying it makes sense, is not a matter of stupidity or intelligence, but cohesion. Maybe is niche because noone can actually do it.
11:19:36*banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
11:22:11Triplefoxprobably the most pressing thing for "nim newbies" is a summary of the safe/productive subset
11:23:56AraqBlaXpirit: can you fix the tester bug?
11:24:29*Matthias247 joined #nim
11:26:06Triplefoxtoday's languages tend to have so many features that you never quite know which features are designed for everyday tasks and which are covering a really difficult edge case and shouldn't be thrown in lightly...it's no wonder people end up thinking Go is okay
11:27:53*Strikecarl joined #nim
11:28:04AraqTriplefox: you are very welcome to improve our tutorial ;-)
11:28:41Triplefoxi'll think about it the next time i work in nim...however as it is, i'm writing C :p
11:29:04flaviuIs there some way to tell Nim to use a different executable extension?
11:29:26*milosn quit (Read error: Connection reset by peer)
11:29:27AraqTriplefox: now that's just *sad* :-(
11:29:30ArrrrrBut would you tell me not having the full power of object inheritance in value objects is just a matter of being a newbe? I know that in a month or 2 or three i will be able to overcome it, but that only means having to write more code or doing it in a counterintuitive way, no that i have become more clever. However i can understand there is no time/manpower to employ it in something people gave up for decades.
11:29:31dom96flaviu: likely only with --out:foo.bin
11:29:32def-flaviu: -o:file.exe
11:29:51flaviuyeah, but I want to put it in a nim.cfg file.
11:29:57pigmejArrrrr: isn't it that you're trying ot use too much java inside nim ?
11:30:16*milosn joined #nim
11:31:15ArrrrrWell, tell me how making that assumption is wrong or useless.
11:31:24dom96flaviu: you can put that in a nim.cfg file
11:31:35ArrrrrMaybe is not a problem in java, doesnt mean is only usefull in java.
11:31:52flaviudom96: Sure I can. But then every executable is called foo.bin.
11:32:07dom96flaviu: put it in a project-specific nim.cfg then
11:32:10AraqArrrrr: expecting the "full power of inheritance" in value objects makes you a newbie.
11:32:18Triplefoxeasy test: does the rule of least power apply to your pet feature
11:32:24pigmejArrrrr: well, the thing is inheritance is not the best for quite a lot of cases
11:32:26ArrrrrWhy
11:32:29Triplefoxif it's not "least powerful" you probably don't need it
11:32:30flaviudom96: There are multiple executables in my project.
11:32:31Triplefoxyet
11:32:48ArrrrrIf using inheritance in value objects is wrong, then dont allow it.
11:32:56dom96flaviu: you can have an executable-specific cfg file then
11:33:24pigmejArrrrr: genrally, when you're learning new language you shouldn't try to use it as another language
11:33:27flaviudom96: And I can also figure out a way to get autotools to write my nim.cfg files!
11:33:37pigmejso if you're learning Nim, then stop thinking 'in java I would...'
11:33:47flaviuArrrrr: for what it's worth, I agree.
11:33:49pigmejit will probably have terrible consequences
11:33:55Araqwell *I* can do it ;-) it's not simply always wrong.
11:33:58dom96flaviu: what you want isn't implemented, so i'm suggesting alternatives.
11:34:07pigmejAraq: ;D
11:35:04pigmejArrrrr: for example composition combined with awesome nim ucfs could give you way better / readable code (even If I'm Nim newbie too)
11:36:14ArrrrrI gree with you that composition is always prefered. But i dont see then why we call bicycle something that only has one wheel.
11:36:45pigmej"[...] Nim's support for object oriented programming (OOP) is minimalistic [...]"
11:36:47pigmejfrom docs
11:36:47*milosn quit (Ping timeout: 256 seconds)
11:37:11Triplefoxthere's a basic architecture pattern i've started applying across all the languages i'm using today, and it requires essentially no language features, although some can eliminate boilerplate
11:37:11BlaXpiritAraq, I don't think i'm the right person to fix testing. it will be much faster for someone who is familiar with it
11:37:49def-BlaXpirit: i think i know already why it fails
11:38:01def-BlaXpirit: I'm just not sure how to fix it
11:38:05Arrrrrbut pigmej i can still use a lot of stuff with refs types, and the only reason you are giving me to dont use them in values is "only a noob would do that", which for me is nonsense
11:39:02ArrrrrI know for example why i would prefer using values instead of refs, and is not because of a language limitation, but a cpu/cache limitation.
11:39:56ArrrrrI dont see why limit that on nim (of course, besides you want to put effort in other things, which is different from saying is good as it is)
11:40:31Araqwell I already said it's not good and gave a couple of alternatives we should try
11:42:33BlaXpiritcan non-immediate templates access variables in scope?
11:44:05BlaXpiritnvm, i just need mixin
11:47:39*HakanD_ joined #nim
11:48:20Araqhrm our JS tests are quite broken, right?
11:49:04BlaXpirityou fixed testing and found broken tests, huh?
11:49:10def-Araq: the JS backend has problems, yes
11:49:23Araqno I fixed yet another JS codegen bug
11:49:33Araqand didn't run the tests before but after my patch
11:49:50Araqand of course now I wonder whether I broke something or if was broken before
11:50:01def-the js tests never succeeded
11:50:17def-at least many of them
11:50:34def-taddr, tunittests, texcpt1 (all with and without -d:release)
11:50:48*HakanD quit (Ping timeout: 256 seconds)
11:51:15*jefus quit (Quit: WeeChat 0.4.2)
11:52:07*jefus joined #nim
11:54:50Araqtaddr works for me
11:55:08Araqunittest cannot work and I'm disabling it
11:55:15Araqlooking at the exception stuff now
11:55:42Araqtactiontable fails for me
11:55:59*milosn joined #nim
11:57:35*user7181 quit (Quit: leaving)
12:11:18*BlaXpirit quit (Read error: Connection reset by peer)
12:11:54*BlaXpirit joined #nim
12:12:36ArrrrrI go to go, thanks for explaining to me how value objects work in the stack, nimroders.
12:12:39*Arrrrr quit (Quit: Page closed)
12:13:00Araq"for example asynchttpyserver just starts and http server and lets it run", def-
12:13:07Araqthat's a very good point
12:13:19*Strikecarl quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
12:13:23Araqwe need some other tag in the source that is checked for
12:13:49Araqlike #TESTRUN
12:14:07Araqbbl
12:15:12BlaXpiritAraq, what about when defined(test):
12:15:46BlaXpirittesting in isMainModule never was a good idea anyway
12:17:38fowlcursed from the start?
12:48:26*Kingsquee quit (Quit: Konversation terminated!)
12:58:21*milosn quit (Ping timeout: 264 seconds)
13:14:01*milosn joined #nim
13:23:45*HakanD_ quit (Read error: Connection reset by peer)
13:27:53novistis it somehow possible to override proc that is defined in stdlib? for example proc echo defined in system.nim. Can i make my own custom echo which is preferred than what is defined in system.nim in my project?
13:29:40dom96you can make one but you will need to prefix it with the module name to disambiguate it
13:30:21novisti see.. that wouldnt work for stuff like operators though. okie..
13:31:13*TEttinger quit (Ping timeout: 245 seconds)
13:34:13*dhasenan quit (Remote host closed the connection)
13:34:33*dhasenan joined #nim
13:35:19dhasenanHrm. Can they turn you into a republic while you're at war?
13:35:56dhasenanApparently you can.
13:39:51dhasenanYay, wrong channel.
13:48:24*ob_ joined #nim
13:53:25*Matthias247 quit (Quit: Matthias247)
13:58:27*milosn quit (Ping timeout: 256 seconds)
13:59:31fowlnovist, dom96 that is not a problem if its from system
13:59:59flaviuI'm clearly using the wrong tool here :P
13:59:59flaviuIt takes 2 seconds to parse a standard nim file with my regexes.
14:00:12fowlof course your echo won't flow back through modules that use system.echo
14:00:46fowlflaviu, parsing nim syntax or searching for something?
14:01:12flaviuSearching for something that happens to involve parsing a subset of nim syntax.
14:02:00flaviuhttps://github.com/flaviut/docweave/blob/master/src/docweave.nim#L9-L43
14:02:39dom96fowl: interesting
14:02:52*Matthias247 joined #nim
14:09:39*MagusOTB quit (Remote host closed the connection)
14:10:37*xcombelle joined #nim
14:14:37fowldom96, seems to be that way and i just tested defining my own echo
14:26:59*johnsoft quit (Ping timeout: 246 seconds)
14:27:08*gmpreussner joined #nim
14:27:28*HakanD joined #nim
14:29:07*Matthias247 quit (Read error: Connection reset by peer)
14:32:29xcombellehi
14:34:57def-hi xcombelle
14:35:36xcombellehi def-
14:41:31repaxBlaXpirit: Stunning implementation of Maybe[T]. :)
14:43:17*jefus quit (Quit: WeeChat 1.1.1)
14:56:22*johnsoft joined #nim
15:02:37flaviuWhen using fsanitize with nim, `fun:markstackandregisters_[:digit:]*` should be added to the blacklist.
15:12:53BlaXpirit2 overloaded procs: one accepts typedesc, other accepts concept - doesn't work, because apparently typedesc accepts everything
15:13:12BlaXpirit1 proc with `when val is typedesc` causes a crash
15:13:22BlaXpirit1 proc with `when compiles(typetraits.name(val))` works
15:13:39*darkf quit (Quit: Leaving)
15:19:19BlaXpiritgee, showstoppers cropping up like crazy
15:19:52flaviuI'm trying to test and make sure I don't leak memory, how would I do that? I'm using GC_fullCollect(), but my tooling still says I'm leaking memory.
15:20:12*milosn joined #nim
15:22:32Jehan_flaviu: Difficult to say without context. Do you mean that there's memory that should be freed by the GC but isn't? Or that there's foreign memory that's not being managed properly?
15:23:19flaviuforeign memory, but I'm not sure if there is a problem or not.
15:23:38federico3I'm tempted to suggest not using async on Nim-for-Python-Programmers
15:25:15Jehan_federico3: In general, I recommend against using concurrency unless you inarguably need it.
15:25:42Jehan_You're incurring a lot of cost, and you have to make sure the benefits are worth it.
15:26:15federico3well, sometimes you really want it
15:27:00*HakanD quit (Quit: Be back later ...)
15:27:08Jehan_federico3: Of course.
15:27:41Jehan_But for a lot of applications it's essentially pointless.
15:28:00Jehan_Well, not so much pointless, but really not worth the trouble.
15:28:23dom96federico3: why?
15:28:43federico3speaking of which, any recommended message passing library/design/method for Nim?
15:29:02flaviuone GC_fullCollect at the end shows 21 leaks, two GC_fullcollect shows only 16 leaks.
15:29:08flaviuNot sure what's going on.
15:30:29federico3dom96: 1) it seems to be at a relatively early stage 2) Mixing Python-like OO design with asyncs leads to a lot of memory safety errors that confuse newcomers coming from Python
15:30:49BlaXpiritisn't async singlethreaded
15:31:02federico3yep
15:34:09dom96what memory safety errors are you referring to?
15:36:01federico3dom96: well, for example when an async proc is called on an object instance and it tries to change values in internal attributes or attributes on other instances
15:38:20*jefus joined #nim
15:40:32dom96federico3: can you give an example?
15:41:21*jefus quit (Client Quit)
15:42:42*jefus joined #nim
15:43:57*mpthrapp joined #nim
15:46:28*mpthrapp_ quit (Ping timeout: 255 seconds)
15:53:21federico3hm, I'll have to recreate one.
16:02:11*banister joined #nim
16:17:33*pregressive joined #nim
16:23:15AraqBlaXpirit: 'when defined(testing)' is fine too, but I don't consider isMainModule as wrong
16:26:45flaviuAraq: What about longer test suites? At some point, a test suite it big enough that it needs to be split out.
16:27:21Araqreally? I thought a test suite always can run in under 5 minutes :P
16:27:57Araqflaviu: but to be serious:
16:28:06flaviuThere can be multiple files and still run in under 5 minutes.
16:28:08Araqwe already have a nice lib vs stdlib split in the tester
16:28:26*clynamen quit (Ping timeout: 246 seconds)
16:29:31*banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
16:32:59Araqdom96: please review https://github.com/Araq/Nim/pull/2513
16:38:16*bcinman joined #nim
16:39:09dom96done
16:45:48Araqcan we merge https://github.com/Araq/Nim/pull/2244 now?
16:46:05Araqif async is unstable anyway, we might as well make it faster
16:50:51*BitPuffin quit (Ping timeout: 276 seconds)
16:56:36dom96and make it even less stable in the process?
16:56:41dom96let's not do that
16:57:11Araqactually fewer closure iterators and allocations could also make it more stable as a side-effect
16:57:24*BitPuffin joined #nim
16:57:29dom96This doesn't just make the implementation unsafe
16:57:33dom96it makes the API unsafe!
16:57:42Araqwhy?
16:58:20dom96https://github.com/Araq/Nim/pull/2244/files#diff-3a2daa5a0e408529216e7d6e0900bc29R422
16:58:39dom96Async and pointers in params don't mix.
16:59:43Araqwhy does this have to be exported?
17:02:18dom96I guess it could be moved to asynchttpserver
17:03:23dom96This isn't the way this should be done though.
17:03:32dom96We need to come up with a way to speed up async whole.
17:05:53Araqbbs
17:21:27*yymoto2 joined #nim
17:32:34*BitPuffin quit (Remote host closed the connection)
17:33:09*BitPuffin joined #nim
17:39:18*Senketsu quit (Quit: Leaving)
17:40:47*gimireh joined #nim
17:41:44gmpreussnerwhat's the best way to manage a project with a lot of packages? would package dependencies go into each package's nim.cfg?
17:41:58gmpreussneri don't want to go through nimble for my personal stuff fyi
17:44:21Jehan_gmpreussner: Use Peru to keep them in sync, nimble build to build them (locally), and add the paths to your config. At least that would be my suggestion for now.
17:44:26BlaXpiritgmpreussner, nimble can install all dependencies specified in a .nimble file, why avoid it
17:45:20Jehan_BlaXpirit: The point is that you don't want a package update in a global directory to break your stuff.
17:45:31BlaXpiritoh i'm a dummy
17:45:41Jehan_One of the big shortcomings of Nimble is that you can have only one installation.
17:45:59pigmejJehan_: what's Peru?
17:46:09BlaXpiritit's a bad sign that people aren't crying everywhere about this
17:46:22Jehan_pigmej: https://github.com/buildinspace/peru
17:46:54Jehan_BlaXpirit: Meh, I (mostly) just don't use Nimble. Except to look up where packages are.
17:46:54BlaXpiritsure looks cool as heck
17:47:40Araqer I think Nimble can handle just fine it's just that nobody knows about it
17:47:52pigmejJehan_: ee, weird
17:48:06BlaXpiritAraq, i wouldn't be surprised
17:48:21Jehan_Araq: If there's a way to specify a different installation path, it's not documented anywhere.
17:49:16flaviuBlaXpirit: I use it in Nimlets to do dependency management.
17:49:17pigmejfor me the biggest problem with nimble is versioning
17:49:30flaviuhttps://github.com/nimlets/nimlets
17:50:20pigmejcorrect me if I'm wrong, but isn't nimble replacing global package versions "just when some package needs it" ?
17:50:37pigmejand there is no way to have multiple versions of the same package, isn't it?
17:51:00BlaXpiritsomething a bit like that
17:51:18pigmejjust like pythons pip without virtualenv
17:51:59BlaXpiritpigmej, actually it keeps all old versions of packages
17:52:24BlaXpiritproblem is only the biggest version is ever used
17:52:36pigmejah so exactly like in python pip ;)
17:52:52BlaXpiriti don't think pip even can keep old version
17:53:04pigmejBlaXpirit: and probably 'biggest' means lastest on disk when sorted by name?
17:53:13BlaXpiriti dont know
17:53:15pigmejBlaXpirit: it can, it will in fact keep it
17:53:21pigmejsometimies by accident sometimes not
17:53:26pigmejwho know, pip is broken as hell
17:53:36BlaXpiriti think you are mistaken here.
17:53:45pigmejabout pip ?
17:54:09*gsingh93 joined #nim
17:54:38pigmejthere is even thingy called yolk which will list multiple packages
17:54:59pigmejand it will show you which version is used (but sometimes it will fail too)
17:55:10Jehan_Well, dealing with multiple versions isn't trivial.
17:55:16Jehan_Unless you do something like virtualenv.
17:55:41*yymoto2 quit (Quit: Lost terminal)
17:55:41pigmejvirtualenv is also quite hmm, hacky :)
17:55:48*gsingh93 quit (Client Quit)
17:56:14pigmejgenerally, default python package management / installing shouln't be used as example as "good package management"
17:56:55*gsingh93 joined #nim
17:59:00Jehan_What virtualenv does well is creating a standalone version of a piece of software that won't get screwed up by messing around with the rest of the system.
17:59:18Jehan_That alone is enormously valuable.
17:59:23pigmejI like how rebar works
17:59:24*shodan45 quit (Quit: Konversation terminated!)
18:00:10pigmejJehan_: well, in theory you're right, but it can crash after system upgrades or some other upgrades (some dynamic loaded libs are copied as they are)
18:00:18pigmejand soo on
18:00:47Jehan_pigmej: Yes, I know. Nothing's perfect (though --always-copy deals with some of the worst stuff).
18:01:15pigmejJehan_: sure, I just wnated to say that pythonic 'separtion' is not really good
18:01:20pigmejit works, but that's mostly all :)
18:01:34Jehan_It is better than what most other systems offer.
18:01:57pigmejJehan_: rebar, hex from erlang world are hmm, wayt better
18:02:16federico3Jehan_: which speaks volumes about the quality of language-specific packaging
18:02:18pigmejfor python conda does pretty cool work, but it's non standard thingy,
18:02:19Jehan_Erlang isn't "most other systems".
18:02:23pigmejnix is cool also for python things
18:02:27Jehan_Erlang isn't even remotely mainstream.
18:02:40pigmejprobably nix + nim would allow multiple versions
18:02:40pigmejetc
18:02:53Jehan_And I remember the last time I had to clean up after uninstalling RVM, for example.
18:02:53pigmejJehan_: huh, erlang world is quite big
18:03:09pigmejrebar3 and hex are quite cool, really
18:03:16Jehan_pigmej: That's different from being mainstream. And I wish Erlang were more mainstream, I'm not dissing it.
18:03:19pigmejbefore that it was mostly crap :)
18:04:10pigmejJehan_: yeah, but not beeing mainstream doesn't mean that it does not have cool tools ;)
18:04:29dom96Why do people seem to think that Nimble cannot handle multiple versions of the same packages being installed at the same time?
18:04:34Jehan_pigmej: Yeah, I know. In fact, most cool tools are somewhat obscure.
18:04:58pigmejdom96: probably because docs are not good enough ?
18:05:33BlaXpiritlol maybe Nimble can handle, then Nim can't
18:05:58pigmejBlaXpirit: rotfl :D
18:06:09pigmejbut the result is the same :)
18:06:42pigmejhmm, just checked nix with nim and it will work pretty well, so that will be a solution too
18:06:50dom96BlaXpirit: That is correct, Nimble resolves the dependencies not Nim.
18:07:35Jehan_dom96: How does Nim know which path the correct version is on?
18:07:50Jehan_Nevermind, how do I even specify a version in Nim?
18:08:06dom96Jehan_: Nimble passes the paths explicitly to Nim
18:08:20dom96You specify the version in a .nimble file.
18:08:33Jehan_I'm calling Nim, not Nimble, to build my main program.
18:08:59dom96Well, sorry, but you will have to call Nimble to build your main program not Nim.
18:09:01Jehan_And there's no way around that, because I have to do other things as part of the build.
18:09:02BlaXpiritoooh i get it. you're not supposed to call nim directly
18:09:20BlaXpiritthat can work
18:09:28Jehan_Okay, then Nimble is still not for me. Aside from the lack of virtualenv support.
18:09:40pigmejJehan_: check nix ;)
18:09:41gmpreussneri have to admit that, now that i'm starting to work on larger projects, i'm not at all clear on how to organize them and manage dependencies. neither Nim nor the Nimble docs are very helpful in this regard.
18:09:43BlaXpirityou don't need virtualenv
18:09:55BlaXpiritNimble manages dependencies well
18:10:06dom96Jehan_: All we need is `nimble c file.nim`.
18:10:25BlaXpiriteach package is allowed to want different versions, no problem
18:10:25dom96After that is implemented I don't see any issues.
18:10:31Jehan_BlaXpirit: There's a lot more to virtualenv than just managing dependencies.
18:10:41BlaXpiritlike a ton of hacks?
18:10:49pigmejBlaXpirit: check nix ;)
18:11:01pigmejsorry for repeating, but nix is really cool if you want to do 'separation'
18:11:09Jehan_Being able to create a standalone distribution, for example.
18:11:22BlaXpiritit doesn't do that so well actually
18:11:24gmpreussnercan i use Nimble with packages that only exist on the local file system?
18:11:30BlaXpirityes
18:11:44BlaXpirit`nimble install` in the folder
18:12:09gmpreussnerwill that create a copy into nimbleDir, or will it fetch files from the folder when needed?
18:12:10dom96gmpreussner: How can I improve the docs? I think that the docs are already pretty detailed.
18:12:17BlaXpiritgmpreussner, copy
18:12:25dom96Perhaps the issue is that people are not reading developers.markdown?
18:12:31dom96https://github.com/nim-lang/nimble/blob/master/developers.markdown
18:12:59Jehan_nimble c file.nim does not work?
18:13:06AraqIMHO the problem is that Nimble has no real website. I never read these github pages
18:13:13BlaXpirit>_>
18:13:23Jehan_Scratch that, nimble doesn't even work with the devel branch at the moment.
18:13:50dom96Jehan_: It hasn't been implemented yet.
18:13:58gmpreussnerdom96: sorry, i didn't mean to bitch. what i'm saying is that there seem to be no guidelines on how to organize large projects. i'm thinking of frameworks and programs that may consist of dozens or hundreds of modules.
18:13:58Jehan_Ah. Well, that doesn't help me, then.
18:14:14gmpreussnerand by modules i mean packages
18:14:21pigmejdom96: you say docs are detailed
18:14:27gmpreussnersorry, i always mix up those two, because we refer to packages as 'modules' at work :)
18:14:29pigmejand you said that nimble can manage multiple versions
18:14:39pigmejeven knowing this I don't see this in docs
18:15:06dom96gmpreussner: None of us have projects of that magnitude so coming up with guidelines for them hasn't been a priority as of yet.
18:15:18gmpreussnerdom96: yeah, understood
18:15:23Araqgmpreussner: so where can I find this information for C++? I don't think this criticsm is fair.
18:15:47dom96pigmej: fair enough
18:16:02pigmejdom96: I'm not saying that those docs are bad
18:16:07gmpreussnerwell, it's not criticism. it's just an obstacle i ran into today. i haven't put much thought into this, and now that i have to, i feel stuck :)
18:16:13pigmejI think that they have too high entry level
18:16:26pigmejso for someone new, it's a problem
18:16:50gmpreussnerAraq: with C++, the IDEs usually make it easy
18:17:18gmpreussnerfor example, in Visual Studio, organizing a solution into projects is the natural worklow, and VS takes care of the dependencies
18:17:32gmpreussneror you can at least tweak them in the project settings
18:18:00gmpreussneri found the workflow for C# particularly easy. i don't have to worry about anything there. the IDE figures out what needs to be imported
18:18:22Jehan_How does Nimble know which version of Nim to call, by the way?
18:18:44dom96Jehan_: It just calls whatever is in your PATH.
18:19:01Araqthat's not the same at all. so you don't want docs of how to organize stuff, you want IDE support for Nim.
18:19:18*bcinman quit (Quit: My Mac has gone to sleep. ZZZzzz…)
18:19:19Araqwhich is of course a very valid desire ;-)
18:19:34pigmejAraq: I will try to improve nim support in emacs if so :)
18:19:47*bcinman joined #nim
18:19:53dom96pigmej: It would be awesome if somebody could help out with docs, perhaps you would be willing to do so?
18:20:18pigmejdom96: I'm probably too new in nim world
18:20:24gmpreussnerAraq: with Nim, i don't know what the idiomatic workflow is, not even in principle. is it nim.cfg? is it nimble? how do i deal with sub-directories? how do i handle module name collisions across different packages? how do i make sure that the main program compiles, but that individual modules are compilable as well? what about separate test harnesses? etc. etc.
18:20:42dom96pigmej: That's a good thing, you know the questions newcomers ask.
18:20:58Jehan_Right now … no offense, but I'll just keep not using Nimble for the time being. I don't think what I get out of it is worth the problem it's causing me.
18:21:05dom96pigmej: You can document your journey to understanding how Nimble works :)
18:21:13pigmejdom96: np
18:21:22Jehan_For what it's worth, I think it's essential that Nimble works with existing build tools and doesn't try to take over the build process.
18:21:26pigmejI can remember my questions / thoughts ;-)
18:21:55BlaXpiriti think Nimble is very good
18:22:02Araq:O
18:22:30AraqBlaXpirit: I don't believe you.
18:22:58dom96Araq: hah
18:23:27Jehan_For better or worse, using external libraries with autoconf/make/etc. is simply unavoidable for a lot of stuff.
18:23:48dom96Jehan_: is there any chance you could give me a detailed description of your project so that I could perhaps help you understand how I would use Nimble to build it?
18:24:09Jehan_dom96: My point is that I don't want to use Nimble to build it.
18:24:24dom96is that because you prefer to use make to build your project?
18:24:34flaviuIt should be possible to hack around with staticExec to run make.
18:24:36Jehan_I want Nimble to simply put packages where I can find them.
18:24:50Jehan_dom96: Not so much prefer but need.
18:25:07dom96Jehan_: It already does that.
18:25:27dom96They will always be in ~/.nimble/pkgs/pkgName-ver
18:25:44Jehan_dom96: Yeah, that's another problem.
18:25:59Jehan_How does Nimble deal with packages that need to run autoconf, by the way?
18:26:36Jehan_Simply put: I need to give my code, as a standalone distribution, to other people.
18:26:38repax~/.nimble is a weird place for non-config files.
18:26:51Jehan_Those people don't want stuff in their home directory that doesn't belong there.
18:27:21Jehan_The distribution absolutely needs to be standalone.
18:27:37Jehan_Not to mention that there may be multiple versions of the code.
18:27:53Araqthat's not nimble's business
18:28:04Araqnimble is not for end users of software
18:28:10Araqit's for Nim developers
18:28:22flaviuIs there some way to have Nim use standard malloc?
18:28:48dom96Jehan_: Nimble already has a config file in which you can override where the "Nimble dir" is (~/.nimble). Perhaps if this became a cmd line argument it would be helpful to you?
18:28:48Jehan_Araq: yeah. But given that I already need to maintain my own package tree then, Nimble is essentially useless for me.
18:28:59dom96That said, I do agree with Araq.
18:29:18BlaXpiritdom96, that would definitely be best
18:29:29BlaXpirit> cmd line argument
18:29:40Jehan_dom96: When I say "no stuff in the home directory of other people", that means exactly that.
18:29:40Araqflaviu: no and that wouldn't help you anyway to detect leaks.
18:29:53Jehan_Not "except for a nimble config file".
18:30:05flaviuAraq: I'm not looking to locate leaks.
18:30:20flaviuI'm looking for buffer overflows.
18:30:26dom96Jehan_: Yeah, which is why I suggest implementing a cmd line argument in Nimble to replace the nimble config file.
18:30:32Jehan_What's the problem with giving Nimble a --dir option to tell it where to look anyway?
18:30:54Araqflaviu: lol.
18:30:54Jehan_Why the obsession with putting stuff in $HOME?
18:31:03dom96That's pretty much my suggestion
18:31:22Jehan_Fine. That's all I've been asking for. Sigh.
18:31:39Araq$HOME is cool, it's a fucking mess already and doesn't require sudo. :P
18:31:54federico3...where else?
18:32:11flaviu$XDG_CONFIG_HOME is better.
18:32:20Jehan_Araq: It's not $HOME vs. /usr/lib, it's $HOME vs. $HOME/some/local/development/dir
18:32:21AraqI have ~/projects for this reason, so ~ can be full of garbage
18:32:36dom96Jehan_: My goal from the very beginning with Nimble was to keep it simple, which is why I prefer to hear the user's full story before simply implementing every feature they ask for.
18:32:48federico3flaviu: sure, if it's available (but it's still under $HOME)
18:33:05repaxhome is for "your" files. nimble-packages can always be downloaded anew
18:33:27Jehan_dom96: That's okay. As I said, I'm doing fine without Nimble so far.
18:33:58Jehan_I'm only telling you that it's virtually useless for me right now in that it only creates extra work and doesn't give me any benefits.
18:35:20dom96alright.
18:35:52*federico3 stating the obvious: nimble could check for an optional $NIMBLE_HOME
18:35:54Jehan_You don't need to feel forced to do anything about it, but if you want feedback, that's why I'm not using Nimble.
18:36:30gmpreussnerdom96: i put together a gist with some quick ideas here: https://gist.github.com/gmpreussner/df7705a7c2c3c57f0e62 - tell me if it's unreasonable or if i'm crazy :)
18:36:30*MagusOTB joined #nim
18:36:31Jehan_What I've been telling you is the long answer to why versioning doesn't do what I need, that's all.
18:37:06Jehan_SInce everybody seemed to try to tell me that I don't need what I know I need.
18:37:06MagusOTBthe default constructor for a type zero initializes everything, right?
18:37:12def-MagusOTB: right
18:37:34repaxI'm not using nimble because I want all dependencies in subdirectories of the project so that I can control exactly what version I'm using and when I'm updating any one depencency. I'm sure Nimble is a useful tool though
18:38:45*xcombelle quit (Ping timeout: 248 seconds)
18:38:51AraqI do use nimble but I want to know how I can make it "git clone" so that I can contribute easily to a nimble package
18:39:04dom96gmpreussner: thank you
18:39:05BlaXpiritrepax, or just specify exact versions in .nimble file and have nimble do it for u
18:39:13dom96repax: ^^
18:39:37dom96Araq: you can't :P
18:39:56Araqbtw instead of version nailing you can also do feature detection via system.declared and system.compiles :P
18:40:34repaxBlaXpirit: I'm probably just not sufficiently familiar then. Good to know it can handle it
18:40:53BlaXpiriti wasn't either, until just nopw
18:41:50Jehan_Looking at the documentation right now, there doesn't seem a way to tell Nimble to use specific command line options for Nim?
18:42:05BlaXpiritisn't that nim.cfg
18:43:09dom96indeed. You should be putting them in your nim.cfg file.
18:43:35dom96My planned "nimble c file.nim" feature will support passing command line options to Nim though.
18:44:47BlaXpiritthe design is so awesome
18:45:14Jehan_What I was thinking of how to deal with debug vs. release builds.
18:45:19Jehan_… was how ...
18:46:11Jehan_Given that right now "nimble build" seems to be the way how you'd go about building something locally.
18:46:46dom96"nimble build" was in fact designed for end-users of your package so it will always build in release mode
18:47:02repaxGood to know
18:47:08Jehan_Umm. That's another thing. I very rarely want to build in release mode.
18:47:26Jehan_I almost always want to at least have checks enabled that guarantee memory safety.
18:48:14dom96That's an option we should introduce for the .nimble file.
18:48:24Jehan_Release is (1) for code that absolutely needs every last bit of performance or (2) benchmark games, IMHO.
18:48:44Jehan_But a lot of code doesn't fall under (1) or (2) and is better off with not having buffer overflows.
18:49:09repaxI usually have different shell scripts for doing debug / release / test builds / or just "nim check"s
18:49:34VarriountJehan_: You do know that alternate 'modes' can be defined in the config file, right?
18:49:52Jehan_Varriount: Yeah, that's what I'm doing.
18:50:00Jehan_The question is how to tell Nimble which one to pick.
18:50:12Jehan_In short, I have -d:memsafe for this mode.
18:52:16gmpreussnerAraq: wrt better IDE support, i don't think that needs to be the first step. the things i mentioned for visual studio ultimately boil down to making the right settings in some configuration files. i'd be totally fine configuring those files by hand now.
18:52:50Jehan_Another fun problem: one of my projects has Nim code that generates other Nim code (from a plain text database).
18:52:52gmpreussnerif there is some workflow with, say, nim.cfg that allows me to manage large projects, i'd be good to go :)
18:53:49gmpreussneri should qualify: as long as i don't end up hard-coding a bunch of absolute paths :)
18:54:12repaxA config file can never be sufficiently flexible
18:54:23gmpreussneryeah, i think something like nimble is needed
18:55:13gmpreussnermaybe i'll just write my own build script that discovers available packages and generates appropriate command lines
18:55:14*Arrrrr joined #nim
18:55:16repaxIn the end you would have to implement a scripting language to perform the setup of a build (like all the build systems out there)
18:55:39*xcombelle_ joined #nim
18:55:57Jehan_repax: Yeah. Which is why essentially all I need is "nimble path".
18:56:30Arrrrr(Hello Nimrod. I want to know how to do this: 'for y in 0..(HEIGHT-1 / 2)', it does not compile)
18:56:35*xcombelle_ is now known as xcombelle
18:56:58repaxJehan_: how about your nim to nim build. I'm sure it can be built by nimble somehow. It just seems overwhelming to me
18:57:32BlaXpiritArrrrr, / returns float
18:57:37Jehan_repax: It's not even something fancy, it mostly just generates a case statement. But it does require an extra step.
18:57:49repaxPerhaps I'm thinking too much in imperative terms
18:57:53ArrrrrYeah, that's what the compiler yells to me, i dont know how to make the conversion
18:58:09BlaXpirityou probably meant 0..(HEIGHT-1) div 2
18:58:35Jehan_Arrrrr: x/y gives a floating point result if x and y are ints.
18:58:36Arrrrrwow you were right. Thanks!
18:58:50flaviuArrrrr: *Nim
18:59:00ArrrrrSo, div gives an entire result?
18:59:13Jehan_x div y produces an int.
18:59:25BlaXpiritfloor div
19:00:33ArrrrrOk, i'll remember that. Thanks
19:01:05*bjz quit (Quit: Textual IRC Client: www.textualapp.com)
19:01:19MagusOTBwhat's the deal with 'result' in the docs?
19:01:33repaxMagusOTB: can you elaborate?
19:01:35MagusOTBis it some kind of magic, or is using that to refer to the return value a convention?
19:01:41dom96gmpreussner: replied
19:01:48BlaXpiritMagusOTB, i'm sure it's mentioned somewhere
19:02:16BlaXpiritmaybe this http://nim-lang.org/manual.html#return-statement
19:02:49MagusOTBok so result is magic
19:02:57MagusOTBit's zero initialized by the compiler?
19:02:57gmpreussnerdom96: awesome, thanks
19:03:01def-MagusOTB: yes
19:03:01dom96it's also a convention to use 'result' instead of defining your own var
19:03:03MagusOTBwhat if the result is a compound type?
19:03:22Jehan_MagusOTB: Every procedure has an implicit variable result that holds the return value. It is initialized as though reset(result) had been called.
19:03:27VarriountMagusOTB: If it's an object, then all it's fields are initialized to zero.
19:03:42VarriountMagusOTB: If it's a reference, the reference is 0 (a null reference)
19:03:48MagusOTBso the same thing you get by calling the proc that comes with the typename
19:03:53dom96gmpreussner: np. Hope that helps somewhat, I know it's not ideal but that is how I would do it. Let me know if you come up with a better solution or if you have any questions.
19:04:50gmpreussneroki
19:06:08gmpreussnerdom96: i think your suggestions will work fine for now. it is kind of what i concluded, except i didn't know about 'nimble install' for local files
19:13:02*bjz joined #nim
19:17:58repaxOne might also want to build object files and temporaries on a scratch disc or ram disc instead of among source files
19:18:38Araqrepax: --nimcache is already configurable
19:18:44repaxGreat
19:18:46BlaXpirit:o
19:23:24*brson joined #nim
19:24:48pigmejwhat does nimsuggest expect on projectfile ?
19:26:56*xcombelle quit (Ping timeout: 240 seconds)
19:28:32gmpreussnerAraq: for the --out parameter, can we make it generate the target directory if it doesn't exist?
19:28:33ArrrrrDoes nim have a switch to test if a file has any problem without having to compile it?
19:28:47*ChrisMAN joined #nim
19:28:48repaxpigmej: That's a good question. Nimsuggest should perhaps have access to as much information as nimble has (in order to find all dependencies)
19:28:50def-Arrrrr: nim check
19:28:54gmpreussnerAraq: for the --nimcache directory it seems to work that way already
19:29:18ArrrrrFantastic , thanks def-
19:29:31pigmejrepax: are you aware of some documentation for nimsuggest?
19:29:41Araqgmpreussner PRs welcome :P
19:30:03Araqpigmej: there is no documentation. ask me
19:30:06repaxpigmej: No. I think it is more like the compiler - i.e. having limited knowledge of the project
19:30:52pigmejAraq: what should I know before I will start integration of it with emacs company mode
19:31:12pigmejAraq: I think about one nimsuggest process per project
19:31:21pigmejbut what more should I know about nimsuggest itself before :)
19:31:31pigmejlike what the heck is that projectfile.nim
19:31:54Araqit usually helps to be completely ignorant when one starts a new project.
19:32:08repaxI find it hard not to be ;)
19:32:22pigmejAraq: you mean ?
19:32:31Araqtoo much knowledge keeps one from doing it
19:32:58pigmejok
19:33:08pigmejfine, just wondering what's that projectfile.nim :)
19:33:14*gimireh quit (Quit: Leaving)
19:33:32pigmejaporia uses current file as projectfile argument for example
19:33:45Araqpretty sure it doesn't
19:33:52*banister joined #nim
19:33:55*banister quit (Max SendQ exceeded)
19:34:06pigmejit does ;) at least for me
19:34:07repaxThe most pressing issue with nimsuggest as I see it has to do with its knowledge of include dirs and project-wide defined symbols
19:34:29Araqthe projectfile is the file that is the main file of your project
19:34:30pigmejAraq: or maybe it's first file where ctrl+space was hit
19:35:09Araqrepax: NimStudio works around that
19:35:29pigmejAraq: yeah, aporia uses first file where completion was called
19:36:05pigmej(it even copies it to /tmp/aporia)
19:37:36BlaXpiritplease help me fix this code. https://bpaste.net/show/19c223b03522
19:37:45BlaXpiritas far as i'm aware, this is a bug, but i dunno
19:37:48pigmejAraq: what are sug|con|def|use ?
19:38:00repaxSo, perhaps NimStudio is a useful source for pigmej?
19:38:17pigmejsug => suggestion, con ?, def ?, use?
19:39:07Araqsug # dot was pressed
19:39:20Araqcon # ( was pressed (show parameters and types)
19:39:27Araqdef # goto definition
19:39:35Araquse # list usages
19:39:51pigmejcool
19:40:00pigmejand the difference between file and dirtyfile ?
19:40:01*xcombelle joined #nim
19:40:13pigmejdirtyfile is something like 'may be broken/ under construction file' ?
19:40:23pigmejkind of ignore syntax errors etc?
19:40:40Araqdirtyfile is the temporary file
19:40:51Araqyou need to save the file for nimsuggest
19:40:53gmpreussnerdom96: i got this working as suggested. i think 'nimble c <file>' is going to be critical though - otherwise i can build either all or nothing :)
19:41:05Araqbut might not want that
19:41:09*dewdrop quit (Read error: Connection reset by peer)
19:41:25Araqso the editor uses a temporary file
19:41:38gmpreussnerdom96: in particular, there is no convenient way to build the tests associated with a package right now
19:41:59Araqand you tell nimsuggest "foo.nim" is actually in "/tmp/foo.nim"
19:42:24pigmejAraq: ah cool
19:42:25*cjbest joined #nim
19:43:20Araqpigmej: also nimsuggest can compile unrelated modules, so you don't really have to create one process per project
19:43:30Araqbut it's true that "per project" works better
19:43:53BlaXpiritAraq, please advise on this very short piece of code. https://bpaste.net/show/19c223b03522
19:44:21dom96gmpreussner: cool. I'll see about implementing that ASAP.
19:44:34flaviuWow, the performance of findAll in nre is terrible!
19:45:15*devdri joined #nim
19:45:49AraqBlaXpirit: known bug.
19:45:52Araqhi devdri welcome
19:45:55BlaXpiritwhat can i do?
19:46:04*bcinman quit (Quit: My Mac has gone to sleep. ZZZzzz…)
19:46:18AraqI never understood why 'distinct G[T]' is required
19:46:22*bcinman joined #nim
19:46:23*devdri quit (Client Quit)
19:46:43BlaXpiritbecause i oversimplified the example
19:46:46*pregressive quit (Remote host closed the connection)
19:46:48BlaXpiritin reality it's actually needed
19:47:06def-BlaXpirit: that's the bug i think: https://github.com/Araq/Nim/issues/1385
19:47:38BlaXpirit:s
19:50:08Arrrrromg, it's been a hard hour but at last i managed to get only one char from window's input without having to press enter http://pastebin.com/rEsqQrTT i feel less stupid now
19:50:51ArrrrrI'm trying to program a roguelike just for experimentation purposes
19:51:01federico3can I list all procs that can act on a given type? The equivalent of dir() ?
19:51:37def-Arrrrr: i think we're missing just that for the terminal module, where it's only defined for non-windows
19:51:56*cjbest quit (Quit: My Mac has gone to sleep. ZZZzzz…)
19:52:12Arrrrri didnt found it inside windows module, but found a way to program it from c++
19:53:12pigmejhmm, Araq i'm getting werid errors from nimsuggest
19:53:17pigmejfor example Error: cannot open '/home/pigmej/Apps/Nim/compiler/lib/system.nim
19:54:38gmpreussnerdom96: is --NimblePath more of an internal feature used by nimble, or is there a way to make Nim read this from the environment? putting it in a nim.cfg is probably not good (absolute path)
19:55:20dom96gmpreussner: it's so that Nim knows where to find Nimble packages
19:55:37gmpreussnerright, but i suppose it's only passed by nimble right now?
19:55:48dom96gmpreussner: nope, it's in Nim's cfg file.
19:56:10dom96It's what allows you to use installed Nimble packages even when compiling with 'nim c'
19:56:13gmpreussnercan it be added as a global environment variable, so i don't have to have an absolute path in nim.cfg?
19:56:37gmpreussneri guess i could throw it into the global nim.cfg for now
19:57:15Araqpigmej: add 'nim' to your PATH
19:57:35Araqpigmej: put 'nimsuggest' into the dir where 'nim' is
19:57:42dom96gmpreussner: nope
19:57:52federico3how can I access "ftell"?
19:58:10Araqfederico3: no, but we know everybody's life depends on this feature
19:58:37pigmejAraq: hmm, in fact they are both symlinked
19:58:42federico3hum?
19:59:10pigmejAraq: where nim binary or where nim sources ?
19:59:21federico3Araq: were you talking to me?
19:59:28Araqfederico3: system.getFilePos
19:59:29def-federico3: getFilePos?
20:00:28federico3thanks
20:00:41Araqfederico3: yes, "can I list all procs that can act on a given type?"
20:00:46pigmejok it seems in the same place where binary is located
20:00:51AraqI replied
20:00:56Araqto that question
20:00:58*endragor quit (Ping timeout: 256 seconds)
20:01:19federico3ah - well, I find python's help() and dir() very useful to explore the language
20:01:46pigmejAraq: now I will need to know what to do with: skVar, skForVar, and so on
20:01:47pigmejwhat are those ?
20:02:02pigmejskVar => seems as a local variable, skForVar same but for for loop
20:02:18Araqwell yes
20:02:30pigmejwhat more is there ?
20:02:43*HakanD joined #nim
20:03:40gmpreussnerdom96: is --NimblePath the path to nimble, the pkgs directory, or to individual packages within pkgs? i can't get it to work :|
20:03:52dom96the pkgs directory
20:04:07dom96i.e. ~/.nimble/pkgs
20:05:03Araqpigmej: procs, converters, iterators, macros, templates, lets, types, consts, methods
20:05:17pigmejAraq: ok so mostly 'everything' ;-)
20:05:18pigmejcool
20:05:41*Arrrrr quit (Quit: Page closed)
20:07:24renesacAraq: the manual says "If the operator ends with ``=`` and its first character is none of
20:07:24renesac``<``, ``>``, ``!``, ``=``, ``~``, ``?``, it is an *assignment operator* which
20:07:24renesachas the lowest precedence."
20:07:33Araqpigmej: skField. that might be all.
20:07:39renesacand right after it, there is the table
20:07:56renesacwhere the precedence level 0 (lowest) has the arrow like operators
20:08:10renesacwith the assignment operators above that
20:08:26Araqyea yeah yeah, fix it. the table is correct
20:08:27renesacthis is very confusing
20:08:35Araqthe text needs an update
20:08:53renesacok
20:10:34renesacand I think the paragraph about arrow operators should be moved to the precedence section
20:10:41renesacas it isn't right associative anymore
20:10:48renesacit only changes precedence
20:10:54gmpreussnerAraq: i find --out rather useless. wouldn't something like --outPath be better?
20:11:46gmpreussner--out seems only useful if you want to rename the build product
20:11:59gmpreussnermost of the time i'm just test compiling modules, however
20:13:28Araqgmpreussner: meh I guess I agree
20:13:52Araqpigmej: https://github.com/Araq/Nim/blob/devel/doc/idetools.txt#L201
20:14:00Araqstill somewhat up to date
20:14:30repaxgmpreussner: And it's not --nimcache:dir/ that you're looking for?
20:15:27pigmejAraq: cool.
20:15:39pigmeji will be there later, I have to go off for hour or two
20:15:55pigmejbut well nimsuggest seems fine
20:17:23Araqbbl
20:20:25gmpreussnerrepax: no, the nimcache is separate. i'm talking about the binaries that are created. they usually end up alongside their corresponding .nim modules
20:22:01*xcombelle quit (Ping timeout: 252 seconds)
20:22:17gmpreussnerdom96: import packageName/module does not work for me in conjuction with --NimblePath. i can do "import module", and it finds the right one (by accident?), but i cannot qualify the package name
20:22:35gmpreussnerError: cannot find 'packageName/module'
20:22:50dom96where did you point --nimblepath to?
20:23:11gmpreussner--NimblePath:"~/.nimble/pkgs"
20:23:26gmpreussnerthe files live in "~/.nimble/pkgs/package-0.1/"
20:23:49gmpreussner0.1 is the version i specified in the .nimble file
20:25:07dom96What does the directory structure in package-0.1 look like?
20:25:39gmpreussnerit's flattened out. just a bunch of files, including module.nim
20:25:58gmpreussnerthere's also a .nimble and a .json. that's it
20:26:01Jehan_Just import module, then.
20:26:17Jehan_If you want to import foo.module or foo/module, you'll have to put it in a foo subdirectory.
20:26:29dom96yeah, you need to put it in a packageName subdir
20:27:05gmpreussneroh ok, so packageName refers to a subdirectory WITHIN the package's srcDir
20:27:13Jehan_Yeah.
20:27:27Jehan_The Nimble package directories are simply added to the search path.
20:27:36gmpreussnerunderstood
20:28:13Jehan_Which is why I have a feature request that foo:module is resolved so that it looks for foo.nimble, then module in that directory. :)
20:28:32gmpreussneryeah, that might be better. packageName subdir seems rather ugly
20:28:36Jehan_To avoid conflicts and stuff (plus, smarter lookup of local modules).
20:29:04Jehan_Right now, you can (for example) override posix.nim by accident, which of course breaks everything.
20:29:23gmpreussnercouldn't we just always infer the 'scope' from the package name?
20:29:34dom96Jehan_: I like that idea.
20:29:45gmpreussnerso if i have packageName.nimble, then "import packageName/module" should just work?
20:29:58dom96Would require tons of code changes though.
20:30:01gmpreussnerregardless of where srcDir is within packageName
20:30:19Jehan_dom96: What idea?
20:30:32dom96Jehan_: foo:module
20:31:16Jehan_dom96: Yeah, not sure how much work it would be.
20:31:17gmpreussnerfor example, i have /packageName/packageName.nimble, /packageName/src/moduleName.nim, srcDir="src". then "import packageName:moduleName" should just work.
20:31:43Jehan_But most importantly, module lookup should start with modules local to the current package.
20:32:17Jehan_It only requires two packages to have a foo.nim module to get some really bad problems.
20:32:42Jehan_Especially if they just happen to be slightly different versions that were copied at different times from the same source.
20:34:31*xcombelle joined #nim
20:35:42dom96gmpreussner: Nimble c is now ready for action.
20:36:05dom96only tested briefly so let me know if you find any bugs.
20:36:11gmpreussnerJehan_: yep, i have this problem right now. complex.nim in a nimble package colliding with the one in stdlib, and no way to disambiguate
20:36:17gmpreussnerdom96: ok, will do right now
20:36:52dom96gmpreussner: hrm, that's a serious problem :\
20:37:19Jehan_gmpreussner: Yeah, I had similar issues myself more than once.
20:38:52Jehan_These days, I mostly stuff things in a subdirectory (but of course that doesn't help with packages).
20:39:18Jehan_Also, if I were ever to use one of the same directories as the stlib, I might run into issues again.
20:39:51Jehan_Anyhow, good night. :)
20:39:59*Jehan_ quit (Quit: Leaving)
20:42:32*dtscode is now known as dtscocain
20:43:05federico3oh - there is no sound support
20:44:01*xcombelle quit (Ping timeout: 252 seconds)
20:54:36gmpreussnerdom96: gonna pm you with some stuff
20:57:00onionhammercool s
20:57:02*bcinman quit (Quit: My Mac has gone to sleep. ZZZzzz…)
20:57:04reactormonkhow can I set environment variables for startProcess?
20:57:18onionhammerso nimble is getting a path command arg? dom96
20:58:12dom96I suppose. It won't be convenient though.
20:58:22onionhammerwhy?
20:58:24dom96It won't be what you asked for.
20:58:48dom96It will be what you can already override in the nimble config file
20:58:52dom96i.e. the nimble dir
20:58:58onionhammernimble install name .
20:59:24onionhammer. meaning here
20:59:33onionhammeror nim l
20:59:48onionhammeroops, phone
21:00:06fowlaraq would say that being able to override posix.nim or system.nim is a feature
21:00:22fowl:p
21:07:02federico3uh oh, there is no syslog
21:08:05*gsingh93 quit (Ping timeout: 246 seconds)
21:11:31*vendethiel joined #nim
21:11:40*HakanD quit (Quit: Be back later ...)
21:12:40*vendethiel- quit (Ping timeout: 265 seconds)
21:12:45*HakanD joined #nim
21:13:58*Kingsquee joined #nim
21:15:12*bcinman joined #nim
21:23:53BlaXpiritrepax, renesac, fowl, flaviu: I updated optionals module. https://github.com/Araq/Nim/pull/2515
21:24:10BlaXpirit(tell me if you don't care about this so i don't bother you anymore)
21:24:57*a5i joined #nim
21:25:03flaviuI care, but my opinion on that implementation is unchanged.
21:25:18BlaXpiritflaviu, on what implementation
21:25:29flaviuOf the optionals module.
21:25:37flaviuAraq, mind taking a look at https://gist.github.com/flaviut/234c784502a81376dd37 ?
21:25:42BlaXpiritwhat in particular?
21:25:56BlaXpiritlook at my last comment there
21:26:43fowlBlaXpirit, or should be a template
21:26:53BlaXpiritwhy?
21:27:15fowlto avoid executing the default param until its needed
21:27:26flaviuBlaXpirit: That's going in the opposite direction, IMO.
21:27:28BlaXpiritah right, right
21:27:48BlaXpiritflaviu, i'm not sure you understand
21:28:02BlaXpiritthe only bad direction i've taken here is the complexity of the module.
21:28:08fowli dont understand why you need just[t] and none[t]
21:28:18flaviuBlaXpirit: I do understand, I just don't like it.
21:28:41BlaXpiritfowl, let me try to explain
21:28:55BlaXpiritthere is that `?` operator which returns one of the two implementations, right?
21:29:10BlaXpiritthe procedures `just` and `nothing` relied on it
21:29:34BlaXpiritwhich means that you cannot choose a different implementation of maybe for your type
21:30:04flaviuThe module API should be no more than Option[T], `?=`, `[]`, `or`, rawGet, isSome, isNone. Everything else is unnecessary and should not exist.
21:31:02BlaXpiritoh but consider this too. a procedure that accepts a Maybe can also accept a zero-overhead Just
21:31:11BlaXpiritit is literally zero overhead
21:32:17flaviuWhy would that be useful?
21:32:26BlaXpirit> it is literally zero overhead
21:32:28*dtscocain is now known as dtscode
21:32:59flaviuI understand its advantages, but why is it useful?
21:33:42BlaXpiritflaviu, let's drop the thought that 2 different implementations of Maybe are not useful. people thought they were.
21:33:50*banister joined #nim
21:33:54*banister quit (Max SendQ exceeded)
21:34:19flaviuBlaXpirit: I don't understand how Just and Nothing are useful.
21:34:47BlaXpiritthey are required if you want to opt out of nil-based implementation
21:35:34flaviuBut they are concrete types? Why even use an Just[T] when a T does the exact same thing.
21:35:40BlaXpiritthey are required because you don't know what underlying implementation of Maybe you'll be using when you're instantiating them
21:36:11BlaXpiritlater they can be converted to a concrete Maybe type
21:36:28fowlBlaXpirit, so Just[T] will be one of the maybe kinds?
21:36:36BlaXpiritwell, yes, yes, it is
21:36:40BlaXpiritit's all in the docs
21:36:56BlaXpiritnow, why is Just[T] needed: because there are converters from Just to Maybes
21:37:57flaviuWhy not have just() return a Maybe directly?
21:38:12BlaXpiriti've covered that, although explanation was very poor
21:38:19*banister joined #nim
21:38:23*banister quit (Max SendQ exceeded)
21:38:58BlaXpirityou wouldn't be able to opt out of nil-based implementation
21:39:11BlaXpirityou don't know what underlying implementation of Maybe you'll be using when you're instantiating a Just
21:40:11flaviuI see.
21:40:13fowlflaviu, isNil(x) will never work, isNil returns bool
21:40:39BlaXpirit?
21:40:44flaviufowl: How do concepts work, I don't understand.
21:41:12flaviuI assumed that each expression is wrapped in a when compiles(...), but I don't really understand it.
21:41:25BlaXpirithow i'm trying to understand it: each part must compile, and, if it returns an expression, it must be boolean true
21:41:51BlaXpiritisNil(x) returns an expression which is not even boolean, so yeah
21:42:05BlaXpirit(but this is all conjecture)
21:42:13BlaXpiritwait, it is lol
21:42:20flaviuAha!
21:42:25flaviuThat was the problem, works now.
21:42:33fowlflaviu, if theres a return type isNil(x) is bool
21:43:08fowli can't get the "x = nil" or anything like that ie "var y = x; y = nil" to work
21:43:13flaviufowl: I can't parse your sentence, but "isNil(x) is bool" works fine.
21:44:40fowlflaviu, i meant if it returns something you need "is T"
21:45:15flaviufowl: Ok, I understand! Thanks!
21:46:26flaviuhttps://gist.github.com/cf4b6f97d60a5c6db888 works great!
21:46:38fowlas to how they work, i believe the code inside the concept is semantically checked
21:47:01fowli stumbled on the section in the compiler but it didnt make much sense
21:48:43BlaXpiritplease write some of your comments under the pull request :p
21:48:56*EXetoC joined #nim
21:49:25flaviuBlaXpirit: Working on it, actually.
21:49:33BlaXpiritthx
22:00:33flaviuError: type mismatch: got (typedesc[ref int], nil) *sigh*
22:01:09BlaXpirityou don't know how much fun i had today
22:01:16BlaXpiritboth literally and sarcastically
22:06:18*banister joined #nim
22:06:22*banister quit (Max SendQ exceeded)
22:08:34flaviuIs there some way to say "Anything but this type"?
22:08:58BlaXpiritflaviu, maybe implement 2nd proc to capture that type
22:10:57*bcinman quit (Quit: My Mac has gone to sleep. ZZZzzz…)
22:11:22HakanDgn
22:11:25*HakanD quit (Quit: Be back later ...)
22:11:58*renesac left #nim ("Once you know what it is you want to be true, instinct is a very useful device for enabling you to know that it is")
22:12:22*renesac joined #nim
22:13:16flaviuBlaXpirit: I don't understand what you mean.
22:13:54*renesac_ joined #nim
22:14:22*renesac_ left #nim (#nim)
22:15:10*bcinman joined #nim
22:19:44*pregressive joined #nim
22:25:07*brson quit (Quit: leaving)
22:30:42*HakanD joined #nim
22:35:09*HakanD quit (Ping timeout: 244 seconds)
22:37:55flaviuAh, I see.
22:45:34*pregressive quit (Remote host closed the connection)
22:46:56*Matthias247 joined #nim
22:47:00*bcinman quit (Ping timeout: 256 seconds)
22:49:43*bcinman joined #nim
23:08:41*user7181 joined #nim
23:12:51pigmejsadly my elisp skills are not enough to make nimsuggest + emacs working (and I don't have probably enough time to improve my elisp now ;/).
23:26:33*Matthias247 quit (Read error: Connection reset by peer)
23:29:29*bcinman quit (Quit: My Mac has gone to sleep. ZZZzzz…)
23:30:16*bcinman joined #nim
23:40:52*bcinman quit (Quit: My Mac has gone to sleep. ZZZzzz…)
23:41:01reactormonkpigmej, wanna team up? Got time in... 18h from now?
23:42:06pigmejreactormonk: if I will have something usefull then, ok ;)
23:43:58*BlaXpirit quit (Quit: Quit Konversation)
23:46:02*davidhq quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)