<< 26-07-2015 >>

00:06:58*askatasuna joined #nim
00:09:14bogenok, it is the nodecl
00:09:31bogenwithout it it is using C's default of an int return (32 bits)
00:24:01filwityeah C functions should be {.cdecl.} i think, which {.importc.} implies
00:24:32filwitof course, I don't really understand the difference between calling-conventions entirely
00:38:57*flaviu quit (Ping timeout: 252 seconds)
00:43:05bogenit is not a calling convention issue.
00:43:23bogenit is a prototype issue
00:51:39*flaviu joined #nim
00:52:26*flaviu quit (Read error: Connection reset by peer)
00:52:48*flaviu joined #nim
01:23:29*jaco60 quit (Ping timeout: 244 seconds)
01:43:35*vendethiel quit (Quit: q+)
01:45:01*mikolalysenko quit ()
01:45:11*mikolalysenko joined #nim
01:53:48*yglukhov joined #nim
01:58:29*yglukhov quit (Ping timeout: 256 seconds)
02:10:41*Kingsquee joined #nim
02:25:50*Varriount joined #nim
02:35:48*Varriount quit (Ping timeout: 264 seconds)
03:21:01*yglukhov joined #nim
03:30:52*darkf joined #nim
03:33:21*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
03:35:21*bjz joined #nim
03:53:14*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
04:02:03*yglukhov quit (Remote host closed the connection)
04:03:21*yglukhov joined #nim
04:28:04*askatasuna quit (Quit: WeeChat 1.2)
04:31:21*bjz joined #nim
04:34:17*yglukhov quit (Remote host closed the connection)
04:46:18*yglukhov joined #nim
05:03:04*Jesin quit (Quit: Leaving)
05:03:41*yglukhov quit (Ping timeout: 252 seconds)
05:05:40*yglukhov joined #nim
05:08:27perturbationhey all - a few days back (after building the compiler in debug mode to get better stack traces) I started getting a really weird error with compiling nre.nim. I traced it back as best I could, and I think it's two things:
05:08:37perturbationa) Weird eager evaluation with inlined iterators
05:09:06perturbationb) something very strange with how int.high is calculated in genArrayLen in ccgexprs.nim
05:09:31perturbationissue is https://github.com/nim-lang/Nim/issues/3140 - I'd really appreciate it if someone else can take a look :)
05:09:38perturbationbeen beating my head against the wall for a bit on this one
05:26:00*yglukhov quit (Ping timeout: 250 seconds)
05:28:33*yglukhov joined #nim
06:32:18*yglukhov quit (Remote host closed the connection)
06:36:06*yglukhov joined #nim
06:43:32*yglukhov quit (Remote host closed the connection)
06:53:12*Kingsquee quit (Ping timeout: 264 seconds)
06:54:23*filwit quit (Quit: Leaving)
07:00:53*yglukhov joined #nim
07:02:37*yglukhov_ joined #nim
07:02:38*yglukhov quit (Read error: Connection reset by peer)
07:25:22*elbow quit (Ping timeout: 272 seconds)
07:44:35*boopsiesisaway is now known as boopsies
07:59:11*dtscode quit (Ping timeout: 244 seconds)
07:59:46*dtscode joined #nim
08:01:33*jszymanski joined #nim
08:02:19*gmpreussner|work quit (Read error: Connection reset by peer)
08:13:21*yglukhov_ quit (Remote host closed the connection)
08:26:39*Matthias247 joined #nim
08:57:16*yglukhov joined #nim
08:58:25avsejis it possible to create an alias to the proc in nim?
09:01:47*yglukhov quit (Ping timeout: 256 seconds)
09:02:45dtscodelike var foo = the_proc?
09:04:30federico3how can I convert a string of bytes to an int?
09:05:02avsejdtscode, yes, I figured it out already. thanks
09:05:12dtscodeoh shit my bad
09:05:53avsejanother question is there generic version of pow()? I can see only float->float one imported from math.h
09:06:56dtscodeuuuuuuuuuhhhhhhhhhhhhhh
09:07:02dtscodethere might be one in system
09:07:56*zahary joined #nim
09:08:26dtscodenope. just one for floats and one for complex
09:08:53def-qqqq4
09:12:48dtscodeavsej: https://bpaste.net/show/f2a214c3c489
09:33:43avsejdtscode, :)
09:35:38dtscodeif that helps
09:37:24avseji know what means to raise number to a power, I just thought there is something builtin. like ** in ruby, but unlisted in the docs. it turns out that there is only standard pow(float, float) -> float from math.h
09:42:26*jaco60 joined #nim
09:56:55*X67r joined #nim
09:58:36*BitPuffin|osx quit (Ping timeout: 264 seconds)
10:19:25*jefus quit (Ping timeout: 256 seconds)
10:29:38*unclechu joined #nim
10:34:00*filwit joined #nim
10:34:20filwitping Araq
10:51:27*antrix joined #nim
10:52:54*antrix quit (Client Quit)
10:58:04*AckZ_ joined #nim
10:58:41*n1ftyn8__ joined #nim
10:58:48*bogen1 joined #nim
11:00:09*TylerE_ joined #nim
11:00:34*bogen-wo1k joined #nim
11:04:31*dtscodefish joined #nim
11:05:48*dtscode quit (*.net *.split)
11:05:48*bogen-work quit (*.net *.split)
11:05:48*DecoPerson quit (*.net *.split)
11:05:48*TylerE quit (*.net *.split)
11:05:49*clone1018 quit (*.net *.split)
11:05:49*AckZ quit (*.net *.split)
11:05:51*n1ftyn8_ quit (*.net *.split)
11:05:51*bogen quit (*.net *.split)
11:05:51*polde quit (*.net *.split)
11:05:51*EastByte_ quit (*.net *.split)
11:06:28*AckZ_ is now known as AckZ
11:06:59*TylerE_ is now known as TylerE
11:09:18*n1ftyn8__ is now known as n1ftyn8_
11:12:38*EastByte_ joined #nim
11:12:47*polde joined #nim
11:14:51*DecoPerson joined #nim
11:16:30*zahary quit (Ping timeout: 260 seconds)
11:16:40*clone1018 joined #nim
11:20:39*Strikecarl joined #nim
11:21:01StrikecarlHave anyone made a .js code highlighter for nim?
11:24:36*Trustable joined #nim
11:31:57reactormonkStrikecarl, huh? What would that be used for?
11:32:14StrikecarlCode highlighting
11:32:23Strikecarlwithout having to do it manually
11:33:29reactormonkYour editor should do that automatically?
11:34:01*Strikecarl quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
11:34:02dgellowgithub has syntax highlighting for nim
11:34:12*Strikecarl joined #nim
11:34:16StrikecarlAporia does yea
11:34:27reactormonkSo what exactly are you asking for?
11:34:35Strikecarlmy code on my website
11:34:44Strikecarli need it to have code hightlighting
11:34:51Strikecarlelse it looks so dull.
11:35:11Strikecarleg. Pastebin has it, it's called syntax hightlighting.
11:35:11reactormonkorg-mode + pygments or something like that ;-)
11:35:23reactormonkbut that would be staticl hl.
11:35:55reactormonkyeah, check if you can use pygments, that's what github uses IIRC
11:37:11dgellowgithub uses Linguist. But pygments also has a nim support http://pygments.org/languages/
11:37:51Strikecarlty
11:39:48*yglukhov joined #nim
11:44:30*yglukhov quit (Ping timeout: 260 seconds)
12:10:14*Strikecarl quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
12:22:42*vendethiel joined #nim
12:29:39dom96github used to use pygments
12:29:44dom96I wish they just kept using it...
12:51:22federico3hm, there is no sorted heap/queue in the standard library it seems
12:54:54*unclechu1 joined #nim
12:55:09*jefus joined #nim
12:55:57*unclechu quit (Ping timeout: 252 seconds)
13:06:58*zahary joined #nim
13:07:32*xet7_ joined #nim
13:11:39*xet7 quit (Ping timeout: 255 seconds)
13:35:48*mytrile joined #nim
13:49:02Araqfilwit: I don't get your forum post ;-)
13:49:42AraqIn fact, I don't understand anything ... you need to give more examples of what you're after
13:55:49filwitAraq: hmm, okay
13:56:26Araqbut I hope you considered the ABA problem for stacks exists
13:56:26dom96filwit: any progress on mascot?
13:56:41dom96Araq just told me he likes the Rust crab
13:56:55filwitdom96: no, but I'll take that into consideration
13:57:26dom96Now that I think about it though, maybe the honey badger isn't the right mascot for us, since bitcoin uses that?
13:57:54filwitAraq: originally I was just going to talk to you about my ideas on here, but figured it was a bit too long for IRC..
13:58:32filwitdom96: hmm.. well whatever works. but our logo is a crown and the history is an Archer, so maybe something that fit into that somehow?
13:59:37Araqfor example, stack = [a, b, c, <<MARK>>, d, e, f]
13:59:44Araq... GC runs ...
14:00:01Araqstack = [x, b, c, <<MARK>> ]
14:00:09filwitno it doesn't mark the stack, it adds a variable to the heap instance
14:00:24Araq--> mark position worthless
14:00:26dom96what do you mean "the history is an Archer"?
14:00:43filwitdom96: "Nimrod" was an archer in the bible
14:01:47dom96hrm, well, if you want to draw a bow, make it one of those modern ones.
14:03:06*BitPuffin|osx joined #nim
14:03:27filwitAraq: I'm not sure what you're saying exactly. My idea doesn't add anything to the stack, it just add's an extra int along side the ref-count to each heap object, then when the ref-count changes instead of scanning the stack for any potential references to zero-count objects, it simple see's if the current stack head is greater than each zero-count object (avoiding the scan)
14:04:07filwiterr... that int holds the literal address of the stack at the point of allocation
14:05:03Araqah ok
14:05:05filwitsince the stack memory always grows and shrinks, it's always in "order" right? (meaning, the locations of things on the stack depends on their position in the call order)
14:06:05filwitso the trade off is a slight bit of memory for scans
14:06:21filwitand since scans are the main concern with shared-memory, that could help?
14:07:32filwitdom96: a bow? i was thinking more along the lines of an archer or a king.. or a anthropomorphized version of somethings "kingish" or "archeryish"
14:07:54filwitmost mascots are animals I think
14:08:06Araqwhat if I have this: a -> x; b -> x where a and b are on the stack?
14:08:09filwitmaybe a lion (for king)?
14:08:23dom96maybe
14:08:26Araqi think every animal is already taken anyway
14:08:29dom96Araq's call.
14:08:33Araqand might get us into trouble
14:08:45AraqI think we should just use the crown
14:08:57Araqbbl
14:09:52filwitAraq: only the point of allocation is recorded.. so the first place 'x' is allocated will keep it alive until the stack-frame rolls back beyond the position any possible stack references could point to it.. thus you don't have to do stack-variable ref-counts but don't have to scan either
14:10:13filwitunless i understood your example wrong..
14:10:18filwitk, ttyl
14:10:58filwitdom96: we could always do something a bit more abstract..
14:12:12filwitdom96: like a symbol that's commonly used that isn't just the logo.. it's a face or figure or place that's associated with a crown somehow
14:13:18filwitor maybe we should just iconify the badger and see what Araq says then?
14:14:48*dom96_ joined #nim
14:15:12filwitdom96: anyways, just drop me a message here with your thoughts.. I'll scan logs even if I drop off after awhile.. going to switch gears for a bit.
14:15:16dom96_filwit: yeah, let's just go with the badger for now.
14:15:27dom96_Since you've already got it done
14:15:58filwitdom96_: okay, sounds good. I'll bbl
14:29:18*zahary1 joined #nim
14:29:18*zahary quit (Read error: Connection reset by peer)
14:29:24gokrHey guys
14:30:23dom96_hi gokr
14:59:50*mytrile quit (Remote host closed the connection)
15:03:56*Matthias247 quit (Read error: Connection reset by peer)
15:15:11*askatasuna joined #nim
15:23:03*dom96_ quit (Ping timeout: 246 seconds)
15:38:39*X67r quit (Quit: leaving)
15:58:40*Arrrr joined #nim
16:01:35*yglukhov joined #nim
16:03:32*yglukhov_ joined #nim
16:03:32*yglukhov quit (Read error: Connection reset by peer)
16:04:10*BitPuffin|osx quit (Ping timeout: 246 seconds)
16:08:12*yglukhov_ quit (Ping timeout: 264 seconds)
16:17:28*darkf quit (Quit: Leaving)
16:19:44*BitPuffin|osx joined #nim
16:27:03*xcombelle joined #nim
16:28:46*wuehlmau1 quit (Quit: Lost terminal)
16:40:32federico3how can I use a proc defined as: proc to[T](data: string): T ?
16:42:14dom96to[T]("foo")
16:43:23federico3where T is my type/class?
16:45:24federico3if so, it triggers a type mismatch at compile time
16:46:45federico3ok, it's this bug: http://forum.nim-lang.org/t/898
16:56:25*dalarmmst quit (Ping timeout: 240 seconds)
16:57:03federico3more bugs :(
16:58:16Arrrr:/
17:05:25*zahary1 quit (Read error: Connection reset by peer)
17:07:04dom96it works with () in the forum?
17:07:23federico3#3149
17:08:42federico3it works but I just run into #3149
17:09:05*dalarmmst joined #nim
17:11:15dom96federico3: replied
17:12:00federico3also, the example in the documentation is not working: Error: inheritance only works with non-final objects
17:15:33federico3urgh
17:16:15federico3thanks dom96 !
17:16:22dom96np
17:18:01federico3dom96: should I open an issue for the code in http://nim-lang.org/docs/marshal.html ?
17:19:16federico3it seems to be fixed with "TA = object of RootObj"
17:21:28dom96federico3: that's ok, just fixed it
17:24:03federico3thanks!
17:25:19*rgv151 joined #nim
17:26:42rgv151hi guys, where did `zipfiles` module done?
17:26:51rgv151gone*
17:27:42*arnetheduck quit (Ping timeout: 255 seconds)
17:31:00dom96I think Araq might have deleted it from the repo...
17:31:07dom96with the intention of moving it to a Nimble package
17:31:08*dtscodefish is now known as dtscode
17:31:16dom96and then never created that nimble package...
17:31:24def-rgv151: maybe this should become it: https://github.com/nim-lang/zip
17:31:54*mytrile joined #nim
17:40:45*filcuc joined #nim
17:46:33perturbationStrikecarl has already left by this point, but if others are interested in syntax highlighting for Nim, Rouge (https://github.com/jneen/rouge) has a regex based highlighter for Nim
17:47:26perturbationeasy to use with Jekyll, if you use that for blog posts (common for github pages)
18:03:50rgv151thx dom96 and def-
18:04:23*jh32 joined #nim
18:08:39*fold quit (Ping timeout: 255 seconds)
18:20:12*elbow joined #nim
18:33:29*jefus_ joined #nim
18:40:37*zaquest quit (Ping timeout: 252 seconds)
18:45:58*zaquest joined #nim
18:53:28*jefus quit (Quit: Leaving)
18:55:25*jefus_ is now known as jefus
18:59:19*Pisuke quit (Ping timeout: 252 seconds)
18:59:37*Sembei joined #nim
19:08:42Araqdom96: `$` for tuples/objects now handles a nil value correctly. Fixes #3149. why did you merge this?
19:09:46Araqit's stupid, if you want $ to work with nil, make $ to work with nil, don't make it work for object fields
19:19:34*aziz joined #nim
19:30:31onionhammeraraq dom96 https://github.com/onionhammer/nimble/commit/774ced2da7aa354025fbd6979056e7986df76fbd
19:31:03onionhammerprobably needs compiler support to get 'import' working properly
19:32:54*rektide quit (Remote host closed the connection)
19:37:58*Demos joined #nim
19:38:10*Demos quit (Remote host closed the connection)
19:38:29*Demos joined #nim
19:39:44*filcuc quit (Quit: Konversation terminated!)
19:39:53*rgv151 quit (Quit: rcirc on GNU Emacs 24.5.1)
19:51:59*Matthias247 joined #nim
19:55:15*aziz quit (Remote host closed the connection)
19:59:12*Arrrr quit (Quit: WeeChat 1.2)
19:59:19onionhammer@varriount you should check out typescript for sublime
19:59:31onionhammersomehow they've got really nice tooltips for functions
20:06:08dom96Araq: k
20:08:21dom96Araq: So you want me to edit all $ to work with 'nil'?
20:08:30Araqnah, I'm thinking about it
20:08:36Araqit's good enough for now
20:08:38Araqbbl
20:08:44dom96Araq: Then don't call my solution 'stupid'
20:09:30*fold joined #nim
20:11:16*unclechu1 quit (Quit: Leaving.)
20:20:09*wuehlmaus joined #nim
20:25:34*jszymanski quit (Quit: computer sleeps...)
20:55:42*Jehan_ joined #nim
21:02:05*xcombelle quit (Quit: Leaving)
21:04:31*Varriount joined #nim
21:09:02dom96onionhammer: please PR if you want me to review it
21:10:07*MatrixBridge quit (Remote host closed the connection)
21:10:22*MatrixBridge joined #nim
21:12:25dom96Araq: Could you add the module you removed from the compiler to Nimble?
21:19:31*Jehan_ quit (Quit: Leaving)
21:26:36*Jehan_ joined #nim
21:35:27*mytrile quit ()
21:38:29onionhammer@dom96 ok
21:53:23*sparrk joined #nim
21:54:18federico3what's the flag to enable colors?
21:54:51federico3I see colored output in aporia but maybe the editor itself is colorizing the output?
21:58:42sparrkIf I have C code that expects a struct, how do I create those structs in Nim?
22:01:02dom96federico3: in a terminal the compiler output should be colorised automatically
22:01:07dom96aporia does its own coloring
22:14:49*Jehan_ quit (Quit: Leaving)
22:15:01federico3oddly I'm not seein colors
22:17:13sparrkAlso, why does `high(uint)` give me an invalid argument error?
22:17:44*Jehan_ joined #nim
22:22:01Jehan_sparrk: May be a compiler bug, uint and uint64 are not in the list of types supported in compiler/semexprs.nim:semLowHigh, but uint8, uint16, and uint32 are.
22:22:19sparrkGotcha
22:23:08def-sparrk: https://github.com/nim-lang/Nim/issues/725
22:24:30sparrkAhhhhh
22:24:45sparrkThat actually answers another question I had def-
22:25:04sparrkI'm putting together example code for how to call Nim from Ruby
22:25:10sparrkand while I still need to figure out structs
22:25:19def-sparrk: a c struct should correspond to a nim object
22:25:39sparrkthe max value I can pass through the Ruby FFI seems to be int32
22:25:48sparrkeven though the high(int) reported 64
22:25:53*boopsies is now known as boopsiesisaway
22:26:00sparrk(signed int64)
22:26:11sparrkbut when I made everything explicit
22:26:15sparrkit worked
22:29:23*Demos quit (Remote host closed the connection)
22:31:20sparrkAnother question
22:31:59sparrkusing `-d:release` with `--app:lib` seems to break my extern pragmas
22:32:27sparrkshould I only use --app:lib?
22:33:02def-sparrk: that sounds like a bug, does it work if you switch the order of -d:release and --app:lib?
22:34:31*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
22:34:45sparrkcompiler indicates success on both orderings of the flags, but the Ruby FFI can no longer locate the function
22:38:08def-ah, it may be optimized away by dead code elimination
22:38:39def-you shouldn't use {.extern.}, that's just name mangling: http://nim-lang.org/docs/manual.html#foreign-function-interface-extern-pragma
22:38:54def-use {.exportc.} instead, right above
22:38:59*ozra joined #nim
22:39:25sparrkFancy!
22:39:33sparrkYou are most helpful def-
22:40:08sparrkBoom
22:40:11sparrkworks wonders
22:40:35def-great
22:40:36sparrkMan every day I love Nim a little bit more
22:40:48sparrkNow that I can call it from my Ruby code
22:40:52sparrkit is even more useful to me
22:51:18*Kingsquee joined #nim
22:59:54*Matthias247 quit (Read error: Connection reset by peer)
23:16:36*flyx quit (Ping timeout: 264 seconds)
23:20:15*Trustable quit (Remote host closed the connection)
23:27:25*Jehan_ quit (Quit: Leaving)
23:29:25*perturbation quit (Quit: Leaving)
23:32:52*gokr quit (Ping timeout: 244 seconds)
23:50:26sparrkI understand that "Ref objects should be used whenever inheritance is used." but is there any practical difference between `type Person = object` and `type Person = ref object of RootObj`? I ask because I can get the Ruby binding to work with plain object, but I cannot for ref objects and I want to know if there is something obvious I'm doing wrong.