<< 10-04-2018 >>

00:10:36*endragor joined #nim
00:15:32*endragor quit (Ping timeout: 276 seconds)
00:49:28FromGitter<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:16FromGitter<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:38FromGitter<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:41FromGitter<gogolxdong> yes, I make it . ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5acc2b6d270d7d3708ae5436]
03:12:47FromGitter<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:54FromGitter<gogolxdong> It can also access JsonNode.
03:52:43FromGitter<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:26FromGitter<Varriount> @gogolxdong Untyped args don't have a type.
05:28:05FromGitter<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:44FromGitter<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:31FromGitter<gogolxdong> I am trying this ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5acc605adf3e0fb547bf3cf9]
06:59:19FromGitter<Varriount> @gogolxdong Why not just have two procedures, one for JsonNode and one for XmlNode?
07:01:43FromGitter<gogolxdong> only one type can use . as a chain expression.
07:01:56FromGitter<gogolxdong> in this context.
07:02:50FromGitter<gogolxdong> others have to be unique.
07:07:18*rokups joined #nim
07:07:27*rockcavera quit (Remote host closed the connection)
07:07:55FromGitter<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:24FromGitter<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:56FromGitter<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:12FromGitter<Varriount> @mratsim
08:13:33FromGitter<Varriount> I agree. Perhaps the pay tense could be deprecated?
08:13:41FromGitter<Varriount> *past
08:14:53FromGitter<Varriount> I always get confused about wether the past tense modifies in-place or the current tense does.
08:15:29FromGitter<Varriount> Another possibility is having an "on" suffix. `replaceOn`...
08:15:49FromGitter<alehander42> that's nice
08:17:02FromGitter<Varriount> Or maybe "in" would be better. `replaceIn`, `toUpperCaseIn`. Hm
08:17:16FromGitter<narimiran> `replaceSelf`, `sortSelf`?
08:19:32FromGitter<Varriount> Possibly.
08:19:33FromGitter<mratsim> too long
08:19:56FromGitter<mratsim> 2 letter prefix or suffix is ok, 4 starts to get long I think
08:20:13TangerHey folks! Anybody know of a library that implements RSA signing?
08:20:32FromGitter<Varriount> Tanger: Do you mean SHA?
08:20:47FromGitter<mratsim> We don’t have it in Nimcrypto: https://github.com/cheatfate/nimcrypto
08:20:52FromGitter<narimiran> `replaces`, `sorts`, `toUpperCases`? :)
08:21:56TangerYeah, 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:05TangerAm I incorrect in thinking that this is a 2-part process?
08:22:06FromGitter<Varriount> @mratsim How usable is that library? I might use it in my code, instead of the hmac and sha modules.
08:22:30FromGitter<mratsim> Well, it will be used in production for our blockchain app
08:22:40FromGitter<mratsim> It will pass a security audit before deployment
08:23:00FromGitter<mratsim> Only it depends on Nim-devel at the moment
08:24:37FromGitter<mratsim> @Tanger I think your best bet right now is to use nim-openssl binding: https://github.com/genotrance/nimssl
08:25:01FromGitter<mratsim> bindings are generated on the fly with the same name/arguments as the original lib
08:25:18TangerAhh, cool! Thanks!
08:25:35FromGitter<Varriount> @narimiran Same problem as the past tense.
08:25:41*yglukhov_ quit (Read error: Connection reset by peer)
08:25:48FromGitter<mratsim> @shashlick there really should be a way to see the proc arguments
08:26:18*yglukhov joined #nim
08:27:25FromGitter<narimiran> but is there really a problem (a need for change) with the current way of nim procs regarding self-mutating procs?
08:28:53FromGitter<mratsim> If I say: `reverse` and `reversed` do you instantly know which one is the mutating version without looking at the docs?
08:31:22FromGitter<narimiran> `reversed` should be mutating one
08:32:43FromGitter<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:28FromGitter<andreaferretti> Hi all
08:37:32*smt` quit (Ping timeout: 260 seconds)
08:37:42FromGitter<andreaferretti> Does anyone know something to use for AES in Nim?
08:37:58FromGitter<andreaferretti> I tried NimAES, but it seems not to compile on 0.18
08:38:35FromGitter<andreaferretti> while openssl_evp seems to target an old version of OpenSSL and does not link with a recent one
08:39:05FromGitter<andreaferretti> I could bind the functions I need on my own
08:39:15FromGitter<andreaferretti> but hoped someone had already done the work
08:45:05FromGitter<gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5acc7991270d7d3708afa354]
08:45:19FromGitter<mratsim> @andreaferretti we build/use nimcrypto at Status: https://github.com/cheatfate/nimcrypto
08:45:51FromGitter<mratsim> otherwise Nimssl should work: https://github.com/genotrance/nimssl
08:46:09FromGitter<mratsim> it will download the latest OpenSSL upon install and generate the bindings dynamically
08:46:23FromGitter<andreaferretti> for nimcrypto I only see hash functions
08:46:33livcdandreaferretti: i just nimble installed the nimAES and ran the example
08:46:35FromGitter<alehander42> @narimiran well you know it's the opposite, right
08:46:44FromGitter<andreaferretti> while nimssl apparently only has sha
08:46:45FromGitter<alehander42> (or at least I think it is in python)
08:46:55FromGitter<mratsim> @narimiran : currently reversed returns a new openarray while reverse is the in-place mutating one, so wrong ;)
08:47:03livcdoh my bad i am still on Nim Compiler Version 0.17.3
08:47:19FromGitter<andreaferretti> @livcd yes, it has issue from v0.18 on
08:47:43FromGitter<alehander42> so yeah it seems the names can be confusing
08:47:46FromGitter<andreaferretti> @mratsim are you aware that any of the libs you mentioned includes AES?
08:47:49FromGitter<narimiran> @alehander42 @mratsim hahahaha, this is the best answer to my question if there's a problem with the current situation! :) :)
08:48:10FromGitter<alehander42> :D
08:48:51FromGitter<mratsim> @andreaferretti : https://github.com/cheatfate/nimcrypto/blob/669274baff80015f60e056c0569ee55a0baec791/nimcrypto/rijndael.nim#L10
08:49:35FromGitter<andreaferretti> oh thank you, I had missed it
08:49:44FromGitter<andreaferretti> looking by alphabetical order :-)
08:51:17FromGitter<andreaferretti> does it include block cipher modes or should I roll out my own?
08:52:15FromGitter<mratsim> is that for arbitrary data length?
08:55:05FromGitter<mratsim> Ask in an issue, I wouldn’t know for AES
08:56:13livcdandreaferretti: just compiled it also on 0.18.1
09:03:18FromGitter<gogolxdong> the code above works for XmlNode and JsonNode , have a try , save double quotes.
09:16:02FromGitter<andreaferretti> @livcd what os are you using?
09:16:16FromGitter<andreaferretti> on Mac OSX I am not even able to import it
09:16:58FromGitter<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:28FromGitter<andreaferretti> https://github.com/jangko/nimAES/issues/5
09:17:45FromGitter<andreaferretti> @mratsim thank you
09:18:30FromGitter<alehander42> oh man I helped somebody in the crystal channel with a nim solution thinking it was the nim channel
09:18:47FromGitter<alehander42> :D I need to start drinking black tea in the morning
09:19:19FromGitter<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:13FromGitter<andreaferretti> @livcd I just noticed the issue only appears with -d:release
09:44:22*xkapastel quit (Quit: Connection closed for inactivity)
09:57:23FromGitter<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:23FromGitter... programming library.
09:58:27Araqeine Schwalbe macht noch keinen Sommer.
09:59:20FromGitter<krux02> well ok, but `nestList` is something that I need to deprecated anyway, bcause of the deprecation of NimIdent
09:59:38FromGitter<krux02> now is the opportunity to replace it with a proper fold
10:00:04FromGitter<krux02> `fold`/`reduce`
10:00:41AraqnestList is a fine name
10:01:03FromGitter<krux02> ok I keep the name
10:01:09Araqit doesn't apply a function 'f' to anything, it nests a list
10:01:24FromGitter<krux02> but a folding operation as a starting symbol, so that empty lists work, too
10:01:54FromGitter<krux02> no it doesn't apply a function 'f`, it applies the function `newCall`
10:02:13Araqyou 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:35FromGitter<krux02> ??
10:03:38FromGitter<krux02> well I could add an optional third argument to nestList.
10:04:06FromGitter<krux02> and then I am happy
10:04:17FromGitter<krux02> everything that worked before still works the same way
10:04:39FromGitter<krux02> but `nestList` just become a tiny bit more useful
10:05:14Araqand a tiny bit slower to compile ;-) but it's ok, do it.
10:05:30FromGitter<krux02> not really
10:05:44FromGitter<krux02> yea a tiny bit you are right
10:07:24Araqbtw I still want your Option[T] optimization. is that merge-ready
10:07:25livcdandreaferretti: i will try with release. I am on w10
10:15:04*dyce[m] joined #nim
10:21:16FromGitter<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:30FromGitter<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:27FromGitter<krux02> Araq: looks like the bug got fixed and the copy nim tree is not necessary anymore
10:43:22Araqkrux02: well it for compat with an older Nim
10:43:33Araqyay, bugs get fixed.
10:48:31FromGitter<krux02> I add a comment in nest List that it is also known as fold expression
10:48:37FromGitter<krux02> http://en.cppreference.com/w/cpp/language/fold
10:49:19FromGitter<krux02> just so that this function get's a hit when someone searches for it
10:52:04FromGitter<krux02> And I would really like to call the arguments on the now new function `nestList` `op`, `pack` and `init`
10:52:27Araqif it makes you happy
10:52:33FromGitter<krux02> yay, it does
10:52:36FromGitter<krux02> :)
10:59:29FromGitter<coffeepots> Nim doesn't allow ranges with a 64 bit scope? Was hoping to make a Natural for int64
11:00:31livcdandreaferretti: worke
11:00:32livcdd
11:00:59FromGitter<krux02> nim does allow ranges with 64bit scope, just the most upper bit is the sign bit
11:02:02FromGitter<coffeepots> I get a type mismatch for range[0..12345678901]
11:02:39FromGitter<coffeepots> Woop, just needed to cast values :D range[0'i64..12345678901'i64]#
11:06:41FromGitter<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:49FromGitter<coffeepots> You only need to specify the first param, so range[0'i64..12345678901] is fine
11:08:19FromGitter<krux02> yea it is fine but it could be smarter ;)
11:09:08Araqyay my foot is getting better
11:09:19Araqmaybe there is hope for me.
11:10:24*Araq sprained his foot :-/
11:17:57Araqno condolences, heh?
11:18:09FromGitter<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:39FromGitter<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:05FromGitter<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:21Araqwell the marathon is on Sunday :-(
11:21:33FromGitter<Vindaar> that sucks :(
11:22:10Araqyeah, will see what the doctor says tomorrow
11:23:08Araqstupid beginner's mistake, was too fast downhill, oversaw some root
11:28:08FromGitter<Vindaar> I wouldn't necessarily call it a beginner's mistake. Can happen to anyone
11:30:09Araqmaybe but I wasn't supposed to run fast to begin with
11:31:12Araqand I shouldn't have picked the woods either, should have practiced on asphalt
11:33:25*SenasOzys joined #nim
11:34:12FromGitter<andreaferretti> @livcd thank you, maybe it is just an issue on OSX
11:34:24FromGitter<andreaferretti> anyway for now I am using nimcrypto
11:34:28FromGitter<andreaferretti> works for what I need
11:34:44FromGitter<andreaferretti> it would be nice to refresh those openssl bindings though
11:35:30FromGitter<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:51Araqthank you. :-)
11:38:37*dddddd joined #nim
11:53:55*leorize joined #nim
12:02:02*byte512 joined #nim
12:21:12FromGitter<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:24FromGitter<exts> (without linking directly to it)
12:21:52FromGitter<exts> current exe folder *
12:37:11shashlicknimssl does have aes wrapped but it's untested. Shouldn't be too hard to get it working
12:38:39Araqexts: os.getAppDir() / "file.txt"
12:42:57*SenasOzys quit (Ping timeout: 264 seconds)
12:46:38*SenasOzys joined #nim
12:47:12FromGitter<krux02> Araq: I wonder if it is a good idea to abuse `strVal` to get the identifier name and symbol name
12:47:56FromGitter<krux02> It would make the code simple in several cases
12:48:21Araqit's what I would do nowadays too.
12:48:42Araqseems like a good idea, yeah.
12:50:12FromGitter<Vindaar> @krux02 it's what I thought strVal was for originally. I think that'd be good
12:50:25FromGitter<krux02> ok thanks for the feedback I will do it
12:50:43FromGitter<krux02> then I think the additional procedures can disapear again
12:53:42Araqthe better then.
13:01:21Araqbtw I like 'replaceIn'
13:01:32Araqand 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:59FromGitter<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:22FromGitter<krux02> hmm, I broke js backend
14:22:43FromGitter<krux02> the js code generation broke, how did I do that, I wonder
14:27:17yglukhovAnyone knows of file system monitoring lib? I'm pretty sure I've seen one...
14:27:58shashlickaraq: curious which direction you wanted to take https://github.com/nim-lang/Nim/pull/7440?
14:28:55FromGitter<krux02> araq: would it be safe to set the name of a symbol after generation, or should this better be avoided
14:29:32Araqbetter avoid it but for now it seems safe
14:29:40Araqshashlick: "pathRelativeToInvoker"
14:30:04AraqNim has a concept that is "relative to the file it's written in"
14:30:08Araqfor example
14:30:14Araq# foo.nim
14:30:24shashlickbut does compiler really change directory anywhere besides staticRead/Exec?
14:30:34Araqimport bar # prefers the bar.nim next to foo.nim
14:30:53Araqon the contrary, it really doesn't change the directory anywhere.
14:31:28Araqthe goal is to make these two the same:
14:31:35Araqnim c -r src/main.nim
14:31:42Araqcd src && nim c -r main.nim
14:32:01Araqwhen your macro uses getCurrentDir() that invariant breaks
14:32:16FromGitter<data-man> @yglukhov: Binding to fswatch lib https://github.com/idlewan/nim-fswatch
14:32:33shashlickso if you did pathRelativeToInvoker() in both those cases, what will you get?
14:33:22shashlickI 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:46Araqthat's not true for any Nim related build.
14:34:04Araqor rather.
14:34:24Araqthat is true for Nim in general, yes, and it's not confusing, it's how things need to work.
14:35:07shashlickok then I'm probably just not understanding how you see pathRelativeToInvoker() working
14:36:13Araqwell I still don't understand how your macro works, but I'd guess it should use instantiationInfo()
14:37:47yglukhovdata-man: thanks! I'm pretty sure I've seen a pure one though...
14:37:56shashlickkeeping 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:26shashlickif 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:48shashlickso it's not possible to perform common tasks - read/write/execute in side that source directory, whatever it may be
14:39:23Araqso add getProjectDir() or something
14:40:06shashlickI 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:22shashlickif compiler never changes directories
14:40:26Araqit needs to be completely different
14:41:47Araqmap it to options.gProjectPath
14:44:38FromGitter<data-man> @yglukhov: Which OS?
14:45:37yglukhovdata-man: i'm on macos, but anything is welcome
14:45:58shashlickaraq: okay so it is already known, I just need to write a proc that returns that value
14:46:10Araqyes, sorry for the confusion
14:46:57shashlickhow do I get options into vmops.nim? import /?
14:47:21Araqimport options
14:47:27Araqif it doesn't do that already
14:48:02shashlickok I'll try it out
14:48:23shashlickmeanwhile, I presume you don't want either get/setCurrentDir
14:48:26shashlickin the VM
14:48:33shashlickhow about putEnv()
14:50:55FromGitter<data-man> @yglukhov: Win & Linux https://github.com/snowlt23/nimwatch
14:51:06Araqdon't care about putEnv()
14:51:43Araqenvironment variables are state I have to replicate on all machines that I happen to use, I dislike them.
14:51:57yglukhovdata-man: awesome, that's probably what i was looking for. Thanks!
14:53:13shashlickI figured it would be useful if you kick off some staticExec() which had to be manipulated by env. vars during build
14:55:26Araqcouven92 might give us some answers
14:57:30shashlickaraq: switching over to https://github.com/nim-lang/Nim/pull/7442 - were there any other concerns with that?
14:58:23shashlickwow github is down!?
14:58:27*miran joined #nim
14:59:05*athenot joined #nim
14:59:14shashlickjust for my vpn ugh
15:00:22Araqshashlick: is very nice now. needs a changelog entry.
15:00:43shashlickok I'll take care of that
15:02:30FromGitter<krux02> Araq: there are environment variables that are quite useful. And those environment variables contain actually useful information
15:03:16shashlickkrux02: vm already has getEnv() for that, this is just putEnv()
15:03:18FromGitter<krux02> but only if they are provided by the system
15:03:32FromGitter<krux02> what should putEnv be useful for?
15:03:40FromGitter<krux02> can nim create a subprocess?
15:03:50shashlickstaticExec()
15:04:21FromGitter<krux02> yea you are right
15:04:23FromGitter<krux02> that is useful
15:05:51Araqkrux02: I could say the same about the registry and you would oppose.
15:06:11*aguspiza joined #nim
15:10:09FromGitter<krux02> well I would not
15:10:52FromGitter<krux02> and I agree to your critique about environment variables
15:11:30FromGitter<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:49FromGitter<krux02> but I think for stuff like "COLUMNS" the environment variable is actually quite useful.
15:16:06FromGitter<krux02> that should not be a global configuration file
15:16:20shashlickthey are useful no doubt but I think it's pain to recreate from one system to the next
15:16:47FromGitter<krux02> yea I think for things like PATH env vars are a pain
15:17:14FromGitter<krux02> most horrible: PROGRAM_X_HOME
15:17:27FromGitter<krux02> or even more anti productivity:
15:18:07FromGitter<krux02> PROGRAM_X_LICENSE_DIR
15:23:52Araqenv 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:16FromGitter<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:44Araqdata-man, if it works, yes.
15:24:54FromGitter<data-man> Ok
15:30:16euantorRegarding 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:35euantorI can see a few uses where it could be useful
15:30:53Araqyeah we need them too
15:37:09FromGitter<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:21shashlickaraq: how do I avoid the UnknownMagic warning - getProjectPath() works fine but I still get a warning
15:38:09Araqwhy is that a magic?
15:38:16FromGitter<alehander42> ah yeah await for was pretty cool
15:38:16FromGitter<data-man> @Araq: Maybe new module stopwatch?
15:38:26FromGitter<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:36shashlickaraq: in system.nim you have to declare it
15:38:38Araqdata-man: you did it wrong, I think
15:38:39FromGitter<alehander42> which compiles to ^ *
15:38:43shashlickdoing it similar to gorgeEx()
15:38:56FromGitter<alehander42> but I guess that's a bit of a hack, it seems to rquire async iterators
15:39:05Araqshashlick: hmmmm
15:40:36Araqwell to avoid the warning introduce a define like nimHasProjectPath and then do in system.nim
15:40:43FromGitter<alehander42> how hard would it be to support async iterators
15:40:49Araqwhen defined(nimHasProjectPath):
15:41:16Araq proc getProjectPath*(): string {.magic: "GetProjectPath".}
15:41:52Araqbtw you can add that to macros.nim, not system.nim
15:43:03Araqasync iterators oh my
15:43:26Araqno idea how they work. write a macro first?
15:49:11shashlickaraq: i'm trying to move the implementation into macros.nim but how do I import options
15:49:44Araqyou can only move the .magic prototype to macros.nim
15:49:51FromGitter<data-man> Yeah, I replaced ```import``` to ```include``` in system/timers.nim and it's works. What to use for js (getTicks)?
15:49:55shashlickok fair
15:50:00Araqthe compiler doesn't care where the .magic declarations reside
15:50:41Araqit will pick them up and resolve them when used.
15:51:35shashlickbut do I still register it as a systemop?
15:52:38FromGitter<krux02> well you can import it from macros and then export it
15:52:45shashlickit still doesn't like the magic - unknown magic
15:52:53FromGitter<krux02> I am just not sure if that is the best thing you can do
15:52:58FromGitter<exts> thanks Araq
15:53:05shashlickthere's nothing special around gorgeEx, how does it accept that?
15:53:31FromGitter<exts> haven't been following closely, how far/close is 1.0 btw?
15:53:33FromGitter<krux02> shashlick: magics are predefiend in the compiler.
15:53:56FromGitter<krux02> so an old compiler will failt to compile that code
15:54:03FromGitter<krux02> therefore you need bootstrapping
15:54:14FromGitter<krux02> that is this when defined thing
15:54:29Araqit's also usually save to just ignore this warning
15:54:53FromGitter<exts> wrote my first nim code in like 3 years using docopts lib this past weekend, felt good.
15:55:00Araqyou need a '= discard' body for the declaration and then old compilers will eat it
15:55:30FromGitter<Varriount> @exts Every time some asks about 1.0, it gets pushed back another month. :p
15:55:37FromGitter<exts> :D
15:55:52FromGitter<alehander42> @Araq why can't I generate `await x` in the result of an untyped macro?
15:56:21FromGitter<Varriount> @alehander42 Doesn't a macro need to call some other function to expand macros in it's body?
15:56:49FromGitter<krux02> Araq: it seems you have pretty bad experience with linux.
15:56:50FromGitter<alehander42> but I just want to generate the macro invocation and let nim deal with it after my macro expansion
15:56:52FromGitter<alehander42> as usual
15:57:01shashlickok got it working, I misread gorgeEx - it has discard and no magic pragma
15:57:17shashlickhad to add a macrosop to vmops to register under that module
15:57:37Araqwell either you register it
15:57:47Araqor you use a new magic enum value
15:58:49FromGitter<data-man> I wonder why the version number so important. Rolling release! :)
15:59:37FromGitter<alehander42> otherwise something like https://gist.github.com/alehander42/b99dc1b3c65f0438bfe85412b5edb078 seems to be sufficient for a simple version of asyncFor
16:00:01FromGitter<alehander42> based on a normal iterator that yields Future-s
16:00:05*nsf quit (Quit: WeeChat 2.0.1)
16:00:13FromGitter<alehander42> and lets the macro insert the `await` where it's needed
16:01:48*Trustable joined #nim
16:02:00FromGitter<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:59FromGitter<krux02> what is the target use case for this asyncFor?
16:07:48FromGitter<alehander42> we wondered if we can have something like Dart async streams
16:07:55*sendell quit (Remote host closed the connection)
16:08:38FromGitter<alehander42> but asyncFor is not so important, that part can be just `for` + await indeed
16:09:00FromGitter<krux02> I haven't used dart
16:09:07FromGitter<krux02> but I do know openmp
16:09:31FromGitter<krux02> but the overhead to create the threads kill all the performance benefit for most use cases
16:09:35FromGitter<krux02> at least my use cases
16:11:06FromGitter<krux02> anyway I have to go
16:22:31*Trustable quit (Remote host closed the connection)
16:29:33shashlickaraq: works great for my use case, and the others as well
16:30:01*jaco60 quit (Read error: No route to host)
16:33:52shashlickhave pushed the changes, please review when you can
16:34:30shashlick@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:00deechHi all, possibly dumb question, why does the following typecheck? https://pastebin.com/rXkN6CU0
18:01:09mirandeech: if you do `let a = foo()`, you'll see that `a == 0`
18:01:44deechIs it implicity returning a default value?
18:02:09miranthe `result` is implicitly declared and initialized with the default value (for `int` that is 0)
18:02:51deechAh, that makes sense, thanks!
18:03:35*floppydh quit (Remote host closed the connection)
18:04:23*floppydh joined #nim
18:05:56deechI suggest this behavior be prominently documented in the manual and would love a compiler that turns off default initialization.
18:06:30deechs/a compiler/a compiler flag/
18:06:45Araqfwiw I agree...
18:08:57FromDiscord<treeform> Araq, i changed how I was doing the sql parser stuff: https://github.com/nim-lang/Nim/pull/7490
18:08:57miranheh, and i would like to not have to do `result = @[]` and `result = ""` :)
18:09:14mirandifferent strokes for different folks....
18:09:25FromDiscord<treeform> Araq, you are right the nkFunction stuff was probably not a good idea.
18:10:17mirandeech: https://nim-lang.org/docs/tut1.html#procedures-result-variable - the behaviour is documented below the example
18:12:27deechmiran: Thanks!
18:13:41deechWhat 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:10Araqit 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:19shashlickdom96: 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:01dom96shashlick: Pretty sure the thread was just moderated
19:45:11dom96appending that shouldn't cause issues
19:46:01shashlickdom96: check out https://forum.nim-lang.org/t/3742/1#23297 <= first link in threadActivity.xml right now
19:46:44shashlicki think that thread id itself doesn't exist
19:46:51dom96yep
19:46:53dom96fixed
19:46:55shashlickit's actually 3696
19:47:49shashlickok nm, looks like you fixed it :)
20:06:07FromGitter<data-man> https://github.com/nim-lang/Nim/issues/7562 ⏎ Poll: remove the --advanced switch
20:06:28*deech` joined #nim
20:09:46Araqmeh 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:17FromGitter<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:02raussDoes anyone have any good suggestions for nim omnifunc in vim/neovim?
22:43:13raussHave 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:38raussI 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:26shashlickLet me know if you find out rauss
22:48:37rauss+1
22:50:46*aguspiza quit (Ping timeout: 264 seconds)
22:52:18raussshashlick: 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:29FromGitter<mratsim> @deech you can use {.noInit.} to avoid default initialization
23:05:36shashlickAle is good for syntax check
23:06:06FromGitter<mratsim> also default initialization is only for stack object. And I think it’s a sane default
23:07:05FromGitter<mratsim> @Varriount, yes if you use contexts it’s stateful, it’s like you append data in your buffer
23:07:32FromGitter<mratsim> otherwise you can use sha2.digest(“abcdef”)
23:07:48FromGitter<mratsim> if you want to reset the context you need to call init.
23:07:56FromGitter<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:00FromGitter<zacharycarter> o/
23:32:16FromGitter<gogolxdong> How to echo a NimNode?
23:32:31FromGitter<zacharycarter> echo repr?
23:32:41FromGitter<zacharycarter> not sure what you're trying to do exactly
23:33:05FromGitter<gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5acd49b1109bb04332ac3750]
23:33:19FromGitter<zacharycarter> errr
23:33:22FromGitter<zacharycarter> this should be a macro I think
23:33:31FromGitter<zacharycarter> oh I see
23:33:42FromGitter<gogolxdong> 'repr' doesn't support 'void' type
23:33:47FromGitter<zacharycarter> one second
23:35:28FromGitter<zacharycarter> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5acd4a407c3a01610dcc2ff6]
23:39:00FromGitter<gogolxdong> I want to see the generated procs.
23:41:21FromGitter<zacharycarter> well I commented out those lines - but assuming you un-comented them
23:41:46FromGitter<zacharycarter> the only way I know of dumping macros is through these helper macros - https://nim-lang.org/docs/macros.html#17
23:45:23FromDiscord<2vg> Hey! Benchmark has been updated!
23:45:23FromDiscord<2vg> https://github.com/tbrand/which_is_the_fastest
23:45:24FromDiscord<2vg>
23:45:24FromDiscord<2vg> * Nim rank
23:45:24FromDiscord<2vg> - jester: 26 / 36
23:45:24FromDiscord<2vg> - mofuw: 9 / 36
23:45:24FromDiscord<2vg>
23:45:26FromDiscord<2vg> But I'm sad because my rank is low...
23:45:43FromGitter<zacharycarter> let's fix this ^
23:45:47FromGitter<zacharycarter> :D
23:49:20FromGitter<zetashift> @2vg didn't you get some great speeds at TechEmpowers benchmarks?
23:52:30FromDiscord<2vg> zetashift: Since this benchmark is a measurement of routing, the number of simple requests does not seem to be related
23:53:59FromDiscord<2vg> Although it did not officially participate in techempower, since pull requests were merged, it will be counted from the next round..
23:53:59FromDiscord<2vg>
23:53:59FromDiscord<2vg> https://github.com/TechEmpower/FrameworkBenchmarks/pull/3515
23:54:34FromGitter<zacharycarter> I don't even understand how something like this gets bench marked - isn't latency an uncontrollable factor?
23:55:04FromGitter<zacharycarter> sorry for my very naive question
23:57:21FromGitter<zacharycarter> okay - sorry - I wasn't aware you were the author of mofuw
23:57:24FromDiscord<2vg> It is probably the result of wrk's latency
23:57:24FromDiscord<2vg> Since routing also includes parsing of parameters and so on, it seems that we are investigating the speed including that time
23:57:55FromDiscord<2vg> ;)
23:58:27FromGitter<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:42FromGitter<zacharycarter> You could try swapping out the GC and see if that has any effect on it
23:59:29FromGitter<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:50FromGitter<zacharycarter> But the fact that you're only losing to crystal and Rust I think is a good sign
23:59:57FromGitter<zetashift> iirc dom86 said he didn't focusing on implementing/fixing those benchmarks