00:01:23 | * | yglukhov joined #nim |
00:01:23 | * | yglukhov_ quit (Read error: Connection reset by peer) |
00:02:27 | * | darkf quit (Quit: Leaving) |
00:04:56 | * | yglukhov quit (Read error: Connection reset by peer) |
00:05:18 | * | yglukhov joined #nim |
00:07:26 | * | yglukhov quit (Read error: Connection reset by peer) |
00:07:36 | * | yglukhov joined #nim |
00:09:47 | * | yglukhov quit (Read error: Connection reset by peer) |
00:17:39 | * | yglukhov joined #nim |
00:19:59 | * | yglukhov quit (Read error: Connection reset by peer) |
00:23:37 | ThePythonicCow | Does someone know what was the 'echo $foo gotcha' that was recently fixed (or know where that is explained)? (Newbie here) |
00:24:14 | def- | ThePythonicCow: http://nim-lang.org/news.html#Z2016-01-18-version-0-13-0-released |
00:24:18 | def- | look at the syntax changes for 0.13.0 |
00:24:43 | ThePythonicCow | thanks - looking |
00:25:33 | * | yglukhov joined #nim |
00:28:27 | * | arnetheduck joined #nim |
00:32:26 | ThePythonicCow | So ... next question ... what is the meaning of an infix '$', as in (echo) $ (foo) ? |
00:34:34 | def- | when you define a proc `$`(...) you can use it as `$`(x, y) or x $ y |
00:34:53 | def- | so it's a function call to `$` with the parameters echo and foo |
00:35:21 | ldlework | in both cases, def- means |
00:35:39 | ephja | similar to the perhaps more familiar "3 + 4" |
00:35:55 | ldlework | a third way to call it would be, echo.$(foo) |
00:35:57 | ldlework | err |
00:35:59 | ThePythonicCow | ah - no builtin meaning - but I can provide one if I want (so the parser has to allow '$' as an infix operator, if the syntax reads that way) |
00:35:59 | ldlework | nope |
00:36:05 | def- | ldlework: echo.`$`(foo) |
00:36:09 | ldlework | right |
00:36:39 | ephja | 3 + 4: proc `+`(a, b: int) |
00:37:25 | * | vendethiel joined #nim |
00:37:28 | ThePythonicCow | ok - I hadn't integrated macro ability of Nim into my mental Nim parser yet :) |
00:38:58 | ephja | it doesn't involve macros |
00:39:53 | ThePythonicCow | yes - not macros - overloading operators - thanks |
00:41:13 | ephja | not necessarily overloading |
00:41:56 | ThePythonicCow | ok ... I will continue reading def's book before I insert foot further into mouth |
00:42:12 | ephja | I don't think `?` for example is defined anywhere. btw, multiple "special" characters can be part of the name (`?$`) |
00:44:02 | ephja | well, `[]` and `==` for example would be more obvious examples :p |
00:44:14 | ThePythonicCow | Do we have any ancient APL programmers around ... they could have some fun with this. |
00:47:10 | def- | ThePythonicCow: it's not my book, it's dom96's |
00:47:29 | ThePythonicCow | ah - name confusion here |
00:47:55 | * | jaco60 quit (Ping timeout: 240 seconds) |
01:00:25 | * | vendethiel quit (Ping timeout: 240 seconds) |
01:13:44 | * | Matthias247 quit (Read error: Connection reset by peer) |
01:14:51 | * | vendethiel joined #nim |
01:17:46 | * | yglukhov quit (Remote host closed the connection) |
01:21:32 | * | junw_ quit (Remote host closed the connection) |
01:35:00 | ldlework | this looks nice, http://www.dinomage.com/tag/sdl_gpu/ |
01:35:26 | * | vendethiel quit (Ping timeout: 240 seconds) |
01:41:12 | ephja | chromium doesn't like that website |
01:41:50 | def- | neither does firefox, crashed my browser |
01:41:51 | ephja | it keeps waiting for resources and nothing can be clicked |
01:48:51 | ephja | ldlework: which browser are *you* using? :p |
01:51:52 | ldlework | well it crashed my browser too |
01:51:56 | ldlework | I mean the library looks nice |
01:54:47 | ephja | https://github.com/grimfang4/sdl-gpu |
01:57:07 | ThePythonicCow | and DinoMage Games uses SDL_gpu: http://www.dinomage.com/2014/03/sdl_gpu-0-8-0-released/ |
01:57:34 | ThePythonicCow | didn't crash my "browser" (wget ... the browser for dubious sites <grin>) |
01:58:07 | ldlework | I wonder if c2nim would just bind it without pain |
01:58:16 | ldlework | whenver I get stuck with c2nim I don't know what I'm supposed to do |
02:12:46 | * | avsej quit (Ping timeout: 240 seconds) |
02:16:18 | * | Trustable quit (Remote host closed the connection) |
02:17:03 | * | avsej joined #nim |
02:17:03 | * | avsej quit (Changing host) |
02:17:03 | * | avsej joined #nim |
02:18:06 | ldlework | How do you produce an empty json object ltieral with the json macro? |
02:18:15 | * | yglukhov joined #nim |
02:18:24 | ldlework | I just get an error that it got a set[empty] |
02:19:46 | def- | ldlework: oops, let me fix that |
02:22:33 | * | yglukhov quit (Ping timeout: 240 seconds) |
02:23:25 | * | avsej quit (Ping timeout: 245 seconds) |
02:30:45 | def- | ldlework: this should fix it: https://github.com/nim-lang/Nim/pull/3829/ |
02:31:10 | ldlework | def-: cool you going to merge it |
02:31:48 | ldlework | or does someone else have to lgtm it |
02:31:57 | def- | ldlework: I'd rather wait for someone else to look over it, no one told me if i'm allowed to merge my own commits, so I only do it for trivial ones |
02:32:14 | ldlework | ok |
02:32:24 | ldlework | I'll just switch over to parseJson for now |
02:32:28 | ldlework | thanks! |
02:41:17 | * | avsej joined #nim |
02:41:18 | * | avsej quit (Changing host) |
02:41:18 | * | avsej joined #nim |
03:08:58 | * | Jesin quit (Quit: Leaving) |
03:15:21 | * | ephja quit (Ping timeout: 245 seconds) |
03:16:43 | * | gokr quit (Quit: Leaving.) |
03:19:25 | * | Jesin joined #nim |
03:19:53 | * | yglukhov joined #nim |
03:23:55 | * | yglukhov quit (Ping timeout: 240 seconds) |
03:28:23 | * | lompik quit (Ping timeout: 264 seconds) |
03:39:41 | Varriount | ldlework: I could try my hand at wrapping the sdl_gpu with c2nim |
04:10:29 | * | nande quit (Read error: Connection reset by peer) |
04:19:22 | * | lompik joined #nim |
04:21:35 | * | yglukhov joined #nim |
04:25:44 | * | yglukhov quit (Ping timeout: 252 seconds) |
04:28:24 | * | ludocode quit (Ping timeout: 272 seconds) |
04:33:57 | * | vendethiel joined #nim |
04:36:18 | * | ludocode joined #nim |
04:38:54 | ics | Is there some way to declare endian-ness in a type? e.g. I have a type Foo = object with field x: cshort # big-endian |
04:39:11 | ics | ...which I am reading in from a binary file |
04:42:28 | ics | Or do I need to call bigEndian16 (import endian) while parsing the binary? |
04:48:09 | * | brson quit (Quit: leaving) |
04:56:01 | * | filwit quit (Quit: Leaving) |
04:58:00 | * | vendethiel quit (Ping timeout: 252 seconds) |
05:07:33 | * | Varriount quit (Disconnected by services) |
05:07:33 | * | Varriount_ joined #nim |
05:19:47 | Varriount_ | ics: Types have the endian-ess of the host platform. |
05:25:07 | ics | Okay. The binary I'm working with is mixed, first two bytes are big and the rest (I think) are little. In a read proc I'm doing f.readData(addr(this.x), sizeof(this.x)) where x: cshort but I'm not sure how I should flip this value (needs pointers?) |
05:26:11 | Varriount_ | ics: http://nim-lang.org/docs/endians.html |
05:27:25 | Varriount_ | ics: Those procs convert from host to target endianess |
05:28:14 | ics | Varriount_: I'm looking at the source, but very new to Nim and I guess having trouble with how to call it |
05:28:37 | Varriount_ | ics: Can I see a larger block of your code? |
05:32:02 | ics | Varriount_: http://pastebin.com/ykLUqznf |
05:33:55 | * | ics is on day 2.5 of Nim |
05:37:26 | ics | With a line like this this.vs = addr(this.vs).bigEndian16(addr(this.vs)) I get this back: Error: expression 'bigEndian16(addr(this.vs), addr(this.vs))' has no type (or is ambiguous) |
05:37:31 | Varriount_ | ics: Is the source data little or big endian? |
05:37:41 | * | Varriount_ is now known as Varriount |
05:37:46 | ics | The first two bytes are big endian, the rest is little endian |
05:38:10 | ics | It's an old format from Mac OS 5 era |
05:38:41 | Varriount | ics: And the data is supposed to be read into..? I mean, you can't read the entire thing into the vc member. |
05:42:25 | ics | I [think I] want an object, i.e. something like var example = MPObject().load("./example_file") where I can then access its fields |
05:44:57 | Varriount | Do the first two bytes signify anything in particular? Are they a header or something, or just a marker? |
05:45:00 | ics | The data contains coordinate components (x1, ..., xn, y1, ..., yn, z1, ..., zn) and so I want two things: to read in the data in its original form, and to then have a method to transform and write that data to another format |
05:45:21 | ics | The first two bytes stored in vs are the length of data |
05:45:32 | ics | or len-1, don't remember |
05:46:59 | Varriount | ics: One moment. I have a solution, but this has also evolved into an addition for the endian module. It currently lacks in-place conversion. |
05:56:04 | ics | Varriount: Cool- so with the current module I see what I needed to do (cleaner maybe): http://pastebin.com/i1GqR78V |
05:56:34 | Varriount | ics: Yes, pretty much. |
05:56:55 | Varriount | ics: You can change the read operation to a readInt16 |
05:57:12 | Varriount | That's what a cshort is, if you look at the typedef. |
06:06:59 | * | brson joined #nim |
06:09:33 | ics | Varriount: this.vs = f.readInt16() works, is that the preferred way (setting to the variable)? |
06:10:33 | ics | And because readInt16 uses read() it advances the read position on the stream... I think I'm understanding this a bit. It certainly looks clearer than the discard readData ... ... |
06:10:36 | Varriount | ics: Yes. readData would be used when reading a stream into an array or sequence (read 50 bytes into an array denoted by pointer 'p') |
06:11:38 | Varriount | ics: And to prevent any headaches, if you need to take the address of a sequence so that you can read data into it via a pointer, use 'addr(mySeq[0])', *not* 'addr(mySeq)' |
06:12:24 | Varriount | same holds true for strings. Sequences and strings, being variable length, have their length and capacity at the beginning of the structure. |
06:13:31 | * | vendethiel joined #nim |
06:15:05 | ics | Ah okay, that's very good to know. Related, is seq the way to go here (as opposed to openarray, which I wrote first but didn't work)? |
06:16:20 | Varriount | Open arrays are for parameter/argument types only. They are a way for a procedure to accept arrays and sequences without code duplication. |
06:17:01 | Varriount | Sequences and strings are dynamically (re)allocated arrays with length & capacity headers. |
06:17:15 | * | endragor joined #nim |
06:17:46 | Varriount | Also, unlike arrays, sequences and strings are always normally allocated on the heap (barring optimizations for string literals) |
06:20:42 | Varriount | ics: Also, just a fair warning if you're doing optimizations, using streams is easier/more flexible, but less efficient (as streams are essentially function tables). |
06:21:29 | Varriount | I mean, it won't be slow, but if you're looking to squeeze every last bit of performance out of the operation, you'll need to use the basic file read procedures. |
06:22:03 | Varriount | Although, I do wonder if the processor wouldn't optimize out the function calls somehow... |
06:22:52 | * | yglukhov joined #nim |
06:23:15 | ics | Given the system these files were created on I think I'd need to be processing thousands with fully saturated data before it became an issue... |
06:23:25 | Varriount | ics: Probably. |
06:23:52 | ics | Though I am trying to learn Nim in part because my Python proof of concept was just a *tiny* bit slow just to exec from the shell |
06:24:09 | ics | That was my excuse anyway... |
06:24:31 | Varriount | ics: It will probably be faster than Python, if only because Python does quite a bit of work encoding everything. |
06:24:47 | * | lompik quit (Ping timeout: 264 seconds) |
06:25:20 | Varriount | ics: If you want real fun, try using memory mapped files. :D |
06:25:23 | * | zaquest joined #nim |
06:25:40 | Varriount | Hello zaquest |
06:25:51 | ics | I'm hoping that as I learn a bit more I can play around with actually generating new files from all sorts of random junk and then putting them back on the Mac Classic they came from. Fun! |
06:26:03 | zaquest | hello |
06:27:10 | * | yglukhov quit (Ping timeout: 245 seconds) |
06:27:42 | ics | Memory mapped files... *sees module...* maybe next weekend... |
06:33:02 | ics | Thanks Varriount, that was very helpful. Enough to keep the bits flowing a little longer. |
06:34:31 | * | vendethiel quit (Ping timeout: 245 seconds) |
06:38:26 | * | Jesin quit (Ping timeout: 240 seconds) |
06:47:04 | * | Jesin joined #nim |
06:49:40 | * | vendethiel joined #nim |
06:59:03 | * | krux02 quit (Quit: Verlassend) |
07:00:23 | * | gour joined #nim |
07:11:00 | * | vendethiel quit (Ping timeout: 248 seconds) |
07:16:07 | * | brson quit (Quit: leaving) |
07:20:01 | * | desophos_ joined #nim |
07:23:56 | * | desophos quit (Ping timeout: 252 seconds) |
07:24:59 | ThePythonicCow | Varriount wrote << as streams are essentially function tables >> |
07:25:57 | ThePythonicCow | If by "streams" you mean the stdio based routines, such as those that read from stdin, then the slowness is due to more than a function ptr table. |
07:26:45 | ThePythonicCow | It's also due to the additional data copy ... stdio does system call reads into its own buffers, and then copies out the characters, strings, whatever is asked for, into the caller's buffers |
07:27:40 | ThePythonicCow | Raw speed comes from avoiding copies, and further from avoiding any inefficient scanning, of the data. |
07:29:34 | ThePythonicCow | I was working inside Bell Labs, in the 1970's, on Unix and C, when stdio was introduced ... it's performance costs were controversial then, and still are in my mind. |
07:33:09 | ThePythonicCow | It's my impression, though I'm not an expert in the matter, that Perl has worked around this with its own high performance i/o independent of stdio, for default i/o ops. |
07:34:44 | ThePythonicCow | But other than that, the only escape for speed freaks is C code using read/write syscalls and minimal copying/scanning. |
07:37:18 | ThePythonicCow | I don't know Nim anywhere near well enough yet to have a reliable clue, but it seems on the surface that its natural structures, such as its strings (length plus nul term) will mandate at least one copy, and its memory management may reinforce that mandate. |
07:37:34 | Araq | ThePythonicCow: cool to have you around. too bad that Unix is the best you guys could come up with ;-) |
07:38:07 | ThePythonicCow | Ah ? ... what's wrong with Unix ? <grin> |
07:39:40 | Araq | the file hierarchy, the case sensitivity, the 'fork' system call, the security concept, the basic design ideas ... ;-) |
07:40:04 | ThePythonicCow | I doubt that Nim can do what Perl did, avoiding copes of most incoming data ... Perl is rather too fuzzy-wuzzy do whatever Larry Wall means, so can play games with its internal data representation |
07:40:27 | ThePythonicCow | Nim is too transparent (good!) as to its choice of data layout, memory management and such |
07:41:11 | ThePythonicCow | << file ... case ... fork ... security ... basic design >>.... all things I love about Unix/Linux ! |
07:41:22 | * | Demon_Fox quit (Ping timeout: 240 seconds) |
07:41:37 | ThePythonicCow | (which means that the next great generation of operating system will probably not come from my keyboard) |
07:44:55 | Araq | yes, it will come from mine. |
07:45:21 | ThePythonicCow | excellent ... I should screen shot this ... so I can brag that I knew you when ! |
07:45:52 | Araq | too bad I have much better things to do. but in 10 years ... who knows. |
07:46:14 | ThePythonicCow | good new O.S.'s are a young man's game ... better hurry up |
07:47:37 | ThePythonicCow | I don't have a good mapping of names to who does what around here ... are you the lead creator of Nim, or is my newbie ignorance about to embarrass me again? |
07:49:12 | Araq | yeah I'm that guy. |
07:50:07 | ThePythonicCow | cool language ... first one I've seen with the clean semantic power of Python (part of my screen name) and the speed of C (my most expert language) |
07:50:25 | ThePythonicCow | I just might have to change my screen name (of 15 years now) to "theNimCow" :) |
07:57:53 | Araq | thanks. |
08:06:26 | ThePythonicCow | My initial objective is to port a fancy backup program that I've been working on for many years to Nim plus lmdb ... lightning memory mapped database. |
08:07:14 | ThePythonicCow | I see where fowlmouth uploaded a straight c2nim of the lmdb.h header file to github last year ... but otherwise I have not noticed any interaction of Nim and lmdb yet. |
08:07:45 | ThePythonicCow | If someone reading this in the near future knows of more Nim + lmdb work, kindly let me know. |
08:09:20 | Araq | sure. I have a monetdb wrapper that I need to open source |
08:11:14 | Araq | see you later guys |
08:11:33 | ThePythonicCow | At first glance, just now, MonetDB is quite different than lmdb ... not what I would need |
08:11:43 | ThePythonicCow | Have a good day Araq - good to meet you here |
08:13:17 | ThePythonicCow | lmdb is a B+ memory mapped <key, value> store, not a table or relational dbms ... lmdb is an absolute speed freak |
08:14:25 | Varriount | ThePythonicCow: I meant streams as in the Nim module |
08:15:10 | ThePythonicCow | Are those streams implemented using stdio ... my first glance at the code just now suggests to me that they are |
08:15:24 | Varriount | Well, the file stream is. |
08:15:45 | ThePythonicCow | ah - there are other streams ? (newbie question, sorry) |
08:16:08 | Varriount | ThePythonicCow: Not in the module, however it provides an interface for others. |
08:16:31 | Varriount | You could have, for example, a 'RandomData' stream. |
08:16:45 | ThePythonicCow | ok - sorta makes sense |
08:17:05 | Varriount | The stream structure contains a bunch a procedure pointers to the underlying implementation routines. |
08:17:26 | ThePythonicCow | ok - that's what was meant by the function ptrs then |
08:17:32 | ThePythonicCow | ok - that's what was meant by the function ptrs then ? |
08:17:47 | Varriount | Yes. |
08:18:11 | Varriount | ThePythonicCow: http://nim-lang.org/docs/streams.html#StreamObj |
08:18:18 | * | vendethiel joined #nim |
08:18:55 | ThePythonicCow | so default Nim file i/o is done using function ptrs to a stream implementation using stdio ... yeah ... not going to get a speed freak excited :) |
08:19:21 | Varriount | ThePythonicCow: Well, that's not the default for IO, that's just a choice. |
08:19:38 | ThePythonicCow | ok |
08:19:53 | ThePythonicCow | I should shut up ... my typing is getting ahead of my cluefulness |
08:19:58 | Varriount | http://nim-lang.org/docs/system.html#readBytes,File,openArray[],Natural,Natural |
08:20:19 | Varriount | Eh, be careful of that URL, it might not open correctly. |
08:21:37 | Varriount | ThePythonicCow: Essentially, the builtin file routines use the underlying stdio procedures. |
08:21:59 | ThePythonicCow | URL opened ok for me (Firefox on Linux). |
08:22:16 | ThePythonicCow | Those links go into the docs further down that I've read so far ... lots to learn |
08:22:44 | Varriount | ThePythonicCow: Don't try memorizing system.nim, or else your head will explode. |
08:24:03 | ThePythonicCow | No problem ... I'll keep tinkering with it, as I have many languages in the past ... until I either get good at it, or get interested in something else |
08:24:18 | * | yglukhov joined #nim |
08:26:10 | Varriount | Araq: Can intrinsic functions be imported, or must the emit pragma be used? |
08:26:23 | Varriount | Er, by import, I mean importc |
08:28:41 | * | yglukhov quit (Ping timeout: 245 seconds) |
08:30:05 | ThePythonicCow | Wouldn't intrinsic functions be handled by Nim as if they were just another C routine ... and then let the C compiler realize it can inline that code? |
08:30:24 | Varriount | ThePythonicCow: Probably? |
08:30:34 | ThePythonicCow | :) |
08:40:22 | * | dashed quit (Quit: Connection closed for inactivity) |
08:42:01 | Varriount | ThePythonicCow: Ah, the importc and nodecl pragmas seem to work. |
08:42:52 | ThePythonicCow | good - someday I will understand what you just wrote :) |
08:43:08 | Varriount | importc replaces use of the Nim procedure with the imported C identifier, and nodecl prevents Nim from generating a prototype in the C file. |
08:47:43 | ThePythonicCow | ah "no-decl", not "node-cl" - ok |
08:49:29 | Varriount | ThePythonicCow: I'm trying to make use of GCC & Clang's builting byte swapping routines. |
08:56:59 | ThePythonicCow | ok |
08:58:17 | * | darkf joined #nim |
09:03:49 | * | Varriount quit (Disconnected by services) |
09:03:49 | * | Varriount_ joined #nim |
09:06:45 | dom96 | hey ThePythonicCow, thank you for buying Nim in Action and for all the feedback you've given :) |
09:09:01 | ThePythonicCow | You're welcome - - damn good book -- just 45% of the way through -- good read and informative |
09:09:34 | * | vendethiel quit (Ping timeout: 250 seconds) |
09:10:14 | dom96 | Glad you're enjoying it :) |
09:29:21 | * | desophos__ joined #nim |
09:32:42 | * | desophos_ quit (Ping timeout: 256 seconds) |
09:37:45 | * | irrequietus joined #nim |
09:40:42 | * | vendethiel joined #nim |
09:46:12 | * | irrequietus quit (Remote host closed the connection) |
09:47:05 | * | irrequietus joined #nim |
09:49:20 | * | yglukhov joined #nim |
09:53:45 | * | yglukhov quit (Ping timeout: 240 seconds) |
09:59:24 | * | desophos__ quit (Read error: Connection reset by peer) |
10:03:18 | * | vendethiel quit (Ping timeout: 256 seconds) |
10:05:21 | * | vendethiel joined #nim |
10:13:53 | * | sheerun joined #nim |
10:14:35 | * | lg_ quit (Ping timeout: 264 seconds) |
10:23:04 | * | irrequietus quit (Remote host closed the connection) |
10:26:31 | * | irrequietus joined #nim |
10:28:25 | * | vendethiel quit (Ping timeout: 245 seconds) |
10:35:05 | * | ephja joined #nim |
10:38:00 | * | filcuc joined #nim |
10:38:19 | * | vendethiel joined #nim |
10:38:54 | filcuc | what is the correct way for passing the pointer to the first element of a seq to C |
10:39:21 | * | gokr joined #nim |
10:39:30 | filcuc | let a: seq[int] | let b: pointer = a[0].addr |
10:39:59 | filcuc | gives me "expression has no address" |
10:50:29 | ephja | in case of 'let', use unsafeAddr |
10:50:36 | ephja | if it's not to be modified of course |
10:50:56 | * | Matthias247 joined #nim |
10:51:01 | filcuc | no just to be read |
10:51:12 | filcuc | from C |
10:52:46 | ephja | just replace addr with unsafeAddr then. it should work |
10:55:32 | filcuc | :| no same error |
10:56:30 | filcuc | let b = a[0].unsafeAddr |
10:56:52 | filcuc | gives me again "Error: expression has no address" |
10:56:55 | ephja | how old is your version? an unsafeAddr bug was fixed recently |
10:57:13 | ephja | 18 days ago |
10:57:31 | ephja | no that's when the issue was opened. I meant 7 days ago |
10:58:04 | filcuc | hash: 732479b797422adaadf6891b8d8c32230f548692 |
10:58:40 | filcuc | ephja: ok for safety i'll rebuild everything with today master branch |
11:01:06 | * | vendethiel quit (Ping timeout: 256 seconds) |
11:01:16 | filcuc | ephja: yes i checked the git log and i don't have the fix for https://github.com/nim-lang/Nim/issues/3736 |
11:09:36 | filcuc | no same error with latest devel |
11:10:37 | filcuc | pastebin.com/dWJVFg2e |
11:10:49 | filcuc | the error comes from line 44 |
11:18:23 | ephja | filcuc: is it compatible with the latest revision for DOtherSide on github? |
11:19:14 | ephja | I guess not. I don't see a nim module |
11:20:35 | filcuc | ephja: the nim module has been moved to nimqml |
11:20:58 | filcuc | ephja: the dotherside it's just the C library |
11:21:47 | filcuc | ephja: right now i'm working on a separate branch (objectFactories) in the nimqml repo |
11:22:31 | filcuc | ephja: for updating the bindings for the upcoming changes made in the dotherside library |
11:24:04 | * | jaco60 joined #nim |
11:24:33 | * | vendethiel joined #nim |
11:24:40 | ephja | ok. share the dotherside module and I'll test your code |
11:26:23 | * | endragor quit (Remote host closed the connection) |
11:29:14 | filcuc | ephja: just git clone the nimqml objectfactories branch |
11:29:43 | filcuc | ephja: https://github.com/filcuc/nimqml.git |
11:30:00 | filcuc | ephja: git clone https://github.com/filcuc/nimqml.git && cd nimqml && git checkout ObjectFactories |
11:30:24 | ephja | I was trying it with nimble. I used the wrong case |
11:31:59 | filcuc | ephja: for correctly compile you'll need also to build the dotherside library..but it's needed for the linking phase and but right now the error i have comes from the compile time phase |
11:33:19 | filcuc | for testing (one you clone) go to the examples/helloworld directory and type nim c --path:../../src main.nim |
11:33:30 | filcuc | *once* |
11:36:17 | * | gokr quit (Quit: Leaving.) |
11:37:53 | ephja | filcuc: it does seem like a bug to me |
11:38:44 | ephja | but you could loop over the indices instead, and then do signalDefinitions[i].parametersTypes[0].unsafeAddr |
11:39:40 | filcuc | ephja: ok i'll try that, thank you ;) |
11:40:33 | ephja | I would personally rename it to 'parameterTypes', or perhaps just 'parameters' |
11:43:54 | filcuc | ephja: yep probably but that it syntactic sugar..i've a lot of more work to do :) basically i've to rework all the QObject macro... |
11:44:28 | filcuc | ephja: so right now the renaming it's not on the top of my todo list :) |
11:44:55 | * | vendethiel quit (Ping timeout: 276 seconds) |
11:44:57 | filcuc | ephja: given also the user shouldn't create a qmetaobject manually...it should be created by a macro at compile time |
11:50:46 | * | yglukhov joined #nim |
11:55:45 | * | yglukhov quit (Ping timeout: 240 seconds) |
12:00:48 | * | skyfex joined #nim |
12:01:03 | ephja | Araq: should it be possible to apply unsafeAddr to non-var loop symbols? (for x in [1]: discard x.unsafeAddr) |
12:01:10 | * | wuehlmaus joined #nim |
12:02:41 | * | junw joined #nim |
12:03:11 | filcuc | ephja: i'll fill an issue |
12:04:42 | Araq | ephja: doesn't this work already with devel? |
12:04:59 | Araq | I recently improved unsafeAddr |
12:05:01 | filcuc | ephja: Araq: to be honest if i think about it i can see that it's not a safe thing to do..i mean, if i think in C++ this should work iff the loop variable is a reference |
12:05:23 | filcuc | so for (const auto& ref : container) or (auto& ref : container) |
12:05:29 | Araq | well it's called unsafeAddr ... |
12:05:44 | Araq | so any safety regards are pointless |
12:06:01 | filcuc | Araq: yes i agree but i'm saying a different thing |
12:06:36 | filcuc | i mean that i don't know if writing " for x in sequence" means that x is reference or a copy |
12:07:36 | * | vendethiel joined #nim |
12:07:37 | filcuc | so in turn i don't know if doing " let c = x.unsafeAddr " is taking the address inside the sequence or of the copy |
12:08:04 | Araq | yeah well it seems like you need to learn about 'mitems' |
12:08:14 | filcuc | probably |
12:08:25 | filcuc | :) |
12:08:55 | ephja | the sequence is immutable though |
12:09:41 | ephja | Araq: well, I use a revision that is about 2 days old. you did fix another bug that I discovered. reporting it |
12:09:59 | filcuc | Araq: this is a test case http://pastebin.com/Bz7K1hci |
12:10:25 | filcuc | if you think that it's a bug i'll create an issue of github |
12:10:33 | filcuc | in |
12:15:17 | ephja | filcuc: does qml cut down on the development time? gtk et al have gobject interfaces which allows for automatic generation of bindings |
12:15:31 | ephja | anyway, I'm looking forward to it, as are many others I'm sure |
12:16:28 | ephja | though gtk isn't so bad, but a lot of people are upset with the state of gtk |
12:19:50 | filcuc | ephja: it' a matter of being proficient in a technology. I'm biased because i love Qt. But basically Qml it's like XAML done right (if you know MS techs) |
12:20:37 | filcuc | ephja: the idea is to create databound applications. So the qml layer (visual) basically just pull data from the backend. |
12:21:44 | filcuc | ephja: but UI it's a hot topic and to be honest you should take your own poison |
12:22:11 | filcuc | be it gtk, wxwidgets, web techs or whatever |
12:24:18 | arnetheduck | Varriount_, had a chance to look at those exceptions? |
12:24:31 | filcuc | Araq: if i cannot use mitems(myseq) since myseq it's a proc parameter..should i "var copymyseq = myseq" ? |
12:25:52 | Araq | filcuc: well if it's immutable maybe you shouldn't try to mutate it ;-) |
12:26:13 | Araq | you can use a 'var' parameter to make it mutable |
12:26:17 | filcuc | ephja: i'll write in the forum when the next release comes out |
12:26:31 | Araq | but if you're just doing it for speed, don't. It usually is not necessary |
12:26:55 | filcuc | Araq: i don't want to mutate it, but i would like the loop variable to be a reference to the element not a copy. With mitems() i think that basically i'm forcing it to be a reference |
12:27:09 | filcuc | correct? |
12:27:37 | Araq | correct. |
12:28:41 | filcuc | Araq: i don't know if you looked at the last pastebin i posted. Basically i want to iterate over a sequence and store the addresses of its elements |
12:28:52 | ephja | but you can't pass in a let anyway |
12:29:33 | ephja | var goes in, var goes out (of mitems, typically) |
12:29:39 | filcuc | Araq: and right know i'm facing the "Error: expression has no address" |
12:30:04 | * | vendethiel quit (Ping timeout: 256 seconds) |
12:30:10 | filcuc | ephja: infact i asked if i've to workaround it by " var copy = myseq" |
12:30:23 | arnetheduck | Araq, ran into something - when a variable is declared local (no *), it should in theory not be accessed by other modules directly, so in most cases it could be made private (static global), and yet, if an iterator accesses it, the name will be used in other modules as well, so they have to import it with extern, and all seemingly private vars have to be exported from each module, just in case.. an example is environment in system - it's private to |
12:30:24 | arnetheduck | the os module but osproc uses an exported iterator (envpairs) and thus in the c code, environment is accessed through an extern.. any thoughts on this? |
12:30:37 | filcuc | brb |
12:32:01 | arnetheduck | keeping it private would make it easier to optimize, but also lessen inter-module deps which opens the door for smarter recompiles |
12:32:34 | ephja | filcuc: is it going to be type safe? |
12:33:56 | Araq | arnetheduck: you're describing the effects of inlining. |
12:34:27 | Araq | the solution is to not rely on such petty optimizations and embrace link time optimizations. |
12:34:38 | Araq | which LLVM supports too. |
12:34:50 | filcuc | ephja: what? |
12:35:21 | arnetheduck | yeah, it could be solved with LTO, but it's also kind of wasteful.. just wondering if there's some way to tell from the ast what belongs in which module.. |
12:35:36 | arnetheduck | else, it kind of doesn't make sense to gen all those .c files, might as well just do a huge one |
12:36:36 | ephja | filcuc: is the library going to be type safe? as in no untyped pointers and such that might cause segfaults and so on |
12:39:16 | arnetheduck | anyway, just wanted to check if this behavior is a feature or not ;) |
12:39:33 | Araq | arnetheduck: it does make sense since only the .c files that change need to be recompiled |
12:39:58 | * | dv- quit (Remote host closed the connection) |
12:40:13 | Araq | LTO is not wasteful, it's the only thing that makes sense to begin with. |
12:40:24 | arnetheduck | .. except you compile them all again if you want to apply lto |
12:40:51 | Araq | optimizers should not be handicapped by the linking technology of the 70ies. |
12:43:16 | ephja | amen |
12:43:23 | Araq | and no, you don't have to "compile them all again" for LTO. |
12:43:39 | * | skyfex quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
12:49:00 | arnetheduck | well, kind of... you take all ir and rerun optimization and machine code generation.. you get to skip some parsing, but.. |
12:57:45 | * | junw quit (Ping timeout: 240 seconds) |
13:00:07 | filcuc | filcuc: i tried my best to do that. So yes. But as a side note, QML has internally a JS engine and so it's not a static language. But you should not need to use JS except for simple property bindings |
13:01:57 | ephja | ok. I assume you were referring to me :p |
13:05:07 | * | vendethiel joined #nim |
13:08:33 | ephja | Araq: did we have a tool for deprecating old type names? |
13:22:07 | * | FreezerburnV joined #nim |
13:22:34 | * | yglukhov joined #nim |
13:22:55 | ephja | nevermind |
13:26:56 | * | vendethiel quit (Ping timeout: 250 seconds) |
13:27:32 | * | gokr joined #nim |
13:33:36 | * | gokr quit (Quit: Leaving.) |
13:43:36 | * | yglukhov quit (Remote host closed the connection) |
14:06:47 | * | vendethiel joined #nim |
14:08:23 | * | yglukhov joined #nim |
14:09:08 | * | lompik joined #nim |
14:21:24 | * | yglukhov quit (Remote host closed the connection) |
14:22:05 | * | yglukhov joined #nim |
14:28:54 | * | vendethiel quit (Ping timeout: 252 seconds) |
14:28:55 | filcuc | ephja: yep sorry, :) |
14:40:35 | ephja | is borrow with 'var' parameters broken? |
14:40:53 | * | vendethiel joined #nim |
14:41:49 | Araq | ephja: possible. |
14:43:58 | ephja | it has been reported already |
14:44:05 | Araq | no |
14:44:58 | ephja | this seems relevant https://github.com/nim-lang/Nim/issues/3082 |
14:45:16 | ephja | I meant by someone else, several months ago |
14:45:45 | * | yglukhov quit (Remote host closed the connection) |
14:47:52 | * | sheerun quit () |
14:49:41 | Araq | ok, so now that's been reported, fix it. |
14:51:00 | ephja | I get lost whenever I try to fix anything |
14:52:59 | ephja | though I didn't know about ?? before |
15:00:16 | ephja | no, that bug is slightly different |
15:06:28 | filcuc | is it more idiomatic to usa newFoo() or a Foo.new |
15:06:32 | filcuc | ? |
15:06:38 | filcuc | *use* |
15:13:30 | * | junw joined #nim |
15:16:26 | Araq | filcuc: newFoo |
15:19:41 | * | Matthias247 quit (Read error: Connection reset by peer) |
15:23:35 | ephja | Araq: https://github.com/nim-lang/Nim/issues/3832. where do I look? in sigmatch or somewhere else? |
15:24:14 | ephja | I should also try to step through the code this time |
15:26:26 | * | vendethiel quit (Ping timeout: 272 seconds) |
15:26:27 | Araq | nimgrep -y sfBorrow --ext:nim compiler |
15:26:45 | Araq | compiler/semstmts.nim |
15:26:45 | Araq | 1203: if sfBorrow in s.flags: |
15:26:45 | Araq | 1233: if {sfImportc, sfBorrow} * s.flags == {} and s.magic == mNone: |
15:26:47 | Araq | 1235: elif sfBorrow in s.flags: semBorrow(c, n, s) |
15:28:45 | Araq | semcall.nim searchForBorrowProc |
15:29:09 | Araq | and it's immediately obvious why 'var' causes problem |
15:29:11 | Araq | s |
15:30:07 | Araq | # New approach: generate fn(x, y, z) where x, y, z have the proper types |
15:30:07 | Araq | # and use the overloading resolution mechanism: |
15:30:20 | Araq | call.add(newNodeIT(nkEmpty, fn.info, t.baseOfDistinct)) |
15:30:27 | * | jaco60 quit (Quit: Leaving) |
15:30:32 | Araq | but empty nodes are not L-values and so the code fails |
15:30:47 | Araq | pretty easy, no need to trace anything. |
15:30:48 | * | jaco60 joined #nim |
15:32:25 | * | sheerun joined #nim |
15:32:53 | Araq | you could generate a dummy 'var' for that or you change the compiler that empty is a valid L-value |
15:37:06 | * | niv quit (Ping timeout: 240 seconds) |
15:37:55 | * | vendethiel joined #nim |
15:39:34 | ephja | ok |
15:40:26 | * | arnetheduck quit (Ping timeout: 250 seconds) |
15:41:15 | * | sheerun quit (Ping timeout: 240 seconds) |
15:50:17 | * | yglukhov joined #nim |
15:53:02 | filcuc | Araq: is it better to use an object or a tuple for mapping a C struct |
15:53:06 | filcuc | ? |
15:53:18 | filcuc | right now i'm using a object that doesn't derive from RootObj |
15:54:48 | * | derka joined #nim |
15:59:35 | * | vendethiel quit (Ping timeout: 264 seconds) |
15:59:54 | * | Trustable joined #nim |
16:02:14 | ephja | "tyVar(tyDistinct T(tyInt int))", and hasDistinct remains false |
16:02:44 | ephja | maybe I'll actually learn something this time. I'll continue later |
16:03:55 | * | vendethiel joined #nim |
16:11:35 | * | yglukhov quit (Remote host closed the connection) |
16:21:08 | * | skyfex joined #nim |
16:34:59 | * | irrequietus quit (Ping timeout: 264 seconds) |
16:44:06 | * | derka quit (Ping timeout: 245 seconds) |
16:45:42 | * | derka joined #nim |
16:47:16 | * | Trustable quit (Remote host closed the connection) |
16:53:26 | * | Jesin quit (Quit: Leaving) |
16:57:25 | * | irrequietus joined #nim |
17:06:59 | * | skyfex quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
17:22:06 | filcuc | is there a Nim beautifier? |
17:25:04 | Araq | nimfix but its not used anymore |
17:35:56 | * | gour quit (Quit: WeeChat 1.3) |
17:43:12 | * | derka quit (Quit: derka) |
17:54:41 | * | gour joined #nim |
17:55:40 | * | derka joined #nim |
17:55:45 | * | derka quit (Client Quit) |
18:05:21 | ephja | Araq: a dummy var passed to 'call'? would empty as an L-value allow procs to accept 'empty' too? what about set[empty]? |
18:05:55 | ephja | what should I use instead of 'debug'? |
18:07:22 | Araq | echo tree works too |
18:07:28 | ephja | right |
18:07:55 | * | Matthias247 joined #nim |
18:09:59 | * | derka joined #nim |
18:12:14 | * | yglukhov joined #nim |
18:14:31 | filcuc | is there a page in the manual where the return value of a proc is explained? |
18:14:54 | * | derka quit (Quit: derka) |
18:14:56 | filcuc | how does: proc foo(): int = 0 work? |
18:15:18 | filcuc | why we can directly 0 without using the implicit result variable? |
18:15:52 | filcuc | i mean..i see three choices: return 0 | 0 | result = 0 |
18:16:13 | bbl_ | filcuc: if it's possible, why not? |
18:16:39 | filcuc | bbl_: no problem for me i just didn't know that using directly '0' return that value |
18:16:45 | ephja | yes, but only if it's the last statement |
18:17:04 | filcuc | so the last expression is also the proc return value? |
18:17:18 | bbl_ | many langauges have that feature |
18:17:18 | ephja | otherwise you have to either discard it or explicitly assign the value to a variable |
18:17:23 | ephja | filcuc: it might be |
18:17:34 | filcuc | bbl_: yep i'm not complaing |
18:17:54 | filcuc | i didn't read it in the manual |
18:18:08 | filcuc | so i was not sure about that..maybe it could work we just one single expression |
18:18:11 | ephja | well, if it's the last expression in the proc block, then yes. 'if' can also be used as an expression: "let x = if true: 1 else: 2" |
18:18:17 | filcuc | and not with multiple statements |
18:18:35 | filcuc | fine thanks ;) |
18:18:58 | ephja | right |
18:20:03 | ephja | "let x = if true: (echo 1; 1) else: 2" |
18:20:07 | * | irrequietus quit () |
18:20:31 | ephja | works with 'block' too but it's a little ugly atm because it must be surrounded by parentheses |
18:21:00 | * | junw quit (Read error: Connection reset by peer) |
18:21:05 | * | junw_ joined #nim |
18:21:17 | ephja | unlike 'if' expressions |
18:26:43 | Araq | ephja: want my fix or do you like to fix it on your own? |
18:29:42 | bbl_ | That's nice :P certainly less verbose than using lambdas in C++ to do the same |
18:32:14 | filcuc | if i've a distinct type Foo = distinct pointer |
18:32:43 | filcuc | is there a simpler way for nulling it istead of let f: Foo = nil.pointer.Foo |
18:33:03 | filcuc | (without writing a ad hoc proc) |
18:33:33 | filcuc | i mean maybe by borrowing some operator |
18:35:32 | Araq | filcuc: usually you define a NilFoo constant |
18:35:57 | Araq | and of course it's initialized to null implicitly for you anyway |
18:36:32 | * | derka joined #nim |
18:36:52 | filcuc | ok |
18:40:12 | * | Demon_Fox joined #nim |
18:41:15 | * | derka quit (Ping timeout: 260 seconds) |
18:44:49 | ephja | Araq: your fix I guess |
18:45:23 | Araq | ephja: sorry, I just noticed my fix doesn't work for every case. :-) |
18:47:23 | * | derka joined #nim |
18:48:45 | * | derka quit (Client Quit) |
18:49:02 | * | derka joined #nim |
18:53:54 | * | derka quit (Client Quit) |
18:53:54 | * | yglukhov quit (Read error: Connection reset by peer) |
18:54:13 | * | yglukhov joined #nim |
18:55:08 | * | Jesin joined #nim |
18:57:03 | ephja | I guess I'll look for something even simpler and read commits |
18:57:03 | * | yglukhov quit (Read error: Connection reset by peer) |
18:59:18 | * | yglukhov joined #nim |
19:02:25 | * | derka joined #nim |
19:02:45 | ephja | Araq: can I print the stack trace related to a specific line in a file? just before the next statement is processed |
19:03:02 | * | wh1t3r0s3 quit (Ping timeout: 276 seconds) |
19:03:32 | * | wh1t3r0s3 joined #nim |
19:10:02 | * | sinnyt joined #nim |
19:10:36 | * | sinnyt left #nim ("Good Bye") |
19:11:11 | * | derka quit (Quit: derka) |
19:11:46 | * | derka joined #nim |
19:18:13 | * | yglukhov_ joined #nim |
19:18:13 | * | yglukhov quit (Read error: Connection reset by peer) |
19:20:29 | * | yglukhov joined #nim |
19:20:30 | * | yglukhov_ quit (Read error: Connection reset by peer) |
19:21:56 | Araq | you sound confused |
19:22:13 | Araq | what would a stack trace related to a specific file mean? |
19:22:25 | * | brson joined #nim |
19:22:28 | Araq | if n.info ?? "temp": writeStackTrace() |
19:22:33 | Araq | is certainly possible |
19:32:03 | * | derka quit (Quit: derka) |
19:34:09 | bbl_ | https://github.com/baabelfish/nvim-nim if any vim users are interested to check this out, still really a work in progress but I'll get the first usable version out soon |
19:34:41 | def- | bbl_: ooh, very exciting! |
19:34:49 | bbl_ | def-: thanks |
19:35:59 | def- | you're aware of the other vim plugin I guess. really looking forward to the nimsuggest integration |
19:36:12 | bbl_ | def-: yeah, I forked it some time ago even |
19:37:10 | bbl_ | This is/was a learning experience in vimscript and nim tooling so I did it from scratch |
19:37:48 | * | M-max quit (Remote host closed the connection) |
19:37:51 | bbl_ | def-: you using vim? |
19:40:30 | * | yglukhov_ joined #nim |
19:40:30 | * | yglukhov quit (Read error: Connection reset by peer) |
19:40:41 | bbl_ | Araq: I got a few requests for nimsuggest: it would be nice for the for loop variables (on line 21 && 22 in the picture in that repo) to get the skForVar with nimsuggest highlight and it would be really great if outline returned also the imported modules |
19:41:31 | bbl_ | Should I add them to github? |
19:43:58 | * | Demon_Fox quit (Quit: Leaving) |
19:46:42 | * | yglukhov joined #nim |
19:46:43 | * | yglukhov_ quit (Read error: Connection reset by peer) |
19:48:57 | * | yglukhov quit (Read error: Connection reset by peer) |
19:56:48 | * | yglukhov joined #nim |
20:02:10 | * | yglukhov quit (Read error: Connection reset by peer) |
20:02:24 | Araq | yeah please and be a bit more specific cause I don't really know what you mean |
20:03:47 | * | Trustable joined #nim |
20:06:49 | * | pregressive joined #nim |
20:06:51 | * | yglukhov joined #nim |
20:09:38 | gour | anyone subscribed to nim-dev list can confirm it's in sync with the forum? i'm missing several posts since today afternoon... |
20:09:44 | * | yglukhov quit (Read error: Connection reset by peer) |
20:16:58 | * | yglukhov joined #nim |
20:17:01 | * | yglukhov quit (Remote host closed the connection) |
20:17:33 | federico3 | gour: your email addr? |
20:18:12 | gour | gour at atmarama dot com |
20:18:45 | federico3 | you show up subscribed 8 days ago and no bounces |
20:19:31 | gour | hmm...maybe it's some gray listing by the server... |
20:19:49 | ldlework | Has anyone written a nice FSM? |
20:20:07 | * | nsf quit (Quit: WeeChat 1.3) |
20:22:22 | * | nsf joined #nim |
20:33:18 | * | yglukhov joined #nim |
20:35:19 | ldlework | How do I test for procs on a type in a concept? |
20:36:21 | ldlework | oh I see |
20:42:24 | ldlework | FSM is really easy to implement with methods |
20:42:33 | ldlework | I was wracking my brain on how to do it with concepts. |
20:43:37 | * | Jesin quit (Read error: error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number) |
20:43:50 | ldlework | actually methods don't help much because the module that manipulates the states will still need to have imported the methods belonging to the state objects passed into it |
20:44:04 | * | Jesin joined #nim |
20:44:15 | ldlework | Its like the only way to do it with a nice interface is to pass in a structure that has procvar fields |
20:45:00 | ldlework | crazy module system |
20:45:17 | ldlework | well I guess not |
20:47:07 | * | derka joined #nim |
20:47:21 | ldlework | hi derka |
20:47:32 | derka | idlework hi how are you doing |
20:48:04 | ldlework | good, just hacking on my game engine |
20:48:12 | ldlework | trying to figure out a good way to do scene management |
20:49:08 | derka | idlework c |
20:49:20 | derka | idlework good luck dont know about scene management |
20:49:43 | * | yglukhov quit (Remote host closed the connection) |
20:49:52 | * | Jesin quit (Ping timeout: 256 seconds) |
20:51:30 | * | derka quit (Client Quit) |
20:52:16 | * | yglukhov joined #nim |
20:52:39 | * | filwit joined #nim |
21:02:09 | ldlework | I'm terrified of using methods :3 |
21:04:17 | * | gour quit (Quit: WeeChat 1.4) |
21:09:58 | * | k1io quit (Quit: Connection closed for inactivity) |
21:24:45 | * | M-max joined #nim |
21:24:46 | M-max | qq: does nim have unary suffix operators? |
21:25:01 | M-max | I know I can write an operator that handles +foo, but can I write one that handles foo+ ? |
21:26:14 | * | Jesin joined #nim |
21:33:09 | * | yglukhov quit (Remote host closed the connection) |
21:33:32 | filwit | M-max: no |
21:33:55 | filwit | you have to write: foo += 1 |
21:34:16 | * | yglukhov joined #nim |
21:34:17 | filwit | (type of thing) |
21:34:19 | M-max | ah, but I'm trying to implement a parser combinator |
21:34:27 | M-max | so I want foo+ to imply at least one foo |
21:34:55 | M-max | it's not the end of the world, as I can just flip so that +foo has the same meaning, it's just slightly less elegant |
21:35:32 | M-max | i.e. +foo transforms foo (a matching rule) into a rule that uses foo to match at least one time |
21:36:34 | filwit | you could always do something like: foo+0 which would allow you to specify a min/max count (with '0' acting as an 'infinite') |
21:36:39 | filwit | but anyways... |
21:38:02 | M-max | yes, I was just thinking that would be one way to do it |
21:42:37 | * | pregressive quit (Remote host closed the connection) |
21:45:24 | Araq | pegs uses prefix ops |
21:46:27 | Araq | which become natural soon enough, after all if math decided to use postfix or prefix is totally arbitrary anyway |
21:46:38 | Araq | *whether |
21:47:53 | * | Jesin quit (Quit: Leaving) |
21:50:16 | ephja | M-max: https://github.com/fowlmouth/glossolalia |
21:50:49 | ephja | it's neat |
21:51:12 | * | mat4 joined #nim |
21:51:17 | mat4 | hello |
21:52:11 | M-max | wow: looks impressive! |
21:52:27 | M-max | although the examples look pretty complex |
21:53:40 | M-max | for now I'm just trying to teach myself parsers (and nim), and trying to get something that implements something pretty close to pegs, but gives me an AST |
21:54:24 | ephja | it is a little difficult to learn |
21:55:29 | * | pregressive joined #nim |
22:06:12 | * | yglukhov quit (Remote host closed the connection) |
22:06:16 | * | TheManiac joined #nim |
22:07:55 | * | yglukhov joined #nim |
22:12:09 | * | yglukhov quit (Ping timeout: 240 seconds) |
22:18:11 | * | Demon_Fox joined #nim |
22:28:08 | * | T_ joined #nim |
22:31:36 | * | lompik quit (Quit: WeeChat 1.3) |
22:32:25 | ldlework | I have a parent class `Foo = ref object of RootObj` and then I have a class `Bar = ref object of Foo`. I have a function that takes a Foo, and calls a multimethod on it. When I pass it a Bar, the multi-method for Foo is called, not Bar. |
22:32:28 | ldlework | What gives? |
22:32:36 | * | T_ quit (Ping timeout: 252 seconds) |
22:36:55 | * | derka joined #nim |
22:38:33 | ldlework | I thought that it was supposed to use dynamic dispatch |
22:38:51 | ldlework | but it doesn't seem to know about the Bar.method |
22:42:49 | Araq | dunno, usually it does that :P |
22:43:12 | ldlework | Araq: Does Bar.method have to be imported where Bar.method is being called? |
22:43:21 | Araq | no. |
22:43:50 | * | Trustable quit (Ping timeout: 245 seconds) |
22:44:29 | * | Trustable joined #nim |
22:45:33 | * | pregressive quit (Remote host closed the connection) |
22:48:38 | * | darkf quit (Quit: Leaving) |
22:48:47 | ldlework | :( |
22:49:37 | ldlework | As soon as I pass this `ref object of Scene` GameScene object to a method that takes Scene (which is defined as `ref object of RootObj`) then calling any method on the GameScene object invokes the base Scene implementation. |
22:50:25 | ldlework | calling any multi-method that is |
22:51:56 | ldlework | adding the .base pragma did not help |
22:52:58 | ldlework | calling the method on the object before passing it to the proc that takes the base-type calls the right sub-type implementation |
22:53:05 | ldlework | shouldn't this work since they are all reftypes? |
22:54:30 | mat4 | I have an object with a member variable fInit which indicated the invocation of an initialisation routine. For all dependent procs these flag is tested (assert). Exist there another way to check if initialisation was done ? |
22:54:46 | ldlework | oh god |
22:58:07 | mat4 | does Nim support contract programming ? |
23:00:52 | mat4 | I've only found these pragma: '.requiresInit.' |
23:01:32 | * | euantor joined #nim |
23:03:03 | mat4 | but it's unclear to me how the described, explicit initialisation is checked |
23:03:48 | mat4 | or better ensured at compile time |
23:08:47 | * | shodan45 joined #nim |
23:09:41 | * | yglukhov joined #nim |
23:11:54 | * | cY63rJUnkY joined #nim |
23:13:55 | * | cY63rJUnkY left #nim (#nim) |
23:14:57 | * | yglukhov quit (Ping timeout: 240 seconds) |
23:24:01 | * | mat4 quit (Quit: Verlassend) |
23:35:31 | * | derka quit (Quit: derka) |
23:36:49 | * | Jesin joined #nim |
23:37:09 | * | desophos joined #nim |
23:47:21 | * | euantor quit () |