<< 24-06-2015 >>

00:01:42*anthgur joined #nim
00:07:58*pregressive quit (Remote host closed the connection)
00:08:31*pregressive joined #nim
00:14:17reactormonkwu-lee, check my notes in the backlog
00:15:11reactormonkwu-lee, but sounds good, got some ideas on how to mess with the compiler to make it work directly?
00:16:52*pregressive quit (Ping timeout: 276 seconds)
00:16:55reactormonkwu-lee, try if you can get it work with passL
00:18:55wu-leejust been fiddling with passL
00:19:19wu-leeno success yet.
00:21:35reactormonkhow are you invoking the linker?
00:22:27wu-leeIn the Nim->C version which works, I'm not, I'm using avr-gcc to compile and link
00:22:51wu-leeit adds the crt*.o file magically
00:23:36wu-leewhen compiling with 'nim c', it seems to compile each .o file separately, and link in a final step
00:23:47wu-leeand so no magic file included.
00:24:15wu-leeI've tried guessing the right .o and adding it to passL, doesn't seem to work.
00:24:39wu-leesomething will work, but tonight I've burnt out again.
00:25:08wu-leehappy with this tiny step, time for some zzz
00:25:40wu-leetry again tomorrow.
00:35:45*brson joined #nim
00:37:11*vinnie left #nim ("Leaving")
00:44:22*tennix joined #nim
00:49:08*tennix quit (Ping timeout: 252 seconds)
00:52:28*BitPuffin|osx joined #nim
00:54:55*tennix joined #nim
00:58:16*codeswish joined #nim
01:03:09*yglukhov joined #nim
01:06:06*jaco60 quit (Ping timeout: 246 seconds)
01:08:02*yglukhov quit (Ping timeout: 272 seconds)
01:31:48*bjz joined #nim
01:34:27*bjz quit (Client Quit)
01:35:01*^aurora^ quit (Quit: My Mac has gone to sleep. ZZZzzz…)
01:35:29*dddddd quit (Ping timeout: 264 seconds)
01:40:28*BitPuffin|osx quit (Ping timeout: 255 seconds)
01:41:52*brson quit (Remote host closed the connection)
01:49:29*zodiak quit (Read error: Connection reset by peer)
02:07:58*anthgur quit (Quit: My Mac has gone to sleep. ZZZzzz…)
02:23:52*tennix quit (Remote host closed the connection)
02:26:08*tennix joined #nim
02:45:30*rgv151 joined #nim
02:48:23rgv151I get this error when I tried to load my Nim lib from C: "Unable to open library: ../libbogo.so: undefined symbol: cmdCount"
02:49:04*tennix quit (Remote host closed the connection)
02:49:15rgv151any advices?
02:51:07fowlThere's some notes in os.nim about that
02:51:39rgv151thx fowl, lemme check
02:52:21*pregressive joined #nim
02:54:09*darkf joined #nim
02:55:32*tennix joined #nim
03:01:47rgv151fowl: there is a not about getting command line from DLL, but I didn't use that API
03:02:52rgv151note*
03:19:08*tennix quit (Remote host closed the connection)
03:20:49*saml_ quit (Ping timeout: 264 seconds)
03:21:34*tennix joined #nim
03:49:18*pregressive quit (Remote host closed the connection)
03:58:26*tennix quit (Quit: Leaving...)
04:05:08*Jesin quit (Quit: Leaving)
04:18:07rgv151I got i it working w/ 2 empty function cmdCount and cmdLine
04:18:45rgv151new problem is I can't pass string to Nim proc
04:19:13rgv151it's empty in Nim proc
04:27:10*MatrixBridge quit (Ping timeout: 265 seconds)
04:29:29*vvova quit (Ping timeout: 265 seconds)
04:29:47*vvova joined #nim
04:34:21*delian66_ joined #nim
04:37:52*delian66 quit (Ping timeout: 265 seconds)
04:47:50*vvova quit (Quit: ChatZilla 0.9.91 [SeaMonkey 2.32/20150112202503])
04:48:08*charmander is now known as dtscode
04:48:32*vvova joined #nim
04:49:01*Demon_Fox quit (Ping timeout: 264 seconds)
04:49:05*Demon_Fox_ joined #nim
04:49:27*jszymanski joined #nim
04:51:29*rkj-b joined #nim
05:05:59*^aurora^ joined #nim
05:08:08*MatrixBridge joined #nim
05:08:34rgv151okay, its cstring, not string :)
05:11:24fowlrgv151: " Availability: On Posix there is no portable way to get the command line from a DLL"
05:12:43*FedeOmoto quit (Quit: Leaving)
05:19:23rgv151fowl: i c, that's why I implemented two those function in my C code
05:19:30rgv151and it's working now
05:19:36rgv151thanks you
05:47:18Xeavsej: can you build your nim stable COPR for fedora 21 x86_64?
05:51:03*Kingsquee quit (Quit: Konversation terminated!)
05:55:50*ChrisMAN_ quit (Ping timeout: 244 seconds)
05:59:18*gokr joined #nim
05:59:27*gokr quit (Read error: Connection reset by peer)
06:07:59*gokr joined #nim
06:15:51*vvova quit (Ping timeout: 246 seconds)
06:16:36*^aurora^ quit (Quit: My Mac has gone to sleep. ZZZzzz…)
06:17:48*rkj-b quit (Quit: ChatZilla 0.9.91.1 [Firefox 38.0.5/20150525141253])
06:22:39*^aurora^ joined #nim
06:29:54*JinShil joined #nim
06:30:18*jubalh joined #nim
06:32:19*yglukhov joined #nim
06:45:57*yglukhov quit (Quit: Be back later ...)
06:49:05*Ven joined #nim
06:55:35*bjz joined #nim
07:23:12*JinShil quit (Quit: Konversation terminated!)
07:29:57*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
07:44:26*fowl quit (Excess Flood)
07:45:06*fowl joined #nim
07:57:24*dalarmmst quit (Ping timeout: 252 seconds)
08:03:19avsejXe, yes
08:03:39Xethanks!
08:04:31avsejsubmitted: https://copr.fedoraproject.org/coprs/avsej/nim/build/100950/ lets see how it works
08:08:11*vikaton quit (Quit: Connection closed for inactivity)
08:15:01*yglukhov joined #nim
08:16:33*coffeepot joined #nim
08:22:06*aziz joined #nim
08:36:07*^aurora^ quit (Quit: My Mac has gone to sleep. ZZZzzz…)
08:59:39*gunn joined #nim
09:00:20*milosn quit (Quit: leaving)
09:15:27*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
09:15:30*vendethiel quit (Ping timeout: 252 seconds)
09:16:58*vendethiel joined #nim
09:30:03*delian66_ quit (Remote host closed the connection)
09:49:41r-kuxoring two uint32 results in RangeError. bug or not?
09:51:04*aziz quit (Remote host closed the connection)
09:51:55*jaco60 joined #nim
09:55:02*Kingsquee joined #nim
10:13:39Araqr-ku: bug
10:18:00*Ven joined #nim
10:19:10*coffeepot quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
10:19:32*coffeepot- joined #nim
10:43:33*Kingsquee quit (Quit: Konversation terminated!)
10:49:26*dddddd joined #nim
10:51:15*archie joined #nim
10:51:15*archie quit (Client Quit)
10:53:12*Uint2048 joined #nim
10:53:24*Uint2048 quit (Client Quit)
10:55:49*gunn quit (Quit: Textual IRC Client: www.textualapp.com)
11:45:54*aziz_ joined #nim
11:53:28*xcombelle joined #nim
12:09:41coffeepot-how do people return different values from one procedure? I got a proc where I want to return int|string|bool|float is this possible?
12:30:25*boopsiesisaway is now known as boopsies
12:32:06yglukhovcoffeepot, if the returned value type is runtime dependant, you may wrap it in a variant object
12:32:45yglukhovif it's known in compile time use generics/templates/overloads, whatever suits you
12:37:16coffeepot-thanks for the help yglukhov. It's for an SQL parameter function. The problem is, this is already in an object variant, but I want to be able to go: echo query.params["myparam"]
12:38:08coffeepot-I tried generics but the trouble is then the context defines the type in that going echo param["myparam"] enforces the return type to be string, where the param might be an int in the object variant
12:38:33coffeepot-for example
12:39:16yglukhovlet query.params["myparam"] be MyVariantType. define proc `$`(v: MyVariantType): string that switches over the type and calls appropriate `$§
12:39:45yglukhovthen it will be usable with echo
12:41:48coffeepot-I already have the `$` proc for the param obj variant so this would work. I guess I'm sort of trying to work out some kind of variant conversion to a concrete type without having to go 'case objVar.kind'. I guess this isn't really possible
12:42:15yglukhovhave you tried using converters?
12:43:13coffeepot-I could set up a mapping of data type to output type with generics, then use converters based on the two types, but that's more work than I had intended tbh
12:43:19yglukhovwell, anyways such implicit conversion is evil, imho. I guess you want your user to be aware that conversion may go wrong, so he is forced to handle invalid conversion
12:43:29coffeepot-yes, you may be right
12:43:50*aziz_ quit (Remote host closed the connection)
12:43:58coffeepot-setting params seems logical though with proc `[]=`*(params: var SQLParams, index: string, data: int|string|bool|float) =
12:44:26yglukhovyeah, writing is easy. parsing is not =)
12:44:29coffeepot-but reading them in a transparent way... maybe not so much
12:44:55coffeepot-:) ok thanks for your help, I think I'll abandon that and stick with returning the obj variant for now
12:45:41yglukhovor... an optional[T].
12:46:14coffeepot-btw, i did try templates, but same probs as generics. I kind of have this idea that it could be made to work with templates but probably not a good use of my time atm, better to just get the thing finished off
12:46:29coffeepot-is optional[T] in the stdlib now?
12:46:42yglukhovi think so
12:46:47coffeepot-cool :)
12:50:00coffeepot-thanks again yglukhov
12:50:09yglukhovno problem at all ;)
12:52:41*Gertm quit (Ping timeout: 256 seconds)
12:54:51*Gertm joined #nim
13:10:19*anthgur joined #nim
13:19:53*xcombelle quit (Quit: Leaving)
13:20:06*anthgur quit (Remote host closed the connection)
13:23:22gokrcoffeepot-: And you can also use objects and methods of course.
13:23:30gokrwhen you get sick of the case switching.
13:24:35gokrI started out building Ni using variants and case switching - worked for a while but then got ... messy as hell. Switched over to objects and use methods where needed (and procs where not needed) and it worked out much better. At least for me.
13:27:29coffeepot-gokr, what do you mean?
13:27:59gokrWhat I mean?
13:28:22coffeepot-yeah sorry, what do you mean by using objects and methods to avoid the case switching?
13:28:38coffeepot-as in proc asInt(...) ?
13:28:39*aziz_ joined #nim
13:29:02gokrobject variants + case switching is IMHO doing manually what dynamic dispatch with methods do automatically.
13:29:08*aziz_ is now known as aziz
13:30:26gokrWith an object variant - you only have one type, right? And you need to look at the "kind" field and decide what to do with it.
13:30:43gokrthe good part: you only have one type. The bad part: you only have one type.
13:31:26gokrWith objects and inheritance, you create a base type - and then inherit from it. Then you implement methods for the different concrete sub types.
13:32:06*aziz quit (Client Quit)
13:32:11gokrTada, dynamic dispatch. Use the base type - and then call your method, and Nim will of course dynamically dispatch to the correct method at runtime.
13:32:16coffeepot-ah yes I see what you mean
13:32:17gokrBut this is basic OO.
13:32:34coffeepot-that would make sense I think in my scenartio
13:32:37coffeepot-scenario
13:32:51*milosn joined #nim
13:32:57coffeepot-because I could have a base param and a distinguished type for all the params I wanted to deal with
13:33:02gokrYep.
13:33:03coffeepot-then as you say use methods
13:33:08coffeepot-:)
13:33:22coffeepot-trouble is I've already done it all as object variants :D
13:33:23gokrMy guess is that it pays off with objects and methods - the more polymorphic behaviors you have.
13:33:31coffeepot-totally
13:33:40gokrI started out with variants, but after a while it got really messy.
13:34:19coffeepot-object variants are really cool, but yeah anything more than a bit complex and it pays to use something more adaptable
13:34:22gokrI find Nim neat though - you can use procs whenever they work, and use methods when you need to.
13:34:40coffeepot-btw does an object var always use the max space it needs for it's components?
13:35:13gokrI presume not, you can't change the kind after creation, right? IIRC
13:35:34gokrOtherwise it would not seem like a good mechanism.
13:35:45coffeepot-like if you had an obj variant with byte and array[10, int] it would always be at least pointer size + overheads
13:36:08coffeepot-I'm not really sure how arrays work in object variants. I kind of presume they're not pointers unless ref
13:36:36coffeepot-so an array of 10 ints would take up space in the base variant even if the kind hasn't been set?
13:37:02coffeepot-you can switch branches in an object variant though as long as you reset it before
13:37:16*wan quit (Ping timeout: 272 seconds)
13:37:35coffeepot-I ask this specifically because I have an octree implementation at home I'm using that uses object variants with an array of refs
13:37:46*duban joined #nim
13:38:02*aziz joined #nim
13:39:03coffeepot-in pascal object variants always take up the size required for the largest item, but ofc this isn't pascal :)
13:39:18gokrHmm, you may be right.
13:39:34gokrBut... then they seem rather... silly to me.
13:40:00coffeepot-lol, well they are still useful, but something to bear in mind if so
13:40:14coffeepot-especially if you want an octree with millions of nodes
13:45:10*bjz joined #nim
13:45:40coffeepot-according to this fairly old thread http://forum.nim-lang.org/t/196 object variants compile to C unions, so it does seem like they take up the memory of the largest item
13:47:35coffeepot-... hmm i might rethink my octree implementation with inheritance to see if i can eek out some more memory after all :)
13:50:09*wan joined #nim
13:50:11*FedeOmoto joined #nim
13:52:55*milosn_ joined #nim
13:52:57*milosn quit (Read error: Connection reset by peer)
13:59:20*milosn_ is now known as milosn
14:15:00*askatasuna joined #nim
14:15:03*xcombelle joined #nim
14:20:32*jubalh quit (Quit: Leaving)
14:22:03*darkf quit (Quit: Leaving)
15:07:52*aziz quit (Remote host closed the connection)
15:11:30*doxavore joined #nim
15:16:13*ChrisMAN_ joined #nim
15:17:34Araqcoffeepot-: usually using an aditional ref for the array part works better than inheritance in this case. ymmv
15:20:33*jszymanski quit (Quit: computer sleeps...)
15:24:04boopsiesdoes anyone know how lexim works? (if it even does)
15:25:16Araqi wrote it
15:29:01*boopsies nods
15:29:21boopsiesi've tried to build leximt and call it on the ex1.lex file but it's erroring
15:29:30boopsiesis it usable?
15:34:43coffeepot-araq thanks for mentioning that. I actually do use a ref to an array for the octree branches (had forgotten I'd changed that from a non-ref), so it's nice to know I'm on the right track :)
15:38:50*Mat4 joined #nim
15:38:57Mat4hello
15:40:13reactormonkAraq, you really want all the text about whitespace in the contributing guide?
15:40:31*fowl quit (Excess Flood)
15:42:07Araqreactormonk: i'll remove later what I consider foolish from the contributing guide
15:42:09*fowl joined #nim
15:42:14reactormonkAraq, so be it
15:42:29Araqboopsies: it is usable afaict but ex1.lex is just some cruft
15:42:38Mat4I would like to suggest thinking about a library for data transformations. Something like map and other typical operators would be helpful
15:42:41AraqI'm busy, will tell you later how to use it
15:43:10AraqMat4: we have map in system.nim and lots of more in sequtils.nim please check it out before complaining ;-)
15:43:18reactormonkMat4, nah, just add concepts to the stdlib
15:43:40Mat4Araq: I will take a look
15:47:54*Shoozza left #nim ("Leaving")
15:48:30boopsiesAraq: alright, thanks!
15:56:35*aziz joined #nim
15:56:36*elbow joined #nim
16:03:13*yglukhov quit (Ping timeout: 250 seconds)
16:03:53*kashyap__ joined #nim
16:05:15kashyap__Hi, I want to try loading DLL's written in nim inside a nim program. How can I do it? I started looking at dynlib module for this but looks like none of the impure libraries use it ...
16:07:29*Arrrr joined #nim
16:13:36*Mat4 quit (Quit: Verlassend)
16:14:26ArrrrAraq, you said once you wanted to change methods. What dont you like?
16:14:49ArrrrAlso, i wonder if they are efficient when you have tens of subtypes
16:16:48*coffeepot- quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
16:20:54*Matthias247 joined #nim
16:23:33*pathetic joined #nim
16:23:52patheticIs there any websocket packages?
16:45:01*pathetic quit (Ping timeout: 246 seconds)
16:49:31*brson joined #nim
16:51:53kashyap__okay .... the dll worked for me after following the instructions from FFI section of the manual ....
16:52:36kashyap__How can I re-load a DLL though ... using the FFI steps, I dont explicitly load the library, so how can I reload?
16:58:18ArrrrI suppose you'll have to search how that works in C
16:59:24FedeOmotoin C it's dlopen() dlclose()
17:00:20FedeOmoto(Linux)
17:00:49FedeOmotoon Windows it's LoadLibrary() and FreeLibrary()
17:11:11*duban quit (Ping timeout: 248 seconds)
17:11:43ArrrrI found this while fighting against opengl http://nim-lang.org/docs/dynlib.html#loadLib,string kashyap__
17:12:21FedeOmotoyou can use loadLib and unloadLib from the dynlib module, calling unloadLib until the reference count on the dynamic library handle reaches zero
17:13:00kashyap__interesting ... how do I call a function that I get the address to using symAddr ....
17:13:12kashyap__casting a pointer to a proc does not seem to work
17:14:03ArrrrI found it here https://github.com/nim-lang/opengl/blob/master/src/opengl.nim#L59-L71
17:14:41kashyap__cool ... thanks Arrrr
17:15:33FedeOmotoyeah, casting should work
17:15:56*doxavore quit (Quit: I said good day, sir.)
17:16:52kashyap__cool ... btw while looking I found this really cool video series - https://www.youtube.com/watch?v=Ee3EtYb8d1o
17:17:03kashyap__game development from scratch
17:18:12*doxavore joined #nim
17:18:25ArrrrI'll give it a shot, i need to learn stuff from c
17:18:54kashyap__We can get the ideas from there and implement in nim :)
17:20:17boopsiestrying to use lexim aand..
17:20:19boopsieslib/nim/core/typeinfo.nim(125, 20) Error: VM is not allowed to 'cast'
17:20:22boopsies:s
17:20:25boopsiesis that a new restriction?
17:21:41ArrrrI got that error yesterday, i was told it is because you cant do that action in compile time
17:22:59boopsiesyeah
17:23:04boopsiesthis is in a lib though
17:23:12boopsiesi assume it used to work..
17:23:22*dalarmmst joined #nim
17:23:26*Matthias247 quit (Read error: Connection reset by peer)
17:26:12*jszymanski joined #nim
17:32:28AraqArrrr: I think we have a 'methods' tag for the git issues.
17:32:38Araqthis is what I don't like, they are broken :P
17:34:01Araqboopsies: now ... let's see
17:36:24boopsiesAraq: i think i figured out how it's meant to work, but it's complaining about VM casting..
17:41:58*vasher_ joined #nim
17:44:42ArrrrWill you fix methods for 1.0 ?
17:46:38AraqArrrr: yes, I think so
17:47:30Arrrrgreat!
17:47:32Araqmy plan is to introduce for 0.11.4 a warning "picked foobar as a dispatcher, declare it explicitly" and then mandate it
17:48:23Araqthe most pressing problem is that the compiler "guesses" which method is the starting point for dispatching causing all sorts of trouble
17:50:28*kashyap__ quit (Ping timeout: 246 seconds)
17:50:30ArrrrI saw, when calling a method it just generate an if-else for each possible type. What if i have 100+ childs of one type
17:52:23Araq*shrug*
17:53:12Araqwe can optimize it later
17:53:33ArrrrHahah. So, i should use in that case proc pointers, right?
17:53:42*Jehan` joined #nim
17:53:58Araqsounds reasonable
17:55:46Araqboopsies: you need to compile the 'lexe' helper via 'nim c lexe' and then you can run the example in lexim
17:56:01Araqworks for me with devel and I'm quite sure I tested it with 0.11.2
17:56:33*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
17:57:28boopsiesAraq: hmm, i'll give it a shot!
18:03:40*^aurora^ joined #nim
18:07:50federico3any way to "cast" the output of a map() to a fixed-size array?
18:08:41Araqfederico3: no.
18:09:03Arrrrany way to forward declare a type ?
18:10:00AraqArrrr: no, mutually recursive types need to be in a single 'type' section
18:10:09federico3essentially the opposite of "@", although it would be nicer if map() was populating the array directly
18:10:25Jehan`You can use type parameters to work around it, too, Arrrr.
18:10:40ArrrrType parameters?
18:15:50Araqgenerics.
18:16:22federico3how about converting a seq into a tuple?
18:18:41Araqthere is a tuples nimble package for that or something
18:21:19*infinity0 joined #nim
18:21:33boopsiesAraq: nim c lexim.nim spits out "lib/nim/core/typeinfo.nim(125, 20) Error: VM is not allowed to 'cast'"
18:22:32fowlfederico3: why dont you just use map on an array and modify it
18:22:42infinity0any chance of a 0.11.3 "soon"? the debian package is mostly good to go, but i'd rather not include the entirety of 87f65f5 as a patch
18:23:17fowlfederico3: and no you can't just make up a tuple at run time
18:23:55Araqinfinity0: I can try, but no promises
18:24:06infinity0ok, thanks
18:24:27Araqboopsies: what is your Nim version?
18:25:56boopsies0.11.2
18:27:12boopsiesdevel that I have on https://github.com/nim-lang/Nim/commit/6820b2fea919c033405e7e204343fddd947c2ef3
18:27:14boopsiesgives..
18:27:34boopsieshttp://hastebin.com/dowegaqefi.avrasm
18:27:51boopsiesi'll try pulling and building latest
18:28:46*duban joined #nim
18:31:04Araqboopsies: that means 'lexe' returned an empty string for some reason
18:31:18boopsieshmm..
18:32:39Araqprobably because on unix it cannot find the exe cause it doesn't start with ./ or some other nonsense
18:33:29boopsiessounds like it
18:35:32boopsiesyep
18:35:34boopsiesPATH=$PATH:. ~/devel/nim/bin/nim c lexim.nim
18:35:36boopsiesworks fine
18:35:52boopsiesstill get the cast error on 0.11.2 though
18:36:35Araq0.11.0 says:
18:36:37Araq- ``marshal.$$`` and ``marshal.to`` can be executed at compile-time.
18:36:51Araqso ... not sure, it really should work
18:37:01boopsieswell- it works on devel :)
18:48:14*brson quit (Ping timeout: 272 seconds)
18:48:22Arrrrwhen everything else fails ... devel
18:57:09*fowl quit (Excess Flood)
18:58:45*fowl joined #nim
19:06:33*yglukhov joined #nim
19:06:58*brson joined #nim
19:07:54*vikaton joined #nim
19:10:26*ozra_ joined #nim
19:10:49Araqhi ozra_ welcome back
19:11:05ozra_Hey Araq!
19:13:04vikatonhi
19:14:06*fowl quit (Excess Flood)
19:14:16*fowl joined #nim
19:14:16*fowl quit (Changing host)
19:14:16*fowl joined #nim
19:14:16*fowl quit (Changing host)
19:14:16*fowl joined #nim
19:14:49*Trustable joined #nim
19:16:49ArrrrHello ozra_, we missed your PRs
19:17:46*vendethiel- joined #nim
19:17:47*vendethiel quit (Ping timeout: 246 seconds)
19:18:24*elbow quit (Remote host closed the connection)
19:19:37ozra_Arrrr: I digged and digged in that generic inheritance thing, but every attempt bubbled up a bug in a different place, finally I realized I need more brains and/or time to fix that one. Haha. But I got together a good set of debugging utils.
19:20:58Araqbummer
19:23:15*^aurora^ quit (Quit: My Mac has gone to sleep. ZZZzzz…)
19:25:09ArrrrOk, as long as you share them with us *sexy wink*
19:26:35ozra_Arrrr: Well, it's just macros around guarded echos, unix-style coloring and some node/type dumpers with another format then the internal.. So..
19:27:30Arrrrunix-style coloring?
19:28:54ozra_Arrrr: Ah, term escape-codes... ```DBG "shit goes down here:".red.bold, someVar.blue.bold, otherVar.yellow``` kinda mini helper
19:30:23ozra_just wraps strings in esc color + reset...
19:42:46Araqozra_: well what you should do is ask me when the problems are overwhelming you
19:43:13*Matthias247 joined #nim
19:52:36ozra_Araq: Yeah, it was hard to get a grip on the flow through the compiler, I must have been in every file in there, haha. So I did those debug-dumpers to try and get better aquainted with the data structures of the type graphs and the ast. I'm ruining the schedule for my proj, so I just had to drop that one :-/.
19:53:36*^aurora^ joined #nim
20:07:25*filcuc joined #nim
20:12:23*Arrrr quit (Quit: WeeChat 1.2)
20:28:29*Mat4 joined #nim
20:31:19Mat4Araq: I have taken a look at the functional operators in the libraries. These are nice opportunities. However what I had in mind are mapping function from multible members of structured data to each other
20:32:15Mat4^functions
20:35:29*xcombelle quit (Quit: Leaving)
20:35:42*jubalh joined #nim
20:35:51*Trustable quit (Remote host closed the connection)
20:37:55ozra_dom96: If you're around: I made a tricky fix to safen the highlighting even if github chops off the code in the middle, or whatever. So fingers crossed, a lot of issues with it should be gone now.
20:39:07ozra_Varriount_: ping. PR should be pulled asap..
20:40:01*wan quit (Ping timeout: 264 seconds)
20:45:09Mat4by the way what was the correct syntax for writing an uint8 to a dynamic allocated memory buffer (pointer) ?
20:46:57Mat4cast[array[0..n, uint8]](pVariable+offset) = value ?!???
20:52:24*wan joined #nim
20:55:46*duban quit (Ping timeout: 276 seconds)
21:03:07FedeOmotocast[ptr array[0 .. n, uint8]](pVariable)[0] = value
21:03:29*gyeates quit (Ping timeout: 246 seconds)
21:03:41*aziz quit (Quit: Leaving)
21:05:19FedeOmotoor more correctly: cast[ptr array[0 .. n, uint8]](pVariable)[offset] = value
21:13:18Mat4thanks, try it
21:13:56dom96ozra_: I'm wondering if github actually does that for diffs, or whether they still highlight the whole file.
21:15:55*miglo joined #nim
21:18:15ozra_dom96: Yeah, it sounds like a hap hazard thing to do, so they likely don't. In any event, the change breaks nothing, it only highlights num literals even though they're not compilable correct. Err on the safe side...
21:22:58reactormonkOn to something more productive, could someone help out https://github.com/nim-lang/Nim/pull/2984 ?
21:23:29*yglukhov quit (Quit: Be back later ...)
21:25:17Xeis nim's syntax derived from pascal?
21:25:50Mat4I bet Pascal was of influence
21:30:50fowlThe compiler was written in pascal originally
21:31:10fowlAnd pas2nim came before c2nim iirc
21:31:50*Kingsquee joined #nim
21:32:13*Kingsquee quit (Client Quit)
21:33:46Jehan`Pascal was an influence, but the syntax is really more Python-inspired, I'd say.
21:34:30migloif I create a type like "type T = object"with some properties and then a variable "var t: T" is "t" already pointing to an object on the stack or is it just some sort of reference to which I have to assign an object via "t = T()"?
21:34:33*jubalh quit (Quit: Leaving)
21:35:33Jehan`instances of "object" types don't "point" anywhere. They _are_ instances of that type.
21:35:47Jehan`They exist either in global memory or on the stack.
21:36:13Jehan`But the concept of "pointing" makes no sense for such variables.
21:36:15fowlmiglo: its like a c struct, but var s: T will initialize it to 0
21:36:30fowlmiglo: so its fields will be nil or 0
21:36:35miglook, thanks
21:37:29miglobut in case of "type T = ref object" the corresponding var is just a pointer?
21:37:38Jehan`Yes.
21:38:10migloso I have explicitly create an object on the heap via "new T" and assign it to the var
21:38:43fowlYou can use the constructor T()
21:39:12fowlIt is nil by default
21:40:07migloso, it could be "new t" or "t = T()"
21:41:20*jszymanski quit (Quit: computer sleeps...)
21:49:01*filcuc quit (Quit: Konversation terminated!)
21:50:14*FedeOmoto quit (Quit: Leaving)
21:50:22*Mat4 quit (Quit: Verlassend)
22:01:03*doxavore quit (Quit: I said good day, sir.)
22:09:00migloHmmm, so if I have "type A = object" then "var f: A" results into the same as "var f = A()", but in the former f is initialized with defaults and in the latter I could assign an already initialized object via its constructor to f
22:10:08*dalarmmst quit (Ping timeout: 256 seconds)
22:12:50*askatasuna quit (Ping timeout: 252 seconds)
22:15:01migloanother case...if I have a base type like "type base = ref object" from which other types are derived from must those derived types be also "ref object" and would it be wrong to declare them just as "object of base"?
22:17:31migloHmm, probably not in nim's multi-method paradigm
22:18:00migloit depends, I guess
22:22:07*dalarmmst joined #nim
22:31:21*pregressive joined #nim
22:34:59*miglo left #nim ("http://quassel-irc.org - Chat comfortably. Anywhere.")
22:38:25*vendethiel- quit (Ping timeout: 250 seconds)
22:39:25*pregressive quit ()
22:40:37fowlMeh
22:50:23*boopsies is now known as boopsiesisaway
22:55:27*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
22:57:04*ozra_ quit (Ping timeout: 246 seconds)
22:58:10*Jehan` quit (Quit: Leaving)
23:02:05*Matthias247 quit (Read error: Connection reset by peer)
23:08:43*gyeates joined #nim
23:11:31*milosn quit (Ping timeout: 255 seconds)
23:13:22*milosn joined #nim
23:15:43federico3how can I print truncated/rounded floats?
23:16:16Varriount_federico3: http://nim-lang.org/docs/strutils.html#formatFloat,float,FloatFormatMode,range[]
23:16:54federico3thanks
23:19:01federico3I miss Python's old-style string formatting
23:22:14Varriount_federico3: Psh, I miss Python's new-style string formatting.
23:23:27federico3well, I find old-stile more practical and quicker to use
23:25:17*Varriount_ is now known as Varriount
23:27:36apenseAnyone know why comments in templates like https://github.com/nim-lang/Nim/blob/master/lib/system.nim#L3259 don't show up in the documentation (http://nim-lang.org/docs/system.html#..^.t,expr,expr)
23:30:23*vendethiel joined #nim
23:30:41Varriountapense: If I had to hazard a guess, that comment wasn't added until April 21st. The documentation was generated at "2015-05-04 19:40:47 UTC" which, if you consider the last number to be the month, means that the code is newer than the documentation.
23:39:34*MyMind quit (Ping timeout: 276 seconds)
23:40:13*Pisuke joined #nim
23:46:39*doxavore joined #nim
23:51:43*vendethiel quit (Ping timeout: 248 seconds)
23:58:31apenseVarriount, thanks! I think you're right. shouldn't the documentation be updated when there is a new release? 0.11.2 was on May 4. Seems like new docs would go for each release
23:59:31*fowl quit (Excess Flood)