<< 15-01-2015 >>

00:02:03Varriountonionhammer: Believe me, as soon as I have the time to look into it, I will.
00:02:42*jokra quit (Ping timeout: 246 seconds)
00:03:25*jokra joined #nim
00:06:18*Trustable quit (Quit: Leaving)
00:08:27*jokra quit (Ping timeout: 264 seconds)
00:08:56Mat4ciao
00:09:00*Mat4 left #nim (#nim)
00:12:23*keyle joined #nim
00:15:36joecodesdom96: still having trouble with async jester. I try this: https://gist.github.com/anonymous/d3e68ca2e69ab1602479 and when I go to http://localhost:1234/s/100 it blocks all other requests
00:16:04keylehi
00:16:34dom96joecodes: db_mysql isn't async
00:17:22joecodesdoh! ok. do you know if anyone is working on making one? or any other async db libraries?
00:19:36Araqjoecodes: I think you need to use gokr's spawning server for now.
00:19:39EXetoCI wish I had time to make an async mongodb lib
00:19:55dom96joecodes: I'm not aware of one.
00:20:27dom96joecodes: Under normal usage the blocking version should be good enough.
00:21:10EXetoCI need to check again if the C lib supports non-blocking operations
00:21:36EXetoCit should imo
00:21:56joecodesok, I will look for gokr's spawning server. i can't let mysql block for that long, also hopefully their is an async httpclient because will need to do some of that as well.
00:23:07AraqEXetoC: yeah if only OSes could execute other stuff when something blocks ... oh wait ... they can do that since the 60ies
00:26:31dom96joecodes: Why would mysql block for 100 seconds under normal usage?
00:26:46EXetoCAraq: I'm referring to non-blocking calls (polling for completion)
00:26:58EXetoCseems like an essential thing to provide in a db lib
00:27:14dom96EXetoC: It does support them.
00:27:23AraqEXetoC: I know what you're talking about
00:27:24joecodesit won't. but maybe sometimes 2 or 3 seconds, and don't want other clients blocked while it does the queries
00:28:28EXetoCdom96: the mongodb C lib?
00:29:04dom96EXetoC: I bet it does.
00:29:26AraqEXetoC: but this hunt for everything async is childish
00:30:08dom96Araq: What do you mean?
00:33:14Araqdom96: it's usually done by the people who don't have to care really.
00:33:22*yonson quit (Read error: Connection reset by peer)
00:34:43*Hakaslak quit (Quit: TODO: Generate 'Computer Sleep Quit Message')
00:35:26EXetoCdom96: I don't think so
00:36:07joecodesdom96: is this the spawn server you were talking about: http://goran.krampe.se/2014/10/25/nim-socketserver/ ? performance sounds awesome, could jester use that same technique?
00:36:38dom96joecodes: I wasn't talking about it, Araq was.
00:37:46Araqjoecodes: yes and that is not even optimized. it does a pretty expensive deepCopy for the sockets buffer.
00:40:07dom96That code cheats a bit. It just reads the first line from the client.
00:40:44joecodesoh yeah :-). anyways, his numbers look great. i have to say, if i could find a programmer friendly webserver like jester that makes everything transparently async it would be a godsend.
00:49:06*gokr1 left #nim (#nim)
00:50:47dom96joecodes: I think I will try to improve asynchttpserver by combining spawn and async together.
00:51:36Araqdom96: please start with a test so that we can officially support spawn with async
00:52:09dom96I'd rather get NimBuild going first.
00:52:18Araqit's bad we tell people "er, you can use one or the other but we never tested both in combination"
00:52:39Araqok ok, go ahead
00:52:40dom96You can use threads and async. I tested that.
00:52:51Araq:O
00:53:07dom96Perhaps that is how I should scale it to multiple cores anyway.
00:53:12*gokr quit (Quit: IRC for Sailfish 0.8)
00:54:10dom96I don't think there is any way for this to work.
00:54:37dom96Because we once again go back to the problem of callbacks being executed in different threads...
00:56:10dom96I'll think about it some more.
00:56:32Araqyou can pass a closure iterator to some other thread via spawn
00:57:23joecodesdom96: i wonder if spawn is the usual way to go? otherwise have to make sure code you are using is async? my use cases are like this normally: request -> make outbound soap request to another server -> parse response -> send to user. I'm guessing with spawn I don't need to worry about whether soap library is async or not... and when manager decides to give away 5000 starbuck cards you don't have to spin up a gazillion f
00:57:35dom96I think it might just work. These callbacks shouldn't reference global variables anyway... maybe.
00:59:20dom96joecodes: What happens when all your threads block?
01:01:19joecodeshair falls out? I wonder how many simultaneous can handle? for my case 1000 is sufficient.
01:01:47dom96I don't know. I'm not sure how spawn works.
01:02:10dom96Araq?
01:03:02Araqdom96: it creates new threads on demand but only up to 100 or something
01:03:38dom96so if 100 get blocked you're basically screwed?
01:05:01Araqwell the limit is 256, just checked. but yeah.
01:05:59dom96If you want to handle 1K connections then you definitely need async.
01:06:15ldleworkekarlso-: did you get it?
01:06:32Araqdom96: that's a brave statement :-)
01:08:49Araqdom96: he could also set the thread limit to 100_000 ... 64bit Linux can handle that, I think
01:09:29Araqand reduce the stack size on creation perhaps
01:10:08Araqthough the "heap per thread" is ... suboptimal for so many threads
01:18:20*Sergio965 joined #nim
01:37:40*enquora quit (Quit: enquora)
01:39:02*joecodes quit (Ping timeout: 245 seconds)
01:44:43*BitPuffin joined #nim
01:59:56*flaviu quit (Remote host closed the connection)
02:00:10*flaviu joined #nim
02:01:55*mwbrown joined #nim
02:04:52*VinceAddons quit (Read error: Connection reset by peer)
02:24:47*gmpreussner joined #nim
02:25:13*jefus_ joined #nim
02:26:35*mwbrown quit (Quit: Leaving)
02:26:54*BitPuffin quit (Ping timeout: 245 seconds)
02:29:35*jefus quit (Ping timeout: 272 seconds)
02:39:03*gmpreussner quit (Ping timeout: 244 seconds)
02:39:10*gmpreussner joined #nim
02:47:39*darkf joined #nim
02:53:24*girvo joined #nim
02:53:28girvoHi all :)
02:54:00girvoquick q: i'm trying to compile a simple raytracer that I found in the forums, but it gives me "Error: undeclared identifier: 'Float'"
02:54:06girvoCode is here: https://gist.githubusercontent.com/AdrianV/5774141/raw/6c243c54f5c81389bbf6ad9f9c224afdb6019fec/raytracer.nim
02:54:19girvoI'm guessing its written for an older version of nim? I'm running the latest compiler, on OS X 10.10
02:55:30girvoOh, also, the title for the forum is still set as "Nimrod" instead of nim :3
02:55:49girvoSpecifically on the "Search Results" page
02:58:33def-girvo: float instead of Float
02:58:37keylegirvo: have you tried changing all mentions of float instead of Float
02:58:48keylewhat he said.
02:59:20EXetoCand :%s/\<T[A-Z]//g
03:00:22flaviu:%s/T\([A-Z]\)/\1/g
03:01:37EXetoCor that, if you want to keep the other char :p
03:02:39girvoThat's exactly what I did :)
03:03:01girvoNow I've just got to get these types passing, it seems he's using an array as a vector somewhere in here, going to have a crack at it
03:03:10girvo`template newVec3(x: float): TVec3 = [x,x,x]
03:03:28girvoIs called here, but errors: let eye = newVec3(0)
03:03:39girvo`Error: type mismatch: got (Array constructor[0..2, int]) but expected 'TVec3'`
03:03:58EXetoCyes, because those are ints
03:04:31EXetoChuh
03:04:49EXetoCI don't know what's going on
03:05:20def-so many case problems =/
03:05:50EXetoCgirvo: no modifications to newVec3?
03:06:02EXetoCtry proc instead of templates. no need for a template either way
03:06:06def-EXetoC: i think that's a change in the compiler, i noticed that as well
03:06:20def-not sure if that is intentional
03:07:09EXetoCseems unlikely
03:07:12def-Like this it works, girvo: https://gist.github.com/def-/476f4f0190438a4d502d
03:13:40*gmpreussner quit (Ping timeout: 244 seconds)
03:13:40*gmpreussner_ joined #nim
03:13:53*vezzy quit (Ping timeout: 240 seconds)
03:14:14*quasinoxen joined #nim
03:19:31*dts|pokeball quit (Read error: Connection reset by peer)
03:20:00*dtscode joined #nim
03:22:47*Sergio965 quit (Quit: Bye! :))
03:26:22*dtscode quit (Quit: ZNC - http://znc.in)
03:26:47*dtscode joined #nim
03:28:06*gmpreussner__ joined #nim
03:28:39*gmpreussner_ quit (Ping timeout: 244 seconds)
03:29:16*brson quit (Quit: leaving)
03:32:19*gmoore joined #nim
03:34:38girvoIs it possible to access SDL1 in nim?
03:34:45girvo1.2 specfically
03:37:32fowlsdl package for nimble
03:42:39*EXetoC quit (Ping timeout: 264 seconds)
03:43:00*superfunc joined #nim
03:51:25*superfunc quit (Ping timeout: 246 seconds)
03:57:54*vendethiel quit (Ping timeout: 244 seconds)
04:07:24*gmpreussner__ quit (Ping timeout: 244 seconds)
04:07:34*gmpreussner__ joined #nim
04:14:21dtscodehey... how come when i do resp title("Teamspeak Info") in jester it doesnt show at the title?
04:17:19keyleurl?
04:17:40dtscode?
04:17:54keyleI meant show me the generated
04:18:10dtscodeoh ok. hold on
04:20:45*superfunc joined #nim
04:21:11keyleI don't see title in the sources except for exception somehow
04:22:47dtscodehttp://dtscode.io/teamspeak3/info
04:23:02dtscodetheres the generarted source
04:25:53*vezzy joined #nim
04:26:13*quasinoxen quit (Ping timeout: 265 seconds)
04:26:13*girvo quit (Ping timeout: 265 seconds)
04:27:33*vendethiel joined #nim
04:34:02keyleok
04:34:25keylelooking at the source it doesn't even generate <html><body>
04:34:42keyleis there some sort of html template you can wrap around?
04:34:58keyletitle should be part of <html><head>
04:42:57dtscodeit doesnt have to be though
04:46:00*MattAitchison joined #nim
04:49:55*vendethiel quit (Ping timeout: 255 seconds)
04:52:25*ARCADIVS joined #nim
04:52:31ldleworkIs there any reflection mechanism for iterating the procs that have a certain signature or anything like that?
04:55:46*superfunc quit (Quit: Page closed)
04:58:52keyledtscode: no but it should
04:59:02*gmpreussner___ joined #nim
04:59:04*gmpreussner__ quit (Ping timeout: 244 seconds)
05:05:51keyleif jester was to ever pump out a title tag, it'd most likely be in the head tag
05:06:13keyleso if you don't have an html and head tag, that may very well be the problem
05:06:37keylebut as I said I couldn't see title in the jester repo (had a quick look only)
05:09:35*vendethiel joined #nim
05:13:07*keyle quit (Quit: leaving)
05:24:03*BitPuffin joined #nim
05:28:31*BitPuffin quit (Ping timeout: 244 seconds)
05:29:00*MattAitchison quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
05:30:15*vendethiel quit (Ping timeout: 256 seconds)
05:38:18*MattAitchison joined #nim
05:43:28*vendethiel joined #nim
05:45:42ldleworkIs there currently a bug where user-typeclass constraints on generic discriminators are not enforced?
05:52:36*MattAitchison quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
06:06:14*vendethiel quit (Ping timeout: 244 seconds)
06:10:04*vendethiel joined #nim
06:42:10*VinceAddons joined #nim
06:52:44*vendethiel quit (Ping timeout: 244 seconds)
06:54:51*Demon_Fox joined #nim
06:56:31*vendethiel joined #nim
07:02:18*nimnoob joined #nim
07:05:16*keyle joined #nim
07:05:37*gmpreussner joined #nim
07:05:39*gmpreussner___ quit (Ping timeout: 244 seconds)
07:11:27*nimnoob quit (Ping timeout: 246 seconds)
07:12:49*Jesin quit (Quit: Leaving)
07:13:34*Jesin joined #nim
07:17:19*vendethiel quit (Ping timeout: 245 seconds)
07:25:19*nande quit (Remote host closed the connection)
07:31:23*HakanD joined #nim
07:32:34*gour joined #nim
07:58:52*gmpreussner quit (Ping timeout: 244 seconds)
07:59:03*gmpreussner joined #nim
08:15:52*gokr joined #nim
08:17:05dtscodekeyle, i figured it out. take a look at the nim forum source. they use raw html with jester. kind of a RoR aproach it looks like
08:17:30keyleok
08:18:17dtscodethanks for the help though
08:30:15*VinceAddons quit (Read error: Connection reset by peer)
08:32:30*vendethiel joined #nim
08:33:01*VinceAddons joined #nim
08:33:41*VinceAddons quit (Read error: Connection reset by peer)
08:43:27*HakanD quit (Quit: Be back later ...)
08:48:47*jsudlow quit (Ping timeout: 244 seconds)
08:52:46*jsudlow joined #nim
09:03:58*sillesta joined #nim
09:05:58*BlaXpirit joined #nim
09:08:33*Trustable joined #nim
09:10:30*Sphax joined #nim
09:11:31*jbe_ joined #nim
09:12:27*jbe_ quit (Client Quit)
09:16:07*jbe_ joined #nim
09:16:16*jbe_ quit (Client Quit)
09:19:19dtscodedom96, how does the nimforum code execute the .tmpl files?
09:24:03Araqdtscode: it doesn't. the compiler compiles them to Nim code.
09:26:19dtscodeAraq, oh
09:28:14dtscodewhere are the vim/gedit syntax highlighting files?
09:28:42dtscodenvr mnd
09:41:16sillestahow do you 'echo "foo"' without a newline?
09:42:15BlaXpiritstdout.write
09:42:16BlaXpiritmaybe
09:42:35ekarlso-Araq: looks like mysql has async c stuffs ? http://jan.kneschke.de/2008/9/9/async-mysql-queries-with-c-api/
09:42:39sillestathanks
09:42:41ekarlso-regarding the earlier discussion
09:49:31*HakanD joined #nim
09:55:01ekarlso-does nim have something for base64url ?
09:56:31BlaXpiritekarlso-, elaborate
09:56:35BlaXpiritwhat does the "url" part change?
09:56:44BlaXpirit...or i can google...
09:57:34ekarlso-http://en.wikipedia.org/wiki/Base64 < BlaXpirit base64url part there..
09:57:36*gmpreussner_ joined #nim
09:57:41BlaXpiritwell, ekarlso-, http://nim-lang.org/base64.html#decode,string
09:57:42*gmpreussner quit (Ping timeout: 244 seconds)
09:57:48ekarlso-basically url / filename safe stuff
09:58:57BlaXpiritok the module is obviously barebones
10:01:10BlaXpiritekarlso-, you just need to replace the characters
10:02:04*gmpreussner__ joined #nim
10:02:21*gmpreussner_ quit (Ping timeout: 244 seconds)
10:02:50BlaXpiriti really don't understand what that newline stuff is doing in base64 module
10:03:10ekarlso-maybe dom96 knows (:
10:03:41BlaXpiriti mean, i do know, but it's just poor design
10:06:11BlaXpiritomg, i still can't figure out which characters this module produces
10:06:32BlaXpiritA-Z a-z + = but what is the other one?
10:07:11BlaXpiritok it's /
10:08:14BlaXpiritekarlso-,
10:08:18BlaXpiritbase64.encode(s).replace('+', '-').replace('/', '_')
10:08:20BlaXpiritsigh
10:11:11ekarlso-:D
10:11:59BlaXpiritand watch out for the idiotic newline functionality
10:22:17*ARCADIVS quit (Quit: ARCADIVS)
10:28:32*gmpreussner___ joined #nim
10:29:13*gmpreussner__ quit (Ping timeout: 244 seconds)
10:33:06ekarlso-:D
10:34:55*JinShil joined #nim
10:46:16*Etheco- joined #nim
11:18:21*gour_ joined #nim
11:21:59*gour quit (Ping timeout: 264 seconds)
11:31:31*HakanD quit (Read error: Connection reset by peer)
11:41:10ekarlso-so what does .final and pure mean ?
11:43:25*jlebrech joined #nim
11:50:31Araqekarlso-: pretty much nothing anymore
11:55:07ekarlso-Araq: k
11:55:11ekarlso-Araq: proc HMAC_CTX_init*(ctx: ptr HMAC_CTX) = {.cdecl, importc.}
11:55:16ekarlso-shouldn't that be valid ? :/
11:55:29Araqget rid of the '='
11:55:42ekarlso-kewl :)
12:19:34*BlaXpirit_ joined #nim
12:19:53BlaXpirit_how to check if a seq is nil?
12:20:14BlaXpirit_oh
12:20:16BlaXpirit_isNil
12:20:18BlaXpirit_what a dummy
12:21:02*matkuki joined #nim
12:22:36*gour_ is now known as gour
12:31:14*jlebrech quit (Remote host closed the connection)
12:35:06ekarlso-BlaXpirit_: what you building in nim ?
12:37:54BlaXpirit_ekarlso-, trying to port docopt now, previously https://github.com/search?q=user%3Ablaxpirit+nim
12:38:11*BlaXpirit_ quit (Quit: Quit Konversation)
12:38:26ekarlso-kewl!
12:40:32*zahary_ joined #nim
12:40:47ekarlso-got a fully working hmac binding at least :D
12:48:45*JinShil quit (Quit: Konversation terminated!)
12:48:58ekarlso-so what is the diff between cstring and cuchar ?
12:50:30Araqif you need to ask this question you should use cstring
12:55:38ekarlso-hmmm, what's a openssl ENGINE ?
12:55:42ekarlso-ref https://www.openssl.org/docs/crypto/hmac.html
12:57:03*gunn quit (Ping timeout: 264 seconds)
13:00:56*yonson joined #nim
13:02:45BlaXpirithow to get the name (string) of the type of a variable
13:05:06BlaXpirit"".type.name == "string" woot
13:05:55ekarlso-hmm, what type would map to a openssl engine ? :/
13:05:58ekarlso-https://www.openssl.org/docs/crypto/engine.html
13:08:10Araqekarlso-: an object
13:08:25Araqyou can be 99% sure it's a struct in C
13:13:26ekarlso-Araq: how you init a object again :/
13:14:45AraqObj(memory: 12.oclock, until: noon)
13:15:32ekarlso-hmac.nim(109, 22) Error: object constructor needs an object type hmm
13:24:02*gunn joined #nim
13:25:05*gokr quit (Quit: Leaving.)
13:27:01BlaXpirithow to check if an object is of a type?
13:27:09BlaXpirithow to check if an object is of a type or its subclass?
13:27:14AraqBlaXpirit: 'of' operator
13:27:28BlaXpiritAraq, of operator does one of these (which one i'm not sure)
13:27:32BlaXpiritso how to do the other one?
13:28:00BlaXpiritI'm talking about ref objects
13:28:15Araqthat doesn't matter. it's "of".
13:28:29BlaXpirit[:26:47] <BlaXpirit> Araq, of operator does one of these (which one i'm not sure)
13:28:49Araqif foo of SomeSubClass:
13:29:04Araqof is Java's instanceof
13:29:08BlaXpirittype B = ref object of A
13:29:25BlaXpiritvar x: A = B()
13:30:34BlaXpiritboth x of A and x of B are true
13:30:53Araqyes
13:31:03Araqlike Java's instanceof.
13:31:31BlaXpiritAraq, so the question is, how to get an operation that returns true for B but false for A
13:31:56Araqx of B returns false if x is only an A.
13:33:20BlaXpirituh oh. type(x) is A
13:33:37BlaXpiritwell that probably makes sense, but is not useful to me
13:34:10Araqif x of B and not (x of C)
13:35:08BlaXpirithuh
13:36:30BlaXpiritit's funny how type(x) is A and type(x) is B are valid in both Nim and Python and both give opposite results
13:37:05ekarlso-Araq: any plans to support something like var foo = ""; foo as cstring ?
13:37:24BlaXpiritekarlso-, what do you want?
13:37:30BlaXpiritthere is an implicit conversion
13:39:06Araqyeah and you can also write foo.cstring
13:39:23ekarlso-ah
13:39:45BlaXpiritAraq, so how can I get the actual type of a ref object, not the type of the variable that contains it?
13:40:25AraqBlaXpirit: oh you can't. and even if you could, you couldn't do anything with it.
13:40:35BlaXpirit:|
13:40:51BlaXpiritthat probably makes sense
13:41:33ekarlso-.eval "foo".len
13:41:36Mimbusekarlso-: eval.nim(3, 5) Error: value of type 'int literal(3)' has to be discarded
13:42:07Araqoh god, not again. will Mimbus ever stop to be a shame of humanity?
13:42:21ekarlso-Araq: sorry ? :p
13:42:55Araquse the Mimbus in #nim-offtopic
13:43:14ekarlso-ah ok :)
13:43:15BlaXpiritAraq, am I really going to do this? https://bpaste.net/show/0b24c7abd6eb
13:43:42ekarlso-I like it that you can "".len.cint -,,-
13:43:44*BlaXpirit is trying to port a Python library without understanding it xD
13:43:51AraqBlaXpirit: yes. for now.
13:44:09BlaXpirituh ok. thanks.
13:45:26ekarlso-should I add the hmac stuff to the wrappers or ?
13:46:07BlaXpiritwhat do you mean "add" and why do you need to do this?
13:46:20ekarlso-BlaXpirit: jwt uses it for hs256
13:47:37Araqekarlso-: don't put it on Nimble before somebody did a serious code review as you don't know what you're doing. no offense.
13:47:59ekarlso-Araq: ey, fine :)
13:48:04ekarlso-Araq: i'm just trying to learn :p
13:50:41Araqfun fact: cmd.exe can run .bat files with unix line endings.
13:52:35*jpoirier quit (Quit: Leaving)
13:53:56ekarlso-I hope all my stupid questions are weclome ;)
13:55:26Araqekarlso-: sure. as long as you can handle my sarcasm.
13:55:31ekarlso-:P
13:55:45*VinceAddons joined #nim
14:04:42*seemsindie joined #nim
14:04:56Araqhi seemsindie welcome
14:06:47VarriountBlaXpirit: I've done that before... It makes finding bugs... interesting
14:06:57BlaXpiritVarriount, cheers
14:07:40VarriountThough, depending on the similarities between languages, not *too* hard to do.
14:10:31*BitPuffin joined #nim
14:11:43BlaXpiritflaviu, how is the progress on regex library?
14:16:48*keyle quit (Read error: Connection reset by peer)
14:19:57matkukiIf i have an object 'MyObject = ref object' with 5 attributes, but I initialize it with 'myobject :MyObject = MyObject()', are the attributes left uninitialized?
14:21:04BlaXpiriteverything is initialized to binary zero
14:21:18matkukiBlaXpirit: Thanks.
14:25:20*jefus__ joined #nim
14:27:39*Jesin quit (Quit: Leaving)
14:28:57*jefus_ quit (Ping timeout: 244 seconds)
14:34:49*johnsoft quit (Ping timeout: 256 seconds)
14:43:14*gokr joined #nim
14:43:25*gokr quit (Remote host closed the connection)
14:43:50BlaXpiritwhy am I getting expression re'...' cannot be called?
14:44:38BlaXpiritecho source.find_all(re"<\S*?>")[0] inside a proc
14:44:39BlaXpiritdoesn't work
14:46:39*jokra joined #nim
14:48:43*Jesin joined #nim
14:49:49*MattAitchison joined #nim
14:52:57*Sphax quit (Quit: CYA!!)
14:53:09BlaXpiritAraq, please check this out. https://bpaste.net/show/773e655480a4 extremely minimal example as usual
14:53:18BlaXpiritlooks like a bug
14:54:05Araqyup. workaround: re.re("a")
14:54:32BlaXpiritthanks, Araq.
14:54:35BlaXpiritshould i report this?
14:54:43BlaXpiritand if so, please tell title
14:55:10Araq"re binding error in generic"
14:59:40*gokr joined #nim
15:02:37*gokr quit (Client Quit)
15:04:08*EXetoC joined #nim
15:06:59*atomic-hedgehog joined #nim
15:17:25onionhammeris that a library error or a compiler error?
15:17:33ekarlso-flaviu: around mr ?
15:18:12*gunn quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
15:19:34BlaXpiritonionhammer, compiler error
15:24:14*gmpreussner___ quit (Ping timeout: 244 seconds)
15:24:53ekarlso-https://bpaste.net/show/89b5699e685b < why would I get Illegal storage access on #110 there ?
15:24:55*matkuki quit (Quit: ChatZilla 0.9.91.1 [Firefox 34.0.5/20141126041045])
15:26:09BlaXpiritsigh
15:26:30ekarlso-BlaXpirit: was that sigh for me ? :p
15:26:32BlaXpiritat the very least try secret[0] instead of secret
15:26:32*MattAitchison quit (Quit: Textual IRC Client: www.textualapp.com)
15:26:44BlaXpiritbut that's still bad
15:27:16EXetoCekarlso-: you mean secret[0].addr?
15:27:23ekarlso-BlaXpirit: but if you do secret[0] it would be the first character of the string ?
15:27:55BlaXpiriti got a bit confused too
15:28:05BlaXpirityeah, do addr(secret[0])
15:28:40EXetoCa string is a length and then a capacity and then a pointer to the actual data or something like that
15:29:35ekarlso-but rly if you do secret[0] you're using the first character for the key...
15:29:38ekarlso-which is kinda sad
15:29:51BlaXpiritsad is what you're doing
15:30:07BlaXpiritit's probably supposed to be cstring, not pointer, anyway
15:30:44ekarlso-rly ? I guess I must be blind in that case...
15:30:59ekarlso- unsigned char *HMAC(const EVP_MD *evp_md, const void *key, int key_len, const unsigned char *d, int n, < that doesn't say cstring...
15:31:25EXetoCit's not just secret[0], it's secret[0].addr, so an address pointing to the first character
15:32:08EXetoCekarlso-: you're right. not that it really matters as long as you shove a pointer in there
15:32:33*nimnoob joined #nim
15:33:15BlaXpiritdoesn't say cstring but i'm pretty sure it would work :o
15:33:21ekarlso-sigh
15:33:40BlaXpiritaddr(secret[0]) is the right way to do it
15:34:12ekarlso-noo..., that would mean if I have "secret" as my key for the signed message it would really get "s" as the key wouldn't it now ?
15:34:22ekarlso-unless i've smoked something
15:34:51BlaXpiritjust do it
15:34:59EXetoCaddr(secret[0]) means you can treat it as a cstring. the address will that of the first element
15:35:17EXetoCjust as it is for a char*, and nim's strings are also zero-terminated
15:35:54BlaXpiritekarlso-, and... please never use cast
15:36:37EXetoCso str[str.len] (str[str.high + 1]) should be \0
15:36:50BlaXpiritwell "never" is an exaggeration
15:37:05ekarlso-I still dont get it why you would pass a partial thing in vs the whole string
15:37:18EXetoCwhat partial string?
15:37:43BlaXpiritekarlso-, you pass address of the first character
15:37:44ekarlso-addr(secret[0]) passes only the address of the first element of the string no ?
15:37:58BlaXpiritthen it can keep reading the string by using pointer arithmetic blah blah
15:38:06EXetoCyes, and char* is essentially an address to the first char, so it's correct
15:39:10ekarlso-hmmms, that blows my mind kinda...
15:39:35EXetoCand a char* string is iterated through by incrementing until a \0 has been encountered: "if (ch[curIdx] == '\0') { /* ok this is the end of the string */ }"
15:39:40*MattAitchison joined #nim
15:39:47*Demos joined #nim
15:40:12ekarlso-man, ok I feel wacked -,,-
15:40:30ekarlso-so when you pass the secret[0].addr it reads the rest of the string from that address or ?
15:40:35BlaXpirityes
15:40:50ekarlso-ok then it all kinda makes a bit more sense -,,-
15:40:55BlaXpiriti think secret[0].addr is a very confusing way to write it
15:41:03*jpoirier joined #nim
15:41:10ekarlso-BlaXpirit: well, openssl.nim has the same syntax
15:41:12ekarlso-:)
15:41:15BlaXpiritgreat example of dot notation abuse
15:41:31BlaXpiriti like addr(secret[0]) but whatever
15:41:47ekarlso-or just "addr secret[0]"
15:42:17EXetoCI disagree
15:42:32EXetoCekarlso-: does it work? that syntax has some limitations, which I hope will be fixed, otherwise it'll just get in the way
15:43:15ekarlso-EXetoC: ya it works :p
15:43:18ekarlso-dot notation and the other one
15:43:25BlaXpiritskipping parentheses very rarely works out in Nim
15:43:36ekarlso-cast[ptr char](addr output2) < what's a better way for that ?
15:43:55ekarlso-destination is output2: array[32, uint8]
15:44:25*nimnoob quit (Remote host closed the connection)
15:44:57BlaXpiritekarlso-, are you sure it's even needed?
15:45:04BlaXpiriti'd expect just `addr output1` to work
15:45:26*AMorpork left #nim ("Leaving")
15:45:38BlaXpiritthe md: cstring part of HMAC is probably wrong
15:45:55BlaXpiritif it actually expect array of uint8 and not char*
15:46:20ekarlso-unsigned char *md < that's the c
15:46:45BlaXpiritunsigned char
15:46:55ekarlso-that's cstring in nim or ?
15:47:01BlaXpiritthat's not char, so interpreting as cstring can be risky
15:47:08BlaXpiritunsigned char is nothing but uint8
15:47:39BlaXpiritwhy dont u use c2nim? -_-
15:47:52ekarlso-BlaXpirit: flaviu tried, this is based on his stuff...
15:48:06ekarlso-but he didn't add the _init methods just the HMAC
15:52:56ekarlso-oh well, let it be then for now..
15:54:22ekarlso-i'll let flaviu stab it since he knows it :p
16:01:18*gokr joined #nim
16:02:00*nimnoob joined #nim
16:16:01*nimnoob_ joined #nim
16:16:01*nimnoob quit (Read error: Connection reset by peer)
16:16:15*eigenlicht quit (Ping timeout: 264 seconds)
16:30:52*darkf quit (Quit: Leaving)
16:31:47BlaXpiritI have a seq[tuple[a,b,c]]
16:31:47*nimnoob_ quit (Read error: Connection reset by peer)
16:32:10BlaXpiritI want to find the tuple that has the smallest b
16:32:37BlaXpiritis there any idiom?
16:32:39BlaXpiritminimum by
16:32:40BlaXpiritetc
16:33:42BlaXpiritah the idiom is < operator :|
16:35:09BlaXpiritreally missing min-by e.g https://docs.python.org/2/library/functions.html#min http://www.preludels.com/#minimum-by
16:35:20ekarlso-BlaXpirit: u think I should continue hacking on it ? :p
16:35:33BlaXpirit:|
16:36:22ekarlso-BlaXpirit: that's motivating :p
16:40:42*jokra quit (Ping timeout: 244 seconds)
16:41:49*seemsindie quit (Ping timeout: 252 seconds)
16:43:32*eigenlicht joined #nim
16:44:24DemosBlaXpirit, you can define `<` in scope and pull out the minimum tuple
16:44:37BlaXpiritin scope, huh
16:44:56BlaXpiritthat's a cool idea, i haven't considered this (and started thinking stdlib sux)
16:45:20Demosyeah, just define `<` right before calling something that uses it
16:45:32Demosand you do it in function scope, so nobody else sees it
16:45:35BlaXpiritcan even do block: probably
16:45:39Demosyup!
16:46:25BlaXpiritthank you
16:46:46Demosno problem
16:47:18*nimnoob_ joined #nim
16:55:10*Demos quit (Ping timeout: 244 seconds)
16:55:39*BlaXpirit quit (Read error: Connection reset by peer)
16:55:55*BlaXpirit joined #nim
16:59:02*eigenlicht quit (Ping timeout: 245 seconds)
16:59:27*nimnoob_ quit (Ping timeout: 246 seconds)
17:01:25ldleworkekarlso-: hey did you get your timer demo working?
17:01:41ekarlso-ldlework: I fell asleep yesterday :p
17:02:16ekarlso-hmm, BlaXpirit apparantly one shouldn't be doing secret[0].addr twice -,,-
17:02:29BlaXpirithuh
17:03:01ldleworkekarlso-: happens. Let me know if you get it.
17:04:02ekarlso-BlaXpirit: I was doing secret[0].addr in both my HMAC and HMAC_Init_ex calls, it caused it to inv storage access
17:04:10ekarlso-vs declaring it as a var and passing it
17:04:15*jpoirier quit (Quit: Page closed)
17:04:23BlaXpiriti dunno man
17:04:30BlaXpiritthis just needs investigation, needs time
17:04:37BlaXpiriti'm doing some tedious work of my own here
17:04:47ekarlso-BlaXpirit: :D
17:04:56ekarlso-BlaXpirit: hence why I should just continue hacking :P
17:05:03ldleworkekarlso-: whatcha workin on
17:05:17ekarlso-ldlework: hmac bindings for ossl
17:05:23ekarlso-and the jwt stuff
17:05:35*eigenlicht joined #nim
17:14:56*jokra joined #nim
17:19:25*eigenlicht quit (Ping timeout: 272 seconds)
17:19:38EXetoCekarlso-: declaring what as a var? it's difficult to infer the semantics based on what you said
17:20:00*irrequietus joined #nim
17:20:52ekarlso-var s = "secret"; var sptr = addr s[0] then passing sptr vs calling addrs[0] twice
17:22:48EXetoCthat appears to be identical
17:23:00EXetoCsemantically
17:23:15ekarlso-EXetoC: well, the sPtr thing works, the other way gives a storage access error
17:23:36ekarlso-what's a good thing for unsigned char *md ?
17:25:50EXetoCmight be a compiler bug, assuming that what you're saying is correct. show us the new code if you want to get to the bottom of it
17:26:10EXetoCekarlso-: I think he told you. unsigned char is basically uint8
17:26:47ekarlso-so instead of cast[ptr char](addr output1) u could do addr output1 ?
17:26:49EXetoCekarlso-: what's the function name again? and what lib is it a part of?
17:27:22ekarlso-https://www.openssl.org/docs/crypto/hmac.html < HMAC and HMAC_Update
17:27:28ekarlso-rather HMAC_Final
17:28:06EXetoCekarlso-: the cast will just make it a 'ptr char' rather than a 'ptr whatever'. it might or might not be needed
17:28:31EXetoCin order to satisfy the compiler that is. try without the cast
17:29:04*eigenlicht joined #nim
17:29:42EXetoCekarlso-: yep, a uint8 sequence seems appropriate for that argument
17:29:54BlaXpiritsux that try block creates a scope :(
17:30:53*silven quit (Ping timeout: 240 seconds)
17:31:01EXetoCyou could have such a parameter in a high level wrapper. it's recommended if you want to distribute it
17:33:32ekarlso-EXetoC: so md5 methods in openssl
17:39:10ekarlso-EXetoC: what parameter u mean ?
17:40:29EXetoCekarlso-: the 'unsigned char' one
17:43:09ekarlso-EXetoC: funny that openssl.nim md5 methods use cstring for unsigned char*
17:43:10BlaXpirit[:46:27] <BlaXpirit> unsigned char is nothing but uint8
17:43:35ekarlso-BlaXpirit: +1 for me being stupid :p
17:46:12EXetoCit might be for the sake of convenience
17:47:27*BitPuffin quit (Ping timeout: 276 seconds)
17:49:37EXetoCit just needs to be binary compatible, so as to not mess up the stack
17:58:54BlaXpiritwhy no seq &=
18:01:27*jpoirier joined #nim
18:09:10*joecodes joined #nim
18:09:15EXetoCI did ask that maybe a year ago. I think it was simply overlooked
18:11:30EXetoCit's surprising that so few have asked for it. I'll look into it
18:11:38def-should just be the same as add, right?
18:11:51*jokra quit (Ping timeout: 256 seconds)
18:12:38EXetoCthat's true
18:13:21def-Hm, do we really need two procs with different names that do the same?
18:13:51EXetoCAraq: were we going to get rid of &= or something?
18:14:39BlaXpiritdef-, what?
18:14:41BlaXpiritadd is different
18:14:44BlaXpiritadd adds one thing
18:14:45BlaXpirit...
18:14:54def-BlaXpirit: works with an openarray as well
18:14:55EXetoCmore assumptions
18:14:57BlaXpiritoh
18:15:01BlaXpirit...
18:15:07BlaXpiritwell i missed that
18:15:13EXetoCand bitterness I suppose :p
18:15:23BlaXpiriti blame docs
18:15:37BlaXpiritthx
18:17:22BlaXpiritoh god no please no
18:17:36BlaXpiritis all my today's work in vain
18:18:24BlaXpiritnaaah false alarm (hopefully)
18:25:44EXetoCthis http://nim-lang.org/system.html#add,seq[T],T or something else?
18:26:31BlaXpiritEXetoC, no, the reason I said [:16:41] is not because of missing &=, if that's what you mean
18:27:06BlaXpiritadd works fine
18:27:35EXetoCyou were then talking about 'add', but ok
18:27:42*sillesta quit (Ping timeout: 265 seconds)
18:28:03*Demon_Fox quit (Quit: Leaving)
18:28:19BlaXpiritif I were making this, i would remove "add(seq, seq)", same for strings, and leave just &=
18:29:41EXetoCI think we were talking about doing the opposite
18:29:58BlaXpiritwait a second
18:30:02BlaXpiritthis is just horrible design
18:30:06BlaXpiritwhat if i have seq[seq
18:30:10BlaXpiritwhat's it gonna do
18:30:11BlaXpiritomg
18:30:30BlaXpirithave u thought about this?
18:31:01BlaXpiritif I want to add an item to a seq[seq then it's basically the same function signature as if i want to extend it with another seq[seq
18:31:58BlaXpiritno, i'm stupid
18:33:11BlaXpiriti mean, i will work just fine
18:33:14BlaXpiritbut sure is confusing
18:33:17BlaXpiritit*
18:35:51BlaXpiritso... what exactly is the point of forbidding object of seq?
18:36:01EXetoCare you saying it's more or less confusing with either?
18:36:03EXetoCexample?
18:36:45EXetoC.eval 1
18:36:48MimbusEXetoC: eval.nim(3, 0) Error: value of type 'int literal(1)' has to be discarded
18:36:52BlaXpirithttps://bpaste.net/show/960ba3c25b90
18:37:01EXetoC.eval type T = object; var x: seq[T]
18:37:04MimbusEXetoC: <no output>
18:37:17BlaXpiritEXetoC, to check whether Mimbus is here, do Mim<TAB>
18:37:25BlaXpiritand just don't use Mimbus here
18:37:47BlaXpiritАrаq doesnt want it here, it looks
18:37:55BlaXpiritjust on -offtopic
18:38:07EXetoCI know he was complaining about excessive invocations, that's all
18:38:49BlaXpiritsee 5 hours ago [:41:27]
18:39:57BlaXpiritso, people, what can you say about my example?
18:40:11BlaXpiritexactly the same invocations lead to different overload
18:40:35BlaXpiritpython has
18:40:57BlaXpiritlst += [5] lst.append(5) lst += [5, 6] lst.extend([5, 6])
18:41:19BlaXpirit(even though "There should be one-- and preferably only one --obvious way to do it.")
18:41:51*brson joined #nim
18:42:30EXetoChopefully he was referring to testing code until it becomes correct
18:42:46BlaXpiritbut it was just 1 invocation that day
18:43:06BlaXpiritwhatever
18:43:21EXetoCAraq: were you? showing code and output here is very convenient
18:43:38BlaXpirit[:35:10] <BlaXpirit> so... what exactly is the point of forbidding object of seq?
18:44:16EXetoCwhat does that mean? seq[ObjectType]?
18:44:23BlaXpirityes
18:44:32EXetoCwe could add: "please test in #nim-offtopic and make sure it works there first" to the output in case of an error
18:44:34EXetoCBlaXpirit: it does work
18:44:52BlaXpiritno. inheritance only works with non-final objects
18:45:35BlaXpiritI can add functionality (bloat) to seq itself, but can't make a separate object with additional functionality
18:45:46BlaXpiritjust why
18:45:58BlaXpiritfinal is only harmful
18:46:14BlaXpiritah maybe it's implementation limitation
18:47:15BlaXpiritnot gonna sweat it too much, just gonna add bloat to seq :>
18:47:28EXetoCit seems like a questionable thing to do. why not either introduce a distinct type or make it a field of a type?
18:47:53EXetoCsuch extensions seem fine
18:48:18EXetoCit's just yet another proc
18:49:38EXetoCit's like extending with a normal function in C++, just that it can look more pleasant at the call site
18:52:33EXetoCand it'll be located in another module, that's all, but it is up to the user to make code readable, and that's something the community has to work on
18:54:41VarriountMeep
18:55:08BlaXpiritwhat does that mean
19:00:40EXetoCmeep meep... vroooom
19:01:05EXetoCsome say "meeb meeb" instead, but it sounds like "meep meep" to me. beaker also says "meep", right? :p
19:02:58BlaXpiritokay
19:03:12BlaXpiritso I really want a subclass of seq
19:05:08VarriountBlaXpirit: Make a wrapper?
19:05:21BlaXpiritbut I gotta redefine every single thing
19:05:25EXetoChaving seq be a class that can be inherited from seems broken. what about the suggestions that I made?
19:05:44VarriountThe problem is that seq has special voodoo magic
19:05:47EXetoCwhat's wrong with referencing the field? you can use a converter though
19:05:55BlaXpirithttps://github.com/docopt/docopt/blob/6b06b5a7305153e9823cd0e6b32d8ff7d5762403/docopt.py#L282
19:06:12EXetoCyou seem to want to introduce implicit referencing, so it should be fine
19:06:21BlaXpiritapparently not only do i need additional functions, but also data
19:06:40EXetoC"converter toBar(o: Foo): Bar = o.somefield"
19:07:04*Ether-plays-4fun left #nim (#nim)
19:07:17BlaXpiritmaybe converter...): var seq would do the trick
19:12:19*alexruf joined #nim
19:12:26EXetoCrelying on dynamic dispatch in this case would be bad, and the procs would have to be converted to methods in order to allow for overriding. "proc add(o: ArrayLike, ...)" would be a nice static approach, but we don't yet have container traits (and bugs prevent us from creating decent such interfaces)
19:20:03*sillesta joined #nim
19:21:46VarriountAraq: Regarding the buildbot, is there anything test-wise that you want me to change? Is the directory layout of the test results ok?
19:22:44*gokr1 joined #nim
19:22:53EXetoCyou might not have been referring to overriding though, but that's my opinion
19:26:13*gokr quit (Ping timeout: 245 seconds)
19:46:38ekarlso-flaviu: you around for some hmac love again ?
19:46:59ekarlso-EXetoC: u asked for the code earlier ?
19:49:14*lesshaste quit (Quit: Leaving)
19:50:41EXetoCekarlso-: I wanted to get to the bottom of that pointer issue, since your solution appeared to be semantically identical. bbl
19:51:55ekarlso-EXetoC: https://bpaste.net/show/d093b04d1164 < what's what I have atm
19:52:43ekarlso-unsure of what i'm doing sadly wrong there
19:53:59*Demos joined #nim
19:56:26ekarlso-EXetoC: heh, I'm guessing u see probably a dousin things that's bad ;P
20:00:20*acidx left #nim (#nim)
20:03:15BlaXpirit.eval echo "abc"[0 .. -1]
20:03:18MimbusBlaXpirit: abc
20:03:27BlaXpirit.eval echo "abc"[0 .. <0]
20:03:30MimbusBlaXpirit: abc
20:03:41BlaXpiritthis. this is horrible
20:03:46BlaXpiritI feel betrayed
20:04:48*t4nk190 joined #nim
20:05:00BlaXpiritinclusive right index is horrible. negative index is horrible. combined together they're the worst nightmare, they just plague the language
20:06:09BlaXpiritffs, it is impossible to get an empty string slice at its begnning
20:07:01EXetoCwhat's wrong with closed intervals?
20:07:06EXetoCBlaXpirit: s[0 .. 0]
20:07:08BlaXpiriti just said it
20:07:14BlaXpiritEXetoC, that's the first character
20:07:39BlaXpiritplease
20:07:42EXetoCproc `[]`*(s: string, x: Slice[int]): string
20:07:47BlaXpiritif i have an operation
20:07:55BlaXpirit"get first N characters of a string"
20:08:05BlaXpiriti write s[0 .. <n]
20:08:09BlaXpiritn == 0
20:08:16BlaXpiriti get the whole f***g string
20:08:21BlaXpiritWHY
20:09:00def-BlaXpirit: [0 .. -1]
20:09:10BlaXpiritdef-, are u serious -_-
20:09:12EXetoCI'm mostly concerned about the fact that it applies only to strings
20:09:18BlaXpirit[:02:35] <BlaXpirit> .eval echo "abc"[0 .. -1]
20:09:38def-yes, it's a bit weird
20:09:44BlaXpiritit's not a bit wierd
20:09:45def-I think Araq didn't like it either
20:09:45VarriountI like the inclusive indice parameters. Makes things easy to reason about.
20:09:48BlaXpiritit's idiotic
20:10:02BlaXpiritVarriount, i can just repeat [:04:19] <BlaXpirit> inclusive right index is horrible. negative index is horrible. combined together they're the worst nightmare, they just plague the language
20:10:31VarriountBlaXpirit: Well, negative index only applies to strings, afaik
20:10:57BlaXpiritthis is where a horrible idea from pascal and a horrible idea from python clash in an incredibly damaging way
20:11:00VarriountArrays can have actual negative indices, as they don't have to start at 0
20:11:15AraqVarriount: it's the same for seqs
20:11:31VarriountOh.
20:11:46EXetoCwell, what's the argument against closed intervals?
20:11:51AraqBlaXpirit: so how do you do a[lowEnum .. highEnum] with you "exclusive" ranges? note that there is no highEnum+1.
20:11:55BlaXpiritEXetoC, -1 everywhere
20:12:08BlaXpirit.eval echo((@[1,2,3])[0 .. <0])
20:12:11MimbusBlaXpirit: @[1, 2, 3]
20:12:12Araqit's not a mistake in pascal
20:12:19Araqand it's no mistake in Nim either
20:12:21EXetoCBlaXpirit: so?
20:12:40BlaXpirithaving to write -1 everywhere vs not having to write everywhere
20:12:48EXetoCs[0 .. s.high]
20:12:49BlaXpiritjust that
20:12:56EXetoCor, s
20:13:01BlaXpirits[0 .. <s.len]
20:13:03Araqnobody has to write -1 everywhere
20:13:08VarriountAraq: One might argue that you could make a special case for enums, but that would be inconsistant.
20:13:13EXetoC<s.len == s.high
20:13:27AraqVarriount: {'a'..'z'} means from a to z inclusively
20:13:32BlaXpiritlook
20:13:40Araqit's not just enums.
20:13:48Varriount;3
20:13:50BlaXpiriti'm not gonna try to convince anyone to change inclusive indices
20:14:06BlaXpiriti just know that they're bad and it's yet another problem i will have to deal with
20:14:09EXetoCand a counter argument was provided
20:14:18BlaXpiritwas not
20:14:23EXetoCit was
20:14:32VarriountBlaXpirit: Did you see what araq wrote?
20:14:37AraqBlaXpirit: you convinced me that -1 for "last element" might have been a bad idea.
20:14:44BlaXpiritI don't understand what Araq wrote
20:15:10EXetoCand it's only for strings
20:15:22BlaXpiritit's for everything but arrays rather
20:15:24ekarlso-EXetoC: did u see anything ?
20:15:30EXetoCekarlso-: haven't looked
20:15:43ekarlso-fair enough
20:16:28Demosthe kind of ranges you use in a language are pretty arbitrary, and nobody can make mistakes with nim's because they cause overflow --> crash if used incorrectly
20:16:31Demosnot underflow
20:16:51EXetoC"for i in 0 .. s.high" seems fine. it might be unusual though, that's all, but plenty of things are either unusual or new altogether
20:17:23Demosdoing something because C does it and that is what people are used to is not usually a great idea
20:17:35BlaXpiritDemos, sigh
20:17:45BlaXpiritNim is doing it exclusively because Pascal does it
20:17:53BlaXpirit(how could i know though)
20:17:58Araqwell I gave the reasoning behind the design choice.
20:18:06VarriountAnd because it makes sense in the context of enums and character literals.
20:18:09Araqyou don't get it, but that's your problem.
20:18:21Araqit was not copied blindly from Pascal.
20:18:35EXetoCAraq knows his stuff :p
20:18:38EXetoClater!
20:18:39Demospersonally, I find it more natural. It is like "the variable WILL get ALL of these values"
20:18:47BlaXpirithttps://www.cs.utexas.edu/users/EWD/transcriptions/EWD08xx/EWD831.html
20:19:33BlaXpirithow many items between a..b?
20:19:35BlaXpirithmmmm
20:19:40VarriountBlaXpirit: That's why numbering should start at zero, not why inclusive indices cause disease.
20:19:41BlaXpirita+b+1
20:19:44BlaXpiritit's only logical
20:19:54EXetoCwasn't dijsktra for closed intervals though?
20:20:06EXetoCbut I couldn't find that particular quote
20:20:25Demosalso, it is a bit reasonable if overflow is UB
20:20:29Demosbut in nim it is not
20:20:59BlaXpiritby the way, inclusive interval works out even worse with 0-based than with 1-based
20:21:30ldleworkJust add a compiler flag :)
20:21:33EXetoCI've said that I'm fine with closed intervals, so I would like an actual argument
20:21:35BlaXpiritthere is probably not a single language with this combination of properties
20:21:42VarriountBlaXpirit: But how would we do character literal ranges?
20:21:43EXetoCso be it
20:21:48BlaXpiritVarriount, what do you mean
20:21:55BlaXpiritah, those ranges
20:21:59ldleworka - z
20:22:06VarriountBlaXpirit: {'a'..'z'}
20:22:09EXetoCyou should only sacrifice so much in favor of average joe
20:22:17BlaXpiritthey're a different thing, do whatever you want lol
20:22:38ldleworkdifferent thing?
20:22:41BlaXpiritit's just that there must be support for normal ranges
20:22:44VarriountThen we run into the "waah, you're not being consistant" complaint.
20:22:57Demosthere is support for normal ranges, 0..<0
20:23:02BlaXpiritDemos,
20:23:03BlaXpiritcome on
20:23:03Demoserm 0..<10
20:23:12BlaXpirit[:02:35] <BlaXpirit> .eval echo "abc"[0 .. -1]
20:23:20BlaXpirit.eval echo "abc"[0 .. <0]
20:23:24MimbusBlaXpirit: abc
20:23:27BlaXpiritexpected: ""
20:23:29EXetoCwhat does that have to do with it?
20:23:36Demossorry I was on the bus at the time I think
20:23:37BlaXpiritnormal ranges are NOT supported
20:23:45BlaXpiritthis is NOT okay
20:23:57*gsingh93 joined #nim
20:23:58BlaXpiritby normal I mean left-inclusive right-non-inclusive
20:24:05BlaXpiritas almost all popular languages do
20:24:53ldleworkmy brain keeps flipping between agreeing and disagreeing
20:24:54Demoshm [0..-1] seems to work for me
20:24:57BlaXpiritunless negative indices are removed, cringes will happen over and over
20:25:04*t4nk190 quit (Ping timeout: 246 seconds)
20:25:20BlaXpiritobscure bugs and pointless conditionals will be unavoidable
20:25:37EXetoCyes if you don't know the language
20:25:43BlaXpiritgoddammit, EXetoC
20:25:52BlaXpiritnobody of the people here expected that resul
20:25:54BlaXpiritt
20:25:56Varriountand verily, the heavens will rain down frogs and oysters
20:26:09BlaXpirit[:08:19] <def-> BlaXpirit: [0 .. -1]
20:26:10Demoswhat, what is wrong with the [0..-1] thing?
20:26:19BlaXpiritEXetoC, are you saying def- doesnt know the language?
20:26:29VarriountI do agree with the '-1' thing, not so much with the inclusive ranges being evil.
20:26:33EXetoCI have no idea
20:26:41DemosI got abc
20:26:44ldleworkhe has a non zero point
20:26:44Demoswhich seems reasonable
20:26:55BlaXpiritVarriount, inclusive ranges are not really evil, just very inconvenient more often than it is convenient
20:27:20BlaXpiriti am not trying to push a change to it in Nim
20:27:35BlaXpiritbut I do insist that [0 .. <0] works properly
20:27:37BlaXpiritby any means
20:28:20BlaXpiritDemos, again, my point was
20:28:39dom96.eval echo("abc"[0 .. -1])
20:28:42Mimbusdom96: abc
20:28:42dom96make perfect sense
20:28:42BlaXpirit[:07:06] <BlaXpirit> if i have an operation [:07:14] <BlaXpirit> "get first N characters of a string" [:07:24] <BlaXpirit> i write s[0 .. <n] [:07:28] <BlaXpirit> n == 0 [:07:35] <BlaXpirit> i get the whole f***g string
20:28:55BlaXpiritdom96, no, it doesn't
20:29:12EXetoCso this is about the semantics for `[]`?...
20:29:13BlaXpiritif i have a range from a bigger number to a smaller number, it must be empty
20:29:36BlaXpiritEXetoC, I can just repeat [:04:19] <BlaXpirit> inclusive right index is horrible. negative index is horrible. combined together they're the worst nightmare, they just plague the language
20:29:37dom96No, if you have a negative number it restarts from the end of the string.
20:29:45EXetoCthat's not an argument
20:29:46BlaXpiritdom96, ok, cool, but it shouldn't
20:29:54BlaXpirit[:07:06] <BlaXpirit> if i have an operation [:07:14] <BlaXpirit> "get first N characters of a string" [:07:24] <BlaXpirit> i write s[0 .. <n] [:07:28] <BlaXpirit> n == 0 [:07:35] <BlaXpirit> i get the whole f***g string
20:29:56Demosactually there may be a point here, but it may be about `<`
20:30:15BlaXpirityou think this never happens?
20:30:29BlaXpiriti bet there is at the very least one bug in standard library caused by this
20:30:38EXetoCagain, it's about the semantics for `[]` then..
20:30:49dom96Although I think that echo("abc"[0 .. 0]) should give an empty string
20:30:59BlaXpiritdom96, uhh
20:31:09BlaXpiritgreat, you fell into the trap of inclusive intervals
20:31:25BlaXpiritthx for supporting my point
20:32:05EXetoCthis is about `[]` more than anything surely
20:32:16BlaXpiritwhat is `[]`
20:32:28EXetoCproc `[]`*(s: string, x: Slice[int]): string
20:32:44BlaXpiritthe concept is everywhere in the language
20:32:57BlaXpiritnot just `[]` follows it
20:33:03BlaXpiritnot just of string, at least
20:33:11BlaXpiritso just now, i was writing a function split by regex (because the one in standard library is useless in most cases)
20:33:13BlaXpiriti have start = 0
20:33:27BlaXpiritand i find a match
20:33:45BlaXpiritso i return first substring, which is [start .. < match.left]
20:34:14BlaXpiritif the match is at the very beginning, what do we get?
20:34:17BlaXpiritno, no, not empty string
20:34:18EXetoCso it is about one instance of `[]`, and not some other aspect of the language or the lib
20:34:20BlaXpiritwe get the whole string
20:34:58BlaXpiritEXetoC, [:11:27] <BlaXpirit> .eval echo((@[1,2,3])[0 .. <0])
20:35:11BlaXpiritthat is at the very least 1 more instance of it
20:36:06EXetoCanyway, I don't know if I care for these semantics, but my stance regarding closed intervals remains the same
20:36:11EXetoCBlaXpirit: yeah ok
20:36:39BlaXpiritEXetoC, please stop talking about closed intervals, as i said, i'm not gonna convince anyone to change it this late
20:36:48flaviuBlaXpirit: Pretty good, working on docs now
20:36:54BlaXpiritflaviu, :>
20:36:58dom96I kind of wish that we just copied Python's intervals.
20:36:59flaviuekarlso-: I'm around now.
20:37:09BlaXpiritdom96, yes, they work very well
20:37:15dom96Will this be changed now? Doubtful.
20:37:19flaviuekarlso-: You don't need the init methods.
20:37:22BlaXpiritleft-inclusive, right-non-inclusive if someone isnt aware
20:37:31flaviuYou can do everything with the HMAC method.
20:37:38EXetoCfine. your one *argument* was refuted though
20:37:54flaviuExcept streaming, but that's not a major use case for you, I hope?
20:37:59BlaXpiritthere were at least 3 arguments
20:38:06BlaXpirit-1, a+b+1, dijsktra
20:38:15BlaXpiritb-a+1 rather lol
20:38:19Varriount-_-
20:38:47BlaXpiritbut now, let's think
20:38:53flaviuBlaXpirit: https://github.com/flaviut/hairy-nemesis
20:39:05BlaXpirithow can we make an operation "get a slice from the beginning of a string" actually work
20:39:27BlaXpiritright now it is: if n == 0: "" else s[0 .. <n]
20:40:19BlaXpiritof course, -1 will break it etc
20:40:28ekarlso-flaviu: how so ? ^
20:40:34BlaXpiritmaybe better if n > 0: s[0 .. <n] else: ""
20:40:40EXetoCis "s[0 .. max(0, <n)]" that bad?
20:40:47flaviuekarlso-: https://gist.github.com/flaviut/3e0b5a52fe9395fcf5c5
20:40:47BlaXpiritEXetoC, that DOES NOT WORK
20:40:54BlaXpiritEXetoC, you fell for it YET AGAIN
20:41:02EXetoC???
20:41:04BlaXpirits[0..0] is the first character
20:41:14EXetoCit's a string containing only the first character, yes
20:41:18ekarlso-flaviu: yeah, that's fair enough, but EXetoC / BlaXpirit shot me earlier for the cast:..
20:41:22VarriountEXetoC, BlaXpirit: Could you two please just drop it? Neither of you is going to convince the other.
20:41:28EXetoCekarlso-: I didn't
20:41:37ekarlso-EXetoC: someone did :p
20:41:38BlaXpiritVarriount, there is nothing to convince
20:41:42EXetoCwell, maybe redundant casts
20:41:57BlaXpiritAraq admitted it is not good, and if someone doesn't see a problem here, well, they have a problem
20:42:21ekarlso-flaviu: what's bad though with providing the init methods ?
20:42:28EXetoCs[0 .. 0] == "" & s[0], s[0 .. 1] == "" & s[0] & s[1]
20:42:40flaviuekarlso-: It complicates the API and requires more headers to be wrapped
20:42:42BlaXpiritEXetoC, wat
20:43:01BlaXpirithttps://bpaste.net/show/e2fdbf114faa beginning of my function
20:43:04ekarlso-flaviu: well I guess someone *might* need it and it's already done for md5...
20:43:10BlaXpiritbarely started writing it, and there is already a bug
20:43:26ekarlso-flaviu: if you go to openssl.nim you can see md5_init etc
20:44:05BlaXpiritEXetoC, what the heck did you write there
20:44:17BlaXpiritoh, yes, it is correct
20:44:23BlaXpiritbut what does it even mean?
20:44:45BlaXpiritmaybe you just illustrated the problem
20:44:52EXetoCok let's see
20:45:09EXetoCso you want s[0 .. 0] to be the empty string? and if so, for the sake of familiarity with semantics in certain other languages?
20:45:23ekarlso-flaviu: if you go to openssl.nim you can see md5_init etc
20:45:28BlaXpiritI want s[0 .. <0] to be the empty string
20:45:29ekarlso-meh, wrong arrow up sorry
20:45:47BlaXpiriti do not care if .. itself is changed, because i'm simply going to avoid it as unviable
20:46:22BlaXpiritnim does not provide a straightforward way to get a slice from the beginning of a string to some index
20:46:41Varriount:<
20:46:44BlaXpiritbecause there is no way to get an empty string i you start from the left side
20:47:02ekarlso-flaviu: I dont get it though why my example doesn't work
20:47:26flaviuekarlso-: I have no idea what you're talking about. The interface is adequate, the problem is that the result doesn't match the c result, which doesn't match the bouncy castle result.
20:48:31ekarlso-flaviu: https://bpaste.net/show/ee36777d5b00 < illegal storage access #111
20:48:44BlaXpiritoh guys guess what
20:48:52EXetoCBlaXpirit: it's just one tiny aspect though, but I will think about this and get back to you a little later
20:49:31BlaXpirithttps://github.com/Araq/Nim/blob/master/lib/impure/re.nim "-1" appears 37 times, "+1" appears 12 times
20:49:42BlaXpiritguess how different it would be with correctly made ranges
20:50:06BlaXpiritEXetoC, it is not tiny
20:50:13*atomic-hedgehog quit (Quit: Lost terminal)
20:50:19EXetoCdo you *often* need the shortcut that you're talking about? I'm asking because I don't write that much real-world code myself
20:50:31EXetoCand I guess I don't work with strings in this way that much
20:50:34BlaXpiritEXetoC, which shortcurt
20:50:43BlaXpiritEXetoC, you're being ridiculous here
20:51:16VarriountBlaXpirit: Well, you might argue that the impure 're' module is unfair, since your translating ranges.
20:51:19EXetoC-myself
20:51:34ekarlso-flaviu: now this is something I totally dont understand.. why does the example work when I say import the "future" module ?
20:51:42BlaXpiritif I write s[0 .. <n] where n is never negative, I don't expect it to return the whole string when n is 0
20:51:53BlaXpiritdon't you get it that it's a huge source of bugs
20:52:07ekarlso-I feel it's uberweird, if I do just "import future" above isMainModule it runs fine..
20:52:17EXetoCBlaXpirit: well, it's not always a shortcut. surely s[0 .. 0] as it is now is considered a shortcut to some people, who just happen to want only the first character then
20:52:18ekarlso-if not it goes splat
20:53:04EXetoCBlaXpirit: I think you are conflating different issues, "shortcuts" and what have you, at times
20:53:12BlaXpiritwat
20:53:20BlaXpiritwhere do you see a shortcut
20:53:34BlaXpiritwhat else do you expect me to write
20:54:02*t4nk709 joined #nim
20:54:02BlaXpiritEXetoC, is this idiomatic code for you? if n > 0: s[0 .. <n] else: ""
20:55:05BlaXpirita tedious option to solve this is to actually make ".. <" a thing
20:55:22BlaXpiritbut then it would need to be a different type of range anyway
20:55:28BlaXpiritaaand double implementations for everything
20:55:36flaviuekarlso-: Because you don't know the size of HMAC_CTX
20:55:36t4nk709What is the meaning of a prefixed P?
20:55:37EXetoCand for people who are just fine with the fact that s[0 .. 0] happens to return a string containing the first character? it's entirely situational
20:55:50*nande joined #nim
20:55:57BlaXpiritEXetoC, it is not situational, it happens all the time!!!!!
20:56:03BlaXpiritget first N characters of a string
20:56:19BlaXpirityou can't get first N characters of a string in Nim
20:56:21BlaXpiritjust think of this
20:56:33flaviuekarlso-: You're passing a pointer to a object of size zero. If it access addr+1, it segfaults.
20:57:04flaviuekarlso-: Like I said, it's a lot more complicated if you want to use those functions. It's not easy.
20:57:11EXetoC"you can't" is very misleading. you just want it to be so with a specific kind of syntax
20:57:26BlaXpiritEXetoC, no, you don't understand
20:57:41BlaXpiritpeople are simply going to write s[0 .. <n] without a fkin clue
20:57:57BlaXpiritas def- and others kindly demonstrated
20:58:03flaviuEXetoC: It's bit me while writing my regex library
20:58:07*t4nk969 joined #nim
20:58:10ldleworkI have to agree with BlaXpirit I think
20:58:29ldleworkI don't think we should do non-mainstream conventions "just cuz"
20:58:44ldleworkWhich seems to be literally the only defense so far, I've heard.
20:58:44flaviuThere's a reason that nearly every language uses exclusive upper bounds.
20:59:15ldlework"I get by, why don't you" should be our last justification for anything.
20:59:43*t4nk709 quit (Ping timeout: 246 seconds)
21:00:45TriplefoxIt's consistent with array definition syntax, however in that case you can define a single length number
21:00:48*Demos quit (Ping timeout: 245 seconds)
21:00:56ekarlso-flaviu: how u fix that issue then if I can ask u
21:01:08EXetoCplease discuss this on the forum
21:01:10*vendethiel quit (Quit: q+)
21:01:22BlaXpiritforum is 20th century
21:01:32VarriountO_o
21:01:33flaviuekarlso-: Like I keep saying, the easiest solution is to just use the HMAC function.
21:01:41BlaXpiritthis conversation we just had would've taken a few weeks on forums
21:01:55ekarlso-flaviu: still my curious ass is wondering ;P
21:02:00ldleworkYeah but at least in a few weeks after that we would remember having it :)
21:02:26BlaXpiritespecially such bare bones forum
21:02:41*superfunc joined #nim
21:02:42BlaXpirityou have to remember every post you made and check if someone wrote back
21:02:44BlaXpiritsrsly
21:03:01ldleworkBlaXpirit: its an effort to self-dogfood
21:03:08ldleworkLets give efforts such as that some leeway
21:03:08*UberLambda joined #nim
21:03:15ldleworkIts pretty admirable.
21:03:17flaviuekarlso-: Probably include the structure definition in the nim file. Another possibility is to create a dummy array[uint8, sizeof(HMAC_CTX)] as a field.
21:03:28BlaXpiritwell if i wanted to reimplement the wheel, i'd make it at least remotely round
21:03:46VarriountVersus here, where
21:03:48flaviuBut that'll break as soon as they change the structure definition.
21:03:50ldleworkBlaXpirit: you're losing my support :)
21:03:53UberLambdaIs there any interest in adding tagged unions to the language?
21:04:08VarriountUberLambda: Huh?
21:04:13EXetoCflaviu: what are those reasons? and could you please give me a link to an article that covers this
21:04:25UberLambdaVarriount: Rust's enums
21:04:36VarriountUberLambda: You've looked at variant objects, right?
21:04:49VarriountUberLambda: I haven't used Rust.
21:04:50UberLambdaI think that's another name for them
21:05:02dom96UberLambda: Are you familiar with object variants?
21:05:02BlaXpiritUberLambda, i think nim has something like that
21:05:06BlaXpiritjust that you can't match them
21:05:09UberLambdaThey're basically enums that can hold values and get stored as a union + id pair
21:05:21UberLambdadom96: are these an actual nim feature?
21:05:21BlaXpiritpeople are talking about object variants **in nim**
21:05:23dom96Object variants will get you what you want. I think we need some syntax sugar for them though.
21:05:24ekarlso-flaviu: oh, wait a min
21:05:30dom96UberLambda: yes
21:05:41UberLambdadom96: checking them out now
21:06:45BlaXpiritso people
21:06:47ldleworkCan anyone confirm or deny that if I use a user-defined type class as a descriminator constraint, Nim will just ignore it?
21:06:48UberLambdaThey're a bit low-level though
21:07:22BlaXpirityup..
21:07:35BlaXpiritbut think of what you can't do with convenience functions!
21:07:39BlaXpirit(not much actually lol)
21:07:57ldleworkplz?
21:08:14UberLambdaI think I just got too used to pattern matching
21:08:14BlaXpiritldlework, it's hard to understand, just make a small example and report bug
21:08:38BlaXpiritUberLambda, i am quite sure it is possible to make ad hoc pattern matching with macros
21:08:38ldleworkfoo[T: Bar], Nim lets me discriminate against non Bar implementing types.
21:08:45ldleworkbut if I do
21:08:58ldleworkfoo[T: tuple] Nim applies the constraint correctly and raises an error
21:09:03superfuncUberLambda: you still can pattern match
21:09:07ldleworkI'm assuming this is what is meant by "User type classes don't work."
21:09:08superfuncin a sense
21:09:29ldleworkUberLambda: +1 to pattern matching in Nim
21:09:45BlaXpiritonionhammer, pls write a macro :p
21:09:46flaviuEXetoC: I hate quora as much as anyone, but http://www.quora.com/Why-are-Python-ranges-half-open-exclusive-instead-of-closed-inclusive?share=1 is pretty good.
21:10:03BlaXpiritflaviu, mmmm so good
21:10:07UberLambdasuperfunc: also with tuples?
21:10:34*t4nk969 quit (Ping timeout: 246 seconds)
21:10:40UberLambdaThe tutorial seems to do just that now that I see it
21:10:49BlaXpiritEVERYONE MUST READ THAT LINK
21:11:01ldleworkBlaXpirit: Just learn Nim better.
21:11:04ldlework:)
21:11:10BlaXpiritif n > 0: s[0 .. <n] else: ""
21:11:16BlaXpiritgud programr
21:11:44BlaXpiritfor reference, Python:
21:11:47BlaXpirits[:n]
21:11:55BlaXpiritfor same result
21:11:56ekarlso-flaviu: meh, harder then it looked then ;P
21:12:08ekarlso-flaviu: what you meant with the dummy thing though ?
21:12:38flaviuliterally add a field `dummy: array[thesizeofthisthing, uint8]`
21:13:00flaviuYou won't be using it, but it'll tell the compiler to use up that much memory for the type.
21:13:06ekarlso-rofl, what's the use of that ;P
21:13:08ekarlso-ah
21:13:54UberLambdaIs mark and sweep disabled by default?
21:14:02UberLambdaIn the GC
21:14:53*vendethiel joined #nim
21:15:20ldleworkUberLambda: http://nim-lang.org/gc.html
21:16:07UberLambdaIdlework: found it, but I don't understand if GC_enableMarkAndSweep is called by the runtime by default
21:16:45ldleworkUberLambda: I would assume so
21:17:18flaviuekarlso-: Anyway, I used some test vectors from RFC 2202, and everything looks good.
21:17:18UberLambdaIs the performance worse?
21:17:36EXetoCldlework: those are not user-defined
21:17:36ldleworkUberLambda: I dont know too much about it, sorry.
21:17:48ldleworkEXetoC: sorry?
21:17:50EXetoCok maybe they are, but the traits construct has a confusing name
21:17:52UberLambdaIdlework: no problem, thanks BTW
21:17:56ekarlso-flaviu: wanna help on that init stuff ? ;p
21:18:11EXetoCldlework: *user-defined* type classes are powered by the 'generic' keyword
21:18:25ldleworkEXetoC: I know that tuple is not user defined
21:18:30ldleworkEXetoC: "Foo" clearly is.
21:18:44ldleworktype Foo = generic t ...
21:18:57ldleworkOh in my example I called it Bar
21:19:02ldleworktype Bar = generic t ...
21:19:02EXetoCnevermind then
21:19:09EXetoCit was broken for me with 'var' parameters
21:19:21ldleworkNim doesn't seem to enforce user-defined descriminator constraints
21:19:22flaviuekarlso-: I'm not sure what you're referring to.
21:19:29EXetoCI wouldn't bother tbh. it'll be fixed some time after 1.0 I assume, and before 2.0
21:19:35ldleworkEXetoC: lol
21:19:44ekarlso-HMAC_init and all that ;)
21:19:58EXetoCflaviu: will read. hopefully the bdfl will voice his opinion in a more detailed fashion
21:20:09ldleworkEXetoC: the only point behind descriminator constraints is so that you get an error at the point of descrimination rather at the point where Nim tries to access some field or proc that the descriminator type doesn't support right?
21:20:30ldleworkWhich I assume happens far far earlier in the compilation?
21:20:43flaviuekarlso-: Don't do work that isn't required. YAGNI
21:20:44ldleworkIs that why they are low priority because they don't prevent you from writing anything?
21:20:59ekarlso-flaviu: ..
21:21:00ekarlso-:P
21:21:15ldleworkEXetoC: sorry if you don't know, I'm just curious
21:21:27ekarlso-flaviu: i'll let go with using HMAC for now -,,-
21:22:19*BlaXpirit_ joined #nim
21:22:20EXetoCldlework: and for better reflection I guess
21:22:39ldleworkEXetoC: but the reason I brought up is true, you think?
21:22:42*UberLambda quit (Quit: Leaving the Matrix)
21:22:46EXetoCand of course better reasoning
21:22:51ldleworkEXetoC: right
21:22:59EXetoCldlework: yes, and the error message would be more obvious
21:23:08ldleworkEXetoC: the error message is absolutely terrible
21:23:17ldleworkhehe, when you violate descriminator constraints
21:23:37ldleworkI only knew what the error meant because I was literally trying to violate the constraint to see what the error would be
21:23:50ldleworklike passing a non-tuple to a tuple constraint
21:24:23ldleworkI guess that's something I could open an issue for
21:24:40ekarlso-flaviu: anyways, thnx so much for helping, i've actually got a working jwt thnx to u and can post it tmrw for packages.
21:24:52ekarlso-flaviu: so user auth is actually working properly
21:24:55VarriountGah. The IDETools code is... interesting
21:25:01flaviuekarlso-: Ok, sounds good!
21:28:32BlaXpirit_Araq, are you going to consider removing negative indices? I don't see any other way to work around this that doesn't require a different slice type etc.
21:29:10superfuncldlework: is the link for your metaprogramming article dead?
21:29:50ldleworksuperfunc: yeah :(
21:29:58ldleworkmy DO instance got pwned
21:30:10ldleworkif anyone has any experience cleaning up pwned linux environments... let me know
21:30:35Varriountldlework: 'sudo rm -rf /' should fix it
21:30:48ldleworkhehe but that would destroy the blog too!
21:30:49VarriountFor a given value of 'fix'
21:31:13flaviuldlework: Can you set it up without a domain?
21:31:29flaviuBest idea is to use scp to get the files out and create a new image.
21:32:34ekarlso-blog, just use pelican and have source in github :P
21:33:24*tinAndi joined #nim
21:35:26ldleworkflaviu: they disabled the networking
21:35:32ldleworkbecause it was being used for outbound ddos
21:35:38ldleworkthat's what makes it difficult to get the data out
21:35:58flaviuI'm not familiar with DO, but can't you download the disk image then?
21:36:46flaviuldlework: Also, you should disable root login and only allow ssh with certificates.
21:37:04ldleworkflaviu: indeed
21:39:10ekarlso-root login be the devil
21:40:13*BlaXpirit_ quit (Quit: Quit Konversation)
21:45:32dom96ldlework: Any ideas how it got pwned?
21:46:07gokr1BlaXpirit: I tried adding a first proc for seq (taking an argument n) and stumbled at exactly these issues. Had to add -1 of course, but also the lesser obvious special case for n == 0.
21:49:50Varriountgokr1: So you too thing that inclusive indices are bad?
21:50:26gokr1I honestly haven't thought that much about it since I have lived in Smalltalk for the last 20 years ;)
21:50:53gokr1I just note that I too got tripped up by it.
21:50:55EXetoCthat's a long time
21:51:02BlaXpiritdtscode, can Mimbus handle infinite loop?
21:51:13VarriountBlaXpirit: It times out after a minute.
21:51:23BlaXpiritliterally minute?
21:51:33BlaXpiriti guess/hope not
21:51:47VarriountBlaXpirit: What other kind of minute would I be talking about?
21:51:53BlaXpiritminute is too long :s
21:52:02VarriountI don't think I've come across a metaphorical minute.
21:52:09BlaXpiritwell i have
21:52:14BlaXpirit"give me a minute" they say
21:52:23BlaXpiritand you have too for sure
21:53:07BlaXpirit.eval import re; echo "Hello, World!".replace(re"\b", "*")
21:53:17EXetoCI've gotten pissed for no reason then when people show up after minutes
21:54:10MimbusBlaXpirit: <no output>
21:54:45BlaXpirit.python import re; re.sub(r"\b", "*", "Hello, World")
21:54:49BlaXpiritBlaXpirit: '*Hello*, *World*'
21:54:52BlaXpiritlel
21:55:12BlaXpiritflaviu, this should be interesting to you
21:55:32BlaXpiritthis might be caused by inclusive intervals
21:55:39BlaXpiritor just 0-size increment more likely
21:55:49*gour quit (Remote host closed the connection)
21:56:01flaviuBlaXpirit: What just happened?
21:56:07BlaXpiritinfinite loop in nim
21:56:09BlaXpiritworks in pytho
21:56:12flaviuah, I know.
21:57:00flaviurelated https://github.com/Araq/Nim/issues/1933, https://github.com/flaviut/hairy-nemesis#why
21:57:02BlaXpirittry that on your lib too :p
21:57:09flaviuI don't have sub yet.
21:57:23BlaXpiritwhatever
21:57:31BlaXpirittry it later then
21:57:35flaviubut my findAll is correctly implemented, so it should be nearly trivial to implement.
21:57:37BlaXpiritor try it on wherever you have a loop
21:58:36BlaXpirit.eval import re; echo "Hello, World!".findall(re"\b")
21:58:36flaviuhttps://github.com/flaviut/hairy-nemesis/blob/master/src/nre.nim#L402
21:58:41MimbusBlaXpirit: out of memory
21:58:47BlaXpiritgood stuff
21:58:50flaviuyep
21:58:51BlaXpiritreally good stuff, Araq
21:59:06ekarlso-can u do a named capturing group to table or stringtable?
21:59:08BlaXpiritthis isn't even some contrived example
21:59:16flaviu.eval import re; "foo".findall(re"")
21:59:19Mimbusflaviu: eval.nim(4, 5) Error: value of type 'seq[string]' has to be discarded
21:59:24flaviu.eval import re; echo "foo".findall(re"")
21:59:28Mimbusflaviu: out of memory
21:59:53BlaXpiritflaviu, Araq wasn't convinced by that, maybe he will by this new thing
22:00:13VarriountIsn't the 're' library powered by pcre?
22:00:16EXetoCjust make sure that this is the cause
22:00:35flaviuVarriount: Yes, but pcre doesn't implement the replacement and findall.
22:00:35BlaXpiritVarriount, it sure is
22:00:42BlaXpiritpcre is good
22:01:20flaviuVarriount: The problem is that nim doesn't deal with a zero-length match correctly.
22:01:36dom96BlaXpirit: Submit a bug report on Github for this please.
22:01:43flaviuIt keeps trying to find the next match, never incriminating the index
22:01:50flaviudom96: https://github.com/Araq/Nim/issues/1933
22:02:07BlaXpirit"edge cases"
22:02:29BlaXpirittoday's topic
22:04:49*superfunc quit (Ping timeout: 246 seconds)
22:07:34VarriountBlaXpirit: To satisfy the need for partially inclusive ranges, we could define new range operators, `...`
22:07:42EXetoCcould you validate your assumption regarding re?
22:07:51flaviuEXetoC: Me?
22:08:08VarriountWe can't change current ranges without massively breaking current programs.
22:08:31flaviuVarriount: I doubt any program relies on getting stuck in an infinite loop :P
22:08:39flaviuEXetoC: https://github.com/Araq/Nim/blob/master/lib/impure/re.nim#L230
22:08:40EXetoCflaviu: no. did you make a claim?
22:08:45EXetoCok
22:08:59EXetoCit is indeed very late to consider such changes
22:09:02flaviuEXetoC: Yes, that the problem with the re module is in findall.
22:09:12Varriountflaviu: Huh? I don't follow your statement. Where did I state that a program relies on getting stuck in an infinite loop?
22:09:21EXetoCmaybe if we all did spend a huge amount of time on it
22:09:33flaviuVarriount: Sorry, I thought you were referring to the re.findAll bug.
22:09:34dom96flaviu: Varriount is talking about changing ranges not split().
22:09:38flaviuOh.
22:09:52flaviuAnyway, if anyone wants to fix re, the correct implementation is here: https://github.com/flaviut/hairy-nemesis/blob/master/src/nre.nim#L344-L355
22:10:20VarriountA very crude operators is 'proc `...`[T, R](a, b: T): R = result = a..(<b)'
22:10:51BlaXpiritVarriount, amazing
22:10:54flaviuVarriount: Again, that's insufficent.
22:10:57VarriountOf course, this doesn't fix the problem with strings and sequences accepting negative indices.
22:11:04BlaXpiritnow i can write if n > 0: s[0 ... n] else: ""
22:11:09BlaXpiritinstead of if n > 0: s[0 .. <n] else: ""
22:11:11BlaXpiritgj
22:11:26VarriountBlaXpirit: Are you being sarcastic? I can't tell.
22:11:29BlaXpiriti am
22:11:44Varriount:<
22:11:54EXetoCas always. please do less of it
22:12:15dom96flaviu: Maybe you should create a PR for that issue?
22:12:27BlaXpiritdom96, i think the existing re library is beyond fixing
22:12:30flaviudom96: I don't care enough, I wrote my own library.
22:12:36*Sergio96_ joined #nim
22:13:13VarriountBlaXpirit: I'm just trying to help. I'm sorry if I offended you earlier.
22:13:34dom96Of course. Why make what everyone uses better when you can just write something completely different and then not even contribute it back into the ecosystem.
22:13:37BlaXpiriti just hope people don't get too offended by what i do
22:13:53BlaXpiritdom96, come on...
22:14:09flaviudom96: please don't say that, I contribute everything possible back
22:14:09BlaXpirityou know stdlib is not good
22:14:10Varriountdom96: I'll fix it when I get home. Hopefully it's a simple fix.
22:14:10flaviuhttps://github.com/flaviut/hairy-nemesis
22:14:28BlaXpiriteveryone should just switch to new library and be happy
22:14:58BlaXpiritbut yeah, maybe these small direct bugfixes are indeed important
22:15:45dom96Wait. So you're saying that we shouldn't use the stdlib at all because it's not good?
22:15:46EXetoCBlaXpirit: not so much offended as annoyed by the apparent aggression
22:15:55dom96And we also shouldn't bother to improve it?
22:16:19BlaXpiritin some parts, yes
22:17:23flaviudom96: See D. They had two stdlibs for a while, and came out better for it.
22:17:35dom96flaviu: They most certainly did not.
22:17:38TriplefoxWrite a "2" and deprecate, optparse already did that
22:17:48BlaXpiritoptparse :D
22:18:28BlaXpiritparseopt* probably
22:18:46EXetoCdom96: I hope most people care about the ecosystem
22:18:52TriplefoxYeah one of those :/
22:18:54BlaXpiritparseopt2 is still almost useless -_-
22:19:13BlaXpiritbtw i was writing docopt this whole day
22:19:19BlaXpirituntil the bugs got to me
22:20:29EXetoCdom96: just do lib<number> if necessary, deprecate the old lib, and then eventually migrate, but that'll hopefully be a rare occurrence
22:21:15BlaXpiritEXetoC, I actually hope that to be a frequent occurence
22:21:56EXetoCit might not be so bad. just output some notice upon the use of the deprecated lib
22:21:57BlaXpiritnot frequent changes to one lib
22:22:08BlaXpiritbut many libs need reworking :s
22:22:14dom96I would like to see RFCs on Github describing what you would like to see improved.
22:22:28dom96Then once Araq agrees for you to make those improvements.
22:22:53*tinAndi quit (Quit: ChatZilla 0.9.91.1 [Firefox 35.0/20150108202552])
22:25:51BlaXpiritdom96, ah yeah
22:25:58BlaXpiriti remember how it was with "random" library
22:26:10BlaXpiritstill sitting there in the dust
22:26:39dom96oh?
22:26:45BlaXpiriti didn't write an "RFC" though
22:26:57dom96what did you do?
22:27:06BlaXpiritbut i don't think it's nearly ready to be included in stdlib
22:27:20BlaXpiritand stdlib inclusion is like a death sentence for a library anywa
22:27:21BlaXpirity
22:27:44BlaXpiritdom96, but at the very least, i reported a ton of bugs with the current random() function, and i didnt see any change
22:28:01EXetoCmanpower
22:28:08dom96You expect Araq to fix all 400 open issues at once?
22:28:13ekarlso-get nimble working with a package index like crates.io in rust and u can have lots of libs outside of nimble itself..
22:28:41BlaXpiriti almost think there should be almost no standard library
22:28:48flaviu^^
22:28:58flaviuI've been thinking very similar thoughts.
22:29:06BlaXpiritbut nah, that's too dangerous for backwards compatibility
22:29:16BlaXpiritlibs can even get totally removed from github and everyone's screwed
22:29:43BlaXpiriteven pull requests for nim are often ignored
22:30:20BlaXpirit(yes, i changed topic again)
22:30:28ldleworkI mean
22:30:34flaviuMy main criticism is that nim tries to do too much.
22:30:34ldleworkoops I was scrolled up
22:30:43ldlework(I like negative indicies)
22:30:56ldleworkflaviu: please don't turn Nim into Go :(
22:31:13flaviuManpower is an issue, yet it's critical that all the infrastructure be written in nim?
22:31:29BlaXpirit^this x1000
22:31:30flaviuDon't use a CSS preprocessor unless it's written in nim?
22:31:52ldlework:up-vote:
22:32:12TriplefoxWould there be a conflict if the python slice syntax were bolted on the existing one
22:32:37BlaXpiritTriplefox, you woke up?
22:32:41ldleworkTriplefox: I'm confounded why we don't just exactly copy what Python does in every instance it makes sense to
22:32:57BlaXpiritnot sure if it's sarcastic, but in case it's not, i agree
22:33:02BlaXpirittoo late tho
22:33:08ldleworkLike for the "We could do anything here, what should we do, people like Python, so lets just do that"
22:33:14ldleworkwould takes us reallly reallly far
22:33:23Triplefoxthe existing is fine for certain things...so keep it
22:33:38BlaXpiritTriplefox, we can't not keep it
22:33:44BlaXpiritcan't break almost every single program
22:33:54BlaXpiritbut that is not my point anyway -_-
22:34:19ldleworkShould we be able to take nim source, compile it to ast, automatically transform it and spit out the modified source?
22:34:33ldleworkgofmt style?
22:34:35BlaXpiritldlework, isn't that exactly what macros do
22:34:42ldleworkBlaXpirit: they don't produce source code do they?
22:34:48BlaXpiritpretty sure they do
22:34:54BlaXpiritmm maybe not
22:34:57BlaXpiriti'm not sure
22:35:11EXetoCldlework: nimfix will serve that purpose apparently
22:35:11flaviuldlework: nimfix pretty
22:35:16EXetoCor will, but I don't know how well
22:35:24ldleworkSo like
22:35:25EXetoCatm that is
22:35:31ldleworkif we were going to do this thing were
22:35:33flaviuIt used to be in the compiler, apparently it it got moved out.
22:35:34ldleworkbefore 1.0
22:35:48ldleworkwe break all the languages really ... uncomfortable abrasive edges
22:36:06ldleworkwould we be able to largely automate small syntax changes like this?
22:36:13ldleworkmaybe I'm dreaming
22:36:25ldleworkbut didn't even Python have 2to3
22:36:56ldleworkthink about the Nim our children will write
22:37:03ldleworkPlease wont SOMEBODY think of the children?
22:37:07ekarlso-aha
22:37:09ekarlso-haha
22:38:23BlaXpirit:D
22:38:26EXetoCit doesn't matter how good or bad the forum is, discussing some things on IRC is simply not ideal
22:38:40EXetoC(not to self also)
22:39:21BlaXpiritmodern forums should be closer to chats than to 20th century forums
22:39:37BlaXpiritgitter almost got it right
22:39:44dom96Lies, we obviously need a mailing list.
22:39:59TriplefoxWhere is our printed newsletter
22:40:00flaviudom96: I'd suggest google groups, but that's incredibly terrible.
22:40:04ldleworkWe need a proposal system.
22:40:16BlaXpiritgithub issues duh
22:40:24BlaXpiritwhat's the point if they're going to be ignored anyway
22:40:35EXetoCforever?
22:40:45ldleworkI wish I could contribute to the language directly
22:40:45EXetoCmore pessimism
22:40:48ldleworkgarrr
22:40:48*gsingh93 quit (Ping timeout: 245 seconds)
22:40:56flaviuBtw, how do I install nimfix?
22:40:58BlaXpiritpessimism is nice
22:41:01flaviuit's not in Nimble
22:41:07BlaXpirityou're either correct or pleasantly surprised
22:41:12ekarlso-if anyone wants to checkout packages tmrw and flame me please ping me .
22:41:19TriplefoxThis comes up with every language community. Nobody is happy with just one medium so we have to allow overlap
22:41:34ldleworkTriplefox: with regards to what
22:50:07Araqflaviu [22:31:13] Manpower is an issue, yet it's critical that all the infrastructure be written in nim?
22:50:23Araqagain this argument?
22:50:36Araqso how many PRs did you submit for Varriount's buildbot?
22:51:03*alphawaffle joined #nim
22:52:10*gokr1 quit (*.net *.split)
22:52:11*Etheco quit (*.net *.split)
22:52:11*biscarch quit (*.net *.split)
22:52:11*Mimbus quit (*.net *.split)
22:52:12*RushPL quit (*.net *.split)
22:52:13*Varriount quit (*.net *.split)
22:52:14*hguux_ quit (*.net *.split)
22:52:14*adam| quit (*.net *.split)
22:52:14*MyMind quit (*.net *.split)
22:52:16*dymk quit (*.net *.split)
22:52:17*iivvoo quit (*.net *.split)
22:52:17*TylerE quit (*.net *.split)
22:52:18*EastByte_ quit (*.net *.split)
22:52:18*no_name quit (*.net *.split)
22:52:18*CARAM__ quit (*.net *.split)
22:52:19*novist quit (*.net *.split)
22:52:19*x4nt quit (*.net *.split)
22:52:20*Amrykid quit (*.net *.split)
22:52:20*xAndy quit (*.net *.split)
22:52:21*Triplefox quit (*.net *.split)
22:52:21*akyte quit (*.net *.split)
22:52:21*SplinterOfChaos quit (*.net *.split)
22:52:22*[CBR]Unspoken quit (*.net *.split)
22:52:23*dom96 quit (*.net *.split)
22:52:23*comex quit (*.net *.split)
22:52:24*fold quit (*.net *.split)
22:52:25*renesac quit (*.net *.split)
22:52:25*eigenlicht quit (*.net *.split)
22:52:25*Trustable quit (*.net *.split)
22:52:25*flaviu quit (*.net *.split)
22:52:26*endou______ quit (*.net *.split)
22:52:26*clone1018 quit (*.net *.split)
22:52:26*[dee] quit (*.net *.split)
22:52:26*profan quit (*.net *.split)
22:52:27*Grauwolf quit (*.net *.split)
22:52:28*KoFish quit (*.net *.split)
22:52:29*sillesta quit (*.net *.split)
22:52:29*skyfex quit (*.net *.split)
22:52:30*saml quit (*.net *.split)
22:52:30*valberg quit (*.net *.split)
22:52:30*vegai quit (*.net *.split)
22:52:30*jez0990 quit (*.net *.split)
22:52:31*def- quit (*.net *.split)
22:52:31*delian66 quit (*.net *.split)
22:52:31*dv- quit (*.net *.split)
22:52:32*vendethiel quit (*.net *.split)
22:52:32*VinceAddons quit (*.net *.split)
22:52:32*Boscop quit (*.net *.split)
22:52:32*kniteli quit (*.net *.split)
22:52:33*onionhammer quit (*.net *.split)
22:52:33*zielmicha quit (*.net *.split)
22:52:33*reloc0 quit (*.net *.split)
22:52:34*nande quit (*.net *.split)
22:52:34*Jesin quit (*.net *.split)
22:52:34*zahary_ quit (*.net *.split)
22:52:34*gmoore quit (*.net *.split)
22:52:34*dtscode quit (*.net *.split)
22:52:35*Sergio96_ quit (*.net *.split)
22:52:35*BlaXpirit quit (*.net *.split)
22:52:35*MajorTennis quit (*.net *.split)
22:52:36*clone1018_ quit (*.net *.split)
22:52:36*JStoker quit (*.net *.split)
22:52:37*irrequietus quit (*.net *.split)
22:52:39*jsudlow quit (*.net *.split)
22:52:39*vezzy quit (*.net *.split)
22:52:40*lyro quit (*.net *.split)
22:52:40*phI||Ip quit (*.net *.split)
22:52:41*skroll3 quit (*.net *.split)
22:52:41*ekarlso- quit (*.net *.split)
22:52:41*betawaffle quit (*.net *.split)
22:52:42*wtw quit (*.net *.split)
22:52:42*flan3002 quit (*.net *.split)
22:52:42*flyx quit (*.net *.split)
22:52:42*ldlework quit (*.net *.split)
22:52:42*Trixar_za quit (*.net *.split)
22:52:43*alexruf quit (*.net *.split)
22:52:43*brson quit (*.net *.split)
22:52:43*Etheco- quit (*.net *.split)
22:52:44*fowl quit (*.net *.split)
22:52:44*joebo quit (*.net *.split)
22:52:46*jpoirier quit (*.net *.split)
22:52:47*EXetoC quit (*.net *.split)
22:52:47*yonson quit (*.net *.split)
22:52:48*MightyJoe quit (*.net *.split)
22:52:48*ramnes quit (*.net *.split)
22:52:48*alphawaffle is now known as betawaffle
22:53:05*Etheco joined #nim
22:53:34*Amrykid2 joined #nim
22:53:34*phI||Ip_ joined #nim
22:53:34*founders joined #nim
22:53:34*Triplefox_ joined #nim
22:53:34*quasinoxen joined #nim
22:53:34*biscarch_ joined #nim
22:53:34*gsingh93 joined #nim
22:53:34*Sergio96_ joined #nim
22:53:34*vendethiel joined #nim
22:53:34*nande joined #nim
22:53:34*sillesta joined #nim
22:53:34*alexruf joined #nim
22:53:34*brson joined #nim
22:53:34*eigenlicht joined #nim
22:53:34*irrequietus joined #nim
22:53:34*BlaXpirit joined #nim
22:53:34*Jesin joined #nim
22:53:34*VinceAddons joined #nim
22:53:34*zahary_ joined #nim
22:53:34*Etheco- joined #nim
22:53:34*Trustable joined #nim
22:53:34*gmoore joined #nim
22:53:34*dtscode joined #nim
22:53:34*flaviu joined #nim
22:53:34*Boscop joined #nim
22:53:34*skyfex joined #nim
22:53:34*SplinterOfChaos joined #nim
22:53:34*endou______ joined #nim
22:53:34*dymk joined #nim
22:53:34*MajorTennis joined #nim
22:53:34*iivvoo joined #nim
22:53:34*TylerE joined #nim
22:53:34*hguux_ joined #nim
22:53:34*EastByte_ joined #nim
22:53:34*no_name joined #nim
22:53:34*CARAM__ joined #nim
22:53:34*wtw joined #nim
22:53:34*ldlework joined #nim
22:53:34*flan3002 joined #nim
22:53:34*flyx joined #nim
22:53:34*kniteli joined #nim
22:53:34*renesac joined #nim
22:53:34*Triplefox joined #nim
22:53:34*akyte joined #nim
22:53:34*Amrykid joined #nim
22:53:34*xAndy joined #nim
22:53:34*x4nt joined #nim
22:53:34*novist joined #nim
22:53:34*comex joined #nim
22:53:34*fold joined #nim
22:53:34*dom96 joined #nim
22:53:34*[CBR]Unspoken joined #nim
22:53:34*reloc0 joined #nim
22:53:34*zielmicha joined #nim
22:53:34*onionhammer joined #nim
22:53:34*clone1018_ joined #nim
22:53:34*profan joined #nim
22:53:34*clone1018 joined #nim
22:53:34*Grauwolf joined #nim
22:53:34*[dee] joined #nim
22:53:34*KoFish joined #nim
22:53:34*adam joined #nim
22:53:34*dv- joined #nim
22:53:34*delian66 joined #nim
22:53:34*def- joined #nim
22:53:34*jez0990 joined #nim
22:53:34*valberg joined #nim
22:53:34*vegai joined #nim
22:53:34*saml joined #nim
22:53:34*JStoker joined #nim
22:53:34*MyMind joined #nim
22:53:34*Trixar_za joined #nim
22:53:34*fowl joined #nim
22:53:34*joebo joined #nim
22:53:38*adam is now known as Guest51690
22:53:38*novist` joined #nim
22:53:52*ldleworker joined #nim
22:54:03*dymk quit (*.net *.split)
22:54:04*iivvoo quit (*.net *.split)
22:54:04*TylerE quit (*.net *.split)
22:54:05*EastByte_ quit (*.net *.split)
22:54:05*no_name quit (*.net *.split)
22:54:05*CARAM__ quit (*.net *.split)
22:54:06*novist quit (*.net *.split)
22:54:06*x4nt quit (*.net *.split)
22:54:07*Amrykid quit (*.net *.split)
22:54:07*xAndy quit (*.net *.split)
22:54:08*Triplefox quit (*.net *.split)
22:54:08*akyte quit (*.net *.split)
22:54:23*jpoirier joined #nim
22:54:23*EXetoC joined #nim
22:54:23*yonson joined #nim
22:54:23*MightyJoe joined #nim
22:54:23*ramnes joined #nim
22:54:27*xandy joined #nim
22:54:37*ldlework quit (*.net *.split)
22:54:37*Trixar_za quit (*.net *.split)
22:54:46*vendethiel quit (Remote host closed the connection)
22:54:49*vendethiel- joined #nim
23:05:50*NimBot joined #nim
23:06:08*no_name joined #nim
23:06:22*comex joined #nim
23:06:22*Zuchto joined #nim
23:06:47*phI||Ip joined #nim
23:06:49*fold joined #nim
23:06:57*eigenlicht joined #nim
23:07:56*phI||Ip_ quit (*.net *.split)
23:07:56*quasinoxen quit (*.net *.split)
23:07:57*VinceAddons quit (*.net *.split)
23:07:57*Boscop quit (*.net *.split)
23:07:57*kniteli quit (*.net *.split)
23:07:57*onionhammer quit (*.net *.split)
23:07:57*zielmicha quit (*.net *.split)
23:07:57*reloc0 quit (*.net *.split)
23:07:59*CARAM__ quit (Max SendQ exceeded)
23:08:16*onionhammer joined #nim
23:08:19sillestanetsplit?
23:08:45*reloc0 joined #nim
23:09:05*jsudlow joined #nim
23:09:16*zielmicha joined #nim
23:09:23*profan joined #nim
23:09:29*betawaffle joined #nim
23:09:45*zielmicha is now known as Guest67437
23:10:04*TylerE quit (Ping timeout: 244 seconds)
23:10:30*Roin joined #nim
23:10:36*jsudlow quit (Client Quit)
23:10:41TriplefoxFreenode is falling over...
23:10:45*jsudlow joined #nim
23:11:06dom96Somebody is DDOS'ing them
23:11:08*nande quit (Ping timeout: 246 seconds)
23:12:03*TylerE joined #nim
23:12:45*lyro joined #nim
23:12:45*stonecolddevin joined #nim
23:12:45*joebo joined #nim
23:12:45*7YUAAFJOH joined #nim
23:12:45*MattAitchison joined #nim
23:12:45*milosn joined #nim
23:12:45*ramnes joined #nim
23:12:45*MightyJoe joined #nim
23:12:45*yonson joined #nim
23:12:45*EXetoC joined #nim
23:12:45*jpoirier joined #nim
23:12:45*Boscop_ joined #nim
23:12:45*fowlmouth joined #nim
23:12:45*Fusion_Gaming joined #nim
23:12:45*x4nt joined #nim
23:12:45*brson joined #nim
23:12:45*Etheco joined #nim
23:12:45*flaviu joined #nim
23:12:45*wan joined #nim
23:13:28*trevorriles joined #nim
23:13:41*Araq joined #nim
23:13:41*kniteli joined #nim
23:13:46*CARAM__ joined #nim
23:14:16*Varriount joined #nim
23:14:27*xAndy joined #nim
23:14:30*Trixar_za joined #nim
23:14:50*wan is now known as Guest70720
23:14:50*flaviu is now known as Guest27733
23:16:14*nande joined #nim
23:22:52*nande quit (Ping timeout: 240 seconds)
23:24:13*nande joined #nim
23:24:57*sillesta quit (Ping timeout: 265 seconds)
23:26:08BlaXpirit_just look at this horrible code
23:26:23BlaXpirit_https://bpaste.net/show/7ccec556932a
23:26:51BlaXpirit_THREE TIMES i needed a conditional because of those negative indices
23:27:26Guest27733BlaXpirit_: Personal fork?
23:27:39*keyle joined #nim
23:27:42keylehi
23:27:48BlaXpirit_i've been doing nothing but making libraries
23:28:06*Guest27733 quit (Read error: Connection reset by peer)
23:28:20*flaviu_ joined #nim
23:29:15*TylerE quit (Changing host)
23:29:15*TylerE joined #nim
23:29:39*flaviu_ is now known as flaviu
23:30:22fowlmouthBlaXpirit_, i dont think it has to be this complicated but idk.. i can't really tell whats going on here
23:30:52BlaXpirit_fowlmouth, have u seen my bug argument earlier today?
23:31:16*CARAM__ quit (Changing host)
23:31:16*CARAM__ joined #nim
23:32:06fowlmouthno but BlaXpirit_ multiple yields arent wise for an inline iterator
23:33:05BlaXpirit_there is no other way
23:33:43*johnsoft joined #nim
23:34:11BlaXpirit_:|
23:34:28ldleworkwhy isn't that wise
23:34:41BlaXpirit_fowlmouth, tell me how to get first N characters of a string
23:35:11BlaXpirit_(this is a test for you, not something I don't know)
23:35:31BlaXpirit_don't forget about corner cases
23:35:52fowlmouthldlework, the code inside the for loop is placed at the yield
23:35:52ekarlsoflaviu: did u get the q on decoding ?
23:36:13BlaXpirit_well i mean you can't get first 5 characters of a 3-char string, but the other corner case :|
23:36:52*VinceAddons joined #nim
23:37:13fowlmouthBlaXpirit_, uh str[0.. <N]?
23:37:14flaviuekarlso: nope, I can't find it in the logs either. Can you post it again?
23:37:23flaviufowlmouth: N == 0
23:37:23EXetoCyou should add "with a slice operation"
23:37:25BlaXpirit_flaviu, yay, typical
23:37:26*gunn joined #nim
23:37:32ekarlsoflaviu: just pondering on how to decode a hs256
23:37:36BlaXpirit_so the problem is, when N==0, it returns the whole string
23:37:44BlaXpirit_first 0 characters is "", not the whole string
23:37:50fowlmouthok
23:38:05fowlmouthso str[0.. max(0,<N)]
23:38:05BlaXpirit_and that's what i've been ranting about
23:38:12def-BlaXpirit_: use substr instead?
23:38:13BlaXpirit_fowlmouth, HAHA YOU FELL FOR IT AGAIN
23:38:16EXetoCfold: not allowed apparently
23:38:19EXetoCfowlmouth:
23:38:23EXetoC>.>
23:38:28BlaXpirit_fowlmouth, n==0 then it gets 1 character
23:38:31*johnsoft quit (Client Quit)
23:38:43fowlmouthoh i see BlaXpirit_
23:38:44flaviuekarlso: Please read the specification. https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#page-12
23:38:47EXetoCbut of course it doesn't account for the first 0 chars
23:38:51fowlmouthBlaXpirit_, i thought you could also do str[start, len] in nim?
23:38:55flaviuekarlso: Base64url
23:38:56BlaXpirit_fowlmouth, i dunno
23:39:07BlaXpirit_def-, substr? let's see
23:39:10fowlmouthwell try that please i'm pretty sure it works
23:39:23EXetoCfowlmouth: no
23:40:04flaviu.eval "foo".substr(0, -1)
23:40:07fowlmouth.eval "hi"[0,1].echo
23:40:08*Jesin quit (Quit: Leaving)
23:40:37*Mimbus joined #nim
23:40:41flaviu.eval "foo".substr(0, -1)
23:40:44Mimbusflaviu: eval.nim(3, 5) Error: value of type 'string' has to be discarded
23:40:45EXetoCit seems the bot doesn't reconnect automatically
23:40:51*johnsoft joined #nim
23:41:11BlaXpirit_def-, substr works indeed!
23:41:19BlaXpirit_now what about seqs?
23:41:38def-BlaXpirit_: write your own sub proc with the behaviour you want at corner cases
23:41:40BlaXpirit_flaviu, substr is that thing you said
23:41:49BlaXpirit_def-, oh, write my own proc... sure
23:42:10BlaXpirit_flaviu, sorry, i keep pinging you instead of fowlmouth
23:42:24fowlmouthi said nothinga bout substr
23:42:44BlaXpirit_fowlmouth, "hi"[0, 1] is hi.substr(0, 1)
23:43:25BlaXpirit_wait, no, it isnt
23:43:44BlaXpirit_it's exactly what i wanted - [] without negative indices
23:44:08*Jesin joined #nim
23:45:30BlaXpirit_"[] considered harmful"
23:46:53*[dee]_ is now known as [dee]
23:47:10flaviuBlaXpirit_: I'm pretty sure substr(0, -1) works only be accident.
23:47:32flaviuhttps://github.com/Araq/Nim/blob/5979d35ab2052b467e89ade90a7b3a47a50e2a28/lib/system/sysstr.nim#L52-L61
23:48:47BlaXpirit_flaviu, ?
23:49:03BlaXpirit_all seems in order. what accident?
23:49:39BlaXpirit_it never does len-index
23:51:21flaviuThe documentation makes no mention of it, substr(0, -2) is undefined behavior, I think.
23:53:19BlaXpirit_to that i can agree
23:54:09BlaXpirit_but then again, documentation doesn't mention a lot :p
23:56:02fowlmouthwell it sounds useful
23:56:26fowlmouthi thought thats how most substr()s work
23:57:04flaviufowlmouth: for most substrings, "foo".substring(0, 0) == ""
23:57:11BlaXpirit_most substrs work with non-inclusive...
23:57:18BlaXpirit_or specify length
23:57:20Araqso make a PR and document it
23:57:36BlaXpirit_but that would go against language convention
23:57:44BlaXpirit_oh you mean documentation
23:57:46BlaXpirit_nvm
23:57:50fowlmoutho_O
23:58:38Triplefoxi am looking at sequence slices now...do we have an equivalent to substr
23:58:49BlaXpirit_i guess not but we can look
23:59:25Araqs[0 .. find(s, '.')] # whole string when no s has no dot at all
23:59:54Araqyou act lke the current behaviour is always undesirable, but it's not