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:19 | leorize | Prestige: I think you asked this like 3 times now :P |
01:35:57 | FromDiscord | <Elegant Beef> You know what they say "Like three times is the charm" |
01:51:06 | Prestige | Yeah what the heck |
01:52:27 | FromDiscord | <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:19 | Prestige | Not sure what you mean - iterate over the seq and remove them? |
01:53:22 | FromDiscord | <Elegant Beef> There is a filter proc |
01:53:47 | FromDiscord | <Elegant Beef> and also a keepIf |
01:54:36 | FromDiscord | <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:44 | FromDiscord | <Elegant Beef> here |
01:55:01 | * | chemist69 joined #nim |
01:55:45 | FromDiscord | <codic> ? |
01:55:52 | FromDiscord | <Elegant Beef> sorry writting it |
01:55:57 | FromDiscord | <Elegant Beef> meant to say here i'll write it π |
01:56:44 | FromDiscord | <Elegant Beef> https://play.nim-lang.org/#ix=2pDe |
01:57:09 | FromDiscord | <Elegant Beef> there is also filter which works similarly |
01:57:19 | FromDiscord | <Elegant Beef> filter returns a seq |
01:57:44 | FromDiscord | <Rika> Huh there's a keep if proc |
01:57:58 | FromDiscord | <Elegant Beef> https://play.nim-lang.org/#ix=2pDf the filter proc |
01:58:13 | FromDiscord | <Elegant Beef> Yea didnt know either of these existed prior π |
01:58:19 | FromDiscord | <codic> ah okay, thanks |
01:58:23 | FromDiscord | <codic> the filter looks like just what i want! |
01:58:29 | FromDiscord | <Elegant Beef> Both are π |
01:58:32 | FromDiscord | <Rika> I knew of filter |
01:58:37 | FromDiscord | <Elegant Beef> One just requires a copy π |
01:59:09 | FromDiscord | <Elegant Beef> fuck there is also an apply |
01:59:12 | FromDiscord | <Elegant Beef> That's wild |
01:59:14 | FromDiscord | <codic> Β―\_(γ)_/Β― |
01:59:24 | FromDiscord | <Elegant Beef> It runs the proc for each entity |
01:59:35 | FromDiscord | <Elegant Beef> no more for loops! |
02:00:07 | FromDiscord | <Elegant Beef> Definetly worth reading to completionβ΅https://nim-lang.org/docs/sequtils.html |
02:00:26 | FromDiscord | <codic> this could be quite useful eyah |
02:00:28 | FromDiscord | <codic> (edit) 'eyah' => 'yeah' |
02:04:22 | FromDiscord | <Rika> Local beef discovers functional programming constructs |
02:04:53 | FromDiscord | <Elegant Beef> Indeed |
02:07:58 | FromDiscord | <Rika> Maybe I should start programming in fp style |
02:13:18 | * | endragor quit (Remote host closed the connection) |
02:20:59 | FromDiscord | <Isomorpheus> just installed via apt. how can I get nimprettier |
02:21:26 | FromDiscord | <Isomorpheus> err nimpretty |
02:23:14 | FromDiscord | <Yardanico> If you installed with apt your Nim is probably outdated |
02:23:22 | FromDiscord | <Yardanico> Check nim -v |
02:23:42 | FromDiscord | <Isomorpheus> 1.0.6 |
02:23:45 | FromDiscord | <Isomorpheus> should I use choosenim? |
02:24:47 | FromDiscord | <Yardanico> Well yeah |
02:24:58 | FromDiscord | <Yardanico> It'll also install stuff like nimpretty |
02:25:18 | FromDiscord | <Isomorpheus> k. how do you update with this tool |
02:34:01 | * | unknown__ quit (Quit: Leaving) |
02:35:11 | * | vicfred joined #nim |
02:37:58 | Prestige | Are 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:45 | FromDiscord | <impbox> I've used it a bunch, works fine, but I'll try make you an example |
02:40:48 | Prestige | I'll share mine in a sec too |
02:42:16 | Prestige | https://play.nim-lang.org/#ix=2pDo |
02:42:47 | Prestige | no 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:30 | FromDiscord | <Isomorpheus> sent a code paste, see http://ix.io/2pDp |
02:45:13 | * | ftsf joined #nim |
02:46:37 | leorize | Prestige: why are you casting a ptr cuchar to cint? |
02:46:57 | Prestige | That's a good question |
02:47:25 | FromDiscord | <Rika> did you put the bins in the path envvar @Isomorpheus |
02:47:26 | Prestige | That was very likely the problem |
02:47:47 | * | surma quit (Ping timeout: 240 seconds) |
02:48:14 | FromDiscord | <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:19 | FromDiscord | <Isomorpheus> checking at the terminal |
02:48:22 | FromDiscord | <Isomorpheus> nim, nimble, and nimpretty all work |
02:48:25 | FromDiscord | <Isomorpheus> as commands |
02:48:32 | FromDiscord | <Rika> restart vscode π |
02:48:42 | FromDiscord | <Isomorpheus> >_> |
02:49:12 | FromDiscord | <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:45 | disruptek | ~gitnim |
03:46:46 | disbot | gitnim: 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:35 | FromDiscord | <SeanOMik> Is there some wiki that shows all the bitwise operators in Nim? |
05:19:00 | * | tefter joined #nim |
05:19:26 | FromDiscord | <Elegant Beef> https://nim-lang.org/docs/tut1.html#basic-types-integers |
05:21:24 | FromDiscord | <SeanOMik> Awesome, thanks |
05:27:19 | * | theelous3 quit (Ping timeout: 260 seconds) |
05:32:48 | * | theelous3 joined #nim |
05:44:10 | FromDiscord | <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:20 | FromDiscord | <Zed> is there an easy way to add a binary name output in nimble? |
06:36:40 | leorize | no, unfortunately |
06:36:47 | leorize | btw 2h before nimconf |
06:36:58 | leorize | oh 4h :P |
06:37:10 | FromDiscord | <Zed> lol |
06:37:18 | FromDiscord | <Zed> well that's a bummer |
06:37:36 | FromDiscord | <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:52 | Araq | Zed: there is --output that you can use within the .nimble file |
06:54:58 | Araq | or something like that |
06:57:21 | FromDiscord | <Zed> there's nothing in the docs for that |
06:57:32 | FromDiscord | <Zed> i know the compiler itself has that flag |
06:57:37 | FromDiscord | <Zed> but ot nimble |
06:57:40 | FromDiscord | <Zed> *not |
06:58:18 | solitudesf | you 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:56 | FromDiscord | <Zed> Prestige |
07:23:10 | FromDiscord | <Zed> That nim braces thing is working |
07:23:42 | FromDiscord | <Zed> there are some quirks to how i've implemented it which is annpying |
07:23:46 | FromDiscord | <Zed> *annoying |
07:26:04 | Araq | how did you implement it? |
07:26:27 | Araq | added a custom parser to the compiler? that's how I did it when #! braces still was a thing |
07:26:44 | FromDiscord | <Zed> nah more like a thing that parses the file |
07:26:44 | FromDiscord | <Rika> its a separate parser afaik |
07:26:48 | FromDiscord | <Zed> yeah |
07:26:49 | FromDiscord | <Rika> that emits regular nim code |
07:26:51 | FromDiscord | <Zed> im not that smart |
07:27:02 | FromDiscord | <Zed> https://github.com/Zed-Inc/nim_braces |
07:27:21 | Araq | it's still in Git's history |
07:27:54 | FromDiscord | <Zed> yeah i saw that the other day |
07:28:39 | FromDiscord | <Zed> is githubs nim syntax highlighting broken? |
07:29:31 | Prestige | Sweet Zed |
07:30:56 | FromDiscord | <Zed> note: it does not work on directories at the moment |
07:31:00 | FromDiscord | <Zed> only single files |
07:33:07 | Prestige | Exciting stuff, can't wait to start using it |
07:33:22 | Prestige | But i just switched my keyboard layout so I'm going to be programming very slowly lol |
07:34:29 | FromDiscord | <Zed> lol |
07:34:35 | FromDiscord | <Zed> what did you switch to? |
07:38:29 | FromGitter | <alehander92> Π΄ΡΡΡ |
07:38:36 | FromGitter | <alehander92> is nimconf ready |
07:39:51 | Prestige | The programmer dvorak layout @Zed |
07:40:04 | Prestige | But modified further since I have a weird board |
07:40:16 | FromDiscord | <Zed> ah yeah i've heard about that |
07:40:34 | FromDiscord | <Zed> do you find it more comortable |
07:41:01 | Prestige | Yeah, even though I just switched it feels nicer |
07:43:13 | FromDiscord | <Zed> say i wanted to switch, could i still use my qwerty layout but remapped? |
07:43:35 | FromDiscord | <Zed> or is it to different? |
07:45:03 | Prestige | Yeah you can use a normal board with remapped keys |
07:47:10 | FromDiscord | <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:22 | FromDiscord | <Shucks> not my text. But isn't he right? |
07:48:41 | FromDiscord | <Rika> transpiling is compiling |
07:49:17 | FromDiscord | <Rika> man this is the 172645871t53786175th time we've gone through this discussion |
07:49:35 | FromDiscord | <Rika> its always inconclusive because compilation and transpilation do not have a concrete definition that is the same in everyone's heads |
07:50:24 | FromDiscord | <Rika> @Shucks where's that from |
07:51:04 | FromDiscord | <Shucks> Some cheat forum where everyone uses cpp and I've came around with some nim code ;D |
07:51:26 | FromDiscord | <Rika> ask about what is wrong with the claim |
07:51:38 | FromDiscord | <Rika> because in my eyes, transpiling is under compiling |
07:52:13 | FromDiscord | <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:20 | FromDiscord | <Zed> transpiling is basically compiling i would say |
07:52:23 | FromDiscord | <Rika> when both of them are compiled to a VM's bytecode |
07:52:35 | FromDiscord | <Zed> ^ |
07:52:44 | FromDiscord | <djazz> A transpiler might transpile to the same language |
07:53:01 | FromDiscord | <Rika> nim doesnt do that im pretty sure |
07:53:04 | FromDiscord | <djazz> Like Babel in JS |
07:53:25 | FromDiscord | <Rika> ugh this is just word elitism or something i dont like this |
07:53:29 | FromDiscord | <Zed> lol, does that mean my braces thing is a transpiler from nim to nim |
07:53:33 | FromDiscord | <Rika> yes |
07:53:34 | FromDiscord | <djazz> Yes |
07:53:34 | FromDiscord | <Rika> kinda |
07:53:36 | FromDiscord | <Rika> i dont know |
07:53:38 | FromDiscord | <Rika> i wouldnt call it that |
07:53:42 | FromDiscord | <djazz> It _transforms_ nim code |
07:53:49 | narimiran | come on guys, it is too early for yet another transpiler vs compiler discussion |
07:53:50 | FromDiscord | <djazz> https://stackoverflow.com/a/44932758 |
07:54:02 | FromDiscord | <Rika> im tired of these discussions |
07:54:10 | FromDiscord | <Zed> can it be bumble bee |
07:54:20 | FromDiscord | <Zed> or is there a nim transformer? |
07:55:31 | FromDiscord | <Rika> try reading nim's emitted C code |
07:55:31 | FromDiscord | <djazz> Whats funny to me is that that is the first thingthe guy on the cheat forum notices about nim lol |
07:55:44 | FromDiscord | <Rika> if you can call that "readable by a human" i'd call asm readable by a human |
07:55:52 | FromDiscord | <Zed> he seems like my old teacher |
07:56:04 | FromDiscord | <Zed> big old school fanboy |
07:56:11 | FromDiscord | <Zed> the internet is useless |
07:56:35 | FromDiscord | <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:35 | FromDiscord | <djazz> Basically βbut if it βcompilesβ to c++, why not just write c++?β |
07:56:59 | Araq | but if C++ comples to asm why not just write asm. |
07:57:05 | FromDiscord | <djazz> Exactly |
07:57:15 | FromDiscord | <Zed> why not just write 1's and 0's |
07:57:17 | FromDiscord | <Zed> noobs |
07:57:30 | FromDiscord | <djazz> Punch cards bro |
07:57:37 | FromDiscord | <Rika> man why are we talking about some random fucker writing cheats whom we dont even know of |
07:58:00 | FromDiscord | <djazz> Yeah, lets talk about nim instead |
07:58:23 | Araq | there is a definition of what "transpile" means and Nim doesn't do it, simple as that. |
07:58:55 | Araq | the definition makes no sense but if you think "transpile" should be a word then well, there is a definition |
07:59:42 | FromDiscord | <Rika> the definition is too vague for me to consider a definition worthy of being in a dictionary |
07:59:48 | Araq | personally I don't see the point, there is already "translate", "interpret", "compile" and "JIT compile" |
08:00:21 | FromDiscord | <Rika> then the 2 said above, convert and transform |
08:00:39 | FromDiscord | <Zed> wouldn't convert and transform be the same thing |
08:01:03 | Araq | there 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:05 | FromDiscord | <Zed> they both manipulate the input to the same output |
08:01:09 | FromDiscord | <Rika> convert usually is the whole thing, transform can be just a portion |
08:01:13 | FromDiscord | <Zed> ah |
08:02:17 | FromDiscord | <Rika> what are yall workin on? |
08:02:35 | FromDiscord | <Shucks> Thank you guys. I see that `transpile, compile` thingy is a sensitive topic ;D |
08:02:53 | FromDiscord | <Rika> its super sensitive lol |
08:02:57 | FromDiscord | <Zed> *where not done yet boy* |
08:03:01 | FromDiscord | <Zed> :P |
08:03:03 | FromDiscord | <Rika> no we are done |
08:03:19 | FromDiscord | <Zed> lol |
08:03:48 | FromDiscord | <Zed> did you submit a talk rika? |
08:04:03 | FromDiscord | <Rika> nope, got nothing to talk about |
08:04:26 | FromDiscord | <Zed> What are you working on at the moment? |
08:04:33 | FromDiscord | <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:46 | FromDiscord | <Rika> i mean big as in popular, not literally large |
08:05:32 | FromDiscord | <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:44 | FromDiscord | <Zed> sounds good |
08:06:01 | FromDiscord | <Rika> its actually a rewrite of my old python code |
08:06:12 | FromDiscord | <Rika> its old (aka very shitty practices and horrible code) |
08:06:20 | FromDiscord | <Zed> your gonna have to do some speed tests |
08:06:38 | FromDiscord | <Rika> just thought of rewriting it since its not async and used threads (***in python***) |
08:07:03 | FromDiscord | <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:25 | FromDiscord | <Rika> @Zed its not gonna be noticeably faster since ehh its just a bot not many use |
08:07:34 | FromDiscord | <Rika> most latency is from the irc server itself |
08:07:47 | FromDiscord | <Shucks> a cli pbar library? |
08:07:49 | FromDiscord | <Rika> my nim implementation so far processes messages in a millisecond |
08:07:55 | FromDiscord | <Rika> @Shucks yup, it's called suru |
08:07:59 | FromDiscord | <Shucks> cool |
08:08:19 | FromDiscord | <Rika> i kinda put it aside for now since im working on this bot app |
08:08:28 | FromDiscord | <Rika> ill return to it though |
08:11:36 | * | dddddd joined #nim |
08:15:44 | Araq | bummer, after I wrote the functizer Clyybber came up with a better idea and now it's useless |
08:17:21 | FromDiscord | <Rika> what idea |
08:18:40 | Araq | https://github.com/nim-lang/RFCs/issues/234#issuecomment-646630694 |
08:18:41 | disbot | β₯ Add write-tracking to Nim's func ; snippet at 12https://play.nim-lang.org/#ix=2pg3 |
08:20:09 | FromDiscord | <Rika> what the fuck thats big brained |
08:27:52 | Araq | yeah, 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:10 | narimiran | 2 hours till the NimConf 2020! https://conf.nim-lang.org/ |
09:02:23 | narimiran | there is also #nimconf IRC channel |
09:02:41 | * | clemens3 joined #nim |
09:03:07 | narimiran | don'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:57 | Zevv | stupid 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:02 | Zevv | aka, are we synced? |
09:19:58 | planetis[m] | I just made a repost about nimconf in hacker news, please upvote |
09:21:06 | FromDiscord | <lqdev> Zevv: I think it's synced, at least according to YouTube's descriptions |
09:21:16 | * | tane joined #nim |
09:21:35 | FromDiscord | <lqdev> otherwise, what would be the point |
09:22:00 | narimiran | Zevv: we all start watching at the same time |
09:22:30 | narimiran | if 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:58 | narimiran | also, if you watch from the beginning, you'll see the live comments as they were written, e.g.: |
09:23:23 | narimiran | if i write a comment at 7th minute of the video, you'll see it when you come to 0:07, not before |
09:26:30 | FromDiscord | <dom96> Quite a nice feature from YouTube |
09:27:40 | * | oddp joined #nim |
09:45:12 | FromDiscord | <Zed> we've had alot of people join discord today |
09:45:55 | FromDiscord | <Rika> lol |
09:47:48 | FromDiscord | <Zed> im curious how many people are actually active on this server |
09:48:05 | FromDiscord | <Zed> i only ever see the same 10-15 people |
09:51:27 | FromDiscord | <Zed> also is all discussion happening on youtube for the conf? |
09:53:49 | narimiran | we cannot prevent the discussion happening elsewhere :P |
09:53:59 | narimiran | but yeah, discussing there would be the best |
09:54:24 | FromDiscord | <Zed> when the videos switch, is all discussion carried over? or does it start anew |
09:55:30 | FromDiscord | <Rika> anew i assume |
09:56:04 | narimiran | every video has its own discussion |
09:57:42 | * | greenfork joined #nim |
10:05:38 | FromDiscord | <--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:47 | Araq | yeah via --dynlibOverride:iconv and some -liconv flag |
10:40:23 | * | waleee-cl joined #nim |
10:42:14 | FromDiscord | <willyboar> Hello! I am readyyyy |
10:44:41 | FromDiscord | <--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:32 | Araq | it doesn't matter if its a dependency or not, --dynlibOverride is a general override mechanism |
10:54:06 | FromDiscord | <dom96> @everyone NimConf 2020 starting in 6 minutes. https://conf.nim-lang.org. This is your one and only notification about it. π |
10:54:22 | FromDiscord | <uniminin> what is this bro |
10:54:23 | FromDiscord | <Recruit_main707> #announcements :P |
10:54:32 | FromDiscord | <Zed> omg why the ping?? |
10:54:33 | FromDiscord | <Zed> lol |
10:54:36 | FromDiscord | <Zed> :P |
10:54:40 | FromDiscord | <Technisha Circuit> What's Nimconf? :P |
10:54:43 | FromDiscord | <KrispPurg> who cares lets enjoy this conf |
10:54:51 | FromDiscord | <Recruit_main707> a conference about nim |
10:55:08 | FromDiscord | <Zed> nim as in the ancient babel king who that programming language is named after |
10:55:17 | FromDiscord | <Synth> > What's Nimconf? :Pβ΅@Technisha Circuit You didn't know about it? ;-; |
10:55:22 | FromDiscord | <Recruit_main707> smh |
10:55:27 | FromDiscord | <aachh> Niiice, looking forward! |
10:55:28 | FromDiscord | <Technisha Circuit> No :P |
10:55:31 | FromDiscord | <Synth> ;-; |
10:55:40 | FromDiscord | <Luk> lel |
10:55:50 | FromDiscord | <Synth> codic said he might join |
10:56:02 | FromDiscord | <Luk> isnt that a big convention starting in 4 min |
10:56:15 | FromDiscord | <strexicious> POGGERS |
10:56:16 | FromDiscord | <KrispPurg> I was gonna join, but I was busy. |
10:56:23 | FromDiscord | <KrispPurg> nimchamp |
10:56:46 | FromDiscord | <KevinBlue18> nim conference |
10:56:55 | FromDiscord | <djazz> Online only |
10:57:06 | FromDiscord | <djazz> Can be watched later at any time |
10:57:46 | * | PMunch joined #nim |
11:00:31 | leorize | nimconf \o/ |
11:00:40 | leorize | wait why does it have a 2 mins counter at the start lol |
11:01:12 | PMunch | To make sure everyone has tuned in! |
11:01:13 | Prestige | UTC + 2 mins |
11:01:26 | Prestige | hi PMunch |
11:01:27 | PMunch | Nim Coordinated Time - NTC |
11:01:30 | PMunch | Prestige, hi |
11:01:32 | * | someunknownuser joined #nim |
11:02:12 | Prestige | I've converted to dvorak lol |
11:02:17 | PMunch | So apparently the timer is added by YouTube premieres |
11:02:24 | PMunch | Prestige, oh, how's that going? |
11:02:47 | Prestige | I love it |
11:02:59 | leorize | you can convert to colemak if dvorak mess up too many keybindings :P |
11:03:41 | Prestige | how do you like colemak? |
11:03:41 | PMunch | Prestige, nice! Loving it after only half a day of usage is pretty rare I think |
11:04:06 | leorize | colemak is awesome, I use a modded version though |
11:04:20 | Prestige | more like 15 mins of use haha |
11:04:24 | * | gangstacat quit (Remote host closed the connection) |
11:04:26 | * | akavel joined #nim |
11:04:33 | leorize | the downside is that if I want this keymap elsewhere I have to make it myself lol |
11:04:35 | * | kaletaa joined #nim |
11:04:51 | Prestige | I modified dvorak too |
11:05:42 | FromDiscord | <Avahe> https://media.discordapp.net/attachments/371759389889003532/723856092974547074/jpeg_1592648247000.jpg |
11:05:45 | PMunch | What modifications did you make? |
11:05:55 | leorize | ooooh, fancy keyboard |
11:06:43 | Prestige | maybe I can share a better map repr |
11:06:54 | Zevv | aw you dropped your keyboard |
11:06:56 | Zevv | shame |
11:07:01 | Prestige | lol |
11:07:38 | Prestige | layer 1: https://0x0.st/i4NP.png |
11:07:56 | FromDiscord | <Zed> nice |
11:08:28 | Prestige | shift layer: https://0x0.st/i4NZ.png |
11:10:27 | Prestige | have a couple other layers for things like f keys |
11:15:28 | * | ee7[m] joined #nim |
11:16:30 | * | sschwarzer joined #nim |
11:16:37 | sschwarzer | Hi :) |
11:16:48 | Prestige | Hey! |
11:17:29 | federico3 | hi |
11:24:48 | FromDiscord | <--HA--> Araq, some -liconv flag does that mean something like --passL:libiconv.so ? |
11:25:08 | leorize | --passL:-liconv <- that's what you should use |
11:26:46 | * | ftsf joined #nim |
11:28:11 | FromDiscord | <--HA--> Thanks! Using: --dynlibOverride:iconv --passL:-liconvβ΅I get: /usr/bin/ld: cannot find -liconv |
11:29:20 | leorize | looks like iconv is not in your linker search path |
11:32:55 | FromDiscord | <--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:06 | leorize | it 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:57 | alehander92_ | ooi |
11:39:59 | leorize | o/ |
11:40:08 | leorize | we are in #nimconf, come join us |
11:42:25 | FromDiscord | <--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:58 | leorize | I think glibc provides iconv, so maybe libc-dev? |
11:44:22 | * | lritter joined #nim |
11:46:32 | FromDiscord | <KrispPurg> βIs there a way to install Nim on windows using i686 cpu on choosenim? |
11:47:04 | leorize | ask dom96 :P |
11:47:26 | FromDiscord | <KrispPurg> okay |
11:50:44 | FromDiscord | <KrispPurg> do I just mention him? |
11:50:55 | * | dddddd quit (Ping timeout: 260 seconds) |
11:51:04 | leorize | I already did but he might not be on irc atm |
11:51:09 | leorize | @dom96 I guess |
11:51:35 | leorize | shashlick might know a thing or two about this, but they might not be online atm |
11:53:08 | * | vsantana joined #nim |
11:54:37 | shashlick | what's up - i'm up for the conf |
11:55:20 | shashlick | i 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:28 | shashlick | there's no force 32-bit flag yet |
11:55:54 | FromDiscord | <--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:08 | leorize | oh you're on musl libc |
11:56:23 | leorize | you need gnu libiconv installed |
11:56:43 | leorize | I'm not sure if Debian provides this |
11:59:01 | narimiran | the second NimConf is about to start, don't miss it: https://www.youtube.com/watch?v=czLI5XJFxYA&list=PLxLdEZg8DRwTIEzUpfaIcBqhsj09mLWHx&index=3 |
12:01:54 | leorize | read: second NimConf talk :P |
12:02:10 | PMunch | Haha |
12:03:19 | FromDiscord | <--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:24 | leorize | https://github.com/JuliaBinaryWrappers/Libiconv_jll.jl/releases |
12:04:37 | leorize | julia does provide prebuilt version of it if you would like to use them |
12:05:16 | FromDiscord | <l1pz> is there a way to setup defines in a nimble file? for example ssl |
12:05:33 | leorize | you can do so in a project configuration file |
12:05:48 | FromDiscord | <l1pz> in config.nims? |
12:05:52 | leorize | yep |
12:06:02 | * | supakeen quit (Quit: WeeChat 2.8) |
12:06:06 | leorize | though usually for best effect, use <project>.nim.cfg |
12:06:24 | leorize | <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:53 | FromDiscord | <l1pz> my project setup is like this |
12:08:56 | FromDiscord | <l1pz> sent a long message, see http://ix.io/2pFl |
12:09:24 | FromDiscord | <l1pz> i want to put the cfg file in the root of the project |
12:09:45 | FromDiscord | <l1pz> would that be okay? |
12:10:07 | FromDiscord | <l1pz> or is should i place in next to the source file? |
12:10:14 | FromDiscord | <l1pz> it* |
12:10:31 | FromDiscord | <l1pz> *or should i place it next to the source file |
12:10:35 | leorize | you should place it next to the source file |
12:11:02 | FromDiscord | <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:05 | FromDiscord | <l1pz> thanks* |
12:16:49 | FromDiscord | <--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:32 | leorize | use --passL:-L/path/to/folder/with/lib |
12:21:17 | leorize | also we have a handy --dynlibOverrideAll flag that can disable all dynamic loads |
12:22:53 | FromDiscord | <Technisha Circuit> How does Nim make the JS file for the JS backend? Compilation or Transpilation? Tryna prove a point |
12:23:10 | leorize | yes |
12:24:11 | FromDiscord | <Technisha Circuit> Does Nim use transpilation at all? For the C backends or the JS backend? |
12:24:23 | leorize | it's compilation but people will argue otherwise because the words are vague |
12:24:34 | FromDiscord | <Technisha Circuit> (My friend says Nim only does transpilation and that's Nim's selling point) |
12:24:36 | FromDiscord | <Technisha Circuit> Thank you |
12:24:46 | leorize | it depends on what you mean by transpilation |
12:25:03 | leorize | you can say C transpile to ASM and you wouldn't be wrong :P |
12:25:08 | * | vsantana joined #nim |
12:25:14 | leorize | the word is just flawed |
12:25:27 | FromDiscord | <Technisha Circuit> Okay then, thanks |
12:27:56 | stefantalpalaru | "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:14 | FromDiscord | <--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:31 | leorize | in 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:44 | FromDiscord | <--HA--> Maybe it is time for me to accept I don't know enough about what I'm doing to continue π |
12:29:55 | narimiran | the next talk is about to start, don't miss it: https://www.youtube.com/watch?v=Qa_9vut4TzQ&list=PLxLdEZg8DRwTIEzUpfaIcBqhsj09mLWHx&index=4 |
12:30:10 | leorize | @--HA-- --dynlibOverrideAll and --passL? |
12:35:13 | * | superbia quit (Quit: WeeChat 2.4) |
12:36:32 | FromDiscord | <--HA--> leorize, it looks like this https://pastebin.com/53iCtd0L |
12:39:01 | FromDiscord | <Shucks> woho inim |
12:39:07 | FromDiscord | <Shucks> no playground testing anymore ;D |
12:39:38 | leorize | @--HA-- I can see why this broke... |
12:39:38 | FromDiscord | <Pixeye> Game Boy Advanced I'M WAITING FOR YOU |
12:39:53 | leorize | it's an stdlib bug, can you report it on github? |
12:40:26 | Araq | stefantalpalaru, Nim isn't on the "same level of abstraction" though, GC, closures and exceptions turn into a higher level beast |
12:41:12 | Araq | C is closer to asm than Nim is to C. Yet nobody says "C is transpiled", it's all messed up |
12:41:37 | FromDiscord | <Rika> 2nd transpiling discussion today :ArtiaFacepalm: |
12:46:43 | FromDiscord | <--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:44 | leorize | I'm fixing it actually :P |
12:50:21 | FromDiscord | <--HA--> Oh cool! Thanks! |
12:50:34 | * | vsantana quit (Ping timeout: 258 seconds) |
12:52:12 | * | vsantana joined #nim |
12:53:16 | leorize | @--HA-- http://ix.io/2pFw <- apply that patch to the stdlib and let me know if that fixes the problem |
12:55:41 | leorize | you don't have to rebuild nim, just apply the patch :P |
12:59:27 | FromDiscord | <Shucks> > 2nd transpiling discussion today :ArtiaFacepalm:β΅@Rika sowwwwy ;D |
13:00:17 | FromDiscord | <Rika> boutta pull the trigger on deleting the word transpile from my mental dictionary |
13:00:29 | FromDiscord | <--HA--> I installed nim with choosenim. Would I just patch the file in .choosenim/toolchains or should I go about it differently? |
13:00:39 | leorize | yea just patch it in there |
13:05:36 | FromDiscord | <--HA--> Awesome, that worked perfectly. Thanks a lot for handolding me through this and then fixing that bug right away. |
13:05:56 | leorize | you're welcome :) |
13:06:30 | FromDiscord | <--HA--> Interestingly it seems I don't need an extra libiconv, using only --dynlibOverrideAll and no -L it works |
13:06:53 | FromDiscord | <--HA--> with musl that is |
13:07:24 | leorize | I 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:25 | Yardanico | yeah |
13:19:33 | Yardanico | "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:36 | Yardanico | https://wiki.musl-libc.org/functional-differences-from-glibc.html#iconv |
13:21:04 | leorize | we should probably make Nim more efficient at making static libs at some point |
13:21:15 | Yardanico | wdym? |
13:21:53 | leorize | the 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:06 | leorize | this is, well, inefficient :P |
13:22:37 | leorize | since dead code elim is basically non existant (and no, LTO won't save you) :P |
13:31:06 | narimiran | The 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:55 | Araq | the linker does save you |
13:59:03 | Araq | if you have a decent one |
14:03:29 | stefantalpalaru | "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:00 | FromDiscord | <Rika> thats not the argument |
14:04:15 | FromDiscord | <Rika> reread what he said |
14:04:35 | FromDiscord | <Rika> `c is closer to asm than nim is to c` doesnt necessarily imply `c is low level` |
14:04:50 | FromDiscord | <Rika> just that `nim is way more high level vs c than c is high level vs asm` |
14:05:40 | stefantalpalaru | How 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:14 | FromDiscord | <Rika> that depends on where you put the boundaries of a high, middle, and low level language |
14:06:16 | stefantalpalaru | (microcode is the actual low-level language, BTW) |
14:06:24 | FromDiscord | <Rika> does high level even have an upper bound? |
14:06:37 | stefantalpalaru | No, no upper bound. |
14:06:43 | FromDiscord | <Rika> then there you have it |
14:09:42 | stefantalpalaru | Glad to help. So from now on start using "transpilation" for compiling Nim to C ;-) |
14:10:00 | FromDiscord | <Rika> what's transpilation? dunno that word |
14:11:59 | stefantalpalaru | https://scholar.google.com/scholar?hl=en&as_sdt=0%2C5&q=transpilation&btnG= |
14:13:29 | FromDiscord | <Rika> you know i cant be assed anymore this is the ***third*** discussion about transpilation and im very fucking done |
14:13:31 | FromDiscord | <Rika> call it whatever |
14:13:36 | FromDiscord | <Rika> ***i*** will call it compilation |
14:13:48 | FromDiscord | <Rika> you ***cannot*** tell me to do otherwise |
14:14:04 | * | Vladar quit (Quit: Leaving) |
14:14:15 | FromDiscord | <Rika> also call me stupid or whatever |
14:15:26 | zedeus | calling Nim -> C transpilation is misleading and reductionist |
14:15:37 | stefantalpalaru | You're out of luck. Arguing for obscure and redundant terminology is my hobby :-) |
14:16:07 | greenfork | get a life man :D |
14:16:07 | FromDiscord | <Rika> three times in one day is too much for me |
14:16:13 | FromDiscord | <Rika> one time is too much for me |
14:16:33 | FromDiscord | <Rika> i wish this argument never has to happen ever again to any fucking programming language |
14:17:16 | stefantalpalaru | Anyone interested in arguing why the right name of the programming language is "Go" and no "Golang"? |
14:17:27 | stefantalpalaru | *not |
14:18:11 | FromDiscord | <Rika> it is Go, golang is just better to refer to the language because of how common the word Go is |
14:18:26 | FromDiscord | <Rika> and people dont like capitalizing either haha |
14:18:36 | FromDiscord | <Rika> some people say rustlang |
14:18:39 | FromDiscord | <Rika> *too |
14:18:41 | FromDiscord | <Rika> also nimlang |
14:18:43 | FromDiscord | <Rika> so eh |
14:19:33 | Araq | stefantalpalaru, I'm underwhelmed by your argument, it makes no sense. |
14:20:20 | stefantalpalaru | Also, I'd like to argue that Nim is Pascal++. |
14:20:38 | FromDiscord | <Rika> and rust is C+++? |
14:21:00 | Araq | Ada is already Pascal++ |
14:23:08 | * | konradmb joined #nim |
14:28:18 | FromDiscord | <codic> time to join nimconf |
14:35:54 | Araq | stefantalpalaru, 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:54 | Araq | *very* different x86 code. |
14:37:49 | Araq | C 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:19 | stefantalpalaru | What 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:45 | stefantalpalaru | Here's an oversimplification of complexity levels: Haskell, Nim and C deal with virtual machines that abstract over CPU registers, cache, memory, etc. |
14:40:07 | stefantalpalaru | Assembler deals with virtual CPU registers that abstract over real registers. |
14:40:38 | stefantalpalaru | Microcode deals with actual hardware gates and voltage levels. |
14:41:04 | FromGitter | <alehander92> stefantalpalaru after translating idioms between high level languages |
14:41:13 | FromGitter | <alehander92> with an automated tool(it was very naive: but still a try) |
14:41:41 | stefantalpalaru | I exaggerated the microcode part a bit. It's more like "connect register 1 to the A side of the ALU". |
14:41:45 | FromGitter | <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:07 | FromDiscord | <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:24 | FromGitter | <alehander92> of coruse there are much more important things: abstraction posibilities, etc |
14:43:04 | FromGitter | <alehander92> but i think this kind of metrics can come close to how we feel about verbosity/usage of a lang |
14:43:06 | stefantalpalaru | Is the virtual machine you target with Haskell that much different than the one you target with C? |
14:43:20 | FromGitter | <alehander92> so i feel its purely a |
14:43:24 | * | konradmb quit (Quit: Leaving) |
14:43:37 | FromGitter | <alehander92> language design thing: i cant understand how the target language has anything to do with "highlevelness" |
14:43:47 | FromGitter | <alehander92> now if its more about transpilation/compilation, sorry, maybe i was offtopic |
14:45:17 | * | UnnoTed joined #nim |
14:50:36 | Araq | stefantalpalaru, TinyC produces asm code without an IR indeed, see https://github.com/TinyCC/tinycc/blob/mob/i386-gen.c#L867 |
14:51:10 | Araq | and 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:28 | stefantalpalaru | Then 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:36 | narimiran | i'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:34 | Araq | the 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:19 | Araq | indicating that Nim is further away from C than C is from assembler. |
14:59:41 | Araq | so if "Nim is transpiled to C" then "C is transpiled to asm" |
14:59:56 | stefantalpalaru | You're talking about the quantity of mismatched concepts to translate. I'm talking about the quality of their abstraction level. |
15:01:12 | FromDiscord | <Isomorpheus> does anyone have nimpretty working with the nim vscode extension? is it just me? |
15:06:29 | Araq | Well I've really nothing to add. Keep using "transpile", but it keeps being wrong. |
15:07:03 | Araq | According to the definition of "transpile". |
15:07:04 | stefantalpalaru | As long as it's an excuse to discuss programming language complexity level, I'll keep using it. |
15:07:48 | Araq | Jeder blamiert sich so gut er eben kann. |
15:08:42 | shashlick | for 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:48 | FromDiscord | <dom96> Araq's argument is completely correct and consistent with the definition of "transpilation" on Wikipedia |
15:09:58 | FromDiscord | <dom96> Nim->C is compilation |
15:10:04 | * | dddddd joined #nim |
15:10:20 | FromDiscord | <dom96> They are at different abstraction levels after all |
15:10:37 | * | sknebel quit (Ping timeout: 272 seconds) |
15:11:00 | FromDiscord | <Zed> are we having a 3rd discussion about transpiling |
15:11:55 | * | tefter quit (Quit: WeeChat 2.8) |
15:12:33 | narimiran | @Zed we're expecting to hit 5 by the end of the day |
15:13:17 | * | giaco quit (Ping timeout: 246 seconds) |
15:13:18 | FromDiscord | <Zed> haha maybe just add an announcement that transpiling is a sensitive topic |
15:13:20 | narimiran | it's not that we have something big going on today, plenty of time to discuss these important matters |
15:13:37 | FromDiscord | <Zed> lol |
15:13:39 | FromDiscord | <willyboar> ^ that's true |
15:14:00 | FromDiscord | <willyboar> today is a celebration day |
15:18:47 | disruptek | have you looked at how the v compiler works? |
15:18:54 | * | dchem joined #nim |
15:19:30 | stefantalpalaru | Shall we talk about macros operating on AST resulting from different compiler passes, depending on whether their result is typed or untyped? :-) |
15:19:40 | FromDiscord | <willyboar> https://github.com/the-benchmarker/web-frameworks eat our dust π |
15:19:46 | dchem | watching videos for conference now |
15:19:55 | * | UnnoTed quit (Ping timeout: 246 seconds) |
15:20:59 | FromDiscord | <Rika> Thank God the day has ended for me, would have hit 4 if it hadn't |
15:21:12 | FromDiscord | <djazz> XD |
15:26:49 | FromDiscord | <Zed> disruptek, i dont think i've heard anyine say anything good about v |
15:26:56 | FromDiscord | <Zed> *anyone |
15:27:53 | FromDiscord | <dom96> You should check their Twitter |
15:27:56 | * | sknebel_ is now known as sknebel |
15:27:58 | FromDiscord | <dom96> Lots are eating up the claims |
15:28:35 | FromDiscord | <Zed> wow really |
15:29:13 | FromDiscord | <willyboar> there always a mystery around V |
15:29:32 | FromDiscord | <Zed> v = vapor ware |
15:29:44 | FromDiscord | <Zed> last i checked they had a sponsor |
15:29:47 | FromDiscord | <Zed> which was weird |
15:29:55 | FromDiscord | <willyboar> we want T lang |
15:29:55 | FromDiscord | <dom96> Tbh the person that's creating it knows how to market in the short-term |
15:30:02 | FromDiscord | <dom96> Whether that will work in the long-term is another matter |
15:30:18 | FromDiscord | <dom96> But in this world, lying your way to success very often works |
15:30:51 | FromDiscord | <Zed> yup, although i think some of his claims are possible |
15:31:22 | FromDiscord | <Zed> but not with what he has at the moment |
15:31:42 | FromDiscord | <dom96> Sure, it's often not outright lies |
15:31:48 | FromDiscord | <dom96> But promises that won't be kept |
15:32:15 | FromDiscord | <dom96> or claims that are exaggerations |
15:33:24 | FromDiscord | <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:53 | Zevv | hey disruptek awoke |
15:41:57 | Zevv | you missed all the fun man |
15:49:50 | narimiran | guys, Ar4q is live on youtube, time for the 4th today's discussion about transpiling, don't miss your chance! |
15:50:18 | sschwarzer | narimiran: *lol* |
15:51:53 | narimiran | It is time for the second part of the #nimconf 2020, and it starts big β with Araq's talk about ARC and ORC! |
15:51:55 | narimiran | Watch it live: https://www.youtube.com/watch?v=aUJcYTnPWCg&list=PLxLdEZg8DRwTIEzUpfaIcBqhsj09mLWHx&index=9 |
15:51:59 | narimiran | ...and don't miss all the other talks coming after it: https://conf.nim-lang.org/ |
15:52:14 | dchem | nice |
16:02:19 | * | solitudesf joined #nim |
16:11:22 | * | oddp quit (Ping timeout: 265 seconds) |
16:12:16 | FromDiscord | <hcorion> π woah some very interesting talks here |
16:14:28 | FromDiscord | <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:51 | FromDiscord | <mratsim> A repl |
16:15:14 | FromDiscord | <mratsim> (can't describe it in less than 2 words :/) |
16:15:33 | FromDiscord | <hcorion> Ooh ok very cool |
16:16:31 | narimiran | @hcorion it is just a 5min talk, you can watch it in a break between two live talks :) |
16:17:07 | FromDiscord | <djazz> Interactive Nim |
16:20:42 | FromDiscord | <hcorion> Oh I missed the GBA talk π
I'll have to go watch that |
16:21:04 | * | oddp joined #nim |
16:22:32 | FromDiscord | <exelotl> @hcorion π |
16:22:54 | FromDiscord | <hcorion> Hey π |
16:23:09 | FromDiscord | <hcorion> That's your talk right? |
16:23:30 | FromDiscord | <exelotl> yeah! Your nake setup helped me a lot with making the jump from makefiles to nimscript builds |
16:23:46 | FromDiscord | <hcorion> Oh nice! Good to hear |
16:27:07 | FromDiscord | <hcorion> Nico also looks really cool |
16:35:32 | * | xace_ quit (Ping timeout: 246 seconds) |
16:37:39 | * | xace joined #nim |
16:41:06 | sschwarzer | The state of the ARC? ;-) |
16:43:01 | FromDiscord | <exelotl> Raiders of the lost ARC |
16:45:17 | FromDiscord | <djazz> Lord of the Nim crown. |
16:45:38 | FromDiscord | <hcorion> Woah I didn't realize you're making a full game in Nim for the GBA, dude that's awesome @exelotl |
16:46:36 | sschwarzer | What'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:56 | sschwarzer | exelotl :) |
16:54:26 | * | tane quit (Ping timeout: 256 seconds) |
16:56:11 | * | ftsf quit (Ping timeout: 246 seconds) |
17:07:54 | solitudesf | !repo fusion |
17:07:54 | disbot | https://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:52 | testnimnoob | is nim in action updated? |
17:37:13 | testnimnoob | if it isnt how badly out of date is it ? |
17:37:18 | * | narimiran quit (Ping timeout: 258 seconds) |
17:38:38 | FromDiscord | <dom96> It's not and it's pretty up to date |
17:38:48 | FromDiscord | <dom96> It supports 1.0, all code examples should still compile |
17:39:27 | FromDiscord | <dom96> Here is an awesome errata https://deepakg.github.io/nim/2019/09/28/nim-in-action-errata.html |
17:39:39 | testnimnoob | omg this is awesome |
17:39:57 | FromDiscord | <dom96> Most of these aren't serious IMO |
17:41:08 | testnimnoob | i really thought that the explanation of model (the calculator) was the BEST explanation |
17:41:09 | testnimnoob | etc |
17:41:23 | testnimnoob | i stopped doing rails because no one could explain it lol |
17:41:52 | testnimnoob | hope you write another book dom |
17:42:12 | FromDiscord | <dom96> yay, nice to hear. Completely forgot about that example heh |
17:42:28 | testnimnoob | most people will parrot "business llogic goes there" |
17:42:37 | testnimnoob | but cant explain it really well |
17:43:14 | testnimnoob | i was only scanning through also |
17:43:22 | testnimnoob | ill 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:00 | FromDiscord | <SeanOMik> How would I update values inside of a `seq` |
18:31:18 | FromDiscord | <SeanOMik> And also remove values from it if I dont know the index of the value |
18:31:41 | leorize | find() can be used to find the index of a value |
18:32:31 | FromDiscord | <SeanOMik> Okay, is there a proc for updating values? |
18:33:58 | leorize | once you got the index, just do `seq[index] = newvalue` |
18:34:59 | FromDiscord | <SeanOMik> Oh cool |
18:35:00 | FromDiscord | <SeanOMik> Thanks |
18:35:24 | leorize | though make sure that you're not using `find()` a lot |
18:35:50 | leorize | it'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:35 | FromDiscord | <Shucks> Someone referred me to a math class which had 2d/3d vectors aswell. Does someone know which one it could be |
18:50:19 | FromDiscord | <Rika> Which one what could be |
18:54:02 | stefantalpalaru | Turns out you can convert decimal numbers to fractions and use those in GMP: https://gmplib.org/manual/Rational-Number-Functions |
18:54:27 | stefantalpalaru | But 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:45 | haxscramper | I 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:45 | haxscramper | fine. |
19:07:26 | FromDiscord | <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:44 | FromDiscord | <--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:06 | FromDiscord | <Shucks> Before I'll continue the wrong way. Could this be simplified? https://play.nim-lang.org/#ix=2pHi |
19:35:11 | shashlick | it will only do it once |
19:35:21 | FromDiscord | <--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:09 | shashlick | don't you need all those binaries? |
19:39:02 | leorize | @Shucks iirc there are built-in templates for `+=` if you have `+` defined |
19:39:34 | leorize | hmm why are you using inheritance here? |
19:40:05 | FromDiscord | <Elegant Beef> Can the nim compiler run in browser to produce js code? |
19:40:10 | leorize | nope |
19:42:06 | FromDiscord | <Elegant Beef> Few issues with that vector file, dont make vectors reference objects, they're created and destroyed a ton |
19:42:15 | FromDiscord | <Elegant Beef> Secondly no reason for inheritance as leorize pointed out |
19:42:41 | FromDiscord | <--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:51 | FromDiscord | <--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:55 | shashlick | okay sounds fair |
19:45:29 | shashlick | you can git clone, nimble install -d to just install its deps (assuming they don't build binaries :D) |
19:45:57 | shashlick | then you can use --path:.. to tell nim about it or have a folder of such cloned packages and use --nimblePath |
19:46:19 | shashlick | i'd suggest nimble develop but it might not work for binary only packages |
19:46:24 | FromDiscord | <Shucks> @leorize Anything else I would need to do to get `+=` work? Just removed my `+=` procs and it doesn't works anymore |
19:46:24 | shashlick | worth a try tho |
19:47:09 | leorize | @Shucks then I guess the template is only defined for ordinals |
19:47:40 | FromDiscord | <--HA--> I think it's the "hybrid" package type, listed as "combination of library and binary" by nimble init |
19:47:50 | shashlick | try git clone and nimble develop |
19:48:03 | shashlick | it will add it to the nimble path searched by nim but won't build the package |
19:48:52 | FromDiscord | <--HA--> I'll give that a try. Thanks. |
19:58:43 | bung | am watching INim is back , wondering the screenshots using some tool make it look like capture from old monitor? |
20:03:15 | leorize | it's probably a crt terminal emulator |
20:03:43 | leorize | it probably was cool-retro-term |
20:04:51 | FromDiscord | <Shucks> looks likes windows cmder |
20:04:52 | FromDiscord | <Shucks> ;D |
20:04:53 | bung | thanks ! found it, looks very cool! |
20:05:09 | FromDiscord | <Shucks> (edit) 'likes' => 'like' |
20:06:33 | FromDiscord | <--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:26 | leorize | you can also use nimph |
20:08:28 | leorize | !repo nimph |
20:08:29 | disbot | https://github.com/disruptek/nimph -- 9nimph: 11Nim package hierarchy manager from the future π§ 15 66β 4π΄ 7& 1 more... |
20:10:46 | FromDiscord | <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:50 | shashlick | --HA-- you need to remove the package from ~/.nimble if it is there as well |
20:10:57 | * | oddp joined #nim |
20:11:08 | shashlick | cause develop packages are linked as #head i think |
20:12:45 | FromDiscord | <--HA--> I'll check out nimph sometime. For now I'm happy I have something working hehe. |
20:14:07 | FromDiscord | <Shucks> mh yea, but you can't use Vector(x:1, y:1) syntax then for example right |
20:14:53 | FromDiscord | <l1pz> No, you have to make a proc to do that for you, but it's quite simple |
20:20:57 | FromDiscord | <--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:53 | leorize | writeFile twice |
20:22:05 | leorize | copying is basically read a file and write it to another |
20:23:22 | FromDiscord | <--HA--> Makes a lot of sense now that you say it π |
20:23:58 | leorize | if 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:48 | qn68h | hi |
20:24:52 | FromDiscord | <Elegant Beef> Yellow |
20:24:54 | leorize | hi |
20:25:26 | * | haxscramper quit (Remote host closed the connection) |
20:25:34 | qn68h | I'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:45 | leorize | about that... |
20:25:47 | leorize | we don't have classes :P |
20:26:16 | qn68h | leorize, are there projects about including them ? :) |
20:26:20 | FromDiscord | <codic> How can I iterate over a json object, parsed with parseJson, per key-value? something like for key, val in object |
20:26:40 | leorize | qn68h: yes but not popular |
20:26:45 | leorize | because Nim don't need class |
20:26:57 | qn68h | leorize, oh really? not popular? |
20:27:01 | leorize | in Nim we write data structures and procs that work on them |
20:27:08 | leorize | we have ufcs |
20:27:18 | FromDiscord | <l1pz> @Shucks I updated the code, so you can how I would do it. https://play.nim-lang.org/#ix=2pHC |
20:27:21 | FromDiscord | <Elegant Beef> Nim creates objects, and due to our funky call syntax we just make procs that use them as parameters |
20:27:23 | FromDiscord | <Elegant Beef> It's nice |
20:27:34 | FromDiscord | <l1pz> (edit) '@Shucks I updated the code, so you can ... how' => '@Shucks I updated the code, so you cansee' |
20:27:45 | qn68h | leorize, look at https://github.com/nim-lang/Nim/wiki/Nim-for-Python-Programmers#self__init__ |
20:27:46 | FromDiscord | <Elegant Beef> `proc add(a,b:int):int = a + b` |
20:27:47 | FromDiscord | <Elegant Beef> for instance |
20:27:56 | qn68h | it's not really nice... |
20:27:57 | oddp | Props to you guys for pulling through with the conf. Hopefully, we over at d will follow suit in the weeks to come. :) |
20:27:59 | FromDiscord | <Elegant Beef> can be use `add(10,11)` or `10.add(11)` |
20:28:24 | qn68h | leorize, having to do "var kitten = initCat()" is not like creating an instance... |
20:28:41 | FromDiscord | <Elegant Beef> Well my counter argument is python sucks |
20:28:42 | FromDiscord | <Elegant Beef> So hah |
20:28:49 | leorize | I guess you will have to write Nim a bit first :P |
20:28:58 | leorize | it's tempting to think Nim is python due to the similar syntax |
20:29:21 | FromDiscord | <Elegant Beef> Imagin having`__` in a variable name |
20:29:23 | FromDiscord | <KingDarBoja> qn68h: welcome to Nim |
20:29:28 | FromDiscord | <KingDarBoja> Coming from Python uh? |
20:29:44 | FromDiscord | <--HA--> sent a long message, see http://ix.io/2pHE |
20:30:08 | qn68h | leorize, 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:21 | FromDiscord | <Elegant Beef> well you can do `Window()` |
20:30:32 | FromDiscord | <Elegant Beef> That is the object constructor |
20:30:34 | FromDiscord | <codic> @--HA-- Thank you! |
20:30:38 | leorize | in Nim we use a simple convention: initType or newType |
20:30:47 | leorize | initType when it's a stack-based object |
20:30:49 | FromDiscord | <Elegant Beef> It uses named parameters if you dont use the procs |
20:30:54 | leorize | newType when it's a heap-typed object |
20:30:57 | FromDiscord | <KingDarBoja> qn68h: the best idea should be writing a bit of Nim π As leorize stated |
20:31:11 | FromDiscord | <Elegant Beef> You have a preconcived notion that the python way is better |
20:31:16 | FromDiscord | <KingDarBoja> You can do OOP on Nim but very minimal |
20:31:27 | qn68h | ElegantBeef: but then Window() does not call anything after the init |
20:31:35 | FromDiscord | <KingDarBoja> This is a way of doing things, but not the only way π |
20:31:56 | leorize | not having constructors is a design decision btw |
20:31:57 | FromDiscord | <Elegant Beef> well that's why you make your own constructor proc |
20:32:11 | qn68h | hmmm... |
20:32:11 | leorize | Araq can brief you on why (if he's still online) |
20:32:17 | qn68h | I looked at https://forum.nim-lang.org/t/3 |
20:32:24 | FromDiscord | <Elegant Beef> Leroize i have a macro called constructor, so you lie π |
20:32:33 | FromDiscord | <Elegant Beef> It doesnt call procs but just makes the init/new procs for you |
20:32:36 | leorize | I mean built-in :P |
20:32:52 | qn68h | and I was surprised by the nim way ;) |
20:32:58 | FromDiscord | <KingDarBoja> Aren't constructors basically `initProcName` and `newProcName` ? |
20:33:04 | FromDiscord | <Elegant Beef> You dont have to use the init/new convention |
20:33:08 | FromDiscord | <Elegant Beef> you can use new everwhere |
20:33:18 | FromDiscord | <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:37 | qn68h | leorize, well i have to say it's my first small desillusion, except that, everything looked great so far in my Nim journey :) |
20:33:39 | FromDiscord | <KingDarBoja> I know, what I mean is just setting the proc to match the type hehehe |
20:33:57 | FromDiscord | <Elegant Beef> The only reason new/init is to easily distinguish stack vs heap objects i believe |
20:34:02 | FromDiscord | <KingDarBoja> qn68h: don't see it as desillusion, it is another way of doing things |
20:34:21 | FromDiscord | <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:43 | qn68h | KingDarBoja, the main problem I have with this way is: |
20:34:47 | FromDiscord | <l1pz> I tried to read up on memory safety in Nim, but couldn't really find it in the docs. |
20:34:59 | leorize | @l1pz you can't capture a `var` in a closure |
20:35:20 | leorize | this is because a closure is run independent of the stack |
20:35:32 | FromDiscord | <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:43 | FromDiscord | <Elegant Beef> I mean this is the help channel π |
20:35:48 | FromDiscord | <l1pz> In C++ I would just pass a refence to the object. How would I do that in Nim? |
20:35:59 | FromDiscord | <l1pz> I mean to the function |
20:36:00 | * | aenesidemus joined #nim |
20:36:07 | leorize | make your `ProgressBar` a ref object |
20:36:08 | qn68h | cat = Cat(); cat.purr() cat.doanything() initCat() <-- this one is an exception in syntax |
20:36:09 | FromDiscord | <KingDarBoja> Yeah but sometimes becomes the discussion Nim stuff |
20:36:11 | leorize | `var` is the reference |
20:36:19 | FromDiscord | <Skaruts> does `choosenim stable` look for the latest stable available, or the latest stable I have installed? |
20:36:28 | FromDiscord | <KingDarBoja> The latest stable available |
20:36:31 | leorize | @l1pz Nim reference is stricter in memory safety requirements |
20:36:37 | FromDiscord | <KingDarBoja> In this case `1.2.2` |
20:36:47 | qn68h | leorize, 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:56 | FromDiscord | <Skaruts> hmm, it switched me to 1.2.0 though |
20:37:04 | FromDiscord | <Elegant Beef> UFCS means that you're wrong |
20:37:07 | leorize | qn68h: you're seeing it wrong: we don't have methods, we only have functions |
20:37:13 | FromDiscord | <Elegant Beef> They're all possible to be regular functions |
20:37:32 | FromDiscord | <KingDarBoja> @Skaruts I think it first update to the major version then the patch one |
20:37:32 | leorize | s/possible to be//g |
20:37:42 | FromDiscord | <KingDarBoja> So run again `choosenim stable` |
20:37:42 | shashlick | Skaruts - your stable |
20:37:49 | shashlick | use choosenim update stable to update your local |
20:37:52 | FromDiscord | <KingDarBoja> Not sure tbh |
20:38:00 | FromDiscord | <Elegant Beef> againβ΅`proc add(a,b:int):int= a + b`β΅can be usedβ΅`10.add(11)` and `add(10,11)` |
20:38:16 | shashlick | if you already installed 1.2.2 directly, stable won't get updated - there's a bug on that |
20:38:18 | FromDiscord | <Elegant Beef> So your issue is a self inflicted one imo π |
20:38:19 | qn68h | leorize, why this choice, in comparison to C++ which has methods etc. ? |
20:38:41 | FromDiscord | <Elegant Beef> Nim does have dynamic dispatch which are called methods, but we use UFCS so we dont need class attached methods |
20:38:54 | leorize | qn68h: we maintain a separation of code from data structure |
20:38:57 | FromDiscord | <KingDarBoja> shashlick: Thanks for the correction |
20:39:08 | FromDiscord | <KingDarBoja> I forgot how the command was |
20:39:17 | leorize | it's just good practice, really |
20:39:35 | leorize | and also it avoided all the nastiness of classes and their methods |
20:39:53 | FromDiscord | <Skaruts> ah thanks, @shashlick |
20:39:57 | leorize | since we have UFCS, the object.method() can be used for... everything :P |
20:40:04 | FromDiscord | <Elegant Beef> yea |
20:40:07 | FromDiscord | <KingDarBoja> Should this be recommended -> https://scripter.co/notes/nim |
20:40:10 | leorize | it doesn't make sense to have special syntax |
20:40:11 | FromDiscord | <Elegant Beef> Nim is wildly different to python |
20:40:15 | qn68h | I'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:21 | leorize | @KingDarBoja yea that's a good resource |
20:40:25 | qn68h | is there a nim testing branch with classes? |
20:40:30 | leorize | nope |
20:40:59 | * | dsrw joined #nim |
20:41:00 | FromDiscord | <Elegant Beef> You can always make classes by having members |
20:41:03 | qn68h | leorize, would you have an example .nim file with many classes and inheritance? i'm curious how it looks like |
20:41:04 | FromDiscord | <Elegant Beef> But that's weird |
20:41:31 | FromDiscord | <KingDarBoja> I have an example xD |
20:41:32 | leorize | qn68h: well the thing is... we don't do inheritance here a lot (if ever) |
20:41:40 | FromDiscord | <KingDarBoja> And switched to Object Variants |
20:41:56 | leorize | @KingDarBoja please show them :P |
20:41:58 | FromDiscord | <Elegant Beef> We use object variants and data oriented design! |
20:42:17 | qn68h | leorize, 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:28 | FromDiscord | <Elegant Beef> A ECS using Components |
20:42:37 | FromDiscord | <Elegant Beef> which is 1 depth inheritance |
20:42:42 | FromDiscord | <Elegant Beef> or 0 if you are smart |
20:43:14 | qn68h | ECS? |
20:43:33 | sschwarzer | Funny, 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:35 | FromDiscord | <SeanOMik> How would I create a new tuple? |
20:43:37 | FromDiscord | <Elegant Beef> Entity Component System |
20:43:45 | FromDiscord | <Elegant Beef> A very compositional system |
20:43:53 | FromDiscord | <Skaruts> @qn68h you can do inheritance in Nim, and you can use methods instead of procs if you need polimorphism |
20:43:57 | FromDiscord | <Elegant Beef> Instead of relying on inheritance you rely on components which tell you what systems will work on it |
20:44:00 | leorize | SeanOMik: `(value1, value2)` |
20:44:10 | FromDiscord | <Skaruts> I did for a UI |
20:44:16 | FromDiscord | <SeanOMik> Awesome, thanks |
20:44:19 | FromDiscord | <Elegant Beef> You design systems that work on the data buckets of components |
20:44:29 | FromDiscord | <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:30 | FromDiscord | <Elegant Beef> Instead of using inheritance |
20:44:38 | leorize | qn68h: it's better to look at some of our libraries, let me try to dig some up |
20:44:43 | FromDiscord | <KingDarBoja> leorize: well I am not sure if it is a proper example of why not using OOP-style |
20:44:50 | qn68h | leorize, yep great i'll look at a lib |
20:45:44 | leorize | @l1pz you'll have to use a template for now, probably we should add one into sugar |
20:46:03 | FromDiscord | <Skaruts> for OOP this helped me out a lot: https://matthiashager.com/nim-object-oriented-programming |
20:46:18 | FromDiscord | <KingDarBoja> I read that too |
20:46:25 | leorize | !repo fidget |
20:46:25 | disbot | https://github.com/treeform/fidget -- 9fidget: 11Figma based UI library for nim, with HTML and OpenGL backends. 15 164β 7π΄ |
20:46:27 | leorize | !repo nigui |
20:46:28 | disbot | https://github.com/trustable-code/NiGui -- 9NiGui: 11Cross-platform desktop GUI toolkit written in Nim 15 340β 34π΄ 7& 5 more... |
20:46:32 | leorize | ^ those are for gui libraries |
20:46:32 | FromDiscord | <KingDarBoja> But please read the last part of it and you will see why it is discouraged |
20:47:08 | Araq | sschwarzer, you cannot move from value to ref semantics or vice versa that easily |
20:47:21 | Araq | esp not if you exposed the library to some clients you have no control over |
20:47:33 | Araq | so this init/new distinction causes no trouble IME |
20:47:33 | leorize | qn68h: 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:36 | FromDiscord | <KingDarBoja> You will get in trouble while trying to _convert an ancestor object to its descendant type._ |
20:47:43 | FromDiscord | <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:51 | leorize | !repo nico |
20:47:52 | disbot | https://github.com/ftsf/nico -- 9nico: 11Nim Game Framework based on Pico-8 15 142β 10π΄ 7& 2 more... |
20:47:57 | qn68h | leorize, no that's fine, thanks a lot! |
20:47:58 | leorize | ^ this one comes to mind for games |
20:48:11 | qn68h | your GUI example is perfet |
20:48:27 | qn68h | *perfect, it showcases well how it goes: https://github.com/trustable-code/NiGui/blob/master/src/nigui.nim#L2449 |
20:49:09 | FromDiscord | <mratsim> @Araq were you aware of this: https://github.com/agroce/afl-compiler-fuzzer |
20:49:16 | leorize | glad that helped |
20:49:16 | FromDiscord | <KingDarBoja> Oh yeah, perfect example π |
20:49:25 | FromDiscord | <KingDarBoja> Give rep to leorize! |
20:49:48 | qn68h | leorize, tl;fr what's the diff func vs proc vs method? |
20:49:55 | sschwarzer | Araq: Ok, I'll just see what experiences I'll make. :) |
20:50:23 | leorize | proc: plain old function |
20:50:25 | Araq | mratsim: no and "let me create more compiler bug reports" is a problem I've yet to experience |
20:50:32 | leorize | func: proc but with {.nosideeffects.} |
20:50:44 | bung | methods dynmic dispatch, proc may or not have side effect, func has no side effect. |
20:50:51 | leorize | method: proc with dynamic dispatching |
20:51:24 | qn68h | leorize, is it just semantic proc vs func, to help the programmer see the differences, or is there a diff really in code? |
20:51:43 | FromDiscord | <Skaruts> it's different |
20:51:45 | leorize | yes, in func you can't modify any state not reachable via parameters |
20:51:48 | qn68h | i mean is it a good practice naming convention or really it works differently? |
20:51:57 | qn68h | oh ok good to know |
20:52:11 | sschwarzer | Would you recommend _against_ not using the init/new convention, apart from it being a convention? |
20:52:48 | FromDiscord | <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:11 | FromDiscord | <lqdev> leorize: sup |
20:53:14 | FromDiscord | <Skaruts> for the latter you need `method` |
20:53:24 | sschwarzer | bung: 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:00 | leorize | @lqdev qn68h was curious on how to do game programming with minimal OOP |
20:54:08 | FromDiscord | <lqdev> right |
20:54:17 | qn68h | Hi lqdev |
20:54:22 | FromDiscord | <lqdev> hi |
20:54:34 | bung | sschwarzer yeah,theres rfc for that since you can pass referrence |
20:54:37 | FromDiscord | <lqdev> well, I just use inheritance with `method`s everywhere for things like `draw()`, `update()`, etc |
20:54:44 | FromDiscord | <lqdev> not sure what do you want exactly |
20:55:07 | leorize | there are talks about ECS, though I don't know if there's anything in circulation rn |
20:55:20 | qn68h | lqdev, I programmed a pointnclick lib in Python, and there was Room, player, object, sprite, etc. |
20:55:20 | leorize | we do have a separated gamedev channel but I forgot the name :P |
20:55:44 | qn68h | and I liked the fact everything was grouped nicely draw(), update(), etc. |
20:56:30 | qn68h | lqdev even from a bird's eye view, not reading the code, just the structure of the code is perfect with classical OOP |
20:56:43 | FromDiscord | <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:57 | FromDiscord | <lqdev> it's important that the object is `ref`, otherwise you may run into weird issues |
20:57:01 | bung | nim is more self explaintion to me. |
20:57:02 | leorize | what our style of programming allows is that you can easily "extend" any "class" |
20:57:08 | FromDiscord | <lqdev> yeah |
20:57:25 | FromDiscord | <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:57 | qn68h | lqdev but with that, how would inherit the init from Sprite? |
20:58:11 | FromDiscord | <lqdev> like I just shown |
20:58:18 | qn68h | in Player's init? |
20:58:30 | FromDiscord | <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:52 | FromDiscord | <lqdev> eg. `method draw*(sprite: Sprite, target: Target) {.base.} =` |
20:59:12 | FromDiscord | <lqdev> you do this for all "abstract" methods you want to create |
20:59:39 | qn68h | hum ok I'll think about this. btw what is draw* why *? |
20:59:53 | FromDiscord | <lqdev> it's just an example |
20:59:59 | * | brainbomb quit (Quit: Leaving.) |
21:00:02 | FromDiscord | <lqdev> you can call them whatever you want |
21:00:07 | bung | export from module |
21:00:17 | qn68h | ok so * has no special meaning? |
21:00:23 | * | greenfork quit (Ping timeout: 256 seconds) |
21:00:28 | FromDiscord | <lqdev> nope, it makes the method *exported* |
21:00:32 | bung | marked it as export |
21:00:33 | leorize | the `*` means that the symbol is exported |
21:00:37 | FromDiscord | <lqdev> so that you can access it from other modules |
21:00:39 | qn68h | oh ok |
21:00:58 | qn68h | i hadn't read this yet in the doc ;) first day of nim :) |
21:01:16 | FromDiscord | <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:26 | FromDiscord | <0xfabe (vn-ki)> Is nim geared towards game dev? |
21:01:27 | FromDiscord | <lqdev> unlike `proc` which dispatches depending on what the type is during compile-time |
21:01:37 | FromDiscord | <lqdev> @0xfabe (vn-ki) it's geared towards general use ;) |
21:01:40 | FromDiscord | <lqdev> so game dev too |
21:01:46 | leorize | nim is geared towards everything :P |
21:02:13 | FromDiscord | <0xfabe (vn-ki)> I'm torn b/w nim and rust for a new proj of mine :P |
21:02:23 | FromDiscord | <KingDarBoja> There is already a web framework, game dev libs, UI libs, etc |
21:03:17 | qn68h | ohh so you can you have multiple functions with the same function name |
21:03:21 | FromDiscord | <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:23 | FromDiscord | <Skaruts> take it with a big grain of salt, but hopfully it can help |
21:03:31 | FromDiscord | <0xfabe (vn-ki)> I guess it might come down to whether I have time to wrap capstone for nim |
21:03:32 | FromDiscord | <lqdev> qn68h: yes, that's called function overloading |
21:03:35 | qn68h | and the compiler will decide which one to use according to the type of the passed parameters? |
21:03:39 | FromDiscord | <lqdev> yes |
21:03:47 | FromDiscord | <lqdev> they just have to have different parameter types |
21:04:31 | qn68h | good to know, thanks! |
21:04:31 | bung | they have differient signature ,so they are differient procs |
21:04:54 | qn68h | something else, out of topic with the OOP discussion: |
21:05:18 | qn68h | context: i came to nim by searching "something with python syntax, but compiled" (AOT) |
21:05:42 | bung | good keyword :P |
21:05:57 | leorize | technically you can compile python :P |
21:06:06 | qn68h | I already used cython (not cpython), it's great for some time critical projects, but at the end you still need the interpreter |
21:06:18 | qn68h | so it's not really what i was looking for (cython) |
21:06:32 | FromDiscord | <KingDarBoja> _Use Jython_ |
21:06:46 | qn68h | so then I looked at pypy, but it's still interpreted, JIT |
21:06:52 | qn68h | and then i came to nim |
21:06:55 | FromDiscord | <SeanOMik> How would I get the current Unix time? |
21:07:06 | leorize | times.now().toUnix() |
21:07:11 | FromDiscord | <SeanOMik> Ah okay |
21:07:14 | FromDiscord | <Skaruts> you still need the interpreter if you use py2exe? |
21:07:17 | FromDiscord | <SeanOMik> I didn't see the `toUnix` proc |
21:07:19 | FromDiscord | <SeanOMik> Thanks |
21:07:30 | sschwarzer | bung: Do you know the RFC for the `func` topic with refs? |
21:07:35 | FromDiscord | <Yardanico> guys go hop on discord voice chat π |
21:07:38 | qn68h | Skaruts, py2exe just packs everything, but it's still there |
21:07:40 | leorize | !rfc func |
21:07:40 | FromDiscord | <Yardanico> for "afterparty" |
21:07:40 | disbot | https://github.com/nim-lang/RFCs/issues/234 -- 3Add write-tracking to Nim's func 7& 17 more... |
21:07:46 | leorize | sschwarzer: ^ |
21:07:49 | FromDiscord | <Skaruts> ah! |
21:08:04 | sschwarzer | Skaruts: As far as I know, py2exe just puts the interpreter into the package. |
21:08:10 | sschwarzer | leorize: Thanks! |
21:08:11 | qn68h | sschwarzer, exactly |
21:08:15 | leorize | glorified 7zsfx? :P |
21:08:18 | bung | yeah that's one,thanks, I dont have good memory. |
21:08:21 | qn68h | same for cx_freeze, pyinstaller, etc. |
21:08:59 | qn68h | do you think that exists? a AOT-compiled version of Python, that doesn't require the interpreter at the end? |
21:09:18 | qn68h | like C or C++ or nim but with exactly the same syntax of python + type defs |
21:09:25 | FromDiscord | <Skaruts> I never found one... |
21:09:37 | FromDiscord | <Skaruts> well... I found Nim π |
21:09:40 | sschwarzer | leorize: Wow, interesting |
21:09:47 | qn68h | Nim seems the closest, right? |
21:09:57 | sschwarzer | And regarding Jython, it's still on Python 2.7 |
21:10:03 | FromDiscord | <Skaruts> as far as I've seen, yea |
21:10:14 | qn68h | would it technically possible to do a "dialect" of nim, that uses the exact same API than python? |
21:10:49 | qn68h | i.e. print() instead of echo, import json; json.dumps({"key":"value"}) , class A(ParentClass): ... |
21:10:59 | FromDiscord | <KingDarBoja> I was being sarcastic, hence the italic text |
21:10:59 | sschwarzer | qn68h: Tricky, because Python _can_ do some things that Nim can't. |
21:11:00 | FromDiscord | <Skaruts> I suppose, I mean, you can this: https://forum.nim-lang.org/t/5758 |
21:11:00 | FromDiscord | <lqdev> totally yeah |
21:11:02 | FromDiscord | <Skaruts> π |
21:11:03 | Yardanico | qn68h: yeah |
21:11:05 | Yardanico | there was py2nim |
21:11:33 | FromDiscord | <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:35 | leorize | qn68h: I'd recommend that you not try to write Nim like you write python |
21:11:37 | sschwarzer | Also, the handling of unicode is totally different. |
21:11:41 | Yardanico | nimpylib isn't the complete solution |
21:11:48 | leorize | everything here look similar but is completely different |
21:11:49 | sschwarzer | leorize: Yep! |
21:11:50 | Yardanico | https://github.com/metacraft-labs/py2nim_deprecated would be the one |
21:11:56 | Yardanico | my nimpylib is kinda meh :D |
21:12:18 | FromDiscord | <Shucks> well I didnt tried it but looks like coding python in nim?.. i guess |
21:12:20 | zedeus | is dsrw on here? |
21:12:28 | leorize | !seen dsrw |
21:12:29 | dsrw | Yep |
21:12:29 | disbot | dsrw 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:56 | zedeus | ah hey, I meant a repl for godot that you can access from the scene view |
21:13:10 | zedeus | someone made one for Unity way back but I can't find it now |
21:13:19 | dsrw | I definitely plan to add a repl. |
21:13:34 | sschwarzer | Write 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:35 | dsrw | With nim though of course. Not gdscript. |
21:13:44 | sschwarzer | *despite |
21:15:06 | zedeus | sweet |
21:15:17 | qn68h | sschwarzer, yes that's true, i observed the same thing along the years |
21:15:47 | qn68h | but still after decades of coding in more than 10 or 15 lang i think, i really found python has the perfect syntax |
21:15:51 | dsrw | And 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:11 | sschwarzer | Actually I enjoy the non-Python-like parts a lot, or at least many of them :) |
21:16:22 | * | waleee-cl joined #nim |
21:16:44 | qn68h | sschwarzer, just an example: |
21:16:44 | leorize | qn68h: just try something new for a bit :P |
21:16:54 | sschwarzer | qn68h: Yes, I'm fine with the Python syntax :-) I don't know if perfect, but quite good. |
21:17:14 | qn68h | in how many lang can you do this so easily? : print([len(word) for w in sorted(words) if "hello" in w]) |
21:18:01 | qn68h | leorize, definitely, i will try it! btw sorry for maybe sounding whining "why is it not exactly like python ;)" i apologize for that! |
21:18:02 | FromDiscord | <willyboar> We gonna have a hackathon????? |
21:18:14 | * | solitudesf quit (Ping timeout: 240 seconds) |
21:18:16 | leorize | I'd rewrite that in Nim for you if I can understand that python snippet :P |
21:18:29 | sschwarzer | leorize: 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:54 | qn68h | sschwarzer, same for me |
21:19:20 | sschwarzer | But then I wanted something with static typing and faster. ;-) |
21:19:37 | zedeus | dsrw: here's one for some inspiration https://github.com/hecomi/uREPL |
21:19:41 | FromDiscord | <willyboar> Open a hackathon channel |
21:19:50 | leorize | we have a hackathon? |
21:20:00 | sschwarzer | Ironically, I got a hint to look at Nim in a talk on asyncio in Python. :-) |
21:20:01 | FromDiscord | <Yardanico> I think we had a forum thread, no? |
21:20:08 | dsrw | zedeus: Nice. Thanks a lot. Checking it out now. |
21:21:18 | FromDiscord | <willyboar> Yeap. I opened it. But was for a hackathon in parallel with conf |
21:21:37 | FromDiscord | <Yardanico> well you can always do it separately |
21:21:45 | FromDiscord | <Yardanico> the idea with small showcasing of libraries seems cool |
21:21:47 | sschwarzer | By the way, just noticed it should be `len(w)`, not `len(word)`. ;-) |
21:22:38 | sschwarzer | Sorry, for nitpicking. I don't know why I'm even writing this. ;-/ |
21:22:50 | FromDiscord | <willyboar> The idea is to create an MVP in 2-3 days |
21:23:00 | FromDiscord | <willyboar> Like lurum something.... |
21:23:03 | FromDiscord | <Yardanico> @KingDarBoja https://github.com/nim-lang/Nim/wiki/Curated-Packages |
21:23:19 | Araq | good night! |
21:23:25 | FromDiscord | <Yardanico> good night π |
21:23:39 | FromDiscord | <willyboar> Curated pages is nice but as I stayed before we must re activate awesome nim |
21:24:04 | FromDiscord | <willyboar> Mobile auto corrector sucks |
21:24:13 | FromDiscord | <Yardanico> ah wait |
21:24:14 | FromDiscord | <Yardanico> I sent wrong link |
21:24:19 | leorize | sschwarzer: 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:25 | FromDiscord | <Yardanico> @KingDarBoja I meant https://github.com/nim-lang/Nim/wiki/Companies-using-Nim |
21:25:11 | qn68h | sschwarzer, haha you're right |
21:25:17 | FromDiscord | <Reki> https://github.com/alehander92/comprehension |
21:25:23 | FromDiscord | <KingDarBoja> Thank you @Yardanico |
21:25:36 | leorize | sugar.collect superseded that one @Reki |
21:25:43 | FromDiscord | <Reki> ah |
21:25:47 | qn68h | leorize, nice indeed! |
21:27:08 | FromDiscord | <UnnoTed> does the nim compiler runs on a raspberry pi? |
21:27:26 | leorize | yes it does |
21:28:14 | FromDiscord | <djazz> Yes |
21:28:38 | FromDiscord | <mratsim> I regularly run Nim on Rpi |
21:29:01 | FromDiscord | <mratsim> and on Andoird phones |
21:29:29 | FromDiscord | <mratsim> we test that regularly at Status because we target mobile and ARM |
21:30:35 | * | Tyresc joined #nim |
21:31:52 | FromDiscord | <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:26 | leorize | Yardanico: ^ crossed irc limits :P |
21:32:37 | Yardanico | wait wat |
21:32:37 | Yardanico | how |
21:32:51 | Yardanico | leorize: it ends as "feel like I've learned a lot about Nim." |
21:34:04 | sschwarzer | Bye everyone! :-) |
21:34:05 | leorize | @l1pz your code is pretty decent :) |
21:34:14 | * | sschwarzer quit (Quit: leaving) |
21:35:19 | FromDiscord | <Yardanico> https://nim-lang-cn.org/ |
21:35:27 | FromDiscord | <l1pz> "crossed irc limits :P". You mean I shouldn't have sent it here? |
21:35:29 | leorize | @l1pz you're not closing the HttpClient you opened |
21:35:54 | leorize | it's just something to tell Yardanico to fix :P |
21:36:12 | leorize | his bot is not aware of the IRC message length limit |
21:36:41 | FromDiscord | <Skaruts> Defied the Laws of IRC |
21:36:44 | FromDiscord | <l1pz> I see. About not closing HttpClient, so that's why I have high ram usage |
21:37:00 | FromDiscord | <l1pz> I mean like 30-40mb |
21:37:10 | FromDiscord | <l1pz> Which is quite a lot for a program like this I think |
21:37:19 | leorize | for your download proc, just close(downloader) at the end |
21:37:27 | leorize | put it in a defer just to be sure |
21:37:32 | bung | dont know why not just `var bar = newProgressBar` |
21:38:08 | leorize | you should also avoid `auto` return type |
21:38:25 | leorize | it's nice for prototyping, but it usually helps with documentation when the return type is documented |
21:38:49 | FromDiscord | <Elegant Beef> Is auto type inference based off what you set result equal to? |
21:39:01 | leorize | yep |
21:39:07 | FromDiscord | <Elegant Beef> Ah that's scary then |
21:39:19 | FromDiscord | <l1pz> I copied that from Nim's source code |
21:39:33 | FromDiscord | <l1pz> It's the modified version of the all() proc |
21:40:19 | leorize | an another reason why your program is using so much ram is due to the excessive memory allocation from the usage of sequtils |
21:40:21 | FromDiscord | <l1pz> bung, because that way I couldn't have passed it to the checkDownloads proc |
21:40:49 | FromDiscord | <Yardanico> https://github.com/nim-lang-cn/ |
21:41:24 | FromDiscord | <Elegant Beef> yard i assume you're dropping links for voice chat? |
21:41:33 | FromDiscord | <Elegant Beef> If so, just make a discord only #voice-chat |
21:41:57 | leorize | @l1pz you can optimize this a bit by making `checkDownloads` apply to one `Future[void]` |
21:42:24 | leorize | so basically you get a `Future[void]` from `download` then `checkDownload()` on it directly before you move it into the seq |
21:42:54 | leorize | wait actually, I'm not reading this correctly :P |
21:43:10 | leorize | ah, I see why you're doing it this way |
21:43:20 | FromDiscord | <Yardanico> https://www.youtube.com/playlist?list=PLXIivpcMlfwAevvA4IvLIiYOujqSuyyKY |
21:43:21 | FromDiscord | <Elegant Beef> i'd also say the use of the "word" `chandl` is quite weird |
21:43:24 | FromDiscord | <l1pz> Asynchronous programming is really new to me |
21:43:26 | FromDiscord | <Elegant Beef> I have no clue what chandl is π |
21:43:39 | leorize | Yardanico: libman has been banned from the forum iirc |
21:43:42 | bung | you can new it and pass it.addr or checkDownloads accept var ProgressBar |
21:43:43 | FromDiscord | <l1pz> First it was 4chandl |
21:43:44 | Yardanico | leorize: oh lol |
21:43:51 | FromDiscord | <l1pz> But it was not a valid package name |
21:44:04 | FromDiscord | <l1pz> Because it stared with a number |
21:44:06 | FromDiscord | <Elegant Beef> fourchandownload π |
21:44:11 | FromDiscord | <Yardanico> f4chandl |
21:44:25 | FromDiscord | <Elegant Beef> Im talking about the proc name btw |
21:44:32 | FromDiscord | <Elegant Beef> i dont care about the package name |
21:45:05 | FromDiscord | <Elegant Beef> download4Chan |
21:45:11 | FromDiscord | <Yardanico> lol |
21:45:12 | FromDiscord | <Elegant Beef> There we did it readabilliity! |
21:45:27 | FromDiscord | <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:56 | FromDiscord | <l1pz> ProgressBar is from a library called progress |
21:46:06 | FromDiscord | <Elegant Beef> That doesnt matter |
21:46:12 | FromDiscord | <Elegant Beef> You can make a reference of anytype |
21:46:15 | FromDiscord | <Elegant Beef> any type* |
21:46:27 | FromDiscord | <l1pz> type ProgressBar = ref ProgresBar |
21:46:51 | FromDiscord | <Elegant Beef> RProgressBar |
21:46:57 | FromDiscord | <Elegant Beef> We can do hungarian notation π |
21:47:01 | * | testnimnoob joined #nim |
21:47:04 | FromDiscord | <Yardanico> BarProgressR |
21:47:08 | FromDiscord | <Yardanico> XD |
21:47:28 | FromDiscord | <dom96> nooo |
21:47:31 | testnimnoob | is vscode the current editor with most useful plugins ? |
21:47:31 | FromDiscord | <dom96> ProgressBarRef |
21:47:35 | FromDiscord | <Elegant Beef> All the cool kids are in voice π |
21:47:35 | FromDiscord | <dom96> is the convention IIRC |
21:47:42 | FromDiscord | <Elegant Beef> Yea no clue convention there |
21:47:45 | leorize | ProgressBar = ref progress.ProgressBar |
21:47:48 | leorize | easy |
21:47:48 | FromDiscord | <Elegant Beef> Vscode is probably the easiest to use |
21:48:18 | FromDiscord | <Elegant Beef> Using qualiifications ... |
21:48:24 | leorize | testnimnoob: if you use neovim, nim.nvim is on par with vscode |
21:48:39 | testnimnoob | lol guess im using neovim |
21:48:41 | FromDiscord | <Elegant Beef> I am kidding in this case that's completely fine! |
21:49:00 | FromDiscord | <KingDarBoja> Join us @Elegant Beef |
21:49:09 | FromDiscord | <KingDarBoja> Join the dark side |
21:49:17 | leorize | testnimnoob: keep in mind that I'm super biased since I wrote it :P |
21:49:24 | testnimnoob | oh |
21:49:26 | FromDiscord | <Yardanico> https://github.com/nim-lang/Nim/commit/10bd488daafa79f52fec0d5e7ea76ec8d5902465 |
21:49:33 | testnimnoob | hehe ive never used neovim |
21:49:37 | testnimnoob | lemme install |
21:49:45 | leorize | but I do have many happy users :P |
21:49:54 | leorize | !repo alaviss/nim.nvim |
21:49:54 | disbot | https://github.com/alaviss/nim.nvim -- 9nim.nvim: 11Nim plugin for NeoVim 15 83β 11π΄ |
21:49:58 | leorize | there's a small demo in there |
21:50:36 | FromDiscord | <19> https://github.com/mystor/slag |
21:50:50 | FromDiscord | <19> this is the rust version of 'syntax skins' |
21:50:55 | FromDiscord | <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:00 | testnimnoob | lol fish also |
21:51:05 | testnimnoob | lemme install that too |
21:51:11 | FromDiscord | <Lantos> sent a code paste, see https://discordapp.com/channels/371759389889003530/371759389889003532/724018533729697923 |
21:51:12 | testnimnoob | im learning so much |
21:51:16 | FromDiscord | <Yardanico> @19 well you can do the same in Nim |
21:51:18 | FromDiscord | <Lantos> (edit) |
21:51:19 | FromDiscord | <Yardanico> as a preprocessor if you want |
21:51:31 | FromDiscord | <19> @l1pz play VimTutor everyday |
21:51:35 | FromDiscord | <Yardanico> just copy the old syntax skins tokenizer and make it standalone π |
21:51:53 | FromDiscord | <Yardanico> https://github.com/nim-lang/Nim/blob/10bd488daafa79f52fec0d5e7ea76ec8d5902465/tests/parser/tbraces.nim |
21:52:05 | FromDiscord | <19> thats a great idea, but i love the py syntax :D its just for ppl who dont :D |
21:52:16 | leorize | @Yardanico you do know you have #discord-only channel, right? :P |
21:52:46 | FromDiscord | <KingDarBoja> _why use braces, why not parenthesis like-lisp_ |
21:52:54 | testnimnoob | @l1pz vim is awesome |
21:53:03 | Yardanico | leorize: yeah |
21:53:05 | testnimnoob | i thought people were wizards when i first saw them use it |
21:53:12 | Yardanico | @KingDarBoja you already kinda can |
21:53:23 | FromDiscord | <l1pz> I know. I watched a lot of videos about it, I really want learn it some day. |
21:53:57 | testnimnoob | it's not too bad idk it felt natural |
21:53:59 | leorize | you won't start out with vim doing magic editing keystrokes :P |
21:54:09 | FromDiscord | <willyboar> There is a nim similar to vim editor |
21:54:11 | FromDiscord | <willyboar> Mor |
21:54:18 | FromDiscord | <willyboar> Moe |
21:54:18 | leorize | !repo moe |
21:54:20 | disbot | https://github.com/fox0430/moe -- 9moe: 11Command line based editor. Written in Nim. 15 132β 11π΄ 7& 2 more... |
21:54:30 | Yardanico | there's also paravim |
21:54:36 | leorize | !repo paravim |
21:54:37 | disbot | https://github.com/paranim/paravim -- 9paravim: 11A Vim-based editor for Nim 15 66β 2π΄ |
21:55:10 | FromDiscord | <willyboar> I think Moe is not vim based but vim inspired |
21:55:12 | testnimnoob | it looks like vim leorize |
21:55:13 | leorize | !repo vim_cubed |
21:55:14 | disbot | https://github.com/oakes/vim_cubed -- 9vim_cubed: 11Vim rendered on a cube for no reason 15 2231β 34π΄ |
21:55:17 | FromDiscord | <willyboar> I am not sure |
21:55:19 | leorize | ^ best editor, fight me |
21:55:48 | leorize | testnimnoob: well it's a vim fork :P |
21:55:55 | leorize | has more features though |
21:56:38 | FromDiscord | <l1pz> You mean vim has more features? |
21:56:44 | FromDiscord | <l1pz> Or moe? |
21:56:45 | FromDiscord | <willyboar> But Moe don't support nimlsp yet |
21:58:08 | FromDiscord | <willyboar> !last disruptek |
21:58:09 | disbot | disruptek spoke in 12#nim-news 6 hours ago |
21:58:59 | * | qn68h left #nim ("Leaving") |
22:02:28 | FromDiscord | <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:44 | FromDiscord | <l1pz> It was with the same link. |
22:02:52 | zedeus | what version |
22:03:19 | FromDiscord | <l1pz> Nim version? |
22:03:21 | zedeus | yea |
22:03:33 | FromDiscord | <l1pz> 1.2.0 |
22:03:45 | zedeus | update to 1.2.2, it has been fixed |
22:03:48 | leorize | I fixed that in devel |
22:03:52 | leorize | it's not backported |
22:03:55 | zedeus | it is |
22:04:16 | leorize | it's kind of a breaking change |
22:04:20 | zedeus | I'm certain I saw it.. |
22:04:34 | leorize | nope :P |
22:05:00 | leorize | it's a breaking change but doesn't fit the security bill to justify a backport I guess |
22:05:00 | zedeus | I guess I just glanced over it, it's just dom's dynamic loading fix |
22:05:27 | zedeus | oh well, people will just have to deal with their program randomly crashing if they wanna use httpclient then :) |
22:06:05 | leorize | well it's not that random... |
22:06:28 | zedeus | for me it was, but I'm sure you can trigger it |
22:06:47 | leorize | you should've reported it lol |
22:06:54 | zedeus | it was recorded years ago |
22:06:59 | zedeus | reported* |
22:07:12 | leorize | oh? |
22:07:25 | leorize | I only noticed it when Avatarfighter was having some trouble writing a scraper |
22:07:31 | zedeus | I commented on the issue here https://github.com/nim-lang/Nim/issues/9867#issuecomment-610323411 |
22:07:32 | disbot | β₯ Long-lived application occasionally dies with SIG_PIPE when calling httpclient.request ; snippet at 12https://play.nim-lang.org/#ix=2aMk |
22:07:52 | zedeus | the issue itself is about another error, but the things you fixed were discussed as well |
22:08:17 | leorize | maybe that one is also fixed now :p |
22:08:19 | * | neceve_ quit (Ping timeout: 258 seconds) |
22:08:57 | leorize | it appears to revolve around the usage of SSL_shutdown, which I fixed |
22:09:01 | leorize | so... probably working? |
22:09:07 | zedeus | probably, yeah |
22:09:28 | zedeus | I 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:15 | testnimnoob | leorize "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:32 | testnimnoob | is it because my nim for this project is too old ? |
22:14:34 | leorize | neovim >= 0.4.3? |
22:15:15 | leorize | your neovim might be too old :P |
22:16:00 | testnimnoob | NVIM v0.2.2 |
22:16:05 | * | dchem quit (Ping timeout: 246 seconds) |
22:16:25 | leorize | damn, that's olddddd |
22:16:35 | leorize | are you on centos or smt? |
22:18:25 | leorize | if 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:23 | testnimnoob | kde neon lol |
22:20:42 | leorize | so basically kubuntu lts |
22:20:49 | leorize | yea you will want that ppa :P |
22:21:59 | FromDiscord | <--HA--> Is there a find or similar for sequences that returns the index of the element? |
22:22:14 | leorize | yes, and in fact, the proc is called `find()` |
22:22:59 | FromDiscord | <--HA--> I can't find it in the docs |
22:23:59 | leorize | it's in the system module |
22:24:07 | leorize | the doc search is funky at times though |
22:24:09 | leorize | ~theinde |
22:24:09 | disbot | no footnotes for `theinde`. π |
22:24:11 | leorize | ~theindex |
22:24:11 | disbot | no footnotes for `theindex`. π |
22:24:16 | leorize | ~index |
22:24:16 | disbot | no footnotes for `index`. π |
22:24:40 | zedeus | ~index is https://nim-lang.org/docs/theindex.html |
22:24:40 | disbot | index: 11https://nim-lang.org/docs/theindex.html |
22:24:44 | * | hecanjog quit (Ping timeout: 256 seconds) |
22:24:57 | * | vicfred joined #nim |
22:25:18 | leorize | @--HA-- https://nim-lang.org/docs/system.html#find%2CT%2CS |
22:25:25 | leorize | this is probably why you couldn't find it :P |
22:26:01 | * | nikita` quit (Quit: leaving) |
22:26:38 | * | hecanjog joined #nim |
22:26:45 | FromDiscord | <--HA--> Thanks |
22:28:36 | leorize | nimconf does bought a decent amount of people into #nim, which is pretty nice :) |
22:28:46 | leorize | bring* |
22:30:45 | FromDiscord | <willyboar> Except that it was an inspiration for current nimers |
22:31:35 | testnimnoob | yay it works |
22:31:42 | testnimnoob | ty ! |
22:31:50 | leorize | np :) |
22:32:35 | FromDiscord | <--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:23 | testnimnoob | pretty noob friendly plugin so far leorize. i dont know jack about programming lol |
22:34:02 | leorize | I wrote that plugin to be as foolproof as possible :P |
22:34:20 | leorize | glad that it's working well there |
22:34:36 | leorize | @--HA-- well I guess you'll have to make one yourself |
22:36:22 | FromDiscord | <--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:42 | FromDiscord | <--HA--> *find sorry |
22:37:39 | leorize | you can write one and contribute it :) |
22:37:56 | leorize | https://play.nim-lang.org/#ix=2pHZ |
22:38:02 | leorize | ^ that's how you'd write one |
22:42:39 | * | synshroud_ joined #nim |
22:43:46 | FromDiscord | <l1pz> There should be something like this in the standard library. Like C++'s find_if |
22:44:26 | * | vsantana_ joined #nim |
22:44:29 | leorize | it's not in because no one find the interest to contribute one :P |
22:45:08 | leorize | you 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:23 | FromDiscord | <l1pz> Which module would be the right place? sequtils? |
22:46:32 | FromDiscord | <--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:36 | leorize | yep |
22:47:03 | * | vsantana quit (Ping timeout: 260 seconds) |
22:47:13 | leorize | my bad, forgot the break |
22:47:19 | leorize | and the -1 for not found :P |
22:50:20 | FromDiscord | <--HA--> That's pretty cool. Never did anything with templates or macros. I have a lot to read and learn. |
22:52:07 | FromDiscord | <juan_carlos> I can not use Fidget Figma Plugin from the Web browser?, I think not just to be sure. |
22:52:33 | leorize | yep, Nim syntax flexibility and templates make this kind of thing really easy to do |
22:53:01 | * | tane joined #nim |
22:54:41 | FromDiscord | <Yardanico> https://forum.my-toolbox.xyz/ |
22:57:21 | FromDiscord | <l1pz> I made the find function more similar to filter in structure. https://play.nim-lang.org/#ix=2pI6 |
22:58:02 | leorize | you can just call it `find()` :P |
22:58:21 | leorize | we usually provide an `It` version which uses template |
22:58:31 | leorize | it's faster than using a closure and the syntax is handy too |
22:59:22 | FromDiscord | <l1pz> I see. I C++ find returns the element itself, which fullfils the criteria. That's why findIf is separate |
22:59:58 | FromDiscord | <l1pz> But we could name it search |
23:00:04 | FromDiscord | <l1pz> Or something |
23:00:09 | leorize | sure |
23:00:21 | leorize | as long as the If part is not there I'm fine :P |
23:00:37 | leorize | (just for consistency with the APIs in sequtils) |
23:00:41 | FromDiscord | <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:55 | FromDiscord | <l1pz> I've never really contributed to an open source project... |
23:01:05 | leorize | yep, tests and documentation |
23:01:25 | leorize | so you basically fork the repo, make a branch, commit your changes, then open a PR |
23:01:45 | FromDiscord | <l1pz> Thanks. I'll look into it tomorrow. |
23:02:25 | leorize | ~nep1 |
23:02:26 | disbot | nep1: 11https://nim-lang.org/docs/nep1.html |
23:02:34 | leorize | ^ refer to that for the code styling |
23:02:36 | leorize | ~apis |
23:02:37 | disbot | no footnotes for `apis`. π |
23:02:40 | leorize | ~api |
23:02:41 | disbot | api: 11https://nim-lang.org/docs/theindex.html |
23:02:45 | Yardanico | not this one disbot |
23:02:58 | leorize | ~apis is https://nim-lang.org/docs/apis.html |
23:02:59 | disbot | apis: 11https://nim-lang.org/docs/apis.html |
23:03:00 | Yardanico | yeah |
23:03:02 | Yardanico | ~apis |
23:03:03 | disbot | apis: 11https://nim-lang.org/docs/apis.html |
23:03:03 | leorize | ^ that one for api naming |
23:03:24 | FromDiscord | <willyboar> disbot: are you high right now? |
23:03:28 | Yardanico | he's low |
23:03:37 | FromDiscord | <willyboar> Yeap |
23:03:49 | FromDiscord | <willyboar> Where is disruptek today? |
23:04:19 | FromDiscord | <willyboar> He missed all the goodies |
23:04:24 | FromDiscord | <Yardanico> Overall amazing day today, thanks guys, I enjoyed the conf and voice chat a lot |
23:05:36 | FromDiscord | <willyboar> I think everyone enjoy it |
23:06:15 | FromDiscord | <Elegant Beef> Psh i cleary was the reason the voice chat was popular, when i left everyone did π |
23:06:41 | FromDiscord | <willyboar> This is true |
23:07:03 | FromDiscord | <Elegant Beef> ~~It was not that everyone else was muted~~ |
23:07:18 | FromDiscord | <willyboar> Nah |
23:07:42 | FromDiscord | <Yardanico> There's one thing we need to remember |
23:07:45 | FromDiscord | <Yardanico> https://i.imgur.com/wSvP4O2.png |
23:08:15 | FromDiscord | <exelotl> wow that's beautiful |
23:08:25 | FromDiscord | <Elegant Beef> I could've been 11 if it wasnt for being hosted at 4am |
23:08:34 | FromDiscord | <willyboar> Araq spamming? |
23:08:38 | FromDiscord | <Yardanico> Yes |
23:08:39 | FromDiscord | <Vindaar> pff, I'm gone for a few minutes and suddenly I'm alone π |
23:08:51 | FromDiscord | <Yardanico> @willyboar don't tell anyone |
23:09:17 | FromDiscord | <willyboar> Of course not |
23:16:22 | * | exelotl quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
23:19:15 | FromDiscord | <KingDarBoja> I wasn't there lol |
23:19:22 | FromDiscord | <KingDarBoja> Only on voice chat |
23:29:22 | * | arecaceae quit (Remote host closed the connection) |
23:29:46 | * | arecaceae joined #nim |
23:39:28 | FromDiscord | <l1pz> There is typo in documentation |
23:41:15 | FromDiscord | <l1pz> On template filterIt, See also: fliter proc, instead of filter |
23:41:43 | FromDiscord | <l1pz> iterator filter has it too |
23:42:27 | FromDiscord | <--HA--> That might be auto generated from source code comments and you can fix it with a PR I'm guessing. |
23:43:26 | FromDiscord | <Elegant Beef> Yep go make a PR for all the spelling mistakes! |
23:43:28 | FromDiscord | <l1pz> Yeah, I was browsing the source code, and saw it. Checked on the docs, you can see it there too |
23:43:30 | FromDiscord | <Elegant Beef> There's a fair bit of them |
23:43:44 | FromDiscord | <juan_carlos> That explains a lot π https://github.com/Figma-Linux/figma-linux/issues/53#issuecomment-603326060 |
23:43:45 | disbot | β₯ Plan on supporting plugin creation through linux client |
23:52:56 | * | tane quit (Quit: Leaving) |