00:09:05 | * | Jesin quit (Quit: Leaving) |
00:09:41 | * | JoshuaT quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
00:10:03 | * | arnetheduck joined #nim |
00:12:53 | filwit | so nimsuggest is now separate from the compiler repo? |
00:14:32 | filwit | no nevermind, looks like the the nim-lang repo is dated |
00:29:29 | * | wb quit (Ping timeout: 250 seconds) |
00:31:54 | ddsaaaaaaaaf | cant wait for visual studio code to get nim language support, to replace sublime text |
00:35:14 | * | jholland quit (Quit: Connection closed for inactivity) |
00:47:11 | * | Jesin joined #nim |
01:06:45 | * | datanoise quit (Ping timeout: 272 seconds) |
01:08:46 | * | ddsaaaaaaaaf quit (Quit: Page closed) |
01:18:07 | * | fffffff joined #nim |
01:18:38 | * | fffffff quit (Client Quit) |
01:18:57 | * | ZZZZZZZZZ joined #nim |
01:19:09 | * | filwit quit (Quit: Leaving) |
01:19:51 | renesac | ZZZZZZZZZ: you are following this project: http://forum.nim-lang.org/t/1107/1 |
01:19:51 | renesac | ? |
01:20:33 | ZZZZZZZZZ | nope, but it looks like its for visual studio |
01:20:49 | ZZZZZZZZZ | and not for visual studio code |
01:21:11 | ZZZZZZZZZ | visual studio code still doesnt support plugin etc |
01:21:57 | ZZZZZZZZZ | https://code.visualstudio.com/ if you havent seen it |
01:23:28 | renesac | oh, didn't know about it |
01:23:41 | ZZZZZZZZZ | its basically sublime text but by microsoft :D |
01:49:32 | * | filwit joined #nim |
01:53:03 | * | darkf joined #nim |
01:53:42 | * | datanoise joined #nim |
01:58:46 | * | flaviu quit (Remote host closed the connection) |
02:07:15 | * | gsingh93 joined #nim |
03:00:57 | * | dddddd quit (Ping timeout: 240 seconds) |
03:05:46 | * | zahary quit (Read error: Connection reset by peer) |
03:06:05 | * | zahary joined #nim |
03:07:44 | * | kz joined #nim |
03:08:29 | kz | Hi. I am trying to play with asyncnet and asyncdispatch and the 'await' keyword is not recognized |
03:08:33 | kz | Error: undeclared identifier: 'await' |
03:08:49 | kz | Nim version is 0.11.2 |
03:09:08 | kz | any idea ? |
03:11:06 | notfowl- | Await doesn't exist, its scanned for in {.async} procs |
03:15:48 | * | TEttinger quit (Ping timeout: 272 seconds) |
03:16:50 | kz | do I need to explicitly mark these proc async ? |
03:17:07 | kz | ok I guessed I missed that point |
03:17:15 | kz | *I guess |
03:17:23 | kz | thanks ! |
03:19:30 | * | wepy joined #nim |
03:19:49 | wepy | how do i fix the error: "cannot open '/usr/lib/nim/system.lib'" problem? |
03:20:24 | wepy | one github issue page said it's about search paths.. |
03:20:34 | wepy | but addint -p:..Nim-build-dir.. din't fix it |
03:21:14 | wepy | ah.. i added the lib dir |
03:25:21 | wepy | actually.. weird |
03:25:34 | wepy | the compile works from the command line, but not from a Makefile |
03:25:36 | wepy | :\ |
03:26:16 | * | MyMind joined #nim |
03:26:36 | * | Sembei quit (Ping timeout: 252 seconds) |
03:27:02 | * | endragor joined #nim |
03:27:54 | * | endragor quit (Remote host closed the connection) |
03:28:28 | * | BitPuffin|osx quit (Ping timeout: 272 seconds) |
03:30:57 | * | endragor joined #nim |
03:33:19 | wepy | if i add --lib:/home/X/Nim/lib.. then instead of a system.nim error, i get errors for imported libs |
03:38:35 | * | Jesin quit (Read error: Connection reset by peer) |
03:39:34 | * | Jesin joined #nim |
03:44:13 | * | gsingh93 quit (Ping timeout: 264 seconds) |
03:45:08 | wepy | why would "nim dump" have different output in a Makefile vs from terminal? |
03:57:11 | * | JoshuaT joined #nim |
04:03:25 | * | MyMind quit (Ping timeout: 264 seconds) |
04:07:32 | * | wepy quit (Quit: Lost terminal) |
04:08:42 | * | Pisuke joined #nim |
04:08:50 | * | kz quit (Quit: Page closed) |
04:22:19 | * | Perelandric quit (Ping timeout: 246 seconds) |
04:37:36 | * | Sembei joined #nim |
04:38:13 | * | yglukhov___ joined #nim |
04:40:25 | * | Pisuke quit (Ping timeout: 265 seconds) |
04:42:33 | * | yglukhov___ quit (Ping timeout: 250 seconds) |
05:10:12 | * | ddl_smurf quit (Quit: ddl_smurf) |
05:16:14 | * | boop joined #nim |
05:16:58 | * | amaur joined #nim |
05:18:26 | * | cazov_ joined #nim |
05:18:29 | * | mal``` joined #nim |
05:20:18 | * | pigmej_ joined #nim |
05:21:29 | * | milosn joined #nim |
05:25:22 | * | dhasenan_ joined #nim |
05:26:56 | * | mal`` quit (*.net *.split) |
05:26:56 | * | pigmej quit (*.net *.split) |
05:26:57 | * | buupisaway quit (*.net *.split) |
05:26:57 | * | dhasenan quit (*.net *.split) |
05:26:57 | * | ir2ivps10 quit (*.net *.split) |
05:26:57 | * | mtj__ quit (*.net *.split) |
05:26:57 | * | cazov quit (*.net *.split) |
05:26:57 | * | Araq quit (*.net *.split) |
05:26:57 | * | amaurea quit (*.net *.split) |
05:26:57 | * | pigmej_ is now known as pigmej |
05:29:23 | * | Araq joined #nim |
05:30:56 | * | mtj_ joined #nim |
05:38:02 | * | ir2ivps10 joined #nim |
05:41:00 | * | notfowl- quit (Excess Flood) |
05:42:06 | * | notfowl joined #nim |
05:54:52 | * | dalarmmst joined #nim |
06:25:17 | * | OnO joined #nim |
06:25:49 | * | Jesin quit (Quit: Leaving) |
06:28:03 | * | yglukhov___ joined #nim |
06:42:41 | * | cazov_ is now known as cazov |
06:42:48 | * | filwit quit (Quit: Leaving) |
06:48:46 | * | Jesin joined #nim |
07:05:01 | * | endragor_ joined #nim |
07:06:20 | * | Kingsquee quit (Quit: Konversation terminated!) |
07:07:27 | dalarmmst | How can I print an int has a hex value without having to specify a length (as with strutils.toHex), or easily calculate the length? |
07:08:48 | * | endragor quit (Ping timeout: 256 seconds) |
07:09:27 | * | notfowl quit (Excess Flood) |
07:09:37 | * | notfowl joined #nim |
07:09:37 | * | notfowl quit (Excess Flood) |
07:10:06 | * | notfowl joined #nim |
07:12:55 | * | Ven joined #nim |
07:14:21 | * | BlaXpirit joined #nim |
07:16:28 | * | datanoise quit (Ping timeout: 272 seconds) |
07:17:01 | * | endragor_ quit (Remote host closed the connection) |
07:17:33 | * | endragor joined #nim |
07:18:31 | * | endragor quit (Remote host closed the connection) |
07:18:50 | * | Andris_zbx joined #nim |
07:22:20 | * | Kingsquee joined #nim |
07:34:12 | * | Trustable joined #nim |
07:36:12 | * | Ven quit (Ping timeout: 276 seconds) |
07:43:40 | * | kashyap_ joined #nim |
07:44:40 | notfowl | dalarmmst, sizeof(num) * 2 |
07:48:49 | kashyap_ | c2nim does not seem to parse array initialization where index is specified - as shown here https://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/Designated-Inits.html ... any workarounds for this/ |
07:50:33 | BlaXpirit | does C really have this syntax? |
07:50:42 | BlaXpirit | this is so inelegant, geez |
07:53:07 | dtscode | Who uses that? |
07:57:13 | * | davidhq joined #nim |
07:58:15 | kashyap_ | :) ... apparently its valid syntax..I've seen it in some kernel code |
08:00:25 | * | johnsoft quit (Ping timeout: 264 seconds) |
08:00:29 | dtscode | Ew. |
08:01:24 | * | johnsoft joined #nim |
08:02:14 | notfowl | lol struct point ptarray[10] = { [2].y = yv2, [2].x = xv2, [0].x = xv0 }; |
08:06:05 | * | dtscode shudders |
08:09:17 | * | Ven joined #nim |
08:09:29 | * | coffeepot joined #nim |
08:13:39 | * | gokr left #nim (#nim) |
08:13:42 | * | datanoise joined #nim |
08:23:50 | * | bluenote joined #nim |
08:35:38 | * | datanoise quit (Ping timeout: 272 seconds) |
08:38:30 | * | notfowl quit (Excess Flood) |
08:39:06 | * | notfowl joined #nim |
08:42:20 | * | endragor joined #nim |
08:42:55 | * | borko joined #nim |
08:43:34 | borko | hello, an absolute beginner with a (silly) question |
08:44:11 | * | endragor quit (Read error: Connection reset by peer) |
08:44:20 | borko | in the standard `math` library, there is the `gcd` proc |
08:44:23 | * | endragor joined #nim |
08:45:08 | borko | and it will happily let me use it with say floats as arguments, because this is how it is implemented |
08:45:14 | borko | is that intended? |
08:45:36 | dtscode | Is what intended? |
08:46:13 | borko | That I can find the greatest common divisor of non-integers? |
08:47:03 | * | davidhq_ joined #nim |
08:47:26 | dtscode | Yes. |
08:47:41 | dtscode | Reading the documentation can tell you that though. |
08:49:29 | bluenote | dtscode: the math module documentation? |
08:49:37 | dtscode | http://nim-lang.org/docs/math.html#gcd,T,T |
08:49:49 | * | davidhq quit (Ping timeout: 265 seconds) |
08:50:13 | borko | Well, the documentation says only "Computes the greatest common divisor of x and y.", and when I looked at the code it looked like you can give it anything that has `mod` and `abs` |
08:50:47 | dtscode | The documentation shows you what type(s) its meant to work with |
08:50:49 | borko | and this is indeed so: echo gcd(2.34, 3.12) --> 8.881784197001252e-16 |
08:52:10 | borko | Indeed; I was just wondering what is the use-case for such a computation. I am not claiming this is somehow not perfectly correct, just trying to understand the rationale |
08:52:11 | bluenote | what is also strange: `mod` itself should not work for float in the first place |
08:52:58 | * | endragor quit (Read error: Connection reset by peer) |
08:53:10 | dtscode | bluenote: Sure it should, considering it explicitly takes float types. |
08:53:21 | borko | it does, though, this is something else I noticed but there is a defined meaning of that at least |
08:53:34 | bluenote | yes, sorry, I was missing the import before |
08:53:53 | borko | I mean there is a defined meaning of mod for floats. See for example `fmod` from C |
08:54:25 | dtscode | borko: I understand what you asking now. That is different than what you are asking before. |
08:54:26 | bluenote | yes, I only tested without "import math" <- that is where it is defined... |
08:54:28 | * | endragor joined #nim |
08:55:38 | bluenote | whereas the regular `mod` for int is in the general scope... |
08:55:47 | borko | The question is: "What is the intended use of finding the greatest common divisor of types that are not ordinal (in the mathematical sense of the word) |
08:55:49 | * | davidhq joined #nim |
08:56:26 | dtscode | borko: Yes. Thats not the same as "Is gcd intended to work with floats?" |
08:56:37 | borko | dtscode: correct |
08:56:53 | dtscode | Which is why I was confused. |
08:57:01 | * | ingsoc joined #nim |
08:57:09 | dtscode | But unfortunately, I don't have an answer for your actual question |
08:57:12 | borko | dtscode: thank you for helping me refine my question |
08:57:52 | * | davidhq_ quit (Ping timeout: 255 seconds) |
08:58:46 | notfowl | Pythons gcd works on floats |
08:59:21 | dtscode | notfowl: Hes asking what the point in using it on floats is |
08:59:32 | dtscode | Or rather, when would one need to use it on floats. |
09:00:41 | * | TEttinger joined #nim |
09:01:00 | * | endragor quit (Ping timeout: 256 seconds) |
09:02:29 | * | endragor joined #nim |
09:02:51 | borko | notfowl: yes. as in, greatest common divisor as a concept is only defined for ordinal types. |
09:03:42 | notfowl | Dunno I'm not a mathematician |
09:04:39 | borko | notfowl: neither am I. What would be a good place to ask this question? |
09:06:48 | bluenote | it would make sense to me if e.g. gcd(1.0, 1.2) == 0.2, i.e., the largest floating point number x which satisfies a == N*x and b == M*x with N,M integers |
09:07:36 | bluenote | but I get gcd(1.0, 1.2) = 2.220446049250313e-16 (btw, also in python) |
09:07:39 | borko | bluenote: indeed. I would expect, for example, gcd(2.34, 3.12) --> 0.78 |
09:08:27 | bluenote | maybe the algorithm used is only approriate for integers |
09:08:37 | borko | bluenote: but this would imply that either A) the numbers are say decimals or rationals or B) we convert them to the closest rational before moving on |
09:09:27 | borko | bluenote: not _integers_ necessarily, but definitely an _ordinal_ type |
09:10:09 | Araq | the algorithm is generic so that it can work on bignums out of the box, I think |
09:10:09 | * | endragor quit (Remote host closed the connection) |
09:10:28 | Araq | that float is allowed too is coincidence |
09:10:33 | bluenote | hm, are floating point number always rationals (being multiples of some machine epsilon)? |
09:10:39 | * | endragor joined #nim |
09:10:50 | Araq | of course they are |
09:11:05 | Araq | cannot compute with math's "real" numbers |
09:11:18 | Araq | that's how "real" they are ;-) |
09:11:38 | borko | bluenote: you can find a rational that exactly represents any float, but this rational is not always exactly equal to the decimal representation of the float |
09:12:41 | * | iamd3vil joined #nim |
09:12:48 | Araq | the decimal representation is ... well ... optimized for humans |
09:13:57 | bluenote | yes, that is probably why we get things like 2.220446049250313e-16 |
09:14:18 | borko | Araq: indeed. But either way: it is a coincidence that `gcd` works with floats; should that be "allowed"? It would rather never be intended in actual code? |
09:14:57 | Araq | well if the algorithm requires 'mod' and floats provide a 'mod' I cannot see why it shouldn't be allowed |
09:16:20 | borko | Well, the results are definitely not something useful. One could argue that interpreting "2.34" as a decimal and using that makes sense, but then there would be quite a bit of magic going on |
09:16:21 | flyx | because in math theory, you need a neutral element to be able to define gcd |
09:16:29 | flyx | 1 is a neutral element for natural numbers |
09:16:40 | flyx | with floating point numbers, you don't have a neutral element |
09:16:47 | borko | flyx: yes |
09:17:24 | Araq | flyx: 1.0 is a neutral element for multiplication for float. I think. |
09:17:38 | flyx | a yes, stupid wording |
09:18:04 | Araq | maybe it's not because of NaN though |
09:18:08 | flyx | gcd on natural numbers can always return at least 1 |
09:18:15 | Araq | but this shouldn't matter here |
09:18:40 | Araq | no, wait NaN * 1.0 == NaN |
09:18:40 | bluenote | flyx: and the machine epsilon for floats |
09:18:41 | flyx | on floating points, I think it's a problem that you cannot at least return the neutral element |
09:18:48 | Araq | so still neutral |
09:18:54 | flyx | hmm |
09:19:04 | flyx | perhaps it's possible |
09:19:43 | flyx | but is the float epsilon really a common divisor for all floats? |
09:19:57 | bluenote | if not, it is some fraction of it :) |
09:19:57 | flyx | I think not, because the distance between two floats varies |
09:20:16 | bluenote | that is what I was wondering before, but you can divide it further |
09:20:39 | bluenote | okay, you cannot represt that number ;) |
09:20:42 | flyx | it's an interesting mathematical question |
09:20:44 | bluenote | represent* |
09:22:05 | flyx | http://stackoverflow.com/questions/14297515/calculating-greatest-common-divisor |
09:22:17 | flyx | the answer shows the issue, I think |
09:22:36 | bluenote | btw: I get "reasonable" results for some values, probably such values which can be encoded precisely as IEEE float |
09:22:38 | flyx | 1.0 is actually 1.0 in exact representation, but 1.2 is not exactly 1.2 |
09:22:53 | flyx | so you wouldn't get 0.2 as gcd if you calculate it |
09:23:10 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
09:23:32 | bluenote | yes that what I think as well |
09:24:01 | Araq | does it work for 1.0 and 0.25 ? |
09:24:19 | bluenote | Araq: yes |
09:24:22 | flyx | yes |
09:24:30 | borko | there is an algorithm for finding a rational that is equal to the decimal representation of a float, for any float. |
09:24:33 | bluenote | probably any mutliple of 2 is okay |
09:24:45 | Araq | yup |
09:25:09 | borko | that would be one way to get somewhat meaningful results I guess |
09:26:00 | flyx | any two numbers work as long as the mantisse is 1. |
09:26:25 | flyx | or one mantisse is a fraction of the other |
09:26:52 | flyx | or the gcd of the two mantissa can be represented as mantisse exactly |
09:29:30 | borko | so, say, "rationalize(5.1) --> 51/10" |
09:29:34 | bluenote | I even see use cases for the current gcd implementation: if gcd(f1, f2) >> epsilon you know that f1, f2 have a "compatible representation" and you may reorder certain computations in a way to maximize numerical stability -- I admin, very fancy, but still "useful" :) |
09:31:02 | borko | Should it at least be documented in some way, or is the current documentation enough? |
09:31:45 | Araq | borko: feel free to improve the docs |
09:32:23 | borko | Araq: I might do it if I knew what to write there :) I came here with my queston _exactly_ because I was confused |
09:32:24 | Araq | rationalize("5.1") --> 51 / 10 can work easily, with floating point it's much harder |
09:34:23 | borko | Araq: there is an established way to do it though; see for example the SWI-Prolog implementation of "rationalize" https://github.com/SWI-Prolog/swipl-devel/blob/master/src/pl-arith.c#L2056 |
09:35:15 | borko | Araq: the nice thing about this is that it cites its references :) |
09:38:04 | borko | Araq: this is a bit too far off topic though; back to the original issue: should I A) forget about it; B) improve the documentation by pointing out it works with floats; C) open an issue on github to discuss how to deal with it? D) None of the above |
09:38:53 | Araq | there are real costs associated with ~460 open issues |
09:39:17 | Araq | so not yet another minor issue we ignore for years please |
09:39:25 | Araq | make a PR or do (A) |
09:41:35 | borko | Araq: pull request with the updated docs? forcing the gcd to only work with ordinals? implementing `rationalize` and using it if an argument is float? |
09:41:56 | Araq | pull request with updated docs |
09:42:04 | borko | Araq: good |
09:57:54 | * | Beluki joined #nim |
09:58:45 | Beluki | Hi. Is there anything in the stdlib to read a keypress from the terminal without displaying it? |
10:02:00 | Araq | Beluki: terminal.nim has some support for that iirc |
10:02:38 | Beluki | I found most of what I was looking for in that module (writing text at arbitrary cursor positions) but nothing for reading. |
10:03:27 | Beluki | Mmm, actually, maybe styleHidden can help. |
10:04:16 | Araq | there is also rdstdin.readPasswordFromStdin |
10:05:24 | Araq | btw this "let's display *nothing* " is a usability pita |
10:05:59 | Beluki | Unfortunately, I need to read a single character. |
10:06:13 | Beluki | My use case is a simple sokoban terminal game. |
10:06:45 | Beluki | I don't need anything beyond reading without echo and printing at arbitrary positions, which terminal does provide. |
10:06:50 | Araq | when not defined(windows): |
10:06:51 | * | banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
10:06:52 | Araq | proc getch*(): char = |
10:06:53 | Araq | ## Read a single character from the terminal, blocking until it is entered. |
10:06:55 | Araq | ## The character is not printed to the terminal. This is not available for |
10:06:57 | Araq | ## Windows. |
10:06:57 | * | borko quit (Quit: Leaving) |
10:07:25 | Araq | so terminal.nim has it |
10:08:10 | Beluki | Oh, so it wasn't in the doc then. I'll have a look at the source. |
10:08:20 | Araq | yeah, fixing it |
10:08:34 | * | JoshuaT quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
10:11:05 | * | banister joined #nim |
10:12:22 | * | dddddd joined #nim |
10:18:00 | * | iamd3vil quit (Quit: Page closed) |
10:18:43 | * | davidhq quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
10:19:03 | * | datanoise joined #nim |
10:22:19 | bluenote | any macro guru around? I have the following problem: https://gist.github.com/bluenote10/3787977625e6bf63e6af |
10:22:43 | bluenote | in a macro I have a string, which I want to parse and determine the type of this expression |
10:23:22 | bluenote | but either parseExpr(s).getType and parseStmt(s).getType result in "node has no type" |
10:23:43 | Araq | use macro m(x: typed) |
10:24:05 | Araq | oh hrm |
10:24:22 | Araq | well yes, parseExpr nor parseStmt do the semchecking for you |
10:24:24 | bluenote | but what if I really have a string, not the original expression |
10:24:29 | Araq | so these indeed have no type |
10:24:59 | bluenote | I though parseStmt would be the correct way, since stmt == typed and expr == untyped |
10:25:19 | Araq | well good idea but that's not how it works |
10:25:20 | Beluki | Araq: given the getch() definition for non-windows systems in terminal.nim, should this suffice to support windows: proc getch*(): WINBOOL {.stdcall, dynlib: "msvcrt", importc: "_getch".} ? |
10:25:45 | * | mahlon_ quit (Read error: Connection reset by peer) |
10:25:46 | Araq | Beluki: if it were that easy we would have done it |
10:26:05 | * | CARAM__ quit (Ping timeout: 252 seconds) |
10:26:30 | Beluki | What could be the potential problems? it seems to be working (at least for some definition of "working") |
10:26:31 | * | Quora quit (Remote host closed the connection) |
10:26:33 | Araq | bluenote: you can do it with some nested macro application |
10:26:43 | * | thotypous quit (Ping timeout: 256 seconds) |
10:27:06 | * | dalarmmst quit (Ping timeout: 272 seconds) |
10:27:06 | * | JStoker quit (Ping timeout: 272 seconds) |
10:27:06 | * | Roin quit (Ping timeout: 272 seconds) |
10:27:08 | Araq | Beluki: msvcrt might not have it iirc |
10:27:16 | Araq | bbl |
10:27:17 | * | banister quit (Ping timeout: 256 seconds) |
10:27:19 | * | mahlon_ joined #nim |
10:27:20 | bluenote | you mean some sort of nested `macro m(x: typed)` |
10:27:29 | bluenote | k, cya |
10:27:42 | * | someplace quit (Ping timeout: 256 seconds) |
10:27:56 | * | fold quit (Ping timeout: 265 seconds) |
10:28:50 | * | EastByte quit (Ping timeout: 256 seconds) |
10:29:00 | * | Amrykid quit (Ping timeout: 272 seconds) |
10:29:46 | * | JStoker joined #nim |
10:29:50 | * | Roin joined #nim |
10:29:53 | * | thotypous joined #nim |
10:30:11 | * | Amrykid joined #nim |
10:30:26 | * | CARAM__ joined #nim |
10:30:32 | * | Heartmender joined #nim |
10:30:53 | * | Heartmender is now known as Guest67556 |
10:31:42 | * | someplace joined #nim |
10:32:46 | * | delian66 quit (Ping timeout: 265 seconds) |
10:32:46 | * | datanoise quit (Ping timeout: 258 seconds) |
10:33:44 | * | ekarlso quit (Ping timeout: 265 seconds) |
10:34:05 | * | delian66 joined #nim |
10:34:07 | coffeepot | I want to process a simple ini file in windows - parsecfg the tool for the job? |
10:34:21 | coffeepot | or is there something more specific to ini's |
10:36:31 | Beluki | coffeepot: parsecfg should be fine (in fact, it's what nimble uses to read ini files). |
10:37:49 | coffeepot | :) ace |
10:37:52 | coffeepot | thanks |
10:38:59 | * | Ven joined #nim |
10:41:52 | * | ekarlso joined #nim |
10:45:16 | * | ekarlso quit (Changing host) |
10:45:16 | * | ekarlso joined #nim |
10:47:37 | * | Jehan_ joined #nim |
10:53:51 | * | bjz joined #nim |
10:55:29 | * | EastByte joined #nim |
10:58:59 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
10:59:24 | * | bjz quit (Ping timeout: 246 seconds) |
10:59:47 | * | ddl_smurf joined #nim |
11:07:09 | * | Demon_Fox quit (Quit: Leaving) |
11:08:34 | * | wb joined #nim |
11:10:26 | bluenote | Araq: I tried a few things with nesting macros (e.g. passing the result of parseStmt to a macro which takes a `typed` parameter) but I could not get it to work |
11:10:59 | * | Ven joined #nim |
11:10:59 | bluenote | I also saw that filwit had exactly the same question before on IRC, so I though it is a good idea to ask this in the forum instead |
11:11:30 | * | davidhq joined #nim |
11:23:53 | * | bjz joined #nim |
11:26:01 | * | bjz quit (Read error: Connection reset by peer) |
11:26:40 | * | bjz joined #nim |
11:32:00 | * | Kingsquee quit (Quit: Konversation terminated!) |
11:38:39 | * | davidhq_ joined #nim |
11:40:14 | * | davidhq quit (Ping timeout: 245 seconds) |
11:55:52 | * | Beluki quit (Quit: Beluki) |
11:58:59 | * | datanoise joined #nim |
12:04:07 | * | datanoise quit (Ping timeout: 265 seconds) |
12:07:47 | OnO | how to raise compile time error on: when not declared(XXXX) |
12:08:09 | OnO | if I use error "msg" I get Error: 'error' can only be used in compile-time context |
12:08:19 | OnO | but isn't where: compile time context? |
12:09:57 | * | HakanD joined #nim |
12:11:11 | Jehan_ | Use {.error: "....".} |
12:11:26 | bluenote | proc checkDef(s: string): bool {.compiletime.} = |
12:11:34 | bluenote | when checkDef("test"): |
12:11:49 | bluenote | would also work |
12:12:06 | bluenote | and place an error in the checkDef proc |
12:17:02 | * | Jehan_ quit (Quit: Leaving) |
12:21:06 | OnO | okay, thanks {.error...} works, yet it is pretty weird... okay wouldn't be simplier to make error "..." work same as {.error "...".} |
12:22:52 | coffeepot | regarding tables, Is it correct to use initTable to clear a table that's already full of data? |
12:24:53 | coffeepot | btw is there a #nim-noobhelp or something, hope I'm not crapping up the IRC channel with my noobian queries :D |
12:25:09 | * | fold joined #nim |
12:56:23 | * | HakanD_ joined #nim |
12:56:24 | * | HakanD quit (Read error: Connection reset by peer) |
12:56:47 | OnO | is there any other way to bind proc to the class type (not instance) than use 1st arg of typedesc[Class] ? |
12:58:05 | OnO | I am having blocking issue of https://github.com/Araq/Nim/issues/2662 |
12:58:21 | OnO | calling: iterator it(T: typedesc[Base]) with any subtype of Base crashes compiler |
13:01:08 | r-ku | OnO: you cant do it any other way |
13:03:45 | * | mrkishi joined #nim |
13:06:57 | Araq | OnO: fix it ;-) |
13:08:14 | OnO | Araq: I have absolutely no clue what happens there, there no description of purpose of getUniqueType |
13:08:47 | OnO | neither clear description of the error, it is just "internal error" |
13:09:00 | Araq | it doesn't matter, getUniqueType doesn't like tyTypeDesc so you need to ensure it's not passed to that |
13:09:35 | Araq | the problem is that your typedesc[Class] ends up in the codegen for some reason |
13:09:45 | * | jfchevrette joined #nim |
13:09:47 | Araq | but since it's irrelevant for codegen, this fails |
13:11:10 | * | kashyap_ quit (Ping timeout: 246 seconds) |
13:13:34 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
13:17:02 | Araq | btw getUniqueType ensures that type((1, 2)) and tuple[x, y: int] produce the same C struct since these need to be compatible |
13:17:20 | Araq | and structs in C use nominal typing, not structural typing |
13:17:23 | * | HakanD_ quit (Quit: Be back later ...) |
13:18:00 | OnO | well.. okay, so the hint is that for some reason it is triggered for iterator but not for regular proc |
13:19:19 | reactormonk | Araq, could you take a look at https://github.com/Araq/Nim/pull/2680 again? nimsuggest is still broken for non-main files, but that's another issue |
13:19:26 | OnO | oh soo sweet, it even crashes on methods :) |
13:19:46 | OnO | method me(T: typedesc[Base]) = echo "method call from " & T.name; Child.me -> Error: internal error: expr: param not init T_91093 |
13:21:29 | * | Guest67556 quit (Changing host) |
13:21:29 | * | Guest67556 joined #nim |
13:21:29 | * | Guest67556 quit (Changing host) |
13:21:29 | * | Guest67556 joined #nim |
13:21:34 | * | Guest67556 is now known as Quora |
13:23:00 | Araq | reactormonk: I see you fixed your import mess |
13:25:15 | Araq | result.symkind = parseEnum[TSymKind](renderTree(...) wtf? |
13:25:34 | * | HakanD_ joined #nim |
13:25:38 | reactormonk | that's copypasta. |
13:26:00 | reactormonk | lemme pull out the old version |
13:28:22 | pigmej | Araq: nimsuggest seems broken even in 'mainline version' |
13:28:45 | Quora | it'd be nice to have a compiler flag that fails compile on unused imports |
13:28:46 | reactormonk | pigmej, that's a different fix with not enough resetting / too much caching I would believe |
13:29:11 | pigmej | probably |
13:29:51 | Araq | Quora: true but it doesn't bloat your exe anyway |
13:29:52 | reactormonk | Quora, we already have a warning for unused symbols, maybe you can extend it to imports |
13:31:58 | Quora | Araq: yeah, it's more of a personal style thing |
13:37:03 | reactormonk | Araq, ok, removed your WTFs. I just copied them over from the old nimsuggest |
13:38:02 | Araq | reactormonk: that's reassuring. so I take from that you don't test anything? |
13:38:23 | dom96 | I think reactormonk should implement this on top of nimsuggest |
13:38:32 | dom96 | as a separate package |
13:38:51 | Araq | no it's fine in nimsuggest |
13:38:55 | Araq | if it works |
13:39:48 | dom96 | It just adds to the things we need to maintain though. |
13:40:13 | dom96 | NimSuggest needs to at least be moved out of the Nim repo already. |
13:40:26 | reactormonk | Araq, I tested this one hell of a lot. Although only from the emacs side, so no automated tests. |
13:40:42 | reactormonk | ... that's also how I found https://github.com/Araq/Nim/issues/2694 |
13:40:54 | reactormonk | also, I was like "works, don't touch it", because that's how the old nimsuggest did it |
13:41:41 | Araq | dom96: nimsuggest uses the compiler |
13:41:51 | Araq | it's a variant of the compiler |
13:42:02 | Araq | cannot be a separate package |
13:42:04 | reactormonk | Araq, that's what we should have the compiler nimble package for... but it's kinda not working IIRC |
13:42:41 | reactormonk | I ran the ./koch tests c caas and checked testresults.html, but no errors reported, so I hope it works |
13:42:52 | dom96 | Araq: Yes, it can. |
13:42:56 | dom96 | Araq: The compiler is a package. |
13:43:31 | dom96 | You told me to create this https://github.com/nim-lang/nimsuggest |
13:43:32 | pigmej | Araq: it crashes in aporia in the same way |
13:43:33 | dom96 | IIRC |
13:43:40 | pigmej | so emacs ir really no issue there |
13:43:41 | dom96 | and then I could never get it to work |
13:44:47 | Araq | reactormonk: 'tests c caas' doesn't do anything, we have no tests for nimsuggest yet |
13:45:04 | * | vikaton joined #nim |
13:45:07 | reactormonk | Araq, ah fuck. |
13:45:57 | Araq | pigmej: well yes |
13:46:21 | Araq | worked for me when I tested it, not sure what happens here |
13:46:36 | pigmej | Araq: have you seen my aporia description ? |
13:46:41 | pigmej | the case with aporia |
13:48:03 | dom96 | pigmej: what is the description? |
13:49:43 | reactormonk | dom96, https://github.com/Araq/Nim/issues/2694 |
13:49:55 | pigmej | yeah exactly this:) |
13:55:45 | * | Perelandric joined #nim |
13:55:58 | Quora | is there a way to have nimble build multiple binaries? |
13:56:10 | Quora | or have multiple source directories |
13:56:36 | Araq | I don't think so |
13:56:42 | * | Ven_ joined #nim |
13:59:17 | dom96 | there is |
13:59:26 | dom96 | just specify multiple bin = "foo" |
13:59:30 | dom96 | or separate by commas |
13:59:37 | dom96 | you can't have multiple source dirs though |
13:59:48 | dom96 | bbl |
14:04:08 | * | JoshuaT joined #nim |
14:04:43 | OnO | Araq: I give up, there is nkHiddenSubConv when I pass subclass to Base to typedesc[Base], there is some magic then in transformFor that triggers newSymNode and newAsgnStmt, and finally leads to getUniqueType with tyTypeDesc that causes internal error |
14:07:32 | Araq | OnO: well why "give up"? |
14:07:52 | Araq | as you noticed there are several solutions to fix this bug |
14:08:23 | Araq | one is to not make transf produce a newAsgnStmt when it's a "typeDesc" |
14:09:10 | Araq | there is types.isCompileTime(t) you can use to check for that iirc |
14:09:41 | Araq | isCompileTimeOnly |
14:10:44 | OnO | actually this is not fault of "for transf" cause it does paDirectMapping on TypeDesc |
14:11:04 | * | endragor quit (Ping timeout: 255 seconds) |
14:11:06 | OnO | but before overload method wraps the call with HiddenSubConv |
14:11:17 | OnO | this effectively triggers paFastAsgn there |
14:12:01 | OnO | maybe HiddenSubConv should never apply to compile time types? |
14:13:55 | * | jfchevrette left #nim ("Textual IRC Client: www.textualapp.com") |
14:14:10 | OnO | calling directly Base we get AST of: ForStmt(Sym(s), Call(Sym(it), Sym(Base)), .... |
14:14:26 | OnO | calling with subclass we get: ForStmt(Sym(s), Call(Sym(it), HiddenSubConv(Empty(), Sym(Child))), ... |
14:15:18 | OnO | btw. HiddenSubConv is bugged, not displaying type we are casting to |
14:15:42 | OnO | anyway, does casting types (not variable) make sense at all? |
14:16:30 | * | vikaton quit () |
14:17:42 | * | BitPuffin joined #nim |
14:20:40 | * | vikaton joined #nim |
14:26:18 | * | Ven_ quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
14:26:46 | Araq | OnO: it doesn't |
14:29:00 | OnO | so my reasoning is right, it should only apply to instances of the types not types (typedesc) itself? |
14:29:15 | OnO | then I'll try to remove this implict HiddenSubConv on overload |
14:31:22 | Araq | good idea, yeah |
14:44:44 | * | darkf quit (Quit: Leaving) |
14:47:57 | * | datanoise joined #nim |
14:49:27 | * | Andris_zbx quit (Remote host closed the connection) |
14:52:54 | * | Xe left #nim (#nim) |
14:54:56 | * | Xe joined #nim |
14:57:16 | * | Ven_ joined #nim |
15:01:26 | * | vikaton quit () |
15:03:07 | OnO | Araq: here you go: https://github.com/Araq/Nim/pull/2708 |
15:04:01 | Araq | OnO: looks good, please add tests though |
15:04:10 | Araq | also ensure this fixes the 'method' bug too |
15:04:15 | OnO | it doesn't |
15:04:19 | Araq | damn |
15:04:23 | OnO | method thing is something else |
15:04:25 | Araq | I hoped it would |
15:04:29 | OnO | me too |
15:04:54 | OnO | for method it actually get through compiler and fails at c compiler level |
15:05:33 | OnO | okay, need to pick my son from kindergarten, will be back in 30 min |
15:09:23 | * | HakanD_ quit (Quit: Be back later ...) |
15:12:26 | * | Strikecarl joined #nim |
15:14:50 | Quora | How do I use source code filters? |
15:15:06 | * | cyraxjoe quit (Quit: No Ping reply in 180 seconds.) |
15:15:34 | * | MightyJoe joined #nim |
15:18:13 | * | Strikecarl quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
15:18:42 | Quora | ah |
15:18:45 | Quora | via include |
15:19:07 | * | ingsoc quit (Quit: Leaving.) |
15:23:01 | * | Jesin quit (Quit: Leaving) |
15:25:02 | * | Marethyu joined #nim |
15:27:08 | * | ingsoc joined #nim |
15:27:23 | Araq | Quora: er no? |
15:27:27 | Araq | via #! |
15:27:37 | Araq | ah sorry, yeah via include |
15:29:37 | Marethyu | Hello! I'm new into Nim and I'd like to know how to transform a string into an array or sequence, like .split() in Python. Thanks in advance |
15:29:57 | Quora | Marethyu: import strutils, "foo bar".split(" ") |
15:30:59 | Marethyu | Very easy. Thanks ! |
15:45:52 | * | Marethyu quit (Ping timeout: 246 seconds) |
15:48:39 | * | MightyJoe is now known as cyraxjoe |
15:52:01 | * | HakanD_ joined #nim |
15:52:23 | Quora | dom96: how do I get jester to listen on not 127.0.0.1? |
15:54:10 | * | arnetheduck quit (Ping timeout: 244 seconds) |
15:57:48 | * | davidhq joined #nim |
16:01:06 | * | Ven_ quit (Ping timeout: 246 seconds) |
16:01:28 | * | davidhq_ quit (Ping timeout: 256 seconds) |
16:07:53 | * | coffeepot quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
16:09:00 | * | gsingh93 joined #nim |
16:20:45 | * | yglukhov___ quit (Ping timeout: 276 seconds) |
16:24:51 | * | johnsoft quit (Ping timeout: 256 seconds) |
16:25:42 | * | johnsoft joined #nim |
16:32:25 | * | bluenote quit (Ping timeout: 246 seconds) |
16:38:54 | * | HakanD__ joined #nim |
16:42:13 | * | HakanD_ quit (Ping timeout: 244 seconds) |
16:46:02 | reactormonk | Araq, what do you want to merge https://github.com/Araq/Nim/pull/2564 ? |
16:46:32 | * | jholland joined #nim |
16:51:15 | * | banister joined #nim |
16:51:50 | * | Jehan_ joined #nim |
16:58:21 | * | Demos joined #nim |
17:02:14 | * | wb quit (Ping timeout: 258 seconds) |
17:02:39 | * | wb joined #nim |
17:03:31 | Araq | reactormonk: looks good, should I merge? |
17:05:02 | reactormonk | Araq, I've hever actually run it all the way :-/ |
17:05:07 | reactormonk | ... lemme do that first |
17:06:03 | reactormonk | ah fuck, gotta merge first |
17:06:47 | Jehan_ | :) |
17:11:42 | OnO | Araq: added tests, but not fix for `method` :> it's not a blocker for me, anyways I filled new bug report #2710 for that one |
17:11:44 | OnO | https://github.com/Araq/Nim/pull/2708 |
17:15:17 | * | gsingh93 quit (Ping timeout: 256 seconds) |
17:18:21 | * | banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
17:20:19 | * | yglukhov____ joined #nim |
17:24:01 | Araq | OnO: excellent |
17:30:41 | * | BitPuffin quit (Ping timeout: 252 seconds) |
17:31:52 | reactormonk | Araq, oh duh, the C test doesn't work. |
17:37:30 | * | TEttinger quit (Ping timeout: 244 seconds) |
17:38:19 | reactormonk | Araq, What does {.noSideEffect.} do exactly? Does it make a proc not to have side effects or does it actually require all called procs inside that proc not to have side effects? |
17:39:59 | Demos | it checks it for you |
17:40:12 | reactormonk | ok |
17:40:25 | Demos | unless it's also marked with {.importc.} afaik |
17:47:29 | * | HakanD__ quit (Quit: Be back later ...) |
17:51:41 | * | Perelandric quit (Quit: Page closed) |
17:52:17 | Araq | that is correct, importc + noSideEffect changes the meaning from "assure" to "assume" |
17:52:27 | * | Perelandric joined #nim |
17:54:33 | * | Strikecarl joined #nim |
17:54:38 | Strikecarl | What lib is "shellExecute" in? |
17:54:52 | dtscode | os? |
17:55:06 | Strikecarl | Nope. |
17:55:14 | Strikecarl | Either nope or i am typing it wrong |
17:55:22 | Strikecarl | "shellExecute(stuff here)" |
17:55:43 | * | shodan45 joined #nim |
17:55:55 | dtscode | is it execShellCMD? |
17:56:12 | Strikecarl | might be, let me test |
17:56:35 | dtscode | its the closest thing in the stdlib to what you are asking for. |
17:56:59 | Strikecarl | Welp, i wanna do "launch Powershell.exe" |
17:57:19 | dtscode | http://nim-lang.org/docs/theindex.html According to this shellExecute doesn't exist |
17:57:21 | Strikecarl | Doesnt work tho, as "powershell.exe" isnt found, do i have to manually make a string to tell it its here? |
17:57:54 | dtscode | Ummmm try making the shell the main process being launched, and pass powershell.exe as an argument. |
17:58:22 | Strikecarl | Got it to work tho, ty |
17:58:39 | dtscode | np |
18:11:28 | * | HakanD__ joined #nim |
18:12:34 | dom96 | Quora: Don't think you can currently. |
18:13:23 | * | Strikecarl quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
18:13:37 | Quora | dom96: it'd be nice if you could |
18:14:17 | Quora | that support not existing is currently a blocker to deployment :< |
18:14:18 | reactormonk | Araq, ok, ready to merge |
18:15:46 | * | Marethyu joined #nim |
18:16:16 | * | iamd3vil joined #nim |
18:17:28 | Marethyu | I'd like to know the equivalent in Nim of the Python ":" like in variable[1:] to get the variable without, for example, its first char. Could someone help me, please ? |
18:18:12 | iamd3vil | How can I use to httpclient module to download a file using a SSL connection on windows? Even though I have installed Openssl on windows it's saying that it could not load ssleay32:libss132.dll |
18:19:20 | Quora | install libssl132.dll? |
18:19:48 | * | redwyn_ joined #nim |
18:21:42 | Marethyu | My question isn't difficult for someone experimented. No one ? ;( |
18:22:12 | Quora | Marethyu: foo[1 .. ^1] |
18:22:32 | iamd3vil | Where do I have to keep the dll? Sorry if this is stupid. |
18:23:13 | Marethyu | Quora: That's how it works... Thanks a lot! |
18:24:09 | * | HakanD__ quit (Quit: Be back later ...) |
18:24:36 | * | HakanD__ joined #nim |
18:25:24 | iamd3vil | I have the dll's in my System32 folder. Do I have to do something else to make it work? |
18:25:50 | Araq | iamd3vil: don't put them in system32. put them next to your .exe instead. |
18:29:08 | * | HakanD__ quit (Ping timeout: 264 seconds) |
18:33:21 | iamd3vil | Even though I am keeping the dlls next to my exe file, it's saying the same thing. I am compiling with -d:ssl switch by the way. |
18:33:37 | * | redwyn_ quit (Quit: leaving) |
18:35:10 | Araq | iamd3vil: use the 32 bit Nim compiler please. 64bit DLLs are hard to come by |
18:35:31 | Araq | especially for gnu open source stuff |
18:35:45 | iamd3vil | Araq: I have tried with another dll. It's working now.Thanks. |
18:36:07 | Araq | you have a 64bit DLL for SSL? |
18:36:12 | Araq | where can I find it? |
18:36:32 | Araq | I package 32 bit nimble with the 64bit Nim for these reasons |
18:36:48 | Araq | would be cool if we could get a proper 64 bit version |
18:37:43 | iamd3vil | I don't think it's a 64 bit dll but I have found the dll from http://indy.fulgan.com/SSL/ |
18:40:04 | Araq | nice thanks |
18:40:15 | Araq | seems to have 64bit DLLs |
18:40:23 | * | vinnie quit (Remote host closed the connection) |
18:40:42 | Araq | which are conveniently called "libeay32.dll" and "ssleay32.dll" ... |
18:41:13 | Araq | oh well at least there are vowels in the name |
18:41:30 | OnO | any way to iterate through field names of object type in macro? |
18:41:47 | OnO | the problem is that fieldPairs needs istance :( |
18:42:51 | Araq | OnO: macros.getType |
18:44:47 | * | MyMind joined #nim |
18:45:43 | OnO | Araq: but if macro takes T: typedesc, how do I turn it into NimNode of type ? |
18:45:57 | * | fizzbooze joined #nim |
18:46:25 | Araq | the macro's parameter types lie |
18:46:39 | Araq | within the macro every parameter is of type NimNode |
18:46:49 | * | iamd3vil quit (Ping timeout: 246 seconds) |
18:49:00 | OnO | hmm... I am confused look: macro ma(T: typedesc[Model]): stmt = getType(T) |
18:49:09 | OnO | causes: test.nim:9:45: Error: type mismatch: got (typedesc[Model]) but expected one of: macros.getType(n: NimNode) |
18:49:27 | OnO | so T is not NimNode |
18:51:00 | * | vinnie joined #nim |
18:53:15 | Araq | interesting. maybe zahary special cased typeDesc[] for macros for reasons that escape me |
18:53:15 | * | pluizer joined #nim |
18:54:25 | pluizer | Hello I'm new to Nim; I get a refence error to HEX2EHEX2E_14015 from code compled to js. Google can't help me, Am I doing something wrong? |
18:54:33 | pluizer | http://pastebin.com/xWuS1E5B |
18:54:46 | OnO | okay I think I can circumvent it via extra compile time proc... |
18:54:55 | OnO | Nim metaprogramming is hard but fun |
18:56:15 | * | gyeates joined #nim |
18:57:01 | * | Marethyu quit (Quit: Page closed) |
18:58:13 | Araq | pluizer: the Nim code that produces this result woudl be helpful too |
19:02:18 | pluizer | one moment |
19:04:51 | pluizer | Araq: Is was just a little example I tried: http://pastebin.com/J4BbSVuc |
19:06:29 | * | brson joined #nim |
19:06:55 | * | davidhq quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
19:13:18 | OnO | hmmm... why te heck bindSym does not work with string in macro |
19:13:19 | * | mnemonikk quit (Ping timeout: 265 seconds) |
19:13:28 | OnO | it just accepts string literal |
19:13:34 | * | gyeates quit (Ping timeout: 256 seconds) |
19:14:09 | Araq | pluizer: seems like the JS codegen cannot handle '..' |
19:14:51 | Araq | OnO: because the point is to lookup the symbol in the macro's scope/context |
19:15:19 | Araq | and not in some ill-specified scope |
19:15:24 | OnO | okay, I thought I nailed it but still cannot convert typedesc macro parameter to NimNode of type |
19:16:46 | Araq | OnO: fix it. semtypes.nim, line 691 |
19:16:58 | Araq | just remove that special case |
19:17:10 | * | heinrich5991 quit (Quit: quit.) |
19:17:19 | * | gsingh93 joined #nim |
19:17:24 | Araq | and IMO the special case for static[T] needs to go too |
19:18:09 | * | mrkishi quit () |
19:20:13 | * | HakanD__ joined #nim |
19:23:35 | * | filcuc joined #nim |
19:24:00 | OnO | Araq: here is the commit that introduced that in 2012! badb6c0f665e22bff77d91bb2f64f195110b9887 |
19:24:06 | OnO | did a little blame investigation |
19:24:16 | * | strcmp1 quit (Ping timeout: 255 seconds) |
19:24:44 | OnO | anyway I believe passing typedesc to macro directly non as NimNode is completely useless |
19:25:14 | * | jholland quit (Quit: Connection closed for inactivity) |
19:28:27 | * | heinrich5991 joined #nim |
19:30:52 | pluizer | Araq: thx |
19:39:34 | * | gyeates joined #nim |
19:40:55 | * | MyMind quit (Ping timeout: 256 seconds) |
19:44:53 | * | pluizer quit (Ping timeout: 256 seconds) |
19:46:12 | notfowl | That's not the issue |
19:46:39 | notfowl | If the param was " typed" you can pass in a typedesc fine |
19:47:06 | notfowl | O I see |
19:53:56 | * | fizzbooze quit (Ping timeout: 272 seconds) |
19:54:31 | OnO | or we should expose some function that turns typedesc into NimNode |
19:54:38 | OnO | maybe via NGetType |
19:56:02 | notfowl | No make the fix Araq said, typedesc isn't useful inside a macro |
19:57:35 | OnO | actually declaring proc getType*(t: typedesc): NimNode works, huh |
20:00:11 | * | d3m1gd quit (Ping timeout: 256 seconds) |
20:07:52 | * | xificurC quit (Remote host closed the connection) |
20:13:43 | OnO | actually it works by pure luck returning BracketExpr(Sym(typeDesc), Sym(User)) |
20:14:04 | OnO | so I think we need proper way to cast typedesc to NimNode |
20:14:13 | OnO | that would be best solution |
20:17:07 | * | xificurC joined #nim |
20:17:25 | OnO | hmmm.. or maybe bracketExpr(Sym(typeDesc), Sym(User)) is actually valid result |
20:19:04 | * | notfowl quit (Excess Flood) |
20:19:12 | * | notfowl joined #nim |
20:19:12 | * | notfowl quit (Changing host) |
20:19:12 | * | notfowl joined #nim |
20:24:32 | * | banister joined #nim |
20:28:14 | * | Jehan_ quit (Quit: Leaving) |
20:38:36 | OnO | made new PR introducing typeNode(t: typedesc): NimNode helper |
20:42:40 | * | pregressive joined #nim |
20:47:22 | * | strcmp1 joined #nim |
20:48:51 | * | redwyn joined #nim |
20:51:34 | * | banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
20:53:42 | notfowl | OnO: ? Yes that is rigjt |
20:54:42 | * | Jehan_ joined #nim |
20:55:44 | notfowl | Typedesc[type] is how it comes through |
20:57:02 | notfowl | OnO: examples how to use Gettype. https://gist.github.com/fowlmouth/3c74409c30533bb0a5b4 |
20:58:18 | OnO | I know how to use it, problem was it was expecting NimNode |
20:58:29 | OnO | but macro was getting typedesc instead |
20:58:53 | notfowl | And instead of fixing the broken behavior you leave it for another person to stumble on |
20:58:54 | OnO | all parameters to macro except static and typedesc are implicitly converted to NimNode |
20:59:09 | OnO | this is not broken behavior |
20:59:18 | OnO | it is okay that typedesc are passed as is |
20:59:21 | OnO | to macros |
20:59:34 | notfowl | Why is it OK? How do you use the parameter? |
20:59:55 | OnO | macro where*(T: typedesc[Model], st: untyped): expr = |
21:00:07 | OnO | in macro body T is NOT NimNode |
21:00:13 | OnO | because of that exception |
21:00:26 | notfowl | Right so how do you *use* it |
21:00:31 | notfowl | How is it useful? |
21:00:34 | * | vikaton joined #nim |
21:00:37 | OnO | thanks to that I can call other procs that expect typedesc[Model] |
21:00:43 | OnO | from macro itself |
21:00:55 | notfowl | ...k |
21:01:01 | notfowl | Back to mowing the grass |
21:02:07 | OnO | I don't know real reason this exception was introduced in 2012 :) but this is how I use it |
21:02:25 | * | ELFrederich_ joined #nim |
21:02:42 | OnO | still it is important to be able to get NimNode out of typedesc :> because you may use it to something else |
21:03:16 | OnO | actually I like it because I have the both embodiments of "type" parameter |
21:05:36 | filcuc | hi all, |
21:05:38 | * | jsjoberg_ joined #nim |
21:05:47 | filcuc | i've started a QtCreator plugin for Nim |
21:05:48 | filcuc | https://github.com/filcuc/QtCreatorNimEditor |
21:06:03 | filcuc | i don't know how it will end...but let's see :) |
21:06:27 | * | JoshuaT_ joined #nim |
21:07:11 | OnO | notfowl: take a look at now working sweet sample of my new ORM: https://github.com/nanoant/nim-orm/blob/master/tests/expr2sql.nim |
21:07:28 | * | dhasenan joined #nim |
21:08:32 | * | banister joined #nim |
21:08:36 | * | banister quit (Max SendQ exceeded) |
21:09:41 | * | ekarlso quit (Ping timeout: 250 seconds) |
21:09:41 | * | dhasenan_ quit (Ping timeout: 250 seconds) |
21:09:41 | * | jsjoberg quit (Ping timeout: 250 seconds) |
21:09:41 | * | ChrisMAN quit (Ping timeout: 250 seconds) |
21:09:41 | * | egrep quit (Ping timeout: 250 seconds) |
21:09:41 | * | JoshuaT quit (Ping timeout: 250 seconds) |
21:09:42 | * | ELFrederich quit (Ping timeout: 250 seconds) |
21:09:42 | * | TheManiac quit (Ping timeout: 250 seconds) |
21:09:42 | * | dewdrop quit (Ping timeout: 250 seconds) |
21:09:42 | * | xender quit (Ping timeout: 250 seconds) |
21:09:42 | * | TheManiac joined #nim |
21:10:54 | * | xender joined #nim |
21:11:03 | * | ChrisMAN joined #nim |
21:11:17 | * | ekarlso joined #nim |
21:15:48 | notfowl | OnO: it is east to fetch the symbol representing the typedesc or the type itself from the result of Gettype |
21:16:06 | notfowl | But maybe you rely on dispatching on the typedesc param. Idm |
21:16:12 | notfowl | Idk* |
21:17:36 | OnO | exactly, I rely on that |
21:18:55 | * | redwyn quit (Quit: leaving) |
21:19:32 | * | Demos quit (Read error: Connection reset by peer) |
21:19:41 | * | filcuc quit (Read error: Connection reset by peer) |
21:20:04 | * | filcuc joined #nim |
21:20:36 | notfowl | Did you try calling typenode gettype? It should work as an overload |
21:21:19 | * | Siecje joined #nim |
21:21:56 | OnO | no it does not, it complains of incorrect argument type, expected NimNode |
21:22:15 | * | transfuturist joined #nim |
21:22:18 | OnO | so AFAIK there is no implicit conversion to NimNode |
21:22:49 | * | filcuc quit (Remote host closed the connection) |
21:23:10 | ZZZZZZZZZ | brson: intruder alert! |
21:23:57 | * | filcuc joined #nim |
21:24:22 | notfowl | OnO: did you try an overload or not |
21:25:19 | OnO | what overload!? I don't understand, getType proc expect NimNode, it does not accept typedesc |
21:25:29 | notfowl | Sigh |
21:25:42 | notfowl | If you named typenode "gettype" it would be an overload |
21:26:29 | notfowl | There would be two gettype functions that refer to the same magic function |
21:26:53 | OnO | this is what I did, typeNode points to same magic function as getType |
21:27:03 | notfowl | Good lord |
21:27:07 | OnO | I confused VM call overloading with function overloading |
21:27:10 | OnO | what? |
21:27:19 | notfowl | That's not an overload |
21:27:24 | notfowl | Its a different function |
21:27:36 | OnO | I don't get you, honestly |
21:27:44 | notfowl | I'm asking if dispatching can fix this rather than. Having a function just for typedescs |
21:29:20 | transfuturist | varargs doesn't seem to work for macros |
21:29:55 | OnO | declaring proc with same or different name but with same magic identifier has exactly same effect |
21:30:43 | transfuturist | Error: type mismatch: got (NimNode) but expected one of: system.items(a: openarray[T]) ... |
21:31:33 | OnO | notfowl: because it emits exactly same VM call... so I don't understand what is has to do with overloading anything |
21:31:51 | transfuturist | when calling the macro, the only argument that gets passed is the very first |
21:31:59 | transfuturist | this is kind of broken now |
21:32:29 | OnO | transfuturist: show me the macro declaration |
21:32:53 | Varriount | Hello Nim'sters |
21:32:55 | OnO | transfuturist: I use varargs for macros and they work pretty ok |
21:33:00 | * | yglukhov____ quit (Quit: Be back later ...) |
21:33:08 | notfowl | Varargs will be bound in brackets |
21:33:46 | transfuturist | http://pastebin.com/5a3RGD3A |
21:33:52 | notfowl | OnO: dude. That's what you do in your pr |
21:34:28 | OnO | notfowl: :)) sorry we are probably lost in translation |
21:34:37 | OnO | notfowl: what was your question again? |
21:34:43 | transfuturist | it matches the syntax in http://nim-lang.org/docs/manual.html#macros-expression-macros |
21:35:16 | notfowl | OnO: nvm let me see when I'm done with my errands |
21:36:11 | transfuturist | varargs shouldn't have to be bound in brackets; that's the point of varargs sugar |
21:37:14 | * | NimrodBot joined #nim |
21:37:23 | * | NimrodBot quit (Read error: Connection reset by peer) |
21:37:59 | * | NimrodBot joined #nim |
21:38:10 | * | NimrodBot quit (Read error: Connection reset by peer) |
21:38:29 | * | NimrodBot joined #nim |
21:38:32 | * | NimrodBot quit (Read error: Connection reset by peer) |
21:41:28 | notfowl | transfuturist: so what node should they be in? |
21:42:02 | transfuturist | ... |
21:42:10 | transfuturist | no |
21:42:12 | transfuturist | the sugar doesn't work |
21:42:15 | transfuturist | modules ([socket, foobar]) |
21:42:20 | transfuturist | that's how i have to write it |
21:43:27 | OnO | transfuturist first of all use untyped instead {.immediate.} pragma which is kind of obsolete |
21:43:47 | OnO | macro modules*(i: untyped): stmt |
21:44:45 | transfuturist | yeah, that doesn't work. |
21:45:31 | OnO | ahh... I see... indeed it doesn't work |
21:46:12 | OnO | you neither can have: macro modules(n: varargs[untyped]): stmt |
21:46:32 | transfuturist | untyped doesn't work either, that's not really relevant to varargs |
21:46:50 | OnO | duh, but I understand you want to have unevaluated AST |
21:46:55 | OnO | ? |
21:47:13 | transfuturist | {.immediate.} works. |
21:48:28 | dom96 | Quora: Would the ability to specify the bind address be enough? |
21:48:33 | OnO | well, it doesn't really, coz it is equvalent of: macro modules*(i: untyped): stmt |
21:48:41 | OnO | so i argument is just a 1st parameter |
21:49:00 | OnO | 2nd and rest arguments are ignored |
21:49:52 | OnO | macro modules*(i: varargs[expr]): stmt {.immediate.} = echo i.repr and calling modules(1, 2, 3, 4) -> echoes just 1 |
21:50:25 | OnO | removing immediate gives just what you want |
21:50:45 | OnO | but all arguments needs to evaluated first |
21:51:08 | transfuturist | which would be the problem, since i'm calling it on undeclared identifiers |
21:51:25 | OnO | then I am afraid this is no go |
21:53:22 | * | gyeates quit (Ping timeout: 256 seconds) |
21:53:25 | transfuturist | it works with strings. |
21:54:17 | OnO | what do you mean? |
21:54:34 | OnO | strings instead undeclared identifiers? |
21:54:40 | transfuturist | yes |
21:55:13 | OnO | yes, strings are just literals, there is no evaluation there |
21:55:58 | transfuturist | and non-vararg untyped works fine |
21:58:35 | * | filcuc quit (Quit: Konversation terminated!) |
21:58:37 | Quora | dom96: yeah, I'd like to bind on 0.0.0.0 for the deployment tools I use (containers) |
21:58:51 | OnO | yeah, this is because mutliple args to varargs is overload, and .immediate. turns off any evalution, but hey what about not using commas |
21:59:00 | OnO | modules(a b c d) works with untyped |
21:59:16 | * | notfowl quit (Excess Flood) |
21:59:26 | OnO | gives funny AST, but you can pick the names from there: Command(Ident(!"a"), Command(Ident(!"b"), Command(Ident(!"c"), Ident(!"d")))) |
21:59:39 | dom96 | Quora: I will add that for you. |
21:59:48 | Quora | :D |
22:01:09 | * | notfowl joined #nim |
22:01:29 | * | BlaXpirit quit (Quit: Quit Konversation) |
22:01:47 | * | vikaton quit () |
22:03:21 | transfuturist | OnO: that is so hacky Dx |
22:03:42 | notfowl | transfuturist: there is another way around it |
22:04:15 | notfowl | Use a template that sends the varargs to a macro iirc |
22:06:42 | transfuturist | how so? |
22:07:09 | OnO | notfowl: would need to be immediate, and will bring same problem |
22:08:39 | OnO | actually there needs to be some case for macro varargs[untyped] argument |
22:09:04 | * | Siecje quit (Read error: Connection reset by peer) |
22:09:11 | OnO | currently it just checks for untyped, varargs[untyped] fails into "typed" category and gets evaluated :> |
22:09:22 | transfuturist | where in the code? |
22:10:42 | transfuturist | in the todo file: e needs to be some case for macro varargs[untyped] argument |
22:11:22 | transfuturist | special case varargs[untyped] and varargs[typed] * |
22:12:13 | Varriount | onionhammer: Merged in the new branch |
22:12:42 | OnO | transfuturist: how nice, so you just need to push Araq or try to implement the feature yourself ;) |
22:12:53 | transfuturist | giving it a go |
22:12:54 | transfuturist | :P |
22:13:49 | transfuturist | it uses magic, though, so i'm not sure where to look |
22:14:24 | * | Trustable quit (Quit: Leaving) |
22:16:20 | OnO | it's funny because currently "expr" === "untyped" |
22:16:23 | Varriount | onionhammer: All that remains is adding documentation for the new settings. |
22:16:50 | OnO | untyped* {.magic: Expr.} |
22:17:00 | OnO | same as expr* {.magic: Expr.} |
22:17:07 | transfuturist | ha |
22:17:23 | OnO | so I presume this is some not yet finished stuff |
22:18:44 | * | JoshuaT_ quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
22:19:23 | * | notfowl quit (Excess Flood) |
22:20:39 | * | notfowl joined #nim |
22:23:28 | * | boop is now known as boopisaway |
22:24:52 | OnO | good night everyone |
22:24:54 | * | OnO quit (Quit: My iMac has gone to sleep. ZZZzzz…) |
22:25:47 | renesac | one feature request I on't think is on the bug tracker is to allow named parameters after varargs |
22:25:54 | renesac | *don't |
22:26:11 | renesac | like the pyhon 3 print function |
22:31:44 | * | pregressive quit (Remote host closed the connection) |
22:32:05 | * | pregressive joined #nim |
22:32:53 | notfowl | Python can do this because there are no overloads |
22:34:19 | notfowl | Know of a language where you can define an accessor like this? `[]=` (obj; idxs: varargs[int]; val) |
22:34:23 | transfuturist | some compiler internals docs sure would be nice |
22:34:27 | * | ekarlso quit (Changing host) |
22:34:27 | * | ekarlso joined #nim |
22:35:55 | * | pregressive quit (Remote host closed the connection) |
22:37:56 | * | datanoise quit (Ping timeout: 252 seconds) |
22:38:29 | transfuturist | how could i find where the arguments to macros are evaluated... |
22:40:21 | * | cmk_zzz quit (Quit: Lost terminal) |
22:40:26 | transfuturist | evaltempl? |
22:45:11 | * | egrep joined #nim |
22:45:52 | transfuturist | semexprs, line 2101 |
22:46:56 | Araq | hey transfuturist |
22:47:02 | transfuturist | ahoy hoy |
22:47:03 | Araq | any luck with DLL reloading |
22:47:25 | transfuturist | well, i mean, it works pretty well by default |
22:47:33 | transfuturist | i'm trying to figure out a framework |
22:48:33 | * | pregressive joined #nim |
22:49:41 | Araq | transfuturist: there are internals documented here: http://nim-lang.org/docs/intern.html |
22:49:50 | transfuturist | ;_; |
22:49:51 | Araq | in particular: http://nim-lang.org/docs/intern.html#debugging-the-compiler |
22:50:21 | Araq | does that look mean you're aware of this? |
22:50:58 | transfuturist | oh, that has a guide on how to use git bisect |
22:51:16 | transfuturist | that look means i forgot about it >> |
22:55:45 | brson | ZZZZZZZZZ: you caught me! |
22:56:48 | Araq | transfuturist: what does that mean "it works pretty well by default"? |
22:57:35 | Araq | the feature is about exposing some reloadDLL("foo.dll") builtin that does the reloading for all the procs which have been dynlib: "foo.dll"'ed |
22:58:09 | * | HakanD__ quit (Quit: Be back later ...) |
22:58:19 | * | notfowl quit (Excess Flood) |
22:58:26 | transfuturist | ah, that's not required, though |
22:58:41 | * | HakanD__ joined #nim |
22:58:44 | transfuturist | instead you can use symAddr to assign to procvars |
22:59:09 | * | notfowl joined #nim |
22:59:27 | transfuturist | i decided to do it outside the compiler, since the basic features are all there |
23:01:32 | * | gsingh93 quit (Ping timeout: 264 seconds) |
23:02:12 | * | amaur left #nim (#nim) |
23:03:09 | * | HakanD__ quit (Ping timeout: 245 seconds) |
23:04:09 | Araq | transfuturist: yes but that doesn't help with all the wrappers that already use .dynlib. plus .dynlib is much easier to use anyway |
23:04:40 | * | gyeates joined #nim |
23:05:05 | notfowl | Can opengl s loading stuff be used |
23:05:25 | transfuturist | it would be nicer, but i'm just not good enough yet |
23:05:59 | Araq | transfuturist: well the major problem is that you're in #nim when I'm sleeping |
23:06:52 | transfuturist | anyway, what I'm trying now is getting varargs[untyped] to work |
23:07:08 | Araq | ok, that's nice |
23:07:20 | Araq | you need to patch compiler/sigmatch.nim for that |
23:07:34 | Araq | and nothing else, I think |
23:07:38 | transfuturist | phew |
23:07:41 | transfuturist | thankds |
23:08:25 | Araq | notfowl: I don't think so |
23:20:13 | * | brson quit (Quit: leaving) |
23:20:21 | * | brson joined #nim |
23:21:19 | * | brson quit (Client Quit) |
23:21:33 | * | brson joined #nim |
23:29:34 | * | pregressive quit (Remote host closed the connection) |
23:29:40 | * | Jehan_ quit (Quit: Leaving) |
23:32:15 | onionhammer | varriount awesome! |
23:33:54 | * | datanoise joined #nim |
23:36:22 | * | datanoise quit (Read error: Connection reset by peer) |
23:37:10 | onionhammer | varriount did you get the doccontinue stuff working in ST3? |
23:42:05 | * | Jesin joined #nim |
23:52:22 | * | johnsoft quit (Ping timeout: 256 seconds) |
23:53:24 | * | johnsoft joined #nim |
23:59:40 | * | transfuturist quit (Ping timeout: 272 seconds) |
23:59:55 | dom96 | Quora: Done. https://github.com/dom96/jester/commit/47320c6a74f594e337bfe36dbe87e9b66f5f037f |