<< 14-01-2015 >>

00:00:01Araq# "emit first or next parameter"
00:00:31Araqso we get things like #.foo<>()
00:03:55flaviuOk, looks good.
00:04:43Araqwell the '.' is special too as Nim is smart and sometimes uses '->' instead of '.'
00:07:55*sillesta quit (Ping timeout: 256 seconds)
00:08:04*Boscop_ joined #nim
00:08:41keyleAraq: where is the source of what you're referring to? Would love to take a look for learning purposes
00:09:02Araqkeyle: just wait for my commit
00:09:20*flan3002 quit (Ping timeout: 264 seconds)
00:09:20*flyx quit (Ping timeout: 264 seconds)
00:09:21*wan quit (Ping timeout: 264 seconds)
00:09:22*wtw quit (Ping timeout: 264 seconds)
00:09:22*ldlework quit (Ping timeout: 264 seconds)
00:09:22*flyx joined #nim
00:10:20*flan3002 joined #nim
00:10:53*Boscop quit (Ping timeout: 240 seconds)
00:12:20*ldlework joined #nim
00:12:23*wan joined #nim
00:12:51*wtw joined #nim
00:16:47*brson quit (Quit: leaving)
00:17:07keyleCan someone explain in layman's terms why gcc compiles to an older nim.exe than then requires cooking with Koch to be up to date?
00:19:46*endou______ joined #nim
00:20:34*Boscop__ joined #nim
00:21:43*Trustable quit (Remote host closed the connection)
00:24:02*Boscop_ quit (Ping timeout: 245 seconds)
00:26:43dts|pokeballjust out of curiosity, how come nim-lang.org doesnt have a favicon for the site?
00:28:57keyleit does <link rel="shortcut icon" href="assets/images/favicon.ico">
00:29:28*Boscop_ joined #nim
00:33:11*Boscop__ quit (Ping timeout: 252 seconds)
00:35:12*CARAM__ joined #nim
00:35:50dts|pokeballweird... chrome doesnt show one
00:36:10flaviuekarlso-: ping
00:36:25flaviuI have the header working, but for some reason I can't get consistent results.
00:36:58reactormonkIs casting to int the correct way to do pointer arithmetics?
00:37:43reactormonkor are pointers unsigned...
00:40:05keyledts|pokeball: does here, maybe try clean cache
00:40:13keyleor try incognito mode for testing
00:40:18dts|pokeballsure
00:40:27Araqreactormonk: nobody knows but I usually use -% and it works
00:43:56Mat4ciao
00:44:00*Mat4 left #nim (#nim)
00:48:43*Boscop__ joined #nim
00:50:15flaviuDoes https://gist.github.com/863a6c7947e51d1767ec return inconsistent results for anyone else?
00:52:46*Boscop_ quit (Ping timeout: 255 seconds)
00:56:32*Guest81214 quit (Ping timeout: 245 seconds)
00:59:10keyleAraq: what's broken about switch?
00:59:34Araqkeyle: the syntax.
01:00:00Araq'break' everywhere or else you get nice fallthrough
01:04:51keyleah I see
01:12:58*z1y joined #nim
01:19:19*VinceAddons quit (Read error: Connection reset by peer)
01:24:05reactormonkHow do I convert an unsigned integer to a signed one?
01:24:22Araqint(x)
01:24:53reactormonkmail is a cstring - is the operation let mailptr = cast[uint](ptr mail) correct?
01:25:19Araqthat's not even correct syntax
01:25:29reactormonkduh
01:25:32Araqremove the 'ptr' and then it might work
01:25:35reactormonkToo much SCala I'd say.
01:26:22reactormonkSeems to compile in the first pass, afterwards I've got some template problems
01:30:11reactormonkFixed. \o/
01:30:39*Ether-plays-4fun quit (Ping timeout: 264 seconds)
01:31:07*Ether-plays-4fun joined #nim
01:32:56*z1y left #nim (#nim)
01:33:48*z1y joined #nim
01:33:51*saml_ joined #nim
01:37:09*gmpreussner_ joined #nim
01:41:02*z1y quit (Ping timeout: 244 seconds)
01:59:42reactormonkAraq, is {.compile.} a toplevel pragma or can I use it in the scope of a proc?
01:59:54Araqtop level
02:01:07reactormonkCan I combine {.exportc.} and {.closure.}?
02:01:32reactormonkI'm trying to figure out how to pass the seq that the functions exported to C modify
02:02:12Araqwell nobody hinders you from using .exportc with .closure but it makes no sense I think
02:02:58reactormonkI could always use a global var, but the thought disgusts me
02:04:12reactormonkI might need to write some more extended C code.
02:04:34Araqyou need to write *less* C code
02:04:41Araqyou should write Nim instead
02:04:45reactormonkragel produces C code.
02:05:02Araqfix ragel
02:05:27gmpreussner_:)
02:05:30gmpreussner_howdy all
02:06:05ldleworksup
02:08:29*z1y joined #nim
02:12:51reactormonkAraq, ragel is GPL. The output is not licensed at all. Might that produce problems?
02:12:59Araqno.
02:13:54*z1y quit (Remote host closed the connection)
02:14:58*z1y joined #nim
02:17:29reactormonkAraq, the ruby codegen is 4.3k LoC. No thanks.
02:18:23Araqbut you don't need to write the backend in C with strcat. you can use Nim instead. :-)
02:18:31*no_name joined #nim
02:18:51EXetoCyeah why C
02:18:55reactormonkIt's cpp
02:19:27reactormonklet's see how well c2nim works on it
02:19:50*JinShil quit (Quit: Konversation terminated!)
02:20:31reactormonknot too well.
02:23:32Araqgood night
02:24:55*jefus_ joined #nim
02:26:22*jefus quit (Ping timeout: 255 seconds)
02:29:04*darkf joined #nim
02:32:18*reactormonk quit (Quit: Leaving)
02:41:09*JinShil joined #nim
02:41:29*Demon_Fox quit (Ping timeout: 256 seconds)
02:41:54*Demon_Fox joined #nim
02:46:44*Amrykid quit (Changing host)
02:46:44*Amrykid joined #nim
02:48:15*iivvoo quit (Ping timeout: 265 seconds)
02:48:16*EastByte_ quit (Ping timeout: 265 seconds)
02:48:32*EastByte_ joined #nim
02:48:45*dymk quit (Ping timeout: 265 seconds)
02:50:22*dymk joined #nim
02:53:48*iivvoo joined #nim
02:56:21*hguux_ quit (Read error: Connection reset by peer)
02:58:00*hguux_ joined #nim
03:02:19*BitPuffin quit (Ping timeout: 245 seconds)
03:13:40*Sergio965 quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
03:24:23*TylerE quit (Ping timeout: 244 seconds)
03:26:19*TylerE joined #nim
03:33:09*iivvoo quit (Ping timeout: 244 seconds)
03:33:30dom96https://news.ycombinator.com/item?id=8883791
03:34:43*nande quit (Remote host closed the connection)
03:36:35flaviudom96: It'd go faster if he pulled the try-catch out of the at hot loop.
03:36:50*Boscop__ is now known as Boscop
03:37:17*endou______ quit (Ping timeout: 244 seconds)
03:37:39*Boscop quit (Changing host)
03:37:40*Boscop joined #nim
03:38:24dom96It seems he built the Nim version with --opt:speed
03:38:26dom96and no -d:release
03:38:32onionhammerdom96 spammers
03:39:02dom96onionhammer: Yeah, I need to do something about that it seems.
03:39:15onionhammer:\
03:39:21onionhammerthat captcha isnt working I gues
03:39:51*endou______ joined #nim
03:40:08dom96onionhammer: it is, that user is doing it manually.
03:40:29onionhammerseriously...?
03:40:51*iivvoo joined #nim
03:41:46flaviulol, he can't be bothered to read the readme.
03:42:05flaviu[url=http://spamspam.com]blah blah[/url]
03:42:33dom96onionhammer: I think so.
03:43:02onionhammeri bet it's a bot..
03:45:02*z1y1 joined #nim
03:46:23keyleif it's a bot you'd get hundreds of spam
03:46:53*z1y quit (Ping timeout: 240 seconds)
03:46:58flaviuWhy not both? Maybe it's a human writing a bot.
03:49:10*dymk quit (Ping timeout: 244 seconds)
03:49:28*dymk joined #nim
03:49:41dom96I deleted that user.
03:49:50dom96And removed his posts.
03:50:23keylegood point, often they run tests over a few days to see how long the op gets them removed
03:50:28keylethen they unleash the scripts
03:51:36flaviudom96: Have you banned the IP?
03:51:48dom96no
03:52:20flaviuYou should probably also ban tor and public proxies from posting too.
03:53:54*z1y1 quit (Remote host closed the connection)
03:58:41*z1y joined #nim
04:03:11keyleNim has crazy speed, not sure why that guy recommends picking Rust for performance
04:03:23keyleBesides, developer performance ways more than anything...
04:04:51onionhammerwho?
04:06:39*saml_ quit (Ping timeout: 264 seconds)
04:06:51*nande joined #nim
04:08:17*iivvoo quit (Ping timeout: 244 seconds)
04:10:22*iivvoo joined #nim
04:11:19*brson joined #nim
04:20:41*Boscop_ joined #nim
04:22:12dom96keyle: Likely because he compiled with --opt:speed not -d:release
04:24:33*Boscop quit (Ping timeout: 252 seconds)
04:30:30*iivvoo quit (Ping timeout: 244 seconds)
04:32:15keyleonionhammer: was referring to https://news.ycombinator.com/item?id=8883791
04:33:22*iivvoo joined #nim
04:37:06*ARCADIVS joined #nim
04:40:58onionhammerah
04:41:25onionhammerhas anyone done the bench w/ -d:release?
04:49:35keyleno but it'd be sensible to reproduce his claims
04:57:53*iivvoo quit (Ping timeout: 244 seconds)
05:01:23*iivvoo joined #nim
05:03:18*keyle quit (Quit: leaving)
05:12:51*brson quit (Quit: leaving)
05:15:01*z1y quit (Quit: Leaving.)
05:37:38ldleworkplz plz plz plz plz plz
05:37:45ldleworkplllllllz, forward type declarations, plz
05:37:50ldleworkkthx.
05:43:51*gmpreussner__ joined #nim
05:44:04*gmpreussner_ quit (Ping timeout: 244 seconds)
05:47:22*BlaXpirit joined #nim
05:48:22*z1y joined #nim
05:48:32*z1y quit (Remote host closed the connection)
05:49:27*z1y joined #nim
05:56:36ldleworkI wonder if anyone can improve the times here: http://arthurtw.github.io/2015/01/12/quick-comparison-nim-vs-rust.html
05:59:16*BitPuffin joined #nim
06:03:43*BitPuffin quit (Ping timeout: 255 seconds)
06:10:19fowlldlework, yes
06:12:02fowlwrite it imperatively
06:12:23ldleworknot sure what that means to you
06:17:50gmpreussner__Rust syntax looks like crap. try to improve that :)
06:18:15ldleworksure, but I am interested in the performance
06:18:27gmpreussner__they're probably more advanced wrt optimization
06:18:27ldleworkI've seen benchmarks beating rust, but they were simplier benchmarks
06:18:46fowlwell theres superfluous allocation here
06:18:49gmpreussner__i wouldn't worry about it too much. if you're really interested, you should take a look at where exactly the time is spent.
06:21:02gmpreussner__it might help to look at the C code too
06:21:25gmpreussner__in the game of life test, unrolling some of the inner loops may work wonders
06:22:05ldleworksure but that's no good, who wants to unroll their own loops
06:22:20fowlanywhere you see toSeq can be optimized away
06:22:36ldleworkI only count that once
06:23:02fowltheres a line in the life example that creates 2 seqs to get a longest-line count
06:23:18ldleworkfowl: show him up!
06:23:36ldleworkthere's always the guy who comes by and optimizes the original benchmarks
06:23:41Triplefoxin that kind of "match over a 2d grid" situation i like to assume a 1d array so that iteration can be all in one go...however that's a basic data design thing
06:24:06ldleworkSure but the Rust does the same thing
06:24:15gmpreussner__note that the next() loop is pretty close to Rust. most of the extra cost goes into print()
06:24:16ldleworkI think fowl is identifying the right kind of changes
06:24:25ldleworkthe kind that come with unfamiliarity with the language
06:24:29ldleworknot algorithm optimizations
06:24:48ldleworkboth implementations seem to do roughly the same thing
06:24:49fowlyes this is written by someone who loves one-liners
06:24:50Triplefoxwell, i'm not that familiar with nim :p
06:24:54ldleworkthough I can't read Rust very well
06:25:02ldleworkTriplefox: :)
06:25:05Triplefoxi didn't even know the syntax "for y in 0.. <iy:" existed
06:25:12gmpreussner__i didn't either
06:25:16BlaXpiriti didnt
06:25:27gmpreussner__i figured it was a formatting error on his blog
06:25:27fowl`<`(n: int) is just n-1
06:25:38gmpreussner__:)
06:25:46BlaXpiritwaaaat
06:25:51BlaXpirithy
06:25:52BlaXpiritwhy
06:25:56Triplefoxdoes it map to high()
06:26:09fowlfor the iterator 0 .. <10 goes from 0 to 9
06:26:13Triplefoxcause i was using high()
06:26:45*iivvoo quit (Ping timeout: 244 seconds)
06:26:58ldleworkTriplefox: wait did you write that article?
06:27:21Triplefoxno
06:27:23ldleworkoh
06:27:26*ldlework rubs eyes
06:27:39ldleworkAlso, I wonder if we would ever consider pattern matching
06:27:57ldleworkit is admittedly nice
06:28:02BlaXpiritmeh
06:28:14BlaXpiritit's only nice when you have a lot of things like Option and whatnot
06:28:20ldleworkwe already have do syntax
06:28:36ldleworkmixing that with pattern matching results is a very readable structure is all
06:28:36BlaXpiritin nim it's needed very rarely
06:28:54ldleworkI don't see why Nim would affect how often you want to match
06:29:08BlaXpiritwell, exactly, it doesn't
06:29:19BlaXpiritRust, however, almost enforces it
06:29:21ldleworkright, so its nice to have pattern matching + do syntax
06:29:34ldleworkbecause it represents the underlying semantics, visually, quite nicely
06:29:52ldleworkone of the first things that made me go "oooh" to Rust's documentation when I first read them
06:31:02ldleworkBlaXpirit: rust enforces it, only in so much that other languages force you to use switch
06:31:20BlaXpirit...
06:31:24ldleworkBlaXpirit: except that with pattern matching you can represent certain match semantics much more sucinctly
06:31:52fowldont you have to pattern match to extract information from enumerations
06:32:37*keyle joined #nim
06:33:11fowlhow could you get the value held by Option<T> without it?
06:33:36Triplefoxhmm oh i get it now, i can use high() on a seq or array, but i can use < for an integer variable
06:34:01BlaXpiritTriplefox, well, you can use < on high as well :p but it's kinda pointless
06:34:18BlaXpirit<len is a bit more useful
06:34:20ldleworkfowl: well that doesn't seem bad really
06:34:22fowlhigh is just len-1
06:34:26*iivvoo joined #nim
06:34:28fowlso you could use < on len()
06:34:33ldleworkI want to add a patch for first and last
06:34:35BlaXpiritwell not really... arrays...
06:35:07fowlnobody uses that feature
06:35:13BlaXpiritlow..high is a nice idiom, because 0..<len is not always reliable
06:36:15*BlaXpirit wonders if access to seq.low is optimized to a constant
06:36:24BlaXpiritprobably is, just need to look at C code really
06:38:08BlaXpiritaand it is
06:39:20Triplefoxi appreciate having options for dealing with the off-by-one iteration problem
06:39:40BlaXpiritwhich reminds me
06:40:33BlaXpirit<s.len compiles to subInt(s_89021->Sup.len, 1) :(
06:41:05ldleworkhow could it compile a sequence's length to a const?
06:41:09BlaXpiritwhat did i expect though
06:41:10BlaXpirityeah
06:41:12BlaXpiritlol
06:41:18ldleworkoh okay, you were confused
06:41:19*gmpreussner___ joined #nim
06:41:24ldleworkI thought *I* was super confused
06:41:25*gmpreussner__ quit (Ping timeout: 244 seconds)
06:41:29BlaXpirit<5 is 4 yay
06:41:51Triplefoxit should be able to optimize an array that isn't 0..0
06:41:58ldleworkyeah
06:42:14BlaXpiritwell theoretically it could use <len and actually transform the loop to use < instead of <=
06:42:15BlaXpiritbut yeah
06:44:18*skyfex_ joined #nim
06:44:22ekarlso-any of you doign webdev with nim ?
06:44:55ldleworkekarlso-: seems light a nightmare right now
06:45:20ekarlso-ldlework: howso ? :p
06:45:24BlaXpiriti really think it's never going to be anywhere near the best tool for the task
06:45:42BlaXpiritI'm totally happy with Python in many applications, and I'm gonna keep it that way
06:45:50ldleworkekarlso-: comapred to the nice ecoystem in Python?
06:46:03ekarlso-ldlework: by all means :)
06:46:08ekarlso-yeah, I use mostly python too :|
06:46:16ekarlso-or dropwizard for that matteR*java*
06:46:18ekarlso-:D
06:46:31ldleworkI mean I probably wont even consider it until there is something like jinja2
06:46:33fowli decided a long time ago that i dont do web work. now i laugh when my friends complain about working with rails and javascript. suckers.
06:46:57ekarlso-ldlework: though the whole packages program is written in nim
06:47:00ekarlso-about 600 ish lines atm
06:47:02ldleworkyeah I'm glad I've shifted away from it too
06:47:36ldleworkekarlso-: I think writing api's in Nim might eventually be workable
06:47:54ldleworkbut like actual web-applications? Its def not there right now.
06:48:11Triplefoxfor single components that have to scale vertically nim might be an easy sell to python coders...for the whole stack, yeah, there's other things to worry about
06:48:35ekarlso-some people got me to code it in nim :p
06:48:36keyleif jester works as advertise, nim should be a fine web server
06:48:36ldleworkI mean, I'm a Python professional, I'm constantly resisting the urge to reach for Nim in the workplace
06:48:38ldleworkSo I dunno
06:48:44ldleworkI mean, I basically do all my system scripting in Nim now
06:48:51ekarlso-ldlework: +1, I use python for openstack ..
06:49:13ldleworkIf Nim had a Fabric equivalent, it'd be curtains for Python on that front
06:49:59keyleas a python professional, can't you just write your python bottlenecks in nim and keep writing python?
06:50:10keyleso you get stable + fast
06:50:55Triplefoxnim can also get a more straightforward story for deploying than pretty much any scripting runtime...make static binary, ship it
06:51:43ekarlso-anyone have suggestions on how I can get JWT into nim ?
06:52:16keylejava web toolkit ?
06:52:32ekarlso-json web token
06:53:28*AMorpork is now known as ZzZMorpork
06:58:06ekarlso-would be nice to have for tokens :|
07:01:59*VinceAddons joined #nim
07:07:21*atomic-hedgehog quit (Ping timeout: 252 seconds)
07:08:26ekarlso-what's the equiv of char* key = "012345678"; in nim ?
07:09:08*endou______ quit (Read error: Connection reset by peer)
07:10:12Triplefoxuh, look at cstring. i forget if you need to introduce a pointer with addr() or not for that
07:10:54ldleworkkeyle: the thing is, I like /writing/ Nim more than I do Python (theoretically). Having the compiler tell me about errors before I actually try it out, is really really nice.
07:10:57*endou______ joined #nim
07:11:19ldleworkkeyle: I'm only slightly less productive in Nim than Python and that's jsut experience and sharp corners in a growing Nim.
07:11:27keyleI agree. I prefer static types
07:11:46ldleworkperformance is a secondary concern, at least for system scripting
07:11:50keylecoming from python though you have a huge advantage
07:11:59ldleworkkeyle: which advantage is that
07:12:00Triplefoxstatic types are a little annoying because of the ... typing but otherwise a big help
07:12:04keylesyntax is very similar
07:12:12ldleworkkeyle: ah, a bit
07:12:26keyleunless you do funky stuff in nim
07:12:52keyleTriplefox: when you come from Java you can really appreciate the terse type defs :>
07:12:56ldleworkits like pascal and python had a baby
07:13:03keylehaha
07:13:18keyleI picture this old man and that young girl
07:13:43keyleI read that python is adding type defs in the future, I'm guessing that's to help performance
07:14:04keylenot for the pleasure of typing more
07:15:16Triplefoxi tend to get irritated now by functions and methods that aren't annotated at all
07:15:21ldleworkits 'gradual typing'
07:15:41keyleTriplefox: can you just define the expectation by using prefix?
07:15:48keylestr_name
07:16:00keyleint_ae
07:16:02ldleworkbut what happens when you don't follow it on accident
07:16:04keyleint_age
07:16:13Triplefoxit's unreliable, and now your variables are longer
07:16:14ldleworkor you pass a prefixed var to the wrong function
07:16:19keyleWell you're using a dynamic language, that's to be expected
07:16:21ldleworkthe whole point is the compiler is helpful
07:16:23ldleworkit isn't a burden
07:16:35keyleI agree
07:16:42ldleworkthe amount you have to type is nominal compared to running your program over and over with runtime debugging
07:16:52keylebut I can appreciated both dynamic and staticly typed languages for what they are
07:17:05ldleworkI agree, I mean I came to Python because of its productivity
07:17:13Triplefoxa big benefit of the dynamic structure is that you can write some very dense things, it's not worth throwing that away for faux-typechecks unless the codebase has gotten into serious trouble
07:17:15ldleworkBut I wonder if Nim is competitive...
07:17:19keylein a large team though, dynamic languages are a pain in the arse and you end up with strict code conventions
07:17:20ldleworkeven being statically typed
07:17:35ldleworkThe most amazing thing about PYthon
07:17:39ldleworkis the insane abstractions I can create with it
07:17:51ldleworkusing the magic of everything being an object
07:17:52keyleI did Groovy for a while, I can tell you it's nice, but nim is much nicer.
07:18:02keyleno fn@#$ JVM to start with
07:18:04ldleworkbut with Nim's metaprogramming and operator overloading, I can do a lot of the same stuff
07:18:09ldleworkbut with type safety :P
07:18:26keylenim is like that tiny gun from star trek
07:18:39*gour joined #nim
07:18:49keyledoesn't look like it but it's very powerful
07:18:59ldleworkdunno
07:19:08ldleworkNim looks like the average of mainstream languages
07:19:20ldleworkIts featureset is a good collection of the feature's we've come to expect
07:19:33ldleworkIt gives us good implementations of each, and tries to make them work together well (theoretically)
07:19:44ldleworkand then it adds some small improvements
07:20:27ldleworkdeclarative type-classes, imperative ast macros, disjoint concurrency proofs, a very nice gc
07:20:54ldleworkSo when I look at Nim, and see everything I've come to expect from a fully featured general purpose language, it immediately communicates powerful to me.
07:21:41ekarlso-what type is "pointer" in nim vs ptr ?
07:21:57ldleworkekarlso-: ptr is a non-gc managed heap reference
07:22:06ldleworkref is a gc-managed heap reference
07:22:24Triplefox"pointer" is equivalent to C void* while "ptr ___" is typed
07:22:34ldleworkoh okay
07:22:35keylecool I didn't know
07:22:48keyle<- 7 days of nim
07:22:50ldleworkno idea what a Nim void ptr is
07:22:56ldleworkkeyle: welcome
07:23:04ldleworkkeyle: what do you think you'll use Nim for?
07:23:20keylesmall stuff
07:23:33keyledid this already https://github.com/keyle/hastebin/
07:23:40keylefor funsies & learning
07:23:45Triplefoxah, i like hastebin
07:23:49Triplefoxif only because of the name
07:23:55*joecodes joined #nim
07:24:58keyleit was a great way to touch http post, json parsing, exec, parseopts...
07:25:17keyleAnd no JVM / CLR / crap to have pre-installed
07:25:47Triplefoxi'm going to write a spritesheet packing tool soon and need to figure out my cli parser story soon
07:26:02keyleI work in a world of bloated monolithic software so, nim is like a fresh orange juice break
07:26:37keyleI'd love to do a text editor like joe/nano but the terminal support is ehm
07:26:45keylenot quite portable
07:26:56keyleehm I shouldn't say that.
07:27:08keylelet's just say it'd take a lot more than I'd want to commit to
07:27:43Triplefoxi think someone brought that up the other day...well, full control over terminals seems to be a pain no matter what
07:28:07keyleyeah Windows particularly
07:28:15Triplefoxmaybe one like "ed" or "debug" would be an easier starting point
07:28:49*nande quit (Remote host closed the connection)
07:28:53keylei don't even know how to poll for a shortcut key on windows CMD
07:29:03keylemight not even be possible or deep down in winapi
07:29:47*iivvoo quit (Ping timeout: 244 seconds)
07:30:20keylealso would love to do a _modern_ alpine style email client
07:31:15Triplefoxi liked pine, elm, etc.
07:31:24Triplefoxmaybe nostalgia
07:31:31keylesame here :)
07:34:29ekarlso-how the crap you create a pointer then ;)
07:35:55Triplefox.eval var a = [1,2,3]; var p = addr(a[0]); echo(p[])
07:35:59MimbusTriplefox: 1
07:36:16Triplefoxp is the pointer to index 0 of a
07:36:23Triplefoxthen i dereference it with []
07:37:26*iivvoo joined #nim
07:37:53ekarlso-Triplefox: what would be the equiv of char* key = "012345678"; then ?
07:38:10Triplefoxhmm let's try a thing
07:38:26Triplefox.eval echo(cstring("012345678"))
07:38:29MimbusTriplefox: 012345678
07:39:08Triplefoxyeah, cstring coerces to char*
07:39:38Triplefoxhttp://nim-lang.org/manual.html#cstring-type
07:45:10ekarlso-this ssl hmac ptr stuff is driving my head crazy
07:45:10Triplefoxwant me to gaze at the api
07:45:10ekarlso-https://gist.github.com/flaviut/38001b3b71d4c42e414f < flaviu left this for me yesterday ;P
07:45:36Triplefoxoh boy
07:45:46ekarlso-;P
07:46:05Triplefoxi wonder what a "d: cstring" is
07:47:11Triplefoxokay http://www.openssl.org/docs/crypto/hmac.html
07:47:20ekarlso-:)
07:48:47Triplefoxwhat is EVP_MD
07:49:06*gmpreussner___ quit (Ping timeout: 244 seconds)
07:50:18ekarlso-good q ..
07:50:24ekarlso-I'm fairly fresh on crypto stuff
07:50:50ekarlso-evp_md can be EVP_sha1(), EVP_ripemd160() etc.
07:51:01Triplefoxthere is example code here, this deserves study http://www.openssl.org/docs/crypto/EVP_DigestInit.html
07:52:18Triplefoxit looks like here the pointer "md" is initialized by EVP_get_digestbyname...i.e. we aren't setting an address in our own code
07:52:54Triplefoxlikewise mdctx
07:56:19ekarlso-Triplefox: how we solve that ? sorry but when it comes to pointers etc I really am lost
07:56:41Triplefoxwe're calling API functions which allocate memory and return pointers
07:56:58Triplefoxin that example: md = EVP_get_digestbyname(argv[1]);
07:57:11Triplefoxand then: mdctx = EVP_MD_CTX_create();
07:57:23Triplefoxfor HMAC, there are also init functions it looks like
07:58:18Triplefoxthe nim bindings don't look complete enough to do all of this yet
07:58:48Triplefox(or i'm missing something about how bindings work in nim which is entirely possible)
07:59:30ekarlso-think i'll wait for flaviu to come around ;P
07:59:36Triplefoxprobably a good idea
08:00:49Triplefoxgrokking nim pointers, also worth it. you'll feel like a Real Systems Programmer
08:01:36ekarlso-Triplefox: how you mean ? :)
08:02:22Triplefoxcause then you see the relationship between the flat memory layout and all the fancy indirection in data structures
08:04:02ekarlso-Triplefox: i thought c wrappers was easy ;P
08:06:29Triplefoxwhen you deal with c you have to deal with low-level memory stuff, nim makes this easy by passing the problem on to you...which is good cause then there's no mismatch
08:13:55*Demon_Fox quit (Quit: Leaving)
08:17:43ekarlso-so Triplefox the "d" is the data you're gonna encrypt
08:19:12ekarlso-or so ..
08:19:43*HakanD joined #nim
08:20:08ekarlso-Triplefox: but theb there's the key pointer thing. how the stuffs do you create a pointer.
08:21:10Triplefoxi've said everything that needs to be said on the topic.
08:22:03ekarlso-fair enough..
08:25:39*sdw quit (Read error: Connection reset by peer)
08:40:06*HakanD quit (Quit: Be back later ...)
08:40:52ekarlso-Triplefox: how you deref a pointer type then vs a ptr ?
08:43:01Triplefox.eval var mypointer : pointer; var a = 100; mypointer = addr(a); echo(cast[ptr int](mypointer)[])
08:43:04MimbusTriplefox: 100
08:44:04Triplefoxthe only difference between pointer and ptr is what the compiler thinks they represent, so you cast from one to the other to tell it what to expect
08:45:20*Sphax joined #nim
08:45:25*Trustable joined #nim
08:48:46*Trustable quit (Remote host closed the connection)
08:49:17*JinShil quit (Quit: Konversation terminated!)
08:50:54*Trustable joined #nim
08:54:32ekarlso-Triplefox: but is the pointer type more low level then ptr ?
08:55:25*z1y left #nim (#nim)
08:55:32Triplefoxit's "less typed". it just says that some kind of memory address is there, but not what it's supposed to mean when it's dereferenced
08:55:53Triplefoxa ptr int means that when i dereference, i am getting an int back from that
08:56:07ekarlso-cause the compiler knows that it's a int...
08:56:10ekarlso-ok I get it
08:56:31ekarlso-and to convert from a "pointer" u need to cast[ptr foo] = somePointer
08:56:43Triplefoxyeah
09:04:18Triplefoxhmm freeimage is complaining it can't import FreeImage_Initialize
09:08:16Triplefoxmaybe binding is just out of date
09:10:32*dymk quit (Ping timeout: 244 seconds)
09:12:10ekarlso-so, what's csize then ?
09:12:32*dymk joined #nim
09:12:36*SplinterOfChaos quit (Ping timeout: 244 seconds)
09:13:01Triplefoxi've never seen it
09:13:28EXetoCsize_t
09:13:34EXetoCcsize* {.importc: "size_t", nodecl.} = int
09:14:17Triplefoxsomeday i'll have to bother learning how to do my own bindings...i'd like to get the stb libs in there
09:16:38*gokr joined #nim
09:21:51*sillesta joined #nim
09:22:17ekarlso-well Triplefox one step forward -,,-
09:24:54ekarlso-https://bpaste.net/show/0476a85f4005 < hmac.nim https://bpaste.net/show/ddbf0c39247b < result of nim c -r hmac.nim
09:25:07ekarlso-does procs need to have a diff name maybe ?
09:25:31*dymk quit (Ping timeout: 244 seconds)
09:27:03*dymk joined #nim
09:29:30Triplefoxthose errors are new to me
09:29:34Triplefoxi don't know
09:30:15ekarlso-Triplefox: ok :)
09:31:07*Jehan_ joined #nim
09:39:59*dymk quit (Ping timeout: 244 seconds)
09:44:07*dymk joined #nim
09:57:51EXetoCwhy are you emitting includes? isn't that the source of the collision?
10:01:48ekarlso-EXetoC: tbh I dont know :) it's based off of what flaviu gist'd
10:05:06EXetoCyou're essentially defining your own declarations here. omit those and see what happens
10:16:55ekarlso-ah ok
10:21:08ekarlso-EXetoC: you mean the importc stuff ?
10:23:36EXetoCekarlso-: the includes
10:27:18ekarlso-dang EXetoC, that worked!
10:27:49EXetoCgreat
10:27:54EXetoChe probably just tested something
10:36:46*MajorTennis joined #nim
10:37:04*MajorTennis quit (Changing host)
10:37:05*MajorTennis joined #nim
10:40:57*dymk quit (Ping timeout: 244 seconds)
10:42:11*dymk joined #nim
10:42:49*HakanD joined #nim
10:51:23*JinShil joined #nim
11:06:59*HakanD quit (Ping timeout: 244 seconds)
11:07:27*HakanD joined #nim
11:07:28*lesshaste joined #nim
11:07:29lesshastehi all
11:07:39Araqhi lesshaste welcome
11:07:48lesshastehi Araq
11:17:03EXetoChola
11:18:00*gour_ joined #nim
11:20:56*gour quit (Ping timeout: 244 seconds)
11:21:09*dumbrun joined #nim
11:28:42*gour_ is now known as gour
11:36:08flaviuekarlso-: oops
11:36:14flaviuI gisted the wrong file
11:36:33flaviuhttps://gist.github.com/3e0b5a52fe9395fcf5c5
11:36:35*ARCADIVS quit (Quit: ARCADIVS)
11:38:30*skyfex_ quit (Ping timeout: 244 seconds)
11:39:28*yonson joined #nim
11:40:10*dumbrun quit (Ping timeout: 246 seconds)
11:40:37*VinceAddons quit (Read error: Connection reset by peer)
11:41:28sillestagood morning
11:48:21*dude joined #nim
11:48:45*dude is now known as Guest41089
11:49:18*Guest41089 is now known as someDude
11:51:02*someDude left #nim (#nim)
11:51:37*[dude] joined #nim
11:53:01*edsc joined #nim
11:53:17*endou______ quit (Ping timeout: 244 seconds)
11:53:54*endou______ joined #nim
11:55:50[dude]Hi everybody!
11:56:06Araqhi [dude]
11:56:19[dude]quick questions... I was trying to install c2nim through nimble just now...
11:56:30edscHi
11:56:34Araqyes, it's broken. we know
11:56:48Araq[dude]: it's hard to fix unfortunately
11:57:12Araqc2nim uses large parts of the compiler
11:57:39[dude]alrighty!
11:58:41[dude]was just trying to see if I can generate a libuv wrapper. I think found one someone created/generated for 0.11.x
11:58:45[dude]I'll give that a go...
11:58:47Araq[dude]: http://forum.nim-lang.org/t/738
11:58:56Araqdescribes how to setup c2nim
11:59:37edscI have a question as well. i iterate over a string to parse every char in it but parseInt take a string in parameter. I would like to know what is the best way to cast it. thanks. it
12:00:16Araqedsc: just use parsutils.parseInt instead. that one fits a parser.
12:01:17*matkuki joined #nim
12:03:32[dude]Araq: I'm not sure if the post mentions how to compile c2nim ATM. I'm having trouble with 1. grabbing c2nim from nimble and 2. compiling c2nim via source. =(
12:04:18Araq[dude]: you need c2nim and nim in the same directory. nim should be 'devel' from github
12:04:33Araqand then you do:
12:04:44Araqcd c2nim
12:04:47Araqnim c c2nim
12:05:01*nercury joined #nim
12:06:05Araqif 'nim' is in /usr/bin where do nim's sources usually end up?
12:09:34*Sphax quit (Quit: ZZZZZzzzzz)
12:10:42BlaXpiritAraq, possibly nowhere
12:11:17AraqBlaXpirit: yeah sure but *if* it exists
12:11:29BlaXpiritcould be anywhere :s
12:11:56Araqso the compiler has no chance to setup '$nim' properly
12:12:21BlaXpiritthe structure of the project is quite weird
12:12:31BlaXpiritno wonder package maintainers don't know what to do
12:13:13EXetoCso, do we introduce /usr/lib/nim/compiler?
12:13:23BlaXpiritthat would be best, I think
12:13:46Araqnah, I'll make the compiler's source a pseudo Nimble package
12:14:01Araqbut I dunno how lol
12:14:22BlaXpiritAraq, here's one package if you care to look inside it https://www.archlinux.org/packages/community/x86_64/nim/download/
12:15:46edscAraq, I was trying to know how to convert a char because each character need to be pase individualy and when I iterate I get a char and not a string which result in a missmatch.
12:15:59lesshastehow large is the development team these days?
12:16:46lesshasteI mean for nimrod
12:17:04Araqlesshaste: hard to say. for the compiler itself 3 people, but I still do most of the work :P
12:17:13lesshasteAraq, oh!
12:17:21lesshasteAraq, well in that case... a double hello :)
12:17:44lesshastedo you have a feeling for how many people program in nimrod?
12:17:47Araqfor the stdlib there are a couple of contributors
12:17:55lesshasteit really sounds like very few
12:18:12lesshasteunless you work 18 hours a day on it :)
12:18:45lesshasteor 180 hours a day
12:18:57MyMindAraq: nim is a full time job for you ?
12:19:53lesshastewe need more nimrod codes on codegolf.se :) E,g, http://codegolf.stackexchange.com/questions/42215/program-a-racing-car
12:20:08AraqMyMind: no, I have a real job too. :-)
12:21:11MyMindunless you get sponsored :)
12:21:41Araqwell depending on how you look at it, this already happened.
12:22:14lesshasteactually a nimrod answer for http://codegolf.stackexchange.com/questions/44278/debunking-stroustrups-debunking-of-the-myth-c-is-for-large-complicated-pro would be very nice
12:22:38dom96ekarlso-: What are you using hmac for?
12:22:39MyMindby whom Araq ?
12:24:41AraqMyMind: I'll announce it officially in some weeks. then I will also have to show you guys exciting new stuff.
12:24:55MyMindwow
12:25:04edscI found my mistake, i forgot to use the stringify operator '$' :/ .
12:25:07MyMindthat's exicting
12:25:48MyMindAraq: for the 1.0 release ?
12:26:09AraqMyMind: mostly orthogonal to 1.0.
12:26:38MyMindwhat means orthogonal besides a geometric form?
12:27:08AraqBlaXpirit: ok, so no compiler sources in packages, got it.
12:27:24BlaXpiritAraq, my test sample consists of 1 distro though :|
12:27:45Araqwell technically that *is* the proper way to do it
12:28:00sillestahow does the "parallel:" on the nim-lang.org site work?
12:28:51Araqsillesta: at runtime it produces a barrier
12:29:16sillestais it in a specific module?
12:29:49Araqat compiletime it tells the compiler "DSL with special rules". it's builtin but pretend to be in threadpool
12:30:03EXetoCcan the compiler be turned into a package with the current package system?
12:31:22BlaXpiritEXetoC, what do you mean
12:31:35BlaXpiritcan a folder with .nim files be turned into a package?
12:31:38BlaXpiritsure it can
12:32:34*yonson quit (Quit: Leaving)
12:33:58EXetoCI meant, using the current directory structure, but maybe the compiler interface should be separated from everything else
12:34:25BlaXpiritthere is no logical place to put it in, except lib
12:34:41BlaXpiritand yes, i'm pretty sure you can do it as a separate package
12:34:48BlaXpiritbut it would be an unpopular decision
12:34:59BlaXpiritit shouldn't be difficult to just copy a folder
12:35:00EXetoCthat's what he wanted, but ok
12:35:19EXetoCI don't know what's wrong with installing it along with everything else though
12:35:41BlaXpiritit's not "wrong", it's just that it is not specified anywhere
12:35:55BlaXpiritpackage maintainers simply can't know that the compiler files may be needed at all
12:36:10keyleAraq: very excited at this prospect, 1.0 stuff
12:36:32keylenight
12:36:33EXetoCit's just a simple modification then
12:36:41*keyle quit (Quit: Morbo: Chitchat achieved!)
12:36:52BlaXpiritEXetoC, why don't you try
12:36:52AraqBlaXpirit: well this really only affects c2nim. the compiler is not a library yet.
12:37:17Araqso package maintainers do the right thing
12:37:19BlaXpiritin nim-git just adding cp -r compiler pkgdir/usr/lib/nim/compiler blah blah
12:37:37BlaXpiritpiece of cake, really
12:40:26EXetoCthat might do
12:40:30*yonson joined #nim
12:41:24BlaXpiritEXetoC, it's a very good PKGBUILD, but I did realize only recently that I need it to be devel branch
12:41:42BlaXpiritso i add a line git checkout devel , no problem
12:41:44*HakanD quit (Quit: Be back later ...)
12:42:36EXetoCif you say so
12:43:07BlaXpiritI don't think PKGBUILD should be devel, though, it's good.
12:43:37BlaXpiritbut a problem is, the repository is too huge :o
12:44:57EXetoCthe size was reduced at some point
12:45:34*Sphax joined #nim
12:48:25*edsc quit (Ping timeout: 246 seconds)
12:50:11*HakanD joined #nim
12:50:26sillestagithub repo link to aporia IDE on nim-lang.org links to the old https://github.com/nimrod-code/Aporia
12:50:43EXetoCbecause csources was put in a separate repo, but it has to be included
12:51:12BlaXpiritEXetoC, there is probably a huge history of some binary file in that repo
12:51:55BlaXpiriti'm sure there have been investigations on this topic, no point in me guesing here
12:52:01yonsonHi, I´m trying to compile greetings.nim (from the nim tutorial) on my windows machine but I´m getting the following error https://gist.github.com/psychotropic/ab8e38ae7faf539b6e32
12:52:12BlaXpiritsillesta, but it's ok, because redirects :p
12:52:13yonsoni´ve checked and nim is correctly added to my path
12:52:29sillestayeah, just noticed it for some reason ;)
12:53:02BlaXpirityonson, it may be because of spaces in directory name
12:53:08BlaXpirit:s
12:53:10BlaXpirittry to have no spaces in the path
12:53:13BlaXpiritand i'm out
12:53:17yonsonhmm i´ll try
12:53:18yonsonjust a sec
12:53:51yonsonoh well
12:53:56yonsonthat fixed it
12:54:04yonsonthanks
12:54:19EXetoCBlaXpirit: there are several directories in csources that are similar
12:54:22EXetoCare all those needed?
12:54:22Araqyonson: er... that should be fixed for years now :-/
12:54:33BlaXpiritEXetoC, no idea
12:54:57yonsonit does seem kind of a silly bug
12:54:57BlaXpirityou know a lot more than me, both about nim and pkgbuilds
12:57:10Araqyonson: report it please
12:59:16EXetoCAraq: are all 16 directories in csources needed?
12:59:56AraqEXetoC: of course. think of our poor solaris users.
13:00:08EXetoC-.-
13:01:31Jehan_EXetoC: You can make gzip/bzip2/xz pack them better by sorting the tar file so that equally named files are next to each other.
13:01:48Jehan_With xz, that becomes actually pretty small.
13:03:32lesshastewhat do nimrod people think of rust? I am not really clear on the significant differences
13:03:52EXetoC*nim :)
13:04:09yonsonAraq, i now see that my computer is using gcc 4.7.3 (old installation), maybe the bug is now fixed?
13:04:43lesshasteI suppose rust has lower level semantics?
13:05:28EXetoCJehan_: and on windows?
13:05:47Jehan_lesshaste: Both languages really target different application domains.
13:05:53EXetoCwe'd need a portable solution I think
13:06:02lesshasteJehan_, could you tell me more about that please?
13:06:06lesshastewhich domains? :)
13:06:17Jehan_EXetoC: On Windows, you can just package the Windows-only code in zip file.
13:07:06lesshasteI am a slightly odd user as I only ever write smallish scientific applications (for example simulations) that need to be fast
13:07:07Jehan_lesshaste: The primary difference is that Rust tries to avoid automatic memory management, while Nim's default is automatic memory management.
13:07:35lesshasteJehan_, that's very interesting. I have no interest in managing memory myself :)
13:07:40EXetoCJehan_: we need two repos then
13:08:48Araqyonson: please try the GCC that we ship with the installer (optional component)
13:08:54Jehan_lesshaste: Well, there are application domains where automatic memory management is an issue (e.g., much of embedded programming) or where you want to have complete control over it.
13:09:12yonsonwill do and report the results
13:09:26lesshasteJehan_, right I can see that. I am being very selfish and just trying to work out what is most useful for me
13:09:48lesshasteJehan_, I don't think I ever need to allocate memory. Although it would be nice to be able to use all my cores easily
13:09:56Jehan_EXetoC: Hmm, I would think that the repo size doesn't matter much. I was thinking more in terms of .tar.xxx or .zip files.
13:10:35Jehan_lesshaste: "Using all my cores" and "easily" usually don't go together in one sentence except for embarallel problems. :)
13:10:52lesshasteJehan_, my problems are embarrassingly parallel in the main :)
13:11:13lesshasteJehan_, mostly, run the simulation for a thousand different values of n and choose the maximum
13:11:26AraqJehan_: I will argue that Nim provides more control over memory management than C++, but it's worth a blog post.
13:11:44EXetoCJehan_: the repo would just be a single archive then, and it's around 300mb now
13:11:48Jehan_lesshaste: Ah, I see. But that should be easy in any language.
13:11:56[dude]Araq: Sorry, stepped away fro a second. I got c2nim to compile now. Thanks for the help. =)
13:12:05lesshasteJehan_, it's a pain in C because everything is a pain in C
13:12:06Jehan_Araq: That'd be shooting fish in a barrel. :)
13:12:26lesshasteJehan_, and python doesn't by default even allow you to run things in parallel
13:12:40Jehan_lesshaste: True. :) But it's not really something that would differentiate Nim and Rust.
13:12:47lesshasteJehan_, ok :)
13:13:03EXetoCAraq: what do these poor solaris users need it for?
13:13:23lesshasteI basically want the highest level language possible with the largest set of scientific libraries possible that will let me write code that runs at the speed of C :)
13:13:27lesshastetoo much to ask? :)
13:13:31yonsonAraq, nope, I still get the same error with nim´s gcc (4.9.1 according to my computer). Should i fill an issue on github?
13:13:43Araqyonson: of course.
13:13:50Jehan_lesshaste: The reason I'm not using Rust is that I have no need for fine-grained control over memory management, basically, but that the memory management techniques of Rust leave a footprint on my code that I can avoid in NIm.
13:14:13lesshasteJehan_, I am reading http://pcwalton.github.io/blog/2013/03/18/an-overview-of-memory-management-in-rust/
13:14:19lesshasteseems a lot of new stuff to learn
13:14:32Jehan_lesshaste: Libraries are still an issue for both, I think, especially scientific libraries; there it comes down to how easy it is to create bindings.
13:14:33EXetoChow about a csources_solaris for those few people. not that I know what the purpose is
13:15:15lesshasteJehan_, right..sadly there is http://scikit-learn.org/stable/ and I don't know if other languages can bind to it
13:15:50lesshastescala gets round this by letting you use java libraries I think
13:15:59Jehan_lesshaste: Not familiar with it; I'm currently working on computer algebra systems, which are basically their own niche.
13:16:12*matkuki quit (Read error: Connection reset by peer)
13:16:14EXetoCwell, python has an C API
13:16:37lesshasteJehan_, interesting... which computer algebra systems ?
13:16:37*matkuki joined #nim
13:16:41Jehan_lesshaste: Yeah, Java interoperability is Scala's great strength (and JVM dependency similarly probably its greatest weakness).
13:16:48Jehan_lesshaste: GAP, Singular.
13:16:52lesshasteJehan_, nice :)
13:17:17lesshasteit's really stupid how all these impressive libraries are tied to one language
13:17:27EXetoCand we have nimborg, but it seems like yet another stale lib. there's a low level binding though I think
13:17:28lesshasteyou feel that with some thought they could have made them interoperable from the start
13:17:50Jehan_lesshaste: That'd be nice, but it's harder than you think.
13:17:51EXetoClesshaste: if indeed the libs are unique, yes
13:18:37lesshasteEXetoC, I think scikit learn is more or less unique. I mean there is a competing set of libraries called weka for java but there are thousands (millions?) of man hours in these projects
13:18:43Jehan_Araq: I actually think memory management in C++ is a big issue, but that ties into my usual argument how I believe that RAII is fundamentally broken (except for rare use cases).
13:18:46lesshasteit's madness to reimplement them for each language
13:19:00lesshasteJehan_, I can imagine but it seems worth it
13:19:12EXetoCin which case I agree. too bad C is what it is though
13:19:30Jehan_lesshaste: A major problem is data representation.
13:20:18lesshasteJehan_, a flat array to pass data in and out would seem to cover most languages wouldn't it?
13:20:44Jehan_You could work around that by making every type completely opaque, but then you need automatic memory management/GC and that means all libraries and the language need to agree on using the same GC.
13:20:54EXetoClesshaste: I've wanted to write an interface that would allow one to easily write C libs in nim, but that might take some time
13:20:55Jehan_lesshaste: But would be totally inefficient.
13:21:04EXetoCnot that it solves your particular problem
13:21:07lesshasteEXetoC, nice :)
13:21:07AraqJehan_: I don't think you ever explained how RAII is broken. :-)
13:21:21AraqI think it's completely broken too, but I like to hear your thoughts
13:21:26Jehan_Assume that you want to represent elements of F[x,y,z] (i.e. polynomials over three variables and the field F).
13:22:04Jehan_Araq: Would be lengthy, I was thinking about posting it in the RAII thread, then I thought better than to stir up unnecessary trouble. :)
13:22:17EXetoCI have so many ideas, but I keep coming back to that one
13:22:17lesshasteJehan_, ok
13:22:47lesshastemaybe nim could have a way of calling python code :)
13:22:48Jehan_lesshaste: There are a number of ways you can represent them. You may require them to have a reference to F, too, or F be implicit.
13:22:59Jehan_lesshaste: I think there already is a module for that?
13:23:04lesshasteoh ok !
13:23:13*valberg is now known as keyvalberg
13:23:16AraqJehan_: IMO it's because there is no escape analysis whatsoever involved and c++ only has 'const' and not 'lent'
13:23:26lesshasteI suppose that works round this particular problem then?
13:24:05Jehan_Araq: Number of problems, short list:
13:24:18Jehan_(1) RAII does not have sane semantics for variables with static scope.
13:24:21lesshasteJehan_, I suppose I have a very crude way of thinking about these things. I am imagine a library that takes in some data and returns something
13:24:44lesshasteJehan_, in that case the API specifies the format it wants and it is your job to provide it
13:24:46Jehan_(2) RAII does not have sane semantics for concurrency (also why shared pointers in C++ essentially have the performance of a small glacier).
13:24:57lesshasteJehan_, but your only problem is making sure the data you pass is in the right format
13:25:11lesshasteJehan_, I think you are talking about something much more sophisticated... ?
13:25:45Jehan_(3) Main use case #1 for RAII is reference counting, which is slow if done using RAII.
13:26:10Jehan_lesshaste: Hmm, talking about two different things at the moment.
13:26:17lesshasteJehan_, :)
13:26:18Araqthe unique_ptr fraction would disagree ;-)
13:26:48lesshasteJehan_, imagine I want to compute the inverse of a matrix. I pass the matrix and get the inverse. My only problem is to pass the matrix in the right format isn't it?
13:26:50Jehan_Araq: unique_ptr is too weak for a lot of important stuff.
13:26:58EXetoCtime to look into it. I'd need a way to fail as soon as something wants the GC though
13:27:22*Demos joined #nim
13:27:39DemosTriplefox, ping
13:28:03Jehan_(4) RAII is used for open/close scenarios with local scope, which can be done as well and often better if you have higher order functions or clean macros.
13:28:36*keyvalberg is now known as valberg
13:29:08Jehan_More importantly, there are tons of other resource management scenarios that RAII does not have any real applicability for (such as an LRU pool).
13:29:40Jehan_(5) If you use it for resource handling, it leaves a significant footprint on your code (see, e.g., the Rule of Three, now actually the Rule of Five).
13:30:47Araqmany disagree with (4) as well. :-) i don't though. I think this whole constructor/destructor business is blown out of proportion. You need to learn the API for the type anyway, even everything uses the precious 'new T' syntax
13:31:02Araq*even when
13:31:11Jehan_lesshaste: Well, yeah. And do you pass the matrix as a list of row or column vectors, for staters?
13:31:46Jehan_Araq: Constructors are a totally different story. I may actually post something in that thread, that can be done without inciting a flame war.
13:32:02EXetoClet's not forget to bash the name
13:32:04DemosI think (4) is more or less valid, it depends on what resource you are using, like I don't really like using RAII for files
13:32:10lesshasteJehan_, ok but that's in the specs. I mean in my dream world that only thing the interface has to do is to code in nimrod to pass the data in the format the specs demand
13:32:26lesshasteJehan_, he/she never has to do any other low level coding or coding in a foreign language
13:32:38Jehan_lesshaste: In my dream world, too. :)
13:32:50lesshasteJehan_, :)
13:34:04Jehan_Demos: A major problem with using RAII for resource handling can be that hidden pointers keep a resource alive longer than you think.
13:34:17lesshasteJehan_, I wonder why our dream worlds don't exist :)
13:34:17lesshaste?
13:34:23Jehan_This is particularly true in languages with closures.
13:34:30DemosJehan_, this is true. For memory I think it is OK
13:34:41*leavengood joined #nim
13:34:44Demosfor something like files not so much
13:34:46Jehan_Store a closure as a callback somewhere, and suddenly all of its environment is being kept alive.
13:35:04Demosand then there are things like sockets that do have open/close semantics but you really need to understand when to close them
13:35:09*leavengood is now known as Guest48178
13:35:12Jehan_That's actually #6: RAII and closures do not mix well, and closures are an important concept.
13:36:19Jehan_Demos: Also, importantly, sometimes closing a resource is non-trivial. RAII assumes that no error handling is needed for that.
13:36:26EXetoCthough I can't use sequtils for example because of my requirements. oh well
13:37:38*JinShil quit (Quit: Konversation terminated!)
13:37:57DemosJehan_, sure. But the resources that do require error handling don't really work in any kind of automatic system. I agree though
13:39:29*JinShil joined #nim
13:47:23*Guest48178 quit (Quit: leaving)
13:50:40*nercury quit (Quit: nercury)
13:51:21Demoswell I gotta go, but Triplefox, I am the maintainer of the FreeImage library and would like to know if you got it working. It is totally possible that there is a missing dynlib directive or your OS may be having trouble finding the library. I use it on windows (usually static linked) and on RHEL
13:51:35*nerijus joined #nim
13:52:38ekarlso-dom96: JWT tokens
13:56:20ekarlso-flaviu: u around ? :)
14:00:07*nerijus left #nim (#nim)
14:17:44*Jehan_ quit (Quit: Leaving)
14:19:10*Demos quit (Ping timeout: 255 seconds)
14:24:16*seemsindie joined #nim
14:25:09*jefus__ joined #nim
14:27:04*gmpreussner___ joined #nim
14:29:11*jefus_ quit (Ping timeout: 252 seconds)
14:29:33gmpreussner___i have a C library with structs that hold function pointers for callbacks that users can register. how would i best model this in nim? is it possible?
14:29:56*gmpreussner___ is now known as gmpreussner
14:33:17*jefus__ is now known as jefus
14:37:53jpoirier_gmpreussner: yes. E.g. just mirror the C callback typedef in your nim wrapper, e.g. type readAsyncCbProc* = proc (buf: ptr uint8; len: uint32; userCtx: UserCtxPtr) {.fastcall.}
14:38:11*JinShil quit (Quit: Konversation terminated!)
14:46:00BlaXpiritgmpreussner, i made an example recently
14:46:00*ivan_ joined #nim
14:46:17*ivan_ quit (Client Quit)
14:46:52BlaXpiritsec
14:46:56*Demos joined #nim
14:47:18*ivan_ joined #nim
14:47:33*ivan_ quit (Client Quit)
14:47:50BlaXpiritgmpreussner, https://github.com/LaurentGomila/CSFML/blob/fdf58188caf49684fbeb5e951c61e92a0a6c3e82/include/SFML/Graphics/Shape.h#L39 https://github.com/BlaXpirit/nim-csfml/blob/254aecd3d1c68ba1febbafc950f1fa7f78872706/examples/shapes.nim#L43 https://github.com/BlaXpirit/nim-csfml/blob/254aecd3d1c68ba1febbafc950f1fa7f78872706/src/csfml_graphics_gen.nim#L2753
14:47:56BlaXpiritthat's 3 huge links D:
14:48:19*ivan_ joined #nim
14:48:21*ivan_ quit (Client Quit)
14:48:47*seemsind1e joined #nim
14:48:55BlaXpiritstill better than blob/master links because they rot :p
14:49:50*seemsind1e quit (Client Quit)
14:49:56*seemsindie quit (Quit: Page closed)
14:50:23Demoswell irc is hardly a bullet proof archive
14:50:24*seemsindie joined #nim
14:50:39BlaXpiritit sure is, what with IRC logs available
14:50:59*HakanD quit (Quit: Be back later ...)
14:51:46seemsindiey
14:52:42jpoirier_BlaXpirit: Is {.cdecl.} okay for callbacks? I'm using {.fastcall.} for reasons I don't remember :/
14:52:57BlaXpiritjpoirier_, it must be consistent with what actually is in the library
14:53:10BlaXpiritif it's just a normal C library with normal C functions, it must be cdecl
14:53:27BlaXpiritand if there is actually __fastcall present in C code, then it's fastcall
14:53:32BlaXpiriti may be mistaken though
14:53:51jpoirier_BlaXpirit: k, that sounds right, thanks
14:56:23*darkf quit (Ping timeout: 240 seconds)
14:56:25*HakanD joined #nim
15:00:10*atomic-hedgehog joined #nim
15:00:42gmpreussnerjpoirier_, BlaXpirit: thanks guys!
15:01:43*Varriount|Busy joined #nim
15:01:50EXetoCjpoirier_: it might've worked just because of luck
15:02:09EXetoCBlaXpirit: you could write a minimal example in C and then run c2nim over it, just to see what is being generated
15:02:28BlaXpiritlol i made half of c2nim myself already
15:03:10BlaXpiriti actually went as far as generating function type signatures from c code
15:03:57BlaXpiritthat last link is autogenerated code btw
15:03:58EXetoCjpoirier_: or was __fastcall indeed in the code?
15:04:33EXetoCBlaXpirit: well it looks like correctly generated callbacks
15:04:53BlaXpiritsure is, cuz it even works :p
15:04:58atomic-hedgehoghi, I'm working with the httpclient library on the devel branch, and my program failed to compile. The issue is with the net.nim library requiring uint16 in some places. There's a cast to uint16 for one part of an expression, but the rest of it is outside the cast and getting coereced to int
15:05:03atomic-hedgehoghttps://github.com/Araq/Nim/blob/devel/lib/pure/net.nim#L1039
15:05:39atomic-hedgehogI've fixed it locally by wrapping the cast aroudn the entire expression and everything seems to be working.
15:05:48atomic-hedgehogSince I'm very new to nim, I'
15:05:56EXetoCBlaXpirit: ok you figured it out
15:06:00atomic-hedgehogm not sure if this is the right way to fix it.
15:06:07atomic-hedgehogShoudl I do a pull request?
15:06:09BlaXpiritEXetoC, uhm it wasn't me who needed help
15:06:24EXetoCnvm then
15:06:38BlaXpiritatomic-hedgehog, this problem was brought up recently, i'm pretty sure
15:06:48BlaXpiritand fixes are probably being worked on
15:06:48*HakanD quit (Quit: Be back later ...)
15:07:13BlaXpirithm i'm not sure though
15:07:43BlaXpiritatomic-hedgehog, yeah, look https://github.com/Araq/Nim/commit/f7ef00aa3be1b31ad2781f21852c41f55c5de1e0#diff-df7c4ae903eab01bc8c4f64f425b48c3
15:08:05BlaXpiritseems to have been fixed a day ago, maybe you're not up to date
15:08:11EXetoCpeople and their ancient builds :p
15:08:16*gmpreussner quit (Ping timeout: 244 seconds)
15:08:49atomic-hedgehogha, nope, I found this two days ago. I have a small child so my time to work on stuff is really limited.
15:09:08BlaXpiritatomic-hedgehog, i don't understand what you mean
15:09:17BlaXpirityou mean you have devel from 2 days ago?
15:09:24BlaXpiritthen update is your solution
15:09:29atomic-hedgehogRight, so it should be fixed in latest.
15:09:34BlaXpiritok
15:09:40atomic-hedgehogI'll do a pull
15:09:45BlaXpiritgood
15:12:36*BitPuffin joined #nim
15:16:47*nercury joined #nim
15:17:43*nodrygo_ joined #nim
15:17:55*gunn joined #nim
15:22:36onionhammeraraq it would be nice to be able to just say {.compile with cpp.} at the top of a module
15:23:46onionhammerit works if I do something hacky like this at the top: proc CPP {.importcpp.}
15:23:48onionhammer:)
15:24:15BlaXpiritit's hard for me to imagine how one can compile different parts of a project with different compilers
15:24:33onionhammerbecause they're ABI compatible
15:24:44onionhammerand distinct .o files are generated per module
15:27:04BlaXpiritcool stuff
15:28:08*nodrygo joined #nim
15:28:23*nodrygo_ quit (Quit: Page closed)
15:29:13*nodrygo left #nim (#nim)
15:31:10*Varriount|Busy quit (Ping timeout: 246 seconds)
15:32:59*Demos quit (Ping timeout: 252 seconds)
15:36:50dts|pokeballdoes the nim compiler generate .o files? i thought all of that was handed to the compiler?
15:36:57dts|pokeballdoes the nim compiler generate .o files? i thought all of that was handed to the c compiler? **
15:37:01dom96THe C compiler does.
15:37:45dts|pokeballyeah, so ABI compatability doesnt matter in this case
15:40:05onionhammerwhy wouldnt it matter
15:41:16onionhammeroh, i thought .o files were binary
15:41:24dts|pokeballbecause its compiling down to c/c++/js/etc and then the system compiler generates the ABI compatibile file
15:41:53onionhammeri'm talking about compiling a C++ and a C file together into a final exe
15:43:06onionhammerwell, linking them together i guess..
15:43:17onionhammerif that makes sense
15:43:34*nodrygo joined #nim
15:43:55onionhammerre http://en.wikipedia.org/wiki/Application_binary_interface
15:44:21onionhammer"ABIs cover details such as ... in the case of a complete operating system ABI, the binary format of object files, program libraries and so on."
15:47:16*[dude] quit (Ping timeout: 246 seconds)
15:51:41*johnsoft quit (Ping timeout: 252 seconds)
15:52:18*johnsoft joined #nim
15:54:31ekarlso-anyone interested in making a JWS library ?
15:56:07dom96what is JWS?
15:56:20*SplinterOfChaos joined #nim
15:57:55ekarlso-dom96: javascript object signing
15:58:01ekarlso-and encryption (jose)
15:58:02ekarlso-:D
15:58:04ekarlso-https://datatracker.ietf.org/wg/jose/documents/
15:58:19dom96Why do you need that?
15:58:33ekarlso-dom96: more libraries = more reasons to use nim :)
16:02:11*nercury quit (Quit: nercury)
16:03:49*ZzZMorpork is now known as AMorpork
16:07:59*VinceAddons joined #nim
16:08:46*brson joined #nim
16:09:45ekarlso-I love nim
16:18:12*gokr quit (Quit: Leaving.)
16:27:16*Demos joined #nim
16:37:35*nercury joined #nim
16:40:32sillestadon't we all :)
16:40:45*Demos quit (Ping timeout: 244 seconds)
16:44:47*seemsindie quit (Ping timeout: 264 seconds)
16:56:36*BlaXpirit_ joined #nim
16:58:47*BlaXpirit quit (Ping timeout: 252 seconds)
17:00:21*nercury quit (Quit: nercury)
17:04:09*gokr joined #nim
17:05:24*jokr joined #nim
17:10:37*yonson quit (Ping timeout: 255 seconds)
17:15:48*jokr quit (Quit: WeeChat 1.0.1)
17:16:05*jokra joined #nim
17:16:40*Demos joined #nim
17:22:16*jokra quit (Quit: WeeChat 1.0.1)
17:22:31*jokra joined #nim
17:24:20*jpoirier_ quit (Quit: Leaving)
17:24:29*nodrygo left #nim (#nim)
17:36:21*skyfex joined #nim
17:42:01*Sphax quit (Quit: CYA!!)
17:46:42*jpoirier joined #nim
17:47:22*gokr quit (Quit: Leaving.)
17:48:35*jokra quit (Quit: WeeChat 1.0.1)
17:49:38*adam_s joined #nim
17:50:35*jokra joined #nim
18:01:04*jefus_ joined #nim
18:04:15*jefus quit (Ping timeout: 264 seconds)
18:07:34ldleworkIf I have a library with BaseType, and in my application I have a Subtype, and a Foo and a Bar, and Foo creates a Subtype and uses library code (which takes BaseType) to pass the Subtype from Foo to the Bar, how I can I do this so that bar gets a Subtype, not a Basetype?
18:08:27*UberLambda joined #nim
18:08:53ldleworkPassing the Subtype to the library seems to cause a downcasting
18:09:28ldleworkI understand that I can upcast back to the Subtype in Bar when it recieves the BaseType from the library, but how should Bar know which Subtype to upcast to?
18:09:37ldleworkIt might be a SubtypeA or a SubtypeB, etc
18:30:48*Demos quit (Ping timeout: 245 seconds)
18:48:37Araqldlework: usually people end up with init(x: var Base) procs, I think
18:55:23*rpag joined #nim
19:10:21*pjc joined #nim
19:13:14joecodesspeaking of more libraries, after reading: http://blog.gopheracademy.com/go-and-ssh/ I wonder if there is an ssh library for nim.
19:13:51def-joecodes: haven't seen one yet
19:18:26*jefus_ is now known as jefus
19:30:18*yonson joined #nim
19:30:19dom96Araq: How can I catch DeadThreadError?
19:30:43Araqer .. you shouldn't
19:31:09dom96Meh. Looks like raises: [] on a {.thread.} doesn't work well.
19:31:35Araqah I see
19:31:54Araqso we should hide this somehow like we do for AssertionError, perhaps
19:32:21Araqin fact
19:32:24dom96Maybe.
19:32:33AraqI can make it use assert instead of raise.
19:32:36dom96I put everything in the thread in a try catch and it still thinks that Exception is raised.
19:32:48*atomic-hedgehog quit (Ping timeout: 244 seconds)
19:33:29Araqthe compiler is usually right. gradha had a similar problem and it was all his fault :P
19:34:34*atomic-hedgehog joined #nim
19:44:08onionhammeraraq thoughts on specifying compiler with a bare pragma
19:44:29*rpag quit (Quit: zZz)
19:44:38onionhammeri mean.. besides your initial reaction of hating everything I say :P
19:45:37Araqach quatsch, ich liebe jeden Menschen auf Gottes grüner Erde...
19:45:58Araqonionhammer: well ... as you noted
19:46:12Araqthere is already a "simple" way to do that
19:46:25Araqwhich breaks with --deadCodeElim:on I think
19:46:56Araqbut. the "mixed" mode has been designed so that you don't have to care about that
19:48:14onionhammersay I"m using a lot of try/catches or something and know that this module will perform much better compiled to cpp?
19:49:58Araqyou document then that people should compile it with 'cpp' instead of 'c'?
19:50:04dom96Any ideas how to check if a stream has something in it?
19:50:25Araqor somehow specify it in your nake file, I dunno if that's possible
19:50:40Araqonionhammer: I think you can also do:
19:50:46Araqwhen not defined(cpp):
19:50:58Araq {.error: "compile as C++ you fool!".}
19:51:00onionhammerI suppose... just think it would be nicer to have a {.exportcpp.} pragma
19:51:11onionhammeror {.export:cpp.} or something
19:51:32onionhammerafk
19:51:33Araqyes, lots of things would be nice. we have ~400 open issues.
19:52:23dom96Argh. The only way would be to check asynchronously I guess.
19:54:05Araqdom96: posix hates that. afaict you can only 'read'
19:55:25onionhammerthat's fair
19:58:45dom96Araq: Any chance I could hack something together with spawn?
19:59:02Araqto do what?
19:59:43dom96To attempt to read from a process' errorStream
20:00:00dom96I don't suppose that will work.
20:00:02*adam_s quit (Quit: Leaving)
20:00:20EXetoConionhammer: then what? you compile as C and possibly get an empty program?
20:00:42onionhammerno if you do nim c cppmodule.nim it will use cpp anyway
20:00:47onionhammer(currently)
20:00:59*Sergio965 joined #nim
20:02:26Araqdom96: no, cannot work
20:02:36dom96oh well
20:02:43dom96No fancy highlighting of stderr then
20:03:00dom96maybe I can just match the errors with pegs
20:03:04*gunn quit (Ping timeout: 265 seconds)
20:03:25Araqdom96: json output for the compiler's error messages is in the works
20:03:35ldleworkWhat's the thing in Nim where I can constrain generic type discriminators?
20:04:16onionhammeras part of idetools araq?
20:04:35onionhammercapital-I ide tools or lower-case
20:04:42Araqonionhammer: it'll be a general switch, not part of idetools
20:04:56dom96Araq: cool
20:05:00dom96What about idetools?
20:05:01Araqonionhammer: we still do cs:none for all command line things
20:05:19ldleworkfound it
20:05:21Araqand will keep this way
20:06:19*gunn joined #nim
20:06:58*pjc quit (Ping timeout: 246 seconds)
20:07:15ldleworkIf you have a type which is generic, do you have to also make all of its method's generic too?
20:07:20ldleworkwait no
20:07:31ldleworkwell yeah
20:07:59*Sergio965 quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
20:08:23onionhammerldlework http://nim-lang.org/manual.html#type-classes
20:08:41*enquora joined #nim
20:08:54ldleworkI'm starting to feel my brain melt
20:09:56*yonson quit (Quit: Leaving)
20:10:39Araqldlework: there are implicit generics in Nim. so when you do:
20:10:46Araqtype Foo[T] = object
20:11:04Araqproc p(f: Foo) # p is implicitly generic with parameter T
20:12:02ldleworkinteresting
20:12:20onionhammeris that true of objects too?
20:12:23*t4nk680 joined #nim
20:13:15t4nk680Hello, I am currently trying to use sfml with nimrod. I have installed bindings with nimble.
20:13:45t4nk680It compiles fine, but when I try and run it can't seem to find it 'could not load: libcsfml-window.so'
20:14:22t4nk680I have installed csfml and sfml
20:15:13def-t4nk680: is the libcsfml-window.so in /usr/lib, /usr/local/lib or somewhere?
20:15:15t4nk680and usr/lib/libcsfml-window.so exits in /usr/lib
20:15:21t4nk680Yes
20:16:05def-that's strange. does it work if you copy the libcsfml-window.so to your current directory?
20:16:27t4nk680Let me just try
20:16:42def-ah,and is the libcsfml-window for the right architecture? might be a 32bit/64bit problem
20:17:14t4nk680Still does not work when 64bit version into dir
20:17:46matkukit4nk680: BlaXpirit_ can probably help, he's the SFML bindings creator.
20:17:56t4nk680Am I compiling the nimrod program with the wrong arch?
20:17:56BlaXpirit_hi
20:17:59t4nk680Hey
20:18:31def-t4nk680: you can check with the "file" program
20:18:37BlaXpirit_t4nk680, what is your distro?
20:18:46t4nk680Arch linux
20:18:48BlaXpirit_ok
20:18:53BlaXpirit_csfml is broken on arch linux
20:19:00t4nk680Ahh ok
20:19:19BlaXpirit_i wrote to package maintainer today
20:19:24BlaXpirit_he doesnt wanna take action
20:19:28t4nk680Maybe using aur package
20:19:34t4nk680Build from source?
20:19:38BlaXpirit_let's go to private message
20:19:47t4nk680OK
20:24:45BlaXpirit_but damn, sure is a ton of people using arch linux
20:25:48t4nk680Yeah, its kinda grown recently.
20:26:29t4nk680People moving away from bloated distros
20:32:59dom96Araq: What about idetools? How's work on them coming along?
20:33:32Araqdom96: as usual there is more pressing work tbd
20:33:36Araq:-(
20:33:45Araqbut maybe next week
20:33:46dom96:\
20:37:59*matkuki quit (Quit: ChatZilla 0.9.91.1 [Firefox 34.0.5/20141126041045])
20:38:59UberLambdaI'm on Arch after a lot of time on Linux Mint
20:39:20UberLambdaToo much bloat, updates could kill the system and rolling release is really nice
20:39:24VarriountAraq: What is Nim's behavior with regard to 'undefined behavior' in the C/C++ backend?
20:40:28AraqUberLambda: I'm on Linux Mint with RR and I'm still waiting for the update that makes my X-window system from crashing hard
20:40:43Araq*makes it stop
20:41:04AraqVarriount: we try to avoid it, but currently not too hard.
20:42:15UberLambdaAraq: try installing Arch on a VM, I think you'd like it
20:42:36UberLambdaSetting it up requires some time but afterwards it doesn't take any long manteinance
20:42:52Araqyeah, been there, tried it, took too much time
20:43:03UberLambdaI found that I had spent more time fixing Mint's update issues than setting up Arch
20:43:18BlaXpirit_yup
20:43:22UberLambdaIn the end, you can make a nice, fully-configured system in ~3 hours
20:43:28AraqI don't fix my linux setups anymore
20:43:39UberLambdaYou wipe & reinstall?
20:43:48t4nk680Think Arch's setup is complicated? try gentoo :)
20:44:01AraqI live with the bugs until it becomes too hard
20:44:08Araqthen I wipe & reinstall
20:44:12BlaXpirit_since i've installed arch, i haven't reinstalled. enough said.
20:44:18UberLambdaAraq: I think this way you lose a lot of productivity
20:44:24joecodesis there a website like npmjs.com for searching for nim packages? currently looking for a dns lib... want to be able to async send dns questions to particular servers for each question (each question to different server).
20:44:32UberLambdaI've been running the same install for 3 years now
20:44:51BlaXpirit_joecodes, i think it's in the works
20:44:52def-joecodes: the packages should be in http://nim-lang.org/lib.html
20:45:03BlaXpirit_that's for now, i suppose
20:45:25BlaXpirit_search for DNS returns nothing
20:45:34BlaXpirit_this is your time to shine, make bindings xD
20:45:40dom96joecodes: You can search using Nimble: nimble search dns
20:46:33joecodesthanks. yeah no dns. I will install nimble.
20:46:35def-joecodes: for DNS I used this: http://nim-lang.org/rawsockets.html#getHostByName,string
20:46:39*Sphax joined #nim
20:46:40AraqUberLambda: most of the time I'm on windows so no, I don't lose a lot of productivity ;-)
20:48:05joecodesthanks def- I need to send the query to the authoritative nameserver for each query, so getHostByName won't work
20:48:52UberLambdaAraq: I just couldn't move from a UNIX-like environment once having tried it
20:49:10UberLambdaAlso, Valve pushing a lot of games to Steam for Linux made my switch almost complete
20:49:15AraqI hate unix with a passion :-)
20:49:28UberLambdaAraq: I hate Windows with a passion :P
20:49:52joecodesI use ubuntu and rarely have probs. chose it because there are so many answers to common problems out there.
20:50:35*gour quit (Quit: Leaving)
20:51:41*t4nk048 joined #nim
20:54:13*t4nk680 quit (Ping timeout: 246 seconds)
20:56:11*BlaXpirit_ was gonna write something, but rethought
21:00:49joecodesalrighty, am now nimble enabled :-). Someone needs to write a golang -> nim transpiler to get all those sweet sweet libraries :-)
21:02:10VarriountMeep.
21:02:29VarriountAraq: Apparently the testers are fixed, even without my patch.
21:15:38VarriountAraq: And I just made a change to the 32 bit portion of the registry that should prevent the WER dialogue from stalling the tester.
21:16:13*Sergio965 joined #nim
21:18:06VarriountHello Sergio965
21:18:12Sergio965Hi!
21:19:03*Mat4 joined #nim
21:19:17VarriountHey Mat4
21:19:30Mat4hi Varriount and all
21:21:52*t4nk048 quit (Ping timeout: 246 seconds)
21:22:05*gokr_ joined #nim
21:22:34*irrequietus joined #nim
21:24:03*jokra quit (Ping timeout: 256 seconds)
21:39:03*adam_s joined #nim
21:40:17*jokra joined #nim
21:45:07*gokr joined #nim
21:47:19*gokr_ quit (Ping timeout: 245 seconds)
21:48:18*irrequietus quit ()
21:48:34*irrequietus joined #nim
21:54:34*t4nk988 joined #nim
22:01:03t4nk988What is an ideal way to store loaded game levels from csv in nimrod?
22:01:49t4nk988seq[seq[]] as in y[x] ?
22:02:37ekarlso-t4nk988: is ti key value ?
22:02:58t4nk988Represents tile type
22:03:06*UberLambda quit (Quit: Leaving the Matrix)
22:03:17t4nk988for example 1 = solid
22:03:30*gokr1 joined #nim
22:03:34EXetoCyes. y[x] will yield a seq[]
22:03:50dom96use an enum for your tile types
22:04:07t4nk988dom96: Already done that :p
22:05:06dom96good
22:10:58*Demon_Fox joined #nim
22:11:58*Sergio965 quit (Remote host closed the connection)
22:12:15flaviut4nk988: btw, seq[seq[...]] might not be ideal, you might want to use a single seq instead. Less indirection, and you can make a wrapper so that the syntax is similar.
22:12:37def-flaviu: if it's fixed size at least
22:12:42t4nk988How would I use a single seq flaviu ?
22:13:27t4nk988Ahh I understand
22:13:34flaviut4nk988: A single seq of size x * y, with access to idx (x, y) being (y * width + x)
22:14:01def-like this: https://github.com/def-/nim-unsorted/blob/master/bitmap.nim#L39-L40
22:14:06EXetoCI don't think it will matter, but I don't bother with 2d arrays in such cases
22:14:23t4nk988What do you mean EXetoC?
22:14:54flaviudef-: You should put a licence file in that repo.
22:15:13def-flaviu: i don't care about licenses, do what you want with the code
22:15:13flaviuOtherwise, no one can use that code.
22:15:28def-flaviu: isn't it public domain without a license?
22:15:45flaviudef-: Just the opposite. If you don't have a licence, no one is allowed to touch it.
22:16:32*Sergio965 joined #nim
22:16:33*Sergio965 quit (Client Quit)
22:16:37t4nk988http://schep.me/license-checker/ def- flaviu
22:17:29def-i don't even want to read about licenses
22:18:01def-the code is mostly from rosetta code, so it's their license
22:18:23t4nk988def-: Its not, you enter your username and it checks to see if licenses are present in your repos
22:19:17ekarlso-is there like a DateTime equiv in nim ?
22:19:41def-ekarlso-: times?
22:19:49ekarlso-kewl :D
22:20:07BlaXpirit_def-, http://choosealicense.com/no-license/
22:20:38t4nk988Haven't seen that before, BlaXpirit_ thanks.
22:20:51flaviudef-: If you wrote the code, you decide the license. Rosetta code requires you license it under the GNU Free Documentation License 1.2, but the terms of that are too complicated for my tastes.
22:21:29flaviudef-: If you want something permissive, http://choosealicense.com/licenses/mit/ is a good choice.
22:22:53ekarlso-oh well, part 1 of JWx stuf done
22:22:56ekarlso-tmrw more ! :D
22:23:44flaviuekarlso-: were you able to figure out why the C and nim code weren't matching up?
22:24:29ekarlso-flaviu: ya, what EXetoC said :)
22:24:52*t4nk988 quit (Ping timeout: 246 seconds)
22:25:28flaviuekarlso-: No, I accidentally gisted the wrong file.
22:25:32flaviuhttps://gist.github.com/3e0b5a52fe9395fcf5c5 is the correct one
22:25:51*jokra quit (Ping timeout: 264 seconds)
22:26:02ekarlso-flaviu: yeah, but I managed to make it work before that too ;)
22:26:36flaviuekarlso-: My problem is this: https://gist.github.com/flaviut/8e3464016063ea83f622
22:26:53flaviuThe code seems identical, but the output is different.
22:27:04ekarlso-:/
22:27:24ekarlso-i guess the hash should be identical ?
22:27:50flaviuyep
22:28:01BlaXpirit_ekarlso-, but what if it uses gcc?
22:28:18BlaXpirit_nvm
22:28:19ekarlso-BlaXpirit_: ?
22:28:23flaviuexactly the same output
22:28:38ekarlso-flaviu: ping when u find the reason ;p'
22:29:11ekarlso-what's the equiv of atomic stuff in nim ?
22:29:14ekarlso-or locks
22:29:47def-http://nim-lang.org/locks.html
22:29:56ekarlso-kewl
22:30:16*Boscop__ joined #nim
22:30:17ekarlso-was gonna start a metrics library also a'la go-metrics or coda hale style to be exact
22:30:36EXetoCunits?
22:30:52ekarlso-EXetoC: ? :Å
22:30:56*nande joined #nim
22:31:41EXetoCnvm
22:32:49ekarlso-EXetoC: like u have a registry ish thing where you can register diff types of metrics..
22:33:27*Boscop joined #nim
22:33:27*Boscop quit (Changing host)
22:33:27*Boscop joined #nim
22:33:39*adam_s quit (Ping timeout: 264 seconds)
22:33:59*Boscop_ quit (Ping timeout: 245 seconds)
22:35:15flaviuekarlso-: a database?
22:36:26ekarlso-flaviu: https://github.com/rcrowley/go-metrics < like that
22:36:31*Boscop__ quit (Ping timeout: 272 seconds)
22:37:02*BlaXpirit_ quit (Quit: Quit Konversation)
22:39:19*yonson joined #nim
22:41:11*mwbrown joined #nim
22:41:49mwbrownAnyone here to answer a quick question regarding reference types?
22:42:44dom96mwbrown: There is lot's of people here. You should just ask your question instead of asking to ask.
22:42:46def-mwbrown: hi. a few are here, what's the question?
22:43:20mwbrownSo on the tutorial (it's been a while since I touched Nim) here: http://nim-lang.org/tut1.html#reference-and-pointer-types
22:43:35mwbrownIt declares both Node and NodeObj, NodeObj being "ref Node"
22:43:47*jokra joined #nim
22:44:00mwbrownit's easy to go from a NodeObj to a Node via new() and then accessing it normally, but is there a way to create a tracked reference from one that was NOT allocated via new?
22:44:12mwbrowni.e. you have a function that takes NodeObj but you only have a Node
22:44:44mwbrownI am assuming that any non-reference types are allocated either on the stack or in the .bss section
22:45:51joecodesdom96 how to set port for jester? argument to runForever?
22:45:53ekarlso-dom96: hirr would u be interested in jwt ?
22:45:55mwbrownI tried using addr but it complained about getting a "ptr" instead of a "ref"
22:46:31dom96joecodes: var settings = newSettings(port = Port(1234))
22:46:59dom96mwbrown: There is not.
22:47:04dom96ekarlso-: No, sorry.
22:47:17ekarlso-dom96: darn
22:47:21mwbrowndom96: in that case should I just use ptr types for those use cases?
22:47:30joecodesdom96: thanks!
22:47:43*Sphax quit (Quit: ZZZZZzzzzz)
22:48:12dom96mwbrown: what is your use case?
22:48:39mwbrowndom96: I want to statically allocate a structure (this is aimed for embedded) and want to pass it around by reference in the safest manner possible provided by Nim
22:48:41*Sphax joined #nim
22:48:44dom96joecodes: That will soon become: settings:\n port = TPort(1234).
22:48:49dom96or something similar.
22:48:52ekarlso-dom96: u not interested in web stuffs ?
22:49:04dom96ekarlso-: I'm not interested in JWT.
22:49:08flaviuekarlso-: Just write the thing, if people are interested, they'll use it.
22:49:18ekarlso-okok :P
22:49:54dom96mwbrown: You want to allocate it on the stack?
22:50:08joecodesdom96: ok. will keep an eye out for it.
22:50:14mwbrowndom96: Either that or in the .bss like you would a static in C
22:50:21ekarlso-that's the sad thing though, if I create something that people dont wanna use then doh
22:50:58dom96mwbrown: You should use 'var Type' I think: http://nim-lang.org/tut1.html#parameters
22:51:01dom96Second example.
22:51:30dom96ekarlso-: What happened to you creating the packages site?
22:51:37ekarlso-dom96: still going
22:51:43ekarlso-dom96: need a token mechanism..
22:51:44flaviuekarlso-: don't think that way, you're just setting yourself up to be disappointed.
22:52:06Araqmwbrown: use 'ptr' or 'var' it doesn't really matter. 'var' is a bit safer though.
22:52:06dom96If you're going to use it then that's enough reason to create a library for it.
22:52:13onionhammerbuild something *you* want to use ekarlso-
22:52:23mwbrowndom96, Araq: Thanks a lot!
22:52:33flaviuExactly. If others find it useful then great!
22:55:03*Sphax quit (Quit: ZZZZZzzzzz)
22:55:38mwbrownyup, just confirmed that a top-level var is in the bss and a var inside a proc is stack-allocated
22:55:51mwbrownby printing the addresses. That works for me!
22:56:54joecodesdom96: so each route block is not async by default? so tried something like: await resp intToStr(fib(45)) but compile error.
22:57:23dom96joecodes: it is, you don't need 'await' in that case.
22:57:51Araqmwbrown: you can write C-like code very easily in Nim.
22:58:37joecodeshmmm. i tried and when long request (fib(45)) runs, it seems to block all other requests. this is from jester installed with nimble install jester
22:59:23Araqjoecodes: because it's blocks your *cpu*.
22:59:41Araqthis is not multi-threaded, async only helps with *io*
23:00:02Araquse spawn when you block your cpu
23:00:18joecodesok thanks.
23:00:47ekarlso-Araq: how would you go about calling a proc every x seconds ?
23:01:07ekarlso-without blocking
23:01:27dom96while true + await sleepAsync
23:01:59ekarlso-does the proc you're calling then need to be async ?
23:02:17dom96yes
23:02:29dom96'await' needs to be in an async proc
23:03:15*matkuki joined #nim
23:03:21EXetoCcan one make sure that no GC allocations are made? a simple hack perhaps
23:03:43*BitPuffin quit (Ping timeout: 245 seconds)
23:05:12ldleworkekarlso-: can you paste a simple example if you get that working
23:05:14*atomic-hedgehog quit (Ping timeout: 245 seconds)
23:05:28ekarlso-ldlework: hah, testing me or ? :p
23:06:00ldleworkekarlso-: I'm just curious
23:06:03ekarlso-;p
23:06:58ekarlso-ldlework: lemme see
23:07:10AraqEXetoC: you can use --gc:none and the compiler tells you
23:08:10EXetoCyeah I did something wrong
23:11:03*matkuki quit (Quit: ChatZilla 0.9.91.1 [Firefox 34.0.5/20141126041045])
23:12:46*Sphax joined #nim
23:13:05*Sphax quit (Client Quit)
23:15:36*Hakaslak joined #nim
23:16:34ekarlso-dom96: I was wondering if we could have nimble at a point have a register package call ?
23:16:44dom96sure
23:17:23ekarlso-and a release also (version etc)
23:20:51*mwbrown quit (Ping timeout: 252 seconds)
23:21:04*irrequietus quit ()
23:21:43*Demon_Fox quit (Quit: Leaving)
23:21:54*adam_s joined #nim
23:24:11*sillesta quit (Ping timeout: 256 seconds)
23:24:43VarriountHm.. Should I put in the "Common Conventions and Practices" guide to use something like koch for complicated make-like configurations?
23:25:05VarriountI mean, the compiler does it, and it works fairly well...
23:26:40fowlkoch should be a nakefile
23:31:56onionhammeryou should work on nimlime :p
23:35:11Varriountonionhammer: A) What should I do, B) I would, if you can do my math homework for me.
23:37:47EXetoCseems like a fair tradeoff
23:37:49flaviuVarriount: pfft, math.
23:38:32flaviuwho needs that?
23:39:26*adam_s left #nim ("Leaving")
23:45:24onionhammerVarriount semi-kidding. The main thing that needs to happen is idetools
23:51:07EXetoCflaviu: noobs