<< 13-06-2021 >>

00:00:12FromDiscord<Varriount> Can anyone familiar with Python and C tell me why Python's posix_spawn implementation doesn't close file descriptors duplicated to stdout, stdin, and stderr? I do that in my own implementation, and am trying to work out why it isn't done there. ↵https://github.com/python/cpython/blob/bb3e0c240bc60fe08d332ff5955d54197f79751c/Lib/subprocess.py#L1642
00:00:36PMunchI have written the Google Authenticator algorithm in Nim before, it's pretty simple
00:00:48PMunchAnd you've got plenty of program memory left with my firmware :P
00:00:50FromDiscord<treeform> Was it part of your keyboard?
00:01:01PMunchNah, it was just for fun
00:01:05FromDiscord<treeform> ok
00:01:12PMunchBefore I even started working on the keyboard
00:01:19PMunchBut it should be pretty simple to add it in
00:01:27PMunchAs I said, plenty of program memory left :)
00:01:49PMunchI was hoping to fit the firmware on an ATtiny85 just for fun, and I think it should be doable
00:02:31PMunchMy keyboard firmware only takes up 3750 bytes in the configuration I'm using
00:02:51FromDiscord<treeform> I remember making a tiny wood computer with ATtiny85
00:03:27PMunchCompared to the smallest version of QMK (with a bunch of stuff disabled) which clocks in at 12220 bytes
00:04:11PMunchWood computer?
00:05:02FromDiscord<treeform> yeah just used a hammer to attach all the chips and wires into wood
00:05:05FromDiscord<treeform> it worked
00:05:28PMunchHaha, that sounds like a fun project :P
00:05:30FromDiscord<treeform> I can't find picture
00:06:54PMunchHmm, I should really go to bed..
00:07:02FromDiscord<treeform> It looked very caveman computer
00:07:08FromDiscord<treeform> Good night
00:07:17FromDiscord<treeform> I look forward to your talk
00:07:40PMunchHow am I tired all day and then bright awake when I should be going to bed..
00:07:51PMunchI look forward to hearings yours as well!
00:08:03PMunchGood night, whenever that'll be for you
00:08:04*PMunch quit (Quit: leaving)
00:15:06FromDiscord<ElegantBeef> @treeform so should we just support clang on linux until someone figures out how to fix gcc?
00:17:08FromDiscord<ElegantBeef> Since clang works identical to windows without any need of that `torel`
00:19:53FromDiscord<treeform> Not sure
00:20:05FromDiscord<treeform> clang is not default on linux
00:20:08FromDiscord<treeform> you have to request it
00:20:15FromDiscord<treeform> it is default on mac
00:20:45FromDiscord<ElegantBeef> I suppose we could default gcc then have as `--clang` flag or something
00:30:39FromDiscord<treeform> There is no way to tell if it was compiled by GCC or LLVM?
00:32:09FromDiscord<ElegantBeef> Not that i see in the dump atleast
00:32:27FromDiscord<ElegantBeef> Suppose if we get addresses that are smaller than the stack start we know
00:35:09FromDiscord<demotomohiro> emit C code like #ifdef GNUC ...?
00:35:39FromDiscord<demotomohiro> `#ifdef GNUC`
00:46:18FromGitter<BracketMaster> you can read bytes from a file as prescribed by readBytes here: https://nim-lang.org/docs/io.html#readBuffer%2CFile%2Cpointer%2CNatural
00:46:31FromGitter<BracketMaster> I'd like to read an entire file
00:46:40FromGitter<BracketMaster> and not have to specify length
00:46:50FromGitter<BracketMaster> that is, I want to read a binary into nim
00:46:58FromGitter<BracketMaster> and entire binary as a seq of bytes
00:50:17*kevc joined #nim
00:50:46*kevc quit (Remote host closed the connection)
01:13:18FromDiscord<Rika> https://nim-lang.org/docs/io.html#readAll%2CFile
01:19:40*arkurious quit (Quit: Leaving)
01:36:07FromDiscord<treeform> @ElegantBeef I am going to merge my big hottie parser rewrite. Can you make sure linux is correct on your side. I am getting some strange readings for test5: https://github.com/treeform/hottie/pull/3/checks?check_run_id=2811817203#step:6:50
01:39:17FromDiscord<treeform> Hmm some thing odd on linux, I think the loop gets optimized out? Is this the issue you had before? https://github.com/treeform/hottie/runs/2811823435#step:6:48
01:41:08FromDiscord<treeform> linux test is flaky because of that
01:42:32FromDiscord<treeform> Windows: totalTime: 1.061ms, Linux: totalTime: 1.362ms
01:42:35FromDiscord<treeform> its not that hmm...
01:42:59FromDiscord<treeform> I think 1ms might be too fast for the test
01:47:04FromDiscord<treeform> I am not hitting the iterator the most on windows, just like linux did.
01:50:11FromDiscord<treeform> flaky tests = worse thing
02:05:24*michaelgugino joined #nim
02:05:34*michaelgugino quit (Remote host closed the connection)
02:21:56FromDiscord<ElegantBeef> @treeform yea close enough https://media.discordapp.net/attachments/371759389889003532/853459134221647912/unknown.png
02:22:07FromDiscord<ElegantBeef> The issue is certainly that it's not long enough
02:23:07FromDiscord<ElegantBeef> Also why i think the stack trace isnt great for linux
02:23:41FromDiscord<treeform> I think I got it to work some times p.running throws error instead
02:23:44FromDiscord<treeform> maybe nim lib bug?
02:24:06FromDiscord<treeform> I will treat exception from p.running as false, that seems to have solved it
02:24:44FromDiscord<ElegantBeef> Yea and now that the linux parser is using uint64 we'll never have an issue with `rip` when getting some odd value
02:30:14FromDiscord<ElegantBeef> Well the running issue was that you were running that while loop inside so occasionally it ended
02:32:38*Joe joined #nim
02:32:47*Joe is now known as Guest68005
02:33:12*Guest68005 quit (Remote host closed the connection)
02:34:28ForumUpdaterBotNew thread by Greenfork: Gcc does not find paths generated by os module on Windows, see https://forum.nim-lang.org/t/8111
02:58:05*osezer20 joined #nim
02:58:18*osezer20 quit (Remote host closed the connection)
03:38:20*professoruss9 joined #nim
03:38:23*professoruss9 quit (Remote host closed the connection)
03:43:51*spiderstew_ joined #nim
03:45:21*spiderstew quit (Ping timeout: 260 seconds)
03:57:48*rockcavera quit (Remote host closed the connection)
04:52:54*johnnynitwits quit (Quit: Bridge terminating on SIGTERM)
04:52:54*threenp quit (Quit: Bridge terminating on SIGTERM)
04:53:22*johnnynitwits joined #nim
04:53:55*threenp joined #nim
04:54:56*skered joined #nim
04:55:26*skered quit (Remote host closed the connection)
05:34:59*mzar joined #nim
05:35:12*mzar quit (Remote host closed the connection)
05:53:09*rtpg joined #nim
05:53:25*rtpg quit (Remote host closed the connection)
06:10:13*dan_x joined #nim
06:10:24*dan_x quit (Remote host closed the connection)
06:26:47FromDiscord<Malma> Hey everyone, is anyone have tutorial for using nimsuggest with curl
06:31:13leorize[m]why would you want to use nimsuggest with curl?
06:31:51FromDiscord<Malma> I want to create some text editor with nim
06:32:11FromDiscord<Malma> (edit) removed "some text"
06:32:57leorize[m]then curl won't cut it
06:33:01leorize[m]you need netcat
06:33:35leorize[m]curl is for communicating via a protocol like http. nimsuggest uses pure tcp on the other hand
06:34:05leorize[m]there's also the stdin/stdout interface to nimsuggest that might be easier to use
06:36:46FromDiscord<Malma> In reply to @leorize "there's also the stdin/stdout": yes, i know that. I think i'll learn netcat then, thanks
06:52:53FromDiscord<Bung> why dont you take look at nimlsp ? you dont need third process
07:16:10*SebastianM joined #nim
07:26:19SebastianMHey Guys, I tried to fetch contents of a page of youtube playlist with httpclient.getcontent but it fails with SIGILL: Illegal operation.
07:26:19SebastianMIllegal instruction (core dumped)
07:28:02SebastianMIt works fine with other https websites. Maybe youtube should be handled differently?
07:29:01Prestigehm could you share the code?
07:35:01SebastianMHere it is: https://play.nim-lang.org/#ix=3pNl
07:36:10SebastianMand echo site_contents at the bottom
07:38:47PrestigeI mean var site_contents = client.getcontent("https://youtube.com")
07:38:59Prestigethis works, idk what you're doing in particular
07:41:32SebastianMLook at the commented section in the link to playground, theres a link to the playlist that I give to binary as argument
07:43:41Prestigeit worked for me
07:44:08Prestigenim r -d:ssl foo.nim Cyberpunk "https://www.youtube.com/playlist?list=PL7XnGuhCcsG4DIWl3dqtYgYrBnxkHo5OM" works fine
07:44:15PrestigeWhat version of Nim are you using?
07:46:00SebastianMNim Compiler Version 1.5.1 [Linux: amd64]
07:46:01SebastianMCompiled at 2021-03-31
07:46:25Prestigehm maybe try the latest stable?
07:51:11SebastianMPrestige: hm, i'll try to use stable version, thank you for your assistance
07:51:14*ohama12 joined #nim
07:51:29*ohama12 quit (Remote host closed the connection)
07:51:45*SebastianM quit (Quit: SebastianM)
08:25:54*threenp quit (Quit: Bridge terminating on SIGTERM)
08:25:54*johnnynitwits quit (Quit: Bridge terminating on SIGTERM)
08:26:15*johnnynitwits joined #nim
08:26:18*threenp joined #nim
09:00:12*DannyHpy[m] quit (Quit: Idle for 30+ days)
09:03:42*gschanuel1 joined #nim
09:04:18*gschanuel1 quit (Remote host closed the connection)
09:33:55*teasea4 joined #nim
09:35:30*conkker7 joined #nim
09:36:24*blackbea- joined #nim
09:36:35*pauwel_kwak joined #nim
09:36:57*wanr[m]1 joined #nim
09:36:57*fbpyr[m]1 joined #nim
09:36:57*nxnl[m]1 joined #nim
09:36:57*dithpri[m]1 joined #nim
09:37:09*kali___ joined #nim
09:37:29*ExtraDosages[m]1 joined #nim
09:37:49*Benjamin[m]121 joined #nim
09:38:25*stisa1 joined #nim
09:38:34*customer[m]1 joined #nim
09:39:13*fowl_ joined #nim
09:40:04*cadmium[m]1 joined #nim
09:40:28*Zoom[m]1 joined #nim
09:41:31*Edoardo[m]11 joined #nim
09:41:43*Cthalupa- joined #nim
09:42:13*fowl quit (*.net *.split)
09:42:13*euantorano quit (*.net *.split)
09:42:13*blackbeard420 quit (*.net *.split)
09:42:13*wanr[m] quit (*.net *.split)
09:42:13*vegai quit (*.net *.split)
09:42:13*nxnl[m] quit (*.net *.split)
09:42:13*fbpyr[m] quit (*.net *.split)
09:42:13*Edoardo[m]1 quit (*.net *.split)
09:42:13*ExtraDosages[m] quit (*.net *.split)
09:42:13*dithpri[m] quit (*.net *.split)
09:42:13*ee7[m] quit (*.net *.split)
09:42:13*cadmium[m] quit (*.net *.split)
09:42:13*Benjamin[m]12 quit (*.net *.split)
09:42:13*Zoom[m] quit (*.net *.split)
09:42:13*stisa quit (*.net *.split)
09:42:13*customer[m] quit (*.net *.split)
09:42:14*Jjp137 quit (*.net *.split)
09:42:14*kali_ quit (*.net *.split)
09:42:14*pauwel_k1ak quit (*.net *.split)
09:42:14*conkker quit (*.net *.split)
09:42:14*Cthalupa quit (*.net *.split)
09:42:14*teasea quit (*.net *.split)
09:42:14*conkker7 is now known as conkker
09:42:14*teasea4 is now known as teasea
09:42:15*fowl_ is now known as fowl
09:44:15*euantorano joined #nim
09:48:43*Jjp137 joined #nim
09:48:54*bashtanov3 joined #nim
09:49:24*bashtanov3 quit (Remote host closed the connection)
09:50:26*ee7[m] joined #nim
09:50:41*vegai joined #nim
09:57:05*CaptainN joined #nim
09:57:21*CaptainN quit (Remote host closed the connection)
10:17:08*SebastianM joined #nim
10:19:45SebastianMPrestige: Just a quick information about the issue. It turns out that Nim was fine and it was my c compiler fault, on gcc it works fine, and earlier I used Zig. Thank you once again:)
10:22:02*SebastianM quit (Quit: SebastianM)
10:27:52FromDiscord<zetashift> minor bikeshedding but I wonder if the top to bottom way of reading code of Nim is a good thing or not
11:09:09*ZoomZoomZoom joined #nim
11:09:52FromDiscord<ajusa> In reply to @zetashift "minor bikeshedding but I": What do you mean? There's also code reordering for people who want to organize code their way
11:19:15*PMunch joined #nim
11:28:31*arkurious joined #nim
11:37:55*saintpai23 joined #nim
11:38:06*saintpai23 quit (Remote host closed the connection)
11:40:58*ZoomZoomZoom quit (Ping timeout: 258 seconds)
11:42:23*icedev joined #nim
11:42:40*icedev quit (Remote host closed the connection)
11:53:22FromDiscord<gerwy> can anyone pls explain to me what are `block` for?
11:53:51FromDiscord<gerwy> from docs i understand its like `while false:` but why the hell would i want code that won't be reached?
11:54:43FromDiscord<Bung> block create variable scope
11:55:21FromDiscord<Bung> while false I guess just keep some code in the code base
11:56:19FromDiscord<Bung> so you dont need switch comment uncomment affected git code change
11:57:35*ZoomZoomZoom joined #nim
12:00:51PMunch@gerwy, blocks can be used as Bung mentioned to create a new scope
12:01:37FromDiscord<konsumlamm> In reply to @Life Sucks "from docs i understand": it's not, it's more like `if true:`, it just creates a new scope
12:02:33PMunchThis is useful if you want to declare a variable that won't live for the entirety of the current scope (for example if you're testing and want to re-use the same variable name). It can also be used with a name `block someName:` and then you can `break someName` to jump out of the block
12:21:14FromDiscord<gerwy> Okay so what is scope then
12:23:01PMunchA lot of things introduce a new scope, an if statement, a while, a procedure, etc. Pretty much anything that indents your code
12:23:19PMunchAnd if you do `var x = 100` inside a scope you can't access that x outside the scope
12:23:57PMunchSo if you do `if something: var x = 100` you couldn't use the `x` variable outside the scope introduced by that `if` statement
12:25:22FromDiscord<Bung> what programing language you comming from ?
12:25:45FromDiscord<Bung> I think many language has variable scope
12:34:55FromDiscord<gerwy> In reply to @PMunch "This is useful if": oh like this, so if i want to have variable, but i don't want it to live forever or to be global i do a new scope?
12:36:20FromDiscord<gerwy> In reply to @Bung "what programing language you": C++, C#, Python, JS↵and yeah they do, i just don't know that its called like this unfortunately i learn most of those languages in school and we learn them not in english which sux ass
12:38:46PMunchYup you can create a new scope with a block statement for that. Another cool trick with blocks is implicit return: https://peterme.net/tips-and-tricks-with-implicit-return-in-nim.html
12:39:21PMunchNot unique to blocks, but handy if you have some slightly complicated initialisation for a variable that you for some reason don't want to push to a procedure
12:46:31*tex0l5995 joined #nim
12:47:04*tex0l5995 quit (Remote host closed the connection)
12:47:32FromDiscord<gerwy> In reply to @PMunch "Yup you can create": ah yes i know this, i tried to do it in my game few times but it didn't worked, i guess indentation was wrong
12:48:36PMunchYou can see how I do it, basically the easiest way to do it is `let x =` on one line, and then whatever you want on indented below that
12:48:46PMunchYou wrote a game in Nim?
12:49:12FromDiscord<hamidb80> sent a code paste, see https://play.nim-lang.org/#ix=3pOH
12:49:23FromDiscord<hamidb80> hey pmunch
12:50:04FromDiscord<Rika> not that i know of
12:50:17PMunchHi @hamidb80
12:50:25PMunchWell you could do a tuple
12:50:46FromDiscord<hamidb80> ok tnks
12:51:10PMunchLike this: https://play.nim-lang.org/#ix=3pOI
12:52:34FromDiscord<gerwy> In reply to @PMunch "You wrote a game": yep
12:52:38FromDiscord<gerwy> for a game jam
12:53:59PMunchOh cool, link?
12:54:28PMunchCurious if anyone did something in Nim for GMTK this year
12:54:30FromDiscord<gerwy> sent a code paste, see https://play.nim-lang.org/#ix=3pOJ
12:55:15FromDiscord<gerwy> In reply to @PMunch "Oh cool, link?": not released it yet, im still working on it and i get stressed because i barely have half of it and i didn't do much progress ehh....
12:55:20FromDiscord<hamidb80> In reply to @PMunch "Like this: https://play.nim-lang.org/#ix=3pOI": tnk u
12:55:20FromDiscord<gerwy> its for 4MB game jam
12:58:38PMunch@gerwy oh cool, reminds me of my Arduboy gamejam: https://community.arduboy.com/t/mannbarschwein-game-jam-5/9229
13:01:32FromDiscord<gerwy> thats all i have right now...↵there was minion running to the right, but as i was doing this queue for minions everything got bad and now it doesn't render any minion... https://media.discordapp.net/attachments/371759389889003532/853620098504851456/Nagranie_z_ekranu_2021-06-13_o_15.00.43.mov
13:01:45FromDiscord<gerwy> and clouds are procedurally generated, because size matters lol
13:08:04*ZoomZoomZoom quit (Remote host closed the connection)
13:08:29*ZoomZoomZoom joined #nim
13:12:32FromDiscord<zetashift> In reply to @ajusa "What do you mean?": Isn't that feature experimental though?
13:19:54FromDiscord<gerwy> i really don't get nim haha
13:20:57FromDiscord<gerwy> i was looking at cool stuff made with nim right and i was reading some stuff in "offensive nim"↵and the person told here to use `-d:ranger` to decrease size of binary (and few others that i know)
13:21:14FromDiscord<gerwy> and i tried that with my game, just to see if that will make it even smaller than it already is
13:21:44FromDiscord<gerwy> and my problem with texture data in array suddenly was fixed and the minion appears 😂😂😂😂
13:22:32FromDiscord<gerwy> why? I don't even know https://media.discordapp.net/attachments/371759389889003532/853625381395234836/Zrzut_ekranu_2021-06-13_o_15.22.25.png
13:23:16PMunchUhm, that's not supposed to happen :P
13:23:26PMunch-d:danger vs. normal shouldn't really change much
13:24:09FromDiscord<gerwy> yeah but somehow it worked lol, i will need to look into that
13:24:12*asdflkj quit (Ping timeout: 245 seconds)
13:24:50FromDiscord<gerwy> i compiled it normally and it doesn't work okay, so it must be it
13:25:18PMunchI have run into a similar issue once, with a cryptography library
13:25:30PMunchIt compiles fine with debug mode, but not with release mode
13:25:52*D_ quit (Ping timeout: 245 seconds)
13:25:57FromDiscord<gerwy> okay never mind, it wasn't the danger flag↵it was changing gc to arc
13:26:13FromDiscord<gerwy> how can i change default gc in nim?
13:26:55leorize[m]--gc
13:27:53PMunchDefault? Put the GC option in the system wide config
13:29:19FromDiscord<gerwy> idk where is this config hah↵i could add something in the command that VSC is using when i click to build↵but i also don't know how to change it
13:30:29*D_ joined #nim
13:30:35PMunchI mean you can also put it in a project local config
13:33:00FromDiscord<gerwy> okay i will figure it out
13:33:02*zaszi joined #nim
13:33:09*zaszi quit (Remote host closed the connection)
13:34:45ForumUpdaterBotNew question by schneiderfelipe: Trouble defining a Nim concept with an auto type inside, see https://stackoverflow.com/questions/67958826/trouble-defining-a-nim-concept-with-an-auto-type-inside
13:35:52FromDiscord<schneiderfelipe> In reply to @schneiderfelipe "Hi guys! I'm having": I posted this question in https://stackoverflow.com/q/67958826/4039050. If someone could answer, that would be awesome! 🎈
13:46:19*ZoomZoomZoom quit (Ping timeout: 258 seconds)
13:47:57*D_ quit (Ping timeout: 245 seconds)
13:49:25*D_ joined #nim
13:51:48*growpotkin joined #nim
13:52:22*growpotkin quit (Remote host closed the connection)
13:59:22*asdflkj joined #nim
14:04:05*ZoomZoomZoom joined #nim
14:24:39FromDiscord<zetashift> In reply to @schneiderfelipe "I posted this question": Also don't forget to post on the forums! More Nim eyes there
14:25:29FromGitter<BracketMaster> anyone here familiar with argparse?
14:25:37FromDiscord<schneiderfelipe> In reply to @zetashift "Also don't forget to": @zetashift No clue how to confirm my e-mail there (I changed it a couple times, no success). Without an e-mail confirmation, I'm unable to post 😦
14:25:44FromGitter<BracketMaster> the examples only show how to use it on fabricate arrays: ``var opts = p.parse(@["--apple", "-o=foo", "hi"])``
14:25:59FromGitter<BracketMaster> how to you use p.parse on input from the CLI?
14:26:02FromDiscord<schneiderfelipe> (edit) "success)." => "success/e-mail confirmation never came)."
14:26:16FromGitter<BracketMaster> https://github.com/iffy/nim-argparse#parse
14:26:27FromGitter<BracketMaster> **fabricated
14:28:55*blackbea- quit (Quit: ZNC 1.8.2 - https://znc.in)
14:29:13*cptMikky7 joined #nim
14:29:14*blackbeard420 joined #nim
14:29:16*cptMikky7 quit (Remote host closed the connection)
14:34:48FromGitter<BracketMaster> looks like you must pass it ``os.commandLineParams()``
14:51:21FromDiscord<Zachary Carter> bout to start up my stream
14:52:48*ZoomZoomZoom quit (Ping timeout: 240 seconds)
14:53:06*threenp left #nim ("User left")
14:53:23FromDiscord<Zachary Carter> https://www.twitch.tv/hahahaitsfunny
14:54:57FromDiscord<Rika> no its not funny
14:55:15FromDiscord<IDF(ardek66)> its quite funny
15:00:01FromDiscord<Kermithos> Im currently trying to rewrite some python scripts in nim, is there anyway to loop trough a json?↵https://play.nim-lang.org/#ix=3pPi
15:13:09FromDiscord<Hi02Hi> sent a code paste, see https://play.nim-lang.org/#ix=3pPF
15:20:25FromDiscord<Kermithos> In reply to @Hi02Hi "since the json is": thanks, worked
15:22:31FromDiscord<konsumlamm> you don't even need the `.pairs()`
15:32:02*samfalkner9 joined #nim
15:32:13*samfalkner9 quit (Remote host closed the connection)
15:38:15*PMunch quit (Quit: leaving)
15:46:17FromDiscord<aleclarson> can a sequence be untyped, or contain values of different types?
15:47:42FromDiscord<Rika> formally no
15:47:46FromDiscord<Rika> there are workaroun
15:47:47FromDiscord<Rika> ds
15:49:08FromDiscord<codic> use a object variant
15:49:15FromDiscord<codic> there are libraries that kinda automate that
15:49:30FromDiscord<codic> is there any way to get a less expensive exceptions impl since the std uses it? (I want to use Result in my own code anyways)
15:50:39FromDiscord<Rika> use arc?
15:51:05FromDiscord<dom96> compile to C++
15:52:45FromDiscord<codic> hmm i wonder how good C++ exceptions are
15:52:48FromDiscord<codic> already using arc
15:54:36*ViacheslavK-t4 joined #nim
15:55:02*ViacheslavK-t4 quit (Remote host closed the connection)
15:56:31FromDiscord<codic> is it possible to extend an enum?
15:57:07FromDiscord<dom96> Don't think so
15:59:54FromDiscord<codic> sent a code paste, see https://play.nim-lang.org/#ix=3pQ2
16:00:20FromDiscord<dom96> nope, you might be able to create a new enum with the values of another
16:00:23FromDiscord<dom96> and automate that via macros
16:02:33FromDiscord<Kermithos> does nim have bitwise operations like python does? (https://wiki.python.org/moin/BitwiseOperators)
16:03:55FromDiscord<dom96> yes
16:04:03FromDiscord<dom96> `shr`, `shl`, `and`, `xor` etc
16:04:21FromDiscord<gerwy> Hi, so umm i was thinking recently↵Is it possible to write Mobile app with nim, a lot of frameworks for mobile uses JS so it could somehow go with nim right? I was also thinking about using cordova with nim but i don't know how well it goes and also cordova seems pretty old
16:05:07FromDiscord<codic> In reply to @dom96 "nope, you might be": hmm i might just use strings for errors but i'm not suer of the cost of that
16:05:16FromDiscord<gerwy> i know that nimx supports Mobile GUI, but idk how to compile it to app
16:05:19FromDiscord<dom96> @Life Sucks yep, and in fact you don't have to be restricted to using Nim's JS backend. You can compile to C++ on Android and Obj C on iOS (it works, I've created a game that uses this approach)
16:05:50FromDiscord<dom96> In reply to @codic "hmm i might just": why are you so worried about cost? Don't prematurely optimise
16:07:58FromDiscord<gerwy> In reply to @dom96 "<@!347345994217816066> yep, and in": yeah i was also considering using C++ and compiling it to wasm with emscripten↵Idk if its easy way to use pure C++ for mobile dev
16:08:39FromDiscord<codic> yeah I know, I'm just wondering
16:09:18FromDiscord<gerwy> also i noticed `droid` for nimx that says it will compile to Android so i guess that could work too, the gui doesn't looks as bad but i don't know how it is with customizing UI thingies because i would like something more modern
16:09:19FromDiscord<dom96> @Life Sucks depends on what you want to do
16:09:32FromDiscord<gerwy> just some app, not a game or anything
16:10:20FromDiscord<dom96> I see, I would recommend one of the more mature frameworks in that case, or even just using Swift/Kotlin directly.
16:10:21FromDiscord<gerwy> app like you can find in AppStore or GooglePlay, not super simple like few buttons and hello world, but also not something super complicated, connecting to million API's, doing some OS stuff in the background etc.
16:11:16FromDiscord<gerwy> well i would like to use nim to that, thats why im asking, its probably is possible and usable i just don't see anyone talking about↵nim is my Plan B btw so its not like im relying only on it
16:12:02FromDiscord<dom96> it's definitely possible, it's just going to be more painful 🙂
16:13:39FromDiscord<gerwy> im already used to pain
16:17:05FromDiscord<gerwy> but i will be to do it, i will could ask for help to setup all the JS stuff here right?
16:17:40PrestigeYeah, ask anything you want here
16:20:35FromDiscord<gerwy> :3
16:20:52*coderpatros[m]1 joined #nim
16:21:19*coderpatros[m]1 quit (Remote host closed the connection)
16:21:19FromDiscord<gerwy> but its not my current project, im still learning nim i only started like month ago ( i knew it before i just didn't had time to start) right now i need to finish this crappy game
16:25:50*D_ quit (Remote host closed the connection)
16:26:06*D_ joined #nim
16:30:59*ZoomZoomZoom joined #nim
16:33:23FromDiscord<Kermithos> how can I convert an int to a binary?
16:34:17FromDiscord<gerwy> like zeros and ones?
16:34:30FromDiscord<gerwy> its already in binary
16:35:08FromDiscord<Kermithos> In reply to @Life Sucks "like zeros and ones?": yes
16:36:26FromDiscord<gerwy> why do you need bits of int? You want to display it?
16:37:00FromDiscord<zetashift> There is a `toBin` proc
16:37:29FromDiscord<gerwy> yes
16:37:32FromDiscord<gerwy> https://nim-lang.org/docs/strutils.html#toBin%2CBiggestInt%2CPositive
16:37:34FromDiscord<gerwy> i think this
16:37:48FromDiscord<gerwy> but why do you need this? Just curious
16:38:00*ZoomZoomZoom quit (Ping timeout: 240 seconds)
16:38:25FromDiscord<Kermithos> just wanna play around, Im pretty new to nim
16:39:36FromDiscord<gerwy> ah okay, well have in mind that output of it is string
16:39:49FromDiscord<gerwy> (edit) "have" => "keep"
16:39:56FromDiscord<gerwy> (edit) "it" => "this"
16:40:27FromDiscord<gerwy> In reply to @Kermithos "does nim have bitwise": so you won't be able to do any bitwise operations on it
16:40:47*ZoomZoomZoom joined #nim
16:41:21FromDiscord<Kermithos> aight, thanks
16:41:46*aedan joined #nim
16:41:54*aedan is now known as Guest48376
16:42:23*Guest48376 quit (Remote host closed the connection)
16:53:54planetis[m]exceptions are better than result in nim
16:53:56planetis[m]imo
16:57:47*ldlework quit (Changing host)
16:57:47*ldlework joined #nim
16:58:08FromDiscord<aleclarson> are there any good guides on nim + ios/android interop?
17:00:02planetis[m]They are faster than result type (since there is no NRVO), plus you can tag every proc that raises, with the .raises pragma and make exceptions part of your libs public interface
17:00:48planetis[m](which is done by default in the docs if you click on the `{. .. .}` thing
17:09:07FromDiscord<zetashift> In reply to @planetis "exceptions are better than": Don't they have different usecases tho?
17:09:17FromDiscord<zetashift> Exceptions should only be used in exceptional situations right
17:10:08planetis[m]and what about result?
17:10:44planetis[m]when you do the result[error] thingy
17:14:12FromDiscord<dom96> ugh wth, why was nim using 0.2.2 and not #head
17:14:35FromDiscord<dom96> sent a code paste, see https://play.nim-lang.org/#ix=3pQn
17:19:20FromDiscord<zetashift> In reply to @planetis "when you do the": Same thing I guess, but isn't Result nicer to use than catching everything?
17:20:07FromDiscord<zetashift> I haven't done a lot with exceptions/results tho
17:21:12planetis[m]if you manually annotate your procs with ``.raises:[ ValueError]`` as example you dont have to
17:22:01planetis[m]I liked this talk https://www.youtube.com/watch?v=fOV7I-nmVXw
17:22:30planetis[m]btw pikus is my favourite speaker
17:23:06planetis[m]its about exceptions in C++, he tries to convice ppl there is nothing wrong with them
17:24:04planetis[m]but when that hip NASA talk about software in rovers came out, ppl just think they shouldn't use them
17:25:19*blackpawn joined #nim
17:38:49*kfenn joined #nim
17:38:52*kfenn quit (Remote host closed the connection)
17:44:36FromDiscord<dom96> Exception tracking is awesome. Wish there was more effort behind polishing this feature
17:46:51*euantorano quit (K-Lined)
17:46:51*fowl quit (K-Lined)
17:46:51*saem quit (K-Lined)
17:57:07FromDiscord<haxscramper> For haxdoc I'm tracking all direct and indirect raises in the documentation, https://github.com/haxscramper/haxdoc/commit/9e09f7a2dc2c56fdce66102a172f1d9104270145 (commit message goes into more details), but in general current system is fine - like I can't think of a feature that could be added/improved except for callback raises,. It that seems like something unfixable
17:58:07FromDiscord<codic> what is nice with result you opt in to not properly handling errors
17:58:47FromDiscord<haxscramper> With result you have to manually compose error handling which takes some time
17:59:21FromDiscord<codic> In reply to @haxscramper "With result you have": true
17:59:23FromDiscord<codic> sent a code paste, see https://play.nim-lang.org/#ix=3pQy
17:59:35FromDiscord<haxscramper> It is a good way to handle errors on the low-level, but as you get higher and higher in abstractions exceptions are just easier to work with
18:00:23FromDiscord<haxscramper> I use option all the time for different procs, but when things get complex enough so failure requires explanation it is a time for exceptions I think
18:13:28planetis[m]i was curious so have inspected the asm of Isolated[T] and provided that you use .nodestroy in the proper places there is no overhead (its optimized away), but for options i think its not the same
18:19:16*NimBot joined #nim
18:27:15*zsoltiv joined #nim
18:41:00*Saemsays[m] joined #nim
18:47:43*Saemsays[m] left #nim (#nim)
19:10:09FromDiscord<zetashift> In reply to @haxscramper "It is a good": can you explain a lil bit why exceptions are easier to work with on a higher abstraction level?
19:13:20FromDiscord<haxscramper> When you have many possible things going wrong (which happens if you get closer to the hypothetical 'main' that kick-starts all processing) handling each case becomes more and more tedious - you ether get to the go's level of "check return if every function immediately" or straight up ignore information.
19:14:49FromDiscord<haxscramper> Stacktraces are not supported with result, which is a major downside - I don't necessarily care about all possible errors for every proc I used now, but with result I either have to handle things on the spot, or ignore the erorr
19:16:49FromDiscord<haxscramper> So exceptions are opt-in for handling, but with result you are forced to write code in a particular manner or loose information.
19:18:55FromDiscord<haxscramper> But it also works other way around I think - writing try/catch all over the place for low-level procedure when it can return option does not make much sense to me either.
19:19:26FromDiscord<haxscramper> And option/either/result comes with nice helper abstractions like maps
19:19:52FromDiscord<haxscramper> (edit) "And option/either/result comes with nice helper abstractions like ... maps" added "FP"
19:24:17*Saemsays[m] joined #nim
19:26:09*Ad03 joined #nim
19:26:16*Ad03 quit (Killed (Sigyn (Spam is off topic on freenode.)))
19:31:26FromDiscord<zetashift> ah yea that makes sense
19:31:45FromDiscord<zetashift> I really like how Scala does `Option` + for-comprehensions
19:33:26*zsoltiv quit (Quit: zsoltiv)
19:36:00FromDiscord<codic> why do C APIs using a `void ` eg in the posix module use a `pointer` type? https://nim-lang.org/docs/system.html#pointer
19:36:19FromDiscord<codic> why not a ptr void or similar
19:36:32FromDiscord<codic> oh, `pointer` is the representation of that
19:37:59*Hazelesque14 joined #nim
19:38:07*Hazelesque14 quit (Read error: Connection reset by peer)
19:39:39FromDiscord<Bung> ptr hold the ptr type
19:39:54FromDiscord<Bung> pointer just pointer that's the semantic
19:40:29FromDiscord<haxscramper> Also forgot to mention nim largely solved issue of "I don't know what procedure I used will raise, but I need to handle all errors" by introducing `.raises: [].` that will take care of that
19:41:26FromDiscord<haxscramper> So at some point you can stop and actually handle every error with compiler assisting you, but you don't have to do it all the time, on every level.
19:43:55FromDiscord<haxscramper> For example in my hmisc package I define a number of helper exception types for dealing with shell and file handling, and in most cases failed external command or missing file means that no further processing is really necessary, so it would stop the program anyway. So why not let exceptions handle this for me instead of writing dozens of 'if tmpRes1.isErr() : return'
19:43:56FromDiscord<Bung> it's force pass compiler ?
19:44:16FromDiscord<haxscramper> .raises [].?
19:44:21FromDiscord<Bung> yeah
19:45:04FromDiscord<haxscramper> Yes, it is similar to the noSideEffect - compiler will error out if there is a chance of getting unlisted exception
19:45:45FromDiscord<haxscramper> So if you don't list any it means procedure won't raise anything, otherwise list of exceptions is inferred from the body
19:46:31FromDiscord<Bung> that means compiler still do the check
19:46:32FromDiscord<haxscramper> And is a part of a procedure signature. So you can use this for callbacks as well (by default they are assumed to raise anything, so you get "callback raises" hell)
19:46:49FromDiscord<haxscramper> In reply to @Bung "that means compiler still": At compile-time yes
19:48:29*ldlework quit (Quit: co'o ro do)
19:48:34FromDiscord<haxscramper> But it is done anyway
19:49:07FromDiscord<Bung> if i do it in top level proc , so I dont need do it everywhere?
19:50:31FromDiscord<haxscramper> Well, actually that's the place where you supposed to use this, to explicitly provide handling of all the errors. But that is just hypothetically, I merely looted out possibility of using this feature to achieve most important feature elf the results - exhaustive failure handling
19:50:47FromDiscord<haxscramper> (edit) "looted" => "pointed"
19:51:09FromDiscord<haxscramper> (edit) "elf" => "of" | "ofthe results ... -" added "-based error handling"
19:52:18FromDiscord<System64 ~ Flandre Scarlet> Do you know why it doesn't work please? https://media.discordapp.net/attachments/371759389889003532/853723473742528612/unknown.png
19:52:53FromDiscord<haxscramper> Because args[0] is a char I think, but it would be better to see the error
19:53:18FromDiscord<System64 ~ Flandre Scarlet> https://media.discordapp.net/attachments/371759389889003532/853723721940336660/unknown.png
19:54:01FromDiscord<haxscramper> You assign procedure to a variable, use commandLineParams()
19:54:22FromDiscord<System64 ~ Flandre Scarlet> ah works now
19:54:23FromDiscord<haxscramper> If you need to get first character as a string you can use $srgs[0] I'm not sure if .string is supposed to work
19:58:03FromDiscord<Bung> Thanks! solve my problem
20:07:37*xet7 quit (Ping timeout: 240 seconds)
20:08:17FromDiscord<Bung> I guess I dont need define a callback type as that, I already wraps callback call in try catch
20:09:22FromDiscord<Bung> I may need import segfaults , since nil acess will break server
20:09:55FromDiscord<codic> how can I create a zeroed out instance of an object
20:10:20FromDiscord<ElegantBeef> `var a: YourObject` `YourObject()`
20:10:25FromDiscord<ElegantBeef> Multiple ways
20:10:26FromDiscord<codic> like in C `struct thing instance; emset(&instance, 0, sizeof instance)`
20:10:32FromDiscord<codic> i see
20:10:40FromDiscord<ElegantBeef> Nim 0-inits by default, so as long as you take memory it'll do it
20:10:45FromDiscord<codic> i thought it would have been left uninitialized
20:10:52FromDiscord<codic> how would you make it not init it then?
20:11:03*xet7 joined #nim
20:11:03FromDiscord<ElegantBeef> `var a {.noinit.}: YourObject`
20:11:20FromDiscord<ElegantBeef> 0-init errors are relatively common so this saves hairs 😄
20:12:02FromDiscord<codic> i see
20:12:38FromDiscord<codic> sent a code paste, see https://play.nim-lang.org/#ix=3pRq
20:12:42FromDiscord<codic> i just type 1 instead
20:12:44FromDiscord<codic> but it's curious
20:12:49FromDiscord<codic> because it makes it not usable without a cast
20:13:49FromDiscord<codic> how to convert a string to an array[108, char]?
20:13:59FromDiscord<codic> like strncpy
20:15:58FromDiscord<Bung> found error handle still a mess if the proc implementation are os specific
20:16:44FromDiscord<Bung> one platform raise, another does not
20:17:10FromDiscord<codic> ` address.sun_path = cast[array[108, char]](socket_path)↵`?
20:17:13FromDiscord<codic> (edit) "char]](socket_path)↵`?" => "char]](socket_path)↵`?is this ok?"
20:17:20FromDiscord<codic> socket_path = `const socket_path = "./socket"`
20:17:26FromDiscord<codic> (edit) "char]](socket_path)↵`?is" => "char]](socket_path)` is"
20:17:29FromDiscord<ElegantBeef> `socket_path[0]` might be fine
20:17:33FromDiscord<ElegantBeef> (edit) "`socket_path[0]`" => "`socket_path[0].addr`"
20:17:39FromDiscord<ElegantBeef> Depends on what you're doing and where you're sending it
20:17:53FromDiscord<codic> "expression has no address"
20:18:03FromDiscord<ElegantBeef> It's a const, they're unaddressable
20:18:10FromDiscord<codic> var instead ?
20:18:14FromDiscord<ElegantBeef> `let` 😛
20:18:32FromDiscord<codic> let var const
20:18:56FromDiscord<codic> so, addr doesnt work
20:19:11FromDiscord<codic> but unsafeAddr gives me `got ptr char but expected array[0..107,char]`
20:19:45FromDiscord<ElegantBeef> Probably better to just make the array and copy mem
20:20:52FromDiscord<ElegantBeef> https://play.nim-lang.org/#ix=3pRs
20:20:56FromDiscord<ElegantBeef> As so
20:21:39FromDiscord<codic> ah yes, this is what I wished to do
20:21:43FromDiscord<codic> translating strncpy
20:22:27FromDiscord<ElegantBeef> Yea i'm not someone that's written much C/C++ so that wasnt clear what `strncpy` meant 😛
20:22:53FromDiscord<codic> basically the same thing
20:23:11FromDiscord<codic> `char strncpy(char dest, char const src, size_t n)` iirc
20:23:43FromDiscord<ElegantBeef> Time to use magic to make this a very usable alternative
20:27:26FromDiscord<codic> interesting
20:27:49FromDiscord<ElegantBeef> https://play.nim-lang.org/#ix=3pRt
20:28:19FromDiscord<ElegantBeef> Aw shit that doesnt work for reference objects, shit!
20:31:17FromDiscord<codic> whoa is this new
20:31:22FromDiscord<codic> sent a code paste, see https://play.nim-lang.org/#ix=3pRw
20:31:30FromDiscord<ElegantBeef> Yea too many "Nim is slow" comments
20:31:34FromDiscord<codic> lol
20:31:52FromDiscord<codic> In reply to @ElegantBeef "Aw shit that doesnt": why are you trying to rewrite strncpy
20:32:07FromDiscord<codic> concepts are cool
20:32:09FromDiscord<ElegantBeef> I'm not
20:32:13FromDiscord<codic> i do not get them
20:32:17FromDiscord<ElegantBeef> I'm just abusing concepts to make a somewhat reusable version
20:32:23FromDiscord<ElegantBeef> Concepts are user defined duck typing
20:32:37FromDiscord<codic> i know what they are, I don't get the syntax
20:32:48FromDiscord<ElegantBeef> Well the new concepts are easier
20:33:44FromDiscord<codic> i don't even know what that x is supposed to represent
20:33:46FromDiscord<codic> sent a code paste, see https://play.nim-lang.org/#ix=3pRy
20:33:48FromDiscord<ElegantBeef> concept
20:34:07FromDiscord<codic> sent a code paste, see https://play.nim-lang.org/#ix=3pRz
20:34:09FromDiscord<ElegantBeef> they're instances of the concept afaik
20:34:12FromDiscord<System64 ~ Flandre Scarlet> In reply to @codic "`char* strncpy(char* dest, char": 3 pointers, OOF
20:34:55*omnigoat left #nim (#nim)
20:34:58FromDiscord<codic> whats wrong with that
20:35:12FromDiscord<codic> sent a code paste, see https://play.nim-lang.org/#ix=3pRA
20:35:20FromDiscord<codic> it quits at the `bindSocket failed`
20:35:21FromDiscord<codic> (edit) "https://play.nim-lang.org/#ix=3pRA" => "https://play.nim-lang.org/#ix=3pRB"
20:35:22FromDiscord<codic> lemme check errn
20:35:23FromDiscord<codic> (edit) "errn" => "errno"
20:35:29FromDiscord<codic> ok that makes far more sense
20:35:32FromDiscord<ElegantBeef> sent a code paste, see https://play.nim-lang.org/#ix=3pRD
20:35:46FromDiscord<ElegantBeef> so does using typedesc 😛
20:36:16FromDiscord<codic> i had it open from an old thing
20:36:18FromDiscord<codic> sent a code paste, see https://play.nim-lang.org/#ix=3pRE
20:36:19FromDiscord<ElegantBeef> due to the fact `type(100)` is int seeing `type int` is jussut ugh
20:36:27FromDiscord<codic> it works, yay
20:37:18FromDiscord<ElegantBeef> Probably should do `min(socketPath.len, address.sunpath.len)` just for safety
20:37:31FromDiscord<codic> https://play.nim-lang.org/#ix=3pRF C/Posix unix socket server in nim if anyone needs it
20:37:34FromDiscord<codic> oh where?
20:37:40FromDiscord<ElegantBeef> in the copy mem
20:37:58FromDiscord<ElegantBeef> You need a check for if string is longer than path rather
20:38:14FromDiscord<ElegantBeef> Cause if the sunpath is 10 and the string is 20 you want to error
20:38:26FromDiscord<ElegantBeef> so do `assert address.sunPath >= socket_path
20:38:27FromDiscord<ElegantBeef> (edit) "socket_path" => "socket_path`"
20:38:39FromDiscord<codic> the posix module is very inconsistent with the C one, I need to submit some PRs
20:38:40FromDiscord<codic> yes true
20:39:04FromDiscord<codic> sunpath is always 108 on linux, I think other posixes too, and I have it hardcoded, but it never hurts...
20:39:29FromDiscord<ElegantBeef> Sure but socketpath could be 109 😛
20:39:35FromDiscord<codic> In reply to @ElegantBeef "so do `assert address.sunPath": you meant the `.len` right?
20:39:40FromDiscord<ElegantBeef> yes
20:40:11FromDiscord<codic> https://play.nim-lang.org/#ix=3pRH fixed
20:40:33FromDiscord<codic> it's not very nice how i have to do these casts and it's completely inconsistent
20:40:44FromDiscord<codic> in C there is no such type as SocketHandle
20:40:50FromDiscord<codic> i dont see the need for that abstraction in the first place
20:41:15FromDiscord<ElegantBeef> So you dont accidently pass a wrong int to do socket logic
20:41:25FromDiscord<ElegantBeef> The entire point of the type system is to protect you fuck fuckups 😄
20:42:07FromDiscord<ElegantBeef> (edit) "fuck" => "from"
20:42:11FromDiscord<codic> yeah but then you end up casting everything anyways
20:42:25FromDiscord<codic> not a problem with having the abstraction, it's that half the functions use it and half don't
20:43:04FromDiscord<ElegantBeef> you dont cast socket once
20:44:03FromDiscord<ElegantBeef> Also isnt that cast from `SockAddrUn` to `SockAddr` dangerous due to the one using a path and the other using an address?
20:44:39FromDiscord<ElegantBeef> Also you dont need to cast that `address.sizeof` you can do `address.sizeof.cuint`
20:45:18FromDiscord<codic> sockaddr is basically a sort of interface for all the sockaddr types in C, it's the only way to do it in C, don't ask me how it works because i have no idea but that's what you do in C
20:45:21FromDiscord<ElegantBeef> same with line 28 just do `cl.cint`
20:45:23FromDiscord<codic> In reply to @ElegantBeef "Also you dont need": thanks that makes it cleaner
20:45:30FromDiscord<codic> 25 too?
20:45:34FromDiscord<ElegantBeef> yea
20:46:01FromDiscord<codic> ok now it looks just fine
20:46:06FromDiscord<codic> way cleaner than the C lol
20:46:31FromDiscord<ElegantBeef> Congrats, this is the benefit of distinct, you can ensure it's only usable in specific places and can always convert to the distinct base if needed
20:46:36FromDiscord<codic> sent a code paste, see https://play.nim-lang.org/#ix=3pRJ
20:47:05FromDiscord<ElegantBeef> And since distinct is just a type system thing, the conversion is free
20:47:23FromDiscord<codic> why can't I use AF_UNIX for sun_family? I found that a bit odd too because that's the only place you would use it and I have to do like AF_UNIX.cushort
20:47:39FromDiscord<ElegantBeef> it's an i32
20:48:11FromDiscord<ElegantBeef> i32 doesnt implictly convert to cushort
20:48:20FromDiscord<ElegantBeef> a u16 should though
20:48:36FromDiscord<codic> idk
20:48:38FromDiscord<ElegantBeef> !eval var a: cushort = 3123u16
20:48:40NimBot<no output>
20:48:46FromDiscord<codic> I'm just wondering why it is defined like that
20:48:47FromDiscord<ElegantBeef> Yep works fine
20:49:07FromDiscord<ElegantBeef> What's AFUnix in C?
20:49:17FromDiscord<ElegantBeef> And what is TSaFamily in C?
20:51:35FromDiscord<ElegantBeef> I bet the first is 32bit and the second is 16bit unsigned(i actually know this is) 😄
20:52:13FromDiscord<ElegantBeef> So that's why Nim has them the same type as their C counterparts, and as such you cannot implictly cast a 32bit to 16bit due to possible loss of information
20:52:16FromDiscord<codic> sent a code paste, see https://play.nim-lang.org/#ix=3pRL
20:54:01FromDiscord<codic> iirc there is no tsa family
20:54:13FromDiscord<codic> i can't find one
20:54:24FromDiscord<ElegantBeef> https://media.discordapp.net/attachments/371759389889003532/853739101777428490/unknown.png
20:54:36FromDiscord<codic> ohh it's sa_family_t
20:54:40FromDiscord<codic> I always get confused by the `T`
20:54:52FromDiscord<codic> yeah it's type is ushort
20:54:57FromDiscord<ElegantBeef> Seems it was an accidental inclusion of `type sa_family_t`
20:55:20FromDiscord<ElegantBeef> Cause ya that T shouldnt exist
20:55:37FromDiscord<ElegantBeef> A lot of the posix wrapped stuff has a prefix char though
20:55:38FromDiscord<codic> type shuld be called Sa_Family?
20:55:46FromDiscord<codic> yeah probably auto generated
20:56:02FromDiscord<ElegantBeef> Yea probably just be called that
20:56:24FromDiscord<ElegantBeef> Anywho hopefully that explained why i'm going to go now, go email someone with your next issues 😛
20:57:41FromDiscord<codic> lol
20:57:43FromDiscord<codic> cya
21:00:17*yashi joined #nim
21:00:31*yashi quit (Remote host closed the connection)
21:03:14*theelous3 joined #nim
21:40:56*theelous3_ joined #nim
21:43:00*kaliy joined #nim
21:46:14*kali___ quit (Ping timeout: 258 seconds)
21:46:15*johnnynitwits quit (Ping timeout: 258 seconds)
21:46:16*theelous3 quit (Ping timeout: 258 seconds)
21:48:02*johnnynitwits joined #nim
21:52:20FromDiscord<greenb1ade> I have a question since I done quite understand how nim actually works. Does nim compile only to other languages or does it have its own compiler that can compile directly to byte code like c/c++?
21:52:53FromDiscord<codic> the official compiler compiles to C, C++, Javascript, and Objective C, which can be compiled into other languages
21:53:04FromDiscord<codic> nlvm uses llvm instead
21:53:24FromDiscord<ElegantBeef> Nim uses established languages as backends which benefits it tremendously
21:54:16FromDiscord<konsumlamm> to be clear, you don't have to compile the generated C code yourself, the nim compiler does that
21:54:48FromDiscord<ElegantBeef> ^ If you used choosenim to install it, you could actually live in ignorance that it's C under the hood 😄
21:56:29FromDiscord<greenb1ade> Alright thanks I just wanted to know, since I use c++ quite often and want to integrate vim and c++ into a project
21:56:38FromDiscord<ElegantBeef> You mean Nim? 😄
21:56:54FromDiscord<greenb1ade> Yeah nim sorry autocorrect
21:57:09FromDiscord<ElegantBeef> You know when nim is auto corrected to vim, you live in hell
21:57:18FromDiscord<greenb1ade> xD
22:00:07FromDiscord<codic> integrate Vimscript into your C++ project
22:00:11FromDiscord<codic> add some nim too
22:00:36FromDiscord<ElegantBeef> Well paravim exists, no clue if it supports vimscript 😄
22:01:10*D_ left #nim ("💨")
22:10:22FromDiscord<codic> paravim is cool
22:10:32FromDiscord<codic> font rendering sucks tho
22:11:40FromDiscord<Bung> sent a code paste, see https://play.nim-lang.org/#ix=3pSk
22:11:44FromDiscord<Bung> Error: 'formatCommon' can have side effects ?
22:12:13FromDiscord<Bung> why a string format had side effects
22:12:42FromDiscord<codic> it's probably not the format itself but either getEnv or one of the functions you call in it
22:13:09FromDiscord<codic> yes getEnv has an effect for one thing
22:13:10FromDiscord<codic> https://nim-lang.org/docs/os.html#ReadEnvEffect
22:14:30FromDiscord<ElegantBeef> @treeform ok so turns out we can do `objdump -sj .comment ./path/to/bin` and that will give us the `.comment` section which tends to store the compiler, but still not overly beautiful 😄
22:15:23FromDiscord<Bung> hmm then how to solve it? dont use func ?
22:16:57FromDiscord<Bung> another thing how i trace `':anonymous' is not GC-safe`
22:17:02FromDiscord<ElegantBeef> sent a code paste, see https://play.nim-lang.org/#ix=3pSo
22:18:02FromDiscord<Bung> but I think your example is about gc safe
22:18:23FromDiscord<ElegantBeef> Well if something isnt gcsafe you can always annotate the function manually
22:19:31FromDiscord<Bung> yeah, it show the source
22:20:46*krux02 joined #nim
22:20:49*bozaloshtsh quit (Quit: ZNC 1.7.5 - https://znc.in)
22:20:58*bozaloshtsh joined #nim
22:20:58*bozaloshtsh quit (Changing host)
22:20:58*bozaloshtsh joined #nim
22:22:04FromDiscord<Bung> I use rx-nim it calls next , the closure proc passing seems the problem
22:25:47FromDiscord<dom96> 2 years and a new httpbeast version is here with the cross-talk issue fixed 🙂
22:27:59FromDiscord<Bung> great!
22:32:26*bozaloshtsh quit (Quit: ZNC 1.7.5 - https://znc.in)
22:32:39*bozaloshtsh joined #nim
22:32:39*bozaloshtsh quit (Changing host)
22:32:39*bozaloshtsh joined #nim
22:36:02FromDiscord<treeform> In reply to @ElegantBeef "<@!107140179025735680> ok so turns": That's a cool find!
22:37:03FromDiscord<codic> at least it works...
22:37:05FromDiscord<codic> sent a code paste, see https://play.nim-lang.org/#ix=3pSr
22:37:18*ZoomZoomZoom quit (Remote host closed the connection)
22:37:36FromDiscord<codic> i hate this distinction between unsafeAddr and addr and I fully support the proposal of removing the former
22:39:44FromDiscord<ElegantBeef> cant you just do `len.SockLen.unsafeaddr`?
22:39:47*ZoomZoomZoom joined #nim
22:39:51FromDiscord<ElegantBeef> iirc that's an lvalue
22:40:59FromDiscord<ElegantBeef> guess i'm wrong
22:42:13FromDiscord<ElegantBeef> Ah not exactly wrong↵> The type conversion T(a) is an L-value if a is an L-value and typeEqualsOrDistinct(T, typeof(a)) holds.
22:42:26FromDiscord<codic> that yields expression has no address
22:42:32FromDiscord<codic> robably because of the temporary
22:42:45FromDiscord<ElegantBeef> Yea like i said it's not an Lvalue but some type conversions are
22:42:50FromDiscord<codic> (edit) "robably" => "probably"
22:42:52FromDiscord<codic> i see
22:43:09FromDiscord<ElegantBeef> In the cast it's a 0-cost conversion it's an lvalue
22:43:14FromDiscord<ElegantBeef> (edit) "cast" => "case"
22:43:21FromDiscord<codic> yeah I don't have a problem with casting
22:43:29FromDiscord<codic> I should expect to a lot, I'm writing super C-y nim
22:43:40FromDiscord<codic> enough to use --gc:none comfortably lol
22:44:56FromDiscord<ElegantBeef> why dont you just convert `len` into `ucred.sizeof.cuint`?
22:45:12FromDiscord<ElegantBeef> Then it's just `len.unsafeaddr`
22:50:54FromDiscord<ElegantBeef> @treeform ok so now i've really solved it `--passL"-no-pie"` disables it so it behaves properly 😄
22:58:55FromDiscord<codic> i used .SockLen instead of .cuint jsut to be more clear
22:58:57*ZoomZoomZoom quit (Ping timeout: 240 seconds)
22:59:05FromDiscord<codic> but that works yeah thanks
23:03:39FromDiscord<ElegantBeef> @treeform Well hopefully that PR makes you happy, also replaced `Table[T, int]` with the more purpose build `CountTable` due to that's what you were using it for 😄
23:42:59FromDiscord<codic> sent a code paste, see https://play.nim-lang.org/#ix=3pSx
23:43:06FromDiscord<codic> i think it's the reason the vscode extension is not working\
23:45:49FromDiscord<treeform> In reply to @ElegantBeef "<@!107140179025735680> ok so now": that is quite hidden, probably needs better docs to explain it.
23:46:08FromDiscord<treeform> In reply to @ElegantBeef "<@!107140179025735680> Well hopefully that": Yeah count table looks great, I should have used it at the start.
23:46:23FromDiscord<ElegantBeef> Yea i realized last night when i was about to fall asleep "Wait that
23:46:27FromDiscord<ElegantBeef> (edit) "that" => "that's just a count table""
23:49:06FromDiscord<treeform> Have you used hottie to find some hot paths in other code and fix them?
23:54:23FromDiscord<ElegantBeef> Not yet, spent most of my time recently pulling hair out trying a cleaner method of that linux support