<< 11-01-2018 >>

00:09:07*alexday joined #nim
00:09:11alexdayhey
00:09:32FromGitter<data-man> Does anyone use this in Windows? https://github.com/Maximus5/ConEmu
00:09:36dom96hi alexday :)
00:12:40alexdayis there a nil type in nim? I am implementing a simple trie with nim. I have type NodeObj = object children: seq[ref Node], isTermal: false. but when I initialize a new Node which is type Node = ref NodeObj. how can I make sure that (in terms of C) children[i] = NULL ?
00:13:06alexdayI can think of like setting an isEmpty property in the NodeObj .
00:13:17dom96you shouldn't be using double 'ref's
00:13:22dom96seq[Node] should be enough
00:13:36alexdayok
00:13:54dom96you can just write: type Node = ref object ....
00:14:17alexdaynoted.
00:14:18dom96and if you want to make something nil just assign nil to it
00:14:26dom96maybe I'm misunderstanding though
00:16:52alexdayso if I assign nil say, I would have to have something like a fixed size of children, and then iterate and set null. I was thinking, since seq[Node] is dynamic, is there anyway to check if the children[0]'th node is not empty or NULL
00:17:15alexdaywithout pre-assigning fixed set of child nodes
00:17:39FromGitter<brentp> @mratsim good to
00:17:42FromGitter<brentp> know
00:17:52FromGitter<brentp> Cigar:https://genome.sph.umich.edu/wiki/SAM#What_is_a_CIGAR.3F
00:19:45*gangstacat quit (Quit: Ĝis!)
00:20:58dom96alexday: check the length and then the contents
00:21:06alexdayok. yeah
00:21:15alexdaythat sounds cool. stupid me :D
00:23:26*gangstacat joined #nim
00:23:35*gokr quit (Ping timeout: 276 seconds)
00:27:33GitDisc<lotzz> Hello everyone
00:32:10*dddddd quit (Remote host closed the connection)
00:34:35*MJCaley joined #nim
00:45:45FromGitter<data-man> Hello!
01:01:19*kafke quit (Ping timeout: 248 seconds)
02:02:45*S1tiSchu joined #nim
02:03:28*MJCaley quit (Quit: MJCaley)
02:06:56*S1t1Schu quit (Ping timeout: 276 seconds)
02:10:28*zahary quit (Quit: Leaving.)
02:17:30*chemist69 quit (Ping timeout: 246 seconds)
02:19:14*MJCaley joined #nim
02:29:46*MJCaley quit (Quit: MJCaley)
02:32:01*chemist69 joined #nim
02:47:31*sz0_ joined #nim
02:49:55*sz0_ is now known as sz0
02:56:31*Cthalupa quit (Ping timeout: 248 seconds)
03:00:00*Cthalupa joined #nim
03:11:04*marenz_ joined #nim
03:15:11*marenz__ quit (Ping timeout: 276 seconds)
03:25:35FromGitter<saolof> does Nim distinguish between statements and expressions?
03:26:45FromGitter<RedBeard0531> yes, but most statements also have expression forms and there is a way to use multiple statements as an expression
03:27:10FromGitter<RedBeard0531> what are you trying to do?
03:27:37FromGitter<saolof> ah, I was just curious, I'm taking a look at the language and the syntax seemed python-like
03:29:29*vlad1777d quit (Ping timeout: 276 seconds)
03:29:30FromGitter<RedBeard0531> it is. but there are also things like https://nim-lang.org/docs/manual.html#statements-and-expressions-statement-list-expression and https://nim-lang.org/docs/manual.html#statements-and-expressions-case-expression that blur the line a little bit
03:56:23*endragor quit (Remote host closed the connection)
04:12:20*endragor joined #nim
04:19:35shashlick@data-man: I use ConEmu, pretty nice
04:23:49FromGitter<data-man> @shashlick: Which Windows version are you using?
04:24:06shashlick10
04:24:50FromGitter<data-man> With all updates? :)
04:26:22shashlickI hope 🙂 ... it is build 1607 Enterprise
04:27:13FromGitter<data-man> Can you check terminal module from my PR https://github.com/nim-lang/Nim/pull/6936 in the ConEmu? Please.
04:29:23shashlicksure
04:29:42shashlickwhat exactly do I need to do?
04:29:58FromGitter<data-man> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a56e846ba39a53f1affe3ca]
04:35:01FromGitter<data-man> What you see? :-)
04:35:51shashlickcannot open strformat?
04:36:51FromGitter<data-man> Oh! Isn't Nim devel?
04:37:36shashlicklet me choosenim update #head
04:46:59shashlickhttps://imgur.com/a/M5MvE
04:47:11shashlickleft is conemu in default color scheme, right is cmd.exe
04:47:25*arnetheduck quit (Remote host closed the connection)
04:48:42shashlicklooks bad in Monokai colorscheme
04:50:05FromGitter<data-man> Big thanks! ⏎ I will try ConEmu on Windows 8 in the VirtualBox.
04:50:25shashlickno problem
04:50:59*arnetheduck joined #nim
04:52:20*arnetheduck quit (Remote host closed the connection)
04:53:51*arnetheduck joined #nim
04:54:57FromGitter<data-man> @shashlick: Are you using Far Manager?
04:55:20*Atomic2 quit (Ping timeout: 260 seconds)
04:56:09shashlicknope, just ConEmu
04:58:51FromGitter<data-man> Why? Far Manager so cool! And I'm one of the contributors. :-)
05:03:48shashlickI used to use norton commander some decades ago, now so used to explorer
05:04:08shashlickof course, with fzf and ff (my tool), I avoid explorer too mostly
05:04:33shashlickhttps://github.com/genotrance/ff
05:06:10FromGitter<data-man> Did you see my message to you about the Everything?
05:08:26*Elronnd quit (Quit: BRB)
05:09:17*Elronnd joined #nim
05:09:24shashlickya i did try out everything but the fzf approach is much faster
05:09:46shashlickplus I can run any tool I want on any selection with shortcuts
05:10:08shashlicklike I can do "ff T" and kill a process
05:11:06shashlicki've also bound it to a hotkey with autohotkey so now all I do is WIN-/ d c and I can open a command line window on the sub-directory I picked on my desktop
05:11:43FromGitter<data-man> Of course, its own utility is always better. :-)
05:12:35shashlickagreed, but it's worth a try, especially when it comes to coding - really speeds things up
05:13:12FromGitter<data-man> Remains to write NimFZF
05:13:19shashlicki even have a conemu shortcut to open a new cmd tab in a directory selected
05:14:07shashlickI've stayed away from terminal/ncurses stuff historically, kudos to you on your PR
05:14:09shashlickand the Far work too
05:15:35*kordanza joined #nim
05:16:10FromGitter<data-man> Oh, no problem! :-)
05:16:56shashlickwhere are you located?
05:19:50FromGitter<data-man> Can you login to gitter?
05:19:53*Elronnd quit (Quit: brb)
05:20:03*elronnd joined #nim
05:21:10*elronnd is now known as Elronnd
05:22:26shashlickhow does that help?
05:24:18FromGitter<data-man> I can write to you privately.
05:28:42*kordanza quit (Quit: Leaving)
05:33:21*Atomic2 joined #nim
05:34:22*Atomic2 quit (Client Quit)
05:52:37*nsf joined #nim
06:11:07*arecaceae quit (Remote host closed the connection)
06:11:26*arecaceae joined #nim
06:11:45*marenz_ quit (Ping timeout: 260 seconds)
06:14:08*arnetheduck quit (Remote host closed the connection)
06:41:34*vlad1777d joined #nim
06:47:27*arnetheduck joined #nim
06:55:44*gokr joined #nim
07:56:50*yglukhov joined #nim
07:57:25*yglukhov quit (Read error: Connection reset by peer)
07:57:37*yglukhov joined #nim
08:07:50*PMunch joined #nim
08:10:13FromGitter<survivorm> @Yardanico you're using arch, aren't you?
08:10:54FromGitter<survivorm> How do you install nim/nimsuggest?
08:13:24miranchoosenim
08:13:38Araqkoch nimsuggest
08:25:42*floppydh joined #nim
08:25:58*claudiuinberlin joined #nim
08:30:31FromGitter<survivorm> i'm a looser... ⏎ no installations of nimsuggest seem to work properly on my PC
08:31:37Araqwhat editor are you using?
08:31:57PMunchsurvivorm, I'm using Manjaro (Arch based) and choosenim works fine for me :)
08:32:07FromGitter<survivorm> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a572107b48e8c3566c81ac7]
08:32:41FromGitter<survivorm> As you see, none given ANYTHING
08:32:49FromGitter<survivorm> not even one
08:32:59Araqcheck nimsuggest.log maybe
08:33:57Araqoh and all these commands require a file.nim argument
08:34:07Araqbut don't tell you you need it :P
08:34:34Araqnimsuggest is mostly used over sockets and it used to be chatty
08:34:45Araqthis caused all sort of protocol related problems
08:34:54Araqand so now it shuts up completely.
08:35:51FromGitter<survivorm> https://gist.github.com/survivorm/c9953b6e361cd7999a4bc337423ac8a0
08:36:24Araqcmd: sug, file: 36, dirtyFile: [11:0]
08:36:24AraqError: invalid module name: ''
08:40:49FromGitter<survivorm> input file, @@34-36 ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a572311290a1f456175b1d0]
08:44:02FromGitter<survivorm> btw, code is compiling and working, if that matters
08:44:33FromGitter<survivorm> i may provide full example, if needed
08:47:58FromGitter<Yardanico> @yglukhov gist works for me, I posted a gist raw link
08:48:26Araqsurvivorm: give it an absolute filename
08:48:57FromGitter<survivorm> in starting, or in sug/def ?
08:49:04Araqin sug/def
08:49:04FromGitter<survivorm> @Araq
08:49:14FromGitter<survivorm> ok, i'll try
08:51:12FromGitter<survivorm> gave me something
08:51:22FromGitter<survivorm> it's great
08:52:03AraqPRs welcome
08:52:58FromGitter<survivorm> in improving nimsuggest?
08:53:11Araqyes
08:54:10AraqI didn't consider these problems of importance as the tools feed nimsuggest the commands in the way it requires
08:54:13FromGitter<survivorm> And that may be the place i'll start digging. Even if only because of how much blood it costed myself
08:54:33Araqnimsuggest is not for humans :-)
08:54:40FromGitter<survivorm> i now
08:54:59FromGitter<survivorm> but it doesn't work in editors, too
08:55:19Araqit does for VSCode
08:56:13FromGitter<survivorm> I tested it in textadept, vim, qt creator and some more on my PC (with pluggins, of cource) and so far - to no avail
08:57:40FromGitter<survivorm> Maybe my before's install was broken. Maybe i've got unlucky. Maybe it's system running version was corrupt - don't now, All i now - it didn't, for me
08:58:14FromGitter<survivorm> So, testing it and making it work better sounds like a plan
08:59:54FromGitter<survivorm> But i think i need a little more maths on parsers/compilators for this task :) ⏎ Currently trying to dig Ullman/Aho THE THEORY OF PARSING, ⏎ TRANSLATION AND COMPILING
09:01:09FromGitter<survivorm> Good book, but unfortunately I'm not so good at maths to read and understand it for more than 2-4 pages a day :)
09:03:17*gmpreussner quit (Ping timeout: 255 seconds)
09:05:03*gmpreussner joined #nim
09:08:30Araqmeh, forget about that book
09:10:17PMunchHmm, slight annoyance with nimble. I have a main file and a support file in my project. I added both to "src" but it asked me to move the support file into a folder named the same as the project and the main file. Problem is that trying to compile the main file now gives me an error saying that it's output already exists and is a folder as it tries to compile it to the same name as the folder..
09:10:56euantor@PMunch I've complained about that a few times :P
09:11:16euantorI still find it unexpected that compiling from the root directory tries to output an executable in the src/ dir
09:11:28euantorTHe solution is to pass the `-o` option to change the output filename
09:11:38AraqNim supports --output, I think nimble does the same
09:13:16AraqUnix simply requires .exe extensions
09:15:04Araqor maybe some lovely double fuck like exeNameHere.elf
09:15:45Araqexegcc, execp, exemv, execlang, exenim -- what's there to dislike? you can easily delude yourself it adds "clarity" to your system
09:17:34alexdayhttps://w.awalgarg.me/d/NiRQ3HLJu can someone please help me with this? I pasted the error as comment at the end of the code
09:18:18Araqfor s in toSeq(value.items) ?
09:18:54Araqfor s in value # sometimes Nim is like Python
09:19:12alexdayow ok
09:19:26Araqlet index = int(s) - int('a')
09:19:26Araq # ?
09:19:34Araqhow does this addressing work?
09:19:47*Vladar joined #nim
09:20:46Araqanyway, you need to use crit bit trees from the stdlib
09:20:56Araqthey do what you attempt to do
09:20:59AraqI think.
09:21:52Araqor at least learn about setLen and sequence indexing, it doesn't work as in Perl
09:24:03alexdayok will look
09:43:13alexdaythat adressing is just like the difference between character and 'a'. so like z - a is 25
09:43:22alexdayand that's the array index
09:43:54Araqyeah I know but your seqs are empty
09:44:09Araqand you should have used an 'array' instead
09:51:44*sendell joined #nim
09:53:35FromGitter<Yardanico> @yglukhov maybe you checked gist yesterday, it was made with my old nickname so link was invalid
09:53:51yglukhovYardanico: yeah, most likely
09:54:30yglukhovanyways, inlining the crash log into the issue looks like a more bullet-proof approach
09:56:31*Atomic2 joined #nim
09:56:50*c0ntribut0r joined #nim
09:57:03*c0ntribut0r quit (Client Quit)
09:57:39*c0ntribut0r joined #nim
09:57:55*Atomic2 quit (Remote host closed the connection)
09:58:19*gokr quit (Read error: Connection reset by peer)
10:09:05*Yardanico joined #nim
10:10:44FromGitter<Yardanico> well it's pretty big
10:11:09FromGitter<Yardanico> but OK, I'll inline crash logs in issues directly, I know that's better for the future :)
10:19:49Araqdo we have a simple and fast zip algorithm written in pure Nim?
10:25:48YardanicoAraq, I don't think so :(
10:26:36Yardanicoit seems that everyone uses libzip
10:27:02FromGitter<data-man> @Araq: https://github.com/jangko/nimz ? ⏎ I not testing :-)
10:27:08Yardanicooh wow!
10:27:15Yardanicosorry, I'm wrong then
10:27:21Yardanicobut we don't know if it's simple or fast :)
10:28:00Yardanicodata-man: how did you find it? :D
10:28:20FromGitter<data-man> It's my big secret :-)
10:28:33FromGitter<codenoid> he is data man
10:28:35Yardanicowell I'm good at finding nim projects too
10:28:40Yardanicoeveryone knows that :P
10:34:16FromGitter<data-man> @Yardanico: You're amazing, no one is arguing that. :-)
10:38:09FromGitter<Yardanico> @GULPF hello, maybe you're around, what would be the best way to select random date if I have start and end of range? ⏎ currently I use "let randdate = fromUnix(int64(float(min) + rand(1.0) * float(max.toUnix - min.toUnix)))"
10:39:50FromGitter<Yardanico> min and max are both of "Time" type
10:39:52livcdhmm i am not able to install c2nim. Should I try to install nim 0.7.13 first ?
10:40:12Araqlivcd, can you fix c2nim please?
10:40:18AraqI can guide you
10:40:26Araqthe change should be one or two lines
10:40:35livcdok lets try
10:41:15Araqfork it from https://github.com/nim-lang/c2nim
10:41:45livcdok
10:42:02Araqc2nim.nim
10:42:08Araqthe lines like
10:42:09AraqrenderModule(tree, outfile, outfile)
10:42:12*Tanger quit (Ping timeout: 268 seconds)
10:42:14Araqshould become
10:42:30Araqwhen compiles(renderModule(tree, outfile, outfile)):
10:42:38Araq renderModule(tree, outfile, outfile)
10:42:42Araqelse:
10:42:47Araq renderModule(tree, outfile)
10:43:07Araqit's used in two places apparently
10:43:19Araqthen c2nim should compile again against an older Nim
10:44:29*BitPuffin joined #nim
10:45:53*xet7 joined #nim
10:46:38livcdand the line 97? : renderModule(m, outfile, outfile)
10:48:47Araqsimilar.
10:49:51livcdalso I have not found how to install this local version with nimble
10:50:12Araq"nimble develop" in c2nim's directory
10:50:28Araqyou don't have to install it
10:50:44Araqjust ensure it compiles with your Nim version and maybe run its testsuite
10:51:05Araqand then use your fork to create a PR
10:51:20Araqthis step will run the tests anyway
10:51:39Araqit's fool proof muhahaha
10:51:47livcdreally? but it won't be in the output right ?
10:51:58Araqwhat output?
10:55:10*Tanger joined #nim
10:56:54Yardanicowait, https://github.com/nim-lang/Nim/issues/2090 is this really implemented? AFAIK csources are still 1-core only :)
10:57:02livcdthat it ran tests
10:57:32Yardanicoah, it's not for nim's csources
10:57:53*xet7 quit (Ping timeout: 265 seconds)
11:14:32*gangstacat quit (Quit: Ĝis!)
11:15:33*xet7 joined #nim
11:22:48FromGitter<GULPF> @Yardanico `let randdate = min + rand(0..(max.toUnix.int - min.toUnix.int)).seconds` is better since casting `Time` to `float` will break soon.
11:23:02Yardanicook, thank you!
11:24:51*vlad1777d quit (Ping timeout: 240 seconds)
11:28:29YardanicoAraq, is this supposed to work? https://gist.github.com/Yardanico/cd3fb7a093a177da255335cb9d90c632
11:29:17Araqnot sure, I think so?
11:29:39Yardanicowell I mean fmt at compile time works, but this one fails (probably because of a template)
11:29:48*gangstacat joined #nim
11:31:01AraqYardanico, make the template .dirty and it works :-)
11:31:10Yardanicoah, ok :)
11:31:19Araqotherwise the hygenic symbol binding rules bite you
11:43:07Yardanicooh wait, fmt actually takes raw strings? because fmt"{a[\"a\"]" doesn't compile (a is a table)
11:43:14Yardanicoof course I can still use triple quotes :)
11:46:20Araqfmt is nothing special
11:46:33Araqfmt"" is an extended raw string literal
11:46:38Araqfmt "" is not
11:46:43miranYardanico: aren't you missing } ?
11:47:07Yardanicomiran, well I do, but that doesn't really matter here
11:47:23YardanicoAraq, ah, ok, thanks again
11:48:05*MyMind joined #nim
11:49:53*Sembei quit (Ping timeout: 248 seconds)
11:50:09*zahary joined #nim
12:02:12*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
12:07:34miranYardanico: have you received your hacktoberfest t-shirt?
12:08:05Yardanicomiran, yep
12:08:20mirannice. i didn't :(
12:08:24Yardanico:(
12:11:07miranwhen did it come?
12:12:52Yardanicohttps://i.imgur.com/ay5kYYy.png
12:14:57miranpfffft, before new year, and you were telling us sad stories about russia being last in the line.... :)
12:15:01Yardanico:P
12:24:18Yardanicobtw, @alehander42 you rock! py2nim is getting advanced features much faster than I could've imagined: https://github.com/metacraft-labs/py2nim/issues/4
12:24:26*LyndsySimon quit (Read error: Connection reset by peer)
12:24:42Yardanicostuff like hasattr/generics/isistance
12:24:47*LyndsySimon joined #nim
12:27:13*literal quit (Ping timeout: 256 seconds)
12:27:47*literal joined #nim
12:29:30*zahary quit (Read error: Connection reset by peer)
12:37:41alexday:P check in the json file for the nim repos
12:37:46alexday:P check in the json file for the nim repos
12:38:26alexdaywut. I replied to a super old message. twice.
12:38:27alexdaymy bad
12:48:32*zahary joined #nim
13:01:45miran"Also in the near future, -d:safety will be available to use along with -d:release for performance and safety (see: #2809)"
13:02:00miranis this implemented? or any news about it?
13:02:43*Snircle joined #nim
13:08:39*ShalokShalom joined #nim
13:10:51*zahary quit (Ping timeout: 256 seconds)
13:11:41*ShalokShalom quit (Remote host closed the connection)
13:14:59*zahary joined #nim
13:15:14Yardaniconot yet TM
13:15:26*marenz_ joined #nim
13:15:37Yardanicoyou can make it by yourself since -d:release is defined in config/nim.cfg in main nim repo
13:24:01dom96make it yourself and make a PR to add it for everyone :)
13:27:58*zahary quit (Read error: Connection reset by peer)
13:28:11*zahary joined #nim
13:34:39FromGitter<survivorm> @PMunch do you plan for xrc in wxnim? I think it would be great
13:35:16FromGitter<survivorm> and this will add more compatibility with the external tools, too
13:36:08PMunchxrc?
13:36:19FromGitter<survivorm> https://wiki.wxpython.org/XRCTutorial
13:36:39FromGitter<survivorm> Generated by many GUI builders
13:36:52PMunchHuh, not sure how I've never heard of that :P
13:37:06FromGitter<survivorm> The idea is to separate the design from code
13:38:17FromGitter<survivorm> http://wxglade.sourceforge.net/, https://github.com/wxFormBuilder/wxFormBuilder generate it as a result. Glade too, of cource :)
13:38:20PMunchYeah, similar to how Gtk has XML loading
13:38:54PMunchIt's a good idea, although a bit weird since you can change it without changing code
13:38:55FromGitter<survivorm> It's gtk-related thing, you know :)
13:38:58PMunchFor better or worse :P
13:39:14Araqform designers lead to non-generic code
13:39:41PMunchWhat do you mean?
13:39:42Araqbetter is a DSL that describes the forms IMO
13:40:02FromGitter<survivorm> Compatibility? Reuse?
13:40:25PMunchYeah, that's why I created the GenUI DSL for various graphical toolkits :)
13:40:40AraqI mean with Delphi to create 5 check boxes I'll have to insert 5 check boxes on my formular
13:40:56FromGitter<survivorm> A-a-and?
13:41:09PMunchOh you want to be able to do for i in 0..5: checkbox() ?
13:41:19PMunchOr something similar
13:41:43Araqbut these likely come from some data model that is not captured at all
13:41:47alexdaywhat does TObject mean?
13:42:36Araqand so I have code that sets these 5 checkboxes according to the underlying object my UI represents and also to read it back
13:42:42PMunchalexday, Type Object as opposed to PObject which is Pointer Object (or rather a ref in Nim). It's deprecated style though
13:43:19PMunchI feel there is a good way to make UIs, just that no-one have discovered it yet..
13:43:25*zahary quit (Quit: Leaving.)
13:43:26AraqPMunch, kind of yes, for i in 0..4: checkbox()
13:43:45PMunchOh yeah, I always forget that .. is inclusive :P
13:44:11FromGitter<survivorm> @Araq I'll look into it, but may be, yes. But it may mean the wrong domain. There are grid and table controls, and may be they ARE not limited
13:44:23FromGitter<survivorm> maybe not
13:44:24alexdayoh I see. that's why I can't see it in the docs? or maybe I am blind
13:44:28PMunchI still hope to be able to complete my type-based UI system. But I'm still having trouble with it..
13:44:34Araqoh it's not hard the problem is that you have 2 representations of the same thing and so you struggle with the consistency problems
13:45:42Araqimmediate mode UIs don't have these problems, you have your program state not in a messy polymorphic non-generic tree structure
13:45:57Araqand everything becomes much simpler.
13:46:02FromGitter<survivorm> But idea is, for the menus and regular staff, this may be life-saver. And for something more... I'm thinking about something about Jinja2 on top of xrc
13:46:19PMunchalexday, well TObject is still used I think when ref is the default type. So you would have Something = ref TSomething if you use the reference by default or PSomething = ref Something if non-reference version is default
13:46:21PMunchIIRC
13:46:34AraqPMunch, it's called system.RootObj now
13:46:52PMunchOh yeah, I was talking about the general naming convention
13:47:05PMunchTObject -> RootObj?
13:47:30AraqPObject -> RootRef
13:47:33Araqyes.
13:47:37PMunchRight
13:47:49AraqI still love immediate mode :P
13:48:09PMunchImmediate mode is nice in it's simplicity. But not very resource friendly..
13:48:35PMunchUpdating the entire UI at 30FPS seems a bit of a waste if nothing actually changes..
13:48:47Araqthere is no other way.
13:49:49dom96PMunch: Note: the common type should have no suffix, so in most cases PObject -> Object
13:49:57FromGitter<survivorm> Who was talking about resource-saving and economy :)
13:50:42PMunchdom96, yeah I know. That's what I was talking about before Araq mentioned RootObj which was a more direct answer to alexdays question :)
13:51:15Araqwhere are the benchmarks? seems unlikely in the presence of all these software layers that the list of rectangles to be updated makes it to the hardware.
13:51:35AraqI bet the HW redraws the whole screen instead :P
13:52:19FromGitter<survivorm> No bets as i have no idea how do they work ^P
13:52:22Araqit's a stupid idea anyway, what if you need to update the full window at 30FPS anyway (watching a video anybody?)
13:52:53Araqare then tell your users "you're fucked, can only update a smart part of the screen because of efficiency"
13:53:24Araqthe worst case is quite common, deal with it.
13:57:42Araqthe only problem with immediate UIs is where to put the state that is UI specific (for animations etc.)
13:58:45*dddddd joined #nim
13:58:53Araqthe other problem is that most APIs are for retained mode
14:00:44*chemist69 quit (Ping timeout: 255 seconds)
14:01:58*arecaceae quit (Remote host closed the connection)
14:02:17*arecaceae joined #nim
14:03:08*chemist69 joined #nim
14:03:18FromGitter<alehander42> thanks @Yardanico , all of those are also very alpha yet, hasattr / isinstance mostly work for 1,2 situations in libraries I work on translating: basically a very early form of flow-based type checking (but eventually they'll improve haha)
14:04:31alexdayPMunch thanks
14:04:38FromGitter<alehander42> btw why "" escapes " in strformat, instead of \"
14:09:56Yardanicofmt "look, I can use \" escape now!"
14:10:07Yardanicofmt("look, I can use \" escape now!") that's more clear ? :)
14:10:15YardanicoI mean that there are different rules]
14:10:35Yardanico<Araq> fmt"" is an extended raw string literal
14:10:38Yardanico<Araq> fmt "" is not
14:12:29FromGitter<GULPF> to bad the syntax highlight in vs code doesn't understand that
14:13:45FromGitter<GULPF> `fmt("\"")` and `fmt"\""` is highlighted the same, showing `\"` in a different color indicating it's a escape sequence
14:17:42dom96I wonder if we should make a bunch of syntax highlighter tests and shame everyone that doesn't abide.
14:19:21FromGitter<alehander42> argh so I have to use fmt<space> *sometimes*
14:20:15Araqhttps://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/oopsla065-burckhardt.pdf
14:20:38Araqalehander42 same like you "sometimes" have to use r"" vs ""
14:21:05FromGitter<alehander42> but not for each \n and ", which are very common
14:21:56FromGitter<alehander42> not a big deal, I just define endl for my projects and interpolate it, I'll use the "" for " and use fmt extended literal always
14:22:15Araq"{a}\n{b}".fmt
14:22:33Araqcan be your default syntax
14:24:05Araqalternatively we could make fmt interpret the \ differently but I dunno
14:24:09FromGitter<alehander42> hm, that's nice too
14:25:25FromGitter<RedBeard0531> I thought you had a plan for fmt/fmtr to handle that?
14:25:48AraqRedBeard0531: you had one, never got any PR from you
14:25:50FromGitter<alehander42> still I think some special handling for \ would be perfect , as one way to do something in 95% of cases (fmt".." instead of fmt function/method) will be best
14:26:26Araqwe should really figure out this thing before releasing 0.18
14:26:39Araqalso the lookup rules for the format protocol seem fishy
14:27:07FromGitter<RedBeard0531> Yeah, I found out that macros run too late for the difference from nnkStrLit vs nnkRawStrLit (or whatever the right names are) to matter
14:27:31FromGitter<RedBeard0531> I was hoping that would Just Work
14:27:56Araqwell it's not much work to implement the lexing step that deals with \
14:28:10Araqbut we need to figure out what to do.
14:28:43Araqthe current way is super consistent but apparently non-intuitive
14:29:00FromGitter<RedBeard0531> Is there already a function that does nim-style escaping/unescaping?
14:29:09Araq(hey, dom96, see? consistency can produce *worse* results)
14:29:50AraqRedBeard0531: Nim is written in Nim, copy it from lexer.nim to be on the safe side
14:29:51FromGitter<RedBeard0531> It's not consistent with python's f-str vs fr-str :)
14:30:25Araqnor is the rest of Nim consistent with Python. strange argument.
14:30:46dom96Can't we just special case r""?
14:30:56dom96and get rid of this rule that blah"" is also a raw string literal?
14:31:00FromGitter<RedBeard0531> Sure, I just meant is there already one exposed in stdlib. I'll take your answer to mean no.
14:31:12FromGitter<GULPF> +1 dom96
14:31:28Araqdom96, and what about re"\d+" ?
14:31:35Araqor pegs?
14:31:49Araqthere is a reason for why the things are as they are
14:31:50dom96Turn it into a macro and have it emit a raw string literal? :P
14:32:09Araqsince fmt is already a macro, why not fix that instead?
14:32:11dom96yeah, nah, syntax highlighting that would be impossible
14:32:34dom96fixing fmt has the same problem
14:32:36FromGitter<RedBeard0531> Could the type system handle it if compile-time functions could take either raw or cooked strings?
14:32:54FromGitter<GULPF> fmt will need special syntax highlighting anyway though
14:33:03FromGitter<RedBeard0531> actually nevermind fmt needs raw strings
14:33:03Araqyou can overload by ast kind but please let's not.
14:34:04FromGitter<RedBeard0531> fmt"{isSpace('\L')}" should work
14:34:27FromGitter<RedBeard0531> it is only in the "stringy" parts that escapes should be interpreted
14:34:58AraqI don't think so, char/string literals within fmt do smell.
14:35:32FromGitter<RedBeard0531> Sure its weird, but between the {} should be Plain Old Code
14:36:28dom96hm, that shows a limitation
14:36:37FromGitter<RedBeard0531> And sometimes its really useful: fmt"""blah {someSeq.join("\n")} blah"""
14:36:39dom96Technically everything inside {...} in a fmt"" should be treated as Nim code
14:36:56dom96which implies fmt"" should be implemented in the compiler :P
14:37:27Araqwrong, we can make fmt interpret \ outside the {} as we see fit
14:37:45Araqif we want to, no compiler magic required.
14:37:57AraqI don't think it's necessary though.
14:38:04Araqbut be my guest.
14:38:11dom96well I dunno
14:38:16dom96I still haven't had a chance to test fmt""
14:38:21dom96because I was hoping we would rename it to f""
14:38:40FromGitter<RedBeard0531> IIRC In python f-strs you don't need to use """ to embed a ". But I don't see that working in nim without compiler support.
14:39:13FromGitter<RedBeard0531> To me that's not enough justification for compilerizing it. But nimsuggest support inside {} is :)
14:39:15dom96as far as this issue goes, either we embrace Nim or not
14:39:52AraqI will tell what does not embrace Nim. a shitty special lexer rule for "f strings"
14:40:19dom96Presumably, currently, char escapes in fmt"" are not intuitive because people are applying their knowledge of Python
14:40:44FromGitter<RedBeard0531> Not just python
14:40:51euantorI'd expect everything in an `fmt""` string to act the same as any other Nim string, unless isnde a `{}` context
14:40:51Araqno, it's that \n is more useful as a newline than as backslash-N
14:40:55euantorSame as in C~
14:40:59euantor*C#
14:41:17FromGitter<RedBeard0531> I think that is how every other language with string interpolation works
14:41:27dom96yeah, and without compiler support that's impossible, no?
14:42:13FromGitter<RedBeard0531> no, the macro can just unexcape before calling newStrLit
14:42:20dom96I can't write: fmt"{toUpper("\n")}"
14:42:28dom96or can I?
14:42:39Araqyou can't because of the "
14:42:40dom96will it expand to toUpper("\n")?
14:42:43FromGitter<RedBeard0531> You need """ but then it would work
14:42:43Araqnot because of the \
14:43:12Araqneither can you write String.format("{toUpper("\n")}") in C#
14:43:16Araqfor the same reasons.
14:43:31dom96but I can in Python, no?
14:43:40FromGitter<alehander42> I agree with Araq it's about usefullness, not about Python users expectations
14:44:34Araq>>> f"{0}"""
14:44:34Araq'0'
14:44:38dom96another approach to subtly hinting people towards not using raw string literals is to rename this to `format` and make all examples: "{x}".format()
14:44:49Araqno idea what Python's doing here
14:45:00FromGitter<alehander42> and about consistency, if we need 3 special patterns (use fmt"..", but use fmt(..) for some escaped stuff or best, use var a = .., fmt"..{a}" for some joins because we can't join inside), that's not good
14:45:34Araqit is good to have a consistent language at the cost of a stdlib you have to learn.
14:45:41FromGitter<GULPF> handling `\` specially in fmt is brutally inconsistent though
14:45:54FromGitter<RedBeard0531> I think they made f"" and fr"" strings a new type of string in the lexer, at the same layer as r"" strings.
14:46:01euantor@Araq The modern C# way is `$"{toUpper("\n")}"`
14:46:07euantorAnd I believe that will work
14:46:25dom96Swift uses "blah: \(myVar)" as far as I can tell
14:46:54AraqGULPF: we can error out though and require {\} for literal backslashes
14:46:56dom96but indeed, Nim's philosophy is not to build these things into the language
14:47:41AraqPython's f-strings are broken
14:47:42euantorYep, works as I thought it did. The C# compiler translates it to `string.Format("Hello {0}", "test".ToUpper())` https://www.irccloud.com/pastebin/4936Nbk9/
14:47:56Araq>>> f"{0}""908"
14:47:56Araq'0908'
14:48:08dom96https://www.python.org/dev/peps/pep-0498/#escape-sequences
14:48:08Araqwhere is my quote in there?
14:48:19Araqtry it with Python 3.6.
14:48:28dom96That's just two string literals, side-by-side
14:48:42Araqoh, wtf
14:48:44dom96which Python concatenates
14:48:49dom96implicitly
14:48:53AraqI see, thanks
14:48:56FromGitter<alehander42> yep
14:49:16euantor@dom96 Yes, Swift uses `"\(var)"` which I personally don't like. Kotlin uses `"$var"` or `"${var}"` for more complex cases: https://kotlinlang.org/docs/reference/idioms.html#string-interpolation
14:49:19Araqyeah, I remember this misfeature of Python
14:49:36Araqeuantor, it's about backslashes and quotes
14:49:44Araqnot about dollar vs braces vs whatever
14:49:51FromGitter<alehander42> ok, why can't fmt implement special escape char handling itself, it's a macro, why would it need language level fixes
14:49:53Araqwe settled for the curlies.
14:50:11Araqalehander42: yes, it can do that.
14:50:28euantorCurlies are for the best, was just wondering why dom posted about what Swift does
14:50:38Araqbut I dunno whether it's a good idea
14:50:44dom96so, see in Python: fr"" is a raw f-string
14:50:51dom96whereas f"" is a f-string
14:51:08AraqI know.
14:51:12dom96that would be a weird rule for Nim
14:51:31FromGitter<RedBeard0531> But is seems like the most useful API
14:51:40FromGitter<GULPF> not for re
14:51:54FromGitter<RedBeard0531> Since 99% of the time you want your \n to mean newline new slash n
14:51:59Araqdo we need "raw" f-strings though? surely I can use fmt""" """ instead
14:52:12Araqand make fmt distinguish between triple lit strings or not
14:52:29Araqthe macro system allows for that
14:52:36FromGitter<RedBeard0531> You need """ to embed a " inside the {}
14:52:48dom96I don't think hacking fmt to treat fmt"" as a non-raw string literal sets a good precedent
14:53:10FromGitter<alehander42> it doesn't make sense for fmt to treat fmt"" as a raw string literal
14:53:19Araqdom96, for now it seems the most pragmatic solution though
14:53:27Araqand 'fmt' is all about getting shit done
14:53:33Araqand not about purity.
14:53:36FromGitter<alehander42> most of the time people format text or echo stuff with it
14:53:47FromGitter<RedBeard0531> That said, I don't know of any use cases for fmtr...
14:53:51dom96That's another rule for syntax highlighters to follow
14:54:06FromGitter<RedBeard0531> They should already special case fmt""
14:54:20Araqnot really as far as the highlighter is concerned it can treat it like the Nim compiler does
14:54:31Araqfmt"" is an extended raw string literal.
14:54:43dom96hrm
14:55:18FromGitter<RedBeard0531> I'd rather a highligher be fmt-aware and highlight the stuff inside {} as code rather than a string
14:55:52dom96It won't be so easy
14:55:56FromGitter<RedBeard0531> That is what good highlighters do in python fstrs or js `${strs}`
14:56:02dom96The stuff inside {} won't exactly be the same as normal Nim code :\
14:56:18FromGitter<alehander42> exactly, highlighters for other languages with this kind of interpolation do work
14:56:22FromGitter<RedBeard0531> why not?
14:56:34miranAraq: re: "where is my quote in there? (f"{0}""908" > '0908') - this works as it should
14:56:56dom96well I suppose " is the only special case
14:57:08miranf"{0}" is first string, "908" is concatenated to it
14:57:25Araqmiran, implicit string concats are dumb. ("a", "b" "c") # yay, typo lead to a bug
14:57:28YardanicoRedBeard0531: fmt supports some special stuff
14:57:37Yardanicoit's not just plain string interpolation
14:57:45miranoh, now i see dom96 already answered that. sorry for duplication
14:57:57Yardanicoit's possible to highlight it properly, but it requires some work
14:57:59Araqthat should have fixed that bullshit for Python 3
14:58:18Araqonly C requires it because it has no string concat operator that can work at compile-time
14:58:33FromGitter<RedBeard0531> "\"" is much more common (and logical) than """"
14:58:49dom96yeah, if " is the only special case then it matches Python behaviour as well
14:59:12miranthat works nice when you break a long string in couple of lines of code
14:59:33*c0ntribut0r quit (Ping timeout: 265 seconds)
14:59:36Araqmiran, a + also works nice.
14:59:44*c0ntribut0r joined #nim
14:59:45miranit is uglier
14:59:48dom96Araq: I do still get annoyed that I have to separate by & every time though :P
15:00:03miranjust like \ line breaks are ugly
15:00:15Yardanicomiran, I wouldn't agree that "a""b" is better than "a" + "b" :)
15:00:22Araqmiran, I beg to differ, clarity cannot be ugly.
15:00:44miranYardanico: i wouldn't agree that "a" + "b" is better than "ab" :P
15:00:54dom96okay, so since we're making fmt"" even more like python
15:01:01dom96Why not go all the way and change it's name to 'f'?
15:01:04Araqdom96, no, we are not.
15:01:12Araqwe make it more useful for the common cases.
15:01:16mirandom96: why are you insisting on it so much? :D
15:01:39dom96because I love it
15:02:05miranas i said on github - i love it too in python. but in nim it feels wrong
15:02:15dom96Araq: And we do that by treating fmt"" as a non-raw-string literal
15:02:15Yardanicothen even more people will use f without space
15:02:22dom96which puts us closer to Python semantics
15:03:03*kivyion quit (Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/)
15:03:11Araqwe don't do anything like that. right now the proposal is to make fmt parse backslashes
15:03:11*yglukhov quit (Remote host closed the connection)
15:03:27mirancan this (non)-raw discussion be supplemented with some examples?
15:03:36Araqmuch like regexes parse backslashes
15:03:37dom96Araq: What's the difference?
15:03:56miranwhat would `echo fmt "{4+3}\n{9+5}"` print?
15:03:57dom96The change in behaviour is the same
15:04:25FromGitter<RedBeard0531> mirin: https://github.com/RedBeard0531/icemonim/blob/master/icemonim.nim#L192 should work with fmt"" rather than requiring "".fmt
15:05:06FromGitter<RedBeard0531> 714
15:05:09*pwntus quit (Ping timeout: 264 seconds)
15:05:36FromGitter<RedBeard0531> shift-enter didn't work. pretend there is a real newline in there
15:05:38*yglukhov joined #nim
15:05:48Yardanicoyou don't need to use it like that
15:06:06Yardanicofmt "this should work too"
15:06:08Yardanicofmt("or this")
15:06:12Yardanicobut I'm not sure :)
15:06:17Araqso ... yeah, there is precedent, regexes parse backslashes in their own way, fmt can parse backslashes too
15:06:39Araqmimicing Nim's backslash rules
15:06:41*yglukhov quit (Read error: Connection reset by peer)
15:06:50dom96Once again, why not rename to 'f'?
15:07:08Araqbluenote worked with 'f' and it did bite.
15:07:10*yglukhov joined #nim
15:07:17dom96how?
15:07:23miran2. what would `echo fmt"text {"more\ntext"} bla"1 print?
15:07:31Araqlots of reasons.
15:07:49Yardanicodom96, people will say "fuuu! nim copies everything from python! lame!!" :D
15:08:07mirandom96: 'f' is the most common one letter function name
15:08:10Araqproc generic[T] = var t = 9; echo f # typo not caught
15:08:39dom96Araq: Why is that not an error?
15:09:00dom96miran: Do you have data to back that claim? :P
15:09:15Araqproc transform(f: proc()) = echo f"{8}" # type error?
15:09:41mirandom96: you cannot go around telling people "stop using `i` as a variable in iteration, now it has a special meaning in nim"
15:09:42Araqthis one works thanks to OR I think but I'm sure I can create a case where it hurts
15:10:07Araqdom96, 'f' is in scope, no error.
15:10:12dom96miran: That's not what I'm doing. That variable is indeed common, but 'f', I don't see it much.
15:10:45dom96Araq: 'f' takes arguments, how can it not be an error?
15:10:45Araqdom96, it will caught at generic instantiation time but it's meh
15:11:03mirandom96: then you're not looking at much mathematical/physics codes, nor functional programming
15:11:05Araqit is a "late" error.
15:11:29*yglukhov quit (Ping timeout: 248 seconds)
15:11:31Araqbecause in plenty of contexts Nim does symbol bindings without type disambiguations
15:11:46Araqas types are not yet available.
15:13:08Araqthat said, I like 'fstr' better as 'fmt' as a name
15:13:27Araqor maybe 'fs'
15:13:34FromGitter<GULPF> both `fmt` and `fstr` are so long :(
15:13:40*c0ntribut0r quit (Ping timeout: 260 seconds)
15:13:44Araq'fs' then? :-)
15:13:56dom96Araq: Did you ever fix VS code's search?
15:13:59subsetparkfmt is pretty damn short, just to say
15:14:00dom96now it's failing for me...
15:14:13Araqwhat do you mean?
15:14:19Yardanicodom96, ah, when we talked about ripgrep?
15:14:26Araqyeah.
15:14:34*c0ntribut0r joined #nim
15:14:37FromGitter<GULPF> @subsetpark not compared to string interpolation in other languages
15:14:37dom96yeah
15:15:10Yardanicodom96, "search.useRipgrep": false
15:15:14Yardanicoin your settings in vscode
15:15:18FromGitter<GULPF> 'fs' is better, but IMO it should be a 1-character name
15:15:33Yardanicoall 1-character names are too common :)
15:15:42Araqcan't take this seriously, sorry
15:15:52subsetparkLet's not overstate the case here. Python didn't even *have* f-strings up until about a week ago. Myself and the rest of the python-speaking world have been getting along just fine with "".format() for a long time.
15:15:53miran1-char name? big no from me
15:16:06Araqwill name you GUL until you see the light :P
15:16:15Yardanicosubsetpark, week ? wtf
15:16:16dom96btw
15:16:19Yardanico:P
15:16:20FromGitter<GULPF> haha
15:16:23dom96var fmt = 42; fmt"..." works fine
15:16:29miranAraq: GUL is too long, why not G?
15:16:30dom96as does defining a `proc fmt`
15:16:44miranG""
15:17:00dom96so I'm still unconvinced that this will be a problem
15:17:07FromGitter<GULPF> you have no right to complain, the compiler is full of 1-character names after all ; )
15:17:11dom96You can still use 'f' as an identifier to your hearts content
15:17:28Yardanico◍"this is better" :D
15:17:33AraqGULPF: not because I'm too lazy to type.
15:17:38Yardanico(and it's actually possible lol)
15:17:41Araqbecause I'm too lazy to invent stupid names.
15:18:03Araqactually I'm also to lazy to read the result, so ok.
15:18:13Araqpoint goes to you.
15:18:40dom96Araq: Also, your first example doesn't compile
15:18:56Araqdom96, it does if you have one 'f' in your scope
15:19:11Araqwhich is the context we're talking about.
15:19:37FromGitter<GULPF> what about using an operator like `@`? C# uses `$` so it's not completely alien
15:19:54dom96oh right, well, that already happens a lot with generics
15:20:00Araqoperators are reserved for common operations.
15:20:04dom96IMO it's a non-issue
15:20:25Araqand "common" is defined as "what Araq considers important"
15:20:37dom96I could import some package that exports 'f' too and have the same problem
15:20:43dom96and I wouldn't even know
15:20:44Araqsince Araq doesn't even like format strings an operator is off the table :P
15:21:01Yardanicoargh, again unicorn on github
15:21:03FromGitter<GULPF> well then :P
15:21:10Yardanicohttps://twitter.com/githubstatus/status/951473930031779841
15:21:15dom96yeah, gist is unicorning
15:21:19Yardaniconot only gist
15:21:23Yardanicogithub is unicorning for me
15:22:43*miran left #nim (#nim)
15:22:53dom96Pastebin it is I guess
15:23:02dom96https://pastebin.com/BnD8dxqD
15:23:09dom96No issues there
15:23:17FromGitter<RedBeard0531> That is worded strangely. Like they are waiting for people to report to them that their site is down rather than having monitoring in place.
15:23:38dom96and this works too https://pastebin.com/7ae2xs4f
15:23:42Yardanicoyay they updated their status https://status.github.com/messages
15:23:47Yardanico" We are investigating reports of service unavailability."
15:24:00subsetparkthe web is poison, people!
15:24:13dom96wow, so much red in the past
15:24:23Yardanicodom96, it wasn't there before they changed current status
15:24:29Araqok, here is the solution
15:24:35Araqan unary % operator!
15:24:42dom96Another reminder that we should come up with a way to store issues/PRs/etc in the git repo as well
15:24:48Araq% is already the format operator
15:24:51YardanicoAraq, hmm
15:24:59Yardanico%"{myvar}" not that bad
15:25:02Araqand %"{0}\n" does the right thing
15:25:07Yardanicowell I mean it's good :)
15:25:11Araqsince it's not a raw string literal
15:25:12subsetparkThat makes a lot of sense...
15:25:35YardanicoAraq, will %"{a[\"b\"]}" work? yay
15:25:45FromGitter<GULPF> +1 from me
15:26:24dom96hah
15:26:34dom96that's genius
15:26:36FromGitter<RedBeard0531> It would be weird if the escaping applied inside the {}
15:26:53dom96and we're back to square one :P
15:27:00FromGitter<RedBeard0531> but still seems better than status quo...hmm
15:27:18Yardanico:D https://strawpoll.com/hy366wp8
15:27:34Yardanicosorry, no "other" option today
15:27:36dom96ooh, strawpoll got a redesign
15:27:46dom96Now I'm reminded of our livestream polls
15:27:47Yardanicothat's another strawpoll afaik
15:27:55dom96Hrm, maybe I'll do a livestream this weekend
15:27:58Yardanicohttp://www.strawpoll.me/ this is the one we've used in the past
15:28:08dom96oh, interesting
15:29:52dom96I didn't realise that operators in front of string literals don't create a raw string
15:32:27Araqyeah, let's go with % I doubt it can be topped
15:32:43dom96Challenge acce-- nah, I doubt it too
15:34:24dom96I wonder how nitely's regex implementation is going (that was nitely wasn't it?)
15:39:08Yardanicoyay, github works
15:41:16Yardanicoargh, my eyes are bleeding https://github.com/bung87/gpx2baidumap-array/blob/master/main.nim
15:42:26dom96this is why we need nimpretty
15:42:33*azur_kind joined #nim
15:44:43Yardanicoactually I did a few random PRs to small nim projects to make them look prettier :)
15:45:26livcddid i see nimpretty here ? :D
15:46:16Yardanicodom96, I bet changelog (including closed issues) will be quite big for 0.18.0 :P
15:47:24Yardanicoit's very satisfying to read big changelogs btw (unless you have to fix a ton of deprecation warnings)
15:50:17Yardanicoalso - semaphoreci is faster even on small projects (because of nim compiler compilation), it takes only ~1:30 to build nim and nimble: https://semaphoreci.com/yardanico/nickel/branches/master/builds/3
15:50:48Yardanico(best test suite ever - check if program compiles)
15:54:31*BitPuffin quit (Remote host closed the connection)
16:09:36FromGitter<Varriount> semaphorici?
16:11:13*der joined #nim
16:12:40YardanicoSemaphoreCI :)
16:15:03*der quit (Remote host closed the connection)
16:15:17*derlafff quit (Remote host closed the connection)
16:15:36*derlafff joined #nim
16:15:36FromGitter<alehander42> unary `%` is smart :D
16:15:48*endragor quit (Remote host closed the connection)
16:15:52*miran joined #nim
16:19:35*PMunch quit (Ping timeout: 260 seconds)
16:24:07Araqeven better, %r"\n" gives a raw string
16:24:16Araqno special casing in the macro required
16:24:26Araqeverything works out beautifully
16:24:58YardanicoAraq, will you push it today? :)
16:26:27*arnetheduck quit (Ping timeout: 240 seconds)
16:31:14*floppydh quit (Quit: WeeChat 2.0.1)
16:31:26Araqyes
16:33:22*endragor joined #nim
16:35:23*zahary joined #nim
16:37:41*endragor quit (Ping timeout: 256 seconds)
16:43:27*yaiyan is now known as Yaiyan
16:47:00miranif somebody could create a forum post to showcase the new usage of %, that would be great
16:47:38miranon the other hand, those kinds of things should be somewhere in documentation/manual, right?
16:47:49Araqlol why? %"{foo}" is the syntax
16:48:09Araqthe manual contains the lexing rules, yes
16:49:15AraqI can replace 'fmt' with '%' in strformat, that's the whole patch
16:49:27miranhow does it behave with those \n inside, and how outside of {}?
16:49:40*azur_kind quit (Remote host closed the connection)
16:50:00mirancan i do %"{3.333333:.2f}"?
16:50:45mirancan i do %"{2.5:>10}"?
16:51:33Araqwhy not?
16:51:51Araqidentifier"string" is an extended raw string literal
16:51:55Araq%"string" is not
16:51:59mirani don't know why not. i don't know what works and what doesn't
16:52:02Araqso \n is parsed differently
16:52:25Araqaccording to Nim's lexing rules
16:52:34Araqeverything works out
16:53:40*azur_kind joined #nim
16:58:39*azur_kind quit (Remote host closed the connection)
17:03:06c0ntribut0rHello guys! Let me distract you from that "%" thing :) Is there any way in nim to tell compiler to use tail call optimization?
17:08:06Araqc0ntribut0r, no, you can enable it for GCC though
17:08:21Araqindependently of the other optimizer settings afaict
17:09:15Yardanicothere's also tailcallelim pass in clang https://llvm.org/docs/Passes.html#tailcallelim-tail-call-elimination
17:09:31Araqnow ... what do we do with the "format" protocol?
17:09:40YardanicoAraq, what is wrong with it?
17:10:11Araqit simply assumes that format(T, string) yields void and means "append" semantics
17:10:17c0ntribut0rThanks everyone
17:10:26AraqaddFormat would be clearer
17:12:12dom96Araq: What's wrong with that?
17:19:42*darithorn joined #nim
17:21:11*claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com)
17:24:51FromGitter<krux02> Araq: can you give me a few seconds of your time?
17:25:05FromGitter<krux02> I try to understand the compiler internal type ast
17:25:32YardanicoOH MY EYES https://github.com/nim-lang/Nim/blob/425f221440cbd453591d0fca9eaf93671d5f6d62/lib/pure/strformat.nim
17:25:35FromGitter<krux02> here is the AST I am currently working with http://ix.io/E1Z
17:27:09FromGitter<krux02> or here with line numbers: http://ix.io/E1Z/Nim
17:28:31FromGitter<krux02> I try to extract Vec[4,float32] as a node, somehow.
17:29:25FromGitter<krux02> the only position in this AST where I can see a 4 followed by a float32 is in line 75
17:32:03dom96Araq: Why was readChar deprecated?
17:32:26*sendell quit (Remote host closed the connection)
17:33:39dom96It was deprecated here and I don't get it: https://github.com/nim-lang/Nim/commit/794d36cf31d8f7debc2ede1f7792fdbcc0a1ef5e
17:36:04Araqkrux02: yeah it's messy, usually I only look at the "implementation" part
17:36:19dom96"readChar shouldn't be used for anything as it's too slow (usually needs to acquire a lock)."
17:36:26Araq(the object arr: array[] thing you refuse to base your analysis on)
17:36:29dom96Despite this I would argue it's still useful
17:36:55Araqdom96, it also uses the IOError exception as the EOF marker
17:37:02Araqwhich is also not nice IMO.
17:37:14dom96The reason I ask is because of this https://stackoverflow.com/questions/48186397/nim-readchar-deprecated-what-to-use-instead
17:37:36Araqif readBuffer(addr myChar, 1) == 1
17:37:41Araqor something like that
17:38:27dom96look at the code
17:38:36dom96replacing that function with this is bleh
17:38:40dom96and it's unsafe code (!)
17:41:26YardanicoAraq, ohhh, % has the same signature as %from json, so % from json is being implicitly picked up by default
17:42:07Yardanicohmm, I don't get it
17:42:55Yardanicoit works fine in separated code
17:42:58Yardanicobut not in my project :)
17:43:31Yardanicooh, here it is
17:44:21YardanicoAraq, seems like I shouldn't use unindent this way :) https://gist.github.com/Yardanico/f6f9f5942f936d1db9cfd33f3257f330
17:44:39Yardanicoand this code compiles
17:44:53Yardanicoand echoes "{a}\n{b}\n" :)
17:46:58AraqYardanico: argh...
17:47:32Araqany obvious solutions?
17:48:02Araqomg that was stupid
17:48:13dom96omg lol
17:48:34Yardanicoso as I understand unindent is called first, and only after json.% is called
17:49:18*Pisuke joined #nim
17:49:39*MyMind quit (Ping timeout: 256 seconds)
17:49:52FromGitter<Yardanico> *after that
17:50:23*azur_kind joined #nim
17:51:05FromGitter<krux02> Araq: what does the last child of a type semantically mean?
17:51:12AraqYardanico: +obj.field # how do think this is parsed?
17:51:25Araqkrux02: the instantiation
17:51:38AraqYardanico: %x.f is the same
17:53:26FromGitter<krux02> Araq: getTypeInst recrusevely taks the last child of the last child until termination
17:53:40FromGitter<krux02> that is causing the problem I have
17:54:16Araqquite possibly
17:54:22Araqtry it without the loop?
17:54:38Araqhello ...? I need a solution asap
17:54:50Araqstrformat.% bites json.%
17:55:19FromGitter<krux02> well the loop was introduced intentionally
17:55:25FromGitter<krux02> with a patch recently
17:55:51FromGitter<krux02> I check when it happened
17:56:02dom96Araq: I have no ideas
17:56:08dom96There isn't really a solution
17:56:16dom96Either we use a different operator
17:56:25dom96or ... there is no other solution
17:56:26Araqwhich one?
17:56:32Araqwhich operator to pick instead?
17:56:44dom96\ ?
17:57:00Araqunary '&' ? because it translates into a concat expression?
17:57:24Araq&"{foo}\n" # still looks nice
17:57:38dom96I don't like that: "Hello" & &"{foo}"
17:57:58Araqhmm but it hardly comes up
17:58:15Araqsince you would embed the concat into the format string, that's its point after all.
17:58:15dom96it will come up if I need to wrap the strings
17:58:35AraqI said "hardly", not never.
17:59:28miranback to 'fmt'? :D
17:59:49Araq*& but then it's 2 chars and somebody's fingers will start to bleed
18:00:01dom96two shifted chars as well...
18:00:05Yardanicomiran, nah, it'll still be a operator I think
18:00:19Araqthe operator solution is too elegant
18:00:21Yardanicopeople like me will need to carefully read manual :P
18:00:30dom96we could also rename json.%
18:00:33miranhow come we don't have bitwise & and |?
18:00:39Yardanicomiran, we do
18:00:40dom96well, we actually can't
18:00:40Araqwe need to keep it but pick an operator that is not yet used.
18:00:42dom96It's canon
18:00:42Yardanicoand and or
18:00:46mirani guess it was readability
18:00:51Araqdom96: was about to say that :P
18:01:22miranYardanico: i'm talking about exactly & and | as keywords, not `and` and `or`
18:01:34Yardanicokeywords? :D
18:01:46miranand now suddenly `&` is ok for something more common
18:02:07miranand it is something which is not as widespread as bitwise &
18:02:38AraqI like *& fwiw, it produces zero or more concats
18:02:53Araq*&"{foo}\n"
18:03:02*yglukhov joined #nim
18:03:03Araqmeh. I dunno
18:03:08mirani don't see connection between `*&` and string formatting
18:03:08dom96-1 from me
18:03:18dom96\"{foo}\n"
18:03:22dom96Inspired by Swift
18:03:31dom96not sure if that's even possible
18:03:35Araqdom96: I find that harder to read
18:03:43Araqit is possible.
18:03:52miran?"{bla}"
18:04:02Yardanico!@#$
18:04:05Araq"lambda foo -- what?"
18:04:17dom96yeah, reminds me of lambda too
18:04:38miranto be honest, ? makes more sense to me than &
18:04:39dom96it does contain code though, so it sorta makes sense
18:04:52miranyou're "asking" to evaluate string
18:05:20dom96@"{bla}" maybe?
18:05:34dom96although with seq using it, it's weird
18:07:33*yglukhov quit (Ping timeout: 264 seconds)
18:10:22*S1tiSchu quit (Read error: Connection reset by peer)
18:11:07miranit should be a symbol not used elsewhere, so that leaves out: @#$%^&*()-+=/<>\
18:11:27miranremaining: ` ~ ?
18:11:54dom96what about ! ?
18:12:03Yardanicomacros module?
18:12:07Yardanicobut ! is deprecated anyway :)
18:12:12Yardanico(in macros)
18:12:12miran` is too similar to ', ~ is too similar to - (remember those don't use `l` as a name warnings?)
18:12:17dom96yeah, its use in macros isn't very useful
18:12:51miran`!` seems logical
18:13:22dom96I think we've kind of been loosely keeping `!` free for others to use
18:13:39*devdri joined #nim
18:13:57Yardanicoand people still say that nim is unstable, look at this: https://gist.github.com/Yardanico/adb9315d3b77df3998fa195453126cf7 I have a DSL in my project which also uses async, so C code is compilcated as hell, but it works :)
18:14:26*devdri quit (Client Quit)
18:15:22Yardanico(it's compiled in release mode here)
18:15:26*yglukhov joined #nim
18:16:05miranok, if ! should be used for other stuff, what do you guys think about `?` ?
18:16:29*yglukhov quit (Read error: Connection reset by peer)
18:16:53miran?"{3+4}"
18:17:01*yglukhov joined #nim
18:17:14FromGitter<RedBeard0531> I still like fmt. It's also easier to do the right thing internally if it is a name rather than an operator
18:17:58miran`fmt` is fine by me, but suddenly there was "it has to be an operator":)
18:20:41*Trustable joined #nim
18:25:03FromGitter<RedBeard0531> It also seems like it would be generally useful to expose equivalent logic from getString in macros.nim. Once that is done, it becomes easy to make fmt do the right thing.
18:27:54*Sembei joined #nim
18:28:02*Pisuke quit (Ping timeout: 255 seconds)
18:28:47dom96Operator makes sense because it won't require parsing of the backslashes in the string
18:29:12*Vladar quit (Remote host closed the connection)
18:29:22FromGitter<RedBeard0531> But that makes it impossible to avoid parsing backslashes inside the {}
18:30:00*azur_kind quit (Read error: Connection reset by peer)
18:30:21FromGitter<RedBeard0531> And I think unescapeStr is a generally useful function to have exposed, which takes the hard part out of fmt itself
18:30:38*azur_kind joined #nim
18:35:51FromGitter<RedBeard0531> strutils.unescape is almost right, but it only handles a subset of the \ escape codes. Can that be expanded to cover the rest and error on unknown escapes?
18:36:06*Jesin joined #nim
18:39:33*Vladar joined #nim
18:51:35FromGitter<GULPF> making it an operator means that doesn
18:52:02FromGitter<GULPF> *means that it doesn't need special handling of '\' though
18:52:40FromGitter<GULPF> it's much more elegant that any alternative
18:54:35*c0ntribut0r quit (Ping timeout: 240 seconds)
18:54:41FromGitter<GULPF> the problem is not that it's hard to implement with a normal identifier, the problem is that it breaks the consistency of the raw string syntax
18:55:26*yglukhov quit (Read error: Connection reset by peer)
18:55:36*azur_kind quit (Remote host closed the connection)
18:56:02*yglukhov joined #nim
19:04:02*devdri joined #nim
19:06:44FromGitter<RedBeard0531> But you don't actually want fmt to take a fully cooked string. You only want to parse escapes outside of the {}. You can't do that with an operator.
19:17:17FromGitter<GULPF> Hmm that means that operators named `\` can't be used inside the `{}`. That's pretty bad
19:21:55*Vladar quit (Quit: Leaving)
19:24:31yglukhovdom96: you around?
19:24:46dom96yes
19:27:28FromGitter<RedBeard0531> Gulph that is why you don't want fmt to be an operator.
19:29:14AraqRedBeard0531: use ?r"\n" to get the non interpreted backslashes
19:29:18Araqworks.
19:29:28Araq(assuming we go for '?')
19:29:51Araqecho ?"{foo}"
19:30:00AraqI still prefer unary &
19:30:10Araqit's sugar for a concatenation
19:30:17Araqwhy not use & ?
19:30:43miran"abc" & &"{123}"
19:30:56Araqso what, nobody has proven that comes up
19:31:19Araqbesides, I use that in Karax and it quickly becomes acceptable
19:31:38FromGitter<RedBeard0531> The key is that I think the most common use case wants *some* slashes escaped
19:31:48mirani don't see the connection between the symbol & and string formatting
19:31:57Araq&"abc{123}"
19:31:59Araq-->
19:32:13Araq"abc" & $123
19:32:29Araqhow can you not see the connection?
19:33:00miranbtw, what do you think about slightly changing how `echo` works? echo a, b, c now produces abc
19:33:15miranwhat about `,` produces one space?
19:33:40Araqdon't see the point
19:33:55miranbetter connection is $"abc{123}"
19:34:00Araqfor debugging it's usally echo a, " b: ", b
19:34:10miranlet a = 10; b = 30
19:34:17miranecho a, b --> 1030
19:34:21Araqwith string literals in between so you can have your spaces there
19:34:30Araqecho a, " ", b
19:34:42Araqecho a, ": ", b
19:34:53Araqecho "(", a, ", ", b, ")"
19:35:13miranyou don't find it ugly/unnecessary?
19:35:34miranif i want concatenated, i would use & or sth
19:35:41miranusually i want them separated
19:36:06Araqyeah but I never want them separated by a space.
19:36:25Araqand so there is no good default.
19:36:25FromGitter<RedBeard0531> Any chance future.dump could be varargs? That seems more useful for a lot of cases
19:36:37miranecho "(", a, ", ", b, ")" -> this will be much nicer with fmt/f/%/&/? :D
19:36:43Araqalso concentations are more expensive than a varargs mechanism
19:37:29Araqhow do I "not" use the space in Python and avoid the allocations? ok, it's Python, nobody cares about allocations.
19:37:31miranecho ?"{a}{b}"
19:37:39Araqbut Nim is systems programming.
19:37:54mirannice and simple :)
19:38:00FromGitter<RedBeard0531> Also, if command syntax could use named args, you could probably do echo a, b, sep=" "
19:38:07Araqhardly. it's disgusting
19:38:14alexdayhi Araq , I just wanted to keep in touch with you. :P
19:39:07FromGitter<RedBeard0531> Is there a technical reason why command syntax can't support named args?
19:39:28AraqI think it would take the syntax past its breaking point
19:39:31Araqbut I'm not sure.
19:40:14FromGitter<RedBeard0531> Breaking compilers is my specialty ☺
19:40:17Araqso ? or &
19:40:29miranok, so no space between things in echo? :( i guess i'll have to use string formatting for that.... (as i find `a, " ", b` ugly)
19:40:29Araqcan we decide on that? I want to work on something important.
19:40:40miranimho ?
19:41:00mirani stated my reasons above, but i can repeat them if necessary
19:41:15Araqmiran, it's logical and with a bit of luck makes you use an even better separator
19:41:24miranwhat about `!`?
19:41:32Araqso that others can interpret the output of your programs
19:42:17*Yardanico_ joined #nim
19:43:18Araqmiran, I think '!' should be some dangerous operation
19:43:39miranhaha, ok
19:44:15miranthen `?` as a shorthand for "can you evalute this string please?" :)
19:44:27Araqecho &"{foo} {bar}"
19:44:30*MyMind joined #nim
19:44:34Araqecho ?"{foo} {bar}"
19:44:47miranwhat is foo? what is bar?
19:44:55miran(translated)
19:45:04*Yardanico quit (Ping timeout: 255 seconds)
19:45:08Araqwhy does it matter? it uses your precious space
19:45:26Araqas the separator, that should be enough to make you happy :P
19:45:28miran&"{foo} --> "concatenate one thing?"
19:45:42Araqyes, nothing wrong with that
19:45:57*Sembei quit (Ping timeout: 240 seconds)
19:46:07*kier quit (Ping timeout: 248 seconds)
19:46:12Yardanico_4400 stars :)
19:46:19mirani just wanted to say that ? makes more sense to me
19:46:35Araqok, now we only need some feedback from others
19:46:42AraqYardanico_, !
19:46:51Araqwhat do you say?
19:46:53FromGitter<RedBeard0531> ! Would be a good operator to let you store openarray in a data structure, not just an arg☺
19:47:06miranwell, dom96 is for `f` and nothing else :D :D
19:47:30FromGitter<data-man> echo <{foo} {bar}>
19:47:40Yardanico_Araq, honestly I don't encounter a lot of operators like ! or @ , so I'm fine with !
19:47:56Araqbut ! is not in your list of options :P
19:48:00Araqit's ? or &
19:48:00*Yardanico_ is now known as Yardanico
19:48:27FromGitter<GULPF> ! > ? > & imo
19:48:34YardanicoAraq, well ? is a bit easier for me to type because it's closer to my fingers :P
19:49:19FromGitter<RedBeard0531> https://nim-lang.org/docs/pegs.html#%3F,Peg
19:49:58FromGitter<data-man> echo <{format}{me}"please">
19:50:09miranGULPF: agreed
19:50:24Araqdata-man: we don't have angle brackets
19:50:28*kier joined #nim
19:51:28Yardanicodata-man: nim tries to implement as much of stdlib without compiler changes as possible
19:51:34Yardanicothat's why async is not built-in for example
19:51:39Yardanicoso core language is not that complicated
19:52:36Araqecho +"{foo}"
19:52:54Araqunary plus anyone?
19:53:28FromGitter<data-man> Ё"Hi{Yo!}"
19:53:49Araqdata-man: it has to be an operator
19:54:17miranAraq: maybe you can leave !! for something exclamatory, and have ! for this? :)
19:54:23Araq!\?&"{0}" # best compromise so far
19:54:46miran:D
19:54:47*Ven`` joined #nim
19:54:48FromGitter<RedBeard0531> Araq: would a PR to make fmt only unescape the string parts be rejected outright? I still think that is the right design, and I'm willing to write it.
19:54:51Araqthe "bang backlash question mark amp" operator
19:54:59Yardanicodata-man: cyrillic letters huh? :P
19:55:04FromGitter<RedBeard0531> aka the "fuck this shit" operator
19:55:13*gokr joined #nim
19:55:14YardanicoAraq, !@#$ is better maybe? :)
19:55:21FromGitter<RedBeard0531> capital s-sharp?
19:55:24Yardanicoah
19:55:27Yardanico# can't be used
19:55:51AraqRedBeard0531: I don't like the name 'fmt' tbh
19:56:03FromGitter<RedBeard0531> emoji happy face since it makes you happy when you use it?
19:56:16FromGitter<RedBeard0531> Sorry, I've got my troll hat on and it is hard to remove...
19:56:18*gokr left #nim (#nim)
19:57:00Yardanicolet's bring some names from emojicode programming language
19:57:05Yardanico🐖
19:57:11FromGitter<RedBeard0531> Hmm I like fmt since it seems imediately obvious what it is for. but `fstr` also seems fine
19:57:18Araqcan't we remove the string{lit} and then json.% for strings would be ambiguous with strformat.%
19:57:45FromGitter<RedBeard0531> although I think that only makes sense by reference to a python feature, which is kinda silly
19:57:48FromGitter<data-man> > "{fmt}"
19:57:58Araqso only the people who use both all the time need to do something like import json except %
19:58:28Araqdata-man: unary > is rewritten to < it would work but it also would be weird
19:58:35YardanicoAraq, I think strformat will be pretty commonly used with json
19:58:50Araqok
19:58:51FromGitter<data-man> > "{fmt}"
19:59:00YardanicoI mean because people will for example call json apis
19:59:08FromGitter<data-man> Two >
19:59:30FromGitter<RedBeard0531> interp""? a bit long I guess
19:59:35Yardanicowell I mean I'm ok with any choice
20:00:15FromGitter<RedBeard0531> Oh, is `F` a common name? How about F""?
20:00:31FromGitter<RedBeard0531> it won't collide with `f` due to partial case sensitivity
20:00:48Araqyeah I know but it's not in NEP-1
20:01:00Araqand not that good to look at either IMO
20:01:24Araqalso it means we need to use the complex implementation that cares about backslashes
20:02:09FromGitter<data-man> _{fmt} :-)
20:02:14FromGitter<RedBeard0531> I don't think so. I think it is just a matter of replacing the call to newStrLit(x) with newStrLit(unescape(x))
20:03:56Araqan operator feel more idiomatic to me. :P
20:05:18FromGitter<RedBeard0531> Yeah, but it does the wrong thing inside of {}. Also it would behave differently with """ strings
20:07:09*yglukhov quit (Read error: Connection reset by peer)
20:07:37FromGitter<RedBeard0531> I think python got the f- vs fr-string distinction right. The stuff between {} never interprets \ and f vs fr decides how to treat \ outside the {}. I'm hopeful we can make it work that well in nim.
20:07:56*yglukhov joined #nim
20:10:36AraqI think I'll go with unary +, it has no meaning for strings and easy to type
20:10:50Araqand that's the main selling point of 'fmt' in the first place
20:11:16alexdaywhen I do a nimble install nimsuggest. why does it start cloning the Nim repo?
20:11:27Yardanicoalexday, firstly - why do you install it like that?
20:11:30Yardanicosecondly - it uses compiler
20:11:58alexdaythen how do you install?
20:12:17alexdaywith koch?
20:13:13FromGitter<data-man> ~"{a}{b}"
20:13:29Yardanicoalexday, yes
20:13:37alexdayok
20:13:40Yardanico./koch tools will clone&compile nimble and nimsuggest
20:14:40alexdayoh, Araq is the founder of nim :P . maybe he will mentor me someday :P
20:14:47alexdayon writing languages
20:15:26FromGitter<RedBeard0531> ~ is the char lisp uses for formatting. but that always felt insane. D uses ~ for concat, so I guess it is kinda like &
20:16:41FromGitter<nitely> what about `%%"{abc}"`?
20:16:56*devdri quit ()
20:20:37FromGitter<data-man> @@"{a}{b}" ⏎ ->"{a}{b}" ⏎ !!"{a}{b}"
20:20:45*claudiuinberlin joined #nim
20:22:00FromGitter<RedBeard0531> would implementing `macro \`{}\` (fmt: string): untyped` work? The use of {} feels right with the syntax.
20:22:54FromGitter<RedBeard0531> Well I fail at markdown. I meant for it to be named {} with the striped syntax.
20:27:09dom96to be honest I dislike all operators except % :(
20:30:11FromGitter<data-man> sf"{a}{b}"
20:30:50dom96nitely: how's your regex package coming along?
20:31:02dom96also, %% might be a good idea
20:33:58Araq%%"{x}" this gets ugly fast
20:34:15Araq+"{x}" is growing on me
20:34:39dom96I think I just prefer fmt"" now
20:34:43FromGitter<nitely> dom96: almost there. I'll open source it this weekend
20:35:02dom96nitely: why not just pop it on to github now?
20:35:10Araqdom96, that doesn't work with \n though and would have to be special cased
20:35:20Araqand then it won't work with " inside
20:35:24dom96we were going to do that anyway
20:35:36dom96it shouldn't work with " inside
20:35:43FromGitter<nitely> dom96: you wanna try it or just check the code?
20:36:02Araqdom96, problem is wouldn't work with \" either
20:36:14Araqwhich is hard to argue for
20:36:18dom96nitely: I'm just afraid you'll disappear someday and we won't ever get to see your masterpiece
20:36:35dom96but I would like to try it
20:37:20FromGitter<nitely> dom96: ahaha I'm sure if I get hit by a bus someone in my family will release it XD
20:37:30FromGitter<data-man> +1 to try it :)
20:37:46*devdri joined #nim
20:37:57dom96still, you should release it right now, there is no reason not to :)
20:38:15FromGitter<nitely> problem is, it requires my package nitely/nim-unicodedb and there were a couple of things missing theere
20:38:35*yglukhov quit (Read error: Connection reset by peer)
20:39:18*yglukhov joined #nim
20:39:56FromGitter<nitely> mainly for matching unicode with shorthands: `\w`, `\d`, etc
20:40:19dom96why is that a problem?
20:40:28dom96it doesn't have to be working 100% to be released :)
20:40:46FromGitter<nitely> well, it's almost done now anyway
20:41:04Yardanicowow, it supports unicode?
20:41:05FromGitter<nitely> I'll try and release it in a couple hours
20:41:11dom96thanks :)
20:41:22dom96Yardanico: Kind of a must-have for regex engines nowadays
20:41:26FromGitter<nitely> my goal is to have unicode level 2 support (i.e: graphemes)
20:41:40FromGitter<nitely> but that will take much longer
20:41:59Araqrelease early, release often. and start with version 1.
20:42:11Araqbufixes produce version 1.1, 1.2 etc
20:42:22Araqgraphemes produce 2.0
20:42:31Araqsee Nim for how to not do things
20:42:48Yardanicoyeah, if nim would be 17.2 no one would be complaining about 1.0 :D
20:42:51Araqversion 1 should be "works for me"
20:42:56enthus1astand if you see v1.1 wait for v1.2 ;)
20:43:43*Yardanico quit (Remote host closed the connection)
20:44:14Araqor go for a year-month release.
20:45:13Araqopen source software is not a master thesis, there is no deadline
20:45:39Araqand the goals shift within time.
20:46:11Araqwhen you were born you couldn't even eat properly, your mother released you anyway
20:46:36enthus1astbut she had a deadline!
20:46:44Araqlol
20:47:11Araqok, release any crap you have after 9 months
20:49:43FromGitter<data-man> A little bit about music https://github.com/lieff/minimp3
20:49:49enthus1astor sometimes deadlines help to get the best out
20:52:15mirani've been afk for cca 1 hour. has any decision been made? :)
20:52:40Araqalways remember beneath a steel sky. https://youtu.be/d-x0qghlvfE?t=569
20:54:27Araqmiran, I went with an unary plus
20:55:22miran+"{it's better than &}"
20:55:44Araqthe + looks a bit like an f :P
20:56:25dom96:/
20:56:28FromGitter<RedBeard0531> are you drunk or just have worse vision than me?
20:56:35*dom96 dislikes it
20:57:02miran:D
20:57:04dom96let's go back to fmt""
20:57:14dom96I guess that's what I get about complaining about that name...
20:57:26miranmemo for the future :)
20:57:45dom96hah, nah, nothing will ever stop me fighting for what I believe in!
20:58:31Araq+ t f
20:58:32FromGitter<RedBeard0531> My offer to make fmt"" work correctly still stands :)
20:58:46Araqand f is a plus with some bow
20:59:04Araqthese are abstract symbols I doubt my vision has anything to do with it
20:59:11dom96+ is just weird here
20:59:12FromGitter<RedBeard0531> It is a very tall and depressed +
20:59:23FromGitter<RedBeard0531> hanging its head in shame
20:59:28dom96please please reconsider
21:00:18AraqRedBeard0531: You can't fix \" for 'fmt'
21:00:24miranif only my iterator syntax proposal got 1/10 of the attention this fmt thing has got.... :(
21:00:43Araqmiran, I read it and I like it. what else is there to say?
21:01:19miranAraq: that's nice to know, thanks! i was hoping if somebody else have something to add/say/improve....
21:01:41*nsf quit (Quit: WeeChat 2.0.1)
21:01:42dom96miran: Is there an RFC for this?
21:01:59FromGitter<data-man> StrFormat -> sf"{is}{the}{best}"
21:02:11miranhttps://github.com/nim-lang/Nim/issues/7047
21:02:25Araqdom96, what if we stick to % then and live with the incompatibility with json?
21:03:44*MJCaley joined #nim
21:04:06dom96argh
21:04:21dom96what if we provide % and format?
21:04:39enthus1astformat formats
21:04:42dom96put the % alias into a separate module, like: import strformat.ops
21:05:02Araq'fmt' does not work well, again.
21:05:15Araqonly an operator does.
21:05:25dom96it does if you write fmt("..."), no?
21:05:29mirancan json's % be changed? and why not? :)
21:05:38dom96miran: because it's canon
21:05:54dom96(my book shows many examples with it)
21:06:00enthus1ast§ ?
21:06:19Araqdom96, true but that's too verbose for some people
21:06:28dom96I feel like there should be a wiki article titled "Nim's historic moments"
21:06:35dom96Where we put links to discussions like this
21:06:51mirancan't you just have errata repo where will be errors plus differences in newer nim versions?
21:07:08dom96I can, but I don't want to
21:07:18mirani know you're trying to avoid any thing that breaks the code in the book, but....
21:07:20dom96Me and Araq agreed that we will release v1 that's compatible with my book
21:07:44Araqwhat's wrong with + ? use it for one day and then come back and complain.
21:08:03dom96+ is commonly used for addition
21:08:09dom96it's odd to use it for formatting
21:08:12Araqunary + is a nop.
21:08:21Araqand has no meaning for string literals
21:08:29dom96yes, but it has meaning for humans
21:08:57AraqI'm a human and it has no meaning to me.
21:08:58FromGitter<data-man> wtf"{Oh}"
21:09:10miran! in vim is 'execute command', i see some connection with 'evaluate string' :)
21:09:26FromGitter<RedBeard0531> Is the only problem with fmt that you need to use """ if you want to embed a " in a {} block?
21:09:27Araqpegs use unary + for "one or more"
21:09:31dom96yeah, I would prefer ! to +
21:09:56dom96Yeah, I'm still unclear about what the problem with fmt"" is
21:10:06FromGitter<RedBeard0531> assuming that fmt called newLit(unescape(str))
21:10:20Araqfmt"\""
21:12:07dom96elaborate
21:12:37FromGitter<GULPF> second " ends the string since it's a raw string
21:13:29dom96no, that raw string isn't finished
21:13:31FromGitter<RedBeard0531> Its a bit odd that you can't \" inside a raw string, but I guess that ship sailed long ago
21:14:17Araqfmt"\"" doesn't work
21:14:36Araq\/"\"" does
21:15:09FromGitter<RedBeard0531> We *could* make fmt require nnkTripleStrLit, but I guess that won't make anyone happy
21:15:23FromGitter<RedBeard0531> That is a cut the baby in half solution
21:15:27FromGitter<GULPF> @dom96 oh, I didn't realize that `""` is an escaped `"` in raw strings
21:16:09FromGitter<RedBeard0531> Yeah, that felt weird to me, but it is what it is
21:16:16dom96yep
21:16:27Araqdoubling the escape hatch is the only way that truely works
21:16:33Araqsee \\ for an example.
21:16:51dom96fmt"{\"}" would be a valid workaround
21:17:23Araqso I don't really think these criticisms against "" or '' are valid
21:18:09Araqor C's format strings where a percent is written as %%
21:18:46Araqby your logic that should have been \% and printf should do the interpretation of \n
21:18:56alexdayhttps://nim-lang.org/docs/tut1.html#procedures-result-variable why is the design done like this. the result variable
21:19:00alexdayimplicit
21:19:00FromGitter<RedBeard0531> but \ is the escape in strings, not "
21:19:22FromGitter<GULPF> but not in raw strings
21:19:29FromGitter<RedBeard0531> alexday that has become one of my favorite nim features. give it a shot. You'll probably like it!
21:19:44dom96RedBeard0531: I love that feature too :D
21:19:48Araqthe point of raw strings is that the backslash is untouched
21:19:56FromGitter<GULPF> what if you actually want `\"`
21:20:23FromGitter<GULPF> `\\"`? then what if *thats* what you actually want
21:20:56alexdayit sounds good, its unique. but then unless one knows the feature its difficult to know :P
21:21:10Araqalexday, Delphi and Eiffel have the feature too :P
21:21:18Araqand I took it from them.
21:21:25miranalexday: that's true about, well... everything, no?
21:21:48alexdayoh ok. I see.
21:22:09FromGitter<GULPF> I'm starting to think `fmt""` is the best option... IMO backslashes needs to be handled differently inside and outside the `{}` blocks. The wart of having to use `"""` for `"` is OK
21:23:20dom96now that I've seen the dreaded +, I will happily take `fmt""`
21:23:28dom96Don't even care about f"" anymore
21:23:37FromGitter<GULPF> fmt"{\foo}\n" should work, where `\` is an operator
21:23:38miranecho "{"a\nb"}\n{"c\nd"}" == ?
21:24:06miranwith fmt/+/?/whatever in front
21:25:24dom96!eval echo r"{"a\nb"}\n{"c\nd"}"
21:25:25NimBotCompile failed: in.nim(1, 11) Error: undeclared identifier: '\'
21:25:44dom96perfect for this occassion
21:26:08Araqok, one last idea
21:26:22Araqwe will have both fmt and %
21:26:35dom96I suggested that above
21:26:37Araqimport strformat except % can be used with JSON
21:26:51dom96but also putting `%` into a separate module
21:27:06Araqwhy? people need to learn about import except
21:27:07dom96i.e. import strformat.ops
21:27:08mirancan't %/fmt be used without any import?
21:28:24Araqstrformat.ops is not how anything else in the stdlib does things
21:29:57*Trustable quit (Remote host closed the connection)
21:29:59dom96I suppose it makes sense to introduce people to this 'except' stuff ASAP
21:30:28dom96but I fear it will be too prevalent
21:33:16*gokr joined #nim
21:36:17*natrys joined #nim
21:38:16miran"import strformat except % " --> so this is in separate module from strutils?
21:38:46FromGitter<GULPF> https://github.com/nim-lang/Nim/blob/devel/lib/pure/strformat.nim
21:38:50FromGitter<GULPF> yes
21:39:26miranmy imports will be longer than my code :D
21:40:00Araqmiran, my documentation comments are longer than my code
21:40:11miranthat's ok :)
21:45:02miranwell guys. i'm off to sleep, can't wait to see in the morning if it is still %/fmt, something else that already was a candidate, or something completely new :)
21:46:42*miran quit (Quit: Konversation terminated!)
21:49:38*Jesin quit (Ping timeout: 255 seconds)
21:53:32yglukhovImo, all operators should be lightweight wrappers to something with a more meaningful name
21:53:48dom96+1
21:54:28yglukhovespecially when those operators are macros, which are sometimes don't behave well in overloading resolution
21:55:22yglukhove.g. https://github.com/nim-lang/Nim/issues/6643
22:03:04Araqthat issue uses 'foo' which is not an operator.
22:03:36Araqwhat's the logic here? 'untyped' is a bit aggressive, yes.
22:03:49Araqthe connection with operators doesn't exist.
22:07:29*Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
22:11:26*MJCaley quit (Quit: MJCaley)
22:15:08*Sentreen joined #nim
22:17:29yglukhovAraq: the logic is that operators are more likely to clash, because everyone thinks that his particular function is so extremely handy that it's gonna be used all over the place, so let's make this `%` = toJson(smth). Why `%`? because arithmetic operators are definitely meaningless here, and would just confuse everyone. So let's take some really meaningless operator and give it some meaning :D
22:18:02yglukhovand `%` is the first meaningless operator that comes to mind
22:18:21yglukhovjust kidding of course, but you get the point ;)
22:20:16*joshbaptiste quit (Ping timeout: 268 seconds)
22:22:23*natrys quit (Quit: natrys)
22:23:05AraqI don't really. `%` doesn't use 'untyped'
22:23:31Araqand the stdlib is careful with its operators
22:23:51Araqcase in point: % used to be fmt until we figured out it sadly doesn't really work well.
22:24:49*claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com)
22:25:16*vlad1777d joined #nim
22:25:18Araqwhere are these operator clashes that you see?
22:26:04Araqand how would 'asgnPlus' instead of '+=' help?
22:27:11yglukhov% used to be (a) lightweight, non-generic (b) proc.
22:27:23yglukhovclashes may occur in non-std libs
22:28:18Araqjson.`%`(a) # disambiguate. it works.
22:28:40AraqI think this is really nicely done in Nim and don't see why we need to change anything
22:29:35Araqnow ok, json.% in particular it a bit misdesigned as the single %* that was introduced later would do the same job
22:33:22yglukhov"I think this is really nicely done in Nim" - i think so too. however, there's a bson module in nimongo, which has introduced `%*` as well (ok, that was a mistake, but still). now any module that imports bson and json (a lot of our server code) is doomed to always do json.`%*`(smth) and bson.`%*`(smth). With my suggestion we could just opt out to toJson(smth) and toBson(smth), which is (a) shorter and (b) meaningful.
22:34:31Araqwell you can do that with a short helper module
22:34:33yglukhovother than that i'm completely happy with using the operators, and i like them. i'm just suggesting a friendly practice
22:35:27Araqit's unfortunate but you can put the discipline somewhere else ("import bsonex" to make things easy to write)
22:37:10yglukhovAraq: ok, here's another sample. this macro `%*` adds `%` to the ast nodes of its input
22:37:29yglukhovit hopes, that `%` will return JsonNode for MyType
22:37:58yglukhovnow what if bson.`%*` wants the same?
22:38:16Araqit doesn't hope, I fixed that long ago, it uses bindSym"%"
22:38:17yglukhovand i want MyType to be both json and bson compliant
22:38:31Araqso it only uses the %'s in json.nim
22:38:32yglukhoveven worse
22:38:47dom96To all the people coming to FOSDEM, you guys want me to get Nim t-shirts for you?
22:38:57dom96If so, tell me your size
22:39:01yglukhovso i can't put mytype into the json literal
22:39:06yglukhovdom96: yes!
22:39:35yglukhovL
22:40:06dom96Oh, also need a colour preference:
22:40:12dom96Denim Blue: https://uktshirtprinting.com/product/custom-product-5a5673687806c3-14363436
22:40:20dom96Dark Grey: https://uktshirtprinting.com/product/custom-product-5a56738b901695-06005377
22:40:27dom96Black: https://uktshirtprinting.com/product/custom-product-5a5673baf0ecc8-16150316
22:40:40dom96Navy Blue: https://uktshirtprinting.com/product/custom-product-5a567eba2753f5-71020628
22:40:53Araqyglukhov, ok but now the problem shifted from "% clashes" to "%* doesn't support a protocol that it otherwise could"
22:41:12Araqwhich is true and we should fix json.nim
22:41:13dom96There is also a fabric choice, one is ~£19.00 the other is ~£24.00 (but has less colour choices: just black and grey)
22:41:39yglukhovdom96: black lgtm
22:42:02dom96The cheaper or more expensive one?
22:42:09yglukhovAraq: well, with my friendly practice this would never be a problem
22:43:27yglukhovbut ok, maybe there's no point in arguing about it until the next nice use-case.
22:43:29FromGitter<RedBeard0531> @yglukhov We finally invested some time a few weeks ago to tune our server-internal BSON parser. If you are using bson a lot it may be worth doing the same thing in nimongo: https://github.com/mongodb/mongo/commit/3c586a7c946ac7f9485b9ff978fa029ac4b5108e
22:44:17yglukhovdom96: let it be the premial =)
22:44:26dom96yglukhov: okay :)
22:45:25dom96I wonder if I should ask on the forum
22:45:31dom96not much time to order these now though
22:45:43yglukhovRedBeard0531: thanks! even though bson performance is not our main problem atm =)
22:47:04dom96PMunch, federico3 ^^ any special requests for t-shirts?
22:47:13*joshbaptiste joined #nim
22:50:11*Jesin joined #nim
22:51:43*arecaceae quit (Ping timeout: 268 seconds)
22:51:54dom96btw any comments on these designs welcome
22:52:59*arecaceae joined #nim
22:54:23*devdri quit ()
22:56:53*chemist69 quit (Ping timeout: 276 seconds)
23:07:37*yglukhov quit (Remote host closed the connection)
23:08:10*yglukhov joined #nim
23:09:41enthus1astjoin c
23:09:56*chemist69 joined #nim
23:09:56enthus1astsorry
23:11:00*dddddd quit (Remote host closed the connection)
23:11:45FromGitter<zetashift> @RedBeard0531 I
23:11:57FromGitter<zetashift> ve heard some mixed things about MongoDB, where does it shine?
23:12:27*yglukhov quit (Ping timeout: 240 seconds)
23:14:16FromGitter<RedBeard0531> I've been working on it for over 8 years now so I'm a bit biased :)
23:16:28FromGitter<RedBeard0531> But we try really hard to make it damn easy to use. We focus on dev productivity for people building apps that use the DB. Probably best to DM if you have more questions though.
23:16:47*endragor joined #nim
23:17:16*MJCaley joined #nim
23:21:03*endragor quit (Ping timeout: 248 seconds)
23:26:31AraqRedBeard0531: Oh are you working for them?
23:27:11Araqinteresting, Mongodb saved my butt once
23:29:26FromGitter<RedBeard0531> Yup. Glad to hear it! Any chance it was a feature I worked on?
23:36:16*MJCaley quit (Quit: MJCaley)
23:39:31*yglukhov joined #nim
23:41:40FromGitter<zetashift> Well I'm not asking why it's better than others, what kind of problems does MongoDB solve easier than others. I've used it twice before in small js sites and I liked how easy it was to get started with
23:43:22AraqRedBeard0531: Windows support? :-)
23:43:53Araqperformance?
23:44:09*yglukhov quit (Ping timeout: 264 seconds)
23:44:11Araqbeing easy to setup and deploy?
23:44:32Araqthe only downside is your query language :-)
23:45:29FromGitter<RedBeard0531> heh. I try to avoid working on our windows support but sometimes I can't help it. I do spend a LOT of time on perf improvements. I'm the goto guy for when things are slower than they should be.
23:45:51*zahary quit (Quit: Leaving.)
23:46:10FromGitter<RedBeard0531> Have you tried the agg language? I spent a lot of time on that a few years ago, although I've largely handed it off.
23:46:18Araqhttp://www.globalnerdy.com/wordpress/wp-content/uploads/2014/05/how-do-i-query-the-database.jpg
23:46:41FromGitter<RedBeard0531> trust me, we hate map/reduce more than you do...
23:46:55Araqthat comic never gets old lol
23:47:09FromGitter<RedBeard0531> the new (well old now) agg language is our replacement for map reduce
23:47:22Araqnever heard of it
23:47:36Araqit's been awhile since I last used Mongo
23:49:55Araqdid you fix the "mongodb just keeps growing" problems on Windows?
23:49:56FromGitter<RedBeard0531> db.postcodes.aggregate([{$match: {state: "NY}}, {$group: {_id: "$city", totalPop: {$sum: "$pop"}, avgPop: {$avg: "$pop"}}}])
23:50:30Araqoh yeah, that's not a query language.
23:50:37FromGitter<RedBeard0531> probably? I don't remember that one.
23:51:58Araqthat's "too lazy to write a parser". ;-)
23:52:00FromGitter<RedBeard0531> I kinda like the queries-are-data API. It makes it really easy to build them programatically.
23:52:34Araqyeah or that.
23:52:36FromGitter<RedBeard0531> Haven't I told you that parsing is my least favorite part of programming ;)
23:52:47Araqit's an API, not a query language. fail.
23:53:13Araqthe trick about "adhoc queries" is in the "adhoc" part
23:53:44AraqI don't write programs that construct these queries as often as I write queries.
23:53:45FromGitter<RedBeard0531> Most users access it programatically. and not from COBAL.
23:58:26Araq*shrug* I used Mongo because it works on Windows and had superior performance
23:58:51Araqand losing some data wasn't also a problem.
23:59:44Araqthe "you have no schema" and "your query is a JSON" parts were a pita ;-)