<< 19-01-2015 >>

00:03:01*Mat4 left #nim (#nim)
00:08:21ekarlsohttps://bpaste.net/show/864a99d43f69 < would there be a better way to write / structure that
00:09:56BlaXpirit_earlier someone told you to use enum
00:10:30ekarlsoyea, but how the crap do you map a string to enum ?
00:12:19BlaXpirit_you should read the manual, once and for all
00:12:21BlaXpirit_http://nim-lang.org/manual.html#enumeration-types
00:13:44BlaXpirit_hmm actually this is not very useful
00:16:41flaviuekarlso: make a table[string, enum]
00:17:29flaviulol, I tried adding a debugging statement in alloc.nim, but it requires gc'd memory :P
00:20:27EXetoCwith cstrings too?
00:20:37EXetoCnvm
00:22:01ekarlsoy awesome flaviu ...
00:22:13ekarlsoflaviu: that worked very nicely :P
00:22:21flaviugreat!
00:23:17def-ekarlso: you can initialize a table with toTable {key1: value1, key2: value2} btw
00:25:31ekarlsodef newTable({}) u mean ?
00:26:38ekarlsowhat would be uber to have would be MyEnum.toTable
00:26:46def-i guess both work
00:27:01ekarlsosince if it's a string u can {$enum: enum}...
00:27:10ekarlsoso it's kinda funky
00:27:19def-well, write your own toTable proc for that and it works
00:27:24ekarlsoheh
00:27:54BlaXpirit_weird stuff. https://bpaste.net/show/bf8b3e98cc18
00:28:16BlaXpirit_that's for ekarlso. indeed that's what you can do
00:28:22BlaXpirit_seems kinda verbose
00:29:19BlaXpirit_ekarlso, http://nim-lang.org/strutils.html#parseEnum,string :D
00:29:34ekarlso...
00:29:48def-yep, looks better
00:29:58*ekarlso throws table code into the hole and flushes
00:30:22BlaXpirit_ekarlso, https://bpaste.net/show/12e453d10e43
00:30:23def-at least for small enums and if speed doesn't matter much
00:30:51BlaXpirit_u get ValueError for free
00:31:03BlaXpirit_but u can wrap it in try: and throw your own exception, whatever
00:32:27*BlaXpirit_ quit (Quit: Quit Konversation)
00:32:35*brson joined #nim
00:32:44flaviudef-: If you find yourself worrying about speed, just remember that nim isn't interpreted ;)
00:33:07def-flaviu: still pretty slow to create all these strings
00:33:27flaviudef-: If it's a string literal, it's free.
00:34:29flaviuSo I'm trying to get the current PFrame, but I think that TLS is making things hard for me and GDB
00:34:29def-$e is a literal here?: https://github.com/Araq/Nim/blob/master/lib/pure/strutils.nim#L486
00:34:30*yonson quit (Quit: Leaving)
00:34:56flaviudef-: sorry, I misunderstood then.
00:37:07EXetoCekarlso: will not work for enums with holes though. it's an annoying limitation, which I assume will be dealt with
00:38:41EXetoCso it mostly applies to bindings I guess
00:38:45*Amrykid quit (Changing host)
00:38:45*Amrykid joined #nim
00:39:28EXetoCno wait, it should work, just that it'll iterate through every hole
00:39:53def-EXetoC: i think you can't iterate over enums with holes
00:40:22def-oh, you can
00:40:45def-then the manual is wrong
00:40:53def-It says here that you can't: http://nim-lang.org/manual.html#enumeration-types
00:41:34flaviudef-: A better way of phrasing that is that "iterating over an enum with holes is undefined behavior"
00:43:29def-good night
00:43:41ekarlsosomeone wanna write a jsonschema library ? :p
00:49:02ekarlsohow hard is it to implement b64 ?
00:51:22ekarlsoguess i'll have to try it out then ..
00:58:33ekarlsocan't a const be a object ?
00:59:24EXetoCnot atm
00:59:35ekarlsodoh
01:00:55*brson quit (Quit: leaving)
01:09:28*asomesom joined #nim
01:12:49*ARCADIVS joined #nim
01:31:26ekarlsohttps://bpaste.net/show/26041645d9c4 does that seem fair ?
01:31:41ekarlsoonly thing to fix is the "pad" part
01:33:52*davidhq quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
01:39:42flaviuI'm doing some testing on windows, but my user's home directory has spaces in it so things fail.
01:40:26flaviuHow have others gotten around that?
01:41:29*brson joined #nim
01:43:59asomesomdoes nimbot.nim need devel version of nim? I get an error when trying to compile it: https://github.com/nim-lang/nimbot/issues/1
01:44:37flaviuekarlso: I know the regular base64 module does that newline nonsense, but it's pointless and directly breaks the spec ("Implementations MUST NOT not add line feeds to base encoded data")
01:46:00flaviuBase64 Content-Transfer-Encoding requires newlines, but that's a niche usecase.
01:46:28flaviuI think the best solution is to turn off newlines by default, and then mention in the doccomment that they MUST NOT be used except for Base64 Content-Transfer-Encoding
01:48:07ekarlsoflaviu: would it be possible to get it into std base64 ?
01:48:09flaviuAlso, `CharSet* = enum` is a nasty way of using enums. Don't do that please.
01:48:39ekarlsowhy so flaviu ?
01:49:10flaviuBecause that string is supposed to be used for a printable representation. Use two named constants instead.
01:49:40ekarlsouh, o
01:50:15flaviuYou have the needle and haystack flipped on encode(Config, string)
01:51:09ekarlsohow so ?
01:51:34flaviuDecoding violates RFC 3548 §2.3.
01:51:46flaviuekarlso: It should be (string, Config)
01:52:08ekarlsouh, ok
01:52:49ekarlsowhat does that have to do with the order of args ?
01:53:11flaviuekarlso: The decoding spec violation is unrelated
01:53:56flaviuI would add a switch `ignoreUnknown` to toggle the non-conformant behavior and default it to on, just to make things simpler for the user.
01:54:42ekarlsogeh, would be really nice if someone would stab base64 for me..
01:54:52ekarlsohaving stuff to do in packages as well :&
01:55:43flaviuekarlso: Maybe tomorrow, I'm testing the packaging on my new NRE library.
01:56:08ekarlsoflaviu: would be awesome if you could or someone else..
01:58:52*Demos_ joined #nim
01:59:49*Demos__ joined #nim
02:00:33ekarlsoflaviu: so decode atm doesnt decode b64url either properly
02:00:38ekarlsowithout going boom
02:02:28*Demos quit (Ping timeout: 245 seconds)
02:03:39*Demos_ quit (Ping timeout: 264 seconds)
02:25:24*nimnoob joined #nim
02:25:56*Boscop joined #nim
02:27:13*onionhammer quit (Ping timeout: 272 seconds)
02:30:35*hasenj joined #nim
02:31:58dtscodeso i stumbled onto perhaps the most important piece of nim code
02:32:18dtscodeproc fuckIt[t](t arg) = discard
02:33:24hasenjnoob question regarding installation: on osx, I copied bin/nim to ~/bin/
02:33:38hasenjnow I'm trying to compile and install nimble
02:33:57dtscodeok
02:33:58hasenjbut I get an error: cannot open file ~/lib/system.nim
02:34:34dtscodeadd ~/bin to your search path
02:34:40hasenjit is on the search path
02:35:16dtscodehmmmm... so you have nim installed somewhere, and then a symbolic link to it in ~/bin?
02:35:20hasenjhttp://hastebin.com/lewuwecigo.rb
02:35:31hasenjI copied it, not symlinked it
02:35:36hasenjshould I symlink instead?
02:35:40dtscodeyes...
02:35:57dtscodeits not going to know where the libs are otherwise
02:36:05hasenjok
02:36:29hasenjI was treating the nim source directory as temporary/disposable
02:39:57*onionhammer joined #nim
02:40:48hasenjgot it, thanks
02:41:18*nimnoob quit (Remote host closed the connection)
02:53:17*VinceAddons quit (Read error: Connection reset by peer)
02:53:37dtscodeoh no no no
02:53:42dtscodeit is very neccesarry
02:56:23*nimnoob joined #nim
03:15:51*darkf joined #nim
03:16:31*brson quit (Quit: leaving)
03:16:57*BitPuffin quit (Ping timeout: 252 seconds)
03:16:58*brson joined #nim
03:19:24*JinShil joined #nim
03:19:56*kapil__ joined #nim
03:24:44*brson quit (Quit: leaving)
03:24:56*brson joined #nim
03:37:03*vendethiel quit (Ping timeout: 245 seconds)
03:38:49*vendethiel joined #nim
03:41:32*EXetoC quit (Ping timeout: 245 seconds)
03:45:51*brson quit (Quit: leaving)
03:54:08*asomesom quit (Quit: Page closed)
04:02:17*fowl joined #nim
04:05:00*jpoirier quit (Quit: Leaving)
04:15:17*BitPuffin joined #nim
04:20:27*BitPuffin quit (Ping timeout: 276 seconds)
04:23:42*vendethiel quit (Ping timeout: 276 seconds)
04:28:23*vendethiel joined #nim
04:29:37*nimnoob quit (Quit: Leaving)
04:44:40*EXetoC joined #nim
04:52:04*vendethiel quit (Ping timeout: 264 seconds)
05:00:05*vendethiel joined #nim
05:23:31*JinShil quit (Quit: Konversation terminated!)
05:30:57*BitPuffin joined #nim
05:36:11*BitPuffin quit (Ping timeout: 265 seconds)
05:40:15*gmpreussner__ quit (Quit: Konversation terminated!)
05:58:05dtscodeMimbus, var foo: table[string, int
05:58:17dtscode.eval var foo: table[string, int]
05:58:21Mimbusdtscode: eval.nim(3, 9) Error: undeclared identifier: 'table'
06:17:24*hasenj quit (Quit: hasenj)
06:28:30*vendethiel quit (Ping timeout: 276 seconds)
06:58:27*vendethiel joined #nim
07:17:22*SplinterOfChaos quit (Ping timeout: 245 seconds)
07:19:39*BitPuffin joined #nim
07:24:23*BitPuffin quit (Ping timeout: 240 seconds)
07:26:52*pc joined #nim
07:30:37*pc left #nim (#nim)
07:31:33*jefus_ joined #nim
07:35:31*jefus quit (Ping timeout: 255 seconds)
07:37:14*JinShil joined #nim
07:37:24*Matthias247 joined #nim
07:42:32*vendethiel quit (Ping timeout: 246 seconds)
07:42:50*BlaXpirit joined #nim
07:44:56*Matthias247 quit (Read error: Connection reset by peer)
07:53:07*vendethiel joined #nim
07:57:15gokrGood morning!
08:00:13*Demos__ quit (Read error: Connection reset by peer)
08:05:37*JinShil quit (Quit: Konversation terminated!)
08:10:01*JinShil joined #nim
08:11:43*gunn_ joined #nim
08:12:03*gunn quit (Ping timeout: 245 seconds)
08:16:07*vendethiel quit (Ping timeout: 245 seconds)
08:22:36*Sphax joined #nim
08:25:47*vendethiel joined #nim
08:33:59*EXetoC quit (Ping timeout: 245 seconds)
08:35:58*Trustable joined #nim
08:37:03BlaXpiritI'm having a really hard time understanding what openarray is
08:37:28BlaXpiritfrom what i've read, all I can think of is "magic"
08:37:39gokrAFAICT openarray is just a special type that you can *only* use as a param type - and it covers both seq and regular arrays.
08:37:51gokrSo yes, definitely an oddball.
08:38:01BlaXpiritas i just find out, it also covers all iterables
08:38:09BlaXpiritwhich is awesome and I thought it didn't
08:38:13gokrOh
08:38:38BlaXpiritbut it's still kinda weird
08:38:48BlaXpiritit should be something like typeclass or whatever
08:39:25gokrI guess its a pragmatic thing - arrays are in the language itself, seq is... mmm, not sure actually, is it purely in the libs?
08:39:58BlaXpiritseq is definitely part of the language, because it has "magic" (literally this pragma) associated with it
08:40:14gokrRight, ok.
08:40:32BlaXpiritwait.. or does it? i actualy cant find any "magic"
08:40:46BlaXpiritoh yeah magic: "LengthSeq"
08:41:17gokrMmm, but I am guessing it may have been "meant" to be in the "libs only" and then perhaps magics creeped in.
08:41:29BlaXpiritoh i'm sorry, openarray is not what I thought
08:41:46BlaXpiritI used standard "find" function assuming it would be on openarray. but it actually isnt
08:42:38BlaXpiritdoes NOT work on iterables.
08:42:47gokrOk.
08:42:58gokrActually very few mentions of openarray in the libs
08:43:09BlaXpiritok then, so now I have a problem with openarray
08:44:48BlaXpiritthis beats me https://github.com/Araq/Nim/blob/master/lib/system.nim#L1802
08:45:11BlaXpirit`find` can operate on anything, then `contains` is based on it but uses openarray
08:46:34BlaXpiritthen there is the whole sequtils, with functions that could be completely universal, but accept only seq[T]
08:46:42*JinShil quit (Quit: Konversation terminated!)
08:48:05gokrIts not like the beautiful Collection hierarchy in Smalltalk - but I am guessing it has evolved like this - in order to match efficient C.
08:48:14BlaXpirit"efficient"
08:48:16gokrsequtils on the other hand, we can always make a better one.
08:48:28*JinShil joined #nim
08:48:29gokrs/match/produce
08:48:36BlaXpiritif you have to recreate arrays over and over and over
08:48:54*vendethiel quit (Ping timeout: 276 seconds)
08:48:59gokrI mainly meant the openArray vs seq thingy.
08:49:03gokrOk, gotta go, later
08:49:07BlaXpiritbye
08:49:28*JinShil quit (Remote host closed the connection)
08:52:08*vendethiel joined #nim
08:54:02dtscodehow come there isnt a python to nim translator?
08:54:15BlaXpiritare u trolling
08:54:24dtscodeis there one?
08:54:30BlaXpiritthere can't be
08:54:36dtscodehow so?
08:55:02dtscodeis nim not turing complete?
09:00:02*VinceAddons joined #nim
09:05:47dtscodeBlaXpirit, no go on... please tell me why it is not possible to compile one turing complete language to another
09:08:25*BitPuffin joined #nim
09:08:34gokrIts not that it can't be done - but a) its huge work if you want it to actually work on larger codebases and b) Nim is different so ... do you really want Python-ish Nim code? and c) please go ahead and write it :)
09:09:09BlaXpiritso there is one Python compiler... it took a huge amount of work, and still depends on CPython
09:09:15dtscodeyes
09:09:41BlaXpiritdon't forget that we're talking about one of the most popular languages here
09:09:43gokrAnd further - what is the end goal? Useful Nim sources or "just a lib I can call"?
09:09:57dtscodei knew it could be done. i was just curious why BlaXpirit thought otherwise. and yeah thats why i figured there wasnt one gokr
09:10:06gokrIf you just want to be able to "call" Python code - then that's doable in many ways.
09:10:28dtscodethe reason i wanted one is because im translating some python to nim, and its going terrible since im having issues manually figuring out the types
09:10:43BlaXpiritoh it's a lot of fun
09:10:53BlaXpiriti just ported a library
09:11:20BlaXpiritluckily the OOP used in it was pure enough, no duck typing really
09:11:36dtscodethe code im porting is very much duck typed
09:11:46gokrdtscode: The reason for BlaXpirit's answer was probably since the question made it sound like it was a trivial thing.
09:12:11dtscodeoh no i wouldnt call anything of the sort trivial. frankly i was surprised that c2nim existed
09:12:47BlaXpirit"transform C into a language that compiles to C"
09:12:53BlaXpiritnothing surprising if you put it that way
09:13:14dtscode...
09:13:28dtscodejust because it compiles to c doesnt mean compiling backwards is just as easy
09:13:41*BitPuffin quit (Ping timeout: 265 seconds)
09:16:05gokrWell, c2nim ... it's not a full C translator. But it sure is a beast of a tool, quite impressive by looking at its source code.
09:16:36dtscodei need to go through the compiler one of these days... but for now, i will work on irc things, my site, and learning racket
09:35:16*vendethiel quit (Ping timeout: 264 seconds)
09:40:14*vendethiel joined #nim
09:42:14ekarlsoso, any of you guys wanna help with getting me a base64 url compliant ting ? :)
09:42:48BlaXpiritekarlso, but i gave u
09:56:43*despairblue joined #nim
09:58:00*despairblue quit (Client Quit)
09:58:13*davidhq joined #nim
10:00:36ekarlsoBlaXpirit: ah, the replace -,,-
10:00:51BlaXpiritit is as good as it gets
10:01:03ekarlsobut the newline stuff then ?
10:01:04*vendethiel quit (Ping timeout: 245 seconds)
10:01:10BlaXpiritbase64 module is shortsighted, what can i do
10:01:18BlaXpiritreplace("\n", ""), big deal
10:01:39ekarlsoah
10:01:44BlaXpiriti tried to find in irc logs when i gave you that code, but couldn't
10:03:45BlaXpiritno, ekarlso, wait
10:03:50BlaXpirityou should just supply newline=""
10:08:16ekarlsogreat, so nim can't decode eyJzdWIiOjEyMzQ1Njc4OTAsIm5hbWUiOiJKb2huIERvZSIsImFkbWluIjp0cnVlfQ since it's missing ==
10:10:52BlaXpiritekarlso, that's invalid base64 then
10:11:07ekarlsoBlaXpirit: nope it's valid b64url..
10:11:20BlaXpiritekarlso, but to fix it you can do: while s.len mod 3 > 0: s &= "="
10:11:26BlaXpiritpretty sure
10:11:56BlaXpiritand don't forget to do the character replacements both ways
10:13:04ekarlsoBlaXpirit: u mean in the base64 module ?
10:13:25BlaXpiritekarlso, no, i'm not saying to edit the base64 module directly
10:13:57ekarlsoI just appended == ..
10:14:16BlaXpiritbut it's not always going to be two ==
10:14:25ekarlsooh
10:14:30BlaXpirit-_-
10:14:35ekarlsothat's great :p
10:14:41BlaXpirit[:10:40] <BlaXpirit> ekarlso, but to fix it you can do: while s.len mod 3 > 0: s &= "="
10:14:46ekarlsook ok
10:15:30BlaXpiritstrange. that string has len mod 3 == 0
10:15:56ekarlsoI wish the base64 module had this fixed instea.d..
10:16:18BlaXpiriti don't see this last thing as a bug
10:16:33ekarlsothe base64url isn't supported atm ..
10:16:44ekarlsorust let's you pass in a "CONFIG" with stuff predefined
10:17:20BlaXpiritekarlso, i made a mistake. it's supposed to be 4. while s.len mod 4 > 0: s &= "="
10:17:44ekarlsohow the feck u go the other way around then ?
10:17:55BlaXpiritstrip("=")
10:17:57BlaXpiriti dunno
10:18:17ekarlso:'(
10:19:02BlaXpiritit's not so bad, man!
10:19:22BlaXpiritekarlso, do you still have the code for replacements that i gave u?
10:19:28ekarlsoye
10:19:36ekarlsoI scoured the irc logs :)
10:19:40BlaXpiritplease send it back, then i can assemble a complete solution
10:19:48ekarlsobase64.encode(s).replace('+', '-').replace('/', '_')
10:19:53BlaXpiritcool cool
10:20:17ekarlsobut really it should be possible to pass in which type of scheme u want
10:20:25ekarlsosince there's different ones :|
10:20:50*vendethiel joined #nim
10:20:52BlaXpiriti'm thinking of contributing to base64 later
10:27:43BlaXpiritekarlso, hmm, Python still gives the "="s with urlsafe_b64encode
10:28:21*gunn_ quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
10:28:36ekarlsoBlaXpirit: hmmms
10:28:46ekarlsohttp://jwt.io < that has a example
10:34:10BlaXpiritekarlso, https://gist.github.com/BlaXpirit/4c84e0ee0064e17d5f52
10:34:14BlaXpirittook me long enough.......
10:34:26ekarlsoBlaXpirit: thnx!
10:36:17ekarlsofunny that the jwt.io example has a invalid "sub"
10:36:25ekarlsoit's supposed to be "stringoruri"
10:37:00ekarlsodoes nim compile on ARM / Power8 btw?
10:38:13*gunn joined #nim
10:39:21Araqyes
10:41:37BlaXpiritis there any function to separate a string into chunks of some size?
10:41:56*vendethiel quit (Ping timeout: 244 seconds)
10:42:51BlaXpirit"abcde", 2 -> "ab", "cd", "e"
10:46:21AraqI heard re.split with a seperator of length 0 does some wonders here
10:47:00Araqsorry, I'm kidding
10:47:17BlaXpiritwell, it IS possible with that awesome new library
10:47:47BlaXpiritah with old one too
10:47:49*Araq still doesn't get why a splitter of length 0 is supposed to be possible
10:48:10BlaXpiritAraq, let me demonstrate then
10:48:29*Araq by that logic division by 0 should be allowed too
10:48:48BlaXpiritno srsly let me demonstrate... and that analogy is bad
10:49:19BlaXpirit"word word word".split(re"\b")
10:49:35BlaXpiritit is a serious bug that this does not work
10:49:51BlaXpiritthis returns 1 string
10:50:02Araqwhat should it return?
10:50:16BlaXpirit"word", " ", "word" etc
10:51:13BlaXpiritAraq, let me assure you that flaviu's library is majestic.
10:52:09Araq*shrug* that splitter is not ""
10:52:26BlaXpiritbut length 0
10:52:37Araqfair enough
10:52:39BlaXpiritand you just disregard it in that lib
10:52:46BlaXpiritas if it was nothing at all
10:54:52*vendethiel joined #nim
10:57:11*BitPuffin joined #nim
10:59:59Araqso make a PR that fixes it
11:01:48BlaXpiriti'm still having trouble figuring out the process
11:01:53*BitPuffin quit (Ping timeout: 240 seconds)
11:02:36BlaXpiritthe first tiny snag is devel branch. i only know how to do things in a fork and pull request through master branch.
11:02:51BlaXpiritbut the big one is, i dont know how to test my changes. do i need to build everything or what
11:03:28BlaXpiritwell for this case, i could just directly import that one file, obviously building the whole nim wouldnt be needed
11:03:42dom96Araq: How are channels implemented? Do they use anything that could be put into poll?
11:04:30Araqdom96: I think so, but bbl
11:04:42dom96This in regards to http://forum.nim-lang.org/t/769
11:04:46dom96*THis is
11:05:30dom96bbl too
11:16:32*BitPuffin joined #nim
11:35:11flaviuESTP's memory profiler is very useful
11:39:14*Sphax quit (Quit: ZZZZZzzzzz)
11:48:56reactormonkOk, I'm currently butchering nim with pargmas... how can I get the path of the file generated by the compiler for a specific file?
11:50:31reactormonkpreferably at compiletime.
11:51:46Araqyou cant
11:54:08*davidhq quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
11:59:09flaviureactormonk: You can probably hack around with currentSourcePath()
11:59:55reactormonkflaviu, that's only the source
12:00:49reactormonkAraq, let's see...
12:01:00flaviureactormonk: Sometimes it's a good enough 90% solution, although I don't know your situation.
12:03:37reactormonkActually, with a bit of emit, it should be doable with any other butchering
12:09:08*johnsoft quit (Ping timeout: 265 seconds)
12:09:41*johnsoft joined #nim
12:23:53*VinceAddons quit (Read error: Connection reset by peer)
12:35:47*Sphax joined #nim
12:37:07*BitPuffin quit (Ping timeout: 256 seconds)
12:49:29*gokr quit (Quit: Leaving.)
13:25:05*Sphax quit (Quit: ZZZZZzzzzz)
13:26:57*Sphax joined #nim
13:27:39ekarlsoError: internal error: GetUniqueType
13:27:41ekarlsohmmmf
13:31:23ekarlsomeh, syntax error :|
13:33:27ekarlsoarray[0..31, uint8] < is hex the most useful thing to convert that to ?
13:43:06*davidhq joined #nim
13:53:06*Boscop_ joined #nim
13:54:02*Boscop quit (Ping timeout: 245 seconds)
13:54:40*Boscop__ joined #nim
13:58:06*Boscop_ quit (Ping timeout: 246 seconds)
14:03:46*davidhq quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
14:04:19*davidhq joined #nim
14:08:59*davidhq quit (Client Quit)
14:11:33*karaboose joined #nim
14:15:19*j3rky joined #nim
14:21:46*Demon_Fox joined #nim
14:23:01*ARCADIVS quit (Quit: ARCADIVS)
14:28:27*BitPuffin joined #nim
14:30:13*gokr joined #nim
14:30:14*hasenj joined #nim
14:30:36*Pisuke quit (Quit: WeeChat 1.1-rc1)
14:31:57*hasenj quit (Client Quit)
14:34:18*jlebrech joined #nim
14:34:44jlebrechi'd like to code directly to the canvas on html with nim
14:35:10jlebrechi was thinking of nim+sdl+compile to js. that even possible?
14:39:53sillestasdl is a c library, don't think so
14:41:57ekarlsoflaviu: https://github.com/ekarlso/nim-jwt
14:42:08ekarlsostill missing some helpers but most of it is there
14:42:36flaviuIs https://github.com/ekarlso/nim-jwt/blob/master/src/private/utils.nim#L32 correct?
14:42:51flaviuShouldn't it be s.replace('+', '-').replace('/', '_')?
14:43:01ekarlsoflaviu:that's BlaXpirit's code ;)
14:43:09ekarlsojust copy paste :p
14:43:16BlaXpiritdang it, i forgot
14:43:22BlaXpiritsorry
14:43:31flaviuekarlso: Needs a nice fat test suite.
14:43:44ekarlsoflaviu: heh, well i've testing some of the stuff but :p
14:43:48ekarlsolike basics
14:44:06jlebrechsillesta: nothing like emscripten then?
14:44:37ekarlsoLooking for nim (>= 0.9.4)...
14:44:44ekarlsohow do you satisfy that ?
14:45:06BlaXpiritcmon... everyone is on 0.10.3 and you're...
14:45:48ekarlsoI've got my "packages" on the same directory level as nim
14:46:07ekarlsoi'm on devel BlaXpirit
14:46:15BlaXpiritok, that's 0.10.3
14:46:18BlaXpiritso what's the problem?
14:46:32ekarlsonimble install in a directory goes bork
14:47:41ekarlsoit goes looking for package nim then goes boom
14:51:20ekarlsoBlaXpirit: so really not sure why it fails
14:51:39BlaXpiriti havent encountered many problems with this whole system, so i dunno
14:51:50ekarlsoBlaXpirit: what directory structure u got ?
14:52:11BlaXpiritstructure of what?
14:53:02ekarlsoI mean, I got ~/projects/nim/Nimrod < compiler and ~/projects/nim/<package> so dunno if the structure there can foo it
14:59:00ekarlsohow can one require "nim" when it's not a package..
15:01:13ekarlsook so dont do "nimble install ." ..
15:02:14jlebrechi want a library that outputs to canvas or webgl?
15:02:47BlaXpirituse DOM, whatever
15:03:23*jefus_ is now known as jefus
15:10:50Araqjlebrech: Nim has its own JS backend, which for some things works better than emscripten and for some things worse
15:11:02*JinShil joined #nim
15:12:10jlebrechAraq: i'd like a subset of css or canvas or something to build upon, what do you recommend?
15:14:28BlaXpirityou can use the actual canvas, for one
15:14:49jlebrechoh that's good :D
15:15:01AraqI don't know what's out there, I would wrap the canvas myself and then use that
15:15:14jlebrechi'm thinking of coding something that ditches css really
15:15:40jlebrechor just a subset that's similar to sdl or allegro
15:15:55BlaXpiritwhat a weird combination
15:16:24jlebrechi mean if i have no choice to use css when it's on the web
15:16:26BlaXpiritif i'm already tied to a crummy browser, why limit myself even more with a compiled language
15:16:54jlebrechyeah, guess you make sense
15:17:16sillestasomething that emulates canvas on desktop could be cool
15:17:18BlaXpiriti'd ditch one of them for sure
15:19:09jlebrechsillesta: oh i see neat idea
15:20:02BlaXpiriti can only bet that there already is
15:27:06jlebrechi hate html/css/js and it's my job
15:27:37jlebrechi want complete control over with displays on screen
15:27:41jlebrechwhat*
15:28:02ekarlsohttps://github.com/ekarlso/nim-jwt/blob/master/src/jwt.nim < shouldn't I be able to import jwt and then use the toClaims function in private/jose ?
15:29:12ekarlsoor do you need to import that explicitly then ?
15:29:22*EXetoC joined #nim
15:30:53*Demon_Fox quit (Quit: Leaving)
15:31:33BlaXpirittoClaims*
15:31:57BlaXpirithm
15:32:10BlaXpirityou need to export
15:32:32BlaXpiritif you want everything public in a module to be exported in another module, you write export
15:33:45ekarlsoBlaXpirit: yeah I added export jose export claims
15:33:48ekarlsono luck
15:34:47*gokr quit (Quit: Leaving.)
15:35:57BlaXpiritis anyone available to accept https://github.com/nim-lang/packages/pull/116 ?
15:42:21*perturbation joined #nim
15:50:17*BitPuffin quit (Read error: Connection reset by peer)
15:50:43*Demon_Fox joined #nim
15:53:06*jpoirier joined #nim
15:57:01ekarlsoBlaXpirit: got a clue ?
15:57:05BlaXpiritno
15:58:10ekarlsook :p
15:58:13*BitPuffin joined #nim
15:58:40*perturbation quit (Ping timeout: 264 seconds)
16:01:36*kapil__ quit (Quit: Connection closed for inactivity)
16:01:55*perturbation joined #nim
16:18:51*Sembei joined #nim
16:32:29*darkf quit (Quit: Leaving)
16:35:02*davidhq joined #nim
16:37:08*davidhq quit (Client Quit)
16:39:14*davidhq joined #nim
16:44:43*davidhq_ joined #nim
16:46:15*davidhq quit (Read error: No route to host)
16:48:17*Matthias247 joined #nim
16:48:36*davidhq joined #nim
16:49:53*davidhq_ quit (Ping timeout: 240 seconds)
16:50:44*davidhq quit (Client Quit)
16:52:06*davidhq joined #nim
16:54:47*davidhq quit (Client Quit)
17:01:18*SplinterOfChaos joined #nim
17:05:30*threewood joined #nim
17:07:49*jlebrech quit ()
17:12:30ekarlso.eval @["1", "2"][1]
17:12:34Mimbusekarlso: eval.nim(3, 11) Error: value of type 'string' has to be discarded
17:12:56*VinceAddons joined #nim
17:21:57*jpoirier quit (Ping timeout: 245 seconds)
17:22:19*yonson joined #nim
17:22:52*karaboose quit (Quit: Page closed)
17:31:40*brson joined #nim
17:35:28*Sphax quit (Quit: CYA!!)
17:39:58flaviuhttp://forum.nim-lang.org/t/771
17:43:09*perturbation quit (Ping timeout: 245 seconds)
17:54:21*JinShil quit (Quit: Konversation terminated!)
18:09:22*Demos joined #nim
18:22:55ekarlsoflaviu: cool :)
18:23:18ekarlsoflaviu: https://nim-pkg.svcs.io:8080 your help in action flaviu and BlaXpirit (:
18:25:10flaviuekarlso: Nice, it works now!
18:25:29EXetoCsuch a memorable username
18:26:02*flaviu is now known as fadg44a3w4fe
18:26:09fadg44a3w4feEXetoC: Happy now?
18:26:45*repax joined #nim
18:26:47fadg44a3w4feEXetoC: Or do you perfer this name? :P
18:27:21*fadg44a3w4fe is now known as clkqaa0ijri1gkb
18:32:16*gokr_ joined #nim
18:32:46*nande joined #nim
18:33:20EXetoC:p
18:35:40*clkqaa0ijri1gkb is now known as flaviu
18:36:07*sampwing joined #nim
18:36:49dtscodei like clkqaa0ijri1gkb. that is a memorable username, and people will know exactly who you are talking about
18:37:55*dtscode is now known as clkqaa0ijri1gkb
18:38:05*clkqaa0ijri1gkb is now known as dtscode
18:39:09EXetoCunless someone named clkqaa0ijri1gka comes along
18:39:48dtscodefuck that guy. no one likes him
18:43:36*darkf joined #nim
18:43:46*darkf quit (Changing host)
18:43:46*darkf joined #nim
18:46:07*repax_ joined #nim
18:49:39*repax quit (Ping timeout: 246 seconds)
19:09:35*rpag joined #nim
19:09:44*Zekka joined #nim
19:10:01*Zekka left #nim (#nim)
19:21:38*gokr_ quit (Ping timeout: 245 seconds)
19:21:45*Jesin quit (Quit: Leaving)
19:26:48*Jesin joined #nim
19:31:42*jefus_ joined #nim
19:34:49*jefus quit (Ping timeout: 245 seconds)
19:36:25*pouledodue joined #nim
19:37:30*pouledodue left #nim ("Textual IRC Client: www.textualapp.com")
19:42:09*cryzed joined #nim
19:51:22Araqhi cryzed welcome
19:51:39cryzedhello
19:52:12*joecodes2 joined #nim
19:53:28*jpoirier joined #nim
20:00:53*BlaXpirit_ joined #nim
20:05:04*Sphax joined #nim
20:09:42*perturbation joined #nim
20:09:56*matkuki joined #nim
20:11:27*repax_ quit (Quit: repax_)
20:12:28matkukiWhy does "var temp: int = 200; echo($temp)" compile and "var temp: int = 200; echo $temp" doesn't?
20:12:40def-matkuki: because of the binding of $
20:13:02def-echo and temp become the arguments to $, like `$`(echo, temp)
20:13:23def-luckily you don't need the $ here anyway, all arguments to echo are stringified automatically
20:14:06matkukidef-: Oh, didn't know about the automatic stringification. Thanks!
20:18:00*zahary joined #nim
20:19:16EXetoCvarargs[expr, `$`]
20:21:00*bjz joined #nim
20:25:27*yonson quit (Ping timeout: 252 seconds)
20:32:39ekarlsoflaviu: now what then ? ;)
20:34:54*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
20:53:28*bjz joined #nim
20:55:15*BlaXpirit_ quit (Quit: Quit Konversation)
21:02:06*bjz quit (Max SendQ exceeded)
21:02:27*rpag quit (Quit: Leaving)
21:10:24*bjz joined #nim
21:18:15*bjz quit (Read error: Connection reset by peer)
21:26:52*bjz joined #nim
21:28:41def-Can't reach nim-lang.org and nimrod-lang.org. Known problem?
21:29:54def-Hm, I guess my provider's dns server is broken in some way, works with other ones
21:31:00*kniteli joined #nim
21:32:12BlaXpiritworks here for sure
21:33:50*Varriount|Laptop joined #nim
21:35:37perturbationstill up for me
21:37:32flaviuIt works for me, but it looks like it's in my DNS cache.
21:43:31BlaXpirituh oh
21:43:56BlaXpiritnot sure if this means DNS is completely down for nim-lang.org http://dnscheck.pingdom.com/?domain=nim-lang.org&timestamp=1421703617&view=1
21:44:19ldlework nim-lang.org works here
21:44:23ldleworkoh dns cache
21:45:52flaviuDoesn't look good: http://i.imgur.com/33Ylhnp.png
21:46:42EXetoCuh oh
21:47:33BlaXpiritD: not for this many days
21:48:01ekarlsowhat's that picture ? ^
21:48:30BlaXpiritbut google took a snapshot of nim-lang.org today
21:48:43BlaXpirit(well, it's not like they can't have a cache)
21:51:09*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
21:55:03Varriount|Laptopnim-lang.org is up for me.
21:55:28ekarlsoguess next is to add "releases" to it
21:56:20BlaXpiritus all checking it doesnt do much because we've seen it
21:56:22EXetoCflaviu: OS?
21:56:40flaviuVarriount|Laptop: It's up, but I'm not getting an authoritative answer on the location of the domain name
21:56:59EXetoCbut the browser caches I guess
21:57:10BlaXpiritjust tested on a different computer in my LAN that hasnt visited that website, and it works
21:57:34ekarlsois it parseopt2 again for cmd line options?
21:57:36BlaXpiritnow, for proxies
21:57:44BlaXpiritekarlso, or docopt :p
21:57:51ekarlsoBlaXpirit: that working ? ^
21:57:53BlaXpiritye
21:57:54flaviuhttps://gist.github.com/9911303ba8c1b4425368
21:58:00flaviusee how there is not authoritive answer?
21:58:13ekarlsoBlaXpirit: link ?
21:58:31BlaXpiritekarlso, http://github.com/docopt/docopt.nim
22:00:39BlaXpirithm, i may have messed up by changing the meaning of `$
22:01:31*sampwing quit (Ping timeout: 252 seconds)
22:01:47*gokr joined #nim
22:15:47ekarlsoBlaXpirit: how you access a string value ?
22:15:53BlaXpirit$
22:15:54ekarlsoI just get that it's a tainted string -,,-
22:16:01BlaXpirittainted string? :o
22:16:01ekarlso let cfgFile = $args["-c"]
22:16:23BlaXpiritI am not aware of this, please help me identify if this is a bug
22:16:35BlaXpiritmaybe better in private message...
22:17:09*Mimbus quit (Remote host closed the connection)
22:18:10*joecodes2 quit (Quit: Page closed)
22:18:18*sampwing joined #nim
22:18:37*joecodes2 joined #nim
22:19:52*flaviu quit (Ping timeout: 245 seconds)
22:24:09*flaviu joined #nim
22:25:02AraqI have the same DNS problems .... :-/
22:26:29ekarlsohow you change port for jester ?
22:28:10sillestahttps://github.com/dom96/jester/blob/master/jester.nim#L28 ?
22:29:21*cryzed left #nim ("Leaving")
22:31:31joecodes2ekarlso: var settings = newSettings(port = Port(1234))
22:31:59ekarlso.eval var foo = "" if true else ""
22:32:07ekarlsothat bot...
22:34:52flaviuekarlso: Sorry, I just restarted
22:35:10*Mimbus joined #nim
22:43:23ekarlsohmmms
22:43:29ekarlsohowto sys.exit(0) ish in nim ?
22:43:51EXetoCsee 'quit'
22:44:07BlaXpiritquit()
22:44:30flaviuekarlso: http://nim-lang.org/theindex.html#ui
22:46:18*perturbation quit (Quit: Leaving)
22:46:19BlaXpiritoh yeah, anchors are messed up
22:46:30BlaXpiritprobably someone wanted to get rid of ``
22:55:27sillestaBlaXpirit: does quit() clean up/collect garbage?
22:55:49BlaXpiriti can't guarantee you anything
22:56:00BlaXpiritbut i'm almost sure that it's just the same as normal program exit
22:56:51Araqit doesn't perform any "cleanup". it relies on the OS to do that
22:57:07*yonson joined #nim
22:57:40Araqthere are some OSes which don't do that, but these are not really "operating systems" but "UNoperating systems" ;-)
22:57:50sillestahehe
23:02:38*Sphax quit (Quit: CYA!!)
23:19:05*Matthias247 quit (Read error: Connection reset by peer)
23:19:50*matkuki quit (Read error: Connection reset by peer)
23:33:04sillestais it possible to interface with obj-c and create a osx window using just nim?
23:33:37dtscodewell you could create an interface using ffi's. it would still require obj-c though
23:33:48dtscodeyou might need cocoa bindings as well
23:35:17gokrsillesta: You could also take a look at the Nim QML stuff
23:38:25*JinShil joined #nim
23:39:50sillestagokr: looks like it's nim -> c interface
23:40:14gokrWhat I meant is that it enables Nim to integrate with Qt - and Qt supports OSX.
23:40:19Araqsillesta: you can compile to objective-c instead of plain C which lessens the pain somewhat
23:40:29sillestaoh
23:40:35sillestagotcha
23:41:21gokrsillesta: What are you trying to build?
23:41:27Araqinterfacing to objective C still is *not* easy this way, but we're getting there, I made extensions for C++ that will end up benefit objc too
23:41:45sillestacool
23:42:13sillestagokr: realized i've never tried "raw" windowing before, i should try it :)
23:42:28sillestagetting late though. good night
23:42:32gokrgnite
23:57:22joecodes2how to write a proc that returns a seq? this sigsegv's on me: proc t(): seq[tuple[s,e:int]] = result.add( (s:0, e:100) )
23:58:07dtscodeproc t(): seq[tuple[int, int]] = foo
23:58:11dtscodeiirc
23:58:23EXetoCyes, because you are not initializing result
23:58:35dtscodeoh duh
23:59:13EXetoCthere are plans to make 'add' "safe" in this regard (initialize if necessary)
23:59:48dtscodewhy doesnt it auto initialize if you dont?
23:59:49*Trustable quit (Remote host closed the connection)
23:59:56dtscodelike an implicit return 0 in c++?