<< 20-06-2020 >>

00:06:04*lritter quit (Ping timeout: 246 seconds)
00:07:04*lritter joined #nim
00:14:02*oddp quit (Ping timeout: 260 seconds)
00:29:53*lritter quit (Quit: Leaving)
00:48:53*vicfred quit (Quit: Leaving)
01:33:52*waleee-cl quit (Quit: Connection closed for inactivity)
01:34:19leorizePrestige: I think you asked this like 3 times now :P
01:35:57FromDiscord<Elegant Beef> You know what they say "Like three times is the charm"
01:51:06PrestigeYeah what the heck
01:52:27FromDiscord<codic> how can i remove all elements matching a string in a seq without doing it manually?
01:53:17*chemist69 quit (Ping timeout: 272 seconds)
01:53:19PrestigeNot sure what you mean - iterate over the seq and remove them?
01:53:22FromDiscord<Elegant Beef> There is a filter proc
01:53:47FromDiscord<Elegant Beef> and also a keepIf
01:54:36FromDiscord<codic> So, if i have a seq @["a","b","c","a"], and I wanted to remove all "a"s, how would I do that?
01:54:44FromDiscord<Elegant Beef> here
01:55:01*chemist69 joined #nim
01:55:45FromDiscord<codic> ?
01:55:52FromDiscord<Elegant Beef> sorry writting it
01:55:57FromDiscord<Elegant Beef> meant to say here i'll write it πŸ˜„
01:56:44FromDiscord<Elegant Beef> https://play.nim-lang.org/#ix=2pDe
01:57:09FromDiscord<Elegant Beef> there is also filter which works similarly
01:57:19FromDiscord<Elegant Beef> filter returns a seq
01:57:44FromDiscord<Rika> Huh there's a keep if proc
01:57:58FromDiscord<Elegant Beef> https://play.nim-lang.org/#ix=2pDf the filter proc
01:58:13FromDiscord<Elegant Beef> Yea didnt know either of these existed prior πŸ˜„
01:58:19FromDiscord<codic> ah okay, thanks
01:58:23FromDiscord<codic> the filter looks like just what i want!
01:58:29FromDiscord<Elegant Beef> Both are πŸ˜„
01:58:32FromDiscord<Rika> I knew of filter
01:58:37FromDiscord<Elegant Beef> One just requires a copy πŸ˜›
01:59:09FromDiscord<Elegant Beef> fuck there is also an apply
01:59:12FromDiscord<Elegant Beef> That's wild
01:59:14FromDiscord<codic> Β―\_(ツ)_/Β―
01:59:24FromDiscord<Elegant Beef> It runs the proc for each entity
01:59:35FromDiscord<Elegant Beef> no more for loops!
02:00:07FromDiscord<Elegant Beef> Definetly worth reading to completion↡https://nim-lang.org/docs/sequtils.html
02:00:26FromDiscord<codic> this could be quite useful eyah
02:00:28FromDiscord<codic> (edit) 'eyah' => 'yeah'
02:04:22FromDiscord<Rika> Local beef discovers functional programming constructs
02:04:53FromDiscord<Elegant Beef> Indeed
02:07:58FromDiscord<Rika> Maybe I should start programming in fp style
02:13:18*endragor quit (Remote host closed the connection)
02:20:59FromDiscord<Isomorpheus> just installed via apt. how can I get nimprettier
02:21:26FromDiscord<Isomorpheus> err nimpretty
02:23:14FromDiscord<Yardanico> If you installed with apt your Nim is probably outdated
02:23:22FromDiscord<Yardanico> Check nim -v
02:23:42FromDiscord<Isomorpheus> 1.0.6
02:23:45FromDiscord<Isomorpheus> should I use choosenim?
02:24:47FromDiscord<Yardanico> Well yeah
02:24:58FromDiscord<Yardanico> It'll also install stuff like nimpretty
02:25:18FromDiscord<Isomorpheus> k. how do you update with this tool
02:34:01*unknown__ quit (Quit: Leaving)
02:35:11*vicfred joined #nim
02:37:58PrestigeAre there more examples of using UncheckedArray? I feel like I'm shooting in the dark here, and my feedback loop for this program is super slow
02:39:45FromDiscord<impbox> I've used it a bunch, works fine, but I'll try make you an example
02:40:48PrestigeI'll share mine in a sec too
02:42:16Prestigehttps://play.nim-lang.org/#ix=2pDo
02:42:47Prestigeno errors but it just doesnt seem to be working. Tried 4 or 5 variations - feel like I'm just shooting in the dark
02:43:30FromDiscord<Isomorpheus> sent a code paste, see http://ix.io/2pDp
02:45:13*ftsf joined #nim
02:46:37leorizePrestige: why are you casting a ptr cuchar to cint?
02:46:57PrestigeThat's a good question
02:47:25FromDiscord<Rika> did you put the bins in the path envvar @Isomorpheus
02:47:26PrestigeThat was very likely the problem
02:47:47*surma quit (Ping timeout: 240 seconds)
02:48:14FromDiscord<Isomorpheus> @Rika prompt asked me to put nimble folder in my path. i did.
02:48:16*r4vi quit (Read error: Connection reset by peer)
02:48:19FromDiscord<Isomorpheus> checking at the terminal
02:48:22FromDiscord<Isomorpheus> nim, nimble, and nimpretty all work
02:48:25FromDiscord<Isomorpheus> as commands
02:48:32FromDiscord<Rika> restart vscode πŸ˜›
02:48:42FromDiscord<Isomorpheus> >_>
02:49:12FromDiscord<Isomorpheus> still not workin
02:49:51*r4vi joined #nim
02:49:51*surma joined #nim
02:50:52*muffindrake quit (Ping timeout: 260 seconds)
02:52:58*muffindrake joined #nim
03:14:22*ftsf quit (Ping timeout: 246 seconds)
03:46:45disruptek~gitnim
03:46:46disbotgitnim: 11https://gitnim.com/ -- choosenim for choosey nimions -- disruptek
04:03:22*hecanjog quit (Ping timeout: 244 seconds)
04:06:02*supakeen quit (Quit: WeeChat 2.8)
04:06:43*supakeen joined #nim
04:07:03*hecanjog joined #nim
04:21:53*dddddd quit (Ping timeout: 258 seconds)
04:43:39*jeko quit (Quit: Leaving)
05:14:35FromDiscord<SeanOMik> Is there some wiki that shows all the bitwise operators in Nim?
05:19:00*tefter joined #nim
05:19:26FromDiscord<Elegant Beef> https://nim-lang.org/docs/tut1.html#basic-types-integers
05:21:24FromDiscord<SeanOMik> Awesome, thanks
05:27:19*theelous3 quit (Ping timeout: 260 seconds)
05:32:48*theelous3 joined #nim
05:44:10FromDiscord<InventorMatt> you may also want to look at the bitops library as well for more operators
05:44:41*solitudesf joined #nim
06:26:10*NimBot joined #nim
06:35:20FromDiscord<Zed> is there an easy way to add a binary name output in nimble?
06:36:40leorizeno, unfortunately
06:36:47leorizebtw 2h before nimconf
06:36:58leorizeoh 4h :P
06:37:10FromDiscord<Zed> lol
06:37:18FromDiscord<Zed> well that's a bummer
06:37:36FromDiscord<Zed> i guess i wont use nimble then
06:42:37*narimiran joined #nim
06:50:18*nikita` joined #nim
06:54:22*tdc joined #nim
06:54:52AraqZed: there is --output that you can use within the .nimble file
06:54:58Araqor something like that
06:57:21FromDiscord<Zed> there's nothing in the docs for that
06:57:32FromDiscord<Zed> i know the compiler itself has that flag
06:57:37FromDiscord<Zed> but ot nimble
06:57:40FromDiscord<Zed> *not
06:58:18solitudesfyou dont need nimble for that, just use relevant nim.cfg/config.nims
07:00:36*brainbomb joined #nim
07:09:31*tdc quit (Quit: Leaving)
07:22:56FromDiscord<Zed> Prestige
07:23:10FromDiscord<Zed> That nim braces thing is working
07:23:42FromDiscord<Zed> there are some quirks to how i've implemented it which is annpying
07:23:46FromDiscord<Zed> *annoying
07:26:04Araqhow did you implement it?
07:26:27Araqadded a custom parser to the compiler? that's how I did it when #! braces still was a thing
07:26:44FromDiscord<Zed> nah more like a thing that parses the file
07:26:44FromDiscord<Rika> its a separate parser afaik
07:26:48FromDiscord<Zed> yeah
07:26:49FromDiscord<Rika> that emits regular nim code
07:26:51FromDiscord<Zed> im not that smart
07:27:02FromDiscord<Zed> https://github.com/Zed-Inc/nim_braces
07:27:21Araqit's still in Git's history
07:27:54FromDiscord<Zed> yeah i saw that the other day
07:28:39FromDiscord<Zed> is githubs nim syntax highlighting broken?
07:29:31PrestigeSweet Zed
07:30:56FromDiscord<Zed> note: it does not work on directories at the moment
07:31:00FromDiscord<Zed> only single files
07:33:07PrestigeExciting stuff, can't wait to start using it
07:33:22PrestigeBut i just switched my keyboard layout so I'm going to be programming very slowly lol
07:34:29FromDiscord<Zed> lol
07:34:35FromDiscord<Zed> what did you switch to?
07:38:29FromGitter<alehander92> дссс
07:38:36FromGitter<alehander92> is nimconf ready
07:39:51PrestigeThe programmer dvorak layout @Zed
07:40:04PrestigeBut modified further since I have a weird board
07:40:16FromDiscord<Zed> ah yeah i've heard about that
07:40:34FromDiscord<Zed> do you find it more comortable
07:41:01PrestigeYeah, even though I just switched it feels nicer
07:43:13FromDiscord<Zed> say i wanted to switch, could i still use my qwerty layout but remapped?
07:43:35FromDiscord<Zed> or is it to different?
07:45:03PrestigeYeah you can use a normal board with remapped keys
07:47:10FromDiscord<Shucks> `offtopic: annoyed they claim 'statically typed compiled systems programming language' but then later on say 'it compiles to C, C++ or JavaScript'. That's what transpiling is...`
07:47:22FromDiscord<Shucks> not my text. But isn't he right?
07:48:41FromDiscord<Rika> transpiling is compiling
07:49:17FromDiscord<Rika> man this is the 172645871t53786175th time we've gone through this discussion
07:49:35FromDiscord<Rika> its always inconclusive because compilation and transpilation do not have a concrete definition that is the same in everyone's heads
07:50:24FromDiscord<Rika> @Shucks where's that from
07:51:04FromDiscord<Shucks> Some cheat forum where everyone uses cpp and I've came around with some nim code ;D
07:51:26FromDiscord<Rika> ask about what is wrong with the claim
07:51:38FromDiscord<Rika> because in my eyes, transpiling is under compiling
07:52:13FromDiscord<Rika> in past arguments of the same topic, someone pulled up "what truly is the difference between java being compiled whilst python being interpreted"
07:52:20FromDiscord<Zed> transpiling is basically compiling i would say
07:52:23FromDiscord<Rika> when both of them are compiled to a VM's bytecode
07:52:35FromDiscord<Zed> ^
07:52:44FromDiscord<djazz> A transpiler might transpile to the same language
07:53:01FromDiscord<Rika> nim doesnt do that im pretty sure
07:53:04FromDiscord<djazz> Like Babel in JS
07:53:25FromDiscord<Rika> ugh this is just word elitism or something i dont like this
07:53:29FromDiscord<Zed> lol, does that mean my braces thing is a transpiler from nim to nim
07:53:33FromDiscord<Rika> yes
07:53:34FromDiscord<djazz> Yes
07:53:34FromDiscord<Rika> kinda
07:53:36FromDiscord<Rika> i dont know
07:53:38FromDiscord<Rika> i wouldnt call it that
07:53:42FromDiscord<djazz> It _transforms_ nim code
07:53:49narimirancome on guys, it is too early for yet another transpiler vs compiler discussion
07:53:50FromDiscord<djazz> https://stackoverflow.com/a/44932758
07:54:02FromDiscord<Rika> im tired of these discussions
07:54:10FromDiscord<Zed> can it be bumble bee
07:54:20FromDiscord<Zed> or is there a nim transformer?
07:55:31FromDiscord<Rika> try reading nim's emitted C code
07:55:31FromDiscord<djazz> Whats funny to me is that that is the first thingthe guy on the cheat forum notices about nim lol
07:55:44FromDiscord<Rika> if you can call that "readable by a human" i'd call asm readable by a human
07:55:52FromDiscord<Zed> he seems like my old teacher
07:56:04FromDiscord<Zed> big old school fanboy
07:56:11FromDiscord<Zed> the internet is useless
07:56:35FromDiscord<Rika> ugh i really want to literally delete the word transpile from my dictionary, its such an abused word that i dont want to even know it anymore
07:56:35FromDiscord<djazz> Basically ”but if it ’compiles’ to c++, why not just write c++?”
07:56:59Araqbut if C++ comples to asm why not just write asm.
07:57:05FromDiscord<djazz> Exactly
07:57:15FromDiscord<Zed> why not just write 1's and 0's
07:57:17FromDiscord<Zed> noobs
07:57:30FromDiscord<djazz> Punch cards bro
07:57:37FromDiscord<Rika> man why are we talking about some random fucker writing cheats whom we dont even know of
07:58:00FromDiscord<djazz> Yeah, lets talk about nim instead
07:58:23Araqthere is a definition of what "transpile" means and Nim doesn't do it, simple as that.
07:58:55Araqthe definition makes no sense but if you think "transpile" should be a word then well, there is a definition
07:59:42FromDiscord<Rika> the definition is too vague for me to consider a definition worthy of being in a dictionary
07:59:48Araqpersonally I don't see the point, there is already "translate", "interpret", "compile" and "JIT compile"
08:00:21FromDiscord<Rika> then the 2 said above, convert and transform
08:00:39FromDiscord<Zed> wouldn't convert and transform be the same thing
08:01:03Araqthere is also "preprocess", C++ used to a "preprocessor", at least according to the people who are clueless and now moved on to "transpiler"
08:01:05FromDiscord<Zed> they both manipulate the input to the same output
08:01:09FromDiscord<Rika> convert usually is the whole thing, transform can be just a portion
08:01:13FromDiscord<Zed> ah
08:02:17FromDiscord<Rika> what are yall workin on?
08:02:35FromDiscord<Shucks> Thank you guys. I see that `transpile, compile` thingy is a sensitive topic ;D
08:02:53FromDiscord<Rika> its super sensitive lol
08:02:57FromDiscord<Zed> *where not done yet boy*
08:03:01FromDiscord<Zed> :P
08:03:03FromDiscord<Rika> no we are done
08:03:19FromDiscord<Zed> lol
08:03:48FromDiscord<Zed> did you submit a talk rika?
08:04:03FromDiscord<Rika> nope, got nothing to talk about
08:04:26FromDiscord<Zed> What are you working on at the moment?
08:04:33FromDiscord<Rika> i dont really do anything big, all ive done so far is write a pretty large library for osu (utilities for the game) and a progress bar library
08:04:46FromDiscord<Rika> i mean big as in popular, not literally large
08:05:32FromDiscord<Rika> im working on the irc bot thats gonna be using the osu library i wrote, just a bot that you give a beatmap (song level) link and spits out info about the beatmap
08:05:44FromDiscord<Zed> sounds good
08:06:01FromDiscord<Rika> its actually a rewrite of my old python code
08:06:12FromDiscord<Rika> its old (aka very shitty practices and horrible code)
08:06:20FromDiscord<Zed> your gonna have to do some speed tests
08:06:38FromDiscord<Rika> just thought of rewriting it since its not async and used threads (***in python***)
08:07:03FromDiscord<Rika> made it async w/ 1 thread, which should be good for the load it has (around 1 user a day on average)
08:07:25FromDiscord<Rika> @Zed its not gonna be noticeably faster since ehh its just a bot not many use
08:07:34FromDiscord<Rika> most latency is from the irc server itself
08:07:47FromDiscord<Shucks> a cli pbar library?
08:07:49FromDiscord<Rika> my nim implementation so far processes messages in a millisecond
08:07:55FromDiscord<Rika> @Shucks yup, it's called suru
08:07:59FromDiscord<Shucks> cool
08:08:19FromDiscord<Rika> i kinda put it aside for now since im working on this bot app
08:08:28FromDiscord<Rika> ill return to it though
08:11:36*dddddd joined #nim
08:15:44Araqbummer, after I wrote the functizer Clyybber came up with a better idea and now it's useless
08:17:21FromDiscord<Rika> what idea
08:18:40Araqhttps://github.com/nim-lang/RFCs/issues/234#issuecomment-646630694
08:18:41disbotβž₯ Add write-tracking to Nim's func ; snippet at 12https://play.nim-lang.org/#ix=2pg3
08:20:09FromDiscord<Rika> what the fuck thats big brained
08:27:52Araqyeah, pure genius
08:32:52*brainbomb quit (Quit: Leaving.)
08:47:21*clemens3 quit (Quit: bbl)
08:50:05*aeverr quit (Ping timeout: 265 seconds)
09:01:44*clemens3 joined #nim
09:01:44*clemens3 quit (Client Quit)
09:02:10narimiran2 hours till the NimConf 2020! https://conf.nim-lang.org/
09:02:23narimiranthere is also #nimconf IRC channel
09:02:41*clemens3 joined #nim
09:03:07narimirandon't forget that we'll have live chat on youtube so you can ask questions live, while watching! don't miss that opportunity
09:04:18*brainbomb joined #nim
09:13:57Zevvstupid question from a youtube-noob: does it premiere by streaming 'live', or does it premiere by allowing people to start the vid from that time?
09:14:02Zevvaka, are we synced?
09:19:58planetis[m]I just made a repost about nimconf in hacker news, please upvote
09:21:06FromDiscord<lqdev> Zevv: I think it's synced, at least according to YouTube's descriptions
09:21:16*tane joined #nim
09:21:35FromDiscord<lqdev> otherwise, what would be the point
09:22:00narimiranZevv: we all start watching at the same time
09:22:30narimiranif you're 15min late, you can watch live from 0:15 forward, or you can watch from the beginning (lagging behind us others who are watching live)
09:22:58narimiranalso, if you watch from the beginning, you'll see the live comments as they were written, e.g.:
09:23:23narimiranif i write a comment at 7th minute of the video, you'll see it when you come to 0:07, not before
09:26:30FromDiscord<dom96> Quite a nice feature from YouTube
09:27:40*oddp joined #nim
09:45:12FromDiscord<Zed> we've had alot of people join discord today
09:45:55FromDiscord<Rika> lol
09:47:48FromDiscord<Zed> im curious how many people are actually active on this server
09:48:05FromDiscord<Zed> i only ever see the same 10-15 people
09:51:27FromDiscord<Zed> also is all discussion happening on youtube for the conf?
09:53:49narimiranwe cannot prevent the discussion happening elsewhere :P
09:53:59narimiranbut yeah, discussing there would be the best
09:54:24FromDiscord<Zed> when the videos switch, is all discussion carried over? or does it start anew
09:55:30FromDiscord<Rika> anew i assume
09:56:04narimiranevery video has its own discussion
09:57:42*greenfork joined #nim
10:05:38FromDiscord<--HA--> Hello. I was able to compile a static ELF binary with musl and these flags `--gcc.exe:musl-gcc --gcc.linkerexe:musl-gcc --passL:-static`. It works with a program only using stdlib. When I use a library I get `could not load: (libc.so.6|libiconv.so)` at runtime. Can I compile the library statically linked as well? I used nimble and it is in my nimble dependencies.
10:09:34*sagax quit (Ping timeout: 258 seconds)
10:27:08*neceve_ joined #nim
10:32:36*Vladar joined #nim
10:36:47Araqyeah via --dynlibOverride:iconv and some -liconv flag
10:40:23*waleee-cl joined #nim
10:42:14FromDiscord<willyboar> Hello! I am readyyyy
10:44:41FromDiscord<--HA--> That does not seem to make a difference. I'm not calling iconv directly, the dependency I have in my .nimble file must be using it. I think the dependency is dynamcilly linked and not being rebuilt maybe? Sorry I know just enough about this to break things but not really what I'm doing. When I compile with -d:nimDebugDlOpen I get↡Dynamic loading not supported↡Dynamic loading not supported↡could not load: (libc.so.6|libiconv.so)
10:50:56*chemist69 quit (Quit: WeeChat 2.7)
10:51:14*chemist69 joined #nim
10:52:32Araqit doesn't matter if its a dependency or not, --dynlibOverride is a general override mechanism
10:54:06FromDiscord<dom96> @everyone NimConf 2020 starting in 6 minutes. https://conf.nim-lang.org. This is your one and only notification about it. πŸ™‚
10:54:22FromDiscord<uniminin> what is this bro
10:54:23FromDiscord<Recruit_main707> #announcements :P
10:54:32FromDiscord<Zed> omg why the ping??
10:54:33FromDiscord<Zed> lol
10:54:36FromDiscord<Zed> :P
10:54:40FromDiscord<Technisha Circuit> What's Nimconf? :P
10:54:43FromDiscord<KrispPurg> who cares lets enjoy this conf
10:54:51FromDiscord<Recruit_main707> a conference about nim
10:55:08FromDiscord<Zed> nim as in the ancient babel king who that programming language is named after
10:55:17FromDiscord<Synth> > What's Nimconf? :P↡@Technisha Circuit You didn't know about it? ;-;
10:55:22FromDiscord<Recruit_main707> smh
10:55:27FromDiscord<aachh> Niiice, looking forward!
10:55:28FromDiscord<Technisha Circuit> No :P
10:55:31FromDiscord<Synth> ;-;
10:55:40FromDiscord<Luk> lel
10:55:50FromDiscord<Synth> codic said he might join
10:56:02FromDiscord<Luk> isnt that a big convention starting in 4 min
10:56:15FromDiscord<strexicious> POGGERS
10:56:16FromDiscord<KrispPurg> I was gonna join, but I was busy.
10:56:23FromDiscord<KrispPurg> nimchamp
10:56:46FromDiscord<KevinBlue18> nim conference
10:56:55FromDiscord<djazz> Online only
10:57:06FromDiscord<djazz> Can be watched later at any time
10:57:46*PMunch joined #nim
11:00:31leorizenimconf \o/
11:00:40leorizewait why does it have a 2 mins counter at the start lol
11:01:12PMunchTo make sure everyone has tuned in!
11:01:13PrestigeUTC + 2 mins
11:01:26Prestigehi PMunch
11:01:27PMunchNim Coordinated Time - NTC
11:01:30PMunchPrestige, hi
11:01:32*someunknownuser joined #nim
11:02:12PrestigeI've converted to dvorak lol
11:02:17PMunchSo apparently the timer is added by YouTube premieres
11:02:24PMunchPrestige, oh, how's that going?
11:02:47PrestigeI love it
11:02:59leorizeyou can convert to colemak if dvorak mess up too many keybindings :P
11:03:41Prestigehow do you like colemak?
11:03:41PMunchPrestige, nice! Loving it after only half a day of usage is pretty rare I think
11:04:06leorizecolemak is awesome, I use a modded version though
11:04:20Prestigemore like 15 mins of use haha
11:04:24*gangstacat quit (Remote host closed the connection)
11:04:26*akavel joined #nim
11:04:33leorizethe downside is that if I want this keymap elsewhere I have to make it myself lol
11:04:35*kaletaa joined #nim
11:04:51PrestigeI modified dvorak too
11:05:42FromDiscord<Avahe> https://media.discordapp.net/attachments/371759389889003532/723856092974547074/jpeg_1592648247000.jpg
11:05:45PMunchWhat modifications did you make?
11:05:55leorizeooooh, fancy keyboard
11:06:43Prestigemaybe I can share a better map repr
11:06:54Zevvaw you dropped your keyboard
11:06:56Zevvshame
11:07:01Prestigelol
11:07:38Prestigelayer 1: https://0x0.st/i4NP.png
11:07:56FromDiscord<Zed> nice
11:08:28Prestigeshift layer: https://0x0.st/i4NZ.png
11:10:27Prestigehave a couple other layers for things like f keys
11:15:28*ee7[m] joined #nim
11:16:30*sschwarzer joined #nim
11:16:37sschwarzerHi :)
11:16:48PrestigeHey!
11:17:29federico3hi
11:24:48FromDiscord<--HA--> Araq, some -liconv flag does that mean something like --passL:libiconv.so ?
11:25:08leorize--passL:-liconv <- that's what you should use
11:26:46*ftsf joined #nim
11:28:11FromDiscord<--HA--> Thanks! Using: --dynlibOverride:iconv --passL:-liconv↡I get: /usr/bin/ld: cannot find -liconv
11:29:20leorizelooks like iconv is not in your linker search path
11:32:55FromDiscord<--HA--> There should be a libiconv.so file somewhere on my system, right? I was not able to locate it. But when I just "nimble build" without extra flags then the dynamically linked binary runs fine. So some version of iconv has to be there otherwise that would not be working, or do I misunderstand?
11:34:06leorizeit could be that the libiconv.so symlink isn't available and you need to install a -dev package from your distro to get this
11:37:57alehander92_ooi
11:39:59leorizeo/
11:40:08leorizewe are in #nimconf, come join us
11:42:25FromDiscord<--HA--> leorize, it is a Debian 10 system and the best I could find was libiconv-hook-dev package which installs a /usr/lib/libiconv_hook.so. Do you think I need to get and compile the iconv library manually?
11:42:35*gangstacat joined #nim
11:42:58leorizeI think glibc provides iconv, so maybe libc-dev?
11:44:22*lritter joined #nim
11:46:32FromDiscord<KrispPurg> ​Is there a way to install Nim on windows using i686 cpu on choosenim?
11:47:04leorizeask dom96 :P
11:47:26FromDiscord<KrispPurg> okay
11:50:44FromDiscord<KrispPurg> do I just mention him?
11:50:55*dddddd quit (Ping timeout: 260 seconds)
11:51:04leorizeI already did but he might not be on irc atm
11:51:09leorize@dom96 I guess
11:51:35leorizeshashlick might know a thing or two about this, but they might not be online atm
11:53:08*vsantana joined #nim
11:54:37shashlickwhat's up - i'm up for the conf
11:55:20shashlicki replied on youtube - if you install a 32-bit mingw and add to path, choosenim will detect that and install 32-bit stuff
11:55:28shashlickthere's no force 32-bit flag yet
11:55:54FromDiscord<--HA--> leorize, Since I link against musl libc I should use the iconv implementation from it I think? Do you have an idea on how I would go about that? I have musl-dev package installed.
11:56:08leorizeoh you're on musl libc
11:56:23leorizeyou need gnu libiconv installed
11:56:43leorizeI'm not sure if Debian provides this
11:59:01narimiranthe second NimConf is about to start, don't miss it: https://www.youtube.com/watch?v=czLI5XJFxYA&list=PLxLdEZg8DRwTIEzUpfaIcBqhsj09mLWHx&index=3
12:01:54leorizeread: second NimConf talk :P
12:02:10PMunchHaha
12:03:19FromDiscord<--HA--> Thanks again leorize, I was hoping to be able to provide a binary that "just runs everywhere" that is why I looked into musl libc and static linking it. But I'm a bit out of my depth. gnu libiconv indeed does not seem to be available on debian by default. Maybe I can compile it from source.
12:04:24leorizehttps://github.com/JuliaBinaryWrappers/Libiconv_jll.jl/releases
12:04:37leorizejulia does provide prebuilt version of it if you would like to use them
12:05:16FromDiscord<l1pz> is there a way to setup defines in a nimble file? for example ssl
12:05:33leorizeyou can do so in a project configuration file
12:05:48FromDiscord<l1pz> in config.nims?
12:05:52leorizeyep
12:06:02*supakeen quit (Quit: WeeChat 2.8)
12:06:06leorizethough usually for best effect, use <project>.nim.cfg
12:06:24leorize<project> is the project name, and place the file next to <project>.nim
12:06:43*supakeen joined #nim
12:08:16*vsantana quit (Ping timeout: 256 seconds)
12:08:53FromDiscord<l1pz> my project setup is like this
12:08:56FromDiscord<l1pz> sent a long message, see http://ix.io/2pFl
12:09:24FromDiscord<l1pz> i want to put the cfg file in the root of the project
12:09:45FromDiscord<l1pz> would that be okay?
12:10:07FromDiscord<l1pz> or is should i place in next to the source file?
12:10:14FromDiscord<l1pz> it*
12:10:31FromDiscord<l1pz> *or should i place it next to the source file
12:10:35leorizeyou should place it next to the source file
12:11:02FromDiscord<l1pz> okay, thank. it's my first time setting up a proper project in nim, so i don't really know the conventions
12:11:05FromDiscord<l1pz> thanks*
12:16:49FromDiscord<--HA--> That is handy. I downloaded the Libiconv.v1.16.0.x86_64-linux-musl.tar.gz and the .so is in there. I still need to specifiy its location I assume. LIBRARY_PATH did not help. These are the flags I use --gcc.exe:musl-gcc --gcc.linkerexe:musl-gcc --passL:-static --dynlibOverride:iconv --passL:-liconv -d:release
12:18:40*superbia joined #nim
12:20:32leorizeuse --passL:-L/path/to/folder/with/lib
12:21:17leorizealso we have a handy --dynlibOverrideAll flag that can disable all dynamic loads
12:22:53FromDiscord<Technisha Circuit> How does Nim make the JS file for the JS backend? Compilation or Transpilation? Tryna prove a point
12:23:10leorizeyes
12:24:11FromDiscord<Technisha Circuit> Does Nim use transpilation at all? For the C backends or the JS backend?
12:24:23leorizeit's compilation but people will argue otherwise because the words are vague
12:24:34FromDiscord<Technisha Circuit> (My friend says Nim only does transpilation and that's Nim's selling point)
12:24:36FromDiscord<Technisha Circuit> Thank you
12:24:46leorizeit depends on what you mean by transpilation
12:25:03leorizeyou can say C transpile to ASM and you wouldn't be wrong :P
12:25:08*vsantana joined #nim
12:25:14leorizethe word is just flawed
12:25:27FromDiscord<Technisha Circuit> Okay then, thanks
12:27:56stefantalpalaru"Transpilation" is meant to be used for a subset of compilation types - the one where the languages at the same level of abstraction.
12:28:48*haxscramper joined #nim
12:29:14FromDiscord<--HA--> with --passL:-L it compiles but at runtime I get the could not load: (libc.so.6|libiconv.so) error again. I tried --dynlibOverrideAll as a test and then I see compile errors about conflicting types for iconv in stdlib_encodings.nim.
12:29:31leorizein my mind transpiling is basically generating the same program in an another language that's close to how you'd write it for real
12:29:43*brainbomb quit (Quit: Leaving.)
12:29:44FromDiscord<--HA--> Maybe it is time for me to accept I don't know enough about what I'm doing to continue πŸ˜‰
12:29:55narimiranthe next talk is about to start, don't miss it: https://www.youtube.com/watch?v=Qa_9vut4TzQ&list=PLxLdEZg8DRwTIEzUpfaIcBqhsj09mLWHx&index=4
12:30:10leorize@--HA-- --dynlibOverrideAll and --passL?
12:35:13*superbia quit (Quit: WeeChat 2.4)
12:36:32FromDiscord<--HA--> leorize, it looks like this https://pastebin.com/53iCtd0L
12:39:01FromDiscord<Shucks> woho inim
12:39:07FromDiscord<Shucks> no playground testing anymore ;D
12:39:38leorize@--HA-- I can see why this broke...
12:39:38FromDiscord<Pixeye> Game Boy Advanced I'M WAITING FOR YOU
12:39:53leorizeit's an stdlib bug, can you report it on github?
12:40:26Araqstefantalpalaru, Nim isn't on the "same level of abstraction" though, GC, closures and exceptions turn into a higher level beast
12:41:12AraqC is closer to asm than Nim is to C. Yet nobody says "C is transpiled", it's all messed up
12:41:37FromDiscord<Rika> 2nd transpiling discussion today :ArtiaFacepalm:
12:46:43FromDiscord<--HA--> leorize, By opening an issue? I can do that but I would not have much to say about it I'm afraid other than this did not compile.
12:47:44leorizeI'm fixing it actually :P
12:50:21FromDiscord<--HA--> Oh cool! Thanks!
12:50:34*vsantana quit (Ping timeout: 258 seconds)
12:52:12*vsantana joined #nim
12:53:16leorize@--HA-- http://ix.io/2pFw <- apply that patch to the stdlib and let me know if that fixes the problem
12:55:41leorizeyou don't have to rebuild nim, just apply the patch :P
12:59:27FromDiscord<Shucks> > 2nd transpiling discussion today :ArtiaFacepalm:↡@Rika sowwwwy ;D
13:00:17FromDiscord<Rika> boutta pull the trigger on deleting the word transpile from my mental dictionary
13:00:29FromDiscord<--HA--> I installed nim with choosenim. Would I just patch the file in .choosenim/toolchains or should I go about it differently?
13:00:39leorizeyea just patch it in there
13:05:36FromDiscord<--HA--> Awesome, that worked perfectly. Thanks a lot for handolding me through this and then fixing that bug right away.
13:05:56leorizeyou're welcome :)
13:06:30FromDiscord<--HA--> Interestingly it seems I don't need an extra libiconv, using only --dynlibOverrideAll and no -L it works
13:06:53FromDiscord<--HA--> with musl that is
13:07:24leorizeI guess they provided an implementation
13:08:19*krux02 joined #nim
13:10:11*akavel quit (Remote host closed the connection)
13:15:38*PMunch quit (Quit: leaving)
13:16:56*konradmb joined #nim
13:17:43*aeverr joined #nim
13:18:49*solitudesf quit (Ping timeout: 264 seconds)
13:19:25Yardanicoyeah
13:19:33Yardanico"The iconv implementation musl is very small and oriented towards being unobtrusive to static link. Its character set/encoding coverage is very strong for its size, but not comprehensive like glibc’s."
13:19:36Yardanicohttps://wiki.musl-libc.org/functional-differences-from-glibc.html#iconv
13:21:04leorizewe should probably make Nim more efficient at making static libs at some point
13:21:15Yardanicowdym?
13:21:53leorizethe current approach to nim staticlib generation is by putting all C code of a module in a file then compile into a `.o`
13:22:06leorizethis is, well, inefficient :P
13:22:37leorizesince dead code elim is basically non existant (and no, LTO won't save you) :P
13:31:06narimiranThe second session of #nimconf is about to start! Join us at https://www.youtube.com/watch?v=ruT7sbs5O-Q&list=PLxLdEZg8DRwTIEzUpfaIcBqhsj09mLWHx&index=6
13:51:18*konradmb quit (Read error: Connection reset by peer)
13:53:44*konradmb joined #nim
13:55:29*konradmb quit (Client Quit)
13:58:55Araqthe linker does save you
13:59:03Araqif you have a decent one
14:03:29stefantalpalaru"C is closer to asm than Nim is to C" - not really, Araq. Both Nim and C are high-level languages with runtimes. See https://queue.acm.org/detail.cfm?id=3212479
14:04:00FromDiscord<Rika> thats not the argument
14:04:15FromDiscord<Rika> reread what he said
14:04:35FromDiscord<Rika> `c is closer to asm than nim is to c` doesnt necessarily imply `c is low level`
14:04:50FromDiscord<Rika> just that `nim is way more high level vs c than c is high level vs asm`
14:05:40stefantalpalaruHow can a high-level language be closer to a middle-level language than to another high-level language, when talking about abstraction levels?
14:06:14FromDiscord<Rika> that depends on where you put the boundaries of a high, middle, and low level language
14:06:16stefantalpalaru(microcode is the actual low-level language, BTW)
14:06:24FromDiscord<Rika> does high level even have an upper bound?
14:06:37stefantalpalaruNo, no upper bound.
14:06:43FromDiscord<Rika> then there you have it
14:09:42stefantalpalaruGlad to help. So from now on start using "transpilation" for compiling Nim to C ;-)
14:10:00FromDiscord<Rika> what's transpilation? dunno that word
14:11:59stefantalpalaruhttps://scholar.google.com/scholar?hl=en&as_sdt=0%2C5&q=transpilation&btnG=
14:13:29FromDiscord<Rika> you know i cant be assed anymore this is the ***third*** discussion about transpilation and im very fucking done
14:13:31FromDiscord<Rika> call it whatever
14:13:36FromDiscord<Rika> ***i*** will call it compilation
14:13:48FromDiscord<Rika> you ***cannot*** tell me to do otherwise
14:14:04*Vladar quit (Quit: Leaving)
14:14:15FromDiscord<Rika> also call me stupid or whatever
14:15:26zedeuscalling Nim -> C transpilation is misleading and reductionist
14:15:37stefantalpalaruYou're out of luck. Arguing for obscure and redundant terminology is my hobby :-)
14:16:07greenforkget a life man :D
14:16:07FromDiscord<Rika> three times in one day is too much for me
14:16:13FromDiscord<Rika> one time is too much for me
14:16:33FromDiscord<Rika> i wish this argument never has to happen ever again to any fucking programming language
14:17:16stefantalpalaruAnyone interested in arguing why the right name of the programming language is "Go" and no "Golang"?
14:17:27stefantalpalaru*not
14:18:11FromDiscord<Rika> it is Go, golang is just better to refer to the language because of how common the word Go is
14:18:26FromDiscord<Rika> and people dont like capitalizing either haha
14:18:36FromDiscord<Rika> some people say rustlang
14:18:39FromDiscord<Rika> *too
14:18:41FromDiscord<Rika> also nimlang
14:18:43FromDiscord<Rika> so eh
14:19:33Araqstefantalpalaru, I'm underwhelmed by your argument, it makes no sense.
14:20:20stefantalpalaruAlso, I'd like to argue that Nim is Pascal++.
14:20:38FromDiscord<Rika> and rust is C+++?
14:21:00AraqAda is already Pascal++
14:23:08*konradmb joined #nim
14:28:18FromDiscord<codic> time to join nimconf
14:35:54Araqstefantalpalaru, https://queue.acm.org/detail.cfm?id=3212479 is a good article but it makes fundamental mistakes. TinyC can still compile C to x86. yes x86 is tremendously complex. that doesn't matter, it doesn't affect C implementations. It affects *optimizing* C implementations. But optimizations are red herring when you seek to judge the "high levelness" of a language. You can always optimize more. You can even take x86 assembler code and optimize it to
14:35:54Araq*very* different x86 code.
14:37:49AraqC is not low level because it maps well to today's hardware. It doesn't. It's low level because it lacks features we have come to appreciate in higher level programming languages.
14:38:19stefantalpalaruWhat do you mean by "x86"? Machine code? And you're saying that Tiny C has no intermediate Assembler representation? Even LLVM has one.
14:39:45stefantalpalaruHere's an oversimplification of complexity levels: Haskell, Nim and C deal with virtual machines that abstract over CPU registers, cache, memory, etc.
14:40:07stefantalpalaruAssembler deals with virtual CPU registers that abstract over real registers.
14:40:38stefantalpalaruMicrocode deals with actual hardware gates and voltage levels.
14:41:04FromGitter<alehander92> stefantalpalaru after translating idioms between high level languages
14:41:13FromGitter<alehander92> with an automated tool(it was very naive: but still a try)
14:41:41stefantalpalaruI exaggerated the microcode part a bit. It's more like "connect register 1 to the A side of the ALU".
14:41:45FromGitter<alehander92> i started to think of another metric: how many primitive expressions you need in B to express 1 expr idiom from A
14:42:07FromDiscord<Rika> a flaw in trying to define transpilation seems to be the varying lines of what is deemed high level and low level
14:42:24FromGitter<alehander92> of coruse there are much more important things: abstraction posibilities, etc
14:43:04FromGitter<alehander92> but i think this kind of metrics can come close to how we feel about verbosity/usage of a lang
14:43:06stefantalpalaruIs the virtual machine you target with Haskell that much different than the one you target with C?
14:43:20FromGitter<alehander92> so i feel its purely a
14:43:24*konradmb quit (Quit: Leaving)
14:43:37FromGitter<alehander92> language design thing: i cant understand how the target language has anything to do with "highlevelness"
14:43:47FromGitter<alehander92> now if its more about transpilation/compilation, sorry, maybe i was offtopic
14:45:17*UnnoTed joined #nim
14:50:36Araqstefantalpalaru, TinyC produces asm code without an IR indeed, see https://github.com/TinyCC/tinycc/blob/mob/i386-gen.c#L867
14:51:10Araqand when I mean x86, I mean x86 code as common assemblers accept it
14:53:10*krux02 quit (Remote host closed the connection)
14:56:28stefantalpalaruThen I don't understand your point. Yes, all C compilers produce Assembler, usually in textual form that is then passed to an assembler that produces machine code. What about it?
14:57:36narimirani'm sure that by the end of this discussion you two will convince each other in your arguments, and the other one will change his mind.
14:58:34Araqthe point is that you can translate C to x86 in a very simple, naive manner, whereas when you translate Nim to C you need to find a mapping for Nim's closures, memory management and exception handling. All features that currently imply "high level language"
14:59:19Araqindicating that Nim is further away from C than C is from assembler.
14:59:41Araqso if "Nim is transpiled to C" then "C is transpiled to asm"
14:59:56stefantalpalaruYou're talking about the quantity of mismatched concepts to translate. I'm talking about the quality of their abstraction level.
15:01:12FromDiscord<Isomorpheus> does anyone have nimpretty working with the nim vscode extension? is it just me?
15:06:29AraqWell I've really nothing to add. Keep using "transpile", but it keeps being wrong.
15:07:03AraqAccording to the definition of "transpile".
15:07:04stefantalpalaruAs long as it's an excuse to discuss programming language complexity level, I'll keep using it.
15:07:48AraqJeder blamiert sich so gut er eben kann.
15:08:42shashlickfor me it is as simple as whether you are translating German -> French - you don't end up with a page from one line
15:09:05*sknebel_ joined #nim
15:09:48FromDiscord<dom96> Araq's argument is completely correct and consistent with the definition of "transpilation" on Wikipedia
15:09:58FromDiscord<dom96> Nim->C is compilation
15:10:04*dddddd joined #nim
15:10:20FromDiscord<dom96> They are at different abstraction levels after all
15:10:37*sknebel quit (Ping timeout: 272 seconds)
15:11:00FromDiscord<Zed> are we having a 3rd discussion about transpiling
15:11:55*tefter quit (Quit: WeeChat 2.8)
15:12:33narimiran@Zed we're expecting to hit 5 by the end of the day
15:13:17*giaco quit (Ping timeout: 246 seconds)
15:13:18FromDiscord<Zed> haha maybe just add an announcement that transpiling is a sensitive topic
15:13:20narimiranit's not that we have something big going on today, plenty of time to discuss these important matters
15:13:37FromDiscord<Zed> lol
15:13:39FromDiscord<willyboar> ^ that's true
15:14:00FromDiscord<willyboar> today is a celebration day
15:18:47disruptekhave you looked at how the v compiler works?
15:18:54*dchem joined #nim
15:19:30stefantalpalaruShall we talk about macros operating on AST resulting from different compiler passes, depending on whether their result is typed or untyped? :-)
15:19:40FromDiscord<willyboar> https://github.com/the-benchmarker/web-frameworks eat our dust πŸ˜›
15:19:46dchemwatching videos for conference now
15:19:55*UnnoTed quit (Ping timeout: 246 seconds)
15:20:59FromDiscord<Rika> Thank God the day has ended for me, would have hit 4 if it hadn't
15:21:12FromDiscord<djazz> XD
15:26:49FromDiscord<Zed> disruptek, i dont think i've heard anyine say anything good about v
15:26:56FromDiscord<Zed> *anyone
15:27:53FromDiscord<dom96> You should check their Twitter
15:27:56*sknebel_ is now known as sknebel
15:27:58FromDiscord<dom96> Lots are eating up the claims
15:28:35FromDiscord<Zed> wow really
15:29:13FromDiscord<willyboar> there always a mystery around V
15:29:32FromDiscord<Zed> v = vapor ware
15:29:44FromDiscord<Zed> last i checked they had a sponsor
15:29:47FromDiscord<Zed> which was weird
15:29:55FromDiscord<willyboar> we want T lang
15:29:55FromDiscord<dom96> Tbh the person that's creating it knows how to market in the short-term
15:30:02FromDiscord<dom96> Whether that will work in the long-term is another matter
15:30:18FromDiscord<dom96> But in this world, lying your way to success very often works
15:30:51FromDiscord<Zed> yup, although i think some of his claims are possible
15:31:22FromDiscord<Zed> but not with what he has at the moment
15:31:42FromDiscord<dom96> Sure, it's often not outright lies
15:31:48FromDiscord<dom96> But promises that won't be kept
15:32:15FromDiscord<dom96> or claims that are exaggerations
15:33:24FromDiscord<Zed> wow some one has spent > $700 backing it
15:38:41*letto quit (Remote host closed the connection)
15:39:07*letto joined #nim
15:41:53Zevvhey disruptek awoke
15:41:57Zevvyou missed all the fun man
15:49:50narimiranguys, Ar4q is live on youtube, time for the 4th today's discussion about transpiling, don't miss your chance!
15:50:18sschwarzernarimiran: *lol*
15:51:53narimiranIt is time for the second part of the #nimconf 2020, and it starts big β€” with Araq's talk about ARC and ORC!
15:51:55narimiranWatch it live: https://www.youtube.com/watch?v=aUJcYTnPWCg&list=PLxLdEZg8DRwTIEzUpfaIcBqhsj09mLWHx&index=9
15:51:59narimiran...and don't miss all the other talks coming after it: https://conf.nim-lang.org/
15:52:14dchemnice
16:02:19*solitudesf joined #nim
16:11:22*oddp quit (Ping timeout: 265 seconds)
16:12:16FromDiscord<hcorion> πŸ‘€ woah some very interesting talks here
16:14:28FromDiscord<hcorion> Can someone give me a brief description of what INim is? My C# brain thinks OOP interfaces, but not sure if that's what it actually is
16:14:51FromDiscord<mratsim> A repl
16:15:14FromDiscord<mratsim> (can't describe it in less than 2 words :/)
16:15:33FromDiscord<hcorion> Ooh ok very cool
16:16:31narimiran@hcorion it is just a 5min talk, you can watch it in a break between two live talks :)
16:17:07FromDiscord<djazz> Interactive Nim
16:20:42FromDiscord<hcorion> Oh I missed the GBA talk πŸ˜… I'll have to go watch that
16:21:04*oddp joined #nim
16:22:32FromDiscord<exelotl> @hcorion πŸ‘‹
16:22:54FromDiscord<hcorion> Hey πŸ‘‹
16:23:09FromDiscord<hcorion> That's your talk right?
16:23:30FromDiscord<exelotl> yeah! Your nake setup helped me a lot with making the jump from makefiles to nimscript builds
16:23:46FromDiscord<hcorion> Oh nice! Good to hear
16:27:07FromDiscord<hcorion> Nico also looks really cool
16:35:32*xace_ quit (Ping timeout: 246 seconds)
16:37:39*xace joined #nim
16:41:06sschwarzerThe state of the ARC? ;-)
16:43:01FromDiscord<exelotl> Raiders of the lost ARC
16:45:17FromDiscord<djazz> Lord of the Nim crown.
16:45:38FromDiscord<hcorion> Woah I didn't realize you're making a full game in Nim for the GBA, dude that's awesome @exelotl
16:46:36sschwarzerWhat's the current state of Nimfusion (Nim + selected libraries, IIRC) now btw? I read about the _idea_ a while ago and saw discussions, but I can't remember any announcements that it was available.
16:46:56sschwarzerexelotl :)
16:54:26*tane quit (Ping timeout: 256 seconds)
16:56:11*ftsf quit (Ping timeout: 246 seconds)
17:07:54solitudesf!repo fusion
17:07:54disbothttps://github.com/nim-lang/fusion -- 9fusion: 11Fusion is for now an idea about how to grow Nim's ecosystem without the pain points of more traditional approaches. 15 49⭐ 4🍴 7& 1 more...
17:36:43*testnimnoob joined #nim
17:36:52testnimnoobis nim in action updated?
17:37:13testnimnoobif it isnt how badly out of date is it ?
17:37:18*narimiran quit (Ping timeout: 258 seconds)
17:38:38FromDiscord<dom96> It's not and it's pretty up to date
17:38:48FromDiscord<dom96> It supports 1.0, all code examples should still compile
17:39:27FromDiscord<dom96> Here is an awesome errata https://deepakg.github.io/nim/2019/09/28/nim-in-action-errata.html
17:39:39testnimnoobomg this is awesome
17:39:57FromDiscord<dom96> Most of these aren't serious IMO
17:41:08testnimnoobi really thought that the explanation of model (the calculator) was the BEST explanation
17:41:09testnimnoobetc
17:41:23testnimnoobi stopped doing rails because no one could explain it lol
17:41:52testnimnoobhope you write another book dom
17:42:12FromDiscord<dom96> yay, nice to hear. Completely forgot about that example heh
17:42:28testnimnoobmost people will parrot "business llogic goes there"
17:42:37testnimnoobbut cant explain it really well
17:43:14testnimnoobi was only scanning through also
17:43:22testnimnoobill work on it for real
17:57:23*testnimnoob quit (Remote host closed the connection)
18:09:09*synshroud joined #nim
18:09:47*oddp quit (Ping timeout: 265 seconds)
18:31:00FromDiscord<SeanOMik> How would I update values inside of a `seq`
18:31:18FromDiscord<SeanOMik> And also remove values from it if I dont know the index of the value
18:31:41leorizefind() can be used to find the index of a value
18:32:31FromDiscord<SeanOMik> Okay, is there a proc for updating values?
18:33:58leorizeonce you got the index, just do `seq[index] = newvalue`
18:34:59FromDiscord<SeanOMik> Oh cool
18:35:00FromDiscord<SeanOMik> Thanks
18:35:24leorizethough make sure that you're not using `find()` a lot
18:35:50leorizeit's O(n) so it's pretty inefficient
18:44:22*opal quit (Remote host closed the connection)
18:45:43*opal joined #nim
18:46:35FromDiscord<Shucks> Someone referred me to a math class which had 2d/3d vectors aswell. Does someone know which one it could be
18:50:19FromDiscord<Rika> Which one what could be
18:54:02stefantalpalaruTurns out you can convert decimal numbers to fractions and use those in GMP: https://gmplib.org/manual/Rational-Number-Functions
18:54:27stefantalpalaruBut you need to do your own parsing/printing: https://mortoray.com/2013/03/14/parsing-an-exact-decimal-value-using-gmp/
19:00:05*waleee-cl quit (Quit: Connection closed for inactivity)
19:02:45haxscramperI have generic proc that assumes existence of another proc for concrete type - `implementationForT`. When I define concrete implementation _after_ generic has been declared everything breaks (`type mismatch error` and only candidate is the one defined _before_ generic). The strange this is: it works correctly for `$`. Code example: https://play.nim-lang.org/#ix=2pH9 - if I move `type U*` declaration _before_ generic everything works
19:02:45haxscramperfine.
19:07:26FromDiscord<mratsim> use "mixin implementationForT" in implementationForT
19:09:32*brainbomb joined #nim
19:10:22*theelous3 quit (Ping timeout: 260 seconds)
19:28:13*NimBot joined #nim
19:33:44FromDiscord<--HA--> When I run nimble build it installs a dependency I use as a library to import in my code. As part of that nimble pckage install it also builds a bunch of binaries, which takes a while. Can I disable that somehow?
19:35:06FromDiscord<Shucks> Before I'll continue the wrong way. Could this be simplified? https://play.nim-lang.org/#ix=2pHi
19:35:11shashlickit will only do it once
19:35:21FromDiscord<--HA--> It's nothing that bothers me on my system because the second time I run it it's all already there and takes barely any time but on the gitlab ci job it makes it slow every time
19:36:09shashlickdon't you need all those binaries?
19:39:02leorize@Shucks iirc there are built-in templates for `+=` if you have `+` defined
19:39:34leorizehmm why are you using inheritance here?
19:40:05FromDiscord<Elegant Beef> Can the nim compiler run in browser to produce js code?
19:40:10leorizenope
19:42:06FromDiscord<Elegant Beef> Few issues with that vector file, dont make vectors reference objects, they're created and destroyed a ton
19:42:15FromDiscord<Elegant Beef> Secondly no reason for inheritance as leorize pointed out
19:42:41FromDiscord<--HA--> shashlick, I don't think so. Unless I misunderstand how it works. It's a library to access a file format from a game. You get the binaries to run as command line tools to extract files and so on but I import the files I need in my nim code and never do anything with the compiled tools.
19:44:51FromDiscord<--HA--> It is not a big problem. Just means the build job will take a few minutes longer. I was just wondering if there was a switch to not build binaries.↡If I removed the `bin = ` part in their .nimble file I suppose that would do it and I would also find out if those files were needed?
19:44:55shashlickokay sounds fair
19:45:29shashlickyou can git clone, nimble install -d to just install its deps (assuming they don't build binaries :D)
19:45:57shashlickthen you can use --path:.. to tell nim about it or have a folder of such cloned packages and use --nimblePath
19:46:19shashlicki'd suggest nimble develop but it might not work for binary only packages
19:46:24FromDiscord<Shucks> @leorize Anything else I would need to do to get `+=` work? Just removed my `+=` procs and it doesn't works anymore
19:46:24shashlickworth a try tho
19:47:09leorize@Shucks then I guess the template is only defined for ordinals
19:47:40FromDiscord<--HA--> I think it's the "hybrid" package type, listed as "combination of library and binary" by nimble init
19:47:50shashlicktry git clone and nimble develop
19:48:03shashlickit will add it to the nimble path searched by nim but won't build the package
19:48:52FromDiscord<--HA--> I'll give that a try. Thanks.
19:58:43bungam watching INim is back , wondering the screenshots using some tool make it look like capture from old monitor?
20:03:15leorizeit's probably a crt terminal emulator
20:03:43leorizeit probably was cool-retro-term
20:04:51FromDiscord<Shucks> looks likes windows cmder
20:04:52FromDiscord<Shucks> ;D
20:04:53bungthanks ! found it, looks very cool!
20:05:09FromDiscord<Shucks> (edit) 'likes' => 'like'
20:06:33FromDiscord<--HA--> shashlick, nimble develop works but then the version is not read from the requires line in my .nimble file. I think I'll just leave it alone and live with longer builds for now.
20:08:26leorizeyou can also use nimph
20:08:28leorize!repo nimph
20:08:29disbothttps://github.com/disruptek/nimph -- 9nimph: 11Nim package hierarchy manager from the future 🧚 15 66⭐ 4🍴 7& 1 more...
20:10:46FromDiscord<l1pz> @Shucks I would use a seq[float] to store the values. This way you only have to write every function once. Like this: https://play.nim-lang.org/#ix=2pHz
20:10:50shashlick--HA-- you need to remove the package from ~/.nimble if it is there as well
20:10:57*oddp joined #nim
20:11:08shashlickcause develop packages are linked as #head i think
20:12:45FromDiscord<--HA--> I'll check out nimph sometime. For now I'm happy I have something working hehe.
20:14:07FromDiscord<Shucks> mh yea, but you can't use Vector(x:1, y:1) syntax then for example right
20:14:53FromDiscord<l1pz> No, you have to make a proc to do that for you, but it's quite simple
20:20:57FromDiscord<--HA--> I have another question that is hopefully not too offtopic, maybe someone has an idea of how it works under the hood and what sounds like the better approach, otherwise I can time both versions. I have strings of a few kb length each (already all read in into memory) and need to write them out to files. About 1000 files. I need each of those files twice. Would it be faster to writeFile twice or writeFile once and then copy it?
20:21:53leorizewriteFile twice
20:22:05leorizecopying is basically read a file and write it to another
20:23:22FromDiscord<--HA--> Makes a lot of sense now that you say it πŸ™‚
20:23:58leorizeif you want peak efficiency one would use vectored functions like writev, but that stuff is not cross-platform :P
20:24:44*qn68h joined #nim
20:24:48qn68hhi
20:24:52FromDiscord<Elegant Beef> Yellow
20:24:54leorizehi
20:25:26*haxscramper quit (Remote host closed the connection)
20:25:34qn68hI've read https://github.com/nim-lang/Nim/wiki/Nim-for-Python-Programmers#objects, and coming from Python, I'd like to see how to do classes in a "nimic" (equivalent to "pythonic" way)
20:25:45leorizeabout that...
20:25:47leorizewe don't have classes :P
20:26:16qn68hleorize, are there projects about including them ? :)
20:26:20FromDiscord<codic> How can I iterate over a json object, parsed with parseJson, per key-value? something like for key, val in object
20:26:40leorizeqn68h: yes but not popular
20:26:45leorizebecause Nim don't need class
20:26:57qn68hleorize, oh really? not popular?
20:27:01leorizein Nim we write data structures and procs that work on them
20:27:08leorizewe have ufcs
20:27:18FromDiscord<l1pz> @Shucks I updated the code, so you can how I would do it. https://play.nim-lang.org/#ix=2pHC
20:27:21FromDiscord<Elegant Beef> Nim creates objects, and due to our funky call syntax we just make procs that use them as parameters
20:27:23FromDiscord<Elegant Beef> It's nice
20:27:34FromDiscord<l1pz> (edit) '@Shucks I updated the code, so you can ... how' => '@Shucks I updated the code, so you cansee'
20:27:45qn68hleorize, look at https://github.com/nim-lang/Nim/wiki/Nim-for-Python-Programmers#self__init__
20:27:46FromDiscord<Elegant Beef> `proc add(a,b:int):int = a + b`
20:27:47FromDiscord<Elegant Beef> for instance
20:27:56qn68hit's not really nice...
20:27:57oddpProps to you guys for pulling through with the conf. Hopefully, we over at d will follow suit in the weeks to come. :)
20:27:59FromDiscord<Elegant Beef> can be use `add(10,11)` or `10.add(11)`
20:28:24qn68hleorize, having to do "var kitten = initCat()" is not like creating an instance...
20:28:41FromDiscord<Elegant Beef> Well my counter argument is python sucks
20:28:42FromDiscord<Elegant Beef> So hah
20:28:49leorizeI guess you will have to write Nim a bit first :P
20:28:58leorizeit's tempting to think Nim is python due to the similar syntax
20:29:21FromDiscord<Elegant Beef> Imagin having`__` in a variable name
20:29:23FromDiscord<KingDarBoja> qn68h: welcome to Nim
20:29:28FromDiscord<KingDarBoja> Coming from Python uh?
20:29:44FromDiscord<--HA--> sent a long message, see http://ix.io/2pHE
20:30:08qn68hleorize, the beauty of OOP is that you just create an object w = Window(), and you don't have to think about "what's the initialization method name? is it newWindow()? is it initWindow()?"
20:30:21FromDiscord<Elegant Beef> well you can do `Window()`
20:30:32FromDiscord<Elegant Beef> That is the object constructor
20:30:34FromDiscord<codic> @--HA-- Thank you!
20:30:38leorizein Nim we use a simple convention: initType or newType
20:30:47leorizeinitType when it's a stack-based object
20:30:49FromDiscord<Elegant Beef> It uses named parameters if you dont use the procs
20:30:54leorizenewType when it's a heap-typed object
20:30:57FromDiscord<KingDarBoja> qn68h: the best idea should be writing a bit of Nim πŸ™‚ As leorize stated
20:31:11FromDiscord<Elegant Beef> You have a preconcived notion that the python way is better
20:31:16FromDiscord<KingDarBoja> You can do OOP on Nim but very minimal
20:31:27qn68hElegantBeef: but then Window() does not call anything after the init
20:31:35FromDiscord<KingDarBoja> This is a way of doing things, but not the only way πŸ˜‰
20:31:56leorizenot having constructors is a design decision btw
20:31:57FromDiscord<Elegant Beef> well that's why you make your own constructor proc
20:32:11qn68hhmmm...
20:32:11leorizeAraq can brief you on why (if he's still online)
20:32:17qn68hI looked at https://forum.nim-lang.org/t/3
20:32:24FromDiscord<Elegant Beef> Leroize i have a macro called constructor, so you lie πŸ˜›
20:32:33FromDiscord<Elegant Beef> It doesnt call procs but just makes the init/new procs for you
20:32:36leorizeI mean built-in :P
20:32:52qn68hand I was surprised by the nim way ;)
20:32:58FromDiscord<KingDarBoja> Aren't constructors basically `initProcName` and `newProcName` ?
20:33:04FromDiscord<Elegant Beef> You dont have to use the init/new convention
20:33:08FromDiscord<Elegant Beef> you can use new everwhere
20:33:18FromDiscord<l1pz> Can someone help with this piece of code? I'm getting memory safety violation error, but I don't really know why. Here's the snippet: https://play.nim-lang.org/#ix=2pHB. I'm trying to make an async file downloader with a progress bar.
20:33:37qn68hleorize, well i have to say it's my first small desillusion, except that, everything looked great so far in my Nim journey :)
20:33:39FromDiscord<KingDarBoja> I know, what I mean is just setting the proc to match the type hehehe
20:33:57FromDiscord<Elegant Beef> The only reason new/init is to easily distinguish stack vs heap objects i believe
20:34:02FromDiscord<KingDarBoja> qn68h: don't see it as desillusion, it is another way of doing things
20:34:21FromDiscord<l1pz> This is the error I'm getting: Error: 'bar' is of type <var ProgressBar> which cannot be captured as it would violate memory safety, declared here: D:\Projects\nim\asyncdl\src\asyncdl.nim(24, 51)
20:34:43qn68hKingDarBoja, the main problem I have with this way is:
20:34:47FromDiscord<l1pz> I tried to read up on memory safety in Nim, but couldn't really find it in the docs.
20:34:59leorize@l1pz you can't capture a `var` in a closure
20:35:20leorizethis is because a closure is run independent of the stack
20:35:32FromDiscord<KingDarBoja> Btw would be great to have a *help* channel and use this for main Nim discussions πŸ€”
20:35:43*aenesidemus_ quit (Quit: Leaving)
20:35:43FromDiscord<Elegant Beef> I mean this is the help channel πŸ˜„
20:35:48FromDiscord<l1pz> In C++ I would just pass a refence to the object. How would I do that in Nim?
20:35:59FromDiscord<l1pz> I mean to the function
20:36:00*aenesidemus joined #nim
20:36:07leorizemake your `ProgressBar` a ref object
20:36:08qn68hcat = Cat(); cat.purr() cat.doanything() initCat() <-- this one is an exception in syntax
20:36:09FromDiscord<KingDarBoja> Yeah but sometimes becomes the discussion Nim stuff
20:36:11leorize`var` is the reference
20:36:19FromDiscord<Skaruts> does `choosenim stable` look for the latest stable available, or the latest stable I have installed?
20:36:28FromDiscord<KingDarBoja> The latest stable available
20:36:31leorize@l1pz Nim reference is stricter in memory safety requirements
20:36:37FromDiscord<KingDarBoja> In this case `1.2.2`
20:36:47qn68hleorize, i.e. all methods are cat.something() *but* there is an exception for the init which is not a method but a regular function :/
20:36:56FromDiscord<Skaruts> hmm, it switched me to 1.2.0 though
20:37:04FromDiscord<Elegant Beef> UFCS means that you're wrong
20:37:07leorizeqn68h: you're seeing it wrong: we don't have methods, we only have functions
20:37:13FromDiscord<Elegant Beef> They're all possible to be regular functions
20:37:32FromDiscord<KingDarBoja> @Skaruts I think it first update to the major version then the patch one
20:37:32leorizes/possible to be//g
20:37:42FromDiscord<KingDarBoja> So run again `choosenim stable`
20:37:42shashlickSkaruts - your stable
20:37:49shashlickuse choosenim update stable to update your local
20:37:52FromDiscord<KingDarBoja> Not sure tbh
20:38:00FromDiscord<Elegant Beef> again↡`proc add(a,b:int):int= a + b`↡can be used↡`10.add(11)` and `add(10,11)`
20:38:16shashlickif you already installed 1.2.2 directly, stable won't get updated - there's a bug on that
20:38:18FromDiscord<Elegant Beef> So your issue is a self inflicted one imo πŸ˜„
20:38:19qn68hleorize, why this choice, in comparison to C++ which has methods etc. ?
20:38:41FromDiscord<Elegant Beef> Nim does have dynamic dispatch which are called methods, but we use UFCS so we dont need class attached methods
20:38:54leorizeqn68h: we maintain a separation of code from data structure
20:38:57FromDiscord<KingDarBoja> shashlick: Thanks for the correction
20:39:08FromDiscord<KingDarBoja> I forgot how the command was
20:39:17leorizeit's just good practice, really
20:39:35leorizeand also it avoided all the nastiness of classes and their methods
20:39:53FromDiscord<Skaruts> ah thanks, @shashlick
20:39:57leorizesince we have UFCS, the object.method() can be used for... everything :P
20:40:04FromDiscord<Elegant Beef> yea
20:40:07FromDiscord<KingDarBoja> Should this be recommended -> https://scripter.co/notes/nim
20:40:10leorizeit doesn't make sense to have special syntax
20:40:11FromDiscord<Elegant Beef> Nim is wildly different to python
20:40:15qn68hI've used code with a lot of classes, inheritance in the past in both c++ and python, and the structure of the code is always "clean", even from bird's eye view... everything is grouped where it should be. I can't really imagine how it would look like here :/
20:40:21leorize@KingDarBoja yea that's a good resource
20:40:25qn68his there a nim testing branch with classes?
20:40:30leorizenope
20:40:59*dsrw joined #nim
20:41:00FromDiscord<Elegant Beef> You can always make classes by having members
20:41:03qn68hleorize, would you have an example .nim file with many classes and inheritance? i'm curious how it looks like
20:41:04FromDiscord<Elegant Beef> But that's weird
20:41:31FromDiscord<KingDarBoja> I have an example xD
20:41:32leorizeqn68h: well the thing is... we don't do inheritance here a lot (if ever)
20:41:40FromDiscord<KingDarBoja> And switched to Object Variants
20:41:56leorize@KingDarBoja please show them :P
20:41:58FromDiscord<Elegant Beef> We use object variants and data oriented design!
20:42:17qn68hleorize, how would you program a game (where many objects herit from parent class), a GUI with windows, buttons, etc. there's a lot of inheritance
20:42:28FromDiscord<Elegant Beef> A ECS using Components
20:42:37FromDiscord<Elegant Beef> which is 1 depth inheritance
20:42:42FromDiscord<Elegant Beef> or 0 if you are smart
20:43:14qn68hECS?
20:43:33sschwarzerFunny, during the last days I was thinking about new/init myself. What I dislike somewhat about the convention is that it seems too low-level. Usually I just want an instance of type and don't care about whether it's implemented as a value of ref. And what if I change a value object to a ref later? Than all uses must rename the function from `init*` to `new*` or keep using the "wrong" name.
20:43:35FromDiscord<SeanOMik> How would I create a new tuple?
20:43:37FromDiscord<Elegant Beef> Entity Component System
20:43:45FromDiscord<Elegant Beef> A very compositional system
20:43:53FromDiscord<Skaruts> @qn68h you can do inheritance in Nim, and you can use methods instead of procs if you need polimorphism
20:43:57FromDiscord<Elegant Beef> Instead of relying on inheritance you rely on components which tell you what systems will work on it
20:44:00leorizeSeanOMik: `(value1, value2)`
20:44:10FromDiscord<Skaruts> I did for a UI
20:44:16FromDiscord<SeanOMik> Awesome, thanks
20:44:19FromDiscord<Elegant Beef> You design systems that work on the data buckets of components
20:44:29FromDiscord<l1pz> Thanks leorize, it works by making a reference by default. Is there way to put this on a single line tho?↡var bar: ref ProgressBar↡bar[] = newProgressBar(links.len)
20:44:30FromDiscord<Elegant Beef> Instead of using inheritance
20:44:38leorizeqn68h: it's better to look at some of our libraries, let me try to dig some up
20:44:43FromDiscord<KingDarBoja> leorize: well I am not sure if it is a proper example of why not using OOP-style
20:44:50qn68hleorize, yep great i'll look at a lib
20:45:44leorize@l1pz you'll have to use a template for now, probably we should add one into sugar
20:46:03FromDiscord<Skaruts> for OOP this helped me out a lot: https://matthiashager.com/nim-object-oriented-programming
20:46:18FromDiscord<KingDarBoja> I read that too
20:46:25leorize!repo fidget
20:46:25disbothttps://github.com/treeform/fidget -- 9fidget: 11Figma based UI library for nim, with HTML and OpenGL backends. 15 164⭐ 7🍴
20:46:27leorize!repo nigui
20:46:28disbothttps://github.com/trustable-code/NiGui -- 9NiGui: 11Cross-platform desktop GUI toolkit written in Nim 15 340⭐ 34🍴 7& 5 more...
20:46:32leorize^ those are for gui libraries
20:46:32FromDiscord<KingDarBoja> But please read the last part of it and you will see why it is discouraged
20:47:08Araqsschwarzer, you cannot move from value to ref semantics or vice versa that easily
20:47:21Araqesp not if you exposed the library to some clients you have no control over
20:47:33Araqso this init/new distinction causes no trouble IME
20:47:33leorizeqn68h: I'm not too well versed in the game stuff, so I'll ping @lqdev and hope that he can answer that part for you
20:47:36FromDiscord<KingDarBoja> You will get in trouble while trying to _convert an ancestor object to its descendant type._
20:47:43FromDiscord<Skaruts> I took it with a grain of salt, as the author advises, but still helped me a lot understanding how to do oop
20:47:51leorize!repo nico
20:47:52disbothttps://github.com/ftsf/nico -- 9nico: 11Nim Game Framework based on Pico-8 15 142⭐ 10🍴 7& 2 more...
20:47:57qn68hleorize, no that's fine, thanks a lot!
20:47:58leorize^ this one comes to mind for games
20:48:11qn68hyour GUI example is perfet
20:48:27qn68h*perfect, it showcases well how it goes: https://github.com/trustable-code/NiGui/blob/master/src/nigui.nim#L2449
20:49:09FromDiscord<mratsim> @Araq were you aware of this: https://github.com/agroce/afl-compiler-fuzzer
20:49:16leorizeglad that helped
20:49:16FromDiscord<KingDarBoja> Oh yeah, perfect example πŸ˜„
20:49:25FromDiscord<KingDarBoja> Give rep to leorize!
20:49:48qn68hleorize, tl;fr what's the diff func vs proc vs method?
20:49:55sschwarzerAraq: Ok, I'll just see what experiences I'll make. :)
20:50:23leorizeproc: plain old function
20:50:25Araqmratsim: no and "let me create more compiler bug reports" is a problem I've yet to experience
20:50:32leorizefunc: proc but with {.nosideeffects.}
20:50:44bungmethods dynmic dispatch, proc may or not have side effect, func has no side effect.
20:50:51leorizemethod: proc with dynamic dispatching
20:51:24qn68hleorize, is it just semantic proc vs func, to help the programmer see the differences, or is there a diff really in code?
20:51:43FromDiscord<Skaruts> it's different
20:51:45leorizeyes, in func you can't modify any state not reachable via parameters
20:51:48qn68hi mean is it a good practice naming convention or really it works differently?
20:51:57qn68hoh ok good to know
20:52:11sschwarzerWould you recommend _against_ not using the init/new convention, apart from it being a convention?
20:52:48FromDiscord<Skaruts> the compiler complains if you use `func` on a proc with side effects, and polymorphism won't work if you use `proc` on a subtype that is being handled as the supertype
20:53:11FromDiscord<lqdev> leorize: sup
20:53:14FromDiscord<Skaruts> for the latter you need `method`
20:53:24sschwarzerbung: What I found confusing first is that a `func` can still do a lot with its arguments. It's really only about _side_ effects (that have nothing to do with the arguments).
20:54:00leorize@lqdev qn68h was curious on how to do game programming with minimal OOP
20:54:08FromDiscord<lqdev> right
20:54:17qn68hHi lqdev
20:54:22FromDiscord<lqdev> hi
20:54:34bungsschwarzer yeah,theres rfc for that since you can pass referrence
20:54:37FromDiscord<lqdev> well, I just use inheritance with `method`s everywhere for things like `draw()`, `update()`, etc
20:54:44FromDiscord<lqdev> not sure what do you want exactly
20:55:07leorizethere are talks about ECS, though I don't know if there's anything in circulation rn
20:55:20qn68hlqdev, I programmed a pointnclick lib in Python, and there was Room, player, object, sprite, etc.
20:55:20leorizewe do have a separated gamedev channel but I forgot the name :P
20:55:44qn68hand I liked the fact everything was grouped nicely draw(), update(), etc.
20:56:30qn68hlqdev even from a bird's eye view, not reading the code, just the structure of the code is perfect with classical OOP
20:56:43FromDiscord<lqdev> so, if you want to stick with your OOP style, what you do is probably create a base `type Sprite = ref object of RootObj`
20:56:57FromDiscord<lqdev> it's important that the object is `ref`, otherwise you may run into weird issues
20:57:01bungnim is more self explaintion to me.
20:57:02leorizewhat our style of programming allows is that you can easily "extend" any "class"
20:57:08FromDiscord<lqdev> yeah
20:57:25FromDiscord<lqdev> so then you can inherit from the object using `type Player = ref object of Sprite`
20:57:55*vicfred quit (Quit: Leaving)
20:57:57qn68hlqdev but with that, how would inherit the init from Sprite?
20:58:11FromDiscord<lqdev> like I just shown
20:58:18qn68hin Player's init?
20:58:30FromDiscord<lqdev> you can define procs that require dynamic dispatch (the method is chosen dependent on what the actual type during runtime is, eg. `draw`)) using `method`
20:58:52FromDiscord<lqdev> eg. `method draw*(sprite: Sprite, target: Target) {.base.} =`
20:59:12FromDiscord<lqdev> you do this for all "abstract" methods you want to create
20:59:39qn68hhum ok I'll think about this. btw what is draw* why *?
20:59:53FromDiscord<lqdev> it's just an example
20:59:59*brainbomb quit (Quit: Leaving.)
21:00:02FromDiscord<lqdev> you can call them whatever you want
21:00:07bungexport from module
21:00:17qn68hok so * has no special meaning?
21:00:23*greenfork quit (Ping timeout: 256 seconds)
21:00:28FromDiscord<lqdev> nope, it makes the method *exported*
21:00:32bungmarked it as export
21:00:33leorizethe `*` means that the symbol is exported
21:00:37FromDiscord<lqdev> so that you can access it from other modules
21:00:39qn68hoh ok
21:00:58qn68hi hadn't read this yet in the doc ;) first day of nim :)
21:01:16FromDiscord<lqdev> anyways, then you just implement all the methods on your other sprites by just changing the first parameter to `player: Player`, and they'll be dispatched accordingly to what the type is at runtime
21:01:26FromDiscord<0xfabe (vn-ki)> Is nim geared towards game dev?
21:01:27FromDiscord<lqdev> unlike `proc` which dispatches depending on what the type is during compile-time
21:01:37FromDiscord<lqdev> @0xfabe (vn-ki) it's geared towards general use ;)
21:01:40FromDiscord<lqdev> so game dev too
21:01:46leorizenim is geared towards everything :P
21:02:13FromDiscord<0xfabe (vn-ki)> I'm torn b/w nim and rust for a new proj of mine :P
21:02:23FromDiscord<KingDarBoja> There is already a web framework, game dev libs, UI libs, etc
21:03:17qn68hohh so you can you have multiple functions with the same function name
21:03:21FromDiscord<Skaruts> @qn64h here's an example of how I did some OOP for a GUI for roguelikes: <https://gist.github.com/Skaruts/887629881d4667a5ec71ce03efb26630>
21:03:23FromDiscord<Skaruts> take it with a big grain of salt, but hopfully it can help
21:03:31FromDiscord<0xfabe (vn-ki)> I guess it might come down to whether I have time to wrap capstone for nim
21:03:32FromDiscord<lqdev> qn68h: yes, that's called function overloading
21:03:35qn68hand the compiler will decide which one to use according to the type of the passed parameters?
21:03:39FromDiscord<lqdev> yes
21:03:47FromDiscord<lqdev> they just have to have different parameter types
21:04:31qn68hgood to know, thanks!
21:04:31bungthey have differient signature ,so they are differient procs
21:04:54qn68hsomething else, out of topic with the OOP discussion:
21:05:18qn68hcontext: i came to nim by searching "something with python syntax, but compiled" (AOT)
21:05:42bunggood keyword :P
21:05:57leorizetechnically you can compile python :P
21:06:06qn68hI already used cython (not cpython), it's great for some time critical projects, but at the end you still need the interpreter
21:06:18qn68hso it's not really what i was looking for (cython)
21:06:32FromDiscord<KingDarBoja> _Use Jython_
21:06:46qn68hso then I looked at pypy, but it's still interpreted, JIT
21:06:52qn68hand then i came to nim
21:06:55FromDiscord<SeanOMik> How would I get the current Unix time?
21:07:06leorizetimes.now().toUnix()
21:07:11FromDiscord<SeanOMik> Ah okay
21:07:14FromDiscord<Skaruts> you still need the interpreter if you use py2exe?
21:07:17FromDiscord<SeanOMik> I didn't see the `toUnix` proc
21:07:19FromDiscord<SeanOMik> Thanks
21:07:30sschwarzerbung: Do you know the RFC for the `func` topic with refs?
21:07:35FromDiscord<Yardanico> guys go hop on discord voice chat πŸ™‚
21:07:38qn68hSkaruts, py2exe just packs everything, but it's still there
21:07:40leorize!rfc func
21:07:40FromDiscord<Yardanico> for "afterparty"
21:07:40disbothttps://github.com/nim-lang/RFCs/issues/234 -- 3Add write-tracking to Nim's func 7& 17 more...
21:07:46leorizesschwarzer: ^
21:07:49FromDiscord<Skaruts> ah!
21:08:04sschwarzerSkaruts: As far as I know, py2exe just puts the interpreter into the package.
21:08:10sschwarzerleorize: Thanks!
21:08:11qn68hsschwarzer, exactly
21:08:15leorizeglorified 7zsfx? :P
21:08:18bungyeah that's one,thanks, I dont have good memory.
21:08:21qn68hsame for cx_freeze, pyinstaller, etc.
21:08:59qn68hdo you think that exists? a AOT-compiled version of Python, that doesn't require the interpreter at the end?
21:09:18qn68hlike C or C++ or nim but with exactly the same syntax of python + type defs
21:09:25FromDiscord<Skaruts> I never found one...
21:09:37FromDiscord<Skaruts> well... I found Nim πŸ˜„
21:09:40sschwarzerleorize: Wow, interesting
21:09:47qn68hNim seems the closest, right?
21:09:57sschwarzerAnd regarding Jython, it's still on Python 2.7
21:10:03FromDiscord<Skaruts> as far as I've seen, yea
21:10:14qn68hwould it technically possible to do a "dialect" of nim, that uses the exact same API than python?
21:10:49qn68hi.e. print() instead of echo, import json; json.dumps({"key":"value"}) , class A(ParentClass): ...
21:10:59FromDiscord<KingDarBoja> I was being sarcastic, hence the italic text
21:10:59sschwarzerqn68h: Tricky, because Python _can_ do some things that Nim can't.
21:11:00FromDiscord<Skaruts> I suppose, I mean, you can this: https://forum.nim-lang.org/t/5758
21:11:00FromDiscord<lqdev> totally yeah
21:11:02FromDiscord<Skaruts> πŸ˜„
21:11:03Yardanicoqn68h: yeah
21:11:05Yardanicothere was py2nim
21:11:33FromDiscord<Shucks> > i.e. print() instead of echo, import json; json.dumps({"key":"value"}) , class A(ParentClass): ...↡@qn68h[IRC]#0000 https://github.com/Yardanico/nimpylib
21:11:35leorizeqn68h: I'd recommend that you not try to write Nim like you write python
21:11:37sschwarzerAlso, the handling of unicode is totally different.
21:11:41Yardaniconimpylib isn't the complete solution
21:11:48leorizeeverything here look similar but is completely different
21:11:49sschwarzerleorize: Yep!
21:11:50Yardanicohttps://github.com/metacraft-labs/py2nim_deprecated would be the one
21:11:56Yardanicomy nimpylib is kinda meh :D
21:12:18FromDiscord<Shucks> well I didnt tried it but looks like coding python in nim?.. i guess
21:12:20zedeusis dsrw on here?
21:12:28leorize!seen dsrw
21:12:29dsrwYep
21:12:29disbotdsrw joined 12#nim 31 minutes ago and last spoke 712 weeks ago https://irclogs.nim-lang.org/25-03-2020.html#19:49:19
21:12:56zedeusah hey, I meant a repl for godot that you can access from the scene view
21:13:10zedeussomeone made one for Unity way back but I can't find it now
21:13:19dsrwI definitely plan to add a repl.
21:13:34sschwarzerWrite Python in Python and Nim in Nim. They're quite different languages dispite the superficial similarities. At least that's my take as a long-time Python developer who started to look into Nim a year ago. (I was about to write "some months", but it's so long ago already)
21:13:35dsrwWith nim though of course. Not gdscript.
21:13:44sschwarzer*despite
21:15:06zedeussweet
21:15:17qn68hsschwarzer, yes that's true, i observed the same thing along the years
21:15:47qn68hbut still after decades of coding in more than 10 or 15 lang i think, i really found python has the perfect syntax
21:15:51dsrwAnd repl breakpoints for scripts. When ruby on rails first came out there wasn't a good ruby debugger, so they had a "breakpoint" function that would bring up a repl with the current stack frame in scope. I really liked it. Probably more than a proper debugger honestly.
21:16:11sschwarzerActually I enjoy the non-Python-like parts a lot, or at least many of them :)
21:16:22*waleee-cl joined #nim
21:16:44qn68hsschwarzer, just an example:
21:16:44leorizeqn68h: just try something new for a bit :P
21:16:54sschwarzerqn68h: Yes, I'm fine with the Python syntax :-) I don't know if perfect, but quite good.
21:17:14qn68hin how many lang can you do this so easily? : print([len(word) for w in sorted(words) if "hello" in w])
21:18:01qn68hleorize, definitely, i will try it! btw sorry for maybe sounding whining "why is it not exactly like python ;)" i apologize for that!
21:18:02FromDiscord<willyboar> We gonna have a hackathon?????
21:18:14*solitudesf quit (Ping timeout: 240 seconds)
21:18:16leorizeI'd rewrite that in Nim for you if I can understand that python snippet :P
21:18:29sschwarzerleorize: That actually was my motivation. I've been using Python for 20 years and wanted to learn something new. The irony is before I learned Python, I learned a new language on average every two years. But Python is so flexible that you can use it for almost anything. :-)
21:18:52*Zectbumo joined #nim
21:18:54qn68hsschwarzer, same for me
21:19:20sschwarzerBut then I wanted something with static typing and faster. ;-)
21:19:37zedeusdsrw: here's one for some inspiration https://github.com/hecomi/uREPL
21:19:41FromDiscord<willyboar> Open a hackathon channel
21:19:50leorizewe have a hackathon?
21:20:00sschwarzerIronically, I got a hint to look at Nim in a talk on asyncio in Python. :-)
21:20:01FromDiscord<Yardanico> I think we had a forum thread, no?
21:20:08dsrwzedeus: Nice. Thanks a lot. Checking it out now.
21:21:18FromDiscord<willyboar> Yeap. I opened it. But was for a hackathon in parallel with conf
21:21:37FromDiscord<Yardanico> well you can always do it separately
21:21:45FromDiscord<Yardanico> the idea with small showcasing of libraries seems cool
21:21:47sschwarzerBy the way, just noticed it should be `len(w)`, not `len(word)`. ;-)
21:22:38sschwarzerSorry, for nitpicking. I don't know why I'm even writing this. ;-/
21:22:50FromDiscord<willyboar> The idea is to create an MVP in 2-3 days
21:23:00FromDiscord<willyboar> Like lurum something....
21:23:03FromDiscord<Yardanico> @KingDarBoja https://github.com/nim-lang/Nim/wiki/Curated-Packages
21:23:19Araqgood night!
21:23:25FromDiscord<Yardanico> good night πŸ™‚
21:23:39FromDiscord<willyboar> Curated pages is nice but as I stayed before we must re activate awesome nim
21:24:04FromDiscord<willyboar> Mobile auto corrector sucks
21:24:13FromDiscord<Yardanico> ah wait
21:24:14FromDiscord<Yardanico> I sent wrong link
21:24:19leorizesschwarzer: well it does help me to write a one liner for that in Nim: import algorithm, sugar; echo collect(for w in words.sorted: (if "hello" in w: w.len))
21:24:25FromDiscord<Yardanico> @KingDarBoja I meant https://github.com/nim-lang/Nim/wiki/Companies-using-Nim
21:25:11qn68hsschwarzer, haha you're right
21:25:17FromDiscord<Reki> https://github.com/alehander92/comprehension
21:25:23FromDiscord<KingDarBoja> Thank you @Yardanico
21:25:36leorizesugar.collect superseded that one @Reki
21:25:43FromDiscord<Reki> ah
21:25:47qn68hleorize, nice indeed!
21:27:08FromDiscord<UnnoTed> does the nim compiler runs on a raspberry pi?
21:27:26leorizeyes it does
21:28:14FromDiscord<djazz> Yes
21:28:38FromDiscord<mratsim> I regularly run Nim on Rpi
21:29:01FromDiscord<mratsim> and on Andoird phones
21:29:29FromDiscord<mratsim> we test that regularly at Status because we target mobile and ARM
21:30:35*Tyresc joined #nim
21:31:52FromDiscord<l1pz> I made my first full-fledged project in Nim, after finishing the Nim in action book and I feel like I need some advice. Can someone who is experienced take a look at my code and make some suggestions? I was programming mainly in C++ before, also used some Python and JavaScript. Here's the repo for the project: https://github.com/l1pz/chandl/. I've worked on this 100 lines of code for the last 12 hours, obviously not continuously and I feel l
21:32:26leorizeYardanico: ^ crossed irc limits :P
21:32:37Yardanicowait wat
21:32:37Yardanicohow
21:32:51Yardanicoleorize: it ends as "feel like I've learned a lot about Nim."
21:34:04sschwarzerBye everyone! :-)
21:34:05leorize@l1pz your code is pretty decent :)
21:34:14*sschwarzer quit (Quit: leaving)
21:35:19FromDiscord<Yardanico> https://nim-lang-cn.org/
21:35:27FromDiscord<l1pz> "crossed irc limits :P". You mean I shouldn't have sent it here?
21:35:29leorize@l1pz you're not closing the HttpClient you opened
21:35:54leorizeit's just something to tell Yardanico to fix :P
21:36:12leorizehis bot is not aware of the IRC message length limit
21:36:41FromDiscord<Skaruts> Defied the Laws of IRC
21:36:44FromDiscord<l1pz> I see. About not closing HttpClient, so that's why I have high ram usage
21:37:00FromDiscord<l1pz> I mean like 30-40mb
21:37:10FromDiscord<l1pz> Which is quite a lot for a program like this I think
21:37:19leorizefor your download proc, just close(downloader) at the end
21:37:27leorizeput it in a defer just to be sure
21:37:32bungdont know why not just `var bar = newProgressBar`
21:38:08leorizeyou should also avoid `auto` return type
21:38:25leorizeit's nice for prototyping, but it usually helps with documentation when the return type is documented
21:38:49FromDiscord<Elegant Beef> Is auto type inference based off what you set result equal to?
21:39:01leorizeyep
21:39:07FromDiscord<Elegant Beef> Ah that's scary then
21:39:19FromDiscord<l1pz> I copied that from Nim's source code
21:39:33FromDiscord<l1pz> It's the modified version of the all() proc
21:40:19leorizean another reason why your program is using so much ram is due to the excessive memory allocation from the usage of sequtils
21:40:21FromDiscord<l1pz> bung, because that way I couldn't have passed it to the checkDownloads proc
21:40:49FromDiscord<Yardanico> https://github.com/nim-lang-cn/
21:41:24FromDiscord<Elegant Beef> yard i assume you're dropping links for voice chat?
21:41:33FromDiscord<Elegant Beef> If so, just make a discord only #voice-chat
21:41:57leorize@l1pz you can optimize this a bit by making `checkDownloads` apply to one `Future[void]`
21:42:24leorizeso basically you get a `Future[void]` from `download` then `checkDownload()` on it directly before you move it into the seq
21:42:54leorizewait actually, I'm not reading this correctly :P
21:43:10leorizeah, I see why you're doing it this way
21:43:20FromDiscord<Yardanico> https://www.youtube.com/playlist?list=PLXIivpcMlfwAevvA4IvLIiYOujqSuyyKY
21:43:21FromDiscord<Elegant Beef> i'd also say the use of the "word" `chandl` is quite weird
21:43:24FromDiscord<l1pz> Asynchronous programming is really new to me
21:43:26FromDiscord<Elegant Beef> I have no clue what chandl is πŸ˜„
21:43:39leorizeYardanico: libman has been banned from the forum iirc
21:43:42bungyou can new it and pass it.addr or checkDownloads accept var ProgressBar
21:43:43FromDiscord<l1pz> First it was 4chandl
21:43:44Yardanicoleorize: oh lol
21:43:51FromDiscord<l1pz> But it was not a valid package name
21:44:04FromDiscord<l1pz> Because it stared with a number
21:44:06FromDiscord<Elegant Beef> fourchandownload πŸ˜›
21:44:11FromDiscord<Yardanico> f4chandl
21:44:25FromDiscord<Elegant Beef> Im talking about the proc name btw
21:44:32FromDiscord<Elegant Beef> i dont care about the package name
21:45:05FromDiscord<Elegant Beef> download4Chan
21:45:11FromDiscord<Yardanico> lol
21:45:12FromDiscord<Elegant Beef> There we did it readabilliity!
21:45:27FromDiscord<dom96> @l1pz nice, some suggestions. Change `auto` to `Future[void]`. Don't write `ref ProgressBar` everywhere, define it in a type section: `type\n ProgressBar = ref object ...`
21:45:56FromDiscord<l1pz> ProgressBar is from a library called progress
21:46:06FromDiscord<Elegant Beef> That doesnt matter
21:46:12FromDiscord<Elegant Beef> You can make a reference of anytype
21:46:15FromDiscord<Elegant Beef> any type*
21:46:27FromDiscord<l1pz> type ProgressBar = ref ProgresBar
21:46:51FromDiscord<Elegant Beef> RProgressBar
21:46:57FromDiscord<Elegant Beef> We can do hungarian notation πŸ˜›
21:47:01*testnimnoob joined #nim
21:47:04FromDiscord<Yardanico> BarProgressR
21:47:08FromDiscord<Yardanico> XD
21:47:28FromDiscord<dom96> nooo
21:47:31testnimnoobis vscode the current editor with most useful plugins ?
21:47:31FromDiscord<dom96> ProgressBarRef
21:47:35FromDiscord<Elegant Beef> All the cool kids are in voice πŸ˜„
21:47:35FromDiscord<dom96> is the convention IIRC
21:47:42FromDiscord<Elegant Beef> Yea no clue convention there
21:47:45leorizeProgressBar = ref progress.ProgressBar
21:47:48leorizeeasy
21:47:48FromDiscord<Elegant Beef> Vscode is probably the easiest to use
21:48:18FromDiscord<Elegant Beef> Using qualiifications ...
21:48:24leorizetestnimnoob: if you use neovim, nim.nvim is on par with vscode
21:48:39testnimnooblol guess im using neovim
21:48:41FromDiscord<Elegant Beef> I am kidding in this case that's completely fine!
21:49:00FromDiscord<KingDarBoja> Join us @Elegant Beef
21:49:09FromDiscord<KingDarBoja> Join the dark side
21:49:17leorizetestnimnoob: keep in mind that I'm super biased since I wrote it :P
21:49:24testnimnooboh
21:49:26FromDiscord<Yardanico> https://github.com/nim-lang/Nim/commit/10bd488daafa79f52fec0d5e7ea76ec8d5902465
21:49:33testnimnoobhehe ive never used neovim
21:49:37testnimnooblemme install
21:49:45leorizebut I do have many happy users :P
21:49:54leorize!repo alaviss/nim.nvim
21:49:54disbothttps://github.com/alaviss/nim.nvim -- 9nim.nvim: 11Nim plugin for NeoVim 15 83⭐ 11🍴
21:49:58leorizethere's a small demo in there
21:50:36FromDiscord<19> https://github.com/mystor/slag
21:50:50FromDiscord<19> this is the rust version of 'syntax skins'
21:50:55FromDiscord<l1pz> I tried learning vim a few times, but I always forgot the function of the buttons. So I spent most of my time in insert mode, navigating the arrows.
21:51:00testnimnooblol fish also
21:51:05testnimnooblemme install that too
21:51:11FromDiscord<Lantos> sent a code paste, see https://discordapp.com/channels/371759389889003530/371759389889003532/724018533729697923
21:51:12testnimnoobim learning so much
21:51:16FromDiscord<Yardanico> @19 well you can do the same in Nim
21:51:18FromDiscord<Lantos> (edit)
21:51:19FromDiscord<Yardanico> as a preprocessor if you want
21:51:31FromDiscord<19> @l1pz play VimTutor everyday
21:51:35FromDiscord<Yardanico> just copy the old syntax skins tokenizer and make it standalone πŸ˜„
21:51:53FromDiscord<Yardanico> https://github.com/nim-lang/Nim/blob/10bd488daafa79f52fec0d5e7ea76ec8d5902465/tests/parser/tbraces.nim
21:52:05FromDiscord<19> thats a great idea, but i love the py syntax :D its just for ppl who dont :D
21:52:16leorize@Yardanico you do know you have #discord-only channel, right? :P
21:52:46FromDiscord<KingDarBoja> _why use braces, why not parenthesis like-lisp_
21:52:54testnimnoob@l1pz vim is awesome
21:53:03Yardanicoleorize: yeah
21:53:05testnimnoobi thought people were wizards when i first saw them use it
21:53:12Yardanico@KingDarBoja you already kinda can
21:53:23FromDiscord<l1pz> I know. I watched a lot of videos about it, I really want learn it some day.
21:53:57testnimnoobit's not too bad idk it felt natural
21:53:59leorizeyou won't start out with vim doing magic editing keystrokes :P
21:54:09FromDiscord<willyboar> There is a nim similar to vim editor
21:54:11FromDiscord<willyboar> Mor
21:54:18FromDiscord<willyboar> Moe
21:54:18leorize!repo moe
21:54:20disbothttps://github.com/fox0430/moe -- 9moe: 11Command line based editor. Written in Nim. 15 132⭐ 11🍴 7& 2 more...
21:54:30Yardanicothere's also paravim
21:54:36leorize!repo paravim
21:54:37disbothttps://github.com/paranim/paravim -- 9paravim: 11A Vim-based editor for Nim 15 66⭐ 2🍴
21:55:10FromDiscord<willyboar> I think Moe is not vim based but vim inspired
21:55:12testnimnoobit looks like vim leorize
21:55:13leorize!repo vim_cubed
21:55:14disbothttps://github.com/oakes/vim_cubed -- 9vim_cubed: 11Vim rendered on a cube for no reason 15 2231⭐ 34🍴
21:55:17FromDiscord<willyboar> I am not sure
21:55:19leorize^ best editor, fight me
21:55:48leorizetestnimnoob: well it's a vim fork :P
21:55:55leorizehas more features though
21:56:38FromDiscord<l1pz> You mean vim has more features?
21:56:44FromDiscord<l1pz> Or moe?
21:56:45FromDiscord<willyboar> But Moe don't support nimlsp yet
21:58:08FromDiscord<willyboar> !last disruptek
21:58:09disbotdisruptek spoke in 12#nim-news 6 hours ago
21:58:59*qn68h left #nim ("Leaving")
22:02:28FromDiscord<l1pz> I tried runnig my program again, I got an "SSL routines:SSL_shutdown:shutdown while in init [SslError]" exception. I ran it twice again, it ran successfully both times. I don't really understand this.
22:02:44FromDiscord<l1pz> It was with the same link.
22:02:52zedeuswhat version
22:03:19FromDiscord<l1pz> Nim version?
22:03:21zedeusyea
22:03:33FromDiscord<l1pz> 1.2.0
22:03:45zedeusupdate to 1.2.2, it has been fixed
22:03:48leorizeI fixed that in devel
22:03:52leorizeit's not backported
22:03:55zedeusit is
22:04:16leorizeit's kind of a breaking change
22:04:20zedeusI'm certain I saw it..
22:04:34leorizenope :P
22:05:00leorizeit's a breaking change but doesn't fit the security bill to justify a backport I guess
22:05:00zedeusI guess I just glanced over it, it's just dom's dynamic loading fix
22:05:27zedeusoh well, people will just have to deal with their program randomly crashing if they wanna use httpclient then :)
22:06:05leorizewell it's not that random...
22:06:28zedeusfor me it was, but I'm sure you can trigger it
22:06:47leorizeyou should've reported it lol
22:06:54zedeusit was recorded years ago
22:06:59zedeusreported*
22:07:12leorizeoh?
22:07:25leorizeI only noticed it when Avatarfighter was having some trouble writing a scraper
22:07:31zedeusI commented on the issue here https://github.com/nim-lang/Nim/issues/9867#issuecomment-610323411
22:07:32disbotβž₯ Long-lived application occasionally dies with SIG_PIPE when calling httpclient.request ; snippet at 12https://play.nim-lang.org/#ix=2aMk
22:07:52zedeusthe issue itself is about another error, but the things you fixed were discussed as well
22:08:17leorizemaybe that one is also fixed now :p
22:08:19*neceve_ quit (Ping timeout: 258 seconds)
22:08:57leorizeit appears to revolve around the usage of SSL_shutdown, which I fixed
22:09:01leorizeso... probably working?
22:09:07zedeusprobably, yeah
22:09:28zedeusI haven't had any crashes since but it got to a point where it almost never happened anyway
22:11:14*someunknownuser quit (Quit: someunknownuser)
22:14:15testnimnoobleorize "E216: No such group or event: TextChangedP *.nim if (!exists('SessionLoad') || !SessionLoad) && !empty(nim#suggest#ProjectFindOrStart()) | call nim#suggest#highlight#HighlightBuffer() | endifPress ENTER or type command to continue"
22:14:32testnimnoobis it because my nim for this project is too old ?
22:14:34leorizeneovim >= 0.4.3?
22:15:15leorizeyour neovim might be too old :P
22:16:00testnimnoobNVIM v0.2.2
22:16:05*dchem quit (Ping timeout: 246 seconds)
22:16:25leorizedamn, that's olddddd
22:16:35leorizeare you on centos or smt?
22:18:25leorizeif you're on ubuntu lts, they have a ppa: https://github.com/neovim/neovim/wiki/Installing-Neovim#ubuntu
22:19:08*sentreen quit (Ping timeout: 256 seconds)
22:20:23testnimnoobkde neon lol
22:20:42leorizeso basically kubuntu lts
22:20:49leorizeyea you will want that ppa :P
22:21:59FromDiscord<--HA--> Is there a find or similar for sequences that returns the index of the element?
22:22:14leorizeyes, and in fact, the proc is called `find()`
22:22:59FromDiscord<--HA--> I can't find it in the docs
22:23:59leorizeit's in the system module
22:24:07leorizethe doc search is funky at times though
22:24:09leorize~theinde
22:24:09disbotno footnotes for `theinde`. πŸ™
22:24:11leorize~theindex
22:24:11disbotno footnotes for `theindex`. πŸ™
22:24:16leorize~index
22:24:16disbotno footnotes for `index`. πŸ™
22:24:40zedeus~index is https://nim-lang.org/docs/theindex.html
22:24:40disbotindex: 11https://nim-lang.org/docs/theindex.html
22:24:44*hecanjog quit (Ping timeout: 256 seconds)
22:24:57*vicfred joined #nim
22:25:18leorize@--HA-- https://nim-lang.org/docs/system.html#find%2CT%2CS
22:25:25leorizethis is probably why you couldn't find it :P
22:26:01*nikita` quit (Quit: leaving)
22:26:38*hecanjog joined #nim
22:26:45FromDiscord<--HA--> Thanks
22:28:36leorizenimconf does bought a decent amount of people into #nim, which is pretty nice :)
22:28:46leorizebring*
22:30:45FromDiscord<willyboar> Except that it was an inspiration for current nimers
22:31:35testnimnoobyay it works
22:31:42testnimnoobty !
22:31:50leorizenp :)
22:32:35FromDiscord<--HA--> Hm I'm looking for something more like filter where I can give the criteria to be met and then I get the index of the first element that matches
22:32:47*sentreen joined #nim
22:33:23testnimnoobpretty noob friendly plugin so far leorize. i dont know jack about programming lol
22:34:02leorizeI wrote that plugin to be as foolproof as possible :P
22:34:20leorizeglad that it's working well there
22:34:36leorize@--HA-- well I guess you'll have to make one yourself
22:36:22FromDiscord<--HA--> Ok. Just didn't want to miss an existing one. And since filter and any and so on exist I thought so might a filter with a proc.
22:36:42FromDiscord<--HA--> *find sorry
22:37:39leorizeyou can write one and contribute it :)
22:37:56leorizehttps://play.nim-lang.org/#ix=2pHZ
22:38:02leorize^ that's how you'd write one
22:42:39*synshroud_ joined #nim
22:43:46FromDiscord<l1pz> There should be something like this in the standard library. Like C++'s find_if
22:44:26*vsantana_ joined #nim
22:44:29leorizeit's not in because no one find the interest to contribute one :P
22:45:08leorizeyou can refine the code I wrote above and turn it into a PR, I'm sure it'll get added
22:45:13*synshroud quit (Ping timeout: 256 seconds)
22:46:23FromDiscord<l1pz> Which module would be the right place? sequtils?
22:46:32FromDiscord<--HA--> I think it needs to return earlier. For that test sequence I would have expected an index of 3 but it keeps going after the first success.↡I was expecting behaviour more like this https://play.nim-lang.org/#ix=2pI2
22:46:36leorizeyep
22:47:03*vsantana quit (Ping timeout: 260 seconds)
22:47:13leorizemy bad, forgot the break
22:47:19leorizeand the -1 for not found :P
22:50:20FromDiscord<--HA--> That's pretty cool. Never did anything with templates or macros. I have a lot to read and learn.
22:52:07FromDiscord<juan_carlos> I can not use Fidget Figma Plugin from the Web browser?, I think not just to be sure.
22:52:33leorizeyep, Nim syntax flexibility and templates make this kind of thing really easy to do
22:53:01*tane joined #nim
22:54:41FromDiscord<Yardanico> https://forum.my-toolbox.xyz/
22:57:21FromDiscord<l1pz> I made the find function more similar to filter in structure. https://play.nim-lang.org/#ix=2pI6
22:58:02leorizeyou can just call it `find()` :P
22:58:21leorizewe usually provide an `It` version which uses template
22:58:31leorizeit's faster than using a closure and the syntax is handy too
22:59:22FromDiscord<l1pz> I see. I C++ find returns the element itself, which fullfils the criteria. That's why findIf is separate
22:59:58FromDiscord<l1pz> But we could name it search
23:00:04FromDiscord<l1pz> Or something
23:00:09leorizesure
23:00:21leorizeas long as the If part is not there I'm fine :P
23:00:37leorize(just for consistency with the APIs in sequtils)
23:00:41FromDiscord<l1pz> Also how would one submit this to Nim? Do I need to write some tests, documentation? Making a ticket, which addresses this issue, thank referencing that when making a PR?
23:00:55FromDiscord<l1pz> I've never really contributed to an open source project...
23:01:05leorizeyep, tests and documentation
23:01:25leorizeso you basically fork the repo, make a branch, commit your changes, then open a PR
23:01:45FromDiscord<l1pz> Thanks. I'll look into it tomorrow.
23:02:25leorize~nep1
23:02:26disbotnep1: 11https://nim-lang.org/docs/nep1.html
23:02:34leorize^ refer to that for the code styling
23:02:36leorize~apis
23:02:37disbotno footnotes for `apis`. πŸ™
23:02:40leorize~api
23:02:41disbotapi: 11https://nim-lang.org/docs/theindex.html
23:02:45Yardaniconot this one disbot
23:02:58leorize~apis is https://nim-lang.org/docs/apis.html
23:02:59disbotapis: 11https://nim-lang.org/docs/apis.html
23:03:00Yardanicoyeah
23:03:02Yardanico~apis
23:03:03disbotapis: 11https://nim-lang.org/docs/apis.html
23:03:03leorize^ that one for api naming
23:03:24FromDiscord<willyboar> disbot: are you high right now?
23:03:28Yardanicohe's low
23:03:37FromDiscord<willyboar> Yeap
23:03:49FromDiscord<willyboar> Where is disruptek today?
23:04:19FromDiscord<willyboar> He missed all the goodies
23:04:24FromDiscord<Yardanico> Overall amazing day today, thanks guys, I enjoyed the conf and voice chat a lot
23:05:36FromDiscord<willyboar> I think everyone enjoy it
23:06:15FromDiscord<Elegant Beef> Psh i cleary was the reason the voice chat was popular, when i left everyone did πŸ˜›
23:06:41FromDiscord<willyboar> This is true
23:07:03FromDiscord<Elegant Beef> ~~It was not that everyone else was muted~~
23:07:18FromDiscord<willyboar> Nah
23:07:42FromDiscord<Yardanico> There's one thing we need to remember
23:07:45FromDiscord<Yardanico> https://i.imgur.com/wSvP4O2.png
23:08:15FromDiscord<exelotl> wow that's beautiful
23:08:25FromDiscord<Elegant Beef> I could've been 11 if it wasnt for being hosted at 4am
23:08:34FromDiscord<willyboar> Araq spamming?
23:08:38FromDiscord<Yardanico> Yes
23:08:39FromDiscord<Vindaar> pff, I'm gone for a few minutes and suddenly I'm alone πŸ˜›
23:08:51FromDiscord<Yardanico> @willyboar don't tell anyone
23:09:17FromDiscord<willyboar> Of course not
23:16:22*exelotl quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
23:19:15FromDiscord<KingDarBoja> I wasn't there lol
23:19:22FromDiscord<KingDarBoja> Only on voice chat
23:29:22*arecaceae quit (Remote host closed the connection)
23:29:46*arecaceae joined #nim
23:39:28FromDiscord<l1pz> There is typo in documentation
23:41:15FromDiscord<l1pz> On template filterIt, See also: fliter proc, instead of filter
23:41:43FromDiscord<l1pz> iterator filter has it too
23:42:27FromDiscord<--HA--> That might be auto generated from source code comments and you can fix it with a PR I'm guessing.
23:43:26FromDiscord<Elegant Beef> Yep go make a PR for all the spelling mistakes!
23:43:28FromDiscord<l1pz> Yeah, I was browsing the source code, and saw it. Checked on the docs, you can see it there too
23:43:30FromDiscord<Elegant Beef> There's a fair bit of them
23:43:44FromDiscord<juan_carlos> That explains a lot 😭 https://github.com/Figma-Linux/figma-linux/issues/53#issuecomment-603326060
23:43:45disbotβž₯ Plan on supporting plugin creation through linux client
23:52:56*tane quit (Quit: Leaving)