00:10:33 | * | MJCaley joined #nim |
00:12:26 | * | RushPL quit (Remote host closed the connection) |
00:15:42 | * | RushPL joined #nim |
00:17:12 | * | Calinou_ is now known as Calinou |
00:30:13 | * | endragor joined #nim |
00:34:35 | * | endragor quit (Ping timeout: 240 seconds) |
00:37:35 | * | user0 quit (Ping timeout: 240 seconds) |
00:37:57 | * | jxy quit (Ping timeout: 240 seconds) |
00:43:00 | * | jxy joined #nim |
01:20:50 | * | Kingsquee joined #nim |
01:21:46 | * | couven92 quit (Quit: Client Disconnecting) |
01:34:33 | * | xkapastel quit (Quit: Connection closed for inactivity) |
02:12:03 | * | MJCaley quit (Quit: MJCaley) |
02:22:58 | * | chemist69 quit (Ping timeout: 256 seconds) |
02:36:42 | * | chemist69 joined #nim |
02:40:27 | * | jxy quit (Ping timeout: 240 seconds) |
02:44:27 | * | marenz_ quit (Ping timeout: 240 seconds) |
02:51:20 | * | jxy joined #nim |
02:58:09 | * | Kingsquee quit (Quit: https://i.imgur.com/qicT3GK.gif) |
02:59:42 | * | jxy quit (Ping timeout: 246 seconds) |
03:04:13 | * | jxy joined #nim |
03:05:41 | * | endragor joined #nim |
03:08:34 | * | craigger quit (Ping timeout: 268 seconds) |
03:08:57 | * | craigger joined #nim |
03:15:57 | * | vlad1777d quit (Ping timeout: 240 seconds) |
04:18:50 | * | dddddd quit (Remote host closed the connection) |
04:19:33 | * | ludocode quit (Read error: Connection reset by peer) |
04:38:50 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
04:54:39 | * | user0 joined #nim |
05:04:31 | * | c0ntribut0r quit (Ping timeout: 248 seconds) |
05:08:10 | * | c0ntribut0r joined #nim |
05:23:51 | * | c0ntribut0r quit (Ping timeout: 256 seconds) |
05:24:09 | user0 | How does one elegantly block the `=` operator for user defined types? |
05:25:30 | * | c0ntribut0r joined #nim |
05:39:27 | * | c0ntribut0r quit (Ping timeout: 240 seconds) |
05:39:57 | * | c0ntribut0r joined #nim |
05:42:42 | * | tinAndi joined #nim |
05:43:35 | * | user0 quit (Ping timeout: 240 seconds) |
05:48:15 | * | tinAndi quit (Ping timeout: 248 seconds) |
05:52:32 | FromGitter | <Varriount> What do you mean? |
05:55:15 | * | endragor quit (Remote host closed the connection) |
06:23:46 | Araq | proc `=`(dest: var MyType; src: MyType) {.error.} but it's in development |
06:24:54 | * | nsf joined #nim |
06:28:42 | * | endragor joined #nim |
06:33:18 | * | JStoker quit (Quit: JStoker is gone :() |
06:47:47 | * | xet7 quit (Quit: Leaving) |
06:51:18 | FromGitter | <survivorm> @shashlick, xterm-256color |
06:52:29 | FromGitter | <survivorm> @shachlick xfce4-terminal |
06:54:27 | shashlick | thanks! |
06:55:10 | * | xet7 joined #nim |
06:55:53 | * | devdri joined #nim |
07:00:36 | * | xet7 quit (Remote host closed the connection) |
07:00:41 | FromGitter | <survivorm> @PMunch a bit late answer, but i'm here |
07:01:21 | FromGitter | <survivorm> Currently going to write an article with all I've dug on parsing yet |
07:01:25 | * | xet7 joined #nim |
07:01:42 | Araq | pah, an article |
07:01:58 | Araq | give us compile-time PEG grammar support please |
07:02:12 | FromGitter | <survivorm> A lot, actually. And never seen it in one place, except for big books on compiler writing |
07:02:43 | FromGitter | <survivorm> @Araq - So, green flag on it? And the AST? |
07:03:11 | Araq | huh? |
07:03:38 | Araq | what do you mean? |
07:04:26 | FromGitter | <survivorm> Then I hear "parsing" - i think of 'text' -> 'some AST' translation, not just tokenization or 'matches', i can perfectly use regexp for it, thank you |
07:04:39 | * | JStoker joined #nim |
07:05:28 | FromGitter | <survivorm> Or did You ask about 'green flag'? |
07:08:45 | * | xet7 quit (Ping timeout: 264 seconds) |
07:11:07 | * | devdri quit () |
07:16:27 | * | solitudesf joined #nim |
07:20:14 | FromGitter | <survivorm> @Araq |
07:22:24 | * | xet7 joined #nim |
07:25:26 | * | endragor quit (Remote host closed the connection) |
07:25:54 | * | endragor joined #nim |
08:02:26 | * | endragor quit (Remote host closed the connection) |
08:02:57 | * | endragor joined #nim |
08:12:22 | * | PMunch joined #nim |
08:14:41 | * | endragor quit (Remote host closed the connection) |
08:15:09 | * | endragor joined #nim |
08:19:16 | * | yglukhov joined #nim |
08:26:28 | * | Vladar joined #nim |
08:34:48 | PMunch | Oh hi survivorm, you still around? |
08:35:23 | * | floppydh joined #nim |
08:36:32 | PMunch | And Araq, why doesn't PEG work on compile-time? Is there some technical issue with it? |
08:38:26 | * | dddddd joined #nim |
08:38:38 | FromGitter | <survivorm> Yeah |
08:38:45 | FromGitter | <survivorm> 'm here |
08:38:59 | PMunch | Just wanted to show you this: https://gist.github.com/kmizu/2b10c2bf0ab3eafecc1a825b892482f3 |
08:39:28 | PMunch | Someone made a small parser combinator library in Nim |
08:42:06 | FromGitter | <survivorm> Hmm. From a first glance - i do not understand how is this used |
08:42:19 | FromGitter | <survivorm> And is this finished at all |
08:42:34 | PMunch | Well, I'm still trying to work through the logic of it :P |
08:43:17 | PMunch | From the proc A() and downwards you can see how he uses it |
08:43:42 | PMunch | Pretty messy syntax but it shouldn't be too hard to use some macro-magic to clean that up |
08:44:39 | FromGitter | <survivorm> Ah, i see, i just viewed not full version of it, as it has no scroll on gitter |
08:44:54 | PMunch | Ah right |
08:46:56 | FromGitter | <survivorm> But for now,, i'm focused at the article, then back to my "work-work". So I'll return to the parsing in evening, maybe. And my idea for now was to take pegs lib with AST (from D, for eg), then compile it to c, then c2nim it and then learn tweaking it's algorithm to the nim-style |
08:47:18 | FromGitter | <survivorm> The same for BNF-thing |
08:47:36 | PMunch | Looking forward to reading the article |
08:48:18 | FromGitter | <survivorm> The version one will be in russian. And translation will be hard, i'm not so good in english |
08:48:45 | FromGitter | <survivorm> The point is - russian docs on parsing are sparce at best |
08:49:16 | PMunch | Ah damn, I don't speak Russian.. |
08:49:33 | PMunch | If you want help with translating though I can try to be of assistance |
08:49:49 | PMunch | Plus, your English is pretty good |
08:49:52 | FromGitter | <survivorm> Yeah, of cource |
08:51:27 | FromGitter | <survivorm> Think of it - I've not seen ANY article that speaks about all the parsing opportunities You have - brute force, regexp, bnf via flex-bison or likes, or native libs, pegs |
08:51:56 | FromGitter | <survivorm> So i decided to write one |
08:53:14 | PMunch | That sounds like an interesting read |
08:56:20 | * | endragor quit (Remote host closed the connection) |
08:56:47 | * | endragor joined #nim |
08:58:20 | * | devdri joined #nim |
09:01:05 | * | PMunch quit (Ping timeout: 240 seconds) |
09:03:46 | * | gmpreussner quit (Ping timeout: 268 seconds) |
09:05:04 | * | PMunch joined #nim |
09:05:33 | * | gmpreussner joined #nim |
09:07:05 | * | vlad1777d joined #nim |
09:09:57 | * | gmpreussner quit (Ping timeout: 240 seconds) |
09:21:45 | FromGitter | <Bennyelg> Guys, do we have any macro that mimik scala match statement ? |
09:24:59 | FromGitter | <andreaferretti> There is patty, but it is still very basic |
09:25:01 | FromGitter | <andreaferretti> https://github.com/andreaferretti/patty |
09:25:09 | FromGitter | <survivorm> @PMunch found pyBison package in python. I'll look into it and MAYBE try to port it to nim (python's my current "native" prog language :) ) |
09:25:20 | FromGitter | <andreaferretti> in particular, patterns cannot be nested |
09:25:28 | FromGitter | <andreaferretti> but PRs are welcome :-) |
09:25:42 | FromGitter | <Bennyelg> Great! @andreaferretti |
09:32:44 | * | endragor quit (Remote host closed the connection) |
09:33:12 | * | endragor joined #nim |
09:38:38 | Araq | PMunch: it's just VM bugs that keep it from working |
09:38:52 | Araq | but the real point is is that you cannot attach actions to matchings |
09:40:21 | * | endragor quit (Remote host closed the connection) |
09:41:07 | * | endragor joined #nim |
09:51:28 | * | natrys joined #nim |
10:02:53 | FromGitter | <survivorm> @Araq Which restriction it is& |
10:03:12 | Araq | it crashes iirc |
10:03:47 | * | Arrrr joined #nim |
10:04:18 | FromGitter | <survivorm> @Araq what's iirc? |
10:04:58 | FromGitter | <survivorm> And the question was about the actions, not compilation |
10:04:58 | Araq | "if I recall correctly" |
10:05:08 | FromGitter | <survivorm> Ah, that |
10:06:22 | * | endragor quit (Remote host closed the connection) |
10:06:33 | crem | it's WIMDRE in German |
10:06:46 | crem | Not sure if D can be ommited.. |
10:06:49 | * | endragor joined #nim |
10:08:22 | Araq | it can. |
10:08:55 | Araq | what about the actions? Pegs was written by a stupid guy who hardly knew how to design Nim APIs/DSLs |
10:10:01 | Araq | and yes, you want to support PATTERN: ACTION(s), not necessarily AST construction, AST construction is expensive |
10:24:02 | FromGitter | <survivorm> @Araq than maybe make this as a flag? |
10:24:37 | * | user0 joined #nim |
10:24:45 | * | PMunch quit (Read error: Connection reset by peer) |
10:26:12 | * | PMunch joined #nim |
10:26:12 | * | yglukhov quit (Read error: Connection reset by peer) |
10:26:14 | * | yglukhov_ joined #nim |
10:28:18 | PMunch | Araq, wasn't the PEGs module written by you? :P |
10:32:09 | * | yglukhov joined #nim |
10:32:09 | * | yglukhov_ quit (Read error: Connection reset by peer) |
10:33:10 | * | yglukhov_ joined #nim |
10:33:10 | * | yglukhov quit (Read error: Connection reset by peer) |
10:33:11 | Araq | yup, I wrote it |
10:36:19 | * | couven92 joined #nim |
10:39:49 | * | endragor quit (Remote host closed the connection) |
10:40:17 | * | endragor joined #nim |
10:40:54 | FromGitter | <andreaferretti> I like the approach of parboiled https://github.com/sirthias/parboiled/wiki where matchings consume or produce stuff on a stack |
10:41:16 | FromGitter | <andreaferretti> This way you can produce an AST that is much smaller then the full parse tree |
10:41:36 | FromGitter | <andreaferretti> This version constructs combinators at compile time https://github.com/sirthias/parboiled2/ |
10:44:53 | FromGitter | <krux02> Araq: do you plan to fix the inconsistency between `-3 mod 2` and `-3.0 mod 2.0` before 1.0? |
10:45:32 | FromGitter | <andreaferretti> why is -3.0 mod 2.0 even a thing? |
10:45:43 | FromGitter | <krux02> what do you mean? |
10:46:13 | FromGitter | <krux02> do you mean mod with a float type, or mod with a negative argument? |
10:46:27 | FromGitter | <andreaferretti> mod with a float type |
10:46:57 | FromGitter | <krux02> well I think it's very useful |
10:48:15 | FromGitter | <andreaferretti> I have never used it, or even guessed it existed, but apparently we do very different things :-) |
10:48:30 | * | endragor quit (Remote host closed the connection) |
10:48:57 | * | endragor joined #nim |
10:49:50 | FromGitter | <krux02> yes we do |
10:49:58 | FromGitter | <krux02> in computer graphics it is very useful |
10:51:15 | FromGitter | <krux02> but sadly the version in c++ (fmod) is completely useless, because of the behaviour in negative numbers |
10:51:53 | Araq | krux02: dunno, seems wrong to depart from what fmod does |
10:52:08 | FromGitter | <krux02> I like to disagree there |
10:52:20 | Araq | maybe introduce 'mod' vs 'rem' like Ada does |
10:53:18 | * | walkre joined #nim |
10:54:11 | FromGitter | <krux02> I could live with that |
10:54:36 | FromGitter | <krux02> there are two worlds who implement mod |
10:54:50 | FromGitter | <krux02> in the positive range they are the same in the negative, they are not |
10:55:34 | Araq | I never use 'mod' for negative numbers though |
10:56:03 | Araq | and you cannot tell me C++ isn't used for computer graphics either, really, seems risky to change |
10:57:33 | FromGitter | <krux02> trust me, it's save to change that |
10:57:36 | * | endragor quit (Remote host closed the connection) |
10:57:52 | * | miran quit (Quit: Page closed) |
10:58:04 | * | walkre quit (Ping timeout: 260 seconds) |
10:58:24 | FromGitter | <krux02> a quote from here: https://www.rapitasystems.com/blog/ada-c-rem-and-mod "Somewhat confusingly, in C99 standard the % operator is usually referred to as mod, although it actually implements the behavior of rem" |
10:59:23 | * | endragor joined #nim |
11:00:16 | FromGitter | <krux02> c++ is used for computer graphics a lot, but the standard mod is avoid because it is useless. People use the mod from for example glm: https://glm.g-truc.net/0.9.4/api/a00129.html#ga3bdf136bc96f670965cd2f48d14356b4 |
11:00:50 | * | endragor quit (Remote host closed the connection) |
11:01:14 | FromGitter | <krux02> https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/mod.xhtml |
11:01:38 | FromGitter | <krux02> but it would be dangerous to change the behavior of mod in nim for floating point values. |
11:02:29 | FromGitter | <GULPF> IMO `mod` should work like C/C++, but there should be a separate operator for floor mod |
11:03:13 | * | endragor joined #nim |
11:03:37 | * | kier quit (Quit: No Ping reply in 180 seconds.) |
11:04:05 | FromGitter | <krux02> @GULPF have you ever used and needed the mod behavior of mod like it is in c++? |
11:04:11 | * | endragor quit (Remote host closed the connection) |
11:05:06 | FromGitter | <krux02> I mean did you ever expect and needed a negative result for `mod(x, 5.0)`? |
11:06:42 | FromGitter | <GULPF> Not really, but I think people might be more familiar with the behavior of mod in C. Besides, I think it's important that `div` uses the same method as `mod`, and changing `div` to floor division would break a lot |
11:07:33 | FromGitter | <krux02> ok that might be true |
11:08:09 | FromGitter | <krux02> and no, people are surprised with the behavior of mod in C all the time. |
11:08:45 | FromGitter | <krux02> % in C is used, then the program crashes and they realize, shit I can't use % I need something else |
11:08:59 | * | kier joined #nim |
11:09:08 | FromGitter | <krux02> I've seen it |
11:09:15 | FromGitter | <krux02> and I had the experience |
11:09:28 | FromGitter | <krux02> here I really think it's good not to copy C. |
11:10:26 | * | endragor joined #nim |
11:10:55 | FromGitter | <krux02> what if Nim changes and says div and rem |
11:11:02 | FromGitter | <krux02> belong together? |
11:11:27 | * | devdri quit (Ping timeout: 248 seconds) |
11:11:51 | FromGitter | <GULPF> you mean that `rem` is trunc mod and `mod`is floor mod? |
11:17:27 | * | devdri joined #nim |
11:19:43 | * | Yardanico joined #nim |
11:21:02 | Araq | krux02: check what Rust does here please :-) |
11:22:12 | PMunch | https://stackoverflow.com/questions/31210357/is-there-a-modulus-not-remainder-function-operation |
11:22:18 | PMunch | Rust does rem as well it seems |
11:24:01 | PMunch | Since Nim uses the keyword mod and not just % I feel like it definitely should be an actual modulus operation |
11:24:20 | FromGitter | <krux02> @gulpf that is how it is in ada |
11:24:24 | PMunch | But also add rem for those who need that |
11:24:47 | PMunch | Calling remainder for mod is just confusing |
11:25:31 | FromGitter | <GULPF> I think Common Lisp also uses the same as Ada |
11:27:52 | Araq | https://mail.mozilla.org/pipermail/rust-dev/2013-April/003683.html |
11:27:58 | Araq | and onwards it goes |
11:28:32 | FromGitter | <krux02> https://stackoverflow.com/questions/4003232/how-to-code-a-modulo-operator-in-c-c-obj-c-that-handles-negative-numbers |
11:28:52 | FromGitter | <krux02> it seems like that `%` in C is implementation defined. lol |
11:30:19 | FromGitter | <krux02> honestly I think to have both modulo and remainder like in Ada is the best thing to have. |
11:30:31 | FromGitter | <krux02> I have no Ada experience, but that really seems like a good idea |
11:30:38 | FromGitter | <GULPF> I agree |
11:31:44 | * | tinAndi joined #nim |
11:32:34 | Araq | yeah, but 'rem' won't become a keyword, sorry |
11:33:59 | Araq | -7 /- 3 = -1 |
11:34:05 | Araq | -7 /+ 3 = 1 |
11:34:23 | Araq | "rem" and "mod" as operators anybody can remember |
11:34:45 | Araq | (I probably got it wrong though) |
11:34:48 | PMunch | That's just confusing.. |
11:34:59 | Araq | as I can't remember 'mod' nor 'rem' |
11:34:59 | PMunch | -7/-3 = ?? |
11:35:48 | PMunch | Modulo only returns positive numbers |
11:36:48 | Araq | /+ then. :P |
11:37:09 | Araq | or maybe %+ |
11:37:35 | * | tinAndi quit (Ping timeout: 248 seconds) |
11:37:45 | Araq | or /+/ vs /-/ |
11:38:09 | Araq | more bikeshedding to come |
11:38:11 | PMunch | Why not just mod and rem? |
11:38:19 | FromGitter | <GULPF> rem is used as a var name all the time |
11:38:26 | FromGitter | <GULPF> would break a lot |
11:38:26 | Araq | because these names are bad. |
11:38:55 | PMunch | But why do you think they are bad :P |
11:39:10 | Arrrr | why not wrap |
11:39:14 | Araq | I would like to remove the 'mod' and 'div' keywords from the language, not add more of them |
11:39:24 | PMunch | GULPF, well type is also often used (I'd say even more than rem) and that's a keyword |
11:39:35 | Araq | type is beyond repair :P |
11:39:40 | PMunch | Haha :P |
11:39:46 | Araq | but we can still get mod/rem right |
11:39:50 | PMunch | div as well though? |
11:39:59 | PMunch | What're you going to call it then? |
11:40:04 | Araq | // |
11:40:11 | PMunch | Eh, I guess that's okay |
11:40:13 | Araq | like Python. |
11:40:25 | PMunch | But /+ and /- is just confusing since you would need to space it out |
11:40:42 | Araq | yeah but that's just Nim's lexical rules at play here |
11:40:45 | federico3 | urgh |
11:40:51 | Araq | and you should use spaces around them anyway |
11:41:06 | federico3 | +1 PMunch |
11:41:23 | PMunch | Yeah but I can imagine a lot of people writing 2/-3 in a program and getting unexpected results.. |
11:41:27 | FromGitter | <alehander42> wow I can imagine a karax with `div` instead of tdiv :D |
11:41:36 | Araq | or maybe %+ vs %- |
11:42:05 | Arrrr | It will work as fine as <4 |
11:42:07 | PMunch | -% +% at least |
11:42:20 | Araq | these already exist, PMunch |
11:42:25 | PMunch | They do? |
11:42:27 | Araq | to do modulo arithmetic ... |
11:42:52 | Araq | so we have %- vs -% vs %+ vs +% |
11:43:07 | Araq | and the type checker is useless since it's all on integers |
11:43:14 | Araq | we need a better plan. |
11:43:27 | PMunch | Yeah, that'd just be a huge mess :P |
11:44:02 | PMunch | Ah so <op>% is unsigned arithmetic |
11:44:07 | PMunch | Interesting |
11:44:24 | Araq | maybe embrace Unicode operators? |
11:44:43 | PMunch | Oh god no :P How would you even type those? |
11:44:52 | PMunch | Apart from ΓΓΓ
of course |
11:44:53 | FromGitter | <GULPF> % for rem and %_ for mod? the _ kind of looks like a floor :P |
11:44:58 | FromGitter | <GULPF> *the _ |
11:45:33 | PMunch | ^_^ For rem and <_< for mod? :P |
11:45:37 | Araq | I don't understand the "floor" analogy. for me one can return negative numbers and the other doesn't |
11:46:05 | Araq | what's there to "floor" in a modulo operation? |
11:46:19 | FromGitter | <GULPF> @Araq floor/trunc is the terminology used in https://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/divmodnote-letter.pdf |
11:46:57 | * | devdri quit (Ping timeout: 240 seconds) |
11:47:00 | FromGitter | <krux02> yes unicode operators, I want Β¬β¨β§ for booleans as alternatives to `not` `or` `and` :P |
11:47:09 | * | derlafff quit (Remote host closed the connection) |
11:47:21 | FromGitter | <GULPF> the reasoning is that mod can be implemented using floor division, and rem can be implemented using truncating division |
11:47:35 | * | derlafff joined #nim |
11:47:46 | Araq | you really don't as usually operators evaluate all their arguments, krux02 |
11:48:09 | Araq | 'and' is much closer to an 'if' than it is to an & |
11:49:26 | Araq | but I made this point before and you shrugged it off ;-) |
11:49:34 | FromGitter | <krux02> I just found out, that x86 assembley has only truncating division and the division instruction calculates both, the remainder and the division result in the same instruction. And the integer division is one of the slowest instructions on the cpu even slower than float64 division |
11:51:03 | * | devdri joined #nim |
11:51:29 | FromGitter | <krux02> Yea we had that argument before. I know I wont't get my unicode Β¬β¨β§ operators, but I can still wish for them |
11:52:17 | * | craigger quit (Quit: bye) |
11:52:28 | * | craigger joined #nim |
11:52:44 | * | vlad1777d quit (Ping timeout: 276 seconds) |
11:53:03 | FromGitter | <krux02> and no I don't think `and` is close to an `if` it is close to an `β§` with lazy evaluation of the arguments |
12:04:51 | FromGitter | <andreaferretti> I'd rather have an operation that returns modulo and division result as a tuple at the same time without doing the same thing twice |
12:05:38 | FromGitter | <andreaferretti> but that's another story, I am actually happy with the name mod, looks much better than % and it is what mathematicians write |
12:06:06 | FromGitter | <andreaferretti> div is also nice to distinguish integer division from float division visually |
12:08:10 | * | tinAndi joined #nim |
12:18:29 | Araq | / //+ //- |
12:18:33 | Araq | // //+ //- |
12:18:40 | Araq | div, rem, mod |
12:18:55 | FromGitter | <krux02> not sure |
12:19:07 | FromGitter | <krux02> div could also be implemented in two ways :P |
12:19:54 | FromGitter | <krux02> @andreaferretti that would be analog to x86 assembler. I think that is a good thing. |
12:22:46 | FromGitter | <data-man> UnQLite 1.1.8 released, If someone uses it. |
12:26:21 | * | Snircle joined #nim |
12:27:00 | FromGitter | <krux02> http://ix.io/Eyb/c |
12:27:41 | FromGitter | <krux02> http://ix.io/Eyc |
12:31:01 | FromGitter | <krux02> http://ix.io/Eyd/c |
12:31:11 | FromGitter | <krux02> http://ix.io/Eye |
12:31:23 | FromGitter | <krux02> as you can see there is this uglyness around 0 |
12:32:34 | FromGitter | <krux02> (div, mod), (remdiv, rem) |
12:35:03 | FromGitter | <krux02> ``proc truncDiv(a,b: int): tuple[quotient, remainder: int]`` ``proc floorDiv(a,b: int): tuple[quotiont, remainder: int]`` |
12:46:46 | * | tinAndi quit (Ping timeout: 265 seconds) |
12:49:39 | FromGitter | <mratsim> normally itβs divmod and quotrem |
12:50:00 | FromGitter | <mratsim> And like andrea I would love a divmod proc that does the work only once ... |
12:51:12 | * | miran joined #nim |
12:52:14 | FromGitter | <ZarsBranchkin> @krux02 Is `company-mode` still unusable for you in `nim-mode`? Recently, after some updating, the completion takes way too long and hangs emacs for few seconds |
12:53:42 | * | niv quit (Quit: The Lounge - https://thelounge.github.io) |
12:53:55 | FromGitter | <GULPF> I think a good C compiler will optimize div + mod anyway |
12:54:41 | miran | re: "// //+ //-" == "div, rem, mod" --> please no |
12:54:48 | FromGitter | <ZarsBranchkin> Kind of wish to learn how `company-mode` backends work. This is what I find annoying about emacs, each mode has bit different approach at implementing things like auto completion backends or auto indentation, so it's all an inconsistent mess |
12:55:01 | * | niv joined #nim |
12:56:00 | FromGitter | <krux02> @ZarsBranchkin emacs is an inconsistent growing mess |
12:56:18 | FromGitter | <krux02> I use it too, and I also have no idea how to fix it |
12:56:47 | FromGitter | <ZarsBranchkin> Yeah, haha, the more you poke around in it, the more you realize how complex of a mess it is |
12:57:10 | FromGitter | <krux02> my gift of the day for you: (defun nim-repl () β "Switch to a nim REPL." β (interactive) β (switch-to-buffer (make-comint "nim-repl" "nim" nil "secret"))) [https://gitter.im/nim-lang/Nim?at=5a6731266117191e61a05e2a] |
12:57:42 | FromGitter | <ZarsBranchkin> o damn, I think this is exactly what I wanted the other day |
12:59:46 | FromGitter | <krux02> if you are on a command line you get the repl with "rlwrap nim secret" |
13:00:42 | FromGitter | <krux02> rlwrap applies gnu readline to nim. gnu readline is GPL so I think the license is incompatible with nim. But rlwrap allows to use it anyway. |
13:01:32 | FromGitter | <ZarsBranchkin> Nice, love how REPL is a secret switch of the nim compiler |
13:02:02 | FromGitter | <ZarsBranchkin> Now just need send to repl command, to evaluate buffer, function or region |
13:02:37 | FromGitter | <krux02> well don't expect too much of the repl. You won't be able to call into any C functions. |
13:02:52 | FromGitter | <krux02> it is all the nimvm and brings all limitations you have in macros as well. |
13:03:03 | FromGitter | <krux02> but if you know that it is really cool |
13:03:34 | FromGitter | <ZarsBranchkin> So it's a Nimscript interpreter? |
13:03:54 | FromGitter | <krux02> I think so |
13:04:23 | FromGitter | <ZarsBranchkin> Heard of it, didn't really check it out much, but it kind of seems like it |
13:04:33 | FromGitter | <krux02> could be, but I never wrote nimscript only macros. So I can't really do that comparison. |
13:22:02 | FromGitter | <Bennyelg> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a6736fad9f895c3604e40b3] |
13:41:19 | * | Arrrr quit (Ping timeout: 248 seconds) |
13:42:24 | * | devdri quit () |
13:50:18 | * | devdri joined #nim |
13:50:58 | FromGitter | <krux02> @Bennyelg try `[]` after the second argument |
13:51:42 | * | nsf quit (Quit: WeeChat 2.0.1) |
13:53:23 | * | devdri quit (Client Quit) |
13:58:23 | FromGitter | <allochi_twitter> Hi, I have a newbie question :), can I ask here? or should I just post in the forum? |
13:58:43 | FromGitter | <krux02> ask |
13:59:02 | FromGitter | <allochi_twitter> Thanks, I have a code snippet |
13:59:15 | FromGitter | <allochi_twitter> import json β β let content = readFile("fuse/dataset.json") β var dataset = parseJson(content) β ... [https://gitter.im/nim-lang/Nim?at=5a673fb3ce68c3bc74f2e8f7] |
13:59:23 | FromGitter | <allochi_twitter> opps |
14:00:01 | FromGitter | <allochi_twitter> How can I reference `Test` instance inside the `check` proc? |
14:00:19 | FromGitter | <allochi_twitter> Without passing it again like `condition.check(condition, node)` |
14:00:39 | FromGitter | <Bennyelg> @krux02 Didnt got you |
14:00:54 | FromGitter | <allochi_twitter> maybe the code need to be formatted |
14:01:19 | FromGitter | <krux02> @Bennyelg uups type, sorry |
14:01:28 | FromGitter | <krux02> yea format the code |
14:01:48 | FromGitter | <krux02> and use tripple backticks around the code |
14:02:02 | FromGitter | <allochi_twitter> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a67405ace68c3bc74f2ecae] |
14:02:26 | FromGitter | <allochi_twitter> it took me a little while to figure out how to post this :D |
14:02:57 | FromGitter | <allochi_twitter> so you see I have a `Test` type, and each test has itβs own `check` `proc` |
14:03:00 | * | gokr joined #nim |
14:03:08 | FromGitter | <krux02> yes I got that |
14:03:34 | FromGitter | <allochi_twitter> Currently the only way to pass a reference to the test instance is by actually passing it |
14:03:36 | FromGitter | <krux02> the check block has the test bound to the symbol t |
14:03:42 | FromGitter | <allochi_twitter> there is no `this` |
14:03:48 | FromGitter | <krux02> correct |
14:04:13 | FromGitter | <allochi_twitter> and I canβt just call `condition.check(node)` |
14:04:14 | FromGitter | <krux02> you can call the first argument this if you want |
14:04:23 | FromGitter | <krux02> correct |
14:04:54 | FromGitter | <allochi_twitter> well, my question is there is no way to call `condition.check(node)` instead of `condition.check(condition, node)` |
14:05:09 | FromGitter | <krux02> is it really that important? |
14:05:22 | FromGitter | <krux02> condition.check(condition, node) seems fine to me |
14:05:38 | FromGitter | <krux02> I like that it does not have a hidden this pointer |
14:05:48 | FromGitter | <allochi_twitter> well, not really, but Iβm trying to learn Nim by porting some of code, and I came across this. |
14:05:58 | FromGitter | <krux02> ok |
14:06:12 | FromGitter | <allochi_twitter> just wanted to make sure Iβm not missing something |
14:06:12 | FromGitter | <krux02> well in c++ a method has a hidden this argument |
14:06:31 | FromGitter | <krux02> but under the hood it still passes the this parameter, you just don't see it |
14:06:38 | FromGitter | <allochi_twitter> yes, I though that maybe Nim also |
14:06:48 | FromGitter | <krux02> no it doesn't |
14:07:13 | FromGitter | <allochi_twitter> Thanks for your help :) |
14:08:29 | * | Jesin quit (Quit: Leaving) |
14:08:56 | FromGitter | <krux02> @allochi_twitter https://nim-lang.org/docs/manual.html#overloading-resolution-automatic-self-insertions |
14:09:10 | FromGitter | <krux02> there is something, but I don't use it |
14:09:48 | FromGitter | <allochi_twitter> Thanks, I guess I need to spend some more time reading the Manual |
14:10:10 | FromGitter | <krux02> but you would still be required to pass explicitly the this parameter, you would just be able to save some typing in the function implementation. |
14:11:02 | FromGitter | <allochi_twitter> Well, the pragma will activate this for the whole module, interesting, I wonder if this has some perfromance cost |
14:12:07 | FromGitter | <allochi_twitter> Nah, I think I can live without it for now :), thanls a lot @krux02 |
14:15:05 | * | PMunch quit (Ping timeout: 240 seconds) |
14:15:44 | * | PMunch joined #nim |
14:55:37 | * | c0ntribut0r quit (Ping timeout: 256 seconds) |
14:56:18 | * | c0ntribut0r joined #nim |
14:59:42 | FromGitter | <nitely> @allochi_twitter write a wrapper? `proc check(t: var Test, j: JsonNode) = t.check(t, j)` then `check(condition, node)` |
15:02:58 | FromGitter | <nitely> not great in general, though |
15:06:41 | * | PMunch quit (Remote host closed the connection) |
15:06:44 | * | PMunch_ joined #nim |
15:08:45 | * | PMunch_ is now known as PMunch |
15:15:36 | * | devdri joined #nim |
15:16:27 | * | gokr quit (Ping timeout: 240 seconds) |
15:19:57 | * | c0ntribut0r quit (Ping timeout: 246 seconds) |
15:20:20 | FromGitter | <allochi_twitter> Haha, amazing @nitely, I just wonβt go that deep, but itβs a nice twist. Thanks! |
15:21:06 | * | c0ntribut0r joined #nim |
15:23:49 | * | PMunch_ joined #nim |
15:24:47 | * | PMunch quit (Ping timeout: 248 seconds) |
15:25:22 | * | PMunch_ is now known as PMunch |
15:31:30 | * | MJCaley joined #nim |
15:37:35 | * | c0ntribut0r quit (Ping timeout: 240 seconds) |
15:37:53 | * | c0ntribut0r joined #nim |
15:45:15 | * | MJCaley quit (Quit: MJCaley) |
15:47:35 | * | PMunch_ joined #nim |
15:48:00 | * | devdri quit () |
15:48:07 | * | PMunch quit (Disconnected by services) |
15:48:12 | * | PMunch_ is now known as PMunch |
15:49:28 | * | arnetheduck quit (Ping timeout: 265 seconds) |
15:50:53 | shashlick | is it possible to convert a string into a variable name at runtime? |
15:53:58 | * | jxy quit (Quit: leaving) |
15:55:49 | * | gmpreussner joined #nim |
15:57:55 | * | jxy joined #nim |
15:58:39 | PMunch | shashlick, no |
15:58:55 | PMunch | Variable names aren't compiled into your binary so they wouldn't mean much on runtime |
15:59:14 | PMunch | But what are you trying to do? There's probably another way to do it :) |
15:59:57 | shashlick | well, I have an array of file names which I'm using to load a bunch of content from text files using staticRead |
16:00:14 | * | MJCaley joined #nim |
16:00:42 | shashlick | that works fine but then I'm trying to pick the right const containing the filename but no way to do it without hard coding each file name |
16:01:18 | PMunch | Well in that case a table is probably the right choice |
16:01:38 | PMunch | https://nim-lang.org/docs/tables.html |
16:01:45 | shashlick | can you have a table built at compile time with a macro? |
16:02:45 | PMunch | You can do pretty much anything with a macro :P |
16:03:06 | shashlick | good good, let me fidget |
16:04:48 | * | nsf joined #nim |
16:06:36 | PMunch | So let me get this right. On compile-time you read in a bunch of files with staticRead. And on runtime you want the user to be able to select the correct file? In that case something like this would work: http://ix.io/EyA/ |
16:06:56 | PMunch | staticString is here just a way to emulate staticRead |
16:07:27 | * | gmpreussner quit (Ping timeout: 240 seconds) |
16:07:50 | * | gmpreussner joined #nim |
16:08:06 | PMunch | If you look at the source code the call to staticString is completely gone and the string is inserted where it would normally be |
16:12:32 | * | gokr joined #nim |
16:14:30 | shashlick | interesting |
16:14:58 | shashlick | i tried using staticRead in a template, but looks like I have to do that in a macro? or use this .compiletime. pragma |
16:15:32 | * | miran_ joined #nim |
16:15:34 | PMunch | .compileTime. is only for procs that get run on compileTime |
16:15:42 | PMunch | All templates get run on compileTime |
16:16:07 | PMunch | Do you have a snippet that shows what you are doing? |
16:16:44 | * | MJCaley quit (Quit: MJCaley) |
16:17:15 | shashlick | https://gist.github.com/anonymous/d5eb0a2fa9715c179d3b80377358dd9d |
16:19:11 | PMunch | Hmm, I'm guessing it's a problem with the walkDir |
16:20:09 | shashlick | Error: 'staticRead' can only be used in compile-time context <= that's the error I get |
16:20:44 | PMunch | Yeah |
16:20:57 | PMunch | walkDir isn't run on compileTime |
16:21:04 | PMunch | So it's not a compile time context |
16:21:07 | * | sz0 joined #nim |
16:21:59 | PMunch | Hmm |
16:22:07 | PMunch | It appears it doesn't work in a template at all |
16:22:10 | PMunch | That's strange |
16:22:40 | shashlick | I just upgraded to a macro and I get a different error |
16:22:57 | shashlick | Error: VM is only allowed to 'cast' between integers of same size |
16:23:09 | PMunch | Uhm, with the same snippet? |
16:23:31 | shashlick | https://gist.github.com/anonymous/1662326c7d52f5ca0f3d9aade792d73c |
16:25:40 | FromGitter | <Bennyelg> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a6762040ad3e04b1b5b614a] |
16:25:47 | FromGitter | <Bennyelg> how to get this working ? :) |
16:26:37 | PMunch | shashlick, there are some different bugs there |
16:26:54 | PMunch | But walkFiles doesn't work on compile time I think |
16:29:10 | PMunch | varargs[$, string] ? |
16:29:27 | PMunch | Or the other way, don't quite remember |
16:29:34 | PMunch | Bennyelg, ^ |
16:29:47 | FromGitter | <Bennyelg> I''l try thanks! |
16:31:19 | shashlick | PMunch: so I removed walkfiles and hard-coded the files, now it doesn't like the fact that KEYMAPSTRING_TABLE is undeclared |
16:31:23 | shashlick | i guess I should resort to hard coding to proceed for now |
16:31:53 | FromGitter | <krux02> @Bennyelg: don't use auto |
16:32:06 | FromGitter | <Bennyelg> its not working anyway |
16:32:14 | FromGitter | <andreaferretti> @shashlick use a `static:` block |
16:32:17 | FromGitter | <Bennyelg> I am just throwing away things to see how to get this working |
16:32:29 | FromGitter | <andreaferretti> otherwise the var is just a runtime variable |
16:33:01 | shashlick | andreaferreti: do you have an example? |
16:33:20 | FromGitter | <krux02> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a6763d0e014122650809cf4] |
16:33:20 | FromGitter | <andreaferretti> No, but I would try something like this |
16:33:27 | shashlick | ok found the documentation |
16:34:08 | * | MJCaley joined #nim |
16:34:08 | FromGitter | <andreaferretti> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a6764006117191e61a1afab] |
16:34:45 | FromGitter | <andreaferretti> I am not sure whether you can see the example over IRC |
16:35:04 | FromGitter | <andreaferretti> anyway, declare and populate your var in a static block |
16:35:17 | FromGitter | <andreaferretti> then assign it to a const at compile time |
16:35:25 | FromGitter | <krux02> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a67644dce68c3bc74f3e7d3] |
16:35:27 | FromGitter | <andreaferretti> the const will be usable at runtime |
16:35:50 | FromGitter | <andreaferretti> Β @krux02 solution is even simler |
16:36:23 | PMunch | shashlick, this works fine here: http://ix.io/EyH/ |
16:37:55 | shashlick | andreaferreti: I tried what you said, it complains with Error: cannot evaluate at compile time for const data = myTable |
16:38:08 | FromGitter | <Bennyelg> done π |
16:40:14 | shashlick | PMunch: your version also isn't compiling - Error: VM is only allowed to 'cast' between integers of same size |
16:40:55 | shashlick | PMunch: actually it worked - without walkfiles |
16:41:22 | shashlick | will experiment with static and compiletime |
16:41:24 | shashlick | thanks for your help! |
16:41:30 | * | gokr quit (Ping timeout: 246 seconds) |
16:41:44 | * | clyybber joined #nim |
16:45:03 | FromGitter | <krux02> when you write code for the VM, only use int and float |
16:45:13 | FromGitter | <krux02> don't use sized integer types like float32 or uint32 |
16:49:33 | * | c0ntribut0r quit (Ping timeout: 265 seconds) |
16:52:00 | * | endragor quit (Remote host closed the connection) |
16:53:27 | * | clyybber quit (Ping timeout: 240 seconds) |
16:57:13 | * | c0ntribut0r joined #nim |
16:58:23 | shashlick | probably walkfiles is doing that internally, cause my code doesn't |
17:01:45 | * | yglukhov_ quit (Remote host closed the connection) |
17:07:54 | * | clyybber joined #nim |
17:09:51 | FromGitter | <data-man> @shashlick: Try walkDir (or walkDirRec) from oswalkdir.nim |
17:10:03 | FromGitter | <Yardanico> @ZarsBranchkin https://gitter.im/nim-lang/twitch - #nim-offtopic |
17:11:40 | * | endragor joined #nim |
17:11:48 | * | PMunch quit (Quit: Leaving) |
17:12:56 | shashlick | it uses the same underlying walkCommon() function which does some integer work, might be some implicit casting going on there |
17:15:23 | * | Trustable joined #nim |
17:16:08 | FromGitter | <ZarsBranchkin> Ooh, hah, was confused by the different name |
17:16:29 | * | endragor quit (Ping timeout: 255 seconds) |
17:20:17 | * | floppydh quit (Quit: WeeChat 2.0.1) |
17:27:51 | * | programisto quit (Quit: WeeChat 1.4) |
17:28:38 | * | endragor joined #nim |
17:30:06 | * | clyybber quit (Quit: good night) |
17:30:14 | * | clyybber joined #nim |
17:30:14 | * | clyybber quit (Client Quit) |
17:30:30 | * | clyybber joined #nim |
17:30:30 | * | clyybber quit (Client Quit) |
17:30:46 | * | clyybber joined #nim |
17:30:46 | * | clyybber quit (Client Quit) |
17:30:54 | * | clyybber joined #nim |
17:30:54 | * | clyybber quit (Client Quit) |
17:31:10 | * | clyybber joined #nim |
17:31:10 | * | clyybber quit (Client Quit) |
17:31:26 | * | clyybber joined #nim |
17:31:26 | * | clyybber quit (Client Quit) |
17:31:52 | * | clyybber joined #nim |
17:31:52 | * | clyybber quit (Client Quit) |
17:32:00 | * | clyybber joined #nim |
17:32:00 | * | clyybber quit (Client Quit) |
17:32:15 | * | clyybber joined #nim |
17:32:15 | * | clyybber quit (Client Quit) |
17:32:31 | * | clyybber joined #nim |
17:32:31 | * | clyybber quit (Client Quit) |
17:32:42 | * | clyybber joined #nim |
17:32:42 | * | clyybber quit (Client Quit) |
17:32:50 | * | clyybber joined #nim |
17:32:50 | * | clyybber quit (Client Quit) |
17:33:06 | * | clyybber joined #nim |
17:33:06 | * | clyybber quit (Client Quit) |
17:33:09 | * | c0ntribut0r quit (Ping timeout: 256 seconds) |
17:33:22 | * | clyybber joined #nim |
17:33:22 | * | clyybber quit (Client Quit) |
17:33:26 | * | endragor quit (Remote host closed the connection) |
17:33:45 | * | clyybber joined #nim |
17:33:45 | * | clyybber quit (Client Quit) |
17:34:09 | * | clyybber joined #nim |
17:34:09 | * | clyybber quit (Client Quit) |
17:34:25 | * | clyybber joined #nim |
17:34:26 | * | clyybber quit (Client Quit) |
17:34:34 | * | clyybber joined #nim |
17:34:34 | * | clyybber quit (Client Quit) |
17:34:50 | * | clyybber joined #nim |
17:34:50 | * | clyybber quit (Client Quit) |
17:35:06 | * | clyybber joined #nim |
17:35:06 | * | clyybber quit (Client Quit) |
17:35:14 | * | clyybber joined #nim |
17:35:14 | * | clyybber quit (Client Quit) |
17:35:30 | * | clyybber joined #nim |
17:35:30 | * | clyybber quit (Client Quit) |
17:35:46 | * | clyybber joined #nim |
17:35:46 | * | clyybber quit (Client Quit) |
17:36:10 | * | clyybber joined #nim |
17:36:10 | * | clyybber quit (Client Quit) |
17:36:11 | * | c0ntribut0r joined #nim |
17:36:26 | * | clyybber joined #nim |
17:36:26 | * | clyybber quit (Client Quit) |
17:36:45 | * | clyybber joined #nim |
17:36:45 | * | clyybber quit (Client Quit) |
17:36:56 | * | clyybber joined #nim |
17:36:56 | * | clyybber quit (Client Quit) |
17:37:12 | * | clyybber joined #nim |
17:37:12 | * | clyybber quit (Client Quit) |
17:37:20 | * | clyybber joined #nim |
17:37:20 | * | clyybber quit (Client Quit) |
17:37:36 | * | clyybber joined #nim |
17:37:36 | * | clyybber quit (Client Quit) |
17:37:52 | * | clyybber joined #nim |
17:37:52 | * | clyybber quit (Client Quit) |
17:38:15 | * | clyybber joined #nim |
17:38:15 | * | clyybber quit (Client Quit) |
17:38:30 | * | clyybber joined #nim |
17:38:30 | * | clyybber quit (Client Quit) |
17:38:56 | * | clyybber joined #nim |
17:38:56 | * | clyybber quit (Client Quit) |
17:39:11 | * | clyybber joined #nim |
17:39:11 | * | clyybber quit (Client Quit) |
17:39:26 | * | clyybber joined #nim |
17:39:26 | * | clyybber quit (Client Quit) |
17:39:41 | * | clyybber joined #nim |
17:39:41 | * | clyybber quit (Client Quit) |
17:39:56 | * | clyybber joined #nim |
17:39:56 | * | clyybber quit (Client Quit) |
17:40:11 | * | clyybber joined #nim |
17:40:11 | * | clyybber quit (Client Quit) |
17:40:27 | * | clyybber joined #nim |
17:40:27 | * | clyybber quit (Client Quit) |
17:40:43 | * | clyybber joined #nim |
17:40:43 | * | clyybber quit (Client Quit) |
17:40:52 | * | clyybber joined #nim |
17:40:52 | * | clyybber quit (Client Quit) |
17:41:08 | * | clyybber joined #nim |
17:41:08 | * | clyybber quit (Client Quit) |
17:41:32 | * | clyybber joined #nim |
17:41:32 | * | clyybber quit (Client Quit) |
17:46:56 | * | natrys quit (Quit: natrys) |
17:47:49 | * | couven92 quit (Quit: Client disconnecting) |
17:49:44 | * | gokr joined #nim |
17:53:12 | GitDisc | <awr> Can I use assembly in nimscript (the reason: so i can use cpuid to see the available ISA extensions to pass to a c compiler to build a project) or is that a flat-out "lol no use nake instead" |
17:54:06 | * | clyybber joined #nim |
17:54:07 | * | MJCaley quit (Read error: Connection reset by peer) |
17:54:40 | * | MJCaley joined #nim |
17:54:51 | GitDisc | <awr> parsing `cat /proc/cpuinfo` and looking up ISA extensions from there isn't portable to windows |
17:58:59 | * | clyybber quit (Client Quit) |
18:01:56 | * | MJCaley quit (Quit: MJCaley) |
18:06:50 | Araq | lol no use nake instead |
18:07:25 | GitDisc | <awr> got it |
18:07:29 | GitDisc | <awr> thx |
18:11:56 | * | stisa joined #nim |
18:16:14 | GitDisc | <treeform> what is a good way to format floats in nim? I was looking at https://bitbucket.org/lyro/strfmt, but it has bugs like `(0.5).format("0.2f")` outputs `0.00` |
18:24:50 | * | sz0 quit (Quit: Connection closed for inactivity) |
18:26:05 | miran_ | @treeform - have you tried to use `import strformat`? |
18:26:30 | miran_ | you might need devel version of nim for it |
18:28:18 | FromGitter | <ZarsBranchkin> and what about https://nim-lang.org/docs/strutils.html#formatFloat,float,FloatFormatMode,range[],Char ? |
18:29:18 | shashlick | walkFiles() is not working in the VM since it calls getFilename() internally which does a cast - $cast[WideCString](addr(f.cFilename[0])) |
18:32:42 | shashlick | this is on Windows |
18:32:47 | shashlick | however, this works - https://gist.github.com/56d362417db90c6b3d0a2ff0fdcbec2d |
18:32:53 | shashlick | so there's something weird going on here |
18:33:36 | FromGitter | <krux02> shashlick: 502 Bad Gateway |
18:34:04 | shashlick | weird - that's on github? |
18:34:24 | FromGitter | <krux02> well when I click it I see it |
18:34:31 | FromGitter | <krux02> it's just the embeddeng that doesn't wrok |
18:37:40 | GitDisc | <awr> nimscript gives you listFiles (which isn't an iterator) |
18:43:28 | GitDisc | <treeform> @miran_ `Error: cannot open 'strformat'` |
18:44:19 | * | yglukhov joined #nim |
18:44:56 | GitDisc | <awr> https://nim-lang.org/docs/strutils.html#formatFloat,float,FloatFormatMode,range[],Char ? |
18:47:00 | GitDisc | <treeform> hmm `(0.312).formatFloat(precision=1)` out puts `0.312` but it should output `0.3` |
18:47:36 | GitDisc | <treeform> oh `(0.312).formatFloat(ffDecimal, precision=1)` works |
18:47:54 | shashlick | @awr: thanks will check it out |
18:50:06 | shashlick | @awr: unable to use listFiles() in this way - listFiles() not found, and cannot import nimscript |
18:50:32 | * | Trustable quit (Remote host closed the connection) |
18:54:52 | GitDisc | <treeform> got my charts drawing in nim: |
18:54:53 | GitDisc | <treeform> |
18:54:54 | GitDisc | <treeform> https://cdn.discordapp.com/attachments/371759389889003532/405435238735675414/unknown.png |
18:55:36 | * | yglukhov quit (Read error: Connection reset by peer) |
18:56:12 | * | yglukhov joined #nim |
19:01:11 | GitDisc | <awr> @shashlick |
19:01:36 | GitDisc | <awr> as a silly hack you could do gorge("ls -1p").splitLines.filterIt(not it.endsWith("/")) |
19:02:21 | shashlick | good point, will have to make it portable but that's a good ide |
19:02:56 | GitDisc | <awr> you may have to figure out how to prevent it from caching |
19:07:14 | * | yglukhov quit (Remote host closed the connection) |
19:15:24 | * | stisa quit (Remote host closed the connection) |
19:22:12 | * | yglukhov joined #nim |
19:33:02 | * | yglukhov quit (Remote host closed the connection) |
19:51:54 | * | Vindaar joined #nim |
19:53:31 | * | yglukhov joined #nim |
20:09:26 | * | scriptum joined #nim |
20:15:56 | * | yglukhov quit (Remote host closed the connection) |
20:16:31 | * | yglukhov joined #nim |
20:19:26 | * | Ven`` joined #nim |
20:36:13 | * | miran_ quit (Quit: Konversation terminated!) |
20:36:15 | * | Yardanico quit (Ping timeout: 248 seconds) |
20:37:46 | * | ofelas quit (Quit: shutdown -h now) |
20:39:37 | * | ofelas joined #nim |
20:45:25 | * | gangstacat quit (Quit: Δis!) |
21:01:46 | * | Jesin joined #nim |
21:04:03 | * | gangstacat joined #nim |
21:09:20 | * | Vladar quit (Quit: Leaving) |
21:14:49 | * | clyybber joined #nim |
21:16:30 | FromGitter | <wiltonlazary> Dear, im talking to people of https://github.com/vadimcn/vscode-lldb, its apears that is not too hard to add Nim language suport to this great debug tool. |
21:23:39 | * | devdri joined #nim |
21:28:02 | * | yglukhov quit (Remote host closed the connection) |
21:29:09 | * | beatmox quit (Remote host closed the connection) |
21:29:40 | * | beatmox joined #nim |
21:36:05 | * | stisa joined #nim |
21:38:56 | * | solitudesf quit (Quit: solitudesf) |
21:44:01 | * | solitudesf joined #nim |
21:53:12 | * | benoliver999 left #nim ("WeeChat 2.0.1") |
21:53:26 | * | xkapastel joined #nim |
21:54:03 | * | Ven`` quit (Ping timeout: 246 seconds) |
21:56:03 | * | Ven`` joined #nim |
21:56:47 | * | clyybber quit (Ping timeout: 248 seconds) |
21:59:32 | FromGitter | <honewatson> With nimble is there a way to install a package so it will save the dependency to your project? Something like... β β ```nimble install templates --save-dep``` [https://gitter.im/nim-lang/Nim?at=5a67b044ce68c3bc74f5b254] |
22:00:41 | * | clyybber joined #nim |
22:02:40 | * | Jesin quit (Quit: Leaving) |
22:03:20 | * | nsf quit (Quit: WeeChat 2.0.1) |
22:08:05 | * | Ven`` quit (Ping timeout: 240 seconds) |
22:08:30 | FromGitter | <Quelklef> Or some way to make Nim virtual enviros? |
22:09:39 | * | yglukhov joined #nim |
22:11:09 | * | Ven`` joined #nim |
22:12:24 | * | rauss quit (Quit: WeeChat 2.0.1) |
22:14:11 | * | rauss joined #nim |
22:15:12 | * | tinAndi joined #nim |
22:15:24 | * | clyybber quit (Ping timeout: 246 seconds) |
22:25:54 | FromGitter | <matrixbot> `pqflx3` 'nimble develop' clones a package to a local dir |
22:28:41 | FromGitter | <Quelklef> I don't think that's quite what he's looking for |
22:31:09 | FromGitter | <honewatson> Yes I want to manually avoid typing in the dependency |
22:51:11 | * | solitudesf quit (Ping timeout: 248 seconds) |
22:53:45 | * | Ven`` quit (Ping timeout: 264 seconds) |
22:56:23 | * | devdri quit () |
22:59:03 | * | Ven`` joined #nim |
22:59:05 | * | xet7 quit (Ping timeout: 240 seconds) |
22:59:09 | * | tinAndi quit (Ping timeout: 265 seconds) |
23:00:25 | * | tinAndi joined #nim |
23:08:37 | * | Ven`` quit (Ping timeout: 256 seconds) |
23:11:55 | * | Ven`` joined #nim |
23:12:53 | GitDisc | <treeform> Can some one help me with macros? I want to convert this code to work with JS: https://gist.github.com/treeform/929915fae3ce5923df69e940d2b657c7 I think right now it produces a bunch of `stdout.write`s but I need it to produce `echo foo & foo & foo` type of thing instead i think? |
23:14:15 | * | xet7 joined #nim |
23:15:57 | * | vlad1777d joined #nim |
23:17:58 | FromGitter | <tim-st> Why doesnt `echo uint64.high` work? |
23:22:09 | FromGitter | <Quelklef> `high(uint64)` isn't a thing. Hardcode it. |
23:22:44 | FromGitter | <tim-st> I was just interested for planning a structure, but I use int64.high*2 now |
23:23:19 | * | Ven`` quit (Read error: Connection reset by peer) |
23:23:24 | * | Ven` joined #nim |
23:25:58 | FromGitter | <tim-st> Btw is it a good idea to give every node in a tree an int to allow quick relation check instead of iterating through tree? |
23:29:03 | GitDisc | <treeform> nvm solve my own problem! thanks |
23:29:08 | GitDisc | <treeform> nvm solved my own problem! thanks |
23:39:33 | * | arnetheduck joined #nim |
23:54:24 | * | yglukhov quit (Remote host closed the connection) |