<< 18-01-2015 >>

00:00:07*JinShil joined #nim
00:03:35*Varriount|Busy joined #nim
00:05:46*Trustable quit (Remote host closed the connection)
00:08:08ekarlsohmm, how can I convert a json object to something I can iterate over ?
00:08:29BlaXpirit_ekarlso, you can immediately iterate over it
00:08:40BlaXpirit_for k, v in my_jobject:
00:08:55AraqVarriount|Busy: I don't get https://github.com/Araq/Nim/pull/1951
00:08:57BlaXpirit_wait.. i'm actually not 100% sure
00:09:13BlaXpirit_yeah, it's correct
00:09:20Araqit says "build.sh can do the download now" but no such commit is in there
00:09:50Araqand apart from that, I *really* dislike changing the build nilly willy. it always breaks things for somebody
00:14:28AraqBlaXpirit_: so what should we do with s[0.. -1]
00:14:47BlaXpirit_Araq, haven't I said?
00:14:52ekarlsohmmms
00:15:01Varriount|BusyAraq: Want me to revert the commit?
00:15:03ekarlsocan't you pass a seq as a varargs ?
00:15:14BlaXpirit_I say, disable the special meaning of negative indices
00:15:40BlaXpirit_I don't know what to do with this without adding alternative ranges/functions to half of stdlib
00:15:44AraqVarriount|Busy: yes. I don't like ./build.sh either. it's sh build.sh so file bits don't matter
00:15:55BlaXpirit_Araq, but you're the language designer here :p
00:16:52BlaXpirit_it is also... possible to make a generic catch-all wrapper
00:17:15BlaXpirit_I just had such a crazy idea for a workaround
00:17:57BlaXpirit_make a new operator (`...` or whatever) that will throw exception if you go out of bounds
00:18:21BlaXpirit_and best (worst) part of this, it would translate 0...-1 to 1..0
00:19:01AraqBlaXpirit_: we can also simply special case 0.. -1, right?
00:19:13BlaXpirit_Araq, nah, people rely on it
00:19:14Varriount|BusyAraq: But special cases are so... icky
00:19:36Araqit's a strange "slice" anyway
00:19:38BlaXpirit_Araq, because it is an alternative way to write x.high
00:20:04BlaXpirit_if you are gonna add special cases, it needs to be a different operator
00:21:21BlaXpirit_so my idea for a new operator, if b<a it returns slice(1, 0); if a<0 you get an error; if b<-1 it turns into you get (a, -1);
00:21:52Varriount|BusyI vote for a breaking change.
00:21:55BlaXpirit_of course, much better would be to just fix everything, but it ain't gonna happen
00:21:56Araqthese negative slices annoy for 'parallel' as well
00:22:19Araqfor 'parallel' I current I do "not supported"
00:22:25BlaXpirit_the smallest breaking change would be [:14:32] <BlaXpirit_> I say, disable the special meaning of negative indices
00:22:39Varriount|BusyYes, that one.
00:22:41BlaXpirit_if it's out of bounds, it's out of bounds
00:23:31BlaXpirit_but i did also describe what I would like to see to help people quickly fix their code in such case
00:23:52Araqyou wrote too much :P
00:24:08Araqhence I'm asking you for a TL;DR
00:24:13BlaXpirit_https://github.com/Araq/Nim/issues/1979 It is impossible to solve this while keeping backwards compatibility. My suggestion is to remove negative indices in slices, and possibly introduce an explicit syntax for them, maybe something like this https://gist.github.com/BlaXpirit/f063fe6706201504580d
00:24:45BlaXpirit_i know the implementation is far from ideal. just a demonstration.
00:26:01EXetoCwhat about getting a possibly empty slice?
00:26:43BlaXpirit_EXetoC, 0..-1
00:26:51BlaXpirit_negative indices special meaning would be removed
00:27:01EXetoCright ok
00:29:11BlaXpirit_Julia has quite a nice syntax. couldn't find a better link than this https://github.com/adambard/learnxinyminutes-docs/blame/master/julia.html.markdown#L197
00:29:44BlaXpirit_all it does is make "end" inside square brackets expand to length of that variable
00:29:54BlaXpirit_you can do math on it and whatnot
00:29:58EXetoCand other issues related to closed intervals? do you think they are less of a problem? having to do "+ 1" here and there for example
00:30:17BlaXpirit_yes, that sux, but let's not get into that, because it is too late
00:31:11BlaXpirit_EXetoC, < operator is an OK workaround most of the time
00:31:23EXetoCok but what were the benefits of half-closed intervals again?
00:31:37BlaXpirit_http://www.quora.com/Why-are-Python-ranges-half-open-exclusive-instead-of-closed-inclusive
00:31:38Araqthere are none ;-)
00:31:42BlaXpirit_-_-
00:31:56EXetoCAraq: what was the reason then?
00:32:25BlaXpirit_in that article, range(a, b) is basically toSeq(a .. <b)
00:32:29EXetoCbut you mentioned 'a' .. 'z' and such
00:32:42EXetoCright
00:33:47Araqagain an exclusive range only works when you have a sentinel you don't care about
00:34:01Araqenums have no such sentinel
00:34:11Araqpython has no typesafe enums
00:34:18Araqneither has C
00:34:19BlaXpirit_we're going offtopic again. thanks, EXetoC :|
00:34:20Araqor Java
00:34:47flaviuJava enums are nothing like C enums.
00:35:03BlaXpirit_my problem is mostly with standard library enforcing inclusive ranges on you
00:35:04Varriount|BusyAnyway, *cough*
00:35:07BlaXpirit_everywhere
00:35:22BlaXpirit_ranges have an easy fix, even now
00:35:35*tinAndi quit (Quit: ChatZilla 0.9.91.1 [Firefox 35.0/20150108202552])
00:35:42Varriount|BusyBlaXpirit_: You would prefer that inclusive and non-inclusive be mixed in the stdlib?
00:35:58benjiwhen designing languages you have to remember that you'll have many, many more user in the future than you have now; you don't want to make the same mistake Stuart Feldman made
00:36:19BlaXpirit_ok let's just forget about inclusive ranges
00:36:24Varriount|Busybenji: Something to live by.
00:36:24BlaXpirit_and look at the problem at hand
00:36:54benjiStuard Feldmen on designing make's syntax: "Why the tab in column 1? [...] I just did something simple with the pattern newline-tab. It worked, it stayed. And then a few weeks later I had a user population of about a dozen, most of them friends, and I didn't want to screw up my embedded base. The rest, sadly, is history."
00:38:20Araqbenji: I'm willing to make the same mistakes that are *required* to be successful. which is: at some point you have to stop deliver stability.
00:38:36Araqer
00:38:40Araqstop and deliver
00:38:46EXetoCwhich of the OOP macros is the best?
00:38:47benjiAraq: agreed; therein lies art
00:38:59BlaXpirit_EXetoC, i feel they are limiting as heck
00:39:15Varriount|Busy"stop *to* deliver stability"?
00:39:31AraqVarriount|Busy: yeah whatever
00:39:58EXetoCBlaXpirit_: what's missing?
00:40:07*gunn joined #nim
00:40:15Araqand exclusive ranges are weird anyway. mathematicians have no problem whatsoever with "sum from 0 to n-1"
00:40:17BlaXpirit_EXetoC, ability to separate things
00:40:28BlaXpirit_Araq, k
00:40:38BlaXpirit_[:35:37] <BlaXpirit_> ok let's just forget about inclusive ranges [:35:42] <BlaXpirit_> and look at the problem at hand
00:41:18BlaXpirit_I see 2 suggestions: remove special meaning of negative indices. introduce a new weird operator (`...`?) that works around this problem [:20:40] <BlaXpirit_> if b<a it returns slice(1, 0); if a<0 you get an error; if b<-1 it turns into you get (a, -1);
00:41:39BlaXpirit_(both suggestions are mine, but i really dont see any others)
00:42:25BlaXpirit_wait, that's not gonna work... if b<-1 you get (a, 0) probably
00:42:32EXetoCBlaXpirit_: none of the macros have any redeeming qualities? I'd just like to discuss getter/setter shortcuts but maybe I'll wait
00:43:06benjiAraq: there is a very narrow pass to navigate; too far on the "don't break things" side and the future is much worse than it could have been (i.e., the gains that an improved design could have made are forfeit), too far on the "do it right" side and the foundations are forever shifting and nothing signficant gets built
00:47:14*sdw quit (Read error: Connection reset by peer)
00:47:39*sdw joined #nim
00:47:39*sdw quit (Changing host)
00:47:39*sdw joined #nim
00:49:10*Varriount|Busy_ joined #nim
00:49:21Araqwell I'll announce it on the forum and see what people say
00:49:35AraqI'm for simply removing negative indexing
00:49:40Varriount|Busy_As am I.
00:49:45Araqas I said, it sucks for 'parallel' too
00:49:49*Varriount|Busy quit (Disconnected by services)
00:49:57*Varriount|Busy_ is now known as Varriount|Busy
00:50:31BlaXpirit_there is an immediate workaround though
00:50:33dom96I'm not.
00:52:08EXetoCdom96: you often benefit from it?
00:52:23BlaXpirit_[:22:50] <BlaXpirit_> but i did also describe what I would like to see to help people quickly fix their code in such case
00:54:21BlaXpirit_what's up with Error: cannot instantiate: 'Slice'
00:54:22*Varriount|Busy quit (Ping timeout: 246 seconds)
00:57:10dom96EXetoC: I just think that 0..1 yielding 1 character makes a lot more sense than 2.
00:57:31BlaXpirit_ok but we're not gonna break all existing code
00:58:01BlaXpirit_and make slices/loops on ordinals impossible
00:58:13dom96I already discussed my opinion on the github issue.
00:58:17BlaXpirit_i'm all for it, but it's just not realistic
00:59:16BlaXpirit_you're opinion is just an opinion, because you're not describing any way to make it real
00:59:24BlaXpirit_your* omg
00:59:30*gsingh93 joined #nim
00:59:37gmpreussnerhi all
01:00:40EXetoCdom96: but that will remain so, won't it?
01:01:41dom96BlaXpirit_: I did. I suggest we implement Python's slice syntax.
01:01:51dom96That shouldn't break anything
01:02:04BlaXpirit_well if it's separate, sure
01:02:16BlaXpirit_go ahead and duplicate every single slice-based operation
01:02:45EXetoCdom96: the only difference will be that x[0 .. -1] will instead yield []
01:03:06BlaXpirit_EXetoC, no..?
01:03:25dom96The difference will be that you will be able to write: x[0:]
01:03:45BlaXpirit_[:01:35] <BlaXpirit_> go ahead and duplicate every single slice-based operation
01:04:04Araqplus the parser updates
01:04:09Araqplus the grammar updates
01:04:17Araqplus the AST changes
01:04:22BlaXpirit_that's nothing, in comparison
01:04:33Araqplus the ability to overload such a construct
01:05:07Araqplus the doc updates
01:05:30Araqand then we only have the problem with people wondering why both exist
01:05:38EXetoCdom96: I'm not talking about syntax here. what am I missing?
01:05:41Araqand if they are different or not
01:06:03dom96EXetoC: I am
01:06:05EXetoCbut [0 .. <0] yielding [] would be neat, but we'd need a temporary operator and a migration strategy
01:06:06Araqand why Nim has 2-4 ways to accomplish everything
01:06:26BlaXpirit_..< operator lel
01:06:26EXetoCwhere is [0 .. -n] actually used though?
01:06:49BlaXpirit_EXetoC, sequ[2 .. -1]
01:06:50EXetoCBlaXpirit_: I meant any negative value
01:07:15Araqs[-1] doesn't work anyway for efficiency
01:07:22EXetoCBlaXpirit_: yes but how often is it relied upon?
01:07:35Araqthe negative indexing was an alien from the beginning
01:07:44BlaXpirit_you can only be sure that people rely on it SOMEWHERE
01:07:59BlaXpirit_and i think you underestimate how many people want to write -1 instead of stuff.high
01:08:04dom96ok ok, remove the negative indexing.
01:08:15dom96It's a pity that our slices won't be as nice as python's though.
01:08:29AraqBlaXpirit_: sugar for stuff.high can always be added later though
01:08:39BlaXpirit_Araq, exactly
01:08:44BlaXpirit_but i'm not talking about this
01:08:50EXetoCmy suggestion doesn't appeal to anyone?
01:08:52BlaXpirit_i'm talking about how much it may be used in current code
01:09:07BlaXpirit_I don't see your suggestion
01:09:15BlaXpirit_specialcase 0..-1 ?
01:10:30EXetoC[0 .. -n] yielding []. the behavior would be similar to how 0 .. -n is iterated through
01:10:45dom96BlaXpirit_: That would be horrible.
01:10:50EXetoCor it might not be so similar
01:10:51BlaXpirit_dom96, yup
01:11:13dom96Just make ~ equal that len or something
01:11:20BlaXpirit_that's not the problem
01:11:31dom96or maybe %
01:11:32BlaXpirit_that is a useful addition for later
01:11:43BlaXpirit_dom96, and i suggested that a long time ago
01:11:45BlaXpirit_Y U NO READ
01:11:56dom96jesus, calm down.
01:12:04BlaXpirit_that's why i get angry and produce "noise"
01:12:19BlaXpirit_because i need to repeat over and over and over
01:12:24EXetoChave a 'slice' proc or something, then apply a migration path
01:13:07*Varriount|Busy joined #nim
01:14:14AraqEXetoC: tell me more about your idea
01:14:24Araqit that because of leading 0?
01:15:20Araqbut the point is that [0.. -4] includes everything (including) the 4th last entry
01:15:23ekarlsohow can I go from time > int ?
01:15:34ekarlsotoSeoncds only gives float :/
01:16:07AraqEXetoC: we might as well get rid of negative indexing then
01:16:26AraqBlaXpirit_: take a guess of how I feel ;-)
01:16:33BlaXpirit_so i just produced a workaround that doesnt need any changes whatsoever
01:17:01*Araq too needs to repeat himself over and over and over
01:17:56BlaXpirit_https://gist.github.com/BlaXpirit/3de6485bc57bee074a21
01:18:06EXetoCAraq: BlaXpirit_ was annoyed by the verbosity of yielding a slice that is possibly empty [], so that's what I was getting at. a proc could be introduced just for that purpose, but I think he implied that it was a very common operation
01:18:49BlaXpirit_here i just make a `...` operator that has non-inclusive right end and doesn't allow negative indices and is based only on `..`
01:20:00EXetoCreturning SomeOtherSliceType?
01:20:06BlaXpirit_nope
01:20:10BlaXpirit_returning Slice
01:20:30BlaXpirit_no idea why : Slice return type doesnt work
01:20:39EXetoCit's a generic type
01:20:46BlaXpirit_oh, what a dummy
01:20:49EXetoChm
01:21:11EXetoCbut it works for parameters at least
01:22:14EXetoCbut because of inference
01:24:09BlaXpirit_this is so stupid but it works
01:26:36BlaXpirit_(i made some adjustments to https://gist.github.com/BlaXpirit/3de6485bc57bee074a21 )
01:26:42BlaXpirit_anyone still here?
01:27:47EXetoCAraq: [x .. lessThanX] == []? again, with a temporary proc for the sake of migration
01:29:44AraqBlaXpirit_: well I think having both ... and .. doesn't solve anything. rubyists will love it though
01:30:13BlaXpirit_Araq, why doesnt it solve anything
01:30:28EXetoCbut that might introduce other errors. it's a trade-off though
01:30:35BlaXpirit_you can make an inclusive version that just prevents negative indices, too
01:30:54EXetoC(I'm referring to what I said)
01:33:27EXetoCor make -1 the only allowed negative value, and then you can catch other kinds of error. 'find' procs never return -2 for example after all
01:34:01BlaXpirit_-1 is the main problem
01:34:04BlaXpirit_what are you thinking
01:34:57EXetoCwith the *current* implementation you mean? because of the questionable semantics
01:35:11AraqBlaXpirit_: because instead of .. vs .. < the poor programmer has to think about .. vs ...
01:35:33BlaXpirit_name it ..<
01:35:35Araq.. < is nicer, especially once we added:
01:36:00Araqtemplate `..<` (a, b): expr = a .. < b
01:36:10BlaXpirit_oh u did? i havent noticed
01:36:22Araqno, but we should finally
01:36:25BlaXpirit_..ok
01:36:34BlaXpirit_and use my implementation :|
01:36:39BlaXpirit_crazy
01:36:53AraqI already gave the implementation
01:37:00BlaXpirit_well it doesnt fix anything then
01:37:09BlaXpirit_and is irrelevant
01:37:18Araq?
01:37:26Araqit fixes as much as your ...
01:37:37BlaXpirit_wtf no
01:37:56BlaXpirit_a[0 ..< 0] remember?
01:38:16BlaXpirit_the whole reason why we are talking?
01:38:42EXetoCbut my change would not affect [x .. y], which I'd imagine is very common
01:39:33BlaXpirit_EXetoC, this whole time it seems like you're talking about something completely different
01:40:38BlaXpirit_the only suggestion that would change .. was suggested by dom96, and it was to completely change it
01:41:40AraqBlaXpirit_: ok, so your ... is not ..< because it gets rid of negative indexes?
01:41:50EXetoCI mean, where x is >= 0 and y >= x. making [x .. y] different then would break a lot more code compared to just making [x .. lessThanX] yield [], which is something you got caught up with before
01:41:53Araqbut we are not discussing this anymore :P
01:42:04BlaXpirit_then what the heck are we discussing
01:42:22Araqyou brought up ...
01:43:06BlaXpirit_please tell me what you think we're discussing
01:43:30Varriount|BusyAraq: Could you please look at https://github.com/Araq/Nim/pull/1981 ?
01:43:33Araqa nice syntax for ..<
01:43:40BlaXpirit_wat
01:43:51BlaXpirit_who cares about that operation if it's useless
01:43:53EXetoCnow I completely forgot about introducing a migration path though, and I guess I'm only referring to your gripe regarding the ugly code needed to possibly yielding an empty slice ([])
01:43:55BlaXpirit_and fixes absolutely nothing
01:44:49AraqVarriount|Busy: add a test case that has a space in it
01:46:13Araqlooks fine to me
01:46:44AraqBlaXpirit_: look, IMO we settled on the semantics and so I thought now we were discussing syntax
01:47:13BlaXpirit_I wasn't aware that anyone settled on anything
01:47:19Varriount|BusyAraq: Which directory do I place it in?
01:47:34EXetoCbut [x .. x] yielding [] does indeed have some nice properties, and a migration path could be introduced in any case, but then would you change the semantics of "for x .. y" too?
01:47:36BlaXpirit_at least announce what I'm supposed to have settled on
01:48:43AraqVarriount|Busy: 'misc'
01:50:31BlaXpirit_[:29:02] <Araq> BlaXpirit_: well I think having both ... and .. doesn't solve anything. rubyists will love it though [:34:29] <Araq> BlaXpirit_: because instead of .. vs .. < the poor programmer has to think about .. vs ...
01:50:45BlaXpirit_where did I miss the statement that we settled on something?
01:50:49BlaXpirit_i don't understand
01:50:54BlaXpirit_please say what we settled on
01:50:59Araqyou didn't miss anything
01:51:28Araqwe agreed on getting rid of negative indexing
01:51:47Araqthe migration path doesn't concern me much
01:51:55BlaXpirit_pffffft okay then
01:52:12BlaXpirit_then nothing else needs to be changed, really
01:52:32BlaXpirit_except maybe an addition of something that provides "len" inside square brackets
01:52:44EXetoCyou don't really care for a shortcut that might yield [] anymore?
01:53:15BlaXpirit_what shortcut
01:53:20BlaXpirit_s[i .. <i]
01:53:21BlaXpirit_this one?
01:53:33BlaXpirit_i dont need anything else for happiness
01:53:41EXetoCanything that is roughly as compact
01:53:52BlaXpirit_well it is already there
01:54:06EXetoCok well you said that you *only* wanted to disallow negative indices
01:54:34BlaXpirit_[:23:32] <BlaXpirit_> https://github.com/Araq/Nim/issues/1979 It is impossible to solve this while keeping backwards compatibility. My suggestion is to remove negative indices in slices, and possibly introduce an explicit syntax for them, maybe something like this https://gist.github.com/BlaXpirit/f063fe6706201504580d
01:58:47BlaXpirit_there. an alternative to `..` that just disallows negative indices and works exactly the same otherwise. https://gist.github.com/BlaXpirit/3de6485bc57bee074a21#file-workaround-nim-L42
01:59:08BlaXpirit_ /fixed
01:59:25fowlmouthhow annoying
01:59:27EXetoChuh
02:00:34*flaviu quit (Remote host closed the connection)
02:01:17fowlmouthyou want to break all my code
02:01:26EXetoCso str[x .. <x] where <x is >= 0 yields an empty string now, but s[0 .. -1] yields the whole string
02:01:46BlaXpirit_no
02:01:51BlaXpirit_oh wait
02:01:52BlaXpirit_yes
02:01:54BlaXpirit_yes
02:02:03BlaXpirit_that is the main problem
02:02:03*flaviu joined #nim
02:02:42EXetoCBlaXpirit_: but did you not want str[x .. find(str, "x")] to possibly yield []? that's something we discussed to great length, but then I asked you know and you didn't really seem to care much
02:02:47EXetoChence the suggestions I've made today
02:02:54fowlmouthBlaXpirit_, that is simply how strings work, get over it
02:03:19BlaXpirit_fowlmouth, you should familiarize yourself with the subject first.
02:03:47EXetoCregarding that shortcut in particular (rather than "if idx == -1: [] else: str[0 .. idx]")
02:04:14BlaXpirit_well now i made a better, universal shortcut
02:05:27fowlmouth"better"
02:05:34EXetoCwell I tried to figure out how it relates to the issue regarding a potentially empty slice ([x .. -1]), but couldn't
02:06:29BlaXpirit_i'm still trying to do things without breaking backwards compatibility. turning out pretty nice, btw.
02:06:55*VinceAddons quit (Read error: Connection reset by peer)
02:07:02BlaXpirit_but since Araq agrees to just make negative indices act as normal, i can maybe just stop
02:07:41fowlmouthno BlaXpirit_ you've turned a simple slice into a branching function and introduced exceptions, this will never pass the microbenchmarks
02:08:20BlaXpirit_that is the price you pay for backwards compatibility
02:08:26BlaXpirit_it can be used RIGHT NOW as well
02:08:28fowlmouthand if we aren't passing microbenchmarks the blogs will hate on us
02:08:36fowlmouthand when reddit reads the blogs reddit will hate on us
02:08:55fowlmouthyes let me go change every ".. <" to "..<"
02:08:56EXetoC.eval var s = "ohai"; echo s[0 .. s.find("q")] # this would print the empty string with my suggestions, but what with your changes is it that provides such a shortcut?
02:08:59MimbusEXetoC: ohai
02:09:10fowlmouthbrb 15 mins lol
02:09:21BlaXpirit_EXetoC, this shortcut is stupid
02:09:33BlaXpirit_i couldn't care less about it, it's a horrible practice
02:09:42BlaXpirit_Araq tried to pose it as useful
02:10:30EXetoCwhat are you talking about? when did he propose such changes? he wanted to make s[0 .. -1] yield an empty sequence rather than the whole string such as is the case now?
02:10:48BlaXpirit_EXetoC, that suggestion is bad because it will break more things than fix
02:10:58BlaXpirit_and it is an exception to already wonky rules
02:10:59EXetoCyou want a shortcut that might yield an empty sequence but you don't want that to be str[0 .. -1]?
02:11:31BlaXpirit_str[0 .. -1] is acceptable to me if negative indices are otherwise an error
02:11:50BlaXpirit_but. with that weird snippet you can use str[0 .! -1] right now
02:11:54AraqBlaXpirit_: it IS useful, "natural" even
02:12:12BlaXpirit_it is a side effect, and relying on it is bad
02:12:13EXetoCBlaXpirit_: other indices being less than -1?
02:12:44BlaXpirit_btw str[0 .. -4] should probably also return empty string
02:12:46EXetoCor just any negative value that is not a compile-time value?
02:13:26BlaXpirit_the thing is, we already allow slices to go out of bounds
02:13:32EXetoCBlaXpirit_: that is what I was suggesting
02:15:12Araqgood night
02:15:16BlaXpirit_4:15 AM, it's probably time to go
02:15:23EXetoCgah
02:15:36BlaXpirit_y u do dis, why alwats so late
02:17:14EXetoCfirst you say it's stupid and then you basically say the same thing as I do. I'm confused
02:17:43BlaXpirit_I understand that you suggest to change only -1 as special case
02:19:10EXetoCmaybe other negative values too, not sure, but I am not referring to any interval changes
02:22:44Varriount|BusyI dislike 'special cases' like these - they only complicate the mental model programmers have to maintain when writing code.
02:22:55BlaXpirit_special cases are not good for sure
02:25:34*jefus_ joined #nim
02:27:07*Varriount|Busy quit (Ping timeout: 246 seconds)
02:27:34EXetoCVarriount|Busy: it's a small change that solves one of his issues that he has, vs a change which might solve a couple of other issues, but is really intrusive, with or without a migration path, imo
02:28:13BlaXpirit_EXetoC, you think special-casing -1 is a small change?
02:29:13BlaXpirit_I've already said, people are not too unlikely to rely on -1 as well: someSeq[4:-1] # discard first 4 items
02:29:27BlaXpirit_I've already said, people are not too unlikely to rely on -1 as well: someSeq[4 .. -1] # discard first 4 items
02:29:28BlaXpirit_rather
02:29:33*jefus quit (Ping timeout: 276 seconds)
02:29:48BlaXpirit_this will cause more problems
02:31:20fowlmouth..? which people do you speak for exactly
02:31:35EXetoCtrue, but you think it's just as intrusive? what about "for x in a .. a" with your proposed interval changes? would this now iterate 0 times? it would be related. Araq barely even discussed changing the intervals though
02:31:55BlaXpirit_i do not propose any interval changes
02:34:25BlaXpirit_i still recognize only 2 options: completely removing special meaning of negative indices or leaving 100% backwards compatibility and introducing an alternative operator that works correctly
02:34:38fowlmouth3. do nothing
02:34:41EXetoCok but what is it that will yield an empty string? when slicing
02:34:58BlaXpirit_alternative operator
02:35:14BlaXpirit_"abc"[0 .! -1] == ""
02:35:23BlaXpirit_sure, this is ugly, but just an example
02:35:55BlaXpirit_"abc"[0 .! -5] == "" or maybe an error. whatever, doesnt matter
02:35:56EXetoCok so then you need a new slice type, right?
02:36:28BlaXpirit_EXetoC, that, or workarounds as shown in my gist
02:36:48BlaXpirit_you may have seen that branched proc `.!` - it works without any changes to the language
02:37:18BlaXpirit_(0 .! -1) == (1 .. 0)
02:37:28BlaXpirit_that's the gist of it :s
02:37:43fowlmouththis all so that str[0 .. find(str,"q")] returns "" if there is no q -_-
02:37:59BlaXpirit_it also removes negative indices completely
02:38:27BlaXpirit_fowlmouth, that is definitely not what i had in mind
02:38:31fowlmouthwhy? the programming languages i'm familiar with work like this
02:38:39EXetoCso, "for x in 0 .! x.high" too? otherwise it'll get confusing
02:39:10BlaXpirit_(0 .! x.high) == (0 .. x.high) for nonnegative indices
02:39:27BlaXpirit_fowlmouth, what are u talking about
02:39:36EXetoCbut if x.high yields -1
02:39:53BlaXpirit_then it translates to (1 .. 0)
02:40:26BlaXpirit_fowlmouth, there is no language that doesn't let you get an empty slice from the beginning of a string/seq
02:40:42fowlmouthcurrent behavior is more desirable than having your one-liner work
02:40:46BlaXpirit_and that shortcut you've demonstrated is stupid, as i've said on multiple occasions
02:40:55BlaXpirit_fowlmouth, why are you doing this to me
02:40:59EXetoCyes but it affects "iterator `..`" hence why it's a bigger change than mine
02:41:07BlaXpirit_i'm almost shouting inside my brain
02:41:08fowlmouthi dont go in #python and not shutup about the things i want them to change
02:41:35BlaXpirit_EXetoC, how can 0 changes to the language change iterator `..`
02:41:50BlaXpirit_fowlmouth, you fell for it
02:41:54fowlmouthyou're being annoying BlaXpirit_ , your ideas are "better" mine are "stupid", buzz off
02:42:11BlaXpirit_fowlmouth, you're being annoying
02:42:17BlaXpirit_[:37:02] <fowlmouth> this all so that str[0 .. find(str,"q")] returns "" if there is no q -_-
02:42:27BlaXpirit_no, it is definitely not what we've been talking about
02:42:37fowlmouthwelcome to /ignore, please return the favor
02:42:39BlaXpirit_how about you read https://github.com/Araq/Nim/issues/1979
02:42:39EXetoCBlaXpirit_: but one must migrate eventually
02:43:05EXetoCunless you make "for i in 0 .. -1" fail immediately, in which all hell breaks loose
02:45:47BlaXpirit_I just wish fowlmouth would actually look at what we're talking about before making things up
02:48:28BlaXpirit_so he tries to pose some stupid shortcut as the reason of this whole talk, to pose it as my idea, but i call the supposedly mine idea stupid, and he gets angry at that? i don't get it
02:49:33EXetoCbad forum or not, eventually I get confused on IRC, but that might just be me
02:49:41*yonson joined #nim
02:49:58BlaXpirit_definitely has been very confusing
02:50:20BlaXpirit_but you saw that Araq said he didn't read the issue page
02:50:24BlaXpirit_and neither did fowlmouth
02:50:26BlaXpirit_so there's that
02:51:10flaviuI find it best to just take a step back and do something else when someone is being irritating.
02:51:35gmpreussnero hai. looks like i missed the party!
02:51:54EXetoCyes. I just get stubborn, but let's talk again tomorrow. just try to make your case in one go with examples and such
02:52:29flaviuPost it on the forum, it's more convenient than backlogging on IRC.
02:52:42EXetoCand not a huge stack of individual sentences. I'll do the same
02:53:19BlaXpirit_3rd instance of the discussion is not what we need
02:53:26BlaXpirit_issues page is totally fine
02:53:32BlaXpirit_if only people actually used it
02:58:39EXetoCstr[0 .! -1] -> "", and then *maybe* eventually str[0 .. -1] -> "" (migration)? ok
03:00:01*rpag quit (Quit: Leaving)
03:00:30*darkf joined #nim
03:00:47BlaXpirit_i just shouldn't have brought up this workaround, because it introduced way too much confusion
03:01:07BlaXpirit_that implementation of .! is definitely ugly
03:04:52EXetoCwell I was talking about the exact same thing, yet you seemed to disagree
03:05:23BlaXpirit_confusion on top of confusion
03:05:39EXetoC-.-
03:08:46*BlaXpirit_ quit (Quit: Quit Konversation)
03:21:39*yonson quit (Quit: Leaving)
03:55:22*brson quit (Quit: leaving)
03:55:57*brson joined #nim
03:59:14benji"violent agreement" ;)
04:27:22*BitPuffin quit (Ping timeout: 240 seconds)
04:29:05dtscodehey dom96, so i would like to clarify something about your answer to my forum post
04:30:01dtscodeso if i have $ProjectRoot, which contains the nim file with the jester routes, and then i have $ProjectRoot/public/css. that corresponds to site.tld/css?
04:30:02*saml_ quit (Remote host closed the connection)
04:37:36*badkins quit (Remote host closed the connection)
05:15:14*EXetoC quit (Ping timeout: 245 seconds)
05:38:12*brson quit (Ping timeout: 245 seconds)
06:14:20*brson joined #nim
06:57:27*gunn quit (Ping timeout: 272 seconds)
06:57:36*gunn joined #nim
07:05:49*gokr quit (Quit: Leaving.)
07:06:14*SplinterOfChaos quit (Ping timeout: 265 seconds)
07:28:52*fowlmouth quit (Quit: Leaving)
08:04:20*gokr joined #nim
08:04:31*gokr quit (Read error: Connection reset by peer)
08:04:54*gokr joined #nim
08:17:30*lws quit (Read error: Connection reset by peer)
08:19:03*brson quit (Quit: leaving)
08:29:02*mafm joined #nim
08:35:30*vendethiel quit (Ping timeout: 246 seconds)
08:36:54*vendethiel joined #nim
08:37:25Triplefoxis it possible to access the contents of an exception as an object from the except: block?
08:40:00Triplefoxoh, getCurrentException()
08:42:24*lws joined #nim
08:42:24*lws quit (Changing host)
08:42:24*lws joined #nim
08:51:38*jpoirier quit (Read error: Connection reset by peer)
09:01:42*gunn quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
09:02:17*mafm quit (Quit: Page closed)
09:03:30*gokr quit (Quit: Leaving.)
09:03:58*lws quit (Read error: Connection reset by peer)
09:05:35*JinShil quit (Read error: No route to host)
09:08:01*JinShil joined #nim
09:20:19*akiradeveloper joined #nim
09:22:30akiradeveloperHi, some names type, block and end are forbidden to use because they are reserved by compiler. Is there workaround? I use them as members in type (fuse has such types)
09:24:27reactormonkakiradeveloper, you could always go with End, or rather use end_
09:24:45reactormonkso object ... end_: int {.importc: "end".}
09:25:39akiradeveloperunderscore is forbidden too?
09:25:48reactormonkoh right -.-
09:26:28reactormonknot sure what the convention is here
09:27:01reactormonkakiradeveloper, you could go for End for now
09:27:18reactormonkAraq, what's the convention when you have an {.importc.} variable that's called "end"?
09:27:27akiradeveloperI tried End for end but it doesn't fit for me
09:28:04akiradeveloperso now, I stay it m_end
09:28:10reactormonkkk
09:29:00*gunn joined #nim
09:43:16akiradeveloperAdding *(star) to symbol exports it but tedious if all the symbols to be exported. Is there workaround? such as exporting all symbols within the file or in some range.
09:50:56*gsingh93 quit (Quit: Connection closed for inactivity)
10:11:46reactormonkakiradeveloper, nope
10:15:35*MyMind quit (Read error: Connection reset by peer)
10:16:19*Pisuke joined #nim
10:33:15Araqakiradeveloper: you can use `end` in backticks, but admittedly it's not very nice to use
10:44:14*BlaXpirit joined #nim
10:54:49*gmpreussner_ joined #nim
10:55:25*gmpreussner quit (Ping timeout: 244 seconds)
11:12:48*Trustable joined #nim
11:13:44*yonson joined #nim
11:19:06*gokr joined #nim
11:24:32gokrHey fellas
11:26:57ekarlsohey gokr :)
11:27:08gokrHalloj :)
11:27:21gokrWas just about to set up a Pluto planet for Nim
11:27:45gokrSitting in "Leo land" - a play center for kids. So I got 3h I think :)
11:30:30*akiradeveloper quit (Remote host closed the connection)
11:30:34*skyfex joined #nim
11:34:24ekarlsohttps://bpaste.net/show/1ea8a6fa1252 < should I just change my stuff there
11:34:33ekarlsoto always use "json" vs direct types ?
11:34:39ekarlsoI guess it would simplify it alot
11:39:45Triplefoxsprite packer progress https://vine.co/v/OjpFEzdlFF7
11:42:16gokrOh, you are working on the packing problem?
11:42:43gokrI once built an advanced tool for optimizing cutting out complicated shapes out of boards.
11:43:00Triplefoxi'm not doing anything original, just taking a simple scanline algorithm recommended by a stackoverflow thread
11:43:16gokrYou only deal with rectangles or?
11:43:36Triplefoxyeah, this is used to make optimal texture atlases for games
11:43:47gokrYeah, I get it.
11:44:00gokrWe used ant colony heuristics
11:44:11gokrAs the overall driving algorithm.
11:44:14Triplefoxoh, that sounds interesting
11:44:28gokrYeah, a very cool algorithm - and fun to implement.
11:44:42gokrImitating how ants find the shortest paths
11:48:58gokrTriplefox: http://en.wikipedia.org/wiki/Ant_colony_optimization_algorithms
11:49:23gokrYou can google for like "aco ant colony optimization bin packing problem" or something.
11:49:31gokrAlso known as the cutting stock problem
11:50:52gokrThe algorithm we used basically imitates the initially "random search" a swarm of ants do when running around looking for food. Then eventually their dropped pheromone trails will reinforce the shortest paths between the food and the stack - and eventually all the ants will follow that trail.
11:51:21*gmpreussner__ joined #nim
11:51:40*VinceAddons joined #nim
11:51:44*gmpreussner_ quit (Ping timeout: 244 seconds)
11:52:35Triplefoxall this algorithm does is walk left to right, top to bottom, placing rectangles in largest to smallest order. most of the fun in it is optimization but i'm probably going to leave it as is since i'm not aiming for realtime
11:53:31Triplefoxgood night
11:56:33gokrnite
11:58:43*JinShil quit (Quit: Konversation terminated!)
12:03:02*JinShil joined #nim
12:19:00*akiradeveloper joined #nim
12:29:39*darkf quit (Ping timeout: 246 seconds)
12:35:37dom96dtscode: yes
12:41:12akiradeveloperThanks Araq. I will go with the backticks solution
12:42:37*darkf joined #nim
12:44:34dom96akiradeveloper: The way we usually get around this is to prefix the field name with 'the', i.e. 'theEnd'
12:45:41BlaXpirithow dramatic
12:46:17flaviuI promised to write something to someone in here, but it was a few days and I can't track it down in the logs.
12:49:12akiradeveloperI like the backticks solution but if Nim compiler eventually discard it, I will settle in the "the" plan
12:53:41*akiradeveloper quit ()
12:55:02*x4nt quit (Quit: WeeChat 1.0.1)
12:57:34flaviuHow does genmapping work?
12:58:24Araqit outputs the list of C files for niminst
12:58:51Araqit used to write some identifier mapping too but iirc I disabled that since it's of no use
13:31:45gokrPlaying with Pluto: http://padme.krampe.se/planetnim/nim.html
13:32:06gokrSo ... anyone with a Nim feed - tell me :)
13:33:38dom96oh yay, my blog is there already :)
13:33:50def-gokr: looks like mine is in as well^^
13:34:04gokrdef-: Hookrace?
13:34:07def-yes
13:34:18gokrI picked those I kinda knew :)
13:34:35gokrSo... this pluto tool is very ... configurable.
13:34:48Araqha my blog is not there
13:34:55gokrI will see where I end up, there are lots of templates - and you can even drive output into Jekyll.
13:35:04gokrAraq: It would have been if you had a visible feed
13:35:15gokrI couldn't see the feed
13:35:17AraqI'm not "blogging" anymore
13:35:19gokrPerhaps I am blind :)
13:36:10Araqskyfex: I hope you know about vm.echoDebugCode?
13:36:45skyfexAraq: No, I didn't. Thanks for the tip :)
13:37:43gokrdom96: This is a meta planet using pluto - you can try several templates there (upper right corner): http://planetweb.herokuapp.com
13:38:31def-Araq: I need some pointers to continue tcc-repl
13:38:35dom96gokr: You should change the link to the build bot to: http://buildbot.nim-lang.org
13:38:55gokrOh, nice :)
13:39:04gokrI had missed that it was pointing correctly
13:39:15gokrWhich reminds me - we should try to dig out some macs
13:39:35def-Araq: When I have two lines "var x = 1" and "echo x", how do I get x to be of the right type in the second one?
13:39:37gokrI have one, but... I use it :)
13:40:22Araqskyfex: how did you find the bug then? o.O
13:40:30gokrRon may have a mac we could use - we will need to have a builder for mac for our purposes anyway.
13:40:45AraqI enabled echoDebugCode, looked at the bytecode and saw the problem :-)
13:41:29Araqdef-: sem.fitNode
13:41:38Araqor similar
13:42:07dom96Araq: Could you please put these tips onto a "Debugging the compiler" wiki page?
13:42:39skyfexAraq: Well, the stack trace showed where the bug occured, and I read the code enough to see that instructions that would insert something into a register would sometimes call `myreset`, it was a bit of a guess, which is why I said to review it carefully before merging ;)
13:43:29flaviudom96: btw, the syntax cheatsheet on the forum is using the wrong domain.
13:43:46dom96flaviu: create an issue
13:43:53dom96or better yet a PR
13:43:59Araqdom96: also the syntax cheatsheet should use forum/rst.html
13:45:26dom96https://github.com/nim-lang/nimforum/issues
13:46:19gokrThis is another template btw: http://padme.krampe.se/planetnim/nim.top.html
13:50:23*BitPuffin joined #nim
13:51:51def-gokr: looks very different
13:52:25gokrhehe, yeah.
13:52:51def-something goes wrong in the first one btw
13:53:00def-from your second post on everything is monospace
13:53:44ekarlsoyay
13:53:52ekarlsoso jwt auth for packages is now fixed :p
13:54:01ekarlsoall done in nim (:
13:54:25ekarlsoI started hacking on a play.rust-lang.org alike thing for nim also using docker
13:54:51ekarlsoidea could be to have a "executor" that listens for incoming snippets to execute and act as a backend for Mimbus as well as the webpage
13:57:08def-ekarlso: that would be really useful to have
13:57:50ekarlsocould probably link it to github accounts as well
13:57:57ekarlsoso that people could have their "snippets" show up
13:57:58flaviuldlework: https://gist.github.com/487be89b8abfae2612e8
13:59:08*benji quit (Quit: leaving)
14:01:57Araqdef-: why do you need to touch semantic checking?
14:02:37def-Araq: i guess because I don't understand how the whole repl thing would work
14:03:43def-when the user enters a new piece of code, would I just translate that piece to C? Or that piece and everything before it?
14:03:55def-Now I guess it's the latter, and I have to goto the right position
14:04:01Araqthat and everything before it
14:04:14Araqyou don't have to go to the right position
14:05:11def-but you don't want the old lines to be executed when you enter a new one
14:05:42Araquh oh, that's a good point lol
14:05:56Araqthat completely escaped me :-)
14:06:14Araqso yeah
14:06:42Araqyou want to keep procdefs etc but not top level 'echo' statements
14:07:08*EXetoC joined #nim
14:07:40def-also don't want to keep calculations
14:08:04Araqyeah, only declarative stuff
14:15:09Araqand the stuff in globals need to be kept. most important feature of a REPL
14:25:20*jefus__ joined #nim
14:28:43*jefus_ quit (Ping timeout: 245 seconds)
14:29:18*gokr quit (Quit: Leaving.)
14:40:13sillestais there any way to get the number of references a ref variable has?
14:40:44*JinShil quit (Quit: Konversation terminated!)
14:43:21Araqsillesta: system.getRefcount but don't use it for anything except debugging
14:43:43Araqand even then it only counts the references in the heap
14:57:34*ARCADIVS quit (Quit: ARCADIVS)
15:01:25*jpoirier joined #nim
15:51:39BlaXpirit"importcing macros is extremely problematic" - is this still true?
15:54:48*gokr joined #nim
16:08:14*gsingh93 joined #nim
16:12:45*gokr quit (Quit: Leaving.)
16:15:03*gmpreussner___ joined #nim
16:15:45*gmpreussner__ quit (Ping timeout: 244 seconds)
16:31:06*darkf quit (Quit: Leaving)
16:33:54*sdw quit (Ping timeout: 276 seconds)
16:35:39*yonson quit (Ping timeout: 252 seconds)
16:46:57DemosBlaXpirit, probably
16:47:14*davidhq joined #nim
16:51:30*gmpreussner joined #nim
16:51:55*gmpreussner___ quit (Ping timeout: 244 seconds)
16:53:34*BlaXpirit_ joined #nim
16:56:33*BlaXpirit quit (Ping timeout: 252 seconds)
17:02:59*sepisoad joined #nim
17:11:02*sepisoad quit (Ping timeout: 244 seconds)
17:17:10*def- quit (Ping timeout: 265 seconds)
17:33:37*SplinterOfChaos joined #nim
17:58:13*def- joined #nim
17:58:40flaviuHow about reserving the nimblepkg.ext for unofficial extensions to whatever package that is?
18:02:36*CARAM__ quit (Ping timeout: 265 seconds)
18:07:33*CARAM__ joined #nim
18:11:03*Matthias247 joined #nim
18:19:27ekarlsoflaviu: ?
18:19:36flaviuekarlso: hi
18:25:28ekarlsowhat about nimblepkg.ext ? ^
18:25:32AraqBlaXpirit_: why is that problematic?
18:26:23BlaXpirit_Araq, https://github.com/Araq/Nim/blob/devel/lib/pure/math.nim#L210
18:27:05AraqBlaXpirit_: ah ok, that's a windows related problem though
18:28:03*gmoore quit (Ping timeout: 246 seconds)
18:28:19*silven joined #nim
18:29:16BlaXpirit_Araq, so without knowing RAND_MAX I can't do anything
18:29:24BlaXpirit_with that int(rand()) mod max
18:29:52def-BlaXpirit_: export rand_max as a constant in math.nim?
18:30:16BlaXpirit_def-, that sure seems good, but it is not available currently, at all
18:30:30BlaXpirit_when defined(windows): const rand_max = 32767
18:30:38BlaXpirit_that's all there is. no rand_max on linux
18:30:51flaviuekarlso: Create conventions where creating an extension package for a certain nimble package is possible.
18:30:58BlaXpirit_although maybe then i could base it on drand48
18:31:12flaviuekarlso: I'm proposing that the *.ext.* namespace be open for that
18:31:19def-BlaXpirit_: there is a RAND_MAX on other systems too I believe
18:31:27def-BlaXpirit_: can't you get that into nim?
18:31:31BlaXpirit_def-, see [:25:42
18:31:46def-aaah
18:31:55BlaXpirit_i'm just not sure
18:32:03flaviuBlaXpirit_: Why do you need to use that random? The spec makes no guarantees on the quality.
18:32:07*gmoore joined #nim
18:32:17BlaXpirit_flaviu, i want to finally fix that random function
18:32:27BlaXpirit_so it does not have a glaring bug
18:32:45BlaXpirit_having a good RNG library separate from stdlib seems reasonable
18:36:07def-BlaXpirit_: i guess we can't just assume 2^32-1?
18:36:35BlaXpirit_def-, i dunno
18:37:33BlaXpirit_it is 2^31-1 here :|
18:37:51AraqBlaXpirit_: just use range[1..10_000]
18:38:00Araqyou *can* do:
18:38:02BlaXpirit_Araq, that's arbitrary
18:38:16Araqvar RAND_MAX {.importc, header: "...".}: cint
18:38:28Araqbut then it's a var and you cannot 'range' over that
18:38:47Araqso it's worse
18:39:09Araqit's not arbitrary, you can put it into an assert if you are so concerned
18:39:19BlaXpirit_Araq, i was starting to think about gathering more entropy by doing multiple calls to it.......
18:39:21*CARAM__ quit (Ping timeout: 276 seconds)
18:39:24Araqassert RAND_MAX >= 10_000
18:40:51Araqalso for the use cases that I have in mind, I'd rather have random() as fast as possible
18:41:21EXetoCso a default one with an arbitrary quality?
18:41:47flaviuAraq: random() is a poor choice for speed.
18:42:14BlaXpirit_https://github.com/Araq/Nim/blob/devel/lib/pure/math.nim#L222 - this line is just filled with problems
18:42:25flaviuUse a LCG with 96-128 bits state instead.
18:42:41BlaXpirit_first of all, yeah, RAND_MAX 32k, but it is also not uniformly distributed!!!
18:43:03def-BlaXpirit_: that sounds like a bad random number generator
18:43:35BlaXpirit_random(24000) has twice higher chance to give 10000 than 20000
18:43:46BlaXpirit_approximately..
18:43:53BlaXpirit_on Windows, of course
18:44:03BlaXpirit_Araq, so just limiting the range is not good either
18:45:36AraqBlaXpirit_: so how does Ansi C think the function that returns something in 0..RAND_MAX-1 *should* be used?
18:45:53BlaXpirit_no clue
18:46:01BlaXpirit_with high enough RAND_MAX it's barely good enough
18:46:04BlaXpirit_but 32k is a joke
18:46:42Araqbecause modulo that number is what's commonly taught
18:46:52flaviuAraq: Common teaching is wrong
18:46:59BlaXpirit_modulo is sad
18:47:01flaviuIt introduces significant biases
18:47:17Araqflaviu: yes, I can see why.
18:47:21Araqhence my question
18:48:06flaviuI didn't see the question, sorry. I use this code: https://github.com/flaviut/furry-happiness/blob/master/rand.nim#L7-L30
18:48:16BlaXpirit_uh guys, what about http://msdn.microsoft.com/en-us/library/sxtz2fa8.aspx
18:48:56flaviuBlaXpirit_: What's the point?
18:49:11BlaXpirit_then it will work on windows approximately the same as on linux
18:49:13BlaXpirit_for a quick fix
18:49:34flaviuah, ok. Sounds good.
18:50:10BlaXpirit_ahh it's not good probably... it says "cryptographicslly secure random numbers"
18:50:28BlaXpirit_that's a different beast, maybe something like CryptGenRandom, which is something like /dev/urandom
18:50:47def-Araq: I think you're supposed to use it with modulo, but much smaller modulos than rand_max. then it doesn't matter as much
18:52:01flaviudef-: Modulo is never correct unless except where ln2(n) is an int.
18:52:19BlaXpirit_i dunno... what about just exposing rand and RAND_MAX and letting people do whatever they want with this? (deprecate all functions on top of it)
18:53:11AraqBlaXpirit_: that just pushes the bugs around
18:53:22BlaXpirit_the point is,
18:53:39BlaXpirit_not to have a function that says it returns a random number from a to b, but actually does something very different
18:53:57Araqpeople will use 'mod' then on top and get the same bugs
18:54:04BlaXpirit_their problem
18:54:19BlaXpirit_at least they will know that RAND_MAX is a thing
18:54:21Araqthat's C's philosophy, not Nim's.
18:54:36flaviuHow about getting rid of rand in that module completely?
18:54:41BlaXpirit_well Nim currently has a bug in the implementation and i dont see how to fix it
18:54:48flaviuand instead tell people to go to nimble.
18:54:57BlaXpirit_flaviu, what would people think of a language that can't give them a random number?
18:55:24Araqflaviu: I like this idea.
18:55:33Araqrandom numbers are hard
18:55:36BlaXpirit_well sure, it's pretty nice
18:55:47BlaXpirit_i didn't think such a suggestion would get any support
18:55:58BlaXpirit_(think of existing code, yadda yadda)
18:56:10AraqBlaXpirit_: well we have .deprecated
18:56:11flaviuBlaXpirit_: How will people think of a language that claims to give them a random number but instead gives them the RFC 1149.5 random number?
18:56:29def-BlaXpirit_: if you make a simple interface that works the same way, then the only change required is an additional import, no?
18:56:58BlaXpirit_well it definitely doesn't have the same API
18:58:10BlaXpirit_but man, i'm starting to doubt my library more and more
18:58:15flaviuI Java gets along on a shitty 64/48 LCG, I have no idea why people put up with that.
18:58:37*flan3002 left #nim ("Have an awesome day!")
19:09:39*CARAM__ joined #nim
19:10:34*joecodes quit (Remote host closed the connection)
19:11:58*Matthias247 quit (Quit: Matthias247)
19:17:55*Matthias247 joined #nim
19:18:30*nimnoob joined #nim
19:19:36*alexruf joined #nim
19:31:17*jefus joined #nim
19:31:47*nimnoob quit (Remote host closed the connection)
19:32:45*jefus__ quit (Ping timeout: 252 seconds)
19:39:05*gmpreussner_ joined #nim
19:39:50*gmpreussner quit (Ping timeout: 244 seconds)
19:48:26*nimnoob joined #nim
20:06:39*johnsoft quit (Ping timeout: 264 seconds)
20:07:26*johnsoft joined #nim
20:08:33*Varriount|Laptop joined #nim
20:08:57Varriount|Laptopdom96, Araq: just so you know, the windows builders might be down for the rest of the day.
20:09:34reactormonkAraq, how exactly are object: fields different from tuple[fields]?
20:09:41Varriount|LaptopThere's some error on the internal RAID array that my desktop computer runs off of, and I'm trying to find out more about the problem.
20:10:05AraqVarriount|Laptop: ok... that sound bad
20:10:22Araqthese long running tests crashed your harddrive?
20:10:48Araqreactormonk: tuple fields are all public.
20:10:56reactormonkAraq, ok.
20:11:11Araqalso tuples use structural typing, objects use nominal typing rules
20:11:20reactormonkWhich means?
20:11:45Araqtype
20:11:55Araq T1 = tuple[a: int]
20:11:58Araq T2 = tuple[a: int]
20:12:07AraqT1 compatible to T2
20:12:09Araqtype
20:12:17Araq O1 = object a: int
20:12:25Araq O2 = object a: int
20:12:32AraqO1 not compatible to O2
20:12:41reactormonkOk.
20:13:23*johnsoft quit (Ping timeout: 256 seconds)
20:14:26*johnsoft joined #nim
20:15:27reactormonkAny way I can run code after compiling to C, before invoking the GCC? I considered going via packaging for C and running it by modifing the packaging scripts
20:16:45*nimnoob quit (Ping timeout: 252 seconds)
20:17:36Araqreactormonk: I can think of all sorts of workarounds
20:17:44Araqbut you really shouldn't do that
20:18:19Araqyou can always influence compilation with .compile, .link, passL, passC
20:21:09*Mat4 joined #nim
20:21:20Mat4hello
20:21:33*gmpreussner__ joined #nim
20:21:41*gmpreussner_ quit (Ping timeout: 244 seconds)
20:25:22Araqhi Mat4
20:25:43Mat4hi Araq, what's up today ?
20:26:09Araqbug #1940 is the only interesting bug left :-(
20:29:20Mat4what's with the other bugs left ?
20:29:34Araqthey are not interesting :p
20:29:40Mat4*g*
20:31:45*Sphax joined #nim
20:35:09*Blamestros joined #nim
20:36:12Mat4I'm working on kernel development this day
20:36:56skyfexAraq: I found out why the uint implicit conversion patch caused regressions.. It was because because the operations in the unsigned.nim module is defined using typeclasses instead of concrete types, which causes the uint->int conversion to be prioritized over the uint->SomeUnsignedInt
20:37:48skyfexRegardless of wether uint conversions should be implemented, that might need to be fixed if you want to define the integer operations in system.nim using typeclasses as well, it should cause similar issues
20:38:34skyfex*i mean IntLiteral->int over IntLiteral->SomeUnsignedInt
20:40:04*rpag joined #nim
20:40:19skyfexI might take a look at wether it's possible to change that prioritization without causing massive regressions
20:40:39Araqskyfex: I know.
20:40:50skyfexAh, mkay :)
20:41:09Araqskyfex: it's a hard problem though
20:41:25Araqproc p[T: int](x: T)
20:41:32Araqmatches as good as
20:41:37Araqproc p(x: int) ?
20:41:52Araqwho knows what problems this causes then
20:41:57*Sphax quit (Quit: ZZZZZzzzzz)
20:46:41*Sphax joined #nim
20:54:05flaviuBlaXpirit_: What was the difference between my and your patches in https://github.com/Araq/Nim/pull/1855 ?
20:54:45BlaXpirit_flaviu, ummm
20:55:12Araqflaviu: BlaXpirit_'s callback looks entirely different
20:55:21BlaXpirit_main thing was, the array of matches is of limited size
20:55:52BlaXpirit_length of array of matches equals number of matches, not just always 20 or something
20:55:59BlaXpirit_otherwise it's pretty much objectively worse
20:56:04flaviuBlaXpirit_: Right, thanks.
20:56:11Araqand fyi I find these PRs with multiple commits really hard to follow
20:57:04flaviuhttps://github.com/Araq/Nim/pull/1855/files makes it look like it's a single commit. I guess I could squash them, but I'd like to keep BlaXpirit's name in the commit log
20:57:19BlaXpirit_i dont care :|
20:57:33Araqoh nice!
20:57:38Araqwasn't aware of this view
20:58:11flaviuBlaXpirit_: Yeah, but when your code turns out to be totally broken, I get to blame you! ;)
20:58:13BlaXpirit_it's a big mess, you shouldn't have added my patch :p
20:58:22BlaXpirit_i think there is a lot of duplication
20:58:46flaviuBlaXpirit_: I know, I'm working on it.
21:01:01*Matthias247 quit (Read error: Connection reset by peer)
21:05:18flaviuBlaXpirit_: I don't think that code is correct. "a".match(re"(b)?") would return an array of length 0, but length 1 would be correct.
21:06:50flaviuPcre does expose that information in fullinfo(pattern, INFO_CAPTURECOUNT)
21:11:06ekarlsois there plans to introduce namespacing for packages / module ?
21:11:31def-ekarlso: they have a namespace, you can use module.proc
21:14:34Varriount|LaptopAraq: I don't know yet. It might be the hard drives, it might be the motherboard or the power supply.
21:15:17Varriount|LaptopThe intel raid firmware reported that a disk wasn't connected yesterday, however a reboot cleared the problem up.
21:15:43Varriount|LaptopToday, the problem returned, and after a reboot, both disks in the array were reported as disconnected.
21:24:06*zahary quit (Ping timeout: 246 seconds)
21:27:53ekarlsodef-: but if a package has say a file called "claims.nim" and another dep has that file too then ? ^
21:31:50def-ekarlso: import claims as claims2?
21:39:12flaviuekarlso: You go an yell at that project.
21:39:15flaviu*and
21:40:07flaviuI also wouldn't consider it too harsh to remove it from nimble until it fixes it's namespacing.
21:40:57*gsingh93 quit (Quit: Connection closed for inactivity)
21:44:31ekarlsoflaviu: how come yell ? ;)
21:48:41*Trustable quit (Quit: Leaving)
21:50:10*alexruf quit (Quit: Textual IRC Client: www.textualapp.com)
21:50:33Araqagain
21:50:56Araqmultiple Nimble packages CAN have the same file/module
21:51:17Araqbut within a Nimble package you need unique module names
21:55:02*rpag quit (Quit: Leaving)
21:56:20Varriount|LaptopDoesn't this kinda force you to use Nimble?
21:56:52Araqno, you can create as many fake nimble packages as you want
21:57:04Araqall it takes is a subdir with a .nimble file in it
21:57:26ekarlsoAraq: so if two packages have the same module then ? how do you determine which one
21:57:55def-ekarlso: package.module i think
21:58:06Araqwell the directory structure makes that clear
21:59:39ekarlsoAraq: how so ?
22:01:13AraqpackA/m.nim vs packB/m.nim ? how is it not obvious?
22:01:50Araqwithin packA when you refer to m guess what m is picked
22:01:52BlaXpirit_if we have libA/awesome.nim, we write import awesome
22:02:09BlaXpirit_so what would people do if they installed libB with awesome.nim
22:03:19AraqBlaXpirit_: I think/hope dom96 made it so that you import it as lib/awesome.nim
22:03:39Araqand not as awesome.nim unless you play with your --path explicitly
22:03:50BlaXpirit_umm no
22:04:36def-i think it should be done as the sdl2 lib does it. there's a main sdl2.nim which you can import with "import sdl2". the sub-modules are in the directory sdl2, so you can "import sdl2.image" and so on
22:04:56Araqdef-: exactly.
22:04:58BlaXpirit_is that possible currently?
22:05:03def-yes
22:05:14def-libraries do it, just checked sdl2
22:05:19BlaXpirit_oh damn, and i did lame things
22:05:26BlaXpirit_csfml, csfml_audio, csfml_graphics
22:05:35def-oh, i missed that =/
22:05:37BlaXpirit_i guess _ is not that much different from . but whatever
22:05:43def-yeah, would be a bit cleaner with .
22:09:20*Blamestros left #nim (#nim)
22:10:07Varriount|LaptopHm. That's actually a neat trick. Perhaps it should be officially recommended?
22:10:21def-i think it was somewhere
22:10:44*gokr joined #nim
22:10:58def-http://nim-lang.org/manual.html#module-names-in-imports
22:11:57EXetoCnot that doing sdl2/sdl2 is particularly annoying
22:13:06Varriount|Laptopdef-: But that's the manual. And unfortunately, few people read the manual before writing a package.
22:13:22Varriount|LaptopWell, read the entire manual, anyway.
22:13:33def-the manual is pretty interesting though
22:13:49def-I think I read it top to bottom
22:14:36Araqthe question is *when* did you read it. it's a living document ;-)
22:14:49def-Araq: yeah, i noticed that, half a year ago
22:14:58def-should read the git diff again
22:15:18Araqwell not too many things were changed I think
22:16:20Araqeverybody is afraid of touching this holy document for some reason
22:16:38AraqPRs for the tutorials are much more common
22:19:13flaviuCan someone merge https://github.com/nim-lang/packages/pulls ?
22:19:33flaviu#114 and #115 look ready.
22:20:56Araqwhy can't you merge it?
22:21:46Varriount|Laptopflaviu: Done.
22:22:07*Sphax quit (Quit: CYA!!)
22:22:34Araqflaviu: want write access?
22:22:39BlaXpirit_yay
22:22:49flaviuSure
22:23:21Araqyou won't misuse your power, will you?
22:23:46Araqand you shall not annoy dom96
22:24:16def-Araq: not going to stop with the biblical references, are you?
22:24:38flaviuof course I won't misuse my power, but I make no promises about annoying dom96.
22:25:05flaviudef-: the bible doesn't hold a monopoly on the world "shall"
22:25:22def-flaviu: alright
22:28:17Araqdamn you. you're flaviu*t* for github
22:28:35AraqI invited some stranger instead
22:28:39EXetoConoz
22:29:26EXetoCthou shalt not program in Java by choice
22:29:41*Boscop_ quit (Quit: Boscop_)
22:30:49ekarlsoso what
22:30:55ekarlsodo u want some kind of approval for packages ?
22:32:10Araqekarlso: what do you mean?
22:32:26flaviuekarlso: Not really approvals, but a quick glance to make sure everything is namespaced correctly.
22:32:51ekarlsoflaviu: ok
22:33:05ekarlsoflaviu: when you mean namespaced u mean uniq proc names etc +
22:33:31flaviuno, just that if the package is named foo, there are no files besides foo.* and foo
22:34:39flaviuJust enough oversight that it doesn't cause name conflicts with other packages.
22:37:01EXetoCjust make sure that everything is in a sub-directory?
22:38:27flaviuThis could and should be automated..
22:40:46ekarlsoflaviu: how so automated ?
22:41:12*yonson joined #nim
22:41:25flaviuekarlso: https://docs.snap-ci.com/assets/images/non-retina/screenshots/pull-request-14fa4bea.png
22:41:57flaviuthe green checkmarks show if it's valid.
22:42:10ekarlsoflaviu: u mean when adding a new package ?
22:42:35flaviuyes. If it's not broken when the PR is sent, it's likely to stay non-broken.
22:53:21*MattAitc_ joined #nim
22:58:42*kniteli quit (Read error: Connection reset by peer)
22:58:48Araqhi MattAitc welcome
23:09:20*MattAitc_ quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
23:12:15*MattAitc_ joined #nim
23:32:15*skyfex quit (Quit: (null))
23:33:04*Varriount|Laptop quit (Ping timeout: 246 seconds)
23:39:15ekarlsohow can you add a package locally to the compiler path?
23:40:00*skyfex joined #nim
23:43:17flaviuekarlso: You can run nimble install in the directory and it gets added to the nimble package location.
23:43:36ekarlsoflaviu: kewl
23:45:30*lws joined #nim
23:45:30*lws quit (Changing host)
23:45:30*lws joined #nim
23:46:52*lws_ joined #nim
23:47:30ekarlsogawd
23:47:41ekarlsois there a way to have the nim compiler not span binary files all over ?
23:47:54def-ekarlso: yes, you can specifiy the nimcache directory
23:47:56ekarlsomy .gitignore becomes foobar :/
23:48:02ekarlsodef-: how ? :P
23:48:19def-just add nimcache to your .gitignore would also help
23:48:39flaviuekarlso: https://github.com/Araq/Nim/blob/devel/.gitignore#L1-L4
23:48:41ekarlsodef-: it adds binary files to src/foo also for src/foo.nim..
23:48:54*lws__ joined #nim
23:48:58def-nim --nimcache:/my/global/nimcache
23:49:23def-note that this will fail if you compile two nim programs at the same time
23:49:26*ekarlso hails flaviu
23:49:29*lws_ quit (Read error: Connection reset by peer)
23:50:09*lws quit (Ping timeout: 252 seconds)
23:54:27*MattAitc_ quit (Quit: Textual IRC Client: www.textualapp.com)
23:56:03ekarlsohmm, can you do like: let foo = case bar: of "foo": "y" ?
23:56:21BlaXpirit_yes
23:56:43ekarlsoawesome
23:57:00BlaXpirit_not totally sure though
23:57:15BlaXpirit_yup, works... not hard to try this