00:13:03 | * | chemist69_ quit (Ping timeout: 264 seconds) |
00:16:58 | * | chemist69_ joined #nim |
00:23:25 | * | freezerburnV joined #nim |
00:54:11 | * | yglukhov joined #nim |
00:58:45 | * | yglukhov quit (Ping timeout: 244 seconds) |
01:37:24 | * | edub4rt quit (Quit: Leaving) |
01:42:28 | * | chemist69_ quit (Ping timeout: 264 seconds) |
01:55:37 | * | chemist69_ joined #nim |
02:18:15 | * | tautologico joined #nim |
02:22:01 | * | kssreeram quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
02:32:52 | * | Demon_Fox joined #nim |
02:33:01 | * | hendi_ joined #nim |
02:36:58 | * | hendi quit (Ping timeout: 252 seconds) |
02:38:52 | * | freezerburnV quit (Ping timeout: 250 seconds) |
02:56:03 | * | yglukhov joined #nim |
03:00:15 | * | yglukhov quit (Ping timeout: 246 seconds) |
03:11:00 | * | veganskaway is now known as vegansk |
03:27:52 | * | NimBot joined #nim |
04:17:12 | * | endragor joined #nim |
04:32:06 | * | arnetheduck quit (Remote host closed the connection) |
04:34:10 | * | kssreeram joined #nim |
04:37:02 | * | arnetheduck joined #nim |
04:40:51 | * | Swend quit (Quit: Page closed) |
04:52:24 | * | endragor quit (Remote host closed the connection) |
04:54:05 | * | endragor joined #nim |
04:58:08 | * | yglukhov joined #nim |
05:02:51 | * | yglukhov quit (Ping timeout: 264 seconds) |
05:04:57 | * | arnetheduck quit (Remote host closed the connection) |
05:30:02 | * | chemist69_ quit (Ping timeout: 250 seconds) |
05:30:23 | * | chemist69_ joined #nim |
05:57:06 | * | arnetheduck joined #nim |
06:06:44 | * | mcc quit (Quit: Connection closed for inactivity) |
06:15:20 | * | endragor_ joined #nim |
06:18:34 | * | endragor quit (Ping timeout: 250 seconds) |
06:18:37 | * | yglukhov joined #nim |
06:22:54 | * | yglukhov quit (Ping timeout: 246 seconds) |
06:22:54 | * | kssreeram quit (Read error: Connection reset by peer) |
06:35:39 | * | endragor_ quit (Remote host closed the connection) |
06:36:09 | * | endragor joined #nim |
06:43:14 | * | filcuc joined #nim |
06:48:45 | * | endragor quit (Remote host closed the connection) |
06:50:19 | * | Demon_Fox quit (Quit: Leaving) |
06:59:32 | * | pafmaf joined #nim |
07:02:18 | * | Gonzih quit (Read error: Connection reset by peer) |
07:06:03 | * | Gonzih joined #nim |
07:10:25 | * | Arrrr joined #nim |
07:19:20 | * | gokr joined #nim |
07:24:42 | cheatfate | Araq, are you slept? |
07:24:58 | Araq | hey |
07:26:04 | cheatfate | Just want to ask what with my ioselectors.nim pr? |
07:33:53 | * | PMunch joined #nim |
07:35:28 | * | yglukhov joined #nim |
07:37:48 | * | ftsf_ joined #nim |
07:37:52 | Araq | cheatfate: looks good |
07:37:59 | Araq | hi ftsf_ welcome |
07:38:02 | ftsf_ | o/ just looking at nim, looks great! =) |
07:38:22 | ftsf_ | might try my next game in nim |
07:40:37 | Araq | try Nim's Unreal Engine 4 wrapper ;-) |
07:41:22 | * | tautologico quit (Quit: Connection closed for inactivity) |
07:42:20 | ftsf_ | Araq, hmm looking at the SDL2 wrapper |
07:42:53 | PMunch | ftsf_, the SDL2 wrapper also have this little thing: github.com/brechtm/nim-sdl-template |
07:43:05 | PMunch | I'm trying it out right now to see how well/if it works |
07:43:16 | ftsf_ | thanks |
07:44:13 | cheatfate | Araq, it looks good, but not accepted yet :( |
07:46:34 | * | filcuc quit (Ping timeout: 260 seconds) |
07:46:53 | * | filcuc joined #nim |
07:47:58 | PMunch | Araq the UE4 wrapper looks interesting |
07:49:22 | vegansk | Araq, hi! You was definitly right about penalty in typeRel. I changed assignment to +=. Was it the last obstacle to merge the PR? |
07:49:28 | * | endragor joined #nim |
07:54:38 | Araq | vegansk: I guess. |
07:54:57 | * | endragor quit (Ping timeout: 258 seconds) |
07:56:18 | vegansk | Cool! :-) |
08:09:29 | brechtm | PMunch: it builds for OS X and iOS (well, back on nim 0.12), but the codebase seems a bit chaotic. But I think it's a great starting point for a multi-platform (desktop/iOS/Android) game. |
08:09:57 | PMunch | Your SDL repo? |
08:10:07 | PMunch | I'm trying to get it to work right now actually |
08:10:19 | brechtm | PMunch: you're on OS X? |
08:10:26 | PMunch | No, Linux |
08:11:05 | brechtm | I haven't tried that. |
08:11:12 | PMunch | You might want to move the android-20 part of the android build thing up to a configuration variable and call it androidTarget or something :) |
08:11:37 | PMunch | I'm getting this issue: make: *** No rule to make target 'jni/SDL/src/atomic/SDL_atomic.c', needed by 'obj/local/armeabi/objs/SDL2/src/atomic/SDL_atomic.o'. Stop. |
08:11:59 | PMunch | Which is weird. Is that an extra package I need on top of SDL2? |
08:12:21 | brechtm | PMunch: I have no idea. |
08:12:48 | brechtm | JNI rings a bell though... |
08:13:08 | brechtm | PMunch: you've got the Android SDK installed? |
08:14:05 | brechtm | PMunch: you need to set some paths in nakefile.nim |
08:14:32 | PMunch | Yes I've got it installed and set up correctly |
08:14:59 | PMunch | let androidSdk = "~/Libraries/android-sdk-linux" |
08:15:27 | brechtm | I gotta start working, so I can't look into it ATM. I should have some time for it this week though. |
08:17:04 | PMunch | Nice :) |
08:17:25 | PMunch | Might have it sorted by then. I should probably get back to work as well :P |
08:18:32 | * | desophos quit (Read error: Connection reset by peer) |
08:20:10 | vegansk | cheatfate, congratulations :-) nice api |
08:20:55 | cheatfate | vegansk, thanks :) |
08:39:58 | ftsf_ | do you find the case/underscore insensitivity causes any issues when working with nim? it scares me a little |
08:40:04 | ftsf_ | especially the underscore thing |
08:43:45 | * | Trustable joined #nim |
08:44:31 | vegansk | ftsf_, no. It just kills the holy wars about naming style :-) |
08:45:09 | ftsf_ | hmm is it possible to make it throw an error if you use the same identifier with a different case/underscoreness? |
08:45:17 | ftsf_ | I can see myself getting very confused |
08:46:00 | PMunch | Wait, Nim treats SomeVariable the same as some_variable? |
08:47:39 | vegansk | PMunch, no! |
08:47:40 | ftsf_ | https://github.com/nim-lang/Nim/wiki/unofficial-faq#why-is-it-caseunderscore-insensitive |
08:47:50 | ftsf_ | vegansk, no? |
08:47:53 | vegansk | First character is case sensitive |
08:47:57 | ftsf_ | oh |
08:48:18 | vegansk | So you can have type Data and variable data |
08:48:29 | PMunch | Oh, that makes sense :) |
08:48:41 | ftsf_ | but DATA is the same as Data, and DaTa and different to data and dATA etc |
08:49:47 | vegansk | ftsf_, yes |
08:50:36 | PMunch | And Da_ta is also the same? |
08:50:51 | ftsf_ | same as Data by the sounds of it |
08:51:12 | vegansk | But it's better to use the different names then the different cases for identifiers |
08:51:20 | PMunch | someVariable == some_variable |
08:51:29 | ftsf_ | yeah... |
08:51:29 | * | endragor joined #nim |
08:51:32 | vegansk | PMunch, yes |
08:52:02 | ftsf_ | would prefer if it threw an error rather than silently treating them the same. but i'll see how it goes |
08:55:13 | * | brechtm_ joined #nim |
08:55:16 | PMunch | The wiki page actually has some good reasoning as to why it's a good choice |
08:55:37 | * | endragor quit (Ping timeout: 244 seconds) |
08:55:54 | PMunch | And it also makes it easier to use other libraries from someone who subscribes to a different style without having a mix in your own project, which is nice |
08:55:57 | vegansk | ftsf_, it was a pain in the ... when I needed to use libraries with different styles in c/c++. If you want to save your style in your code, you need to write wrappers. It's not a problem with Nim |
08:56:15 | PMunch | ^ exactly |
08:56:50 | PMunch | Just out of curiosity, what style does people here subscribe to? |
08:58:19 | * | brechtm quit (Ping timeout: 260 seconds) |
09:00:41 | ftsf_ | vegansk, okay, cool |
09:00:46 | ftsf_ | i'll keep an open mind |
09:01:37 | ftsf_ | can i pass nil as a null pointer? |
09:03:27 | EastByte | I'm pretty sure you can |
09:03:34 | PMunch | Yes |
09:03:46 | PMunch | I did it recently when working with xlib |
09:04:55 | ftsf_ | there's a function that takes `center: ptr Point` and I'm passing nil and it's getting a type mismatch |
09:06:00 | PMunch | Hmm, that's strange |
09:06:08 | ftsf_ | https://gist.github.com/ftsf/4aa7676d4ddb261a70b357cae309eb14 |
09:06:09 | PMunch | You ould always try to cast it |
09:06:47 | EastByte | so nil doesn't implicitly cast to any pointer? |
09:06:56 | ftsf_ | ohh |
09:07:00 | ftsf_ | the nil was fine |
09:07:06 | ftsf_ | it was a problem with the Rect being a let, not a var |
09:07:19 | EastByte | haha, that happens to me all the time |
09:07:38 | PMunch | Aaah |
09:07:47 | PMunch | It's a bit annoying the way Nim reports those errors |
09:07:54 | ftsf_ | *nods* |
09:08:15 | PMunch | Even if you write a converter function it doesnt' do the conversion before it prints out the error.. |
09:08:53 | PMunch | Araq, would it be possible to improve this error message? |
09:10:25 | * | coffeepot joined #nim |
09:15:15 | ftsf_ | hurrah, I have an SDL canvas that I can draw to and scale up to screen \o/ |
09:16:09 | PMunch | Wooo! |
09:16:31 | PMunch | ftsf_, you might want to have a look at hookrace.net where he builds a little game in SDL |
09:16:48 | PMunch | https://hookrace.net/blog/writing-a-2d-platform-game-in-nim-with-sdl2/ |
09:17:00 | ftsf_ | thanks |
09:17:13 | ftsf_ | i think i should be pretty good from here on |
09:17:26 | ftsf_ | just need to figure out how to adapt the stuff from c/c++ to nim |
09:19:54 | ftsf_ | what's the difference between int and cint? |
09:21:02 | EastByte | cint represents an int in C |
09:21:18 | EastByte | int and cint might not have the same size |
09:21:21 | ftsf_ | ahh |
09:25:56 | PMunch | https://github.com/nim-lang/Nim/issues/4416 |
09:26:14 | gokr | Spry ended up on HN again :) |
09:26:23 | PMunch | I created an issue for the error message :) |
09:30:29 | coffeepot | PMunch that and also does anyone mind that var params aren't listed as such in type mismatches? |
09:31:07 | PMunch | Hmm, haven't really used vars. Care to show an example? |
09:31:44 | coffeepot | ok, just a sec |
09:32:07 | * | kssreeram joined #nim |
09:33:47 | coffeepot | ha! |
09:34:11 | coffeepot | well it appears it HAS been changed and I haven't had that error since the update |
09:34:18 | coffeepot | because it does mention vars now :D |
09:35:34 | coffeepot | i meant as in if you have a proc foo(a: var int) for example and you pass it a const or literal, I'm sure it used to not mention that the param was var |
09:35:38 | coffeepot | so it could get confusing |
09:36:13 | coffeepot | especially with a lot of params. It lists var now so I have no complaints now :) |
09:36:35 | * | endragor joined #nim |
09:37:36 | coffeepot | while I'm here though, I'm learning how to do macros |
09:37:50 | coffeepot | is it possible to use macros to make a type? |
09:38:30 | coffeepot | I tried it but I just get undeclared identifier when I try to use it :/ |
09:39:02 | PMunch | Hmm, I think that should be possible. If my understanding of macros are correct. |
09:39:22 | PMunch | You must make sure the macro is run before your code needs the type obviously |
09:39:25 | coffeepot | I was hoping I could do a macro to create the "type X = object" and 'copy' the field definitions from another object |
09:39:34 | coffeepot | yeah, i think thats my problem :/ |
09:39:57 | coffeepot | is there a way to display the output from a macro, like dumptree? |
09:40:33 | coffeepot | all I can tell is that the compiler is 'ok' with the macro, but not what it's actually ending up with |
09:41:48 | coffeepot | is it only possible to do compiletime macros if you don't pass it typed parameters? |
09:42:58 | * | ftsf_ quit (Quit: :q!) |
09:43:01 | PMunch | Yes I think all macros are compiletime |
09:43:04 | flyx | coffeepot: you can echo result.repr at the end of the macro |
09:43:18 | coffeepot | flyx cheers, will try that :) |
09:44:54 | flyx | coffeepot: typed parameters will be resolved before they pass into the macro, i.e. if you pass `foo` to the macro, `foo` must resolve to a symbol in the context where the macro is called. It will be a Sym in the macro. if it is untyped, it does not need to be resolved and will be an Ident in the macro. |
09:45:19 | flyx | but the macro will always be executed at compile time |
09:46:01 | coffeepot | flyx: ok that makes sense :) |
09:46:35 | * | endragor quit (Remote host closed the connection) |
09:46:45 | flyx | result.repr outputs Nim source for easier reading. there's also result.treeRepr which displays the generated AST |
09:47:47 | coffeepot | that's awesome. I was trying to pass the macro to astToStr or repr but it wasn't working, didn't think to try outputting inside the macro :) |
09:49:33 | * | Gonzih quit (Quit: WeeChat 1.5) |
09:50:22 | * | Gonzih joined #nim |
09:53:24 | * | endragor joined #nim |
09:57:14 | * | gokr quit (Ping timeout: 260 seconds) |
10:01:30 | coffeepot | silly question, you can do let assignment in a loop, right? |
10:10:44 | * | pancake__ joined #nim |
10:10:59 | pancake__ | how can i use a type from a different .nim file= |
10:12:00 | pancake__ | https://gist.github.com/trufae/b67656d8ede650b88343a8039cdc5b67 |
10:12:07 | vegansk | pancake_, http://nim-lang.org/docs/manual.html#modules-import-statement |
10:12:27 | vegansk | R2PipeHttp* = object |
10:12:32 | pancake__ | import -> include ? |
10:12:44 | pancake__ | yeah seems to work |
10:16:07 | coffeepot | include stuffs the code you import into your source, only really useful for splitting up large modules |
10:16:26 | pancake__ | well it works for my use case |
10:16:54 | coffeepot | include is like a text copy |
10:17:30 | coffeepot | good you got it working tho :) |
10:17:50 | PMunch | coffeepot, let is compiletime. So not too sure about loops |
10:18:08 | pancake__ | but its clearly not the way to go for the final implementation |
10:18:11 | * | pafmaf quit (Read error: Connection reset by peer) |
10:18:11 | * | pafmaf joined #nim |
10:18:12 | PMunch | I guess if the loop is run on compiletime it should work |
10:19:08 | coffeepot | PMunch it *seems* to work in a loop! Compiler doesn't complain anyway |
10:19:08 | * | kssreeram quit (Read error: Connection reset by peer) |
10:19:11 | flyx | coffeepot, PMunch: let is not compiletime and can be used in a loop. const is compiletime |
10:19:31 | PMunch | Oh right, my bad |
10:19:37 | PMunch | I was thinking of const |
10:20:03 | * | pancake__ quit (Quit: leaving) |
10:20:07 | coffeepot | flyx cheers. I'm just using it to save some typing with all the 'newNimNode's :) |
10:21:43 | flyx | coffeepot: be aware that there are some helper functions in macros.nim to generate NimNodes more easily. also, for larger portions of code, you can use the `do` notation. |
10:23:20 | coffeepot | yes though interestingly there only seems to be helpers for some node types |
10:23:52 | coffeepot | debugging them is kinda difficult. I got a message about child missing but hard to work out where without line numbers! |
10:24:11 | coffeepot | this is my first try though to be fair |
10:24:41 | flyx | yeah, it's definitely not easy |
10:25:16 | coffeepot | has anyone made a DSL for macros? Or is that too meta-meta |
10:26:02 | flyx | that would indeed be very meta |
10:26:11 | coffeepot | :) |
10:26:35 | flyx | but `quote do:` seems to come close to it |
10:28:15 | * | pafmaf quit (Read error: Connection reset by peer) |
10:28:15 | * | pafmaf joined #nim |
10:32:08 | * | fredrik92 joined #nim |
10:36:20 | coffeepot | not quite sure I understand what the do notation is doing |
10:36:29 | coffeepot | or how to use it |
10:37:04 | coffeepot | is it just taking a list of statements and passing it in as a macro param? |
10:37:24 | * | bjz joined #nim |
10:39:27 | * | arnetheduck quit (Ping timeout: 264 seconds) |
10:40:49 | * | kssreeram joined #nim |
10:44:49 | * | brechtm_ quit (Remote host closed the connection) |
10:48:08 | * | bjz_ joined #nim |
10:49:46 | * | bjz quit (Ping timeout: 252 seconds) |
10:50:51 | * | abruanese quit (Ping timeout: 240 seconds) |
10:53:27 | * | abruanese joined #nim |
10:54:51 | * | pafmaf quit (Quit: Leaving) |
10:57:09 | * | euantor joined #nim |
11:06:39 | * | kssreeram quit (Ping timeout: 260 seconds) |
11:09:23 | * | kssreeram joined #nim |
11:19:17 | Arrrr | it is passed as 'untyped' |
11:19:56 | * | ftsf joined #nim |
11:31:09 | * | abruanese quit (Ping timeout: 260 seconds) |
11:32:19 | * | abruanese joined #nim |
11:37:34 | * | filcuc quit (Ping timeout: 260 seconds) |
11:39:02 | * | Arrrr_ joined #nim |
11:42:03 | * | Arrrr quit (Ping timeout: 276 seconds) |
11:42:58 | * | brechtm joined #nim |
11:49:39 | * | bjz joined #nim |
11:51:12 | * | bjz_ quit (Ping timeout: 260 seconds) |
11:57:56 | * | filcuc joined #nim |
12:11:15 | * | Arrrr_ quit (Read error: Connection reset by peer) |
12:11:31 | * | yglukhov quit (Ping timeout: 240 seconds) |
12:18:12 | PMunch | brechtm, I figured out the SDL errors I was getting |
12:18:35 | PMunch | I had installed the dynamic runtime version from my package manager and not the source files |
12:19:04 | brechtm | PMunch: ah... and the Android build works now? Because I haven't tried that yet. |
12:19:13 | PMunch | Well, not quite |
12:19:17 | PMunch | I'm getting some other errors |
12:19:32 | brechtm | oh well, computers, eh? :-) |
12:19:37 | PMunch | jni/SDL/src/dynapi/SDL_dynapi_procs.h:222: error: undefined reference to 'SDL_GetBasePath_REAL |
12:19:39 | PMunch | Yeah |
12:19:49 | PMunch | I'll see if I can sort them out though |
12:34:03 | * | kssreeram quit (Ping timeout: 264 seconds) |
12:40:18 | PMunch | brechtm, which SDL version are you using? |
12:42:45 | brechtm | PMunch: SDL2-2.0.4 |
12:44:19 | brechtm | PMunch: can you get it building for Linux (as in not Android)? |
12:50:21 | PMunch | Is that the default target? |
12:51:38 | PMunch | SDL2-2.0.4 complained about the SDL_GetBasePath_REAL thing I mentioned earlier when building for Android. Going back to 2.0.3 seems to have "fixed" that but I'm still having issues.. |
12:51:47 | PMunch | Specifically the logging functions complains |
12:54:06 | PMunch | brechtm, the nakefile doesn't appear to have a buildtarget for Linux. Only Mac, iOS and Linux |
12:54:21 | PMunch | I'll add one and PR it to you when I get off work |
13:05:21 | PMunch | I'm getting a strange error: |
13:05:38 | PMunch | error: format not a string literal and no format arguments [-Werror=format-security] |
13:05:38 | PMunch | __android_log_print(ANDROID_LOG_INFO, "NIM_APP", a0); |
13:05:58 | PMunch | And that is from Nim code which is compiled down to this C code: |
13:06:01 | * | yglukhov joined #nim |
13:06:20 | PMunch | N_NIMCALL(void, droidlogimported_741003_2231592625)(NCSTRING a0) { __android_log_print(ANDROID_LOG_INFO, "NIM_APP", a0);} |
13:06:35 | PMunch | Is NCSTRING not a string literal? |
13:10:55 | * | kssreeram joined #nim |
13:13:49 | * | yglukhov quit (Remote host closed the connection) |
13:14:22 | * | yglukhov joined #nim |
13:19:39 | * | kssreeram quit (Read error: Connection reset by peer) |
13:24:43 | PMunch | It seems like that's the only thing that holds back the wrapper from working for Android. It spits out a bunch of warnings but it compiles fine. |
13:33:23 | PMunch | brechtm, I was able to build the app for Linux by simply running "nim c --noMain main.nim" |
13:34:59 | PMunch | But that's probably using the shared version of SDL |
13:43:01 | * | kssreeram joined #nim |
13:44:15 | * | kssreeram quit (Client Quit) |
13:54:32 | * | rolha joined #nim |
13:54:41 | rolha | hi everyone |
13:55:36 | rolha | I'm using this html5 canvas code, and whilst everything works fine, the fillStyle is not changed (it's always black) is there anything obviously wrong with this snippet? https://github.com/ruivieira/nim-canvas/blob/master/canvas.nim#L20 |
13:56:07 | * | saml joined #nim |
13:57:05 | rolha | I'm calling it with an hex RBG, e.g. ctx.fillStyle("#FF0000") |
14:14:39 | * | pregressive joined #nim |
14:22:19 | * | kssreeram joined #nim |
14:29:21 | * | nsf quit (Quit: WeeChat 1.5) |
14:35:56 | * | namnguyen joined #nim |
14:36:10 | * | kssreeram quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
14:40:20 | * | GangstaCat quit (Quit: Leaving) |
14:44:02 | * | kssreeram joined #nim |
14:44:46 | * | kssreeram quit (Client Quit) |
14:46:50 | zds | What is the current best practice for calling a nim function from within a Python 2 module? |
14:49:40 | PMunch | Best practice is probably not to do it.. But if you must I think using some kind of C FFI would be your best bet |
14:50:44 | * | gokr joined #nim |
14:51:09 | zds | Hm, ok. Why is best practice not to do it? It seems like a relatively sensible way to implement optimized inner loops in a Python codebase. |
14:52:04 | PMunch | Hmm, that's true I guess. |
14:52:32 | PMunch | But it's still a bit hacky |
14:52:42 | PMunch | I don't think there's anything wrong with it apart from that |
14:54:55 | PMunch | docs.python.org/2/extending/extending.html |
14:54:56 | PMunch | That would probably be of interest |
14:55:07 | PMunch | github.com/nim-lang/python/tree/master/examples |
14:55:07 | PMunch | github.com/nim-lang/python |
14:55:07 | PMunch | And that would be what you need to create the bindings as seen in the Python wiki in Nim |
14:55:46 | zds | Yes I saw that... But that seems to be going in the opposite direction, calling Python from Nim. |
14:56:26 | zds | These look like calling Nim from Python: http://akehrer.github.io/posts/connecting-nim-to-python/, https://github.com/jboy/nim-pymod |
14:57:12 | PMunch | Well the examples there might do |
14:57:32 | PMunch | But the wrapper is around python.h I think. But I might be wrong |
14:59:28 | PMunch | So by installing that wrapper and following the Python guide on integrating with C you should be able to use Nim instead of C |
15:01:57 | PMunch | zds, looking at the first link you supplied. What he's doing there is creating a .dll (or .so on Linux (maybe OSX as well)) and then calling that from Python |
15:02:48 | zds | Yes... Seems relatively straightforward |
15:02:57 | PMunch | Which certainly works, but it could be that doing it the way the python guide explains is faster. |
15:03:38 | zds | Ok, I'll read that too. Thanks |
15:05:02 | PMunch | Basically what that does is to convert Python types to C types and doing a DLL call. The other method passes the Python types directly and in Nim you import a header explaining these types. Doing it the latter way will probably save a little time by not having to convert types, something which might matter if it's performance you're aiming for (and I'm guessing it is since you wanted to optimize an inner loop). |
15:07:18 | PMunch | You should probably run the entire loop in Nim by the way |
15:08:26 | PMunch | Not sure how "pricey" calls to C from Python is but you'd probably get better performance if Nim/C was able to handle the loop itself. Just pass in the loop conditions along with data and expect a result, then implement the entire loop in Nim. |
15:16:26 | * | xet7 quit (Quit: Leaving) |
15:21:00 | * | yglukhov_ joined #nim |
15:21:35 | * | ics joined #nim |
15:25:04 | * | yglukhov quit (Ping timeout: 260 seconds) |
15:25:22 | * | yglukhov_ quit (Ping timeout: 258 seconds) |
15:34:37 | coffeepot | how can I iterated through the fields of an object passed to a macro? |
15:34:46 | coffeepot | iterate |
15:37:02 | * | PMunch quit (Quit: leaving) |
15:38:07 | * | PMunch joined #nim |
15:39:01 | * | PMunch quit (Client Quit) |
15:45:36 | * | yglukhov joined #nim |
15:47:51 | * | brson joined #nim |
15:49:50 | * | yglukhov quit (Ping timeout: 244 seconds) |
15:50:59 | * | pafmaf joined #nim |
15:53:58 | * | yglukhov joined #nim |
16:02:45 | * | Jesin quit (Ping timeout: 244 seconds) |
16:04:03 | * | yglukhov quit (Remote host closed the connection) |
16:04:03 | * | Jesin joined #nim |
16:05:31 | * | Jesin quit (Remote host closed the connection) |
16:08:50 | * | Jesin joined #nim |
16:09:51 | * | coffeepot quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
16:14:48 | * | euantor quit (Read error: Connection reset by peer) |
16:18:31 | * | yglukhov joined #nim |
16:18:40 | * | Demon_Fox joined #nim |
16:22:20 | * | filcuc quit (Read error: Connection reset by peer) |
16:25:57 | * | PMunch joined #nim |
16:40:16 | * | elrood joined #nim |
16:44:19 | * | euantor joined #nim |
16:48:05 | * | nsf joined #nim |
16:53:55 | * | euantor quit (Remote host closed the connection) |
16:55:45 | * | euantor joined #nim |
17:02:30 | * | euantor quit (Remote host closed the connection) |
17:14:15 | * | fredrik92 quit (Ping timeout: 246 seconds) |
17:14:51 | * | fredrik92 joined #nim |
17:25:07 | * | ics quit (Quit: Connection closed for inactivity) |
17:28:49 | * | brechtm quit (Remote host closed the connection) |
17:29:40 | * | euantor joined #nim |
17:36:10 | * | endragor quit () |
17:37:46 | * | kssreeram joined #nim |
17:39:02 | * | kssreeram quit (Client Quit) |
17:51:02 | * | euantor quit () |
17:55:57 | * | yglukhov quit (Remote host closed the connection) |
17:57:27 | * | yglukhov joined #nim |
17:58:59 | * | KaiXBerg joined #nim |
18:04:19 | * | yglukhov quit (Remote host closed the connection) |
18:05:16 | * | rolha quit (Read error: Connection reset by peer) |
18:08:03 | * | algoban joined #nim |
18:10:28 | * | rolha joined #nim |
18:11:01 | * | Matthias247 joined #nim |
18:15:03 | * | TheLemonMan joined #nim |
18:18:44 | * | yglukhov joined #nim |
18:19:16 | * | benwbooth joined #nim |
18:24:53 | chrisheller | zds: take a look at https://github.com/jboy/nim-pymod |
18:25:26 | chrisheller | That does most of the work for wrapping Nim code into a Python module for you. |
18:25:49 | zds | Yup - I linked it up there. Seems like the least painful way through. Is the overhead very bad? |
18:26:27 | chrisheller | Ah sorry. Missed that. |
18:28:02 | * | kssreeram joined #nim |
18:28:47 | * | yglukhov quit (Remote host closed the connection) |
18:31:21 | chrisheller | It doesn't seem to be, although we haven't used it for anything that required lots of hops back and forth. |
18:32:08 | chrisheller | Like PMunch said, you probably don't want to have a tight loop that is performance critical that is jumping back and forth between Python and Nim |
18:32:26 | * | shodan45 joined #nim |
18:32:55 | chrisheller | But that is just good general advice for mixing most languages; nothing specific to Nim and Python |
18:41:13 | zds | sure, that makes a lot of sense |
18:41:23 | zds | i think the barriers would be pretty simple in my case |
18:45:20 | shodan45 | I just filled out the survey.... and realized I've been at least "following" Nim for a fairly long time, about 2 years |
18:45:36 | shodan45 | stupid time going by too fast |
18:47:01 | * | brechtm joined #nim |
18:55:45 | * | rolha quit (Ping timeout: 246 seconds) |
18:58:05 | * | fredrik92 quit (Quit: Shutting down...) |
18:58:26 | * | desophos joined #nim |
18:59:41 | * | kssreeram quit (Max SendQ exceeded) |
19:03:16 | * | fredrik92 joined #nim |
19:05:33 | * | kssreeram joined #nim |
19:07:27 | * | couven92 joined #nim |
19:09:14 | * | fredrik92 quit (Disconnected by services) |
19:09:37 | * | fredrik92 joined #nim |
19:10:44 | * | fredrik92 quit (Client Quit) |
19:11:06 | * | couven92 is now known as fredrik92 |
19:18:39 | * | yglukhov joined #nim |
19:20:24 | * | PMunch quit (Quit: leaving) |
19:21:32 | * | rolha joined #nim |
19:21:32 | * | PMunch joined #nim |
19:22:42 | * | yglukhov quit (Ping timeout: 244 seconds) |
19:28:17 | * | fredrik92 quit (Read error: Connection reset by peer) |
19:29:59 | * | fredrik92 joined #nim |
19:30:18 | * | yglukhov joined #nim |
19:30:46 | * | fredrik92 quit (Read error: Connection reset by peer) |
19:34:45 | * | fredrik92 joined #nim |
19:37:51 | * | abruanese quit (Ping timeout: 276 seconds) |
19:41:01 | * | brechtm_ joined #nim |
19:44:51 | * | brechtm quit (Ping timeout: 264 seconds) |
19:45:35 | * | brechtm_ quit (Ping timeout: 244 seconds) |
19:46:25 | * | brechtm joined #nim |
19:48:32 | * | brechtm quit (Read error: Connection reset by peer) |
19:48:37 | * | brechtm_ joined #nim |
19:53:28 | * | brechtm joined #nim |
19:53:51 | * | chrisheller quit (Remote host closed the connection) |
19:57:21 | * | brechtm_ quit (Ping timeout: 276 seconds) |
20:06:30 | * | kssreeram quit (Read error: Connection reset by peer) |
20:12:54 | * | benwboot_ joined #nim |
20:12:58 | * | yglukhov quit (Remote host closed the connection) |
20:15:02 | * | kssreeram joined #nim |
20:16:04 | * | benwbooth quit (Ping timeout: 264 seconds) |
20:16:48 | * | edub4rt joined #nim |
20:18:03 | * | pafmaf quit (Quit: Leaving) |
20:18:52 | * | yglukhov joined #nim |
20:19:29 | * | benwbooth joined #nim |
20:22:18 | * | benwboot_ quit (Ping timeout: 272 seconds) |
20:25:51 | * | kssreeram quit (Read error: No route to host) |
20:31:11 | PMunch | Hi everyone! |
20:31:34 | PMunch | Still having some trouble with compiling this Android/SDL thing |
20:32:08 | PMunch | Got some help over in #SDL (shoutout to slvn), so those errors are sorted out |
20:33:29 | PMunch | But I'm having some trouble with this file: github.com/PMunch/nim-sdl-template/blob/master/src/nimx/logging.nim |
20:33:57 | PMunch | The C compiler is complaining: |
20:33:59 | PMunch | error: format not a string literal and no format arguments [-Werror=format-security] |
20:33:59 | PMunch | __android_log_print(ANDROID_LOG_INFO, "NIM_APP", a0); |
20:34:09 | PMunch | Maybe you have any hints yglukhov? |
20:34:42 | PMunch | brechtm, hi I've fixed the SDL issues I was having with the template project :) |
20:36:31 | yglukhov | PMunch: are you building with naketools? |
20:36:43 | yglukhov | nimx.naketools? |
20:37:02 | PMunch | I'm running "nake droid" |
20:37:08 | PMunch | From the base of that repo |
20:37:19 | yglukhov | ok, that should work... give me a second |
20:37:49 | PMunch | yglukhov, keep in mind that this is your older "nim-sdl-template" |
20:38:11 | yglukhov | ah.. have you tried nimx one? |
20:38:28 | brechtm | PMunch: good to hear that |
20:38:32 | PMunch | Not yet |
20:38:41 | brechtm | yglukhov: hi... i've played with num-sdl-template before |
20:38:50 | PMunch | I tried to copy in just the android part of the nimx logger |
20:39:50 | * | J3RN left #nim ("WeeChat 1.5") |
20:40:42 | yglukhov | PMunch: well, that probably should be fixed by adding format in from of a0 |
20:41:00 | brechtm | yglukhov: I didn't move to the new nimx, since that seems to be GUI framework instead of a game framework |
20:41:10 | yglukhov | not sure why it happens though. i guess you have some different cc options |
20:41:13 | brechtm | yglukhov: is that a correct? |
20:42:20 | brechtm | yglukhov: and thanks for nim-sdl-template... it saved me a lot of time figuring things out. |
20:42:43 | PMunch | yglukhov, I think it might be some new cc options for SDL |
20:43:13 | yglukhov | brechtm: well... since it's a hardware accelerated gui framework (is it really a framework? =)), you can definitely use it for games ;) moreover, we're currently working on a commercial game based on nimx (ui/events/porting layer) and rod (2d/3d scene-graph engine) |
20:43:37 | yglukhov | PMunch: ok, just try add "%s" before a0 |
20:43:50 | PMunch | I replaced the function with this: hastebin.com/mafiyadeli.py |
20:44:00 | PMunch | Now it appears to work |
20:45:13 | yglukhov | PMunch what was it before then? =) |
20:45:46 | PMunch | hastebin.com/vuxifoliri.py |
20:46:15 | yglukhov | PMunch: you forgot to backtick a |
20:46:18 | yglukhov | `a` |
20:47:10 | PMunch | Right you are |
20:47:16 | PMunch | Still worked with the backticks though |
20:50:24 | yglukhov | PMunch, fyi, nimx is getting a lot further with everything, and it is actively maintained. I would suggest switching to it. There's already a lot of useful features there. Like cross render-to-image, subpixel antialiased fonts, etc. Also its as crossplatform as it can get. android, ios, macos, linux, windows, js, asm.js, you name it =) |
20:50:24 | * | brechtm_ joined #nim |
20:50:53 | PMunch | And it's game friendly? |
20:51:02 | gokr | oh my. Iceland just shot England out of the Euro! |
20:51:03 | PMunch | Because that's what I'm planning on using it for |
20:51:10 | gokr | Sorry for the offtopic, but ... damn. |
20:51:13 | PMunch | gokr, what? Really? |
20:51:17 | gokr | Yup! 2-1 |
20:51:30 | yglukhov | PMunch, it is much more friendly to games than sdl =)) |
20:51:36 | gokr | I read somewhere that 8% of the Iceland population is in France to watch the games ;) |
20:52:09 | PMunch | gokr, yeah I read that as well :P |
20:52:11 | yglukhov | just, subclass a View, and override draw method, and you can use gl there just fine |
20:52:19 | PMunch | yglukhov, I think I'll give it a try then |
20:52:29 | gokr | PMunch: Gaming? I presume you are aware of Urhonimo too. |
20:52:34 | namnguyen | yglukhov, how is it compared to, say, cocos2d-x? |
20:52:59 | yglukhov | PMunch: if you use currentContext().gl (defined in portable_gl) you're getting js compatibility for free |
20:53:51 | * | brechtm quit (Ping timeout: 264 seconds) |
20:53:58 | PMunch | gokr, I haven't heard of it no. But I think SDL/OpenGL combo would be better |
20:54:44 | PMunch | But I'll definitely check it out |
20:55:36 | gokr | https://github.com/3dicc/Urhonimo |
20:55:41 | yglukhov | namnguyen: nimx can not be compared to cocos, because it's not a game engine. it is more of a porting layer that also happens to offer views system and some basic primitives for drawing. for a game engine there's rod, which is based on nimx, and offers scene-graph model to work with. |
20:56:23 | yglukhov | PMunch: Urchonimo is a full-blown engine, which can not seriously be compared to sdl/opengl. the downside of it - it is c++ =)) |
20:56:48 | PMunch | Well, since I'm going to use Nim that's not much of a problem for me :) |
20:57:19 | * | kssreeram joined #nim |
20:57:48 | PMunch | I have no problem with doing some low level stuff. Used LibGDX for a while but writing something in Nim seems like fun :) |
20:58:03 | yglukhov | gokr: do you happen to be an Urchonimo contributor by any chance? since it's not the first time you're advirtising it =) |
20:58:26 | gokr | Sorry, I just want people to know about it. |
20:58:34 | gokr | It was me and Araq who made it |
20:58:50 | yglukhov | you mean the bindings, right? |
20:58:57 | * | rolha quit (Ping timeout: 244 seconds) |
20:59:11 | gokr | Yeah, no I haven't contributed to Urho3D itself. |
20:59:48 | * | brechtm_ quit (Remote host closed the connection) |
20:59:49 | gokr | We used Urhonimo at 3DICC and it worked great - but for other reasons that project is on hold. |
21:00:00 | yglukhov | ok. if anyone involved with game engines here, please note, that we're looking for help (read: hiring) =) |
21:00:29 | gokr | Drop over to #urho3d and talk to some people there. |
21:01:10 | yglukhov | you think they would be excited with a chance to use nim? =) |
21:01:38 | PMunch | yglukhov, give me a year to finish my masters and I'm interested :P |
21:01:39 | gokr | Could be |
21:02:03 | gokr | yglukhov: What kind of stuff are you doing? Games? |
21:02:28 | yglukhov | Game. without 's'. yet |
21:02:52 | yglukhov | backend stuff is also there. based on jester |
21:03:01 | * | desophos quit (Remote host closed the connection) |
21:03:07 | gokr | IMHO Urho3D is ... a very good engine. And I am not sure all of that is ... practical to reimplement. |
21:03:22 | gokr | I mean things like Bullet, etc etc. |
21:03:27 | yglukhov | i know, you already told that to me ;) |
21:03:36 | gokr | Sorry :) |
21:03:53 | yglukhov | but you can't argue thats a lot of fun |
21:04:03 | gokr | But I am all for it of course - I just would hesitate myself. |
21:04:26 | * | rolha joined #nim |
21:04:53 | gokr | Exact! And I am all for fun stuff. |
21:04:53 | yglukhov | gokr: there's an autobuilt live demo of the editor: http://yglukhov.github.io/rod/livedemo/main.html |
21:05:01 | yglukhov | updated with every push to master =) |
21:05:19 | * | KaiXBerg quit (Quit: Page closed) |
21:05:46 | * | desophos joined #nim |
21:05:48 | yglukhov | so, as you (hopefully) may see, we're making some progress... |
21:06:02 | * | chrisheller joined #nim |
21:06:06 | * | chrisheller quit (Remote host closed the connection) |
21:06:06 | gokr | yglukhov: Fun! |
21:06:22 | * | chrisheller joined #nim |
21:06:43 | namnguyen | yglukhov, what am i seeing on that page? |
21:09:16 | yglukhov | namnguyen: it is rod editor. you can add nodes to the graph and put some components on them. unfortunately we did not yet care to implement file loading in the editor in js version. you can load sprites and collada meshes and animations (including skeletal) from collada or after-effects, but only in the native version for now. |
21:09:43 | yglukhov | the engine itself of course supports loading all this stuff in a cross-platform manner includeing js and asm.js |
21:10:05 | namnguyen | oh cool |
21:10:14 | * | elrood quit (Quit: Leaving) |
21:10:24 | namnguyen | i'm not sure if it is my browser, or something, but the click doesn't seem to be very accurate |
21:10:38 | namnguyen | like, i clicked on the small arrows, but nothing happened |
21:10:50 | * | desophos quit (Remote host closed the connection) |
21:10:55 | yglukhov | oh right, they don't work yet, sorry =) |
21:11:25 | namnguyen | that is way cool though. |
21:11:30 | namnguyen | one code base for all platforms. |
21:11:31 | yglukhov | you can try drag the values on non-focused numeric fields |
21:11:41 | yglukhov | indeed |
21:12:39 | yglukhov | those numeric fields i just reimplemented a couple of days ago, and the still need some tuning =) |
21:14:45 | * | GangstaCat joined #nim |
21:18:24 | * | yglukhov quit (Remote host closed the connection) |
21:21:40 | * | yglukhov joined #nim |
21:34:30 | PMunch | Hmm, in the nimx readme it explains how to compile on Unix and Windows. But how do you compile for other targets than the working machine? |
21:34:45 | PMunch | (Note I haven't actually downloaded it, just looking around on GitHub) |
21:34:49 | PMunch | yglukhov, ^ |
21:35:05 | * | pregressive quit (Remote host closed the connection) |
21:35:39 | yglukhov | pmunch: nake js, nake ios, nake ios-sim, nake droid |
21:36:09 | yglukhov | also nake -d:emscripten |
21:36:15 | PMunch | Oh, I looked in the nakefile and it have non of those targets :S |
21:36:22 | yglukhov | if you've got emcc in yout PATH |
21:36:30 | yglukhov | it import nimx.naketools |
21:36:36 | yglukhov | *imports |
21:36:46 | PMunch | Aah, silly me |
21:41:01 | * | desophos joined #nim |
22:03:26 | * | arnetheduck joined #nim |
22:04:50 | * | TheLemonMan quit (Quit: "It's now safe to turn off your computer.") |
22:10:48 | * | desophos quit (Remote host closed the connection) |
22:13:54 | * | algoban quit (Remote host closed the connection) |
22:18:08 | * | desophos joined #nim |
22:24:00 | * | fredrik92 quit (Ping timeout: 246 seconds) |
22:25:20 | * | fredrik92 joined #nim |
22:31:42 | * | desophos quit (Remote host closed the connection) |
22:33:02 | * | desophos joined #nim |
22:41:31 | * | rolha quit (Ping timeout: 240 seconds) |
22:48:14 | * | Trustable quit (Remote host closed the connection) |
22:58:40 | * | gokr quit (Ping timeout: 250 seconds) |
23:00:55 | * | Matthias247 quit (Read error: Connection reset by peer) |
23:13:11 | * | benwbooth quit (Ping timeout: 240 seconds) |
23:14:39 | * | benwbooth joined #nim |
23:20:12 | Araq | hey guys, anything that needs my attention? |
23:24:35 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
23:27:30 | yglukhov | Araq: nothing serious but mind looking at https://github.com/nim-lang/Nim/pull/4420 |
23:27:31 | yglukhov | ? |
23:28:55 | * | PMunch quit (Quit: leaving) |
23:29:41 | Araq | needs tests and docs |
23:41:21 | * | pregressive joined #nim |