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:13 | NhanH | Is 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:28 | Sharcho | NhanH: in the standard library there are wrappers for FreeImage and DevIL |
00:23:46 | Sharcho | also sdl_image and bpl |
00:26:46 | NhanH | sdl 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:11 | reactormonk | any 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:17 | reactormonk | ???(???, ???) Error: identifier expected, but found '"comment_s"' |
00:53:21 | reactormonk | :-/ |
00:53:55 | * | rapind joined #nim |
00:57:33 | * | lavender joined #nim |
01:00:07 | Sharcho | reactormonk: 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:52 | rkj-b | I 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:51 | rkj-b | Specifically, 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:43 | flaviu | Nim 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:19 | rkj-b | Also, 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:23 | def- | 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:54 | def- | Nim should work fine on Windows, Linux and Mac |
02:11:52 | * | chemist69 quit (Ping timeout: 240 seconds) |
02:15:02 | rkj-b | I 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:02 | reactormonk | Hm. 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:03 | def- | reactormonk: full code with the strange error message? |
02:17:23 | * | sampwing quit (Ping timeout: 252 seconds) |
02:17:34 | reactormonk | def-, ???(???, ???) Error: identifier expected, but found '"comment_s"' |
02:17:53 | reactormonk | def-, http://pastie.org/9960928 |
02:21:33 | def- | the problem isn't coming from where you think |
02:21:40 | def- | it's from the "proc `sToken`(fpc: uint) =" |
02:22:49 | def- | i think that just doesn't work with quote? |
02:23:43 | def- | you could go one step deeper and instead of "quote", build the actual procedure |
02:23:50 | def- | as an AST directly |
02:24:43 | reactormonk | hmm, let's see |
02:25:15 | reactormonk | sTokenIdent = ident(sToken) |
02:25:17 | reactormonk | that solves it |
02:25:43 | def- | interesting |
02:25:50 | reactormonk | Any way I can make sure the dead code elim doesn't kill either of the procs? |
02:26:20 | def- | why? |
02:26:37 | * | darkf joined #nim |
02:26:52 | reactormonk | because I'm going to be using them from C. |
02:27:20 | def- | exportc and * |
02:27:45 | def- | hm, doesn't seem to work inside quote either |
02:27:53 | reactormonk | from 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:46 | def- | {.deadcodeelim: off.} |
02:28:52 | def- | at the start of the file? |
02:29:19 | reactormonk | sounds good to me |
02:30:09 | reactormonk | nope, the procs still don't get generated |
02:31:37 | def- | maybe because you create them inside of a proc? |
02:31:43 | nimnoob123 | alright 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:26 | flaviu | How about creating a repo for filwit's art in the nim-lang org? |
02:32:43 | def- | flaviu: yes, should filter out the logo and other used stuff and do that |
02:32:54 | reactormonk | Error: invalid pragma: deadcodeelim: off |
02:32:58 | reactormonk | ... when pushing it |
02:33:22 | def- | nimnoob123: proc modifySth(x: var MyObject) = ... |
02:33:26 | def- | reactormonk: yes, can't be pushed |
02:33:51 | nimnoob123 | hmm let me try that again |
02:33:55 | reactormonk | def-, hm. How can I push stacktrace:off into code generated by a macro? |
02:34:42 | def- | reactormonk: write the code as you want it to come out and use dumpTree to see how |
02:34:49 | reactormonk | def-, point taken |
02:34:58 | def- | (That means I don't know) |
02:37:29 | nimnoob123 | oh I'm retarded, thanks def-, I tried that earlier and idk I guess I messed up somehow. works though |
02:38:03 | reactormonk | def-, nope. :-/ |
02:38:22 | reactormonk | how do I ask the macro stuff to output me the generated code? |
02:38:50 | def- | reactormonk: echo result.repr at the end |
02:39:24 | def- | reactormonk: what you're doing looks pretty complicated |
02:39:31 | reactormonk | def-, and insane |
02:39:57 | * | lavender quit (Ping timeout: 265 seconds) |
02:40:52 | def- | 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:17 | reactormonk | {.push, stacktrace: off.} |
02:41:26 | reactormonk | but I Want {.push stacktrace:off.} :-/ |
02:42:39 | * | papabalyo joined #nim |
02:42:59 | def- | make the "stacktrace:off" a child of "push" maybe |
02:43:57 | reactormonk | nope, segfault |
02:47:30 | * | saml_ joined #nim |
02:48:32 | papabalyo | Hi 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:04 | papabalyo | when I do the same get and redeploy local server on port 80 everything works fine |
02:49:35 | def- | papabalyo: using nim 0.10.2? |
02:49:47 | papabalyo | yes |
02:50:01 | def- | httpclient is broken in 0.10.2, you should try with the devel branch from github |
02:50:37 | papabalyo | OK, will do. Thanks def- ! |
02:51:30 | * | lavender joined #nim |
02:52:19 | def- | 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:40 | def- | and it's probably easier to just do "echo getContent(http://localhost:8888/api/something")" |
02:54:16 | def- | with parseUri you translate the string into an URI, then with $ you translate it back into a string |
02:54:42 | def- | 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:18 | reactormonk | def-, I assume any sigsev goes to github issues? |
03:08:11 | nimnoob123 | not going to lie, feels good when things start to work after a few hours of learning lol |
03:08:39 | reactormonk | def-, actually, I still get the incorrect produced code with |
03:08:41 | reactormonk | result.add quote do: |
03:08:43 | reactormonk | {.push stacktrace: off.} |
03:13:23 | reactormonk | nope, the result is correct. |
03:13:34 | reactormonk | {.push, stacktrace: off.} works too. |
03:17:58 | * | papabalyo quit (Quit: Page closed) |
03:21:17 | reactormonk | https://stackoverflow.com/questions/28598093/remove-stacktraces-from-an-emit-pragma let's do it this way :-) |
03:23:12 | nimnoob123 | anyone know how to get rid of the sdl2 'Event' error regarding you can't prove the event was initialized? |
03:23:20 | nimnoob123 | warning* |
03:36:00 | * | lyro quit (Ping timeout: 252 seconds) |
03:36:58 | * | lyro joined #nim |
03:43:13 | nimnoob123 | def- 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:33 | dhasenan | Is 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:40 | dhasenan | If I am wrapping a C++ type in Nim, should I omit private fields? |
04:37:08 | reactormonk | dhasenan, probably |
04:39:57 | * | nimnoob123 quit (Quit: Page closed) |
04:49:42 | Triplefox | i 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:43 | Varriount | Hm. It occurs to me that it should be possible to create python-esque generators in C via procedure casting and argument inspection... |
05:03:19 | Varriount | I 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:13 | Araq | dhasenan: 'importcpp' prevents 'sizeof' generation, in general. maybe there is still a bug left in the codegen? |
07:33:42 | Araq | or 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:18 | TEttinger | Varriount, 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:22 | gokr | I just stumbled over Bret Victor's presentation "The Future of Programming": https://vimeo.com/71278954 |
08:21:03 | gokr | That was a very nice presentation in a funny format. |
08:21:28 | * | lavender joined #nim |
08:21:32 | Araq | that Javascript will end up giving us a slight performance boost? |
08:21:55 | gokr | Hum? |
08:22:22 | Araq | maybe I'm confusing talks :P |
08:22:30 | gokr | I think you are. |
08:22:39 | Triplefox | it's the one that he sets in the mid 1970's, i think |
08:23:07 | gokr | If 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:09 | gokr | Yeah |
08:23:23 | gokr | Its a very funny "time trip". |
08:29:07 | fowlmouth | whats up with ProveInit how do you get past it |
08:29:16 | fowlmouth | {.noinit.} doesnt stop it |
08:30:21 | Araq | fowlmouth: .noinit just means that there is no memset(0) generated |
08:30:52 | Araq | ProveInit means your SDL_event uses a range like 1..4 which doesn't include zero |
08:31:46 | Araq | so the default init value is wrong |
08:31:51 | Araq | and so the compiler complains |
08:32:08 | Araq | that you need to initialize it explicitly |
08:33:09 | fowlmouth | yeah i know |
08:33:32 | fowlmouth | i am asking for a way around it |
08:33:38 | Triplefox | tested with an EmptyEvent at 0 and that does fix it...probably not what we want though |
08:33:52 | fowlmouth | btw we should just call the empty state nil ;) |
08:34:44 | * | lavender quit (Ping timeout: 246 seconds) |
08:39:17 | Triplefox | hmm i managed to generate invalid c while investigating the other option of dumping a "0x100" in there |
08:39:55 | Triplefox | var evnt:Event = cast[Event](cint(0x100)) |
08:41:32 | fowlmouth | Triplefox, just use TEvent(kind: QuitEvent) |
08:42:16 | * | wb joined #nim |
08:42:30 | Triplefox | oh wait it wouldn't be quite right the way i did it anyway |
08:42:39 | Triplefox | cause that enum is for EventType |
08:44:47 | nimnoob123 | yeah 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:09 | Triplefox | var evnt = Event(kind: QuitEvent) |
08:47:18 | Triplefox | still terrible but no warnings |
08:47:39 | nimnoob123 | yeah basically, gets overwritten the moment it goes through pollEvent as well |
08:48:13 | nimnoob123 | think im getting close to porting my c++ sdl2 game to nim, fun times |
08:48:25 | nimnoob123 | but it's almost 3am again... lol time flies |
08:48:33 | * | BlaXpirit quit (Quit: Quit Konversation) |
08:50:16 | Triplefox | there 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:57 | nimnoob123 | maybe 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:27 | fowlmouth | nimnoob123, i'll add a symbol you can use like var evt = sdl2.defaultEvent |
08:54:30 | * | dumdum joined #nim |
08:54:46 | nimnoob123 | that'd work |
09:02:00 | * | nimnoob123 quit (Quit: Page closed) |
09:04:57 | * | teapot1 joined #nim |
09:31:29 | gokr | Did anyone experiment with cling? The C++ interpreter based on LLVM? |
09:31:53 | fowlmouth | gokr, for urho? |
09:32:19 | gokr | Well, for any kind of dynamic fiddling |
09:33:10 | gokr | Eventually I want to be able to modify Nim code while running - in at least some fashion. |
09:33:27 | fowlmouth | gokr, do you know what platform urho3ds windows binaries are |
09:33:41 | gokr | Ehm, what platform? |
09:33:47 | fowlmouth | mingw/msvc/clang |
09:33:57 | fowlmouth | that matters right? |
09:34:05 | gokr | Ah, well, you can build in several ways AFAIK. |
09:34:21 | gokr | I am not sure what limitations cling has. |
09:35:15 | fowlmouth | trying to avoid building it myself |
09:35:25 | gokr | Urho? |
09:35:39 | gokr | It was not hard to build. |
09:35:48 | gokr | At least not on OSX and Linux. |
09:36:18 | * | pafmaf quit (Quit: This computer has gone to sleep) |
09:37:31 | gokr | Urho: "Supported build tools and IDEs: Visual Studio, Xcode, Eclipse, CodeBlocks, QtCreator, GCC, LLVM/Clang, MinGW" |
09:40:37 | gokr | fowlmouth: 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:33 | gokr | Also 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:37 | fowlmouth | something is bugged with my video card and linux |
10:00:29 | fowlmouth | so im on windows for the moment |
10:02:09 | * | reem joined #nim |
10:02:31 | gokr | Ok, well, I haven't built Urho there yet - but Araq of course has. |
10:03:00 | gokr | And dom96, and Dominik's instructions are in the Urhonimo readme. |
10:03:19 | gokr | You would need VS2013 for Urhonimo apparentlt.y |
10:04:11 | * | akiradeveloper joined #nim |
10:06:52 | akiradeveloper | DWORD32 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:06 | def- | akiradeveloper: i think jehan's response to my byteaddress worries is relevant here: http://forum.nim-lang.org/t/892/1#5303 |
10:13:43 | Araq | note that the enormous windows.nim will be deprecated soon |
10:14:06 | Araq | we 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:11 | TEttinger | RCC++ ? |
10:26:37 | * | akiradeveloper joined #nim |
10:26:48 | fowlmouth | akiradeveloper, use winlean instead |
10:28:07 | TEttinger | woah, hadn't heard of RCC++ before, neat stuff |
10:34:55 | * | kuzy000_ joined #nim |
10:37:49 | * | bjz joined #nim |
10:39:31 | akiradeveloper | I 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:19 | Araq | usually in C "unsigned" doesn't mean much. the C developer thinks it means "natural number" but this is just wrong |
10:40:41 | Araq | so I usually map it to a signed integer of the same size |
10:41:59 | Araq | but that's what I do I don't think there is a consensus really |
10:44:00 | akiradeveloper | You know I am developing fuse binding and once I design the interface to use unsigned a filesystem implementation needs too much casting |
10:45:01 | akiradeveloper | Really 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:16 | akiradeveloper | inode number is 64bit unsigned for filesystems to have 2^64-1 inodes... This sounds to me not misuse of unsigned value |
10:50:02 | akiradeveloper | I 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:23 | Araq | *shrug* do what you think is reasonable |
11:02:58 | Araq | obviously it's important to be able to habe 2^64-1 inodes as 2^63-1 would be too few of them |
11:03:06 | Araq | *to have |
11:03:36 | czr | for 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:13 | czr | so 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:54 | gokr | Btw, debugging huge.nim works great in QtCreator. |
11:08:09 | czr | the 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:19 | gokr | It can also use the nim syntax highlighter for Kate. |
11:10:11 | Araq | czr: exactly, thank you. |
11:10:30 | czr | np, sorry for barging in :-) |
11:11:37 | czr | however, 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:55 | czr | akiradeveloper, ^ |
11:12:36 | czr | akiradeveloper, btw, are you wrapping libfuse or talking fuse directly with kernel? |
11:13:04 | gokr | Looks like this: http://snag.gy/FZiM2.jpg |
11:13:58 | akiradeveloper | czr: https://github.com/akiradeveloper/nim-fuse for lowlevel, I am talking with kernel but for highlevel, I am just wrapping libfuse |
11:14:58 | akiradeveloper | I 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:23 | dom96 | gokr: are there any tutorials for Urho3D? |
12:16:03 | gokr | mmm, there are quite a lot of demos, like 30 or so. And the documentation is quite nice. |
12:16:38 | gokr | Not sure about tutorials, I think there is something out there - but I forgot to read it |
12:17:31 | * | rapind joined #nim |
12:19:55 | gokr | Googling will get you some at least. Also stuff on youtube. |
12:24:41 | * | bjz joined #nim |
12:25:14 | dom96 | hrm 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:35 | akiradeveloper | phew https://github.com/Araq/Nim/blob/master/lib/posix/posix.nim#L456 |
13:00:18 | wb | Hm, so apparently "string|bool|float" isn't valid. What's the proper Nim syntax for a heterogenous type like this? |
13:01:51 | def- | wb: why is that notvalid? |
13:02:24 | wb | Compiler throws "not a concrete type" |
13:02:47 | def- | haven't seen that error before |
13:03:23 | akiradeveloper | so only the bit-width matters |
13:03:30 | * | Trustable joined #nim |
13:04:13 | akiradeveloper | Nim doesn't think the value that the bit pattern represent is important. Just define arithmetics for bitset... |
13:05:20 | akiradeveloper | If 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:44 | Varriount | infinity0: I just commented on your 'koch zip' issue. |
14:52:15 | infinity0 | thanks, i will play with the zip thing when i get some time |
14:52:56 | * | BlaXpirit joined #nim |
14:53:50 | Varriount | infinity0: Sorry if I came off as snarky. I really do see the ideas behind your reasoning. |
14:54:15 | infinity0 | ah no worries, i'm glad it makes sense now :) |
14:55:23 | Varriount | infinity0: Also, even though I agree (somewhat hesitantly), including tests in 'koch zip' is not entirely up to me. |
14:55:46 | infinity0 | i 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:42 | gmpreussner|work | nim.cfg seems to be hosed today. none of my projects compile anymore - can't find imports :/ |
15:40:53 | gmpreussner|work | did anyone else run into this? |
15:42:20 | Araq | have you tried to change your cwd so that ../foo can be resolved? |
15:43:14 | gmpreussner|work | lemme check |
15:43:36 | gmpreussner|work | ok, that works! |
15:44:02 | gmpreussner|work | if i cwd into the directory where the nim.cfg is, it compiles fine |
15:44:18 | * | jfchevrette joined #nim |
15:44:20 | Araq | let me check the code |
15:44:25 | gmpreussner|work | but i can't do, for example: nim c foo/bar.nim where foo/ contains nim.cfg |
15:45:42 | gmpreussner|work | it does find and load nim.cfg though |
15:46:22 | gmpreussner|work | hmm... maybe this is the correct behavior after all? |
15:46:41 | gmpreussner|work | perhaps cwd should be where the compiled file is located |
15:47:05 | gmpreussner|work | i haven't put any thought into this :) |
15:47:39 | def- | gmpreussner|work: instead of cwd I'm using 'path = "$projectPath/../src"' and it still seems to work |
15:48:39 | gmpreussner|work | def-: ah, interesting. what does $projectPath resolve to? |
15:48:57 | gmpreussner|work | is that the path to the file being compiled? |
15:49:12 | def- | that's what I assume |
15:49:21 | Araq | gmpreussner|work: nevertheless it should work. you can look into nimconf.loadConfigs and debug it if you want to |
15:49:30 | gmpreussner|work | ok |
15:49:38 | gmpreussner|work | it used to work until yesterday :) |
15:49:40 | Araq | but it did load your config, just the paths were wrong, right? |
15:49:58 | * | Varriount_ is now known as Varriount |
15:50:05 | gmpreussner|work | i think so. it failed to find any of the imports in ../src |
15:50:43 | Araq | hmm, well path handling in the compiler is surprisingly complex :P |
15:54:41 | gmpreussner|work | i 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:01 | zio_tom78 | Hi to everybody |
16:01:11 | def- | hi zio_tom78 |
16:01:55 | * | DecoPerson quit (Quit: Connection closed for inactivity) |
16:02:17 | zio_tom78 | I'm looking for a way to convert an array of "char" into a string. Just doing "string(arr)" doesn't work |
16:02:47 | zio_tom78 | var arr : array[0..1024, char] |
16:03:21 | zio_tom78 | I've looked at the manual and in the "strutil" module, but I found nothing relevant |
16:03:58 | BlaXpirit | zio_tom78, first make sure that array is zero terminated |
16:04:06 | BlaXpirit | or do you want a string of constant length? |
16:04:07 | def- | OT: 0..1024 is 1025 chars |
16:05:02 | * | qwr joined #nim |
16:05:29 | zio_tom78 | Right, I am reading 1024 bytes from a file and am putting a NULL in the 1025th character |
16:05:38 | def- | zio_tom78: var myString = $arr |
16:05:46 | BlaXpirit | var arr: array[0..1024, char]; arr[0] = 'a'; arr[1] = '\0'; echo($arr) |
16:05:48 | BlaXpirit | works |
16:05:52 | zio_tom78 | Ahah! How silly of me! |
16:06:00 | def- | but this is pretty inefficient to do |
16:06:12 | zio_tom78 | In fact I have doubts about my overall approach. |
16:06:21 | BlaXpirit | such a conversion is quite non-obvious. I was gonna do string(cstring(arr)) |
16:06:30 | zio_tom78 | The 1024 bytes are read by the function zlib.gzread |
16:06:47 | zio_tom78 | I am reading a quite large text file that has been compressed by gzip |
16:07:01 | * | ob_ joined #nim |
16:07:12 | zio_tom78 | I want to decompress it into a string variable |
16:07:29 | zio_tom78 | Currently I am decompressing chunks of 1024 bytes each and appending them into a string |
16:07:31 | BlaXpirit | oh, it might not need to be zero-terminated |
16:08:42 | def- | zio_tom78: something like this?: https://github.com/Araq/Nim/blob/master/lib/wrappers/zip/zlib.nim#L187 |
16:09:41 | def- | 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:18 | zio_tom78 | Sort 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:35 | def- | 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:53 | gmpreussner|work | def-: $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:57 | zio_tom78 | Oh, sorry, I misunderstood your suggestion |
16:16:26 | zio_tom78 | def-: 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:36 | zio_tom78 | Thanks a lot guys! |
16:16:58 | def- | zio_tom78: and a setLen after it's all done |
16:17:09 | zio_tom78 | def-: Yeah, right |
16:18:30 | * | Sornaensis joined #nim |
16:21:37 | Varriount | onionhammer: ping |
16:24:09 | * | darkf quit (Quit: Leaving) |
16:30:20 | zio_tom78 | BlaXpirit, def-: Ok, now the code works smoothly and the speed is comparable with gzip. Thanks a lot |
16:30:48 | def- | zio_tom78: awesome! |
16:31:32 | zio_tom78 | Cheers to everybody! |
16:31:39 | * | zio_tom78 left #nim ("ERC Version 5.3 (IRC client for Emacs)") |
16:36:19 | dybt | I'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:48 | dybt | woops, missed a space at the start of the link https://gist.github.com/dylanbraithwaite/9f097db5c928860c69b7 |
16:38:14 | def- | dybt: that means your Nim compiler assumes 64bit, while you C compiler is 32bit (or the other way around) |
16:39:03 | def- | Maybe it also has to do with cygwin? |
16:39:40 | dybt | I tried it in cygwin too. It complained about not being able to link with some windows functions |
16:40:27 | dybt | I 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:27 | def- | Strange, I don't know how this happens then |
16:44:14 | dybt | yeah, gcc's version is mingw32 and Nim is amd64. I'll try installing a 64 bit version of mingw |
16:44:17 | dybt | thanks |
16:44:41 | * | pregressive quit (Remote host closed the connection) |
16:50:40 | dybt | can I specify a specific c compiler? |
16:51:35 | gmpreussner|work | how 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:23 | dom96 | gmpreussner|work: Can I see your code? |
16:54:32 | * | kjo1 quit (Quit: Leaving.) |
16:57:25 | ekarlso | what libraries to make :p |
16:59:42 | def- | dybt: --cc:gcc and --gcc.exe:path/filename here |
16:59:55 | dybt | thanks |
17:01:36 | dybt | does 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:07 | def- | nope |
17:06:19 | def- | but it's the same settings as in the config/nim.cfg |
17:06:29 | dybt | ah |
17:06:45 | def- | 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:58 | dybt | I 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:40 | gmpreussner|work | dom96: http://github.com/nimious - pick any repository :) |
17:18:09 | gmpreussner|work | i 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:50 | wb | So 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:58 | wb | (asked this earlier but nobody knew) |
18:26:17 | def- | 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:02 | BlaXpirit | maybe you're confusing generic vs variant |
18:28:47 | wb | Possibly. This is the code: http://hastebin.com/oluterivup.hs |
18:29:27 | BlaXpirit | yes, you are |
18:31:06 | BlaXpirit | wb, https://github.com/Araq/Nim/blob/master/lib/pure/json.nim#L517 |
18:31:48 | BlaXpirit | this 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:06 | wb | Thanks. I hope there's some sort of syntactic sugar planned there, though: that's some serious voodoo. |
18:35:17 | BlaXpirit | i've been trying to think what exactly is the reason that you can't use generics here |
18:35:24 | BlaXpirit | brain too weak |
18:35:38 | * | TnTReX joined #nim |
18:37:37 | metachar | what'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:09 | metachar | and they say you need "or types" like that one |
18:40:05 | * | shevy left #nim ("I'll be back ... maybe") |
18:40:49 | wb | im trying to write a simple config file loader (mostly for practice), and the data can be a string, bool, or float |
18:40:57 | BlaXpirit | see also docopt |
18:44:25 | dom96 | wb: I think something like this should work: https://gist.github.com/dom96/b932c5bad4033cb7d062 |
18:44:29 | dom96 | But it crashes the compiler. |
18:44:52 | Trixar_za | Hey dom96 |
18:46:29 | dom96 | hi Trixar_za |
18:52:30 | BlaXpirit | dom96, that definitely is not the intended behavior |
18:52:49 | BlaXpirit | a config file of one type? |
18:55:16 | * | TnTReX quit (Quit: Leaving) |
18:55:23 | wb | On a related note, is there an "any" type? |
18:56:58 | * | Pisuke joined #nim |
18:57:52 | wb | ("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:29 | def- | wb: you could do something like this: http://nim-lang.org/json.html#JsonNodeObj |
19:00:49 | BlaXpirit | wb, 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:08 | wb | This is a complete cluster. Is there a way to just tell the compiler not to typecheck a certain region? |
19:38:22 | wb | Or a "void ptr" a la C/C++? |
19:39:13 | Jehan_ | wb: Can you be more specific? |
19:40:03 | Jehan_ | 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:22 | BlaXpirit | wb, "pointer" is "void*" |
19:40:35 | * | brson joined #nim |
19:41:48 | wb | Alright, 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:02 | BlaXpirit | wb, but there is no other good way to go |
19:42:04 | BlaXpirit | srsly |
19:42:14 | BlaXpirit | have u seen https://github.com/BlaXpirit/docopt.nim ? |
19:42:47 | BlaXpirit | I just noticed that github changed syntax highlight (at least colors) for nim |
19:43:05 | BlaXpirit | strings definitely weren't blue before |
19:44:29 | BlaXpirit | actually, docopt's code won't teach you anything other than json |
19:44:40 | BlaXpirit | just another instance of it. works OK |
19:45:03 | BlaXpirit | actually, proc val(...) kinda helped |
19:45:57 | wb | Yeah 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:20 | BlaXpirit | wb, this is already syntax sugar :p |
19:47:25 | BlaXpirit | C++ has it worse |
19:47:31 | * | dumdum quit (Ping timeout: 256 seconds) |
19:48:11 | BlaXpirit | Haskell probably has some clever solution to this |
19:49:11 | Araq | can somebody help this guy? http://forum.nim-lang.org/t/897 |
19:49:28 | saml | tutorial is gone? |
19:49:40 | Araq | though I'll probably take it as a chance to improve our leak detector |
19:49:57 | BlaXpirit | saml, no |
19:50:10 | saml | http://nim-lang.org/documentation.html unlinked from here |
19:50:58 | Araq | saml: there is a "learn" tab |
19:51:03 | Araq | it's in there |
19:51:26 | BlaXpirit | saml, 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:33 | reactormonk | How can I render a StmtList into code? Good old `$`? |
19:53:21 | Jehan_ | Araq: Umm, the problem is that just downloading the tar.bz2 is going tot take forever. |
19:54:23 | saml | ah i see |
19:54:31 | saml | i cray |
19:54:49 | * | pr3d4t0r quit (Ping timeout: 245 seconds) |
19:55:38 | * | pr3d4t0r joined #nim |
19:55:53 | Jehan_ | reactormonk: toStrLit(s).strVal should normally do the trick. |
19:56:18 | reactormonk | Jehan_, thanks. Let's see if it's a good idea to do that. |
19:56:38 | Jehan_ | I have no idea if the conversion is perfect for everything, though. |
19:58:30 | Trixar_za | Hmmm, apparently I still have Jehan_ on ignore. Can't remember why though |
19:59:13 | reactormonk | Trixar_za, ^^ |
19:59:15 | Jehan_ | Eh, I remember, and feel free to put me back on it. |
19:59:38 | reactormonk | lulz. |
19:59:40 | Trixar_za | Not even sure if it's the same one. Broad ignores == bad. |
20:00:05 | reactormonk | What's a good way to iterate over two different things at the same time? aka a list of tuples |
20:01:26 | Jehan_ | reactormonk: for a, b in list.items: echo a, " ", b |
20:01:56 | Jehan_ | Have to specify items, or it'll try to infer list.pairs. |
20:02:04 | reactormonk | Jehan_, let's say I want to iterate over 1, 2, 3 and "a", "b", "c" at the same time |
20:02:27 | Jehan_ | So, that wouldn't be a list of tuples, but two lists? |
20:03:24 | Jehan_ | The easiest (though not prettiest) way would be: for i, a in list1.pairs: let b = list2[i]; ... |
20:04:21 | reactormonk | Jehan_, doesn't really matter, the items I'm iterating over are static. |
20:04:30 | reactormonk | So it's just a matter how to organize them. |
20:06:49 | Jehan_ | 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:27 | reactormonk | I 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:23 | Triplefox | Is there a good rule of thumb for deciding between tuple and object |
20:32:56 | * | UberLambda quit (Quit: Leaving the Matrix) |
20:34:13 | Araq | tuple: 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:52 | Triplefox | What 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:01 | Jehan_ | Triplefox: Basically, tuples are for when you have few fields and use constructors and tuple assignment a lot. |
20:48:41 | Jehan_ | 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:54 | Triplefox | I 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:32 | Jehan_ | 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:52 | Araq | 'case' also only works in objects |
20:59:17 | saml | aporia doesn't have auto complete, right? |
21:00:31 | * | jfchevrette quit (Quit: Textual IRC Client: www.textualapp.com) |
21:01:25 | Araq | we're working on it |
21:01:28 | def- | Araq: yes, it took some time to look into this issue: http://forum.nim-lang.org/t/897/1#5327 |
21:01:43 | def- | Araq: I got the program fast, but i think something is wrong with the GC still |
21:03:09 | Araq | tried with --gc:markAndSweep too? |
21:03:42 | * | BlaXpirit_ quit (Quit: Quit Konversation) |
21:03:43 | def- | it's a bit difficult to try because it takes long until it gets really slow |
21:04:11 | Araq | that sounds more like a fragmentation issue |
21:04:27 | def- | ah! because of so many string allocations |
21:04:35 | Araq | but I can work on the memory profiler this weekend |
21:04:45 | Araq | perhaps. |
21:05:28 | Araq | seems to be a good candidate for a long running test |
21:06:14 | Araq | (which of course should be run when people install Nim ... ;-) ) |
21:06:19 | def- | It's pretty interesting to parse the entire wikipedia |
21:06:33 | def- | i don't think tests should be run on installation |
21:06:51 | Araq | good |
21:10:53 | * | rapind joined #nim |
21:17:23 | * | Mat4 joined #nim |
21:17:28 | Mat4 | hello |
21:19:51 | def- | hi Mat4 |
21:20:02 | Mat4 | hi def- |
21:21:31 | * | brson joined #nim |
21:23:29 | Araq | def-: I'm actually not too much of generics for everything, how about this idea: make the type overridable like perhaps so: |
21:23:52 | Araq | when existsFile(rationalOverride): |
21:24:13 | Araq | from rationalOverride import BaseInt |
21:24:16 | Araq | else: |
21:24:23 | Araq | type BaseInt = int |
21:24:30 | Araq | ... # code that uses BaseInt |
21:24:58 | Araq | while that may first seem like a hack, it actually buys us interop |
21:25:04 | def- | sounds like a hack. so you'd have to use the same BaseInt for the whole project |
21:25:17 | Araq | that's the *feature* I'm after |
21:25:43 | Araq | this 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:10 | def- | I'm not sure, could be interesting |
21:26:12 | Araq | but I don't have the problem that my Rational[int] doesn't work with your Rational[BigInt] |
21:26:53 | Araq | well I guess people won't accept it |
21:26:58 | * | Boscop_ joined #nim |
21:27:36 | Araq | so meh, let's make it generic |
21:28:04 | * | filwit quit (Quit: Leaving) |
21:28:23 | def- | with generics it should still be so that you can use int by default |
21:28:44 | def- | and i don't know how to make it generic properly, user defined typeclasses? |
21:29:14 | def- | 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:54 | Araq | yeah but typeclasses are perhaps not in 1.0 ... |
21:30:25 | * | gsingh93 quit (Ping timeout: 264 seconds) |
21:30:28 | Araq | and Just [T] is what we use for now, so meh, it's fine |
21:30:33 | * | Boscop quit (Ping timeout: 252 seconds) |
21:31:00 | Araq | Mat4: yeah but then not having a type system is wierd for systems programming |
21:31:50 | Araq | you 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:06 | Mat4 | probably |
21:33:14 | * | pregressive joined #nim |
21:34:07 | Mat4 | I have these idea of storage formats implicitly converting to a unified type at reading... anyhow that's somewhat offtopic |
21:39:27 | BlaXpirit | is there a clever way to write var arr = [f(), f(), f(), f(), f(), f(), f(), f()] ? |
21:39:53 | def- | BlaXpirit: for seqs there's newSeqWith |
21:40:00 | Araq | BlaXpirit: macro? |
21:40:01 | def- | that i wrote exactly for this |
21:40:29 | BlaXpirit | mmm looks nice, def- |
21:40:51 | def- | you could adapt it to arrays i guess |
21:41:36 | BlaXpirit | it's probably not worth it in this case :/ |
21:44:13 | def- | BlaXpirit: ideally you'd want something like [f() * 10]? |
21:44:33 | BlaXpirit | I'll just write a loop |
21:44:39 | def- | maybe a macro would work! |
21:44:46 | BlaXpirit | the only thing I didn't like about writing a loop is that it is 0..15 |
21:44:55 | def- | arr.low..arr.high? |
21:45:04 | BlaXpirit | right. |
21:45:14 | BlaXpirit | thanks |
21:45:23 | def- | or even better: for x in arr.mitems: x = f() |
21:45:53 | BlaXpirit | mmmmmmmmm so good |
21:50:29 | Mat4 | you can write an iterator as alternative using tail-call recursion? |
21:52:17 | * | alexruf quit (Quit: Textual IRC Client: www.textualapp.com) |
21:57:45 | Mat4 | nf (f, i) → i > 0: f (i-1) |
22:00:37 | Mat4 | need 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:57 | saml | what's difference between echo "hello" and echo("hello") ? |
22:06:10 | saml | and discard "hello" and discard("hello") |
22:06:20 | saml | i don't know when to use () or when not to |
22:06:35 | def- | saml: http://nim-lang.org/manual.html#command-invocation-syntax |
22:07:39 | BlaXpirit | I omit the brackets when it sounds like a proper sentence |
22:07:43 | def- | 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:58 | BlaXpirit | my recent favorite: sleep 2.seconds |
22:08:03 | saml | so always use () |
22:09:06 | def- | saml: I like to leave away brackets when it looks more aesthetical |
22:09:22 | BlaXpirit | draw circle |
22:09:25 | * | dybt quit (Ping timeout: 255 seconds) |
22:09:30 | def- | or "close file" |
22:09:59 | BlaXpirit | i'd be tempted to write file.close() in that case :D |
22:10:07 | saml | aesthetic 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:40 | BlaXpirit | lolololol |
22:24:45 | BlaXpirit | I feel like a crazy man |
22:24:50 | BlaXpirit | writing macros by using just strings |
22:29:13 | def- | BlaXpirit: have some example code? |
22:29:22 | BlaXpirit | soon |
22:30:05 | BlaXpirit | it 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:22 | panzone | hi, 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:30 | Araq | hi panzone. nice. |
22:47:04 | def- | panzone: hi. first we have to be accepted of course. which project? |
22:47:59 | panzone | I'm interested in the garbage collector project |
22:48:34 | Araq | good choice ;-) |
22:48:35 | panzone | and obviously first you have to be accepted, but I learned last year that the first you move, the better are you chances |
22:48:41 | fowlmouth | anybody know how to interrupt visual studio from building |
22:48:42 | def- | 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:21 | fowlmouth | nvm found it |
22:49:33 | def- | panzone: but from how i understand gsoc, people who have never contributed to open source are quite welcome as well |
22:49:51 | panzone | I 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:46 | panzone | and 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:12 | ldlework | Prepared and motivated... this guy sounds dangerous. |
22:52:27 | def- | panzone: awesome |
22:52:57 | panzone | like, 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:59 | def- | that's one of the few projects where I'm not listed as mentor, so we'll have to find zahary |
22:53:31 | Araq | not really, I think I know what he had in mind |
22:54:18 | panzone | (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:31 | Araq | panzone: 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:41 | reactormonk | panzone, from what I understand it's not a modular GC, it's the compiler which should be modular to insert different GCs |
22:54:53 | panzone | (oh, and sorry for my terrible english :) ) |
22:55:36 | Araq | it 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:12 | Araq | the other two GCs that we have are markAndSweep and Boehm and neither requires any barriers |
22:56:32 | panzone | mmm so that you can change the gc algorithm at compile time without having to change everything |
22:56:37 | * | Siecje joined #nim |
22:56:45 | Araq | yes, that's possible already |
22:56:53 | Siecje | I'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:03 | Araq | but more GC algorithms can be implemented |
22:57:17 | Araq | and in general a GC requires codegen support as you should know |
22:57:25 | dom96 | Siecje: It has been moved out of the standard library. |
22:58:10 | saml | http://irclogs.nim-lang.org/ ? |
22:58:12 | Siecje | dom96: Thanks, does nim have a package manager I've got that far. |
22:58:16 | dom96 | Siecje: 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:34 | saml | nimble search irc |
22:58:40 | Araq | panzone: did that answer your question? |
22:58:40 | saml | url: git://github.com/nim-lang/irc (git) |
22:58:43 | dom96 | Siecje: Yeah, it's called Nimble: https://github.com/nim-lang/nimble/ |
23:00:11 | Siecje | dom96: I saw your web framework it looks really cool |
23:00:18 | dom96 | Siecje: Thanks :) |
23:00:43 | * | ob_ joined #nim |
23:00:45 | TEttinger | Nimble is awesome so far, it needed a little config on windows do get stuff off git (haven't tried mercurial yet) |
23:01:12 | dom96 | TEttinger: That's good to hear, what config did it require? |
23:01:12 | * | 5EXAAJO3K quit (Quit: This computer has gone to sleep) |
23:01:46 | Araq | panzone: 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:53 | panzone | Araq: 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:17 | TEttinger | dom96: setting git config to use https:// instead of git:// |
23:03:30 | TEttinger | someone else posted the line to do that in here... |
23:04:42 | dom96 | TEttinger: 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:58 | Araq | panzone: well if you have any suggestions of how to improve the description, I'm all ears |
23:05:05 | Siecje | Does nimble support the same package installed with different versions? |
23:05:13 | TEttinger | <singul42> still having the problem with git:// protocol under windows, but as a workaround git config --global url."https://".insteadOf git:// helps |
23:05:34 | dom96 | Siecje: yep |
23:06:17 | TEttinger | dom96: 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:36 | Siecje | dom96: That's a pretty smart implementation. Having one location for third part packages. |
23:06:41 | TEttinger | anyone got a recommendation for a Nim package to test really fast? |
23:06:46 | * | t4nk530 quit (Ping timeout: 246 seconds) |
23:06:47 | TEttinger | preferably an application |
23:08:47 | panzone | Araq: no, no, it's ok. it perfectly explains the problem and why you want a solution. |
23:08:54 | def- | TEttinger: brainfuck |
23:10:26 | Araq | panzone: 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:20 | Araq | as that it is not too hard but requires a completely different barrier |
23:12:20 | federico3 | I'll just leave this here: https://stripe.com/blog/stripe-open-source-retreat |
23:14:00 | reactormonk | federico3, the wording could be better. Anyway, from what I know most of the poeple here are from europe. |
23:14:14 | Siecje | federico3: How did it go? |
23:14:18 | federico3 | wording? |
23:14:30 | * | nimnoob123 joined #nim |
23:14:32 | reactormonk | "retreat" |
23:14:56 | panzone | and 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:58 | federico3 | reactormonk: "We also will accept applicants from outside the United States" |
23:15:18 | BlaXpirit | wb, I accidentally stumbled upon this http://nim-lang.org/typeinfo.html |
23:15:19 | nimnoob123 | is there an alternative syntax for importing from subfolders? (instead of using forward slash) |
23:15:22 | dom96 | federico3: Why is this relevant, isn't this over already? |
23:15:36 | BlaXpirit | nimnoob123, dot is the same |
23:15:37 | dom96 | nimnoob123: import foo.bar |
23:15:43 | nimnoob123 | thanks |
23:15:52 | federico3 | they might be do it again |
23:15:53 | reactormonk | dom96, looks like you're right. wrong year ^^ |
23:16:28 | def- | reactormonk: i also thought "retreat" means they'll stop support open source |
23:16:31 | wb | BlaXpirit: thanks, that'll probably be helpful. |
23:16:39 | reactormonk | def-, exactly. |
23:17:41 | * | Boscop_ quit (Ping timeout: 250 seconds) |
23:18:15 | * | Boscop_ joined #nim |
23:18:24 | Araq | "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:11 | reactormonk | Araq, 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:54 | Siecje | How does nim differentiate local modules vs third party ? |
23:32:26 | ekarlso | heya guys |
23:32:38 | ekarlso | dom96: u think we can deploy play.nim-lang.org this weekend ? |
23:33:08 | dom96 | ekarlso: Sure. If you let me test it first. |
23:33:31 | ekarlso | dom96: I can host it if that's ok and give you ssh access |
23:33:40 | reactormonk | Siecje, third party as in nimble? |
23:33:41 | ekarlso | got free compute power for nim stuff |
23:33:51 | Siecje | reactormonk: yeah |
23:34:05 | reactormonk | Siecje, how do you want to do the differentiating? |
23:34:15 | def- | ekarlso: yay! |
23:34:31 | def- | ekarlso: when can I try it out? |
23:34:36 | reactormonk | Siecje, aka, at which point does it matter? |
23:34:38 | dom96 | ekarlso: sure. |
23:34:43 | ekarlso | def-: hoping by the weekend if my kid allows it :p |
23:35:02 | Siecje | reactormonk: discovery |
23:38:02 | * | panzone quit (Quit: Leaving...) |
23:43:39 | flaviu | ekarlso: Who donated the VM? |
23:44:08 | ekarlso | flaviu: vm's atm |
23:44:10 | ekarlso | zetta.io |
23:44:30 | ekarlso | got one for packages and one for play |
23:45:05 | ekarlso | how can I get the first char of a string ? |
23:45:16 | flaviu | Looks like zetta is down atm |
23:45:24 | flaviu | ekarlso: mystr[0]? |
23:45:30 | ekarlso | .eval var foo = "foo"; foo[0] |
23:45:35 | ekarlso | that bot... |
23:45:49 | * | Mimbus joined #nim |
23:46:30 | ekarlso | flaviu: they're doing maintenance of the networking backend |
23:47:42 | ekarlso | .eval var foo = "foo"; foo[0] |
23:47:46 | Mimbus | ekarlso: eval.nim(4, 3) Error: value of type 'char' has to be discarded |
23:48:33 | ekarlso | huh |
23:48:41 | TEttinger | Mimbus is a Nim bot? |
23:49:49 | ekarlso | .eval let names = @["endre"]; let letters = @["e"]; echo(names.filter(proc (s: string): bool = string(s[0]) in letters)) |
23:49:52 | Mimbus | ekarlso: eval.nim(5, 49) Error: conversion from char to string is invalid |
23:49:59 | TEttinger | .eval var foo = "foo"; echo(foo[0]); discard; |
23:50:04 | Mimbus | TEttinger: f |
23:50:13 | ekarlso | .eval let names = @["endre"]; let letters = @["e"]; echo(names.filter(proc (s: string): bool = s[0] in letters)) |
23:50:16 | Mimbus | ekarlso: eval.nim(5, 48) Error: type mismatch: got (seq[string], char) |
23:50:19 | ekarlso | :P |
23:54:10 | TEttinger | .eval let names = @["endre"]; let letters = @["e"]; echo(names.filter(proc (s: string): bool = ! ! s[0] in letters)) |
23:54:13 | Mimbus | TEttinger: eval.nim(5, 45) Error: type mismatch: got (char) |
23:54:50 | TEttinger | .eval let names = @["endre"]; let letters = @['e']; echo(names.filter(proc (s: string): bool = s[0] in letters)) |
23:54:54 | Mimbus | TEttinger: @[endre] |
23:54:58 | TEttinger | hehe yay |
23:55:03 | flaviu | it's best to move the bot use into #nim-offtopic before Araq gets annoyed :P |
23:55:09 | TEttinger | I'm done |
23:56:37 | * | rapind joined #nim |