00:15:22 | * | vendethiel quit (Ping timeout: 264 seconds) |
00:15:54 | gmpreussner|work | dom96: im writing bindings for OpenGL ES and ran into some name collisions. when I nimify the constants, some of them end up with the same name as imported functions. what's the best way to resolve that? |
00:16:22 | gmpreussner|work | one thing i tried was to convert the constants to enums, but that gets really messy thanks to the crappy API |
00:16:54 | gmpreussner|work | another option would be to rename either the constants or the functions, but that may confuse users |
00:17:19 | notfowl | gmpreussner|work: I believe yglukhov has a wrapper for opengl es in nimx |
00:17:48 | gmpreussner|work | notfowl: oh, i searched github and couldn't find any. lemme check |
00:18:51 | gmpreussner|work | he forked OpenGL, but not ES |
00:19:37 | notfowl | There has to be some opengl es stuff in here for it to run on mobile right |
00:19:53 | gmpreussner|work | he is using a subset of GL in portable_gl.nim |
00:20:10 | gmpreussner|work | i guess it's the common denominator of all GL's |
00:20:17 | gmpreussner|work | very limited functionality |
00:20:50 | notfowl | Ah |
00:20:52 | gmpreussner|work | notfowl: do you have any recommendation on how to best resolve the name collisions? i'm not sure what to do... |
00:21:29 | gmpreussner|work | if all else fails, i could get back to the fugly GL constant naming conventions (UPPER_SNAIL_CASE) |
00:21:29 | notfowl | gmpreussner|work: prefix the constants with c, it had to be done in opengl.nim because of the conflicts |
00:22:54 | gmpreussner|work | i looked at the bindings in nim-lang, and they went with the fugly names |
00:23:09 | gmpreussner|work | i.e. GL_CULL_FACE_MODE |
00:23:15 | gmpreussner|work | instead of glCullFaceMode |
00:23:27 | gmpreussner|work | i guess i could do cglCullFaceMode... is that what you're suggesting? |
00:25:03 | notfowl | The problem was back then some constants clashed with function names, that was before we had cs:partial though |
00:25:25 | gmpreussner|work | yep, that's the problem i'm having |
00:25:33 | gmpreussner|work | what is cs:partial? |
00:26:19 | notfowl | Partial case sentitivity, means capitalization matters for the first letter |
00:26:38 | gmpreussner|work | oh i see |
00:26:44 | * | Jehan_ quit (Quit: Leaving) |
00:27:01 | * | jbomo joined #nim |
00:27:02 | * | jbomo quit (Client Quit) |
00:27:11 | gmpreussner|work | the Wiki recommends using camelCase for constants, if possible |
00:27:20 | gmpreussner|work | that will make it clash again |
00:28:01 | gmpreussner|work | maybe i just go with FUGLY_CASE then? |
00:28:10 | notfowl | Might as well |
00:28:13 | gmpreussner|work | then at least it is consistent with opengl.nim |
00:28:24 | notfowl | Its nice to not the api very far removed from its c equivalent |
00:29:01 | notfowl | That way you can tell people to RTFM without having one written :D |
00:30:11 | gmpreussner|work | true. i prefer to use idiomatic nim though |
00:30:24 | gmpreussner|work | so the code isn't littered with C style stuff |
00:30:46 | gmpreussner|work | imho a user shouldn't have to know that an import comes from C etc. |
00:31:33 | transfuturist | so i worked out how to print a nim enum in gdb |
00:31:34 | transfuturist | print (reprEnum((*formal).kind, (&NTI190260)))->data |
00:31:57 | transfuturist | where NTI*** is something you have to find manually, since the info regex doesn't work outside of the actual name |
00:33:00 | * | Jesin joined #nim |
00:33:08 | transfuturist | and, uh. fun news. |
00:33:23 | transfuturist | the breakpoints set in nim files don't follow the nim control structure |
00:35:24 | transfuturist | i have a breakpoint set on an echo statement and it's catching the cases where the statement doesn't fire |
00:43:43 | reactormonk | transfuturist, urgh |
00:43:48 | * | yglukhov____ joined #nim |
00:48:06 | * | yglukhov____ quit (Ping timeout: 246 seconds) |
00:48:35 | * | vikaton joined #nim |
00:53:36 | * | Demos joined #nim |
00:58:48 | * | filwit joined #nim |
01:04:17 | * | Kingsquee joined #nim |
01:06:05 | * | epichero quit () |
01:11:57 | transfuturist | back to trying to get endb to compile |
01:16:46 | * | dddddd quit (Ping timeout: 244 seconds) |
01:18:52 | * | vendethiel joined #nim |
01:27:21 | * | gsingh93 quit (Ping timeout: 240 seconds) |
01:27:45 | * | Trustable_2 joined #nim |
01:30:31 | * | Trustable quit (Ping timeout: 250 seconds) |
01:37:11 | def- | transfuturist: that sounds weird, did you try without optimizations or can you post instructions for how to reproduce? |
01:37:21 | def- | I only tried really simple things with gdb but they seemed to work just fine |
01:39:10 | Quora | how would I use metaprogramming to simplify redundant blocks of code like this? https://github.com/Heartmender/sobot/blob/master/web/web.nim#L32-L34 |
01:39:42 | def- | Quora: a template |
01:39:49 | Quora | def-: how would I do that? |
01:39:56 | Quora | I've not used languages with templates before |
01:40:19 | def- | http://nim-lang.org/docs/tut2.html#templates |
01:41:47 | * | vendethiel quit (Ping timeout: 256 seconds) |
01:44:37 | Quora | https://gist.github.com/Heartmender/8978e3b0876036390139 |
01:45:25 | def- | an {.immediate.} pragma might help |
01:46:00 | Quora | nope |
01:46:04 | * | pipeep quit (Changing host) |
01:46:04 | * | pipeep joined #nim |
01:46:14 | def- | I can't test it, strangely the re module is not compiling for me |
01:46:36 | transfuturist | def-: i'm pretty sure it's all a consequence of the c generation. control structures get melted down into gotos (with many line directives), that might mess with the breakpoint |
01:47:40 | def- | oh, i see why, my bad |
01:47:54 | * | boydgreenfield quit (Quit: boydgreenfield) |
01:48:27 | transfuturist | endb seems to put a bunch of references to an object called 'F' that isn't defined anymore, either locally or globally, and that's freezing the compilation |
01:48:40 | transfuturist | example statement: F.s[0].address = (void*)&n; F.s[0].typ = (&NTI193805); F.s[0].name = "n"; |
01:48:58 | def- | transfuturist: yeah, i noticed that as well, no idea what that was and why it stopped working. maybe bisecting will help |
01:49:37 | * | vendethiel joined #nim |
01:50:16 | transfuturist | bisecting is always the answer :P |
01:51:04 | transfuturist | in ccgstmts: |
01:51:06 | transfuturist | if frameLen > 0: blockEnd.addf("F.len-=$1;$n", [frameLen.rope]) |
01:52:10 | Quora | def-: would a macro be more appropriate? |
01:52:50 | def- | Quora: this works: https://gist.github.com/def-/7d5fdfac9dc7ca9729cf |
01:53:39 | transfuturist | it seems to be indentation sensitive |
01:53:57 | transfuturist | gcc isn't complaining about the lines where F is referenced on non-indented lines |
01:55:04 | Quora | def-: doesn't work for me |
01:55:10 | Quora | 0.11.2 |
01:55:18 | * | Trustable_2 quit (Remote host closed the connection) |
01:55:27 | Quora | or |
01:55:34 | Quora | I copied the wrong block |
01:55:36 | Quora | ugh |
01:55:38 | Quora | I hate chrome |
01:57:01 | Quora | http://puu.sh/hNHnS/f3a312d6dc.png web.nim(33, 5) Error: undeclared identifier: 'get' |
01:57:20 | def- | Quora: don't put the template inside the routes |
01:57:56 | Quora | doesn't work in or out of them |
01:58:52 | def- | oh, it works when you remove the brackets at foo() call |
01:58:57 | def- | I'm wondering why |
01:59:15 | * | vikaton quit () |
01:59:54 | def- | that's probably the routes macro interfering, I think it might be a better idea to go with the manual routing: https://github.com/dom96/jester/blob/master/tests/example2.nim |
02:00:12 | Quora | ahh |
02:00:14 | Quora | okay I see |
02:00:15 | Quora | thanks |
02:02:28 | Quora | wait what |
02:02:41 | Quora | it's now eliminating the stuff from the binary |
02:03:14 | def- | ok, let's not call templates inside the routes macro |
02:03:30 | def- | I just checked, and the routes macro just discards our templates |
02:03:41 | Quora | https://gist.github.com/Heartmender/59250eddb8e20252541c |
02:03:42 | notfowl | O.o |
02:03:43 | Quora | oh |
02:03:51 | def- | two choices: go with manual routing, or build your custom routes with a macro |
02:04:43 | transfuturist | hm, it might be in csources too |
02:04:54 | Quora | how would I do it with a macro? |
02:05:13 | def- | Quora: it's a bit complicated I think, you can try reading about them in the tutorial. I'll give it a try too |
02:05:58 | def- | (but this looks hacky to me and I would go with the manual routing instead) |
02:07:34 | Quora | hmm |
02:08:27 | Quora | def-: I filed an issue (https://github.com/dom96/jester/issues/34) |
02:08:43 | def- | Quora: not necessary, that's totally intentional |
02:09:12 | def- | the routes macro is not supposed to have templates inside |
02:09:28 | Quora | def-: I find it better to make the issue and be rejected than not make it and have the authors never know there is a problem to begin with |
02:09:49 | def- | it parses the AST of the stmt inside and transforms that into a manual routing |
02:10:05 | Quora | ah |
02:15:17 | * | darkf joined #nim |
02:18:13 | def- | Quora: ha, got it I think! |
02:18:19 | Quora | hmm? |
02:20:20 | notfowl | Is the template pulled out in outsideStmts |
02:20:42 | def- | Quora: Updated: https://gist.github.com/def-/7d5fdfac9dc7ca9729cf |
02:22:58 | def- | Quora: maybe you're also interested in the mimetypes module: http://nim-lang.org/docs/mimetypes.html |
02:23:21 | def- | then you could get rid of specifying your own mimetypes by hand |
02:24:42 | Quora | def-: that is kinda beautiful. Thanks! |
02:25:48 | def- | Quora: still one thing missing, my bad |
02:26:37 | notfowl | Do you use the s parameter def- |
02:26:42 | def- | notfowl: just fixed |
02:26:48 | def- | That's what was missing |
02:27:03 | def- | I can't actually test the program, don't have a sobot.toml |
02:27:16 | notfowl | def-: do you know how to use quote |
02:27:24 | def- | notfowl: yes, but it complains here |
02:27:29 | notfowl | Its a lot nicer looking than parserxpr |
02:27:33 | notfowl | Ah |
02:28:22 | def- | is there a dirty kind of quote? |
02:28:28 | Quora | https://github.com/Heartmender/sobot |
02:28:54 | notfowl | No but it is needed. Quote itself is not magic just a macro |
02:29:35 | Quora | web.nim(22, 3) Hint: 'robotoregwoff2' is declared but not used [XDeclaredButNotUsed] |
02:30:08 | def- | Quora: i removed those |
02:30:13 | Quora | oh |
02:30:25 | Quora | OH |
02:30:27 | Quora | I see |
02:30:29 | Quora | okay |
02:30:41 | def- | Quora: also, did you know that jester has setStaticDir? |
02:31:05 | Quora | I do now |
02:33:09 | def- | notfowl: are you sure quote is not magic and a macro instead? |
02:33:42 | def- | notfowl: from what I can see it's semQuoteAst im compiler/semexprs.nim |
02:36:15 | notfowl | Hrm |
02:38:01 | notfowl | Thought I just looked at it recently |
02:56:12 | * | vendethiel quit (Ping timeout: 258 seconds) |
03:00:12 | transfuturist | if not m.preventStackTrace: |
03:00:13 | transfuturist | var procname = makeCString(m.module.name.s) |
03:00:13 | transfuturist | add(prc, initFrame(m.initProc, procname, m.module.info.quotedFilename)) |
03:00:13 | transfuturist | else: |
03:00:14 | transfuturist | add(prc, ~"\tTFrame F; F.len = 0;$N") |
03:01:39 | * | zahary quit (Ping timeout: 244 seconds) |
03:03:23 | * | vendethiel joined #nim |
03:03:40 | reactormonk | Araq, hm? |
03:26:29 | * | vendethiel quit (Ping timeout: 245 seconds) |
03:35:46 | * | vendethiel joined #nim |
03:37:57 | * | BitPuffin|osx quit (Ping timeout: 256 seconds) |
03:58:31 | * | notfowl is now known as fowl |
03:59:46 | * | vendethiel quit (Ping timeout: 264 seconds) |
04:27:05 | * | Kingsquee quit (Quit: Konversation terminated!) |
04:36:52 | transfuturist | got endb to work, F needed to be renamed to FR in strings |
04:49:53 | transfuturist | it seems that enable and disable are no longer endb commands |
04:50:30 | transfuturist | ah, it's toggle now |
04:52:29 | transfuturist | still isn't working... |
04:53:05 | transfuturist | the pain that is debugging a debugger |
05:15:13 | * | vendethiel joined #nim |
05:22:23 | * | mal``` quit (Ping timeout: 248 seconds) |
05:22:50 | * | mal`` joined #nim |
05:23:46 | renesac | Yo dawg, I herd you like debuggers |
05:29:28 | * | Demon_Fox joined #nim |
05:38:05 | * | vendethiel quit (Ping timeout: 256 seconds) |
05:38:24 | * | vendethiel joined #nim |
06:12:15 | transfuturist | for the last five hours i've been switching between trying to get gdb to work, and trying to get endb to work, and alternately remembering why i switched to trying the other immediately |
06:13:24 | transfuturist | aaaaaaaaaaaaaaaaaaaaagh |
06:17:39 | transfuturist | right, fuck debuggers. |
06:17:57 | * | BlaXpirit joined #nim |
06:23:31 | * | vendethiel quit (Ping timeout: 255 seconds) |
06:26:11 | * | vendethiel joined #nim |
06:36:05 | * | iamd3vil joined #nim |
06:37:41 | * | d3m1gd joined #nim |
06:46:04 | * | Demos quit (Read error: Connection reset by peer) |
06:47:18 | * | bjz joined #nim |
07:00:33 | * | Kingsquee joined #nim |
07:25:31 | * | Matthias247 joined #nim |
07:36:59 | * | dtscode quit (Remote host closed the connection) |
07:38:51 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
07:39:16 | * | transfuturist quit (Quit: Lost terminal) |
07:40:02 | * | Matthias247_ joined #nim |
07:42:43 | * | Matthias247 quit (Ping timeout: 255 seconds) |
07:44:30 | ggVGc | why does nim use colons after conditionals ? |
07:44:42 | ggVGc | not sure why python does it either, but I guess that's where the inspiration comes from |
07:44:51 | ggVGc | I don't see a syntactic benefit of it |
07:47:33 | * | ingsoc joined #nim |
07:47:55 | * | iamd3vil quit (Ping timeout: 246 seconds) |
07:54:09 | * | wan quit (Ping timeout: 240 seconds) |
07:55:13 | * | wan joined #nim |
07:58:16 | * | coffeepot joined #nim |
08:05:48 | * | bjz joined #nim |
08:19:43 | * | yglukhov____ joined #nim |
08:22:20 | * | Jesin quit (Quit: Leaving) |
08:24:15 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
08:28:22 | * | ddl_smurf quit (Quit: ddl_smurf) |
08:34:58 | * | mrkishi quit () |
08:37:49 | * | MyMind joined #nim |
08:42:55 | * | ingsoc quit (Quit: Leaving.) |
08:44:00 | * | BlaXpirit quit (Quit: Quit Konversation) |
08:57:58 | * | mal`` quit (Ping timeout: 256 seconds) |
09:05:42 | * | xcombelle joined #nim |
09:11:55 | * | mal`` joined #nim |
09:18:21 | def- | ggVGc: reads nicely and same syntax works with single line conditionals, see also: http://forum.nim-lang.org/t/1127#7031 |
09:23:24 | * | endragor joined #nim |
09:41:11 | * | banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
09:48:56 | * | Demon_Fox quit (Quit: Leaving) |
09:56:02 | * | bluenote_ joined #nim |
09:59:48 | * | ddl_smurf joined #nim |
10:13:20 | * | filwit quit (Quit: Leaving) |
10:18:59 | * | Trustable joined #nim |
10:28:00 | * | phira joined #nim |
10:37:23 | * | OnO joined #nim |
10:49:06 | * | milosn quit (Quit: leaving) |
11:00:32 | coffeepot | couldn't see it in the manual, how do I create my own exceptions for raising? |
11:00:35 | * | johnsoft quit (Ping timeout: 272 seconds) |
11:01:24 | coffeepot | ah ok I see, just create object decending from Exception |
11:01:53 | * | johnsoft joined #nim |
11:07:57 | * | bjz joined #nim |
11:15:24 | dom96 | Quora: thanks |
11:18:16 | * | bjz quit (Ping timeout: 255 seconds) |
11:32:04 | * | banister joined #nim |
11:32:40 | * | banister quit (Client Quit) |
11:33:02 | * | banister joined #nim |
11:44:38 | * | vikaton joined #nim |
11:50:40 | * | bjz joined #nim |
11:51:28 | * | ELFrederich quit (Quit: Leaving) |
11:52:50 | * | Kingsquee quit (Quit: Konversation terminated!) |
11:54:57 | * | dddddd joined #nim |
11:57:20 | * | emilsp joined #nim |
11:57:33 | emilsp | erm, is there python equivalent for nims json library ? |
11:59:02 | dom96 | emilsp: https://docs.python.org/2/library/json.html I guess |
12:00:03 | emilsp | dom96, yeah, but it returns a dictionary, whereas nim's library returns super awesome node objects/structs/things, which are much more fun to deal with |
12:00:57 | dom96 | emilsp: that is the way to represent it in Python because it is dynamically typed |
12:01:43 | emilsp | I see no reason why it couldn't return an object that would just throw exceptions if the type it held wasn't accessed with the right 'method' or whatever |
12:02:09 | emilsp | maybe I'm just stupid, but dealing with 'bare' dicts feels too hard for what I want to do |
12:03:45 | dom96 | emilsp: The obvious solution is to use Nim instead of Python :P |
12:04:22 | emilsp | dom96, to serialize python objects ? Of course :) |
12:05:21 | emilsp | dom96, I would've used nim if it hadn't been for the libraries that were already there in python for this project :( |
12:05:29 | dom96 | Why not just use the pickle module for serialisign? |
12:05:32 | dom96 | *serialising |
12:05:52 | emilsp | I don't want to serialize everything |
12:06:50 | emilsp | and serialization is 'clunky' when you deal with enums and there might be a thread object somewhere there, and a subprocess for good measure |
12:13:18 | * | JinShil joined #nim |
12:14:47 | * | gmpreussner|work quit (Read error: Connection reset by peer) |
12:33:15 | * | OnO is now known as ono |
12:39:33 | * | ingsoc joined #nim |
12:43:44 | * | vikaton quit () |
12:50:29 | * | Freedum joined #nim |
12:55:27 | Freedum | Could someone explain me that ? This code : http://pastebin.com/atpXGYvL prints only one IP. But this one : http://pastebin.com/p5TGdt7W prints a ton of IPs. And I just changed "google.com" to "www.google.com". Why ? |
12:57:53 | emilsp | multiple hosts bound to the full hostname ? |
12:58:21 | emilsp | but just a resolver host for the 'nonfull' hostname ? |
12:58:48 | Freedum | Maybe. |
12:59:17 | * | banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
13:01:41 | Freedum | It depends. It works for google.com, but it doesn't work for, say, 4chan.org. The output is : 141.101.114.6.52.99.104.97.141.101.115.6.52.99.104.97.190.93.244.6.52.99.104.97.190.93.245.6.52.99.104.97.190.93.247.5.103 141.101.115.6.52.99.104.97.190.93.244.6.52.99.104.97.190.93.245.6.52.99.104.97.190.93.247.5.103 190.93.244.6.52.99.104.97.190.93.245.6.52.99.104.97.190.93.247.5.103 190.93.245.6.52.99.104.97.190.93.247.5.103 190.93.247.5.1 |
13:04:24 | Freedum | Is there no way to get properly the IP adress associated to a hostname ? |
13:06:53 | * | banister joined #nim |
13:07:44 | def- | Freedum: I guess it's just missing in the standard library so far |
13:09:40 | emilsp | Freedum, wouldn't there be multiple IPs associated with a hostname anyway ? |
13:13:24 | Freedum | Yes, that's true. I found that https://raw.githubusercontent.com/def-/nim-unsorted/master/dns.nim gives only one IP, that works, even if it changes from www.google.com (173.194.113.113) to google.com (216.58.210.46) |
13:15:20 | * | Freedum quit () |
13:15:29 | * | giuliano108 joined #nim |
13:23:07 | * | ono is now known as OnO |
13:24:09 | reactormonk | dom96, any idea whom to bug for the whole suggest stuff? |
13:25:41 | * | ingsoc quit (Quit: Leaving.) |
13:26:36 | * | OnO quit (Quit: Textual IRC Client: www.textualapp.com) |
13:30:21 | dom96 | reactormonk: Araq I suppose |
13:32:41 | giuliano108 | May I ask a question? Is there an equivalent of "select" for channels (TChannel)? Such a call would block until any of the channels is available for reading or writing. |
13:33:32 | dom96 | giuliano108: Don't think so. But if that is something you would like to see then create an issue on Github for it, or a thread on the forum. |
13:33:47 | dom96 | It might be easy enough to implement using a macro. |
13:33:51 | * | OnO joined #nim |
13:34:11 | * | banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
13:49:04 | giuliano108 | dom96: thanks, I can maybe try to implement that myself |
13:51:22 | * | BitPuffin|osx joined #nim |
14:06:04 | * | banister joined #nim |
14:07:05 | * | pregressive joined #nim |
14:10:12 | * | yglukhov____ quit (Ping timeout: 256 seconds) |
14:10:50 | * | yglukhov____ joined #nim |
14:15:16 | * | Freedum joined #nim |
14:17:32 | Freedum | Hello.. Could someone explain me that error : "test.nim(15, 2) Error: value of type 'int' has to be discarded" ? The line is s.recv(data, 1024) and I don't understand what discarded mean... |
14:18:53 | def- | Freedum: the recv proc returns an int value, namely how much data has been received |
14:19:27 | def- | Freedum: you should compare the return value to see if it's according to what you expect, or if you don't care, just write "discard s.recv(...)" |
14:19:30 | emilsp | Freedum, and if you don't discard return values, you get errors |
14:19:40 | emilsp | because you should never discard return values, really |
14:19:44 | * | JinShil quit (Quit: Konversation terminated!) |
14:20:27 | * | BlaXpirit joined #nim |
14:20:38 | def- | if you write a proc, and the result should be discardable, there's the {.discardable.} pragma |
14:21:13 | bluenote_ | any ideas how to determine the size of a certain C type from within Nim? I expected this to work: {.emit: """ printf("Size of: %zu", sizeof(int)); """} |
14:28:29 | * | pregressive quit (Remote host closed the connection) |
14:29:54 | bluenote_ | okay got it: emit is not wrapped in a function, so I had to define a function first... |
14:33:14 | dom96 | you could just also do: echo(sizeof(cint)) |
14:34:54 | Freedum | Alright, it works. Thanks |
14:38:30 | * | pregressive joined #nim |
14:38:44 | * | milosn joined #nim |
14:43:02 | onionhammer | Varriount nice! how far from a release are we? |
14:44:27 | * | darkf quit (Quit: Leaving) |
14:46:11 | onionhammer | Varriount doccontinue not working for me on mac actually |
14:52:35 | * | xcombelle quit (Quit: Leaving) |
14:54:57 | bluenote_ | dom96: I was actually interested in the size of ptrdiff_t, which is probably not exported (no cptrdiff_t at least) |
14:55:34 | dom96 | bluenote_: I see. In that case you probably would have had to wrap it. |
15:03:15 | * | pregressive quit (Remote host closed the connection) |
15:15:52 | * | jholland joined #nim |
15:21:07 | * | venuc joined #nim |
15:24:24 | * | Jesin joined #nim |
15:24:53 | venuc | hi all, I am trying to build Nim on Mac OS X 10.5. Since I do not have clang installed, I modified the build.sh file to use GCC (i686-apple-darwin9-gcc-4.0.1). I am getting this error while running "sh build.sh" |
15:24:56 | venuc | gcc -w -O3 -fno-strict-aliasing -Ic_code -c c_code/3_1/stdlib_net.c -o c_code/3_1/stdlib_net.o c_code/3_1/stdlib_net.c: In function 'bindaddr_514620': c_code/3_1/stdlib_net.c:355: error: 'u_int32_t' undeclared (first use in this function) c_code/3_1/stdlib_net.c:355: error: (Each undeclared identifier is reported only once c_code/3_1/stdlib_net.c:355: error: for each function it appears in.) c_code/3_1/stdlib_net.c:355: error: syntax error b |
15:25:08 | venuc | could someone please help? |
15:29:38 | def- | venuc: hm, that's strange. I don't know if we support such an old gcc version. just replacing clang with gcc may not work because nim may create compiler specific c code. and I remember the u_int problems from here: https://github.com/Araq/Nim/issues/1406 |
15:31:58 | def- | venuc: I think some include might help for u_int32_t, but you may run into other problems |
15:32:01 | def- | https://stackoverflow.com/questions/5163835/what-is-u-int32-t |
15:34:07 | * | venuc quit (Ping timeout: 246 seconds) |
15:39:43 | * | vendethiel quit (Ping timeout: 255 seconds) |
15:41:22 | Freedum | https://github.com/nim-lang/c2nim Do I just need to run c2nim.nim to use it, or do I have to compile something ? |
15:48:33 | onionhammer | venucvenuc you should just install the os X command line tools |
15:49:11 | onionhammer | or homebrew |
15:49:14 | * | vendethiel joined #nim |
15:51:41 | * | gmpreussner|work joined #nim |
15:59:46 | * | banister quit (Read error: Connection reset by peer) |
16:06:42 | * | coffeepot quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
16:07:26 | * | pregressive joined #nim |
16:08:49 | * | OnO quit (Ping timeout: 264 seconds) |
16:12:11 | * | vendethiel quit (Ping timeout: 256 seconds) |
16:14:41 | * | vendethiel joined #nim |
16:17:15 | * | TEttinger quit (Ping timeout: 272 seconds) |
16:23:23 | def- | Freedum: nimble install c2nim |
16:30:06 | * | yglukhov_____ joined #nim |
16:30:52 | * | drguildo joined #nim |
16:31:19 | * | pregressive quit (Remote host closed the connection) |
16:31:30 | Freedum | ty def- |
16:31:41 | drguildo | does anybody have any idea why the rot13 brainfuck example on http://howistart.org/posts/nim/1 would cause an OverflowError? |
16:33:09 | * | yglukhov____ quit (Ping timeout: 256 seconds) |
16:34:42 | * | yglukhov_____ quit (Ping timeout: 256 seconds) |
16:35:08 | drguildo | http://pastie.org/10190682 is the output i get |
16:36:16 | def- | drguildo: Hi, I'm the author of that guide |
16:36:25 | def- | drguildo: https://github.com/howistart/howistart/pull/36/files |
16:36:48 | drguildo | oh cool, hi |
16:38:48 | def- | drguildo: Now you have the chance to proof-read my pull request. Does it make sense? |
16:39:17 | * | ticktick left #nim ("gaylords") |
16:39:55 | * | bluenote_ quit (Ping timeout: 246 seconds) |
16:40:32 | gmpreussner|work | def-: is DDrace written in Nim? |
16:41:57 | drguildo | def-: yeah, that makes sense. thanks. |
16:42:01 | * | Freedum quit (Ping timeout: 246 seconds) |
16:42:02 | def- | gmpreussner|work: unfortunately not, but I actually started using Nim to rewrite it in Nim, but got sidetracked by other things: http://hookrace.net/blog/what-is-hookrace/ |
16:43:19 | gmpreussner|work | nice |
16:45:49 | ldlework | gmpreussner|work: use your skills to lead the effort build standard metaverse technologies to lead us from web to verse with the anticipation of consumer vr techonlogy |
16:46:14 | emilsp | ldlework, wat |
16:46:25 | * | ldlework folds his arms. |
16:46:52 | * | giuliano208 joined #nim |
16:47:01 | gmpreussner|work | working on it ^_^ |
16:47:09 | * | ldlework falls over. |
16:47:30 | * | brson joined #nim |
16:49:49 | * | giuliano108 quit (Ping timeout: 245 seconds) |
16:49:59 | gmpreussner|work | who maintains Nim syntax highlighting on GitHub? |
16:50:09 | * | def- quit (Ping timeout: 252 seconds) |
16:50:30 | gmpreussner|work | it's not working correctly... integer constant suffixes seem to be handled badly |
16:51:11 | gmpreussner|work | see https://github.com/nimious/io-gles/blob/master/src/gles3/gl3.nim#L288 |
16:51:13 | BlaXpirit | yup, i had fun with that |
16:51:21 | * | giuliano208 quit (Ping timeout: 250 seconds) |
16:52:37 | * | brson quit (Quit: leaving) |
16:53:26 | * | pregressive joined #nim |
16:59:13 | * | brson joined #nim |
17:03:29 | * | Freedum joined #nim |
17:11:04 | * | dtscode joined #nim |
17:12:47 | * | Jehan_ joined #nim |
17:13:52 | * | gamesbrainiac joined #nim |
17:16:37 | Freedum | I know I can use httpclient to make GET and POST requests...but what about CONNECT, HEAD, HEAD, PUT, DELETE, TRACE... ? |
17:21:34 | * | def- joined #nim |
17:23:01 | * | vendethiel quit (Ping timeout: 256 seconds) |
17:25:06 | Freedum | def-, I know I can use httpclient to make GET and POST requests...but what about CONNECT, HEAD, HEAD, PUT, DELETE, TRACE... ? |
17:25:15 | * | boopisaway is now known as boop |
17:29:09 | dom96 | Freedum: yep http://nim-lang.org/docs/httpclient.html#HttpMethod |
17:29:51 | def- | gmpreussner|work: same problem in Vim iirc |
17:30:58 | * | gsingh93 joined #nim |
17:35:10 | * | Jesin quit (Quit: Leaving) |
17:40:38 | * | yglukhov_____ joined #nim |
17:45:03 | * | epichero joined #nim |
17:50:40 | gmpreussner|work | def-: your 150 byte executable article is fantastic |
17:52:07 | def- | gmpreussner|work: thanks! |
17:53:13 | def- | I also had some more fun in that direction: https://github.com/def-/nim-small-coreutils |
17:54:50 | Freedum | Thanks a lot def- ! |
17:55:06 | Freedum | Sorry, it was dom96 :-) |
17:55:25 | * | Freedum quit () |
18:03:25 | gamesbrainiac | guys, is anyone considering working on an IntelliJ idea extension for nim? |
18:03:55 | * | Jesin joined #nim |
18:05:52 | def- | gamesbrainiac: haven't seen anything |
18:06:07 | gamesbrainiac | def- I was considering it myself. |
18:09:13 | dom96 | gamesbrainiac: I was considering working on one actually. |
18:09:41 | gamesbrainiac | dom96 I think it would be useful, I love the code completion it provides. |
18:10:15 | gamesbrainiac | dom96 I'll be at PyCon APAC 2015 soon, so I can ask some of the core devs if they're interested in supporting it. |
18:10:32 | gamesbrainiac | Since the golang plugin's success was in large part due to jetbrains help |
18:10:48 | gamesbrainiac | (api isn't all that well documented) |
18:10:56 | dom96 | gamesbrainiac: That would be brilliant. Spread the word of Nim at PyCon :) |
18:11:08 | gamesbrainiac | dom96 Will do man! |
18:13:15 | * | elbow_ quit (Remote host closed the connection) |
18:16:43 | * | epichero quit () |
18:17:22 | * | Perelandric joined #nim |
18:21:26 | gmpreussner|work | def-: i just stumbled upon your NES emulator |
18:21:30 | gmpreussner|work | you are full of awesome |
18:22:32 | gmpreussner|work | i've been wanting to write an Atari Lynx emulator in Nim. just don't have any time. might revisit now :) |
18:23:45 | gmpreussner|work | love the 'op' template and how clean everything is |
18:23:56 | Jehan_ | gamesbrainiac: I think it'd be a great idea, but, yeah, I've found the documentation to be largely impenetrable. |
18:24:27 | gamesbrainiac | Jehan_ Join the club. I actually know some of the guys, and the often have to ask the person who wrote the damn api to know whats what |
18:25:19 | gamesbrainiac | ...some of the guys (at jetbrains) ... |
18:25:25 | * | vendethiel joined #nim |
18:31:35 | * | MyMind quit (Quit: WeeChat 1.1.1) |
18:34:30 | Jehan_ | gamesbrainiac: I had been thinking about adapting the Scala plugin, because it's pretty mature and writing Scala code would be a lot easier than Java, but the thing is huge. |
18:34:43 | * | boydgreenfield joined #nim |
18:34:56 | Jehan_ | In the end, vim + tags still works best for me. :) |
18:35:10 | Jehan_ | Especially since I often have to work on a server via ssh. |
18:35:12 | gamesbrainiac | Jehan_ I probably want to do it in Kotlin. Problem with Scala is that you have to add a huge .jar file with every distro |
18:35:27 | Jehan_ | gamesbrainiac: Eh, it's not so bad. |
18:35:27 | boop | is there something in nim that's like python's struct.pack? |
18:35:40 | Jehan_ | And proguard can trim it down to a fairly reasonable size. |
18:36:45 | * | xcombelle joined #nim |
18:37:06 | Jehan_ | boop: Umm … the concept doesn't really make as much sense in Nim. |
18:37:25 | boop | hmm. |
18:37:26 | Jehan_ | Since you can already declare a tuple or object with the appropriate byte layout. |
18:37:27 | * | deavmi joined #nim |
18:37:29 | deavmi | I love nim! |
18:37:34 | deavmi | Learning it as of today |
18:37:38 | dtscode | Maybe I'm crazy, but I'm not finding a substr method in strutils. Am I right? |
18:37:42 | deavmi | And it is frikken awesome |
18:37:45 | Jehan_ | And then just do copyMem etc. to access the byte representation. |
18:37:48 | boop | it's mostly for the endianness stuff |
18:38:03 | boop | how would i do pad null bytes in a packed object? |
18:38:18 | deavmi | Anybody know about any other small or different languages |
18:38:44 | Jehan_ | dtscode: substr is in system.nim |
18:39:08 | dtscode | Jehan_: Thanks. Its been far too long since I've used nim :D |
18:39:11 | Jehan_ | boop: Hmm, endianness makes sense. I hadn't thought of that. |
18:39:34 | boop | the endian package is quite low level |
18:39:42 | boop | ideally i could do something like this: 'struct.pack('!xcH5x{}sx'.format(len(msg) + 1), b'\x83', len(msg) + 7, six.b('?' + msg))' |
18:40:46 | * | boop unrolls the xyproblems |
18:40:47 | dom96 | deavmi: That's nice to hear! Other programming languages off the top of my head: Crystal, Rust, Go, ooc. |
18:40:49 | Jehan_ | boop: You could probably handle endianness using fieldPairs(). |
18:40:51 | boop | trying to implement this |
18:40:54 | boop | http://www.byond.com/forum/?post=276414#comment1156465 |
18:41:03 | boop | i might be going at it the wrong way |
18:42:12 | dom96 | boop: perhaps this is what you need https://github.com/akiradeveloper/msgpack-nim |
18:42:55 | boop | messagepack is its own protocol |
18:43:02 | boop | i'm trying to interface with an existing protocol |
18:44:31 | * | deavmi quit (Ping timeout: 246 seconds) |
18:45:29 | * | fizzbooze joined #nim |
18:45:31 | * | gamesbrainiac quit (Quit: Bye folks!) |
18:48:51 | Jehan_ | boop: Looking at the forum post, struct.pack seems to be overkill. just string.add() should suffice for this particular protocol. |
18:49:10 | boop | Jehan_: and endianness? |
18:49:42 | Jehan_ | boop: There's only a case of a two-byte integer being encoded. |
18:50:07 | boop | and a four byte float being decoded |
18:50:17 | boop | that's another thing, unpacking. hm. |
18:50:30 | Jehan_ | Oh, I didn't see that in the post. |
18:50:41 | Jehan_ | Well, floats are easy, since they have a standard layout. |
18:51:15 | Jehan_ | Just use a float32, get its addr(), cast to ptr array[0..3,char]. |
18:52:19 | def- | gmpreussner|work: great to hear, thanks! |
18:54:55 | * | yglukhov_____ quit (Quit: Be back later ...) |
19:02:04 | * | deavmi joined #nim |
19:03:30 | boop | let msglen: uint16 = cast[uint16](htons(cast[int16](len(msg).uint16))) |
19:03:34 | boop | ^ oh well, should work! |
19:03:56 | * | banister joined #nim |
19:05:15 | fowl | Used endians module for reading/writing data, it was probably an abuse though |
19:05:55 | * | yglukhov_____ joined #nim |
19:06:13 | * | deavmi quit (Ping timeout: 246 seconds) |
19:07:05 | * | brson quit (Quit: leaving) |
19:10:39 | * | vendethiel quit (Ping timeout: 245 seconds) |
19:15:55 | * | yglukhov_____ quit (Quit: Be back later ...) |
19:16:45 | boop | hmm |
19:16:53 | boop | can i concat a string and a ptr array? |
19:16:57 | boop | [char] |
19:21:39 | Jehan_ | boop: Here's a a simple module to do string encoding of int and float32 values: https://gist.github.com/rbehrends/02cfb062ec344a5002d5 |
19:22:55 | Jehan_ | Could probably use some tidying up, but it should be enough for your purposes. |
19:23:13 | boop | oohhh. that's great! thanks so much! |
19:27:55 | * | rinukkusu quit (Quit: ZNC - http://znc.in) |
19:28:26 | * | rinukkusu joined #nim |
19:38:11 | * | askatasuna joined #nim |
19:39:41 | * | boydgreenfield quit (Quit: boydgreenfield) |
19:42:41 | boop | Jehan_: before you get too far away, do i have permission to use this in a MIT licensed thing? |
19:43:31 | Jehan_ | Actually, let me just put CC0 on this. |
19:43:42 | Jehan_ | This should make it even easier. |
19:43:45 | boop | that works :) |
19:46:31 | * | vendethiel joined #nim |
19:48:06 | Jehan_ | boop: Updated. |
19:48:28 | * | xcombelle quit (Remote host closed the connection) |
19:48:53 | boop | cheers! |
19:49:15 | Jehan_ | I've also added float64 support while at it. |
19:53:50 | * | fizzbooze quit (Ping timeout: 252 seconds) |
20:02:33 | * | dom96_ joined #nim |
20:05:10 | * | drguildo left #nim (#nim) |
20:05:12 | * | Varriount quit (Ping timeout: 252 seconds) |
20:07:54 | * | Wicked joined #nim |
20:08:06 | * | filwit joined #nim |
20:08:57 | * | endragor quit (Ping timeout: 240 seconds) |
20:10:34 | * | pregressive quit (Remote host closed the connection) |
20:13:12 | dtscode | does writeFile append to the file or overwrite it? |
20:13:23 | Wicked | My errors must be blasphemous for an experimented Nimrider, but what's the problem with my code ? http://pastebin.com/1qZJ0MCn |
20:13:40 | Araq | dtscode: overwrite |
20:14:13 | dtscode | Araq: Is there a method like writeFile that appends? |
20:14:43 | * | gsingh93 quit (Ping timeout: 256 seconds) |
20:15:35 | dom96_ | dtscode: I think you need to open() the file with the correct flags. |
20:15:54 | dtscode | Damn. Oh well. |
20:17:22 | Araq | Wicked: google doesn't like bots? |
20:17:42 | Araq | you need to set the user-agent at least |
20:18:17 | filwit | dtscode: not sure if you didn't get what dom96 meant, he meant do this: yourfile.open("...", fmAppend) |
20:18:42 | dtscode | filwit: Yeah thats what I figured. |
20:18:54 | filwit | okay, just making sure :) |
20:19:01 | Wicked | I don't think the problem comes from the user-agent or Google itself. Here's the error : http://pastebin.com/HGqYgCAS |
20:19:23 | def- | Wicked: nope, compilation failures don't come from Google |
20:19:48 | Wicked | Ha ha :D |
20:19:57 | def- | it means you're tryint to print a StringTableRef, but there is no stringification proc ($) defined |
20:20:11 | def- | print or otherwise make a string |
20:21:33 | Wicked | Oh ! The problem comes from echo(a). |
20:23:42 | * | Varriount joined #nim |
20:24:25 | * | pregressive joined #nim |
20:25:10 | Wicked | Also, is there a function to know the type of a variable ? |
20:29:19 | def- | Wicked: type() |
20:30:25 | Wicked | Thanks a lot. |
20:31:15 | def- | if you want to print them, import typetraits and use 3.type.name |
20:32:32 | Wicked | Alright |
20:37:18 | Wicked | Hum, there's no such thing in documentation. How do I convert my Response body to a string ? |
20:39:36 | Jehan_ | The simplest way to dump something to a string is using repr(x). |
20:39:49 | Jehan_ | Which should work on pretty much anything, but isn't as pretty as $x. |
20:41:17 | * | boydgreenfield joined #nim |
20:41:35 | Wicked | Okay, thanks! |
20:48:51 | * | giuliano108 joined #nim |
20:50:09 | Wicked | I see that myResponse.status gives me "200 OK". I understand that this is the same thing that "200 Connection Etablished", but can I send it directly to my client ? Will his browser read "200 OK" like "200 Connection Etablished" ? |
20:53:15 | dom96_ | Wicked: What are you trying to do? |
20:55:44 | Wicked | Something like a proxy. I already know how to make a web server, but I want to make a proxy server which is more difficult than just respond to a GET request by the same response. |
20:56:49 | dom96_ | Wicked: Take a look at the docs for the Response object (what request() returns) http://nim-lang.org/docs/httpclient.html#Response |
20:57:28 | Varriount | Wicked: Neat. How does a proxy actually work? |
21:01:00 | Wicked | The point is to read the HTTP request coming from a client, parse it to have the request type, the url to get and the HTTP version, then send the request on the specified host, get the response, and send the response to the client. |
21:01:15 | Wicked | [Varriount] |
21:01:33 | * | boydgreenfield quit (Quit: boydgreenfield) |
21:01:38 | Varriount | Wicked: Ah, thanks. |
21:03:47 | Varriount | Wicked: I expect that the '200 Ok' is the same as http status code 200 |
21:04:05 | Varriount | Actually, I'm puzzled as to why that's a string, and not an integer. |
21:04:15 | * | pregressive quit (Remote host closed the connection) |
21:05:44 | Wicked | I know, but my question was to know if a web browser is able to understand that "200 OK" == "200 Connection Etablished". |
21:08:18 | Varriount | Wicked: I believe the '200 Connection established' is separate? I'm looking at this: https://github.com/google/google-api-php-client/issues/117 |
21:08:50 | Varriount | Wicked: Also this: http://curl.haxx.se/mail/lib-2005-10/0023.html |
21:09:25 | Varriount | It looks like the answer is 'it depends on the client' |
21:10:22 | Wicked | So, looks like that when there's at least "200" in the response it's good. |
21:11:37 | * | dvlwrk joined #nim |
21:12:14 | dom96_ | Varriount: There is an enum for this. |
21:12:31 | dom96_ | but httpclient doesn't use it I suppose |
21:13:52 | Varriount | dom96: In an ideal world, Nim would have a module with an api similar to that of the Python 'requests' module. |
21:16:28 | * | boydgreenfield joined #nim |
21:21:46 | * | brson joined #nim |
21:24:55 | dom96_ | Varriount: Indeed. In an ideal world we would get paid to make the httpclient module awesome. |
21:27:16 | * | Wicked quit (Ping timeout: 246 seconds) |
21:29:01 | boop | asynchttpclient is a lot nicer on the API than httpclient |
21:29:47 | * | vendethiel quit (Ping timeout: 264 seconds) |
21:31:50 | * | saml quit (Quit: Leaving) |
21:37:56 | * | xender joined #nim |
21:38:50 | * | gsingh93 joined #nim |
21:39:21 | xender | Hi. Could you advise me some 2d graphics library for gamedev, with a nice API, that will work when compiled to C and JS (not necessarily by built-in JS backend, Emscriptening generated C is allowable too, if it's going to be better (I've seen that opinion on one blog))? |
21:39:33 | xender | Will SFML or SDL2 work in those modes? |
21:39:53 | * | giuliano108 quit (Quit: leaving) |
21:40:03 | * | doomster joined #nim |
21:40:13 | doomster | Hi! |
21:40:14 | xender | Targetting Linux + maybe Windows, MacOS + browsers via JS |
21:40:30 | BlaXpirit | xender, check out https://github.com/def-/nimes |
21:41:21 | xender | BlaXpirit: Oh, yeah, the blog post I've seen was about this, thank you for reminding me. Will check out :) |
21:42:18 | doomster | I'm looking for a way to determine the number of elements in a set[char]. len() doesn't seem to have an according overload, is there a special reason for this? |
21:42:53 | BlaXpirit | maybe some semantic nonsense |
21:43:15 | BlaXpirit | doomster, you're looking for `card` |
21:43:43 | BlaXpirit | how i found it: http://nim-lang.org/docs/system.html search for ": set" |
21:43:47 | doomster | ah, thanks BlaXpirit! |
21:45:06 | * | mrkishi joined #nim |
21:47:41 | dom96_ | doomster: These docs are also useful: http://nim-lang.org/docs/manual.html#types-set-type |
21:47:53 | dtscode | Can someone tell me why https://bpaste.net/show/bed5d38b92be doesn't append code to file? |
21:47:59 | * | gmpreussner|work quit (Ping timeout: 244 seconds) |
21:48:54 | dom96_ | dtscode: you mean it just overwrites it? |
21:49:18 | dtscode | dom96_: No. The file is the same before running the program |
21:49:42 | dom96_ | dtscode: So you never get to line 26 perhaps? |
21:49:51 | Varriount | dtscode: Buffering perhaps? |
21:50:10 | dtscode | dom96: No, because it prints True. |
21:50:20 | dtscode | Varriount: Perhaps. Would I need to call flushFile? |
21:50:25 | dom96_ | Ok. Then buffering is likely. |
21:50:29 | dom96_ | You should close the file handle. |
21:50:51 | dtscode | /facepalm |
21:51:13 | * | gmpreussner|work joined #nim |
21:51:19 | Varriount | Although, shouldn't the OS normally close any open file handles when the program quits? |
21:53:00 | dom96_ | yeah. I'm guessing dtscode's process didn't exit yet. |
21:53:40 | dtscode | Yeah it doesn't exit after writing to the file |
21:55:19 | dtscode | Odd... It still doesn't write to the file. |
21:56:16 | Varriount | what happens when you write, instead of appending? |
21:57:18 | dtscode | Let me see real quick |
21:57:48 | * | gmpreussner|work quit (Ping timeout: 244 seconds) |
22:00:25 | dtscode | Varriount: Writing overwrites it, as expected |
22:00:48 | Varriount | Weird, so appending doesn't work.. |
22:01:06 | Varriount | AFAIK, the stdlib uses the constants found in the C library. |
22:01:33 | * | BlaXpirit quit (Quit: Quit Konversation) |
22:03:58 | Varriount | dtscode: What OS are you using, and what C lib? |
22:04:22 | dtscode | Linux Mint, gcc which I think is glibc |
22:08:57 | * | vendethiel joined #nim |
22:09:16 | Varriount | dtscode: Sorry if this exasperates you, but what happens when you test out a simple usage of append? |
22:09:42 | dtscode | Let me see... |
22:09:53 | Varriount | Using a simple 3 line script, appending works for me, although I'm on Windows... |
22:12:19 | dtscode | A simple test does not work for me. |
22:12:35 | * | boydgreenfield quit (Quit: boydgreenfield) |
22:13:24 | Varriount | O_o |
22:13:40 | Varriount | dtscode: Stop scaring me. |
22:13:58 | dtscode | No joke |
22:15:58 | Varriount | dtscode: What does the C source look like? Can you see what (eventual) constant is being passed to open()? |
22:16:38 | dtscode | Let me see |
22:18:07 | Varriount | dtscode: Here are the constants in the system source code: https://github.com/Araq/Nim/blob/8ddb58aecc6ddc4c7945258d55debd188c3b5692/lib/system/sysio.nim#L251 |
22:18:15 | * | dvlwrk quit (Ping timeout: 272 seconds) |
22:18:47 | dtscode | Wait... I spoke too soon |
22:18:50 | dtscode | It did work |
22:19:19 | Varriount | ? |
22:19:29 | filwit | hmm.. can someone explain to me why the pointers in this simple gist are so far off? gist: https://gist.github.com/PhilipWitte/2d167c888f95e67f0292 |
22:19:57 | filwit | namely, why is the pointer addr to 'me' from the proc 'blah' so different than that of it's properties? |
22:20:18 | dtscode | Varriount: The simple test worked. |
22:21:02 | filwit | I would have expected that and addr to a 'ptr object's member would basically be an offset from it's own, but that doesn't appear to be the case at all |
22:21:32 | boop | filwit: i'm guessing the pointer is on the stack, stuff it points to is on the heap |
22:21:34 | Varriount | filwit: Doesn't `addr me` give the address on the stack where the pointer resides? |
22:22:10 | Varriount | 'give the address of the pointer pointing to GameObj data' |
22:22:14 | filwit | boop: that's gotta be it, of course.. i was thinking in reverse (the members where stack refs) but that makes sense |
22:22:28 | filwit | damn.. |
22:22:35 | Varriount | filwit: Long day? |
22:22:47 | filwit | nah, just wasn't thinking this through enough |
22:22:52 | * | askatasuna quit (Quit: WeeChat 1.1.1) |
22:22:53 | filwit | middle of day for me |
22:24:09 | * | gsingh93 quit (Ping timeout: 244 seconds) |
22:24:25 | filwit | nevermind, it works actually if I put the 'w' var inside a seq (which is my actual use-case anyways |
22:24:48 | filwit | but good to be aware of.. |
22:25:39 | Varriount | filwit: In case you don't already know, 'var' parameters are essentially pointers to the argument type on the stack. |
22:26:39 | * | boydgreenfield joined #nim |
22:26:48 | filwit | Varriount: thanks for the heads up.. I'm just exploring some ideas right now, but thanks for the heads up |
22:30:36 | * | gamesbrainiac joined #nim |
22:31:27 | filwit | cool it works!: https://gist.github.com/PhilipWitte/2d167c888f95e67f0292 |
22:31:47 | filwit | can adjust 'index' value of GameObj through reference to it's 'data' field |
22:31:51 | * | vendethiel quit (Ping timeout: 256 seconds) |
22:32:17 | filwit | dunno how safe all this is.. |
22:32:59 | Varriount | filwit: I'm sure Araq would be horrified at all the casting and pointer arithmatic |
22:33:07 | filwit | er.. the `.` macro is kinda pointless now.. |
22:34:13 | filwit | Varriount: yeah.. and possibly for good reason.. I'm not sure exactly the implications of using 'ptr object' as a container for GCed data.. could just be unsafe all around (of course I could most likely manually register 'data' with the GC) |
22:34:35 | Varriount | filwit: Why are you using a pointer? |
22:35:20 | filwit | well initially I was just using 'ref object', but wasn't sure if ref-counting variables was going to get in the way of my pointer arithmetic |
22:36:17 | filwit | plus, if possible it would be nice to have the GC not scan my top-level list of data I tightly control anyways |
22:36:27 | Varriount | filwit: I don't believe so, not unless you are doing arithmatic with references to the references, and those references are stored in sequences. |
22:36:57 | Varriount | (I'm not sure that made sense...) |
22:37:06 | filwit | am a bit confused, lol |
22:37:35 | Varriount | filwit: Also, isn't that something of a premature optimization? |
22:38:23 | filwit | well that part isn't a big concern, it's just I want to know how to do something like it if I want to. |
22:38:36 | filwit | the GC scanning part I mean |
22:40:25 | Varriount | filwit: Araq would be the one to ask about using pointer arithmatic with references. |
22:40:30 | filwit | mostly I'm looking for a way to pass around a user-defined type (aka, Ship) to user-defined functions (aka, blah) and still be able to manipulate GameObj properties tied to that instance (aka, 'index' which is used to enable/disable the object on multiple event lists) |
22:40:46 | Varriount | filwit: Inheritance? |
22:40:59 | filwit | oh, i meant to right 'without inheritance' |
22:41:14 | Varriount | Or possibly, wrap the user defined type inside another type? |
22:42:06 | * | vendethiel joined #nim |
22:42:09 | Varriount | filwit: You know that what your script does is the same as inheritance, right? |
22:42:22 | filwit | yes |
22:42:54 | filwit | there's a reason I'm trying to do this generically, but like I said, it's just an idea at this point |
22:43:15 | filwit | at the end of the day, Inheritance might just be the better option |
22:43:43 | filwit | anyways, do gotta work on other things now |
22:43:54 | * | pregressive joined #nim |
22:45:15 | Jehan_ | filwit: The result of putting GCed references in an object allocated with alloc() and friends will result in those references not being scanned and (unless other references are there to keep them alive) the associated objects possibly being freed prematurely. |
22:45:52 | Jehan_ | You can work around this by using GC_ref() and GC_unref() manually. |
22:46:44 | Jehan_ | The Boehm GC also eliminates the issue, but … well, it's not really suited for video games. |
22:48:34 | * | pregressive quit (Ping timeout: 255 seconds) |
22:52:26 | filwit | Jehan_: okay, thats what I was guessing. Thanks for confirming that. |
22:54:13 | * | boop is now known as boopisaway |
22:58:50 | * | boopisaway is now known as boop |
23:00:49 | * | brson quit (Read error: Connection reset by peer) |
23:02:03 | * | brson joined #nim |
23:04:11 | Varriount | Gah, as much as I dislike PyCharm and IntelliJ for their memory usage, their refactoring capabilities are unmatched. |
23:05:12 | * | vendethiel quit (Ping timeout: 276 seconds) |
23:05:40 | * | brson quit (Client Quit) |
23:07:10 | Jehan_ | Varriount: Heh. :) |
23:07:15 | onionhammer | Varriount release yet? :) |
23:07:34 | Jehan_ | I have to say that I don't need refactoring capabilities very much. |
23:07:57 | Jehan_ | Or rather, when I need them, they don't really do enough for what I need. |
23:08:32 | Jehan_ | I have wondered whether a refactoring language might be a good solution. |
23:09:08 | Jehan_ | I.e. a programming language that has basic refactoring commands and can apply them to a set of files. |
23:09:51 | * | milosn quit (Ping timeout: 265 seconds) |
23:10:06 | * | brson joined #nim |
23:11:17 | * | milosn joined #nim |
23:12:38 | Varriount | onionhammer: Since you primarily use ST3, I would appreciate it if you could test all the new commands and features. |
23:12:47 | Varriount | Then we can release. |
23:14:35 | Varriount | onionhammer: I just made a commit, so don't forget to check out the new revision |
23:15:38 | onionhammer | Varriount ok, i'm on a trip in tennessee right now, so I dont have a whole lot of time on my computer |
23:15:47 | onionhammer | are you on ST2 only? |
23:16:48 | * | vendethiel joined #nim |
23:17:02 | onionhammer | Varriount doccomments still dont work for me at least |
23:19:22 | Varriount | onionhammer: They aren't empty, are they? |
23:19:49 | onionhammer | no |
23:26:49 | * | gamesbrainiac quit (Quit: Bye folks!) |
23:31:44 | * | brson quit (Quit: leaving) |
23:34:58 | * | gmpreussner|work joined #nim |