00:10:36 | * | endragor joined #nim |
00:15:32 | * | endragor quit (Ping timeout: 276 seconds) |
00:49:28 | FromGitter | <Varriount> @mratsim What do you think of a "do" prefix? |
00:54:35 | * | kunev- quit (Ping timeout: 240 seconds) |
00:55:24 | * | kunev joined #nim |
00:59:31 | * | sz0 quit (Quit: Connection closed for inactivity) |
01:05:02 | * | smt` quit (Read error: Connection reset by peer) |
01:05:45 | * | smt joined #nim |
01:19:01 | * | xkapastel joined #nim |
01:32:07 | * | nixfreak joined #nim |
01:34:04 | * | yglukhov joined #nim |
01:38:44 | * | yglukhov quit (Ping timeout: 276 seconds) |
01:46:33 | * | Lord_Nightmare quit (Ping timeout: 264 seconds) |
01:50:59 | * | Lord_Nightmare joined #nim |
01:53:16 | FromGitter | <gogolxdong> How to make this right? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5acc190b270d7d3708ae184b] |
01:58:00 | * | Lord_Nightmare2 joined #nim |
01:59:05 | * | dddddd quit (Remote host closed the connection) |
02:01:33 | * | Lord_Nightmare quit (Ping timeout: 264 seconds) |
02:01:33 | * | Lord_Nightmare2 is now known as Lord_Nightmare |
02:07:30 | * | Lord_Nightmare2 joined #nim |
02:08:09 | * | Lord_Nightmare quit (Ping timeout: 264 seconds) |
02:08:27 | * | Lord_Nightmare2 is now known as Lord_Nightmare |
02:09:16 | * | athenot quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
02:21:38 | FromGitter | <gogolxdong> hints item undefined. |
02:27:01 | * | Lord_Nightmare2 joined #nim |
02:28:17 | * | Lord_Nightmare quit (Ping timeout: 260 seconds) |
02:28:18 | * | Lord_Nightmare2 is now known as Lord_Nightmare |
02:33:21 | * | Lord_Nightmare quit (Ping timeout: 264 seconds) |
02:35:31 | * | Lord_Nightmare joined #nim |
02:59:31 | * | athenot joined #nim |
03:10:13 | * | endragor joined #nim |
03:11:41 | FromGitter | <gogolxdong> yes, I make it . ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5acc2b6d270d7d3708ae5436] |
03:12:47 | FromGitter | <gogolxdong> @Varriount ,you can use this combination to access XmlNode. |
03:15:02 | * | endragor quit (Ping timeout: 265 seconds) |
03:16:56 | * | athenot_ joined #nim |
03:17:58 | * | athenot quit (Ping timeout: 260 seconds) |
03:33:54 | FromGitter | <gogolxdong> It can also access JsonNode. |
03:52:43 | FromGitter | <gogolxdong> How to compare typedesc value of untyped args with string or something? |
03:54:17 | * | endragor joined #nim |
04:21:03 | * | ativol quit (Quit: WeeChat 1.9.1) |
04:55:36 | * | smt` joined #nim |
04:59:19 | * | smt quit (Ping timeout: 268 seconds) |
05:24:26 | FromGitter | <Varriount> @gogolxdong Untyped args don't have a type. |
05:28:05 | FromGitter | <gogolxdong> yes.What's the problem? |
05:35:03 | * | nixfreak quit (Ping timeout: 260 seconds) |
05:58:17 | * | smt` quit (Read error: Connection reset by peer) |
05:58:40 | * | smt` joined #nim |
06:03:44 | FromGitter | <gogolxdong> I am unable to switch the macro `.` according to the type of JsonNode or XmlNode. |
06:14:22 | * | Vladar joined #nim |
06:22:11 | * | nsf joined #nim |
06:22:31 | * | aguspiza joined #nim |
06:25:42 | * | athenot_ quit (Ping timeout: 260 seconds) |
06:47:58 | * | aguspiza quit (Ping timeout: 260 seconds) |
06:57:31 | FromGitter | <gogolxdong> I am trying this ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5acc605adf3e0fb547bf3cf9] |
06:59:19 | FromGitter | <Varriount> @gogolxdong Why not just have two procedures, one for JsonNode and one for XmlNode? |
07:01:43 | FromGitter | <gogolxdong> only one type can use . as a chain expression. |
07:01:56 | FromGitter | <gogolxdong> in this context. |
07:02:50 | FromGitter | <gogolxdong> others have to be unique. |
07:07:18 | * | rokups joined #nim |
07:07:27 | * | rockcavera quit (Remote host closed the connection) |
07:07:55 | FromGitter | <gogolxdong> I am trying to make the `.` works like object accessor for serializer . |
07:14:31 | * | max3 quit (Quit: Connection closed for inactivity) |
07:15:24 | FromGitter | <gogolxdong> or ⏎ `````` [https://gitter.im/nim-lang/Nim?at=5acc648c6d7e07082bd9f98d] |
07:17:53 | * | rockcavera joined #nim |
07:20:39 | * | yglukhov joined #nim |
07:25:27 | * | yglukhov_ joined #nim |
07:25:28 | * | yglukhov quit (Read error: Connection reset by peer) |
07:26:56 | FromGitter | <mratsim> @Varriount do is fine by me. But I think `doSort`, `sorted`, `mitems`are too much possibilities |
07:31:57 | * | Torro joined #nim |
07:37:33 | * | dyce[m] quit (*.net *.split) |
07:45:55 | * | floppydh joined #nim |
08:00:28 | * | Torro left #nim ("-bye") |
08:03:05 | * | gmpreussner quit (Ping timeout: 268 seconds) |
08:05:13 | * | gmpreussner joined #nim |
08:07:02 | * | sendell joined #nim |
08:07:33 | * | byte512 quit (Ping timeout: 264 seconds) |
08:13:12 | FromGitter | <Varriount> @mratsim |
08:13:33 | FromGitter | <Varriount> I agree. Perhaps the pay tense could be deprecated? |
08:13:41 | FromGitter | <Varriount> *past |
08:14:53 | FromGitter | <Varriount> I always get confused about wether the past tense modifies in-place or the current tense does. |
08:15:29 | FromGitter | <Varriount> Another possibility is having an "on" suffix. `replaceOn`... |
08:15:49 | FromGitter | <alehander42> that's nice |
08:17:02 | FromGitter | <Varriount> Or maybe "in" would be better. `replaceIn`, `toUpperCaseIn`. Hm |
08:17:16 | FromGitter | <narimiran> `replaceSelf`, `sortSelf`? |
08:19:32 | FromGitter | <Varriount> Possibly. |
08:19:33 | FromGitter | <mratsim> too long |
08:19:56 | FromGitter | <mratsim> 2 letter prefix or suffix is ok, 4 starts to get long I think |
08:20:13 | Tanger | Hey folks! Anybody know of a library that implements RSA signing? |
08:20:32 | FromGitter | <Varriount> Tanger: Do you mean SHA? |
08:20:47 | FromGitter | <mratsim> We don’t have it in Nimcrypto: https://github.com/cheatfate/nimcrypto |
08:20:52 | FromGitter | <narimiran> `replaces`, `sorts`, `toUpperCases`? :) |
08:21:56 | Tanger | Yeah, I think so Varriount. I'm looking to sign a JWT with "SHA256withRSA (also known as RSASSA-PKCS1-V1_5-SIGN with the SHA-256 hash function)" |
08:22:05 | Tanger | Am I incorrect in thinking that this is a 2-part process? |
08:22:06 | FromGitter | <Varriount> @mratsim How usable is that library? I might use it in my code, instead of the hmac and sha modules. |
08:22:30 | FromGitter | <mratsim> Well, it will be used in production for our blockchain app |
08:22:40 | FromGitter | <mratsim> It will pass a security audit before deployment |
08:23:00 | FromGitter | <mratsim> Only it depends on Nim-devel at the moment |
08:24:37 | FromGitter | <mratsim> @Tanger I think your best bet right now is to use nim-openssl binding: https://github.com/genotrance/nimssl |
08:25:01 | FromGitter | <mratsim> bindings are generated on the fly with the same name/arguments as the original lib |
08:25:18 | Tanger | Ahh, cool! Thanks! |
08:25:35 | FromGitter | <Varriount> @narimiran Same problem as the past tense. |
08:25:41 | * | yglukhov_ quit (Read error: Connection reset by peer) |
08:25:48 | FromGitter | <mratsim> @shashlick there really should be a way to see the proc arguments |
08:26:18 | * | yglukhov joined #nim |
08:27:25 | FromGitter | <narimiran> but is there really a problem (a need for change) with the current way of nim procs regarding self-mutating procs? |
08:28:53 | FromGitter | <mratsim> If I say: `reverse` and `reversed` do you instantly know which one is the mutating version without looking at the docs? |
08:31:22 | FromGitter | <narimiran> `reversed` should be mutating one |
08:32:43 | FromGitter | <narimiran> `"my string".reversed` is, well, my string reversed. and `reverse("my string")` is, "I need you to take this string of mine and give me the reverse of it" |
08:34:56 | * | smt joined #nim |
08:37:28 | FromGitter | <andreaferretti> Hi all |
08:37:32 | * | smt` quit (Ping timeout: 260 seconds) |
08:37:42 | FromGitter | <andreaferretti> Does anyone know something to use for AES in Nim? |
08:37:58 | FromGitter | <andreaferretti> I tried NimAES, but it seems not to compile on 0.18 |
08:38:35 | FromGitter | <andreaferretti> while openssl_evp seems to target an old version of OpenSSL and does not link with a recent one |
08:39:05 | FromGitter | <andreaferretti> I could bind the functions I need on my own |
08:39:15 | FromGitter | <andreaferretti> but hoped someone had already done the work |
08:45:05 | FromGitter | <gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5acc7991270d7d3708afa354] |
08:45:19 | FromGitter | <mratsim> @andreaferretti we build/use nimcrypto at Status: https://github.com/cheatfate/nimcrypto |
08:45:51 | FromGitter | <mratsim> otherwise Nimssl should work: https://github.com/genotrance/nimssl |
08:46:09 | FromGitter | <mratsim> it will download the latest OpenSSL upon install and generate the bindings dynamically |
08:46:23 | FromGitter | <andreaferretti> for nimcrypto I only see hash functions |
08:46:33 | livcd | andreaferretti: i just nimble installed the nimAES and ran the example |
08:46:35 | FromGitter | <alehander42> @narimiran well you know it's the opposite, right |
08:46:44 | FromGitter | <andreaferretti> while nimssl apparently only has sha |
08:46:45 | FromGitter | <alehander42> (or at least I think it is in python) |
08:46:55 | FromGitter | <mratsim> @narimiran : currently reversed returns a new openarray while reverse is the in-place mutating one, so wrong ;) |
08:47:03 | livcd | oh my bad i am still on Nim Compiler Version 0.17.3 |
08:47:19 | FromGitter | <andreaferretti> @livcd yes, it has issue from v0.18 on |
08:47:43 | FromGitter | <alehander42> so yeah it seems the names can be confusing |
08:47:46 | FromGitter | <andreaferretti> @mratsim are you aware that any of the libs you mentioned includes AES? |
08:47:49 | FromGitter | <narimiran> @alehander42 @mratsim hahahaha, this is the best answer to my question if there's a problem with the current situation! :) :) |
08:48:10 | FromGitter | <alehander42> :D |
08:48:51 | FromGitter | <mratsim> @andreaferretti : https://github.com/cheatfate/nimcrypto/blob/669274baff80015f60e056c0569ee55a0baec791/nimcrypto/rijndael.nim#L10 |
08:49:35 | FromGitter | <andreaferretti> oh thank you, I had missed it |
08:49:44 | FromGitter | <andreaferretti> looking by alphabetical order :-) |
08:51:17 | FromGitter | <andreaferretti> does it include block cipher modes or should I roll out my own? |
08:52:15 | FromGitter | <mratsim> is that for arbitrary data length? |
08:55:05 | FromGitter | <mratsim> Ask in an issue, I wouldn’t know for AES |
08:56:13 | livcd | andreaferretti: just compiled it also on 0.18.1 |
09:03:18 | FromGitter | <gogolxdong> the code above works for XmlNode and JsonNode , have a try , save double quotes. |
09:16:02 | FromGitter | <andreaferretti> @livcd what os are you using? |
09:16:16 | FromGitter | <andreaferretti> on Mac OSX I am not even able to import it |
09:16:58 | FromGitter | <andreaferretti> trying to compile a file that imports nimAES results in clang trying to generate a giant lookup table and never actually completing |
09:17:28 | FromGitter | <andreaferretti> https://github.com/jangko/nimAES/issues/5 |
09:17:45 | FromGitter | <andreaferretti> @mratsim thank you |
09:18:30 | FromGitter | <alehander42> oh man I helped somebody in the crystal channel with a nim solution thinking it was the nim channel |
09:18:47 | FromGitter | <alehander42> :D I need to start drinking black tea in the morning |
09:19:19 | FromGitter | <krux02> yea guess what I am already doing |
09:19:52 | * | aziz joined #nim |
09:20:08 | * | aziz quit (Client Quit) |
09:21:04 | * | couven92 joined #nim |
09:31:13 | FromGitter | <andreaferretti> @livcd I just noticed the issue only appears with -d:release |
09:44:22 | * | xkapastel quit (Quit: Connection closed for inactivity) |
09:57:23 | FromGitter | <krux02> Araq: If I recall correctly, you were pretty much against the introduction of a functional programming library in Nim, because for loops were a much simpler and more general solution, and yet I find parts of a functional programming library implemented here and there. For example right now I I have `macros.nestList` right in front of me, wich is simply a bad version of `fold`. `fould` can be found in any functional |
09:57:23 | FromGitter | ... programming library. |
09:58:27 | Araq | eine Schwalbe macht noch keinen Sommer. |
09:59:20 | FromGitter | <krux02> well ok, but `nestList` is something that I need to deprecated anyway, bcause of the deprecation of NimIdent |
09:59:38 | FromGitter | <krux02> now is the opportunity to replace it with a proper fold |
10:00:04 | FromGitter | <krux02> `fold`/`reduce` |
10:00:41 | Araq | nestList is a fine name |
10:01:03 | FromGitter | <krux02> ok I keep the name |
10:01:09 | Araq | it doesn't apply a function 'f' to anything, it nests a list |
10:01:24 | FromGitter | <krux02> but a folding operation as a starting symbol, so that empty lists work, too |
10:01:54 | FromGitter | <krux02> no it doesn't apply a function 'f`, it applies the function `newCall` |
10:02:13 | Araq | you all have this tendency to walk through the desert and then say "ok, I am gonna refresh myself in this pool of water nearby" |
10:02:35 | FromGitter | <krux02> ?? |
10:03:38 | FromGitter | <krux02> well I could add an optional third argument to nestList. |
10:04:06 | FromGitter | <krux02> and then I am happy |
10:04:17 | FromGitter | <krux02> everything that worked before still works the same way |
10:04:39 | FromGitter | <krux02> but `nestList` just become a tiny bit more useful |
10:05:14 | Araq | and a tiny bit slower to compile ;-) but it's ok, do it. |
10:05:30 | FromGitter | <krux02> not really |
10:05:44 | FromGitter | <krux02> yea a tiny bit you are right |
10:07:24 | Araq | btw I still want your Option[T] optimization. is that merge-ready |
10:07:25 | livcd | andreaferretti: i will try with release. I am on w10 |
10:15:04 | * | dyce[m] joined #nim |
10:21:16 | FromGitter | <krux02> Araq: I thought it is an unwanted optimization, I haven't looked into it for some time I will check that later |
10:38:30 | FromGitter | <krux02> Araq: in this line: https://github.com/nim-lang/Nim/blob/devel/compiler/guards.nim#L771 there is a when declared statement. But for what? Is it necessary that the compiler can be compiled with on older standard library? |
10:41:27 | FromGitter | <krux02> Araq: looks like the bug got fixed and the copy nim tree is not necessary anymore |
10:43:22 | Araq | krux02: well it for compat with an older Nim |
10:43:33 | Araq | yay, bugs get fixed. |
10:48:31 | FromGitter | <krux02> I add a comment in nest List that it is also known as fold expression |
10:48:37 | FromGitter | <krux02> http://en.cppreference.com/w/cpp/language/fold |
10:49:19 | FromGitter | <krux02> just so that this function get's a hit when someone searches for it |
10:52:04 | FromGitter | <krux02> And I would really like to call the arguments on the now new function `nestList` `op`, `pack` and `init` |
10:52:27 | Araq | if it makes you happy |
10:52:33 | FromGitter | <krux02> yay, it does |
10:52:36 | FromGitter | <krux02> :) |
10:59:29 | FromGitter | <coffeepots> Nim doesn't allow ranges with a 64 bit scope? Was hoping to make a Natural for int64 |
11:00:31 | livcd | andreaferretti: worke |
11:00:32 | livcd | d |
11:00:59 | FromGitter | <krux02> nim does allow ranges with 64bit scope, just the most upper bit is the sign bit |
11:02:02 | FromGitter | <coffeepots> I get a type mismatch for range[0..12345678901] |
11:02:39 | FromGitter | <coffeepots> Woop, just needed to cast values :D range[0'i64..12345678901'i64]# |
11:06:41 | FromGitter | <krux02> hmm but it is a good point if the range operator should interpret the 0 literal as 64 bit when the other argument is in that range |
11:07:49 | FromGitter | <coffeepots> You only need to specify the first param, so range[0'i64..12345678901] is fine |
11:08:19 | FromGitter | <krux02> yea it is fine but it could be smarter ;) |
11:09:08 | Araq | yay my foot is getting better |
11:09:19 | Araq | maybe there is hope for me. |
11:10:24 | * | Araq sprained his foot :-/ |
11:17:57 | Araq | no condolences, heh? |
11:18:09 | FromGitter | <coffeepots> Ouch :/ Easily done too, I managed to almost sprain mine from accidentally skipping a step on the stairs (bent the wrong way a bit), not fun! |
11:19:42 | * | SenasOzys quit (Ping timeout: 260 seconds) |
11:20:39 | FromGitter | <narimiran> Araq: I thought you were talking about your imaginary foot to make some point that you have shot your foot with some feature, or something like that :D |
11:21:05 | FromGitter | <Vindaar> @Araq So no marathon training for now, huh? :/ Well, I'm sitting here with an injury in my left wrist, which keeps me from all sports I enjoy since July last year :( |
11:21:21 | Araq | well the marathon is on Sunday :-( |
11:21:33 | FromGitter | <Vindaar> that sucks :( |
11:22:10 | Araq | yeah, will see what the doctor says tomorrow |
11:23:08 | Araq | stupid beginner's mistake, was too fast downhill, oversaw some root |
11:28:08 | FromGitter | <Vindaar> I wouldn't necessarily call it a beginner's mistake. Can happen to anyone |
11:30:09 | Araq | maybe but I wasn't supposed to run fast to begin with |
11:31:12 | Araq | and I shouldn't have picked the woods either, should have practiced on asphalt |
11:33:25 | * | SenasOzys joined #nim |
11:34:12 | FromGitter | <andreaferretti> @livcd thank you, maybe it is just an issue on OSX |
11:34:24 | FromGitter | <andreaferretti> anyway for now I am using nimcrypto |
11:34:28 | FromGitter | <andreaferretti> works for what I need |
11:34:44 | FromGitter | <andreaferretti> it would be nice to refresh those openssl bindings though |
11:35:30 | FromGitter | <Vindaar> @Araq: Nah, imo that's the wrong attitude. Too easy to blame oneself for something like this in hindsight. You were simply unlucky. Stay positive and concentrate on getting better. If you miss this marathon, there's heaps more in the future! |
11:35:51 | Araq | thank you. :-) |
11:38:37 | * | dddddd joined #nim |
11:53:55 | * | leorize joined #nim |
12:02:02 | * | byte512 joined #nim |
12:21:12 | FromGitter | <exts> how do you set a relative path to the current exe when loading files? for example I created a command line tool w/ json settings and what ever folder i execute the tool in looks for the json file in that folder rather than the folder of the exe. |
12:21:24 | FromGitter | <exts> (without linking directly to it) |
12:21:52 | FromGitter | <exts> current exe folder * |
12:37:11 | shashlick | nimssl does have aes wrapped but it's untested. Shouldn't be too hard to get it working |
12:38:39 | Araq | exts: os.getAppDir() / "file.txt" |
12:42:57 | * | SenasOzys quit (Ping timeout: 264 seconds) |
12:46:38 | * | SenasOzys joined #nim |
12:47:12 | FromGitter | <krux02> Araq: I wonder if it is a good idea to abuse `strVal` to get the identifier name and symbol name |
12:47:56 | FromGitter | <krux02> It would make the code simple in several cases |
12:48:21 | Araq | it's what I would do nowadays too. |
12:48:42 | Araq | seems like a good idea, yeah. |
12:50:12 | FromGitter | <Vindaar> @krux02 it's what I thought strVal was for originally. I think that'd be good |
12:50:25 | FromGitter | <krux02> ok thanks for the feedback I will do it |
12:50:43 | FromGitter | <krux02> then I think the additional procedures can disapear again |
12:53:42 | Araq | the better then. |
13:01:21 | Araq | btw I like 'replaceIn' |
13:01:32 | Araq | and think this should make it into NEP-1 |
13:03:59 | * | gokr joined #nim |
13:04:07 | * | gokr left #nim (#nim) |
13:10:33 | * | SenasOzys quit (Ping timeout: 264 seconds) |
13:15:55 | * | SenasOzys joined #nim |
13:16:59 | FromGitter | <Varriount> @mratsim , @cheatfate : In nimcrypto, is `sha2.update(ctx, "abc"); sha2.update(ctx, "def")` the same as `sha2.update(ctx, "abcdef")`? |
13:32:26 | * | SenasOzys quit (Ping timeout: 256 seconds) |
13:42:18 | * | SenasOzys joined #nim |
13:51:24 | * | LyndsySimon quit (Quit: ~) |
13:51:37 | * | LyndsySimon joined #nim |
14:00:25 | * | r4vi quit (Quit: ~) |
14:00:37 | * | r4vi joined #nim |
14:02:33 | * | leorize quit (Ping timeout: 260 seconds) |
14:03:25 | * | enigmeta quit (Quit: ~) |
14:03:31 | * | dashed quit (Quit: ~) |
14:03:37 | * | enigmeta joined #nim |
14:03:45 | * | dashed joined #nim |
14:10:39 | * | Senketsu quit (Remote host closed the connection) |
14:10:58 | * | arecaceae quit (Remote host closed the connection) |
14:11:21 | * | arecaceae joined #nim |
14:13:27 | * | Senketsu joined #nim |
14:17:15 | * | smt` joined #nim |
14:21:04 | * | smt quit (Ping timeout: 265 seconds) |
14:21:36 | * | endragor quit (Remote host closed the connection) |
14:22:22 | FromGitter | <krux02> hmm, I broke js backend |
14:22:43 | FromGitter | <krux02> the js code generation broke, how did I do that, I wonder |
14:27:17 | yglukhov | Anyone knows of file system monitoring lib? I'm pretty sure I've seen one... |
14:27:58 | shashlick | araq: curious which direction you wanted to take https://github.com/nim-lang/Nim/pull/7440? |
14:28:55 | FromGitter | <krux02> araq: would it be safe to set the name of a symbol after generation, or should this better be avoided |
14:29:32 | Araq | better avoid it but for now it seems safe |
14:29:40 | Araq | shashlick: "pathRelativeToInvoker" |
14:30:04 | Araq | Nim has a concept that is "relative to the file it's written in" |
14:30:08 | Araq | for example |
14:30:14 | Araq | # foo.nim |
14:30:24 | shashlick | but does compiler really change directory anywhere besides staticRead/Exec? |
14:30:34 | Araq | import bar # prefers the bar.nim next to foo.nim |
14:30:53 | Araq | on the contrary, it really doesn't change the directory anywhere. |
14:31:28 | Araq | the goal is to make these two the same: |
14:31:35 | Araq | nim c -r src/main.nim |
14:31:42 | Araq | cd src && nim c -r main.nim |
14:32:01 | Araq | when your macro uses getCurrentDir() that invariant breaks |
14:32:16 | FromGitter | <data-man> @yglukhov: Binding to fswatch lib https://github.com/idlewan/nim-fswatch |
14:32:33 | shashlick | so if you did pathRelativeToInvoker() in both those cases, what will you get? |
14:33:22 | shashlick | I just think it's a bit confusing since all build is run in a specific directory and everything is relative to that in the source |
14:33:46 | Araq | that's not true for any Nim related build. |
14:34:04 | Araq | or rather. |
14:34:24 | Araq | that is true for Nim in general, yes, and it's not confusing, it's how things need to work. |
14:35:07 | shashlick | ok then I'm probably just not understanding how you see pathRelativeToInvoker() working |
14:36:13 | Araq | well I still don't understand how your macro works, but I'd guess it should use instantiationInfo() |
14:37:47 | yglukhov | data-man: thanks! I'm pretty sure I've seen a pure one though... |
14:37:56 | shashlick | keeping the macro aside, all I want to know is the exact location of a file with both staticRead and staticExec, especially when I use those in a nimble library |
14:38:26 | shashlick | if I make those calls in a library, all paths are relative to ~/.nimble/pkg/lib/abc.nim and I cannot access anything in the actual source directory |
14:38:48 | shashlick | so it's not possible to perform common tasks - read/write/execute in side that source directory, whatever it may be |
14:39:23 | Araq | so add getProjectDir() or something |
14:40:06 | shashlick | I can name it anything, but I'm just trying to understand how it would be different than the behavior or return value of getCurrentDir() |
14:40:22 | shashlick | if compiler never changes directories |
14:40:26 | Araq | it needs to be completely different |
14:41:47 | Araq | map it to options.gProjectPath |
14:44:38 | FromGitter | <data-man> @yglukhov: Which OS? |
14:45:37 | yglukhov | data-man: i'm on macos, but anything is welcome |
14:45:58 | shashlick | araq: okay so it is already known, I just need to write a proc that returns that value |
14:46:10 | Araq | yes, sorry for the confusion |
14:46:57 | shashlick | how do I get options into vmops.nim? import /? |
14:47:21 | Araq | import options |
14:47:27 | Araq | if it doesn't do that already |
14:48:02 | shashlick | ok I'll try it out |
14:48:23 | shashlick | meanwhile, I presume you don't want either get/setCurrentDir |
14:48:26 | shashlick | in the VM |
14:48:33 | shashlick | how about putEnv() |
14:50:55 | FromGitter | <data-man> @yglukhov: Win & Linux https://github.com/snowlt23/nimwatch |
14:51:06 | Araq | don't care about putEnv() |
14:51:43 | Araq | environment variables are state I have to replicate on all machines that I happen to use, I dislike them. |
14:51:57 | yglukhov | data-man: awesome, that's probably what i was looking for. Thanks! |
14:53:13 | shashlick | I figured it would be useful if you kick off some staticExec() which had to be manipulated by env. vars during build |
14:55:26 | Araq | couven92 might give us some answers |
14:57:30 | shashlick | araq: switching over to https://github.com/nim-lang/Nim/pull/7442 - were there any other concerns with that? |
14:58:23 | shashlick | wow github is down!? |
14:58:27 | * | miran joined #nim |
14:59:05 | * | athenot joined #nim |
14:59:14 | shashlick | just for my vpn ugh |
15:00:22 | Araq | shashlick: is very nice now. needs a changelog entry. |
15:00:43 | shashlick | ok I'll take care of that |
15:02:30 | FromGitter | <krux02> Araq: there are environment variables that are quite useful. And those environment variables contain actually useful information |
15:03:16 | shashlick | krux02: vm already has getEnv() for that, this is just putEnv() |
15:03:18 | FromGitter | <krux02> but only if they are provided by the system |
15:03:32 | FromGitter | <krux02> what should putEnv be useful for? |
15:03:40 | FromGitter | <krux02> can nim create a subprocess? |
15:03:50 | shashlick | staticExec() |
15:04:21 | FromGitter | <krux02> yea you are right |
15:04:23 | FromGitter | <krux02> that is useful |
15:05:51 | Araq | krux02: I could say the same about the registry and you would oppose. |
15:06:11 | * | aguspiza joined #nim |
15:10:09 | FromGitter | <krux02> well I would not |
15:10:52 | FromGitter | <krux02> and I agree to your critique about environment variables |
15:11:30 | FromGitter | <krux02> but I have the impression that some people feel super productive when then can set all their environment variables correctly on all their systems |
15:15:49 | FromGitter | <krux02> but I think for stuff like "COLUMNS" the environment variable is actually quite useful. |
15:16:06 | FromGitter | <krux02> that should not be a global configuration file |
15:16:20 | shashlick | they are useful no doubt but I think it's pain to recreate from one system to the next |
15:16:47 | FromGitter | <krux02> yea I think for things like PATH env vars are a pain |
15:17:14 | FromGitter | <krux02> most horrible: PROGRAM_X_HOME |
15:17:27 | FromGitter | <krux02> or even more anti productivity: |
15:18:07 | FromGitter | <krux02> PROGRAM_X_LICENSE_DIR |
15:23:52 | Araq | env vars are often a patch over the directory hierarchy mess. it is /usr/lib/Python2.3 or /usr/local/lib/Python2.3, meh we'll have key to this information called PYTHON_PATH that fucks the hierarchy in order to know for sure |
15:24:16 | FromGitter | <data-man> @Araq: If we move the timers.nim to lib/pure but modify system/timers.nim (for compatibility), will this be correct? ⏎ ⏎ ```import lib/pure/timers``` [https://gitter.im/nim-lang/Nim?at=5accd71f080a385053190c97] |
15:24:44 | Araq | data-man, if it works, yes. |
15:24:54 | FromGitter | <data-man> Ok |
15:30:16 | euantor | Regarding the file system watcher stuff, I wonder if something like async streams would be useful for Nim: https://www.dartlang.org/tutorials/language/streams |
15:30:35 | euantor | I can see a few uses where it could be useful |
15:30:53 | Araq | yeah we need them too |
15:37:09 | FromGitter | <data-man> lib/pure/timers.nim(1, 2) Error: module names need to be unique per Nimble package; module clashes with /home/dataman/Projects/Nim/lib/system/timers.nim :( |
15:37:21 | shashlick | araq: how do I avoid the UnknownMagic warning - getProjectPath() works fine but I still get a warning |
15:38:09 | Araq | why is that a magic? |
15:38:16 | FromGitter | <alehander42> ah yeah await for was pretty cool |
15:38:16 | FromGitter | <data-man> @Araq: Maybe new module stopwatch? |
15:38:26 | FromGitter | <alehander42> right now you can still imitate it with a macro ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5accda7227c509a774f957bc] |
15:38:32 | * | jaco60 joined #nim |
15:38:36 | shashlick | araq: in system.nim you have to declare it |
15:38:38 | Araq | data-man: you did it wrong, I think |
15:38:39 | FromGitter | <alehander42> which compiles to ^ * |
15:38:43 | shashlick | doing it similar to gorgeEx() |
15:38:56 | FromGitter | <alehander42> but I guess that's a bit of a hack, it seems to rquire async iterators |
15:39:05 | Araq | shashlick: hmmmm |
15:40:36 | Araq | well to avoid the warning introduce a define like nimHasProjectPath and then do in system.nim |
15:40:43 | FromGitter | <alehander42> how hard would it be to support async iterators |
15:40:49 | Araq | when defined(nimHasProjectPath): |
15:41:16 | Araq | proc getProjectPath*(): string {.magic: "GetProjectPath".} |
15:41:52 | Araq | btw you can add that to macros.nim, not system.nim |
15:43:03 | Araq | async iterators oh my |
15:43:26 | Araq | no idea how they work. write a macro first? |
15:49:11 | shashlick | araq: i'm trying to move the implementation into macros.nim but how do I import options |
15:49:44 | Araq | you can only move the .magic prototype to macros.nim |
15:49:51 | FromGitter | <data-man> Yeah, I replaced ```import``` to ```include``` in system/timers.nim and it's works. What to use for js (getTicks)? |
15:49:55 | shashlick | ok fair |
15:50:00 | Araq | the compiler doesn't care where the .magic declarations reside |
15:50:41 | Araq | it will pick them up and resolve them when used. |
15:51:35 | shashlick | but do I still register it as a systemop? |
15:52:38 | FromGitter | <krux02> well you can import it from macros and then export it |
15:52:45 | shashlick | it still doesn't like the magic - unknown magic |
15:52:53 | FromGitter | <krux02> I am just not sure if that is the best thing you can do |
15:52:58 | FromGitter | <exts> thanks Araq |
15:53:05 | shashlick | there's nothing special around gorgeEx, how does it accept that? |
15:53:31 | FromGitter | <exts> haven't been following closely, how far/close is 1.0 btw? |
15:53:33 | FromGitter | <krux02> shashlick: magics are predefiend in the compiler. |
15:53:56 | FromGitter | <krux02> so an old compiler will failt to compile that code |
15:54:03 | FromGitter | <krux02> therefore you need bootstrapping |
15:54:14 | FromGitter | <krux02> that is this when defined thing |
15:54:29 | Araq | it's also usually save to just ignore this warning |
15:54:53 | FromGitter | <exts> wrote my first nim code in like 3 years using docopts lib this past weekend, felt good. |
15:55:00 | Araq | you need a '= discard' body for the declaration and then old compilers will eat it |
15:55:30 | FromGitter | <Varriount> @exts Every time some asks about 1.0, it gets pushed back another month. :p |
15:55:37 | FromGitter | <exts> :D |
15:55:52 | FromGitter | <alehander42> @Araq why can't I generate `await x` in the result of an untyped macro? |
15:56:21 | FromGitter | <Varriount> @alehander42 Doesn't a macro need to call some other function to expand macros in it's body? |
15:56:49 | FromGitter | <krux02> Araq: it seems you have pretty bad experience with linux. |
15:56:50 | FromGitter | <alehander42> but I just want to generate the macro invocation and let nim deal with it after my macro expansion |
15:56:52 | FromGitter | <alehander42> as usual |
15:57:01 | shashlick | ok got it working, I misread gorgeEx - it has discard and no magic pragma |
15:57:17 | shashlick | had to add a macrosop to vmops to register under that module |
15:57:37 | Araq | well either you register it |
15:57:47 | Araq | or you use a new magic enum value |
15:58:49 | FromGitter | <data-man> I wonder why the version number so important. Rolling release! :) |
15:59:37 | FromGitter | <alehander42> otherwise something like https://gist.github.com/alehander42/b99dc1b3c65f0438bfe85412b5edb078 seems to be sufficient for a simple version of asyncFor |
16:00:01 | FromGitter | <alehander42> based on a normal iterator that yields Future-s |
16:00:05 | * | nsf quit (Quit: WeeChat 2.0.1) |
16:00:13 | FromGitter | <alehander42> and lets the macro insert the `await` where it's needed |
16:01:48 | * | Trustable joined #nim |
16:02:00 | FromGitter | <alehander42> it seems reactor.nim by @zielmicha already has stuff like this but it seems it uses its own macro for async iterators https://github.com/nim-lang/Nim/issues/6576 |
16:04:59 | FromGitter | <krux02> what is the target use case for this asyncFor? |
16:07:48 | FromGitter | <alehander42> we wondered if we can have something like Dart async streams |
16:07:55 | * | sendell quit (Remote host closed the connection) |
16:08:38 | FromGitter | <alehander42> but asyncFor is not so important, that part can be just `for` + await indeed |
16:09:00 | FromGitter | <krux02> I haven't used dart |
16:09:07 | FromGitter | <krux02> but I do know openmp |
16:09:31 | FromGitter | <krux02> but the overhead to create the threads kill all the performance benefit for most use cases |
16:09:35 | FromGitter | <krux02> at least my use cases |
16:11:06 | FromGitter | <krux02> anyway I have to go |
16:22:31 | * | Trustable quit (Remote host closed the connection) |
16:29:33 | shashlick | araq: works great for my use case, and the others as well |
16:30:01 | * | jaco60 quit (Read error: No route to host) |
16:33:52 | shashlick | have pushed the changes, please review when you can |
16:34:30 | shashlick | @mratsim - just saw your comment on nimssl - ya, really need to figure out https://github.com/genotrance/nimgen/issues/1 |
17:45:24 | * | noonien joined #nim |
17:52:11 | * | gokr joined #nim |
17:53:02 | * | gokr left #nim (#nim) |
17:59:31 | * | deech joined #nim |
18:00:00 | deech | Hi all, possibly dumb question, why does the following typecheck? https://pastebin.com/rXkN6CU0 |
18:01:09 | miran | deech: if you do `let a = foo()`, you'll see that `a == 0` |
18:01:44 | deech | Is it implicity returning a default value? |
18:02:09 | miran | the `result` is implicitly declared and initialized with the default value (for `int` that is 0) |
18:02:51 | deech | Ah, that makes sense, thanks! |
18:03:35 | * | floppydh quit (Remote host closed the connection) |
18:04:23 | * | floppydh joined #nim |
18:05:56 | deech | I suggest this behavior be prominently documented in the manual and would love a compiler that turns off default initialization. |
18:06:30 | deech | s/a compiler/a compiler flag/ |
18:06:45 | Araq | fwiw I agree... |
18:08:57 | FromDiscord | <treeform> Araq, i changed how I was doing the sql parser stuff: https://github.com/nim-lang/Nim/pull/7490 |
18:08:57 | miran | heh, and i would like to not have to do `result = @[]` and `result = ""` :) |
18:09:14 | miran | different strokes for different folks.... |
18:09:25 | FromDiscord | <treeform> Araq, you are right the nkFunction stuff was probably not a good idea. |
18:10:17 | miran | deech: https://nim-lang.org/docs/tut1.html#procedures-result-variable - the behaviour is documented below the example |
18:12:27 | deech | miran: Thanks! |
18:13:41 | deech | What purpose does default initialization (vs. a type error) serve except convenience? |
18:14:53 | * | xkapastel joined #nim |
18:30:56 | * | darithorn joined #nim |
18:34:10 | Araq | it was/is somewhat hard to make hash tables work without default initialization for the slots in the underlying array |
18:43:08 | * | tiorock joined #nim |
18:43:08 | * | tiorock quit (Changing host) |
18:43:08 | * | tiorock joined #nim |
18:43:08 | * | rockcavera is now known as Guest54135 |
18:43:08 | * | Guest54135 quit (Killed (karatkievich.freenode.net (Nickname regained by services))) |
18:43:08 | * | tiorock is now known as rockcavera |
18:51:26 | * | yglukhov quit (Read error: Connection reset by peer) |
18:52:01 | * | yglukhov joined #nim |
18:53:32 | * | rockcavera quit (Ping timeout: 260 seconds) |
19:05:03 | * | rockcavera joined #nim |
19:33:19 | shashlick | dom96: the forum RSS feed has bad links - it appends /1 to the url which results in a 404 |
19:33:54 | * | nsf joined #nim |
19:35:23 | * | rokups quit (Quit: Connection closed for inactivity) |
19:45:01 | dom96 | shashlick: Pretty sure the thread was just moderated |
19:45:11 | dom96 | appending that shouldn't cause issues |
19:46:01 | shashlick | dom96: check out https://forum.nim-lang.org/t/3742/1#23297 <= first link in threadActivity.xml right now |
19:46:44 | shashlick | i think that thread id itself doesn't exist |
19:46:51 | dom96 | yep |
19:46:53 | dom96 | fixed |
19:46:55 | shashlick | it's actually 3696 |
19:47:49 | shashlick | ok nm, looks like you fixed it :) |
20:06:07 | FromGitter | <data-man> https://github.com/nim-lang/Nim/issues/7562 ⏎ Poll: remove the --advanced switch |
20:06:28 | * | deech` joined #nim |
20:09:46 | Araq | meh just read the generated html documentation |
20:14:40 | * | miran quit (Quit: Konversation terminated!) |
20:27:22 | * | yglukhov quit (Remote host closed the connection) |
20:28:57 | * | yglukhov joined #nim |
20:30:17 | FromGitter | <data-man> --patterns:on|off - turn pattern matching ⏎ What is it? |
20:33:34 | * | yglukhov quit (Ping timeout: 268 seconds) |
20:34:06 | * | icebattle joined #nim |
20:39:47 | * | couven92 quit (Quit: Client disconnecting) |
21:11:12 | * | deech`` joined #nim |
21:13:03 | * | deech` quit (Ping timeout: 260 seconds) |
21:20:16 | * | Vladar quit (Quit: Leaving) |
21:26:34 | * | noonien quit (Quit: Connection closed for inactivity) |
22:42:02 | rauss | Does anyone have any good suggestions for nim omnifunc in vim/neovim? |
22:43:13 | rauss | Have only found one plugin that has it, but it's terrible. Just dumps all possible words or something, without regard to types or context. The source code says it uses nimsuggest but there's no way... or it's not using it well |
22:44:38 | rauss | I just started looking into making my own, or maybe fixing the baabelfish one, but wanted to ask here first |
22:47:35 | * | nsf quit (Quit: WeeChat 2.0.1) |
22:48:26 | shashlick | Let me know if you find out rauss |
22:48:37 | rauss | +1 |
22:50:46 | * | aguspiza quit (Ping timeout: 264 seconds) |
22:52:18 | rauss | shashlick: I know it's not a problem with nimsuggest. I tried out vscode, and the autocomplete is amazing. But it's also not a problem with vim, because there are others (TypeScript's tsuquyomi) that are amazing too |
22:57:40 | * | NimBot joined #nim |
23:05:29 | FromGitter | <mratsim> @deech you can use {.noInit.} to avoid default initialization |
23:05:36 | shashlick | Ale is good for syntax check |
23:06:06 | FromGitter | <mratsim> also default initialization is only for stack object. And I think it’s a sane default |
23:07:05 | FromGitter | <mratsim> @Varriount, yes if you use contexts it’s stateful, it’s like you append data in your buffer |
23:07:32 | FromGitter | <mratsim> otherwise you can use sha2.digest(“abcdef”) |
23:07:48 | FromGitter | <mratsim> if you want to reset the context you need to call init. |
23:07:56 | FromGitter | <mratsim> (regarding nimcrypto) |
23:17:33 | * | floppydh quit (Remote host closed the connection) |
23:17:57 | * | tiorock joined #nim |
23:17:57 | * | tiorock quit (Changing host) |
23:17:57 | * | tiorock joined #nim |
23:17:57 | * | rockcavera is now known as Guest31060 |
23:17:57 | * | Guest31060 quit (Killed (moon.freenode.net (Nickname regained by services))) |
23:17:57 | * | tiorock is now known as rockcavera |
23:18:21 | * | floppydh joined #nim |
23:20:32 | * | libman_ quit (Quit: leaving) |
23:28:01 | * | SenasOzys quit (Remote host closed the connection) |
23:29:27 | * | SenasOzys joined #nim |
23:32:00 | FromGitter | <zacharycarter> o/ |
23:32:16 | FromGitter | <gogolxdong> How to echo a NimNode? |
23:32:31 | FromGitter | <zacharycarter> echo repr? |
23:32:41 | FromGitter | <zacharycarter> not sure what you're trying to do exactly |
23:33:05 | FromGitter | <gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5acd49b1109bb04332ac3750] |
23:33:19 | FromGitter | <zacharycarter> errr |
23:33:22 | FromGitter | <zacharycarter> this should be a macro I think |
23:33:31 | FromGitter | <zacharycarter> oh I see |
23:33:42 | FromGitter | <gogolxdong> 'repr' doesn't support 'void' type |
23:33:47 | FromGitter | <zacharycarter> one second |
23:35:28 | FromGitter | <zacharycarter> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5acd4a407c3a01610dcc2ff6] |
23:39:00 | FromGitter | <gogolxdong> I want to see the generated procs. |
23:41:21 | FromGitter | <zacharycarter> well I commented out those lines - but assuming you un-comented them |
23:41:46 | FromGitter | <zacharycarter> the only way I know of dumping macros is through these helper macros - https://nim-lang.org/docs/macros.html#17 |
23:45:23 | FromDiscord | <2vg> Hey! Benchmark has been updated! |
23:45:23 | FromDiscord | <2vg> https://github.com/tbrand/which_is_the_fastest |
23:45:24 | FromDiscord | <2vg> |
23:45:24 | FromDiscord | <2vg> * Nim rank |
23:45:24 | FromDiscord | <2vg> - jester: 26 / 36 |
23:45:24 | FromDiscord | <2vg> - mofuw: 9 / 36 |
23:45:24 | FromDiscord | <2vg> |
23:45:26 | FromDiscord | <2vg> But I'm sad because my rank is low... |
23:45:43 | FromGitter | <zacharycarter> let's fix this ^ |
23:45:47 | FromGitter | <zacharycarter> :D |
23:49:20 | FromGitter | <zetashift> @2vg didn't you get some great speeds at TechEmpowers benchmarks? |
23:52:30 | FromDiscord | <2vg> zetashift: Since this benchmark is a measurement of routing, the number of simple requests does not seem to be related |
23:53:59 | FromDiscord | <2vg> Although it did not officially participate in techempower, since pull requests were merged, it will be counted from the next round.. |
23:53:59 | FromDiscord | <2vg> |
23:53:59 | FromDiscord | <2vg> https://github.com/TechEmpower/FrameworkBenchmarks/pull/3515 |
23:54:34 | FromGitter | <zacharycarter> I don't even understand how something like this gets bench marked - isn't latency an uncontrollable factor? |
23:55:04 | FromGitter | <zacharycarter> sorry for my very naive question |
23:57:21 | FromGitter | <zacharycarter> okay - sorry - I wasn't aware you were the author of mofuw |
23:57:24 | FromDiscord | <2vg> It is probably the result of wrk's latency |
23:57:24 | FromDiscord | <2vg> Since routing also includes parsing of parameters and so on, it seems that we are investigating the speed including that time |
23:57:55 | FromDiscord | <2vg> ;) |
23:58:27 | FromGitter | <zacharycarter> I mean I'm not surprised Crystal and Rust outperform Nim tbh - I would poke dom and see if he has any ideas to boost performance |
23:58:42 | FromGitter | <zacharycarter> You could try swapping out the GC and see if that has any effect on it |
23:59:29 | FromGitter | <zacharycarter> also I don't think Nim's async implementation is necessarily ideal yet - I mean I know Nim v2 is like a stupid catch phrase at this point - but I think there are ideas in the works for Nim's future to improve in that area |
23:59:50 | FromGitter | <zacharycarter> But the fact that you're only losing to crystal and Rust I think is a good sign |
23:59:57 | FromGitter | <zetashift> iirc dom86 said he didn't focusing on implementing/fixing those benchmarks |