00:05:50*madpata joined #nim
00:08:08*TomDotTom joined #nim
00:19:50FromDiscordUptime - 1 day, 5 hours, and 4 minutes
00:21:32FromDiscord<Yardanico> why there's only 1 letter difference in idiom vs idiot 🤔
00:21:44*manjaroi3_ joined #nim
00:22:24*manjaroi3_ quit (Client Quit)
00:25:02*TomDotTom quit (Ping timeout: 265 seconds)
00:27:26FromDiscord<Elegant Beef> Cause some idioms are idiotic
00:29:21FromDiscord<Yardanico> or some idiots are idiomatic?
00:36:34Yardanicoxioren: https://www.youtube.com/watch?v=rg_Pam__I8o has a bit similar tone
00:36:51Yardanico(warning: psychedelic images in the video :P)
00:38:39*arecacea1 quit (Remote host closed the connection)
00:38:42Yardanicomy full playlist is https://www.youtube.com/playlist?list=PLnthTbhS8ZO9m8nkK25JYC4CIphFvHk7r and it's very random
00:39:14*arecacea1 joined #nim
00:41:08xiorenwill bookmark it
00:50:12FromDiscord<InventorMatt> is this supposed to cause an error https://play.nim-lang.org/#ix=2AYw ?
00:50:45*abm quit (Quit: Leaving)
00:51:35FromDiscord<InventorMatt> how come having a bracket parameter prevents that borrow pragma from working then?
00:52:02disruptekborrow works to import a proc from the source type to the distinct.
00:52:13disruptekyour distinct type lacks a generic V in its definition.
00:52:33disruptekthe `.` operator isn't a thing without {.experimental: "dotOperators".}
00:53:14disruptekalso, you perform the borrow like this: proc `.`[V](x: Bar[V]; field: string) {.borrow.}
00:55:59FromDiscord<InventorMatt> that is causing a new error https://play.nim-lang.org/#ix=2AYx
00:56:22FromDiscord<InventorMatt> saying there is no symbol to borrow from
00:56:32disruptekyes, well there wouldn't be, right?
00:57:12disruptekyou just defined Foo. you need to define `.`[T](x: Foo; field: string): T first.
00:57:34disruptekor whatever. i forget the syntax for `.`().
00:57:41disruptekit's in the experimental docs.
00:57:44disbot9concepts: 11user-defined type classes; documented in the experimental section of the manual: https://nim-lang.org/docs/manual_experimental.html#concepts -- 7disruptek
00:58:29FromDiscord<InventorMatt> yeah, i was just following the manual for that section and was wondering why adding the bracket paramater makes it stop working versus a normal distinct type
00:58:59disruptekbecause it's meaningless without a V on the rhs.
01:00:57FromDiscord<InventorMatt> i'm trying to convert arraymancer tensors into fixed size matrices using distinct types and using that was my best guess for creating shapes
01:02:06disruptekthe V is a variable that represents a type, or in the case of a static, a value. you have to use it on both sides of the assignment for it to have meaning to the compiler.
01:04:07FromDiscord<InventorMatt> okay, I guess my idea for it is a dead end then
01:04:09YardanicoI guess it's time to join the cool kids club and make my README for my github profile
01:04:22Yardanicos/my R/a R
01:04:36disruptekyour idea for it isn't a dead end, but it's challenging to use static generics.
01:06:24FromDiscord<InventorMatt> https://play.nim-lang.org/#ix=2AYB well this was my current idea for it.
01:06:42FromDiscord<InventorMatt> but it seems as though I'll need to try a different approach
01:07:56disrupteki use some static generics here:
01:07:59disruptek!repo gram
01:07:59disbot12https://github.com/disruptek/gram -- 9gram: 11Generic graphs in Nim 15 11⭐ 1🍴 7& 4 more...
01:08:21disruptekit's a pain in the ass, honestly.
01:10:05*madpata quit (Ping timeout: 240 seconds)
01:11:04*xioren quit (Quit: leaving)
01:11:57Yardanicodidn't know github would step that low
01:12:12Yardanicosecond command will basically forcefully rename the current branch to "main"
01:12:22Yardanicoand they don't even mention that this will do that
01:12:49Yardanicothat's IMO not very cool
01:13:00disruptekweird. it's almost like they expect you to know how to use git on github.
01:13:13Yardanicodisruptek: well tons of people who use github don't really know how to use git
01:13:18Yardanicothey use IDEs and github's web interface
01:13:20Yardanicoand never touch the cli
01:13:35Yardanicoi didn't execute that command though :)
01:24:37*pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
01:26:14*pbb joined #nim
01:29:03PrestigeYardanico: Yeah, that's kinda crazy.
01:29:04*pbb quit (Client Quit)
01:29:17Yardanicoyou can change it, yes, but they made it "main" by default for ALL github users
01:29:26Yardanicoyou can change it in https://github.com/settings/repositories
01:29:29*pbb joined #nim
01:29:34*pbb quit (Client Quit)
01:30:40leorize[m]I don't mind "main" as default, but forcing a branch name change on an established repo is kinda ass
01:31:23Yardanicowell, it's kind of tricky as well, they don't "force" since people can use different commands, but a lot of people will just copy-paste or re-type :)
01:31:43FromDiscord<Avatarfighter> i wont lie what yard said is making me wonder if i know how to make a git commit from the cli
01:31:52Yardanicogit add changed_file
01:31:55Yardanicogit commit -m "my message"
01:32:06FromDiscord<Avatarfighter> *shudders*
01:32:45*apahl quit (Ping timeout: 272 seconds)
01:34:17*apahl joined #nim
01:35:51PrestigeGit gui programs make me nervous
01:36:04PrestigeWhat will the button do!?
01:39:12*pbb joined #nim
01:42:19FromDiscord<Avatarfighter> yall use git? I just zip up my projects and title it "really works this time 1a"
01:42:30*xioren joined #nim
01:43:49FromDiscord<Avatarfighter> Oh wow thats a fun project idea
01:43:59FromDiscord<Avatarfighter> BudgetGit incoming
01:49:15*user0 joined #nim
02:01:31*a_chou joined #nim
02:25:53*gmaggior quit (Quit: Leaving)
02:29:09*a_chou quit (Remote host closed the connection)
02:39:25*muffindrake quit (Ping timeout: 240 seconds)
02:41:52*muffindrake joined #nim
02:51:01leorize[m]congrats you've invented cvs
02:54:34FromDiscord<Kreggy> rod
02:54:43FromDiscord<Kreggy> https://media.tenor.com/images/78577aa3c4ea9800563c83ff894da411/tenor.gif
02:54:44FromDiscord<Kreggy> https://media.tenor.com/images/78577aa3c4ea9800563c83ff894da411/tenor.gif
02:54:44FromDiscord<Kreggy> https://media.tenor.com/images/78577aa3c4ea9800563c83ff894da411/tenor.gif
02:54:45FromDiscord<Kreggy> https://media.tenor.com/images/78577aa3c4ea9800563c83ff894da411/tenor.gif
02:54:46FromDiscord<Kreggy> https://media.tenor.com/images/78577aa3c4ea9800563c83ff894da411/tenor.gif↵https://media.tenor.com/images/78577aa3c4ea9800563c83ff894da411/tenor.gif
02:54:47FromDiscord<Kreggy> https://media.tenor.com/images/78577aa3c4ea9800563c83ff894da411/tenor.gif
02:55:40FromDiscord<j❗> nimrod :troll: :troll: :troll: :troll:
02:55:43FromDiscord<j❗> https://media.discordapp.net/attachments/371759389889003532/766856939082219561/image0.gif
02:55:43FromDiscord<j❗> https://media.discordapp.net/attachments/371759389889003532/766856940545376257/image0.gif
02:55:48FromDiscord<j❗> https://media.discordapp.net/attachments/371759389889003532/766856960200015872/image0.gif
02:55:50FromDiscord<j❗> ☹️ https://media.discordapp.net/attachments/371759389889003532/766856969112780801/image0.gif
02:55:54FromDiscord<j❗> nobody else
02:55:55FromDiscord<j❗> Is here
02:56:00FromDiscord<Kreggy> I am here
02:56:02FromDiscord<j❗> Mods dont even do shit
02:56:03FromDiscord<j❗> wtf
02:56:03FromDiscord<Kreggy> The server is dead
02:56:07FromDiscord<j❗> yeah wtf
02:56:14FromDiscord<j❗> No point
03:00:15FromDiscord<colonthree> nimrod
03:03:48FromDiscord<Yardanico> -2
03:03:58FromDiscord<Elegant Beef> Now on a scale of 0-10 how dumb would it be to make a PR wit this? https://github.com/beef331/Nim/commit/328b9d7638cb65d0e4d38dc0eb2b0b4b6c575a31
03:04:22*krux02 quit (Remote host closed the connection)
03:14:45FromDiscord<Elegant Beef> Cheers!
03:20:50leorize[m]@Yardanico sometimes I wish delete relays over to IRC :P
03:21:11FromDiscord<Yardanico> yeah these people were weird
03:21:22FromDiscord<Yardanico> Maybe they enjoy finding servers and spamming on them
03:22:19FromDiscord<Yardanico> I should've used the bridge's commands to ban them though, missed such an opportunity for a test :)
03:24:40FromDiscordUID of Yardanico who sent/edited a message most recently on Discord is 177365113899057152
03:25:15leorize[m]I wonder when will Nim get popular enough to warrant a #nim-jobs channel
03:25:40Yardanicowe already published a status job offer in discord announcements
03:25:55leorize[m]that's only one company
03:29:18leorize[m]wow Nim is still on the second page of HN
03:37:57FromDiscord<Yardanico> magic
03:46:01leorize[m]I guess we will have to wait for Araq to answer that one :P
03:46:28leorize[m]why are people so dead set on "it has to specialize into something"
03:47:14leorize[m]I'd say that Nim is designed to be better than anything else :P
03:47:18Prestigeworld domination!
04:00:50FromDiscord<PizzaFox> nim compiler should emit efficient code for all build targets right
04:01:01FromDiscord<PizzaFox> surely js target can be optimized to not be so slow
04:02:39FromDiscord<PizzaFox> most obvious things is the unnecessarily large amount of code it emits
04:02:51leorize[m]someone actually benchmarked that mess
04:02:54leorize[m]it's fast
04:03:21FromDiscord<PizzaFox> i can make it faster 😈
04:03:23FromDiscord<Yardanico> @PizzaFox try -d:danger but really it isn't slow
04:03:45FromDiscord<PizzaFox> i will now begin some nonscientific auditing of nim js compilation
04:04:15leorize[m]this result is reallly old by now, so take it with a grain of salt
04:04:40Prestigedang, over 3 years ago
04:04:45FromDiscord<PizzaFox> v8 probably has gotten a lost faster since then
04:04:47FromDiscord<PizzaFox> wasm too i imagine
04:05:09leorize[m]and the JS backend received some optimization since
04:05:10FromDiscord<PizzaFox> plus that was a month before firefox quantum
04:05:51leorize[m]spidermonkey is never gonna be fast tbh
04:06:00FromDiscord<PizzaFox> microsoft jscript best runtime
04:06:01*supakeen quit (Quit: WeeChat 2.9)
04:06:09FromDiscord<PizzaFox> apples webkit one is unironically crazy fast
04:06:15FromDiscord<PizzaFox> lemme find this regex benchmark
04:06:37*supakeen joined #nim
04:07:06leorize[m]don't know if jscore is actually faster than spidermonkey
04:07:52leorize[m]on linux you can use gnome web (webkit-based) to run the bench
04:08:05leorize[m]on windows there aren't any browser based on webkit though
04:08:48FromDiscord<PizzaFox> https://media.discordapp.net/attachments/371759389889003532/766875332128014366/69646362.png
04:09:10FromDiscord<PizzaFox> this is log scale https://media.discordapp.net/attachments/371759389889003532/766875426462498866/69646238.png
04:09:11*arecacea1 quit (Remote host closed the connection)
04:09:35*arecacea1 joined #nim
04:09:47FromDiscord<PizzaFox> (edit) 'this is' => '⬆️ linear and' | 'scale' => '⬇️'
04:11:23FromDiscord<PizzaFox> > Python is clearly the loser↵i think of this nim blog quote once again
04:11:51leorize[m]jscore is faster than rust what?
04:12:02FromDiscord<PizzaFox> for that specific regex, yes
04:12:52FromDiscord<Elegant Beef> 0/10 no nimscript there
04:13:09FromDiscord<PizzaFox> i asked the graph creator for their data
04:13:11leorize[m]can nim-regex match at ct?
04:13:47FromDiscord<Elegant Beef> No dont think so
04:14:08FromDiscord<Elegant Beef> It's an impure library no?
04:14:19leorize[m]nim-regex is pure nim
04:14:32FromDiscord<Elegant Beef> Ah my bad
04:14:33leorize[m]!repo nim-regex
04:14:34disbot12https://github.com/nitely/nim-regex -- 9nim-regex: 11Pure Nim regex engine. Guarantees linear time matching 15 97⭐ 13🍴 7& 2 more...
04:15:19FromDiscord<PizzaFox> https://docs.google.com/spreadsheets/d/15k6LZjn6t_lpF4k1f5UNuFf2egLbfKwGO9gSUei4COY/edit
04:15:39FromDiscord<PizzaFox> csv for future generations reading the chatlogs https://media.discordapp.net/attachments/371759389889003532/766877058885615626/RegExp_Benchmarks_-_Sheet1.csv
04:17:01leorize[m]it's useless without the benchmark code :P
04:17:17FromDiscord<PizzaFox> just realized
04:19:38FromDiscord<PizzaFox> well the benchmarks are pretty self explanatory
04:19:57FromDiscord<PizzaFox> only compiled lang there is rust which is just `cargo run --release`
04:21:36FromDiscord<slymilano> hello gents! I have a `seq[Person]` how can I render that seq as json in jester? i hope i don't have to define my own operator 😦
04:22:33leorize[m]@slymilano `import json; echo %seqHere`
04:22:36FromDiscord<PizzaFox> can a Person be represented in json
04:23:22leorize[m]```json.`%` ``` can convert just about anything into json
04:23:23FromDiscord<slymilano> damn it feels good, looking great! thank you leorize
04:23:33FromDiscord<slymilano> import json and badabing
04:27:23*shinzo joined #nim
04:36:25*NimBot joined #nim
04:39:03FromDiscord<Elegant Beef> Still concerned how not do bodge arround incorrect nimscript using `evalScript`
04:39:04*user0 quit (Ping timeout: 272 seconds)
04:53:17leorize[m]Zevv saw this on HN https://news.ycombinator.com/item?id=24804223
04:54:11FromDiscord<PizzaFox> looks cool
05:06:10Zevvtoooo late
05:06:24ZevvI GPLed :)
05:06:42Zevvbut it is indeed kind of what I needed the other day, thanks man
05:16:16FromDiscord<slymilano> Is Jester latest broken for anyone else? I'm getting build errors on my github action. https://github.com/sergiotapia/torrentinim/runs/1267664511
05:16:32FromDiscord<slymilano> `/home/runner/.nimble/pkgs/jester-0.4.3/jester.nim(704, 26) Error: undeclared identifier: 'initInterval'`
05:19:39*solitudesf joined #nim
05:23:36FromDiscord<flywind> Use [email protected]#head if using latest Nim version.
05:28:32FromDiscord<slymilano> Thanks for the tip, I actually specified my nim version to 1.2.6 as opposed to `stable`
05:36:51leorize[m]@dom96 you should tag a new jester version
05:40:04FromDiscord<PizzaFox> hey guys remember that regex benchmarking thing
05:40:15FromDiscord<PizzaFox> idk if i am at fault here but i uhh ummm
05:40:22FromDiscord<PizzaFox> nim is crazy crazy slow
05:41:08FromDiscord<PizzaFox> https://play.nim-lang.org/#ix=2AZn
05:41:11FromDiscord<flywind> I remember `nim-regex` was slower than stdlib.
05:41:20FromDiscord<PizzaFox> using regular `re` from stdlib
05:41:57FromDiscord<PizzaFox> sent a code paste, see https://play.nim-lang.org/#ix=2AZo
05:43:26FromDiscord<PizzaFox> its literally 10x slower than python
05:43:31FromDiscord<PizzaFox> how is this possible
05:43:39FromDiscord<PizzaFox> is pcre that unoptimize
05:43:41FromDiscord<PizzaFox> (edit) 'unoptimize' => 'unoptimized'
05:46:01FromDiscord<flywind> what's your compilation flags?
05:46:09FromDiscord<PizzaFox> -d:release
05:46:20FromDiscord<PizzaFox> also i possibly am stupid 1 sec lemme perform sanity check
05:47:49FromDiscord<flywind> Could you benchmark more basic operation? I think your program contains lots of string allocation.
05:48:21FromDiscord<PizzaFox> i will make a repo shortly
05:48:24FromDiscord<PizzaFox> 1 sec
05:49:19FromGitter<jrfondren> what are you benchmarking there? I would expect a regex benchmark to run a regex against a bunch of text.
05:50:03FromDiscord<PizzaFox> simply wait for my repo
05:50:07FromDiscord<flywind> https://github.com/nitely/nim-regex/pull/58
05:50:09disbot➥ 6NFA macro + better NFA matcher
05:50:39FromDiscord<flywind> Some benchmarks between `re` and `nim-regex`.
05:52:16FromDiscord<flywind> https://github.com/mariomka/regex-benchmark
05:52:50FromDiscord<flywind> This regex benchmark shows that re is really fast in some operations.
05:56:22FromDiscord<nikki> is it possible to do enough flow analysis to build something like rust's borrow checker using just nim macros? even if say you have to wrap the code with the macro, or annotate parameter and return types in functions with borrowing tags (eg. returns / takes an owned vs. borrowed ref and so on)
05:57:24FromDiscord<nikki> (independently of how useful / effective / tractable that would be in practice, just about the possibility)
05:59:24FromDiscord<Elegant Beef> I believe 1.4 introduces features have borrow checking
05:59:28FromDiscord<Elegant Beef> (edit) 'I believe 1.4 introduces features ... have' => 'I believe 1.4 introduces featuresto'
06:07:03FromDiscord<PizzaFox> ok repo is here https://github.com/pizzafox/regex-bench
06:07:08FromDiscord<PizzaFox> for regex benchmarks
06:07:16*xioren quit (Quit: leaving)
06:07:31FromDiscord<PizzaFox> (edit) 'benchmarks' => 'benchmarks↵unfortunately my gcc has totally fucked itself and i cant install libc anymore, so someone else please bench it'
06:09:26*leorize quit (Remote host closed the connection)
06:10:15*leorize joined #nim
06:13:56leorize[m]@nikki you can but it's impractical
06:14:38leorize[m](not to mention the amount of bugs you might stumble along the road)
06:16:18FromGitter<jrfondren> PCRE isn't slow, but this is a benchmark designed to punish it. I think https://github.com/jrfondren/topsender-bench is a lot more realistic as a test, though that's old and you can't even run it without a large exim log handy. That one just runs a single reasonable regex against a bunch of text, and then reports on it. (the higher nim times there are due to an ancient defect in CountTable.sort)
06:16:58FromGitter<jrfondren> I ran your benchmark anyway with hyperfine and get Rust as 3.66 times faster than Python, and 666 times faster than Nim.
06:16:58leorize[m]looks like I'll get to try rust
06:19:08FromDiscord<Elegant Beef> "get to"?
06:19:32leorize[m]@PizzaFox nim-regex is much much faster, try that instead
06:19:40FromDiscord<PizzaFox> >:(
06:19:42FromDiscord<PizzaFox> ok
06:21:18FromGitter<jrfondren> it might be faster on benchmarks exactly like this, and not at all in practice. Actually I just remembed, the 30s time there is nim-regex, and although it's an ancient regex people said the same thing to me at the time. Oh just use this, it's better.
06:22:40FromGitter<jrfondren> if you're not building regexes at runtime from potentially abusive input then this stuff just doesn't matter at all. A regex like a?a?a?a?a?a?aaaaa is a bug.
06:25:28leorize[m] that's the pitfall of micro benchmarks
06:30:23*leorize quit (Ping timeout: 240 seconds)
06:42:44FromDiscord<nikki> maybe nim's compile time code stuff is a good fit for compile time construction of a regex matcher
06:42:51FromDiscord<nikki> that then optimizes down
06:43:08FromDiscord<nikki> https://github.com/hanickadot/compile-time-regular-expressions
06:43:40FromDiscord<nikki> ^ like this except in a lang where u can actually use the normal lang for compile time stuff in a normal way
06:44:44leorize[m]we have npeg for PEGs that can construct a parser at compile time
06:44:46leorize[m]!repo npeg
06:44:47disbot12https://github.com/zevv/npeg -- 9npeg: 11PEGs for Nim, another take 15 120⭐ 7🍴
06:44:58leorize[m]nim-regex can also do that iirc
06:45:16*leorize joined #nim
06:45:40FromDiscord<nikki> kewl
06:58:54Zevvkewl, right!
07:10:15leorize[m]hmm, there's a ~6 months gap between 1.0.0 and 1.2.0
07:10:26leorize[m]and ~6 months gap between 1.2.0 and 1.4.0
07:10:33leorize[m]we, uh, got a schedule now?
07:13:58FromDiscord<flywind> sent a code paste, see https://play.nim-lang.org/#ix=2AZD
07:14:52FromDiscord<flywind> I think macros/templates doesn't like generics, I have to use `mixin`.
07:15:37leorize[m]it's an expected interaction
07:16:12FromDiscord<flywind> Is it documented?
07:17:25FromDiscord<flywind> But people may be not know `await` is a templates.
07:17:32FromDiscord<flywind> (edit) 'may be' => 'maybe'
07:17:48FromDiscord<flywind> It just gave: Error: undeclared identifier: 'await'
07:20:35leorize[m]like everything related to asyncdispatch, it's not fully documented
07:21:09FromDiscord<flywind> yea, I agree.
07:26:35FromGitter<jrfondren> s/asyncdispatch/nim/ . `let x, y = (1, 2)` has a warning, but it doesn't have documentation, and I just wrote a program to confirm that `let x, y = SomeObj(1, 2)` constructs two objects. Just before that I re-learned that re's =~ has an implicit ^ anchor, unlike other languages with the syntax, and there spent some minutes WTFing before carefully working it out in inim. The 're' docs don't spell this out.
07:30:28leorize[m]would you mind creating a PR/issue for `re` behavior?
07:31:22leorize[m]I actually never know that `let x, y = (1, 2)` is possible
07:31:27leorize[m]ping Araq I guess?
07:31:54FromGitter<jrfondren> ping him about it being possible? It has a dedicated warning.
07:32:05FromGitter<jrfondren> it makes sense as a generalization of `var x, y: int`
07:32:36leorize[m]yea but I'm not sure if the behavior when something is assigned is documented in the spec
07:35:48FromGitter<jrfondren> of re... it looks like I never creating anything for that. I probably talked about it here and then left it at that. It's normal to learn things about a language, so once I griped about how surprising it was I probably accepted it as something I'd learned, without noticing the oddity: that it's not normal to learn things and then not find those things documented clearly
07:37:02FromGitter<jrfondren> I'm writing this stuff down now. I'll see about contributing it back
07:37:09supakeendom96: I updated the parseHeader PR, if that's the right way to do it I have no problem also taking a stab at how it's used in asynchttpserver/friends.
07:52:20*vicfred quit (Quit: Leaving)
08:04:36FromDiscord<acek7> oh man theres so much more organization now
08:08:54FromDiscord<Elegant Beef> Huh?
08:09:08FromDiscord<acek7> the channels are organized
08:09:14FromDiscord<acek7> i havent checked iin a bit
08:12:44FromDiscord<Elegant Beef> Ah, yea it was very disordered
09:17:15*Vladar joined #nim
09:32:51*kenran joined #nim
09:36:30FromDiscord<Recruit_main707> compiling with --threads:on makes the program slower when you dont use them...
09:42:42*hnOsmium0001 quit (Quit: Connection closed for inactivity)
09:43:58*arecacea1 quit (Remote host closed the connection)
09:44:30*arecacea1 joined #nim
09:45:58*Zeedox joined #nim
09:50:05*kenran quit (Ping timeout: 240 seconds)
09:52:30*nature joined #nim
09:54:59FromGitter<jrfondren> how much slower?
10:03:11*bung joined #nim
10:05:12*FromGitter quit (Remote host closed the connection)
10:05:12*oprypin quit (Quit: Bye)
10:05:30*oprypin joined #nim
10:05:42*FromGitter joined #nim
10:22:08FromDiscord<dom96> > @dom96 you should tag a new jester version↵@leorize[Matrix] will do
10:39:14bungthe asyncdispatch.addRead called when start reading or after reading ?
10:50:21FromDiscord<dom96> when you want to do a read
10:53:23bungok I get it.
10:57:10FromDiscord<dom96> New Jester version tagged 🙂
10:58:10FromDiscord<dom96> choosenim ends up installing itself to CWD...
10:58:16FromDiscord<dom96> that's a pretty showstopper bug
11:02:19FromGitter<jrfondren> oh, choosenim also doesn't work on CentOS 6. That's end-of-lifed in a month
11:20:27*fredrikhr joined #nim
11:21:49FromDiscord<dom96> 0.7.0? or the earlier version
11:22:03FromDiscord<dom96> the newest version should work hopefully on anything, since it's all statically linked now
11:24:00*Zeedox quit (Remote host closed the connection)
11:24:22FromGitter<jrfondren> the one you get from `curl https://nim-lang.org/choosenim/init.sh -sSf | sh`. it definitely requires a glibc newer than 2011 edition
11:24:49FromGitter<jrfondren> looks like that's 0.6.0
11:26:42FromGitter<jrfondren> choosenim-0.6.0_linux_amd64 . It actually still wouldn't work if it were statically linked though, because the system gcc on CentOS 6 is too old to build Nim's pregenerated C sources
11:27:39FromGitter<jrfondren> solution is to use a newer build system through SCL. This isn't a hit on Nim. Pretty much anything not old enough to have a CentOS 6 rpm is going to hit this.
11:28:05FromGitter<jrfondren> I just mentioned it because I'd just tried to use choosenim on a CentOS 6 box.
11:52:30*hyiltiz quit (Remote host closed the connection)
11:54:40*krux02 joined #nim
12:01:28federico3dom96: Nimble appears to be missing in the source package on https://nim-lang.org/install_unix.html
12:03:52FromGitter<jrfondren> nimble's built by the './koch tools' step
12:06:01*supakeen quit (Quit: WeeChat 2.9)
12:06:33*supakeen joined #nim
12:34:23bungsend a codepaste https://play.nim-lang.org/#ix=2B0Y how to simplely make this work, variable conn is outside of callback
12:48:31FromDiscord<PizzaFox> javascript and c have such similar syntax you could just use c2nim on js code right
12:49:24FromDiscord<PizzaFox> (edit) 'javascript and c have such similar syntax you could just use c2nim on ... js' => 'javascript and c have such similar syntax you could just use c2nim on(some)'
12:54:35dv^_^int c = 2; foo(&c); how do I do this in nim?
12:54:55ehmryhow often does this tarball change? -> https://nim-lang.org/download/nim-1.4.0.tar.xz
12:55:36*noonien joined #nim
12:57:42FromGitter<jrfondren> dv^_^: https://play.nim-lang.org/#ix=2B12
12:59:05dv^_^jrfondren: hmm ok thanks
12:59:32supakeendv^_^: https://play.nim-lang.org/#ix=2B16
13:02:10dv^_^what about struct widget { shared_ptr<int> val; } w; shared_ptr<int> c = make_shared<int>(2); w.val = c
13:02:38supakeenI can't read C++, what does that do?
13:02:52dv^_^basically I have a widget, and I want a pointer to some int that changes all the time
13:02:56dv^_^a UI widget
13:03:14dv^_^or a reference. preferably safe code
13:03:30leorize[m]federico3: that's my fault, I got a brainfart writing this code: https://github.com/nim-lang/nightlies/blob/43d01629621ce879ef81e130e42ff05cd6c0702e/.github/workflows/nightlies.yml#L225
13:03:38supakeenI don't think that can be done safely but what jrfondren showed gets close, you can get the unsafeAddr and store it somewhere as they showed.
13:04:19leorize[m]federico3: that will be sorted on later patch releases
13:05:22leorize[m]ehmry: it won't. There was an issue during release which is why it got re-released
13:08:05*noonien quit ()
13:08:14dv^_^supakeen, so what's the pattern to use if I want two variables to point to the same data safely?
13:12:37ehmryleorize[m]: and nimble will be no longer bundled at dist/nimble?
13:13:55FromGitter<jrfondren> dv^_^: https://play.nim-lang.org/#ix=2B1d
13:14:15leorize[m]ehmry: that's largely my fault, I'm patching it but it won't get released until the next patch release
13:16:03ehmryleorize[m]: ok, np
13:20:22bungforget my question.
13:21:29FromGitter<jrfondren> dv^_^: well, better example: https://play.nim-lang.org/#ix=2B1f
13:21:44FromGitter<jrfondren> bung, have you given up on getting an answer or did you figure it out?
13:22:17bungasyncdispatch Callback returns means it will not block asyncdispatch polling ?
13:23:15bungjrfondren first I miss param fd:AsyncFD then the compilation pass, second I change callback returns true otherwise program blocked
13:24:09bungI debug info ouputs to console inside callback seems works correct.
13:24:11*lbart quit (Read error: Connection reset by peer)
13:29:07dv^_^jrfondren, hmm, thanks
13:29:07*lbart joined #nim
13:29:08*lbart quit (Changing host)
13:29:08*lbart joined #nim
13:36:32bunghmm no, it should return false , but it will cause program stucked.
13:38:58*Lord_Nightmare quit (Ping timeout: 260 seconds)
13:45:12bungmy bad `If you use this function, you don't need to use asyncdispatch.send() or asyncdispatch.connect()`
13:53:22bungI notice addTimer when oneshot is false the callback should return false , otherwise oneshot has no meaning
14:03:48*lbart quit (Ping timeout: 256 seconds)
14:06:22*lbart joined #nim
14:06:22*lbart quit (Changing host)
14:06:22*lbart joined #nim
14:14:51*arecacea1 quit (Remote host closed the connection)
14:15:34*arecacea1 joined #nim
14:26:16*njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
14:26:22*njoseph joined #nim
14:43:20FromDiscord<dom96> > dom96: Nimble appears to be missing in the source package on https://nim-lang.org/install_unix.html↵@federico3 yeah, not really my domain anymore I'm afraid
14:54:46*nc-x joined #nim
14:55:22*nc-x quit (Remote host closed the connection)
15:02:15disruptekbob marley sucks.
15:05:14disruptekc'mon, i know you're all thinking it.
15:06:47miprinah I haven't thought about bob marley for almost 40 years now
15:09:42Oddmongerraggae sucks
15:25:25*FromDiscord quit (Remote host closed the connection)
15:25:38*FromDiscord joined #nim
15:25:38disruptekno, it's not reggae, it's his whiny fuckin' voice.
15:26:19FromDiscord<exelotl> 10 year old me agrees with you
15:26:26disruptekhis music is boring, and that's about the worst insult i can think of.
15:32:48*arecacea1 quit (Remote host closed the connection)
15:33:10Zevvthe music was all that brought me to disruptek-tv
15:33:16Zevvhis programming was mediocre, at most
15:33:19Zevvbut the music, man
15:33:21Zevvthe music!
15:33:44disruptekmaybe by the end of the year.
15:33:54FromDiscord<Clyybber> his song has a nice track
15:33:54FromDiscord<Clyybber> https://www.youtube.com/watch?v=AkXVBRV1vWo
15:33:58FromDiscord<Clyybber> *son
15:33:59Zevvwhat happens then
15:34:52disrupteki might learn how to code.
15:39:12*arecacea1 joined #nim
15:47:32FromDiscord<dom96> New choosenim finally released 🙂
15:47:40FromDiscord<dom96> Everybody update via `choosenim update self`
15:47:45disruptekdom96: what do you make of this?
15:48:43FromDiscord<Clyybber> the Prologue failure?
15:48:59disruptekwell, nimble claims head is not >= 1.4.0
15:49:16disruptekyes, it's prologue.
15:49:23FromDiscord<dom96> @shashlick you got a twitter?
15:49:43FromDiscord<dom96> found it
15:50:52FromDiscord<shashlick> Yep what about it
15:51:31FromDiscord<dom96> gonna tweet about new choosenim and wanted to thank you 🙂
15:52:24FromDiscord<shashlick> Oh 👍
15:52:43disrupteki named my 7th daughter shashlick.
15:52:59disruptek$deity's gift to nim.
15:53:00stefantalpalaruNim-1.4 seems to have a more strict "has to be used (or discarded)" check that prevents templates from being used as rvalues. Is there a workaround?
15:54:22FromDiscord<shashlick> I don't use Twitter anymore except to grumble about some product every few years
15:55:54FromDiscord<dom96> shashlick can you test via `choosenim update self`? 🙂
15:56:16disruptekthat's putting the cart before the horse, isn't it?
15:56:23FromDiscord<dom96> just in case I missed something
16:01:41*Prestige quit (Ping timeout: 272 seconds)
16:04:13*Prestige joined #nim
16:06:12FromDiscord<shashlick> Will in a bit
16:06:30FromDiscord<Clyybber> stefantalpalaru: Do you have an example?
16:08:19disruptekAraq: can we gate new concepts or something? they are blocking a few projects now.
16:09:06FromDiscord<Clyybber> whats blocking?
16:09:29disruptekconcepts? i dunno.
16:09:43disrupteki think dict is impl so i'm not sure what remained.
16:09:43FromDiscord<Recruit_main707> https://tenor.com/view/confused-what-nigga-please-really-loop-gif-4966361
16:10:25*Lord_Nightmare joined #nim
16:10:26disruptekdamnit discord.
16:10:28FromDiscord<Clyybber> hmm, what does to gate mean
16:10:28FromDiscord<Clyybber> lol
16:10:35disruptekput behind a switch.
16:10:53FromDiscord<Clyybber> and what needs the new concepts?
16:11:16FromDiscord<Vindaar> dude that gif is hella disorienting
16:11:21disrupteknimph, frosty, jason, i would pretty much use them everywhere.
16:11:35FromDiscord<Clyybber> why don't the current concepts work?
16:11:47FromDiscord<Clyybber> bugs, I guess, but we need reports to fix them
16:11:49disruptekbecause the compiler is dumb.
16:11:57disruptekwe aren't fixing them afaik.
16:12:41FromDiscord<Clyybber> I want to
16:12:59FromDiscord<Clyybber> they are more universal than the new ones
16:13:00disruptekwhy? we already have a new rfc'd impl.
16:13:12FromDiscord<Clyybber> well, its not tested, I doubt its better
16:13:15disruptekiiuc, the differences are merely syntactic.
16:13:47FromDiscord<Clyybber> no, theres some shortcutting, which is fine, but shouldn't be tied to the new syntax
16:13:56FromDiscord<Clyybber> the new syntax can be accomplished by macros as well
16:14:09FromDiscord<Clyybber> I wrote a small prototype demonstrating it
16:14:16disrupteki know, that's my point.
16:14:28FromDiscord<Clyybber> surely frosty isn't blocked by syntax
16:14:31disruptekare you saying the new concepts are a subset of the old ones?
16:14:36FromDiscord<Clyybber> yeah
16:14:51FromDiscord<Clyybber> they can't replace them
16:14:51disruptekwell, i thought we successfully argued against that.
16:15:07disruptekoh, the new syntax is already in?
16:15:19disrupteklet's call the new syntax "user typeclasses".
16:15:44FromDiscord<Clyybber> no its not
16:15:51FromDiscord<Clyybber> its not in devel if you mean that
16:16:02FromDiscord<Clyybber> lets simply not have a new syntax :P
16:16:07disruptekwell, you can run groups in nimph if you wanna see what breaks.
16:16:09FromDiscord<Clyybber> and instead flesh out the macro
16:16:34FromDiscord<Clyybber> disruptek: I probably won't be able to tell what breaks because I can't be sure that its not a user error
16:16:38FromDiscord<Clyybber> and nimph is so big
16:17:03FromDiscord<Clyybber> can't you run dust on it?
16:17:03disruptekyou're just running on file, not the whole thing.
16:17:09FromDiscord<Clyybber> ah ok
16:17:35disruptekdust might work now, if i fix it after araq's breakage. i can't remember if i impl imports for dust.
16:17:56FromDiscord<Clyybber> oh, so the imports are required?
16:17:57disruptekanyway, groups.nim is just a test of concepts.
16:18:14FromDiscord<dom96> Just avoid concepts tapshead.gif
16:18:26FromDiscord<Clyybber> just fix them tapsheadmore.gif
16:18:44disrupteki avoided them for a year. finally asked for the 10th time if they were safe and was told they were.
16:18:58disruptekas soon as i started using them, we got a new impl and i discovered how broken they are.
16:19:03FromDiscord<lqdev> haha! fool
16:19:10disruptekbut i already have a bunch of stuff using them. irritating.
16:19:16FromDiscord<lqdev> you got hooked just like me…
16:19:22disrupteki know.
16:19:28disruptekand the crazy thing is, i knew it.
16:19:31disrupteki fucking knew it.
16:19:32FromDiscord<Clyybber> disruptek: can you minimize it to a self-contained one file thing?
16:19:42FromDiscord<Clyybber> I'll get to it as soon as I'll solve this bug
16:19:43disrupteki dunno, i'm working on mangling.
16:19:50FromDiscord<Clyybber> aight
16:19:53FromDiscord<Clyybber> no hurry
16:19:53disruptekwe can make a date to pair it later.
16:20:12disrupteki gave up on araq's mangling method.
16:20:19disruptekit just doesn't work, "i don't care."
16:20:29FromDiscord<Clyybber> what is the difference
16:20:36disruptekno global analysis.
16:20:50FromDiscord<Clyybber> yours doesn't do global analysis?
16:20:54disruptekmine does.
16:21:33disrupteki will concede that it's possible that a flaw in the frontend is breaking the backend, but i just don't want this pr to touch the frontend if i can help it.
16:21:59FromDiscord<Clyybber> have you tracked it down,?
16:22:01disrupteki would rather get this working in the backend, do ic, and then reimpl the backend so that frontend flaws stay in the frontend.
16:22:12disrupteki wrote some shit logic to track it down, yes.
16:22:16FromDiscord<Clyybber> frontend flaws shouldn't stay anywhere
16:22:26FromDiscord<Clyybber> frontend flaws should be fixed
16:22:26disruptekeasy for you to say.
16:22:41disruptekdude, have you paid any attention to how this compiler gets written? 🤣
16:23:47FromDiscord<Clyybber> first we must identify the flaw
16:23:58disruptekwell, that's what my logic does.
16:24:06FromDiscord<Clyybber> and what is the flaw?
16:24:11disrupteki realized that i could communicate better in code than in text.
16:24:29FromDiscord<Clyybber> i cannot read your code 🤣
16:24:38FromDiscord<Clyybber> half-kidding
16:24:45disrupteki didn't say there was a flaw. but the logic will represent the needs of the backend according to what the frontend provides.
16:25:02FromDiscord<Clyybber> how can you workaround a flaw that you don't know what it is?
16:25:04disruptekand if we don't like what the backend requires, we can fix the frontend to provide better input.
16:25:13FromDiscord<Clyybber> yeah
16:25:22disruptekyou have to understand that the mangling introduces a new spec.
16:25:33disrupteki don't know if the frontend adheres to that spec or not.
16:25:49FromDiscord<Clyybber> wheres that spec written down
16:25:53FromDiscord<Clyybber> or whats the gist of it?
16:26:10disrupteknorm has a runtime crash under mangling. i don't know if this is my fault or if there's a bug in the frontend that my new spec exposes.
16:26:13disruptekas an example...
16:26:40FromDiscord<Clyybber> maybe its illegal sym sharing
16:26:46FromDiscord<Clyybber> or its your fault and its illegal name sharing
16:26:54FromDiscord<Clyybber> sharing is ~~caring~~ illegal
16:27:02disruptekthe spec is as simple as, "know the rules of mangling. mangle symbol and types names."
16:27:49FromDiscord<Clyybber> no, what the spec is for the frontend to adhere to
16:28:06*Onionhammer quit (Quit: The Lounge - https://thelounge.chat)
16:28:15disruptekwhatever the c compiler needs as far as types, symbols, names.
16:28:30disrupteki just don't know if the old mangler allowed us to exploit it somehow.
16:29:06disruptekie. i get two types with the same signature and name, but different identities. should they be equal? identical? or distinct?
16:30:02FromDiscord<Clyybber> identical I would say
16:30:36disruptekwhat if they have the same name but different signatures?
16:30:43FromDiscord<Clyybber> not identical
16:31:12disruptekso if we give type B the name Jeff, then when type A comes along, we have to name it Jeff_1.
16:31:25FromDiscord<Clyybber> yes
16:32:01FromDiscord<Clyybber> module A could have a different jeff type then module B no?
16:32:06disruptekand now type A appears in a new module. and we want to call it Jeff. and by all rights we should, but we can't, because Jeff is used by type B and we need the type names to match across modules.
16:32:23disruptekit's this kind of bullshit.
16:32:28FromDiscord<Clyybber> why do we need the names to match if they aren't the same type
16:32:35FromDiscord<Clyybber> only happen to share their name?
16:32:58*Onionhammer joined #nim
16:33:05disruptekif the types have the same signature, they can share the same name.
16:33:20disruptekotherwise i'd be giving types with the same signature lots of new names.
16:33:33FromDiscord<Clyybber> ok
16:34:23FromDiscord<Clyybber> but you were talking about the case where they don't have the same signature
16:34:51disruptekif they don't have the same signature, then type A should be called Jeff by any naive measure.
16:35:00disruptekbut Jeff is already used elsewhere.
16:35:20FromDiscord<Clyybber> why should it be called Jeff?
16:35:36disruptekbecause that's its s.name.s
16:35:38FromDiscord<Clyybber> If there are two jeffs and they are not equal, obviosly one needs to be renamed
16:35:47shinzoDoes nim does efficient copying (like structural sharing or something) when creating a new copy of an object? or is just a new object created from zero?
16:35:49disruptekwell, i said "naive"
16:36:02disruptekshinzo: from zero. use a ref for reference semantics.
16:36:32disruptekshinzo: unless you are using arc and move semantics.
16:37:22shinzodisruptek: Ok, want to keep the objects immutable when pasing them through functions
16:37:57disruptekshinzo: they will be immutable if they are value types and defined without `var` prefix in the proc signature.
16:38:10FromDiscord<Clyybber> disruptek: naively and correct would be to append the signature to the name
16:38:17FromDiscord<Clyybber> this is what current mangling does right?
16:39:04stefantalpalaruClyybber, this is what I vae to do to avoid a compiler error: https://gist.github.com/stefantalpalaru/3daccc359668c45267d091dd96667490
16:39:46shinzoyeah, by copying them, was just curious if there was any special efficient copying being done, not a problem for me really, it's very nice that nim makes this ergonomic
16:40:05stefantalpalaruIt looks like the variable tracking is done before template expansion, so it doesn't see that a dangling value inside the template ends up being assigned outside the template.
16:40:18disruptekclyybber, araq: basically, the conceipt of our new mangling design is that we could use identities. iiuc, the new identity code makes this worse.
16:40:25FromDiscord<Clyybber> stefantalpalaru: I have a different suspicion, could you try with https://github.com/nim-lang/Nim/commit/3f00a738dbc8319b4dd2b86bf5529c096f2dd243 reverted?
16:40:31disruptekshinzo: what lang are you coming from?
16:41:34FromDiscord<Clyybber> disruptek: Aren't signatures identities?
16:41:37disruptekshinzo: no copy occurs when calling a proc on an immutable object in the event the object consumes more than sizeof(pointer)*3 bytes in memory.
16:41:50disruptekclyybber: identities are ptype.uniqueId or psym.id
16:41:56leorize[m]sizeof(float) * 3 actually
16:42:20FromDiscord<Clyybber> disruptek: Ah, hmm. And why is that not working?
16:42:21disruptekthat's the way i remember it but i'm not sure it's as correct.
16:42:45disruptekclyybber: because of our conceipt that identities are as correct as signatures.
16:42:53disruptekconceit, too.
16:43:08FromDiscord<Clyybber> ok, so identities are just a different signature impl
16:43:19disruptekleorize[m]: by which i mean, is it correct for the same reason, or not?
16:43:20FromDiscord<Clyybber> concept too
16:43:37disruptekyes and yes, they are different altogether.
16:43:58FromDiscord<Clyybber> how?
16:44:21disruptekalthough while two objects with the same identity will always share the same signature, two objects with the same signature may have varied identities.
16:44:35disruptekyou get that, right?
16:44:40FromDiscord<Clyybber> yeah
16:44:48shinzodisruptek: if no copy occurs in that case what happens then?
16:45:00disruptekshinzo: nothing bad. it's just an optimization.
16:45:16FromDiscord<Clyybber> correct me here: because signatures are based on the type itself, body etc. and identities are just handed out on each type creation?
16:45:21disruptekwe won't permit you to mutate the object in any event. the compiler will issue an error.
16:45:24disruptekas it should.
16:45:33disruptekclyybber: right.
16:45:44FromDiscord<Clyybber> ok, seems simple enough
16:45:44shinzodisruptek: ok, good!
16:45:52disruptekclyybber: it is, but we got it wrong.
16:45:57disruptekshinzo: yeah, it's sweet.
16:46:16FromDiscord<Clyybber> disruptek: correct me here: did we get it wrong because aliases?
16:46:22disruptekno, because identities.
16:46:42FromDiscord<Clyybber> why is it wrong to use identites?
16:47:18disruptekbecause what the c compiler cares about is signature. that's the discriminating design property.
16:47:35FromDiscord<Clyybber> the c compiler cares about what we give him
16:47:44FromDiscord<Clyybber> if we put the signature in the name he cares
16:47:47FromDiscord<Clyybber> if we don't he doesn't
16:48:05disruptekwe were trying to eliminate calculating signatures. that's how mangling was invented as a project.
16:48:17shinzodisruptek: weird I don't see this feature being talk about when seen discussions about nim, this "purity" part is really nice
16:48:19disruptekthe idea was that maybe hashing all this stuff was expensive.
16:48:24leorize[m]fun CI stuff: https://github.com/nim-lang/Nim/pull/15610/files#diff-8d210fcad3e24ff1285a3aa6f757ef1222f3487d1867aa5b808c3623753f6c1aR620
16:48:24disbot➥ 3compiler: add annotations support for CI
16:48:44FromDiscord<Clyybber> right, so instead of using s.name.s & signature we now use s.name.s & s.id
16:48:45disruptekshinzo: i know. and check out the new strictFuncs stuff.
16:48:50FromDiscord<Clyybber> basically right?
16:48:57disruptekwe use signatures, too.
16:49:08disruptekin my latest stuff, i mean.
16:49:12FromDiscord<Clyybber> why?
16:49:24FromDiscord<Clyybber> do identites not suffice?
16:49:31disruptekbecause at the entry points into mangling, we've already calculated the signature, so it's free.
16:49:46disruptekand we want two types with the same signature to have the same name.
16:49:53disruptekif they want it, i mean.
16:49:54FromDiscord<Clyybber> do we?
16:49:58FromDiscord<Clyybber> ok
16:50:15FromDiscord<Clyybber> do you have a snippet of nim code that demonstrates when we want them to have the same name?
16:50:20disruptekalso you have things like pthread_mutex_t that you import from multiple places.
16:50:44FromDiscord<Clyybber> ah, but thats importc anyways?
16:50:57disruptekso the name is immutable.
16:51:13FromDiscord<Clyybber> yeah, those needn't be mangled, no?
16:51:16disruptekwe can't go 'round with pthread_mutex_t_3 etc.
16:51:20FromDiscord<Clyybber> so just check for sfImportC
16:51:28disruptekwe do.
16:51:37disruptekthe point is, we have to record that the name is in use.
16:51:50FromDiscord<Clyybber> makes sense
16:51:52disruptekwe cannot assume that the mangle is safe just because the frontend says it is.
16:51:56FromDiscord<Clyybber> but we don't need the signature for that
16:52:11disruptektrue, we don't need the sig for that.
16:52:36disruptekhow do you propose to disambiguate without the signature, though?
16:52:48FromDiscord<Clyybber> disambiguate what?
16:53:10FromDiscord<Clyybber> we don't need to disambiguate importC types
16:53:17disruptekhow do we know if two pthread_mutex_t(s) are safe to both be importc and share the same name?
16:53:30FromDiscord<Clyybber> we just assume so
16:53:36FromDiscord<Clyybber> you are using importc after all
16:53:48FromDiscord<Clyybber> is that not how current mangling does it?
16:53:49FromDiscord<Clyybber> :D
16:54:45FromDiscord<Clyybber> regardless of wether you do TypeA {.importc: pthread_mutex.} or TypeB {....} its the same in the C code?
16:55:03FromDiscord<Clyybber> don't trust me on that one, best to check the code generated on current devel
16:57:03FromDiscord<Clyybber> ok, I checked, it doesn't mangle importc types
16:57:25FromDiscord<Clyybber> sent a long message, see http://ix.io/2B2q
16:57:49FromDiscord<Clyybber> sent a code paste, see https://play.nim-lang.org/#ix=2B2r
16:58:04FromDiscord<Clyybber> hmm, gotta fix the bridge
16:58:36FromDiscord<Clyybber> disruptek: You feel me? Both end up raw as "bruh" there is no trace of T1 or T2 in the generated code
16:59:09disruptekoh i was offline.
16:59:27FromDiscord<Clyybber> oh, should I resend?
16:59:32disruptekno, i got it.
16:59:42disruptekyes, the old code works.
16:59:46disruptekthe new code works, too.
16:59:54disruptekas i said, this isn't the problem area.
17:00:05FromDiscord<Clyybber> ah, alright
17:01:40FromDiscord<Clyybber> stefantalpalaru: ping
17:02:04disruptekconsider this, though: if i importc Jeff, then i need to record the fact that Jeff is in use and a later attempt to create a name, Jeff, should create instead Jeff_1.
17:02:27FromDiscord<Clyybber> yes
17:02:33FromDiscord<Clyybber> but not a later attempt that is also importc
17:02:55FromDiscord<Clyybber> still no need for signature here
17:03:58disruptekbut i think caching whether the "owning" type is immutable or not might be worthwhile for error messages at least.
17:04:19disrupteki think it's a good addition, thanks.
17:04:23FromDiscord<Clyybber> owning as in "i came first" ?
17:04:50FromDiscord<Clyybber> hmm, maybe, but what kind of code would it error out for?
17:04:51disruptekwe don't have the technology to rename yet. honestly, it's probably worth implementing.
17:05:36disrupteksomething where we attempting to importc the name after exporting it.
17:05:57FromDiscord<Clyybber> heh, better not error out for that one
17:06:05FromDiscord<Clyybber> otherwise you end up with a timothissue
17:06:10disruptekif i had to do this again, i would have just written a new backend. seriously.
17:06:33disrupteki mean, how hard could it be?
17:06:52FromDiscord<Clyybber> did we solve something just now?
17:07:16disrupteknah, but it could be an optimization.
17:07:23FromDiscord<Clyybber> what exactly
17:07:43disrupteka slightly different code path for immutable names.
17:08:00FromDiscord<Clyybber> an immutable name being importc or exportc?
17:08:19disruptekor a compiler proc, yes.
17:08:31FromDiscord<Clyybber> whats the optimization?
17:08:50disruptekwe can ignore any sig-based checking or calcs or whatever.
17:09:10FromDiscord<Clyybber> oh, yeah. What did it do before?
17:09:54disruptekbefore? probably nothing. current code? it merely changes how the name is mangled, but all the same flow occurs otherwise.
17:10:02disruptekthe same checks, etc.
17:10:14FromDiscord<Clyybber> ah
17:10:36FromDiscord<Clyybber> ok, I would refrain from handling errors there for now
17:11:20disruptekthe main thing is that we need the side-effects; incrementing counters, etc.
17:11:30disruptekthis is key to making ic work.
17:11:37FromDiscord<Clyybber> yeah, increment the counter for the name
17:12:01FromDiscord<Clyybber> why do we ever need the signature?
17:12:12FromDiscord<Clyybber> if we have the identity
17:12:20disruptekbecause let's say that we importc as our first step.
17:12:24disruptekso we import Jeff.
17:12:46disruptekthat increments the Jeff counter. also, we stash id###->Jeff.
17:12:47FromDiscord<Clyybber> type Jeff {.importc: "Jeff".}
17:13:03FromDiscord<Clyybber> whats id###?
17:13:10FromDiscord<Clyybber> the identity of Jeff?
17:13:21FromDiscord<Clyybber> where do we store that?
17:13:31disruptekin the same disambiguation table. string->counter
17:13:37FromDiscord<Clyybber> ah ok
17:13:44FromDiscord<Clyybber> shouldn't it be
17:13:50FromDiscord<Clyybber> name->counter
17:13:56FromDiscord<Clyybber> not identity->counter
17:14:05disruptekhonestly? it should be two tables.
17:14:20disruptekone id->counter, one name->counter.
17:14:28disruptekbut whatever. it is what it is, for now.
17:14:40FromDiscord<Clyybber> Ok, so right now it is id->counter?
17:15:08disruptekname->counter is next-available-counter
17:15:08disruptekid->counter is counter-we-assigned-to-that-id
17:15:15disruptekright now it is string->counter and we $id or $name.
17:15:49FromDiscord<Clyybber> ah, ok
17:16:25disruptekanyway, we need this side-effect because we need to know what to do when we are presented with Jeff again.
17:16:34FromDiscord<Clyybber> yeah
17:16:36disrupteklike, is it the same signature? same key?
17:16:43FromDiscord<Clyybber> it reall should be two tables though
17:16:48disruptekof course.
17:16:50FromDiscord<Clyybber> seems dangerous to conflate the two
17:17:11FromDiscord<Clyybber> especially if you encounter type `124789159801` = int :p
17:17:15disruptekit's not dangerous, because names never start with digits and identities never start with characters.
17:17:16leorize[m]@euantor if you're around can you look into Nim's freebsd ci?
17:17:45FromDiscord<Clyybber> disruptek: yeah
17:17:47disruptekit's just lazy and inefficient.
17:18:04FromDiscord<Clyybber> ok, so if we encounter
17:18:07euantoranoleorize[m]: sure, will do so after eating dinner
17:18:08FromDiscord<Clyybber> type Jeff = int
17:18:19FromDiscord<Clyybber> then, we check name->counter
17:18:25disruptekif i were to implement this again, i would use a query pattern where i could cache all the results and return complex responses.
17:18:27FromDiscord<Clyybber> increment it
17:18:33FromDiscord<Clyybber> and set id->counter
17:18:52disruptekfirst we check id->counter.
17:19:03disrupteksecond we check name->counter.
17:19:15disruptekthird, increment it, set id->counter.
17:19:15FromDiscord<Clyybber> we check for the existance of id->counter right?
17:19:34disruptekright, we need to read it so we can combine it with the name.
17:19:41FromDiscord<Clyybber> so
17:20:19FromDiscord<Clyybber> if id->counter: #already generated, combine with name↵else:↵ inc name->counter↵ id->counter = name->counter
17:20:36FromDiscord<Clyybber> let me split that up
17:20:40FromDiscord<Clyybber> if id->counter: #already generated, combine with name
17:20:44FromDiscord<Clyybber> else:
17:20:47FromDiscord<Clyybber> inc name->counter
17:20:58FromDiscord<Clyybber> id->counter = name->counter
17:21:08FromDiscord<Clyybber> sorry for the indentation, shitcord cuts off leading spaces
17:21:31euantoranoleorize[m]: reporting to #sr.ht - seems to be an image issue
17:21:34FromDiscord<Clyybber> imagine the part after the else being indented
17:21:34disruptekwell, we inc last. name->counter holds the next-available.
17:21:50FromDiscord<Clyybber> ah ok
17:21:56disrupteksame same but different.
17:22:05FromDiscord<Clyybber> makes sense, doesn't matter
17:22:14leorize[m]euantorano: sr.ht seems to break a lot :/
17:22:57FromDiscord<Clyybber> disruptek: That doesn't seem to complex, when does it break?
17:22:59disruptekideally, we ask any question we want, it gets turned into a query object, that object is hashed as a key to a table that yields the complex response.
17:23:12FromDiscord<Clyybber> too complex
17:23:13disruptekif no response is cached, we execute the query and cache it.
17:23:19euantoranoleorize[m]: mostly seems to be the FreeBSD image that keeps breaking, the OpenBSD one seems more reliable. They are still in Alpha I guess 🤷‍♂️
17:23:42FromDiscord<Clyybber> disruptek: I guess it could be done, but all the queries are the same no? "giveMeAName"
17:25:03stefantalpalaruClyybber: reverting that commit got rid of the problem.
17:25:36FromDiscord<Clyybber> stefantalpalaru: Nice, finally a good reason to revert it
17:26:20FromDiscord<Clyybber> I will create a PR
17:26:54disruptekto me, normalizing the input and output is the complex part. having these proper objects organizes the complexity better.
17:27:24FromDiscord<Clyybber> stefantalpalaru: Can you leave a comment here https://github.com/nim-lang/RFCs/issues/251 ?
17:27:26disbot➥ 3Allow return in expressions again ; snippet at 12https://play.nim-lang.org/#ix=2B2K
17:30:31disruptekmake sure you mention me.
17:31:05FromDiscord<Clyybber> disruptek: So where do we fail?
17:31:17FromDiscord<Clyybber> And how is that logic 1300 lines?
17:31:25FromDiscord<Clyybber> Its mostly debug those 1300 lines right?
17:31:28disruptekyou know me.
17:31:39*gmaggior joined #nim
17:32:25FromDiscord<Clyybber> this logic you described seems simple and sound
17:32:34disruptekweird, right?
17:34:08FromDiscord<Clyybber> solving it will require understanding it, nobody truly understands more than 100 lines of code at once
17:34:16FromDiscord<Recruit_main707> Araq: I did some benchmarks comparing arc vs regions, i posted everything on the forum thread
17:34:34FromDiscord<Clyybber> maybe its even a needle in your debugging stack thats doing somethign sneaky
17:34:39FromDiscord<Clyybber> like decreasing your counters
17:35:01disruptekrecruit: please link the thread.
17:35:12FromDiscord<Recruit_main707> https://forum.nim-lang.org/t/6930
17:35:38disruptekclyybber: well, i just pushed some progress yesterday. today i need to debug some packages, but i already know i can reproduce some non-release traps in our test suite.
17:35:56disruptekrecruit: danke.
17:37:05FromDiscord<Clyybber> disruptek: Yeah, but I mean, at some point the debug code becomes a distraction not a help
17:37:07disrupteki will argue in favor of none and regions.
17:37:19FromDiscord<Clyybber> maybe its worth it to remove all of it and reduce it to a minimum working thing
17:37:26FromDiscord<Clyybber> and start debugging again from tehre
17:37:37FromDiscord<Recruit_main707> cool
17:37:54disruptekclyybber: this is not that time.
17:40:57disruptekrecruit: if arc beat none then you're probably doing extra allocs that are not necessary in your handwritten code. or, nim is.
17:42:10disruptekit's not really fair to compare arc to regions without handling dealloc similarly; ie. not at close of scope but at close of "region". does that make sense?
17:42:50federico3the formatting of https://nim-lang.org/docs/times.html is broken
17:42:52FromDiscord<Clyybber> yep
17:43:26FromDiscord<Clyybber> federico3: Its reported already AFAIK
17:43:47FromDiscord<Recruit_main707> disruptek, that code specifically is not written by me, its in the tests folder of nim
17:43:59disrupteki'm just saying.
17:44:06FromDiscord<Clyybber> is it written for regions?
17:44:32FromDiscord<Recruit_main707> nope, i adapted it, keeping everything as close as i could
17:44:38FromDiscord<Clyybber> I see
17:45:17FromDiscord<Recruit_main707> i do dealloc everything at the end as disruptek said instead of whenever it goes out of scope,
17:45:39FromDiscord<Clyybber> you can do the same thing for arc
17:45:46disruptekwell, the questions are, "which can be made fastest?", "which is fastest for idiomatic nim?", i guess.
17:46:14disrupteki'm not sure it makes sense to compare two equal impls that aren't either optimized or idiomatic.
17:46:47FromDiscord<Clyybber> disruptek: But theres so many debug stuff, surely some of that is not relevant for the current problem anymore?
17:50:27disruptekare you asking which debug stuff is relevant?
17:50:58FromDiscord<Clyybber> yeah
17:51:27FromDiscord<Clyybber> lol
18:00:20*scott_tams joined #nim
18:04:38scott_tamsI don't seem to be able to install https://github.com/pragmagic/vscode-nim
18:05:12scott_tamsdoes it require the non-open-source version of VS Code? I have version 1.49.1-1 (OSS build) from the Manjaro repos
18:05:47FromDiscord<Clyybber> pretty sure it should work on the oss version too
18:07:30scott_tamscode --install-extension kosz78.nim
18:07:30scott_tamsInstalling extensions...
18:07:30scott_tamsExtension 'kosz78.nim' not found.
18:07:30scott_tamsMake sure you use the full extension ID, including the publisher, e.g.: ms-dotnettools.csharp
18:07:30scott_tamsFailed Installing Extensions: kosz78.nim
18:07:44*lritter joined #nim
18:08:35FromDiscord<Clyybber> hmm, mabye try nim-alt
18:09:32scott_tamsHmm... https://github.com/pragmagic/vscode-nim/blob/0272a0544ddf147fde98f8a8f2b624b7dcb19eb3/package.json#L44-L46
18:10:07scott_tamsClyybber, do you mean `kosz78.nim-alt`?
18:11:19scott_tamsyeah, I can't install ms-vscode.cpptools either :(
18:12:00FromDiscord<Clyybber> maybe try https://marketplace.visualstudio.com/items?itemName=nimsaem.nimvscode
18:12:17FromDiscord<Clyybber> I don't use vscode myself so this is guesswork, but this one is the most updated I think
18:12:28FromDiscord<Clyybber> and its written in Nim itself which is pretty neat :D
18:12:47scott_tamswhat do you use?
18:14:30scott_tamsno, that one also depends on ms-vscode.cpptools
18:15:47FromDiscord<Clyybber> hmm, damn. I use kakoune
18:16:16FromDiscord<Clyybber> I'm pretty sure @Yardanico is using the oss version and the plugin just fine, maybe he can help you
18:16:46FromDiscord<Yardanico> @scott_tams I know the exact reason why you can't install it
18:17:05FromDiscord<Yardanico> VSCodium doesn't use the official VSCode marketplace anymore
18:17:09Prestige@Clyy did you move from vim to kakoune? Curious how the transition is
18:17:39FromDiscord<Clyybber> I started using both, but found kakoune to make more sense
18:17:42FromDiscord<Yardanico> But I used VSCode-oss from arch repos "code", it still uses the official marketplace
18:18:01*kenran joined #nim
18:18:24scott_tamsthat's very weird. I'm using the same thing, but Nim and ms-vscode.cpptools don't show up
18:18:29FromDiscord<Clyybber> Prestige: I think I only used vim for about a month or so before switching to kakoune
18:18:31scott_tamsI'm trying the official binary from the AUR
18:18:35FromDiscord<Yardanico> are you sure that it's the same thing?
18:18:52PrestigeHmm okay, I might give kak a shot for a bit
18:19:09FromDiscord<Yardanico> Oh shoot
18:19:14scott_tams@Yardanico what does `code --version` give you?
18:19:23FromDiscord<Yardanico> They seem to have switched to OpenVSX as well @scott_tams
18:19:29FromDiscord<Yardanico> I mean code package in the arch repo
18:19:48FromDiscord<Yardanico> https://github.com/archlinux/svntogit-community/blob/packages/code/trunk/product_json.diff
18:21:42FromDiscord<Yardanico> You can ask Nim's plugin maintainer to upload it to OpenVSX
18:21:45FromDiscord<Yardanico> or do that yourself :P
18:22:24FromDiscord<Clyybber> can't you install from folder or something like that?
18:22:25scott_tamsit won't work, it depends on ms-vscode.cpptools which they won't take in OpenVSX because it has proprietary blobs
18:22:36Yardanicowell I'm not sure why it depends on that
18:22:44YardanicoIt really doesn't use any functionality from ms-vscode.cpptools
18:22:51Yardanicoyou can try to just remove that dependencyt?
18:23:00Yardanicoand of course there are alternatives, like vscode-nim-lsp which will use nimlsp
18:23:13Yardanicoleorize[m]: https://github.com/nim-lang/Nim/pull/15610/files is very cool!
18:23:13disbot➥ 3compiler: add annotations support for CI
18:24:32*narimiran joined #nim
18:37:22*lbart quit (Ping timeout: 265 seconds)
18:37:52*Onionhammer quit (Quit: The Lounge - https://thelounge.chat)
18:38:44*lbart joined #nim
18:42:26*Onionhammer joined #nim
18:43:04*leorize quit (Quit: WeeChat 2.9)
18:43:43scott_tamsWhen trying to build nimsaem.nim I encountered this error: Error: cannot open file: nimsuggest/sexp
18:43:53scott_tamsI'm assuming it's because I don't know how to use nimble?
18:43:55*bung quit (Quit: Lost terminal)
18:44:15*Jesin quit (Quit: Leaving)
18:45:06*lbart quit (Ping timeout: 265 seconds)
18:45:12*kenran quit (Ping timeout: 272 seconds)
18:46:12FromDiscord<Yardanico> how did you install nim?
18:47:38scott_tamsusing choosenim
18:47:40*aenesidemus quit (Read error: Connection reset by peer)
18:47:51*Jesin joined #nim
18:47:57scott_tams(which I installed from AUR)
18:49:40*lbart joined #nim
18:49:40*lbart quit (Changing host)
18:49:40*lbart joined #nim
18:50:53FromDiscord<Yardanico> weird
18:50:58FromDiscord<Yardanico> try running nimble install nimsuggest
18:51:15FromDiscord<Yardanico> oh wait no
18:52:34FromDiscord<dom96> choosenim is in aur? 😮
18:55:35*NimBot joined #nim
18:55:44Yardanicotry nimble install compiler
18:55:48Yardanicobut it's really weird
18:57:08FromDiscord<dom96> what is nimsaem?
18:58:07FromDiscord<Clyybber> @dom96 its the name the author choose to release https://github.com/saem/vscode-nim on vscode repos
18:58:28FromDiscord<dom96> hmmm, why does it need to be built then?
18:58:56scott_tamsdom96 it's no longer available in my version of VSCode, I'm trying to sideload it
18:59:03scott_tamsuntil it can be published to OpenVSX
18:59:10scott_tamsSee https://github.com/saem/vscode-nim/issues/8
18:59:11disbot➥ 3Publish to OpenVSX
18:59:34FromDiscord<dom96> I see, it's actually written in Nim
18:59:38scott_tamsYardanico nimble install compiler did the trick
18:59:55FromDiscord<dom96> You should PR it so that it includes `compiler` as a dep in its nimble file
19:00:14scott_tamsgood idea
19:01:49scott_tamsI'm checking out Nim after using Crystal for a couple years, very used to this kinda stuff ;)
19:05:25FromDiscord<dom96> cool
19:16:35*Mat5 joined #nim
19:24:38Mat5I'm not familiar with the actual development, does there exist a decent SDL2 wrapper?
19:26:24scott_tamsI wouldn't know, have you checked nimble.directory ?
19:26:31disruptekplease don't add `compiler` to requirements.
19:26:40disruptekit's nonsensical. just add a $nim to the path.
19:26:45disruptekin project.nim.cfg, ideally.
19:27:08scott_tamsHm? Sorry, I'm new to nim, what do you mean?
19:27:34scott_tams`nimble install compiler` did seem to install the compiler
19:27:41disruptekcompiler should not be installed; as a package, it's just a nonsense idea.
19:28:52scott_tamswhat do you mean? Can code not import portions of the compiler and use them as modules?
19:28:56Yardanicoit can
19:29:05Yardanicodisruptek: some distributions don't include nim source code in nim packages
19:29:09Yardanicoso it needs to be in nimble reqs
19:29:35scott_tamswell, specifically, choosenim doesn't, and that's what the web site says is the recommended way to install
19:29:40disruptekwell, then nimble should treat it specially. if the user includes $nim and you don't have it, you'll have to install the compiler.
19:30:22Yardanicoscott_tams: it's totally okay to put compiler in requirements
19:30:23Yardanicodon't worry
19:30:28Mat5scott_tams, no, but found it. Thanks for the link
19:30:32disruptekotherwise we have the situation that i need to write compiler code that can be compiled by any version of a nim compiler, but that code is applicable to any version of the compiler. in my user code, how do i know which version of the compiler code is running?
19:30:37scott_tamsyeah, I disagree disruptek
19:30:55disruptekyou don't have to agree, but you have to understand the problem.
19:32:52*Mat5 quit (Quit: Leaving)
19:33:05scott_tamsI don't, though. The compiler executable and the modules/source code which make up the compiler are two different things
19:33:24disruptekthey are. but the constants used to compile the code vary between versions.
19:34:15FromDiscord<Clyybber> disruptek: It doesn't matter normally, and it definitely doesn't if the source is newer than the compiler
19:34:27FromDiscord<Clyybber> *newer or just as new
19:35:01FromDiscord<Elegant Beef> Currently scott i'm using the nim compiler to be able to use nimscript to control applications
19:35:20FromDiscord<Elegant Beef> To answer your question "what do you mean? Can code not import portions of the compiler and use them as modules?"
19:35:29disruptekdo what you want. i really don't feel like arguing this. make an rfc please.
19:35:49FromDiscord<Clyybber> disruptek: rfc for what?
19:36:16FromDiscord<dom96> having a special dependency that works magically is nonsensical
19:36:21disruptekfor whether including the compiler is wise or preferable to $nim, and whether it should be deprecated.
19:36:40disrupteknim is one such dependency. also, nimph doesn't support it, because it's magical.
19:36:42FromDiscord<dom96> nothing wrong with adding `compiler` to the list of requirements, it allows you to lock onto a specific commit/version
19:36:44disruptekyet nimble does.
19:37:06disruptekalthough, nimble only supports it poorly. witness 1.0.10 versus "1.0.10" and now "1.4.0".
19:38:13disruptekso you're compiling early compiler code with a later version of the compiler.
19:38:27disruptekand i'm a library author. how am i supposed to know which version of the code i have?
19:38:42FromDiscord<shashlick> Compiler package can be out of sync with the nim version being used
19:38:50FromDiscord<shashlick> I prefer $nim
19:39:01Yardanicodisruptek: nimble already fixed that bug
19:39:13disruptekYardanico: well, Prologue is failing now.
19:39:29Yardanicodisruptek: it's not?
19:39:34disruptekit only took nimskull 9 years to learn how to parse version strings.
19:39:38Yardanicook ok whatever
19:39:45Yardanicobugs can be everywhere
19:39:51Yardanicoeven in *stable* software with version >1.0
19:39:51disrupteki keep hearing this...
19:39:55Yardanicoyes, but it's true
19:40:07disruptekso why do you doubt me?
19:40:41FromDiscord<shashlick> Stay on topic - $nim is what I use in nimterop and it works fine across multiple versions of Nim
19:40:49disruptekof course.
19:40:56scott_tamswhat is $nim and nimterop
19:41:05disruptekyou and i came to the same conclusion last year, iirc.
19:41:10disruptekthere's no other sane way to do it.
19:41:17disruptek$repo nimterop
19:41:21disruptek!repo nimterop
19:41:23disbot12https://github.com/nimterop/nimterop -- 9nimterop: 11Nimterop is a Nim package that aims to make C/C++ interop seamless 15 218⭐ 20🍴 7& 11 more...
19:41:34Yardanico@shashlick the problem is that there's no guarantee that nim sources will be available
19:41:34disruptekuh, $nim is a path substitution you can use in paths to refer to the stdlib.
19:41:51disruptekYardanico: exactly. this is the problem to solve. no other.
19:41:54scott_tamsso like `import $nim/somepackage`?
19:42:15disruptekno, like --path:"$nim"
19:42:23disrupteknot stdlib, root nim install directory.
19:42:47disruptekit's mostly used to allow user code to import the compiler, which is adjacent to stdlib "/lib/"
19:43:42disruptekbut apparently absent in some installations. so instead of making packagers solve the problem that they supplied, uh, we want to muddy the waters, breaking software.
19:43:43scott_tamsis this something the package sets up in your shell or something special to nim command line tools or...? I'm so confused
19:44:10disruptek--path:"$nim" is a command-line parameter.
19:44:37disruptekthe $nim is verbatim. then the compiler parses paths and expands $variable to the contents of the variable.
19:45:01disruptek...for a limited number of expansions such as $lib, $nim, $home, $project, $nimbleDir, and so on.
19:45:09disrupteki mostly just use $config.
19:45:50disruptek$nim refers to (which nim)/.., basically.
19:45:52FromDiscord<shashlick> @Yardanico there's no reason to act like the compiler is not part of the stdlib
19:46:17Yardanico@shashlick well, but I'm talking about current behaviour
19:46:22Yardanicoit needs to be changed then
19:46:32FromDiscord<shashlick> Agreed
19:46:34Yardanicoso nim *explicitly* bundles compiler src with the distribution
19:46:37Yardanicoright now it doesn't
19:46:38scott_tamsif I do `nim somecommand --path="$nim"` at my terminal, the dollar-sign will be picked up by my shell and reinterpreted as the value of `$nim`, which, unless my package maintainer added `$nim` as an environment variable to some configuration file (they didn't) it will be null and the output will be `nim somecommand --path=`
19:46:40disruptekyes, the behavior needs to be changed.
19:46:45Yardanicoeven nim's own binary releases are _without_ compiler source
19:46:46FromDiscord<shashlick> And compiler package should be deprecated somehow
19:46:53disruptekYardanico: that's just not true.
19:47:11FromDiscord<shashlick> It's only distro packages to my knowledge
19:47:22Yardanicoyeah sorry it's there with nim releases
19:47:25disbot9gitnim: 11https://gitnim.com/ -- choosenim for choosey nimions -- 7disruptek
19:47:26scott_tams`which nim` would evaluate to /usr/bin/nim, which is the location of the binary, not a directory.
19:47:29disrupteklook at any release you want.
19:47:36scott_tamssaying `which nim`/anything is nonsensical
19:47:39leorize[m]`$nim` is a PITA for packager
19:47:52FromDiscord<nikki> if i want to use a container implemented in C, that just has an interface of ptrs and sizes, and gives me a hook for element destruction, and i want to hold nim objects that can have nim-managed ref members, in the hook do i just need to call `=destroy` on the element? eg. https://play.nim-lang.org/#ix=2B3Q works
19:47:56disruptekscott_tams: `which nim`/..
19:47:57scott_tamsleorize[m], I can only imagine!
19:48:06scott_tamsso `/usr/bin/`?
19:48:18disrupteklook dude, i can only supply the answer so many times.
19:48:25disruptekat some point you're going to have to read what i write.
19:48:28disruptekit's only fair.
19:48:31disruptekmeet me halfway.
19:50:02scott_tamsecho $vim
19:50:18disruptek!code pathsub
19:50:19disbotno results 😢
19:50:45disruptek!code pathsubs
19:50:45disbot12https://github.com/nim-lang/Nim/blob/13e659cfec83eb3c2c3c2bbbf10d01ba59bc0d5b/compiler/modulepaths.nim -- 11compiler/modulepaths.nim 7& 3 more...
19:51:13scott_tamsso this applies in nim code or in shell commands?
19:51:35disruptekit applies to configuration strings for the compiler.
19:51:52scott_tamsoh so like in config files, like the .nimble file?
19:51:55disruptekeg .cfg files, .nims switch()es, and cli arguments.
19:52:15disruptekyes, any nimscript that imports `--`() for example.
19:52:23*hyiltiz joined #nim
19:52:23*hyiltiz quit (Changing host)
19:52:23*hyiltiz joined #nim
19:52:27scott_tamsI don't see the relevance of the github link
19:52:40disruptekit's just whatever disbot found.
19:52:55disruptekit's the top hit but doesn't include the definition
19:52:59scott_tamswhat is a nimscript (is it just nim source code?) and what do you mean by `imports --()`?
19:53:24disrupteknimscript is nim, but compile-time only subset.
19:53:32scott_tamsohh ok
19:53:33disruptekit's just run by the vm.
19:53:37*hnOsmium0001 joined #nim
19:54:25disruptekwell, not necessarily macros. they are but one part of the language supported there. `--`() is a proc that knows how to invoke cli-argument syntax at compiletime.
19:55:33scott_tamsok...so within "nimscript"s, you can write `somecommand --path=$config` and that will yield a configuration directory
19:55:46scott_tamswhere somecommand is some sort of special proc or macro?
19:56:24disruptekyou can write `--path="$nim"` i think. or something damn near to it.
19:56:48disrupteki usually use switch("path", "$nim"), let's say.
19:57:00disrupteki just find it less surprising to read.
19:57:21disruptekbut i don't favor putting any config in nimscript.
19:57:46disruptekit's too expensive for tooling to discover.
19:57:50FromDiscord<nikki> a 0-init of a seq is not safe to `.add` to yet right?
19:57:52FromDiscord<Clyybber> not really
19:58:01FromDiscord<Clyybber> @nikki hmm?
19:58:04disrupteka 0-init?
19:58:10FromDiscord<Clyybber> Oh, it is. seqs are empty by default
19:58:14disruptekall new seqs are zerod.
19:58:19disruptekall memory allocs, in fact.
19:58:23FromDiscord<Clyybber> That is there is no nil for seqs
19:58:30FromDiscord<nikki> if i `alloc0` some memory that is meant for a value object that contains a seq member
19:58:35mipriscott_tams: https://github.com/nim-lang/Nim/blob/devel/compiler/options.nim#L666 it's only called in a few places
19:58:44FromDiscord<nikki> (asking cuz it'll be 0-alloced in C-land actually)
19:58:53disruptekyes, it will be zero'd.
19:58:54FromDiscord<nikki> ah nice, the 0-init is safe to add to then
19:58:54FromDiscord<Clyybber> @nikki it should be fine I think
19:59:09FromDiscord<nikki> right what i meant is, is 0 bytes a safe start state for a seq to add to
19:59:14FromDiscord<Clyybber> disruptek: No hes asking about having a seq and initializing it to nil manually
20:00:02disruptekoh lemme read this again, sorry.
20:00:09FromDiscord<nikki> oh i guess the member is actually a ref since seq is a ref type and so i'd have to actually set it to a `newSeq` result
20:00:14scott_tamswhy would all mallocs be zeroed? doesn't that incur a significant overhead?
20:00:31FromDiscord<nikki> malloc (a C term) doesn't zero
20:00:39scott_tamsI meant the Nim equivalent
20:00:40FromDiscord<nikki> `alloc0` (nim) zeros, so does calloc (C)
20:00:43disruptekbecause values start at zero, so...
20:00:48scott_tams"all memory allocs"
20:01:02FromDiscord<Clyybber> nim has alloc and alloc0
20:01:16disruptekand realloc and...
20:02:14scott_tamsso when a seq is created, is it initially a buffer of zeroes of some arbitrary size?
20:02:39disruptekafaik, yes.
20:02:55disrupteksome of this changed in the last year, though.
20:04:06scott_tamsayyy I've got syntax highlighting in VSCode working finally :D
20:04:07leorize[m]scott_tams: allocs are zero-ed for safety
20:04:08FromDiscord<nikki> to clarify -- did you mean to refer to the buffer of elements that a seq refers to, or the buffer for the seq itself (which would be a pointer to the element buffer, plus a size, and maybe other stuff idk)
20:04:12leorize[m]and it's not slow
20:04:35FromDiscord<Clyybber> scott_tams: An empty seq of course won't be a buffer of zeros
20:04:38scott_tamsleorize[m], 1 why is that safer? and 2 how does it not impact performance?
20:04:44FromDiscord<Clyybber> It will contain as many zeros as the capacity of that seq
20:04:47leorize[m]if that impacts you, a variable can always be tagged with `{.noInit.}` to disable that
20:04:48Yardanicoscott_tams: 1) because otherwise you'll have garbage info
20:04:54disruptekthat's what he meant, clyybber.
20:05:07FromDiscord<Clyybber> scott_tams: Othewise you could read uninitialized memory
20:05:13leorize[m]scott_tams: modern architectures allow for extremely quick `memset()`
20:05:13disruptekwell, if the seq is empty it won't be garbage.
20:05:22Yardanicodisruptek: because it's 0-alloced
20:05:25scott_tamsnot if bounds checking is enforced?
20:05:32disruptekright, but we would check you.
20:05:35FromDiscord<nikki> well 'contains' depends on whether you meant the seq value object itself which is a buffer ptr and a capacity and a len, or the buffer containing element data
20:05:46disruptekif no bounds check, yes, it will be zero everywhere.
20:05:53scott_tamsfor example, a seq may have a capacity of 16 but a size of 9 (9 elements with space for 16)
20:05:54disruptekbecause we alloc0 by default.
20:06:14leorize[m]I'm not even sure what is being talked about rn lol
20:06:21scott_tamshence if bounds checking were enforced, it wouldn't matter what junk is in the remaining 7 elements
20:06:31disrupteki think he's worried about the overhead of alloc0 still.
20:06:39FromDiscord<Clyybber> oh, you mean the space between length and capacity
20:06:42FromDiscord<Clyybber> disruptek: shush
20:06:43disruptekcorrect, scott_tams.
20:06:59disruptekclyybber: you shush.
20:07:03FromDiscord<nikki> yeah it depends on how newseq acquires the mem for the element buffer
20:07:04scott_tamsI suppose if the CPU is designed to do this quickly then it doesn't matter
20:07:09FromDiscord<Clyybber> disruptek: :P
20:07:15disruptekit's really not a big deal.
20:07:19FromDiscord<nikki> i would expect / hope that it leaves it uninitialized
20:07:24disruptekany performance-critical code can avert the zero'ing.
20:07:39disruptekbut, y'know, this isn't all that common a problem with nim.
20:07:42disruptekperformance, i mean.
20:07:43FromDiscord<Clyybber> disruptek: its not about zeroing the part between 0 and length
20:07:50disrupteki know.
20:08:01FromDiscord<Clyybber> let me check the implementation so we can answer this
20:08:09scott_tamshaha, I recognize that these sorts of micro-optimizations aren't generally imporant, but I find them fun to think about
20:08:12disrupteka seq of cap 16 is an alloc of 16 or w/e, regardless of how much it holds.
20:08:39leorize[m]@mratsim can tell you exactly how to micro optimize the hell out of nim :P
20:08:48mipriyou can read the seq stuff in lib/system/seqs_v2.nim. it's all relatively readable Nim. f.e. prepareSeqAdd clearly calls allocShared0 and reallocShared0, so yeah 'uninitialized' capacity outside of the len of the seq will be zeroed
20:08:56disrupteki'm probably 98% sure we still alloc0 seqs under arc.
20:08:56FromDiscord<Clyybber> Hmm, yeah
20:09:19FromDiscord<nikki> alloc0 for the seq value object itself
20:09:21FromDiscord<nikki> but the q is about the element buffer
20:09:36disruptekjust assume everything is alloc0'd.
20:10:08disruptekthe only time i'd be less sure is, eg. a realloc.
20:10:27FromGitter<oal> I'm trying out nim for the first time. Is there a way to watch source files and auto re-build and run on changes? Something like a "nimble watch"?
20:10:33FromDiscord<Clyybber> yeah, so far seqs don't even use realloc
20:10:39FromDiscord<Clyybber> still we are pretty fast :D
20:10:44disruptekno, but strings.
20:10:59scott_tamsthat could actually be pretty useful. If the CPU/arch manages to optimize memsets of 0, it could actually improve performance to do that over bounds checking for nonzero values (i.e. pointers) because you could just JNE instead of loading the size into a register then comparing and jumping on the result
20:11:24disruptekobviously, the more we can tell the os about what we want, the better.
20:13:06*olav_ joined #nim
20:13:11FromDiscord<Clyybber> I should be more specific, both realloc, but the default allocator doesn't really do anything smart in realloc
20:13:22*olav_ is now known as oal
20:13:23FromDiscord<nikki> https://media.discordapp.net/attachments/371759389889003532/767118074415284244/unknown.png
20:13:36oalI'm trying out nim for the first time. Is there a way to watch source files and auto re-build and run on changes? Something like a "nimble watch"?
20:14:00Yardanicooal: we saw your message from gitter :)
20:14:09disrupteki think there are a couple packages that do fs notification.
20:14:17YardanicoI think there was something like that but I don't recall the name
20:14:18disruptekask disbot.
20:14:23oalah, I didn't know if they were synced :)
20:14:24Prestigelike hcr?
20:14:31disruptekdo it privately, and disbot'll give you 30 results.
20:14:38Yardanicooal: nim gitter, discord, irc, matrix are all connected together
20:14:44YardanicoPrestige: nah
20:14:48disruptekbut you can only talk to disbot privately from irc.
20:14:54Yardanicorebuilding and restarting
20:14:57FromDiscord<Clyybber> !package file watch
20:14:57disbotdisruptek hung like rhinocerous🦏
20:15:00Yardanicouseful for e.g. web development
20:15:00Prestigeoh ok
20:15:04FromDiscord<Clyybber> lol?
20:15:05Yardanicofor backends
20:15:13disruptekdisbot: shush.
20:15:14disboton it. 👍
20:15:18oalYardanico: Neat!
20:15:36scott_tamsoooh, you guys have matrix too? nice
20:15:37Yardanicofor example karax has a tool like that, but for the frontend part
20:15:50FromDiscord<nikki> trying to find where newSeq is impl'd
20:16:05disbot9matrix: 11Nim channels on Matrix can be found at +nim:asra.gr (https://matrix.to/#/+nim:asra.gr)
20:16:06FromDiscord<Clyybber> are you using gc:arc?
20:16:13leorize[m]scott_tams: ^
20:16:39disruptekhow did we even get on this subject.
20:16:42FromDiscord<nikki> @Clyybber are you asking me? i was thinking to when i want deterministic lifetime behavior
20:17:05FromDiscord<Clyybber> oh, because of the newSeq impl I mean
20:17:13Yardanico@nikki https://github.com/nim-lang/Nim/blob/devel/compiler/ccgexprs.nim#L1361
20:17:19Yardanicoit calls newSeqPayload
20:17:25Yardanicofrom seqs_v2 with --gc:arc or orc
20:17:58FromDiscord<nikki> hmm i guess i meant the newSeq_<mangle> in the C backend output
20:18:01FromDiscord<Clyybber> and otherwise it calls the newSeq procs in lib/system/*
20:18:08FromDiscord<nikki> it's written in nim and linked in right
20:18:21FromDiscord<nikki> not as much the codegen for a newSeq in nim code
20:18:36Yardanico@nikki they all will just call newSeqPayload with arc/orc anyway
20:18:58FromDiscord<nikki> awesome thanks for that second one @Yardanico
20:23:59scott_tamswhat is the difference between `when` and `if`?
20:24:14oalwhen is checked compile time I think
20:24:16disruptekwhen is compile-time.
20:24:30disruptekshashlick: are you busy?
20:24:34Yardanico@shashlick ^
20:29:09*ForumUpdaterBot quit (Remote host closed the connection)
20:29:17*ForumUpdaterBot joined #nim
20:30:58*narimiran quit (Ping timeout: 272 seconds)
20:32:37*madpata joined #nim
20:34:43disruptek@shashlick nevermind, i figured it out.
20:44:53*oal quit (Quit: oal)
20:53:41FromDiscord<nikki> is there a way to say `--gc:arc` in nim playground?
20:55:32FromDiscord<nikki> in any case, really glad things work this way:
20:55:35FromDiscord<nikki> https://media.discordapp.net/attachments/371759389889003532/767128697001738250/unknown.png
20:56:05*lritter quit (Ping timeout: 265 seconds)
20:56:19FromDiscord<nikki> sorry about overuse of the world 'test' lol
20:56:48Yardanico@nikki no
20:56:56Yardanicono way to change it on playground for now
20:57:12FromDiscord<nikki> word. no way to tell the compiler to enable a flag in eg. a main module top-of-the-file pragma or sth
20:57:14leorize[m]you don't need arc for destructors to work btw
20:57:19Yardanicothat too^
20:57:42FromDiscord<nikki> leorize i found that it didn't deterministically cascande to the seq elems with arc off
20:58:00FromDiscord<nikki> https://media.discordapp.net/attachments/371759389889003532/767129305443467334/unknown.png
20:58:02FromDiscord<nikki> example with on / off ^
20:58:10Yardanicoyes, refc wouldn't call destroys right away
20:58:15Yardanicounless you call GC_fullCollect()
21:00:04FromDiscord<haxscramper> @nikki You can try using https://wandbox.org/ - it also has the latest nim build and supports compilation flags. There is no syntax highlighting though
21:02:02scott_tamsnim compiles to C/C++/JS, rather than ASM or LLVM IR, correct? Is there any way to see the resulting C or C++?
21:02:25FromDiscord<nikki> they show up in '~/.cache/nim' for me
21:02:34FromDiscord<nikki> depends on that cache location on your system / nim config
21:02:43Yardanicoyou can also override that
21:02:46Yardanicoby --nimcache:folder
21:04:18scott_tamsyes, I see.
21:07:11*scott_tams quit (Quit: Leaving)
21:07:27FromDiscord<William_CTO> I bought the book Nim in Action. I know the book was written before the release of 1.0, but it says that nim can be complied down to Obj C, is that still true?
21:07:54FromDiscord<nikki> yep
21:09:35FromDiscord<scott> sent a code paste, see https://play.nim-lang.org/#ix=2B4b
21:11:45leorize[m]Nim's C is not pretty :p
21:12:14FromDiscord<scott> I mean, it's better than webpack/babel's JS from what I've seen
21:13:21Zevvis there a proc that toggles a var bool in stdlib?
21:13:31FromDiscord<Clyybber> disruptek is working on making it prettier
21:13:33Yardanicoi don't think so :P
21:13:36leorize[m]why would you need that lol
21:13:45FromDiscord<Clyybber> thats also why he went crazy
21:13:51FromDiscord<Clyybber> Zevv: lol
21:13:51FromDiscord<lqdev> `x = not x` you're repeating `x` twice :)
21:13:52Zevvthis.that.someThing.bla = not this.that.someThing.bla
21:13:58FromDiscord<lqdev> ↑
21:13:58ZevvI want this.that.someThing.bla.toggle()
21:13:58FromDiscord<scott> @Clyybber that makes sense 😂
21:14:21disruptekx = not x
21:14:23FromDiscord<scott> zevv `func toggle(x: bool): bool = not x
21:14:25FromDiscord<scott> (edit) 'x' => 'x`'
21:14:36FromDiscord<lqdev> not the thing
21:14:43Zevvyeah sure, I have that.
21:14:46FromDiscord<lqdev> `proc toggle(x: var bool) = x = not x`
21:14:52Zevvbut I was wondering if there was a default version of that in stdlib
21:15:03disruptekyeah, there is.
21:15:03leorize[m]!eval proc toggle(x: var bool) = x = not x
21:15:06disruptekx = not x
21:15:07NimBot<no output>
21:15:12Zevvdisruptek: ready ^^
21:15:25Zevv"read" I mean
21:15:25Zevvthis.that.someThing.bla = not this.that.someThing.bla
21:15:38miprigrep -Pr 'proc|func' lib/|grep -P 'bool.*bool'|grep var # no output. conclusion, it's not in stdlib
21:15:51disrupteki know you don't like it, but you know what?
21:15:53disruptekyou're wrong.
21:16:01disruptektoggle is the wrong way to do this.
21:16:13disruptekx = not x captures the semantic perfectly.
21:17:13Zevvsure. But DRY
21:17:18FromDiscord<scott> yeah, what disruptek said
21:17:21Zevvit's error prone
21:17:28FromDiscord<scott> It's not repeating yourself, nor error prone
21:17:35FromDiscord<nikki> are you doing that a lot?
21:17:39ZevvIT is. I need to type 'x' twice
21:17:40FromDiscord<nikki> toggling some bool var
21:17:43Zevvand 'x' is 'this.that.someThing.bla'
21:17:52mipriAda 2020 added @ as a shorthand for the lefthand side of the an assignment. so there it'd be this.that.someThing = not @;
21:17:53ZevvPretty often
21:18:02ZevvThat is cool
21:18:11FromDiscord<scott> yeah that is pretty smart
21:18:19ZevvIn C I always do `^= 1`
21:18:24FromDiscord<Clyybber> mipri: Interesting
21:18:36FromDiscord<scott> if you really want the convenience, write the proc. If you think it should be part of stdlib, it wouldn't be hard to make a PR I don't think
21:18:49leorize[m]something like that need an RFC :P
21:18:50FromDiscord<nikki> Zevv that only works if true == 1
21:18:59miprier, := for assignment. It's a nice way of getting around Ada not having += operators
21:19:04FromDiscord<nikki> but in C any non-zero is true
21:19:16FromDiscord<nikki> but yeah if you make sure you use 1 only it works
21:19:28Zevvnikki: Why do you think I'm writing Nim and not C
21:19:30disruptekterrible idea, honestly.
21:19:41ZevvC is full of terrible ideas.
21:19:42disruptektoggle() tells me absolutely nothing.
21:19:43ZevvI love it.
21:19:57FromDiscord<scott> it doesn't seem like a farfetched sugar to me
21:20:08disruptekit doesn't tell me if it's idempotent, what type it is, whether it as side effects, etc.
21:20:26Zevv`toggle!`(), because I love you too
21:20:32Zevvand everybody loves Ruby
21:20:41disruptekoff and on as enums that equal false and true. these are acceptable sugar.
21:20:46disruptektoggle() is horribad.
21:20:52FromDiscord<scott> can procs shout in nim?
21:20:57disruptekmine do.
21:21:10FromDiscord<nikki> i wonder why you're flipping booleans so often haha
21:21:15disruptekthey scream, "FABULOUS!"
21:21:20FromDiscord<nikki> but also that the flipping isn't some reusable domain-word
21:21:22Zevvnikki: user interface
21:21:26FromDiscord<nikki> like if you had flipFlag then sure
21:21:28Zevvit's called a toggle button
21:21:38FromDiscord<nikki> why does it end up happening many places over the code
21:21:43FromDiscord<nikki> don't you have just one toggle button component
21:21:53FromDiscord<scott> lol, disruptek, methods in Ruby/Crystal which end in the exclamation mark are referred to as methods which "shout"
21:21:54FromDiscord<nikki> or send a var bool to the toggle button code and flip it there
21:21:56disruptekhe wants to type less, is all.
21:22:00Zevvbecause my code is just bad
21:22:11FromDiscord<scott> ones that end in the question mark are said to "ask"
21:22:12ZevvI'm beyond shame
21:22:21FromDiscord<nikki> pics of code?
21:22:22FromDiscord<nikki> jk
21:22:30disruptekjust template foo = some.stupid.long.shit and then you can foo = not foo like a sane person.
21:22:34Zevv"pics of code"
21:22:41leorize[m]!eval import with; var a = false; a.with: _ = not _
21:22:41Zevvthat's very 2020
21:22:42NimBotCompile failed: /playground/nim/lib/system/fatal.nim(49, 5) Error: unhandled exception: /playground/nimble/with-0.4.0/with.nim(15, 9) `t.kind in {nnkObjectTy, nnkTupleTy}` `with` must be called with either objects or tuples. [AssertionDefect]
21:22:48Zevvin the old days we just used ASCII For that
21:22:51FromDiscord<scott> I still don't see what's wrong with tossing `func toggle(var x: bool) = x = not x`?
21:23:12Zevvnothing is, but disruptek
21:23:15FromDiscord<nikki> if you do that you can't have a long-winded discussion on discord
21:23:22disrupteki thought you said you agreed with me.
21:23:58FromDiscord<scott> Zevv, I meant in your code, not the stdlib
21:24:04leorize[m]!eval import with; var a = false; a.with: `=` not _
21:24:06NimBotCompile failed: /playground/nim/lib/system/fatal.nim(49, 5) Error: unhandled exception: /playground/nimble/with-0.4.0/with.nim(15, 9) `t.kind in {nnkObjectTy, nnkTupleTy}` `with` must be called with either objects or tuples. [AssertionDefect]
21:24:22leorize[m]gah, with is limited
21:24:26Zevvscott: I forked my own stdlib when I forked Nim
21:24:33Zevvin my parallel universe, I have it alll
21:24:41FromDiscord<scott> leorize, just use the playground
21:25:01leorize[m]oh lol with is not limited
21:25:08leorize[m]playground has the `with` package installed
21:25:22FromDiscord<scott> hm?
21:25:37FromDiscord<scott> I was saying link to the playground instead of trying to !eval
21:26:55leorize[m]oh sorry I wasn't talking to you :P
21:27:00FromDiscord<nikki> is there some mode or something one can turn on to check that there were no mem leaks with arc? i was playing around with having manually managed memory that holds arc objects etc.
21:27:03disrupteki want to be fat enough to wear a tool apron as a bib.
21:27:07leorize[m]I was referring to my statement earlier
21:27:09mipriit does look nicer with with
21:27:11FromDiscord<nikki> seems like one way is to use malloc + valgrind?
21:27:20*solitudesf quit (Ping timeout: 272 seconds)
21:27:23disruptekuse valgrind.
21:27:42disruptekyes, with useMalloc.
21:28:04Yardanico@NIKKI -d:useMalloc --gc:arc
21:28:13Yardanicothere's also some debugging arc stuff but not really only for leaks
21:28:25leorize[m]stdlib `with` doesn't support multiple evaluation of `_` :( https://play.nim-lang.org/#ix=2B4j
21:28:38FromDiscord<nikki> yay no leaks i'm so happy thanks everyone
21:28:45FromDiscord<not_lum> hi
21:28:56disruptekme too.
21:29:27FromDiscord<scott> oh wow, that with statement is NICE
21:29:40FromDiscord<scott> is that a 3rd party package or stdlib?
21:29:52miprithe one I used was Zevv's. didn't know about stdlib
21:30:35miprihttps://nim-lang.org/docs/lib.html doesn't know about it either
21:30:48leorize[m]the one I use was stdlib
21:30:53Yardanicoyeah that needs to be updated mipri
21:31:06FromDiscord<nikki> arc is cool i'm really happy
21:31:16disruptekit's excellent.
21:31:29FromDiscord<nikki> this is like exactly the thing needed
21:31:34FromDiscord<nikki> the combination of features nim has
21:31:50disruptekwell, it has very good bones.
21:32:06disruptekthere is a lot of work to be done, but nowhere to go but up.
21:32:13FromDiscord<nikki> it's a good place to be in
21:32:26FromDiscord<nikki> also the community is pretty awesome tbh
21:33:29*Vladar quit (Quit: Leaving)
21:34:14leorize[m]Zevv: fix std/with and you can have your DRY toggle :P
21:35:18Zevvin my stdlib with has long been fixed
21:35:35Zevvone day I'll fork the universe
21:35:48FromDiscord<scott> why not upstream?
21:35:49Zevvoh look I did just that!
21:35:52Zevvooh and again
21:36:00disruptekeh we will fix the community eventually, but the code is easier.
21:40:28FromDiscord<nikki> how could i build with `-d:danger` but also get `-g` on the C compilation / link?
21:40:37FromDiscord<nikki> i want to step through it with gdb just to learn what's happening
21:40:50FromDiscord<nikki> _looks at docs_
21:41:41FromDiscord<nikki> oh and actually step through the C / have gdb take me to the C, not the nim
21:42:02FromDiscord<scott> could you build with `-d:danger`, then compile the cached C code with `gdb -g`?
21:42:39FromDiscord<nikki> oh totes. was jw if there was a quick way from the nim compiler commadn itself
21:42:44FromDiscord<lqdev> --debugger:gdb
21:42:55FromDiscord<Recruit_main707> ^
21:43:02FromDiscord<lqdev> or --debugger:native
21:43:14FromDiscord<nikki> i think `--debugger:native` makes gdb show nim code on breakpoint right?
21:43:21FromDiscord<lqdev> yes
21:43:30leorize[m]`nim -g --checks:off`
21:43:31FromDiscord<nikki> yea i wanna actually step through the C code :0
21:43:44FromDiscord<nikki> the generated C code
21:44:07leorize[m]if you wanna step through the C code: `--linedirs:off`
21:44:13FromDiscord<nikki> kk
21:44:24miprinim c -d:danger --passC:-g --verbosity:2
21:44:37FromDiscord<nikki> passC 😄
21:44:39FromDiscord<nikki> yay
21:57:09FromDiscord<nikki> ok just stepped through the C of my manual alloc + arc test with gdb
21:57:13FromDiscord<nikki> my conclusion is that nim is awesome
21:58:20FromDiscord<Elegant Beef> Grats
21:58:50FromDiscord<scott> yeah arc is why I'm checking out nim again
21:59:27FromDiscord<scott> really pleasantly surpised with ergonomics too 🙂
21:59:49FromDiscord<nikki> i also really like that it gens C and i can gdb thru the C and i understand how much stuff the computer would do
21:59:58FromDiscord<nikki> it's not actually that tractable to do the same with C++
22:00:22FromDiscord<nikki> also the gen'd C just using structs for the objects
22:00:45FromDiscord<scott> hm, that's interesting. I kinda was viewing the C target as a negative, but that is a nice upside
22:00:56FromDiscord<Elegant Beef> Why is the C target a negative?
22:01:07FromDiscord<nikki> like there's no "hidden control flow" but it's still higher level than parsing the straight up asm, which i'd do when compiling C++
22:01:42FromDiscord<scott> because I don't like the idea of targeting a text-based output. it seems more prone to confusing bugs than an intermediary bytecode like LLVM IR.
22:01:51FromDiscord<nikki> @scott i think C is proving to be a good IR + gives natural interop with C and other C ABI libs without resorting to eg. ffi
22:02:05miprithe worry with a transpiler is always that you'll have to deal with two languages
22:02:13FromDiscord<scott> yeah exactly
22:02:20leorize[m]isn't LLVM IR text also?
22:02:36disruptekit doesn't have to be. 😉
22:02:41FromDiscord<nikki> usually you just use llvm as a library in the compiler and just generate its in memory IR repr
22:02:42FromDiscord<scott> sorry, I meant the bytecode that LLVM IR translates directly to
22:02:56mipriNim's good on that. actually I wish it weren't so good, I'd like to emit an #include and then define some unary functions that emit C macros or such
22:03:01disruptekscott: the reason c is a win is embedded and maybe gpu stuff.
22:03:07FromDiscord<scott> like IR -> LLVM bytecode as ASM -> machine code
22:03:20FromDiscord<Elegant Beef> Meanwhile i'm going "Nim Vm, Nim Vm" and cheering that this method gives an portable interpreted subset 😄
22:03:39leorize[m]Nim's C output is pretty structured
22:03:42FromDiscord<nikki> @scott with the text thing, did you mean bugs as a user of the lang, or as a compiler author
22:03:50leorize[m]the backend have a pseudo C AST and a renderer
22:03:56leorize[m]so it's pretty solid
22:04:03FromDiscord<nikki> i think if the compiler is well tested and stable and i trust the devs, then it ends up netting positive
22:04:17FromDiscord<scott> @nikki I mean the potential for an interaction of bugs in both instances as with any other transpiled language
22:04:20disruptekclyybber: do you want the current example of mangling that i'm working on? i can present the problem here, finally.
22:04:36FromDiscord<nikki> yeah i'd be curious to see concrete instances of that if / when you run into them
22:05:23FromDiscord<nikki> the capability for interop with C++ templates is p nice too, not sure i'd use it soon except maybe with entt
22:05:30FromDiscord<nikki> but i'm mostly considering flecs
22:05:34Yardanicowell it can happen, but it's pretty rare @nikki
22:05:44disruptek@clyybber: ^
22:05:48Yardanicoi mean C compiler errors for nim-compiled C code
22:06:05FromDiscord<scott> probably more rare than a Crystal compiler error, that's for damn sure 😁
22:06:05FromDiscord<nikki> yea that's what i was thinking. it depends on the stability of the lang i think; but nim has seemed to come far
22:06:10FromDiscord<Clyybber> disruptek: Yeah,!
22:06:21leorize[m]I'm pretty sure Nim's `shr`/`shl` still have the same undefined behavior as C
22:06:30FromDiscord<Clyybber> leorize: Nope
22:06:34FromDiscord<Clyybber> They are masked
22:06:43disruptekso i'm working on the tjsonutils.cpp test.
22:06:44leorize[m]oh, krux PR went in?
22:06:57FromDiscord<Clyybber> I *think* so
22:07:13FromDiscord<nikki> i think @scott it could be that, a C repr is more high level and to do an llvm IR output you generate this high level model anyway then codegen to IR yourself too, whereas with C output you reduce that work
22:07:22FromDiscord<nikki> which actually means less code that can have bugs
22:07:24FromDiscord<Clyybber> leorize: oh, its not
22:07:55leorize[m]it's the sort of undefined behavior that you're unlikely to hit, so I don't worry too much
22:08:10disruptekdue to order of generics, the $ of a ordered-key-value-pair (tuple) from tables, when comprised of string and JsonNodeObj, eg. a JObject most likely, is defined as taking an argument x with different names.
22:08:21leorize[m]most of C undefined behaviors has been turned into runtime & compile-time checks iirc
22:08:26FromDiscord<nikki> that is mostly only true it the frontend lang is similar enough to C, and it seems to be. like there's the runtime, and them the macros / static lookup stuff which you'd have to impl anyways even when targetting LLVM IR
22:08:52disruptekin one case, it takes tupJsonNode_std_json_3 and in another it takes OrderedKeyValuePair_std_tables.
22:09:25disruptekand this is a problem on c++ because c++ forms a proc symbol using the function name and the first argument typename.
22:09:40disruptekso we get a linking failure.
22:10:10FromDiscord<nikki> leorize i don't think UB captures all of the types of issues scott is talking about, maybe he was getting more at the kind of issues u see in other transpilation situations eg. babel, cljs, ...
22:10:19FromDiscord<nikki> which don't depend on UB in the backend lang
22:11:48FromDiscord<nikki> btw quick q--- if this works:
22:11:54FromDiscord<nikki> https://media.discordapp.net/attachments/371759389889003532/767147900282470420/image0.png
22:12:09FromDiscord<nikki> that means that it'll properly work for a nested spaghetti of arc objects in Elem right
22:12:22FromDiscord<nikki> will try some spaghetti soon i guess
22:12:52leorize[m]yes it will
22:13:03disrupteki had mexican for the first time in over a year last night.
22:13:14disruptekand she says her sister is a redhead. go figure.
22:13:29disruptekit's a crazy world we live in.
22:13:57leorize[m]you're unlikely to surpass the amount of spaghetti within Nim's asyncdispatch :P
22:14:05FromDiscord<Clyybber> lol
22:14:09Zevvcmon fix csp then
22:15:00disruptekwhat's wrong with cps?
22:15:21disruptekwe're not waiting on me, right?
22:15:21FromDiscord<nikki> did zevv actually mean csp lol
22:15:27FromDiscord<nikki> which is channels n thingies
22:15:33FromDiscord<nikki> while csp is continuations
22:15:36disruptekcsp comes after we finish cps.
22:15:41FromDiscord<nikki> (edit) 'csp' => 'cps'
22:15:50FromDiscord<nikki> cool :0
22:16:02FromDiscord<nikki> when do we get actors
22:16:15disruptekwell, you can make actors if you want.
22:16:35disrupteki want csp primitives first.
22:16:53FromDiscord<nikki> will do
22:17:17FromDiscord<nikki> i've always if you take a csp graph
22:17:24FromDiscord<nikki> and then take its line graph or dual or sth
22:17:27FromDiscord<nikki> u get actors
22:17:36FromDiscord<nikki> (edit) 'i've always ... if' => 'i've alwaysfelt like'
22:18:00disruptekokay, but i personally don't think actors mesh well with the rest of nim.
22:18:21FromDiscord<nikki> oh yeah. i'm not saying actors mesh well with the rest of nim
22:18:26FromDiscord<nikki> just playin' 'round
22:18:37disruptekyeah, once cps works properly, we'll have a lot of options.
22:18:43FromDiscord<nikki> i don't write much asyncblah code usually
22:18:46disruptekeverything is on the table. everything can be done.
22:18:57FromDiscord<nikki> yea seems like it. nim is p flexible
22:19:20disruptek!repo cps
22:19:21disbot12https://github.com/disruptek/cps -- 9cps: 11Continuation-Passing Style for Nim 🔗 15 39⭐ 2🍴
22:19:28FromDiscord<nikki> i feel like nim's syntax structure makes for way saner macros than s-exps
22:19:43disruptekto read, you mean?
22:19:48FromDiscord<nikki> yea saw that earlier disruptek and was reading thru some examples
22:19:57FromDiscord<nikki> yea the UX of actually using the macros
22:20:45disruptekit's just an easier dsl, but it's not really different.
22:20:52disrupteki mean, i like that.
22:21:40FromDiscord<haxscramper> I've spent about ~3+ years using emacs etc. and still can't really get around lisp macros, because of ergonomics. Nim macros are /much/ better compared to lisp, since you know what you are dealing with
22:21:54disrupteki mean, "tool bib" isn't really a thing. is that insane or what?
22:22:00disruptekwhere are all the fat people?
22:22:29FromDiscord<nikki> well, i think having read some nim, after having done a fair amt of lisp, it feels like i understand ppl's nim dsls quicker. it's not that different for sure but just like empirical human feelz thingies
22:23:03FromDiscord<haxscramper> Like this is a regular case object tree + lisp syntax is just simply **the bad** thing
22:29:32FromDiscord<Rythm> sent a long message, see http://ix.io/2B4D
22:34:10*nature quit (Quit: WeeChat 2.9)
22:38:18FromDiscord<Jockie Music (1)>
22:42:24FromDiscord<haxscramper> How to check if file `isMainModule`, except for cases where documentation is being built? Does `nim doc` create some `define` that I can check?
22:59:39*madpata quit (Ping timeout: 258 seconds)
23:11:38*vicfred joined #nim
23:37:35*a_chou joined #nim
23:59:29FromDiscord<Clyybber> disruptek: Ha, ok. How does current mangling do it?