00:00:00 | ldlework | inside the condition is include_other_template(template_name, context_dictionary) |
00:00:03 | onionhammer | that gets translated into if/else branch in nim |
00:00:20 | onionhammer | ldlework you can call another proc |
00:00:32 | ldlework | right |
00:00:47 | ldlework | So where does template inheritance come in |
00:00:49 | ldlework | nm |
00:00:51 | onionhammer | your dictionary of templates would have to be compiled |
00:01:01 | ldlework | its not a dictionary of templates |
00:01:02 | onionhammer | you cant load them from a templates folder |
00:01:09 | ldlework | its a dictionary of values that the template should use to render |
00:01:25 | onionhammer | ok |
00:01:32 | onionhammer | well you can definitely write something like your example |
00:01:36 | ldlework | ok :) |
00:01:44 | onionhammer | it would be fairly simple |
00:01:57 | ldlework | I believe you. I think I was confused earlier |
00:01:58 | onionhammer | when I say it's compiled I dont mean that the string is generated at compile time and thats all u can use |
00:01:59 | fowl | See how macros.quote is implemented |
00:02:13 | ldlework | onionhammer: I think that's what I thought |
00:02:39 | onionhammer | i agree that would be pretty pointless :P |
00:05:50 | onionhammer | BlaXpirit-UA how would you write an html template with nimception? |
00:05:57 | BlaXpirit-UA | https://gist.github.com/BlaXpirit/067a7cce395f2146ebba |
00:06:22 | BlaXpirit-UA | html coming up |
00:06:23 | onionhammer | hm, theres no html in there |
00:06:51 | ldlework | I don't understand it |
00:07:22 | ldlework | If you type 'yes' the first time, the template gets rendered, and it asks for input a second time? |
00:07:23 | BlaXpirit-UA | just a convoluted proof of concept that it's not just all static |
00:07:40 | BlaXpirit-UA | ldlework, if u type yes, you can type another line to put into the template |
00:07:46 | ldlework | nice dude |
00:08:09 | ldlework | BlaXpirit-UA: so unlike jinja, even the runtime stuff is full Nim? (like the second readline) |
00:08:19 | BlaXpirit-UA | yes, it's just nim |
00:08:21 | ldlework | that's nuts |
00:08:35 | BlaXpirit-UA | it's same as onionhammer's but extremely short |
00:08:48 | ldlework | so, the second readline... that too is compiled at compile time? |
00:10:03 | ldlework | What's nice about this, is a template has a compiler checked function signature... |
00:10:18 | BlaXpirit-UA | ok there is some problem with nimception and i can't produce an html example :D |
00:10:26 | onionhammer | ldlework its the same w/ nim-template |
00:10:26 | ldlework | Compared to python where you just pass a dictionary, and you may or may not be passing everything the template needs. |
00:10:29 | BlaXpirit-UA | oh nvm i just forgot how to use it |
00:10:37 | onionhammer | templates basically are procs |
00:10:50 | ldlework | onionhammer: I believe you. My 'nice' isn't to his in particular, but my ongoing cognitive revelation of how nim templates actually behave. |
00:10:57 | ldlework | onionhammer: yeah that's really useful |
00:11:03 | * | JinShil joined #nim |
00:11:37 | BlaXpirit-UA | finally https://gist.github.com/BlaXpirit/d3ca3f4acbd00783bc1f |
00:11:42 | onionhammer | you get syntax highlighting for templates with nimlime too ;) |
00:12:17 | onionhammer | BlaXpirit-UA cool, what about C/C++? |
00:12:20 | onionhammer | or CSS |
00:12:23 | onionhammer | afk a bit |
00:12:32 | BlaXpirit-UA | can do anything, it's just indentation-based |
00:12:56 | BlaXpirit-UA | which is an inconvenience more often than not |
00:14:40 | BlaXpirit-UA | well actually no, it can't do anything. basing it on indentation is a huge limitation |
00:14:49 | BlaXpirit-UA | but whatever, it's just a proof of concept |
00:15:52 | Siecje | ldlework: how is that different than jinja2? |
00:16:32 | ldlework | Siecje: how is what |
00:17:10 | Siecje | You said "unlike jinja, even the runtime stuff is full Nim" |
00:17:27 | ldlework | Siecje: jinja2 doesn't let you run arbitrary Python |
00:17:29 | Siecje | Oh you mean inside the templates you can just write Nim |
00:17:31 | ldlework | inside the templates |
00:17:33 | ldlework | yeah |
00:17:44 | ldlework | I mean, most of the time that's a good thing I guess |
00:17:48 | BlaXpirit-UA | well jinja could also just have arbitrary python |
00:17:50 | Siecje | For better or worse, yeah |
00:17:55 | BlaXpirit-UA | it was a voluntary choice to not |
00:18:21 | ldlework | BlaXpirit-UA: yeah but doing it with arbitrary python in python would be messier than in nim |
00:18:31 | BlaXpirit-UA | can't see how |
00:18:48 | ldlework | you have to manually set up the avilable scope to the things you eval and so on |
00:19:12 | ldlework | though I suppose here you're stitching strings together to generate code |
00:19:27 | reactormonk | what's the windows equivalent to EADDRINUSE? |
00:20:30 | * | BlaXpirit-UA quit (Quit: Quit Konversation) |
00:28:30 | reactormonk | found it |
00:33:03 | * | JinShil quit (Quit: Konversation terminated!) |
00:35:01 | * | DSAFDSGFD quit (Quit: Page closed) |
00:38:46 | * | Sharcho quit (Quit: Leaving) |
00:44:32 | * | nimnoob123 quit (Quit: Page closed) |
00:46:47 | Siecje | I have a file called name.nim with a proc inside. I'm trying from name import proc, but it says undeclared identifier 'proc' |
00:47:05 | * | FDGFGFGDFD joined #nim |
00:47:22 | * | xificurC_ joined #nim |
00:47:31 | reactormonk | Siecje, gotta export the proc via * |
00:48:01 | * | xificurC quit (Remote host closed the connection) |
00:48:30 | Siecje | reactormonk: Ty, I had the '*' is confusing in my notes from last time I played with nim, now I know why |
00:50:16 | fowl | From name import func1, func2 |
00:52:36 | * | Trustable quit (Remote host closed the connection) |
01:01:00 | * | saml_ joined #nim |
01:06:09 | * | darkf joined #nim |
01:19:39 | Siecje | I was planning on having the templates as nim code but I can't pass which file to import from https://dpaste.de/RdLJ#L1,4 |
01:20:23 | * | JinShil joined #nim |
01:32:54 | onionhammer | sec Siecje.. |
01:41:24 | * | JinShil quit (Quit: Konversation terminated!) |
01:47:14 | onionhammer | Siecje https://gist.github.com/onionhammer/5bef227ffa5280f7da66 |
01:47:44 | onionhammer | it's easier to work with strings than macros/templates though |
01:49:40 | onionhammer | added a string version |
01:50:49 | onionhammer | btw nim-template reindents your template, so you dont need to have it aligned all the way to the left |
01:50:49 | * | wb quit (Ping timeout: 264 seconds) |
01:51:18 | reactormonk | onionhammer, still gotta do the html escape dance |
01:51:29 | onionhammer | html escape dance? |
01:51:51 | Siecje | onionhammer: I don't think that was my issue (not yet anyways) the problem was importing the template function |
01:52:27 | onionhammer | Siecje I just noticed you had your code with no indentation |
01:52:33 | onionhammer | just a note |
01:54:02 | Siecje | onionhammer: well they are in different files and the rest is a string? |
01:54:27 | onionhammer | right, i'm saying you can indent the string further |
01:54:59 | Siecje | Doesn't that add whitespace to the string itself though? |
01:55:24 | onionhammer | yes but nim-templates automatically removes it |
01:55:43 | onionhammer | it uses the line with the least leading whitespace and re-indents the rest of the lines to match |
01:55:52 | Siecje | okay thanks |
02:09:13 | Siecje | onionhammer: How does the string get passed to the template? |
02:09:13 | Siecje | layout.render(title): |
02:09:13 | Siecje | tmpl html""" |
02:10:52 | onionhammer | http://nim-lang.org/0.11.0/manual.html#macros-statement-macros |
02:10:59 | onionhammer | it's a nim macro |
02:11:37 | onionhammer | since you're kinda just starting out w/ nim, and it's not trivial, i would just stick to passing strings & using procs |
02:11:45 | onionhammer | like the example in alternate.nim |
02:19:36 | Siecje | In view.nim I'm getting Error: cannot open 'templates' |
02:24:27 | onionhammer | gist your code |
02:34:01 | Siecje | https://dpaste.de/4bC8#L3 |
02:34:26 | Siecje | https://dpaste.de/4bC8#L3,49 |
02:37:55 | onionhammer | are underscores in filenames allowed? |
02:37:57 | onionhammer | i dont think so. |
02:45:42 | Siecje | same error |
02:49:49 | * | gokr_ quit (Ping timeout: 245 seconds) |
02:49:49 | * | Amrykid quit (Ping timeout: 245 seconds) |
02:50:27 | onionhammer | Siecje works for me |
02:50:45 | onionhammer | once i got rid of the _'s and renamed the index proc to something else |
02:50:53 | * | Amrykid joined #nim |
02:50:56 | onionhammer | the index proc and the index module makes its usage ambiguous |
02:52:52 | * | Valiance joined #nim |
02:53:24 | Siecje | oh right |
02:54:08 | Siecje | hmm I'm still getting the templates error |
02:55:38 | Siecje | nimble install nim-templates fails https://dpaste.de/zD6P |
02:57:29 | onionhammer | do `nimble search templates` |
02:59:04 | Siecje | success it finds your github repo |
03:00:06 | Siecje | okay I needed to install templates |
03:00:36 | Siecje | onionhammer: thanks for your help |
03:01:32 | onionhammer | np |
03:04:11 | * | kjo1 joined #nim |
03:06:17 | * | Valiance quit (Quit: Page closed) |
03:13:14 | * | kjo1 left #nim (#nim) |
03:14:09 | fowl | Is master or devel the main branch of work now? |
03:23:50 | reactormonk | \o/ epc works - now I just need to make it give me a suggestion |
03:28:49 | * | BitPuffin|osx quit (Ping timeout: 250 seconds) |
03:29:01 | Siecje | I see { content } on the page and not the inner template |
03:34:01 | * | Demon_Fox quit (Ping timeout: 250 seconds) |
03:35:32 | * | Demon_Fox joined #nim |
03:35:42 | reactormonk | I just can't tickle the nimsuggest to give me something :-/ Anyone got some data ready? |
03:36:29 | reactormonk | nope, this one should work. hmm. |
03:43:28 | * | johnsoft quit (Ping timeout: 252 seconds) |
03:43:36 | * | johnsoft joined #nim |
03:48:59 | reactormonk | ok, wtf. I'm calling |
03:49:02 | reactormonk | suggest.suggestionResultHook = proc (s: Suggest) = |
03:49:03 | reactormonk | results.add(s) |
03:49:17 | reactormonk | and when checking echo(isNil(suggestionResultHook)) |
03:49:23 | reactormonk | over in suggest.nim, I get true |
03:52:08 | * | Demon_Fox quit (Ping timeout: 256 seconds) |
03:53:45 | * | Demon_Fox joined #nim |
03:57:43 | * | vendethiel joined #nim |
04:02:15 | * | RaphaelHythloday joined #nim |
04:02:40 | RaphaelHythloday | I have a problem with the interpreter: I typed "var a: int" and got " |
04:02:40 | RaphaelHythloday | No command 'var' found, but there are 22 similar ones |
04:02:40 | RaphaelHythloday | var: command not found" |
04:02:53 | * | xificurC_ quit (Write error: Broken pipe) |
04:03:00 | * | xificurC joined #nim |
04:04:06 | reactormonk | RaphaelHythloday, yeah, we dropped interpreter support because it sucks |
04:04:19 | reactormonk | sorry, gotta go with a test file and just nim -r c in behind |
04:04:28 | RaphaelHythloday | Ok |
04:04:29 | reactormonk | it's fast enough that you don't really know the difference |
04:04:36 | RaphaelHythloday | The flag should be removed then, though |
04:04:37 | RaphaelHythloday | nim i |
04:04:48 | RaphaelHythloday | If it doesn't work |
04:05:02 | RaphaelHythloday | And the code purged from the compiler, kept seperate in github |
04:06:21 | reactormonk | someone can pull it from the git history if they want, I opened an issue on purging it, let's see |
04:07:35 | reactormonk | but as mentioned, nim -r c test.nim is as fast as nim i - just gotta add that echo stuff |
04:14:56 | * | brson joined #nim |
04:31:25 | * | RaphaelHythloday quit (Ping timeout: 265 seconds) |
04:32:03 | reactormonk | Araq, https://github.com/Araq/Nim/issues/2634 blocks emacs stuff atm :-( |
04:50:21 | onionhammer | Siecje $ needs to be followed by a var or {} |
04:50:39 | onionhammer | $ { content } wont work, ${ content } or $content |
04:50:48 | Siecje | ahh |
05:02:19 | * | vendethiel quit (Ping timeout: 245 seconds) |
05:15:30 | * | ddl_smurf quit (Quit: ddl_smurf) |
05:26:08 | * | Siecje quit (Quit: Leaving.) |
05:28:48 | * | gsingh93 joined #nim |
05:39:59 | * | gsingh93 quit (Ping timeout: 276 seconds) |
05:47:12 | * | brson quit (Quit: leaving) |
05:51:07 | * | johnsoft quit (Ping timeout: 255 seconds) |
05:51:15 | * | johnsoft joined #nim |
06:05:20 | * | BlaXpirit joined #nim |
06:13:41 | * | synthmeat joined #nim |
06:14:45 | * | iamd3vil joined #nim |
06:33:15 | * | JinShil joined #nim |
06:38:45 | * | nimnoob123 joined #nim |
06:39:02 | nimnoob123 | def- or fowl you around? https://github.com/nim-lang/sdl2/pull/42 |
06:40:22 | nimnoob123 | sound that when i was trying to compile w/ the latest commits - 'when not defined()' got changed to 'when defined()' :# |
06:40:26 | fowl | Hey what doss this this fix exactly |
06:40:32 | nimnoob123 | fixes the imports |
06:40:46 | fowl | From missing symbols? |
06:41:14 | nimnoob123 | when def- added the sdl_static check he did a double when SDL_Static when the first check was meant to check for the dynamic libs |
06:41:22 | fowl | Do you have an up to date lib? |
06:41:28 | nimnoob123 | so basically it's not checking anymore (yes) |
06:42:00 | fowl | Oh I thought this just added deadcodeelim |
06:42:35 | fowl | Sry for the confusion :p its merged |
06:42:40 | nimnoob123 | +1 |
06:43:27 | fowl | check out nimx |
06:43:35 | nimnoob123 | yeah i was trying to compile and "can't import TTF_Init" etc... im like O_o lol |
06:44:00 | nimnoob123 | what's nimx (going to go google) |
06:45:04 | fowl | https://github.com/yglukhov/nimx |
06:45:35 | fowl | has its own TTF and image loading |
06:46:11 | fowl | im trying to get a screenshot |
06:46:28 | nimnoob123 | neat, i'll check it out after im done testing this sound stuff im working on |
06:50:15 | * | saml_ quit (Quit: Leaving) |
06:50:40 | fowl | http://i.imgur.com/FTWt9CG.png |
06:50:51 | nimnoob123 | nice |
06:52:09 | fowl | compiles to ios, android or js too |
06:53:03 | * | oleg joined #nim |
06:53:26 | * | oleg is now known as Guest81147 |
06:55:00 | nimnoob123 | neat :) |
06:59:22 | * | MyMind quit (Quit: WeeChat 1.2-dev) |
07:15:47 | * | yglukhov_ joined #nim |
07:33:41 | novist | is there a way to define wide strings from literals? basically strings that would work with windows API, you know like L"utf-16le string here" in c/c++ |
07:49:06 | * | Guest81147 quit (Quit: Page closed) |
07:53:14 | * | iamd3vil quit (Ping timeout: 276 seconds) |
08:00:38 | * | JinShil quit (Quit: Konversation terminated!) |
08:17:39 | * | wtw joined #nim |
08:17:44 | * | wtw left #nim (#nim) |
08:17:49 | * | wtw joined #nim |
08:19:36 | * | Ven joined #nim |
08:28:04 | * | HakanD_ joined #nim |
08:30:07 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
08:47:54 | * | Ven joined #nim |
09:04:15 | * | yglukhov_ quit (Quit: Be back later ...) |
09:06:06 | * | milosn quit (Quit: leaving) |
09:21:29 | * | yglukhov_ joined #nim |
09:21:35 | * | yglukhov_ quit (Client Quit) |
09:26:57 | * | grncdr joined #nim |
09:35:23 | * | grncdr1 joined #nim |
09:36:46 | * | grncdr quit (Ping timeout: 272 seconds) |
09:37:37 | * | gokr_ joined #nim |
09:42:15 | * | iamd3vil joined #nim |
09:43:26 | iamd3vil | Can anyone tell me what type of archive format, zipfiles module can support? |
09:45:39 | BlaXpirit | iamd3vil, maybe... zip? |
09:47:22 | * | ir2ivps10 quit (Ping timeout: 255 seconds) |
09:47:41 | HakanD_ | dom96: there is still a 0.9.6 milestone in github issues |
09:51:25 | iamd3vil | I am trying to open a Zip file and extract it. I get the following error "SIGSEGV: Illegal storage access. (Attempt to read from nil?)" But the Zip file contains files. |
09:51:41 | iamd3vil | What am I doing wrong? |
09:52:27 | HakanD_ | You are probably not initializing something correctly |
09:52:34 | HakanD_ | can't tell without looking at your code |
09:53:23 | * | wb joined #nim |
09:53:53 | iamd3vil | here is my code: http://pastebin.com/ghkvG4wi |
09:54:27 | * | JinShil joined #nim |
09:55:10 | * | jholland quit (Quit: Connection closed for inactivity) |
09:56:53 | * | loz1 joined #nim |
09:57:12 | * | JinShil quit (Client Quit) |
09:57:20 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
09:58:58 | loz1 | hi guys, i have type declaration in library: |
09:58:58 | loz1 | Rect* = tuple[x, y: cint, w, h: cint] |
09:58:58 | loz1 | but i get undeclared error on: |
09:58:58 | loz1 | var rect = Rect(1, 1, 10, 10) |
09:59:47 | loz1 | looks like a stupid mistake, but i cant find it( |
10:00:17 | def- | loz1: var rect: Rect = (1, 1, 10, 10) should work, but the compiler doesn't like cint literals |
10:00:36 | def- | 1.cint etc work, but that's not as nice of course |
10:00:48 | * | bluenote joined #nim |
10:01:05 | def- | tuple initialization is a bit bad still |
10:01:10 | grncdr1 | is there a way to get nim to dump out the source after expanding macros? |
10:01:24 | iamd3vil | HakanD_: Any idea what I did wrong? |
10:01:25 | grncdr1 | I assume there must be, but I'm not seeing it in the help when I run `nim` |
10:01:37 | def- | grncdr1: at the end of a macro you can do: echo result.repr |
10:01:48 | grncdr1 | ah nice |
10:01:49 | def- | grncdr1: no other way I think |
10:02:44 | grncdr1 | oh, except I was trying to get away with just templates :( |
10:02:57 | def- | iamd3vil: looks like the zipfiles module is just broken a bit |
10:03:24 | def- | grncdr1: I guess it could be added to the compiler rather easily |
10:03:40 | HakanD_ | iamd3vil: it requires libzip2, I couldn't try it, dunno |
10:03:56 | grncdr1 | def-: will consider diving into the compiler tomorrow I think |
10:04:02 | grncdr1 | this is day 2 of nim for me :P |
10:04:12 | loz1 | def-: your variant gives: Error: type mismatch: got ((int, int, int, int)) but expected 'Rect' |
10:04:18 | def- | grncdr1: Yep, changing the compiler is definitely for day 2, not day 1 |
10:04:31 | grncdr1 | ;) |
10:04:31 | HakanD_ | but judging from the existing T,P stuff, which is a depreciated convention, I seems nobody touched it for some time |
10:04:46 | novist | anyone happen to know if there is any difference between *I and *I64 operations? for example ModI vs ModI64. Seems unsigned integer operations make no distinction between I and I64, just signed ones. however from looking at compiler code i couldnt really tell if there is any difference.. would for example ModI magic work fine with 64 bit ints? |
10:05:01 | def- | loz1: right, because the compiler doesn't do auto-literal conversion in tuples yet. Needs to be "1.cint" etc, or the type could be int |
10:09:12 | loz1 | def-: ok, ill try it |
10:09:45 | loz1 | def-: it works, thanks) |
10:10:03 | * | HakanD__ joined #nim |
10:13:14 | * | HakanD_ quit (Ping timeout: 246 seconds) |
10:14:46 | * | Kingsquee quit (Quit: Konversation terminated!) |
10:18:14 | * | Ven joined #nim |
10:19:05 | * | Sembei joined #nim |
10:37:20 | * | banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
10:37:21 | * | yglukhov_ joined #nim |
10:40:14 | * | gokr_ quit (Ping timeout: 245 seconds) |
10:41:23 | * | JinShil joined #nim |
10:41:27 | * | JinShil quit (Client Quit) |
10:42:34 | * | yglukhov_ quit (Ping timeout: 252 seconds) |
10:43:59 | * | gokr_ joined #nim |
10:45:47 | * | banister joined #nim |
10:47:58 | * | filcuc joined #nim |
10:49:17 | * | Matthias247 joined #nim |
10:50:32 | FDGFGFGDFD | lol tried to compile the new nim version and got ==> Error: execution of an external program failed; rerun with --parallelBuild:1 to see the error message |
10:50:52 | FDGFGFGDFD | i ran with --parallelBuild:1 and it completed |
10:50:55 | FDGFGFGDFD | lol |
10:52:19 | BlaXpirit | o.o |
10:52:29 | BlaXpirit | but u should probably update csources |
10:52:59 | FDGFGFGDFD | isnt csource just for boostrapping when u dont have a first nim version? |
10:53:21 | BlaXpirit | that |
10:53:24 | BlaXpirit | is probably true |
10:53:39 | FDGFGFGDFD | anyway it worked without error with --parallelbuild:1 |
10:53:40 | BlaXpirit | i dunno, i'm doing something weird with building, so updating csources helped me |
10:53:41 | fowl | If your Nim is a few weeks old it shouldn't build |
10:53:52 | FDGFGFGDFD | ok |
10:54:08 | FDGFGFGDFD | but it worked |
10:54:18 | novist | i had same error, getting new csources fixed it |
10:54:28 | fowl | You should buy a lottery ticket then friend |
10:54:35 | fowl | lol |
10:54:38 | loz1 | what should i write on case's else branch if i dont want to do anything? |
10:54:47 | novist | discard |
10:55:10 | loz1 | novist: thank you) |
10:56:32 | * | banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
10:56:45 | * | yglukhov_ joined #nim |
10:57:43 | synthmeat | fowl: just out of interest - why have case's else if it doesn't do anything? |
10:58:25 | synthmeat | loz1, not fowl. apologies. |
10:58:39 | fowl | Guarantee that every case is covered synthmeat |
10:59:29 | synthmeat | it's not gonna fall through? |
10:59:39 | loz1 | synthmeat: ye, compiler wants me to cover all cases |
11:00:04 | loz1 | and its kinda nice btw, reminds me ocaml |
11:00:16 | synthmeat | ah, i see. didn't notice warning. builds though. |
11:00:56 | synthmeat | could use some color in compiler output :) |
11:01:07 | loz1 | well, i got an error "not all cases are covered" |
11:01:12 | loz1 | not a warning |
11:01:39 | fowl | No fall through on cases. If you cover every case you don't need else though |
11:01:54 | synthmeat | 0.11 over here, not all cases covered, only warning |
11:02:17 | synthmeat | "Warning: use 'else: discard'; non-ordinal case without 'else' is deprecated [Deprecated]" |
11:02:49 | fowl | Dunno what that means |
11:03:29 | * | BitPuffin|osx joined #nim |
11:04:24 | loz1 | synthmeat: test_sdl2.nim(36, 7) Error: not all cases are covered |
11:04:45 | loz1 | nim updated yesturday |
11:06:09 | synthmeat | this is what i'm compiling with 0.11 to get that http://pastie.org/10124938 |
11:06:56 | * | gokr_ quit (Ping timeout: 240 seconds) |
11:07:20 | * | synthmeat is just now on switch statement bit of tutorial :) |
11:07:46 | * | gokr_ joined #nim |
11:08:27 | fowl | synthmeat, oh ok it used to be the case that else was optional for string cases since you cant cover every case |
11:08:33 | fowl | i guess its deprecated now |
11:10:36 | * | OnO joined #nim |
11:10:56 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
11:11:28 | synthmeat | i agree with that change |
11:12:22 | * | seymour joined #nim |
11:16:39 | * | cryzed joined #nim |
11:19:52 | * | OnO is now known as ono |
11:20:42 | FDGFGFGDFD | yes more errors catched at compile time is a good thing |
11:21:11 | synthmeat | a question about idioms - so, i should use parentheses only on function invocations? |
11:26:01 | bluenote | I'm trying to "nimble update opengl" but I get "Error: unhandled exception: Name or service not known [OSError]" |
11:26:30 | def- | bluenote: same here, let's see |
11:26:33 | bluenote | any ideas how to solve that? I recompiled nimble and performed "nimble update" |
11:27:07 | bluenote | "nimble install opengl" gives a json parsing error |
11:27:45 | def- | bluenote: ehm, "nimble update" doesn't take a name |
11:27:56 | def- | nimble update; nimble install opengl |
11:28:26 | def- | With "nimble update opengl" you tell nimble to update its packages database from the url "opengl" which obviously is no URL at all |
11:29:03 | bluenote | you are right: I though I'm supposed to do "nimble update <package>" |
11:29:28 | synthmeat | bluenote: i don't think you were counter-intuitive in thinking that should work |
11:29:39 | bluenote | and note that "nimble update opengl" indead does break something because after that "nimble list" does no longer work |
11:29:41 | * | synthmeat is not using nimble yet though |
11:29:58 | bluenote | yes, this makes sense than |
11:30:16 | bluenote | seems to work fine now after "nimble update" |
11:30:48 | def- | bluenote: "nimble install <package>" updates the package |
11:31:21 | def- | yes, "nimble update opengl" first deletes the old packages.json, then tries downloading a new one |
11:31:37 | FDGFGFGDFD | is there plan for a float32 math library? |
11:31:56 | * | JinShil joined #nim |
11:32:00 | def- | FDGFGFGDFD: haven't heard of anything |
11:33:49 | FDGFGFGDFD | ok i guess ill just wrap what i need then, opengl is all about float32 :( |
11:36:55 | bluenote | hm, is it possible to tell nimble to update to a certain commit hash? e.g. nim-glfw already has a commit making it 0.11 compatible but there is no tag to pull this version directly... |
11:37:30 | dom96 | bluenote: nimble install nim-glfw@#hash |
11:38:27 | bluenote | dom96: great, thanks! |
11:38:53 | BlaXpirit | bluenote, in this case u may just use HEAD |
11:42:58 | synthmeat | block breaking! awesome. |
11:43:30 | * | Ven joined #nim |
11:47:03 | * | Trustable joined #nim |
11:47:10 | FDGFGFGDFD | imo the slideshow on nim-lang.com should be 3 separate blocks, or at least redesigned... i visit the website often and i just saw that it was a slideshow with more than 1 slide today lol |
11:47:37 | * | Trustable quit (Remote host closed the connection) |
11:48:37 | * | Trustable joined #nim |
11:49:29 | * | wb quit (Ping timeout: 246 seconds) |
11:50:24 | * | Ven quit (Read error: Connection reset by peer) |
11:51:36 | * | ingsoc joined #nim |
11:52:54 | fowl | Funny someone just said it changes too fast |
11:53:06 | fowl | I thought it was slow |
11:54:44 | * | wb joined #nim |
11:55:25 | BlaXpirit | i think this person said it is too slow |
11:55:58 | FDGFGFGDFD | its like on a 10sec timer |
11:56:12 | FDGFGFGDFD | and the controls are all the way on the right T_T |
11:57:05 | FDGFGFGDFD | past 2 second on the front page, you either scrolled, or clicked on a link imo |
12:01:31 | FDGFGFGDFD | function slideshow_enter() { clearTimeout(timer); } function slideshow_exit () { startTimer(16000); } |
12:02:19 | * | TEttinger quit (Ping timeout: 245 seconds) |
12:02:24 | FDGFGFGDFD | aint nobody got time fo dat |
12:02:34 | BlaXpirit | FDGFGFGDFD, i think u can make a pull request |
12:04:39 | fowl | I use the edit button on github for PRs all the time :( |
12:05:04 | BlaXpirit | :( |
12:05:31 | * | ono quit (Quit: My iMac has gone to sleep. ZZZzzz…) |
12:06:07 | fowl | cba to do the whole clone commit push thing |
12:11:27 | * | iamd3vil quit (Remote host closed the connection) |
12:14:07 | * | Ven joined #nim |
12:20:17 | * | Ven quit (Read error: Connection reset by peer) |
12:25:04 | * | novist is now known as r-ku |
12:25:20 | * | yglukhov_ quit (Read error: Connection reset by peer) |
12:25:56 | * | yglukhov_ joined #nim |
12:48:25 | * | filcuc quit (Quit: Konversation terminated!) |
12:56:55 | * | loz1 quit (Ping timeout: 250 seconds) |
13:01:15 | * | HakanD__ quit (Ping timeout: 250 seconds) |
13:07:46 | r-ku | i dont get it.. how am i supposed to build compiler after i add new magic to it? i did it very carefully following example of another magic and it appears to be all ok, i build compiler, but then when i try to build something i get error about unknown added magic |
13:11:26 | dom96 | where are you using this magic? |
13:11:34 | r-ku | system.nim |
13:12:05 | dom96 | I think you should test the magic outside of that module first. |
13:12:16 | dom96 | what magic are you adding? |
13:13:04 | r-ku | UIntToStr |
13:13:13 | r-ku | guess name is pretty obvious |
13:14:08 | r-ku | hm, koch does not put newly compiled compiler to bin dir? |
13:15:28 | r-ku | looks like compiler/nim executable recognizes new magic, guess that solves it |
13:16:27 | def- | Why does UIntToStr need any magic? can't you import unsigned and use $? |
13:17:02 | * | vendethiel joined #nim |
13:17:03 | * | HakanD__ joined #nim |
13:17:08 | fowl | r-ku, use a symlink ;) |
13:18:15 | fowl | symlinks solve all problems |
13:18:20 | r-ku | unsigned numbers are neglected to a point that makes me want to tear my hairs out |
13:18:38 | r-ku | converting to string for uint64 is implemented in repr.min and it calls c_sprintf |
13:18:44 | dom96 | r-ku: when developing the compiler use ./koch temp |
13:18:51 | dom96 | then you will get nim_temp in the bin dir |
13:19:03 | r-ku | thanks for the tip |
13:20:39 | * | banister joined #nim |
13:20:44 | r-ku | either of you happen to know why there are separate magics for 64 bit ints? they do either same thing or just include explicit cast to int64. it does not make much sense |
13:24:06 | fowl | have not looked into it myself |
13:26:03 | r-ku | asking because i want to know if its ok to remove them. my magic hacking basically was turning Int64ToStr to UIntToStr because Int64ToStr was totally redundant |
13:34:24 | * | grncdr1 quit (Quit: Leaving.) |
13:34:34 | dom96 | sorry, no idea. |
13:35:48 | * | darkf quit (Quit: Leaving) |
13:36:47 | Joe-T | does that compiler crash still happen on |
13:37:16 | Joe-T | https://github.com/Araq/Nim/issues/2518 |
13:38:05 | * | banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
13:39:33 | Joe-T | there's loads of "nkCharLit..nkInt64Lit:" |
13:44:20 | * | JinShil quit (Quit: Konversation terminated!) |
13:47:00 | * | yglukhov_ quit (Read error: Connection reset by peer) |
13:47:33 | * | yglukhov_ joined #nim |
13:50:39 | * | johnsoft quit (Ping timeout: 250 seconds) |
13:51:00 | * | johnsoft joined #nim |
13:54:36 | * | vendethiel quit (Ping timeout: 240 seconds) |
13:57:39 | * | Matthias247 quit (Read error: Connection reset by peer) |
14:02:17 | * | vendethiel joined #nim |
14:03:31 | * | milosn joined #nim |
14:13:24 | * | ddl_smurf joined #nim |
14:25:15 | * | vendethiel quit (Ping timeout: 256 seconds) |
14:38:32 | * | BitPuffin|osx quit (Ping timeout: 246 seconds) |
14:51:26 | * | r-ku is now known as novist |
14:51:29 | * | novist is now known as r-ku |
14:51:42 | * | r-ku quit (Quit: ZNC - http://znc.in) |
14:52:46 | * | r-ku joined #nim |
15:13:29 | * | banister joined #nim |
15:13:33 | * | banister quit (Max SendQ exceeded) |
15:14:11 | * | banister joined #nim |
15:14:38 | * | loz1 joined #nim |
15:27:30 | * | flaviu joined #nim |
15:27:34 | flaviu | https://gist.github.com/173615c7635f78495938 |
15:27:48 | flaviu | It runs and produces reasonable AST :D |
15:29:33 | BlaXpirit | so? |
15:29:38 | FDGFGFGDFD | is nimweb suposed to work on windows? i havent looked at the source, but i get this error--> [Error] cannot open: ticker.txt |
15:30:07 | flaviu | BlaXpirit: I don't have to mess around with the parser, this could technically be done with a macro. |
15:30:21 | BlaXpirit | ok but it's not viable |
15:30:56 | flaviu | I'm not sure what you mean. |
15:31:56 | BlaXpirit | well first of all you'd have to macro all your code |
15:32:09 | flaviu | Ah, I see what you mean. I agree. |
15:32:09 | BlaXpirit | or am i missing some pragma/filter |
15:32:36 | flaviu | I think you can .push. .pop. macros, but, yes, this would go better in the compiler. |
15:44:14 | * | Sembei quit (Ping timeout: 272 seconds) |
15:44:27 | * | MyMind joined #nim |
15:45:16 | * | Ven joined #nim |
15:53:03 | reactormonk | r-ku, yeah, we treat unsigned as second-class, which is alright imo |
15:54:21 | r-ku | im not so sure about that |
15:55:23 | reactormonk | r-ku, you should only use unsigned ints for pointers |
15:55:32 | reactormonk | ... or interacting with c programs |
15:56:16 | r-ku | see there is conflict right there. nim has terrific interfacing with c/c++ capabilities, but unsigned mess makes it pain in the ass |
15:56:57 | reactormonk | It's recommended to use signed ints in nim. |
15:59:00 | reactormonk | maybe write a macro that you can add to an importc'd proc that writes a wrapper proc that uses ints? |
16:00:12 | reactormonk | and why do you need magic for that btw? Normal $ not good enough because? |
16:00:41 | * | Ven quit (Read error: Connection reset by peer) |
16:01:22 | r-ku | because normally compiler stringifies integer through proc in sysstr.nim (if name is right) |
16:01:31 | r-ku | and compiler makes call to it |
16:01:50 | r-ku | sure there could be custom $ operator for uint64 but then it would be duplication of code |
16:03:25 | * | Ven joined #nim |
16:04:59 | reactormonk | isn't there a $ in unsigned? |
16:08:52 | reactormonk | Not sure what Araq's thoughts on hacking additional unsigned magic into the compiler are, but I would say it doesn't have too high of a chance of being accepted. If you want to make some unsigned contributions, please add them to the unsigned.nim file in the stdlib. |
16:11:00 | FDGFGFGDFD | finally got nimweb working lol |
16:11:04 | r-ku | so basically copying code from one place to another, having two copies of same func is better solution? |
16:11:28 | * | HakanD__ quit (Ping timeout: 272 seconds) |
16:14:07 | * | banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
16:14:37 | * | Ven quit (Ping timeout: 256 seconds) |
16:16:45 | * | gokr_ quit (Remote host closed the connection) |
16:20:17 | * | loz1 quit (Ping timeout: 256 seconds) |
16:24:50 | reactormonk | r-ku, what are you trying to do? |
16:25:11 | r-ku | stringify 64bit unsigned int at compile time |
16:25:14 | * | wb quit (Ping timeout: 256 seconds) |
16:25:39 | reactormonk | ah, I see. |
16:26:43 | reactormonk | why do you need that again exactly? |
16:27:35 | reactormonk | BlaXpirit, btw, I agree with bluenote |
16:28:02 | BlaXpirit | reactormonk, Arаq is one of the few who want Haskell's naming |
16:28:21 | BlaXpirit | haven't heard any reasons for it |
16:28:50 | r-ku | just trying random things. however it should work anyway |
16:28:54 | reactormonk | BlaXpirit, so switch it up |
16:29:21 | BlaXpirit | ... |
16:29:30 | BlaXpirit | honestly i don't care anymore |
16:29:39 | reactormonk | I can't push to your PR ;-) |
16:30:16 | r-ku | is there a way to mix types at compile time? cast not working so im bit at loss there too |
16:30:17 | BlaXpirit | reactormonk, pretty sure u can make a PR to my PR |
16:30:29 | * | johnsoft quit (Ping timeout: 256 seconds) |
16:30:45 | BlaXpirit | but please don't bother |
16:30:56 | BlaXpirit | r-ku, cast is not what you want |
16:31:02 | * | banister joined #nim |
16:31:14 | * | johnsoft joined #nim |
16:31:17 | BlaXpirit | cast is byte twiddling |
16:31:25 | r-ku | how it should be done then? say i have int and i want to assign it to int8 |
16:31:40 | r-ku | (at compile time) |
16:31:55 | BlaXpirit | the basic recipe is |
16:31:59 | BlaXpirit | Type(value) |
16:32:14 | reactormonk | BlaXpirit, we'll see. |
16:32:17 | BlaXpirit | strange that you need to convert here |
16:32:28 | BlaXpirit | some_int8 = int8(some_int) |
16:32:59 | r-ku | ohh |
16:33:14 | r-ku | should have been obvious |
16:50:54 | Araq | r-ku: adding UIntToStr magic is perfect. removing the 64 bit variants too. go ahead please. :-) |
16:51:19 | r-ku | oh good to hear, thanks |
16:51:52 | nimnoob123 | are there box2d bindings for nim? |
16:52:31 | BlaXpirit | nimnoob123, i don't think so |
16:52:41 | BlaXpirit | chipmunk is better anyway |
16:53:00 | nimnoob123 | never heard of chipmunk |
16:56:13 | * | filcuc joined #nim |
16:56:35 | * | ingsoc quit (Quit: Leaving.) |
16:59:16 | * | johnsoft quit (Ping timeout: 240 seconds) |
17:01:47 | Araq | bbl |
17:03:38 | * | Strikecarl joined #nim |
17:10:16 | * | Strikecarl quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
17:11:58 | FDGFGFGDFD | https://github.com/Araq/Nim/pull/2639 |
17:13:36 | FDGFGFGDFD | i think its a simple fix for the slideshow problems, instead of fiddling with de timers etc |
17:13:46 | * | BitPuffin|osx joined #nim |
17:16:02 | bluenote | BlaXpirit: are you still there? |
17:16:07 | BlaXpirit | hi |
17:16:51 | * | ingsoc joined #nim |
17:17:02 | bluenote | hi! I'm just studying your maybe[t] implementation. Looks really promising. I'm a huge fan of your ?= template |
17:17:03 | * | filcuc quit (Quit: Konversation terminated!) |
17:17:24 | bluenote | one question regarding your naming convention suggestions though: |
17:17:45 | bluenote | what is the difference between a.get, and a.get(b) ? |
17:18:06 | BlaXpirit | none.get -> exception none.get(x) -> x |
17:18:18 | BlaXpirit | bluenote, is that unclear from docs? |
17:18:30 | * | gsingh93 joined #nim |
17:18:41 | bluenote | hm, then I was expecting unsafeGet to be get :) |
17:19:05 | BlaXpirit | none.unsafeGet -> your computer explodes |
17:19:13 | bluenote | ;) |
17:19:34 | bluenote | I mean: There is no safe get without offering an alternative... |
17:20:11 | bluenote | so I just don't see the reason for get, unsafeGet, get(default) |
17:20:39 | BlaXpirit | you'll have to be clearer than that |
17:21:14 | bluenote | "get" alone cannot be safe |
17:21:55 | bluenote | and thus equivalent to unsafeGet ? |
17:22:41 | BlaXpirit | exceptions are safe |
17:22:48 | BlaXpirit | they can't blow up your computer |
17:23:59 | bluenote | oh, you _really_ mean this kind of unsafe :) |
17:24:45 | bluenote | I wasn't expecting this. "unsafe" to me was suggesting "this function may throw" |
17:25:16 | BlaXpirit | well no, that's probably impossible to blow up a computer, but it's just null pointer dereference |
17:25:49 | bluenote | yes, I see |
17:26:54 | bluenote | the average functional language just don't has this type of unsafe |
17:27:49 | bluenote | gotta think about it a bit more |
17:28:40 | BlaXpirit | good thing you didn't see https://github.com/BlaXpirit/Nim/blob/954c57ad/lib/pure/optionals.nim |
17:28:48 | bluenote | what I don't like is that "get" and "get(default)" have the same name, although they are semantically extremely different, since the first is "unsafe" (=can throw) while the second is perfectly safe |
17:29:35 | bluenote | I did! And I'm glad to see that you got rid of the "nil implies None" semantic |
17:29:48 | BlaXpirit | well actually you could opt out of it |
17:29:49 | bluenote | this would definitely cause trouble |
17:30:29 | bluenote | yes, and it might make sense in certain performance critical situations |
17:31:39 | * | Demon_Fox quit (Ping timeout: 250 seconds) |
17:32:29 | bluenote | but I think the general motivation for Option[T] is type safety -- if performance matters, I can always opt out |
17:33:37 | bluenote | currently I would probably vote for get + uncheckedGet + getOrElse(default) |
17:34:37 | BlaXpirit | D: |
17:35:03 | bluenote | btw: usually there is also a function to inject another option: |
17:35:55 | * | NimBot joined #nim |
17:36:13 | bluenote | optionA.getOr(optionB), where optionB is not a default of type T but another Option[T] |
17:36:55 | BlaXpirit | bluenote, that is currently present |
17:37:06 | FDGFGFGDFD | getOrElse is ugly lol |
17:37:16 | bluenote | but this makes probably only sense with Scala's optional parenthesis: o1 getOr o2 getOr o3 getOrElse somedefault |
17:37:31 | bluenote | ugly be explicit |
17:37:48 | bluenote | it is? |
17:39:33 | bluenote | oh yes, the overloaded or |
17:41:00 | bluenote | not a big fan of overloading `or` here, since this removes the possibility to overload `or` for Maybe[bool] |
17:41:43 | bluenote | which might be handy in situations where you have to evaluation conditions of bools which are all wrapped in Options |
17:42:14 | FDGFGFGDFD | i think a standard function would be better than overloading or |
17:43:36 | bluenote | this would give for instance: some(false) or some(true) == some(false) which a user may write accidently when working with Maybe[bool] |
17:43:37 | * | flaviu quit (Remote host closed the connection) |
17:46:47 | FDGFGFGDFD | a default map function on maybe would be nice to have too imo |
17:47:07 | FDGFGFGDFD | on option* sorry |
17:47:49 | bluenote | FDGFGFGDFD: yes, at first I was also missing this a lot |
17:48:06 | FDGFGFGDFD | map f nothing -> nothing , map f just x -> just f x |
17:49:20 | bluenote | but currently mapping itself is not a very common in the standard library, and there even is no flatMap |
17:52:51 | FDGFGFGDFD | pattern matching would be really fun to have too |
17:53:03 | FDGFGFGDFD | im spoiled by haskell lol |
17:53:18 | bluenote | me too |
17:54:52 | bluenote | for the maybe monad the ?= template actually suffices: if x ?= someOptX: <stmt using x, if someOptX was defined> else: <stmt otherwise> |
17:54:55 | Araq | bluenote: afaict Nim doesn't return 0 when C compilation fails |
17:55:34 | bluenote | Araq: I would have been surprised if it really does, but that is what I got |
17:55:48 | bluenote | I'll have to check again what could have went wrong here... |
17:55:59 | Araq | dunno about 'nimrun' though |
17:57:08 | bluenote | in fact I modified nimrun, placed an echo of the compiler exit immediately after the compilation to double-check... |
17:58:00 | * | Demon_Fox joined #nim |
17:59:40 | * | skyfex joined #nim |
18:00:16 | bluenote | Araq: Now, I triple-checked and I have found the error, stupid me, "immediately after the compilation" ... |
18:00:50 | bluenote | what nimrun does: compile + parameter shift + check status |
18:01:23 | * | saml_ joined #nim |
18:01:24 | bluenote | interesting that the parameter shift apparently maintains the error code in some cases |
18:01:40 | bluenote | so I did not see this issue with other compilation errors |
18:02:13 | bluenote | I |
18:02:20 | bluenote | 'll close the issue... |
18:03:24 | * | filcuc joined #nim |
18:03:48 | Araq | yay |
18:10:40 | * | vendethiel joined #nim |
18:26:23 | * | polkm joined #nim |
18:26:34 | polkm | how hard would it be to make a nim port of glm? |
18:26:54 | * | filcuc_ joined #nim |
18:27:34 | * | filcuc quit (Ping timeout: 255 seconds) |
18:28:20 | def- | polkm: I guess you mean this: http://glm.g-truc.net/0.9.6/index.html |
18:28:24 | def- | polkm: port or wrapper? |
18:30:07 | polkm | yeah thats the one, and I guess i mean bindings |
18:30:42 | def- | Urhonimo is a wrapper of a quite big C++ library, so your chances are good: https://github.com/3dicc/Urhonimo |
18:34:29 | * | vendethiel quit (Ping timeout: 250 seconds) |
18:34:47 | bluenote | @polkm: I have something like that on my todo list |
18:36:40 | onionhammer | araq have you looked into a libgccjit or cling based backend? |
18:37:28 | * | filcuc_ quit (Ping timeout: 255 seconds) |
18:37:31 | * | grncdr joined #nim |
18:40:33 | * | filcuc_ joined #nim |
18:40:46 | nimnoob123 | is there a way to do something like: nim c "-d:one,two,three" or -d:"one,two,three" or would I have to do: nim c -d:one -d:two -d:three every time |
18:41:16 | * | bluenote quit (Ping timeout: 246 seconds) |
18:44:00 | * | vendethiel joined #nim |
18:44:44 | fowl | Put it in a Nim.cfg file nimnoob123 |
18:44:53 | fowl | Then you don't have to mess with it |
18:45:26 | fowl | They have to be separate tho |
18:46:54 | * | johnsoft joined #nim |
18:48:20 | nimnoob123 | hmm yeah that'd work, going to test that in a bit |
18:58:14 | * | gsingh93 quit (Ping timeout: 256 seconds) |
19:11:06 | * | ingsoc quit (Quit: Leaving.) |
19:12:00 | * | lakurei joined #nim |
19:13:08 | lakurei | Hi. I'm trying nim for a future project and made a small benchmark as a test. |
19:13:15 | lakurei | Here's the code: http://pastebin.com/raw.php?i=xxDx02q6 |
19:13:56 | lakurei | I would like to know if I did something wrong that could skew the result. |
19:14:02 | def- | lakurei: so, how's it doing? |
19:14:13 | lakurei | Currently, this is twice as fast as the Java ( -server !!!) version. |
19:14:31 | lakurei | Is nim doing something incredibly clever that won't scale to bigger programs or is this really the performance to expect? |
19:15:08 | def- | Let me take a look |
19:15:18 | def- | but generally top performance is what I expect of Nim |
19:15:43 | lakurei | My times are: 1.4s (nim), 2.2s (JDK 8, -server), 3.4 (.NET, Microsoft runtime), 6.9s (Dlang) |
19:15:43 | def- | I have a few benchmark links down here if you're interested: https://github.com/def-/nim-benchmarksgame |
19:16:16 | def- | lakurei: Is it intentional that your intcache has 1025 values? |
19:16:47 | lakurei | Yes, it's the closest thing to the actual program I want to write (an interpreter, it will cache 1024 ints too to avoid stressing the gc). |
19:17:11 | lakurei | But I tested with other sizes. |
19:17:18 | def- | I think GCC is doing some great optimization work here. With GCC I get 1.3 s runtime, with clang 3.1 s |
19:17:19 | * | Ven joined #nim |
19:17:21 | grncdr | how does one forward-declare a proc? |
19:17:27 | lakurei | In this particular program is doesn't matter that much beyond size 5+. |
19:17:31 | def- | grncdr: proc foo(x: int) |
19:17:41 | grncdr | def-: no return type then? |
19:17:47 | def- | grncdr: also add the return type |
19:17:50 | onionhammer | lakurei wheres the rest of the code? |
19:17:53 | def- | grncdr: but no "=" and body of course |
19:17:59 | lakurei | onionhammer: the java version? |
19:18:09 | onionhammer | the .net version/d version and stuff |
19:18:12 | lakurei | It's basically the same, using classes instead of the tagged union. |
19:18:29 | grncdr | that's giving me "implementation of yourProc.yourProc" expected… |
19:18:39 | lakurei | Identical, same cache, same procedures, etc |
19:18:49 | def- | grncdr: have a full example? |
19:19:04 | lakurei | For D I wrote two versions, one with a tagged union one with classes (the classes one was horribly slow). |
19:20:32 | grncdr | def-: http://pastebin.com/MKbdvP9U <- minimal example that gives me that error |
19:20:42 | * | filcuc_ quit (Ping timeout: 272 seconds) |
19:20:42 | * | Kingsquee joined #nim |
19:20:51 | def- | grncdr: that may be a problem with generics |
19:20:57 | * | Ven quit (Read error: Connection reset by peer) |
19:21:27 | def- | grncdr: oh, you're just missing a "=" in line 3 |
19:21:39 | def- | grncdr: sorry if I made you remove that unintentionally |
19:21:47 | grncdr | no, that was a brain fart |
19:22:24 | grncdr | strange, I think this might be something else… |
19:22:34 | * | skyfex_ joined #nim |
19:23:32 | def- | lakurei: the code looks just fine. I only made some stylistic changes: https://gist.github.com/def-/0732f243d80f33901208 |
19:23:44 | def- | lakurei: I tried using non-ref objects but they're slower in this usecase |
19:23:46 | onionhammer | lakurei you dont actually need 'return' in single statement functions |
19:24:13 | lakurei | def-: thanks, I've never used nim, good to see the actual style. :) |
19:24:14 | onionhammer | ah def- saw the same thing :0 |
19:25:23 | onionhammer | also echo can just be echo space instead of echo(..) def- :P |
19:25:25 | def- | lakurei: Generally with Nim it's worth compiling with GCC and Clang if you want to benchmark. For some problems clang optimizes better, for others GCC |
19:25:31 | def- | onionhammer: right, thanks |
19:25:51 | lakurei | I always use the latest mingw gcc. |
19:25:55 | def- | lakurei: Any reason it's a ValueUnion instead of just an int? |
19:26:02 | lakurei | Yes. |
19:26:05 | * | skyfex quit (Ping timeout: 265 seconds) |
19:26:09 | lakurei | The idea is to write a lisp dialect. |
19:26:22 | lakurei | When I write it, the values will be represented in the same way. |
19:26:29 | def- | Oh, I did that recently as well: http://hookrace.net/blog/make-a-lisp-in-nim/ |
19:26:43 | onionhammer | lakurei inlining make_int might also improve peformance |
19:26:57 | lakurei | Yeah, your post was actually a good inspiration, specially the part "only second in performance to the Java version". :) |
19:27:05 | onionhammer | nah nevermind it was a fluke :0 |
19:27:21 | * | vendethiel quit (Ping timeout: 250 seconds) |
19:28:19 | lakurei | For reference, this is the Java version: |
19:28:20 | lakurei | http://pastebin.com/raw.php?i=3WZYgYdS |
19:28:44 | lakurei | (I tried declaring everything as final, etc, no changes in performance) |
19:29:23 | def- | Java doesn't have the float variant |
19:29:37 | lakurei | Yeah, I didn't bother to add the abstract base class |
19:29:43 | lakurei | and a float additional class. |
19:29:50 | lakurei | Because it's actually slower even without it. |
19:31:23 | * | Ven joined #nim |
19:31:47 | lakurei | A version that does have it (same exact performance): http://pastebin.com/raw.php?i=kGpDiW3Z |
19:32:35 | lakurei | BTW, offtopic: nice work with the nes emulator, it works well on Windows. |
19:33:03 | def- | If you wanted, you could use converters to make it less explicit in Nim (still does exactly the same): https://gist.github.com/def-/0732f243d80f33901208 |
19:33:08 | def- | Thanks, great to hear! |
19:33:23 | def- | I'm playing Tetris all the time now, might have been a bad idea |
19:33:38 | lakurei | Oh, mmm, mpairs is mutable, that's nice. |
19:34:13 | lakurei | And the converter makes up for quite clean code, although I'm not sure if I like it for bigger programs. |
19:34:36 | def- | right, it becomes too implicit and you don't know what's happeneing exactly anymore. have to be careful with that |
19:34:58 | lakurei | I've been playing Ice Climber. :) |
19:35:20 | * | Ven quit (Read error: Connection reset by peer) |
19:35:31 | lakurei | Fun mistake: when I first made the benchmark, Nim was like 12 seconds instead of 1.x. |
19:35:36 | lakurei | And I thought: this is dog-slow. |
19:35:37 | def- | No -d:release? |
19:35:41 | lakurei | Exactly. |
19:35:56 | lakurei | I also compiled nimes without -d:release and it was like 3 fps. |
19:36:04 | lakurei | I supposed --opt:speed was the flag to set. |
19:36:20 | * | Ven joined #nim |
19:36:25 | lakurei | It was the emulator that I thought: if this runs fast when compiled to JS it can't be so slow natively. |
19:36:49 | def- | It already says "Debug Build" in the compiler output |
19:36:58 | def- | Maybe colorizing the output would help |
19:37:45 | * | elbow_json joined #nim |
19:38:24 | * | Ven quit (Read error: Connection reset by peer) |
19:41:09 | * | Ven joined #nim |
19:44:29 | lakurei | Also, mmm, I see a pdcurses.dll in the nim lib folder, can I use it from nim? |
19:44:49 | def- | import pdcurses |
19:44:55 | def- | there's a lib/wrappers/pdcurses.nim |
19:45:32 | lakurei | Great. I hate that the Python curses module only works on unix. |
19:45:54 | lakurei | And I always wanted to make a small ascii sokoban for the terminal. Perhaps another good choice for nim. |
19:45:54 | def- | From what I see the Nim curses module only works on Windows, haha |
19:46:01 | * | vendethiel joined #nim |
19:46:02 | lakurei | Oh what the heh. |
19:46:13 | def- | at least I haven't seen pdcurses on linux |
19:47:18 | def- | Maybe termbox works, no idea |
19:47:24 | def- | That looked like a modern curses |
19:47:37 | lakurei | Anyway, thanks a lot for the help. I can't wait to start writing something (that isn't a bench) with this. :) |
19:48:04 | def- | glad to help, have fun |
19:51:11 | * | saml_ quit (Remote host closed the connection) |
19:59:16 | * | Ven quit (Read error: Connection reset by peer) |
19:59:59 | * | Ven joined #nim |
20:05:02 | * | grncdr quit (Quit: Leaving.) |
20:05:35 | * | Ven quit (Read error: Connection reset by peer) |
20:09:01 | * | Ven joined #nim |
20:10:01 | * | vendethiel quit (Ping timeout: 264 seconds) |
20:10:38 | * | OnO joined #nim |
20:12:57 | * | Ven quit (Read error: Connection reset by peer) |
20:15:34 | * | grncdr joined #nim |
20:17:44 | * | filcuc_ joined #nim |
20:17:52 | * | Ven joined #nim |
20:21:09 | * | OnO quit (Quit: My iMac has gone to sleep. ZZZzzz…) |
20:26:31 | * | Varriount quit (Read error: Connection reset by peer) |
20:34:38 | * | vendethiel joined #nim |
20:48:22 | * | BlaXpirit_ joined #nim |
20:51:37 | * | polkm quit (Quit: Page closed) |
20:53:31 | * | Ven quit (Read error: Connection reset by peer) |
21:02:57 | * | transfuturist joined #nim |
21:03:04 | transfuturist | http://harmful.cat-v.org/software/c++/I_did_it_for_you_all |
21:03:19 | * | BlaXpirit_ quit (Quit: Quit Konversation) |
21:05:11 | * | yglukhov_ quit (Quit: Be back later ...) |
21:16:36 | * | vendethiel quit (Ping timeout: 244 seconds) |
21:17:22 | * | gsingh93 joined #nim |
21:19:43 | * | wb joined #nim |
21:23:09 | * | flaviu joined #nim |
21:24:14 | flaviu | iamd3vil: If you read the logs, try --debuginfo --linedir:on, run it through GDB, and see where GDB tells you the problem is. |
21:35:56 | * | loz1 joined #nim |
21:38:44 | * | ingsoc joined #nim |
21:39:19 | flaviu | bluenote: Thanks for pointing out the bug, I've applied your patches. |
21:45:30 | * | elbow_json quit (Quit: Leaving) |
21:54:25 | * | Trustable quit (Ping timeout: 264 seconds) |
21:58:06 | * | filcuc_ quit (Quit: Konversation terminated!) |
21:59:33 | * | gsingh93 quit (Ping timeout: 276 seconds) |
22:04:56 | * | ingsoc quit (Quit: Leaving.) |
22:17:44 | * | Ven joined #nim |
22:20:25 | * | Ven quit (Read error: Connection reset by peer) |
22:36:45 | * | Ven joined #nim |
22:38:10 | * | Ven quit (Read error: Connection reset by peer) |
22:43:42 | nimnoob123 | well this is a neat warning: Warning: 'l' should not be used as an identifier; may look like '1' (one) [SmallLshouldNotBeUsed] |
22:51:55 | BlaXpirit | yes, very useful |
22:52:09 | BlaXpirit | /s |
22:53:58 | def- | BlaXpirit: just disable it in your global Nim config if you don't like it |
23:00:28 | * | grncdr quit (Quit: Leaving.) |
23:06:11 | * | vendethiel joined #nim |
23:15:38 | def- | fowl: are you working on adding GCC overflow detection or should I take a look? |
23:16:26 | * | TEttinger joined #nim |
23:16:42 | fowl | Not me |
23:17:01 | def- | alright, fun for me then |
23:20:15 | def- | oh, that's only available in GCC 5.0. Can we check for GCC version? |
23:21:12 | fowl | staticExec |
23:21:40 | def- | That's not a good approach. Imagine we're just building the C files and want to compile elsewhere |
23:21:57 | def- | I guess we'll have to go down to CPP defines |
23:22:56 | fowl | not sure how to solve with the cross compiling scenario |
23:24:00 | def- | huh, Nim's overflow checks look wrong |
23:27:51 | * | vendethiel quit (Ping timeout: 250 seconds) |
23:33:00 | * | eskimo joined #nim |
23:38:42 | * | BlaXpirit_ joined #nim |
23:41:43 | * | BlaXpirit quit (Ping timeout: 256 seconds) |
23:46:07 | * | eskimo quit (Quit: Leaving) |
23:48:56 | * | BlaXpirit_ quit (Quit: Quit Konversation) |
23:50:12 | * | jsseb joined #nim |
23:55:28 | * | wan joined #nim |