00:01:06 | FromDiscord | <Zectbumo> is there something like the javascript `??` |
00:01:36 | FromDiscord | <Elegantbeef> wrapnils? |
00:02:14 | FromDiscord | <Yardanico> https://github.com/status-im/questionable |
00:02:21 | FromDiscord | <Yardanico> "Use the |? operator to supply a fallback value when the Option does not hold a value:" |
00:02:34 | FromDiscord | <Yardanico> but there are others as well |
00:05:18 | FromDiscord | <huantian> ooh that's a nice wrapper |
00:07:04 | FromDiscord | <Yardanico> https://github.com/arnetheduck/nim-result is even nicer, covers more usecases, but it's not compatible with options |
00:07:23 | FromDiscord | <Yardanico> I mean you can easily write code that converts std/options to Opt, but still |
00:12:03 | FromDiscord | <Zectbumo> okay, I think I need a debugger now. how do I step through nim code? |
00:13:31 | FromDiscord | <Elegantbeef> C debuggers work when you compile with `--debugger:native` |
00:15:03 | FromDiscord | <Zectbumo> there should be an entire debug section in the docs page (I know, I know, PR request š I'm going to have to start making a list of all these PRs I need to make š |
00:16:08 | * | krux02 quit (Remote host closed the connection) |
00:19:53 | * | noeontheend quit (Ping timeout: 260 seconds) |
00:33:34 | FromDiscord | <!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3XSy |
00:34:01 | FromDiscord | <Elegantbeef> Lol pmunch really needs to make a better example |
00:34:40 | FromDiscord | <Elegantbeef> you need to have a `path` or `syspath` that has a `cstdio.h` |
00:36:20 | FromDiscord | <!Patitotective> what clang version should i use? 9, 9.0.1, 10, 10.0.0, 11, 11.1.0, 13, 13.0.1, 14 or 14.0.0 lol |
00:36:55 | FromDiscord | <Elegantbeef> Whichever you have |
00:37:02 | FromDiscord | <!Patitotective> all of those |
00:40:12 | FromDiscord | <Elegantbeef> It's only for parsing so just use whatever |
00:40:16 | FromDiscord | <!Patitotective> anyways, it seems like clang does not have cstdio, instead `gcc-4.8.5/libstdc++-v2` does |
00:48:25 | * | ltriant quit (Ping timeout: 248 seconds) |
00:51:10 | * | ltriant joined #nim |
00:58:51 | * | ltriant_ joined #nim |
00:59:33 | * | ltriant quit (Ping timeout: 260 seconds) |
01:00:26 | * | vicfred quit (Quit: Leaving) |
01:06:34 | * | dithpri quit (Ping timeout: 240 seconds) |
01:09:33 | * | dithpri joined #nim |
01:14:45 | FromDiscord | <!Patitotective> sent a code paste, see https://paste.rs/l8W |
01:15:17 | FromDiscord | <!Patitotective> what was https://github.com/define-private-public/stb_image-Nim wrapped with? |
01:15:33 | FromDiscord | <Elegantbeef> Are you using it on C++? |
01:16:32 | FromDiscord | <!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3XSH |
01:18:35 | FromDiscord | <Elegantbeef> isnt stdc a C++ wrapped C file? |
01:18:36 | FromDiscord | <Elegantbeef> Yea it's a C++ file |
01:19:43 | FromDiscord | <!Patitotective> soooo i shold compile to cpp? right |
01:19:48 | FromDiscord | <Elegantbeef> > A free C++11 file dialog library. |
01:19:54 | FromDiscord | <Elegantbeef> You cannot use futhark on C++ |
01:20:03 | FromDiscord | <Elegantbeef> Just reimplement the code in Nim |
01:20:22 | FromDiscord | <!Patitotective> reimpl-who? |
01:20:26 | FromDiscord | <!Patitotective> whats that |
01:20:38 | FromDiscord | <Elegantbeef> Take the code and rewrite it in Nim |
01:21:11 | FromDiscord | <Elegantbeef> Or try c2nim |
01:23:04 | FromDiscord | <Elegantbeef> It's a C++ source library not a C++ library so it's going to be a pain to use |
01:23:45 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "It's a C++ source": :[ |
01:26:24 | FromDiscord | <!Patitotective> dang `/home/cristobal/minidev/nim-portable-file-dialogs/portable-file-dialogs.h(1513, 13) Error: invalid token $ (\36)` |
01:26:41 | FromDiscord | <!Patitotective> will i have to rewrite 1745 lines? :[ |
01:28:53 | FromDiscord | <!Patitotective> theres also this thing https://sourceforge.net/p/tinyfiledialogs/code/ci/master/tree/tinyfiledialogs.c |
01:30:39 | FromDiscord | <Elegantbeef> What was the issue with the Nim official ones |
01:30:48 | * | noeontheend joined #nim |
01:38:32 | * | wallabra_ joined #nim |
01:39:27 | * | wallabra quit (Ping timeout: 252 seconds) |
01:39:38 | * | wallabra_ is now known as wallabra |
01:45:34 | * | dithpri quit (Ping timeout: 240 seconds) |
01:56:19 | FromDiscord | <yoyojambo> besides using a while loop, is there a way to have more control over the variable in a for loop that counts up? |
01:56:34 | * | dithpri joined #nim |
01:56:56 | FromDiscord | <yoyojambo> I am trying to skip several iterations at once by increasing the variable |
01:57:34 | FromDiscord | <yoyojambo> or should I just add a condition at the top with a `continue`? |
01:58:26 | FromDiscord | <Elegantbeef> You can make your own iterator |
02:00:19 | FromDiscord | <yoyojambo> hmmm I think that would complicate it a lot |
02:01:11 | FromDiscord | <yoyojambo> I kind of want the logic that increases the variable inside the for loop not as part of it |
02:01:35 | FromDiscord | <yoyojambo> but its fine ill just use `continue` |
02:13:48 | * | rockcavera joined #nim |
02:13:49 | * | rockcavera quit (Changing host) |
02:13:49 | * | rockcavera joined #nim |
02:23:03 | FromDiscord | <root> is there anywhere i can post a problem im having? |
02:23:10 | FromDiscord | <Elegantbeef> Here |
02:23:16 | FromDiscord | <root> ok |
02:24:27 | FromDiscord | <root> so im using this code https://github.com/elddy/Nim-Reverse-Shell and im a noob so i dont understand how to use it to send and receive commands between the server and the client, any help would be appreciated. |
02:25:25 | FromDiscord | <Elegantbeef> `socket.send` and `socket.recv` is how |
02:26:53 | FromDiscord | <Elegantbeef> Do you have a more descrpitive explanation of the problem? |
02:28:55 | FromDiscord | <root> Yes how would I format that if I wanted to send and receive messages typed in by the user? |
02:29:10 | FromDiscord | <root> And thank you so much for the help btw |
02:29:24 | FromDiscord | <Elegantbeef> What do you mean? |
02:31:15 | FromDiscord | <root> Thatās ok I will try to give the rest out by myself, thank you tho! |
02:31:47 | FromDiscord | <Elegantbeef> Jeez people thank a lot for so little reason š |
02:32:25 | FromDiscord | <root> Sorry I just appreciate your time š |
02:40:51 | * | noeontheend quit (Ping timeout: 256 seconds) |
03:12:52 | * | arkurious quit (Quit: Leaving) |
03:16:34 | FromDiscord | <root> what does "spawn" do ? |
03:21:56 | * | noeontheend joined #nim |
03:25:23 | FromDiscord | <Elegantbeef> spools up a thread with the right hand of the `spawn` statement |
03:25:38 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/manual_experimental.html#parallel-amp-spawn |
03:26:34 | FromDiscord | <root> i still dont understand how to use this code š¦ |
03:26:44 | FromDiscord | <root> https://github.com/elddy/Nim-Reverse-Shell |
03:28:32 | FromDiscord | <root> i wanna use this to send commands from the server to the client |
03:28:42 | FromDiscord | <root> i cant figure it out tho š¦ |
03:28:52 | FromDiscord | <root> (edit) "š¦" => "š" |
03:30:02 | * | Guest13 joined #nim |
03:32:11 | * | Guest13 left #nim (#nim) |
03:41:08 | * | noeontheend quit (Ping timeout: 260 seconds) |
03:43:10 | * | rockcavera quit (Remote host closed the connection) |
04:19:54 | FromDiscord | <Zectbumo> @root it looks pretty simple from the looks of the code. where are you stuck? |
04:25:51 | FromDiscord | <root> I donāt know how to use the recvMsg() and sendMsg() things |
04:26:01 | * | duuude quit (Ping timeout: 248 seconds) |
04:26:28 | FromDiscord | <root> In reply to @Zectbumo "<@817060943803973632> it looks pretty": I donāt know how to use the recvMsg() and sendMsg() things |
04:28:29 | FromDiscord | <Zectbumo> don't you just run the server and client? |
04:32:00 | FromDiscord | <root> Yea but idk how to send and receive data between them š¦ |
04:32:11 | FromDiscord | <root> Sry Iām coming from python so I kinda dumb |
04:32:11 | FromDiscord | <Zectbumo> you just type |
04:32:22 | FromDiscord | <Zectbumo> me too š |
04:33:03 | FromDiscord | <root> So whenever u type and press enter into the server it send the info to client.py? |
04:33:09 | FromDiscord | <root> .nim |
04:34:13 | FromDiscord | <Zectbumo> so reading the program it looks like: run Client on your windows machine, ssh tunnel 4444, then run Server on the other machine, and start typing on "other machine" |
04:34:45 | FromDiscord | <Zectbumo> and of course open up TCP 4444 on the firewall on the Server side |
04:34:59 | FromDiscord | <root> Where does the client receive and use the data sent from server? |
04:36:11 | FromDiscord | <Zectbumo> in recvMsg it has a recvLine() and then writeLine(cmds) |
04:36:19 | FromDiscord | <root> Omg thank you |
04:36:33 | FromDiscord | <root> ā¤ļø |
04:39:08 | FromDiscord | <Zectbumo> oh in my instructions I did it backwards. run the server first, then tunnel, then client š |
04:39:30 | FromDiscord | <root> Thank you! |
04:40:23 | FromDiscord | <root> How do I have nim execute system commands? |
04:40:40 | FromDiscord | <Zectbumo> oh and since you are tunneling there is no need to open port on 4444 either |
04:40:56 | FromDiscord | <root> Thatās ok I already knew that I just appreciate the help |
04:41:06 | FromDiscord | <Zectbumo> it already is executing for you via cmd.exe |
04:41:33 | FromDiscord | <root> Wait so whatever I type into server is being sent and executed in the client? |
04:41:41 | FromDiscord | <Zectbumo> yes |
04:41:46 | FromDiscord | <root> Ohhhh |
04:41:50 | FromDiscord | <root> I didnāt know thattt |
04:41:54 | FromDiscord | <root> Iām dumb lol |
04:41:56 | FromDiscord | <root> Thank you |
04:41:59 | FromDiscord | <Zectbumo> type dir and you should see a listing pop up |
04:42:15 | FromDiscord | <root> I donāt š¦ |
04:42:53 | FromDiscord | <Zectbumo> do you see "Got connection from:" on the server side? |
04:42:59 | FromDiscord | <root> Yes |
04:43:36 | FromDiscord | <root> Yea I just typed mkdir hi and no new directory was formed |
04:43:39 | FromDiscord | <Zectbumo> do you see the command you typed pop up on the client side? |
04:43:49 | FromDiscord | <root> No |
04:43:56 | FromDiscord | <Zectbumo> okay so message didn't make it through |
04:44:20 | FromDiscord | <Zectbumo> it actually echos before executing |
04:44:34 | FromDiscord | <root> Ok let me try something |
04:48:04 | FromDiscord | <Zectbumo> it looks like this program burns cycles waiting for the process to exit while in use. it may chew cpu just sitting there doing nothing |
04:48:17 | FromDiscord | <root> Oh ok |
04:48:42 | FromDiscord | <root> Exponentially? Or will it just always take up some cpu space |
04:48:47 | FromDiscord | <Zectbumo> do you have cmd.exe on the client side? |
04:49:01 | FromDiscord | <root> Yes |
04:49:08 | FromDiscord | <Zectbumo> just some. it has a dedicated thread just cycling, no wait, just checking a flag |
04:49:47 | * | slowButPresent quit (Quit: ERC 5.4 (IRC client for GNU Emacs 28.1)) |
04:50:35 | FromDiscord | <Zectbumo> probably checking the process thousands of times per second š |
04:51:19 | FromDiscord | <Zectbumo> anyway, just a side note. it's a basic program. and you have bigger issues |
04:53:43 | FromDiscord | <Zectbumo> okay, my guess is you do not have cmd.exe and the process gets closed and then the socket gets closed and the recvMsg returns and sendMsg is hanging because it's trying to read 1 char so since that's not moving the process gets stuck |
04:54:05 | FromDiscord | <Zectbumo> though, if you did type a command I would guess that the Client would exit |
04:54:11 | FromDiscord | <Zectbumo> possibly with error |
04:54:52 | FromDiscord | <Zectbumo> oh no, error. there is an except: return š® |
05:04:09 | FromDiscord | <root> how do i compile a nim project to run on windows š¦ |
05:04:43 | FromDiscord | <Zectbumo> š I tried this today and gave up with I saw it needed minGW |
05:05:00 | FromDiscord | <root> okok |
05:06:06 | FromDiscord | <Zectbumo> https://nim-lang.org/install_windows.htmlāµcheck out compiler dependencies |
05:06:47 | FromDiscord | <Zectbumo> actually, I'll do it with you. I stopped prematurely |
05:06:58 | FromDiscord | <huantian> I would use choosenim myselfāµ<https://github.com/dom96/choosenim#choosenim>āµthough I haven't tried either method on windows |
05:07:02 | FromDiscord | <huantian> because windows is for the weak |
05:08:06 | FromDiscord | <root> what does nim compile to by default? assembly? |
05:08:20 | FromDiscord | <Zectbumo> complies to C code |
05:08:31 | FromDiscord | <root> wouldnt that have a .c extention |
05:08:41 | FromDiscord | <Zectbumo> yes, somewhere you can find that |
05:08:45 | FromDiscord | <root> my output file has no extention |
05:08:52 | FromDiscord | <huantian> nim -> c -> binary |
05:08:57 | FromDiscord | <Zectbumo> that compiled to machine code |
05:09:03 | FromDiscord | <root> ok |
05:09:24 | FromDiscord | <root> can binary run on windows? |
05:09:39 | FromDiscord | <huantian> only if you compile it for windows |
05:09:40 | FromDiscord | <huantian> and not linux |
05:09:42 | FromDiscord | <Zectbumo> only if you build on windows, or crossbuild for windows |
05:09:53 | FromDiscord | <huantian> ^ |
05:09:56 | FromDiscord | <root> how do u cross build for windows |
05:10:01 | FromDiscord | <Zectbumo> let's not go there |
05:10:08 | FromDiscord | <Zectbumo> just get nim working on windows |
05:10:08 | FromDiscord | <root> my pc is on linux but i want it to work on windows |
05:10:15 | FromDiscord | <huantian> <https://nim-lang.org/docs/nimc.html#crossminuscompilation-for-windows> |
05:10:36 | FromDiscord | <root> In reply to @Zectbumo "let's not go there": is it not worth it? should I just get my win 10 vm to use nim |
05:11:16 | FromDiscord | <Zectbumo> you would get cool points from me if you crossbuild, but that's just more steps |
05:11:34 | FromDiscord | <root> ok |
05:11:40 | FromDiscord | <root> well i do want cool points |
05:11:44 | FromDiscord | <Zectbumo> š |
05:11:53 | FromDiscord | <huantian> then read the docs š |
05:11:54 | FromDiscord | <root> In reply to @huantian "<https://nim-lang.org/docs/nimc.html#crossminuscomp": i did this now what |
05:11:59 | FromDiscord | <root> In reply to @huantian "then read the docs": i willll |
05:12:18 | FromDiscord | <huantian> you installed mingw, then did `nim c -d:mingw file.nim`? |
05:12:28 | FromDiscord | <root> its just hard moving from a lang with to much documentation (python) to nim with like none |
05:12:28 | FromDiscord | <huantian> you should have a file called `file.exe` and you can run that on windows |
05:12:42 | FromDiscord | <root> In reply to @huantian "you installed mingw, then": thx! |
05:12:54 | FromDiscord | <Elegantbeef> Or wine š |
05:13:12 | FromDiscord | <Elegantbeef> if you have wine you can actually do `nim c -d:mingw -r ...` |
05:13:45 | FromDiscord | <root> In reply to @Elegantbeef "if you have wine": i did this it worked š |
05:13:48 | FromDiscord | <root> thank u all |
05:16:22 | FromDiscord | <Zectbumo> there's your cool point |
05:25:37 | FromDiscord | <Zectbumo> so I'm running chrome 101 on windows and I can't download the nim package from the website. chrome makes me delete the zip after download completion |
05:26:03 | FromDiscord | <Elegantbeef> Yep many antivirus programs flag it as a virus |
05:26:59 | FromDiscord | <Prestige> The browser makes you delete the file? Weird |
05:27:18 | FromDiscord | <Elegantbeef> Yep they can detect what they consider malware and remove it |
05:27:20 | FromDiscord | <Zectbumo> https://media.discordapp.net/attachments/371759389889003532/975630507914190879/unknown.png |
05:27:35 | FromDiscord | <Prestige> Can't you override that somehow? |
05:27:47 | FromDiscord | <Zectbumo> yeah, I can go into settings and disable standard protection |
05:28:11 | FromDiscord | <Zectbumo> just, not ideal for the non developers using nim |
05:28:49 | FromDiscord | <Zectbumo> (edit) "non developers" => "standard user" |
05:29:33 | FromDiscord | <huantian> You can also go to downloads |
05:29:37 | FromDiscord | <huantian> And then thereās a button |
05:29:43 | FromDiscord | <huantian> Like download anyways |
05:30:52 | FromDiscord | <Zectbumo> so I disabled it in chrome and now Windows: https://media.discordapp.net/attachments/371759389889003532/975631400172662804/unknown.png |
05:31:02 | FromDiscord | <Zectbumo> guys, Nim is going viral! |
05:31:24 | FromDiscord | <Elegantbeef> Yea it's well established for a year or so that Nim triggers AV |
05:31:26 | FromDiscord | <Elegantbeef> It's a shame but it's what it is |
05:32:15 | FromDiscord | <Zectbumo> has anyone talked to Microsoft about this? |
05:32:31 | FromDiscord | <Zectbumo> and Google |
05:33:30 | FromDiscord | <Elegantbeef> https://forum.nim-lang.org/t/7885 |
05:33:43 | FromDiscord | <Yardanico> <https://github.com/nim-lang/Nim/issues/17820> |
05:33:56 | FromDiscord | <Yardanico> Potentially https://github.com/nim-lang/Nim/pull/19767 can help with that |
05:34:26 | FromDiscord | <Yardanico> since last time I checked, the most detected binary from the 1.6.6 archive was nimgrab.exe with (i don't remember exactly) 15-18 detections, others only had 2-3 detections at max |
05:35:16 | FromDiscord | <Zectbumo> what? hmm, it actually looked like it caught a virus. maybe someone put a back door in? it flashed the name of the worm but then it oddly disappeared before I could quarantine it |
05:35:24 | FromDiscord | <Yardanico> no it's not a virus |
05:35:26 | FromDiscord | <Yardanico> it's a false positive |
05:35:42 | FromDiscord | <Zectbumo> I see |
05:36:03 | FromDiscord | <Yardanico> nimgrab is probably detected because it uses the (kind of) deprecated windows UrlMon API for downloading stuff, and it seems that AVs really don't like that |
05:37:11 | FromDiscord | <Zectbumo> the odd part is that it flagged as a threat but then reverses on its own without me doing anything and then says 0 threats |
05:37:35 | FromDiscord | <Yardanico> In reply to @Zectbumo "the odd part is": did you think it would let you actually decide what you want to happen on "your" device? hahaha |
05:37:41 | FromDiscord | <Yardanico> good joke :) |
05:38:03 | FromDiscord | <Zectbumo> aw well, at least I know the bitcoin miner running on my machine now is going to a good cause š |
05:38:08 | FromDiscord | <Yardanico> but in all seriousness, most windows users aren't tech savvy at all, so that's why defender behaves like that |
05:39:18 | FromDiscord | <undel> In reply to @Yardanico "but in all seriousness,": i've seen people (gamers in particular) download obvious malware because it promised to optimize gaming performance |
05:39:36 | FromDiscord | <undel> instead they got a cryptominer and a chrome extension that injected ads into every page |
05:41:24 | FromDiscord | <Zectbumo> so my guess is that the AV did a quick check raised a false positive and then once it did a full check it found it was okay |
05:41:47 | * | gshumway quit (*.net *.split) |
05:41:48 | * | via_ quit (*.net *.split) |
05:41:48 | * | Stink quit (*.net *.split) |
05:41:48 | * | robertmeta quit (*.net *.split) |
05:41:48 | * | oz quit (*.net *.split) |
05:41:48 | * | notchris quit (*.net *.split) |
05:41:53 | FromDiscord | <Yardanico> no? it just removed the binary |
05:41:55 | * | via_ joined #nim |
05:42:00 | * | notchris joined #nim |
05:42:03 | * | Stink joined #nim |
05:42:19 | FromDiscord | <Yardanico> if you unpacked the archive, check the binaries, you'll probably be missing a few that the defender removed |
05:42:30 | FromDiscord | <Zectbumo> maybe so. hopefully I didn't need it |
05:42:33 | * | gshumway joined #nim |
05:42:35 | * | Stink is now known as Guest7620 |
05:42:41 | * | ox joined #nim |
05:42:46 | * | robertmeta joined #nim |
05:42:46 | * | robertmeta quit (Changing host) |
05:42:46 | * | robertmeta joined #nim |
05:43:35 | FromDiscord | <Zectbumo> arg and it deleted my zip |
05:44:23 | FromDiscord | <Zectbumo> this is abuse |
05:45:45 | FromDiscord | <Zectbumo> okay, install complete. I even added to start menu. whatever that means |
05:47:00 | FromDiscord | <Zectbumo> oh I get a custom cmd prompt now š https://media.discordapp.net/attachments/371759389889003532/975635459453620244/unknown.png |
05:56:42 | FromDiscord | <Zectbumo> okay I got caught up with the details https://github.com/nim-lang/Nim/issues/17820 |
06:03:38 | FromDiscord | <Prestige> In reply to @Zectbumo "this is abuse": That's why I don't use Windows |
06:04:41 | FromDiscord | <Zectbumo> I can't even remember why I wanted nim on windows now. this process took me for a spin |
06:08:05 | FromDiscord | <Zectbumo> That's why I run four operating systems š |
06:49:37 | * | ltriant joined #nim |
06:50:44 | * | ltriant_ quit (Ping timeout: 248 seconds) |
06:55:12 | * | PMunch joined #nim |
07:09:25 | FromDiscord | <Zectbumo> sent a code paste, see https://paste.rs/5wh |
07:10:18 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3XTl |
07:13:08 | FromDiscord | <Elegantbeef> `user.email` of course |
07:13:22 | FromDiscord | <Elegantbeef> I sometime write fantastic things š |
07:13:53 | FromDiscord | <Zectbumo> there's nothing standard? it's a basic need in nim |
07:14:11 | FromDiscord | <Elegantbeef> In nim the only truthy value is `true` |
07:14:17 | FromDiscord | <Elegantbeef> if you want other truthy values you use converters |
07:14:58 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/Bb7 |
07:15:03 | FromDiscord | <Zectbumo> I would like a standard converter that checks for nonDefault |
07:15:06 | FromDiscord | <Yardanico> In reply to @Zectbumo "there's nothing standard? it's": i think checking if a string is not empty is simple enough :) |
07:15:28 | FromDiscord | <Elegantbeef> `myVal != default(typeof(myVal))` |
07:15:29 | FromDiscord | <Zectbumo> sure is, and is going to happen everywhere |
07:15:32 | FromDiscord | <Yardanico> In reply to @Zectbumo "I would like a": after all, nim is not python despite all the marketing people are trying to do |
07:15:52 | FromDiscord | <Elegantbeef> Nim is a statically typed language and all values implicitly turning into bools is bad design |
07:15:54 | FromDiscord | <Yardanico> and converters are kind of a bad practice except some specific cases |
07:15:55 | FromDiscord | <Zectbumo> no nim is better, or should be at least |
07:16:26 | FromDiscord | <Yardanico> nim only has implicit type conversion when it makes sense |
07:16:33 | FromDiscord | <Yardanico> without surprising behaviour |
07:16:59 | FromDiscord | <Yardanico> first you want `if string` to work, and then by accident you pass a string to a proc that accepts bool |
07:17:00 | PMunch | Zectbumo, strings in Nim can't be nil like in many other languages. So the default value of a string is an empty string. You can check if a string is empty like you did above or with `user.email.len == 0`. Nim is also very strict about types, so checking if a string is true or false doesn't work. |
07:17:12 | FromDiscord | <Zectbumo> I like explicitly turning into bools. like @ElegantBeef default() check is cool. just needs to be standard, imo |
07:17:47 | FromDiscord | <Elegantbeef> I mean it's one line of code |
07:18:08 | FromDiscord | <Yardanico> In reply to @Zectbumo "I like explicitly turning": default as standard would only really work for simple builtin types |
07:18:25 | FromDiscord | <Yardanico> because user-defined types usually use constructor-like procs for initialization |
07:18:53 | PMunch | In your case `if user.email`, let's rename the field to `user.hasAddress` and let's assume this comes from a HTTP form or something. Now this field is sent as "true" or "false" as strings. Now the check `if user.hasAddress` logically looks like it would check if the user has an address, but in fact it checks if the user `hasAddress` field isn't set properly. |
07:18:56 | FromDiscord | <Zectbumo> that's all I'm asking is the simple types. anyone else can make their own if needed for custom |
07:19:18 | FromDiscord | <Yardanico> and yeah, I don't see the need for these types of conversions in code i write usually :) |
07:19:42 | FromDiscord | <Yardanico> and i also started using nim after using python back in 2017 |
07:20:13 | PMunch | And default is already built-in, so not sure what you want to be standard about that |
07:20:28 | FromDiscord | <Elegantbeef> They want a `isDefault` or similar |
07:21:01 | FromDiscord | <Zectbumo> sent a code paste, see https://play.nim-lang.org/#ix=3XTn |
07:21:02 | FromDiscord | <Yardanico> has? |
07:21:09 | FromDiscord | <Elegantbeef> You can do that |
07:21:10 | FromDiscord | <Zectbumo> (edit) "https://play.nim-lang.org/#ix=3XTn" => "https://play.nim-lang.org/#ix=3XTo" |
07:21:20 | FromDiscord | <Yardanico> but again, this is not much different in length than `if user.email != ""` |
07:21:29 | PMunch | Aah, something like `template isDefault(x: untyped): bool = x == default(typeof(x))`? |
07:21:47 | FromDiscord | <Zectbumo> In reply to @Yardanico "but again, this is": I'm going for elegance not char count |
07:22:05 | FromDiscord | <Yardanico> how is this not elegant š¤ |
07:22:12 | FromDiscord | <Yardanico> its a basic piece of code that's going to be the same in most languages |
07:22:25 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/1BZ |
07:22:27 | FromDiscord | <Zectbumo> In reply to @Elegantbeef "You can do that": yes, but I would like to see this standard where it's the nim norm. |
07:22:35 | FromDiscord | <Elegantbeef> "standard" |
07:22:39 | FromDiscord | <Elegantbeef> It's one frigging proc š |
07:22:46 | PMunch | `template has(obj, field: untyped): bool = compiles(obj.field) and obj.field != default(typeof(obj.field))` |
07:22:50 | FromDiscord | <Yardanico> anyway, maybe you like it, but I like my "old-school" nim way |
07:23:00 | PMunch | Now you can if `if user.has email` :P |
07:23:13 | FromDiscord | <Elegantbeef> Pmunch really going off the deepend š |
07:23:29 | FromDiscord | <Zectbumo> In reply to @Elegantbeef "It's one frigging proc": I'll use that proc, but too bad I won't see anyone else using it because everyone will be stuck in != "" land |
07:23:39 | FromDiscord | <Elegantbeef> Well it's more expressive |
07:23:55 | FromDiscord | <Elegantbeef> `has` sounds like `compiles(myType.field)` |
07:23:55 | PMunch | I typically use .len == 0 for what it's worth |
07:24:52 | FromDiscord | <Yardanico> In reply to @Zectbumo "I'll use that proc,": if you want everyone to use the same idioms and code style, Nim is really, really not for you :) |
07:24:58 | FromDiscord | <Yardanico> look into things like Go that force one way to write code |
07:25:18 | FromDiscord | <Yardanico> nim has multiple ways to do the same thing, and people prefer different ones |
07:25:28 | PMunch | Keep in mind as well that `default(int)` is 0. So `if has user.age` would run if the user was a newborn |
07:26:13 | FromDiscord | <Zectbumo> there's no forcing everyone to use `has` it would be nice to have an elegant way built in already so not everyone comes up with their own or worse nothing at all |
07:26:46 | PMunch | IMO those auto-bool and default checks is more useful when you have nilable types that can't readily mix with the rest of the behaviour of your type |
07:27:15 | FromDiscord | <Zectbumo> In reply to @PMunch "IMO those auto-bool and": that's another area. I would like the ?? like in javascript |
07:27:17 | PMunch | Nim luckily doesn't have those, if you have a string you can always call string-based procs on it, no silly nil checks |
07:27:43 | FromDiscord | <Zectbumo> sent a code paste, see https://play.nim-lang.org/#ix= |
07:28:05 | FromDiscord | <Yardanico> https://nim-lang.org/docs/wrapnils.html |
07:28:16 | PMunch | Zectbumo, you don't really need that in Nim. But optionsutils has something similar for options: https://github.com/PMunch/nim-optionsutils |
07:28:34 | FromDiscord | <Yardanico> although it is a bit different, optionsutils is better |
07:28:49 | FromDiscord | <Yardanico> also there's https://github.com/status-im/questionable from status |
07:29:16 | FromDiscord | <Yardanico> @Zectbumo just make your own version of stdlib as some people do :P |
07:29:35 | FromDiscord | <Yardanico> if they don't agree with the way nim stdlib is structured or how it handles things |
07:30:08 | FromDiscord | <Zectbumo> In reply to @Yardanico "<@157415492812800000> just make your": it does seem that's the way |
07:30:39 | FromDiscord | <Yardanico> but really, i think your ideas are all a bit too pythony, e.g. the one about typeless arguments |
07:30:45 | FromDiscord | <Zectbumo> I went through optionutils earlier when I ran into it in the cookies module |
07:30:59 | FromDiscord | <Yardanico> if you use nim for some time you'll stop trying to make it look like python :) |
07:31:21 | FromDiscord | <Zectbumo> sure, and I really like that it's so flexible that I can get what I want |
07:31:52 | * | krux02 joined #nim |
07:32:06 | FromDiscord | <Yardanico> yes i didn't say you can't, that's why a lot of people use nim |
07:32:13 | FromDiscord | <Yardanico> even if they disagree with the stdlib or other stuff |
07:32:28 | * | krux02 quit (Remote host closed the connection) |
07:32:33 | FromDiscord | <Yardanico> but the majority still prefers to try to do it with existing nim means instead of doing something completely new |
07:33:01 | FromDiscord | <Zectbumo> wrapnils looks interesting. a bit backward for my taste but works. |
07:36:10 | FromDiscord | <Zectbumo> btw, not looking to make nim into python, just using python as a bar that I'd like to see nim meet or exceed |
07:36:24 | FromDiscord | <Zectbumo> javascript too |
07:39:05 | * | gsalazar joined #nim |
07:56:43 | FromDiscord | <Zectbumo> sent a code paste, see https://play.nim-lang.org/#ix=3XTx |
08:00:23 | FromDiscord | <Zectbumo> sent a code paste, see https://paste.rs/KI3 |
08:19:20 | FromDiscord | <sheerluck> what is `has` here? |
08:20:13 | FromDiscord | <Elegantbeef> A very obscure procedure name |
08:20:21 | FromDiscord | <Rika> sent a code paste, see https://paste.rs/cn9 |
08:20:47 | FromDiscord | <Rika> It is elegant, but it is not self explanatory nor glance-understandable |
08:21:13 | FromDiscord | <sheerluck> In reply to @Elegantbeef "A very obscure procedure": so `I can has cheezburger?` is valid Nim, right? |
08:21:15 | FromDiscord | <Rika> āElegantā for whatever that word means really |
08:21:24 | FromDiscord | <Rika> In reply to @sheerluck "so `I can has": Postfix ? š |
08:21:31 | FromDiscord | <Rika> No postfix here other than |
08:21:40 | FromDiscord | <Elegantbeef> and `[]` |
08:21:44 | FromDiscord | <Rika> True |
08:32:46 | * | ltriant_ joined #nim |
08:33:50 | * | ltriant quit (Ping timeout: 240 seconds) |
08:50:36 | * | dithpri quit (Remote host closed the connection) |
09:12:48 | FromDiscord | <Phil> In reply to @Zectbumo "see, great example of": My friend, compile-time checks are heaven. It is very lovely to prevent yourself from being dumb at compile time |
09:13:14 | FromDiscord | <Phil> I wish python could prevent me more from being dumb |
09:13:26 | FromDiscord | <Phil> (edit) "dumb" => "dumb. Sadly it doesn't, it trusts me! What a foolish notion" |
09:16:12 | FromDiscord | <Phil> Also, Spy X Family has ruined me. I hear "elegant", I immediately have anime-memes in my head of an old bearded dude in a tailcoat and a cane shouting about how X is elegant or not |
09:16:27 | FromDiscord | <Elegantbeef> No comment |
09:22:59 | * | dmichiels joined #nim |
09:38:48 | * | Zectbumo quit (Remote host closed the connection) |
10:16:15 | NimEventer | New thread by Rbohl64: Memory Leak with --gc:orc and Nimble Decimal Library, see https://forum.nim-lang.org/t/9159 |
10:24:49 | FromDiscord | <Yardanico> In reply to @NimEventer "New thread by Rbohl64:": time to check with useMalloc instead of weird rusages :) |
10:28:48 | FromDiscord | <Yardanico> yeah it is true "definitely lost: 19,248 bytes in 401 blocks" |
10:47:07 | FromDiscord | <uncle jim> gib me some beginner projects pls |
10:47:22 | FromDiscord | <uncle jim> i am really demotivated rn |
10:47:30 | FromDiscord | <uncle jim> i dont know what to do |
10:48:01 | FromDiscord | <uncle jim> https://tenor.com/view/tembel-%C3%BC%C5%9Fenge%C3%A7-lazy-gif-19911238 |
10:48:35 | FromDiscord | <uncle jim> @ElegantBeef i need you |
10:52:25 | FromDiscord | <Rika> What are you interested in |
10:53:15 | FromDiscord | <uncle jim> In reply to @Rika "What are you interested": some terminal based apps? |
10:53:18 | FromDiscord | <uncle jim> i guess |
10:53:23 | FromDiscord | <Rika> Then make one? |
10:53:36 | FromDiscord | <uncle jim> i dont kno how to make one |
10:53:38 | FromDiscord | <uncle jim> i mean |
10:53:41 | FromDiscord | <Rika> Then learn how to? |
10:53:43 | FromDiscord | <uncle jim> just look at sudoku |
10:53:49 | FromDiscord | <uncle jim> solver |
10:54:04 | FromDiscord | <xflywind> You can read https://xmonader.github.io/nimdays |
10:54:26 | FromDiscord | <uncle jim> In reply to @flywind "You can read https://xmonader.github.io/nimdays": the is gold |
10:54:31 | FromDiscord | <uncle jim> thenks |
10:54:41 | FromDiscord | <Yardanico> zalso check https://narimiran.github.io/nim-basics/ and other nim tutorial stuff |
10:54:43 | FromDiscord | <uncle jim> thenks wery much |
10:54:49 | FromDiscord | <uncle jim> In reply to @Yardanico "zalso check https://narimiran.github.io/nim-basics/": i red that |
10:55:24 | FromDiscord | <xflywind> Or you can help simple stuffs regarding Nim 2.0 or implement libraries in https://github.com/nim-lang/needed-libraries/issues |
10:55:51 | FromDiscord | <uncle jim> thas too much for me lel |
10:57:31 | FromDiscord | <xflywind> Well, there is a hard fork called Nimskull, you can port some good changes to Nim. |
10:57:43 | FromDiscord | <Yardanico> lol |
11:05:53 | FromDiscord | <xflywind> @Yardanico Hi, what did you think I need to check for https://github.com/nim-lang/Nim/pull/19767#issuecomment-1119528144? |
11:06:00 | FromDiscord | <xflywind> (edit) "did" => "do" |
11:06:29 | FromDiscord | <Yardanico> yeah it's better to be safe, although I think that it should work totally fine |
11:06:45 | FromDiscord | <Yardanico> and hopefully it makes nim much less detectable by AVs |
11:09:07 | FromDiscord | <xflywind> I agree. I'm testing it using `koch temp c -r tools/finish.nim`. |
11:09:19 | FromDiscord | <Yardanico> well, araq said to test it from finish.exe |
11:09:26 | FromDiscord | <Yardanico> so you run finish.exe and it downloads mingw with nimgrab |
11:16:37 | FromDiscord | <xflywind> lol, I use `curl` on windows. |
11:25:22 | FromDiscord | <retkid> I've switched over to nlvm |
11:27:57 | FromDiscord | <Yardanico> In reply to @retkid "I've switched over to": okay, enjoy life with no arc :P |
11:28:11 | FromDiscord | <retkid> FUCK |
11:28:13 | FromDiscord | <Yardanico> i mean nlvm is nice, but I don't think it's worth using it for general purpose Nim at this point |
11:28:33 | FromDiscord | <retkid> so basically im gonna use it until i do something cursed and need arc |
11:28:37 | FromDiscord | <retkid> then be like fuck |
11:28:38 | FromDiscord | <retkid> and replace it |
11:28:39 | FromDiscord | <Rika> Itās worth using to encourage itās development heh |
11:28:43 | FromDiscord | <Yardanico> In reply to @retkid "FUCK": it's also still nim 1.2.x branch |
11:28:55 | FromDiscord | <retkid> is nim 2.0 out? |
11:28:58 | FromDiscord | <Yardanico> no |
11:29:01 | FromDiscord | <Yardanico> but nim 1.4 and 1.6 are out |
11:29:03 | FromDiscord | <retkid> eh then who cars |
11:29:04 | FromDiscord | <retkid> (edit) "cars" => "cares" |
11:29:05 | FromDiscord | <retkid> well |
11:29:07 | FromDiscord | <retkid> 1.6 is cool |
11:29:08 | FromDiscord | <retkid> hmmm |
11:29:32 | FromDiscord | <Yardanico> any specific reason you want nlvm? |
11:29:38 | FromDiscord | <retkid> webasm |
11:29:41 | FromDiscord | <Yardanico> for wasm32 you can just use nim's c backend with wasi sdk/emscripten |
11:29:44 | FromDiscord | <Yardanico> and it works really well |
11:29:51 | FromDiscord | <Yardanico> in fact it'll probably work better than with nlvm |
11:29:56 | FromDiscord | <retkid> In reply to @Yardanico "for wasm32 you can": that was too much of a pain in the ass last time i tried |
11:29:58 | FromDiscord | <Yardanico> it's really easy |
11:29:59 | FromDiscord | <retkid> but maybe i was sleepy |
11:30:07 | FromDiscord | <retkid> im only slightly sleepy |
11:30:49 | FromDiscord | <Yardanico> https://github.com/Yardanico/wasm4nim/blob/master/examples/config.nims some of the flags for wasm (you'll need most of them even with nlvm), the only thing is that passL with all the stack size etc will probably not be needed |
11:30:52 | FromDiscord | <Yardanico> this was made for wasm4 |
11:30:58 | FromDiscord | <Yardanico> the fantasy game console |
11:35:28 | FromDiscord | <retkid> In reply to @Yardanico "https://github.com/Yardanico/wasm4nim/blob/master/e": https://github.com/stisa/nwasm |
11:35:33 | FromDiscord | <retkid> i was looking at this |
11:35:35 | FromDiscord | <retkid> lmao |
11:42:58 | FromDiscord | <xflywind> In reply to @Yardanico "so you run finish.exe": It works |
11:43:09 | FromDiscord | <xflywind> => https://github.com/nim-lang/Nim/pull/19767#issuecomment-1127566452 |
11:45:16 | FromDiscord | <xflywind> I think it should backport to 1.6.x |
11:45:37 | FromDiscord | <xflywind> (edit) "backport" => "be backported" |
11:45:59 | FromDiscord | <Yardanico> yeah |
11:59:54 | FromDiscord | <planetis> sent a code paste, see https://play.nim-lang.org/#ix=3XUo |
12:00:04 | FromDiscord | <Andreas> sent a code paste, see https://play.nim-lang.org/#ix=3XUp |
12:00:51 | FromDiscord | <enthus1ast> does V() work? |
12:00:53 | FromDiscord | <Andreas> (edit) "https://play.nim-lang.org/#ix=3XUp" => "https://play.nim-lang.org/#ix=3XUr" |
12:01:41 | FromDiscord | <Yardanico> In reply to @Andreas "Is it possible to": wdym "generic type V"? if it's a generic type you must instantiate it with all types |
12:01:41 | FromDiscord | <Andreas> In reply to @enthus1ast "does V() work?": sadly not - V can be anything (int, string, float, object) |
12:01:58 | FromDiscord | <Yardanico> types are compile-time in Nim, so you must instantiate the type when you declare a value with it |
12:01:59 | FromDiscord | <enthus1ast> i think it does not, but you could try to use a yaml implementation, as far as i know, yaml supports comments and is a superset of jsonāµ(@planetis) |
12:02:37 | FromDiscord | <Yardanico> that's the only way, you can't just declare `var x: V` here |
12:02:43 | FromDiscord | <Yardanico> maybe you actually want to use object variants? |
12:02:46 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3XUs |
12:02:51 | FromDiscord | <Yardanico> or inheritance with runtime dispatch |
12:03:02 | FromDiscord | <Yardanico> https://nim-lang.org/docs/manual.html#types-object-variants |
12:05:23 | FromDiscord | <Andreas> sent a code paste, see https://play.nim-lang.org/#ix=3XUt |
12:06:06 | FromDiscord | <Andreas> (edit) "https://play.nim-lang.org/#ix=3XUt" => "https://play.nim-lang.org/#ix=3XUu" |
12:06:28 | FromDiscord | <Yardanico> you can have a object kind with no fields |
12:06:33 | FromDiscord | <Yardanico> like mykindNone or something |
12:06:40 | FromDiscord | <Andreas> (edit) "https://play.nim-lang.org/#ix=3XUu" => "https://play.nim-lang.org/#ix=3XUv" |
12:07:02 | FromDiscord | <Yardanico> In reply to @Andreas "yepp, i actually use": but actually why not std/options ? |
12:07:23 | FromDiscord | <Andreas> In reply to @Yardanico "but actually why not": yeah, maybe thats best.. |
12:10:48 | FromDiscord | <Andreas> sent a code paste, see https://play.nim-lang.org/#ix=3XUw |
12:12:04 | FromDiscord | <Andreas> (edit) "https://play.nim-lang.org/#ix=3XUw" => "https://play.nim-lang.org/#ix=3XUx" |
12:23:56 | FromDiscord | <planetis> @enthus1ast no it does work actually |
12:24:00 | FromDiscord | <Rika> Iām not sure what your V type is supposed to be even after reading the convo |
12:25:46 | FromDiscord | <enthus1ast> oh thats great, i know i've tried it some day and it was not working back thenāµ(@planetis) |
12:40:08 | * | slowButPresent joined #nim |
12:52:51 | * | ox is now known as oz |
13:00:34 | arkanoid | what are the best selling point of rust compared to nim, as today? |
13:02:03 | arkanoid | I am thinking about moving from nim to rust as I'm having problems with antivirus issue and lack of production-level libs for some stuff I need, but I fear what I will lose |
13:02:53 | FromDiscord | <retkid> i would like to access the second |
13:02:58 | FromDiscord | <retkid> (edit) "i would like to access the second ... " added "element in the tree" |
13:03:02 | FromDiscord | <retkid> of each xml element |
13:03:17 | arkanoid | I really like Nim, but wheel is not turning fast enough to bet on it for some larger projects. What I will miss the most? |
13:03:28 | FromDiscord | <retkid> - aāµ/ 1āµ/ 2āµ3 |
13:03:44 | FromDiscord | <retkid> (edit) "- aāµ/ 1āµ/ 2āµ3" => "sent a long message, see http://ix.io/3XUF" |
13:04:09 | FromDiscord | <retkid> 0 |
13:04:14 | FromDiscord | <retkid> (edit) "0" => "-> "hi"" |
13:04:19 | FromDiscord | <retkid> (edit) "http://ix.io/3XUF" => "https://paste.rs/n0C" |
13:06:34 | FromDiscord | <Rika> In reply to @arkanoid "I really like Nim,": Better generics and macros? |
13:06:38 | FromDiscord | <Rika> Syntax? |
13:08:09 | arkanoid | rust syntax surely is ugly compared to Nim, and compile time is surely more ergonomic in nim too for same reason |
13:08:20 | * | rockcavera joined #nim |
13:08:20 | * | rockcavera quit (Changing host) |
13:08:20 | * | rockcavera joined #nim |
13:09:21 | FromDiscord | <Rika> Yeah I looked at the embedded rust stuff and wow |
13:09:30 | FromDiscord | <Rika> āThis is pretty badā |
13:09:44 | FromDiscord | <Rika> Though there are ideas Iād totally copy over |
13:12:29 | FromDiscord | <Rika> Bad not in the sense of āunusableā, just messy |
13:12:47 | FromDiscord | <retkid> embedded low level nim is also a bit of a pain though |
13:12:51 | FromDiscord | <retkid> due to how libraries do gc |
13:13:25 | FromDiscord | <Rika> ARC ORC |
13:13:26 | arkanoid | sadly I need "official" reference libraries to rely on, not wrappers with bus factor 1 (not talking about quality here, just safety againts bitrot) |
13:13:27 | FromDiscord | <Rika> Easy |
13:13:31 | FromDiscord | <planetis> Lack of progress is not something that concerns me too much, in general nim is a stable and elegnat language. |
13:13:53 | FromDiscord | <retkid> In reply to @Rika "ARC ORC": doesm |
13:13:59 | FromDiscord | <retkid> (edit) "doesm" => "doesn't that cause memory holes" |
13:14:02 | FromDiscord | <retkid> if you didn't design for it |
13:14:07 | FromDiscord | <Rika> In reply to @retkid "doesn't that cause memory": Youāre mistaken? |
13:14:18 | FromDiscord | <planetis> not with orc |
13:14:26 | PMunch | A wrapper with bus factor 1 isn't too bad IMO, I mean once a library is wrapped it's wrapped, there's not much more to do |
13:14:34 | FromDiscord | <Rika> Not with ARC if you know you donāt cycle |
13:14:40 | PMunch | Of course if you use Futhark you don't have to depend on wrappers at all :) |
13:14:43 | FromDiscord | <Rika> In reply to @PMunch "A wrapper with bus": Updates |
13:14:52 | FromDiscord | <Rika> In reply to @PMunch "Of course if you": You do if you want an idiomatic one |
13:15:06 | FromDiscord | <retkid> In reply to @Rika "Not with ARC if": yes but using the entire stdlib and extra libraries, are you really so sure you aren't gonna memory hole on an embedded system with probably very low amounts of ram |
13:15:12 | FromDiscord | <planetis> I think making a real wrapper opposed to bindings takes more time to get right |
13:15:18 | arkanoid | PMunch: nope, you need to have proper updates 1:1 with relase schedule |
13:15:19 | FromDiscord | <Rika> In reply to @retkid "yes but using the": Do you know what youāre saying? |
13:15:45 | PMunch | Oh for sure, but with Futhark you write your abstractions on top, and the low-level wrapping part is done automatically |
13:15:49 | FromDiscord | <Rika> I sure donāt know how low ram amount has to do with leaking memory, theyāre not exactly related |
13:15:59 | FromDiscord | <Rika> You could run out of memory sure |
13:16:04 | FromDiscord | <Rika> Fragmentation and all |
13:16:05 | FromDiscord | <planetis> that's awesome, I need to try it again |
13:16:10 | PMunch | So apart from major library rewrites you probably won't have to change much, if anything |
13:16:15 | FromDiscord | <planetis> In reply to @PMunch "Oh for sure, but": in reply to this |
13:16:16 | FromDiscord | <Rika> Thatās the job of the allocator though not really the GC |
13:16:32 | FromDiscord | <Rika> Not leaking memory is the job of the GC |
13:16:41 | FromDiscord | <Rika> If it does then is it really a GC |
13:16:45 | FromDiscord | <retkid> In reply to @Rika "I sure donāt know": .... I don't know how you can possibly say that out loud and not instantly see what i meant |
13:16:56 | arkanoid | PMunch: as one of the first users of Furhark (really, thanks for that, hooked me for quite a lot of time), I strongly believe in low level automatic wrapping + idiomatic wrapping on top of it, jut yet even if done right it would still be a bus factor 1 idea |
13:17:11 | FromDiscord | <Rika> In reply to @retkid ".... I don't know": You meant the opposite way, okay |
13:17:13 | FromDiscord | <retkid> where you have a limited headroom and some form of memory defect would be extremely annoying to debug |
13:17:21 | FromDiscord | <planetis> I might move naylib to it, that custom C parser of theirs suck |
13:18:00 | FromDiscord | <Rika> Now what do you mean by āwith the libraries and all, youāll leak memory with ARCā |
13:18:28 | FromDiscord | <planetis> @PMunch but I need to right everything by hand right? No way to cheat? |
13:18:35 | FromDiscord | <retkid> while yes when you have memory to spare its fine for a few problems but when on a long running system running problematic libraries that you may not know problematic until every 1 month and 13 days your embedded system has 2 minutes of downtime |
13:18:59 | FromDiscord | <retkid> (edit) "downtime" => "downtime, might be a bit annoying to debug" |
13:19:00 | FromDiscord | <Rika> I know what you mean by that |
13:19:16 | FromDiscord | <Rika> Iām asking about the connections between library usage and leaking with ARC now |
13:19:35 | FromDiscord | <planetis> I mean it wouldn't be much work at this point, I already have most functions already wrapped |
13:19:36 | PMunch | arkanoid, that's true, but at least for me when I was done writing a low-level wrapper I was fed up with the project and didn't want to touch the low-level wrapper ever again. With Futhark doing the boring 1:1 translation work I can spend my time creating a beautiful wrapper on top. This is a lot more fun, and takes a lot less time to maintain, which overall will hopefully lead to better-developed wrappers. |
13:19:57 | PMunch | @planetis, right everything? |
13:19:57 | FromDiscord | <planetis> (edit) removed "already" |
13:20:06 | FromDiscord | <Rika> He means write |
13:20:11 | FromDiscord | <retkid> I've had a few times where I've switched over to ARC and my applications would use more ram, and I'd have to go back in and actually make sure the code i was running wasn't absolute garbage |
13:20:24 | FromDiscord | <planetis> I must dyslexic of something |
13:20:25 | FromDiscord | <retkid> but when i did that it was nearly identica l |
13:20:26 | FromDiscord | <retkid> (edit) "identica l" => "identical" |
13:20:30 | FromDiscord | <planetis> (edit) "of" => "or" |
13:20:33 | PMunch | Oh :P |
13:20:37 | FromDiscord | <Rika> Async is cyclic and you need ORC for that |
13:20:43 | PMunch | Well Futhark does the 1:1 conversion from C to Nim |
13:20:45 | FromDiscord | <Rika> Otherwise I believe most other libraries arenāt |
13:20:47 | FromDiscord | <planetis> No i dont think so |
13:20:59 | FromDiscord | <retkid> In reply to @Rika "Async is cyclic and": usually happens when i use async on threads |
13:21:04 | PMunch | Then the resulting job is to write nice Nim interfaces over the C functions |
13:21:10 | FromDiscord | <Rika> And thereās your issue no? |
13:21:27 | FromDiscord | <Rika> Also you canāt exactly use threads and async in embedded (without effort) |
13:21:40 | FromDiscord | <Rika> Since those rely on POSIX things and usually you donāt have that on embedded |
13:21:43 | FromDiscord | <retkid> pretty sure this has never been a problem for a single threaded application |
13:21:51 | FromDiscord | <retkid> like ever |
13:21:53 | PMunch | For example I recently wrote a CoAP wrapper that features destructors and async/await support in Nim. So you don't have to manage memory manually, and you can integrate it with other async systems in Nim :) |
13:22:18 | FromDiscord | <retkid> but the only time I've needed to switch over to ARC is when im doing strange memory things on threads |
13:22:23 | PMunch | I have an article in the pipe for it that will help to showcase how to work with Futhark |
13:22:48 | FromDiscord | <Rika> Well in embedded contexts threads are much different from threads in more usual contexts |
13:22:55 | FromDiscord | <Rika> You have less securities and limitations and whatnot |
13:23:02 | FromDiscord | <Rika> Sometimes you donāt have threading at all xd |
13:23:21 | FromDiscord | <retkid> In reply to @Rika "You have less securities": that sounds cooler for the 0.2 seconds before i read the words |
13:23:31 | FromDiscord | <retkid> sent a code paste, see https://play.nim-lang.org/#ix= |
13:23:45 | FromDiscord | <retkid> then i slumped back in my chair |
13:23:57 | FromDiscord | <retkid> (edit) |
13:24:07 | FromDiscord | <Rika> I donāt know man, Iām not sure what your point was |
13:24:20 | FromDiscord | <Rika> ARC doesnāt leak unless you have cycles as Iāve said |
13:24:21 | FromDiscord | <retkid> Rika are you ever sure what my point was |
13:24:58 | FromDiscord | <Rika> Would you like to ask the other people whether they understood your point or not |
13:25:01 | FromDiscord | <planetis> Well apart from some C FFI regressions in 1.6 that have been fixed, making sure you don't mess up with pointers somehow is still your responsibility. |
13:25:24 | FromDiscord | <Rika> In reply to @planetis "Well apart from some": I believe that will always be your responsibility when wrapping C libraries |
13:25:29 | FromDiscord | <retkid> In reply to @Rika "Would you like to": No i think I am always unprepared to talk about these things, bad at articulating these problems, and never wanna share my code |
13:25:39 | FromDiscord | <Rika> Okay |
13:25:50 | FromDiscord | <Rika> Youāll get better over time with practice |
13:26:13 | FromDiscord | <Rika> By the way I hope you donāt think Iām mad lol |
13:26:26 | FromDiscord | <planetis> well the best tool you have is ASan it helps track down mistakes easily, provided you know what's going on |
13:26:47 | FromDiscord | <retkid> In reply to @Rika "Youāll get better over": im going to uni for this shit soon so I hope I somehow get better at articulating low level problems in Nim |
13:27:06 | FromDiscord | <Rika> Uni doesnāt really help from my experience but ymmv |
13:27:22 | FromDiscord | <planetis> In reply to @Rika "Uni doesnāt really help": same |
13:27:40 | FromDiscord | <retkid> welp |
13:27:59 | FromDiscord | <retkid> hopefully this part of my brain just gets bulkier over the next 40 uyears |
13:28:03 | FromDiscord | <retkid> (edit) "uyears" => "years or so" |
13:28:31 | FromDiscord | <retkid> the "reddit programmer argument" part |
13:28:34 | FromDiscord | <Rika> Careful of haemorrhage |
13:28:56 | FromDiscord | <retkid> THATS HOW YOU SPELL THAT |
13:29:00 | FromDiscord | <retkid> :O |
13:29:23 | FromDiscord | <Rika> You can also spell it without the first a |
13:30:10 | FromDiscord | <planetis> they teach that stuff very fast, so going prepared would help you a lot. |
13:31:47 | FromDiscord | <retkid> In reply to @planetis "they teach that stuff": I'll be fine for a few yearws |
13:31:48 | FromDiscord | <retkid> (edit) "yearws" => "years" |
13:31:50 | FromDiscord | <retkid> maybe a year |
13:32:08 | FromDiscord | <retkid> but there will probably be a very specific point in time |
13:32:19 | FromDiscord | <retkid> where i go from knowing everything to go to knowing nothing |
13:32:25 | FromDiscord | <retkid> and thats what i gotta be ready for |
13:33:06 | FromDiscord | <Rika> Here, I think I get it now |
13:33:13 | FromDiscord | <Rika> Youāre right that you can leak with ARC |
13:33:26 | arkanoid | PMunch: sure, but what you have at the end is at least 3 projects: low-level wrapper that hopefully you can keep up-to-date automatically (but that's not granted), an idiomatic wrapper that should cope with low-level changes and compatibility on top, and your project using the imported features. As a simple programmer in a 1 man team, I want to cope with just my project, sadly |
13:33:30 | FromDiscord | <Rika> Youāre mistaken that you can leak with ARC easily |
13:33:42 | FromDiscord | <Rika> Youāre right that you still have to be careful with ARC |
13:33:55 | FromDiscord | <planetis> well being open to learning is the best skill someone should have in CS |
13:34:49 | FromDiscord | <retkid> In reply to @planetis "well being open to": I don't wanna only major in CS but I feel like i might be too stupid for a mathmatics degree |
13:34:54 | FromDiscord | <retkid> (edit) "mathmatics" => "mathematics" |
13:35:00 | PMunch | arkanoid, yeah I get that. I was just saying that since the amount of work required to keep a project up to date is smaller it should allow developers of the bindings to create better results with the same amount of effort |
13:35:02 | FromDiscord | <planetis> a minor in math? |
13:35:30 | FromDiscord | <planetis> oh two degrees cool |
13:36:12 | FromDiscord | <retkid> learned some f# today |
13:36:26 | FromDiscord | <retkid> better than ocaml lmao |
13:37:22 | FromDiscord | <planetis> and how is it? |
13:37:31 | FromDiscord | <planetis> learning functional languages is the only thing I resist, I guess I don;t follow what I preachš¤£ |
13:37:53 | FromDiscord | <retkid> its easier having been scared off by ocaml |
13:38:05 | FromDiscord | <retkid> though it took me like an hour to write a simple function |
13:38:09 | PMunch | @retkid, I learned some F# for a class at university, that was horrible |
13:38:26 | PMunch | Taught myself some Clojure, now that is a really nice language |
13:38:32 | * | arkurious joined #nim |
13:38:39 | FromDiscord | <retkid> then it took me like 30 minutes to write a prime checking function |
13:38:49 | FromDiscord | <retkid> then took me 5 minutes to check within a loop |
13:39:07 | FromDiscord | <retkid> In reply to @PMunch "<@217459674700578816>, I learned some": its not that cool. I like how it makes me think |
13:39:16 | FromDiscord | <retkid> (edit) "cool." => "bad." |
13:39:36 | arkanoid | I went straight learning haskell. That-is-a-monster language |
13:39:38 | PMunch | The thing I really liked with Clojure was how everything just slots together. F# felt like drying to use a screwdriver to nail something up |
13:39:46 | FromDiscord | <Rika> Haskell isnāt too bad |
13:39:51 | arkanoid | problem is that the feature you have in haskell you don't have anywhere else |
13:39:53 | PMunch | s/drying/trying |
13:40:26 | FromDiscord | <Rika> In reply to @arkanoid "problem is that the": So like Nim hahaha |
13:40:29 | PMunch | I wish the Nim standard library fit together as well as Clojures, if that was the case it would be pretty much perfect |
13:40:40 | arkanoid | yeah :D kinda |
13:41:02 | FromDiscord | <retkid> https://media.discordapp.net/attachments/371759389889003532/975754753625710628/unknown.png |
13:41:16 | arkanoid | nim would be my perfect language if there would be official releases for major libs for it |
13:41:46 | FromDiscord | <retkid> In reply to @arkanoid "nim would be my": this is the nim motto... |
13:41:48 | arkanoid | but nowadays you see only C/C++/Rust and Python for very high level implementations |
13:41:55 | PMunch | @retkid, you probably liked the functional way of thinking, which I also enjoy immensely, but it's just so clunky and weird |
13:42:03 | FromDiscord | <retkid> https://tenor.com/view/bender-hookers-blackjacks-futurama-gif-18364125 |
13:42:25 | arkanoid | hahaha |
13:42:26 | FromDiscord | <retkid> ^thats just the entire nim community and all major libs |
13:42:33 | FromDiscord | <retkid> we have our own fork |
13:42:37 | FromDiscord | <retkid> hasn't been updated in 7 years |
13:42:50 | FromDiscord | <retkid> but Treeforms did it like in 1998 |
13:42:52 | FromDiscord | <retkid> ĀÆ\_(ć)_/ĀÆ |
13:43:38 | PMunch | I have considered trying to delete all of stdlib and try to build my own :P |
13:43:47 | PMunch | That is quite a herculean task though |
13:44:25 | PMunch | Oh well, I'm off |
13:44:27 | * | PMunch quit (Quit: Leaving) |
13:44:28 | FromDiscord | <retkid> sounds like you have too much freetime |
13:44:34 | FromDiscord | <retkid> consider how limited life is |
13:45:01 | FromDiscord | <retkid> and all the cool things that can be done in that time, like, go outside |
13:45:15 | FromDiscord | <retkid> i kid |
13:48:02 | FromDiscord | <Rika> Youāre a kid yes |
13:48:13 | FromDiscord | <Rika> Youāre retkid |
13:49:53 | FromDiscord | <retkid> retadult |
13:49:54 | FromDiscord | <retkid> legaly |
13:50:34 | FromDiscord | <retkid> though in my brain im stuck at the age of like a 13 year old and I cant mature socially |
13:52:00 | FromDiscord | <Rika> Probably should get that checked or something |
13:53:59 | * | noeontheend joined #nim |
13:59:06 | FromDiscord | <retkid> In reply to @Rika "Probably should get that": just autism |
13:59:11 | FromDiscord | <retkid> socially inepty |
13:59:13 | FromDiscord | <retkid> (edit) "inepty" => "inept" |
14:07:21 | FromDiscord | <Andreas> seems that `-d:nimOldCaseObjects ` solves my troubles with variants š Any idea how long this option will be around ? |
14:07:31 | FromDiscord | <Andreas> (edit) "`-d:nimOldCaseObjects `" => "`-d:nimOldCaseObjects`" |
14:09:42 | * | noeontheend quit (Ping timeout: 260 seconds) |
14:12:07 | * | noeontheend joined #nim |
14:13:22 | arkanoid | where would be nim here? http://www.modulecounts.com/ |
14:13:32 | * | dtomato quit (Quit: The Lounge - https://thelounge.chat) |
14:13:41 | arkanoid | it's just a rethoric question |
14:15:12 | FromDiscord | <retkid> https://media.discordapp.net/attachments/371759389889003532/975763349608497202/unknown.png |
14:15:27 | FromDiscord | <retkid> what the fuck node |
14:16:22 | FromDiscord | <retkid> this is because node will have modules that have modules for their modules |
14:17:11 | arkanoid | node is like https://9gag.com/gag/apgv5PB |
14:17:33 | * | dtomato joined #nim |
14:17:55 | FromDiscord | <aph> In reply to @arkanoid "where would be nim": you can try counting here: https://github.com/nim-lang/packages/blob/master/packages.json |
14:18:01 | FromDiscord | <aph> failed on my phone |
14:18:09 | FromDiscord | <aph> the data is too large to be on a clipboard |
14:18:21 | arkanoid | there's nim you can enable on modulecounts.com |
14:18:27 | arkanoid | it's just 1/day |
14:19:10 | * | vicfred joined #nim |
14:21:31 | arkanoid | elixir/erlang has some serious curve, I though it was less than that |
14:28:50 | FromDiscord | <Rika> In reply to @Andreas "seems that `-d:nimOldCaseObjects`": Likely 2.0? |
14:28:58 | FromDiscord | <Rika> Rather it will be gone by 2.0 |
14:34:56 | FromDiscord | <uncle jim> how to accept command line arguments in nim? |
14:36:40 | FromDiscord | <Rika> Thereās a lot of ways, you can get parameters raw from std/os or use an external package to help with parsing |
14:38:04 | FromDiscord | <0st guy on the list> In reply to @Rika "Thereās a lot of": how me do that? |
14:38:09 | FromDiscord | <0st guy on the list> using std/os |
14:38:56 | FromDiscord | <Rika> https://nim-lang.org/docs/os.html#commandLineParams |
14:39:10 | FromDiscord | <Rika> There's also |
14:39:12 | FromDiscord | <Rika> https://nim-lang.org/docs/parseopt.html |
14:41:19 | FromDiscord | <0st guy on the list> zamn the nim standard lib is wayyyyyy better than rust standard lib(rust std sucks) |
14:47:07 | FromDiscord | <Rika> I have no experience there so I canāt say |
14:47:11 | FromDiscord | <Rika> Why do you think so |
14:47:47 | FromDiscord | <0st guy on the list> In reply to @Rika "Why do you think": it's really small |
14:47:56 | FromDiscord | <Rika> Probably intentional |
14:48:13 | FromDiscord | <0st guy on the list> it does not have many libs that are actually needed |
14:49:10 | FromDiscord | <Rika> Why not use a third party library then |
14:49:45 | FromDiscord | <0st guy on the list> In reply to @Rika "Why not use a": can't be so reliant on them |
14:49:52 | FromDiscord | <Rika> Why so? |
14:50:15 | FromDiscord | <0st guy on the list> In reply to @Rika "Why so?": it increases rusts compile time |
14:50:26 | FromDiscord | <0st guy on the list> the `dependencies` |
14:50:41 | FromDiscord | <Rika> The standard library doesnāt? |
14:51:30 | arkanoid | 0st guy on the list: for your infomation, nim is going to externalize stdlib features too |
14:51:57 | arkanoid | the more modules, the better, including stdlib |
14:52:16 | arkanoid | (this is the shared idea, not my personal, I like batteries included) |
14:53:45 | FromDiscord | <0st guy on the list> In reply to @Rika "Why not use a": there's also the problem of outdated crates |
14:54:10 | FromDiscord | <Rika> Itās an issue for standard libraries too you know |
14:54:20 | FromDiscord | <0st guy on the list> In reply to @Rika "Itās an issue for": y |
14:54:24 | FromDiscord | <Rika> A lot of stuff in the Nim standard library are left to rot because no one is maintaining it |
14:54:47 | FromDiscord | <Rika> Just because something is in the standard library doesnāt mean it is well maintained |
14:55:07 | FromDiscord | <0st guy on the list> hmmmm |
14:55:20 | FromDiscord | <0st guy on the list> guess we can't do anything about that |
14:55:33 | FromDiscord | <Rika> In reply to @arkanoid "(this is the shared": I like batteries included if it didnāt mean maintenance hell |
14:55:48 | FromDiscord | <Rika> Then again, Iād prefer āeasy to make integrated librariesā more |
14:56:11 | FromDiscord | <Rika> Like features that allow for you to easily combine different libraries from different people kinda thing |
14:57:36 | * | vicfred quit (Quit: Leaving) |
15:05:42 | arkanoid | I prefer when a lot of people are aiming at the same thing. |
15:05:54 | arkanoid | And nim is not like that |
15:08:56 | FromDiscord | <Rika> What do you mean? |
15:11:41 | FromDiscord | <Rika> Itās hard to explain this, but if weāre talking relatively, I believe all languages have an unfocused aim with regards to devs who arenāt part of the core team |
15:11:42 | arkanoid | I mean that I like when the knowledge/responsibility over a project is shared among a lot of people |
15:11:47 | FromDiscord | <Rika> Itās just that Nim is smaller so itās felt more |
15:12:48 | FromDiscord | <Rika> With core devs itās a different thing |
15:13:54 | arkanoid | sure, I'm not saying nim is wrong, absolutely, it's my favorite and community, but it's hard to live with it. I fear betting when picking modules for important projects |
15:14:21 | arkanoid | while with python, for example, there would be shitton of people complaning for a regression, with nim I'd be always the first |
15:15:08 | FromDiscord | <Rika> It really is hard to live with |
15:15:17 | FromDiscord | <Rika> I have the same feeling |
15:15:49 | FromDiscord | <Rika> Itās not easy to solve, I believe itās partially a money thing partially a āweāre so different people donāt want to use itā |
15:16:56 | * | vicfred joined #nim |
15:25:26 | arkanoid | someone has to be paid professionally to build, maintain and pass the responsibility to next maintainer for major building blocks |
15:26:22 | arkanoid | nim would be a great language for data science, but it is not as nobody is getting paid to build the equivalent of python's scipy for nim |
15:26:41 | FromDiscord | <sheerluck> nim is a great language |
15:27:55 | arkanoid | it's a big trap for small teams who want to use them as lingua-franca for different projects |
15:31:28 | FromDiscord | <sheerluck> lower your expectations a bit. It's a trap only if small team expects too much. like all python batteries. |
15:33:55 | FromDiscord | <sheerluck> if small team wants to do something but it is not available yet in Nim, small team can use Python to fill the gaps |
15:57:28 | arkanoid | sheerluck, maintaining two pipelines and splitting to microservices is not always feasible or preferred than just using the technology that let's you do both |
15:58:20 | FromDiscord | <jmgomez> heys guys, anyone knows what's the compiler argument (if possible at all) for setting a directory to look for dyn libs when creating an executable? |
15:59:50 | FromDiscord | <demotomohiro> `--passL:-L/path/to/dir` |
16:01:20 | FromDiscord | <demotomohiro> Or `--clibdir:/path/to/dir`: https://nim-lang.org/docs/nimc.html |
16:03:18 | FromDiscord | <jmgomez> but is not that for the linker? I mean for the dependencies on the executable, rather than the symbols |
16:10:40 | * | wallabra_ joined #nim |
16:11:17 | * | wallabra quit (Ping timeout: 246 seconds) |
16:11:39 | * | wallabra_ is now known as wallabra |
16:15:30 | FromDiscord | <spoon> any treesitter support? |
16:18:17 | FromDiscord | <spoon> or treesitter grammar rather |
16:20:41 | FromDiscord | <demotomohiro> @jmgomez Then only option I know is `--rpath`: https://sourceware.org/binutils/docs-2.38/ld/Options.html#OptionsāµAnd It seems no way to embed paths to search for dlls to an executable on windows. |
16:32:21 | FromDiscord | <jmgomez> In reply to @demotomohiro "<@726017160115126333> Then only option": Tried before asking and didnt did the trick, not sure if I was doing something wrong. I did a simbolic link with the dlls because the env var cant be set neither (on MacOs). When I got a fresh env will try again with rpath. Thanks! |
16:51:48 | * | ehmry quit (Ping timeout: 240 seconds) |
16:55:57 | * | noeontheend quit (Ping timeout: 260 seconds) |
16:56:26 | * | ehmry joined #nim |
17:01:41 | * | ehmry quit (Ping timeout: 246 seconds) |
17:06:52 | FromDiscord | <Rika> In reply to @spoon "or treesitter grammar rather": someone tried |
17:32:33 | * | ehmry joined #nim |
17:37:30 | * | xet7 joined #nim |
18:02:22 | * | ehmry quit (Ping timeout: 250 seconds) |
18:05:32 | FromDiscord | <konsumlamm> In reply to @retkid "its easier having been": i'm curious what scared you in OCaml that wasn't a problem in F# |
18:05:54 | FromDiscord | <morgan> is there a way to have a for loop that jumps forward by more than one? |
18:06:37 | FromDiscord | <konsumlamm> sure |
18:06:41 | FromDiscord | <retkid> https://media.discordapp.net/attachments/371759389889003532/975821608532979722/unknown.png |
18:07:13 | * | PMunch joined #nim |
18:07:20 | FromDiscord | <konsumlamm> In reply to @MorganAlyssa "is there a way": `for i in countup(a, b, step): ...` |
18:07:24 | NimEventer | New question by William Rosenbaum: Function comparing two strings slower in nim than python, see https://stackoverflow.com/questions/72263721/function-comparing-two-strings-slower-in-nim-than-python |
18:07:26 | FromDiscord | <retkid> https://media.discordapp.net/attachments/371759389889003532/975821792906215524/unknown.png |
18:07:45 | FromDiscord | <konsumlamm> In reply to @retkid "": isn't the F# syntax mostly the same? |
18:07:54 | FromDiscord | <konsumlamm> those don't really look like beginner examples either |
18:08:36 | FromDiscord | <morgan> In reply to @konsumlamm "`for i in countup(a,": thanks |
18:08:38 | FromDiscord | <retkid> i also dont feel the need to type ;; to define a var |
18:08:45 | FromDiscord | <konsumlamm> why are you confused about the dots though? those just access module members, just like in Nim |
18:08:57 | FromDiscord | <konsumlamm> In reply to @retkid "i also dont feel": you don't need to either, except in the REPL |
18:09:39 | FromDiscord | <retkid> pointAssoc.add_multi isn't defined in this screenshot |
18:09:40 | FromDiscord | <retkid> so |
18:09:56 | FromDiscord | <retkid> what if its a builtin default function thats stupid and i need to learn |
18:10:11 | FromDiscord | <retkid> what are all the ~ i guarantee they do something stupid and unneeded |
18:10:31 | FromDiscord | <konsumlamm> named arguments lol |
18:11:00 | FromDiscord | <retkid> idk f# just seems more slimmed down |
18:11:03 | FromDiscord | <retkid> same idea |
18:11:04 | FromDiscord | <konsumlamm> it is |
18:11:05 | FromDiscord | <retkid> just moved |
18:11:09 | FromDiscord | <retkid> (edit) "moved" => "modern" |
18:11:41 | FromDiscord | <retkid> i also wanted to learn more functional so i can learn a language like haskell less difficulties |
18:11:51 | FromDiscord | <retkid> also purescript |
18:13:05 | FromDiscord | <konsumlamm> makes sense |
18:13:18 | FromDiscord | <retkid> (edit) "i also wanted to learn more functional so i can learn a language like haskell ... less" added "with" |
18:13:50 | FromDiscord | <retkid> ~~i also wanna impress this cute person i know whos a haskell nerd~~ |
18:14:31 | PMunch | F# seems slimmed down? What have you been using? |
18:14:39 | * | ehmry joined #nim |
18:14:45 | FromDiscord | <retkid> slimmed down in simple syntax |
18:14:57 | FromDiscord | <retkid> it has more features and a bigger stdlib |
18:15:09 | FromDiscord | <konsumlamm> ~~i doubt a haskell nerd will be impressed by F#~~ |
18:15:16 | PMunch | F# syntax is a wild mess.. |
18:15:18 | FromDiscord | <konsumlamm> unless you show them computation expressions maybe |
18:15:40 | PMunch | If you want slim syntax, check out Clojure :) |
18:15:42 | FromDiscord | <retkid> In reply to @konsumlamm "~~i doubt a haskell": if i get good F# i can impress her with haskell and purescript and maybe even... K |
18:29:33 | FromDiscord | <retkid> In reply to @PMunch "F# syntax is a": there are some things involving how strict the typing is that i'd like to ideally change |
18:30:27 | FromDiscord | <retkid> i like how the lack of control makes you write code differently too |
18:36:19 | FromDiscord | <ambient> F# is pretty much Ocaml isn't it? Ocaml should be pretty easy to get started with, plus it's pretty fast |
18:37:42 | FromDiscord | <ambient> now, could I write Ocaml just with Nim macros? š¤ |
18:56:05 | FromDiscord | <Phil> If you use nimpy, do you still compile with -d:release? |
18:56:38 | FromDiscord | <Phil> Mostly asking since, skimming over the nimpy github page, the example does not contain -d:release:āµ`nim c --app:lib --out:mymodule.so --threads:on mymodule` |
18:58:00 | FromDiscord | <Yardanico> In reply to @Isofruit "Mostly asking since, skimming": Are you talking to the StackOverflow question? |
18:58:05 | FromDiscord | <Phil> In reply to @Yardanico "Are you talking to": Yeah, got curious and skimmed over it |
18:58:23 | FromDiscord | <Phil> Couldn't see anything obviously wrong with the code so I started assuming he compiled badly somehow |
18:58:23 | FromDiscord | <Yardanico> Well, that person isn't there, are they? |
18:58:32 | FromDiscord | <Yardanico> In reply to @Isofruit "Couldn't see anything *obviously*": Yeah I'll try myself |
18:59:20 | FromDiscord | <Yardanico> And they shouldn't forget about overhead of converting Nim types to Python types |
19:00:03 | FromDiscord | <Phil> Yeah but if you act on strings with 50000 chars I'd assume the overhead to be not that big in comparison |
19:00:13 | FromDiscord | <Phil> That's why I asked if their benchmark was a lot of small calls or a few big ones |
19:04:28 | PMunch | Seems like a classic mistake of debug vs. release |
19:04:40 | FromDiscord | <Xzayler> Does anyone use an ORM with nim? |
19:04:42 | PMunch | I built their code with both |
19:04:49 | PMunch | @Xzayler, yes |
19:04:54 | FromDiscord | <Xzayler> which one? |
19:05:11 | FromDiscord | <Xzayler> I found a few but not sure if they're up to date or abandoned or something |
19:05:15 | PMunch | Python version on my version was 0.9s, Nim was 5.6 in debug mode, 0.6 in release mode |
19:05:26 | PMunch | @Xzayler, oh an ORM |
19:05:32 | PMunch | Sorry I misread your question |
19:05:46 | PMunch | I assume some projects use ORMs in Nim though, can't think of any of the top of my head though |
19:05:51 | PMunch | Maybe the Nim forums? |
19:06:32 | FromDiscord | <Xzayler> I mean an ORM library |
19:07:46 | FromDiscord | <Phil> In reply to @Yardanico "Yeah I'll try myself": Just did it, they didn't compile with -d:release |
19:07:51 | FromDiscord | <Yardanico> Classic |
19:08:02 | FromDiscord | <Yardanico> A true timeless classic |
19:08:13 | FromDiscord | <Yardanico> Even though Nim literally screams DEBUG MODE |
19:08:20 | FromDiscord | <Yardanico> But I guess they didn't see that with nimporter or something |
19:12:11 | FromDiscord | <Phil> TBF, they're likely a pythonista that just looked at the github page of nimpy, which makes no mention of -d:release |
19:12:29 | FromDiscord | <Phil> I can see myself making the same mistake if I just want to play fast and loose and play around |
19:12:44 | FromDiscord | <Yardanico> but honestly there's almost no point in optimizing this specific code in a Nim extension |
19:13:31 | FromDiscord | <Phil> Eh, still around 33% faster on my machineāµKeep in mind he's most likely doing this for bioinformatics. āµYou do a ton of string comparison stuff like this there |
19:14:20 | FromDiscord | <Yardanico> In reply to @Isofruit "Eh, still around 33%": The cost of crossing the Python-Nim bridge in this case is also quite big |
19:14:32 | FromDiscord | <Yardanico> it'd be better if he would write his program in Nim and call into Python for stuff he needs from it |
19:16:16 | FromDiscord | <Phil> I think if he just writes the entire part thats computationally expensive so that you only do a single call from the outside, do a ton of work in nim and then return the result, you could make it worth it while staying in the python ecosystem |
19:16:29 | FromDiscord | <Phil> Though fun fact, this was the first time I ever did nim to python stuff, that was surprisingly painless |
19:17:00 | PMunch | Yeah I was also shocked by how easy it was to use nimpy |
19:17:15 | FromDiscord | <Phil> God dangit Pmunch! I wanted to write an answer as well xD |
19:17:29 | PMunch | I thought the instructions was missing a part :P |
19:17:38 | PMunch | @Phil, haha feel free :) |
19:18:17 | FromDiscord | <Phil> Nah, can't really add much more than you already did, other than numbers that is |
19:18:38 | FromDiscord | <Yardanico> In reply to @Isofruit "Nah, can't really add": your comment is a bit misformatted with ` :) |
19:18:52 | FromDiscord | <Phil> Yeah I saw that just now as well |
19:18:55 | FromDiscord | <Rika> Donāt think itās his fault though |
19:19:25 | PMunch | Yeah the -d:release part of that message uses backticks :P |
19:19:34 | PMunch | I changed them manually in my paste |
19:21:16 | FromDiscord | <Phil> I noticed too late to edit ;_; |
19:21:34 | * | byanka joined #nim |
19:22:52 | FromDiscord | <Phil> Where was stuff like -d:lto explained again? |
19:23:01 | FromDiscord | <Phil> It's not in the compiler user guide |
19:27:15 | PMunch | The Stack Overflow developer survey has square boxes with checkmarks that works like radio-boxes.. |
19:27:34 | PMunch | -d:lto is just a shortcut for --passL:-flto I believe |
19:27:37 | PMunch | It's a C thing |
19:28:33 | FromDiscord | <Yardanico> In reply to @PMunch "-d:lto is just a": a bit more than that, it also forces the use of lld with clang for no reason :) |
19:28:42 | FromDiscord | <Yardanico> so if you want LTO with clang but don't have lld installed, -d:lto won't work :P |
19:28:55 | FromDiscord | <Yardanico> passing -flto directly to the C compiler will |
19:30:07 | FromDiscord | <Phil> The only reason I know of -d:lto is because I think yard dropped it at one point and it actually gave another slight speed-up to my web-project, so I just kept it in there for when I compile prod-code.āµSo without being able to bug Yard about this, I wouldn't even know -d:lto is there and useful! |
19:30:43 | FromDiscord | <Phil> Thus the question if there's other documentation than the compiler user guide for stuff like that |
19:40:32 | PMunch | Well, make a Stackoverflow post about poor performance in Nim and you'll get all the flags you need :P |
19:41:56 | FromDiscord | <Phil> But PMunch! |
19:42:09 | FromDiscord | <Phil> I'd need to have an example of nim code with poor performance for that and I just don't have that! |
19:42:27 | FromDiscord | <Phil> ~~Even my worst nim-code bits in my application are still like 5 times faster than whatever I had in python in their place~~ |
19:43:16 | FromDiscord | <Phil> With the one exception being hashing the password, but we had already established that python basically has an insanely well optimized wrapper around ... some very fast C lib whose name I forgot |
19:52:16 | PMunch | Haha, what a luxury problem you have |
19:55:06 | * | gsalazar quit (Remote host closed the connection) |
19:55:10 | FromDiscord | <Phil> I think it's mostly that in terms of performance I'm looking through a very skewed lense. I'm not going for embedded software speeds where I actually need to seriously think about optimizations.āµMy worst nim code will always be faster than my python code through the sheer virtue of it being written in nim, and if my measuring stick is python then I pretty much can only win |
19:55:16 | * | gsalazar joined #nim |
19:58:41 | PMunch | Beside -d:release the biggest speed boost you can get is changing algorithms and optimising your code |
19:58:53 | PMunch | LTO and other such things will only give you marginally better performance |
19:59:35 | FromDiscord | <Phil> Yeh, but LTO is free performance! |
20:00:08 | FromDiscord | <Phil> In terms of bang for buck, given the amount of effort that goes into making use of LTO on my end, its utility is infinite! |
20:00:08 | PMunch | You can read this as well: https://blog.johnnovak.net/2017/04/22/nim-performance-tuning-for-the-uninitiated/ |
20:00:16 | PMunch | It's a bit old, but still some good stuff in there |
20:00:24 | PMunch | That's fair |
20:00:51 | FromDiscord | <Yardanico> In reply to @PMunch "LTO and other such": well, PGO can give quite big speedups as well, but for it you need some real-world usage data to profile your program on |
20:01:02 | PMunch | There was another thing where you would run your code through a program which essentially figured out what the hot paths where and made sure those where faster |
20:01:08 | PMunch | Ah yes, PGO! |
20:01:34 | PMunch | https://forum.nim-lang.org/t/6295 |
20:03:50 | FromDiscord | <Yardanico> https://github.com/Yardanico/nim-snippets/blob/master/compile_pgo.nim a lot of repetitions :) |
20:03:55 | FromDiscord | <planetis> That blog theme is so cool |
20:04:28 | PMunch | @planetis, John Novaks? |
20:04:32 | FromDiscord | <planetis> yep |
20:04:39 | PMunch | Yeah I really like that one |
20:05:49 | PMunch | Solid mobile version as well |
20:05:55 | PMunch | I really should redesign my site.. |
20:15:23 | * | daemilk quit (Quit: Connection closed for inactivity) |
20:31:30 | * | vicecea quit (Remote host closed the connection) |
20:32:04 | * | vicecea joined #nim |
20:51:35 | * | tiorock joined #nim |
20:51:35 | * | tiorock quit (Changing host) |
20:51:36 | * | tiorock joined #nim |
20:51:36 | * | rockcavera is now known as Guest5850 |
20:51:36 | * | Guest5850 quit (Killed (copper.libera.chat (Nickname regained by services))) |
20:51:36 | * | tiorock is now known as rockcavera |
20:54:34 | FromDiscord | <planetis> I forgot about what a director in a multinational company here told me during an industry event. |
20:55:06 | FromDiscord | <planetis> Fuck rust you should learn Java and SQL database s are the future man |
20:55:28 | FromDiscord | <planetis> Good advice, right? |
21:09:21 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "What was the issue": id have to create a gtk2 window (and a windows window)āµand besides i dont want that dependency im not sure how to create a window and hide it or š¤·āāļø |
21:10:49 | PMunch | I mean if you just want to earn money learn Fortran and Cobol :P |
21:11:22 | PMunch | I once got told that programming was a fad and I should try to get myself onto a fishing ship instead |
21:11:26 | PMunch | Not all advice is good advice |
21:14:57 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "What was the issue": they're so old https://media.discordapp.net/attachments/371759389889003532/975868984362688532/Screenshot_from_2022-05-16_16-14-25.png |
21:15:02 | FromDiscord | <Elegantbeef> Hey i bet most fishermen never say "Fish is fucking abhorrent" |
21:15:13 | FromDiscord | <Elegantbeef> I know software developers say "Software is fucking abhorrent" |
21:15:15 | * | PMunch quit (Quit: leaving) |
21:16:40 | * | noeontheend joined #nim |
21:38:59 | * | greaser|q joined #nim |
21:40:09 | * | greaser|q quit (Changing host) |
21:40:09 | * | greaser|q joined #nim |
21:40:11 | * | greaser|q is now known as GreaseMonkey |
22:03:45 | FromDiscord | <ambient> is there a copy somewhere? |
22:03:47 | FromDiscord | <ambient> sent a code paste, see https://play.nim-lang.org/#ix=3XWO |
22:04:04 | FromDiscord | <ambient> (edit) "https://play.nim-lang.org/#ix=3XWO" => "https://play.nim-lang.org/#ix=3XWP" |
22:04:25 | FromDiscord | <ambient> (edit) "https://play.nim-lang.org/#ix=3XWP" => "https://play.nim-lang.org/#ix=3XWQ" |
22:05:05 | FromDiscord | <ambient> i tested the (y, x) = (x, y) part and it doesn't seem to change any performance |
22:15:41 | * | termer quit (Remote host closed the connection) |
22:16:03 | * | termer joined #nim |
22:27:42 | FromDiscord | <ambient> sent a code paste, see https://play.nim-lang.org/#ix=3XWW |
22:28:48 | FromDiscord | <Yardanico> i think asking arraymancer questions in #science would be more useful :) but it's fine to ask it here too, but some people in #science only talk in it P |
22:28:57 | FromDiscord | <ambient> ok |
22:33:25 | FromDiscord | <Elegantbeef> The `[a..b]` might copy |
22:52:39 | * | arkurious quit (Quit: Leaving) |
22:58:43 | * | xet7 quit (Remote host closed the connection) |
22:59:46 | * | xet7 joined #nim |
23:41:04 | FromDiscord | <root> sent a code paste, see https://play.nim-lang.org/#ix=3XX8 |
23:41:19 | FromDiscord | <root> (edit) "https://play.nim-lang.org/#ix=3XX8" => "https://play.nim-lang.org/#ix=3XX9" |
23:41:47 | FromDiscord | <root> (I already had the server running on my host pc (Linux) |
23:42:54 | FromDiscord | <Elegantbeef> https://stackoverflow.com/a/43168497/15200657 |
23:43:01 | FromDiscord | <Elegantbeef> Mingw isnt properly in your path |
23:43:27 | FromDiscord | <Elegantbeef> You either need the `.dll` next your binary or mingw in path |
23:43:47 | FromDiscord | <Elegantbeef> Dont recall where mingw is placed for Nim |
23:44:37 | FromDiscord | <root> ok thank you š |
23:45:54 | * | ltriant_ quit (Ping timeout: 272 seconds) |
23:46:09 | * | ltriant joined #nim |
23:46:21 | FromDiscord | <Elegantbeef> Windows is the worst development platform return to TempleOS |
23:54:23 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "*Windows is the worst": true |