<< 19-02-2015 >>

00:01:57*rkj-b joined #nim
00:04:35*davidhq quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
00:05:00*kjo1 quit (Quit: Leaving.)
00:08:12*elasticdog joined #nim
00:12:41*shalabh quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
00:13:13NhanHIs there any simple image reader library? Basically I just need to read image of the common format into a matrix of RGB pixel
00:16:40*davidhq joined #nim
00:20:50*rkj-b quit (Ping timeout: 246 seconds)
00:21:28SharchoNhanH: in the standard library there are wrappers for FreeImage and DevIL
00:23:46Sharchoalso sdl_image and bpl
00:26:46NhanHsdl seems a bit overkill for that purpose, I'm looking at the rest. Thanks!
00:31:33*gokr quit (Read error: Connection reset by peer)
00:31:37*JinShil joined #nim
00:32:48*filwit joined #nim
00:34:54*nimnoob123 joined #nim
00:38:19*filwit quit (Quit: Leaving)
00:44:08*davidhq quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
00:44:13*johnsoft quit (Ping timeout: 250 seconds)
00:44:47*johnsoft joined #nim
00:48:17*zahary quit (Read error: Connection reset by peer)
00:48:49*zahary joined #nim
00:50:11reactormonkany way I can tell nim NOT to exclude a proc via deadcodeelim?
00:50:20*zahary quit (Client Quit)
00:51:17*akiradeveloper quit ()
00:51:26*zahary joined #nim
00:53:17reactormonk???(???, ???) Error: identifier expected, but found '"comment_s"'
00:53:21reactormonk:-/
00:53:55*rapind joined #nim
00:57:33*lavender joined #nim
01:00:07Sharchoreactormonk: you can either use --deadCodeElim:off or you could try, if false: myfunc()
01:01:07*shodan45 quit (Quit: Konversation terminated!)
01:06:36*milosn quit (Read error: Connection reset by peer)
01:07:42*kjo1 joined #nim
01:11:52*wb quit (Ping timeout: 240 seconds)
01:12:16*milosn joined #nim
01:14:02*rapind quit (Remote host closed the connection)
01:16:03*rapind joined #nim
01:16:06*Sharcho quit (Quit: Leaving)
01:21:33*rkj-b joined #nim
01:26:21*Hakaslak joined #nim
01:26:51*infinity0 quit (Ping timeout: 250 seconds)
01:26:56*infinity0_ joined #nim
01:26:56*infinity0_ quit (Changing host)
01:26:56*infinity0_ joined #nim
01:26:56*infinity0_ is now known as infinity0
01:36:32*RayoGundead quit (Quit: Page closed)
01:38:43*Hakaslak quit (Quit: TODO: Generate 'Computer Sleep Quit Message')
01:40:02*kjo1 quit (Quit: Leaving.)
01:41:07*rapind quit (Remote host closed the connection)
01:42:31*pregressive quit (Remote host closed the connection)
01:46:29*pregressive joined #nim
01:46:29*pregressive quit (Client Quit)
01:54:26*rapind joined #nim
01:56:46*rapind quit (Remote host closed the connection)
01:59:23*brson quit (Quit: leaving)
02:03:52rkj-bI have only a tiny bit of computer language knowledge, mostly learned a bit of C in school. I stopped messing with it when the pointers looked to destroy my hard drive. I can't type for S**t. I ned a decent language to math logic project. Nim seems about right. They say "easy to learn"/ Good.
02:05:51rkj-bSpecifically, is it reasonably less complicated than Rust?
02:06:18*Trustable quit (Remote host closed the connection)
02:08:50*chemist69_ joined #nim
02:09:43flaviuNim has complicated stuff in it, but it's easy to avoid. From what I understand, most of Rust's complexity comes from borrowed and unique pointers, which Nim does not have.
02:10:19rkj-bAlso, I am looking to get rid of Windows. I want PCLinuxOS, which is free of systemd (which sounds like a disaster in the making).
02:10:23def-rkj-b: I would say so. You could dive deep into macros and advanced stuff, but if you don't want to, you'll never touch that.
02:10:54def-Nim should work fine on Windows, Linux and Mac
02:11:52*chemist69 quit (Ping timeout: 240 seconds)
02:15:02rkj-bI think I can handle pointer stuff now. No big mystery. What I worry about is a dump-truck full of bells & whistles. (like C++). If I use PCLinuxOS I look to be likely to need to compile everything. I tried that with OCaml. The French seem to own it. Filled my hard drive with weird C compiler stuff!!!
02:15:02reactormonkHm. I can't seem to get the {.emit.} macro to produce the code I want. With {.emit: "`sAction`".} inside a quote do ... it doesn't replace it with the actual string. With result.add(newNimNode(nnkPragma).add(newNimNode(nnkExprColonExpr).add(newIdentNode("emit"), newStrLitNode(action)))) I get some strange error message.
02:17:03def-reactormonk: full code with the strange error message?
02:17:23*sampwing quit (Ping timeout: 252 seconds)
02:17:34reactormonkdef-, ???(???, ???) Error: identifier expected, but found '"comment_s"'
02:17:53reactormonkdef-, http://pastie.org/9960928
02:21:33def-the problem isn't coming from where you think
02:21:40def-it's from the "proc `sToken`(fpc: uint) ="
02:22:49def-i think that just doesn't work with quote?
02:23:43def-you could go one step deeper and instead of "quote", build the actual procedure
02:23:50def-as an AST directly
02:24:43reactormonkhmm, let's see
02:25:15reactormonk sTokenIdent = ident(sToken)
02:25:17reactormonkthat solves it
02:25:43def-interesting
02:25:50reactormonkAny way I can make sure the dead code elim doesn't kill either of the procs?
02:26:20def-why?
02:26:37*darkf joined #nim
02:26:52reactormonkbecause I'm going to be using them from C.
02:27:20def-exportc and *
02:27:45def-hm, doesn't seem to work inside quote either
02:27:53reactormonkfrom C in the same file, so the * isn't really required. Actually, I don't want to expose them to the other nim libs.
02:28:46def-{.deadcodeelim: off.}
02:28:52def-at the start of the file?
02:29:19reactormonksounds good to me
02:30:09reactormonknope, the procs still don't get generated
02:31:37def-maybe because you create them inside of a proc?
02:31:43nimnoob123alright I get how to set individual setters for object types, but how would I let a method modify an object property? I feel like I'm missing something obvious after reading different information sites on nim
02:32:26flaviuHow about creating a repo for filwit's art in the nim-lang org?
02:32:43def-flaviu: yes, should filter out the logo and other used stuff and do that
02:32:54reactormonkError: invalid pragma: deadcodeelim: off
02:32:58reactormonk... when pushing it
02:33:22def-nimnoob123: proc modifySth(x: var MyObject) = ...
02:33:26def-reactormonk: yes, can't be pushed
02:33:51nimnoob123hmm let me try that again
02:33:55reactormonkdef-, hm. How can I push stacktrace:off into code generated by a macro?
02:34:42def-reactormonk: write the code as you want it to come out and use dumpTree to see how
02:34:49reactormonkdef-, point taken
02:34:58def-(That means I don't know)
02:37:29nimnoob123oh I'm retarded, thanks def-, I tried that earlier and idk I guess I messed up somehow. works though
02:38:03reactormonkdef-, nope. :-/
02:38:22reactormonkhow do I ask the macro stuff to output me the generated code?
02:38:50def-reactormonk: echo result.repr at the end
02:39:24def-reactormonk: what you're doing looks pretty complicated
02:39:31reactormonkdef-, and insane
02:39:57*lavender quit (Ping timeout: 265 seconds)
02:40:52def-i also auto-created a bunch of procs/templates once, but only with templates: https://github.com/def-/nim-units/blob/master/units.nim#L23-L26
02:41:17reactormonk{.push, stacktrace: off.}
02:41:26reactormonkbut I Want {.push stacktrace:off.} :-/
02:42:39*papabalyo joined #nim
02:42:59def-make the "stacktrace:off" a child of "push" maybe
02:43:57reactormonknope, segfault
02:47:30*saml_ joined #nim
02:48:32papabalyoHi there! Nim newbie is here. I'm trying to use httpclient package to access REST api, but for some reason when I provide port number in URI it automatically returns 404 (like this echo(get($parseUri("http://localhost:8888/api/something")).body)) when I curl the same URL it returns 200 and valid JSON. Any ideas what can be wrong?
02:49:04papabalyowhen I do the same get and redeploy local server on port 80 everything works fine
02:49:35def-papabalyo: using nim 0.10.2?
02:49:47papabalyoyes
02:50:01def-httpclient is broken in 0.10.2, you should try with the devel branch from github
02:50:37papabalyoOK, will do. Thanks def- !
02:51:30*lavender joined #nim
02:52:19def-You're welcome, papabalyo. I hope 0.10.4 comes out soon, lots of people stumbling over broken httpclient
02:52:44*rapind joined #nim
02:53:40def-and it's probably easier to just do "echo getContent(http://localhost:8888/api/something")"
02:54:16def-with parseUri you translate the string into an URI, then with $ you translate it back into a string
02:54:42def-and getContent is the convenience proc for get(...).body
02:56:47*ob_ joined #nim
02:56:59*rapind quit (Ping timeout: 246 seconds)
03:00:53*JinShil quit (Remote host closed the connection)
03:02:18reactormonkdef-, I assume any sigsev goes to github issues?
03:08:11nimnoob123not going to lie, feels good when things start to work after a few hours of learning lol
03:08:39reactormonkdef-, actually, I still get the incorrect produced code with
03:08:41reactormonk result.add quote do:
03:08:43reactormonk {.push stacktrace: off.}
03:13:23reactormonknope, the result is correct.
03:13:34reactormonk{.push, stacktrace: off.} works too.
03:17:58*papabalyo quit (Quit: Page closed)
03:21:17reactormonkhttps://stackoverflow.com/questions/28598093/remove-stacktraces-from-an-emit-pragma let's do it this way :-)
03:23:12nimnoob123anyone know how to get rid of the sdl2 'Event' error regarding you can't prove the event was initialized?
03:23:20nimnoob123warning*
03:36:00*lyro quit (Ping timeout: 252 seconds)
03:36:58*lyro joined #nim
03:43:13nimnoob123def- https://github.com/nim-lang/sdl2/issues/26 since ProveInit is going to be a compile error soon
03:43:37*Woflox quit (Ping timeout: 250 seconds)
03:51:30*rapind joined #nim
03:53:17*lyro quit (Ping timeout: 246 seconds)
03:53:33dhasenanIs there a way to tell nim that an imported C++ type is templated so it shouldn't try to call sizeof() on it without template arguments?
03:53:43*lyro joined #nim
03:55:02*brson joined #nim
04:09:50*chemist69 joined #nim
04:11:11*chemist69_ quit (Ping timeout: 246 seconds)
04:13:29*rapind quit (Remote host closed the connection)
04:17:08*rkj-b quit (Quit: ChatZilla 0.9.91.1 [Firefox 35.0.1/20150122214805])
04:22:17*TEttinger joined #nim
04:23:53*Hakaslak joined #nim
04:24:46*nande quit (Remote host closed the connection)
04:29:20*Hakaslak quit (Remote host closed the connection)
04:29:53*Hakaslak joined #nim
04:33:04*ehaliewicz joined #nim
04:36:40dhasenanIf I am wrapping a C++ type in Nim, should I omit private fields?
04:37:08reactormonkdhasenan, probably
04:39:57*nimnoob123 quit (Quit: Page closed)
04:49:42Triplefoxi was just going to mention that ProveInit issue with sdl2 too...just got the latest and had to go through renaming all my api calls and finally arrived back at that darn warning again
04:49:45*fungos quit (Quit: No Ping reply in 180 seconds.)
04:51:01*fungos joined #nim
04:53:03*rapind joined #nim
04:57:27*rapind quit (Ping timeout: 250 seconds)
05:00:19*dyu joined #nim
05:02:43VarriountHm. It occurs to me that it should be possible to create python-esque generators in C via procedure casting and argument inspection...
05:03:19VarriountI wonder if it's feasable to do it with the Nim compiler...
05:13:09*saml_ quit (Quit: Leaving)
05:13:29*reem quit (Remote host closed the connection)
05:25:13*Hakaslak quit (Quit: TODO: Generate 'Part & Quit Message')
05:33:07*reem joined #nim
05:40:01*lavender quit (Ping timeout: 264 seconds)
05:44:57*lavender joined #nim
05:53:53*reem quit (Remote host closed the connection)
05:58:28*reem joined #nim
05:59:00*fizzbooze joined #nim
06:31:50*pafmaf joined #nim
06:35:34*JinShil joined #nim
06:40:11*bjz joined #nim
06:59:34*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
07:05:00*ehaliewicz quit (Ping timeout: 252 seconds)
07:09:37*Boscop joined #nim
07:14:25*rapind joined #nim
07:15:10*gokr_ joined #nim
07:18:47*rapind quit (Ping timeout: 252 seconds)
07:18:48*reem quit (Remote host closed the connection)
07:27:11*bjz joined #nim
07:30:22*Demon_Fox quit (Remote host closed the connection)
07:30:53*fowl quit (Ping timeout: 252 seconds)
07:32:25*fowl joined #nim
07:33:13Araqdhasenan: 'importcpp' prevents 'sizeof' generation, in general. maybe there is still a bug left in the codegen?
07:33:42Araqor maybe you need to update your Nim devel version
07:34:24*reem joined #nim
07:34:37*gokr_ quit (Ping timeout: 264 seconds)
07:35:50*fowlmouth joined #nim
07:36:18TEttingerVarriount, I'm interested to see what you come up with
07:37:42*nimnoob123 joined #nim
07:38:00*fowl quit (Ping timeout: 244 seconds)
07:39:10*NimBot joined #nim
07:41:08*brson quit (Quit: leaving)
07:41:31*BlaXpirit joined #nim
07:43:47*gokr_ joined #nim
07:48:18*gokr joined #nim
08:05:23*lavender quit (Ping timeout: 240 seconds)
08:06:25*gsingh93 quit (Ping timeout: 244 seconds)
08:08:16*sillesta joined #nim
08:17:27*banister joined #nim
08:19:05*banister quit (Client Quit)
08:19:38*fizzbooze quit (Ping timeout: 246 seconds)
08:20:22gokrI just stumbled over Bret Victor's presentation "The Future of Programming": https://vimeo.com/71278954
08:21:03gokrThat was a very nice presentation in a funny format.
08:21:28*lavender joined #nim
08:21:32Araqthat Javascript will end up giving us a slight performance boost?
08:21:55gokrHum?
08:22:22Araqmaybe I'm confusing talks :P
08:22:30gokrI think you are.
08:22:39Triplefoxit's the one that he sets in the mid 1970's, i think
08:23:07gokrIf you don't feel you have the time - you can skip to 26 min in (threads and locks) :) but basically his conclusions are in around 29 min and onward.
08:23:09gokrYeah
08:23:23gokrIts a very funny "time trip".
08:29:07fowlmouthwhats up with ProveInit how do you get past it
08:29:16fowlmouth{.noinit.} doesnt stop it
08:30:21Araqfowlmouth: .noinit just means that there is no memset(0) generated
08:30:52AraqProveInit means your SDL_event uses a range like 1..4 which doesn't include zero
08:31:46Araqso the default init value is wrong
08:31:51Araqand so the compiler complains
08:32:08Araqthat you need to initialize it explicitly
08:33:09fowlmouthyeah i know
08:33:32fowlmouthi am asking for a way around it
08:33:38Triplefoxtested with an EmptyEvent at 0 and that does fix it...probably not what we want though
08:33:52fowlmouthbtw we should just call the empty state nil ;)
08:34:44*lavender quit (Ping timeout: 246 seconds)
08:39:17Triplefoxhmm i managed to generate invalid c while investigating the other option of dumping a "0x100" in there
08:39:55Triplefoxvar evnt:Event = cast[Event](cint(0x100))
08:41:32fowlmouthTriplefox, just use TEvent(kind: QuitEvent)
08:42:16*wb joined #nim
08:42:30Triplefoxoh wait it wouldn't be quite right the way i did it anyway
08:42:39Triplefoxcause that enum is for EventType
08:44:47nimnoob123yeah i rose an issue on he repo, since the loop polls for the next event anyways adding a random eventtype fixes the proveinit warning (sdl2?)
08:47:09Triplefoxvar evnt = Event(kind: QuitEvent)
08:47:18Triplefoxstill terrible but no warnings
08:47:39nimnoob123yeah basically, gets overwritten the moment it goes through pollEvent as well
08:48:13nimnoob123think im getting close to porting my c++ sdl2 game to nim, fun times
08:48:25nimnoob123but it's almost 3am again... lol time flies
08:48:33*BlaXpirit quit (Quit: Quit Konversation)
08:50:16Triplefoxthere is basically only one situation where it matters that it's unset and in that one, it'll be a runtime error on the first frame, i think...so this is mostly a source styling issue anyway
08:52:57nimnoob123maybe create a proc similar to create window var event : Event = createEvent(), cleaner than above
08:53:36*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
08:54:27fowlmouthnimnoob123, i'll add a symbol you can use like var evt = sdl2.defaultEvent
08:54:30*dumdum joined #nim
08:54:46nimnoob123that'd work
09:02:00*nimnoob123 quit (Quit: Page closed)
09:04:57*teapot1 joined #nim
09:31:29gokrDid anyone experiment with cling? The C++ interpreter based on LLVM?
09:31:53fowlmouthgokr, for urho?
09:32:19gokrWell, for any kind of dynamic fiddling
09:33:10gokrEventually I want to be able to modify Nim code while running - in at least some fashion.
09:33:27fowlmouthgokr, do you know what platform urho3ds windows binaries are
09:33:41gokrEhm, what platform?
09:33:47fowlmouthmingw/msvc/clang
09:33:57fowlmouththat matters right?
09:34:05gokrAh, well, you can build in several ways AFAIK.
09:34:21gokrI am not sure what limitations cling has.
09:35:15fowlmouthtrying to avoid building it myself
09:35:25gokrUrho?
09:35:39gokrIt was not hard to build.
09:35:48gokrAt least not on OSX and Linux.
09:36:18*pafmaf quit (Quit: This computer has gone to sleep)
09:37:31gokrUrho: "Supported build tools and IDEs: Visual Studio, Xcode, Eclipse, CodeBlocks, QtCreator, GCC, LLVM/Clang, MinGW"
09:40:37gokrfowlmouth: So anyway, Araq will take a look at dynamic reloading of Nim modules. So that's possibly the "easiest" path to begin with.
09:42:33gokrAlso Urho is experimenting with RCC++
09:49:48*reem quit (Remote host closed the connection)
09:50:37*reem joined #nim
09:55:42*reem quit (Remote host closed the connection)
09:59:37fowlmouthsomething is bugged with my video card and linux
10:00:29fowlmouthso im on windows for the moment
10:02:09*reem joined #nim
10:02:31gokrOk, well, I haven't built Urho there yet - but Araq of course has.
10:03:00gokrAnd dom96, and Dominik's instructions are in the Urhonimo readme.
10:03:19gokrYou would need VS2013 for Urhonimo apparentlt.y
10:04:11*akiradeveloper joined #nim
10:06:52akiradeveloperDWORD32 is unsigned https://msdn.microsoft.com/en-us/library/cc230319.aspx but nim defines it as signed http://nim-lang.org/windows.html#DWORD32 so DWORD32 in nim can't express a value more than 2^31-1?
10:13:06def-akiradeveloper: i think jehan's response to my byteaddress worries is relevant here: http://forum.nim-lang.org/t/892/1#5303
10:13:43Araqnote that the enormous windows.nim will be deprecated soon
10:14:06Araqwe should wrap these things again with c2nim
10:14:19*reem quit (Remote host closed the connection)
10:18:49*akiradeveloper quit (Remote host closed the connection)
10:26:11TEttingerRCC++ ?
10:26:37*akiradeveloper joined #nim
10:26:48fowlmouthakiradeveloper, use winlean instead
10:28:07TEttingerwoah, hadn't heard of RCC++ before, neat stuff
10:34:55*kuzy000_ joined #nim
10:37:49*bjz joined #nim
10:39:31akiradeveloperI know Araq don't like unsigned int. So it's usually recommended to use signed int? If we are interfacing unsigned values in C?
10:40:19Araqusually in C "unsigned" doesn't mean much. the C developer thinks it means "natural number" but this is just wrong
10:40:41Araqso I usually map it to a signed integer of the same size
10:41:59Araqbut that's what I do I don't think there is a consensus really
10:44:00akiradeveloperYou know I am developing fuse binding and once I design the interface to use unsigned a filesystem implementation needs too much casting
10:45:01akiradeveloperReally annoys me... So I am considering rewrite them by signed. I don't use windows.nim that's what I picked while researching
10:46:35*TEttinger quit (Ping timeout: 264 seconds)
10:48:16akiradeveloperinode number is 64bit unsigned for filesystems to have 2^64-1 inodes... This sounds to me not misuse of unsigned value
10:50:02akiradeveloperI think it's convenient that numerics are the same in C if it's not ideal. especially if we are interfacing with C
10:58:19*sepisoad joined #nim
11:02:23Araq*shrug* do what you think is reasonable
11:02:58Araqobviously it's important to be able to habe 2^64-1 inodes as 2^63-1 would be too few of them
11:03:06Araq*to have
11:03:36czrfor inode numbers it's actually somewhat complicated. on some filesystems they should be treated as unique identifiers for inodes (the fs will allocate them), on others you can actually discern some .. meaning of the value (ext-family)
11:03:37*sepisoad quit (Read error: Connection reset by peer)
11:04:13czrso yes, it's quite possible and within POSIX spec to allocate an inode "number" that has highest bit set. however, since it's to be treated as opaque data, it probably doesn't matter.
11:07:54gokrBtw, debugging huge.nim works great in QtCreator.
11:08:09czrthe only operation that is "useful" in userspace with inode "numbers" is comparing two inode numbers for equality. any other operation is meaningless really.
11:08:19gokrIt can also use the nim syntax highlighter for Kate.
11:10:11Araqczr: exactly, thank you.
11:10:30czrnp, sorry for barging in :-)
11:11:37czrhowever, if you're providing an interface for existing linux/posix API, the path of the least surprise for the user of the interface is retaining exactly the same types, unless you're attempting to hide the underlying API. for FUSE it doesn't seem like a good idea
11:11:55czrakiradeveloper, ^
11:12:36czrakiradeveloper, btw, are you wrapping libfuse or talking fuse directly with kernel?
11:13:04gokrLooks like this: http://snag.gy/FZiM2.jpg
11:13:58akiradeveloperczr: https://github.com/akiradeveloper/nim-fuse for lowlevel, I am talking with kernel but for highlevel, I am just wrapping libfuse
11:14:58akiradeveloperI need more time to think of this problem
11:17:11*czr nods
11:17:15*akiradeveloper quit (Remote host closed the connection)
11:28:22*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
11:53:20*bjz joined #nim
11:57:58*bjz quit (Ping timeout: 252 seconds)
11:58:07*sepisoad joined #nim
12:00:11*sepisoad quit (Read error: Connection reset by peer)
12:10:41*MajorWork joined #nim
12:14:35*MajorWork quit (Changing host)
12:14:35*MajorWork joined #nim
12:15:23dom96gokr: are there any tutorials for Urho3D?
12:16:03gokrmmm, there are quite a lot of demos, like 30 or so. And the documentation is quite nice.
12:16:38gokrNot sure about tutorials, I think there is something out there - but I forgot to read it
12:17:31*rapind joined #nim
12:19:55gokrGoogling will get you some at least. Also stuff on youtube.
12:24:41*bjz joined #nim
12:25:14dom96hrm thanks
12:25:23*rapind quit (Remote host closed the connection)
12:26:07*akiradeveloper joined #nim
12:26:28*gokr_ quit (Remote host closed the connection)
12:26:56*gokr_ joined #nim
12:38:42*akiradeveloper quit ()
12:44:07*akiradeveloper joined #nim
12:54:35akiradeveloperphew https://github.com/Araq/Nim/blob/master/lib/posix/posix.nim#L456
13:00:18wbHm, so apparently "string|bool|float" isn't valid. What's the proper Nim syntax for a heterogenous type like this?
13:01:51def-wb: why is that notvalid?
13:02:24wbCompiler throws "not a concrete type"
13:02:47def-haven't seen that error before
13:03:23akiradeveloperso only the bit-width matters
13:03:30*Trustable joined #nim
13:04:13akiradeveloperNim doesn't think the value that the bit pattern represent is important. Just define arithmetics for bitset...
13:05:20akiradeveloperIf one interpret C's u32 to int32 there is no information loss but signed integer is concrete in its semantics. so better to use signed
13:08:40*rapind joined #nim
13:09:52*ob_ quit (Ping timeout: 245 seconds)
13:14:54*reem joined #nim
13:17:53*pafmaf joined #nim
13:19:35*reem quit (Ping timeout: 264 seconds)
13:19:36*banister joined #nim
13:19:59*banister quit (Max SendQ exceeded)
13:21:38*akiradeveloper quit ()
13:22:42*banister joined #nim
13:22:44*banister quit (Max SendQ exceeded)
13:29:07*banister joined #nim
13:29:10*banister quit (Max SendQ exceeded)
13:31:53*untitaker quit (Ping timeout: 240 seconds)
13:33:14*pafmaf quit (Quit: This computer has gone to sleep)
13:37:42*untitaker joined #nim
13:38:01*pafmaf joined #nim
13:39:11*vendethiel- joined #nim
13:39:22*vendethiel quit (Ping timeout: 240 seconds)
13:43:07*rapind quit (Remote host closed the connection)
13:43:37*gokr_ quit (Ping timeout: 264 seconds)
13:44:26*rapind joined #nim
13:45:01*gokr_ joined #nim
13:48:53*rapind quit (Ping timeout: 265 seconds)
13:50:11*kjo1 joined #nim
13:54:34*dybt joined #nim
14:06:59*banister joined #nim
14:07:02*banister quit (Max SendQ exceeded)
14:07:24*banister joined #nim
14:07:29*banister quit (Max SendQ exceeded)
14:07:54*banister joined #nim
14:11:36*rapind joined #nim
14:28:33*banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
14:35:07*pafmaf quit (Quit: This computer has gone to sleep)
14:35:29*banister joined #nim
14:35:33*banister quit (Max SendQ exceeded)
14:36:01*banister joined #nim
14:36:05*banister quit (Max SendQ exceeded)
14:36:07*dom96_ quit (Ping timeout: 246 seconds)
14:38:41*dumdum quit (Ping timeout: 256 seconds)
14:47:14*pafmaf joined #nim
14:47:49*gsingh93 joined #nim
14:51:44Varriountinfinity0: I just commented on your 'koch zip' issue.
14:52:15infinity0thanks, i will play with the zip thing when i get some time
14:52:56*BlaXpirit joined #nim
14:53:50Varriountinfinity0: Sorry if I came off as snarky. I really do see the ideas behind your reasoning.
14:54:15infinity0ah no worries, i'm glad it makes sense now :)
14:55:23Varriountinfinity0: Also, even though I agree (somewhat hesitantly), including tests in 'koch zip' is not entirely up to me.
14:55:46infinity0i understand
15:14:48*banister joined #nim
15:16:37*JinShil quit (Quit: Konversation terminated!)
15:26:52*Sornaensis quit (Max SendQ exceeded)
15:27:29*Varriount_ joined #nim
15:27:39*Sornaensis joined #nim
15:29:33*dumdum joined #nim
15:30:51*Varriount quit (Ping timeout: 252 seconds)
15:35:52*jholland joined #nim
15:40:42gmpreussner|worknim.cfg seems to be hosed today. none of my projects compile anymore - can't find imports :/
15:40:53gmpreussner|workdid anyone else run into this?
15:42:20Araqhave you tried to change your cwd so that ../foo can be resolved?
15:43:14gmpreussner|worklemme check
15:43:36gmpreussner|workok, that works!
15:44:02gmpreussner|workif i cwd into the directory where the nim.cfg is, it compiles fine
15:44:18*jfchevrette joined #nim
15:44:20Araqlet me check the code
15:44:25gmpreussner|workbut i can't do, for example: nim c foo/bar.nim where foo/ contains nim.cfg
15:45:42gmpreussner|workit does find and load nim.cfg though
15:46:22gmpreussner|workhmm... maybe this is the correct behavior after all?
15:46:41gmpreussner|workperhaps cwd should be where the compiled file is located
15:47:05gmpreussner|worki haven't put any thought into this :)
15:47:39def-gmpreussner|work: instead of cwd I'm using 'path = "$projectPath/../src"' and it still seems to work
15:48:39gmpreussner|workdef-: ah, interesting. what does $projectPath resolve to?
15:48:57gmpreussner|workis that the path to the file being compiled?
15:49:12def-that's what I assume
15:49:21Araqgmpreussner|work: nevertheless it should work. you can look into nimconf.loadConfigs and debug it if you want to
15:49:30gmpreussner|workok
15:49:38gmpreussner|workit used to work until yesterday :)
15:49:40Araqbut it did load your config, just the paths were wrong, right?
15:49:58*Varriount_ is now known as Varriount
15:50:05gmpreussner|worki think so. it failed to find any of the imports in ../src
15:50:43Araqhmm, well path handling in the compiler is surprisingly complex :P
15:54:41gmpreussner|worki bet :)
15:57:16*qwr quit (Read error: Connection reset by peer)
15:58:54*wb quit (Ping timeout: 246 seconds)
16:00:31*zio_tom78 joined #nim
16:01:01zio_tom78Hi to everybody
16:01:11def-hi zio_tom78
16:01:55*DecoPerson quit (Quit: Connection closed for inactivity)
16:02:17zio_tom78I'm looking for a way to convert an array of "char" into a string. Just doing "string(arr)" doesn't work
16:02:47zio_tom78var arr : array[0..1024, char]
16:03:21zio_tom78I've looked at the manual and in the "strutil" module, but I found nothing relevant
16:03:58BlaXpiritzio_tom78, first make sure that array is zero terminated
16:04:06BlaXpiritor do you want a string of constant length?
16:04:07def-OT: 0..1024 is 1025 chars
16:05:02*qwr joined #nim
16:05:29zio_tom78Right, I am reading 1024 bytes from a file and am putting a NULL in the 1025th character
16:05:38def-zio_tom78: var myString = $arr
16:05:46BlaXpiritvar arr: array[0..1024, char]; arr[0] = 'a'; arr[1] = '\0'; echo($arr)
16:05:48BlaXpiritworks
16:05:52zio_tom78Ahah! How silly of me!
16:06:00def-but this is pretty inefficient to do
16:06:12zio_tom78In fact I have doubts about my overall approach.
16:06:21BlaXpiritsuch a conversion is quite non-obvious. I was gonna do string(cstring(arr))
16:06:30zio_tom78The 1024 bytes are read by the function zlib.gzread
16:06:47zio_tom78I am reading a quite large text file that has been compressed by gzip
16:07:01*ob_ joined #nim
16:07:12zio_tom78I want to decompress it into a string variable
16:07:29zio_tom78Currently I am decompressing chunks of 1024 bytes each and appending them into a string
16:07:31BlaXpiritoh, it might not need to be zero-terminated
16:08:42def-zio_tom78: something like this?: https://github.com/Araq/Nim/blob/master/lib/wrappers/zip/zlib.nim#L187
16:09:41def-zio_tom78: it decompresses directly into a string, and resizes it to the correct size before
16:10:14*qwr quit (Quit: Coyote finally caught me)
16:11:18zio_tom78Sort of. But does it work with gzipped files? As far as I understand, they have an header at the beginning. And the advantage of zlib.gz* functions is that they work with uncompressed files as well (which is something my program sometimes should do)
16:11:47*ob_ quit (Ping timeout: 264 seconds)
16:11:56*pregressive joined #nim
16:12:35def-zio_tom78: i don't mean you should use that proc, but use something similar internally to decompress into the string directly. that should work with zlib.gzip as well?
16:12:53gmpreussner|workdef-: $projectPath will make it compile, but it will then still not work with "nim c -r", because it can't find the compiled executable
16:12:57zio_tom78Oh, sorry, I misunderstood your suggestion
16:16:26zio_tom78def-: Ok, now I see. Instead of reading data into an array, make new space at the end of the string and make zlib.gzread write directly into this area
16:16:28*Sornaensis quit (Max SendQ exceeded)
16:16:36zio_tom78Thanks a lot guys!
16:16:58def-zio_tom78: and a setLen after it's all done
16:17:09zio_tom78def-: Yeah, right
16:18:30*Sornaensis joined #nim
16:21:37Varriountonionhammer: ping
16:24:09*darkf quit (Quit: Leaving)
16:30:20zio_tom78BlaXpirit, def-: Ok, now the code works smoothly and the speed is comparable with gzip. Thanks a lot
16:30:48def-zio_tom78: awesome!
16:31:32zio_tom78Cheers to everybody!
16:31:39*zio_tom78 left #nim ("ERC Version 5.3 (IRC client for Emacs)")
16:36:19dybtI'm having trouble installing Nimble (on Windows). When I run the script in the zip on the github released page, or just clone it and run 'nim c src\nimble.nim', this happenhttps://gist.github.com/dylanbraithwaite/9f097db5c928860c69b7s
16:36:48dybtwoops, missed a space at the start of the link https://gist.github.com/dylanbraithwaite/9f097db5c928860c69b7
16:38:14def-dybt: that means your Nim compiler assumes 64bit, while you C compiler is 32bit (or the other way around)
16:39:03def-Maybe it also has to do with cygwin?
16:39:40dybtI tried it in cygwin too. It complained about not being able to link with some windows functions
16:40:27dybtI have mingw installed and I don't remember installing it. I assumed it was the Nim installer that did it, so I thought they would line up
16:41:27def-Strange, I don't know how this happens then
16:44:14dybtyeah, gcc's version is mingw32 and Nim is amd64. I'll try installing a 64 bit version of mingw
16:44:17dybtthanks
16:44:41*pregressive quit (Remote host closed the connection)
16:50:40dybtcan I specify a specific c compiler?
16:51:35gmpreussner|workhow do i correctly override system.$(x: T) for custom trivial object types? when I do "echo myVar" for a custom type, i get "ambigious call"
16:54:23dom96gmpreussner|work: Can I see your code?
16:54:32*kjo1 quit (Quit: Leaving.)
16:57:25ekarlsowhat libraries to make :p
16:59:42def-dybt: --cc:gcc and --gcc.exe:path/filename here
16:59:55dybtthanks
17:01:36dybtdoes that show up in the --help/--advanced list? I've been scrolling through it looking and didn't see anything
17:02:07*rapind quit (Remote host closed the connection)
17:03:56*pregressive joined #nim
17:05:31*rapind joined #nim
17:06:07def-nope
17:06:19def-but it's the same settings as in the config/nim.cfg
17:06:29dybtah
17:06:45def-took me some time to figure out, should definitely be documented somewhere
17:07:43*dumdum quit (Ping timeout: 256 seconds)
17:10:18*sampwing joined #nim
17:10:58dybtI couldn't get it to work with cygwin's 64 bit gcc but 'nim --cpu=i386' worked fine
17:14:40*teapot1 quit (Ping timeout: 246 seconds)
17:17:36*wb joined #nim
17:17:40gmpreussner|workdom96: http://github.com/nimious - pick any repository :)
17:18:09gmpreussner|worki gotta go to work now. i will be back later
17:24:58*dyu quit (Quit: Leaving)
17:26:17*MajorWork quit (Quit: Leaving)
17:26:48*pafmaf quit (Quit: This computer has gone to sleep)
17:33:34*dybt quit (Ping timeout: 255 seconds)
17:39:24*wan_ joined #nim
17:43:13*sampwing quit (Ping timeout: 252 seconds)
17:52:32*metachar joined #nim
17:53:42*rapind quit (Remote host closed the connection)
17:55:03*gsingh93 quit (Quit: WeeChat 1.1.1)
17:55:40*dybt joined #nim
17:56:33*rapind joined #nim
17:57:05*gsingh93 joined #nim
17:59:22*gsingh93 quit (Client Quit)
17:59:46*gsingh93 joined #nim
18:00:17*dumdum joined #nim
18:02:21*UberLambda joined #nim
18:10:21*Matthias247 joined #nim
18:10:57*reem joined #nim
18:11:00*gsingh93 quit (Quit: WeeChat 1.1.1)
18:11:22*gsingh93 joined #nim
18:13:35*gsingh93 quit (Client Quit)
18:14:33*gsingh93 joined #nim
18:25:50wbSo apparently "string|bool|float" isn't valid (compiler throws "not a concrete type"). What's the proper Nim syntax for a heterogenous type like this?
18:25:58wb(asked this earlier but nobody knew)
18:26:17def-wb: i still thinkthat's valid. have any code?
18:26:29*gsingh93 quit (Quit: WeeChat 1.1.1)
18:26:57*gsingh93 joined #nim
18:27:02BlaXpiritmaybe you're confusing generic vs variant
18:28:47wbPossibly. This is the code: http://hastebin.com/oluterivup.hs
18:29:27BlaXpirityes, you are
18:31:06BlaXpiritwb, https://github.com/Araq/Nim/blob/master/lib/pure/json.nim#L517
18:31:48BlaXpiritthis is a variant type (don't think this is a term in Nim, but still...)
18:32:12*xeizlif quit (Ping timeout: 246 seconds)
18:32:51*xeizlif joined #nim
18:35:06wbThanks. I hope there's some sort of syntactic sugar planned there, though: that's some serious voodoo.
18:35:17BlaXpiriti've been trying to think what exactly is the reason that you can't use generics here
18:35:24BlaXpiritbrain too weak
18:35:38*TnTReX joined #nim
18:37:37metacharwhat's the benefit of a type being a string or a bool or a float? I know the functional programming nerds always talk about something called "curry howard isomorphism" and how it's supposed the best thing since sliced bread
18:38:09metacharand they say you need "or types" like that one
18:40:05*shevy left #nim ("I'll be back ... maybe")
18:40:49wbim trying to write a simple config file loader (mostly for practice), and the data can be a string, bool, or float
18:40:57BlaXpiritsee also docopt
18:44:25dom96wb: I think something like this should work: https://gist.github.com/dom96/b932c5bad4033cb7d062
18:44:29dom96But it crashes the compiler.
18:44:52Trixar_zaHey dom96
18:46:29dom96hi Trixar_za
18:52:30BlaXpiritdom96, that definitely is not the intended behavior
18:52:49BlaXpirita config file of one type?
18:55:16*TnTReX quit (Quit: Leaving)
18:55:23wbOn a related note, is there an "any" type?
18:56:58*Pisuke joined #nim
18:57:52wb("auto" looked promising, but it also throws "not a concrete type" in every case i tried)
18:58:15*gsingh93 quit (Quit: WeeChat 1.1.1)
18:58:27*MyMind quit (Ping timeout: 244 seconds)
18:58:33*gsingh93 joined #nim
19:00:29def-wb: you could do something like this: http://nim-lang.org/json.html#JsonNodeObj
19:00:49BlaXpiritwb, no, it's different again
19:03:06*jsudlow quit (Remote host closed the connection)
19:07:14*gsingh93 quit (Quit: WeeChat 1.1.1)
19:08:07*jsudlow joined #nim
19:09:17*jsudlow quit (Client Quit)
19:09:39*jsudlow joined #nim
19:09:59*metachar left #nim ("Leaving")
19:11:38*jsudlow quit (Client Quit)
19:12:06*jsudlow joined #nim
19:14:55*lavender joined #nim
19:18:50*Jehan_ joined #nim
19:19:48*banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
19:25:43*JinShil joined #nim
19:25:48*banister joined #nim
19:29:56*jmcassid joined #nim
19:30:13*jmcassid is now known as qfire
19:37:08wbThis is a complete cluster. Is there a way to just tell the compiler not to typecheck a certain region?
19:38:22wbOr a "void ptr" a la C/C++?
19:39:13Jehan_wb: Can you be more specific?
19:40:03Jehan_There are a number of ways to deal with "should be able to accept any type" situations, but it depends on the situation.
19:40:22BlaXpiritwb, "pointer" is "void*"
19:40:35*brson joined #nim
19:41:48wbAlright, that will probably work. Jehan_: currently trying to write a simple config file loader. Using the variant type approach, the code for describing the data is much longer and more complex than all the rest put together.
19:42:02BlaXpiritwb, but there is no other good way to go
19:42:04BlaXpiritsrsly
19:42:14BlaXpirithave u seen https://github.com/BlaXpirit/docopt.nim ?
19:42:47BlaXpiritI just noticed that github changed syntax highlight (at least colors) for nim
19:43:05BlaXpiritstrings definitely weren't blue before
19:44:29BlaXpiritactually, docopt's code won't teach you anything other than json
19:44:40BlaXpiritjust another instance of it. works OK
19:45:03BlaXpiritactually, proc val(...) kinda helped
19:45:57wbYeah i saw it (and json). It works, but if that's the best way to do it then i'd say it's a language limitation: violates the "easy things should be easy" principle.
19:47:17*vendethiel- is now known as vendethiel
19:47:20BlaXpiritwb, this is already syntax sugar :p
19:47:25BlaXpiritC++ has it worse
19:47:31*dumdum quit (Ping timeout: 256 seconds)
19:48:11BlaXpiritHaskell probably has some clever solution to this
19:49:11Araqcan somebody help this guy? http://forum.nim-lang.org/t/897
19:49:28samltutorial is gone?
19:49:40Araqthough I'll probably take it as a chance to improve our leak detector
19:49:57BlaXpiritsaml, no
19:50:10samlhttp://nim-lang.org/documentation.html unlinked from here
19:50:58Araqsaml: there is a "learn" tab
19:51:03Araqit's in there
19:51:26BlaXpiritsaml, tutorial was never linked on that page. http://web.archive.org/web/20150205102804/http://nim-lang.org/documentation.html
19:52:04*gsingh93 joined #nim
19:52:33reactormonkHow can I render a StmtList into code? Good old `$`?
19:53:21Jehan_Araq: Umm, the problem is that just downloading the tar.bz2 is going tot take forever.
19:54:23samlah i see
19:54:31samli cray
19:54:49*pr3d4t0r quit (Ping timeout: 245 seconds)
19:55:38*pr3d4t0r joined #nim
19:55:53Jehan_reactormonk: toStrLit(s).strVal should normally do the trick.
19:56:18reactormonkJehan_, thanks. Let's see if it's a good idea to do that.
19:56:38Jehan_I have no idea if the conversion is perfect for everything, though.
19:58:30Trixar_zaHmmm, apparently I still have Jehan_ on ignore. Can't remember why though
19:59:13reactormonkTrixar_za, ^^
19:59:15Jehan_Eh, I remember, and feel free to put me back on it.
19:59:38reactormonklulz.
19:59:40Trixar_zaNot even sure if it's the same one. Broad ignores == bad.
20:00:05reactormonkWhat's a good way to iterate over two different things at the same time? aka a list of tuples
20:01:26Jehan_reactormonk: for a, b in list.items: echo a, " ", b
20:01:56Jehan_Have to specify items, or it'll try to infer list.pairs.
20:02:04reactormonkJehan_, let's say I want to iterate over 1, 2, 3 and "a", "b", "c" at the same time
20:02:27Jehan_So, that wouldn't be a list of tuples, but two lists?
20:03:24Jehan_The easiest (though not prettiest) way would be: for i, a in list1.pairs: let b = list2[i]; ...
20:04:21reactormonkJehan_, doesn't really matter, the items I'm iterating over are static.
20:04:30reactormonkSo it's just a matter how to organize them.
20:06:49Jehan_Well, if it's a list of tuples, then the first solution I proposed is both the easiest and cleanest, I think.
20:07:18*BlaXpirit_ joined #nim
20:07:27reactormonkI can make it a list of tuples, not a problem.
20:10:47*sampwing joined #nim
20:12:52*filwit joined #nim
20:15:01*sampwing quit (Ping timeout: 252 seconds)
20:18:37*alexruf joined #nim
20:23:43*reem quit (Remote host closed the connection)
20:26:07*lavender quit (Ping timeout: 245 seconds)
20:31:14*qfire left #nim (#nim)
20:32:23TriplefoxIs there a good rule of thumb for deciding between tuple and object
20:32:56*UberLambda quit (Quit: Leaving the Matrix)
20:34:13Araqtuple: when you need structural typing; object: when you need nominal typing
20:36:31*reem joined #nim
20:40:57*reem quit (Remote host closed the connection)
20:41:50*rapind quit (Remote host closed the connection)
20:42:34*brson quit (Quit: leaving)
20:42:53*rapind joined #nim
20:43:52TriplefoxWhat about "uhh i just have some data" :D i guess i would default to tuple for that
20:47:10*JinShil quit (Quit: Konversation terminated!)
20:47:26*rapind quit (Ping timeout: 252 seconds)
20:48:01Jehan_Triplefox: Basically, tuples are for when you have few fields and use constructors and tuple assignment a lot.
20:48:41Jehan_There are other use cases, but that's the big one.
20:51:55*TEttinger joined #nim
20:52:40*reem joined #nim
20:52:54TriplefoxI guess what I'm really looking for is how they're different from the haxe equivalent of typedef and class, and that mostly hinges on details of the type system and also the memory model
20:54:27*gsingh93 quit (Read error: Connection reset by peer)
20:54:32Jehan_Internally, they're both essentially the same (C structs), unless you use inheritance, which works for objects only (but is optional for them).
20:54:52*gsingh93 joined #nim
20:54:52Araq'case' also only works in objects
20:59:17samlaporia doesn't have auto complete, right?
21:00:31*jfchevrette quit (Quit: Textual IRC Client: www.textualapp.com)
21:01:25Araqwe're working on it
21:01:28def-Araq: yes, it took some time to look into this issue: http://forum.nim-lang.org/t/897/1#5327
21:01:43def-Araq: I got the program fast, but i think something is wrong with the GC still
21:03:09Araqtried with --gc:markAndSweep too?
21:03:42*BlaXpirit_ quit (Quit: Quit Konversation)
21:03:43def-it's a bit difficult to try because it takes long until it gets really slow
21:04:11Araqthat sounds more like a fragmentation issue
21:04:27def-ah! because of so many string allocations
21:04:35Araqbut I can work on the memory profiler this weekend
21:04:45Araqperhaps.
21:05:28Araqseems to be a good candidate for a long running test
21:06:14Araq(which of course should be run when people install Nim ... ;-) )
21:06:19def-It's pretty interesting to parse the entire wikipedia
21:06:33def-i don't think tests should be run on installation
21:06:51Araqgood
21:10:53*rapind joined #nim
21:17:23*Mat4 joined #nim
21:17:28Mat4hello
21:19:51def-hi Mat4
21:20:02Mat4hi def-
21:21:31*brson joined #nim
21:23:29Araqdef-: I'm actually not too much of generics for everything, how about this idea: make the type overridable like perhaps so:
21:23:52Araqwhen existsFile(rationalOverride):
21:24:13Araq from rationalOverride import BaseInt
21:24:16Araqelse:
21:24:23Araq type BaseInt = int
21:24:30Araq... # code that uses BaseInt
21:24:58Araqwhile that may first seem like a hack, it actually buys us interop
21:25:04def-sounds like a hack. so you'd have to use the same BaseInt for the whole project
21:25:17Araqthat's the *feature* I'm after
21:25:43Araqthis way I can use Rationals of bigints everywhere to try things out
21:25:50*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
21:26:10def-I'm not sure, could be interesting
21:26:12Araqbut I don't have the problem that my Rational[int] doesn't work with your Rational[BigInt]
21:26:53Araqwell I guess people won't accept it
21:26:58*Boscop_ joined #nim
21:27:36Araqso meh, let's make it generic
21:28:04*filwit quit (Quit: Leaving)
21:28:23def-with generics it should still be so that you can use int by default
21:28:44def-and i don't know how to make it generic properly, user defined typeclasses?
21:29:14def-Just [T] could cause weird errors for the users
21:29:42*Mat4 this discussion reminds him about reasons against the idea of type systems in general
21:29:54Araqyeah but typeclasses are perhaps not in 1.0 ...
21:30:25*gsingh93 quit (Ping timeout: 264 seconds)
21:30:28Araqand Just [T] is what we use for now, so meh, it's fine
21:30:33*Boscop quit (Ping timeout: 252 seconds)
21:31:00AraqMat4: yeah but then not having a type system is wierd for systems programming
21:31:50Araqyou can either have static typing or simplicity, I don't think there is a nice middle ground
21:32:06*pregressive quit (Remote host closed the connection)
21:32:06Mat4probably
21:33:14*pregressive joined #nim
21:34:07Mat4I have these idea of storage formats implicitly converting to a unified type at reading... anyhow that's somewhat offtopic
21:39:27BlaXpirit is there a clever way to write var arr = [f(), f(), f(), f(), f(), f(), f(), f()] ?
21:39:53def-BlaXpirit: for seqs there's newSeqWith
21:40:00AraqBlaXpirit: macro?
21:40:01def-that i wrote exactly for this
21:40:29BlaXpiritmmm looks nice, def-
21:40:51def-you could adapt it to arrays i guess
21:41:36BlaXpiritit's probably not worth it in this case :/
21:44:13def-BlaXpirit: ideally you'd want something like [f() * 10]?
21:44:33BlaXpiritI'll just write a loop
21:44:39def-maybe a macro would work!
21:44:46BlaXpiritthe only thing I didn't like about writing a loop is that it is 0..15
21:44:55def-arr.low..arr.high?
21:45:04BlaXpiritright.
21:45:14BlaXpiritthanks
21:45:23def-or even better: for x in arr.mitems: x = f()
21:45:53BlaXpiritmmmmmmmmm so good
21:50:29Mat4you can write an iterator as alternative using tail-call recursion?
21:52:17*alexruf quit (Quit: Textual IRC Client: www.textualapp.com)
21:57:45Mat4nf (f, i) → i > 0: f (i-1)
22:00:37Mat4need some sleep, ciao
22:02:19*Mat4 quit (Quit: Verlassend)
22:03:58*dybt quit (Read error: No route to host)
22:04:15*dybt joined #nim
22:05:57samlwhat's difference between echo "hello" and echo("hello") ?
22:06:10samland discard "hello" and discard("hello")
22:06:20samli don't know when to use () or when not to
22:06:35def-saml: http://nim-lang.org/manual.html#command-invocation-syntax
22:07:39BlaXpiritI omit the brackets when it sounds like a proper sentence
22:07:43def-the rules for when it works aren't obvious, so some people avoid it. it also has problems with some operators, like "echo $foo"
22:07:58BlaXpiritmy recent favorite: sleep 2.seconds
22:08:03samlso always use ()
22:09:06def-saml: I like to leave away brackets when it looks more aesthetical
22:09:22BlaXpiritdraw circle
22:09:25*dybt quit (Ping timeout: 255 seconds)
22:09:30def-or "close file"
22:09:59BlaXpiriti'd be tempted to write file.close() in that case :D
22:10:07samlaesthetic confusion
22:10:43*panzone joined #nim
22:12:27*sampwing joined #nim
22:13:12*dybt joined #nim
22:16:45*sampwing quit (Ping timeout: 252 seconds)
22:21:03*reem quit (Remote host closed the connection)
22:23:29*dybt quit (Quit: Leaving)
22:23:43*kuzy000_ quit (Ping timeout: 252 seconds)
22:24:40BlaXpiritlolololol
22:24:45BlaXpiritI feel like a crazy man
22:24:50BlaXpiritwriting macros by using just strings
22:29:13def-BlaXpirit: have some example code?
22:29:22BlaXpiritsoon
22:30:05BlaXpiritit all started from this relatively innocent line https://github.com/docopt/docopt.nim/blob/54e9c4affcbb9273afc5249cd99a81e826c65937/src/docopt.nim#L113
22:30:18*nande joined #nim
22:36:02*sampwing joined #nim
22:36:07*xet7 joined #nim
22:44:22panzonehi, I' m a student interested in one of your GSOC project and I'd like to know 1) if you accepted students that have never contributed to nim and 2) if you have some sort of requirement or anything
22:46:30Araqhi panzone. nice.
22:47:04def-panzone: hi. first we have to be accepted of course. which project?
22:47:59panzoneI'm interested in the garbage collector project
22:48:34Araqgood choice ;-)
22:48:35panzoneand obviously first you have to be accepted, but I learned last year that the first you move, the better are you chances
22:48:41fowlmouthanybody know how to interrupt visual studio from building
22:48:42def-panzone: we'd have to discuss the project with you before, have you do some research. having written some nim before is a must
22:49:21fowlmouthnvm found it
22:49:33def-panzone: but from how i understand gsoc, people who have never contributed to open source are quite welcome as well
22:49:51panzoneI know how gc works, I partecipated at the last GSOC working to mono and their gc collector
22:49:53*5EXAAJO3K joined #nim
22:50:46panzoneand knowing nim before seems logic :) I'm moving this early for having the time for write a good proposal and start knowing both the language and the codebase
22:51:12ldleworkPrepared and motivated... this guy sounds dangerous.
22:52:27def-panzone: awesome
22:52:57panzonelike, I don't really understand the goal of the project. from the description it seems that you want to write some sort of a "modular" gc where the compiler insert some sort of "directives" then implemented by external modules provided at compile time
22:52:59def-that's one of the few projects where I'm not listed as mentor, so we'll have to find zahary
22:53:31Araqnot really, I think I know what he had in mind
22:54:18panzone(I'm saying all this from my ignorance about how nim handles gc. I read that you include everything in native executable if I understand correctly ?)
22:54:31Araqpanzone: so the idea is that the GC tells the codegen "I need this kind of write (read) barrier" and then the codegen emits the proper barriers
22:54:41reactormonkpanzone, from what I understand it's not a modular GC, it's the compiler which should be modular to insert different GCs
22:54:53panzone(oh, and sorry for my terrible english :) )
22:55:36Araqit does that today already, but well the only barrier that works right now is for the deferred reference counting GC
22:55:57*rapind quit (Remote host closed the connection)
22:56:12Araqthe other two GCs that we have are markAndSweep and Boehm and neither requires any barriers
22:56:32panzonemmm so that you can change the gc algorithm at compile time without having to change everything
22:56:37*Siecje joined #nim
22:56:45Araqyes, that's possible already
22:56:53SiecjeI'm getting a 404 on this page http://nim-lang.org/irc.html
22:56:56*untitaker left #nim ("WeeChat 1.1.1")
22:57:03Araqbut more GC algorithms can be implemented
22:57:17Araqand in general a GC requires codegen support as you should know
22:57:25dom96Siecje: It has been moved out of the standard library.
22:58:10samlhttp://irclogs.nim-lang.org/ ?
22:58:12Siecjedom96: Thanks, does nim have a package manager I've got that far.
22:58:16dom96Siecje: If you need docs for it I'm afraid you'll have to generate them yourself, at least until we get a proper packages website running.
22:58:34samlnimble search irc
22:58:40Araqpanzone: did that answer your question?
22:58:40saml url: git://github.com/nim-lang/irc (git)
22:58:43dom96Siecje: Yeah, it's called Nimble: https://github.com/nim-lang/nimble/
23:00:11Siecjedom96: I saw your web framework it looks really cool
23:00:18dom96Siecje: Thanks :)
23:00:43*ob_ joined #nim
23:00:45TEttingerNimble is awesome so far, it needed a little config on windows do get stuff off git (haven't tried mercurial yet)
23:01:12dom96TEttinger: That's good to hear, what config did it require?
23:01:12*5EXAAJO3K quit (Quit: This computer has gone to sleep)
23:01:46Araqpanzone: so in addition to --gc:refc|boehm|markAndSweep we have something like --gcOption:RC --gcOption:preciseStackMarking --gcOption:readBarriers that is requested by the GC implementation that you picked via --gc
23:02:43*t4nk530 joined #nim
23:02:53panzoneAraq: yes, basically you want to support other algorithms via different modules and you need to insert the "implementation" for the opions a gc use
23:03:17TEttingerdom96: setting git config to use https:// instead of git://
23:03:30TEttingersomeone else posted the line to do that in here...
23:04:42dom96TEttinger: I see. Perhaps I should make Nimble do that. Can you create an issue for this please?
23:04:44*pregressive quit (Remote host closed the connection)
23:04:58Araqpanzone: well if you have any suggestions of how to improve the description, I'm all ears
23:05:05SiecjeDoes nimble support the same package installed with different versions?
23:05:13TEttinger<singul42> still having the problem with git:// protocol under windows, but as a workaround git config --global url."https://".insteadOf git:// helps
23:05:34dom96Siecje: yep
23:06:17TEttingerdom96: I need to verify that that particular command works, I basically changed the git:// checkouts to http:// more manually before (by specifying the url in full I believe)
23:06:36Siecjedom96: That's a pretty smart implementation. Having one location for third part packages.
23:06:41TEttingeranyone got a recommendation for a Nim package to test really fast?
23:06:46*t4nk530 quit (Ping timeout: 246 seconds)
23:06:47TEttingerpreferably an application
23:08:47panzoneAraq: no, no, it's ok. it perfectly explains the problem and why you want a solution.
23:08:54def-TEttinger: brainfuck
23:10:26Araqpanzone: so yeah, this is a broad task, but an obvious GC to pick would be a tricolor incremental mark and sweep GC
23:10:32*lavender joined #nim
23:10:36*reem joined #nim
23:11:20Araqas that it is not too hard but requires a completely different barrier
23:12:20federico3I'll just leave this here: https://stripe.com/blog/stripe-open-source-retreat
23:14:00reactormonkfederico3, the wording could be better. Anyway, from what I know most of the poeple here are from europe.
23:14:14Siecjefederico3: How did it go?
23:14:18federico3wording?
23:14:30*nimnoob123 joined #nim
23:14:32reactormonk"retreat"
23:14:56panzoneand the barrier should be provieded by a codegen module. so a gc module should include the implementation for barriers, if it should use a precise or conservative stack marking ecc. ecc.
23:14:58federico3reactormonk: "We also will accept applicants from outside the United States"
23:15:18BlaXpiritwb, I accidentally stumbled upon this http://nim-lang.org/typeinfo.html
23:15:19nimnoob123is there an alternative syntax for importing from subfolders? (instead of using forward slash)
23:15:22dom96federico3: Why is this relevant, isn't this over already?
23:15:36BlaXpiritnimnoob123, dot is the same
23:15:37dom96nimnoob123: import foo.bar
23:15:43nimnoob123thanks
23:15:52federico3they might be do it again
23:15:53reactormonkdom96, looks like you're right. wrong year ^^
23:16:28def-reactormonk: i also thought "retreat" means they'll stop support open source
23:16:31wbBlaXpirit: thanks, that'll probably be helpful.
23:16:39reactormonkdef-, exactly.
23:17:41*Boscop_ quit (Ping timeout: 250 seconds)
23:18:15*Boscop_ joined #nim
23:18:24Araq"Maybe it’s a rapidly-growing project where the maintainer can currently barely find time for bugfixes. " where do I sign?
23:19:02*panzone quit (Ping timeout: 245 seconds)
23:19:11reactormonkAraq, just shoot them a mail whether they're doing it again
23:19:42*ob_ quit (Ping timeout: 265 seconds)
23:22:01*sampwing quit (Ping timeout: 252 seconds)
23:24:43*sillesta67 joined #nim
23:25:14*sampwing joined #nim
23:25:41*sillesta quit (Disconnected by services)
23:25:43*sillesta67 is now known as sillesta
23:26:25*panzone joined #nim
23:30:54SiecjeHow does nim differentiate local modules vs third party ?
23:32:26ekarlsoheya guys
23:32:38ekarlsodom96: u think we can deploy play.nim-lang.org this weekend ?
23:33:08dom96ekarlso: Sure. If you let me test it first.
23:33:31ekarlsodom96: I can host it if that's ok and give you ssh access
23:33:40reactormonkSiecje, third party as in nimble?
23:33:41ekarlsogot free compute power for nim stuff
23:33:51Siecjereactormonk: yeah
23:34:05reactormonkSiecje, how do you want to do the differentiating?
23:34:15def-ekarlso: yay!
23:34:31def-ekarlso: when can I try it out?
23:34:36reactormonkSiecje, aka, at which point does it matter?
23:34:38dom96ekarlso: sure.
23:34:43ekarlsodef-: hoping by the weekend if my kid allows it :p
23:35:02Siecjereactormonk: discovery
23:38:02*panzone quit (Quit: Leaving...)
23:43:39flaviuekarlso: Who donated the VM?
23:44:08ekarlsoflaviu: vm's atm
23:44:10ekarlsozetta.io
23:44:30ekarlsogot one for packages and one for play
23:45:05ekarlsohow can I get the first char of a string ?
23:45:16flaviuLooks like zetta is down atm
23:45:24flaviuekarlso: mystr[0]?
23:45:30ekarlso.eval var foo = "foo"; foo[0]
23:45:35ekarlsothat bot...
23:45:49*Mimbus joined #nim
23:46:30ekarlsoflaviu: they're doing maintenance of the networking backend
23:47:42ekarlso.eval var foo = "foo"; foo[0]
23:47:46Mimbusekarlso: eval.nim(4, 3) Error: value of type 'char' has to be discarded
23:48:33ekarlsohuh
23:48:41TEttingerMimbus is a Nim bot?
23:49:49ekarlso.eval let names = @["endre"]; let letters = @["e"]; echo(names.filter(proc (s: string): bool = string(s[0]) in letters))
23:49:52Mimbusekarlso: eval.nim(5, 49) Error: conversion from char to string is invalid
23:49:59TEttinger.eval var foo = "foo"; echo(foo[0]); discard;
23:50:04MimbusTEttinger: f
23:50:13ekarlso.eval let names = @["endre"]; let letters = @["e"]; echo(names.filter(proc (s: string): bool = s[0] in letters))
23:50:16Mimbusekarlso: eval.nim(5, 48) Error: type mismatch: got (seq[string], char)
23:50:19ekarlso:P
23:54:10TEttinger.eval let names = @["endre"]; let letters = @["e"]; echo(names.filter(proc (s: string): bool = ! ! s[0] in letters))
23:54:13MimbusTEttinger: eval.nim(5, 45) Error: type mismatch: got (char)
23:54:50TEttinger.eval let names = @["endre"]; let letters = @['e']; echo(names.filter(proc (s: string): bool = s[0] in letters))
23:54:54MimbusTEttinger: @[endre]
23:54:58TEttingerhehe yay
23:55:03flaviuit's best to move the bot use into #nim-offtopic before Araq gets annoyed :P
23:55:09TEttingerI'm done
23:56:37*rapind joined #nim