<< 21-01-2021 >>

00:11:45ForumUpdaterBotNew post on r/nim by AndreaDaedra: I've just realized that if you put your WIN (Windows) keycap upside down it says NIM like in the Nim programming language. &lt;3, see https://i.redd.it/xqdn1kt2vkc61.jpg
00:20:14FromDiscord<digitcrusher> lol
00:32:38*zedeus joined #nim
00:33:55FromDiscord<Clyybber> ha nice
00:43:12lainwhat does %= do in a nim.cfg file?
00:53:03*Kaivo quit (Quit: WeeChat 3.0)
01:04:55disrupteksee Nim/config/nim.cfg:
01:04:57disruptek# Environment variables can be accessed like so:
01:04:58disruptek# gcc.path %= "$CC_PATH"
01:07:46lainahhh ok, thanks
01:09:58*Tanger joined #nim
01:21:19*abm quit (Read error: Connection reset by peer)
01:23:33*muffindrake joined #nim
01:42:09*cgfuh quit (Quit: WeeChat 2.9)
02:28:17*Prestige_ is now known as Prestige
03:04:40*Tlangir joined #nim
03:07:22*Tanger quit (Ping timeout: 256 seconds)
03:13:07*muffindrake quit (Ping timeout: 260 seconds)
03:14:44*muffindrake joined #nim
03:20:59*wasted_youth quit (Quit: Leaving)
03:41:32*casaca quit (Remote host closed the connection)
03:53:24*rockcavera quit (Remote host closed the connection)
03:55:43*casaca joined #nim
04:14:47*spiderstew joined #nim
04:15:05*spiderstew_ quit (Ping timeout: 272 seconds)
04:53:20*zedeus quit (Ping timeout: 256 seconds)
04:53:26leorizedisruptek: do you think the name findExe is good or should I pick something else?
04:53:48*zedeus joined #nim
04:53:55leorizeI need to write one for nim-sys, and unlike the stdlib, this one is not configurable and instead mimics whatever the host os would do
04:54:08leorizebasically a library version of `which`
04:54:45disruptekwill it clash? if so, whichExe. else, probably not worth changing it?
04:55:05leorizeprobably not, I don't think anyone would import both sys/exec and osproc
04:55:44disruptekprobably leave it, then; one less think for people to guess wrong.
04:59:49disrupteki like that it's not configurable. 😁
05:00:06disruptekwhat are you gonna tell timmy when he demands switches?
05:00:34leorizedon't use it :P
05:01:56disruptekhah
05:08:15FromDiscord<Avatarfighter> hello hello everyone
05:10:40Prestige o/
05:17:44*sagax joined #nim
05:37:45*Tlanger joined #nim
05:38:49*vicfred_ quit (Quit: Leaving)
05:39:45*Tlangir quit (Ping timeout: 240 seconds)
05:42:03FromDiscord<JSGRANT> Now we just need Nim-Machine-Operating-Systems; We've almost gone full-circle!
05:42:40FromDiscord<JSGRANT> looooooooooool; Honestly a bit shocked there aren't more osdev projects in Nim. Maybe not too-too shocked because the barrier-to-entry / mountain-to-climb is a fair bit higher but still.
05:44:41FromDiscord<InventorMatt> I think it would really cool to make an rtos for embedded systems in nim. it would certainly be alot easier than a full os
06:21:10disrupteknim has exactly 7,000 closed issues.
06:22:30FromDiscord<ElegantBeef> We did it, let's pack it up
06:23:20disruptekwe aren't growing the number of watchers but we /are/ growing the number of issues.
06:26:00disruptektimmy has 89 open PRs.
06:27:05disruptekthe pr queue has grown, too. i'd say we're up around 20% yoy.
06:28:41*waleee-cl quit (Quit: Connection closed for inactivity)
06:49:36PrestigeThat's a lot of PRs. Takes a long time to review?
06:54:57disrupteki really don't get it.
06:55:51disruptekmaybe i'm an asshole, but as far as i'm concerned, nothing has really changed in the last year except that we have fewer arc bugs and orc is almost usable.
06:56:12disruptekwell, not maybe. maybe was a stretch, i admit.
06:56:51disruptekchoosenim seems a lot more stable lately, which is good.
06:58:59PrestigeAnd progress (at least in research?) on cps and concepts? disruptek
07:00:05disruptekwhen i think of nim-2020, i won't think of cps or concepts.
07:00:45PrestigeYeah, for sure
07:01:18Prestige2021 year of better editor support, maybe
07:01:56disruptekit's pretty disheartening if that is really our goal for the year.
07:02:39PrestigeI'd really really like concepts to be in a good state. It would have a big impact on how I write Nim code
07:02:49FromDiscord<lqdev> same
07:02:50disrupteksure.
07:02:51PrestigeBut I've no idea what's going on with it
07:03:04disruptekyou have to test it.
07:03:26disrupteki promised to test it next week.
07:04:02disruptekyou may as well get your hands dirty with the new impl. it only lacks fields, afaik.
07:04:05PrestigeI'm 100% down to test it and report any issues I find, but I thought it was in the middle of a rewrite, still
07:04:31disruptekno, it has been waiting for eyes for a couple months now.
07:05:22*zedeus quit (Ping timeout: 256 seconds)
07:05:26PrestigeWell shit. When I'm back on my computer tomorrow I'll see about installing the most recent nim version and test it out
07:05:39disruptekdon't bother; it's not in that version.
07:05:54PrestigeJust in a branch?
07:06:04disruptekyes. araq-concepts
07:06:25*narimiran joined #nim
07:06:34PrestigeNoted, I'll be on that tomorrow
07:07:58FromDiscord<Avatarfighter> disruptek if i send you a meme would you laugh
07:08:00disruptekno.
07:08:00disrupteklast commit to the branch was september 13th.
07:08:00disruptekso, four months ago.
07:08:02PrestigeI'm trying to unwind from work today. 2 different broken builds were deployed to prod, I'm amazed
07:08:07FromDiscord<Avatarfighter> Ok disruptek sending you a dank maymay
07:08:30FromDiscord<Rika> haha thats so funny avatar whered you find this
07:09:49PrestigeDo we have a public board/list of goals for upcoming releases with acceptance criteria?
07:10:13PrestigeOr similar
07:10:42disrupteki miss chinese food.
07:10:46FromDiscord<Avatarfighter> Rika wanna see the meme
07:10:49FromDiscord<Avatarfighter> disruptek close your eyes so you dont see it again https://media.discordapp.net/attachments/371759389889003532/801710112267829268/image0.jpg
07:10:55FromDiscord<Rika> @Avatarfighter put it through a zoom meeting too aka the teacher showing the book through zoom
07:10:55FromDiscord<Rika> xddd
07:10:55FromDiscord<Avatarfighter> lmao
07:11:13FromDiscord<Rika> make sure the text is similarly distorted
07:11:18FromDiscord<Rika> why isnt the text gray btw
07:11:20FromDiscord<Avatarfighter> better yet
07:11:52Prestigedisruptek: get some
07:12:24FromDiscord<Avatarfighter> My bad
07:12:24FromDiscord<Avatarfighter> the meme hasn’t faded like textbooks have
07:12:31FromDiscord<Avatarfighter> Prestige: not that I know of
07:12:31disruptekprestige: there's a roadmap somewhere.
07:12:31FromDiscord<Avatarfighter> disruptek: nothing complete i thought?
07:13:03PrestigeHmm I'll dig for it at some point
07:14:41*hoijui_ joined #nim
07:14:41*hoijui joined #nim
07:17:07disruptekyeah, i don't remember where it is.
07:19:48*actuallybatman quit (Ping timeout: 260 seconds)
07:21:20disruptekPrestige: i know notnil was on the 2020 roadmap, along with ic and orc.
07:21:26PrestigeWas there a problem with asyc/await's impl? I haven't used it in Nim
07:21:32PrestigeAh.
07:21:53disruptekit's too late to rant about async.
07:22:02disruptek!rfc 295
07:22:02disbothttps://github.com/nim-lang/RFCs/issues/295 -- 3next steps for CPS
07:23:07saemBut rants are fun!
07:31:46disruptek~goals is disruptek, 2021: nigel, nimo, gitnim/dist, cps
07:31:47disbotgoals: 11disruptek, 2021: nigel, nimo, gitnim/dist, cps
07:32:04disruptekfeel free to add yours.
07:32:28disruptekquery with ~goals (some regex)
07:32:48disruptekas per usual ~footnote syntax.
07:32:56disruptek~rika oo
07:32:56disbotRika: 11a footnote
07:33:09disruptek~rika goatlicker
07:33:10disbotno matching footnotes for `rika` with regexps `goatlicker`. 🙁
07:33:26*haxscramper joined #nim
07:36:33*haxscramper left #nim (#nim)
07:39:44*habamax joined #nim
07:40:06saem~goals saem
07:40:07disbotno matching footnotes for `goals` with regexps `saem, `. 🙁
07:40:15saemGood
07:41:45FromDiscord<haxscramper> ~goals is haxscramper: C++ interop, docgen
07:41:45disbotgoals: 11disruptek, 2021: nigel, nimo, gitnim/dist, cps
07:41:46disbotgoals: 11haxscramper: C++ interop, docgen
07:48:13FromDiscord<lqdev> ~goals is lqdev 2021: tsuki
07:48:14disbotgoals: 11disruptek, 2021: nigel, nimo, gitnim/dist, cps
07:48:14disbotgoals: 11haxscramper: C++ interop, docgen
07:48:14disbotgoals: 11lqdev 2021: tsuki
08:26:57*leorize quit (Remote host closed the connection)
08:30:20*Tlanger quit (Quit: Leaving)
08:30:22*leorize joined #nim
08:33:29*hoijui_ quit (Ping timeout: 272 seconds)
08:33:29*hoijui quit (Ping timeout: 272 seconds)
08:38:32*PMunch joined #nim
08:45:53Oddmongergoal: learning Nim
08:47:49PMunchOooh, footnotes have regex support?
08:48:49FromDiscord<haxscramper> ~.
08:48:49disbotno footnotes for `.`. 🙁
09:19:15Oddmongerhow would you protect an include from multiple inclusions ?
09:19:43Oddmongerdefining a global and initializing it at the end of the include ?
09:19:43FromDiscord<haxscramper> Probably using C-like include guards
09:20:03FromDiscord<haxscramper> At the start
09:20:03saemShouldn't that be a compiler error?
09:20:24FromDiscord<haxscramper> No, `include` doesn't give any errors
09:20:41saemSure, but shouldn't it?
09:20:43FromDiscord<haxscramper> Oddmonger: do you really need an include?
09:21:13FromDiscord<haxscramper> I guess `include` is "screw it, I don't care" use case where you are on your own
09:21:19Oddmongerit's for readability, and for defining a struct in multiple files
09:21:31FromDiscord<haxscramper> Maybe refactor your code?
09:21:51FromDiscord<haxscramper> Because `include` only brings pain IMO, you need to use `import` 99.99% of the time
09:22:31Oddmongerwell i use import 99% of the time
09:22:57FromDiscord<haxscramper> But you can do `when not includeHappened: const includeHappened = true <your module body>`
09:23:27Oddmongerhere the include is dragged from a tool, not used after generation and filled of import of regex and so
09:23:39Oddmongerso i keep only the 1% necessary
09:23:50Oddmongerah ok this way, thank you
09:37:48*PMunch quit (Ping timeout: 256 seconds)
09:38:12*PMunch joined #nim
09:49:30*ehmry quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
09:50:09*ehmry joined #nim
09:53:10*ehmry quit (Client Quit)
09:53:32*ehmry joined #nim
09:57:44*hnOsmium0001 quit (Quit: Connection closed for inactivity)
10:03:33*abm joined #nim
10:03:42*Vladar joined #nim
10:15:59*Tanger joined #nim
10:24:31FromDiscord<hamidb80> can I ask my questions/problem about Nim here?
10:24:38FromDiscord<lqdev> yeah
10:24:48*hoijui_ joined #nim
10:24:53*hoijui joined #nim
10:27:37FromDiscord<hamidb80> I'm a little confused about using "re" prefix before regex pattern. ↵in the nim doc (https://nim-lang.org/docs/re.html#Regex) I saw something like this ↵find("abcdefg", re"cde") https://media.discordapp.net/attachments/371759389889003532/801759897192235018/Capture.PNG
10:27:59FromDiscord<lqdev> the `re` "prefix" is not really a prefix, it's a procedure
10:28:15FromDiscord<lqdev> and you're only importing `find` from the `re` module
10:28:40FromDiscord<lqdev> change your `from re import find` to `from re import find, re`, or even better yet, `import re`.
10:29:42FromDiscord<hamidb80> https://media.discordapp.net/attachments/371759389889003532/801760421803196416/Capture.PNG
10:29:51FromDiscord<hamidb80> sounds not working
10:30:33FromDiscord<lqdev> hmm
10:30:49FromDiscord<ElegantBeef> does `from module` allow using `module.proc`?
10:31:01FromDiscord<Clyybber> Araq: ping
10:31:04FromDiscord<lqdev> really i've never used `from import` so i can't really give you much advice
10:31:15FromDiscord<lqdev> but idiomatic Nim prefers using `import module`
10:31:23FromDiscord<ElegantBeef> My only advice is to write nim idiomatic code as much as your python brain says it's not right
10:31:33FromDiscord<hamidb80> but if I use re.re it's working
10:31:51FromDiscord<lqdev> yeah possibly because it imports the module from the module
10:31:57*skelett quit (Quit: WeeChat 2.9)
10:32:02FromDiscord<ElegantBeef> i dont know anything about importing modules outside `import module` and `import module except A`
10:32:38FromDiscord<lqdev> i think this could be classified as a bug but then not really
10:33:03FromDiscord<lqdev> because in the `re` module there are two symbols named `re`: the module itself and the procedure
10:38:48*xet7 joined #nim
10:42:19*Vladar quit (Remote host closed the connection)
10:47:49*Vladar joined #nim
11:07:54*habamax quit (Read error: Connection reset by peer)
11:08:09*habamax joined #nim
11:38:07*xet7 quit (Quit: Leaving)
11:49:32*Q-Master quit (Ping timeout: 260 seconds)
11:57:47PMunchIs there a guide somewhere for cross-compiling to the RPi?
11:58:08PMunchEh, I guess it's just compiling for ARM..
12:00:34Zevvyeah good luck with that
12:00:51Zevvthe compilation is usually trivial, but using the right headers & libs is your pain
12:00:54PMunchWhy would that be so hard?
12:00:56PMunchAh..
12:01:21ZevvI know of raspi cross compile environments, I think I tried something once
12:01:29Zevvbut in the end I just decided to put a decent disk on the pi and run it there
12:01:57PMunchProbably doesn't help that I'm using it for Home Assistant
12:02:02PMunchSo it's not running raspbian
12:02:14PMunchuname -a: Linux core-ssh 5.4.79-v7 #1 SMP Fri Jan 1 15:06:29 UTC 2021 armv7l Linux
12:02:31Zevvcouldn't tell, in my experience 99% of the stuff running on raspis is just raspian spinoff
12:03:46PMunchThis is not.. https://github.com/home-assistant/operating-system
12:10:04PMunchHmm, looks like running it in Docker is the easiest solution..
12:12:30FromDiscord<hamidb80> is there any reason that explains why both ↵string.len and string.len() ↵are correct?
12:12:59PMunchYes
12:13:13PMunchIt's the universal call syntax
12:13:16PMunchOr part of it
12:13:22PMunchlen(string) is also valid
12:13:26PMunchSo is `len string`
12:17:03*hoijui quit (Quit: Leaving)
12:17:19*hoijui joined #nim
12:18:23FromDiscord<hamidb80> wow
12:21:37*Q-Master joined #nim
12:22:18PMunchNot sure if that was a good wow or a bad wow :P
12:29:05FromDiscord<hamidb80> good wow
12:29:12FromDiscord<hamidb80> sounds amazing
12:29:32PMunchIt is pretty neat
12:29:35FromDiscord<hamidb80> (edit)
12:29:50FromDiscord<hamidb80> 👍
12:31:06FromDiscord<Rika> depends on the person but its generally neat
12:31:08FromDiscord<hamidb80> I think nim needs more attention
12:32:12FromDiscord<Rika> we all think so
12:34:47*hoijui quit (Ping timeout: 272 seconds)
12:34:47*hoijui_ quit (Ping timeout: 272 seconds)
12:40:02FromGitter<heharkon> hi, I'm new here and to Nim... I think Nim is awesome too. I saw some discussion to make tooling better for nim, but I have to say I'm pretty impressed already! :) I've been learning Ada for some time now but I keep hitting my head with it's tooling, even with the help of the new package manager Alire, everything is so, SO difficult... seems that I'm jumping ship and switching to nim now :D
12:40:41FromDiscord<Rika> nim's tooling is no chance against go's, rust's, python's, etc.
12:40:44FromDiscord<Rika> ada
12:40:46FromDiscord<Rika> oops
12:40:51FromDiscord<Rika> didnt mean to send that so early
12:40:53PMunchReally? I think it's pretty good
12:41:09FromDiscord<Rika> you think nimsuggest is good?
12:41:23PMunchWell, maybe not the editor tools
12:41:31PMunchBut I don't tend to use those anyways
12:41:50FromGitter<heharkon> yeah of course there's always room for improvement, but still :)
12:42:23FromDiscord<Rika> editor tooling and debug tools are the issues for nim
12:42:24FromDiscord<Rika> i believe
12:46:27ForumUpdaterBotNew thread by Wiltzutm: Is there a way to use question mark in my proc names?, see https://forum.nim-lang.org/t/7407
12:47:18FromDiscord<Yardanico> AHAHHAHA https://media.discordapp.net/attachments/371759389889003532/801795051268866090/unknown.png
12:47:37FromDiscord<Yardanico> `proc isLarge(p: Penis): bool`
12:55:04*rockcavera joined #nim
12:57:40FromDiscord<Recruit_main707> Modern problems
13:02:47*abm quit (Remote host closed the connection)
13:03:15*abm joined #nim
13:04:02*rockcavera quit (Killed (rothfuss.freenode.net (Nickname regained by services)))
13:04:03*rockcavera joined #nim
13:06:47*Tlangir joined #nim
13:06:57*xet7 joined #nim
13:07:29*Tanger quit (Ping timeout: 256 seconds)
13:07:35FromDiscord<lqdev> damn that guy has a low self-esteem
13:07:35*Kaivo joined #nim
13:09:35PMunchhttp://ix.io/2MMq damn it..
13:09:54PMunchlqdev, or a massive dong and some humour
13:12:41ForumUpdaterBotNew question by Alex Craft: How to mark non-pure function as pure in Nim, see https://stackoverflow.com/questions/65828146/how-to-mark-non-pure-function-as-pure-in-nim
13:16:17FromDiscord<Yardanico> @lqdev lol https://media.discordapp.net/attachments/371759389889003532/801802343662223390/unknown.png
13:16:23FromDiscord<lqdev> frick
13:16:25FromDiscord<lqdev> you beat me to it
13:16:40FromDiscord<Yardanico> I actually cheated by posting an incomplete answer first, and then editing it a few times :)
13:17:15FromDiscord<lqdev> well i took my time to research that `cast(noSideEffects)` is actually `cast(noSideEffect)`
13:18:30FromDiscord<Yardanico> yeah same
13:21:32*hoijui_ joined #nim
13:21:37*hoijui joined #nim
13:22:20planetis[m]i liked more subtle jokes like when the french guy posted a question about strings and due to google translate, some instances were translated as thongs
13:27:39PMunchHaha :P
13:32:16*abm quit (Quit: Leaving)
13:34:25*wasted_youth joined #nim
13:41:02FromDiscord<Yardanico> If anyone wants to play around with wolfSSL and Nim - https://www.wolfssl.com/, I dirty-patched openssl.nim to work with WolfSSL (because a person in Telegram asked if it's possible to use WolfSSL with Nim and I spent some time but got the simplest httpclient get request working for https://example.com)
13:41:03FromDiscord<Yardanico> https://gist.github.com/Yardanico/8f67af4f40f272de0b68ce7cf25a6fe6
13:41:14FromDiscord<Yardanico> it's really dirty-patched because wolfSSL adds its own prefixes
13:41:22FromDiscord<Yardanico> Compile wolfssl with ./configure --enable-static --enable-opensslextra --enable-opensslall --enable-tlsv10 --enable-dtls --disable-shared
13:41:38FromDiscord<Yardanico> and nim app with nim c --dynlibOverride:libssl --dynlibOverride:libcrypto -d:openssl10 -d:ssl --passL:"-L /path/to/wolfssl/src/.libs/ -lwolfssl" main.nim
13:43:00FromDiscord<Yardanico> file size is 944K if the binary is compiled with -d:danger --gc:arc --opt:size (dynamically linked with glibc)
13:43:49PMunchThat's pretty cool
13:44:18FromDiscord<exelotl> @Yardanico omg how did you get a dark theme on the forums :(
13:45:43FromDiscord<Yardanico> dark reader
13:45:52FromDiscord<Yardanico> I'm using it for pretty much all of my browsing on desktop nowadays
13:49:37PMunchI'm reading the community survey, was it translated to other languages than English?
13:50:02FromDiscord<Yardanico> I don't think so, no
13:50:15PMunchAh
13:51:07PMunchI wonder if we lose a lot of non-english speaking users on the survey from that
13:51:22PMunchFor example the Chinese users
14:02:22*PMunch quit (Quit: leaving)
14:06:48FromDiscord<Yardanico> got a 100% static 64-bit musl (zig cc) + wolfssl nim binary of size 988KB
14:06:54FromDiscord<Yardanico> maybe I can try to bring it down even more
14:09:32*rockcavera quit (Remote host closed the connection)
14:19:14*hoijui quit (Ping timeout: 264 seconds)
14:19:50*hoijui_ quit (Ping timeout: 264 seconds)
14:20:42ForumUpdaterBotNew thread by Alexeypetrushin: What are simple profilers to use with Nim?, see https://forum.nim-lang.org/t/7408
14:23:18FromDiscord<shadow.> is there any graphics library similar to processing? i basically need a way to handle clicks, draw rectangles, and draw images
14:25:59FromDiscord<digitcrusher> opengl ;)
14:26:24FromDiscord<digitcrusher> there's also this https://github.com/memononen/nanovg
14:26:43FromDiscord<digitcrusher> i haven't used it myself though
14:27:05FromDiscord<mratsim> Do not try to compress crypto lib with UPX or compressor in that vein. They might "optimize" size for example by removing memset(0) calls that are supposed to erase secrets from memory.
14:27:17FromDiscord<shadow.> does opengl have an event-wait based system? im making chess, which means i only need to update canvas when an event fires
14:27:18FromDiscord<Yardanico> well this is not for normal "secure" usage
14:27:37FromDiscord<digitcrusher> opengl is just for graphics
14:27:47FromDiscord<shadow.> ah
14:27:51FromDiscord<shadow.> does it have click events?
14:27:54FromDiscord<digitcrusher> for window/keyboard/mouse stuff you also need something like glfw
14:27:58FromDiscord<shadow.> ahhh ok
14:28:04FromDiscord<mratsim> SDL handles controllers/joysticks/mouses and graphics
14:28:09FromDiscord<Yardanico> oh I got it down to 732KB by compiling wolfssl with zig cc musl too
14:28:10FromDiscord<shadow.> im debating between using nim and v for this project lol
14:28:16FromDiscord<Yardanico> for arm arch
14:28:18FromDiscord<Yardanico> "main: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, stripped"
14:28:20FromDiscord<Yardanico> 732KB
14:28:27FromDiscord<Yardanico> and it works
14:28:34FromDiscord<Yardanico> without upx
14:28:40FromDiscord<digitcrusher> choose the one with easier to use bindings
14:28:44FromDiscord<digitcrusher> for the libraries you need
14:28:54FromDiscord<digitcrusher> that's the main goal right?
14:29:02FromDiscord<shadow.> nim would be much easier for the engine as i can just use ref objects and methods, whereas v's oop is pretty iffy rn, but the library `gg` in v is supported by the langauge itself, and handles clicks and rendering very simply
14:29:10FromDiscord<shadow.> so it's basically, do i want the engine to be easier or the ui
14:29:11FromDiscord<shadow.> lol
14:29:19FromDiscord<shadow.> (edit) "methods," => "methods for pieces,"
14:29:27FromDiscord<mratsim> Did you look at nimx btw?
14:29:30FromDiscord<shadow.> hm
14:29:34FromDiscord<shadow.> let me take a look
14:29:53FromDiscord<shadow.> ive seen it before
14:30:02FromDiscord<shadow.> didnt know if it was good for this type of stuff or more typical desktop gui
14:30:31FromDiscord<lqdev> obligatory aglet ad https://github.com/liquidev/aglet
14:30:50FromDiscord<shadow.> bet
14:30:52FromDiscord<mratsim> Nimx was created for a game UI
14:30:53FromDiscord<shadow.> ill take a look
14:31:05FromDiscord<shadow.> hmm
14:31:10FromDiscord<lqdev> there's window.waitEvents(callback)
14:31:19FromDiscord<shadow.> oooh
14:31:20FromDiscord<shadow.> interesting
14:31:23FromDiscord<shadow.> thanks
14:34:30FromDiscord<digitcrusher> you won't need aglet if you don't want to use pure opengl
14:35:14FromDiscord<lqdev> ah right
14:35:24FromDiscord<digitcrusher> opengl is harder to use than the canvas stuff you described
14:35:40FromDiscord<lqdev> so if you want a layer on top of opengl you can try out NanoVG
14:35:46FromDiscord<lqdev> should be easy to bind with c2nim
14:36:48FromDiscord<shadow.> hmm
14:36:49FromDiscord<digitcrusher> yeah i already mentioned nanovg
14:37:17FromDiscord<shadow.> the only reason im leaning towards v is because gg works very well and is cross-platform and simple
14:37:18FromDiscord<digitcrusher> nanovg is supposed to be similar to the html canvas api
14:37:24FromDiscord<shadow.> but ill look at nanovg
14:37:36FromDiscord<shadow.> i just wish v's interfaces had fields lol
14:38:01FromDiscord<lqdev> V isn't even on 1.0 lol
14:38:06FromDiscord<shadow.> yeah exactly lmao
14:38:08FromDiscord<lqdev> and its compiler doesn't seem very stable
14:38:14FromDiscord<shadow.> works for me ¯\_(ツ)_/¯
14:38:17FromDiscord<lqdev> and its memory management seems kind of inexistent
14:38:22FromDiscord<shadow.> that is true lmao
14:38:27FromDiscord<shadow.> autofree isn't even done yet
14:38:36FromDiscord<lqdev> you may as well use processing tbh
14:38:38FromDiscord<shadow.> here's snake https://media.discordapp.net/attachments/371759389889003532/801823068321218600/snake.v
14:38:40FromDiscord<shadow.> NO
14:38:42FromDiscord<shadow.> JAVA
14:38:43FromDiscord<shadow.> BLECH
14:38:46FromDiscord<shadow.> DO NOT MAKE ME VOMIT
14:38:48FromDiscord<lqdev> try groovy
14:38:51FromDiscord<shadow.> ehhh
14:38:57FromDiscord<shadow.> kotlin maybe?
14:39:05FromDiscord<shadow.> idfk
14:39:11FromDiscord<shadow.> if i had to use that i might as well just use py
14:39:18FromDiscord<shadow.> but im ideally looking for something i can compile and distribute
14:39:38FromDiscord<digitcrusher> scala maybe?
14:40:06FromDiscord<shadow.> oh lord
14:40:06FromDiscord<shadow.> no
14:40:14FromDiscord<digitcrusher> why lol
14:41:27FromDiscord<shadow.> idk i typically like languages with less features honestly? i know that's odd in a nim server but i make an exception for nim lmao
14:41:36FromDiscord<shadow.> and afaik scala is pretty big
14:42:38FromDiscord<digitcrusher> interesting
14:43:40FromDiscord<digitcrusher> it's not like scala is forcing you to use alll the new features
14:43:50FromDiscord<shadow.> yeah i get that
14:44:01FromDiscord<shadow.> i just mean i prefer languages that are simple in principle because i find they follow the ideals i prefer
14:44:07FromDiscord<shadow.> again, why i've kinda been drawn to v lately lol
14:44:12FromDiscord<shadow.> though i do think that goes the other way sometimes
14:44:28FromDiscord<shadow.> like i like ufcs in nim, but i find the operator overloading to be a bit much for me
14:44:42FromDiscord<shadow.> so idk, i can swing either way i suppose
14:45:13FromDiscord<shadow.> and it's not just me, but reading other's code and/or using libraries, i kinda like to be able to just read it and know what's going on. and with complex scala features i might not be able to do that as easily ¯\_(ツ)_/¯
14:46:13*kaun_ joined #nim
14:47:19*kaun_ left #nim (#nim)
14:48:03FromDiscord<digitcrusher> hmm i didnt have any problems with not understanding scala code that i was gonna use in my project
14:48:15*Tlangir quit (Remote host closed the connection)
14:48:34FromDiscord<digitcrusher> maybe that's because i've only used lwjgl with scala so far lol
14:54:20FromDiscord<lqdev> if you like scala so much then what are you doing here 🤔
14:55:24FromDiscord<digitcrusher> idk
14:55:31FromDiscord<mratsim> Operator overloading to allow Vec3 to work naturally is one of the most requested feature in Zig.
14:55:37FromDiscord<digitcrusher> is this some hardcore nim fandom guild then?
14:55:51FromDiscord<mratsim> For math it's very important to have operator overloading.
14:56:04FromDiscord<lqdev> no but you seem to be praising scala a lot on a server unrelated to it
14:56:15FromDiscord<lqdev> and mind you this is the on-topic chat
14:56:20*actuallybatman joined #nim
14:56:24FromDiscord<digitcrusher> ok
14:56:28FromDiscord<mratsim> that's fine, we need to know what other languages do right
14:56:53FromDiscord<mratsim> personally I don't mind
14:57:26FromDiscord<mratsim> the line between praising and evangelism task force is not that tiny
14:58:49FromDiscord<shadow.> v has operator overloading but no custom operators and only same type on both sdies
14:58:51FromDiscord<Clyybber> scala is cool
14:58:52FromDiscord<shadow.> (edit) "sdies" => "sides"
14:59:01FromDiscord<digitcrusher> i don't know the conversation kinda evolved from graphics libraries in nim to other languages, i didn't think of moving to #offtopic when the topic "crossed the line" that would've been a bit akward lol
14:59:15FromDiscord<digitcrusher> (edit) "akward" => "awkward"
14:59:18FromDiscord<Clyybber> but not as cool as nim :p
14:59:34FromDiscord<digitcrusher> >:(
14:59:39FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2MMU
14:59:44FromDiscord<shadow.> idk, something like using `` for set intersection just feels a bit odd to me sometimes
15:00:00FromDiscord<mratsim> it should be `^`
15:00:02FromDiscord<mratsim> 😄
15:00:20FromDiscord<shadow.> that would make more sense but still, i don't like the idea of using mathematical / logical operators for things that don't make intuitive sense
15:00:26FromDiscord<shadow.> on a vec it makes sense, on a set, not so much
15:00:42FromDiscord<lqdev> well sets do have their own set of operators in math notation
15:00:45FromDiscord<mratsim> sets have a standard mathematical symbol for intersection
15:00:48FromDiscord<lqdev> but ASCII is too limited
15:00:55FromDiscord<Clyybber> scala fits a different niche IMO, as it's built on the JVM
15:00:57FromDiscord<lqdev> and people don't have unicode keyboards
15:01:15FromDiscord<lqdev> except me :DDDDD ∧
15:01:20FromDiscord<shadow.> lmfao
15:01:24FromDiscord<shadow.> laughs in dyalog apl
15:01:31FromDiscord<Clyybber> and sadly the @static annotation got reverted in https://github.com/scala/scala/pull/1340 which makes some things impossible
15:01:32disbotRevert `@static` annotation
15:01:35FromDiscord<haxscramper> Nim manual says that support for unicode operators might be added. I wonder how useful this might be though
15:01:39FromDiscord<mratsim> https://github.com/mratsim/weave/blob/master/formal_verification/event_notifiers.pdf↵↵Weave formal verification uses the set mathematical notation https://media.discordapp.net/attachments/371759389889003532/801828859447738399/unknown.png
15:01:49FromDiscord<shadow.> `Avg←{(+⌿⍵)÷≢⍵}`
15:01:53FromDiscord<shadow.> "you guys are using english?"
15:02:07FromDiscord<digitcrusher> there's also scala native besides jvm, i don't know how complete it is though
15:02:08FromDiscord<mratsim> Works today https://github.com/mratsim/constantine/blob/master/constantine/tower_field_extensions/tower_instantiation.nim#L31
15:02:32FromDiscord<haxscramper> I mean infix operators
15:02:33FromDiscord<digitcrusher> some other guys were talking about scala native here earlier
15:02:47FromDiscord<haxscramper> Not just Unicode identifiers
15:04:22FromDiscord<lqdev> btw @mratsim how is formal verification for multithreaded programs done, in a nutshell?
15:04:40FromDiscord<Clyybber> by trying very many combinations :D
15:04:47FromDiscord<lqdev> _i'm saying in a nutshell because you really like throwing lots of links and references at me_
15:05:11FromDiscord<mratsim> So what you really want to formally verify is the synchronization data structures (channels, locks, condition variables, thread notification scheme).
15:05:51FromDiscord<mratsim> If you have a borrow checher, the borrow checker can deal with their usage and ensuring unique owner and lifetimes when requires. This is the part of data race that Rust solves.
15:07:28FromDiscord<mratsim> and to formally verify synchronization data structure, that's exactly what clyybber said. You have multiple approach to formal verification:↵1. Using a deductive approach and from hypothesis determine if your scope respects some constraints or not↵2. Using an brute-force approach and trying all possible states and ensuring than none violates your constraints.
15:08:16FromDiscord<mratsim> Approach 2 is more practical and is used everywhere in the embedded world, and the concurrent data structure verifier that exist today.
15:08:34FromDiscord<mratsim> approach 1 requires a proof assistant like Coq.
15:09:35FromDiscord<mratsim> Now how does the brute-force approach work: you create "shadow" thread using coroutines or closure iterators or fibers or CPS anything that can be suspended and resumed.
15:10:33FromDiscord<mratsim> at a synchronization point (thread creation, lock, condition variable, atomic). You try enqueue all the possible interleaving that you can have, just like if you wanted to do a search on a tree.
15:11:37FromDiscord<mratsim> and then you check that all of those interleaving leads to a valid "doAssert condition" that you specify.
15:12:24FromDiscord<mratsim> in Weave, the condition is that there is no deadlock.
15:13:36FromDiscord<mratsim> and no livelock.
15:14:21FromDiscord<mratsim> i.e. the program reaches the end when there is no work to do
15:19:30*Kurre[m] quit (Quit: Bridge terminating on SIGTERM)
15:19:30*Avahe[m] quit (Quit: Bridge terminating on SIGTERM)
15:19:31*cmc[m] quit (Quit: Bridge terminating on SIGTERM)
15:19:31*Avatarfighter[m] quit (Quit: Bridge terminating on SIGTERM)
15:19:31*vindaar[m] quit (Quit: Bridge terminating on SIGTERM)
15:19:32*silvernode[m] quit (Quit: Bridge terminating on SIGTERM)
15:19:32*leorize[m] quit (Quit: Bridge terminating on SIGTERM)
15:19:32*j-james[m] quit (Quit: Bridge terminating on SIGTERM)
15:19:32*cadmium[m] quit (Quit: Bridge terminating on SIGTERM)
15:19:32*dilawar_uchiha[m quit (Quit: Bridge terminating on SIGTERM)
15:19:32*codic quit (Quit: Bridge terminating on SIGTERM)
15:19:33*BauxnaMatrix[m] quit (Quit: Bridge terminating on SIGTERM)
15:19:35*lnxw37d4 quit (Quit: Bridge terminating on SIGTERM)
15:19:35*BitPuffin quit (Quit: Bridge terminating on SIGTERM)
15:19:35*juanfra__ quit (Quit: Bridge terminating on SIGTERM)
15:19:35*k0mpjut0r quit (Quit: Bridge terminating on SIGTERM)
15:19:35*lytedev[m] quit (Quit: Bridge terminating on SIGTERM)
15:19:36*Zoom[m] quit (Quit: Bridge terminating on SIGTERM)
15:19:36*Clonkk[m] quit (Quit: Bridge terminating on SIGTERM)
15:19:37*himup[m] quit (Quit: Bridge terminating on SIGTERM)
15:19:38*ee7[m] quit (Quit: Bridge terminating on SIGTERM)
15:19:38*unclechu quit (Quit: Bridge terminating on SIGTERM)
15:19:40*awici[m] quit (Quit: Bridge terminating on SIGTERM)
15:19:40*reversem3 quit (Quit: Bridge terminating on SIGTERM)
15:19:44*planetis[m] quit (Quit: Bridge terminating on SIGTERM)
15:19:44*matthias[m] quit (Quit: Bridge terminating on SIGTERM)
15:19:45*jaens[m] quit (Quit: Bridge terminating on SIGTERM)
15:19:45*xigoi[m] quit (Quit: Bridge terminating on SIGTERM)
15:19:45*Juno[m] quit (Quit: Bridge terminating on SIGTERM)
15:19:45*VijayMarupudi[m] quit (Quit: Bridge terminating on SIGTERM)
15:20:09*stisa[m] quit (Quit: Bridge terminating on SIGTERM)
15:20:10*MTRNord quit (Quit: Bridge terminating on SIGTERM)
15:28:31OddmongerIIRC, the objects are pointer passed in functions arguments ?
15:29:15Oddmongerif i call foo(my_heavy_object:myObj) , «my_heavy_object» wont be copied ?
15:31:43Oddmongeror should i add «var» in the function def, to be sure to pass a pointer, and not a copy of the object ?
15:32:11*stisa[m] joined #nim
15:33:23Oddmongeror (last possibility ?) i define an alias type, which is a ref
15:34:17Oddmongerbut isn't the first simple form optimized by compiler ? (that is, foo(obj:myObj) will get obj as a pointer)
15:35:10FromDiscord<haxscramper> IIRC rules for passing object via pointer/by value is `sizeof(Obj) > 3 sizeof(ptr)`
15:35:44FromDiscord<haxscramper> And you don't need to use `var` for optimization, this is never necessary
15:35:49*habamax quit (Ping timeout: 246 seconds)
15:36:21Oddmongervar is for reference (when wanting modifying original variable)
15:36:42Oddmongerbut i was thinking using it to force the pointer usage for passing argument
15:36:44FromDiscord<haxscramper> But if you are passing object and want to mutate it (e.g. you need to avoid copy because you need to make sure this is the same object) then yes, you should use var
15:37:16Oddmongerno, i just want to pass an fat array without copy each time
15:38:04Oddmongerbut with the sizeof rules you've mentionned, that's ok for me
15:38:35Oddmongera (big and fat) thank you
15:46:05*haxscramper joined #nim
15:54:14FromDiscord<mratsim> if you want to ensure that a type is always passed by reference add {.byref.} pragma. But this is only necessary for FFi in Nim.
15:54:35FromDiscord<mratsim> I think Nim nailed the parameter passing story.
15:56:09Oddmongernice
15:57:01*waleee-cl joined #nim
16:00:20*rockcavera joined #nim
16:06:41haxscramperHow can I define custom type in nim code and pass it into embedded nimscript interpreter? There is a `implementRoutine()` for proc declaration, but nothing for types.
16:07:31haxscramperI can define types internally in script, but I want to pass them between main program and embedded interpreter
16:08:07FromDiscord<mratsim> staticRead? 😛
16:08:48*PMunch joined #nim
16:09:00haxscramperDo you have an example how to use it in this scenario? In my understanding it is just for reading blob of data at compile-time
16:09:12haxscramperNot for passing type definition into nim interpreter
16:09:49FromDiscord<mratsim> parseStmt should be able to recreate the type.
16:10:08FromDiscord<mratsim> but it's really just a hack.
16:12:08haxscramperI can pass type definition as string just fine by prepending it to `llStreamOpen`. What I'm interested in is how to make this /properly/, using available compiler API. There is probably some `compiler/vm.registerType()` that I can't find because it named differently.
16:12:08haxscramperAnd maybe someone could point me to it
16:14:57FromDiscord<mratsim> I never managed to get it working unfortunately so I never tried, last time I tried I was stuck at https://github.com/nim-lang/Nim/issues/12293 and never retried since
16:15:00disbotcompiler as a library: findNimStdLibCompileTime fails to find system.nim ; snippet at 12https://play.nim-lang.org/#ix=22qc
16:18:18*natrys joined #nim
16:18:51*GitterIntegratio joined #nim
16:18:52*Avahe[m] joined #nim
16:18:52*matthias[m] joined #nim
16:18:52*jaens[m] joined #nim
16:18:52*Avatarfighter[m] joined #nim
16:18:52*Zoom[m] joined #nim
16:18:52*j-james[m] joined #nim
16:18:52*MTRNord1 joined #nim
16:18:53*unclechu joined #nim
16:18:53*lytedev[m] joined #nim
16:18:53*lnxw37d4 joined #nim
16:18:53*BitPuffin joined #nim
16:18:53*juanfra__ joined #nim
16:18:54*VijayMarupudi[m] joined #nim
16:18:54*reversem3 joined #nim
16:18:54*planetis[m] joined #nim
16:18:54*xigoi[m] joined #nim
16:18:54*leorize[m] joined #nim
16:18:58*ee7[m] joined #nim
16:18:58*k0mpjut0r joined #nim
16:18:58*Juno[m] joined #nim
16:18:59*BauxnaMatrix[m] joined #nim
16:18:59*cadmium[m] joined #nim
16:18:59*codic joined #nim
16:19:00*silvernode[m] joined #nim
16:19:00*vindaar[m] joined #nim
16:19:00*Kurre[m] joined #nim
16:19:00*cmc[m] joined #nim
16:19:01*awici[m] joined #nim
16:19:02*dilawar_uchiha[m joined #nim
16:19:03*himup[m] joined #nim
16:19:07*Clonkk[m] joined #nim
16:19:17*haxscramper left #nim ("ERC (IRC client for Emacs 27.1)")
16:19:21*haxscramper joined #nim
16:20:25leorizethe design for sys/exec would be simplified so much if concepts actually worked...
16:21:10*hoijui_ joined #nim
16:21:10*hoijui joined #nim
16:21:56leorizelook at this monstrosity that I am writing: https://play.nim-lang.org/#ix=2MNj
16:22:02leorizeI need to simplify this somehow...
16:22:10leorizedisruptek: ^ any suggestions?
16:24:03FromDiscord<Clyybber> leorize: wrong link?
16:24:28leorizeit's the correct link
16:25:01leorizeif I have concept I can use a "h.fd is FD" or smt like that and it would work, maybe
16:31:22*PMunch quit (Quit: leaving)
16:31:30haxscramperAfter examining `treeRepr` for `PNode` that interpreter passes to callback proc it seems like I instead need to search for how nim type definition corresponds to AST interpretation, and most likely writing lazy conversion between `PNode` in compiled callback implementation and actual type.
16:31:30haxscramperI can probably do something `<type-name>PNode = distinct PNode` where `<type-name>` is a name of type that I want to work on. I pass definition of the type to nim interpreter directly, but do some compile-time preprocessing on compiled side.
16:31:31haxscramper
16:31:44haxscramperThis is similar to PMunch's idea for using marshalling
16:33:37haxscramperThough this would only work if I create overloads for all procs that work with given type so they would accept both `distinct PNode` and actual type.
16:33:37haxscramper
16:33:48*rockcavera quit (Remote host closed the connection)
16:34:55haxscramperOr use pointer-to-implementation in compiled code, and pass opaque handle+all procs to nim side.
16:37:17disruptekleorize: why don't you have a single opaque type that isn't a case object?
16:38:26*rockcavera joined #nim
16:38:49*Q-Master quit (Ping timeout: 246 seconds)
16:39:11leorizebecause I need to keep the type data?
16:40:29FromDiscord<!Privileged> may I ask if httpclient supports socks5 proxies as i can't seem to get mine to connect
16:40:34leorizeI'm not sure what you're suggesting actually :P
16:40:37disrupteki mean, you keep all the fields, just don't make it a variant. i'm assuming that a read pipe can transition to skClosed.
16:41:05FromDiscord<Clyybber> leorize: huh, weird, I reloaded it and now I got a different snippet (the one I saw before was some vimscript stuff I think)
16:41:12leorizethat would balloon the object size though...
16:41:22disruptekhow do you figure?
16:41:23FromDiscord<Clyybber> ix has been kinda slow/unreliable for a while
16:41:42FromDiscord<mratsim> @leorize maybe that would help? https://github.com/mratsim/trace-of-radiance/blob/master/trace_of_radiance/support/emulate_classes_with_ADTs.nim
16:41:52leorizedisruptek: each field is around 8 bytes?
16:42:08disruptekthere are only 5 fields.
16:42:15leorizeand I need at least 3 of them
16:42:55disruptekyou are going to do a discriminator transition to skClosed?
16:43:03leorizeyea, it's not hard
16:43:10leorizeI just need to construct a new object to replace it
16:43:21leorizeall of my objects has destructors, so I don't have to care
16:43:29disruptekthen that's not a transition. 😉
16:44:05leorizesame thing in my book :p
16:44:29disruptekwell, if you care about 8 bytes, note that the transition costs more than 8 bytes.
16:44:36disrupteker, the replacement.
16:45:00disruptekanyway, it seems you've made your bed. now you get to lie in it.
16:46:09leorizealright, then I'll see how well this design work, then trim it down later if needed
16:47:55disruptekmratsim: have you heard the word? the word is nimph.
16:48:02disruptek!repo nimph
16:48:03disbothttps://github.com/disruptek/nimph -- 9nimph: 11Nim package hierarchy manager from the future 🧚 15 94⭐ 5🍴 7& 1 more...
16:48:15disruptekimagine a package manager that understands how dependencies work.
16:48:23disrupteki know.
16:49:08FromDiscord<mratsim> I only want to install what i need for my test suite to deserialize test vectors :/. My package has no dependencies except the nim compiler.
16:50:49disrupteknoted.
16:52:41FromDiscord<!Privileged> is it possible to use httpclient with socks5?
16:52:45disruptekno.
16:52:50FromDiscord<!Privileged> welp
17:02:26FromDiscord<Recruit_main707> can i create a thread, make it run a function, and instead of it being deleted once it finishes, freeze it/sleep it until i want to call that function again
17:02:32FromDiscord<Recruit_main707> ?
17:03:10*hnOsmium0001 joined #nim
17:06:41FromDiscord<Vindaar> still no Nim generated plots in the survey results 😢
17:08:46disruptekrecruit: just make a proc that waits on a semaphore at the bottom of a while loop. flip the semaphore in your controlling thread.
17:08:50*Q-Master joined #nim
17:09:30FromDiscord<Recruit_main707> yeah, that what i was thinking of, but wanted to know if i could do something else, thanks
17:10:04disruptekyou can, but why would you?
17:10:27FromDiscord<Recruit_main707> it would look cleaner
17:10:34FromDiscord<Recruit_main707> i think
17:13:03FromDiscord<Rika> it would probably just be an abstraction of what disruptek just said though
17:13:39FromDiscord<mratsim> @Recruit_main707 that's called a threadpool
17:13:58*Q-Master quit (Ping timeout: 264 seconds)
17:14:43*hoijui quit (Ping timeout: 272 seconds)
17:14:43*hoijui_ quit (Ping timeout: 272 seconds)
17:17:06*leorize quit (Ping timeout: 268 seconds)
17:18:46*leorize joined #nim
17:32:55*abm joined #nim
17:36:16FromDiscord<Recruit_main707> then, how is that when i use spawn, the code is slower, each function only receives a pointer, and they are all independent
17:36:23FromDiscord<Recruit_main707> so no race condition
17:36:50disruptekleorize: i want to generate binaries in ci, for nimph/gitnim/golden/etc. and i don't know where to begin. i'm looking at nightlies and it seems like i need the settings code, the cache code, pretty much all the code.
17:37:42leorizewhat attributes do you want your binary to have?
17:37:57disruptekonly the good ones.
17:38:00FromDiscord<mratsim> A function is a pointer, and when you do multithreading, you capture all the argument of the function in an environment and just call fn(env).
17:38:30FromDiscord<mratsim> regarding the speed I would need to see the code.
17:38:47FromDiscord<!Privileged> sent a code paste, see https://play.nim-lang.org/#ix=2MO6
17:39:24FromDiscord<mratsim> there is a lines iterator, no need for an intermediate buffer.
17:39:47leorizedisruptek: do you want the binary to be fully static (ie. no external deps)? do you want it to not depend on libc also?
17:39:52FromDiscord<lqdev> @!Privileged wdym by "proxy name"?
17:39:53leorizeand do you want the build to be reproducible?
17:39:59*Q-Master joined #nim
17:40:05disruptekleorize: these sounds like good attributes.
17:40:11disruptekman, why isn't this written in nim?
17:40:25leorizesetup-nim didn't exist then
17:40:32FromDiscord<!Privileged> `proxy` is the proxy, it doesnt get added to the output
17:40:43FromDiscord<lqdev> well then it must be empty
17:40:54FromDiscord<!Privileged> its not
17:40:55FromDiscord<!Privileged> it has size 2
17:41:02disrupteki guess maybe i start from scratch.
17:41:06FromDiscord<lqdev> are you sure about that? try `echo proxies`
17:41:17leorizedisruptek: better that way, you want all the hard attributes...
17:41:50FromDiscord<!Privileged> https://media.discordapp.net/attachments/371759389889003532/801869171473383454/unknown.png
17:42:08FromDiscord<!Privileged> `@["hello\c", "world\c"]` if the image wont load
17:42:26disruptekwell, i guess no binaries soon.
17:42:33leorizedisruptek: might be easier if you use zig C compiler to generate your binary, it has all that is needed for a static build
17:42:40FromDiscord<Recruit_main707> sent a code paste, see https://paste.rs/u4C
17:42:53FromDiscord<lqdev> `\c` is a carriage return, so your terminal returns the cursor to the beginning of the line
17:43:00FromDiscord<lqdev> you need to strip it in your `readLines`
17:43:01FromDiscord<!Privileged> ah
17:43:06disruptekyeah, i used to use zig. but now it's a pita and i need a shim just to run the compiler.
17:43:06FromDiscord<!Privileged> didnt know those existed, ty
17:43:11FromDiscord<lqdev> np
17:43:12FromDiscord<!Privileged> i was accounting for newline only
17:43:26FromDiscord<lqdev> yeah check out `"\p"`, it's the platform-dependent line ending
17:43:39leorizedisruptek: easier than setting up a toolchain
17:43:47FromDiscord<!Privileged> ty will do
17:44:04FromDiscord<lqdev> np, good luck!
17:44:12FromDiscord<!Privileged> cheers ^^
17:44:13disrupteki would just use setup-nim. i don't see why that won't work.
17:44:20FromDiscord<Rika> liquid the issue with that is that windows can have unix line ended files
17:44:21FromDiscord<mratsim> @Recruit_main707 I don't understand how the `parallel` statement works, I tried too but failed so I can't tell you what's happening here.
17:44:43FromDiscord<Rika> then you're screwed since \p isnt dependent on the file but on the compiling os
17:45:01FromDiscord<Rika> so you have to always deal with \r
17:46:12FromDiscord<Recruit_main707> @mratsim should i just remove the `parallel:`?
17:46:26FromDiscord<mratsim> yes
17:46:39disruptekleorize: i guess the issue is that i don't have any static compiler/ssl for osx/win; only my linux environments. yuk.
17:46:40FromDiscord<mratsim> I think it's only useful for seq/array accesses.
17:47:12leorizedisruptek: yes, that is the issue
17:47:20disruptekrecruit: i gave you the two line solution and an hour later you're still trying to make to make it work "cleaner".
17:47:23leorizeI mostly give up on setting a fully reproducible chain
17:47:27disrupteki will never understand these people.
17:50:40FromDiscord<lqdev> @Rika yeah you're right
17:51:22FromDiscord<lqdev> @!Privileged in this case you can also check out https://nim-lang.org/docs/strutils.html#stripLineEnd%2Cstring
17:52:18FromDiscord<!Privileged> i kinda need to keep '\n' tho :/
17:52:46FromDiscord<!Privileged> oh actually
17:52:53*habamax joined #nim
17:52:58FromDiscord<!Privileged> i could use that ig ty
17:54:28*tane joined #nim
18:03:58FromDiscord<Clyybber> disruptek: why do you need a shim for the compiler?
18:04:33disruptekbecause the generic "cc:env" feature doesn't work with zig.
18:04:49FromDiscord<Clyybber> why not?
18:05:12disrupteksomething to do with zig compilation requiring an extra argument or something.
18:05:34disruptekironically, cc:env replaced cc:zig. 🙄
18:06:17FromDiscord<Clyybber> I think you need to treat zig like clang
18:06:27disruptekgo ahead and try it.
18:07:24ForumUpdaterBotNew thread by Stbalbach: Regex and capture unicode text, see https://forum.nim-lang.org/t/7409
18:12:55FromDiscord<!Privileged> anyone know why this may occur/
18:12:59FromDiscord<!Privileged> sent a code paste, see https://play.nim-lang.org/#ix=2MOy
18:13:34FromDiscord<lqdev> ouch, where does the stack trace occur?
18:13:41FromDiscord<Clyybber> disruptek cc:env isnt gonna work for zig; it states that it expects a gcc like compiler
18:13:47FromDiscord<lqdev> (edit) "occur?" => "point to?"
18:13:47FromDiscord<!Privileged> ` outFile.writeLine(validProxy) #error` here
18:14:00FromDiscord<!Privileged> sent a code paste, see https://play.nim-lang.org/#ix=2MOz
18:14:24disruptekclyybber: my point stands.
18:14:48FromDiscord<Rika> did you open it for writing? i believe by default its reading only
18:14:56FromDiscord<lqdev> ah yeah
18:14:59FromDiscord<lqdev> rika's right
18:15:14FromDiscord<!Privileged> :facepalm:
18:15:16FromDiscord<!Privileged> iyoure right
18:15:16FromDiscord<lqdev> try `open("file.txt", fmWrite)`
18:15:37FromDiscord<lqdev> that param should be explicit tbh
18:15:46*nekits071 joined #nim
18:15:51FromDiscord<Rika> same
18:15:51FromDiscord<!Privileged> still nothing
18:15:58FromDiscord<Rika> but no error right?
18:16:03FromDiscord<!Privileged> error is still there
18:16:05FromDiscord<Rika> maybe need to flushfile
18:16:08FromDiscord<Rika> oh
18:16:11FromDiscord<Rika> huh?
18:16:17FromDiscord<Rika> did you save and recompile www
18:16:21FromDiscord<Rika> i often forget to do so
18:16:24FromDiscord<!Privileged> yep
18:17:10*nekits07 quit (Ping timeout: 246 seconds)
18:17:10*nekits071 is now known as nekits07
18:17:26FromDiscord<Rika> no idea, maybe check that line in io.nim
18:18:09FromDiscord<!Privileged> nvm
18:18:10FromDiscord<!Privileged> classic me
18:18:13FromDiscord<!Privileged> added it in the wrong place!
18:18:18FromDiscord<Rika> lol4
18:18:18FromDiscord<!Privileged> i need to read sometimes
18:18:21FromDiscord<!Privileged> alr tysm xd
18:18:50disruptekclassic !privileged.
18:19:39FromDiscord<!Privileged> 😦
18:22:02FromDiscord<Clyybber> disruptek did you try just setting clang.exe ?
18:23:06disrupteki dunno; i wrote this code in june.
18:24:11disruptekif it works with clang.exe, that's one less thing i need to worry about. 😉
18:29:41FromDiscord<Clyybber> it should; try it :)
18:32:01FromDiscord<Clyybber> ah; working on arc is such a bliss 😄
18:34:52disruptekso, starlink ordered.
18:35:03disrupteksaem: this is what i'm gonna try: https://www.amazon.com/gp/product/B07YZPJ2CM
18:35:35FromDiscord<Clyybber> disruptek: Oh? are you going to facecam?
18:35:59disruptekno, but weirdly, now that people want to interview me, they also want to check out my outfits.
18:36:04*j-james joined #nim
18:36:12FromDiscord<iWonderAboutTuatara> is there a way to get the index in a regular foreach iterator?
18:36:23disruptekfor index, item in foo.pairs:
18:36:25FromDiscord<iWonderAboutTuatara> or do I need to write a custom iterator that returns value index tuple
18:36:33FromDiscord<iWonderAboutTuatara> oh that's a thing?
18:36:34FromDiscord<iWonderAboutTuatara> wow
18:36:38FromDiscord<iWonderAboutTuatara> thanks!
18:37:08FromDiscord<Clyybber> disruptek: curious, does it say out of stock for you too?
18:37:17disruptekno.
18:37:56FromDiscord<Clyybber> huh
18:38:18FromDiscord<mratsim> @iWonderAboutTuatara import std/enumerate
18:38:34FromDiscord<mratsim> for iterators that don't have a "pairs"
18:42:26Oddmongerlet's say i have this one: var data_b:seq[byte] = @[ 1,1 ] ; and i want to access to this data zone as byte _and_ int16
18:43:01Oddmongeri tried of course a cast… var data_w:seq[int16] = cast[seq[int16]](data_b)
18:44:12Oddmongeranswer: expected seq[byte]
18:45:38Oddmongerah … i guess it's because a seq is not an array of something, and has its own struct. So i can only use «to» to convert, which will do a copy and not ref the same memory zone
18:58:44*hyiltiz quit (Ping timeout: 265 seconds)
19:00:44*hyiltiz joined #nim
19:06:41FromDiscord<mratsim> use ptr UncheckedArray[int16]
19:08:44*Kaivo quit (Quit: WeeChat 3.0)
19:10:53Oddmongerahh like this
19:11:04Oddmongerthank you
19:22:45FromGitter<awr1> https://github.com/microsoft/win32metadata
19:22:57FromGitter<awr1> this is extremely interesting
19:23:04disruptekdoubtful.
19:23:29FromGitter<awr1> will see about using this for generating nim bindings
19:25:19*xet7 quit (Ping timeout: 265 seconds)
19:26:57*xet7 joined #nim
19:27:59*koltrast quit (*.net *.split)
19:27:59*kinkinkijkin quit (*.net *.split)
19:27:59*qwr quit (*.net *.split)
19:28:05*qwr joined #nim
19:28:09*kinkinkijkin joined #nim
19:29:22*koltrast joined #nim
19:34:31*xet7 quit (Ping timeout: 256 seconds)
19:37:36*xet7 joined #nim
19:38:34*habamax quit (Ping timeout: 264 seconds)
19:39:00FromDiscord<Recruit_main707> @mratsim update: also was slower without `parallel:`
19:45:53*etothpiiminus1 joined #nim
19:50:02*leorize quit (Ping timeout: 268 seconds)
19:56:03*etothpiiminus1 quit (Ping timeout: 256 seconds)
19:56:41*etothpiiminus1 joined #nim
19:57:11*leorize joined #nim
20:01:49*etothpiiminus1 quit (Ping timeout: 265 seconds)
20:02:23*etothpiiminus1 joined #nim
20:04:51*leorize quit (Ping timeout: 268 seconds)
20:06:41*leorize joined #nim
20:13:35saemdisruptek: did you get it yet? PS. what are you wearing?
20:14:07disruptekjust a thong.
20:15:19*etothpiiminus1 quit (Ping timeout: 256 seconds)
20:17:25*NimBot joined #nim
20:18:43*jjido quit (Quit: Connection closed for inactivity)
20:18:55*hoijui_ joined #nim
20:18:56*hoijui joined #nim
20:22:23*etothpiiminus1 joined #nim
20:23:11*Vladar quit (Quit: Leaving)
20:24:56*Vladar joined #nim
20:27:01*Gustavo6046 quit (Ping timeout: 246 seconds)
20:27:47*etothpiiminus1 quit (Ping timeout: 256 seconds)
20:29:08*Gustavo6046 joined #nim
20:33:59*etothpiiminus1 joined #nim
20:34:34disruptekleorize: should balls only output to stderr, or...?
20:38:16*Mat8 joined #nim
20:38:52Mat8G'day everyone
20:39:23FromDiscord<digitcrusher> good evening
20:39:49disruptekhello nimlets
20:40:26Mat8I want to note that building Nim from the git sources gives an (for me) interesting hint: "conversion from string to itself is pointless"
20:42:23leorizeyea, there are a bunch of those around because of either generics or because no one cleaned them up yet
20:43:22*hoijui_ quit (Ping timeout: 265 seconds)
20:43:25Mat8well, at least I have now an explanation for this, thanks
20:43:40*etothpiiminus1 quit (Remote host closed the connection)
20:43:51*hoijui quit (Ping timeout: 265 seconds)
20:44:40leorizedisruptek: no idea
20:44:59leorizetests might emit their own output but then wouldn't you want balls' messages so you know which test emitted them?
20:45:23disruptekthe problem i'm trying to solve is only that streams are stomping on each other.
20:45:47leorizehow is that possible?
20:45:57disruptekcheckpoint currently outputs to stdout and the nim compiler does not.
20:46:02leorizemultithreaded tests?
20:46:14disruptekno; slow streams. 😁
20:46:53leorizeah yea, stdout is buffered but not stderr
20:47:12disruptekyes.
20:47:34leorizeI think it's fine to output to stderr if that solves the issue
20:48:12disrupteki think so, too; this allows the user to test against stdout. i don't think supporting unittests religiously is all that useful.
20:57:53*xet7 quit (Quit: Leaving)
21:01:51*vicfred joined #nim
21:06:09disruptekit's actually already written this way, it just doesn't work on windows.
21:06:15disruptekfuck 'em.
21:06:30*leorize quit (Ping timeout: 268 seconds)
21:07:25*leorize joined #nim
21:12:43*j-james quit (Quit: WeeChat 3.0)
21:25:33*leorize quit (Remote host closed the connection)
21:27:08*leorize joined #nim
21:41:39FromDiscord<shadow.> what doesn't work on windows?
21:43:48*narimiran quit (Ping timeout: 260 seconds)
21:44:23FromDiscord<!Privileged> sent a code paste, see https://paste.rs/sHE
21:47:49*leorize quit (Ping timeout: 268 seconds)
21:49:38*haxscramper quit (Remote host closed the connection)
21:50:39FromDiscord<konsumlamm> you can't assign a "called iterator" to a value
21:50:54FromDiscord<konsumlamm> afaik at least
21:51:27FromDiscord<mratsim> inline iterators are compile-time constructs.
21:51:57FromDiscord<!Privileged> so how would you call `find` on a seq?
21:51:59FromDiscord<mratsim> use `var items = toSeq(loadedProxies.items)`
21:52:09FromDiscord<mratsim> import std/algorithms
21:52:10FromDiscord<!Privileged> ahh alr
21:52:15FromDiscord<konsumlamm> that's just copying the seq though, sin't it?
21:52:19FromDiscord<konsumlamm> (edit) "sin't" => "isn't"
21:52:20FromDiscord<mratsim> yes
21:52:22FromDiscord<lqdev> well why'd you want to do that
21:54:01FromDiscord<konsumlamm> i'd prefer it if closure iterators were the default and inline iterators just an optimization
21:54:16FromDiscord<konsumlamm> so that when designing an API, you don't need to care about inline vs closure iterators
21:54:29FromDiscord<lqdev> you hardly ever use closure iterators though
21:54:52FromDiscord<lqdev> simply because inline iterators provide pretty much all the facilities you ever need
21:56:28FromDiscord<konsumlamm> except when you want to make iterator combinators
21:56:35FromDiscord<konsumlamm> like map, filter, fold on iterators
21:56:48FromDiscord<!Privileged> so how would you call `find` on a sequence without copying it
21:57:22FromDiscord<!Privileged> also what actually is a pointer in nim
21:57:22FromDiscord<lqdev> `find` doesn't copy the sequence
21:57:54FromDiscord<lqdev> passing seqs as parameters never makes a copy unless you specifically assign it to a variable
21:58:50FromDiscord<konsumlamm> why would find need to copy the seq? you're just iterating over it (unless you're talking about a different find...)
21:59:05FromDiscord<!Privileged> for some reason i was getting some compiler errors when calling find
21:59:08FromDiscord<!Privileged> they seem to be fixed now
21:59:16FromDiscord<!Privileged> well ty for your help, i appreciate it
22:01:25FromDiscord<konsumlamm> i wish something like iterutils would be in the stdlib
22:01:33FromDiscord<konsumlamm> though the stdlib already is pretty big
22:02:55federico3is there any Nim talk in the upcoming remote FOSDEM?
22:03:59*leorize joined #nim
22:05:11tanefederico3, https://fosdem.org/2021/schedule/event/nimdsl/ there's at least one it seems
22:05:46federico3evidently the search function on the website does not work :)
22:06:13taneif I search for "nim" the talk shows up :)
22:10:56federico3Kotlin and Zig have a whole devroom :-/
22:12:30FromDiscord<ElegantBeef> Yea pmunch's talk is the only one i know about
22:12:45FromDiscord<mratsim> Nim inline iterators should be combinable, right now it requires zero-functional.
22:13:45FromDiscord<ElegantBeef> Yea the solution is to make inline iterators first class not make everything closure, that way we get functionality and performance
22:14:57FromDiscord<ElegantBeef> Many things that work on `openArray[T]` should take `iterator[T]` instead so it allows more types, for instance `sum` should certainly work on anything iterable with a addition operator
22:15:44FromDiscord<ElegantBeef> It also would fix the UFCS for iterators so we dont need that `toSeq(iter)` we can do `iter.toSeq`
22:16:53FromDiscord<exelotl> That sounds very epic
22:17:41FromDiscord<ElegantBeef> I believe this PR makes that possible https://github.com/nim-lang/Nim/pull/11992
22:17:44disbotevery symbol becomes 1st class; defines 0-cost lambda and aliases; inline iterators/templates/etc can be passed to any routine ; snippet at 12https://play.nim-lang.org/#ix=250A
22:18:32FromDiscord<mratsim> we need both openarray and iterator
22:18:43FromDiscord<mratsim> it's different use cases.
22:19:06FromDiscord<ElegantBeef> Yes, but in some cases iterator makes more sense
22:19:07FromDiscord<mratsim> unless we can have var iterator?
22:19:27FromDiscord<ElegantBeef> I'm not saying remove `openArray` i'm saying replace openArray with iterator when that becomes viable and it makes sense
22:19:33FromDiscord<mratsim> or Iterable concept
22:19:45FromDiscord<ElegantBeef> sum for instance should certainly just take an iterator
22:20:33FromDiscord<ElegantBeef> Same with some of the sequtils and my contribution to setutils
22:21:15FromDiscord<konsumlamm> zero-functional looks pretty cool (i haven't used it yet), but i kinda dislike that it needs the `-->` macro and that the combinators don't use normal procs
22:21:43FromDiscord<ElegantBeef> https://github.com/nim-lang/Nim/blob/devel/lib/std/setutils.nim#L20↵Like this should be a proc that takes an iterator atleast in my view
22:22:03FromDiscord<konsumlamm> but tbf, lambdas (with the `->` sugar) have some inference problems, so using templates with `it` is probably the better alternative
22:22:25FromDiscord<mratsim> lambda syntax and inference needs some love
22:22:46FromDiscord<mratsim> I have to had {.nimcall.} or {.gcsafe.} in many case and it's quite annoying
22:23:24FromDiscord<mratsim> and foo.takeWhile(x => x <= 10) is very strange
22:23:59FromDiscord<mratsim> I would prefer `foo.takeWhile(lambda x: x <= 10)`
22:25:29FromDiscord<konsumlamm> ye, everything that just iterates over the thing should work on iterators, that'd be epic
22:25:33*natrys quit (Quit: natrys)
22:26:07FromDiscord<ElegantBeef> Yea when we get first class iterators i have a feeling that'll be what gets defaulted, since it's just better for performance and ergonomics
22:26:28FromDiscord<ElegantBeef> It's like when views get fixed, a lot of the stdlib should get view versions, like `strutils`
22:27:02FromDiscord<mratsim> strutils should get iterators in many cases 😉
22:27:11FromDiscord<ElegantBeef> Yea, but also should get views
22:28:00FromDiscord<ElegantBeef> slice operations, split, lines, all things like that which currently double allocate should have view versions
22:29:08FromDiscord<exelotl> mannn I really want view types to be stable
22:30:04FromDiscord<exelotl> it's gonna be so good
22:32:48FromDiscord<konsumlamm> so is most things using iterators/iterables actually realistic in the foreseeable future?
22:33:09FromDiscord<ElegantBeef> I mean it's usable now if you dont mind templates/`yourTemplat(iter)`
22:33:50FromDiscord<ElegantBeef> Look at my link to setutils, it works on all iterables that are bitsetable ordinals
22:34:36FromDiscord<mratsim> "foreseeable" is a stretch. Since 2021 is the year of stability and this is a new feature.
22:35:03FromDiscord<mratsim> well inline iterator chaining is supposedly working (according to the manual) but actually never worked.
22:35:40Mat8ciao
22:35:48*Mat8 quit (Quit: Leaving)
22:36:42FromDiscord<konsumlamm> speaking of setutils, it still needs to be linked in the stdlib docs
22:36:48FromDiscord<ElegantBeef> It's in devel
22:36:58FromDiscord<ElegantBeef> So will be in `1.6.0`
22:37:12FromDiscord<ElegantBeef> It's here https://nim-lang.github.io/Nim/theindex.html
22:37:29FromDiscord<konsumlamm> i mean https://nim-lang.github.io/Nim/lib.html
22:37:47FromDiscord<ElegantBeef> https://media.discordapp.net/attachments/371759389889003532/801943652946673734/unknown.png
22:38:03FromDiscord<ElegantBeef> https://media.discordapp.net/attachments/371759389889003532/801943717288083456/unknown.png
22:38:04FromDiscord<ElegantBeef> It's there
22:38:11FromDiscord<ElegantBeef> They're automatically generated docs
22:38:51FromDiscord<konsumlamm> i know it's there, but it's not in the lib.html, which is where most people would presumably look to get an overview over what modules the stdlib has
22:39:14FromDiscord<ElegantBeef> I mean i never use that, so ehh
22:39:19FromDiscord<ElegantBeef> Feel free to make a PR for it 😄
22:39:24FromDiscord<konsumlamm> i will
22:39:41FromDiscord<ElegantBeef> I honestly forgot that page even existed since i just use the index
22:39:56FromDiscord<konsumlamm> i mean, i didn't even know about theindex until 2 weeks ago
22:40:11FromDiscord<ElegantBeef> I learned about the index before the lib page, so i guess to each their own
22:40:13FromDiscord<mratsim> theindex has a discoverability problem
22:40:17FromDiscord<ElegantBeef> Yep
22:40:29FromDiscord<mratsim> not sure how to get to it without knowing that it exists
22:40:39FromDiscord<konsumlamm> i just always looked at the lib.html
22:41:01FromDiscord<konsumlamm> i also initially thought Nim had no File type, since `io` is not linked directly there
22:41:11FromDiscord<konsumlamm> apparently i was too stupid to search for "File"
22:41:15FromDiscord<ElegantBeef> Lol
22:42:54FromDiscord<konsumlamm> the "Nim Standard Library" section is also what's linked on the website, so i assume most people will look at that first when exploring the stdlib
22:46:01FromDiscord<exelotl> theindex also has a discoverability problem on the inside xD↵I found it in my early days with nim and was like wtf... this is the worst doc ever
22:47:30*Sembei joined #nim
22:48:32FromDiscord<exelotl> I can see it being useful once you know your way around, but when I'm looking for something in the stdlib by name, I prefer to just use the search box in the doc pages
23:00:24FromDiscord<Clyybber> yeah, the doc pages itself should be searchable via the search box too
23:03:19*tane quit (Quit: Leaving)
23:09:58disruptekrust requires almost 11gb of disk in order to compile.
23:10:31disruptekon the other hand, people are willing to pay you to watch the compiler.
23:22:57*Vladar quit (Quit: Leaving)
23:29:36leorizeif the user specify that the PATH variable of the child process should be modified, should I search for the program to launch in the modified PATH or should I use the parent process PATH?
23:33:35FromDiscord<Clyybber> disruptek: And a lot of RAM/swap
23:35:15FromDiscord<Clyybber> which is why the BSDs don't have 32bit rustc builds (because they require that a package can be built on the target arch)
23:43:16FromDiscord<K-> does anyone have a cool idea for a command line tool that I could do in nim?
23:50:14*Q-Master quit (Read error: Connection reset by peer)
23:50:21*Q-Master joined #nim
23:56:51FromDiscord<phoph> downloader
23:56:57FromDiscord<phoph> (edit)