<< 03-07-2018 >>

00:01:32FromGitter<fedkanaut> How do I create brackets when making macros? I got "[]" but can't figure out how to put something in it.
00:15:37CodeVancequote do:
00:16:21CodeVancealso `nnkBracketExpr.newTree( newSymNode("Collection"), newSymNode("Entity"),`
00:17:08CodeVance`hint astGenRepr quote do: [foo]`
00:17:18FromGitter<fedkanaut> Thanks!
00:22:07*sz0 quit (Quit: Connection closed for inactivity)
00:25:06CodeVanceanother tip at the end of your macro add hint repr result
00:25:33CodeVanceit shows the plain text version of the macro result
01:07:54*dddddd quit (Remote host closed the connection)
01:08:53*nasusiro joined #nim
01:09:31nasusirohey guys. is it possible to set the -o inside a nimscript? I don't want to type -o:bin/foo all the time.
01:18:14FromGitter<gogolxdong> How to import from js file?
01:20:00FromGitter<gogolxdong> (https://files.gitter.im/nim-lang/Nim/Xzk4/image.png)
01:26:21FromGitter<kayabaNerve> If I want to be able to write: ⏎ `PROC^4(data)` ⏎ to have that proc run 4 times, and have a working ^ decl of: ⏎ `proc `^`*(pro: proc(hex: string): string, times: int, hex: string): string =` ⏎ What are the valid ways to call it? [https://gitter.im/nim-lang/Nim?at=5b3ad0bd60c387078358557b]
01:27:14FromGitter<kayabaNerve> Because I'm struggling to call it. I want something close to the original, but I'll take other ways...
01:27:31FromGitter<kayabaNerve> And there's a reason I don't just do myProc(times, hex)
01:32:40FromGitter<kayabaNerve> I'd also accept PROC[4]...
01:33:03*nasusiro quit (Quit: Quitting for now...)
01:33:16FromGitter<kayabaNerve> And I'm fully willing to hear Nim can't satisfy this random request of mine that violates so many things
01:46:28FromGitter<Quelklef> ...whytho
01:46:40FromGitter<rayman22201> @kayabaNerve https://nim-lang.org/docs/macros.html#calls-expressions-array-access-operator
01:46:46FromGitter<rayman22201> love the macro
01:47:05FromGitter<rayman22201> though I agree, super weird thing to do lol
01:47:12FromGitter<Quelklef> He said he wants a 'working ^ decl' though so I think macros can't be used?
01:47:18FromGitter<Quelklef> should still be possible I think
01:48:00FromGitter<Quelklef> is ``proc `^`(f: proc(hex: string): string, times: int): proc(hex: string): string`` also ok? Because that should be possible and fit the given syntax
01:48:13FromGitter<Quelklef> not quite, you'd need to do `(proc^4)(string)` but
01:49:32FromGitter<Quelklef> yeah wait `proc^4(data)` is going to be parsed as `` `^`(proc, 4(data))`` I think, so what you're asking isn't quite possible
01:49:38FromGitter<Quelklef> wait, maybe with term rewriting macros?
01:52:04CodeVancenot possible with quote do
01:52:11CodeVanceuse something else
01:52:15CodeVance"^".ident
01:52:32FromGitter<Quelklef> ?
01:56:35CodeVancenvm
01:57:17FromGitter<Quelklef> I think `3(4)` is a parsing error, so this isn't possible :(
01:57:35FromGitter<Quelklef> `Error: in expression '3(4)': identifier expected, but found '3'`
01:57:44FromGitter<Quelklef> Disappointing, I think it'd be possible otherwise
02:00:00FromGitter<Quelklef> ```code paste, see link``` ⏎ ⏎ Works, though, and can be used like `(g^n)(x)`. [https://gitter.im/nim-lang/Nim?at=5b3ad8a089db5e701c9ca5d5]
02:00:14FromGitter<Quelklef> Which, in my opinion, is better, anyway...
02:04:53*Jesin quit (Quit: Leaving)
02:08:22*Jesin joined #nim
02:20:01*Lord_Nightmare quit (Ping timeout: 256 seconds)
02:25:20FromGitter<kayabaNerve> Because the name of the algorithm is SHA512 squared and I'm eccentric and not working on it right now, so I need the solution tomorrow or so, and thought this could be cool
02:25:32FromGitter<kayabaNerve> Thanks @Quelklef
02:27:37FromGitter<kayabaNerve> Oh. But it's not limited to SHA512. It's for all hash algorithms.
02:28:11FromGitter<Varriount> Is it normal posix behavior to send sigpipe when writing to a closed file?
02:28:24FromGitter<kayabaNerve> (or cubed...)
02:28:40*find0x90 joined #nim
02:29:39*find0x90 quit (Client Quit)
02:35:28*donlzx joined #nim
02:35:57FromGitter<kayabaNerve> @Quelklef Just wanted to say your solution is really smart, especially thinking of returning a proc. It's annoying to wrap the whole thing in () as I immediately call substr, but it's way better than anything I could ever do.
02:39:08*mitai joined #nim
02:41:25*Lord_Nightmare joined #nim
03:13:06*ieatnerds joined #nim
03:14:54*ieatnerds quit (Client Quit)
03:35:16FromGitter<Quelklef> @kayabaNerve thanks! You could also rename it to `rep` instead of `` `^` `` so you can use it like `proc.rep(3)(4)` and not have to wrap it in `()`s
03:36:03*endragor joined #nim
03:38:05*smt` quit (Read error: Connection reset by peer)
03:38:28*smt` joined #nim
03:45:47*mitai quit (Ping timeout: 256 seconds)
03:55:02*skrylar quit (Remote host closed the connection)
04:02:23*lompik joined #nim
04:22:36*krux02 quit (Remote host closed the connection)
04:24:06FromGitter<Varriount> Anyone here have some time to help with something?
04:25:04FromGitter<Varriount> I need a template that will repeat a given block of code X number of times, passing in a list of expressions and an identifier to determine how many times the block should repeat.
04:26:18FromGitter<Varriount> I'm guessing the syntax would probably be something like: ⏎ ⏎ ```repeatBlock([a,b, c], ident): ⏎ ident * ident``` [https://gitter.im/nim-lang/Nim?at=5b3afaea3572e970c170dacc]
04:32:16FromGitter<Quelklef> can you give a usage example?
04:32:25FromGitter<Quelklef> I can try but I dont' quite understand what you're wanting
04:33:04FromGitter<Quelklef> Is it like ⏎ ⏎ ```repeatBlock([2, 3, 4], x): ⏎ echo(x)``` ⏎ ⏎ echoes 2, then 3, then 4? [https://gitter.im/nim-lang/Nim?at=5b3afc7f60c3870783589b9b]
04:33:05FromGitter<Varriount> @Quelklef I'm writing a module that deals with subprocesses, and needs to handle stdout, stderr, and stdin objects.
04:33:14FromGitter<Varriount> @Quelklef Yes.
04:33:40FromGitter<Quelklef> ```for x in [2, 3, 4]: ⏎ echo(x)``` [https://gitter.im/nim-lang/Nim?at=5b3afca3f166440661149f8d]
04:33:41FromGitter<Quelklef> ...?
04:34:51FromGitter<Varriount> Hm, perhaps.
04:35:05FromGitter<Varriount> @Quelklef This is the module I'm currently writing: https://gist.github.com/Varriount/e5df257fe04370c5469b216cf25983ee
04:36:19FromGitter<Quelklef> And your're wanting to
04:36:28FromGitter<Quelklef> Sorry, I'm doing 2 things at once right now as well
04:37:08FromGitter<Varriount> It's not really important, I was really just wondering if someone had some handy-dandy function ready.
04:37:59FromGitter<Quelklef> i mean I bet it's possible
04:38:08FromGitter<Quelklef> you could learn macros and make it yourself too!
04:47:31FromGitter<Quelklef> but I'd actually love to tackle this if I can understand it lol
05:04:22FromGitter<kayabaNerve> @Quelklef I'd still have to do the substring wrap which is my man issue.
05:04:41FromGitter<Quelklef> what do you mean by that?
05:29:44*skrylar joined #nim
05:39:36*leorize joined #nim
05:39:58FromGitter<rayman22201> Hey @kayabaNerve, Here is a rather obtuse way to do your weird carrat repeat syntax: https://gist.github.com/rayman22201/003ae414c1943278dfd25460e3098fbf
05:56:16*leorize quit (Remote host closed the connection)
06:08:30FromGitter<Varriount> @rayman22201 Did you guys consider using term-rewriting macros for this?
06:23:07FromGitter<rayman22201> yeah, but the lexer doesn't seem to like it. Or I'm not very good at term rewriting macros.
06:24:22FromGitter<rayman22201> @Quelklef tried and got ⏎ ⏎ > `Error: in expression '3(4)': identifier expected, but found '3'`
06:29:49*Vladar joined #nim
06:42:11FromGitter<Quelklef> I'm actually a little surprised it's a parsing error
06:43:07FromGitter<Quelklef> especially since other expressions are allowed like `(somefunction * someoverloadedoperator)(3)`
06:44:36FromGitter<rayman22201> could be a bug? idk
06:50:09FromGitter<Quelklef> no i doubt it just a design decision
06:50:32FromGitter<rayman22201> true. Probably more likely
06:50:35*fjvallarino quit (Remote host closed the connection)
06:51:02*fjvallarino joined #nim
06:51:05FromGitter<Quelklef> @Araq any words on this? `3(4)` being a parser error rather than something else? Constricts the possible usage of macros.
06:55:29*fjvallarino quit (Ping timeout: 255 seconds)
07:00:00FromGitter<mratsim> identifiers cannot start with a digit though
07:00:32FromGitter<mratsim> this is also true in Python
07:03:41shashlickmeh - github rate limits, just when things were getting even more fun with tissue
07:04:09FromGitter<Quelklef> @mratsim No yes I just mean that parsing a function call isn't `expr(expr)`, it's something else
07:04:52FromGitter<Quelklef> seemingly along the lines of `(identifier | '(' expr ')') '(' expr ')'`
07:05:13FromGitter<Quelklef> and I feel like that's a slight downfall
07:05:46FromGitter<Quelklef> I'm not sure if doing what I'm asking is even possible with the current setup, though, I know Nim has some tricky parsing to do
07:08:33FromGitter<ephja> ```proc `()`(i: int): int = i * 2``` ⏎ ⏎ ;) [https://gitter.im/nim-lang/Nim?at=5b3b20f089db5e701c9d210e]
07:15:15FromGitter<Varriount> @ephja Does that actually work?
07:21:37FromGitter<ephja> @Varriount yes, but only when the experimental call operator feature is enabled
07:22:12FromGitter<ephja> I forgot to add a second argument
07:28:25*fjvallarino joined #nim
07:54:50*leru joined #nim
08:01:15*floppydh quit (Quit: WeeChat 2.1)
08:03:14*floppydh joined #nim
08:14:10*beatmox quit (Ping timeout: 264 seconds)
08:14:10*tribly quit (Ping timeout: 264 seconds)
08:14:16*beatmox joined #nim
08:16:01*tribly joined #nim
08:17:01*dddddd joined #nim
08:19:57YardanicoIs this code supposed to work? https://gist.github.com/Yardanico/80536d735dfd0d5b8fc63a2a54e584a3
08:19:58TangerHey guys, I'm trying to test the stdin reading of an app by redirecting stdin to a file in my tests. Problem is I have a quit call in there, which quits out of the actual unit tests. I was considering replacing the quit with a return if it's running a test, but I was curious to see if anybody had a more succinct way to achieve this?
08:35:21FromGitter<narimiran> hmmm, this is strange. i'm doing some numerical calculation and exporting results (floats) to .csv.
08:35:46FromGitter<narimiran> at one point a floating number is wrongly converted to the scientific notation!
08:36:11FromGitter<narimiran> i get `9.775367418133826e-0` instead of `9.775367418133826e-1` (9.77 vs 0.977)
08:42:08FromGitter<narimiran> sorry, the correct value is -0.0977536 (minus, and one more decimal zero)
08:48:30FromGitter<narimiran> wtf, look at this: the same number printed using `:0.5f` and `:0.5e` formatting: `-0.09810, -9.81000e-0`
08:49:13FromGitter<narimiran> this is by using the `&` for string formatting, nim stable (0.18.0)
08:53:13FromGitter<narimiran> the same thing in nim devel
08:56:01FromGitter<narimiran> and the best of all - i cannot reproduce this behaviour in a simple example.... !?!
09:01:44*rosshadden quit (Read error: Connection reset by peer)
09:03:38*rosshadden joined #nim
09:04:45*gibril joined #nim
09:11:08*gibril quit (Quit: leaving)
09:26:03*leru quit (Quit: Leaving)
09:26:25FromGitter<narimiran> ok, i found the "bug". it was my fault, of course. i was stripping some characters and `e-02, ...`was stripped to `e-0` instead of `e-02`
09:26:40*FromGitter * narimiran kicks himself
09:33:30Araqtemp10.nim(7, 6) Error: in expression '4(4)': identifier expected, but found '4'
09:33:45Araq--> the parser ate it, semcheck caught it
09:33:56Araqshould be usable in a macro, let's try
09:35:05Araqimport macros
09:35:06Araqmacro m(x: untyped): untyped =
09:35:06Araq discard
09:35:06Araqm 4(4)
09:35:16Araq--> works, Nim is awesome
09:38:08FromGitter<mratsim> this is magic, I would expect it not to work ¯\\_(ツ)\_/¯
09:38:42*noonien joined #nim
09:41:44*krux02 joined #nim
09:42:45Araqit's primaryExpr '(' primaryExpr ')' # function call
09:42:57Araq"foo bar"() also works
09:43:09Araqand I've misused it in scripting... :-)
09:43:35Araq"gcc -c foo"() # Nim is the better Bash.
09:56:05*pwntus quit (Ping timeout: 240 seconds)
10:02:11FromGitter<mratsim> Woot, timothee is back, poor bug tracker
10:09:15*arecaceae quit (Remote host closed the connection)
10:09:34*arecaceae joined #nim
10:12:06Araqhe is doing good work, figuring out how the compiler works.
10:16:01*arecaceae quit (Ping timeout: 256 seconds)
10:16:59*gibril joined #nim
10:18:00federico3something like $ run this command would be really nice for scripting
10:20:36Araqsince I don't want more lexer rules (breaks every highlighter) this needs to be in a string literal
10:20:50Araqbut there is no reason we can't "run" a string literal via ()
10:21:24Araqso I like my hack quite a bit :-)
10:23:17*gibril quit (Quit: leaving)
10:23:49*bevo quit (*.net *.split)
10:24:12*gibril joined #nim
10:24:12*gibril quit (Client Quit)
10:29:35*gibril joined #nim
10:31:08*gibril quit (Client Quit)
10:31:25*gibril joined #nim
10:32:50*NimBot joined #nim
10:33:54*leorize joined #nim
10:40:28*nsf joined #nim
10:41:03FromGitter<Grabli66> Hi! Can i compile nim program for OpenWRT MIPS?
10:42:32Yardanico@Grabli66 if you have a C compiler for it, then probably yes
10:42:44YardanicoI mean C cross-compiler from your current host to OpenWRT MIPS
10:58:55dom96Yes, you can.
10:58:58dom96Nim supports MIPS
11:00:34dom96Look up how to target MIPS using C and you'll be on your way to having Nim working
11:07:26Araqdom96, besides the kdom/dom integration, what do you think is left to do for Karax v1?
11:09:39dom96Fix all my issues :P
11:10:57FromGitter<mratsim> documentation
11:11:07dom96You need a website for it
11:11:11FromGitter<mratsim> (yeah I know it’s easy :P)
11:11:17dom96with plenty of marketing material and yeah, documentation
11:11:34Araqdocumentation is in the readme.rst now
11:11:45AraqI mean sure
11:11:51Araqyou can write books about these things.
11:12:41*smt joined #nim
11:13:15*smt` quit (Ping timeout: 256 seconds)
11:15:30FromGitter<Grabli66> dom96, thanks.
11:15:53skrylarhmm
11:21:47dom96So Python is adding `:=` just for if statements
11:24:26FromGitter<narimiran> @dom96 and that addition is one of the stupidest ideas i've seen
11:25:14FromGitter<mratsim> uh? if statement? that’s dumb
11:26:11Yardanicohttps://www.python.org/dev/peps/pep-0572/
11:26:14FromGitter<narimiran> introducing `:=` is dumb(er)
11:26:15FromGitter<mratsim> any reference to the news?
11:26:25FromGitter<mratsim> great
11:26:49FromGitter<mratsim> ah it’s expression not statement
11:27:42FromGitter<mratsim> this is similar to C assignment that also returns the value of the expression: `while (value := read_next_item()) is not None:`
11:29:11FromGitter<mratsim> this is tricky though: https://www.python.org/dev/peps/pep-0572/#lowering-operator-precedence
11:32:03FromGitter<mratsim> this is similar to Rust “while let” and “if let"
11:34:14*elrood joined #nim
11:35:04dom96yes, and you could probably implement it as a template in Nim
11:37:40*arecaceae joined #nim
11:41:52FromGitter<mratsim> last time we discussed about this, arq said that it didn’t fit with Nim “flow-based programming” whatever that meant.
11:44:09dom96oh, that `=` shouldn't return `void`?
11:45:43dom96Here is the relevant thread: https://forum.nim-lang.org/t/3988
11:51:52FromGitter<ChristianWitts> as a very long time Python user, I’m not a fan of the zoidberg operator
11:58:08dom96That's a great name :)
12:13:25dom96Hrm, should we be adding test cases for things like this? https://github.com/nim-lang/Nim/issues/6615
12:13:28dom96Araq: ^
12:22:06Araqdom96, in general, yes.
12:22:14Araqand that bug isn't even fixed, I think
12:22:43Araq"Error: type mismatch: got <nil> but expected 'SomeType = Forward'
12:22:43Araq"
12:22:48dom96oh, so it should work
12:23:05Araqyeah...
12:23:17Araqnice it doesn't crash anymore, but the compiler should accept it
12:23:27dom96okay, I reopened
12:30:10Araqcan we make https://nim-lang.org/docs/apis.html part of the style guide?
12:30:33Araqit's the original design document behind the stdlib
12:30:58Araqand doesn't contradict it (yet?), though it's of course too slim
12:33:57dom96sure we can
12:41:17*mitai joined #nim
12:43:02Araqnice
12:44:23*leorize quit (Remote host closed the connection)
12:48:29*nasusiro joined #nim
12:56:46dom96https://twitter.com/nim_lang/status/1014130476930486278 :D
13:00:28dom96I think it's time to update our donate page
13:02:56Araqyeah, it's a good time to be alive.
13:03:08Araqanyhow, nimcache is annoying.
13:03:36Araqwhen you use both 'nim c' and 'nim cpp' at the same time
13:03:42Araqas the object files are not compatible
13:04:01Araqso either we can produce foo.cpp.obj or have more subdirs in nimcache/
13:04:10dom96yeah, seems like a simple solution
13:04:27Araqbut it's also annoying me that nimcache is relative to the current project
13:04:49Araqand not in some /tmp or $home/nimcache
13:04:50FromGitter<narimiran> btw, what's the simplest solution for (one-time) donation to nim?
13:05:26dom96narimiran: not sure which is simplest, but there are plenty of options: paypal, bountysource, opencollective, bitcoin
13:05:32dom96All support one-time donations
13:05:48dom96https://nim-lang.org/donate.html
13:06:38FromGitter<narimiran> since i don't have an account on any of them, i'll try to see what is the simplest for me + the most money for you :)
13:06:55Araqpaypal's fees are pretty bad.
13:07:05dom96every service has fees sadly
13:07:11dom96bountysource has like 10%
13:07:21dom96which is far worse than paypal AFAIK
13:07:24skrylarmoney handling is annoying; you probably want to put up with the fees
13:07:53skrylar(theres also librepay and ko-fi, but well, fees are not avoidable with money. turns out money engineers are good at grubbing)
13:08:24dom96I also want us to set up a patreon (for Nim and for ourselves)
13:08:31dom96I wonder what their fees are like
13:09:13FromGitter<narimiran> i guess i should be getting some money in about two-weeks time. hopefully by then i/we will figure out what is the best way to donate
13:09:22skrylarthe fees for all of those things is less than Apple/Valve's take
13:09:33skrylarusually less than 30%
13:09:45skrylarbut the government will take what patreon doesn't :)
13:10:48dom96hehe so true
13:11:04Araqesp in Germany, the king of taxes :-(
13:11:14*endragor quit (Remote host closed the connection)
13:11:25FromGitter<narimiran> Araq: isn't your VAT something like 19%?
13:11:45FromGitter<narimiran> because here in Croatia we have nice and round 25%!!
13:11:48dom96Araq: Not for long. Brexit will make tax rises unavoidable in the UK soon enough
13:13:19Araqnarimiran, VAT is 19%, yes. and all around pre-tax vs net is 50% off
13:14:07FromGitter<kaushalmodi> General curiosity: How is the donation used? What part goes to hosting, etc.
13:14:36Araqearn 3000€ officially and live with 1500€
13:15:13FromGitter<narimiran> same here with pre-tax vs net. the only difference is that what remains after the taxes is here something like 700€
13:15:45Araqcroatia, huh? never was there :-)
13:15:52FromGitter<narimiran> and no, the cost of living is not 2-3x smaller!
13:15:57*ieatnerds joined #nim
13:16:10dom96kaushalmodi: Digital ocean actually covers our hosting for free. The most recent use of our donations was for the forum.
13:16:35FromGitter<narimiran> croatia - great for holidays (or so the turists think), okayish for living here :)
13:16:47Araqyeah and we have something big (TM) in the works
13:16:55dom96indeed
13:17:01Yardanicohmmm
13:17:01FromGitter<narimiran> v1.0 or GTFO!!! :D
13:17:21Yardanico( ͡°( ͡° ͜ʖ( ͡° ͜ʖ ͡°)ʖ ͡°) ͡°) some secret development
13:17:51FromGitter<Vindaar> now I'm curious :P
13:17:56nasusiroAraq: to be honest with you I was thinking as well about nimcache last night. Go figure!
13:18:15Araqnarimiran: v1.0 plan is out
13:18:20dom96nimcache would indeed be better in /tmp/
13:18:32dom96It's amazing where a nimcache dir sometimes shows up
13:18:41Araqwhat do we do with the binaries?
13:18:49dom96Pretty sure there is a bug in there somewhere that makes it appear in the wrong place
13:18:56AraqI would put them in nimcache too, esp when '-r' is used
13:19:06dom96no, binaries are different
13:19:26nasusirodom96: you know what I was thinking about nimcache last night? Replacing it with SQLite database and cache every project in a central database.
13:19:32FromGitter<narimiran> but binaries "somewhere else" would be nice to simplify .gitignore
13:19:43Araqfor production I usually use -o:bin/stuff.exe
13:19:51Araqand else I don't care where it ends up
13:20:00FromGitter<kaushalmodi> About nimcache, if you put it in /tmp, please set it in /tmp/$USER/. I have ended up in scenarios where multiple users try to write other user's /tmp dir
13:20:25Araqyeah /tmp is pretty bad. it doesn't even exist on Android.
13:20:46nasusiroAraq: last night I asked whether it's possible to use -o:bin/foo or --out:... in a nimscript. I hate typing -o:bin/foo all the time, whereas --threads:on can be placed in my nimscript and work as expected.
13:20:47skrylarstore them in /dev/null, the most efficient of compressants
13:21:16skrylarnasusiro, you could always use a makefile :^)
13:21:27Araq /dev/null doesn't exist on BananajoeUnix though
13:21:35nasusiroskrylar: I don't use makefile; I prefer using meson
13:22:01dom96Yeah, to be honest saving in /tmp as issues of its own
13:22:05Araqnasusiro, switch("out", "bla") in NimScript should do the job
13:22:06dom96*has
13:22:19skrylari like plan9's mk, but requires a lot of crap to be installed. meanwhile, a makefile can have a phony target that just kicks off your project's chosen build scripts
13:22:22nasusiroAraq: what's out and what's bla?
13:22:54Yardaniconasusiro, out is a compiler option and "bla" is a "out" argument
13:23:04Yardanico--out:bla is the same as switch("out", "bla")
13:23:22nasusirothat's more like it, a cleaner explanation that makes sense now lol
13:23:24nasusirothank you
13:24:02FromGitter<narimiran> so what to put in nim.cfg so all my binaries in a project are in `bin/` subdirectory?
13:25:05skrylari was reading assembly related stuff earlier (linear scan register allocation; apparently linear scan and/or binpacking are claimed by the whitepaper to be 99% as performnant as graph colored) about how small a compiler can actually be :ponder:
13:25:43nasusiroAraq: what do you think about the SQLite caching suggestion in place of nimcache?
13:26:00Araqnarimiran: heh, seems impossible as --out doesn't deal with directories but with filenames
13:26:30Araqnasusiro, we do this for --incremental:on but the C code needs to stay in .c files
13:26:39Araqelse I cannot run a C compiler over them ;-)
13:27:13nasusiroI'm sure I have seen a use of it before
13:27:22nasusirowhen I find my original resource, I will share it with you
13:27:25nasusiroit's very useful
13:27:30Araqswitch("out", "bin/$projectName")
13:28:01Araqdon't remember what $variables we support though...
13:28:18*pwntus joined #nim
13:28:33FromGitter<mratsim> can’t you just use Stripe or Mangopay for donations. 1.4 and 1.8% fees on European credit card. (And Stripe is 2.9% on American credit card)
13:28:36*pwntus quit (Changing host)
13:28:36*pwntus joined #nim
13:29:01FromGitter<mratsim> (because US credit card are just a money grab ….)
13:29:02dom96Stripe is a good idea
13:29:06*endragor joined #nim
13:29:35FromGitter<mratsim> issue with stripe is the different fees for EU vs US (1.4 vs 2.9) while Mangopay is a flat 1.8%
13:29:51FromGitter<mratsim> but MangoPay doesn’t accept American Express iirc
13:30:29skrylarhave actually had to start researching this problem (money platforms)
13:30:45skrylarpatreon is the easiest but a lot of people don't like them and/or they don't handle single payments well
13:31:05skrylarcoalescing benefits from multiple payment platforms seems an annoying task to solve at some point
13:32:04dom96There is a project which provides a web page for all these services but I can't remember its name
13:33:24skrylarwell the harriness comes with if you are doing a benefits package patreon style
13:33:40FromGitter<mratsim> otherwise non-profits in France can use this, no commission whatsoever, but France non-profits only: https://www.helloasso.com/
13:33:47Araqnasusiro, https://github.com/nim-lang/Nim/issues/7874 feel free to comment
13:34:09skrylaryou're expected culturally to make news posts through them (and their clones, if doing simultaneous site runs), and sometimes people get badges or whatever
13:34:14nasusirothank you Araq, I will read the comments and let you know ;)
13:34:39skrylarmratsim: ko-fi doesn't take a cut (but the underlying processors do) and anyone can use it
13:36:24FromGitter<mratsim> interesting
13:36:57FromGitter<mratsim> ugh, it uses Paypal
13:38:43FromGitter<kaushalmodi> Comparison of fees: https://oremacs.com/2017/12/10/patreon/
13:39:17nasusiroAraq: for GCC there is a caching suggestion if you haven't tried it already; it's called ccache https://ccache.samba.org/
13:41:41FromGitter<mratsim> ccache is GPL, and should be managed at the bistro/devops level in my opinion
13:41:59AraqI prefer to fix Nim's problems instead of layering shit on top of broken stuff
13:42:07Araq;-)
13:42:09nasusiroAraq: agreed
13:42:11FromGitter<mratsim> distro not bistro
13:42:30Araqaww, there is no bistro level
13:42:43FromGitter<mratsim> https://en.wikipedia.org/wiki/Bistro
13:43:02Araqyes, I know what a bistro is.
13:43:21FromGitter<mratsim> =)
13:44:15nasusiroAraq: I will try something and let you know in a minute
13:44:38Araqbistro -- food. distro -- toilet. you need both.
13:48:34*endragor quit (Remote host closed the connection)
13:50:03nasusiroAraq: why am I prohibited from using full path for CC inside nim.cfg?
13:50:26Araqcc only takes an enum value
13:50:36Araquse gcc.exe = "fullpath"
13:50:42nasusiroah cool
13:50:44Araqor clang.exe etc, you get the idea
13:52:07*endragor joined #nim
13:52:09nasusiroyep, it works like a bullet!
13:53:32nasusiroI just added "usr/lib/ccache/gcc" to gcc.exe and caches compilation files. I edited a project of mine after I originally compiled it and took it a fraction of a second to recompile the whole thing
13:54:04Araqso ... in other words the Nim compiler is the bottleneck.
13:54:20nasusiroI guess :/
13:54:31Araquntil that is sorted out, I cannot advertise Nim's compile times :-)
13:54:39nasusiro^_^ haha
13:55:04Araqbut the good news is that --incremental:on is implemented. the bad news is it's untested.
13:55:17nasusiroso Nim does not have an IR before emitting C code?
13:55:33nasusiroor is C used as our IR code?
13:55:44Araqit has an IR but it's not serialized to any binary format.
13:55:54nasusirothat's not what I meant
13:55:59Araqnow we have that, but it needs to be tested.
13:56:05Araqthe AST is the IR.
13:56:12nasusiroah yes, correct
13:56:27nasusiroI'm still learning about language and compiler design
13:56:50Araqand it's ok as an IR, we also have a control flow graph but algorithms on this thing suck
13:57:09CodeVanceIs incremental compiling working
13:57:46nasusiroAraq: where should I use --incremental:on? with nim c or can I place it inside a nimscript as well?
13:57:46AraqCodeVance, got burned out after implementing it, will bring it to production quality later.
13:58:43Araqyou shouldn't use it at all for now. unless you want to help with its development.
13:59:04CodeVanceBut it works sorta
13:59:05CodeVanceCool nice job
13:59:19Araq? did you test it?
13:59:53CodeVanceI'll have to compile nim devel to test it out
14:00:14Araqyeah well, expect immediate crashes
14:01:07nasusiroAraq: is there a possibility that the verbosity delays the compilation? If I use --verbosity:0 it compiles extremely fast.
14:03:28Araqunlikely
14:05:49CodeVanceAre concepts still in development?
14:06:09CodeVanceFor me they seem to be working well
14:06:39Araqstill in development but part of v1 now
14:06:51Araqand recently have received plenty of fixes
14:07:03shashlickaraq: i've been posting full stack traces on crash reports, is that useful for your debugging?
14:07:31Araqnot all that much, sorry, the first thing I do is to run 'koch temp c test'
14:07:53nasusiroI wanted to ask: what does koch mean, as a name I mean?
14:08:34Araqbut tbh ... I'm not fixing bugs. I'm reviewing bugfixes.
14:08:48CodeVanceis the difference between `of` and `is` that one works during compile time and the other at runtime? It's not mentioned in the system.nim file
14:08:52FromGitter<mratsim> koch is cook in German
14:08:56Araqso announce your tool on the forum, shashlick
14:09:10CodeVancenasusiro koch == chef
14:09:12FromGitter<mratsim> of is for inherited types
14:09:27Yardaniconasusiro, it's in the docs :) https://github.com/nim-lang/Nim/blob/devel/doc/koch.rst
14:09:32Araqof == instanceof
14:09:35FromGitter<mratsim> is is the canonical type matcher
14:09:38Yardanicohttps://nim-lang.org/docs/koch.html
14:09:42shashlickaraq: okay, cause I run nim_temp to generate those traces but they are so long and I wonder if they really help in any way
14:09:49Araqis == "is of type"
14:10:22nasusiroAraq: Ah nice! :)
14:11:23*miran joined #nim
14:14:06*gibril quit (Quit: leaving)
14:15:26*gibril joined #nim
14:16:47*bevo joined #nim
14:19:52skrylarmratsim: bistro level.. yes, i would like cream with my compile cache.
14:23:35*ieatnerds quit (Ping timeout: 260 seconds)
14:26:41Araqthere is no cow level.
14:35:15*sz0 joined #nim
14:52:31Araqwow, case statments support {.linearScanEnd.} as another optimization
14:56:49nasusiroAraq: how much of improvement are we talking about?
14:58:44CodeVancedepends on your application
15:00:31*endragor quit (Remote host closed the connection)
15:03:23*fvs left #nim ("ERC (IRC client for Emacs 25.3.1)")
15:03:35*fjvallarino quit (Remote host closed the connection)
15:03:41*fjvallarino joined #nim
15:11:01FromGitter<reisub0> Hi all. I've a small issue that's driving me nuts, regarding the AsyncHttpClient
15:11:13*nsf quit (Quit: WeeChat 2.1)
15:11:59FromGitter<reisub0> I'm basically trying to make an async HTTP Get request but the request itself has a multipart data string
15:12:28FromGitter<reisub0> There is no such proc that matches what I require in the getContent or get procs
15:13:42Yardanico@reisub0 are you sure you want to send MULTIPART with GET ?
15:14:14FromGitter<reisub0> The API I'm using seems to require it
15:14:41FromGitter<reisub0> curl -s http://localhost:3000/list -X GET -d'type=task'
15:14:44FromGitter<reisub0> Equivalent curl
15:14:55FromGitter<reisub0> I understood it to be equivalent to a multipart
15:15:00FromGitter<reisub0> Or was I mistaken?
15:15:27Yardanico@reisub0 this is not multipart, is it?
15:15:31Yardanicothis is just normal data
15:15:45FromGitter<reisub0> Ah whoops
15:15:59FromGitter<reisub0> The function arguments do seem to call it multipart
15:16:52Yardanico"(HTTP) Sends the specified data in a POST request to the HTTP server, in the same way that a browser does when a user has filled in an HTML form and presses the submit button."
15:17:21Yardanicoyou can probably use "request" proc
15:17:25FromGitter<reisub0> Wouldn't the added -XGET make it a get request?
15:17:27Yardanicoit has a body argument
15:17:42FromGitter<reisub0> Yeah, so I have to manually insert a=b in the body and add a crlf?
15:17:56Yardanicoidk if you would need to add crlf by yourself
15:18:16FromGitter<reisub0> Yeah, I'll check it out
15:18:21FromGitter<reisub0> Thanks!
15:18:28Yardanicobut really this api is bad if it requires you to use get requests with data in them
15:18:57FromGitter<reisub0> Yeah, it is
15:21:23FromGitter<kaushalmodi> Can someone write a nice blog post on the use of => and -> from futures?
15:21:27FromGitter<kaushalmodi> and also [] and lc?
15:21:44Yardanicowell, docs explain them pretty much
15:21:59Yardanicolc is for list comprehension (like in python), but you need to specify types
15:22:34Yardanicoand there are examples for -> and =>
15:22:39Yardanico(for lc too)
15:22:54FromGitter<kaushalmodi> I cannot grasp the example in https://nim-lang.org/docs/future.html#=%3E.m,untyped,untyped
15:23:01Yardanicowhy?
15:23:25FromGitter<kaushalmodi> What's the relationship between -> and f in that example?
15:23:38FromGitter<kaushalmodi> And how does that link with the use of => in the next line?
15:23:45Yardanicowell, this example just uses -> and => at the same time
15:23:54Yardanico-> is for proc types, => is for lambdas
15:25:00Yardanicoline with => is the same as "echo passTwoAndTwo(proc (x, y: int): int = x + y)"
15:25:27Yardanicoand proc passTwoAndTwo(f: (int, int) -> int): int = is the same as proc passTwoAndTwo(f: proc (x, y: int): int): int =
15:25:58*fjvallarino quit (Remote host closed the connection)
15:26:26*fjvallarino joined #nim
15:26:49miranregarding `lc` - the current syntax is IMO clumsy, so while i prefer list comprehensions in python, i use `map` in nim
15:26:52FromGitter<kaushalmodi> Yardanico: Thanks. It's still not clear.. But let me play around with those for a bit. I'll get back if I have questions
15:27:07Yardanicomiran, maybe use mapIt instead?
15:27:34miranYardanico: yeah, mapIt is nice, i'm using it also
15:27:56Yardanicoand if you do a lot of mapIt filterIt etc and need performance you would use zero_functional module
15:28:18miranYardanico: i use that too :) very nice library!!
15:28:24miran@kaushalmodi: start with `=>`
15:28:47FromGitter<reisub0> Hello and I'm sorry if my question is missing something very basic but, I seem to have encountered another issue ⏎ ⏎ Trying to compile my very basic function ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b3b962ff166440661162722]
15:28:49miranthe problem with the example in the docs is that it unnecessary uses both -> and => at the same time
15:29:03FromGitter<kaushalmodi> I am trying to convert this in emacs lisp to =>: ⏎ ⏎ ```(let ((plus1 (lambda (x) ⏎ (+ x 1)))) ⏎ (funcall plus1 1))``` [https://gitter.im/nim-lang/Nim?at=5b3b963f7e23133ecb2e3ac7]
15:30:50*fjvallarino quit (Ping timeout: 260 seconds)
15:31:37FromGitter<Yardanico> @reisub0 did you forget to create "body" variable?
15:32:17miran@kaushalmodi this is the simplest example of `=>` i could make from the top of my head: http://ix.io/1fSS/
15:32:17FromGitter<reisub0> No it's been created with `let body="type=task"`
15:32:20FromGitter<Araq> use import, not include
15:32:34FromGitter<Araq> AsyncHttpClient is probably some other type you introduced on your own
15:33:03FromGitter<reisub0> I am using import
15:33:03*ieatnerds joined #nim
15:33:09FromGitter<kaushalmodi> miran: Thanks!
15:33:14FromGitter<reisub0> And this code is only literally one file
15:33:28FromGitter<Yardanico> @rtei
15:33:44FromGitter<Yardanico> @reisub0 can you post full code on gist if you can?
15:33:56FromGitter<Yardanico> also what is your nim version?
15:34:30FromGitter<Yardanico> with this code I get another error (which is because .body from asyncresponse is a future and you need to "await" for it) ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b3b978533b0282df4fcb39f]
15:35:39FromGitter<Yardanico> @Araq btw, with code: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ Is this normal? "body: None" [https://gitter.im/nim-lang/Nim?at=5b3b97cb70efc60660a9b500]
15:37:18FromGitter<kaushalmodi> hmm.. future is renamed to sugar on devel?
15:37:22FromGitter<Yardanico> yes it is
15:37:23miranyup
15:38:33FromGitter<Araq> <AsyncHttpClient, url: string, body: None> is the problem
15:38:44FromGitter<Araq> plus some wrong compiler error message :-)
15:41:26FromGitter<reisub0> Are these optional parameters or are they all compulsory?
15:41:33FromGitter<reisub0> I did manage to get it to compile on this gist
15:41:41FromGitter<reisub0> https://gist.github.com/5bc3c481ecf5468064ec171e95f46d6b
15:42:27Yardanico@reisub0 if a proc has argument like "someName = someValue" then it's optional
15:42:54shashlickAraq: just posted about tissue on the forum - https://forum.nim-lang.org/t/4008
15:44:03FromGitter<reisub0> @Yardanico Well, that doesn't make any sense because, then, it should have matched the proc prototype?
15:47:28FromGitter<kaushalmodi> this obviously doesn't work: ⏎ ⏎ ```import sugar ⏎ echo 1.(x => x + 1)``` ⏎ ⏎ what's the correct syntax? [https://gitter.im/nim-lang/Nim?at=5b3b9a90a99e1e52b712afbf]
15:47:45miranyou're missing `map`
15:47:57miranoops, no
15:48:11FromGitter<kaushalmodi> yeah, I am not dealing with arrays/seqs
15:48:15Yardanico@kaushalmodi I don't think you can use anonymous procs with => from sugar module like this
15:48:21Yardanicobut I might be wrong, I don't use it myself
15:48:48FromGitter<kaushalmodi> I am trying to *map* this in lisp: ⏎ ⏎ ```(let ((plus1 (lambda (x) ⏎ (+ x 1)))) ⏎ (funcall plus1 1))``` ⏎ ⏎ to `=>`. [https://gitter.im/nim-lang/Nim?at=5b3b9ae07e23133ecb2e4954]
15:50:28FromGitter<Araq> shashlick: omg, it's slick :-)
15:50:50FromGitter<Yardanico> @kaushalmodi you can use `echo (proc (x: int): int = x + 1)(1)` for this
15:50:55FromGitter<Yardanico> idk about =>
15:51:46FromGitter<kaushalmodi> @Yardanico Yes, anon procs work.. I was just trying to learn the use of =>
15:51:59shashlickaraq: curious on our feedback, happy to add any features that help speed up this routine work
15:52:22FromGitter<Yardanico> well, it's probably used (as you might have guessed by the examples) to pass anonymous procs to other procedures in-line
15:52:49FromGitter<Yardanico> because nim can't infer type of arguments/return value without that
15:52:56FromGitter<Yardanico> (I think)
15:53:07FromGitter<Araq> karax uses => in one of its examples fwiw
15:53:42FromGitter<Yardanico> https://github.com/pragmagic/karax/blob/fb604321f3db185fa21ea04ac56a42fa740d59aa/examples/buttonlambda.nim#L8
15:53:59FromGitter<mratsim> @kaushalmodi this is the proper syntax: ⏎ ⏎ ```import sugar ⏎ echo (x => x + 1)(1)``` ⏎ ⏎ But you can’t use it because as Yardanico said, Nim cannot infer types here. [https://gitter.im/nim-lang/Nim?at=5b3b9c1760c38707835a3a2b]
15:58:26FromGitter<mratsim> @kaushalmodi you can check some usage here: https://github.com/mratsim/nim-projecteuler/blob/04df31f1a283ebf74c39e6f72a47e46001041619/src/lib/primes.nim#L93 ⏎ ⏎ https://github.com/mratsim/nim-projecteuler/blob/09c6bf59d974b530e0a4a2b64aa1ce263214d0f9/src/pe008_largest_product_in_a_series.nim#L77 ⏎ ⏎ https://github.com/mratsim/nim-projecteuler/blob/09c6bf59d974b530e0a4a2b6
15:58:26FromGitter... 4aa1ce263214d0f9/src/pe002_even_fibonacci_numbers.nim#L15 [https://gitter.im/nim-lang/Nim?at=5b3b9d2281816669a42cff18]
15:58:44FromGitter<mratsim> (last link is the simplest)
16:01:07FromGitter<kaushalmodi> ok.. finally got this working.. the syntax looks very non-intuitive
16:01:11FromGitter<kaushalmodi> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b3b9dc789db5e701c9e7af8]
16:01:16*fjvallarino joined #nim
16:01:28FromGitter<kaushalmodi> *see the order in which things should be defined.. 1.. 3.. 2*
16:01:42FromGitter<Yardanico> well, but it's still usefuk
16:01:53FromGitter<Yardanico> *useful :D
16:02:05FromGitter<narimiran> ...and now you can practice using `->` on the same example ;)
16:02:25FromGitter<mratsim> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b3b9e113d8f71623d593298]
16:02:29FromGitter<mratsim> better? ;)
16:02:45FromGitter<narimiran> spoiler alert! :D
16:02:48FromGitter<kaushalmodi> @narimiran Yes, that part is easy now
16:02:54FromGitter<kaushalmodi> @mratsim yep :)
16:03:03FromGitter<kaushalmodi> but that jumbled order still bugs me
16:03:30FromGitter<mratsim> uh no, you need to define the proc then call it
16:03:33FromGitter<kaushalmodi> it's like you define a proc with the types and input value, but then you pass the proc definition when you actually call it
16:03:55FromGitter<narimiran> why jumbled? you can use this example now not only for plusOne, but for any other `int -> int` function
16:03:59FromGitter<mratsim> fn is not the actual proc though, it’s a stub
16:04:04FromGitter<mratsim> it’s instantiated at call site
16:04:43FromGitter<kaushalmodi> @mratsim hmm.. "but for any other int -> int function" makes sense
16:04:45FromGitter<mratsim> define the higher order function —> define it’s body —> call it with a function as parameter
16:04:49FromGitter<kaushalmodi> thanks
16:04:50FromGitter<narimiran> maybe it would be clearer if you didn't call it `plus1`, but `use2`
16:05:03FromGitter<kaushalmodi> @narimiran yeah.. I was translating directly from that elisp snippet
16:05:35FromGitter<kaushalmodi> but..
16:05:47FromGitter<kaushalmodi> still the input arg gets hardcoded in that `use2` wrapper
16:06:46FromGitter<mratsim> @kaushalmodi ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b3b9f167e23133ecb2e55b8]
16:07:01FromGitter<kaushalmodi> ok.. this is better: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b3b9f259b82c6701b9f2d13]
16:07:08FromGitter<kaushalmodi> hehe
16:09:35FromGitter<narimiran> yes, that is better :)
16:13:15Yardanico@Araq are there any examples on how to use --gc:regions? Because person in Telegram tells that he just added --gc:regions and he can use GCd code on esp8266
16:14:09*ieatnerds quit (Ping timeout: 264 seconds)
16:19:26endes[m]https://gitlab.com/NetaLabTek/Arduimesp
16:20:42*donlzx quit (Remote host closed the connection)
16:27:07FromGitter<rayman22201> Damn that is cool!
16:32:11FromGitter<kaushalmodi> @mratsim @narimiran Building up that example to one more complication level..
16:32:15FromGitter<kaushalmodi> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b3ba50f63042f2df35308bc]
16:32:29FromGitter<kaushalmodi> Is that a way to not hard-code the fn type to deal with ints?
16:37:33FromGitter<narimiran> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b3ba64d63042f2df3530ad7]
16:38:30FromGitter<narimiran> notice the change in the order of parameters
16:38:38FromGitter<kaushalmodi> yeah.. was going to ask that
16:38:46FromGitter<kaushalmodi> I had the opposite order.. didn't work
16:39:34FromGitter<kaushalmodi> @narimiran 👍 Works! Thanks.
16:40:01FromGitter<narimiran> i think the type is inferred from the first parameter, so it has to be something with the known type - anonymous function isn't
16:43:27*sz0 quit (Quit: Connection closed for inactivity)
16:50:58FromGitter<kaushalmodi> Here's the result of all that Q&A: https://scripter.co/notes/nim/#lambda. Thanks @narimiran and @mratsim for your help!
16:51:51FromGitter<Varriount> dom96: Where did you here that?
16:52:03FromGitter<Varriount> (Regarding Python and `:=`)
16:52:11FromGitter<narimiran> thanks for the mention @kaushalmodi! it's these small things that make me happy :)
16:52:19dom96https://news.ycombinator.com/item?id=17448439
16:53:22Yardanico@kaushalmodi but don't forget that you don't need => for lambda
16:53:50Yardanicooh I see
16:53:57FromGitter<kaushalmodi> Yardanico:.. yes :)
16:54:04FromGitter<kaushalmodi> the last line
16:54:12Yardanicoanonymous procedures = lambdas, right?
16:54:13*ieatnerds joined #nim
16:54:32FromGitter<kaushalmodi> yes
16:55:18FromGitter<kaushalmodi> I just chose to hyperlink the => with #lambda and the other with #anonymous-procedures as the latter is the "official name" from Nim Manual
16:56:36dom96makes sense :)
16:58:16*noonien quit (Quit: Connection closed for inactivity)
17:01:05FromGitter<narimiran> @kaushalmodi the example after the line "Here are few more examples of using => and ->:" won't work for some general type T
17:01:16FromGitter<narimiran> because of the signature of anonymous proc
17:02:17FromGitter<kaushalmodi> @narimiran You are right.. they are remnants of me trying to make generics work..
17:02:29FromGitter<kaushalmodi> I will remove generics from those two int, flt examples
17:02:30FromGitter<kaushalmodi> thanks
17:07:28FromGitter<narimiran> no problem :)
17:08:43FromGitter<narimiran> btw, if you'll extend your list comprehension part - try to compare the syntax with map(It) for the same examples, to see what is clearer/nicer to you
17:09:20*ieatnerds quit (Ping timeout: 276 seconds)
17:09:48FromGitter<kaushalmodi> I've now updated https://scripter.co/notes/nim/#proc-type-sugar with one minor addition: `echo twoInpOneOut("abc", "def", (x, y) => x & y)` :)
17:09:51FromGitter<kaushalmodi> this is awesome!
17:10:10FromGitter<kaushalmodi> About `lc`.. I will take up analysis of that at a later point.
17:10:25FromGitter<kaushalmodi> Once done, I'll remove that todo tag
17:11:14*HYP3RBOR3A joined #nim
17:11:52*ieatnerds joined #nim
17:12:47FromGitter<narimiran> now is awesome, half an hour ago it was jumbled :D :D :D
17:13:25*Trustable joined #nim
17:14:06FromGitter<kaushalmodi> yes.. basically needed to grasp that the lambda has to be wrapped with fn type
17:14:24Yardanicolambda = anonymous procedure, remember! :P
17:14:45FromGitter<kaushalmodi> yes, yes.. I mean `=>` :)
17:20:01FromGitter<kaushalmodi> basically, anonymous procedures (or do notation) = fn signature + `=>` syntax
17:21:12FromGitter<kaushalmodi> if the fn signature doesn't need specifying, like in @narimiran's `map` + `=>` example, you can use the concise `=>` syntax to replace the more verbose anon proc/do
17:30:33*Trustable quit (Remote host closed the connection)
17:58:41*fjvallarino quit (Remote host closed the connection)
17:58:48*fjvallarino joined #nim
18:15:29FromGitter<kaushalmodi> OK, I couldn't resist, here are the list comprehension notes: https://scripter.co/notes/nim/#list-comprehension. Does it make it easier to understand the `lc[ .. ]` syntax?
18:15:51FromGitter<Araq> the lc syntax should go away IMO
18:16:43ashleyk_are nim coders called nimbos
18:19:04FromGitter<kaushalmodi> @Araq I am not too attached to list comprehension.. just feels like something to have in the toolbox, just in case.
18:19:17FromGitter<narimiran> @Araq +1 for lc going away
18:41:46FromGitter<narimiran> @kaushalmodi the last example is IMO the only one showing the advantages of `lc` over `map`/`filter`
18:42:56FromGitter<Grabli66> Hi! Why my simple program with echo socket server eats 40Mb of memory?
18:45:15krux02is someone here using gdb to debug Nim?
18:45:19FromGitter<narimiran> @Grabli66 is it compiled with `-d:release`?
18:45:29FromGitter<Grabli66> Yes
18:45:45krux02cool
18:46:08krux02I am working on something that might be of interest to you
18:46:18FromGitter<narimiran> krux02: i think that was the answer to my question, not yours ;)
18:46:32krux02well yea
18:46:47krux02then are you using gdb?
18:47:13FromGitter<narimiran> nope, i don't write bugs :P
18:50:02FromGitter<Grabli66> It's sad. It eats more than java :)
18:50:06krux02narimiran, debuggers are not just there to find bugs, but also to make code execution explorable
18:50:20krux02meaning debuggers can greatly help to understand a non buggy system
18:50:56krux02Grabli66: have you tried using a memory profiler?
18:51:13krux02normally you can profile where most of your memory is used up
18:52:08krux02but be happy that it is not pythen. There a simple applet that does nothing more than listening to key presses to open a drop down terminal eats 50MB
18:52:38FromGitter<narimiran> krux02: i know, i'm just not at that level of knowledge (yet) to benefit from gdb
18:53:05FromGitter<Grabli66> krux02, how i can profile memory of nim program?
18:53:07krux02narimiran, you will only get to that level of knowledge when you actually actively use it.
18:53:41krux02well I don't think there are any nim specific programs. there are just programs written to profile C and C++
18:53:44krux02valgrind
18:53:58krux02(if I remember correctly)
18:54:19*nasusiro quit (Quit: Quitting for now...)
18:55:01FromGitter<narimiran> yeah, it is on my to-do list, i'll try to learn and use it once i catch some time to do it....
18:55:53krux02I just learned gdb
18:56:14krux02because I improved the gdb pretty printers
18:56:58krux02they are pretty neat right now. I can print strings tables sets hash-sets enums
18:57:35krux02the conf object in the nim compiler that is passed around everywhere is completely explorable
18:58:20krux02but the integration in other tools such as gdbgui doesn't work that nicely
19:13:40FromGitter<Araq> oh? how to get this gdb pretty printing?
19:17:57*miran_ joined #nim
19:18:04*ashleyk_ is now known as ashleyk
19:18:10*miran quit (Ping timeout: 260 seconds)
19:27:29*lompik quit (Ping timeout: 248 seconds)
19:33:37dom96Grabli66: what's your code?
19:33:53dom96ashleyk: nimians or nimmers
19:34:42ashleyknimphiles ?
19:35:17ashleykheh
19:35:19FromGitter<Grabli66> Simple echo server on async socket.
19:36:05dom96Grabli66: That doesn't help me help you
19:38:11FromGitter<Grabli66> I am writing from a phone. I can show code only tomorrow.
19:38:34*Vladar quit (Quit: Leaving)
19:40:07FromGitter<Grabli66> I am tried to use memory profiler. But did not find anything strange.
19:42:27krux02Araq: since when are you on gitter?
19:42:48krux02well I currently develop gdb pretty printing on a branch of Nim
19:43:03FromGitter<Araq> I'm trying to abandon LimeChat as it keeps reconnecting, annoying me
19:43:14FromGitter<Araq> so I'm on gitter when I'm on OSX
19:43:46krux02I deprecated OSX
19:43:51dom96Araq: Get XChat Azure
19:43:59krux02but here is the nim pretty printer https://github.com/krux02/Nim/blob/macro-in-generic-type/nim-gdb.py
19:45:11krux02all you need to do to get them working is "source nim-gdb.py"
19:45:33krux02I don't know how to automatically load nim-gdb.py when a python program is started
19:46:05krux02I found out a way on Linux, where I can embed the python script in a section of the binary.
19:46:38krux02but even then you still need to enable the path of the binary for gdb to allow these pretty printers to be loaded automatically.
19:47:27krux02and then debugging from the command line gdb works pretty nice
19:47:33krux02print conf
19:47:44krux02print conf.searchPaths
19:51:13shashlickother than DMs, my irc <-> slack matterbridge is working well
19:57:23*nsf joined #nim
20:08:52*mike_oalian joined #nim
20:12:19FromGitter<metasyn> is anyone involved with apache arrow + nim ?
20:12:28FromGitter<metasyn> was just googling a bit and didn't see anything
20:18:58FromGitter<rayman22201> @Araq and @dom96: what would it take to get one of you guys to make a video / twitch stream / write up a walk through of the compiler internals? People love that kind of stuff and it's definitely the hip thing to do. I want to see how the sausage is made.
20:19:36dom96rayman22201: there already are twitch streams that we've done
20:20:04dom96https://nim-lang.org/blog/2017/12/28/nim-in-2017-a-short-recap.html
20:20:08dom96see bottom of article
20:21:49FromGitter<Araq> @rayman22201 yeah, I should do this again.
20:22:00FromGitter<Araq> this week. any preferences?
20:22:03FromGitter<rayman22201> Ah, sweet!
20:22:15FromGitter<rayman22201> I need to catch up on those old videos to see what I missed
20:26:56krux02I somehow didn't get those videos
20:27:14krux02meybe they need some more presence on the nim website
20:27:27krux02I just started a video
20:56:09*ieatnerds quit (Ping timeout: 264 seconds)
21:01:33FromGitter<Quelklef> anyone know if I'm allowed to swear in my PRs...?
21:08:43FromGitter<kayabaNerve> @Quelklef No. We are a good Christian Git Repository <3
21:08:49FromGitter<kayabaNerve> :P
21:09:03FromGitter<Quelklef> we'll see what the code reviewers say...
21:12:06dom96Quelklef: why do you feel the need to swear?
21:12:47FromGitter<Quelklef> i'm angry at css
21:13:16FromGitter<Quelklef> lowering the font size of a contained `span` caused the parent `span` to bulge. What???
21:13:18FromGitter<kayabaNerve> Some dude named dom really messed up the progression of a lib with the 18.1 update...
21:13:19FromGitter<kaushalmodi> heh
21:13:50FromGitter<kaushalmodi> @Quelklef I am no expert at CSS, but can provide some help
21:13:56FromGitter<kaushalmodi> probably em vs rem?
21:14:29dom96oh, swearing at CSS is fine :P
21:14:39FromGitter<Quelklef> lol @dom96
21:14:56FromGitter<Quelklef> @kaushalmodi contained `span` was `0.8em`. should be fine, no?
21:15:27FromGitter<kaushalmodi> yeah.. using em instead of rem is a good practise for font sizing
21:15:29FromGitter<Quelklef> container is `font-size: 15px`
21:15:35FromGitter<kaushalmodi> em size is relative to the parent
21:15:56FromGitter<Quelklef> right
21:16:33FromGitter<kaushalmodi> if container is 15px (hope that this container is the body), and span is 0.8em, then that span should be 12px.
21:16:55FromGitter<kaushalmodi> the only place where I specify size in px is in body.. everywhere else is in em
21:18:09FromGitter<Quelklef> i mean yeah the font gets smaller but then makes the container bulge
21:18:27FromGitter<kayabaNerve> Just remove the CSS
21:19:02FromGitter<Quelklef> oh damn
21:19:12FromGitter<kayabaNerve> ez
21:20:26FromGitter<kaushalmodi> hmm.. difficult to tell anything without looking at the code
21:20:39FromGitter<kaushalmodi> even then, it could be difficult; this is CSS :P
21:21:38FromGitter<Quelklef> i can try and isolate the problem
21:21:45FromGitter<Quelklef> but at this point ive just settled for `1em`
21:22:23FromGitter<kaushalmodi> unless some other rule is changing that span's font size.. removing the font-size rule should default to 1em
21:22:49FromGitter<Quelklef> oh jesus
21:22:53FromGitter<Quelklef> I just pushed 2 commits
21:23:05FromGitter<Quelklef> can someone help me: how do I squash 3 pushed commits together
21:23:30FromGitter<Quelklef> i really need to learn git beyond clone, pull, and push...
21:23:34FromGitter<kaushalmodi> https://magit.vc Worth it even if you don't use emacs for anything else :)
21:23:43FromGitter<kaushalmodi> (above comment is serious)
21:24:53FromGitter<Quelklef> feels cheaty tho
21:26:09*miran_ quit (Ping timeout: 264 seconds)
21:26:48FromGitter<Quelklef> ayyy i did it
21:26:53FromGitter<Quelklef> stackoverflow lied to me tho
21:29:08FromGitter<Varriount> @dom96 Does choosenim have any documentation on how to checkout devel?
21:29:51FromGitter<kaushalmodi> @Quelklef Quick demo of squashing using Magit: https://i.imgur.com/tJ0kmvx.gifv
21:30:44FromGitter<Quelklef> That doesn't look all too different
21:31:07dom96Varriount: choosenim --help?
21:31:30FromGitter<Varriount> Hrm, and it doesn't appear to like my 64 bit mingw
21:32:20FromGitter<kaushalmodi> @Quelklef The key strokes for squashing were literally `ri`, `s`, `s`, `s`, `s`, .. (`ri` for interactive rebase, `s` for sqash)
21:35:11FromGitter<Quelklef> oh yeah?
21:35:24FromGitter<Quelklef> well if I just don't use git then I only need zero keystrokes
21:44:35FromGitter<krux02> @Quelklef well yea that is true. But if you use git on github. you have a service that keeps your sourcecode alvife for you, even if you forget about it for years. change computer. Move to a new home. And burn your old mess you don't want to deal with anymore. It will still be there, even if you loose all the account information.
21:45:51FromGitter<Quelklef> I keep my code in a notebook under my bed
21:46:02FromGitter<Quelklef> servers crash. papers don't
21:47:05FromGitter<Quelklef> sorry @krux02 I wasn't being serious and I thought that was clear, but maybe not :P
21:47:47krux02yea but the overhead of using git is big. It is a very valid argument
21:50:14FromGitter<Araq> @Quelklef no need to squash in a PR, we do that in the merge process
21:51:36FromGitter<Quelklef> @Araq oh! awesome
21:59:16*isene left #nim ("WeeChat 1.9.1")
22:02:52*mike_oalian quit (Quit: mike_oalian)
22:14:19*mike_oalian joined #nim
22:14:59FromGitter<Vindaar> +1 for Magit :)
22:28:41*riidom_ joined #nim
22:29:02*riidom quit (Ping timeout: 256 seconds)
22:31:25*elrood quit (Quit: Leaving)
22:33:08krux02Vindaar well rather +1 for github
22:34:12FromGitter<Vindaar> Fortunately I can like both, haha
22:34:48krux02I use magit, too
22:34:57krux02but for some reason I am not excited about it.
22:35:01krux02I just use it
22:35:32krux02it's good that it is there, but it is also again a program that only benefits the emacs people
22:37:04krux02I would really like to like emacs. But I just can't it is so horrible to use
22:37:05FromGitter<Vindaar> Well, I'm excited about it, because imo it *really* makes using git a lot more comfortable. And I agree with @kaushalmodi: simply using emacs purely to use magit would be worth it for non emacs users
22:37:18krux02but I still use it, because I don't know anything better
22:37:24FromGitter<Vindaar> although you're probably right that most people won't
22:37:37FromGitter<Vindaar> I really don't understand why you think it's horrible to use :(
22:38:21krux02worst thing of all is this automatic breaking of the window layout and this automatik random abuse of windows and displaying other content than I wint it to display
22:38:32FromGitter<kaushalmodi> krux02: Yeah, don't get it why you find it so terrible
22:38:49krux02to be honest it should work like blender
22:38:49FromGitter<kaushalmodi> Just make a list of top 5 things you don't like in it, and start fixing it in your config.
22:39:23FromGitter<kaushalmodi> krux02: The window layout "breaking" is a feature
22:39:27FromGitter<kaushalmodi> But you can take it
22:39:45FromGitter<kaushalmodi> Have a look at https://github.com/wasamasa/shackle
22:40:14krux02I know about shacke
22:40:24krux02the problem is I don't understand it
22:40:35krux02I want to turn layout breaking off
22:40:36FromGitter<kaushalmodi> Try my config: https://github.com/kaushalmodi/.emacs.d/blob/master/setup-files/setup-shackle.el
22:40:38krux02entirely
22:40:55FromGitter<kaushalmodi> But then how would `C-x 2`, `C-x 3` work?
22:41:15krux02never ever automatically bring a buffer to the forground. Never split a window.
22:41:39krux02C-x 2 etc should split
22:41:44krux02but that is manual split
22:41:56krux02it is just that emacs should automatically do split in the background
22:41:58FromGitter<kaushalmodi> shackle is syntactic sugar over the `display-buffer-alist`mechanics
22:42:18FromGitter<kaushalmodi> Your requirement seems extreme.. but should be possible
22:43:01FromGitter<kaushalmodi> Just advice the internal `display-buffer-pop-up-window` etc fns to *not* popup
22:43:30krux02my requirement isn't extreme. I just can't stand it that emacs dosn't respect that I put time and effort in splitting my windows how I like them to be split.
22:43:47krux02have you ever used blender?
22:43:48*nsf quit (Quit: WeeChat 2.1)
22:44:34FromGitter<kaushalmodi> no
22:44:53FromGitter<kaushalmodi> Another hack would be to set `split-height-threshold` and `split-width-threshold` to very high values
22:44:56krux02it is has a tiling layout as well
22:45:12krux02but it never "automatically" does a split
22:45:32FromGitter<kaushalmodi> Emacs to so much more than any single editor out there..
22:45:58FromGitter<Vindaar> well you can just set `pop-up-windows` to `nil`. Then emacs shouldn't split anything by itself anymore
22:46:04krux02yea and one of the things is breaking the layout.
22:46:21krux02and the worst part of it. The behaviour is absolutely random and unpredictable
22:46:35krux02sometimes things are displayed here, sometimes there
22:46:52FromGitter<kaushalmodi> May be it's just me, but the splits happen when I want without surprises..
22:47:05krux02sometimes when I want to switch to another buffer it changes the current buffer, somtimes it changes the buffer seen an another window
22:47:31FromGitter<kaushalmodi> Yes, there are hooks for that too
22:47:49krux02I don't want hooks. I just want to disable it all globally with one switch
22:48:16FromGitter<kaushalmodi> When you get a chance.. try out shackle
22:48:33FromGitter<kaushalmodi> I have documented all the shackle configs in comments in my linked config above
22:48:34krux02have you ever looked into `split-window-threshold'?
22:48:52FromGitter<kaushalmodi> I leave it at the default value because I want splits
22:49:01FromGitter<kaushalmodi> but you can set it to a very high value to prevent splits
22:49:02*ieatnerds joined #nim
22:49:40FromGitter<kaushalmodi> wait.. there isn't anything like *split-window-threshold*
22:49:57krux02sorry that was the wrong one
22:50:18krux02split-height-threshold
22:50:41FromGitter<kaushalmodi> yeah, I don't change those thresholds
22:51:25krux02I changed the function emacs uses to split a window to not split windows
22:51:45krux02because I wanted to disable spliting windows automatically
22:51:57krux02I did so with the thresholds
22:52:08krux02but the thresholds have this nice little details
22:52:32krux02"‘split-window-sensibly’ may split it vertically disregarding the value of this variable."
22:52:43krux02wft?
22:52:54FromDiscord<emekoi> is there a way to patch the standard library change the what the `magic` pragma points to?
22:52:57krux02why do I set this variables when emacs just may ignore it at any time?
22:53:26FromGitter<kaushalmodi> it's documented.. I would then try to make `split-window-sensibly` to not do anything
22:55:26krux02it is so much time that I lost in writing my emacs config
22:55:37krux02and all just to make emacs do less
23:00:23*mike_oalian quit (Quit: mike_oalian)
23:03:35*mike_oalian joined #nim
23:04:15*mike_oalian quit (Client Quit)
23:04:35*floppydh quit (Ping timeout: 240 seconds)
23:05:32krux02not to forget sometimes and only sometimes emacs just decides not not split the buffer but to create a new emacs frame instead
23:05:40krux02also totally random
23:05:50krux02the same command might split or crate a new frame
23:06:00krux02no predictability of the tool possible
23:07:23*floppydh joined #nim
23:09:57krux02and sometimes I want to display a buffon on the right Frame, but emacs just refuses to do it and always does it on the left
23:10:00krux02why
23:10:31krux02btw I am not making this up, or this is something that I remember that it happened to be once
23:10:48krux02kaushalmodi: this is happening right now
23:10:50FromGitter<kaushalmodi> krux02: Your Emacs experience has certainly been scarred. I'd suggest that you email [email protected] for help. The mailing list is very polite and helpful.
23:11:45krux02I am sometimes on #emacs on irc
23:11:56krux02they are nice and helpful
23:11:58krux02that is true
23:12:13krux02and the author of shacke is always there recommending shackle
23:12:20krux02but still I don't understand shackle
23:12:59krux02I don't install a package that I don't understand just for the hopes it could fix something where I don't know what it exactly fixes and what it might even make worse
23:13:39FromGitter<kaushalmodi> Hmm, I have never been on #emacs. But on the mailing list, the core devs like Eli and Stefan reply, which is awesome. Martin is the code dev for window buffer frame management. He is active in the help mailing list too.
23:14:32FromGitter<kaushalmodi> My shackle config I linked above is well documented (for my sake). Did you skim through it?
23:14:59*xet7 quit (Quit: Leaving)
23:16:09*ieatnerds quit (Ping timeout: 268 seconds)
23:17:24krux02kaushalmodi: I skimmed that I didn't even see that you posted it, but I am reading now
23:33:53*ieatnerds joined #nim
23:46:05FromGitter<krux02> I will check on that one later. It is too late for now but I bookmarked it.
23:49:00*donlzx joined #nim
23:50:19*mitai quit (Ping timeout: 256 seconds)
23:59:56*ieatnerds quit (Ping timeout: 268 seconds)