01:21:43 | * | mahlon quit (Ping timeout: 244 seconds) |
01:27:28 | * | mahlon joined #nim |
01:56:53 | * | jimmoth_44 joined #nim |
01:59:33 | * | jimmoth_44 quit (Client Quit) |
02:10:15 | FromDiscord | <Just Jasmine, Please> Hi! I'm getting back into nim after a little break and was wondering if there where any good tutorials on making games using godot and nim? Not necessarily setting it up, I feel that I would learn faster if I could see how the language interacts with godot |
02:29:53 | FromDiscord | <impbox [ftsf]> I've seen a few people posting about using nim with Godot in the #gamedev channel, not sure if there's any tutorials but maybe someone can help you out |
02:42:08 | FromDiscord | <hyu1996> choosenim does not support centos7.6 |
02:42:24 | FromDiscord | <hyu1996> https://media.discordapp.net/attachments/371759389889003532/907822468960501760/unknown.png |
02:43:29 | FromDiscord | <hyu1996> I need to install a new version of the compiler to compile the new version of glibc |
02:44:37 | FromDiscord | <Rika> afaik choosenim expects modern glibc yeah |
02:52:48 | NimEventer | New thread by Tmsa04: Fix for Warning: implicit conversion to 'cstring' from a non-const location, see https://forum.nim-lang.org/t/8608 |
02:55:02 | * | neurocyte0132889 quit (Ping timeout: 240 seconds) |
03:03:32 | * | krux02 quit (Quit: Leaving) |
03:11:20 | FromDiscord | <Yardanico> In reply to @hyu1996 "I need to install": If you just want Nim on an system with old glibc you can get nightlies for 1.6 branch |
03:12:25 | FromDiscord | <Yardanico> https://github.com/nim-lang/nightlies/releases/tag/2021-10-19-version-1-6-727c6378d2464090564dbcd9bc8b9ac648467e38 |
03:12:55 | FromDiscord | <Yardanico> binaries there are statically linked with musl |
03:13:19 | FromDiscord | <Yardanico> Also this is not a "nightly" in the stability sense, but the 1.6 release |
03:17:27 | FromDiscord | <ajusa> How do I install Futhark on Linux? https://github.com/PMunch/futhark↵I'm getting a `cannot find -lclang`, not sure what packages I need other than clang. Also not sure what path I'm supposed to pass to it |
03:18:22 | FromDiscord | <ajusa> And I answered my own question: I needed to install `clang-devel`, my bad |
03:24:35 | FromDiscord | <hyu1996> In reply to @Yardanico "If you just want": thx bro, I am already compiling gcc7.5 |
03:32:16 | FromDiscord | <hyu1996> this code is a bit counter-intuitive https://media.discordapp.net/attachments/371759389889003532/907835018653618196/WXGEQIVVKCXUWBZIKLB.png |
03:37:23 | FromDiscord | <hyu1996> This is the result of running python https://media.discordapp.net/attachments/371759389889003532/907836310058856458/unknown.png |
03:40:15 | FromDiscord | <hyu1996> intuitively, the path a/../d/e is d/e, not a/d/e |
03:44:14 | * | arkurious quit (Quit: Leaving) |
03:48:05 | FromDiscord | <Rika> In reply to @hyu1996 "intuitively, the path `a/../d/e`": python does not resolve ".." afaik |
03:54:07 | FromDiscord | <hyu1996> there is bad news. my glibc is broken. I will take a moment to restore from the system backup. https://media.discordapp.net/attachments/371759389889003532/907840518610907216/unknown.png |
03:57:21 | FromDiscord | <hyu1996> In reply to @Rika "python does not resolve": I think python’s approach is correct because`a` is not the root directory, it is a relative directory |
04:06:01 | * | supakeen quit (Quit: WeeChat 3.3) |
04:06:32 | * | supakeen joined #nim |
04:16:50 | Amun-Ra | 7.6 is eol, what can you do |
04:32:42 | * | rockcavera quit (Remote host closed the connection) |
04:52:04 | FromDiscord | <hyu1996> in my country, centos7 is still very popular, and many production environments are afraid to upgrade or replace the system easily. |
04:54:25 | FromDiscord | <hyu1996> our company’s test environment is centos7.64, so we use this version of the system for development and testing |
06:06:44 | Amun-Ra | that's pretty unfortunate as iirc they stopped releasing security fixes for 7.x |
07:26:35 | FromDiscord | <evoalg> I get why `newSeqOfCap` is more efficient than Seq, but why would `newSeqOfCap` be used instead of an array? Both are limited by size, and both grab all the memory they need upon initialization ... have I got that right? |
07:27:52 | FromDiscord | <Elegantbeef> sequences can grow |
07:27:58 | FromDiscord | <Elegantbeef> So if you do hit the capacity it can grow over it |
07:28:06 | FromDiscord | <Elegantbeef> But with an array if you need more you're SoL |
07:28:33 | FromDiscord | <evoalg> newSeqOfCap can grow? - oh I didn't know ... |
07:28:52 | FromDiscord | <Elegantbeef> It's just a sequence underneath, it just allocates a given amount on usage |
07:29:39 | FromDiscord | <evoalg> I see ... then what's the difference between the cap and a seq where you define the length? ... ie `newSeq[string](3)` |
07:30:43 | FromDiscord | <Rika> Capacity means only memory |
07:30:50 | FromDiscord | <evoalg> eg `newSeq[string](3)` vs `newSeqOfCap[string](3)` |
07:30:59 | FromDiscord | <Rika> (Empty seq) |
07:31:11 | FromDiscord | <Rika> Defined length means the seq is filled with default entries of the type |
07:31:58 | FromDiscord | <evoalg> ohhhh the Cap version isn't filled ... why is that a good thing? ... I mean why would one be used over the other? |
07:33:52 | FromDiscord | <evoalg> Oh I guess you can filled the already filled one with proper values out of order |
07:34:17 | FromDiscord | <evoalg> but for the Cap version I'd have to use .add |
07:41:02 | FromDiscord | <Elegantbeef> Indeed `newSeq[int](3)[0]` is fine but `newSeqOfCap[int](3)[0]` is an error |
07:50:24 | FromDiscord | <evoalg> Thank you once again for patiently & expertly answering my noob questions |
08:00:11 | * | pro joined #nim |
08:08:50 | * | PMunch joined #nim |
08:11:09 | FromDiscord | <evoalg> So I was wrong to think they were limited in size, it's more that they grab that much memory in one go |
08:12:23 | FromDiscord | <Elegantbeef> Yep |
08:12:26 | FromDiscord | <Elegantbeef> You've got it! |
08:13:52 | FromDiscord | <evoalg> Nice lol I'm getting there slowly (with your help) |
08:14:56 | FromDiscord | <Elegantbeef> Hey my help is offered gladly especially today! 😛 |
08:15:13 | FromDiscord | <evoalg> why especially today? |
08:15:51 | FromDiscord | <Elegantbeef> My dogs were attacked when i was walking them today, so the distraction is nice 🙂 |
08:16:14 | FromDiscord | <evoalg> ahhh no sorry to hear that |
08:16:28 | FromDiscord | <evoalg> well I do have another question... |
08:16:33 | FromDiscord | <Elegantbeef> Good |
08:17:06 | FromDiscord | <evoalg> let me prep it .... |
08:19:49 | FromDiscord | <evoalg> https://play.nim-lang.org/#ix=3EyS |
08:20:19 | FromDiscord | <evoalg> I want to know if my "find all" proc is a good idea or if I'm missing something obvious |
08:20:41 | FromDiscord | <Elegantbeef> Depends on what you're after, do you want them all in a collection? |
08:20:44 | FromDiscord | <evoalg> (as I thought there would be the function already in nim but I can't see anything) |
08:21:45 | FromDiscord | <evoalg> I was after the indexes, as I wanted to replace those chars by something else (but not with the same char) |
08:21:56 | FromDiscord | <Rika> I feel like that’s fine |
08:22:10 | FromDiscord | <Rika> If you’re finding all you have to scan all indices |
08:22:19 | FromDiscord | <Rika> Given an unsorted sequence |
08:23:04 | FromDiscord | <evoalg> ok phew - I was thinking I was taking the long way as I usually do 😉 |
08:23:43 | FromDiscord | <Elegantbeef> You can do it a bit simpler(also included an inplace iterator version) https://play.nim-lang.org/#ix=3EyT |
08:24:05 | FromDiscord | <evoalg> oooo let me digest! |
08:24:15 | FromDiscord | <Rika> Smh beef code duplication that’s bad |
08:24:52 | FromDiscord | <Rika> Personally would make the iterator only, I can always use to seq for the value returning version |
08:25:33 | FromDiscord | <Elegantbeef> Yep |
08:28:49 | FromDiscord | <evoalg> woah I'm still trying to figure out how that inplace iterator works |
08:29:30 | FromDiscord | <Elegantbeef> iterators are just copy pastes basically |
08:30:26 | FromDiscord | <Elegantbeef> So where you call `for x in findAllIndsof(s, c)` imagine it copying the iterator body there and each `yield` is doing `let x = yieldValue` followed by your code |
08:31:12 | FromDiscord | <evoalg> ok I sort of get that ... but the yield seems to be returning an address? |
08:31:47 | FromDiscord | <Elegantbeef> yea `var string` `var char` are references |
08:32:16 | FromDiscord | <evoalg> ohhhhh! |
08:32:41 | FromDiscord | <evoalg> lol that's very tricky and cute |
08:33:59 | FromDiscord | <Elegantbeef> What's probably clear is that this wouldnt work for `let` variables, so you'd need to do a copy first |
08:34:17 | FromDiscord | <Elegantbeef> `var myNewStr = myString` before the iterator |
08:34:44 | FromDiscord | <Tuatarian> anyone here do graphics programming in Nim? |
08:34:48 | FromDiscord | <Tuatarian> or game programming |
08:34:56 | FromDiscord | <Elegantbeef> Some schmuck named beef |
08:35:05 | FromDiscord | <Tuatarian> wonder who that could be |
08:35:13 | FromDiscord | <Tuatarian> any idea what tooling he uses? |
08:35:33 | FromDiscord | <Tuatarian> (gameengine/library/whatever) |
08:35:37 | FromDiscord | <Elegantbeef> He's presently using his own "framework" |
08:35:42 | FromDiscord | <Tuatarian> I see |
08:35:48 | FromDiscord | <Tuatarian> has he written it from scratch? |
08:36:08 | FromDiscord | <Elegantbeef> Using SDL2 + opengl + assimp yes |
08:36:11 | FromDiscord | <Tuatarian> if so, I am very impressed with his work |
08:36:19 | FromDiscord | <Tuatarian> what's his opinion on SDL2? |
08:36:27 | FromDiscord | <Elegantbeef> It's fine so far |
08:36:46 | FromDiscord | <Tuatarian> I've been using raylib, but I want to try other things since shaders have never worked properly for me |
08:36:49 | FromDiscord | <Elegantbeef> Window events being in the same event queue as buttons kinda sucks |
08:37:02 | FromDiscord | <Tuatarian> somehow the examples work fine, but my code does not, and I cannot identify the difference between me and the examples |
08:37:06 | FromDiscord | <Tuatarian> oh I see |
08:37:07 | FromDiscord | <Tuatarian> that's strange |
08:37:17 | FromDiscord | <Elegantbeef> drop-2021-11-09\_01.53.02.mp4 https://media.discordapp.net/attachments/371759389889003532/907911779634540554/drop-2021-11-09_01.53.02.mp4 |
08:37:17 | FromDiscord | <Elegantbeef> This is my present work with it |
08:37:27 | FromDiscord | <Elegantbeef> Mostly building it out with it, but truss3d is very much "not finished" |
08:37:30 | FromDiscord | <Tuatarian> pretty solid |
08:37:54 | FromDiscord | <Elegantbeef> Today i was working on framebuffers before the aforementioned event |
08:37:57 | FromDiscord | <Tuatarian> yeah this looks very good |
08:38:03 | FromDiscord | <Tuatarian> the wonder event? |
08:38:12 | FromDiscord | <Tuatarian> window? |
08:38:30 | FromDiscord | <Elegantbeef> Nope the thing about my dogs i mentioned earlier |
08:38:49 | FromDiscord | <Tuatarian> oh god |
08:38:52 | FromDiscord | <Tuatarian> wow I did not see that |
08:38:55 | FromDiscord | <Tuatarian> that's horrible |
08:39:12 | FromDiscord | <Tuatarian> are they ok? |
08:39:17 | FromDiscord | <Elegantbeef> https://github.com/beef331/truss3d if you want to look about the framework feel free too, looking now forgot to throw a license on it |
08:39:38 | FromDiscord | <Tuatarian> debating whether to work from this or to try to make my own thing |
08:39:56 | FromDiscord | <Elegantbeef> Aside from stitches and being uncomfortable yea they're fine, one got vastly more injured |
08:40:18 | FromDiscord | <Elegantbeef> And if you wanted to see how it looks in use the above game is being developed openly |
08:40:26 | FromDiscord | <Elegantbeef> https://github.com/beef331/mindthegap3D |
08:41:16 | FromDiscord | <Tuatarian> how does rendering work with SDL? |
08:41:21 | FromDiscord | <Tuatarian> like lets say I want to draw a triangle |
08:41:32 | FromDiscord | <Elegantbeef> I'm not using sdl2 for rendering |
08:41:39 | FromDiscord | <Tuatarian> pure opengl for rendering? |
08:41:44 | FromDiscord | <Elegantbeef> I'm using opengl for rendering, sdl2 for IO/windowing and assimp for loading models |
08:41:55 | FromDiscord | <Tuatarian> is managing the 3 libs a pain? |
08:42:19 | FromDiscord | <Elegantbeef> Not too bad, i'm using my own fork of the last's bindings to add features i want/need |
08:42:24 | FromDiscord | <Elegantbeef> The other two work as if C |
08:43:22 | FromDiscord | <Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/907913310798770186/image.png |
08:43:26 | FromDiscord | <Elegantbeef> https://github.com/beef331/truss3d/blob/master/examples/shapes.nim generated by this |
08:43:36 | FromDiscord | <Elegantbeef> Just so you can get an understanding of the API presently |
08:45:01 | FromDiscord | <Tuatarian> seems pretty reasonable |
08:45:12 | FromDiscord | <Tuatarian> I really hate the organization of opengl though |
08:45:29 | FromDiscord | <Tuatarian> it basically being a state machine really makes life hard |
08:45:57 | FromDiscord | <Elegantbeef> Yea that's what most of the abstractions are about removing that nusiance part |
08:47:49 | FromDiscord | <Elegantbeef> You might be interested in https://github.com/Ethosa/nodesnim or https://github.com/abisxir/alasgar |
08:54:14 | PMunch | Is the playground down for anybody else? It appears up from my end.. https://forum.nim-lang.org/t/5052#55908 |
08:54:41 | FromDiscord | <Elegantbeef> Fine here |
08:56:33 | FromDiscord | <evoalg> Will you be walking with a big stick in future? Hmmmm I dunno what the answer is |
08:58:01 | FromDiscord | <Elegantbeef> I'm not Teddy Roosevelt |
08:59:10 | FromDiscord | <evoalg> So in your tricky iterator, `s: var string` bit means a ref, and with the `for i, x in s:` part, i and x aren't addresses, but the `yield s[i]` is because s[i] is an address, so that's why you yield that instead of x? |
08:59:31 | FromDiscord | <Elegantbeef> Yep |
08:59:45 | FromDiscord | <Rika> Be careful when calling them references |
08:59:51 | FromDiscord | <Elegantbeef> `for i, x in s` calls `x.pairs` which yields `(int, char)` |
09:00:04 | FromDiscord | <Rika> You’ll get confused easily |
09:00:33 | FromDiscord | <evoalg> I get confused easily enough as it is lol |
09:00:53 | FromDiscord | <Rika> In reply to @evoalg "So in your tricky": Not because it’s an address but because x is immutable |
09:01:25 | FromDiscord | <Rika> s[i] is “var char” and x is “char” |
09:01:41 | FromDiscord | <Rika> You could yield x if you used mitems |
09:02:02 | FromDiscord | <Elegantbeef> But then you need to use your own increment counter |
09:03:09 | FromDiscord | <Rika> ?? What increment counter |
09:03:20 | FromDiscord | <Elegantbeef> `i, x` |
09:03:38 | FromDiscord | <Rika> Again, what about it |
09:03:49 | FromDiscord | <Elegantbeef> Ah right nevermind |
09:03:54 | FromDiscord | <Rika> Smh |
09:03:57 | FromDiscord | <evoalg> interesting! ... I think in python I can change the x (in a for x in...) |
09:04:16 | FromDiscord | <Rika> In reply to @evoalg "interesting! ... I think": Python doesn’t have a concept of immutability |
09:04:30 | FromDiscord | <evoalg> ahh gotcha |
09:04:38 | FromDiscord | <evoalg> I googled smh ... Shaking my head ? |
09:04:41 | FromDiscord | <Rika> Unless you shoehorn it in with custom classes |
09:04:44 | FromDiscord | <Rika> In reply to @evoalg "I googled smh ...": Yes |
09:05:29 | FromDiscord | <evoalg> Do both of you know how to program in C too? |
09:05:39 | FromDiscord | <Elegantbeef> I do not |
09:05:56 | FromDiscord | <Elegantbeef> I know enough C i can wrap stuff, but aside from that i do not know anything |
09:06:32 | FromDiscord | <evoalg> I'm encouraged to hear that because with lots of C talk in this channel I was fearing I'd have to have a good understanding of C to be able to program in nim properly |
09:07:06 | FromDiscord | <Elegantbeef> C will help but to learn lower level stuff Nim will do just aswell |
09:07:32 | FromDiscord | <Elegantbeef> I came from C# a few years ago and didnt have much of a grasp on pretty much any lower level stuff |
09:07:59 | FromDiscord | <evoalg> ahhh interesting! |
09:09:45 | FromDiscord | <Rika> In reply to @evoalg "Do both of you": I do |
09:09:48 | FromDiscord | <Rika> Sorry to say |
09:09:53 | FromDiscord | <Rika> And also unfortunately for me |
09:10:11 | FromDiscord | <evoalg> lol ... why unfortunately? |
09:10:17 | FromDiscord | <Elegantbeef> It's C |
09:10:22 | FromDiscord | <evoalg> lol |
09:10:25 | FromDiscord | <Rika> Try it. You may cry |
09:10:46 | PMunch | Pfft, C isn't all that bad |
09:10:53 | PMunch | Once you get a hang of pointers |
09:11:08 | FromDiscord | <Rika> It isn’t but it is if you’re under time pressure and have to write a lot of shit from scratch |
09:11:21 | FromDiscord | <Rika> Also lack of overloading was painful |
09:11:41 | FromDiscord | <Rika> Library name + type name prefixes |
09:11:43 | FromDiscord | <Rika> How nice |
09:12:30 | FromDiscord | <evoalg> when people talk of C in here, are they talking C or really C++ ? |
09:12:43 | PMunch | I talk of C |
09:12:49 | FromDiscord | <Elegantbeef> Depends if it's Gumber, it's C++ else it's C |
09:13:09 | PMunch | I've programmed C++, but I was told my code resembled C code :P |
09:14:02 | FromDiscord | <evoalg> hehe ... I was under the impression that everyone uses C++ now ... I was lied to |
09:14:34 | FromDiscord | <Elegantbeef> C++ is a common language in some domains |
09:15:11 | FromDiscord | <evoalg> C is faster then C++ and that's why it's still used? |
09:15:23 | FromDiscord | <Elegantbeef> uh oh language speeds 😀 |
09:15:33 | FromDiscord | <evoalg> oh damn sorry |
09:15:43 | FromDiscord | <Elegantbeef> When it comes to system languages they're pretty much all the same |
09:15:47 | FromDiscord | <konsumlamm> you can essentially write C in C++, so not really |
09:16:18 | pro | https://www.youtube.com/watch?v=1i4-e1okZtw 5min thoughts on c+++ |
09:17:27 | FromDiscord | <Rika> Barney starsoup lmao |
09:22:28 | FromDiscord | <evoalg> hash - but interesting |
09:41:54 | FromDiscord | <evoalg> Rika when you said that with the "find all indices" proc and the iterator that code duplication is bad and the iterator is all that's needed (if I understood rightly), how can I use that iterated to get the index rather than the address, if i really wanted the index? |
09:42:24 | FromDiscord | <evoalg> iterator |
09:43:56 | FromDiscord | <Rika> In reply to @evoalg "Rika when you said": You would make the index the “base iterator” and derive an address iterator from that |
09:45:48 | FromDiscord | <evoalg> over my head, but that's ok, I have a lot to learn yet 😉 |
09:46:38 | FromDiscord | <Rika> I use these terms but it’s not specific to Nim |
09:46:49 | FromDiscord | <Rika> I would show how but I am not at a large computer |
09:48:58 | FromDiscord | <evoalg> that's fine! 🙂 |
10:18:33 | FromDiscord | <Zoom> The books are shorter.↵(@evoalg) |
10:38:41 | NimEventer | New thread by Gyohng: Proc doSomething(msg="", opt=-1), see https://forum.nim-lang.org/t/8609 |
10:48:21 | * | NeoCron joined #nim |
10:51:53 | * | NeoCron quit (Remote host closed the connection) |
11:05:44 | Amun-Ra | evoalg: if you don't know the max # of elements compile time you can't use array |
11:06:54 | FromDiscord | <evoalg> ahhh true - thanks! |
11:07:40 | FromDiscord | <Zoom> Sorry for repeating myself. I'd appreciate if any occasional Geany user could comment there\: https://github.com/geany/geany/pull/2988 [HJarausch (HJarausch)](https://matrix.to/#/@hjarausch-54468881db8155e6700cd3cf:gitter.im), you might be interested. |
11:10:12 | FromDiscord | <Rika> Geany users are very limited in number |
11:14:11 | FromDiscord | <Zoom> And the sky is blue. |
11:15:05 | FromDiscord | <Zoom> I like its simplicity, it's nice to quickly drop onto a bare Win machine. |
11:16:42 | FromDiscord | <amadan> Messing around your changes, anything in particular to look for?↵Only issue I can find is that it doesn't pick up nim when trying to build a file |
11:19:28 | FromDiscord | <Zoom> @amadan\: it should look in your path for this. Anyway, if it doesn't pick up it's not this config's fault \:D |
11:19:50 | FromDiscord | <Zoom> It's mostly just an updated identifiers list |
11:23:36 | FromDiscord | <Zoom> Though, it were the missing ident settings that made me do it. Config's been there for two years 🤦 |
11:25:57 | FromDiscord | <amadan> sent a code paste, see https://play.nim-lang.org/#ix=3EzP |
11:26:08 | FromDiscord | <amadan> (edit) "https://play.nim-lang.org/#ix=3EzP" => "https://play.nim-lang.org/#ix=3EzQ" |
11:31:57 | * | koltrast quit (Remote host closed the connection) |
11:33:37 | * | koltrast joined #nim |
11:42:42 | * | krux02 joined #nim |
11:47:42 | FromDiscord | <Zoom> We can add it and complain. It's probably because it uses Python lexer |
11:54:18 | FromDiscord | <Zoom> Hm, Lexilla actually has a lexer for Nim, it's just not imported into Geany. |
12:06:02 | * | supakeen quit (Quit: WeeChat 3.3) |
12:06:32 | * | supakeen joined #nim |
12:07:40 | FromDiscord | <hmmm> yo nimscords, anyone familiar with datamancer? |
12:08:06 | FromDiscord | <Rika> No |
12:08:37 | FromDiscord | <hmmm> rika sama I expect you to be familiar with everything, I'm surprised |
12:09:41 | FromDiscord | <hmmm> I'm kind of surviving the impact by googling how to do xyz in pandas and see if datamancer has the facilities but I'm hitting some roadblocks |
12:10:06 | FromDiscord | <Rika> In reply to @hmmm "rika sama I expect": Why |
12:10:12 | * | Freneticks quit (Quit: WeeChat 2.8) |
12:10:15 | FromDiscord | <Rika> I’m not a data scientist |
12:10:45 | FromDiscord | <hmmm> you are a nim guru I expect you to know everything :3 |
12:11:11 | FromDiscord | <Rika> I haven’t written proper Nim code in probably months |
12:11:29 | FromDiscord | <hmmm> your unproper code is still sama level of quality |
12:11:45 | FromDiscord | <Rika> Okay |
12:11:54 | FromDiscord | <Rika> Well let’s hear your problem then |
12:12:50 | FromDiscord | <hmmm> well there are lots, but the most recent one is that pandas let you select columns without identifier with loc or iloc and I don't know yet how to do it on datamancer |
12:13:24 | FromDiscord | <Rika> Okay now wait for someone who knows about this to answer you lol |
12:13:28 | FromDiscord | <hmmm> lol |
12:13:33 | FromDiscord | <hmmm> I love you rika |
12:13:51 | FromDiscord | <Rika> I’ll actually look into it maybe later but I’m not at my apartment lol |
12:14:48 | FromDiscord | <hmmm> don't worry about it I'm sure I'll find some dataframe guru around, usually it's vindaar |
12:18:23 | arkanoid | though experiment: nim is the third most popular language, millions of developers dive into the community and creates nim packages all over the web. What makes nim more resilient than npm in handling the micropackaging problem? |
12:19:49 | FromDiscord | <Rika> Nothing |
12:22:59 | arkanoid | I'd bet on the type system |
12:23:37 | FromDiscord | <Rika> Hmm I guess that’s true |
12:23:59 | FromDiscord | <Rika> But that wouldn’t stop dumb users abusing auto and adding type names to proc names |
12:27:30 | FromDiscord | <hmmm> having millions of devs means having millions of pages of documentation and tutorials, I'm drooling |
12:27:57 | FromDiscord | <hmmm> why the rest of the world can't understand nim greatness |
12:28:35 | FromDiscord | <hmmm> I mean you write echo "hello" and it does something what's more beautiful than that |
12:31:56 | * | neurocyte0132889 joined #nim |
12:31:56 | * | neurocyte0132889 quit (Changing host) |
12:31:56 | * | neurocyte0132889 joined #nim |
12:32:02 | FromDiscord | <ajusa> Anyone have any idea as to why this library might be slower than python? https://github.com/z-------------/nim-mmdb/blob/master/src/mmdb.nim |
12:33:55 | FromDiscord | <Zoom> sent a code paste, see https://play.nim-lang.org/#ix=3EAg |
12:34:16 | PMunch | Without looking at the code I'm going to guess either unnecessary copying, or poor choice of compilation flags |
12:37:13 | FromDiscord | <faix> millons of devs does having many other problems and other point of views. not all what does twinkle is gold !↵(@hmmm) |
12:38:08 | FromDiscord | <ajusa> In reply to @PMunch "Without looking at the": I used Nim release when I tested it, and after reading it I get the impression that it is idiomatic Nim? |
12:38:56 | FromDiscord | <ajusa> Fwiw I think the python implementation is actually calling C, but straight Nim should be faster than Nimpy |
12:50:04 | * | neurocyte0132889 quit (Quit: The Lounge - https://thelounge.chat) |
12:54:22 | * | neurocyte0132889 joined #nim |
12:54:22 | * | neurocyte0132889 quit (Changing host) |
12:54:22 | * | neurocyte0132889 joined #nim |
13:14:30 | FromDiscord | <sOkam!> New to Nim. Is it possible to create aliases for func, proc and method?↵eg. `fn name()` vs `func name()`↵Saw that macros can do some fancy stuff, but wondering if they include those too |
13:18:48 | FromDiscord | <Rika> you can but it will not be pretty |
13:19:05 | FromDiscord | <Rika> and it wont look exactly like that |
13:19:37 | FromDiscord | <Rika> basically: not without massive amounts of effort and probably many tears, and much changed syntax |
13:37:01 | * | rockcavera joined #nim |
13:37:02 | * | rockcavera quit (Changing host) |
13:37:02 | * | rockcavera joined #nim |
13:45:19 | PMunch | Uhm, not sure what sOkam meant, but it shouldn't be that hard.. |
13:46:09 | FromDiscord | <Yardanico> @PMunch he meant creating keyword aliases |
13:46:20 | FromDiscord | <Yardanico> so instead of "proc" you can write "prc", instead of "func" you write "fn", etc |
13:46:27 | PMunch | Oooh, right |
13:46:38 | PMunch | I thought he meant something like this: https://play.nim-lang.org/#ix=3EAu |
13:46:40 | FromDiscord | <Yardanico> that's easily possible with source code filters, but they don't really understand the syntax so they will also replace the words in the wrong places |
13:46:48 | PMunch | And was confused why @Rika thought that would be painful |
13:46:50 | FromDiscord | <Yardanico> and making a macro for aliased keywords can be pretty hard |
13:47:27 | FromDiscord | <enthus1ast> @sOkam!\: why you wanna do this? |
13:56:07 | FromDiscord | <exelotl> wow lol I went to search something on nimble.directory and saw my own library in the trending section xD |
14:00:12 | FromDiscord | <dom96> you're famous |
14:00:25 | FromDiscord | <dom96> really awesome that nimble.directory has this feature |
14:06:39 | FromDiscord | <hmmm> put nimble.directory on the website somewhere, I lost the link recently and it was a pain to find it again |
14:07:14 | FromDiscord | <exelotl> I was thinking of moving the library to sourcehut but then I'd lose my stars 😅 |
14:07:30 | FromDiscord | <exelotl> they've got me hooked |
14:07:41 | FromDiscord | <hmmm> first world dev problems, I see 😋 |
14:08:53 | * | Gentoolman joined #nim |
14:09:01 | Gentoolman | Hello! |
14:09:33 | pro | welcome |
14:10:55 | FromDiscord | <willyboar> In reply to @hmmm "put nimble.directory on the": there is in the search section here https://nim-lang.org/documentation.html |
14:12:50 | Gentoolman | I would like if you helped me with one thing. I'm trying to set a value in a JSON dictionary, yet it doesn't seem to work with Python-esque syntax |
14:12:52 | FromDiscord | <hmmm> too hidden and it should use the proper name nimble.directory so google can see it. Ideally it should be on main page near irc and github links |
14:12:58 | Gentoolman | Something of that sort |
14:13:01 | Gentoolman | https://pastebin.com/vbuXnTde |
14:13:44 | FromDiscord | <Yardanico> first of all, in nim you have to define new variables with var let or const |
14:13:47 | FromDiscord | <Yardanico> in your case `var` is the best choicer |
14:13:48 | FromDiscord | <Yardanico> (edit) "choicer" => "choice" |
14:14:00 | Gentoolman | That's not the ful source code ;) |
14:14:41 | FromDiscord | <Yardanico> ah right, you need to do % |
14:14:47 | FromDiscord | <Yardanico> %getEnv("VAULT_ROLE_ID") |
14:14:58 | Gentoolman | let me try that one out |
14:15:00 | FromDiscord | <Yardanico> % is defined in json and it makes a json object out of a variable |
14:15:19 | Gentoolman | Damn, that's crazy |
14:15:25 | Gentoolman | Thanks a billion times |
14:19:21 | Gentoolman | My bad, it actually was on json page. :) |
14:30:37 | arkanoid | what is zig c compiler and why it can be used with nim too? |
14:31:15 | FromDiscord | <Yardanico> `zig cc` wraps clang and adds a lot of versions of glibc, musl, mingw to allow cross-compiling for a lot of architectures and OSes |
14:31:42 | FromDiscord | <Yardanico> it's generally easier to use it for cross-compilation because then you don't need to have a separate compiler for every architecture/os combination |
14:32:22 | FromDiscord | <Yardanico> for example https://github.com/Yardanico/ircord/blob/master/zig-compile-vps.sh compiling for an older version of glibc |
14:32:49 | FromDiscord | <Yardanico> -fno-sanitize=undefined is here because `zig cc` has it on by default, and ASAN really doesn't like refc |
14:36:29 | FromDiscord | <dom96> Anybody interested? https://twitter.com/contextfreeinfo/status/1458434818492887049?s=21 |
14:37:37 | FromDiscord | <Yardanico> In reply to @dom96 "Anybody interested? https://twitter.com/contextfree": would it be hard though? they seem to have a simple C interface |
14:38:11 | FromDiscord | <Yardanico> ah, not that simple since they don't use emscripten, so will need to use something like https://github.com/yglukhov/wasmrt |
14:38:57 | FromDiscord | <dom96> anything stopping from using emscripten? |
14:40:09 | FromDiscord | <Yardanico> because wasm-4 is not really made for it? i mean it should be possible, but won't be very simple too |
14:40:14 | FromDiscord | <Yardanico> i can't find anything related to wasm-4 with emscripten |
14:41:01 | FromDiscord | <dom96> In reply to @Yardanico "ah, not that simple": huh, didn't see this before |
14:41:08 | FromDiscord | <dom96> I guess it calls clang to generate wasm? |
14:41:15 | FromDiscord | <Yardanico> yes |
14:42:24 | FromDiscord | <dom96> Another approach: https://github.com/dom96/webasmio |
14:42:44 | FromDiscord | <Yardanico> how would that work for pure wasm though? |
14:42:51 | FromDiscord | <dom96> Much more to implement but also much more fun, if anyone wants to help I'd love to collab |
14:43:06 | FromDiscord | <Yardanico> well, you basically want a wasm backend for nim I guess :P |
14:43:11 | FromDiscord | <dom96> yes |
14:43:44 | FromDiscord | <dom96> I think it's cool this kind of thing is possible as a library |
14:45:45 | FromDiscord | <dom96> Guess I'll be starting an async-wg and a webasm-wg |
14:45:59 | FromDiscord | <dom96> so many fun projects, so little time |
14:46:33 | NimEventer | New post on r/nim by GeroSchorsch: how to pass argument to proc by value without changing its value outside of the proc?, see https://reddit.com/r/nim/comments/qqvzpn/how_to_pass_argument_to_proc_by_value_without/ |
14:48:25 | FromDiscord | <Rika> In reply to @dom96 "so many fun projects,": ikr |
14:51:07 | FromDiscord | <Yardanico> anyway, doing the wasm4 thing now, let's see if it's easy enough |
14:52:54 | FromDiscord | <dom96> awesome, thanks for looking into it 🙂 |
15:08:39 | FromDiscord | <vindaar> Indeed, there is no such thing at the moment. I don't really see the point of indexing a data frame using integers. If you can enlighten me, I might be willing to add the option↵(@hmmm) |
15:10:52 | FromDiscord | <Rika> has anyone made an LV2/LADSPA/some daw plugin with nim? just curious, dont have a specific question |
15:11:57 | FromDiscord | <jorjun-666> On a mac with DYLD_LIBRARY_PATH set to my custom homebrew setup.. but linker is not searching in there.. any tips ? |
15:13:08 | FromDiscord | <enthus1ast> this is for the dynamic linker |
15:14:16 | FromDiscord | <enthus1ast> so it should search on app start for in this folder BUT this depends on how the libraries are linked. iirc nim does not respect this variable (at least on linux) |
15:14:18 | FromDiscord | <jorjun-666> yep, have installed libgd (with homebrew) and getting "dlopen(libgd.dylib, 0x0002): tried: 'libgd.dylib' (no such file), '/usr/local/lib/libgd.dylib' (no such file), '/usr/lib/libgd.dylib' (no such file)" |
15:15:06 | FromDiscord | <jorjun-666> I don't use those folders at all... maybe I can attempt to fix..? |
15:15:09 | FromDiscord | <enthus1ast> in fact, nim calls dlopen / dlsym by itself |
15:15:39 | FromDiscord | <Yardanico> @dom96 that was too easy :) https://media.discordapp.net/attachments/371759389889003532/908012034443075645/unknown.png |
15:15:44 | FromDiscord | <Yardanico> i expected more troubles from the C compiler |
15:16:01 | FromDiscord | <Yardanico> this is their default C example https://media.discordapp.net/attachments/371759389889003532/908012125308481606/unknown.png |
15:16:07 | FromDiscord | <Yardanico> translated to nim |
15:18:31 | FromDiscord | <tandy> is this a nico example in wasm?↵(@Yardanico) |
15:18:40 | FromDiscord | <Yardanico> no, it's https://wasm4.org/docs/ |
15:18:45 | FromDiscord | <Yardanico> In reply to @dom96 "Anybody interested? https://twitter.com/contextfree": ^ |
15:19:07 | FromDiscord | <tandy> oh intersting↵(@Yardanico) |
15:21:03 | FromDiscord | <Yardanico> file size is much higher than the one compiled for C though |
15:21:58 | FromDiscord | <dom96> nice! Do you have Twitter? Can you tweet the example to ContextFreeInfo? 🙂 |
15:23:23 | FromDiscord | <Yardanico> yeah sure I'll tweet him, need to organize the files a bit better though |
15:23:59 | FromDiscord | <enthus1ast> @jorjun-666\: on linux dlopen is used ( https://linux.die.net/man/3/dlopen ) and this should respect the LD\_LIBRARY\_PATH.https://github.com/nim-lang/Nim/blob/141b76e36519219915ada9086d1c9b1d0b465659/lib/system/dyncalls.nim |
15:25:05 | FromDiscord | <Yardanico> @dom96 ah nvm the big file size was because I left out some text code where I tried nim strings (they work) |
15:25:20 | FromDiscord | <Yardanico> but with dynamic allocations wasm cartridge size seems to increase quite a lot (from ~200 bytes to 6kb) |
15:26:20 | FromDiscord | <Yardanico> the resulting binary for the same example in C and Nim is only 6 bytes larger in Nim |
15:26:31 | FromDiscord | <Yardanico> 218 vs 224 |
15:30:21 | FromDiscord | <IsaacPaul> Very cool |
15:30:30 | FromDiscord | <enthus1ast> @jorjun-666\: it seems that the use of DYLD\_LIBRARY\_PATH was restricted, for "system integrity purpose" |
15:31:10 | FromDiscord | <enthus1ast> others also fighting with it, the document that was linked in this thread ( https://github.com/rbenv/rbenv/issues/962 ) is not available any more on the apple site. |
15:32:12 | FromDiscord | <enthus1ast> fuzzy feeling that apple respects your integrity right? \:D |
15:34:38 | FromDiscord | <jorjun-666> In reply to @enthus1ast "others also fighting with": But not my time, right... thanks so much... what do people do symlink libs into current folder? |
15:36:03 | FromDiscord | <enthus1ast> i do not programm on apple devices. But yeah this could work. |
15:36:34 | FromDiscord | <enthus1ast> Another interesting thing could be to strace the execution (if strace is available on macos) and see where it also looks for the lib |
15:36:50 | FromDiscord | <enthus1ast> just for curiosity |
15:39:57 | FromDiscord | <enthus1ast> @jorjun-666\:↵https://stackoverflow.com/questions/39927235/alternative-for-the-dyld-library-path-trick-since-mac-os-10-11-el-capitan-with-shttps://developer.apple.com/library/archive/documentation/DeveloperTools/Conceptual/DynamicLibraries/100-Articles/RunpathDependentLibraries.htmlMaybe this can work, but i think this requires a rebuild of the libs. |
15:40:18 | FromDiscord | <enthus1ast> which defeats the purpose of brew i guess |
15:49:58 | FromDiscord | <pietroppeter> hi @PMunch did you get any response - I remember you asking somewhere - on what do we think about fosdem 2022 (remote)? I see deadline for devroom proposal is in a few days (Nov 15), do we usually propose a devroom or do we wait for an appropriate devroom to be there and send nim talks there? I might be interested in submitting a talk proposal if there is a devroom that fits nim... https://fosdem.org/2022/news/2021-11-02-devroom-cfp/ |
15:51:12 | PMunch | No one responded as far as I know. But I've gotten a couple emails from the minimalistic room that we've been welcome in before (even helped them with organisation a while back) |
15:51:47 | PMunch | Now that we've done NimConf I feel like we have more to show to FOSDEM in regards to what they can expect from a Nim room and the quality of the talks |
15:51:57 | PMunch | So it might be worth trying to get our own room this year |
15:53:36 | FromDiscord | <Yardanico> @dom96 https://github.com/Yardanico/wasm4nim |
15:53:40 | * | arkurious joined #nim |
15:54:04 | FromDiscord | <Yardanico> tweeted to contextfree |
15:56:17 | FromDiscord | <dom96> thanks for the call out about FOSDEM @pietroppeter and PMunch. Would love to see a Nim-specific devroom this time |
15:56:24 | FromDiscord | <dom96> Wasn't there a Zig one last year? |
15:56:36 | PMunch | Was there? |
15:57:00 | PMunch | The deadline for room proposals is in 5 days by the way |
15:57:53 | FromDiscord | <pietroppeter> thanks @PMunch for the answer, good to know @dom96 is in on this. pretty new to FOSDEM so I would prefer not taking ownership of anything (except a talk proposal as mentioned :)) but let me know if I can help in some way! |
15:58:33 | * | pro quit (Quit: WeeChat 3.3) |
16:00:03 | FromDiscord | <dom96> CC @narimiran who's organised NimConf |
16:03:07 | FromDiscord | <pietroppeter> In reply to @PMunch "Was there?": it seems there was indeed a zig devroom in 2021: https://archive.fosdem.org/2021/live/#devrooms |
16:03:18 | PMunch | Huh cool |
16:07:59 | PMunch | Oh well, I've gotta go walk the dog. But I'll be back later |
16:08:01 | * | PMunch quit (Quit: leaving) |
16:08:19 | FromDiscord | <pietroppeter> sent a long message, see http://ix.io/3EBv |
16:08:33 | FromDiscord | <pietroppeter> I can help out as one of the 5 volunteers if needed |
16:08:45 | FromDiscord | <Daniel M. Jaén> What is the best package for HTTP? |
16:09:46 | FromDiscord | <enthus1ast> @Daniel M. Jaén\: it depends 😀 |
16:10:03 | FromDiscord | <enthus1ast> For client or server? |
16:10:10 | FromDiscord | <Daniel M. Jaén> server |
16:10:17 | * | rockcavera quit (Remote host closed the connection) |
16:11:19 | FromDiscord | <enthus1ast> sent a long message, see http://ix.io/3EBz |
16:11:41 | FromDiscord | <enthus1ast> I like prologue, but have used alm the three successfully |
16:11:47 | FromDiscord | <enthus1ast> All |
16:13:19 | FromDiscord | <Daniel M. Jaén> Oh, and what about `httpx`? |
16:13:52 | FromDiscord | <xflywind> a fork of httpbeast; just use httpbeast |
16:14:55 | FromDiscord | <Daniel M. Jaén> nice |
16:15:02 | FromDiscord | <Yardanico> @dom96 I could've removed the header file but I can't get Nim to export the C symbol without N_LIB_PRIVATE |
16:15:16 | FromDiscord | <Yardanico> (that's the default even with exportc) |
16:17:26 | FromDiscord | <dom96> In reply to @pietroppeter "I can help out": you can count me in too, who wants to do the submission? 🙂 |
16:17:55 | FromDiscord | <Yardanico> ah I can probably do codegenDecl but it's quite ugly |
16:18:09 | FromDiscord | <dom96> In reply to @flywind "a fork of httpbeast;": kinda wishing httpx was just called httpbeast_win 🙂 |
16:19:12 | FromDiscord | <dom96> btw with io_uring I think there is room for a httpbeast-like package that specifically takes advantage of IOCP and io_uring (afaik these have a similar model) |
16:21:05 | FromDiscord | <xflywind> In reply to @dom96 "btw with io_uring I": I hope so. Maybe `cps-nim` will implement that eventually. |
16:22:45 | FromDiscord | <dom96> Maybe |
16:23:24 | FromDiscord | <dom96> it doesn't depend on coroutines though |
16:24:09 | FromDiscord | <xflywind> yeah, and https://github.com/alaviss/nim-sys provides OS support cps |
16:24:16 | FromDiscord | <xflywind> (edit) "yeah, and https://github.com/alaviss/nim-sys provides OS support ... cps" added "for" |
16:24:54 | FromDiscord | <xflywind> https://github.com/alaviss/nim-sys/blob/master/tests/ioqueue/asyncio.nim |
16:25:28 | FromDiscord | <xflywind> (edit) "provides" => "will provide" |
16:31:26 | FromDiscord | <willyboar> In reply to @dom96 "kinda wishing httpx was": ugly naming detected.. |
16:39:09 | FromDiscord | <Yardanico> ok I made it work without a header |
16:39:18 | FromDiscord | <Yardanico> but with ugly codegenDecl :P i guess I can hide them with pragmas though |
16:41:06 | NimEventer | New post on r/nim by smazga: Proper way to do an async timeout, see https://reddit.com/r/nim/comments/qqyeky/proper_way_to_do_an_async_timeout/ |
16:45:39 | FromDiscord | <Daniel M. Jaén> What is the correct way to use inputs? |
16:48:26 | FromDiscord | <dom96> In reply to @pietroppeter "from devroom submission page": just so that this doesn't get lost, you wanna create a thread on the forum? 🙂 |
16:49:56 | FromDiscord | <Yardanico> @dom96 i made it so that the header is not needed but because of that I have to do https://github.com/Yardanico/wasm4nim/blob/master/examples/hello.nim#L14 |
16:50:13 | FromDiscord | <Yardanico> the thing is - I can't hide that in a module since you can't export custom pragmas from modules |
16:51:06 | FromDiscord | <dom96> Could you use a macro as a workaround? i.e. a macro that just adds those pragmas to a proc (which can be used as a pragma) |
16:51:06 | FromDiscord | <Yardanico> i guess it's okay anyway :) |
16:51:10 | FromDiscord | <Yardanico> In reply to @dom96 "Could you use a": i guess |
16:54:44 | NimEventer | New Nimble package! textformats - Easy specification of text formats for structured data, see https://github.com/ggonnella/textformats |
16:57:13 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3EBZ |
16:58:46 | FromDiscord | <Yardanico> pushed to the repo |
16:59:42 | FromDiscord | <Recruit_main707> isnt there a pragma pragma for this kind of stuff? |
17:00:10 | FromDiscord | <Yardanico> In reply to @Recruit_main707 "isnt there a pragma": you can't export it |
17:00:18 | FromDiscord | <Yardanico> so if you define it in a module and import that module, you won't be able to use it |
17:10:54 | * | riceman joined #nim |
17:15:08 | * | rockcavera joined #nim |
17:15:08 | * | rockcavera quit (Changing host) |
17:15:08 | * | rockcavera joined #nim |
17:20:58 | FromDiscord | <Yardanico> seems like i can make it 100% identical to the C wasm output if I make the array as `const` and then `cast[ptr uint8](unsafeAddr smiley)` |
17:21:14 | FromDiscord | <Yardanico> but I guess I'll keep it with `var` and `addr smiley[0]` for now since it's only a 4 bytes difference :) |
17:22:22 | FromDiscord | <hmmm> in my days 4 bytes would have made a difference between eating or starving 🧐 |
17:22:29 | FromDiscord | <Recruit_main707> Lmao |
17:23:51 | FromDiscord | <Yardanico> 4 bytes difference is because when the array is `const` the compiler can put all strings and the array itself into a single contiguous block https://media.discordapp.net/attachments/371759389889003532/908044294210854942/unknown.png |
17:24:48 | FromDiscord | <Yardanico> but with `var` it stores array data in a separate block https://media.discordapp.net/attachments/371759389889003532/908044536712949790/unknown.png |
17:26:53 | FromDiscord | <Yardanico> i mean size is quite important for wasm4 - they impose strict limits - 64KB max cartridge size (wasm file), 64KB RAM |
17:26:59 | * | rockcavera quit (Remote host closed the connection) |
17:27:03 | FromDiscord | <Yardanico> and 1024 disk storage (for saves and stuff) |
17:27:08 | FromDiscord | <Yardanico> (edit) "and 1024 ... disk" added "bytes of" |
17:28:08 | FromDiscord | <Yardanico> and yes ram allocation works just fine with arc and -d:useMalloc |
17:28:19 | * | rockcavera joined #nim |
17:28:19 | * | rockcavera quit (Changing host) |
17:28:19 | * | rockcavera joined #nim |
17:31:38 | FromDiscord | <dom96> now I'm really tempted to get webasmio running for this example |
17:35:22 | NimEventer | New post on r/nim by floscr: Reading continuously from stdin?, see https://reddit.com/r/nim/comments/qqzllc/reading_continuously_from_stdin/ |
17:43:47 | FromDiscord | <Daniel M. Jaén> What is the default port of httpbeast? |
17:44:20 | FromDiscord | <Yardanico> In reply to @Daniel M. Jaén "What is the default": httpbeast' default port is 8080 |
17:44:26 | FromDiscord | <Yardanico> jester is 5000 |
17:44:29 | FromDiscord | <Daniel M. Jaén> In reply to @Yardanico "httpbeast' default port is": ok, thx |
18:25:38 | * | neurocyte0132889 quit (Quit: The Lounge - https://thelounge.chat) |
18:26:29 | FromDiscord | <Schelz> what is not working pls help: ↵var t: Thread[void]↵t.createThread(main) https://media.discordapp.net/attachments/371759389889003532/908060056610811955/unknown.png |
18:28:05 | * | neurocyte0132889 joined #nim |
18:28:05 | * | neurocyte0132889 quit (Changing host) |
18:28:05 | * | neurocyte0132889 joined #nim |
18:28:41 | FromDiscord | <IsaacPaul> sent a code paste, see https://play.nim-lang.org/#ix=3ECn |
18:30:07 | FromDiscord | <IsaacPaul> Granted you need to compile with `--threads:on` |
18:31:50 | FromDiscord | <dom96> iirc you cannot use `void`, it's a quirk of how `Thread` is implemented |
18:32:20 | FromDiscord | <Schelz> --threads:on solved the problem thx @IsaacPaul |
18:32:22 | FromDiscord | <Yardanico> In reply to @dom96 "iirc you cannot use": you can though |
18:32:23 | FromDiscord | <Yardanico> :P |
18:35:58 | * | federico3_ joined #nim |
18:36:33 | * | PMunch joined #nim |
18:38:49 | FromDiscord | <zannzen> hello, very new to nim but: is there a proper way of reading using a `FileHandle` type? ↵↵Was trying to just do the basic `inotify` example from the std library docs but `read` doesn't exist apparently and all the functions in `io` seem to work for `File`. I tried converting it using `open(File, FileHandle)` but it didn't seem to actually get inotify events properly |
18:44:58 | PMunch | What kind of file handle are you trying to read from |
18:45:14 | FromDiscord | <zannzen> the `inotify` file descriptor |
18:45:30 | PMunch | And what do you expect to read from it? |
18:45:43 | * | riceman quit (Read error: Connection reset by peer) |
18:46:10 | * | riceman joined #nim |
18:46:38 | PMunch | If you want to get events you should probably use inotify_events from the same module |
18:46:50 | * | riceman quit (Read error: Connection reset by peer) |
18:47:59 | FromDiscord | <zannzen> sent a code paste, see https://play.nim-lang.org/#ix=3ECq |
18:48:16 | FromDiscord | <zannzen> where `fd` is the inotify file descriptor |
18:48:30 | FromDiscord | <zannzen> but this fails to compile |
18:48:36 | FromDiscord | <zannzen> as `read` doesn't exist |
18:49:11 | PMunch | Ah, you need to import posix |
18:49:28 | PMunch | Which is where the read procedure used there is defined |
18:51:18 | FromDiscord | <zannzen> that did it, thanks! - in general for non-file `fd`s is that how I should handle this behavior? or is there a nim-ism for similar activities (e.g. epoll)? |
18:53:33 | PMunch | Pretty much |
18:53:43 | PMunch | Or at least that's how I tend to do it |
18:54:14 | FromDiscord | <zannzen> cool, easy enough. appreciate the help |
18:56:01 | * | riceman joined #nim |
18:56:01 | * | riceman quit (Client Quit) |
18:56:10 | PMunch | Happy to be of assistance |
18:56:17 | * | riceman joined #nim |
18:56:20 | * | riceman quit (Client Quit) |
18:57:15 | * | riceman joined #nim |
18:57:52 | * | riceman quit (Client Quit) |
18:58:37 | * | riceman joined #nim |
18:58:39 | * | riceman is now known as riceman_ |
18:58:42 | * | riceman_ quit (Client Quit) |
18:58:55 | * | riceman_ joined #nim |
18:59:45 | * | riceman_ quit (Client Quit) |
19:01:01 | * | riceman joined #nim |
19:01:57 | * | riceman quit (Remote host closed the connection) |
19:12:39 | * | riceman_ joined #nim |
19:14:14 | * | Gentoolman quit (Quit: WeeChat 3.3) |
19:20:02 | * | PMunch quit (Quit: leaving) |
19:26:00 | FromDiscord | <sOkam!> @Yardanico @enthus1ast @PMunch thx for the answers 🙂↵Was just curious if its possible, since it tends to fit my syntax style to have short words (1-2 letters) for very frequently used things |
19:26:29 | FromDiscord | <sOkam!> Might not be too worth it to do it manually, from what you guys say |
19:38:28 | * | riceman_63 joined #nim |
19:38:45 | * | riceman_ quit (Quit: Client closed) |
19:42:01 | * | riceman_63 quit (Client Quit) |
19:42:14 | * | riceman_ joined #nim |
19:54:46 | FromDiscord | <dom96> In reply to @zannzen "that did it, thanks!": For epoll/kqueue we have the selectors module that abstracts over these. |
19:55:05 | FromDiscord | <enthus1ast> @sOkam!\: i think its not worth to shorten proc or func just so save a few keystrokes (maybe you editor can help here). However Nim has a lot of opportunity to save keystrokes, just skim through the nice stdlib, it already can do alot cool stuff, then the even bigger keystroke saving comes from template, macros, custom pragmas, which can make nim code very dense, elegant and efficient to type. |
20:42:52 | * | PMunch joined #nim |
20:45:32 | arkanoid | how can I creare a proc that takes a range as an argument? |
20:46:01 | arkanoid | I just want a func that does "myRange.toSeq.join(",")" |
20:46:17 | arkanoid | but I'm getting Error: invalid type: 'range' in this context: 'proc (r: range) |
20:50:28 | PMunch | You probably want an HSlice: https://play.nim-lang.org/#ix=3ECZ |
20:51:47 | nrds | <Prestige99> https://nim-lang.org/docs/system.html#HSlice found it |
20:52:24 | nrds | <Prestige99> Looks like `Slice` is an alias for HSlice |
20:52:34 | nrds | <Prestige99> https://github.com/nim-lang/Nim/blob/version-1-6/lib/system.nim#L497 |
20:55:24 | PMunch | Well Slice is homogenous, while HSlice is not |
20:56:10 | nrds | <Prestige99> True |
20:56:19 | nrds | <Prestige99> Interesting I hadn't seen HSlice previously |
20:58:13 | PMunch | It's typically used for negative indexes |
20:58:27 | PMunch | Where the second argument is a BackwardsIndex |
21:01:30 | * | riceman_ quit (Quit: Client closed) |
21:04:11 | FromDiscord | <zentoad> I am having trouble getting nim to find the c++ library installed by CMake.↵`switch("clib", "jxl")` is in my confg.nims but is searches the current directory.↵adding `switch("clibdir", "/usr/local/lib")` doesn't do anything |
21:14:06 | * | PMunch quit (Changing host) |
21:14:07 | * | PMunch joined #nim |
21:33:35 | FromDiscord | <hmmm> hey I have a: if thingy == condition: <do absolutely nothing> , what was the incantation? discard pass or what |
21:33:43 | nrds | <Prestige99> discard |
21:33:51 | FromDiscord | <hmmm> ty bro 👍 |
21:33:58 | nrds | <Prestige99> Any time |
21:34:14 | FromDiscord | <Elegantbeef> You can also do `if x: ## Todo: anything` since doc comments are AST |
21:35:26 | FromDiscord | <hmmm> this looks cooler than discard |
21:36:11 | FromDiscord | <hmmm> but I intend for it to do nothing forever so no todo 😊 |
21:36:48 | FromDiscord | <Elegantbeef> What's the point of a `if thing == condition` 😀 |
21:37:13 | FromDiscord | <hmmm> skip the first line reading a file |
21:38:13 | FromDiscord | <Elegantbeef> I dont see how that achieves this but ok |
21:38:30 | FromDiscord | <hmmm> hmm it works trust me, I have a plan |
21:39:49 | PMunch | @Elegantbeef, probably something like `if myStream.readLine().len == 0:` or something like that |
21:40:02 | PMunch | Where the condition has a side effect |
21:44:57 | FromDiscord | <hmmm> oh god munchie knows the plan 😳 |
21:45:16 | FromDiscord | <Elegantbeef> i spose, but my instinct is to use the iterator the just do `if line.len >0: #do stuff` |
21:45:20 | FromDiscord | <hmmm> anyway inc somevar is idiomatic nim or cool people do something better? |
21:46:11 | FromDiscord | <Elegantbeef> It's idiomatic |
21:46:20 | FromDiscord | <hmmm> 👍 |
21:47:12 | PMunch | I'd say `inc` is the most idiomatic |
21:47:26 | PMunch | If what you are doing is in fact incrementing a counter |
21:47:34 | FromDiscord | <hmmm> yes |
21:47:44 | PMunch | If you just need to add one to a variable for some other purpose then I'd do `+= 1` |
21:48:18 | PMunch | And it's not so much that I know the plan as that I've done exactly the same thing before :P |
21:49:02 | FromDiscord | <hmmm> we all had to take that route in our path to greatness I guess 🤔 |
22:13:21 | * | sagax quit (Quit: Konversation terminated!) |
22:20:10 | * | PMunch quit (Quit: leaving) |
22:40:31 | FromDiscord | <deech> If I have a `proc` returning a `NimNode` do I have to call it through a template/macro to get it splice in that NimNode at this some point? |
22:42:46 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3EDr |
22:42:58 | FromDiscord | <Elegantbeef> Generally you only call them inside macros though |
22:43:13 | FromDiscord | <deech> Ahhah! Thanks |
22:43:59 | FromDiscord | <deech> What do I if the NimNode is some proc I'd like to splice in at the toplevel? |
22:44:19 | FromDiscord | <Elegantbeef> You'd need to call a macro which returns the AST |
22:44:29 | FromDiscord | <Elegantbeef> NimNodes are data not sem'd AST |
22:44:43 | FromDiscord | <Elegantbeef> Well they can be sem'd, but they're still just data |
22:45:00 | FromDiscord | <deech> Is there something like `toAst(doThing)`? |
22:45:22 | FromDiscord | <Elegantbeef> there is `getTypeImpl` and `getTypeInst` |
22:45:31 | FromDiscord | <Elegantbeef> Those let you extract the procedure def from the symbol |
22:45:32 | FromDiscord | <deech> Or is that simply the "identity" macro? `macro m(x:untyped):untyped = x` |
22:45:48 | FromDiscord | <Elegantbeef> That'd be what you want |
22:45:57 | FromDiscord | <Elegantbeef> Assuming `doThing` returns vali AST |
22:46:01 | FromDiscord | <Elegantbeef> valid even |
22:47:47 | FromDiscord | <deech> Is there such a macro/template in the stdlib? |
22:48:16 | FromDiscord | <Elegantbeef> I dont think so |
22:48:37 | FromDiscord | <deech> Cool. Seems useful. |
22:48:44 | FromDiscord | <Elegantbeef> Though i guess you'd want `macro m(x: typed): untyped` |
22:49:09 | FromDiscord | <Elegantbeef> Though I'm still uncertain the API desire so I guess I may be wrong |
22:49:28 | FromDiscord | <deech> I seem to remember seeing somewhere that `typed` arguments to macros is deprecated? |
22:49:35 | FromDiscord | <Elegantbeef> Nope |
22:50:24 | FromDiscord | <Elegantbeef> `typed` arguments are the only way to get a sem'd ast inside the macro, so it'd very much be bad to be deprecated |
22:50:24 | FromDiscord | <Elegantbeef> Well there are also the specific parameter types, but for an entire body there is no other way |
22:50:36 | FromDiscord | <Elegantbeef> Typed macros are really the bread and butter of the code introspection |
22:50:49 | FromDiscord | <Elegantbeef> If you can get around the odd differences in some AST |
22:52:00 | FromDiscord | <Elegantbeef> Araq's actually explictly said the opposite that i've seen in that he'd prefer only typed macros |
22:52:58 | FromDiscord | <Elegantbeef> Untyped macros are really double edged swords, they give tons of syntax flexibility at the cost of readability and understanding |
22:57:56 | * | sagax joined #nim |
23:58:51 | * | emery quit (Remote host closed the connection) |
23:59:11 | * | lain quit (Ping timeout: 260 seconds) |