00:14:14 | FromGitter | <riddl_gitlab> is it a bug? ⏎ ⏎ ```buf = buf + uint((rand(2048 - 16*amount) + 16 * amount -1792) shl 24)``` ⏎ ⏎ when there is no whitespace between minus sign and `1792` nim says ... [https://gitter.im/nim-lang/Nim?at=5c58d55678e1ed4103e1eec6] |
00:14:37 | FromGitter | <riddl_gitlab> or is it another nim thing that I am not aware of? |
00:21:01 | rayman22201 | It's Command invocation synatax (called UFCS in other languages). https://nim-lang.org/docs/manual.html#procedures-command-invocation-syntax |
00:21:26 | rayman22201 | It's treating that as as `amount(-1792)` |
00:21:51 | rayman22201 | not a bug, correct spacing is important. |
00:22:30 | FromGitter | <riddl_gitlab> ..... |
00:25:22 | FromGitter | <riddl_gitlab> sorry but this is just broken |
00:26:20 | rayman22201 | To quote the Big Lebowski, "That's just like, your opinion, man" |
00:26:39 | rayman22201 | If I were to code review that line, I would call you out on it. It's not good style. |
00:28:03 | rayman22201 | the error message could maybe be more clear though. That's a tough problem. |
00:28:33 | rayman22201 | Many people enjoy the ufcs syntax, this kind of compiler nit-pickyness is the price we pay for that feature. |
00:30:44 | FromGitter | <timotheecour> thats not UFCS though that’s command invocation syntax |
00:31:03 | FromGitter | <timotheecour> (sry for the nitpick, otherwise ya) |
00:34:39 | FromGitter | <gogolxdong> Someone used nimPDF? |
00:37:15 | FromGitter | <riddl_gitlab> > *<rayman22201>* If I were to code review that line, I would call you out on it. It's not good style. ⏎ ⏎ Well, we've got different definition of what code review should check in the first place ⏎ ⏎ > *<rayman22201>* the error message could maybe be more clear though. That's a tough problem. ... [https://gitter.im/nim-lang/Nim?at=5c58dabb78e1ed4103e210bf] |
00:37:51 | FromGitter | <riddl_gitlab> Not worth it, its convenient in very limited cases |
00:38:34 | rayman22201 | It's widely used in Nim. |
00:39:26 | FromGitter | <timotheecour> ya overtime u may come to appreciate that syntax; it does look leaner |
00:40:46 | rayman22201 | It makes writing DSL's much easier, something Nim is very strong at. |
00:42:31 | FromGitter | <riddl_gitlab> i dont have any problem with that syntax, its in ruby for centuries |
00:44:02 | FromGitter | <riddl_gitlab> but this should work as well ⏎ ⏎ ```var x = 10 ⏎ var z = 928 * x -3``` [https://gitter.im/nim-lang/Nim?at=5c58dc5254f21a71a1fca8a0] |
00:45:08 | FromGitter | <timotheecour> nim has significant whitespace |
00:47:20 | FromGitter | <riddl_gitlab> in case of indentations, thats reasonable, but spaces? |
00:47:43 | FromGitter | <riddl_gitlab> for someone moving from c/c++c/c#/objc its mind blowing |
00:51:16 | rayman22201 | I still write plenty of C/C++ in my day job... I have had 0 issues with it |
00:54:22 | * | theelous3 quit (Ping timeout: 272 seconds) |
01:05:21 | FromGitter | <riddl_gitlab> well, people can adapt in every way, but it doesn't change that it's just broken. Someone decided that doubtful functionality is worth more that consistency. ⏎ Reason should be a differentiator here, spaces doesn't matter in arithmetic. You want that feature? Implement it in a way that doesn't break logic. Dont take me offensive, inconsistency is something I can hardly stand in general, but here its minor issue. |
01:05:21 | FromGitter | ... Maybe fixable in future (g++ handles C++ syntax which is far more complex.. but it takes time:) ) |
01:11:46 | rayman22201 | You have to prove to us that's it's broken first. You have stated your opinion that it is broken, but not really given any evidence why. "Spaces don't matter in arithmetic". Actually they do. "-3" is not the same as "x - 3". One is a negative number, which is a particular subset of Z (the natural numbers), and the other is the "-" formal algebraic subtraction function. |
01:14:30 | rayman22201 | The space becomes even more important with matrices / linear algebra because subtraction is not commutative |
01:15:48 | FromDiscord_ | <juan_carlos> No problem: (amount ) -(1792) |
01:16:14 | FromDiscord_ | <juan_carlos> (amount )-( 1792) |
01:18:45 | FromGitter | <riddl_gitlab> 1) substraction is just an addition of negative number, matter of abstraction ⏎ 2) spaces are not related with commutative property of matrices in any way |
01:19:11 | FromGitter | <riddl_gitlab> yeah, sure we can go with brackets here, in calculations. Great idea. |
01:19:23 | FromGitter | <riddl_gitlab> we droped brackets in function calls |
01:19:40 | rayman22201 | "for someone moving from c/c++c/c#/objc its mind blowing"... Quite a few people have come to Nim from C/C++ and even embedded, and nobody has had issues with this feature. In fact many enjoy the elegance of it. |
01:19:44 | FromGitter | <riddl_gitlab> just to have them in calculations |
01:19:53 | FromGitter | <gogolxdong> (https://files.gitter.im/nim-lang/Nim/oOsh/image.png) |
01:20:21 | FromGitter | <riddl_gitlab> @rayman22201 im not talking talk func param, param2 is ugly or anything like that |
01:20:23 | FromGitter | <riddl_gitlab> its ok |
01:21:28 | FromGitter | <riddl_gitlab> but if we need to pay for it with broken syntax of arithmetic operations its something i just dislike |
01:21:40 | FromGitter | <gogolxdong> anyone graphics background, how to fill the pentagram? |
01:22:03 | rayman22201 | @riddl_gitlab: " spaces are not related with commutative property of matrices in any way" The importance of spaces in formal math is relative. As long as another human can parse what you are seeing it's fine. With a machine parser more precision is required. |
01:22:06 | FromGitter | <riddl_gitlab> fill it with blood of innocent cat |
01:22:10 | FromGitter | <riddl_gitlab> ;-) |
01:29:28 | * | d10n-work quit (Quit: Connection closed for inactivity) |
01:46:40 | FromGitter | <timotheecour> (https://files.gitter.im/nim-lang/Nim/74nQ/image.png) |
01:47:25 | FromGitter | <timotheecour> @araq are you here? do you intend to have builds runing for prior versions of a branch even though u pushed new commits to that branch? travis is queing like crazy right now because of that |
01:49:58 | FromGitter | <timotheecour> (See https://travis-ci.org/nim-lang/Nim/branches) ; maybe there’s a setting we can put in .travis.yml that would kill a prior job if a new commit (wo `[skip ci]`) is pushed to that same branch (in some situations it’s useful to keep both; but in most cases it’s too resource ineffective) |
02:07:47 | * | seni quit (Ping timeout: 240 seconds) |
02:23:59 | FromGitter | <timotheecour> EDIT: figured out the setting we need to change, see https://github.com/nim-lang/Nim/issues/10556 |
02:28:58 | * | a_b_m quit (Quit: Leaving) |
03:02:25 | * | banc quit (Quit: Bye) |
03:05:47 | * | dddddd quit (Remote host closed the connection) |
03:24:10 | * | banc joined #nim |
03:42:33 | * | NimBot joined #nim |
03:44:57 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
04:15:56 | * | nsf joined #nim |
04:34:16 | FromGitter | <timotheecour> is there a growable circular buffer implementation in either stdlib or nimble? |
04:34:31 | FromGitter | <timotheecour> Use case : queues |
04:35:07 | leorize | `lists`? |
04:35:30 | leorize | also for queues there's `dequeues` |
04:35:45 | leorize | `deques` to be exact |
04:40:50 | FromGitter | <timotheecour> @leorize thanks! `deques` seems exactly what i need |
05:59:14 | FromDiscord_ | <j$> anyone here? |
05:59:36 | FromGitter | <timotheecour> noone |
05:59:55 | FromDiscord_ | <j$> hmmm |
06:00:45 | FromDiscord_ | <j$> is there a way to have a variable that is accessible from all files? |
06:01:06 | FromDiscord_ | <j$> or is that bad practice, in general? |
06:01:06 | FromGitter | <timotheecour> like `-d:foo:bar` |
06:02:12 | FromGitter | <timotheecour> bad practice in general but useful for debugging: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ (`nim —fullhelp`) [https://gitter.im/nim-lang/Nim?at=5c5926e49221b9382d188000] |
06:05:18 | FromDiscord_ | <j$> hmm I don't think this is what I want, so there's a variable that's in my main module, I want to be able to access that variable in my imported modules, is there a way to do this, or a better way to have to same effect |
06:06:22 | FromDiscord_ | <j$> I cant import the main module bc the recursive module error or whatever |
06:07:11 | FromDiscord_ | <j$> the only other way I see is to declare that variable in all modules then assign them in the main |
06:07:21 | FromDiscord_ | <j$> which is annoy |
06:07:27 | FromDiscord_ | <j$> ing |
06:07:41 | FromGitter | <timotheecour> just have a module `common.nim` that defines ur global shared variable and let ur other modules call `import common` either explicitly or implicitly as i showed above via `—import:common.nim` (only for debugging tho) |
06:10:49 | * | kapil____ joined #nim |
06:12:41 | FromDiscord_ | <j$> I didnt want to do that either but seems like the only good option |
06:13:05 | FromDiscord_ | <j$> is there a reason you cant define a global variable like this? |
06:16:51 | leorize | @j$ try adding the needed variables on top of your main module |
06:16:56 | leorize | before any `import` statements |
06:17:25 | leorize | then you might be able to access them |
06:17:29 | leorize | see: http://nim-lang.github.io/Nim/manual.html#modules |
06:23:24 | * | narimiran joined #nim |
06:29:15 | * | lritter joined #nim |
06:42:34 | FromGitter | <timotheecour> thx for 2nd time today leorize, i didn’t know recursive module dependencies are (very partially…) supported |
06:55:35 | * | krux02 joined #nim |
07:27:48 | FromDiscord_ | <demotomohiro> Then, everytime you reuse these modules that depends on global variables defined in main module, you have to define same global variables in the main module again or you would get ``undefined variable`` errors. |
07:28:36 | FromDiscord_ | <demotomohiro> sounds like bad practice |
07:35:34 | Araq | don't use too many globals, they make your code non .gcsafe so you won't be able to use multi-threading |
07:41:27 | FromGitter | <timotheecour> @araq all good with https://github.com/nim-lang/Nim/pull/10545 ? |
07:43:33 | FromGitter | <timotheecour> also travis didn’t use to be that slow; wondering if it’s the `araq-test-nimble-packages` builds; although even then it’s odd given that travis has a timeout per build |
07:43:48 | * | Cthalupa quit (Ping timeout: 246 seconds) |
07:44:53 | Zevv | Properly handling paths is surprisingly hard, good that Nim can handle this for me :) |
07:47:24 | * | Cthalupa joined #nim |
08:00:00 | * | gmpreussner quit (Quit: kthxbye) |
08:04:35 | * | gmpreussner joined #nim |
08:41:42 | * | JustASlacker joined #nim |
08:44:49 | * | kapil____ quit (Quit: Connection closed for inactivity) |
08:56:40 | * | jubalh left #nim (#nim) |
08:58:11 | narimiran | @timotheecour regarding CIs: didn't you say that you have some updates for https://github.com/nim-lang/Nim/pull/10367 ? |
09:06:15 | * | volkov joined #nim |
09:07:03 | Araq | https://nim-lang.github.io/Nim/lib.html new doc style has arrived |
09:07:11 | Araq | thanks narimiran, looks much better IMO |
09:08:25 | * | floppydh joined #nim |
09:15:38 | * | kapil____ joined #nim |
09:19:39 | Araq | timotheecour, haven't reviewed it yet |
09:20:40 | Araq | but it should be fine if you addressed my remarks |
09:20:53 | Araq | will review it soon, sorry |
09:44:44 | * | volkov quit (Quit: volkov) |
09:48:32 | FromGitter | <timotheecour> Ok thx; i sent u a few other PRs as well |
09:49:38 | FromGitter | <timotheecour> @narimiran yes haven’t got around to clean that azure PR, can do tmrw |
09:50:07 | FromGitter | <timotheecour> (looks like getting urgent bc travis is getting slow) |
09:56:21 | * | nc-x joined #nim |
09:56:46 | FromGitter | <mratsim> cgi applications, do we have those? |
10:00:57 | nc-x | narimiran: http://i66.tinypic.com/672qv7.png |
10:01:08 | nc-x | mobile site does not look good |
10:01:25 | narimiran | nc-x: thanks, will look into it |
10:01:35 | FromGitter | <mratsim> the lines are too long on wide screen |
10:01:52 | FromGitter | <mratsim> standard typography is 80~100 characters per line |
10:16:16 | Zevv | I guess on mobile you'd want to change the whole CSS layouting to hide the left menu |
10:16:41 | * | Vladar joined #nim |
10:17:59 | * | Cthalupa quit (Ping timeout: 268 seconds) |
10:19:03 | * | nc-x quit (Ping timeout: 256 seconds) |
10:19:33 | * | Cthalupa joined #nim |
10:20:58 | narimiran | @mratsim i'm big proponent of 80-100 chars per line, but: people complained that the pages are too narrow (ok, we could/should ignore them :)), and the code samples were "spilling over" way too frequently |
10:21:34 | narimiran | so i increased the width, *and* increased the main font size, so it is almost the same (slightly higher) char per line as before |
10:21:37 | FromGitter | <mratsim> restrict code to 80 ;) |
10:25:25 | narimiran | sometimes code is under 80 but docgen does its "magic" and you have these too long lines |
10:31:17 | narimiran | nc-x: how is https://nim-lang.org/docs/lib.html on mobile? (that's the old version) |
10:33:07 | narimiran | to answer my own question: it is TOC first, then the content. it might be best to do what Zevv says |
10:37:50 | * | dddddd joined #nim |
10:42:55 | Zevv | Old css folds the content div under the toc div if the window is too small |
10:43:09 | Zevv | but having to scroll through 12 pages of toc before you reach the content is also not optimal |
10:43:16 | narimiran | yup |
10:43:27 | Zevv | I think for mobile there is no good solution, there is just too much info on the pages |
10:43:56 | FromDiscord_ | <juan_carlos> Try <details> |
10:44:22 | Zevv | I do like the new CSS btw, makes better use of screen estate. |
10:45:21 | * | abm joined #nim |
10:46:28 | narimiran | thanks :) |
10:49:49 | federico3 | oh - was there a release? |
10:51:04 | federico3 | ok, tooted |
10:58:31 | * | absolutejam joined #nim |
11:00:22 | absolutejam | morning |
11:02:34 | * | tzui quit (Remote host closed the connection) |
11:05:03 | * | tzui joined #nim |
11:20:12 | FromGitter | <riddl_gitlab> is there any module in std proving pointers arithmetic like ptrMath in https://github.com/Vladar4/sdl2_nim/blob/master/sdl2/private/stdinc.nim or I need to provide it myself everytime? |
11:21:18 | FromGitter | <mratsim> no libs, see also: https://forum.nim-lang.org/t/4606#28851 |
11:27:21 | Zevv | narimiran: i don't know the css internal, but take a look at the python docs |
11:28:02 | Zevv | they keep the toc frame on the left, but scale the main frame to the with of the screen. Wrapping is always ok on mobile small with, but you can still scroll left to the toc |
11:28:33 | Zevv | if I zoom in, the font grows but the main column is again resized to screen width |
11:31:31 | FromGitter | <riddl_gitlab> > no libs, see also: https://forum.nim-lang.org/t/4606#28851 |
11:32:31 | leorize | the general recommendation is to use UncheckedArray |
11:34:10 | FromGitter | <riddl_gitlab> > no libs, see also: https://forum.nim-lang.org/t/4606#28851 ⏎ ⏎ Thank you @mratsim . I have question to your optimized version of it (one with emiting c code). ⏎ If I what to use it I need always pass `pointer` (unsafeAddr of object) instead of `ptr Type`, do I understand it correct? [https://gitter.im/nim-lang/Nim?at=5c5974b2975714406b9a38fd] |
11:34:46 | FromGitter | <mratsim> you can use either pointer or ptr T, but unsafeAddr will give you ptr T |
11:35:06 | FromGitter | <mratsim> not that pointer also includes ptr T |
11:43:07 | Araq | we need an arrayAddr that produces a ptr UncheckedArray |
11:44:12 | FromGitter | <mratsim> can be sugar |
11:47:26 | Araq | sure but it's often more correct to use ptr UncheckedArray but with addr you're encouraged to use the wrong type |
11:52:44 | FromGitter | <mratsim> yeah I’m casting to unchecked quite often |
12:06:43 | * | seni joined #nim |
12:09:14 | livcd | is nimble.directory open source ? |
12:09:38 | livcd | ah i found it nvm |
12:11:49 | * | nsf quit (Quit: WeeChat 2.3) |
12:14:58 | federico3 | yes |
12:21:40 | narimiran | Zevv, nc-x: soon i'll have a fix for the documentation on mobile (or at least i think i will :)) |
12:22:06 | narimiran | there will be no TOC, and the main content will be of full length |
12:26:26 | narimiran | *full width |
12:26:42 | * | seni quit (Remote host closed the connection) |
12:29:15 | * | ng0 joined #nim |
12:33:31 | * | rockcavera quit (Remote host closed the connection) |
12:34:49 | * | kapil____ quit (Quit: Connection closed for inactivity) |
12:35:24 | * | stefanos82 joined #nim |
12:36:35 | * | seni joined #nim |
12:36:58 | * | rockcavera joined #nim |
12:55:59 | * | PMunch joined #nim |
13:03:45 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
13:15:31 | * | Snircle joined #nim |
13:23:03 | Araq | https://ci.appveyor.com/project/Araq/nim/builds/22134532/tests wow only 3 failures |
13:23:38 | Araq | quite good for a heavy system.nim refactoring |
13:24:24 | PMunch | Nice, what kind of refactoring? |
13:24:45 | Araq | moved IO subsystem to its own module |
13:30:01 | federico3 | is nimfind not being shipped with the latest release by choice? |
13:30:26 | Araq | yeah, the 0.19.x line is about bugfixes only |
13:30:28 | leorize | federico3: because it's not there? :P |
13:30:48 | Araq | we're all waiting for 0.20 :-) |
13:30:51 | federico3 | same for nim-gbp? I see a tools/nim-gdb.py file |
13:31:06 | Araq | that's probably an oversight of installer.ini |
13:31:23 | Araq | but again, if 0.19.0 lacked it, 0.19.4 should also lack it |
13:32:00 | federico3 | tools/nim-gdb.py was shipped first with 0.19.0 |
13:33:00 | federico3 | thanks Araq |
13:33:02 | Araq | well I dunno |
13:33:18 | Araq | you can argue it's just a bug and thus 0.19.x should have it |
13:33:46 | Araq | or you can argue it's a "new feature" since you can do 'source toos/nim-gdb.py' in GDB otherwise |
13:34:11 | Araq | not worth losing sleep over, IMO. |
13:35:08 | leorize | that is, if you install nim-gdb.py :P |
13:36:15 | federico3 | I'm just asking to keep packaging.rst accurate |
13:36:33 | Araq | I see |
13:37:08 | Araq | well packaging.rst should probably mention installer.ini which covers these things too, albeit a bit indirectly |
13:46:12 | federico3 | yes, that helps |
13:49:54 | Araq | https://github.com/nim-lang/Nim/issues/10561 this seems to be an easy system.nim patch for those of you who'd like to get into Nim development |
14:15:37 | FromGitter | <arnetheduck> @Araq, doing https://github.com/nim-lang/RFCs/issues/67? |
14:20:07 | Araq | yeah |
14:20:12 | Araq | was easier than expected |
14:20:39 | FromGitter | <arnetheduck> nice. |
14:21:54 | Araq | coming soon: Move the signal handler and exception handling code out of system *cough* |
14:22:11 | Araq | oh no, first the assert-related stuff |
14:22:47 | leorize | osproc API is terrible atm :/ |
14:22:56 | Araq | hey! I like it |
14:23:16 | leorize | I need to pass in only stdin and capture stdout |
14:23:23 | leorize | but that's not possible with the current osproc |
14:23:41 | Araq | sure it is, that's what I did in nimedit |
14:24:18 | leorize | oh, nice |
14:24:22 | leorize | how did you do it? |
14:25:35 | Araq | https://github.com/Araq/nimedit/blob/master/console.nim#L359 |
14:26:08 | Araq | I guess the API could be much better, but it's also messy because of the multi threading |
14:26:50 | Zevv | narimiran: looks good, the TOC just drops out |
14:27:53 | leorize | Araq: oh, I need to actually pass the stdin file to the process |
14:28:04 | leorize | or else that will break `isatty` |
14:28:40 | narimiran | Zevv: thanks, i'm quite satisfied how it looks :) (and surprised that it worked :)) notice that also font size drops a bit, so you don't have giant font on your phone or small screen/window |
14:28:44 | Araq | ah there is an RFC for that :P leorize |
14:29:02 | Zevv | narimiran: I noticed, this is pretty and usable imho |
14:29:43 | Zevv | If you're open for more comments (which I don't know how to solve): |
14:29:53 | narimiran | now we can browse the documentation while we're on toilet :D |
14:30:13 | Zevv | The TOC is sometimes not helping; for example in system there is this whole list from `..` to `<` which is not at all informational |
14:30:22 | Zevv | or the 6 times "len" |
14:31:00 | Zevv | there is no type info there, so the user has no clue which one to choose |
14:31:05 | narimiran | just resize your window and you won't be seeing it :P :D |
14:31:22 | Zevv | Yeah, true, solves it for me as well :) |
14:31:36 | narimiran | joking aside, i agree and i hope it will be solved sooner or later |
14:31:47 | Zevv | yeah, but what are the possible solutions? |
14:32:06 | Araq | merge overloaded procs to one in the TOC |
14:32:12 | narimiran | the best solution i came with so far: let somebody else worry and implement that :P |
14:32:22 | Zevv | I heard you're the docman :) |
14:32:27 | narimiran | shit. |
14:32:36 | Zevv | I'm just a naive user |
14:34:14 | * | aguspiza joined #nim |
14:44:21 | Araq | leorize, can you create a PR that adds a 'startProcess' that also takes stdin/stdout/stderr. Maybe it's hard though |
14:49:16 | leorize | it shouldn't be too hard, I'll try :) |
14:49:19 | PMunch | Companion post to my FOSDEM talk is now up: https://peterme.net/meta-programming-in-nim-fosdem-talk-companion-post.html it might be a still rough but I wanted to get something out there as fast as possible so people wouldn't forget all about it :P |
14:50:50 | narimiran | PMunch: what are your impressions? how was the audience? |
14:51:48 | PMunch | Lot's of nodding, some laughing (at the right places), generally they seemed interested enough |
14:52:17 | PMunch | Will be interesting to see the video of it :P |
14:52:25 | leorize | everyone will be interested when you show genui :p |
14:52:29 | PMunch | Hard to gauge my own performance when I'm not in the audience |
14:52:40 | PMunch | leorize, I actually just opened some genui files |
14:52:45 | leorize | too bad it's not available for everything |
14:53:46 | PMunch | Talked to krux02 about it at FOSDEM and after he pointed me to look at AntTweakBar I really want to start working on it again |
14:54:20 | PMunch | I was thinking about my new library, the cross-platformm one :) |
14:54:40 | PMunch | It's really simple to make the genui macro for your platform of choice though |
14:54:45 | narimiran | could you maybe, before that, fix playground? :) people are asking about it |
14:54:56 | PMunch | Still haven't gotten access to it.. |
14:55:06 | PMunch | Otherwise it would be on the top of my list |
14:55:51 | narimiran | ok, who we need to ping/remind to give you the access? |
14:56:05 | PMunch | Not 100% sure TBH |
14:56:46 | PMunch | I think it's zacharycarter, but not sure |
14:57:58 | narimiran | i think he's on gitter, so let's try it this way: @zacharycarter, ping :) |
14:58:44 | PMunch | Doesn't the bot auto @? |
14:58:52 | PMunch | Or is that only when it's at the start of a sentence? |
14:58:59 | narimiran | does it? i had no idea |
14:59:20 | PMunch | It used to at least :P |
14:59:52 | FromGitter | <Vindaar> I don't think it does. At least not in mid sentence. At the start no idea |
15:00:06 | narimiran | Vindaar we can check it right now |
15:00:06 | * | kapil____ joined #nim |
15:00:14 | narimiran | did it? |
15:00:18 | FromGitter | <Vindaar> nope |
15:00:29 | narimiran | Vindaar: now? |
15:00:39 | FromGitter | <Vindaar> yep |
15:00:44 | narimiran | ok, : is needed |
15:00:52 | PMunch | Vindaar, does this work? |
15:00:56 | PMunch | Ah yes it does |
15:01:00 | FromGitter | <Vindaar> hehe :) |
15:01:09 | PMunch | Vindaar- is it any symbol |
15:01:12 | PMunch | Hmm, no |
15:01:13 | narimiran | in the middle of sentence Vindaar: maybe? |
15:01:27 | FromGitter | <Vindaar> nope, I think just the `@` |
15:01:37 | PMunch | So it seems like it's the start of the sentence and only when followed by : or , |
15:03:19 | FromGitter | <Clyybber> Im pretty sure it works in the mid of a sentence, it's just that gitters highlighting is wonky at best |
15:03:51 | narimiran | it works if i put @ in front manually, @Clyybber, like this here |
15:04:11 | FromGitter | <Clyybber> Yeah, the @ is needed |
15:05:59 | PMunch | Clyybber, the IRC -> Gitter bot will automatically add an @ before the username if it's the first word and it's followed by a , or : |
15:06:07 | * | seni quit (Quit: Leaving) |
15:06:09 | PMunch | That's what we were discussing :P |
15:06:38 | PMunch | If you compare the IRC and gitter logs you will see what we mean: irclogs.nim-lang.org |
15:06:53 | FromGitter | <Clyybber> Oh, sry I was a bit OOL :D |
15:07:06 | FromGitter | <Clyybber> Thats pretty cool tho |
15:08:24 | PMunch | Yeah it's nice, since IRC doesn't use @ to highlight and just highlights you as long as your word is in the message |
15:08:32 | PMunch | Plus many IRC clients will have tab completion for nick-names which often adds a , or : automatically |
15:11:00 | krux02 | PMunch, so did you try out AntTweakBar? |
15:11:31 | PMunch | I didn't try it, but I looked at some code examples |
15:12:25 | PMunch | I mean this kind of stuff is easy to expand to in Nim: TwAddVarRW(bar, "speed", TW_TYPE_DOUBLE, &speed, |
15:12:25 | PMunch | " label='Rot speed' min=0 max=2 step=0.01 keyIncr=s keyDecr=S help='Rotation speed (turns/second)' "); |
15:12:56 | krux02 | yes it is |
15:13:00 | krux02 | not everything though |
15:13:14 | krux02 | the stap is something that still should be added manually I think |
15:13:32 | krux02 | but TW_TYPE_DOUBLE is something you shouldn't need to write manually |
15:13:44 | PMunch | Could be written as `bar.addVarRW(speed, label="Rot speed", min=0, max=0, step=0.01, keyIncr='s', keyDecr='S', help="Rotation speed (turns/second)"); |
15:13:55 | PMunch | stap? |
15:14:11 | krux02 | step |
15:14:15 | PMunch | Oh yeah |
15:14:37 | PMunch | Looking at AntTweakBar I started to think of how you can control the widget creation |
15:14:48 | krux02 | not much |
15:15:08 | krux02 | I used them mostly for debugging purpose, so not real end user UI |
15:15:27 | PMunch | I kinda like the idea of "hints" that are a simple key-value pair list which the engine is free to use or discard, but with some "official" names for things that should work cross-platform. |
15:15:29 | krux02 | but really fast prototyping and here everything is static, except that you can hide it |
15:16:01 | PMunch | Yeah AntTweakBar definitely looks to be more geared towards debugging |
15:16:13 | * | ng0 joined #nim |
15:16:20 | PMunch | I mean the input idea is similar, but the output is vastly different |
15:16:36 | krux02 | it has no intention to be end user UI, but that should be custom made in my opinion anyway |
15:16:47 | krux02 | end user UI at least for games don't need much. |
15:17:07 | PMunch | Well games is a bit of a special category since they tend to be very stylized |
15:17:10 | * | aguspiza quit (Ping timeout: 246 seconds) |
15:17:15 | krux02 | a few sliders in the main menue. items to choose from a list. But some fancy graphcis |
15:17:29 | PMunch | But for something like a settings menu a similar approach to ATB should work fine |
15:17:48 | krux02 | it really depends on what you want to do. But ant tweak bar is really made to be embedded in 3D applications |
15:17:52 | krux02 | so mostly games |
15:17:56 | PMunch | True |
15:18:25 | PMunch | It's definitely giving me some good ideas though, so thanks for telling me about it :) |
15:18:41 | krux02 | you are welcome |
15:19:30 | * | aguspiza joined #nim |
15:19:40 | krux02 | when you try it out. The official website only has a version that does not yet support SDL2.0 that is a bit sad. I fixed that problem, there is no way to contact the maintainer (if you still want to call him that) to merge that. |
15:19:55 | krux02 | so nimAntTweakBar is already fixed |
15:20:23 | krux02 | https://github.com/krux02/nimAntTweakBar |
15:21:35 | krux02 | but I didn't port the examples |
15:21:41 | PMunch | Oh cool |
15:30:22 | * | nsf joined #nim |
15:33:56 | * | aguspiza quit (Ping timeout: 240 seconds) |
15:41:40 | * | ng0 quit (Remote host closed the connection) |
15:42:42 | * | ng0 joined #nim |
16:02:27 | * | Trustable joined #nim |
16:11:05 | * | PMunch quit (Remote host closed the connection) |
16:28:44 | rockcavera | which library do I use for regular expressions? NRE or RE? |
16:29:26 | narimiran | i think re is the preferred one |
16:31:22 | * | JustASlacker quit (Remote host closed the connection) |
16:37:47 | * | floppydh quit (Quit: WeeChat 2.3) |
16:40:19 | * | absolutejam quit (Ping timeout: 268 seconds) |
16:48:26 | * | solitudesf quit (Quit: ZNC - https://znc.in) |
16:48:52 | * | solitudesf joined #nim |
16:51:42 | FromGitter | <kaushalmodi> re is officially preferred, nre is unofficially by some :) |
16:51:55 | FromGitter | <kaushalmodi> And nre was officially deprecated at some point |
16:52:51 | FromGitter | <kaushalmodi> .. and there's a third one, available from nimble, not depending on PCRE: `regex` |
16:55:13 | Araq | regex doesn't compile with devel |
16:55:25 | Araq | unknown regression deep inside unittest.nim |
16:56:34 | Araq | and that's a pity because we could resolve the dispute by embracing regex |
17:00:38 | FromGitter | <Varriount> Araq: Is the compilation error straightforward? |
17:02:11 | Araq | what do you mean? |
17:22:24 | FromDiscord_ | <akavel> Hi! Newbie question: does Nim allow overloading by only returned type of a proc? |
17:23:06 | FromDiscord_ | <akavel> e.g.: |
17:23:06 | FromDiscord_ | <akavel> ``` |
17:23:06 | FromDiscord_ | <akavel> proc foo(): uint64 = ... |
17:23:06 | FromDiscord_ | <akavel> proc foo(): string = ... |
17:23:06 | FromDiscord_ | <akavel> ``` |
17:23:53 | FromDiscord_ | <akavel> or should I distinguish them by name, e.g.: |
17:23:53 | FromDiscord_ | <akavel> ``` |
17:23:54 | FromDiscord_ | <akavel> proc foo_uint64(): uint64 = ... |
17:23:54 | FromDiscord_ | <akavel> proc foo_string(): string = ... |
17:23:54 | FromDiscord_ | <akavel> ``` |
17:27:47 | narimiran | isn't this easily tested by yourself? ;) |
17:33:31 | FromGitter | <Vindaar> @akavel Hey! No that is not supported. You can either distinguish by name, create a generic which you instantiate manually or use a `typedesc` argument: https://gist.github.com/Vindaar/a84bd2eb9c3d215026c219cb21b77054 ⏎ ⏎ @narimiran well, it's nice to have confirmation and some ideas for alternatives, no? ;) |
17:34:04 | narimiran | true, sorry |
17:37:20 | FromGitter | <mratsim> proc foo(): auto = when type(CompileTimefoo()): fooUint64() else: fooString() |
17:38:01 | FromDiscord_ | <akavel> @Vindaar: thanks! |
17:39:02 | FromDiscord_ | <akavel> In case of a generic and `when ... elif ...`, will Nim emit an error if I try to use it for a type not listed in the `when` block? |
17:39:24 | FromGitter | <brentp> why not just ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ ? [https://gitter.im/nim-lang/Nim?at=5c59ca4cc2dba5382ee683c6] |
17:39:59 | FromDiscord_ | <akavel> @brentp: ok, cool, thanks! 😃 |
17:41:18 | narimiran | now for the real question: why do you need this? (aka, maybe you don't need this :)) |
17:41:32 | FromGitter | <Vindaar> @akavel if you use it for a type not listed in either `when` or `elif` the function body will just be empty. So depending on your use case you should either include an `else` branch to handle all other types (error manually for instance) or use what @brentp says and already constrain the generic |
17:41:59 | FromDiscord_ | <akavel> @narimiran: I'm writing a protocol parser & emitter, |
17:42:41 | FromDiscord_ | <akavel> the protocol has some basic "atoms", namely: uint64, bool, string |
17:43:58 | FromDiscord_ | <akavel> for the emitter, I imagine I can have `proc write(s; v: uint64)` and `proc write(s; v: string)` etc. |
17:44:17 | FromDiscord_ | <akavel> but I was wondering what to do for the parser |
17:45:30 | FromDiscord_ | <akavel> should I have `read_uint64()`, or somehow `read[uint64]()`, or `var v: uint64 = stream.read()` would just work because type inference via return type. |
17:45:40 | leorize | @akavel: there's the `{.error: "msg".}` pragma that you can place in the `else` branch |
17:46:28 | FromDiscord_ | <akavel> @leorize: cool, thanks! Still, I suppose the type constraint has a benefit of being self-documenting in the signature |
17:46:48 | FromDiscord_ | <akavel> @narimiran: do you have some other suggestions in this case? 😃 |
17:48:25 | FromGitter | <brentp> @akavel, you can also do, e.g.: ⏎ ⏎ ```proc read(i:var int) = ... ⏎ proc read(s:var string) = ... ⏎ proc read(f:var float) = ...``` [https://gitter.im/nim-lang/Nim?at=5c59cc69975714406b9ca97f] |
17:49:17 | FromDiscord_ | <akavel> @brentp: but this then requires 2x more lines where called, no? |
17:50:51 | FromGitter | <brentp> you mean in order to allocate the argument? not if you re-use it. |
17:51:37 | FromDiscord_ | <akavel> `let x = stream.read[uint64]()` or `let x = stream.read_uint64()` looks simpler for me than: |
17:51:38 | FromDiscord_ | <akavel> ``` |
17:51:38 | FromDiscord_ | <akavel> var x: uint64 |
17:51:38 | FromDiscord_ | <akavel> stream.read(x) |
17:51:38 | FromDiscord_ | <akavel> ``` |
17:52:05 | FromDiscord_ | <akavel> especially if I do a *lot* of those |
17:53:05 | * | FromGitter quit (Remote host closed the connection) |
17:54:58 | * | jacobsin joined #nim |
17:56:07 | FromDiscord_ | <akavel> Uh, ok, now I see in the streams library there are `readUint64` etc. functions, so this kinda makes me believe this is probably "the canonical way" |
18:14:36 | Zevv | dom96: I'd like to do some small refactorings on the networking code; I think getAddrInfo() should return a proper Nim data structure that can be GC'ed so freeAddrInfo() can be dropped |
18:15:27 | Zevv | and I think that some procs using inet_ntoa()/inet_ntop() might be better off moving to getnameinfo() |
18:15:30 | Zevv | any thoughts? |
18:18:33 | * | tzui quit (Ping timeout: 252 seconds) |
18:19:29 | * | lritter quit (Quit: Leaving) |
18:29:35 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
18:41:59 | * | regtools quit (Quit: leaving) |
18:42:09 | * | regtools joined #nim |
18:44:18 | Araq | Zevv, better embrace the destructors for this |
18:48:36 | Zevv | not sure of that is needed at this time. getAddrInfo() will just iterate the addrinfo linked list and put the elements in a seq, and do freeaddrinfo() straight away. |
18:49:02 | * | kapil____ quit (Quit: Connection closed for inactivity) |
18:49:29 | Zevv | why keep the result in a linked list with ptr's |
19:04:35 | * | aguspiza joined #nim |
19:16:47 | * | jacobsin quit (Ping timeout: 240 seconds) |
19:18:21 | * | jacobsin joined #nim |
19:20:01 | * | jxy quit (Quit: leaving) |
19:22:33 | * | jacobsin quit (Ping timeout: 245 seconds) |
19:23:04 | * | nsf quit (Quit: WeeChat 2.3) |
19:29:40 | FromDiscord_ | <demotomohiro> I wrote a blog post about debugging Nim code with GDB. |
19:29:40 | FromDiscord_ | <demotomohiro> https://internet-of-tomohiro.netlify.com/nim/gdb.en.html |
19:30:53 | * | seni joined #nim |
19:31:50 | * | jacobsin joined #nim |
19:32:27 | * | snowolf quit (Ping timeout: 250 seconds) |
19:33:50 | * | snowolf joined #nim |
19:36:10 | * | jacobsin quit (Ping timeout: 246 seconds) |
19:37:15 | * | jacobsin joined #nim |
19:37:56 | * | jxy joined #nim |
19:41:19 | * | jacobsin quit (Ping timeout: 244 seconds) |
19:42:16 | * | jacobsin joined #nim |
19:46:30 | * | aziz joined #nim |
19:49:38 | * | jacobsin quit (Ping timeout: 245 seconds) |
19:51:21 | * | jacobsin joined #nim |
19:55:26 | * | jacobsin quit (Ping timeout: 240 seconds) |
19:55:36 | * | vlad1777d joined #nim |
20:28:56 | * | Jesin quit (Quit: Leaving) |
20:31:20 | krux02 | demotomohiro: that is pretty cool |
20:41:07 | * | kobi7 joined #nim |
20:47:08 | * | Jesin joined #nim |
20:47:27 | * | Trustable quit (Remote host closed the connection) |
20:49:28 | * | aziz quit (Ping timeout: 272 seconds) |
20:51:24 | FromDiscord_ | <demotomohiro> krux02 thank you! |
21:01:37 | * | aziz joined #nim |
21:01:44 | krux02 | it mostly sums up the content of the video, but it also mentions things that I think are not part of the video |
21:02:06 | krux02 | but I think you don't mention the key to refrash the text user interface on the terminal |
21:02:18 | krux02 | it is pretty important since it can mess up pretty easily. |
21:09:37 | krux02 | demotomohire: you should mention Ctrl-L |
21:15:34 | * | aziz quit (Ping timeout: 246 seconds) |
21:16:20 | narimiran | @demotomohiro thanks for the article! i think we should link to it in the gdb video description |
21:21:42 | * | theelous3 joined #nim |
21:23:29 | * | narimiran quit (Read error: Connection reset by peer) |
21:26:23 | * | kobi7 quit (Quit: Leaving) |
21:26:42 | * | kobi7 joined #nim |
21:27:16 | kobi7 | cd $(nimble path yaml); nim c yaml.nim |
21:27:27 | kobi7 | worksforme anyone? |
21:28:27 | shashlick | qw21OI() |
21:28:32 | * | aziz joined #nim |
21:32:19 | * | Vladar quit (Read error: Connection reset by peer) |
21:32:22 | shashlick | that was an awesome article |
21:45:31 | * | abm quit (Read error: Connection reset by peer) |
21:45:58 | * | abm joined #nim |
22:03:48 | * | aguspiza quit (Ping timeout: 245 seconds) |
22:12:41 | federico3 | Nim 0.19.4 has been uploaded and is being built in Debian https://buildd.debian.org/status/package.php?p=nim |
22:15:39 | * | aziz quit (Ping timeout: 246 seconds) |
22:29:11 | * | aziz joined #nim |
22:38:35 | * | PMunch joined #nim |
22:42:44 | * | krux02 quit (Remote host closed the connection) |
22:43:32 | * | aziz quit (Ping timeout: 268 seconds) |
22:52:54 | * | jacobsin joined #nim |
22:55:20 | * | aziz joined #nim |
22:57:08 | * | jacobsin quit (Ping timeout: 250 seconds) |
23:00:03 | * | vlad1777d quit (Ping timeout: 245 seconds) |
23:00:55 | * | fvs joined #nim |
23:02:05 | fvs | hi, not sure why the following fails, any suggestions: https://pastebin.com/zeWMUykp |
23:03:33 | * | FromGitter joined #nim |
23:04:09 | FromGitter | <oprypin> thanks @genotrance |
23:05:52 | * | kobi7 quit (Quit: Leaving) |
23:06:04 | oprypin | fvs, num*8 is probably not what you meant |
23:09:53 | FromGitter | <akavel> I'm trying to use `concept`s, but I'm getting an error like below: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c5a17c1ca428b06455f194e] |
23:10:14 | FromGitter | <akavel> relevant file fragments: |
23:10:44 | FromGitter | <akavel> ##serve.nim |
23:11:00 | FromGitter | <akavel> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c5a180478e1ed4103ea429f] |
23:11:12 | FromGitter | <akavel> then later: |
23:11:56 | FromGitter | <akavel> ```proc serve*(store: Store; r, w: Stream) = ⏎ # ...``` [https://gitter.im/nim-lang/Nim?at=5c5a183bceb5a2264f9de886] |
23:12:09 | FromGitter | <akavel> ##nixme.nim |
23:12:30 | FromGitter | <akavel> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c5a185d1b62f12650ab6184] |
23:12:44 | FromGitter | <akavel> ##local_store.nim |
23:13:12 | FromGitter | <akavel> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c5a188878e1ed4103ea4767] |
23:13:16 | FromGitter | <akavel> any ideas?... |
23:13:26 | FromGitter | <akavel> what I might be doing wrong?... |
23:20:44 | * | aziz quit (Remote host closed the connection) |
23:21:30 | FromGitter | <akavel> Ok, found it: seems that in the concept declaration, I should be using `... is seq[string]` instead of `... : seq[string]` |
23:21:38 | PMunch | akavel, try changing your concept to s.query_valid_paths(openArray[string]) is seq[string] |
23:21:46 | PMunch | Yeah :) |
23:21:49 | FromGitter | <akavel> :) |
23:22:09 | FromGitter | <akavel> found it via `tests/concepts/` in Nim repo |
23:22:41 | PMunch | The Nim manual also mentions this: https://nim-lang.org/docs/manual.html#generics-concepts |
23:23:06 | FromGitter | <akavel> right, also see it now; just didn't notice it's ` is `, not `:`, in the example. |
23:23:08 | FromGitter | <akavel> Thanks! |
23:23:08 | PMunch | See for example the Stack[T] concept which has `s.pop() is T` |
23:23:19 | PMunch | No problem :) |
23:24:04 | PMunch | The concept syntax can be a bit confusing |
23:26:30 | FromGitter | <akavel> still, better than templates in C++ ;) |
23:29:50 | PMunch | Oh for sure |
23:31:21 | PMunch | I do wish we had some kind of simpler interface syntax though |
23:31:42 | PMunch | Maybe I'll write a macro that will generate the correct concept syntax for me :P |
23:32:12 | * | PMunch quit (Remote host closed the connection) |
23:41:19 | FromGitter | <akavel> Can I define an array in multiple lines? Each element on separate line? |
23:42:05 | FromGitter | <akavel> ok, sorry, I had a different syntax error than I expected. |
23:55:14 | * | rockcavera quit (Remote host closed the connection) |
23:59:20 | * | askatasuna joined #nim |