<< 29-08-2018 >>

00:05:04FromGitter<bung87> what's exactly <kbd>up</kdb> <kbd>down</kdb> string value while programing with terminal ?
00:06:37FromGitter<bung87> https://github.com/bung87/tinyterm/blob/master/src/ui/menu.nim#L10
00:07:42*floppydh quit (Ping timeout: 264 seconds)
00:09:18*floppydh joined #nim
00:13:51FromGitter<rayman22201> this: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ gives a parsing error ... [https://gitter.im/nim-lang/Nim?at=5b85e53f58a3797aa3ce3c9d]
00:16:42FromGitter<bung87> is a space there
00:18:19FromGitter<rayman22201> yup, space is there
00:22:56FromGitter<bung87> looks weird dont know whether a problem.. seems like look for a variable but end with a space
00:24:45FromGitter<rayman22201> the space is supposed to be there: https://nim-lang.org/docs/manual.html#templates-identifier-construction
00:25:11FromGitter<rayman22201> the problem is the `_`
00:31:19FromGitter<bung87> hmm https://github.com/nim-lang/Nim/blob/27b081d1f77604ee47c886e69dbc52f53ea3741f/tests/lexer/tunderscores.nim#L6
00:33:56FromGitter<rayman22201> that is the behavior I am seeing, yes. but it should not be. Backtick notation should replace the string `name`, so that the proc becomes `get_name`
00:34:33FromGitter<rayman22201> the underscore is causing it to not interpret the backticks correctly
00:35:01FromGitter<rayman22201> if I remove the underscore, the template works correctly
00:39:07*abm quit (Ping timeout: 240 seconds)
00:49:35*sagax joined #nim
00:53:18*shadowbane quit (Remote host closed the connection)
00:53:43*shadowbane joined #nim
00:56:09*zachcarter joined #nim
01:00:16*zachcarter quit (Ping timeout: 246 seconds)
01:18:33*darithorn joined #nim
01:19:20*derlafff quit (*.net *.split)
01:20:40*zahary_ quit (Quit: Connection closed for inactivity)
01:21:03*derlafff joined #nim
01:49:07*sg-james[m] quit (*.net *.split)
01:49:07*Connor[m]1 quit (*.net *.split)
01:49:07*GitterIntegratio quit (*.net *.split)
01:49:07*petersjt014[m] quit (*.net *.split)
01:49:07*dashed quit (*.net *.split)
01:49:07*opi- quit (*.net *.split)
01:49:07*cmk_zzz quit (*.net *.split)
01:49:22*cmk_zzz joined #nim
01:49:48*opi_ joined #nim
01:50:07*Connor[m]1 joined #nim
01:50:17*dashed joined #nim
01:50:23*GitterIntegratio joined #nim
01:50:32*sg-james[m] joined #nim
01:51:49*petersjt014[m] joined #nim
01:51:53*tyler569 quit (Ping timeout: 260 seconds)
01:54:16*tyler569 joined #nim
01:55:28*captainkraft quit (Ping timeout: 272 seconds)
01:56:21*captainkraft joined #nim
01:58:25*smt quit (Ping timeout: 252 seconds)
01:59:12*smt joined #nim
01:59:54*sagax quit (Remote host closed the connection)
02:20:18*nathanj quit (Ping timeout: 264 seconds)
02:20:41*nathanj joined #nim
02:25:44*endragor joined #nim
02:35:28FromGitter<gogolxdong> Is there any example of encryption and decryption in Nim?
02:42:49*FromDiscord_ quit (*.net *.split)
02:42:49*dvn quit (*.net *.split)
02:42:49*Elronnd quit (*.net *.split)
02:42:50*revere quit (*.net *.split)
02:42:50*bozaloshtsh quit (*.net *.split)
02:42:50*vegax87 quit (*.net *.split)
02:42:50*pydsigner quit (*.net *.split)
02:42:50*dada78641 quit (*.net *.split)
02:43:02*dada78641_ joined #nim
02:43:05*bozaloshtsh joined #nim
02:43:35*FromDiscord joined #nim
02:44:31*zachcarter joined #nim
02:45:14*elronnd joined #nim
02:46:26*SenasOzys quit (Remote host closed the connection)
02:48:43*dvn joined #nim
02:49:42*SenasOzys joined #nim
02:50:39*bozaloshtsh quit (Changing host)
02:50:39*bozaloshtsh joined #nim
02:53:51*pydsigner joined #nim
02:54:24*revere joined #nim
02:54:48*vegax87 joined #nim
02:55:51FromGitter<gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b860b37ac25fd11b5abe375]
02:56:58*ftsf joined #nim
02:57:22*darithorn quit (Quit: WeeChat 2.2)
03:03:41FromGitter<gogolxdong> not sure the casting works correctly.
03:04:15FromGitter<gogolxdong> and the last line got SIGSEGV: Illegal storage access. (Attempt to read from nil?)
03:07:34leorizeI don't think string can be casted to ptr byte
03:07:54leorizein theory you can cast a cstring like that however
03:12:10FromGitter<gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b860f0ac53ee54c18b981c7]
03:12:10*arecaceae quit (Remote host closed the connection)
03:12:29*arecaceae joined #nim
03:12:48FromGitter<gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b860f2f7649b9063e1b938d]
03:12:50Tangergogolxdong: Nim strings are split into two parts, the length and the actual data. Casting to cstring will return a pointer to the data region of the string
03:13:41*dddddd quit (Remote host closed the connection)
03:14:19Tangergogolxdong: Is outbytes nil in that example? Doesn't look like you're initialising it
03:15:01TangerYou need to alloc0 some space for it if you're writing to it by pointer
03:16:10FromGitter<gogolxdong> yes.
03:16:44FromGitter<gogolxdong> it works after alloc0(100), but got different result from encrypted message.
03:17:23FromGitter<gogolxdong> we are trying aes128
03:26:38*krux02 quit (Remote host closed the connection)
03:43:12*dorelix quit (Remote host closed the connection)
03:50:37*darithorn joined #nim
03:53:29FromGitter<gogolxdong> I think nimcrypto library should be more specific such as Pkcs7Padding, etc.
03:54:47*captainkraft quit (Ping timeout: 240 seconds)
03:55:21*captainkraft joined #nim
04:02:22*zachcarter quit (Ping timeout: 250 seconds)
04:39:06FromGitter<gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b86236a94f8164c17b4ffda]
04:40:24FromGitter<kayabaNerve> Fork it
04:40:40FromGitter<gogolxdong> It's even different with the encrypted message itself.
04:42:07FromGitter<gogolxdong> not familiar with cryptography but saw many other padding mode applies in AES.
04:43:58*darithorn quit (Quit: WeeChat 2.2)
04:59:15*zachcarter joined #nim
05:03:34*zachcarter quit (Ping timeout: 240 seconds)
05:03:54*nsf joined #nim
05:26:42*elronnd is now known as Elronnd
05:39:56*sagax joined #nim
06:44:18FromGitter<gogolxdong> anyone familiar with nginx uploading file configuration?
06:44:59*chemist69 joined #nim
06:47:27FromGitter<gogolxdong> nginx reverse proxy uploading
06:59:35FromGitter<Bennyelg> what is the problem? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b86445758a3797aa3d02a5e]
07:00:46FromGitter<Bennyelg> The error I got ⏎ ⏎ `````` [https://gitter.im/nim-lang/Nim?at=5b86449dd8d36815e5a591b5]
07:00:47FromGitter<Bennyelg> /Users/benny/.nimble/pkgs/jester-0.4.0/jester.nim(492, 55) Error: attempting to call undeclared routine: 'some'
07:02:27FromGitter<timotheecour> @Bennyelg FWIW https://github.com/nim-lang/Nim/pull/8786 will improve such error msgs by providing context on what ‘some’ is
07:08:15FromGitter<timotheecour> @kaushalmodi are you here?
07:19:42*leorize quit (Ping timeout: 264 seconds)
07:24:30*Vladar joined #nim
07:31:39*PMunch joined #nim
07:38:42FromGitter<Bennyelg> How do I convert the headers into Option ?
07:39:33FromGitter<mratsim> seems like there is import options missing or mixin `some`
07:39:59FromGitter<mratsim> it could be because resp is a macro so options should be visible at the macro call site
07:40:19*norok2 joined #nim
07:41:14FromGitter<mratsim> btw @timotheecour did you see that? https://github.com/fragcolor-xyz/nimtorch
07:41:39FromGitter<Bennyelg> How Do I create and assign to option type ?
07:41:49FromGitter<Bennyelg> var headers: Option[RawHeaders] ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b864e3dd8d36815e5a5ccf8]
07:42:03FromGitter<mratsim> let foo = Some(my_wrapped_type)
07:42:28FromGitter<mratsim> some, lower case
07:42:31FromGitter<mratsim> https://nim-lang.org/docs/options.html
07:43:01FromGitter<mratsim> but can you `import options` in your file first, I think that’s a bug in Jester
07:43:40FromGitter<mratsim> just importing might fix it, if yes there is a symbol visibility issue that might require mixin in Jester
07:57:28FromGitter<ZarsBranchkin> Is there some way to modify the linker options that were passed with `passL`? Trying to use winim library by crosscompiling, but it passes a path to linker that has backslashes in path
07:57:38*leorize joined #nim
07:57:44FromGitter<ZarsBranchkin> And I'm on linux, so I need to replace `\` with `/`
08:02:03*leorize quit (Ping timeout: 252 seconds)
08:03:40*gmpreussner_ joined #nim
08:04:18*gmpreussner quit (Ping timeout: 252 seconds)
08:04:25FromGitter<mratsim> —passL:foo on CLI or {.passL:”foo”.} in your file
08:05:37FromGitter<ZarsBranchkin> The option is already passed but I want to modify it
08:06:12FromGitter<ZarsBranchkin> `x86_64-w64-mingw32-gcc: error: ~/.nimble/pkgs/winim-2.4.1/winim/inc\..\lib\winim64.res: No such file or directory` ⏎ so I want to replace `\` with `/`
08:06:28FromGitter<ZarsBranchkin> This file passes the option https://github.com/khchen/winim/blob/26c7a277f64c6f28f6428d54a32fcab58d59d5c2/winim/inc/winimbase.nim
08:09:42*rokups joined #nim
08:20:21*stefanos82 joined #nim
08:25:21*abm joined #nim
08:27:29FromGitter<ZarsBranchkin> Alright, went the quick and dirty way. Changed `linkerexe` to shells script that replaces `\` with `/` and passes it to actual linker
08:47:57*fredrik92 joined #nim
08:50:25FromGitter<timotheecour> @Araq are you on slack?
08:50:44FromGitter<Araq> hi
08:51:24FromGitter<timotheecour> Hi; to answer ur question regarding https://github.com/nim-lang/Nim/issues/8803 :
08:51:33*couven92 quit (Ping timeout: 252 seconds)
08:53:42FromGitter<timotheecour> That means u can replace $nimc_D/tests/types/tparameterizedparent0.nim with: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b865f15ff4451561653773b]
08:55:46FromGitter<timotheecour> that also means u can test for multiple would-be compile errors in a single test file, and have more flexibility on how you want to test ; whereas currently you can only have a single compile error per file (eg: tests/types/tparameterizedparent{0,1,2,3,4}.nim)
08:57:22FromGitter<Araq> ok, I'm beginning to understand `compilesWithContext` would be yet another builtin
08:57:25euantorhttps://go.googlesource.com/proposal/+/master/design/go2draft-generics-overview.md
08:57:25FromGitter<timotheecour> `ctx.ok` is equivalent to `let ok = compiles(AppleKapal (color: 13))`
08:57:35FromGitter<timotheecour> Yes.
08:57:38euantor`contract` looks an awful lot like `concept` :)
08:58:02FromGitter<Araq> euantor: read it, yup, Go is becoming a little more like Nim
08:58:49euantorNice to see others think Nim is on the right track
08:59:09*zachcarter joined #nim
08:59:13FromGitter<timotheecour> compiles can be implemented in terms of `compilesWithContext` to reuse code.
08:59:36FromGitter<Araq> yeah, I don't want it :-) (surprise...)
08:59:37FromGitter<mratsim> @euantor, the beginning reads like PR damage control :P
08:59:50FromGitter<timotheecour> why
09:00:01euantorYeah, I think it kind of is
09:00:20euantorThere's a sort of related video too: https://blog.golang.org/go2draft
09:00:28FromGitter<Araq> because right now `compiles` is underspecified and its implementation is quite terrible
09:00:48FromGitter<Araq> it's not something I want to embrace for testing the compiler.
09:00:56euantorThey're improving error handling too, but I'm not sure the current design quite covers all the problems...
09:01:47FromGitter<Araq> what should have been done internally in the compiler and also in the macro system is to turn errors into AST nodes
09:01:54FromGitter<timotheecour> well we can report/fix bugs as they come; which ones are you referring to
09:02:39FromGitter<Araq> that might as well give us `untyped` without its restrictions
09:03:16FromGitter<Araq> but the things are what they are and the tester is too important to build upon on sand
09:03:32*zachcarter quit (Ping timeout: 250 seconds)
09:04:03FromGitter<timotheecour> is there a bug in GitHub regarding compiles?
09:04:26*Rush quit (Ping timeout: 252 seconds)
09:04:53FromGitter<Araq> plenty of things don't work, my `when compiles(experimentalWrapper(...))` comes to mind
09:05:10FromGitter<Araq> I don't think we have a git tag for `compiles` though.
09:05:39FromGitter<Araq> and most real bugs have been fixed because `unittest` relies on it heavily
09:05:41*RushPL joined #nim
09:06:23FromGitter<timotheecour> ok well I can still implement compilesWithContext now and we can disallow or discourage its use in the compiler until said bugs are addressed; but I’d still wanna be able to use it in user code
09:07:24FromGitter<Araq> do you though? seems wrong to me to add a language builtin for testament
09:08:10FromGitter<timotheecour> for now (until whatever bug you’re referring to is fixed) I’d at least use it in user code (not in testament)
09:10:34FromGitter<Araq> unfortunately I haven't written the RFC for `semityped` yet
09:11:04FromGitter<Araq> that seems close to your `compilesWithContext` but comes from a different angle
09:11:22FromGitter<timotheecour> sorry what’s the skinny? (or a rough draft if u have)?
09:11:59FromGitter<Araq> do you know `nnkIdent` and `nnkSym`?
09:12:09FromGitter<Araq> I mean their difference.
09:13:09FromGitter<timotheecour> well former is just for identifiers
09:15:25FromGitter<Araq> hmm, maybe let me start from scratch.
09:16:55FromGitter<Araq> it occured to me that error messages are better emitted as JSON in this day and age. JSON is a tree structure. ASTs are a tree structure. So even better than JSON, embed the errors in a structured way in the AST directly. Then `compiles` can be implemented via a macro like so:
09:17:35FromGitter<Araq> `macro compiles(x: semityped): bool = not x.contains(nnkError)`
09:18:10FromGitter<Araq> `semityped` means the compiler does a best effort to sem'check the expression but doesn't fail
09:18:57FromGitter<Araq> and that's what Nim already does in some form with the distinction between `nnkIdent` and `nnkSym`
09:20:01FromGitter<Araq> and it's usually what macros like `async` should operate on, the full AST body is sem'checked, but there are error sections regarding `await` statements then they need to fixup.
09:20:55FromGitter<Araq> so `semityped` could be renamed to `typed` since the older `typed` is a subset of this idea.
09:21:25FromGitter<timotheecour> interesting
09:21:59FromGitter<timotheecour> the JSON aspect is a bit orthogonal to what you’re describing though
09:22:19FromGitter<Araq> yeah, but it's what let me to the idea.
09:23:39FromGitter<Araq> it would be another big round of compiler refactorings.
09:24:07FromGitter<Araq> but it would give us a more introspective language and a reliable `compiles`
09:24:26FromGitter<timotheecour> use json by default will lead to all the evilness of dynamic types: errors caught at runtime instead of CT: instead we can have best of both worlds using AST types as we already do, but also provide a `toJson` that can be called form any AST node.
09:26:06FromGitter<Araq> I'm not talking about JSON, please don't be distracted
09:26:28FromGitter<timotheecour> actually toJson can be implemented “easily” IMO; simply using carefuly use of “case of”
09:26:40FromGitter<timotheecour> Ok.
09:26:44FromGitter<Araq> it would be an AST extension, a couple of new `nnkError`kinds
09:27:00FromGitter<Araq> and then you can use `await` in a template and yet `await`can pick it up.
09:27:15FromGitter<Araq> it would solve the composability problems that Nim's DSLs have.
09:29:26FromGitter<timotheecour> loosely related to that, I’ve been meaning to write an RFC on having a type system for iterator: use case: `toSeq(it: untyped)` could become: `toSeq(it: itertyped)` (with a better name); this would allow having inline iterators be more 1st class. eg; `iter it = miter(1)`
09:30:27FromGitter<Araq> yeah I know. but on the other hand, why do iterators have it's own "scope"
09:31:02FromGitter<timotheecour> u mean namespace or u mean scope?
09:31:03FromGitter<Araq> the better design seems to me to not allow iterators and procs with the same name.
09:31:11FromGitter<timotheecour> YESS!
09:31:22FromGitter<timotheecour> i think that was a design mistake; idk if it was intentional.
09:31:48FromGitter<Araq> it was. but it predated `toSeq` and closure iterators
09:33:26FromGitter<timotheecour> ok we can have a saner type system with simpler lookup, and `myiter()` would become typed (although not accepted in context of an expression).
09:37:25FromGitter<timotheecour> while you’re here, all good on https://github.com/nim-lang/Nim/pull/8682 ?
09:38:46*CcxWrk quit (Remote host closed the connection)
09:39:30*CcxWrk joined #nim
09:42:09*ftsf quit (Ping timeout: 252 seconds)
09:45:58FromGitter<Vindaar> @rayman22201 just saw your message from last night. The `invalid underscore` error is thrown in the lexer. No idea if there'd be a reliable way to make this work. You'd need to allow identifiers with trailing underscores under some but not all circumstances, which are hard to define working on tokens. But (I guess you're aware of that) it's a non issue anyways, because `getsomething` is equivalent to `get_something`
09:45:58FromGitter... anyways, so the trailing underscore isn't needed.
09:46:36FromGitter<Araq> btw I hate Nim's configuration system...
09:48:47FromGitter<Araq> if anybody has a good idea of how to remove/simplify it I'm all ears
09:48:47*xet7 joined #nim
09:52:15FromGitter<timotheecour> well there’s definitely room for improvement; one goal could be to make nims usable ( nim-lang/Nim#8682 is exactly attempting that) , and eventually nim.cfg could be completely deprecated, so we’d only have nimscript.
09:52:26FromGitter<timotheecour> furthermore, the search for which nimscript
09:59:13FromGitter<Araq> I don't like `nims` either. Stuff should be in pragmas and that's it. it's the only way to do it in a nimble package anyway as the package's config is ignored
10:00:53FromGitter<Araq> then there is this personalized stuff about the compiler's verbosity, where to put produced files, which `gcc` to invoke.
10:00:59FromGitter<timotheecour> what do u mean by “in pragmas” ? I find very useful to have my ~/.config/nim/config.nims apply to everything
10:01:36FromGitter<Araq> and what's in there to "apply to everything"? the things I mentioned.
10:02:06FromGitter<Araq> so it's a machine/user specific setup, why search so many places to get that information.
10:03:12FromGitter<timotheecour> can u give me an example in nim repo so I know what u mean?
10:04:07FromGitter<Araq> no. can you show me what your `~/.config/nim/config.nims` contains?
10:07:42*CcxCZ joined #nim
10:08:46*CcxCZ is now known as ccx^xmpp
10:09:09*fredrik92 quit (Quit: Client disconnecting)
10:13:42FromGitter<timotheecour> ```code paste, see link``` ⏎ ⏎ having a real language (subset of nim, as nimscript) is useful ; I want the features it provides (multiline comments, variables, etc) without having to learn a new subpar config language (eg: .tmux.conf is really bad when u need to customize cross platform stuff) [https://gitter.im/nim-lang/Nim?at=5b8671d6c53ee54c18bbca8d]
10:14:31*seni joined #nim
10:16:35FromGitter<timotheecour> still not sure what you mean: what do you want to replace config.nims or nim.cfg with?
10:18:54FromGitter<Araq> I don't know yet. Probably I will do nothing and work on more important problems
10:19:07FromGitter<Araq> glad you like NimScript :-)
10:19:21*couven92 joined #nim
10:20:00FromGitter<timotheecour> Ok well lemme know if u have any other comments on #8682
10:20:25FromGitter<Araq> btw you can use `when defined(nimHasHintProcessing)` now
10:20:47FromGitter<timotheecour> I know, it’s in the snippet i showed above
10:22:08FromGitter<Araq> oh yeah
10:32:04FromGitter<timotheecour> just saw u had added comments in #8682; I pushed a new commit.
10:33:47FromGitter<Araq> great now make the nimsuggest tests part of travis...
10:34:17FromGitter<Araq> `nim c -r nimsuggest/tester` unfortunately some tests are red and need to be disabled first :-)
10:35:17*ccx^xmpp quit (Quit: WeeChat 2.0.1)
10:35:22FromGitter<timotheecour> Ugh… can this be done after PR merge?
10:36:39*zachcarter joined #nim
10:37:19FromGitter<Araq> but how do I know you didn't break nimsuggest otherwise? :P
10:38:27FromGitter<Araq> also nimsuggest's tester is a pinnacle of human achievement, you'll love digging into it
10:40:55FromGitter<timotheecour> fixing pre-existing bugs in `nim c -r nimsuggest/tester` is out of scope for this PR, otherwise it’ll take forever before PR is merged. r u saying CT doesn’t currently test for nimsuggest/tester ?
10:41:36FromGitter<Araq> not fixing them, disabling them
10:41:54FromGitter<Araq> > r u saying CT doesn’t currently test for nimsuggest/tester ? ⏎ yes
10:44:52FromGitter<Araq> it might be out of the scope of this PR, but it's what has to be done before merging your PR anyway
10:45:19FromGitter<timotheecour> i see `# - nim c -r nimsuggest/tester` is commented out in .travis.yml ; i can uncomment and fix as needed but what about windows/appveyor? it was never in appveyor
10:45:51FromGitter<Araq> yup, appveyor shouldn't test it for the time being
10:46:32FromGitter<Araq> the tester was unreliable on Windows :-)
10:47:17*noonien joined #nim
10:48:42FromGitter<timotheecour> Ok, good to go modulo adding tests to travis and making sure the same tests pass before and after?
10:51:49FromGitter<Araq> yes
10:55:04FromGitter<timotheecour> shall i use `disabled: “travis”` or `disabled: true` ?
10:56:34FromGitter<Araq> I don't think "travis" would work
10:58:07FromGitter<Araq> check the source, nimsuggest's tester is completely different from testament. ("OMG; such a terrible design! Must re-use code." -- Yeah, yeah, whatever, I disagree.)
11:06:16FromGitter<timotheecour> speaking of json, test preambules (the discard output string) could be in json ...
11:07:52PMunchHmm, should we try to get a talk in at FOSDEM this year?
11:15:06*zachcarter quit (Ping timeout: 252 seconds)
11:15:27FromGitter<alehander42> `experimental` in my nim.cfg breaks bootstrapping, is this a bug, or flag changes are not supposed to be supported
11:16:21FromGitter<Araq> how does it break bootstrapping?
11:17:29*dddddd joined #nim
11:23:41*PMunch quit (Quit: Leaving)
11:33:31FromGitter<timotheecour> @araq please take a look at https://github.com/nim-lang/Nim/pull/8805 which adds testing nimsuggest on travis
11:41:23FromGitter<alehander42> my csources nim fails when it gets the experimental option
11:43:25FromGitter<alehander42> e.g. if i have `experimental:notnil` in my nim.cfg in home
11:44:09FromGitter<alehander42> `Error: invalid argument for command line option: '--experimental' ⏎ `
11:48:35*user__ joined #nim
11:49:51FromGitter<timotheecour> u can put that in ~/.config/nim/config.nims: `when nimHasNotnil: —experimental:notnil` once my PR https://github.com/nim-lang/Nim/pull/8682 is merged
11:50:40FromGitter<timotheecour> not sure if that can be done with `nim.cfg` but nims shd be fine with this
11:52:35FromGitter<timotheecour> (yet another reason why I think we shd think about deprecating/discouraging nim.cfg in near future)
11:55:07*captainkraft quit (Ping timeout: 240 seconds)
11:56:00*ftsf joined #nim
12:08:48*user__ quit (Ping timeout: 245 seconds)
12:10:32*user__ joined #nim
12:16:37*leorize joined #nim
12:25:34*user__ quit (Read error: Connection reset by peer)
12:26:02*user__ joined #nim
12:26:22FromGitter<alehander42> hm I can use a `@if` in my case
12:26:28FromGitter<alehander42> but we need a general solution indeed
12:31:53*nsf quit (Quit: WeeChat 2.2)
12:38:49*captainkraft joined #nim
12:42:54FromGitter<florianlenz> hi, is there a official module for generating random bytes?
12:44:59FromGitter<Araq> random.nim?
12:45:28FromGitter<Araq> `@if` is the general solution. it exists since forever
12:51:41FromGitter<alehander42> well I happen to have a flag that I pass only for the module that needs experimental in my case
12:52:13FromGitter<alehander42> but that's just luck, in general something like @if hasNotNil is needed
13:02:23*endragor quit (Remote host closed the connection)
13:14:35FromGitter<mratsim> @alehander42 it has the flag, it’s hidden in one of my issues
13:15:02FromGitter<mratsim> here: https://github.com/nim-lang/Nim/issues/8691#issuecomment-414662209
13:17:56*derlafff quit (Remote host closed the connection)
13:18:16*derlafff joined #nim
13:19:33*user__ quit (Read error: Connection reset by peer)
13:20:04FromGitter<alehander42> ah great
13:20:07FromGitter<alehander42> thanks @mratsim
13:20:27FromGitter<mratsim> I guess changelog should mention it as well
13:20:41*endragor joined #nim
13:25:16*endragor quit (Ping timeout: 260 seconds)
13:40:11FromGitter<kaushalmodi> @timotheecour Hello! You pinged?
14:04:03*seni quit (Quit: Leaving)
14:31:10FromGitter<gogolxdong> Can Nim be used to develop Android and IOS APP?
14:36:26*smt quit (Ping timeout: 260 seconds)
14:37:34*gangstacat quit (Quit: Ĝis!)
14:44:22FromGitter<florianlenz> @Araq you mean https://nim-lang.org/docs/random.html?
14:46:03euantorYes, that's the standard library's random module
14:49:36FromGitter<florianlenz> The module descriptions says "Nim's standard random number generator. Based on the xoroshiro128+ (xor/rotate/shift/rotate) library.". I need cryptographic secure random bytes.
14:50:24FromGitter<florianlenz> At best from the target random source like /dev/random
14:50:42euantorTry my sysrandom library: https://github.com/euantorano/sysrandom.nim
14:51:05euantorIt should do what you want
14:51:09FromGitter<florianlenz> ah cool. That is what I need
14:52:08FromGitter<florianlenz> Any reason why this isn't shipped with nim? I use it quite often for my work and I guess others do as well
14:53:35euantorNo idea, I created my library because I needed it
14:54:26FromGitter<florianlenz> k
14:55:44FromGitter<mratsim> actually most of the time people only need a PRNG, and don’t look beyond the default.
14:55:57FromGitter<mratsim> Those who need a CSPRNG will dig into the implementation.
14:58:01FromGitter<mratsim> you can also check this @florianlenz https://github.com/cheatfate/nimcrypto/blob/master/nimcrypto/sysrand.nim
14:58:06FromGitter<ephja> anyone who uses the default without examining it when doing crypto is bound to make additional mistakes I think
14:59:16FromGitter<mratsim> Lot of people only need a PRNG for games, statistics, ...
15:01:59FromGitter<ephja> right
15:07:55FromGitter<tim-st> is there a type like tuple with fields that has static size at compile time, and where I can cast to? I tried it with tuple and it works, but tuple size seems unknown at compile time
15:08:21FromGitter<tim-st> I calculated the tuple size on my own...
15:10:17FromGitter<alehander42> is there a new syntax for `not nil`
15:10:18FromGitter<alehander42> types ?
15:10:50FromGitter<ephja> @alehander42 does it not work? if so, is it because it's not enabled via "experimental" if so, then the compiler should notify you of that option
15:11:13FromGitter<alehander42> the problem is I pass `--experimental:notnil`
15:11:24FromGitter<alehander42> and I still get an error for `buf: seq[YamlStreamEvent] not nil`
15:12:41FromGitter<ephja> what's the error message? keep in mind that experimental can mean both "might or might not be a suitable language feature" and "is probably buggy". the latter is certainly true
15:13:29FromGitter<alehander42> buf: seq[YamlStreamEvent] not nil
15:13:31FromGitter<ephja> @tim-st there have been times when I haven't been able to take the size of something at compile time, and so I've had to instantiate dummy objects for that purpose
15:13:31FromGitter<alehander42> ops
15:13:51FromGitter<alehander42> Error invalid type
15:14:10FromGitter<alehander42> yeah the problem is this is in a lib
15:14:25FromGitter<alehander42> so I have to fix it upstream if it's problematic
15:15:47FromGitter<alehander42> on the other hand I guess the idea is that string and seq now are `not nil` by def
15:15:48FromGitter<ephja> I don't even see where YamlStreamEvent is defined🤔
15:16:01FromGitter<alehander42> but then we just need a better error
15:16:27FromGitter<alehander42> like ⏎ seq is always not nil: invalid type, remove ` not nil` to compile
15:17:37FromGitter<alehander42> yeah, the problem is exactly when I use seq
15:17:49FromGitter<alehander42> and we need to add a note to the changelog as it is a breaking change
15:18:07FromGitter<alehander42> (ok, breaking for experimental, but still needs a note)
15:20:05*thomasross quit (Remote host closed the connection)
15:20:32*thomasross joined #nim
15:22:39*nsf joined #nim
15:25:21FromGitter<alehander42> @Araq are there any plans to implement default `@[]` and `""` for the js backend ? otherwise the new changes can easily lead to bugs there
15:25:41FromGitter<alehander42> (one removes `isNil` and assumes it's always a valid array => runtime error)
15:29:59*chemist69 quit (Quit: WeeChat 1.9.1)
15:30:12FromGitter<tim-st> @ephja thanks, yes this will work, thanks!
15:31:08FromGitter<tim-st> I could also read each field manually into the tuple/object but my current way is much easier, I read once the complete type and each field has directly the correct value, but for this I need the compile tiime size
15:32:53FromGitter<tim-st> @ephja btw I'm currently work again on the thing where I needed lzma, do you have an eample where I can extract a given compressed string to the uncompressed string or cstring using your lib?
15:33:33FromGitter<tim-st> normally I understand how wrapper work, but I couldnt find it in your wrapper :(
15:38:22*gangstacat joined #nim
15:44:21FromGitter<Vindaar> @tim-st: not sure if you solved it or not, but something like this works (probably what @ephja is also talking about): ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ Might still break if something is more complex though [https://gitter.im/nim-lang/Nim?at=5b86bf55cff55e56177a3a54]
15:49:27FromGitter<ephja> I was referring to Foo(...).sizeof rather than Foo.sizeof
15:50:35FromGitter<ephja> @tim-st oh. right. I have lzma bindings! this is the code I was testing it with before https://gist.github.com/ephja/1384059296eec8593b197d60d5edbd27
15:50:52*ftsf quit (Ping timeout: 250 seconds)
15:56:32FromGitter<tim-st> @ephja perfect, thanks!
15:57:21FromGitter<tim-st> @Vindaar thanks, but I think the problem is that the compiler can pack a tuple so the size is in fact unknown, independent on the single fields types sizes :(
15:58:00FromGitter<tim-st> the vm can not know about the packed size, unless it 100% implements the gcc and clang, ... algorithms
15:59:01FromGitter<tim-st> I will do it manually for each field at compile time, but the way @ephja suggested (getting size at runtime) would work too
16:00:43FromGitter<Vindaar> Oh, ok, if that's the case it doesn't help :/ How do you do it at compile time then for each field?
16:02:02FromGitter<tim-st> I just read from my stream each type as the type I know it is, and then say for each `result.fieldA = readFromStreamAtPosA; result.fieldB = readFromStreamAtPosB`
16:03:11FromGitter<tim-st> The main problem is, when the tuple size is bigger than the sum of each fields, when I then read the complete sum size and the compiler uses a bigger size because it thinks access is quicker then, my type gets corrupted
16:04:51FromGitter<tim-st> I think this is the reason why nim doesnt support tuple size at compile time
16:08:30FromGitter<Vindaar> Yeah, that would make sense
16:24:40*vegax87 quit (Ping timeout: 250 seconds)
16:26:40*abm quit (Quit: Leaving)
16:29:08*darithorn joined #nim
16:41:51*nsf quit (Quit: WeeChat 2.2)
16:55:44*rokups quit (Quit: Connection closed for inactivity)
16:57:19*vegax87 joined #nim
17:00:36sagaxhi all!
17:00:58sagaxhow to compile code to single binary file?
17:10:05FromGitter<mratsim> it’s compiled to a single binary by default
17:13:05FromGitter<rayman22201> @Vindaar damn different time zones. I just got back on online to see your message. You are correct about the lexer. It seems to me like this case should theoretically work, but like you said, the nim style insensitivity makes it not a big deal.
17:26:22FromGitter<tim-st> @ephja I get this output: https://gist.github.com/tim-st/f12f9c20da7d255b81518b50e164882f
17:26:22FromGitter<tim-st> shouldnt there be a different size for the compressed one?
17:26:22*seni joined #nim
17:35:33FromGitter<rayman22201> Another late reply, but I am a fan of @timotheecour's idea for making. nims standard over .cfg
17:36:44FromGitter<kayabaNerve> I wish I could use .nims as .cfg
17:37:28FromGitter<kayabaNerve> My project has main.nim (empty 99% of the time) and `samples` which are unfit to be main but also are great snippets to demo the code/can be used as a main.
17:37:53FromGitter<kayabaNerve> Thing is, if I copy over a sample, I must rename it to main, since I can't do nim.nims; I have to do nim.cfg.
17:37:58FromGitter<mratsim> I’m ok with .nims or .toml
17:38:21FromGitter<kayabaNerve> That said, I do some things in the nims I can't do in the cfg.
17:38:43FromGitter<kayabaNerve> But then I have two samples that are co dependent... it's doesn't end up pretty.
17:42:35FromGitter<rayman22201> Having a proper language as your config is just obviously superior imho
17:43:41FromGitter<rayman22201> You can abuse it of course, but that flexibility becomes very important, especially for complex use cases like cross compilation or large projects
17:44:25*krux02 joined #nim
17:46:49FromGitter<kayabaNerve> I really just use it to force the C++ backend.
17:47:04FromGitter<kayabaNerve> ```if getCommand() == "c": ⏎ setCommand("cpp")``` [https://gitter.im/nim-lang/Nim?at=5b86dc17ff44515616569fba]
17:48:15FromGitter<kayabaNerve> The rest of it could be done with a switch statement. That said, I need to setup tasks/different build suites... and I'm pretty sure at the level I need, I would need Nake, not Nimscript.
17:50:42FromGitter<mratsim> but for tasks you should use nimble though
17:56:52FromGitter<kayabaNerve> It's not a Nimble package
17:57:15*zachcarter joined #nim
17:57:21zachcarterhowdy all
17:58:10zachcarterAraq: thank you for pointing out the flaw in the implementation of the length | empty | full procedures in my AsyncQueue impl - I fixed the problem and now things are running swell!
17:59:05zachcarterAlso - I spoke with my director today and he said he's onboard with me starting to use Nim in projects at work - it will be a slow introduction of the language and probably just involve projects I work on (until others learn enough Nim via pair programming)
17:59:19zachcarterHe's going to talk to my manager just to make sure everything is okay - but assuming it is - I'm excited!
18:00:18FromGitter<mratsim> woooo congrats
18:01:24FromDiscord<awr> hey is {.noForward.} dead (replaced with {.reorder: on.}?)
18:01:49FromDiscord<awr> i was gonna do a PR adding to docs but I noticed a commented out chunk on {.noForward.}
18:01:59FromDiscord<awr> *adding {.reorder.} to docs
18:02:09FromGitter<rayman22201> Congratulations @zachcarter!
18:02:22zachcarterThank you!
18:08:08FromGitter<timotheecour> @zachcarter which company?
18:08:34zachcartertimotheecour: Carfax
18:08:58FromGitter<timotheecour> cool Thx!
18:09:14zachcarternp! - I told my director that since one of our organizational goals was to reduce tech sprawl - Nim would be a great candidate for that
18:10:03zachcartercurrently the product I work on has five or six different languages (Vanilla JS, Ecmascript6/7, NodeJS, Flow (static-typing), Typescript, Golang, Java, and Kotlin) - depending on the component and when it was built and what we had available to us at the time of building it / what made sense at the time.
18:10:13zachcarterand I explained with Nim - we could reduce that number of languages down to one
18:10:52zachcarterI also highlighted the potential for datascience work using Nim instead of Python / R - the latter of which I think is the more popular data analsyis language atm
18:12:24FromGitter<timotheecour> related to that https://twitter.com/voidtarget/status/1034275371695239168 is a big news for me: nimtorch, nim frontend to pytorch for neural nets
18:13:11FromGitter<timotheecour> looking fwd to see lots of PRs coming from carfax in Nim repo!
18:19:18FromGitter<Vindaar> @rayman22201 ok, implementing that feature into the lexer turned out to be rather trivial. But I'm not sure Araq would like it? Well, I'm not sure if *I* like it :D The downside is that the user can define variable names etc. with trailing underscores, as long as they are always written in backticks (I just check if we're currently in backticks or not).
18:21:21FromGitter<rayman22201> hrmm.... idk if I like that either.
18:21:39FromGitter<timotheecour> @ephja @Vindaar @tim-st: for CT sizeof, see https://github.com/nim-lang/Nim/issues/5493 ; and maybe give another encouragement nudge to @krux02 ;-)
18:22:58FromGitter<timotheecour> @Vindaar what’s the context for "implementing that feature into the lexer “ ? do u have a PR/issue link? (coz i have 1 idea related to that)
18:24:29FromGitter<rayman22201> @timotheecour here: https://irclogs.nim-lang.org/29-08-2018.html#00:13:51
18:24:51FromGitter<rayman22201> and here: https://irclogs.nim-lang.org/29-08-2018.html#09:45:58
18:24:53FromGitter<tim-st> @timotheecour I think the only way to support it would be to compile a dummy file that has the type in it an tell nim what is the size
18:24:54FromGitter<rayman22201> for context
18:25:36FromGitter<tim-st> Maybe it would be possible to find patterns where `packed` pragma creates different sizes and simulate these
18:26:19FromGitter<ephja> krux \m/
18:27:44FromGitter<tim-st> oh, I think that's exactly what he does, but he doesnt seperate between release and debug mode
18:29:53FromGitter<ephja> @tim-st same compressed and uncompressed size? that doesn't seem right >.<
18:30:14krux02you mentioned me?
18:32:38FromGitter<timotheecour> @Tim-st what do u mean by "the only way to support it would be to compile a dummy file” ? https://github.com/nim-lang/Nim/pull/5664 doesn’t seem to do that?
18:33:43FromGitter<timotheecour> @krux02 ya, I think there’s more customers for your PR on sizeof :-) ?
18:34:59krux02yea I know
18:35:05krux02currently it is bad timing though
18:35:13krux02hand in my master thesis next week
18:38:06shashlickcan finally monitor nim github in slack - https://imgur.com/O5IsA7J
18:39:49FromGitter<timotheecour> @krux02 good luck w ur master thesis!
18:40:08krux02thans
18:40:10krux02k
18:40:55FromGitter<timotheecour> (but basically the main thing blocking ur PR is rebasing against devel?)
18:42:27FromGitter<ephja> gl!
18:43:05FromGitter<ephja> krux02: nim-gdb is pretty neat. I dunno what's causing code that I step over to also not be executed. that's very odd
18:43:37FromGitter<ephja> I need to see if it happens with plain gdb too
18:44:13FromGitter<ephja> that might actually be useful at times, but it's far more common to want to not inspect, but still execute some part of the code in question :-)
18:47:54FromGitter<tim-st> @ephja Do you get different results for the code? I tried on windows with dll from the official website
18:48:24FromGitter<nortiero> Hi! I'm playing with Urho3D. In cpp mode, nim compiler produces the following C++ code: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ Please note that there are base constructors too, I cannot easily add a fake argument. ... [https://gitter.im/nim-lang/Nim?at=5b86ea77f5402f32aaac731a]
18:57:32krux02phja nim-gdb doesn't really change anything in gdb
18:57:39krux02it just loads pretty printers
18:57:54krux02but it is regular gdb
19:26:06*zachcarter quit (Quit: Page closed)
19:29:49FromGitter<timotheecour> @rayman22201 ok thx for the context; the idea i had was unrelated. I plan to submit RFC at some point: the idea is a tiny amendment to nim’s style insensitivity: identifiers starting/ending with `_` would be compared strictly (not style insensitively); this would help among other things with: ⏎ ⏎ 1) user_sort vs use_rsort => `useRSORT_` would be different from `user_sort` ⏎ 2) some acronyms to avoid
19:29:49FromGitter... breaking them in meaningless way ⏎ 3) (most important use case): FFI: eg: `libmpfr.dylib` defines both `mpfr_exp2` and `mpfr_exp_2` ; FFI wrappers could simply insert trailing `_` to avoid symbol clash; other example: libldc.dylib defines both `exit` and `_exit` ; etc there are many more examples [https://gitter.im/nim-lang/Nim?at=5b86f42c11227d711de8bd14]
19:37:41FromGitter<tim-st> where is the "implicit return value" documented?
19:37:54FromGitter<tim-st> should this work:
19:38:03FromGitter<tim-st> ```proc test(): int = ⏎ result = 1 ⏎ 2``` [https://gitter.im/nim-lang/Nim?at=5b86f61a58a3797aa3d4739d]
19:52:04FromGitter<rayman22201> @timotheecour Those kinds of naming conventions are popular in several older C++ codebases that I have worked with (old internal banking systems, not OSS stuff) so your FFI usecase is very reasonable. FFI symbol clashing is the big sell here for me, but maybe there are other ways to deal with symbol clashing. IDK if I like it elsewhere in the language. From my understanding, Your first example of `user_sort` vs
19:52:04FromGitter... `usersort` vs `usersort_` is something I think araq specifically wants to be equivalent. So that would not be a selling point for the core devs I think (read araq). It might complicate the lexer more than it helps, but I don't have a strong opinion one way or the other.
19:53:34FromGitter<kaushalmodi> Today I was concatenating a string like `"foo" & someProcReturningString`
19:53:37FromGitter<timotheecour> The code change is not hard and I can volunteer to do it if needed
19:53:44FromGitter<kaushalmodi> and `someProcReturningString` takes 0 args
19:54:06FromGitter<kaushalmodi> that gave me compile errors like: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b86f9dd11227d711de8e122]
19:54:29FromGitter<kaushalmodi> the fix was add the empty parens.. `"foo" & someProcReturningString()`
19:54:43FromGitter<kaushalmodi> so I am trying to understand when the empty parens are needed vs not
19:54:51FromGitter<timotheecour> @rayman22201 currently usersort_ is not even allowed so my proposal introduces no breaking change; it’d just give a new meaning to a previously unallowed identifier: usersort_
19:56:19FromGitter<timotheecour> @kaushalmodi foo.bar => UFCS ; bar => no UFCS ; that’s documented
19:56:41FromGitter<kaushalmodi> @timotheecour Thanks
19:57:08FromGitter<kaushalmodi> as a general rule, I think doing `foo()` would always work..
19:57:25FromGitter<kaushalmodi> `foo()` or `bar().foo()` or `foo().bar()` ..
19:58:03FromGitter<timotheecour> No it can’t : let bar = myfun returns a function pointer instead of calling it
19:58:34FromGitter<timotheecour> Nim does the right thing in this case (compared to D)
19:58:49FromGitter<rayman22201> @timotheecour I think the principle is the main issue, not the implementation. I'm not sure if goes against a core design principle of the language (style insensitivity). That's a conversation you have to have with araq. It won't break anything existing, but it may open up a can of worms in user code if people decide to use it as a convention.
19:58:52FromGitter<kaushalmodi> Thanks. Makes sense
19:59:30FromGitter<timotheecour> @kaushalmodi can u please elaborate on the suggestion you +1’d here: https://github.com/nim-lang/Nim/pull/8795#issuecomment-416604939 ⏎ ⏎ > How about exposing lineInfoToString in config.nims? Then we can specify the format ourselves. ⏎ ⏎ how would I do that? [https://gitter.im/nim-lang/Nim?at=5b86fb221d3a5711b6b79ca2]
20:00:26FromGitter<rayman22201> @tim-st your code does not compile on the nim playground, and I wouldn't expect it to because the integer literal 2 by itself is not valid nim code. Here is the docs on return: https://nim-lang.org/docs/manual.html#statements-and-expressions-return-statement ⏎ I think there is better docs about the magic / implicit `return` variable, but I can't find them atm
20:01:27FromGitter<rayman22201> /s/`return`/`result`
20:02:33FromGitter<kayabaNerve> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b86fbd8ac25fd11b5b1b8e5]
20:02:38FromGitter<kayabaNerve> It doesn't tell me the error
20:02:58FromGitter<kaushalmodi> @timotheecour I just replied.
20:02:59FromGitter<kayabaNerve> Should I make an issue of this? Lol.
20:03:12FromGitter<kayabaNerve> Is there just no way to use raises with async? Lol
20:03:22FromGitter<rayman22201> @tim-st : also this https://nim-lang.org/docs/tut1.html#procedures-result-variable
20:03:32FromGitter<kaushalmodi> Another Nim question unrelated to current discussion.. how can I do `curl -X GET` calls using Nim?
20:05:07FromGitter<kayabaNerve> It just doesn't work. Ok. That's problematic..
20:05:11FromGitter<kaushalmodi> *why do I ask before searching a bit better?* Looks like client.get is the answer
20:06:04FromGitter<rayman22201> I think `HTTPClient.request` can also take an arbitrary string in the `httpMethod` parameter
20:06:24FromGitter<tim-st> @rayman22201 your links describe the implicit `result` variable, that different from the implicit return value. Also the code above is valid nim code, and when change to `var result = 1` works. So there is a check that both are not allowed. I wanted to compare this to specs so I can find out if it's a bug or expected, but it seems the implicit return value is not described anywhere
20:06:59FromGitter<kaushalmodi> @rayman22201 I was earlier doing `client.getContent(url).parseJson()` for an API that works over http
20:07:11FromGitter<kaushalmodi> now try to figure out how to do the same for another API that needs GET
20:08:33FromGitter<kaushalmodi> well.. doc string of `getContent` says "Connects to the hostname specified by the URL and performs a GET request.".. so not sure why it's not working
20:09:04FromGitter<rayman22201> @tim-st The last link I sent you describes it pretty well I think. If you do not have a return statement, the value of the `result` variable is used as the return value.
20:10:12FromGitter<rayman22201> and your snippet gives this error for me. It does not compile`in.nim(3, 5) Error: expression '2' is of type 'int literal(2)' and has to be discarded`
20:10:31FromGitter<rayman22201> if you do `discard 2`, that works fine
20:10:41FromGitter<kaushalmodi> Anybody using Todoist here?
20:10:51FromGitter<kaushalmodi> I am trying to make this API call from Nim: http://doist.github.io/todoist-api/rest/v8/#get-all-projects
20:11:08FromGitter<kaushalmodi> That curl commands works from terminal
20:11:40FromGitter<rayman22201> @kaushalmodi, what happens if you use `request` instead of `getContent`?
20:11:43FromGitter<kaushalmodi> But if I put that exact URL in `newHttpClient().getContent(URL)`, it throws an exception
20:11:46FromGitter<kaushalmodi> let me try
20:12:00FromGitter<rayman22201> slightly different api, but gives you more control
20:14:07FromGitter<kaushalmodi> tried and looked at Response.body.. "404 page not found"
20:14:28FromGitter<kaushalmodi> odd.. it's the exact same URL I paste (not type) in `curl -X GET URL`
20:14:36FromGitter<rayman22201> that is odd
20:14:49FromGitter<rayman22201> are you putting your api token into the header correctly?
20:15:02FromGitter<rayman22201> setting the "Bearer"
20:15:43FromGitter<rayman22201> `client.headers = newHttpHeaders({ "Authorization" : "Bearer <my_token>" })`
20:15:44FromGitter<kaushalmodi> this is what I do: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b86fef094f8164c17ba44b1]
20:15:49FromGitter<kaushalmodi> (not a real token :))
20:15:55FromGitter<rayman22201> I hope not :-)_
20:16:26FromGitter<kaushalmodi> I found use of an Elisp fn I wrote a while ago.. that randomizes chars in selected region :)
20:16:46FromGitter<rayman22201> cool lol
20:16:58FromGitter<rayman22201> the code I sent above is equivalent to the -H flag in curl
20:17:26FromGitter<kaushalmodi> ah! dummy me
20:17:40FromGitter<rayman22201> easy mistake to make. np
20:17:44FromGitter<kaushalmodi> I was appending the -H .. portion to the URL input of `request`
20:18:02FromGitter<kaushalmodi> *never worked with this stuff before*
20:18:04FromGitter<rayman22201> that will do it!
20:18:12FromGitter<kaushalmodi> thanks! trying what you suggested
20:18:26FromGitter<rayman22201> typos affect the best of us :-P
20:18:59FromGitter<ephja> @tim-st it's compressing, and then decompressing though, right?
20:19:40FromGitter<ephja> in which case it should match. or maybe I've missed something. it might not be the most readable example
20:19:57FromGitter<ephja> I'll look at it more carefully soon
20:20:05FromGitter<tim-st> @ephja I have not checked it. But I dont think so. I compared a seq with 100_000 times same byte, and this should compress, but didnt change size
20:20:10FromGitter<tim-st> thanks!
20:21:33FromGitter<tim-st> @rayman22201 no, `discard 1` has a completely different meaning compared to just `1` see:
20:21:40FromGitter<ephja> I should have specified the name of the arguments
20:22:18FromGitter<tim-st> ```proc test(): int = ⏎ var result = 1234 ⏎ 5678``` ⏎ ⏎ works [https://gitter.im/nim-lang/Nim?at=5b870079c2bd5d117aef3281]
20:23:32FromGitter<tim-st> I'm ok with it that it doesnt compile, but wanted to see the manual entry where it descibes that this is not allowed, otherwise I cant be sure if thats a bug
20:23:51FromGitter<kaushalmodi> @rayman22201 Thanks! This worked!
20:24:02FromGitter<kaushalmodi> https://ptpb.pw/xgS4/nim
20:24:09FromGitter<rayman22201> @tim-st Interesting.... It works because you shadowed the `result` variable
20:24:22FromGitter<tim-st> yes, also without var it works:
20:24:34FromGitter<tim-st> ```proc test(): int = ⏎ 1``` [https://gitter.im/nim-lang/Nim?at=5b87010258a3797aa3d4be2a]
20:24:45FromGitter<tim-st> only with both it doesnt
20:25:29FromGitter<rayman22201> yup. you are correct. That is the behavior I see. I'm not sure if that is correct or not
20:25:43FromGitter<tim-st> I wasnt sure too :\
20:25:51FromGitter<rayman22201> it is weird / interesting
20:26:17FromGitter<kayabaNerve> Is it a good idea for async for IO but threading for processing?
20:26:26FromGitter<ephja> yes, there are both block statements and block expressions
20:26:38FromGitter<ephja> echo (if true: 1 else: 2)
20:30:08FromGitter<mratsim> @kayabaNerve that’s what you’re supposed to do
20:30:27FromGitter<ephja> one or more branches may raise an exception instead of returning a value
20:31:02FromGitter<mratsim> maybe we should transform the shadow result variable to an error instead of a warning?
20:31:23FromGitter<ephja> seems reasonable
20:32:20sagaxhow to compile with silent mode?
20:32:22FromGitter<kayabaNerve> @mratsim Just checking
20:32:32FromGitter<ephja> `assert inBuf == outBuf2[0 ..< outPos2]` well, the decompressed input is identical to the original data. so far so good :-P bbs
20:32:32sagaxwithout debug output
20:34:31FromGitter<rayman22201> @mratsim @tim-st I think a warning is fine. I could see shadowing `result` being useful *if you know what you are doing*. I think it's a documentation bug. implicit return needs to be documented more clearly.
20:34:46FromGitter<tim-st> @mratsim the problem I described wasnt about shadowing the result variable, it was about using "implicit return value" together with result variable doesnt work
20:34:58FromGitter<rayman22201> exactly
20:35:25FromGitter<tim-st> Also: "implicit return value" is not described at all from what I have seen
20:36:04*stefanos82 quit (Quit: Quitting for now...)
20:36:16FromGitter<rayman22201> I can't find documentation for implicit return at all. And the official tutorial is actually misleading here, because the section on return implies that the implicit `result` var is returned, not the last statement in the body
20:36:55sagaxcan't find some like as --silent key
20:37:08sagaxfor compile nim code without debug output
20:37:11FromGitter<tim-st> @ephja is it ok to set the `allocator` to `nil`?
20:37:20sagaxi know about 1>/dev/null and 2>/dev/null
20:37:36sagaxbut i think that nim have some key for silent mode
20:40:24*Vladar quit (Remote host closed the connection)
20:43:20FromGitter<tim-st> @ephja I tried to built a high level api like here, I think it should work if your example was correct: https://gist.github.com/tim-st/6a04b9ffe71f5cd77b992d2fee6d713b
21:11:43FromGitter<ephja> @tim-st the out_pos parameter will be set to the actual length I think
21:11:48FromGitter<ephja> well, length-1
21:12:19FromGitter<ephja> yes, the allocator may be nil: "lzma_allocator for custom allocator functions. Set to NULL to use malloc() and free()."
21:35:40sagaxi found --verbose key
21:35:51sagaxbut this can't disable debug output
21:36:03sagaxjust setup output with minimal verbose
21:36:21sagaxbut maybe nim can compile without any output?
21:37:29sagaxhm, ok, i just will be use 2>/dev/null
21:37:57FromGitter<ephja> there's also "-w:on|off|list, --warnings:on|off|list" and "--hints:on|off|list"
21:38:16sagaxthanks, will try this
21:38:26FromGitter<ephja> see nim --advanced, or nim --fullhelp for both the basic help and advanced help
21:44:25FromGitter<ephja> @tim-st documented in src/liblzma/api/lzma/container.h https://sourceforge.net/projects/lzmautils/
21:44:54FromGitter<ephja> but check if out_pos is smaller than the uncompressed length-1
21:45:37*seni quit (Quit: Leaving)
21:49:13sagaxnim have some package manager>
21:49:15sagax?
21:49:28sagaxlike as gem,pip,luarock,npm,etc...
21:52:17sagaxoh, i found
21:52:23sagaxnimble, thanks
22:01:17FromGitter<kaushalmodi> Very excited to have my first API project started: https://github.com/kaushalmodi/ntodo
22:01:30FromGitter<kaushalmodi> For now, it only gets a list of my todoist projects and creates a new project
22:01:58*abm joined #nim
22:08:56*xet7 quit (Quit: Leaving)
22:17:38*noonien quit (Quit: Connection closed for inactivity)
23:12:48*abm quit (Remote host closed the connection)
23:13:11*abm joined #nim
23:17:16*abm quit (Ping timeout: 246 seconds)
23:23:18*zachcarter joined #nim
23:25:28zachcarterI spoke with my manager today - relating what my director and I talked about - and he sounds like is onboard too. Just need confirmation from the director now - but it sounds like Nim is a go at carfax :D
23:26:01zachcarterWe need to create an embedded experience for our product - mimicking the current frontend - and I don't want to resort to iFrames if possible - so I think we're going to use webcomponents
23:26:44zachcarterand I've made it clear - that I think we should wrte this new widget w/ the Nim JS target instead of using TypeScript | Flow - as we'd eventually like to stop using both - and just achieve type safety via Nim
23:27:15zachcarterTime to work on a Nim equivalent of lithtml / hyperhtml
23:27:19zachcarter:D
23:28:30FromGitter<rayman22201> sweet!
23:31:29*krux02 quit (Remote host closed the connection)
23:45:35Tangerkaushalmodi: Nice! Amazing what can be done with so few lines of code in Nim :D
23:47:10zachcarterI was talking to another developer today at work, one of my co-workers that I'd hang out with after work (and there are very few because I learned early on not to mix work and personal life)
23:47:44zachcarterand I told him the exciting news about Nim - and I explained the main concern regarding Nim adoption - which is there isn't a resource pool to hire from, and no one besides myself at Carfax knows it
23:48:36zachcarterI also told him about the major selling point for Nim that I raised with my director - in that it can help reduce tech sprawl. We have 7 different languages (or frameworks that provide extensions to existing languages, like Flow) - and I was explaining we could potentially write our product in one language
23:49:00zachcarterbut my co-worker brought up the point that introducing a new language - unless everyone adopts it - isn't really reducing tech sprawl, except in whatever project it's used in
23:49:31zachcarterI'm not sure how to counter that point though - I mean he is right - but I feel like the Nim seed needs to be planted, and then once folks see the potential, they will naturally gravitate towards the language.
23:49:58zachcarterand you can't do that - without getting Nim's proverbial foot through the door
23:50:27zachcarterConvincing people through slideshows / presentations doesn't work - people think, yeah that's cool but I like the language I know better and I don't want to learn something new.
23:50:55zachcarterI think the only way to introduce a change like that in "enterprise IT" is to do it organically
23:51:35zachcarterBecause no one is going to trust me and my word when I say that Nim is superior to X or that Nim can potentially benefit us in a certain way
23:56:14FromGitter<rayman22201> I think the sad truth is that "reducing tech sprawl" is a very difficult thing to do.... from a business perspective, it is almost always cheaper to maintain the status quo than it is to build new things that provide the same functionality..... but I still want Nim to be used in more places, so please don't let that stop you lol!