<< 02-10-2020 >>

00:02:52*oculux joined #nim
00:05:49*EastByte joined #nim
00:05:49*voltist joined #nim
00:05:49*silvernode[m] joined #nim
00:05:49*OMGOMG joined #nim
00:08:22*bung joined #nim
00:12:52*bung quit (Ping timeout: 256 seconds)
00:29:11FromDiscord<dayl1ght> is it possible to tell nim not to copy an object?
00:29:31disruptekwho are you people?
00:29:53FromDiscord<dayl1ght> e.g. if I have `type Person = object`, and an `array[10, Person]`, I'd like to do `let person = people[0]; person.name = "abc"`
00:30:07FromDiscord<dayl1ght> and have that mutate the people array instead of copying to a new variable
00:31:15disruptekuse a ref.
00:31:28disruptek~manual
00:31:28disbotmanual: 11the Nim Manual is https://nim-lang.org/docs/manual.html -- disruptek
00:32:37FromDiscord<dayl1ght> doesn't a ref imply a heap allocation
00:33:45disruptekuse a pointer, then.
00:34:24disrupteki don't know anyone named abc and i'm suspicious of this code.
00:34:39disruptekwhat are you making?
00:37:59FromDiscord<dayl1ght> How is that suspicious, it seems pretty standard to me
00:38:23FromDiscord<dayl1ght> I have a list of stack-allocated values and I want to mutate one of them
00:38:49disruptekuse a ptr or a template.
00:41:11FromDiscord<dayl1ght> a template?
00:41:29FromDiscord<dayl1ght> sent a code paste, see https://play.nim-lang.org/#ix=2zqC
00:41:32disruptekit's like a hygienic c macro.
00:41:34FromDiscord<dayl1ght> I basically want to this, but in nim
00:41:36FromDiscord<dayl1ght> to do*
00:42:11FromDiscord<dayl1ght> do you mean a template that takes the addr, mutates that and then returns it?
00:42:37disruptektemplate person: Person = people[0] ... person.name = "cher"
00:43:07FromDiscord<dayl1ght> ah interesting, I didn't know you could have templates inline like that
00:43:14FromDiscord<dayl1ght> thanks, that should work
00:46:01FromDiscord<dayl1ght> tbh this seems like a very standard usecase, I'm surprised templates are the best way to do this
00:46:38disruptekwell, they are free and they work well to remove [0] from people's code that for some reason needs to remove [0].
00:46:53FromDiscord<dayl1ght> e.g. if I have a bunch of assignments to fields of `someVariable.anotherVariable.yetAnotherVariable`, it's common to save `someVariable.anotherVariable.yetAnotherVariable` to a local and keep assigning that
00:47:12FromDiscord<dayl1ght> I don't need to remove [0], I need nim not to copy the value
00:47:25FromDiscord<Elegant Beef> yea you can do↡`let a = person[0].unsafeaddr`
00:47:54disruptekuse a ptr if you really want to add a variable to your program.
00:48:03FromDiscord<Elegant Beef> As was said you can do it with pointers **or** templates
00:48:45disruptekit's hard to help when the actual goal is secret.
00:49:01disruptekbut beef'll keep tryin'.
00:49:12FromDiscord<exelotl> @dayl1ght there's a {.byaddr.} pragma coming soon that does exactly what you want: https://github.com/nim-lang/Nim/pull/13508
00:49:13disbotβž₯ new syntax for lvalue references: `var b {.byaddr.} = expr` ; snippet at 12https://play.nim-lang.org/#ix=2mVU
00:49:15FromDiscord<dayl1ght> eh the goal is basically what I said
00:49:16FromDiscord<Elegant Beef> Hey i know nothing, i just spew bullshit πŸ˜„
00:49:21FromDiscord<dayl1ght> sent a code paste, see https://play.nim-lang.org/#ix=2zqF
00:49:34FromDiscord<dayl1ght> I don't want to have to keep repeating self.frames multiple times
00:49:52disrupteki prefer templates because they are free.
00:50:16FromDiscord<Elegant Beef> You're free
00:50:22disruptekthe semantics can be a little less... firm, though. just like me.
00:51:02FromDiscord<dayl1ght> @exelotl yeah that looks exactly like what I want
00:52:41FromDiscord<exelotl> in your code above you should be able to use `addr` instead of `unsafeAddr` because the thing that you're taking the address of is mutable, being a `var` parameter
00:53:02FromDiscord<exelotl> templates are a decent solution too I guess. You might be lucky and find that the C compiler is able to optimise the repeated expansion
00:53:11FromDiscord<Elegant Beef> The only reason i said unsafeaddr was it said `let` earlier
00:54:10FromDiscord<exelotl> another fun solution I found to this problem is using an iterator that yields a `var` result:↡https://gist.github.com/exelotl/ef2507c58b4f81c74a197f99c56b9bd5
00:54:43FromDiscord<Yardanico> hacktioberfest did an update against spammy people https://hacktoberfest.digitalocean.com/hacktoberfest-update
00:54:55FromDiscord<Yardanico> " As of 2pm PST on October 1, at least 4% of pull requests from Hacktoberfest participants have been marked β€˜invalid’ or β€˜spam.’"
00:55:05FromDiscord<dayl1ght> thanks, I'll try pointers first and if it's too cumbersome I'll use a template
00:58:21*abm quit (Read error: Connection reset by peer)
01:23:13*arecacea1 quit (Remote host closed the connection)
01:23:36*arecacea1 joined #nim
01:36:35*Tanger joined #nim
01:47:07*apahl quit (Ping timeout: 240 seconds)
01:49:22*apahl joined #nim
02:09:15*bung joined #nim
02:13:27*bung quit (Ping timeout: 240 seconds)
02:30:49*bung joined #nim
02:36:20PrestigeNoob template question, is it possible/how do I do this? https://play.nim-lang.org/#ix=2zqT
02:40:42Prestigejust found https://forum.nim-lang.org/t/3342
02:56:47*muffindrake quit (Ping timeout: 240 seconds)
02:59:08*muffindrake joined #nim
02:59:40FromDiscord<Elegant Beef> So did you find your answer?
02:59:58PrestigeI suppose what Araq posted is the best solution for now
03:00:16PrestigeAlthough I wish I could use : as a proc name :P
03:15:01*waleee-cl quit (Quit: Connection closed for inactivity)
03:21:09*EastByte quit (*.net *.split)
03:21:09*voltist quit (*.net *.split)
03:21:09*silvernode[m] quit (*.net *.split)
03:21:09*OMGOMG quit (*.net *.split)
03:27:22*vqrs quit (Ping timeout: 260 seconds)
03:28:56*vqrs joined #nim
03:30:21*vicfred quit (Quit: Leaving)
03:38:08*vicfred joined #nim
03:49:01*EastByte joined #nim
03:49:01*voltist joined #nim
03:49:01*silvernode[m] joined #nim
03:49:01*OMGOMG joined #nim
03:49:05*apahl quit (Ping timeout: 272 seconds)
03:49:40*apahl joined #nim
04:06:02*supakeen quit (Quit: WeeChat 2.9)
04:06:37*supakeen joined #nim
04:27:45*narimiran joined #nim
04:31:54*zielmicha__ quit (Ping timeout: 256 seconds)
04:32:03*zielmicha__ joined #nim
05:18:42*solitudesf joined #nim
05:19:22*Tanger quit (Quit: Leaving)
05:24:05*gangstacat quit (Ping timeout: 272 seconds)
05:41:47*thomasross quit (Ping timeout: 240 seconds)
06:09:00*NimBot joined #nim
06:11:23*leorize quit (Ping timeout: 240 seconds)
06:12:22*letto quit (Quit: Konversation terminated!)
06:12:24FromDiscord<Yardanico> Well it's too ambiguous
06:13:21PrestigeYeah, it is. Just wish it were possible, but I decided on ||
06:14:16*letto joined #nim
06:15:19*PMunch joined #nim
06:21:25*JustASlacker joined #nim
06:26:23*JustASlacker quit (Ping timeout: 256 seconds)
06:29:04*leorize joined #nim
06:35:41PMunchleorize, hi, I see you mentioned nimlsp and semantic highlighting yesterday
06:35:57PMunchI started implementing it, but the spec is still not finalised so I put it on ice for a little while
06:36:51leorize[m]1PMunch: I thought they pushed out a formal draft as part of the next version of lsp recently?
06:37:21PMunchOh they did?
06:37:29PMunchI haven't been following the development of this
06:41:17PMunchHuh, neel looks pretty interesting
06:42:23leorize[m]1PMunch: https://github.com/microsoft/language-server-protocol/blob/gh-pages/_specifications/specification-3-16.md#textDocument_semanticTokens
06:43:52*gangstacat joined #nim
06:44:51PMunchOh cool
06:44:59PMunchMaybe it's finally time to implement this then
06:45:39PMunchIf anyone wants to help out we need a mapping from the output of Nimsuggest to the symbol kinds defined here
07:15:25PrestigeExciting stuff
07:16:54FromDiscord<Elegant Beef> I could grab markers to draw a map, i've got crayons too!
07:18:41PMunchHmm, I'm looking at docopt and trying to find a way to get proc registration to work..
07:19:20FromDiscord<Elegant Beef> This is were i say "i'm a big numpty so i can clap and pretend to help"
07:19:31PMunchI mean it returns a `Table[string, Value]` so it should be possible to create the whole register actions system separate from docopts
07:20:04PMunchProblem is that you can have sub-commands, not entirely sure how that would work
07:20:36PMunchLooking at the naval_fate example, what would the procedures look like? https://github.com/docopt/docopt.nim
07:28:45*Trustable joined #nim
07:31:47FromDiscord<pietroppeter> Prestige have a look at https://github.com/mattaylor/elvis it seems Araq's implementation taken a bit further adding truthy and falsy logic (which might not what you want)
07:35:08*Trustable quit (Remote host closed the connection)
07:41:26FromDiscord<Recruit_main707> whats the difference between nimsuggest and idetools?
07:41:35FromDiscord<Recruit_main707> is idetools outdated?
07:44:18Araqmy implementation?
07:44:29Araqof what?
07:45:29*mmohammadi9812 joined #nim
07:45:35Araqah never mind
07:48:26FromDiscord<pietroppeter> (you probably alright got it, implementation of ternary operator from a 2017 forum post: first commit in elvis repo actually references that forum post)
07:48:55PMunchSorry, the playground is down for maintenance
07:49:56FromDiscord<pietroppeter> (and I discovered today where does the name come from https://en.wikipedia.org/wiki/Elvis_operator )
07:51:08FromDiscord<Clyybber> lol, thats neat
07:51:38FromDiscord<pietroppeter> I hope it is not the PR on markdown that put playground down πŸ₯Ί
07:53:07PMunchHaha, well not only that :P
07:53:20PMunchI went to rebuild all the images, and the VPS ran out of disk space
07:53:37PMunchSo now I'm just cleaning it out and will rebuild everything
07:54:24FromDiscord<Elegant Beef> This reminds me, how do you do the tutorializing through nim playground, i know it can do guided shit, but dont recall how to set it up?
07:55:43PMunch@Elegant, this should explain it: https://github.com/PMunch/nimtours
07:58:09FromDiscord<pietroppeter> ok good, I am relieved... btw thanks a ton for the playground. I love it, it is a really great service! the thing I love most is the fact that I can code nim on the phone πŸ™‚
07:59:09PMunch@Elegant, here is the example tour from GitHub: https://play.nim-lang.org/#tour=https://raw.githubusercontent.com/PMunch/nimtours/master/example.html
08:00:01PMunch@pietroppeter, thanks :) It wasn't me who created it initially, but I have rewritten big chunks of it after I took over maintaining it
08:00:44FromDiscord<Elegant Beef> Yea it's nice
08:02:29AraqPMunch, are you removing support for older Nims?
08:02:42PMunchAraq, wasn't planning on it, why?
08:02:48*Vladar joined #nim
08:03:54Araqto save disk space
08:05:20PMunchEh, they don't really take up that much space
08:05:36PMunchThe issue is that docker isn't cleaning up properly after itself
08:07:30Araqmaybe Golang needs destructors, they make cleanups easier
08:22:37FromDiscord<Recruit_main707> the lsp repo has stalled a bit, is it still developed PMunch?
08:29:53*hnOsmium0001 quit (Quit: Connection closed for inactivity)
08:40:02AraqRuby got a rightward assignment operator :-)
08:40:13Araqfib(10) => x
08:40:49AraqI might want that for Nim too...
08:40:58Araqf(x, y) = let a
08:41:25Araqmaybe too weird though
08:41:52PMunchRecruit_main707, yeah I'm still developing it
08:41:57Araqbut it's got others finally noticed all PLs got the assignment syntax wrong
08:42:02Araq*it's good
08:42:11FromDiscord<Vindaar> or do it like R and have both `->` and `<-` both doing what one expects
08:42:12PMunchCurrently it's more in a state of maintenance, but I have plans to implement new features
08:42:25PMunchAnd you're more than welcome to help out if you like :)
08:43:23Araqand Ruby got endless method definitions
08:43:47Araqyou can never read them completely, they are endless
08:44:11FromDiscord<Varriount> Araq: While it might be philosophically correct, breaking widespread convention is rarely accepted well
08:44:16FromDiscord<Elegant Beef> What do you mean got the syntax wrong? `a = b` a is b πŸ˜„
08:44:26Araqpretty nice. Infinite code can be more maintainable in the long run
08:46:10AraqBeef: first you evaluate f(x, y) and then you store the result somewhere
08:46:58FromDiscord<Varriount> Araq: There are times where I feel like Nim is this convoluted gadget that does 20 things in 30 different ways.
08:47:46Araqthere are times where I feel like you're a troll.
08:48:45FromDiscord<Elegant Beef> Well with the let ketword it gets weird since it reads as "let 'a' equal result of proc" vs. "result of proc equals let a" although im just thinking of this more mathematically than anything else
08:49:12Araqwhat 20 things do we do in 30 different ways?
08:49:35FromDiscord<Elegant Beef> The whole "left hand is the unknown" is all i can think about when doing assignment
08:51:51FromDiscord<Varriount> Well, if I'm a troll, then I don't see how any answer I give could be considered constructive.
08:51:54*natrys joined #nim
08:52:02AraqPython: special syntax for 'if' expressions. Nim lacks it, it unified 'if' instead.
08:52:12AraqGo: special syntax for ':='. Nim lacks it
08:52:24Araqare Python and Go convoluted gadgets too then?
08:54:57PMunch@Varriount, I think he just meant that the statement is similar to what trolls normally make
08:55:03*Vladar quit (Quit: Leaving)
08:56:05AraqVarriount: I know you're not a troll but indeed I see how anything constructive can come after "20 things in 30 different ways"
08:56:14Araq* I cannot see
09:06:28PMunchHmm, how can I check if every boolean in an array is true?
09:07:30FromDiscord<Elegant Beef> Cast to N number of ints check if `int.high and cast[0]` is `int.high` then question why i responded
09:10:21PMunchHaha, so far I went with foldl from sequtils
09:16:08FromDiscord<Rika> isnt there an `allIt` template in sequtils
09:16:24PMunchOh right, there is
09:17:57PMunchHmm, `name = args[argIt].to[string]()`: Error: cannot instantiate: 'T'
09:18:22PMunch`to` is defined as: proc to[T](v: Value): T
09:23:40Araqargs[argIt].to[:string]()
09:24:01Araqmaybe :-)
09:24:55PMunchAah, that seems to work
09:27:46FromDiscord<lqdev> PMunch: `args[argIt].to[:string]()`
09:29:27FromDiscord<Rika> ar/q already said that
09:31:11*abm joined #nim
09:33:18PMunchHmm, I have a procedure and I want to iterate over its arguments. With `getImpl` it groups `x, y: int` into a single IdentDef, is there a way to get a version where it is split?
09:49:35Araqnot as far as I know
09:51:48FromDiscord<lqdev> @Rika ircord truncated it to `args[argIt].to`
09:52:02FromDiscord<Rika> no
09:52:09FromDiscord<lqdev> uh?
09:52:24FromDiscord<Rika> its `args[argIt].to:string` tho
09:52:44FromDiscord<lqdev> https://media.discordapp.net/attachments/371759389889003532/761526070155280385/Screenshot_20201002_115235.jpg
09:52:55FromDiscord<lqdev> that's what i'm seeing
09:53:04FromDiscord<Rika> https://media.discordapp.net/attachments/371759389889003532/761526146818375700/unknown.png
09:53:08FromDiscord<lqdev> wait, maybe it interpreted it as a link?
09:53:22FromDiscord<lqdev> ominous.
09:53:36FromDiscord<Rika> spooky
09:53:49FromDiscord<lqdev> it's spooktober after all
09:56:07PMunchhttp://ix.io/2zsJ what do you think about this? Should I PR it to docopt?
09:57:18PMunchSilly Discord trying to parse text :P
09:58:21FromDiscord<lqdev> @Rika ok on my PC it looks loke yours
09:58:24FromDiscord<lqdev> (edit) 'loke' => 'like'
10:01:16*krux02 joined #nim
10:04:35FromDiscord<Vindaar> @PMunch: yeah, do it! Although I fear what the reception might look like
10:06:01PMunchWhy? It doesn't change anything for current docopt usage, but allows easier calling/unpacking
10:06:08PMunchI just need to add a better failure mode
10:13:05FromDiscord<Vindaar> because as far as I remember the author wasn't willing to change the code in the past. Their opinion was that it is a straight up port of docopt. I hope I'm wrong though
10:13:26PMunchI mean this could also be implemented as a separate library
10:13:34PMunchSo if he doesn't want it I'll just make it a separate thing
10:13:57FromDiscord<Vindaar> At least personally I'd find that nice πŸ™‚ (if they don't want it)
10:16:42PMunchHmm... https://play.nim-lang.org/#ix=2zsV
10:16:55PMunch(just manually set the version and it will compile)
10:17:01PMunch(The latest tag is broken atm)
10:18:16FromDiscord<Vindaar> what do you want to use that for?
10:18:17PMunchNvm, fixed the latest tag (or rather I just set it to the latest version that was built)
10:18:43PMunch`macro dispatchProc(args: Table[string, Value], procedure: proc, conditions: static[seq[string]] = @[]): untyped`
10:18:48PMunchWell that's my actual signature
10:19:00FromDiscord<Vindaar> ah
10:19:05PMunchIf you don't supply conditions I will just turn the procedure name into a condition
10:19:49PMunchSo instead of `args.dispatchProc(myCommand, @["myCommand"])` you could just do `args.dispatchProc(myCommand)`
10:19:49FromDiscord<Vindaar> why not make it `static[varargs[string]]`?
10:20:14PMunchGuess I could
10:20:22PMunchBut that's still a weird bug
10:21:32FromDiscord<Vindaar> I guess it is. But I think I've seen something like this mentioned befor
10:31:45PMunchHmm, has discardable been removed?
10:32:32*dv-^_^61 joined #nim
10:32:35FromDiscord<lqdev> no
10:34:41PMunchThis doesn't work in my macro: http://ix.io/2zsZ
10:34:52PMunchI guess it's because that is a closure?
10:35:01*dv-^_^6 quit (Ping timeout: 264 seconds)
10:38:41FromDiscord<lqdev> probably
10:38:42FromDiscord<lqdev> wtf nimsuggest
10:38:57FromDiscord<lqdev> i just saw my RAM usage rapidly grow to 16GiB
10:40:08FromDiscord<Vindaar> gotta buy more ram!
10:43:38FromDiscord<lqdev> is this electron?
10:44:06FromDiscord<Vindaar> nah, it's tau. Even more heavy on RAM. It's a feature!
10:45:31FromDiscord<whisperdev> Is nimsuggest the worst nim program?
10:46:05FromDiscord<Vindaar> on a serious note: no, it just has a few annoying bugs
10:46:08FromDiscord<Recruit_main707> does anyone know how to set up a lsp in komodo?
10:47:19*Vladar joined #nim
10:47:19FromDiscord<whisperdev> Why is Nim so slow with JSON? 😦
10:47:48PMunchIs it possible to create a macro that returns a block that can either return a value or not?
10:48:09PMunch@whisperdev, what do you mean?
10:48:18FromDiscord<Vindaar> PMunch: well, you can't do that normally either right? How could a macro do it then?
10:48:29FromDiscord<whisperdev> @PMunch Just checked Kostya's benchmarks
10:48:39*Trustable joined #nim
10:48:52FromDiscord<Clyybber> and nobody seems to have small reproducable examples to show the nimsuggest bugs :D
10:49:46FromDiscord<flywind> `nimsuggest` is really annoying in recently days
10:50:08PMunch@Vindaar, well you can with a {.discardable.} procedure..
10:50:32PMunch@whisperdev, link?
10:50:44FromDiscord<Vindaar> I suppose this: https://github.com/kostya/benchmarks#json
10:51:04FromDiscord<Vindaar> PMunch: oh, never considered that
10:55:50FromDiscord<lqdev> @Clyybber the problem is that nimsuggest only starts being super annoying when your project grows
10:55:59FromDiscord<lqdev> it's fine on small projects
10:56:39*mmohammadi98120 joined #nim
10:57:39FromDiscord<Rika> @whisperdev its not the language that is slow but the implementation
10:57:49FromDiscord<Rika> of json parsing or w/e
10:58:25*mmohammadi9812 quit (Ping timeout: 264 seconds)
10:58:33FromDiscord<whisperdev> @Rika The user only cares about the library that they can use to do stuff πŸ™‚
10:58:46FromDiscord<lqdev> lmao i know why it's so fucking slow
10:58:56FromDiscord<lqdev> https://github.com/kostya/benchmarks/blob/7c13e9221c4e58f95151864b5db87363a38734b2/common/commands.mk#L24
10:59:04FromDiscord<lqdev> they aren't compiling with -d:danger
10:59:08FromDiscord<lqdev> :DDDDD
10:59:19FromDiscord<whisperdev> It's interesting that serde typed is faster than simdjson
10:59:21FromDiscord<lqdev> that's an unfair comparison
10:59:25FromDiscord<Rika> well is d:danger https://github.com/kostya/benchmarks/blob/7c13e9221c4e58f95151864b5db87363a38734b2/common/commands.mk#L4
10:59:27FromDiscord<Vindaar> there's that line though: https://github.com/kostya/benchmarks/blob/7c13e9221c4e58f95151864b5db87363a38734b2/common/commands.mk#L4
10:59:28FromDiscord<Rika> oops
10:59:32FromDiscord<Rika> (edit) removed 'well is d:danger'
10:59:33FromDiscord<lqdev> oh there
10:59:37FromDiscord<lqdev> didn't see it
11:00:07FromDiscord<Rika> its interesting that they separated nim flags but not rust flags or others
11:00:12*mmohammadi9812 joined #nim
11:00:12FromDiscord<Rika> wonder why they did so
11:00:31FromDiscord<whisperdev> I think Yardanico committed the packedjson and danger/arc
11:00:47FromDiscord<lqdev> idk why there's an extra --opt:speed in the nim flags
11:00:54FromDiscord<lqdev> -d:danger implies that
11:01:20FromDiscord<whisperdev> because people dont know...too many flags πŸ˜„
11:01:31FromDiscord<lqdev> regardless, i do agree it's quite slow.
11:01:45FromDiscord<lqdev> right now i'm using std/json to parse tiled tilemaps
11:01:51FromDiscord<Rika> ar/q explained why its slow a lot of times in this channel
11:01:55FromDiscord<lqdev> hopefully it won't become too much of a bottleneck
11:02:08FromDiscord<lqdev> @Rika link?
11:02:12FromDiscord<lqdev> or quote
11:02:23*mmohammadi98120 quit (Ping timeout: 265 seconds)
11:02:24FromDiscord<Rika> no idea, its been a long time already
11:02:30planetis[m]there is https://github.com/OpenSystemsLab/jsmn.nim but haven't used it
11:02:32FromDiscord<Rika> but i just remember them explaining
11:03:19*mmohammadi98126 joined #nim
11:03:52FromDiscord<whisperdev> so why is it slow? araq cant code? (/s)
11:04:02planetis[m]...and the accompanying https://github.com/OpenSystemsLab/sam.nim
11:05:06*abm quit (Ping timeout: 256 seconds)
11:05:34*mmohammadi9812 quit (Ping timeout: 272 seconds)
11:08:14*mmohammadi98126 quit (Ping timeout: 260 seconds)
11:10:46PMunchHmm, it's not pretty, but it works.. http://ix.io/2ztb
11:11:33FromDiscord<lqdev> PMunch: making an RTS?
11:11:47*waleee-cl joined #nim
11:16:24PMunchHaha, no the stuff there is just the example from docopt
11:16:45Araqit's slow because it also has to work at compile-time
11:16:49*abm joined #nim
11:17:21Araqand nobody optimized it to use SSE, started to work on it but then got distracted
11:18:02Araqif you need speed, use a binary format, you also avoid the clusterfuck of imprecise floating point parsing this way
11:20:46FromDiscord<lqdev> good idea
11:20:57FromDiscord<lqdev> but tiled doesn't have a binary export format :(
11:21:03FromDiscord<lqdev> maybe i can create a converter script though
11:27:53*a_b_m joined #nim
11:29:48PMunchhttp://ix.io/2zto/nim
11:29:53PMunchI think I'm happy with this now
11:31:24*abm quit (Ping timeout: 256 seconds)
11:38:17*a__b__m joined #nim
11:41:17*a_b_m quit (Ping timeout: 246 seconds)
11:41:17*bung quit (Ping timeout: 246 seconds)
12:02:22PMunchIf you guys want to show support -> https://github.com/docopt/docopt.nim/pull/51
12:02:22disbotβž₯ Add procedure dispatch module
12:06:02*supakeen quit (Quit: WeeChat 2.9)
12:06:35*supakeen joined #nim
12:12:03*bung joined #nim
12:16:35*bung quit (Ping timeout: 260 seconds)
12:17:47*gangstacat quit (Ping timeout: 240 seconds)
12:22:02Araq1.4 is finished, I think
12:22:17Araqno showstopper bugs left
12:22:30FromDiscord<lqdev> whaaat
12:22:35PMunchOoh, any cool new features?
12:23:27Araqgc:orc, strict funcs, view types
12:23:49FromDiscord<Rika> nice, congrats
12:23:54Araqbut don't expect view types to work :-)
12:23:57FromDiscord<lqdev> i guess IC is a 1.6 feature then?
12:24:02Araqyep
12:24:08FromDiscord<lqdev> also what about your new concepts RFC impl?
12:24:19Araqnew concepts are for 2021
12:24:30FromDiscord<lqdev> mmkay
12:24:44FromDiscord<lqdev> can't wait
12:25:03Araqwell you can contribute, my concepts impl is well documented
12:28:11*arecacea1 quit (Read error: Connection reset by peer)
12:28:35*arecacea1 joined #nim
12:28:38supakeenorc?
12:28:54FromDiscord<mratsim> And my axe!
12:31:43*dv-^_^619 joined #nim
12:35:30*dv-^_^61 quit (Ping timeout: 272 seconds)
12:40:58Araqnext version will be named 'Uruk'
12:44:17FromDiscord<exelotl> Is there any chance that a fix for https://github.com/nim-lang/Nim/issues/15428 could make it into 1.4 ? πŸ˜…
12:44:20disbotβž₯ Wrong codegen with openArray ; snippet at 12https://play.nim-lang.org/#ix=2zud
12:45:09Araqtried, it requires a non-trivial and hence risky refactoring
12:45:22Araqbetter done for 1.4.2
12:46:06FromDiscord<exelotl> Ah ok, that's fair :)
12:46:18Araqmratsim: I cannot reproduce
12:46:33Araqhttps://github.com/nim-lang/RFCs/issues/257
12:46:35disbotβž₯ Noinline and/or Addressable consts ; snippet at 12https://play.nim-lang.org/#ix=2zuj
12:46:49Araqthe compiler doesn't duplicate large const arrays for my toy example
12:47:19Araqit produces e.g. extern NIM_CONST tyArray__9cFSACijKI7Pz9b3NAOxFR9bw myarr__16fupmXehsHjrCLAZF0diw
12:47:30Araqwhich is exactly what you want it to generate
12:47:51Araqis your RFC about allowing 'unsafeAddr' for these?
13:12:56leorize[m]1anyone here got windows? I need someone to help me debug something with git.
13:18:30AraqI'm on Windows but busy
13:18:40Araqwhat do you want to know?
13:19:22leorizecan you clone c2nim then run: `git -C <absolute windows path to c2nim> rev-parse --show-cdup`?
13:19:33leorizeplease also run the command on `cmd.exe`
13:20:43leorize(also why do we bundle c2nim with windows release tarball?)
13:21:01Araqhistorical reasons I think
13:22:00Araqfun fact: if you compile 'of b:' ('if' misspelt) with Nim devel it takes up *all* of your RAM and dies with OOM
13:22:15Araqand OSes in 2020 cannot handle that, swap, crash and burn
13:22:29disruptekonly your os.
13:22:51AraqLinux did the same, back then when I still used Linux
13:23:04Araqbut alright
13:23:18AraqWindows in 2020 cannot handle that. ffs...
13:23:35disruptekeh i don't use swap.
13:24:00AraqI expect the swapping to work
13:24:22Prestigetemped to try it
13:24:28Prestigetempted*
13:24:32PMunchHmm, ditto
13:24:42disruptekin 1991 when i had 4mb of ram and it took all day to build the kernel, i could run navigator in x. go figure.
13:25:48PMunchOkay, playground is done rebuilding all of the images now :)
13:27:00disruptektime to crash the playground with `of`.
13:27:51Araq1.2 is fine I think
13:28:22leorizeAraq: linux got that fixed now :P they basically make the oom killer an userspace app lol
13:29:28leorizeAraq: can you help me with running that command? I need to know the output so I can figure out why nightlies is failing
13:29:54Araqmy computer is unresponsive...
13:30:02AraqI'm debugging this OOM
13:30:27leorizemove to fedora 33 for debugging oom, they got a proper oom killer there now
13:31:06Araqcan't use an OS that sounds like a hand lotion
13:32:07leorizelol
13:32:51FromDiscord<Broken insanity> hi↡how i can merge 2 lists into 1 alternating elements ?
13:33:20Araqit's ok, I use nimMaxHeap=4000 it works better, not really reliably, but better
13:35:26Araqleorize, the command produces nothing whatsoever
13:36:09leorize[m]1Araq: ok that's what it's supposed to do
13:36:16leorize[m]1then why is koch not working...
13:36:37leorize[m]1can you remove `dist/c2nim` then run `./koch c2nim`?
13:36:43PMunch@Broken try zip in sequtils
13:38:09disruptekAraq: can you think of a reason we shouldn't move mangling into a single-source-of-truth ModuleGraph structure? it solves all my problems.
13:38:37FromDiscord<Broken insanity> thanks
13:39:01Araqdisruptek, I tried to tell you for months now that the PSym.loc.r is the single source of truth as symbols are not duplicated
13:39:16disruptekbut it's meaningless for conflict resolution.
13:39:22Araq(when a symbol is duplicated it has its own identity)
13:40:41Araqkoch c2nim
13:40:41Araqdeps.cmd: git clone -q https://github.com/nim-lang/c2nim.git C:\Users\rumpf\projects\nim\dist\c2nim
13:40:43Araqdeps.cmd: git -C C:\Users\rumpf\projects\nim\dist\c2nim rev-parse --show-cdup
13:40:44AraqFAILURE: C:\Users\rumpf\projects\nim\dist\c2nim already exists but is not a git repo
13:41:21Araqthe deps.cmd is making me nervous
13:41:24leorizeI bet it's the CR-LF that's causing problem then
13:41:34Araqdo we rely on batch scripts?
13:42:04leorizeno
13:43:01leorizedeps.cmd is just printing whatever we run
13:55:17*vicfred quit (Quit: Leaving)
13:59:08FromDiscord<mratsim> @Araq I think you used my "let ExpLut" instead of making it const
13:59:10*bung joined #nim
13:59:34AraqI think I know my 10 line test program and I used 'const'
14:00:51AraqI also read the C code generator's code, it does produce 'extern' for named constants
14:01:09FromDiscord<mratsim> mmmmh
14:01:28*waleee-cl quit (Quit: Connection closed for inactivity)
14:01:31FromDiscord<mratsim> not on my usual machine but I'll give you some instructions to reproduce on Constantine
14:01:39FromDiscord<mratsim> give me 15min
14:02:01Araqmaybe you use it in the VM with 'static T' and it loses the information that it was a named const
14:04:39Araqor maybe you expand it in multiple modules thanks to template overdoses
14:15:52leorize[m]1Araq: can you apply this patch http://ix.io/2zuO then run `./koch c2nim`? I need some debugging data to be completely sure why it's not working
14:19:57*PMunch quit (Quit: leaving)
14:25:33FromDiscord<mratsim> @Araq https://github.com/nim-lang/RFCs/issues/257#issuecomment-702763701↡↡Adding info on how it's called.
14:25:34disbotβž₯ Noinline and/or Addressable consts ; snippet at 12https://play.nim-lang.org/#ix=2zuj
14:26:19*waleee-cl joined #nim
14:26:46*arecacea1 quit (Read error: Connection reset by peer)
14:27:21*arecacea1 joined #nim
14:29:56*enthus1ast quit (Ping timeout: 240 seconds)
14:30:20*enthus1ast joined #nim
14:32:10*JustASlacker joined #nim
14:32:55*zielmicha__ quit (Ping timeout: 240 seconds)
14:32:57*JStoker quit (Ping timeout: 240 seconds)
14:33:03*zielmicha__ joined #nim
14:35:08*JStoker joined #nim
14:35:55*waleee-cl quit (Ping timeout: 240 seconds)
14:37:21Araqleorize[m]1,
14:37:22AraqDEBUG: cmd output:
14:37:22AraqDEBUG: cmd status: 0
14:37:59leorizedoes it success?
14:38:37leorizeif it doesn't then probably I'll have to add repr() to that output thingy to know exactly what's the problem...
14:38:57Araqstatus is 0, so success
14:39:14leorizeI check if the output is empty also
14:39:22leorizeI mean does the ./koch c2nim still erroring?
14:39:27Araqyes
14:40:02leorizecan you add repr to the output so I can have a view on what's exactly in it?
14:40:11leorizethe file is tools/deps.nim
14:40:13Araq 0000000002971EA0"\10"
14:40:13Araq""
14:40:14*waleee-cl joined #nim
14:40:18Araqthere is a newline in it
14:40:32*EastByte quit (*.net *.split)
14:40:32*voltist quit (*.net *.split)
14:40:32*silvernode[m] quit (*.net *.split)
14:40:32*OMGOMG quit (*.net *.split)
14:40:34Araqyou need a strip call
14:40:57*EastByte joined #nim
14:40:57*voltist joined #nim
14:40:57*silvernode[m] joined #nim
14:40:57*OMGOMG joined #nim
14:41:05Araq<insert dirty joke here>
14:41:17leorizehow come that is not a problem with linux... windows is weird
14:41:28leorizeshould be simple enough
14:43:17*l1x quit (Ping timeout: 246 seconds)
14:43:48Araq result = status == 0 and output.strip() == ""
14:43:51Araqdoes the trick
14:44:09*l1x joined #nim
14:45:39*ormiret quit (Ping timeout: 244 seconds)
14:46:47*disruptek throbs.
14:47:24*ormiret joined #nim
14:50:06leorize#15470 created
14:50:06disbothttps://github.com/nim-lang/Nim/pull/15470 -- 3tools/deps: fix git dir check [backport:1.4]
14:50:12leorizethanks Araq for helping out
14:51:04leorizedo you want me to remove c2nim from being bundled with windows zip as well?
14:51:47leorizec2nim commit is not pinned so it would not result in a deterministic build for windows
14:53:57*krux02 quit (Remote host closed the connection)
14:55:48*JustASlacker quit (Ping timeout: 256 seconds)
14:57:41disruptekdoes anyone know what problems, if any, exist with our zip wrapper?
14:58:56Araqleorize, hmm yeah, remove c2nim from our windows offer
14:59:12Araqdisruptek, it doesn't work and I cannot fix it
14:59:20disruptekfair enough.
15:08:19*disruptek 🎜 what color is your mangle 🎝 what color ♬ oooh yeah β™« baby
15:17:47FromDiscord<ache of head> πŸ€”
15:25:28FromDiscord<Avatarfighter> What is up everyone
15:25:31*voltist quit (Ping timeout: 244 seconds)
15:25:38FromDiscord<Avatarfighter> What is new with you all
15:25:51*voltist joined #nim
15:26:27FromGitter<alehander92> oi
15:32:25*gangstacat joined #nim
15:32:34FromDiscord<dayl1ght> wow I get a huge difference with -d:release and without
15:32:45FromDiscord<dayl1ght> I wonder what's going on πŸ€”
15:32:46disruptekweird.
15:33:08FromDiscord<dayl1ght> I'm using objects a lot, I assume -d:release is optimizing the copies?
15:33:09FromDiscord<Rika> there must be some optimisations happening for some reason
15:33:28FromDiscord<dayl1ght> like passing objects through procs a lot
15:33:30FromDiscord<Rika> no
15:33:44FromDiscord<Rika> optimisations in general are being applied
15:33:49FromDiscord<Rika> not just for objects or w/e
15:34:27FromDiscord<dayl1ght> right, optimizations in general, but it's weird to have such a huge difference in perf
15:34:51FromDiscord<Rika> no it is not
15:35:05FromDiscord<Rika> nim compiles debug by default
15:35:29FromDiscord<Rika> people can see something from around 2x performance increase to 10x or even more
15:35:32FromDiscord<Rika> depending on the program, of course
15:35:44FromDiscord<dayl1ght> eh it's more like over 100x lol
15:35:50FromDiscord<Rika> still normal
15:35:51FromDiscord<dayl1ght> I think there's something wrong with my program
15:36:04FromDiscord<Rika> perhaops
15:36:08disruptekAraq: supersnappy is a dep-free nim compression impl that works with arc and is 3x faster than frosty itself for my test data (~2.9mb json graph). compresses to 760k.
15:36:26disruptek(i propose to use this for ic)
15:36:41FromDiscord<dayl1ght> if I have a `type Something = object ... x: Table[int, int]`
15:36:48*casaca quit (Ping timeout: 244 seconds)
15:36:55FromDiscord<dayl1ght> and then a `proc mutateSomething(self: var Something) = something.intField = 0`
15:37:06*casaca joined #nim
15:37:06FromDiscord<dayl1ght> does calling mutateSomething copy the whole instance of `Something`? including the table?
15:37:40FromDiscord<Rika> no
15:38:35FromDiscord<dayl1ght> so `Something` is passed by reference? I thought `object`s were copied
15:39:27*nature joined #nim
15:39:38FromDiscord<mratsim> @dayl1ght all compiled languages: C, C++, Rust, Swift, D, Crystal have a default debug with no optimization and a release build with everything turned on
15:40:09FromDiscord<mratsim> Also objects bigger than 24 bytes (3 words on 64-bit) are passed by reference in the backend
15:40:19FromDiscord<dayl1ght> sent a code paste, see https://play.nim-lang.org/#ix=2zvk
15:40:20FromDiscord<mratsim> i.e. don't worry about them
15:40:23FromDiscord<dayl1ght> basically I have a lot of code like these little procs:
15:40:27FromDiscord<dayl1ght> (edit) 'procs:' => 'procs^'
15:40:37FromDiscord<dayl1ght> I'm wondering if the interpreter is being copied every time
15:40:42*JustASlacker joined #nim
15:41:01FromDiscord<Rika> anything with var is passed via pointer afaik
15:41:04FromDiscord<mratsim> No, a var parameter is always passed by pointer otherwise you can't modify it
15:42:14*jacereda joined #nim
15:42:15FromDiscord<mratsim> Also relevant: https://github.com/status-im/nimbus/wiki/Interpreter-optimization-resources
15:42:25FromDiscord<dayl1ght> right, that makes sense
15:44:00FromDiscord<dayl1ght> can I pass -O0, -O1 etc to gcc somehow?
15:44:08FromDiscord<mratsim> sure
15:44:17FromDiscord<mratsim> -d:release passes -O3
15:44:26FromDiscord<mratsim> --opt:size passes -Os
15:44:27FromDiscord<dayl1ght> I'd like to test different optimization levels
15:44:50FromDiscord<mratsim> and otherwise on the CLI you can do nim c --passC:"-O2" yourfile.nim
15:44:54FromDiscord<dayl1ght> ah nice
15:44:55FromDiscord<dayl1ght> thanks
15:45:13FromDiscord<mratsim> or in any of your nim files you can do {.passC:"-O2".}
15:45:23FromDiscord<juan_carlos> `-d:lto -d:strip` also exist.
15:45:49FromDiscord<mratsim> or you can compile different files with different optimization levels with {.localPassC:"-O2".} on one file and -O3 on another.
15:46:23FromDiscord<whisperdev> How do I align string output when I want to have columns? |service|service_status|
15:46:29*hnOsmium0001 joined #nim
15:46:30FromDiscord<mratsim> but for an interpreter the biggest optimization is usually avoiding allocation in the interpreter loop and computed gotos
15:46:39disruptek!repo terminaltables
15:46:40disbothttps://github.com/xmonader/nim-terminaltables -- 9nim-terminaltables: 11terminal tables for nim 15 33⭐ 2🍴
15:47:02*JustASlacker quit (Ping timeout: 264 seconds)
15:47:29FromDiscord<dayl1ght> yeah, I haven't done any optimizations yet but it should be within python's/ruby's ballpark at least
15:47:35FromDiscord<dayl1ght> I'll test some more
15:47:44*jacereda` joined #nim
15:49:01FromDiscord<mratsim> Usually, if it doesn't involve strings that are naivelly allocated over and over again, Nim is around C speed (but naive handling of strings in C is slower than Python too ...)
15:49:44FromDiscord<dayl1ght> The reason I suspect copying is because I'm following the design of a C interpreter from a book pretty closely, and I can compare my implementation to the author's and theirs is much faster
15:49:58FromDiscord<dayl1ght> so I think with my naive translation from C to nim using `object`s there's a lot of copying happening somewhere
15:50:17FromDiscord<mratsim> When doing 1-1 impl of C code I never got different speed
15:50:21*dv-^_^6193 joined #nim
15:50:37FromGitter<alehander92> whisperdev use align and alignLeft
15:50:40FromDiscord<mratsim> tested in the forum with Quake for example which is a highly optimized piece of code due to the hardware of the time
15:50:40FromGitter<alehander92> from strutils maybe
15:50:56FromDiscord<mratsim> Nim objects are very efficient
15:51:03FromDiscord<dayl1ght> e.g. some of their functions were like `doX(CallFrame* x)`
15:51:06FromDiscord<mratsim> ref objects are meh but Nim objects are fast
15:51:15FromDiscord<dayl1ght> whereas my equivalent is `doX(x: CallFrame)`
15:51:31*jacereda quit (Ping timeout: 246 seconds)
15:51:33FromDiscord<mratsim> wouldn't copy
15:52:01FromDiscord<mratsim> I'm writing a crypto library with 4300 bits integers on the stack, they aren't copied
15:52:14FromGitter<alehander92> wow strutils2
15:52:34FromDiscord<dayl1ght> hmm isn't the point of `object`s the fact that they are copied?
15:52:37*dv-^_^619 quit (Ping timeout: 260 seconds)
15:52:39FromDiscord<mratsim> https://github.com/mratsim/constantine/blob/master/constantine/curves/bls12_381_pairing.nim#L24-L26
15:52:54FromDiscord<mratsim> No, the point of objects is that they have value semantics
15:53:01FromDiscord<dayl1ght> I'm not claiming nim is slow btw, I'm just trying to find what's wrong in _my_ code lol
15:53:16Araqgive us some links/code
15:53:36FromDiscord<mratsim> but when you pass parameter, Nim will copy unmodified objects if 24 byts or less or pass by hidden pointer if bigger
15:54:52FromDiscord<mratsim> compile with --debugger:native and use Apple Instruments / intel VTune / perf record and perf annotate
15:55:15FromDiscord<mratsim> write a bench and analyze where your code spend the time
15:55:32FromDiscord<mratsim> Example investigation: https://github.com/nim-lang/Nim/issues/9514
15:55:33disbotβž₯ [Perf] Max/min are not inline and slow (7x slower than memory-bound implementation) ; snippet at 12https://play.nim-lang.org/#ix=2svy
15:55:34FromDiscord<dayl1ght> yeah with perf record I got a lot of time spent in nimFrame, popFrame and some GC function
15:56:01FromDiscord<mratsim> And other: https://forum.nim-lang.org/t/5124#32241
15:56:11FromDiscord<mratsim> only optimize in -d:release
15:56:20FromDiscord<mratsim> nimFrame and popFrame don't exist in release mode
15:56:53FromDiscord<mratsim> GC functions are probably because you are using temporary seq/strings in a tight loop instead of reusing a buffer, not sure what the original C code uses
15:57:13FromDiscord<dayl1ght> oh oops, that was while recording in debug mode, you're right. It's still slower than I expect in release mode though
15:57:21FromDiscord<dayl1ght> this is the interpreter loop: https://github.com/frankpf/kiwi/blob/debug/vm/src/interpreter.nim#L170
15:57:47FromDiscord<dayl1ght> thanks for the tips, I'll investigate more
16:01:04AraqechoErr fmt ?
16:01:46Araqif that is not lazy, there is no need to benchmark it, the string constructions and output to the console destroy everything
16:02:54FromDiscord<dayl1ght> that calls out to process.stdout.write when the argv includes `--debug`
16:03:35FromDiscord<dayl1ght> console output won't happen, but string construction could definitely be the issue
16:03:48Araqreplace it by a template
16:04:03FromDiscord<dayl1ght> sent a code paste, see https://play.nim-lang.org/#ix=2zvx
16:04:10AraqTableRef[Opcode, int64] --> probably better as array[Opcode, int64]
16:04:27Araqyou should use 'result'
16:04:48leorize[m]1change that to a template so you'd have lazy evaluation
16:05:08FromDiscord<dayl1ght> result where?
16:05:15jacereda`besides not being lazy, echoErr also compares all the arguments in the command line with "--debug"
16:05:26Araqeverywhere you can.
16:05:26FromDiscord<dayl1ght> ah and it does that every time it's called too.
16:05:46leorizeyou should have a proper argument parser lol
16:05:53FromDiscord<dayl1ght> well yeah :p
16:06:01leorizecligen and nim-argparse are my personal favorite
16:06:13leorizethere are probably better ones now, though
16:06:14FromDiscord<dayl1ght> I assume in echoErr fmt"{var1} {var2}" the string will be constructed every time, gcc/nim can't optimize it out
16:06:18FromDiscord<dayl1ght> because debugMode() depends on runtime values
16:06:28Araqand replace your stack based VM with a register based one
16:06:39leorizeif you use template then `fmt` will be lazily evaluated
16:06:42FromDiscord<dayl1ght> Araq: do you mean assigning to result? what's the difference between that and returning
16:07:02leorizeassigning to result enables some optimization regarding named values
16:07:39FromDiscord<dayl1ght> thanks, those are great tips, I'll use a template for echoErr and make debugMode not be called every single time
16:07:51FromDiscord<dayl1ght> I imagine those two alone should get me to python ballpark
16:07:54FromDiscord<Rika> additional optimisations can be done by using result instead of return
16:08:00jacereda`Araq: I don't think it would run much faster with a register-based VM, this VM is constructing/destructing boxed values all the time
16:08:25leorizeif debugMode got called enough then it'd be cheap :P assuming you have a big enough cpu cache
16:08:28FromDiscord<dayl1ght> jacereda: you mean the pop/push sequences?
16:08:32jacereda`yes
16:08:33Araqregister-based VM are much easier to debug too IME
16:08:40FromDiscord<dayl1ght> yeah I'll optimize those later
16:08:45jacereda`if you keep the stack-based design, having a TopOfStack value might make a difference
16:09:00jacereda`you don't need to perform 2 fetches for, say, binary operators
16:09:05FromDiscord<dayl1ght> yep
16:09:18FromDiscord<dayl1ght> I can just mutate the stack and stackTop
16:09:26Araqthrow away the stack-based design, it's both harder to debug and slower
16:09:52leorizenot everyone agrees on that tbh
16:09:53Araqthe only reason why people write them is because they are clueless and then write tutorials for the more clueless
16:11:20FromDiscord<dayl1ght> I'm planning to move to a register-based bytecode later on, but it seems harder to implement
16:12:33jacereda`I disagree, stack-based designs are just a perfect fit for some types of languages (Forth), not so good if you want to write a JIT
16:14:02disruptekyou sound like my mom.
16:15:56Araqwell I have written them all, AST based, stack based, register based. AST based is the least amount of code but stack and register are pretty much the same, stacks are harder to debug, tend to produce variable length instructions and thus harder to map to decent debug information
16:17:12jacereda`never had a variable-length instruction in any of my stack-based interpreters
16:17:36jacereda`when you need things like pushLiteral, you just embed the literal in the next cell
16:17:44FromDiscord<dayl1ght> isn't that variable length
16:17:53FromDiscord<dayl1ght> since your push will take two bytes effectively
16:18:25FromDiscord<dayl1ght> whereas other instructions without parameters would only take one byte for the opcode
16:18:26jacereda`the opcode is pushLiteral, not the literal itself
16:19:10FromDiscord<dayl1ght> if I have `push` and `push_lit 2` instructions, my push needs only 1 byte for the opcode
16:19:14jacereda`I tend to avoid bytecode, direct threading is the way to go, we aren't in the 8 bit era
16:19:27FromDiscord<dayl1ght> and push_lit needs one byte for the opcode + 1 for the literal, isn't that the definition of variable length?
16:21:06jacereda`in that sense, lisp is also composed of variable-length instructions?
16:21:38FromDiscord<dayl1ght> I don't know about lisp but that looks exactly like e.g. x86 to me
16:21:44FromDiscord<dayl1ght> if it was fixed-length both push and push lit would take 2 bytes
16:21:51Araqexactly
16:21:52FromDiscord<dayl1ght> no?
16:23:58jacereda`and how would you encode loading a 32-bit value in a register?
16:24:04jacereda`with a fixed-size encoding
16:24:06jacereda`loadhi/loadlo?
16:24:21jacereda`there you have, variable-length instruction
16:25:01FromDiscord<dayl1ght> I don't think you'd be able to? if your instructoins are 32-bit, you can't have a 32 bit immediate
16:25:09FromDiscord<dayl1ght> with loadhi and loadlo you still have a fixed-length instruction set
16:25:12FromDiscord<dayl1ght> if both of those take 32 bits
16:26:02jacereda`and how is loadhi/loadlo simpler than pushLiteral() implemented as push(*pc++)?
16:26:29FromDiscord<dayl1ght> oh I'm not discussing whether it's simpler or not
16:26:52FromDiscord<dayl1ght> but I think for CPUs the advantage of fixed-length instruction sets is that they can know the size without depending on the opcode
16:27:04FromDiscord<dayl1ght> which means they can pipeline the next instructions for example
16:27:40FromDiscord<dayl1ght> i think that's why x86 processors decode to (I assume?) fixed-length instructions called uops
16:28:50jacereda`and I see the value of RISC designs for hardware, but for an interpreter I think a stack-based direct-threading design is way simpler than register-based designs
16:29:16jacereda`as always, assuming there's no plan to jump to JITting
16:29:31FromDiscord<dayl1ght> there's a nice discussion of register-based vs stack-based design here http://craftinginterpreters.com/a-virtual-machine.html#design-note
16:30:16FromDiscord<dayl1ght> I don't think the literature has any evidence of any of the two being better for performance
16:31:03FromDiscord<dayl1ght> araq: I don't get why variable-length instructions are harder to map to good debug information
16:31:29FromDiscord<dayl1ght> are you assuming direct compilation from source code to bytecode without an AST?
16:34:20FromDiscord<mratsim> coming soon VM/interpreter/emulation channel
16:34:51FromDiscord<mratsim> I think I have that in some of the link I posted
16:35:07FromDiscord<mratsim> MorphosVM or SableVM has 2 implementations don't remember which
16:35:24FromDiscord<dayl1ght> mratsim: I do want to have a JIT later on and I looked a little into some project you had
16:35:36FromDiscord<dayl1ght> I think it was something similar to DynASM?
16:36:10FromDiscord<dayl1ght> a set of macros to help with emitting x86 assembly
16:36:15FromDiscord<mratsim> https://www.scss.tcd.ie/publications/tech-reports/reports.07/TCD-CS-2007-49.pdf
16:36:35FromDiscord<mratsim> DynASM is way more complex than macros
16:37:01FromDiscord<mratsim> you add inline annotation and then pass a preprocessor that would transform them into ASM that can be called
16:37:36FromDiscord<dayl1ght> ahh so the source code itself is transformed to asm
16:37:49FromDiscord<mratsim> You probably looked into Photon-JIT: https://github.com/numforge/laser/tree/master/laser/photon_jit / https://github.com/mratsim/photon-jit
16:37:49FromDiscord<dayl1ght> https://github.com/mratsim/photon-jit/blob/master/examples/ex01_jit_hello_world.nim
16:37:52FromDiscord<dayl1ght> I think this is what I saw yeah
16:38:21FromDiscord<mratsim> Note that nlvm has LLVM ORC JIT support as well
16:38:21*a__b__m quit (Read error: Connection reset by peer)
16:38:47FromDiscord<mratsim> photon JIT is more of a proof of concept for now on how to have an easy to extend JIT assembler
16:38:47FromDiscord<dayl1ght> assembler.mov rdi, 0x01
16:39:06FromDiscord<dayl1ght> so this is kinda like a DSL to help with building x86 instructions?
16:39:26FromDiscord<mratsim> especially compared to asmjit (opcode generation via javascript) and xbyak (opcode generation via C++ text generation)
16:39:28FromDiscord<dayl1ght> e.g. it pushes the bytes of mov rdi, 0x01 to some internal buffer
16:39:30FromDiscord<mratsim> yes
16:39:32FromDiscord<dayl1ght> ah ok
16:39:54FromDiscord<dayl1ght> yeah that looks useful, I'm so far away from having a JIT tho
16:40:21FromDiscord<dayl1ght> I also want to experiment with combining AOT + JIT
16:40:26FromDiscord<mratsim> but apart from the buffer I tried to make most computed at compile-time
16:40:30FromDiscord<dayl1ght> I think there's a lot of untapped potential in AOT compilation for dynamic languages
16:40:40jacereda`for AOT I would look at https://c9x.me/compile/
16:40:59jacereda`it will be slower than LLVM, but it's small and fast
16:41:00FromDiscord<mratsim> that's also something I'm interested in for machine learning
16:41:26*abm joined #nim
16:41:44FromDiscord<mratsim> basically https://github.com/numforge/laser/tree/master/laser/lux_compiler is a DSL that can either be compiled into Nim or have a LLVM backend for GPU codegen
16:41:57FromDiscord<mratsim> well it's a plan for a DSL
16:42:50FromDiscord<mratsim> there are a couple of markdown that explain the design, challenges there: https://github.com/numforge/laser/tree/master/laser/lux_compiler/core
16:43:15jacereda`speaking of GPU, anyone working on making Nim generate SPIR-V?
16:43:20FromDiscord<dayl1ght> there's this phd thesis from 2010 on AOT compilation for PHP: https://paulbiggar.com/research/thesis.pdf
16:43:24FromDiscord<mratsim> so if you want an IR/AST that can be used at both AOT and Runtime this can help you
16:43:36FromDiscord<dayl1ght> it looked promising, I'm sad no one is exploring AOT for dynamically typed languages
16:43:40jacereda`oh, found this https://github.com/jwollen/nim2spirv
16:43:43FromDiscord<mratsim> I think I saw something
16:43:48FromDiscord<mratsim> yep
16:43:49FromDiscord<dayl1ght> my theory is that everyone copies JS and JIT makes a lot of sense for JS since you don't want to pay the overhead of compiling
16:43:57FromDiscord<dayl1ght> but for python and ruby for example, I think AOT might make more sense
16:44:30FromDiscord<dayl1ght> since you probably don't care how long it takes to compile :p
16:44:45FromDiscord<dayl1ght> I'll look into the design of lux, thanks
16:46:23FromDiscord<mratsim> those were my initial experiments, ordered by ascending difficulty: https://github.com/mratsim/compute-graph-optim
16:46:46FromDiscord<dayl1ght> ah there's also this recent paper (2019) on JS AOT compilation: https://hal.archives-ouvertes.fr/hal-01937197/document
16:46:54FromDiscord<dayl1ght> that one is _very_ interesting, they claim to get within 50% of v8's perf
16:46:58FromDiscord<dayl1ght> which is super impressive
16:47:04*abm quit (Quit: Leaving)
17:00:46*Trustable quit (Remote host closed the connection)
17:13:49FromDiscord<Kaynato> I saw https://arxiv.org/abs/1811.05213 but the exact methodology they say are a significant burden
17:19:14*kobi7 joined #nim
17:25:14*arecacea1 quit (Remote host closed the connection)
17:25:48planetis[m]if I write a destructor for an object which also contains seq, do I need to write `=destroy`(foo.myseq) manually, inside the destructor?
17:26:22*jacereda` quit (Ping timeout: 246 seconds)
17:27:04planetis[m]because I think that this used to be redundant?
17:27:37*arecacea1 joined #nim
17:28:10FromDiscord<whisperdev> Not Nim specific but what is the most efficient way to get strings that startWith("Prefix.") from an array of strings?
17:28:41*JustASlacker joined #nim
17:29:00planetis[m]write a for loop yourself, I guess
17:29:18PrestigeIf it's an array/sequence ^ can also use filter
17:29:39FromDiscord<shashlick> @leorize - I'm checking for musl based on gcc output - is that sufficient
17:30:08Prestigehttps://nim-lang.org/docs/sequtils.html#filter.i%2CopenArray%5BT%5D%2Cproc%28T%29 @whisperdev
17:30:18leorize@shashlick it's usually is
17:30:37FromDiscord<shashlick> okay - on alpine, it's in the target, whereas on ubuntu, its a spec that's read in
17:30:45leorizethat won't work for musl-gcc I think
17:30:52FromDiscord<mratsim> @planetis no need it will be destroyed at end of scope
17:30:59leorizeso it's a bit of a pita
17:31:02FromDiscord<shashlick> also, reason i'm using gcc -v is because i need the version info as well
17:31:32leorizeyou got gcc -dumpversion as well :P
17:31:45leorizethough I don't think they will change the `-v` output format
17:32:57FromDiscord<whisperdev> If I want to operate on LPWSTR lets say with something like .startsWith() I need to write my own implementation that works with LPWSTR?
17:32:59planetis[m]mrastim: i mean I have overwriten the object's destructor, that encapsulates the seq and I don't see a dealloc call being generated for the seq
17:33:37FromDiscord<shashlick> @leorize - target is in the -v output
17:33:45*bung quit (Quit: Lost terminal)
17:34:01leorize-dumpmachine + -dumpversion :P
17:34:09leorizetotally deterministic
17:34:47FromDiscord<shashlick> two calls vs. one?
17:34:57FromDiscord<shashlick> but brittle perhaps
17:35:38leorizeI think -v works well enough, provided that -v output won't change
17:35:47*JustASlacker quit (Ping timeout: 260 seconds)
17:36:07planetis[m]I will try an older nim version, I must be wrong
17:36:17leorizeplanetis[m]: sounds like a bug to me
17:36:29leorizeoh wait you overriden the destructor?
17:36:37leorizethen you need to add that in explicitly I think
17:36:41FromDiscord<shashlick> dumb question but musl only supported on linux right
17:36:44FromDiscord<shashlick> not osx/win
17:37:02leorizethat's where it's most used, yes
17:37:19leorizemusl has been ported to other os but userbase is near zero so you shouldn't care about it
17:37:24FromDiscord<shashlick> cause i don't want to make the code os specific
17:38:24leorizeplanetis[m]: probably should ask Araq about how destructor works
17:38:48FromDiscord<whisperdev> What's better nim-chronos or std's async/await?
17:39:00disruptekplanetis[m]: you need to write your own.
17:39:15disruptekwhisperdev: chronos does not work with arc.
17:40:05leorizethere was this talk long ago about merging chronos and std's but then both sides do nothing :P
17:40:29disruptekno point in pursuing chronos, imo.
17:41:06leorizechronos has a ton of useful features that the stdlib doesn't have
17:41:16leorizeI mainly care about the AsyncBuffer though
17:41:28leorizeI might port it over in the future
17:41:35disruptekas long as it doesn't work on arc, i couldn't care less.
17:42:27FromDiscord<whisperdev> does it work with orc?
17:42:30disruptekno.
17:42:46leorizeit should work with orc, but you gotta test it first
17:43:05leorizeI mean if it doesn't work with orc we can't say that orc is a refc replacement :P
17:43:23disruptekit is, but they are doing dangerous stuff.
17:43:29disruptekshortcuts.
17:43:54disruptekhonestly, i won't use status software because i don't want to be beholden to their priorities and motivations for features, etc.
17:49:56FromDiscord<aHaquer> I'm working on a nimble package, but sometime between yesterday and today, running nimble install didn't appear to actually overwrite the executable, so I deleted the executable but it's now complaining that it can't find the file↡> bash: /home/delight/.nimble/bin/fake: No such file or directory
17:51:00FromDiscord<Rika> because nimble doesnt overwrite the executable
17:51:05FromDiscord<Rika> it shims it
17:51:25FromDiscord<Rika> on linux it symlinks it
17:51:58FromDiscord<Rika> which executable did you delete?
17:52:03FromDiscord<Rika> rather, what location
17:52:27*Vladar quit (Quit: Leaving)
17:52:33FromDiscord<Rika> if its the one at `/home/delight/.nimble/bin`, you deleted the symlink
17:52:46FromDiscord<aHaquer> I removed↡> ~/.nimble/bin/fake
17:53:25FromDiscord<aHaquer> Oh
17:53:36FromDiscord<aHaquer> How do I restore the symlink
17:53:54FromDiscord<Rika> i think making nimble install whatever package again will reinstate it
17:55:12FromDiscord<aHaquer> I've tried↡> nimble install↡multiple times
17:55:21FromDiscord<Rika> in what directory?
17:55:36FromDiscord<aHaquer> In the package directory
17:55:44FromDiscord<aHaquer> Upper level
17:55:51FromDiscord<aHaquer> /Repos/package
17:56:34FromDiscord<Rika> what error does it come up with
17:56:54FromGitter<Knaque> `bash: /home/delight/.nimble/bin/fake: No such file or directory`
17:56:58FromDiscord<aHaquer> It doesn't give me any error when I nimble install
17:57:03FromDiscord<aHaquer> Just when I try to run it
17:57:28FromDiscord<Rika> @knaque: that error is of a different methodology
17:57:51FromDiscord<Rika> so it succeeds on nimble install? that might mean your package isnt configured as a binary package
17:57:52FromDiscord<aHaquer> Also, yesterday it did appear to be overwriting, but now it's not
17:57:53FromGitter<Knaque> I didn't know which you were referring to so I made a dumb guess :shrug:
17:58:12*kobi7 quit (Ping timeout: 256 seconds)
17:58:49FromDiscord<aHaquer> I think I configured is as a binary package, how would I check?
17:59:18FromDiscord<aHaquer> Oh yeah it is
17:59:25FromDiscord<aHaquer> there is a bin in my package.nimble
17:59:27FromDiscord<Rika> afaik there should be a `bin` field in the nimble file?
17:59:37FromDiscord<Rika> okay huh it says success on install?
18:00:03FromDiscord<aHaquer> All of the output I get on the install it
18:00:06FromDiscord<aHaquer> (edit) 'it' => 'is'
18:00:06FromDiscord<Rika> `Success: xxx installed successfully.`?
18:00:12FromDiscord<aHaquer> sent a long message, see http://ix.io/2zwb
18:00:24FromDiscord<Rika> there should be a last line whether it failed or succeeded
18:00:27FromDiscord<Rika> (edit) 'there should be a last line ... whether' => 'there should be a last linesaying'
18:00:46FromDiscord<aHaquer> (edit) 'http://ix.io/2zwb' => 'http://ix.io/2zwe'
18:00:49FromDiscord<Rika> did you write "y" then enter?
18:01:10FromDiscord<Rika> because the caps `N` means it defaults to no
18:01:13FromDiscord<aHaquer> it does not seem to be waiting for me to enter the prompt
18:01:19FromDiscord<Rika> h u h
18:01:31FromDiscord<Rika> try `nimble install -y`
18:01:44FromDiscord<aHaquer> Oh crap
18:01:53FromDiscord<Rika> ?
18:02:07FromDiscord<aHaquer> Sorry for wasting your time, I was just pressing enter
18:02:14FromDiscord<Rika> ah okay
18:02:14FromDiscord<aHaquer> I thought it would auto Y
18:02:18*kobi7 joined #nim
18:02:19FromGitter<Knaque> I've corrected him to actually read the thing.
18:02:26FromDiscord<Rika> the caps letter is the automatic decision
18:02:34FromDiscord<aHaquer> Sorry, I'm new to nim
18:02:39FromDiscord<Rika> its fine
18:02:40FromDiscord<aHaquer> This is my first package
18:02:43FromDiscord<Rika> we all were at one point
18:03:06FromDiscord<aHaquer> thanks for the help
18:03:15*kobi7 quit (Client Quit)
18:09:33*thomasross joined #nim
18:13:08planetis[m]so yeah I tested older nim version, turns out you need to call destroy yourself: https://play.nim-lang.org/#ix=2zwh
18:14:41planetis[m]weiird i still see a leak after commenting out destroy in 1.2
18:14:52planetis[m]works without a leak in devel
18:19:37FromDiscord<Recruit_main707> does getOccupiedMem work without a gc?
18:19:55FromDiscord<shashlick> @leorize - how do you know if a binary is built with musl instead of glibc
18:21:02leorize[m]1@shashlick you don't
18:21:39FromDiscord<shashlick> i updated nimterop to download musl binaries and am building choosenim fine
18:21:50FromDiscord<Vindaar> huh, can't you just use `objdump` or similar πŸ€”
18:21:50leorize[m]1you can to an extent but I would not go there
18:22:14FromDiscord<juan_carlos> is best practice to use `create()` without passing the `size` ?, is it inferred or has to grow it after creation?.
18:23:01leorize[m]1@Vindaar you can sorta deduce it out by looking at the symbols
18:23:20leorize[m]1however there aren't any concrete way to figure that part out
18:23:41leorize[m]1you can, however, very easily figuring out if a binary was built with glibc :p
18:23:59FromDiscord<Vindaar> hmm 🧐
18:25:18leorize[m]1@juan_carlos nim's `create()` is similar to `calloc`
18:30:35Araqplanetis[m], you need to destroy the string if you override the =destroy.
18:30:53planetis[m]Araq: ok thanks
18:31:17Araqand it's covered by our destructors manual too
18:31:29planetis[m]now i need to unbreak my repo, somehow git checkout tag broke it
18:31:34planetis[m]freaking git
18:32:59FromDiscord<shashlick> is there any way to tell which c compiler Nim is using
18:33:09FromDiscord<shashlick> beyond defined(gcc)
18:33:19FromDiscord<shashlick> like what was passed in with --gcc.exe and the like
18:35:46FromDiscord<haxscramper> How I can completely disallow type conversion for `type D = discinct int` - I want to disallow `D(12)` and instead provide custom conversion function that would do some correctness checks for parameter. Tried `proc D(a: int) {.error.}` but got referinition error
18:36:50FromDiscord<shashlick> compilesettings.ccompilerPath is always blank
18:50:55FromDiscord<Recruit_main707> `The Nim profiler can also be used for measuring memory usage, simply compile your application with the --profiler:off, --stackTrace:on, and -d:memProfiler flags.`↡Does this still work? i keep getting `Error: undeclared identifier: 'nimProfile'`
18:51:46FromDiscord<Rika> its memProfiler
18:51:55*abm joined #nim
18:52:19FromDiscord<Slyris> installing nim through scoop don't work anymore ?
18:52:26FromGitter<alehander92> Araq
18:52:30FromDiscord<Slyris> My CI don't install nim anymore since few commits
18:52:32*Trustable joined #nim
18:52:50FromDiscord<Slyris> but since i don't have a windows computer right now i cannot test
18:52:52FromDiscord<Recruit_main707> > its memProfiler↡?
18:52:55FromGitter<alehander92> did you get my update for the friday stuff
18:53:02FromGitter<alehander92> wednesday*
18:53:49FromDiscord<himu> what's the best configuration to set up nim with nvim/vim? nimlsp seems to crash often.
18:55:51Prestigeit needs some work. I'm using nimslp and nim.nvim
18:56:15Prestigehttps://github.com/alaviss/nim.nvim
18:57:43*leorize quit (Ping timeout: 240 seconds)
19:00:41FromDiscord<lqdev> nimlsp? what for?
19:01:04FromDiscord<lqdev> nim.nvim already uses nimsuggest directly
19:01:08FromDiscord<lqdev> for autocomplete
19:01:16FromDiscord<lqdev> though it doesn't do error reporting
19:01:23FromDiscord<lqdev> yet
19:01:38PrestigeTo interact with my lsp client
19:02:06FromDiscord<lqdev> but why do you need lsp for nim
19:02:10leorize[m]1@shashlick sounds like a bug?
19:02:13FromDiscord<lqdev> if nim.nvim already does most of the work
19:02:18FromDiscord<lqdev> error reporting i guess?
19:03:57PrestigeYes, and I have shortcuts set up for lsp so I like using it where I can
19:08:11Araqalehander92: I think so, not sure
19:08:30FromDiscord<shashlick> @leorize - yep - will debug at some point - cCompilerPath is not set
19:09:01*leorize joined #nim
19:09:13FromDiscord<Rika> @Recruit_main707 where do you put "nimProfile" anywhere
19:12:58Araqnarimiran, branch off 1.4 from this devel, it's complete
19:13:10Araq(to the best of my knowledge...)
19:13:27Araqthe Nim profiler is dead, please use a different tool :-/
19:13:32Araqgood night
19:13:35leorize[m]1not so fast, windows nightlies are failing due to niminst and i don't know why
19:16:42leorizeofc it's caused by someone touching niminst recently...
19:20:18narimiranAraq: ok, will do
19:20:33narimiranleorize: ok, will wait
19:21:28FromDiscord<Recruit_main707> @Rika its in the actual gc files
19:21:42FromDiscord<Recruit_main707> i dont use it directly
19:21:49FromDiscord<Rika> odd
19:22:57leorizejust opened #15472
19:22:58disbothttps://github.com/nim-lang/Nim/pull/15472 -- 3niminst: restore ZIP building functionality
19:23:44leorizeafter that passes please restart my nightlies PR
19:27:46leorizeactually you can just merge the PR now
19:27:51leorizeCI doesn't build nor run niminst
19:34:58Zevvwhat's that hip font rendering library
19:35:01Zevvi forgot
19:37:08disruptek!repo author:treeform font
19:37:10disbotno results 😒
19:37:19disruptek!repo author:treeform fonts
19:37:19disbotno results 😒
19:37:28disruptekwtf treeform.
19:38:26disruptekoh, it's not author:
19:38:33disruptek!repo typography
19:38:34disbothttps://github.com/treeform/typography -- 9typography: 11Fonts, Typesetting and Rasterization. 15 117⭐ 7🍴
19:39:05Zevvah thanks
19:40:08Zevvman that dude did a solid job there
19:41:33*aenesidemus joined #nim
19:55:29*arecacea1 quit (Remote host closed the connection)
19:55:49*arecacea1 joined #nim
20:09:30natureI can't wrap my head around a problem since last week I have with Nim... I'd be really grateful if someone can point me out what is wronf here...
20:09:54natureThis file compile without any problem: https://paste.rs/VUq
20:10:14natureBut this one doesn't: https://paste.rs/Wb3
20:11:12natureI have the following error: at line 25: "template/generic instantiation of `async` from here" and line 28: "Error: type expected"
20:12:36leorizenature: s/ValueError:/ValueError,/
20:13:06leorizenewException is a template that takes two parameters, it doesn't process any special syntax here :P
20:13:09naturegosh...
20:13:19naturethanks leorize
20:13:30natureI am quite new to Nim as you can tell ^^'
20:14:44leorizehope you're enjoying Nim :)
20:15:06leorizeand don't be shy asking questions here, we are always happy to help
20:15:10natureI am still figuring my way around, but I really like it so far! :D
20:16:37natureBtw any advice for a good devlopment environment ?
20:16:52FromDiscord<himu> nimsuggest seems to be stopping again and again. Hmm. Looks like nimslp+coc is the best way here. @lqdev
20:17:39FromDiscord<lqdev> sorry to hear that.
20:18:12FromDiscord<himu> @nature. If its IDE you are talking about, prefer VS Code. VS Code support for Nim is quite good.
20:18:14leorize@himu nimsuggest/nimlsp will always crash, my plugin just tell you when it does :P
20:18:15FromDiscord<lqdev> but nimlsp uses nimsuggest anyways :)
20:18:42leorizeusually for nimlsp the lsp client just silently restart the thing so you won't see any messages
20:19:12leorizenature: my go-to is neovim + nim.nvim, but I'm biased
20:19:17nature@himu I am currently using vscode but I had to use this extension made by a chinese guy since the "official" one didn't work for me...
20:20:05FromDiscord<himu> nimlsp also crashes a lot. Actually i didn't have any problems until I opened VS Code. Official extension seems to work quite well for me.
20:20:12Prestigeleorize: how do you feel about lsp in general? I've been trying to use it for everything possible
20:20:40natureleorize: I like vim a lot too, but I was looking for some good autocomplete + linting support, I don't know if nvim can do it well
20:21:13leorizeI think it's a neat idea
20:22:01FromDiscord<lqdev> !repo alaviss/nim.nvim
20:22:01disbothttps://github.com/alaviss/nim.nvim -- 9nim.nvim: 11Nim plugin for NeoVim 15 100⭐ 13🍴
20:22:03leorizethe protocol is obviously designed for vscode, but it seems like everyone managed to adapt it to work everywhere
20:22:05PrestigeI've been wanting to contrib to nimlsp, but I'm curious about the state of nimsuggest (if it's crashing)
20:22:07FromDiscord<lqdev> nature ^
20:22:28FromDiscord<lqdev> all linting is done by the compiler
20:22:40FromDiscord<himu> I have to set up nvim again in VS Code. What a drag. coc+nimlsp was working well until some recursive dependency error came up and its been crashing ever since
20:23:13leorizePrestige: well... nimsuggest will always crash until 4raq finishes his rewrite of it
20:23:23Prestigeah, bummer
20:23:26FromDiscord<lqdev> sent a code paste, see https://play.nim-lang.org/#ix=2zwQ
20:23:30FromDiscord<lqdev> add to your init.vim and have fun
20:23:47FromDiscord<lqdev> whenever nimsuggest misbehaves, just type :Res and job done.
20:23:50PrestigeIf he's in the middle of a rewrite, I won't bother
20:24:08leorizedon't worry, nimlsp use nimsuggest as a library
20:24:30leorizeso you will be touching nimsuggest -> lsp translation code 99% of the time
20:24:37FromDiscord<himu> Hmm. Do you guys use coc? Maybe for other languages and frameworks?
20:24:40PrestigeI mean contributing to nimsuggest
20:24:47PrestigeYeah I do @himu
20:25:11Prestigefor nim, c, go, js, ts, and java
20:25:14leorizeplease do contribute, 4raq works on like several things at the same time so we won't get rewritten nimsuggest anytime soon
20:25:51PrestigeI'll see if I can complete any open nimsuggest issues for hacktoberfest
20:26:05FromDiscord<Elegant Beef> "Updated Docs"
20:26:59leorizenature: nim.nvim has a demo in it's readme, please watch that and decide for yourself :)
20:27:01Prestigehehe
20:27:32FromDiscord<lqdev> leorize: how can you enable the doc thingy btw
20:27:40FromDiscord<lqdev> could be quite handy sometimes
20:27:43natureyes I checked the repo, might just go back to vim then :D
20:27:57leorize@lqdev `set completeopt+=preview`
20:28:16nature(for nim, I use vim for pretty much anything else already)
20:28:22leorizethere's also the :NimDocOf command if you want to call docs on demand
20:28:35naturewould you recommend coc or just nim.nvim ? with neovim
20:28:43leorizePrestige use both :P
20:29:01leorizeI use only nim.nvim though
20:29:09FromDiscord<lqdev> btw is there anything i can do with `[*missing arguments*]` in generic procs
20:29:18FromDiscord<lqdev> it takes up a good amount of screen space
20:29:27FromDiscord<lqdev> sometimes i can't read proc signatures because of it
20:29:46leorizefix the compiler :P I'm not sure why that happens tbh
20:30:18PrestigeHm I only see 2 open issues tagged with nimsuggest... thought there would be like, 100
20:30:27leorize!repo nim-lang/nimsuggest
20:30:28disbothttps://github.com/nim-lang/nimsuggest -- 9nimsuggest: 11idetools for the nim language 15 24⭐ 6🍴
20:30:29leorize^ look there
20:31:26Prestigeoh ty
20:34:12*vicfred joined #nim
20:35:18naturePrestige: how did you setup nim.nvim + coc ? Looking for some inspiration
20:37:11FromDiscord<dk> hashing refs by addr, yay/nay?
20:37:19PrestigeI literally only use it for syntax highlighting nature
20:37:51FromDiscord<lqdev> @dk depends on the context
20:38:23FromGitter<alehander92> Araq well i tried many things on wednesday, but https://irclogs.nim-lang.org/30-09-2020.html#19:54:54
20:39:40Prestigenature: but here's my nvim config: https://github.com/avahe-kellenberger/dotfiles/blob/master/nvim/init.vim
20:39:43FromGitter<alehander92> i just need to find a bit more time, was busy with the start of the job sorry
20:40:01FromGitter<alehander92> but now it should be different
20:44:08naturecrap leorize just realized your the writer of nim.nvim hahah, makes sense now
20:44:11PrestigeIs it possible to have two files include each other (to split them up but act as if they were together)?
20:44:15naturegreat work there and thanks :D
20:44:27FromDiscord<Varriount> Prestige: `include`
20:44:51PrestigeJust curious if it works that way, the manual was pretty brief on include
20:44:52*synshroud joined #nim
20:44:55Prestigewa
20:44:59Prestigewoops
20:45:07leorizePrestige: recursive include is not something anyone tried I think
20:45:11leorizenature: np :)
20:45:50FromDiscord<Varriount> Prestige: You would just have one file include the other. Or have a parent file include both.
20:47:04Prestigehm okay. I was hoping I could move all my templates, iterators, and macros (which are specific to the file) moved into another file. Maybe I'm weird
20:47:37Araqalehander92: ok, well
20:48:00PrestigeAraq: I thought you went to sleep mate
20:49:10Araqtrue
20:49:47Araqcan't sleep though, somebody is wrong on the internet
20:50:14Prestigehttps://xkcd.com/386/
20:50:20FromDiscord<ache of head> xD
20:50:28FromDiscord<lqdev> Araq: i know that feeling almost _too_ well lol
20:51:15*natrys quit (Quit: natrys)
20:57:22*Trustable quit (Remote host closed the connection)
20:58:33natureleorize: I have nim.nvim, but when I open a nim file I get the error: "nimsuggest instance for project /home/nature/dev/nim-chat stopped with exitcode: 1"
20:58:40natureHow can I torubleshoot this ?
20:59:14leorizewhat version of nimsuggest do you have?
20:59:18leorizerun nimsuggest --version
20:59:45naturenim compiler 1.2.6
21:00:04leorizedoes your project compile with nim?
21:00:08natureyes
21:00:30leorizecan you run `nimsuggest /home/nature/dev/nim-chat`?
21:02:22naturehttps://paste.rs/Qk2
21:02:57leorizeah yea you're running 1.2.6
21:03:10leorizetry `nimsuggest /path/to/file/you/were/opening/with/neovim`
21:03:54naturehttps://paste.rs/Fda
21:04:27leorizecongrats, you found a compiler bug :P
21:04:37leorizeit should probably triggers if you run `nim check` on that same file
21:04:40naturecrap haha
21:05:18natureno it works
21:05:37natureI wonder if it's related to nixos...
21:06:27FromDiscord<himu> Is there something like nodemon for nim? A server that checks on the project repo and automatically runs the nim project once a file/folder changes.
21:07:02Zevvbwah why are the initDayTime date arguments the wrong way around
21:07:09Zevvis that german notation?
21:07:22Prestigeiso 8601? I haven't seen it
21:10:06leorizenature: it's not uncommon for nimsuggest to mysteriously die, esp if your project is complex
21:11:18natureany lead as to how to fix this ?
21:12:07leorizetry to create a minimal test case to reproduce it and open an issue :P
21:12:17leorizethen hope that Araq looks at it
21:12:43leorizeor you can just try debugging the compiler, which is not easy
21:13:39natureoh ok, I tried nimsuggest on another simpler nim file and everything seems to work fine
21:13:50Araqit's as easy to debug as anything else
21:14:13natureI'd be willing to try :D
21:14:17*Amun_Ra quit (Ping timeout: 256 seconds)
21:14:23naturehow do I set a breakpoint ?
21:14:47Araqyou can do that with gdb but it's a waste of time
21:14:58*abm quit (Read error: Connection reset by peer)
21:15:12Araqthe compiler runs through pretty much every breakpoint thousand of times before the problem shows up
21:15:47FromDiscord<shashlick> Araq: any tricks you can think of to find out what c compiler Nim is using at compile time
21:16:46Araqthere is defined(gcc) and the stuff you encountered that doesn't work
21:17:12FromDiscord<shashlick> okay - does Nim respect $CC if set?
21:17:15leorize@shashlick: just create a nim file that imports a C file
21:17:26leorizeand nim don't respect $CC unless you use --cc:env
21:17:34Araqshashlick: --cc:env yes
21:17:59FromDiscord<shashlick> ah okay
21:18:34FromDiscord<shashlick> what does importing a C file do
21:19:29leorizewrite a simple function that produce output depending on the compiler compiling it
21:19:40FromDiscord<himu> I have a doubt regarding recursive dependencies. Do recursive module dependencies also give error for procs? If yes, how do I resolve it. For now, I have put all my types into a single file/module and that module is being imported everywhere in my project.
21:19:59FromDiscord<shashlick> leorize: i need the actual path since nimterop calls the C compiler for preprocessing
21:20:21leorizethen you're pretty much screwed
21:20:24FromDiscord<shashlick> right now, I check $CC but if a user sets --gcc.exe or a nim.cfg, nimterop won't know
21:20:32FromDiscord<shashlick> do user needs to do both
21:20:37leorizeunless you can get the value of --gcc.exe
21:20:46FromDiscord<shashlick> shouldn't matter on alpine since everything is standard
21:20:54FromDiscord<shashlick> but on ubuntu when you have to use musl-gcc
21:20:59FromDiscord<shashlick> or even arm compilers
21:21:13naturefound the culprit!
21:21:31leorizemy advise is to fix compilersettings then mark it for backport
21:21:59FromDiscord<shashlick> rabbit holes
21:22:02leorizeif users want to cross compile with nimterop, they need newer nim
21:22:09nature!repo status-im/nim-chronos
21:22:10disbothttps://github.com/status-im/nim-chronos -- 9nim-chronos: 11Chronos - An efficient library for asynchronous programming 15 111⭐ 13🍴
21:22:30natureimporting this prevents nimsuggest from working
21:22:45*Amun_Ra joined #nim
21:22:45leorizecan you file a bug at nim-lang/nimsuggest?
21:22:56naturewill do :)
21:23:12leorizeI guess chronos was doing some weird magic
21:25:04disruptekvulkan support in my browser means jack shit if the fucking location bar has 500ms latency on each keystroke.
21:25:47disruptekAraq: --cc:env feels like it was added just to make supporting zig harder.
21:26:15*solitudesf quit (Ping timeout: 256 seconds)
21:26:26Araq*shrug*, I did it with the best intentions
21:26:33FromDiscord<shashlick> here's the other fun - nimterop compiles plugins using nim so if you are mixing glibc and musl, you can have toast built with glibc trying to load a plugin built with musl, or vice versa
21:26:48disruptekit's no big deal, but i had to write a shim.
21:27:31AraqIMHO you should stop messing around with musl and write system.nim Nim code that doesn't need a libc
21:28:00Araqor accept that libc is kinda part of the OS and you don't replace it.
21:28:14Araqand that Linux isn't an OS but a family of OSes
21:28:17leorizeit's for supporting building 3rd party libraries inline with a nim build
21:28:54*narimiran quit (Ping timeout: 260 seconds)
21:29:38leorizeI can write you syscall-based Nim if you pay me enough :P
21:30:10disruptekthere's a job in the ic department opening up soon.
21:30:16leorizeStatus did at least 30% of the work with their io.nim rewrite
21:32:07leorizedisruptek: you dropping out of ic dev or are you looking for more man power?
21:32:22disruptekyes.
21:32:55disruptekactually, i did just figure out where this aliasing issue is coming from.
21:34:53Araqleorize: I'd pay you for Windows syscalls, you have to work for free for Linux support
21:36:04leorizeno one in their right mind would call Windows syscalls directly, even Go do it via their dlls
21:36:43disruptekthat's why he suggested /you/ do it.
21:36:47Araqcan't betray Linux's ideas about dysfunctional money-less societies
21:37:09FromDiscord<shashlick> why cannot ag search recursively
21:38:13disrupteknewSeq(int): TaintedString = ... yay
21:38:24disrupteknewSeq(int): seq[TaintedString] = ... rather
21:38:52Araqso ... the aliasing issue comes from tyAlias?
21:39:06Araqleorize: well kernel.dll stuff is fine
21:39:16Araqno need to go deeper than that
21:39:34leorizeI should be available this winter break, and I'll let you know then if I can take up on the job :P
21:39:38disruptekthe typeCache in /some/ modules knows it as seq[String] and others seq[TaintedString].
21:40:08disruptekor anyway, the names those have mangled to. since they have the same hash...
21:40:25Araqthe trick is to skip tyAlias
21:40:33disruptekthe trick is to /not/ skip it.
21:40:56Araqtrust me.
21:41:17disrupteki know what you're saying, but i'd rather have Tainted sig out with a different value.
21:42:25Araqand I don't. skipping is the only sane option and type aliases are a misfeature already
21:42:40AraqTainted is only important if it's a 'distinct' type
21:43:04disruptekokay, but we don't track distinct, either.
21:46:25Araqwhy not?
21:46:47*apahl quit (Ping timeout: 240 seconds)
21:46:56disruptekprobably because there's no point in the backend.
21:47:28disruptekit's like you always say: the problem isn't where you think it is.
21:47:50*apahl joined #nim
21:47:54disruptekthe issue is simply that we overwrite the typeCache value that /was/ seqString with seqTaintedString.
21:48:28disruptekit is output in proc params, but the problem arises when we are generating code for a proc body with a TaintedString rettype.
21:48:53disruptekand this resets the cache. which has the same signature because duh, strings are taintedstrings, etc.
21:49:48Araqwhy do you use the cache? it was written for generating unique hashes
21:50:05Araqanyhow, you'll figure it out, good night
21:50:09disruptekpeace.
21:50:23disruptekgetTypeDescAux has always used the cache.
21:50:27*nature quit (Quit: WeeChat 2.9)
21:59:22Araqmy name mangler never used getTypeDescAux
22:00:14disruptekwhat do you think getTypeName does?
22:13:50Zevvdisruptekkkkk
22:16:02PrestigeI'm writting a proc to swap elements in a doubly linked list. Is there a more sane way to do this? https://play.nim-lang.org/#ix=2zxo
22:16:24PrestigeI haven't put in nil checks yet, just getting a concept going
22:17:16Prestigemaybe I could just swap the values, lol
22:19:16disruptekZevv: dude.
22:19:44disruptek!last clyybber
22:19:45disbotclyybber spoke in 12#nim 11 hours ago 12https://irclogs.nim-lang.org/02-10-2020.html#10:48:52
22:26:27FromDiscord<shashlick> why is musl-gcc being picked by default on ubuntu after installing musl-tools
22:33:40FromDiscord<shashlick> somehow nim is always using musl-gcc even after i've uninstalled it
22:33:52disruptekneat.
22:34:36FromDiscord<shashlick> ugh, nim.cfg in parent dir in wrong place
22:34:37FromDiscord<shashlick> life's good
22:38:09FromDiscord<Eleven> Is Nim a good alternative to Data Science?
22:40:12disruptekZevv: you here?
22:40:20FromDiscord<Vindaar> Well, it's still missing some stuff you might want. But more and more is being developed and to me we're at a decent spot already, @Eleven
22:41:02FromDiscord<Eleven> thanks guy :3
22:41:11FromDiscord<Vindaar> what do you do / need most?
22:42:17FromDiscord<Eleven> study the data science base and then work with it
22:42:18voidpivindaar: your ggplot looks awesome
22:43:16FromDiscord<Vindaar> @Eleven sorry, I don't follow :/↡@voidpi Thanks! Feel free to let me know what is missing for you!
22:43:56FromDiscord<Eleven> good brother, good night ^^
22:45:58Zevvdisruptek: a bit
22:46:00Zevvsup
22:46:03Zevvwas about to nap
22:46:14ZevvI nimmed tonight
22:46:18Zevvloong time ago
22:46:32disruptekwut
22:46:39Zevvyessss
22:46:43Zevvat least a month
22:46:49Zevvfeels great man
22:46:51Zevvnimmin'
22:47:22voidpivindaar: thanks, I want to retry some plot9 stuff I did with ggplot-nim
22:47:26disruptekum, so i have a generic instance of an alias that is turned into something that is not an alias.
22:47:43disruptektrying to decide if this is a nim bug. if it's not a bug, it's a huge pita for me.
22:48:23Zevvdude
22:48:25disruptekmy type is tyString with a symbol of skType named TaintedString.
22:48:37disrupteklike, what is it even?
22:49:07FromDiscord<Vindaar> voidpi: cool! Some stuff may still not work of course. I did already port over the periodic table from the plotnine docs, haha https://github.com/Vindaar/ggplotnim/blob/master/recipes.org#fun-with-elements
22:50:57Zevvdisruptek: I am no longer of any use to you
22:51:07ZevvI have become utterly dumb
22:51:11Zevvstupid
22:51:11voidpivindaar: fucking nice!
22:51:12Zevvsimple
22:51:15disruptektoo much brew, eh?
22:51:29disruptekwhat did you read tonight?
22:51:37Zevvtoo much shouting, complaining, hacking
22:52:14ZevvI'm making a high performance event viewer; i got gazillions of things happening in logs, all timing critial. I want to visualize because I have no clue wat all this stuff is doing
22:52:24Zevvpeople mashing stuff and stuff and more stuff in elastic search
22:52:30Zevvand not a soul knows how to look at it
22:52:40Zevvthey come up with crappy "dashboard" and "big data" things
22:52:54disruptekwell, yes. kinesis etc.
22:52:57Zevvthat crunch and crunch and eat CPU and still only create whirling sprays of vomit
22:53:43disruptekthat sounds like a fragrant problem.
22:54:16ZevvThis is todays fruit: http://zevv.nl/div/2020-10-03%2000-50-29.mkv
22:54:31Zevvmaking the zoomable pannable time window was the hardest thing
22:54:48Zevvgrid fading in when resolution changes from month to day to hour to minute to second to millisecond
22:54:58Zevvnow the events need to go look like something nice
22:55:08Zevvput in little graphs and shit
22:55:12Zevvit will be sooo nice
22:55:29disruptekwhat is it, d3?
22:55:35Zevvwhat is d3?
22:55:46Zevvno it's just raw sdl2
22:55:49disruptekjs canvas svg etc.
22:55:53ZevvI want 60fps at least
22:55:56ZevvI have *no* patience
22:56:25Zevvthere is probably soooo many things doing just this soo much easier
22:56:49Zevvthis is my crap. there is many more like it. but this crap is mine
22:56:58disruptekuh, noted.
22:57:23disrupteki wouldn't have a clue how to sdl.
22:57:32Zevvneither did I
22:57:53Zevvyou have no shortage of stuff you had no clue about
22:57:54disruptekfeels like too much work.
22:58:10Zevveverything feels like too much work
22:58:14Zevvuntil you had a beer of two
22:58:34disruptekomg i had such a nightmare getting this car up here.
22:58:42disruptekwas my own fault, but still...
22:58:53disruptekthe gods didn't want to help.
22:59:03voidpiZevv: looks awesome
23:01:34Zevvjust wait
23:01:37Zevvit looks like shit now
23:09:24Zevvsorry I'm not any help disruptek
23:09:55Zevvwould love to hack on stuff some time again, really
23:10:01disruptekit's okay, i will take it out on you later.
23:10:20Zevvdo your best
23:11:05disrupteki need to hit you up for help on frosty, too.
23:12:53Zevvjust memcpy that shit and whack it through a pipe
23:12:55Zevvhow hard can it be
23:13:55disruptekoh right, i forgot.
23:14:45Zevvthere you have it
23:14:49Zevvglad to be of service
23:14:56disruptekdude, you're the best.
23:15:05disrupteksleep tight, zevv.
23:16:30Zevvthanks man
23:16:32ZevvZzzZ
23:24:10*dv-^_^61939 joined #nim
23:28:07*dv-^_^6193 quit (Ping timeout: 260 seconds)
23:34:58*NimBot joined #nim
23:36:18FromDiscord<Avatarfighter> this was the most wholesome interaction I've seen in ages
23:40:33FromDiscord<Rika> and disrupt.k is a participant, really surprising innit?
23:41:33FromDiscord<Avatarfighter> it brings a tear to my eye
23:41:54*thomasross quit (Ping timeout: 260 seconds)
23:44:42*abm joined #nim