00:00:04 | FromDiscord | <retkid> https://media.discordapp.net/attachments/371759389889003532/977360090891964426/unknown.png |
00:00:08 | FromDiscord | <retkid> this doesn't scare you |
00:00:11 | FromDiscord | <Rika> it doesnt |
00:00:16 | FromDiscord | <Rika> you dont even need to use it directly |
00:00:28 | FromDiscord | <Rika> there are helpers where you dont touch a single node generating function |
00:00:29 | FromDiscord | <Elegantbeef> I'm the wrong person to ask |
00:00:47 | FromDiscord | <retkid> beef all you do is macro all day |
00:00:55 | FromDiscord | <retkid> you basically write lisp in nim |
00:01:10 | FromDiscord | <Elegantbeef> I havent wrote a macro in quite some time |
00:01:15 | FromDiscord | <Generic> ast is really not that much of a big deal |
00:01:43 | * | Guest95 quit (Quit: Client closed) |
00:02:16 | * | ltriant joined #nim |
00:02:47 | FromDiscord | <Generic> in the beginning the best thing is probably to just write some example code you want to be generated and print out the ast for it |
00:02:50 | FromDiscord | <retkid> I know this doesn't belong in nim but does sending data on an unlimited data line cost the company money |
00:03:03 | FromDiscord | <Rika> what? |
00:03:11 | FromDiscord | <retkid> like on a wireless mobile network |
00:03:16 | FromDiscord | <Rika> doing anything costs money for the company ofc? |
00:03:58 | FromDiscord | <retkid> so since my line is getting cancelled in a few days im gonna write some JS to stream random data to /dev/null on my computer |
00:04:12 | FromDiscord | <retkid> and download it from mine as well |
00:04:14 | FromDiscord | <Andreas> In reply to @Generic "in the beginning the": a little howto would be nice. And regarding templates - is there some chance to see the 'rendered'-template |
00:04:26 | FromDiscord | <Elegantbeef> Ah yes you're going to cost the company pennies |
00:04:37 | FromDiscord | <Elegantbeef> https://dev.to/beef331/demystification-of-macros-in-nim-13n8 here you go andreas |
00:05:26 | FromDiscord | <Rika> In reply to @Andreas "a little howto would": i think you can use --expandMacro:"templatename" on it but im not sure of that |
00:05:32 | FromDiscord | <Elegantbeef> You can |
00:05:44 | FromDiscord | <Elegantbeef> There is also the `std/macros` `expandMacro` macro |
00:06:00 | FromDiscord | <Generic> yeah I was about to bring that up |
00:06:14 | FromDiscord | <Generic> I only discovered it recently |
00:06:24 | FromDiscord | <Generic> otherwise I always used `echo result.repr` |
00:07:11 | FromDiscord | <Andreas> In reply to @Elegantbeef "https://dev.to/beef331/demystification-of-macros-in": nice, but i'm asking for a tool. Like one can 'dump' Nim-code to C and then inspect it. As a programmer i'm interested in the AST - nothing more and i wonder why none of the text-editors offers a way to let me inspect the resulting AST ? I once did a twin-view for Atom, just to see Code and AST side-by -side |
00:07:14 | FromDiscord | <retkid> guys if GO can be in GCC why cant nim be |
00:07:23 | FromDiscord | <retkid> we should contribute to GCC in nim |
00:07:28 | FromDiscord | <Elegantbeef> You dont want to dump the C code |
00:07:51 | * | ltriant quit (Ping timeout: 276 seconds) |
00:07:57 | FromDiscord | <Elegantbeef> I mean you can make tooling relatively easily https://streamable.com/c6farb |
00:08:10 | FromDiscord | <Andreas> In reply to @Elegantbeef "You dont want to": well, right, but at least i could, if i'm crazy enough.. |
00:08:23 | FromDiscord | <retkid> In reply to @Andreas "nice, but i'm asking": this stuff exists and is frequently used by C and C++ "people" |
00:08:27 | FromDiscord | <Elegantbeef> I mean you can do \`--nimcache\:someFolder |
00:08:52 | FromDiscord | <Rika> the c code is not the "ast" either |
00:08:58 | FromDiscord | <Rika> kinda sounded like you equated them |
00:09:01 | FromDiscord | <Generic> I just go into userfolder/.nimcache/whateverprojectimworkingon |
00:09:09 | FromDiscord | <retkid> In reply to @Elegantbeef "I mean you can": is the AST not the asm? |
00:09:12 | FromDiscord | <Rika> no |
00:09:14 | FromDiscord | <Elegantbeef> No |
00:09:20 | FromDiscord | <Elegantbeef> AST is astract syntax tree |
00:09:23 | FromDiscord | <Elegantbeef> abstract\ |
00:09:28 | FromDiscord | <Rika> astract |
00:09:28 | FromDiscord | <retkid> ah not the literal asm |
00:09:30 | FromDiscord | <Elegantbeef> It's what the compiler works on and reasons with |
00:09:32 | FromDiscord | <huantian> AST represents the structure of the Nim code so you can programmatically manipulate it |
00:09:49 | FromDiscord | <Elegantbeef> It's not even close to ASM |
00:10:01 | FromDiscord | <retkid> how much should i care about it |
00:10:08 | FromDiscord | <Elegantbeef> If you write macros a lot |
00:10:21 | FromDiscord | <Elegantbeef> Macros afterall take in AST and emit new AST |
00:10:33 | FromDiscord | <retkid> so thats how macros work |
00:11:52 | FromDiscord | <Andreas> In reply to @Elegantbeef "Macros afterall take in": that tool looks amazing - pretty new November.2021 - what editor is this ? |
00:12:14 | FromDiscord | <retkid> looks like... |
00:12:19 | FromDiscord | <retkid> code |
00:12:20 | FromDiscord | <retkid> .. |
00:12:41 | FromDiscord | <Elegantbeef> It's a small toy project for nimscripter |
00:13:01 | FromDiscord | <Elegantbeef> It's not actually usable or anything just a small example for nimscripter |
00:13:14 | FromDiscord | <Elegantbeef> https://github.com/beef331/nimscripter/tree/master/examples/macrorepl hosted here if interested |
00:14:00 | FromDiscord | <Andreas> In reply to @Elegantbeef "https://github.com/beef331/nimscripter/tree/master/": could one, integrate this into, say VS-Code or Atom ? |
00:14:07 | FromDiscord | <retkid> people use atom |
00:14:31 | * | jmdaemon joined #nim |
00:14:35 | FromDiscord | <retkid> probably something easier to do in inteliji |
00:14:49 | FromDiscord | <Zectbumo> I saw two add-ons for atom. Which is the good one? Nim2? |
00:15:03 | FromDiscord | <retkid> you use atom |
00:15:09 | FromDiscord | <retkid> is there any reason? |
00:15:24 | FromDiscord | <Elegantbeef> No clue |
00:15:28 | FromDiscord | <Zectbumo> No, but I thought I would because of the Nim plugin |
00:16:14 | FromDiscord | <retkid> YO ADOBE HAS AN IDE |
00:17:45 | FromDiscord | <retkid> check out brackets ide |
00:17:58 | FromDiscord | <Rika> isnt that deprecated |
00:18:03 | FromDiscord | <Rika> or unsupported |
00:18:10 | FromDiscord | <Rika> i believe they stopped dev of brackts |
00:18:11 | FromDiscord | <Rika> (edit) "brackts" => "brackets" |
00:20:38 | FromDiscord | <Andreas> @ElegantBeef just from the PR-side of things - such a tool, would enable people to make use of templates/macros. And i'd say such has not been done before - seriously - that would be a unique feature for Nim.. |
00:21:58 | FromDiscord | <retkid> In reply to @Rika "i believe they stopped": they transferred it to the community to die |
00:22:16 | FromDiscord | <retkid> https://media.discordapp.net/attachments/371759389889003532/977365675016343593/unknown.png |
00:22:20 | FromDiscord | <retkid> its still going |
00:22:21 | FromDiscord | <Andreas> (edit) "Nim.." => "Nim..↵A playground on the website would prolly enough.." |
00:22:23 | FromDiscord | <Elegantbeef> "make use of templates/macros" you mean like they're presently used? |
00:23:21 | FromDiscord | <Andreas> In reply to @Elegantbeef ""make use of templates/macros"": like one can have a trial&error - experience as in the video.. interactive-computing 🙂 |
00:23:41 | FromDiscord | <Andreas> (edit) "🙂" => "🙂↵exploring things..." |
00:23:53 | FromDiscord | <Elegantbeef> Well the NimVM can run in browser so have at 'er |
00:24:10 | FromDiscord | <retkid> In reply to @Elegantbeef "Well the NimVM can": that moment when you compile to JS |
00:24:28 | FromDiscord | <Elegantbeef> Nah the compiler doesnt run in browser |
00:24:47 | FromDiscord | <retkid> that moment when you say you can compile to JS but half the stdlib doesn't work |
00:25:06 | FromDiscord | <Elegantbeef> Stuff that should work generlally does |
00:25:20 | FromDiscord | <retkid> none of the cool things work tho |
00:25:29 | FromDiscord | <Elegantbeef> Like what? |
00:25:38 | FromDiscord | <Andreas> In reply to @Elegantbeef "Well the NimVM can": i'm interested in the visual-experience. Having a template on the left and a rendered piece-of-code on the right.. |
00:28:28 | FromDiscord | <retkid> In reply to @Elegantbeef "Like what?": servers are the one that hurt the most |
00:29:03 | FromDiscord | <Elegantbeef> What? |
00:29:21 | FromDiscord | <Elegantbeef> I have 0 clue why you'd want to use Nim -\> JS for a backend |
00:29:38 | FromDiscord | <retkid> why not |
00:29:47 | FromDiscord | <huantian> Because JS is horrible |
00:29:48 | FromDiscord | <Elegantbeef> Cause it makes 0 fucking sense |
00:30:00 | FromDiscord | <retkid> In reply to @Elegantbeef "Cause it makes 0": why does that surprise you coming from me |
00:30:06 | FromDiscord | <Elegantbeef> Let's use a js runtime instead of running native |
00:30:08 | FromDiscord | <retkid> In reply to @huantian "Because JS is horrible": node is a good lang |
00:30:12 | FromDiscord | <Rika> then write node |
00:30:14 | FromDiscord | <Rika> what |
00:30:19 | FromDiscord | <retkid> nim is a better lang |
00:30:23 | FromDiscord | <Rika> then use nim natively |
00:30:25 | FromDiscord | <Rika> what |
00:30:40 | FromDiscord | <retkid> what if for some contrived reason i NEEDED js |
00:30:51 | FromDiscord | <huantian> What is your contrived reason |
00:30:55 | FromDiscord | <Elegantbeef> You use juan carlos' NodeJs library |
00:31:16 | FromDiscord | <retkid> say, i was like a 15 year old in a programming class |
00:31:25 | FromDiscord | <retkid> and my teacher wanted me to write a node js server |
00:31:29 | FromDiscord | <huantian> Then you write JS |
00:31:33 | FromDiscord | <huantian> Because that’s your assignment |
00:31:39 | FromDiscord | <Elegantbeef> Say there was a library that abstracted a lot of NodeJs for Nim |
00:31:47 | FromDiscord | <Elegantbeef> Shit would be cool if there was too bad there is |
00:32:01 | * | vicfred quit (Quit: Leaving) |
00:32:16 | FromDiscord | <retkid> https://media.discordapp.net/attachments/371759389889003532/977368194018856970/unknown.png |
00:32:23 | FromDiscord | <retkid> i didn't know he could code |
00:32:34 | FromDiscord | <Elegantbeef> https://github.com/juancarlospaco/nodejs |
00:33:22 | FromDiscord | <retkid> https://media.discordapp.net/attachments/371759389889003532/977368470427672656/unknown.png |
00:33:24 | FromDiscord | <retkid> this is cursed |
00:33:43 | FromDiscord | <Elegantbeef> Could be worse could be writing JS manually |
00:33:49 | FromDiscord | <retkid> no that image |
00:35:51 | FromDiscord | <retkid> there is no eample code |
00:36:27 | FromDiscord | <huantian> Did you like |
00:36:38 | FromDiscord | <huantian> Click on any of the doc links at the top of the reader |
00:36:42 | FromDiscord | <huantian> (edit) "reader" => "rear" |
00:36:46 | FromDiscord | <huantian> (edit) "rear" => "readme" |
00:36:58 | FromDiscord | <Elegantbeef> retkid doesnt read they just bitch 😄 |
00:37:13 | FromDiscord | <retkid> i looked in the src |
00:37:53 | FromDiscord | <retkid> https://media.discordapp.net/attachments/371759389889003532/977369605444087888/unknown.png |
00:38:41 | FromDiscord | <retkid> In reply to @huantian "Click on any of": thats not example code thats just docs |
00:39:15 | NimEventer | New Nimble package! odbcn - ODBC abstraction for Nim, see https://sr.ht/~mjaa/odbcn-nim/ |
00:41:14 | FromDiscord | <huantian> https://media.discordapp.net/attachments/371759389889003532/977370449065431060/2022-05-20_17-40-35.mp4 |
00:41:48 | FromDiscord | <Elegantbeef> I'll subtitle it for you huan |
00:47:31 | FromDiscord | <mr. glowinthedark> how do you force a proc argument to be a literal? |
00:47:57 | FromDiscord | <huantian> why do you need it to be a literal? |
00:48:04 | FromDiscord | <Elegantbeef> you can do `static T` or `T{lit}` |
00:48:10 | FromDiscord | <Elegantbeef> the first forces it to be known at compile time |
00:48:14 | FromDiscord | <Elegantbeef> The latter forces it to be a literal |
00:48:41 | FromDiscord | <Zectbumo> That's cool, can i see an example of that? |
00:48:55 | FromDiscord | <mr. glowinthedark> hmm, can you force a specific value in proc head? |
00:48:57 | FromDiscord | <Elegantbeef> I just showed an example |
00:49:02 | FromDiscord | <Elegantbeef> `T{lit}` |
00:49:12 | FromDiscord | <mr. glowinthedark> specific value for the literal |
00:49:31 | FromDiscord | <mr. glowinthedark> so I can have multiple procs, each for different literal value |
00:49:55 | FromDiscord | <Zectbumo> @mr. glowinthedark maybe you are looking for enum? |
00:50:14 | FromDiscord | <huantian> https://play.nim-lang.org/#ix=3YfM |
00:50:19 | FromDiscord | <mr. glowinthedark> don't worry, I know what I'm doing |
00:51:13 | FromDiscord | <Elegantbeef> You'd need to use static like huan showed |
00:52:18 | FromDiscord | <huantian> also just in case you want this, use `{.error: "compile time error message".}` if you need |
00:53:41 | FromDiscord | <Rika> Beans |
00:55:04 | FromDiscord | <huantian> https://cdn.discordapp.com/emojis/340218056934686732.webp?quality=lossless |
00:55:16 | FromDiscord | <huantian> dang I forgot things don't embed here I'lls end it anyways↵https://cdn.discordapp.com/emojis/340218056934686732.webp?quality=lossless |
00:55:20 | FromDiscord | <huantian> (edit) "I'lls end" => "I'll send" |
00:56:54 | FromDiscord | <Rika> I knew a dude who was nicknamed beans IRL |
01:01:46 | FromDiscord | <retkid> so |
01:02:13 | FromDiscord | <retkid> either 781454 living people have a wikipedia article |
01:02:27 | FromDiscord | <retkid> or nim is having trouble reading beyond 87092337874 bytes |
01:02:55 | FromDiscord | <retkid> no it seems I didn't write an end of file part in the while true |
01:03:02 | FromDiscord | <retkid> i forgot about that |
01:15:42 | FromDiscord | <Professor Actual Factual> How to statically compile `importc` functions in nim?↵See: https://play.nim-lang.org/#ix=3YfR |
01:16:22 | FromDiscord | <Elegantbeef> You cannot |
01:16:36 | FromDiscord | <Elegantbeef> You'd use `let` instead of \`const |
01:16:43 | FromDiscord | <Professor Actual Factual> In reply to @Elegantbeef "You cannot": 😦 Damn, that sucks |
01:16:57 | FromDiscord | <Professor Actual Factual> I kind of need const to support multithreading with globals |
01:17:12 | FromDiscord | <retkid> isn't that already done |
01:17:34 | FromDiscord | <Elegantbeef> Why do you need const for a function pointer |
01:17:39 | FromDiscord | <Elegantbeef> `let` should suffice |
01:17:45 | FromDiscord | <Professor Actual Factual> This is a toy example, but if it were let |
01:17:54 | FromDiscord | <Professor Actual Factual> I would not be able to use that function in a multithreaded application |
01:18:00 | FromDiscord | <Elegantbeef> Yes you would |
01:18:13 | FromDiscord | <retkid> ~~cant you just use createShared~~ |
01:18:20 | FromDiscord | <Elegantbeef> Why would you need to |
01:18:24 | FromDiscord | <Elegantbeef> It's a procedure |
01:18:27 | FromDiscord | <Elegantbeef> It's not a heap allocation |
01:18:52 | FromDiscord | <Professor Actual Factual> Hmm, i experienced this about a year back, I will try to reproduce again with minimal example. I could be wrong |
01:19:14 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/zwt |
01:19:26 | FromDiscord | <Elegantbeef> You can override the thread analysis |
01:19:42 | FromDiscord | <retkid> wait why is that gcsafe? |
01:19:48 | FromDiscord | <Elegantbeef> You know a global pointer to a proc is GcSafe so you can tell it as such |
01:19:59 | FromDiscord | <Elegantbeef> Cause a pointer proc isnt gc'd? |
01:20:21 | FromDiscord | <Elegantbeef> It's an address to a pointer it's like having `let a = 10` |
01:20:55 | FromDiscord | <Elegantbeef> It's odd Nim thinks it's unsafe to access a pointer proc from a procedure but we can override the compilers reasoning cause we're adults |
01:23:39 | FromDiscord | <retkid> https://media.discordapp.net/attachments/371759389889003532/977381121606164490/unknown.png |
01:23:41 | FromDiscord | <retkid> i forgot about this |
01:24:09 | FromDiscord | <Professor Actual Factual> sent a code paste, see https://play.nim-lang.org/#ix=3YfS |
01:24:21 | FromDiscord | <Elegantbeef> Might need `{.cast(gcSafe).}:` instead |
01:24:48 | FromDiscord | <retkid> nim does have a problem of thinking the gc is upset when shes just having fun |
01:24:49 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3YfT |
01:25:15 | FromDiscord | <Elegantbeef> I mean it's generally right |
01:25:54 | FromDiscord | <Elegantbeef> In this case it's gcsafe, but i think the compiler has an issue that "all procedures are gcunsafe" even though it should just be "all closures" |
01:27:13 | FromDiscord | <Professor Actual Factual> sent a code paste, see https://play.nim-lang.org/#ix=3YfX |
01:27:17 | FromDiscord | <Elegantbeef> really if you didnt want this cast you could do `template printfconst: auto = printf` |
01:27:29 | FromDiscord | <Professor Actual Factual> sent a code paste, see https://play.nim-lang.org/#ix=3YfZ |
01:31:23 | * | noeontheend joined #nim |
01:35:49 | FromDiscord | <retkid> In reply to @huantian "": https://media.discordapp.net/attachments/371759389889003532/977384182336594070/Peek_2022-05-13_14-46.gif |
01:35:59 | FromDiscord | <retkid> In reply to @huantian "": https://media.discordapp.net/attachments/371759389889003532/977384226544578580/Peek_2022-05-20_21-35.webm |
01:39:12 | FromDiscord | <huantian> eh? |
01:47:06 | FromDiscord | <Elegantbeef> That's my word! |
02:15:38 | FromDiscord | <retkid> In reply to @huantian "eh?": you cherry picked, almost none of them have any code eamples |
02:16:01 | FromDiscord | <Elegantbeef> It's a relatively light wrapping over the underlying API |
02:18:23 | FromDiscord | <retkid> also how do i get the maximum size of a stream buffer |
02:18:27 | FromDiscord | <retkid> (edit) removed "buffer" |
02:18:44 | FromDiscord | <retkid> ie, highest possible position |
02:18:59 | FromDiscord | <Elegantbeef> There is no limit |
02:19:35 | FromDiscord | <retkid> where it ends? |
02:19:40 | FromDiscord | <retkid> where there is no more file to read |
02:20:27 | FromDiscord | <Elegantbeef> Streams can be streamed in |
02:21:02 | FromDiscord | <Elegantbeef> You cannot know the end of a stream |
02:21:10 | FromDiscord | <Elegantbeef> You read until the end |
02:22:22 | FromDiscord | <retkid> In reply to @Elegantbeef "You read until the": well... how do i know that |
02:22:38 | FromDiscord | <Elegantbeef> `atEnd` |
02:22:46 | FromDiscord | <retkid> if s.atEnd |
02:24:13 | FromDiscord | <Elegantbeef> Consider a socket stream you'll never know how much data they'll send |
02:39:07 | * | noeontheend quit (Ping timeout: 260 seconds) |
02:49:00 | * | ltriant joined #nim |
02:53:10 | * | ltriant quit (Ping timeout: 240 seconds) |
03:01:37 | * | ltriant joined #nim |
03:24:39 | * | ltriant quit (Ping timeout: 246 seconds) |
04:03:49 | * | ltriant joined #nim |
04:08:54 | * | ltriant quit (Ping timeout: 272 seconds) |
04:40:27 | * | ltriant joined #nim |
04:45:38 | * | ltriant quit (Ping timeout: 272 seconds) |
05:10:12 | * | jmdaemon quit (Ping timeout: 260 seconds) |
05:17:38 | * | ltriant joined #nim |
05:22:36 | * | ltriant quit (Ping timeout: 246 seconds) |
05:46:08 | FromDiscord | <Bung> pls help me with this https://github.com/bung87/nimlsp/runs/6528943266?check_suite_focus=true |
05:49:22 | FromDiscord | <m4ul3r> sent a code paste, see https://play.nim-lang.org/#ix=3Ygs |
05:59:50 | * | Jjp137 quit (Ping timeout: 250 seconds) |
06:00:08 | * | Jjp137 joined #nim |
06:05:49 | FromDiscord | <retkid> Under what conditions is out of memory defect outputted |
06:06:04 | * | dithpri quit (Ping timeout: 240 seconds) |
06:15:11 | FromDiscord | <Zectbumo> @m4ul3r you need to runForever() in order to process messages |
06:17:05 | FromDiscord | <Zectbumo> In reply to @retkid "Under what conditions is": I would tell you, but then you would think it was obvious |
06:18:07 | FromDiscord | <retkid> In reply to @Zectbumo "I would tell you,": I meant a bit more technical then that because my program takes up almost no memory but yet is out of it |
06:21:00 | FromDiscord | <Zectbumo> oh. well it's when the memory allocator returns a nil because it ran out of allocation space. why do you think your program takes no memory? maybe you have a leak |
06:22:00 | FromDiscord | <m4ul3r> In reply to @Zectbumo "<@186968592544301058> you need to": Got it 👍 , I just need to call poll() within my while loop then |
06:30:41 | * | dithpri joined #nim |
06:36:18 | FromDiscord | <retkid> In reply to @Zectbumo "oh. well it's when": I’m trying to skip 70gbs into a stream |
06:36:44 | FromDiscord | <Zectbumo> burning bandwidth huh? sticking it to the man |
06:37:01 | FromDiscord | <retkid> Nono thats tomorrow |
06:38:04 | * | dithpri quit (Ping timeout: 240 seconds) |
06:38:05 | FromDiscord | <Zectbumo> so did you run top and watch your memory go up up up? |
06:39:01 | FromDiscord | <ripluke> i wonder why the nim distros module sucks, its not that hard to implement it better |
06:39:18 | FromDiscord | <Zectbumo> @ripluke do it! |
06:39:41 | FromDiscord | <ripluke> sent a code paste, see https://play.nim-lang.org/#ix=3YgC |
06:39:47 | FromDiscord | <ripluke> easy nim code to get users distro |
06:39:57 | * | dithpri joined #nim |
06:40:10 | FromDiscord | <ripluke> Works for any distro :) |
06:40:19 | FromDiscord | <retkid> In reply to @Zectbumo "so did you run": I saw no such thing |
06:41:06 | FromDiscord | <Zectbumo> In reply to @ripluke "Works for any distro": any linux distro, you mean? |
06:41:15 | FromDiscord | <retkid> In reply to @ripluke "Works for any distro": How do you know if you’re running Linux hmmm |
06:41:22 | FromDiscord | <retkid> Apart from the extremely obvious |
06:41:36 | FromDiscord | <ripluke> In reply to @Zectbumo "any linux distro, you": yes |
06:41:45 | FromDiscord | <ripluke> probably works on mac aswell |
06:41:59 | FromDiscord | <Zectbumo> no, not mac. it is BSD based |
06:42:18 | FromDiscord | <ripluke> os-release doesnt exist on mac? |
06:42:20 | FromDiscord | <retkid> Might still be an os release for posix compat |
06:42:28 | FromDiscord | <Zectbumo> that's not posix |
06:42:29 | FromDiscord | <ripluke> In reply to @retkid "Might still be an": yes |
06:43:10 | FromDiscord | <retkid> In reply to @Zectbumo "that's not posix": They still try to have most posix compatibilities. This one is easy to implement so I don’t see why not |
06:43:31 | FromDiscord | <retkid> I’m very upset woeusb isn’t bootable ugh |
06:44:05 | FromDiscord | <ripluke> ahh it doesnt, i might have to implement some conditionals |
06:44:16 | FromDiscord | <Zectbumo> In reply to @retkid "They still try to": that's not how that works. and no. it's not posx and no mac does not have /etc/os-release |
06:44:34 | * | dithpri quit (Ping timeout: 240 seconds) |
06:44:49 | FromDiscord | <Zectbumo> In reply to @ripluke "ahh it doesnt, i": I would be surprised even if ALL linux distros does that |
06:45:18 | FromDiscord | <ripluke> In reply to @Zectbumo "I would be surprised": all gnu/linux distros do that |
06:45:27 | FromDiscord | <Zectbumo> okay. maybe so |
06:45:36 | FromDiscord | <ripluke> there are probably only 2 or 3 that dont |
06:45:39 | FromDiscord | <Zectbumo> but not BSD, not Mac, not windows |
06:45:46 | FromDiscord | <ripluke> yea |
06:45:51 | FromDiscord | <ripluke> unfortunately |
06:45:57 | FromDiscord | <Zectbumo> so your % success is really low |
06:46:00 | FromDiscord | <retkid> In reply to @Zectbumo "I would be surprised": They have to, to be posix compliant |
06:46:19 | FromDiscord | <retkid> That is the standard way to read Linux |
06:46:24 | FromDiscord | <ripluke> In reply to @Zectbumo "so your % success": yea |
06:46:27 | FromDiscord | <retkid> If you wanna be sure, do a |
06:46:38 | FromDiscord | <Zectbumo> yeah, that's not posix |
06:46:42 | FromDiscord | <retkid> “If: else” |
06:47:17 | FromDiscord | <ripluke> might have to use the distro module and see if its macos or bsd, bc at the end of the day im not trying to rewrite it |
06:48:08 | FromDiscord | <retkid> Alrighty so |
06:48:18 | FromDiscord | <retkid> os-release is a system d thing |
06:48:37 | FromDiscord | <retkid> Anything that uses init d is somewhere else im pretty sure |
06:48:47 | FromDiscord | <retkid> Most things are system d |
06:48:54 | FromDiscord | <ripluke> In reply to @retkid "os-release is a system": artix has one even though it doesnt use sysd |
06:49:14 | FromDiscord | <Zectbumo> see, even not all linux has os-release |
06:49:15 | FromDiscord | <retkid> Void has one |
06:49:21 | FromDiscord | <retkid> Gentoo as well |
06:49:23 | FromDiscord | <ripluke> yea |
06:49:32 | FromDiscord | <Zectbumo> https://unix.stackexchange.com/questions/351557/on-what-linux-distributions-can-i-rely-on-the-presence-of-etc-os-release |
06:49:36 | FromDiscord | <Rika> Not necessarily |
06:49:49 | FromDiscord | <retkid> In reply to @Rika "Not necessarily": Leave gentoo customizability out of this |
06:49:53 | FromDiscord | <Rika> If it’s a system d thing then there’s a few distributions you’re not hitting |
06:50:04 | FromDiscord | <Rika> In reply to @retkid "Leave gentoo customizability out": That’s the point of Gentoo |
06:51:28 | FromDiscord | <demotomohiro> My gentoo doesnt use systemd but has /etc/os-release |
06:51:35 | FromDiscord | <retkid> If your Linux environment has been released in the last 15 years and has no os-release it’s a design decision |
06:51:36 | FromDiscord | <ripluke> Most others also have it |
06:51:41 | FromDiscord | <Zectbumo> @ripluke here, this is what you need. posix compliant:↵`The uname utility is compliant with the IEEE Std 1003.1-2008 ("POSIX.1")↵ specification.` |
06:51:50 | FromDiscord | <ripluke> Yea it's uname |
06:51:58 | FromDiscord | <ripluke> Uname is anything unix |
06:52:03 | FromDiscord | <Zectbumo> no |
06:52:09 | * | tiorock joined #nim |
06:52:10 | * | tiorock quit (Changing host) |
06:52:10 | * | tiorock joined #nim |
06:52:10 | * | rockcavera quit (Killed (calcium.libera.chat (Nickname regained by services))) |
06:52:10 | * | tiorock is now known as rockcavera |
06:52:10 | FromDiscord | <Zectbumo> it's anything posix compliant |
06:52:16 | FromDiscord | <ripluke> Mac and bsd support it |
06:52:17 | FromDiscord | <Zectbumo> there are unix that are not posix compliant |
06:52:24 | FromDiscord | <ripluke> In reply to @Zectbumo "there are unix that": Oh |
06:52:25 | FromDiscord | <retkid> execute uname output to folder then read that folder |
06:52:36 | FromDiscord | <retkid> To file |
06:52:50 | FromDiscord | <ripluke> In reply to @retkid "execute uname output to": How do u run shcmds in nim |
06:53:43 | FromDiscord | <Zectbumo> Linux != GNU != UNIX != POSIX |
06:53:52 | FromDiscord | <retkid> exCMDEx |
06:53:55 | FromDiscord | <retkid> From os |
06:54:02 | FromDiscord | <ripluke> Oh |
06:54:05 | FromDiscord | <retkid> (edit) "exCMDEx" => "exCmdEx" |
06:54:14 | FromDiscord | <retkid> Or something it’s in OS I’m on mobile |
06:54:19 | FromDiscord | <ripluke> In reply to @Zectbumo "Linux != GNU !=": Ya |
06:54:23 | FromDiscord | <demotomohiro> !eval echo static(staticExec("uname -a")) |
06:54:25 | NimBot | Linux 761a1dc8ecf7 5.4.0-110-generic #124-Ubuntu SMP Thu Apr 14 19:46:19 UTC 2022 x86_64 Linux |
06:54:45 | FromDiscord | <ripluke> In reply to @retkid "Or something it’s in": I'll read the docs, now that I know it's in os |
06:54:58 | FromDiscord | <ripluke> !eval echo static(staticExec("uname -r")) |
06:55:00 | NimBot | 5.4.0-110-generic |
06:55:10 | FromDiscord | <ripluke> Kernel version |
06:55:16 | * | dithpri joined #nim |
06:55:27 | FromDiscord | <ripluke> So on Mac it'd be darwin |
06:55:49 | FromDiscord | <Zectbumo> yeah but not with -r |
06:56:05 | FromDiscord | <ripluke> R shows kernel |
06:56:24 | FromDiscord | <ripluke> Which would make it super easy to identify mac |
06:56:33 | FromDiscord | <retkid> This is like 2 steps away from malware |
06:56:40 | FromDiscord | <retkid> Though I suppose anything is |
06:57:09 | FromDiscord | <Zectbumo> In reply to @ripluke "R shows kernel": are you saying capital R? |
06:57:12 | FromDiscord | <ripluke> In reply to @retkid "This is like 2": It's much less sus to just implement some conditials with the distros module |
06:57:19 | FromDiscord | <ripluke> In reply to @Zectbumo "are you saying capital": No the -r flag |
06:57:35 | FromDiscord | <ripluke> But I have autocaps cuz mobile :/ |
06:58:11 | FromDiscord | <Zectbumo> that's the release and on mac it shows something like "xx.x.x" |
06:58:36 | FromDiscord | <ripluke> In reply to @Zectbumo "that's the release and": Doesn't say Darwin? I've never used mac |
06:59:01 | FromDiscord | <Zectbumo> uname -s says "Darwin" |
06:59:08 | FromDiscord | <ripluke> In reply to @Zectbumo "uname -s says "Darwin"": Oh |
06:59:17 | FromDiscord | <ripluke> !eval echo static(staticExec("uname -s")) |
06:59:19 | NimBot | Linux |
06:59:32 | FromDiscord | <ripluke> That might work |
07:02:02 | * | dithpri quit (Remote host closed the connection) |
07:03:51 | FromDiscord | <Zectbumo> @ripluke https://nim-lang.org/docs/posix_utils.html#uname_2 |
07:05:02 | FromDiscord | <Zectbumo> !eval import std/posix_utils;echo uname().sysname |
07:05:06 | NimBot | Linux |
07:09:31 | FromDiscord | <retkid> !eval import std/posix_utils;echo uname() |
07:09:35 | NimBot | Compile failed: (sysname: "Linux", nodename: "f1ab22ce5af5", release: "5.4.0-110-generic", version: "#124-Ubuntu SMP Thu Apr 14 19:46:19 UTC 2022", machine: "x86_64") |
07:09:52 | FromDiscord | <retkid> well |
07:09:56 | FromDiscord | <retkid> i got it anyway lmao |
07:10:01 | FromDiscord | <Zectbumo> it's an object |
07:10:04 | FromDiscord | <retkid> ye |
07:10:24 | FromDiscord | <retkid> !eval import std/posix_utils;echo uname().version |
07:10:27 | NimBot | #124-Ubuntu SMP Thu Apr 14 19:46:19 UTC 2022 |
07:11:19 | FromDiscord | <Zectbumo> !eval import std/posix_utils;echo $uname() |
07:11:22 | NimBot | Compile failed: (sysname: "Linux", nodename: "0d2a00fd4307", release: "5.4.0-110-generic", version: "#124-Ubuntu SMP Thu Apr 14 19:46:19 UTC 2022", machine: "x86_64") |
07:12:31 | FromDiscord | <Zectbumo> that's odd |
07:12:46 | FromDiscord | <retkid> sent a code paste, see https://play.nim-lang.org/#ix=3YgJ |
07:13:14 | FromDiscord | <ripluke> sent a code paste, see https://play.nim-lang.org/#ix=3YgK |
07:13:25 | FromDiscord | <retkid> In reply to @ripluke "what i implemented: ": look at my code |
07:13:33 | FromDiscord | <retkid> use a case statement |
07:14:11 | FromDiscord | <ripluke> In reply to @retkid "use a case statement": yea i will optimize thee code |
07:14:35 | FromDiscord | <retkid> look |
07:14:39 | FromDiscord | <retkid> ima be real |
07:15:02 | FromDiscord | <demotomohiro> !eval import distros; echo foreignDepInstallCmd("nim") |
07:15:07 | NimBot | Compile failed: ("<your package manager here> install nim", true) |
07:15:17 | FromDiscord | <retkid> fuck anyone who uses a BSD which isn't freebsd or openbsd |
07:15:20 | FromDiscord | <retkid> you're too far gone |
07:15:37 | FromDiscord | <retkid> bsd is already far too niche |
07:15:42 | FromDiscord | <retkid> (edit) "bsd" => "freebsd" |
07:15:42 | FromDiscord | <ripluke> sent a code paste, see https://play.nim-lang.org/#ix=3YgL |
07:15:47 | FromDiscord | <retkid> going farther is like |
07:15:49 | FromDiscord | <retkid> "ok" |
07:15:52 | FromDiscord | <demotomohiro> eval doesnt support multiple lines |
07:15:56 | FromDiscord | <ripluke> nice |
07:16:20 | FromDiscord | <retkid> if make an enum |
07:16:32 | FromDiscord | <ripluke> it works for me on linux so it should work |
07:16:34 | FromDiscord | <retkid> i'd |
07:16:37 | FromDiscord | <Zectbumo> !eval↵echo "hello"↵echo "world" |
07:16:53 | FromDiscord | <Zectbumo> nope |
07:16:53 | FromDiscord | <Rika> In reply to @retkid "fuck anyone who uses": NetBSD |
07:17:08 | FromDiscord | <retkid> In reply to @Rika "NetBSD": i forgot about netBSD but thats just far enough |
07:17:16 | FromDiscord | <ripluke> In reply to @retkid "i forgot about netBSD": yea |
07:17:19 | FromDiscord | <retkid> anything farther is "i will not support" |
07:17:24 | FromDiscord | <Rika> “Technically macOS is a BSD” |
07:17:34 | FromDiscord | <retkid> Oh I'll never support mac |
07:17:37 | FromDiscord | <ripluke> In reply to @Rika "“Technically macOS is a": its DARWIN :) |
07:17:45 | FromDiscord | <Rika> I said technically |
07:17:47 | FromDiscord | <retkid> the day i support mac is the day i die |
07:17:52 | FromDiscord | <Rika> Darwin is based on BSD so technically |
07:17:53 | FromDiscord | <ripluke> In reply to @Rika "I said technically": ye ik |
07:18:09 | FromDiscord | <ripluke> In reply to @Rika "Darwin is based on": yea |
07:18:17 | FromDiscord | <Zectbumo> and technically technically it was based on FreeBSD |
07:18:28 | FromDiscord | <Zectbumo> but nobody is allowed to say that |
07:18:34 | FromDiscord | <Zectbumo> because of the license |
07:18:49 | FromDiscord | <retkid> hah |
07:18:54 | FromDiscord | <retkid> you cant fork it and make it closed sorced |
07:18:55 | FromDiscord | <retkid> sad |
07:19:06 | FromDiscord | <Rika> If there are BSD based operating systems are there BSD cringe operating systems |
07:19:11 | FromDiscord | <ripluke> In reply to @Zectbumo "and technically technically it": wait does the bsd license not make u make any code modifications public like the gnu licensce |
07:19:39 | FromDiscord | <retkid> In reply to @ripluke "wait does the bsd": opposite |
07:19:39 | FromDiscord | <Zectbumo> no, welcome to BSD 😄 |
07:20:25 | FromDiscord | <retkid> nvm |
07:20:25 | FromDiscord | <Zectbumo> I wouldn't say opposite. it just doesn't have that requirement |
07:20:32 | FromDiscord | <retkid> ^^^ |
07:20:44 | FromDiscord | <retkid> sleepy im trying to figure out if installing windows will nuke my drives again |
07:20:46 | FromDiscord | <retkid> 😔 |
07:21:14 | FromDiscord | <Zectbumo> yeah, why is harddrive management SOO difficult on windows? |
07:21:23 | FromDiscord | <Zectbumo> it's like computers 101 |
07:21:34 | FromDiscord | <retkid> last time i tried to install windows 8 it nuked both of my other partitions |
07:21:37 | FromDiscord | <retkid> i tried to delete one |
07:21:48 | FromDiscord | <retkid> im going to keep it unallocated and maybe it'll leave it alone? |
07:21:57 | FromDiscord | <Rika> Windows nukes partitions on the same drive but not other drives I believe |
07:22:03 | FromDiscord | <Zectbumo> windows 8? then you deserved it |
07:22:07 | FromDiscord | <retkid> well |
07:22:15 | FromDiscord | <retkid> i only need windows for 1 thing |
07:22:19 | FromDiscord | <retkid> In reply to @Rika "Windows nukes partitions on": im on GPT |
07:22:24 | FromDiscord | <retkid> it shouldn't have touched the other drives |
07:22:35 | FromDiscord | <retkid> (edit) "drives" => "partitions" |
07:22:55 | FromDiscord | <Rika> Windows don’t give no fucks |
07:23:07 | FromDiscord | <Zectbumo> I booted into win8 the other day on and old machine I pulled out of the closet. MS installed a shortcut with Windows 10 installer on it |
07:23:29 | FromDiscord | <Zectbumo> (edit) "it" => "the desktop" |
07:23:31 | FromDiscord | <ripluke> how do i get cpu usage in nim? couldnt find it in the os module |
07:23:37 | FromDiscord | <Rika> Windows likes fucking with you no matter what you do with drives so just keep it in its own drive is what I do |
07:23:54 | FromDiscord | <retkid> In reply to @Rika "Windows likes fucking with": my hhd is on my other house |
07:23:56 | FromDiscord | <retkid> 😭 |
07:24:03 | FromDiscord | <retkid> (edit) "on" => "in" |
07:24:05 | FromDiscord | <Rika> Hard hard disk |
07:24:10 | FromDiscord | <retkid> very hard |
07:24:15 | FromDiscord | <ripluke> yes |
07:24:23 | FromDiscord | <retkid> it runs at like 10 mb/s |
07:24:37 | FromDiscord | <retkid> thats why i caled it my hhd and not my hdd, you guys believe me right, im not brain dead, right |
07:24:42 | FromDiscord | <ripluke> soft soft disk |
07:24:47 | FromDiscord | <ripluke> ssd |
07:25:00 | FromDiscord | <Rika> Solid disk drive |
07:25:02 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=3YgN |
07:25:10 | FromDiscord | <Rika> In reply to @Isofruit "This one is a": some 5 |
07:25:17 | FromDiscord | <Rika> Well I guess that doesn’t work too well either |
07:25:18 | FromDiscord | <retkid> solid disk devide |
07:25:33 | FromDiscord | <Rika> So maybe convert that 5 into the range too |
07:25:39 | FromDiscord | <Phil> In reply to @Rika "Well I guess that": Ah, forget that one for the example, but that won't work either |
07:25:53 | FromDiscord | <demotomohiro> I first installed windows8 on my machine and then installed linux without writing boot loader on ssd. I write boot loader on usb stick and I insert it when I want to run Liunx. |
07:25:55 | FromDiscord | <Phil> Is there a way to do it in a single line though? |
07:26:07 | FromDiscord | <Phil> because `5.0..9` isn't a thing |
07:26:39 | FromDiscord | <Elegantbeef> `some(range[0..9](5))` |
07:27:33 | FromDiscord | <Phil> Ahhh thanks!↵I think that also might allow me to do "none"'s |
07:27:38 | FromDiscord | <Phil> (edit) "Ahhh thanks!↵I think that also might allow me to do "none"'s ... " added "for range optionals" |
07:27:50 | FromDiscord | <Elegantbeef> You can also make a typedesc |
07:28:25 | FromDiscord | <Phil> Hmm fair |
07:32:17 | FromDiscord | <Andreas> I have a simple question: Indexes into seqs, tables and basically any container i use are positive Integers. So why is it a type-error to use a uint8 - which is might be a small one, but still a perfect integer ? But it somehow doesnt fit the bill ? I need to do int( my-small-uint ) to make things work - can one use a converter for such cases ? |
07:32:37 | FromDiscord | <Andreas> (edit) removed "is" |
07:33:14 | FromDiscord | <Rika> You can sure |
07:33:27 | FromDiscord | <Rika> Nim prefers explicit type conversion for unsigned to signed |
07:33:29 | FromDiscord | <demotomohiro> https://github.com/nim-lang/Nim/wiki/Unofficial-FAQ#why-are-unsigned-types-discouraged |
07:33:46 | FromDiscord | <Zectbumo> In reply to @ripluke "how do i get": !eval import std/posix; var r: Rusage; RUSAGE_SELF.getrusage(r.addr); echo r.ru_utime.tv_sec |
07:33:59 | FromDiscord | <Zectbumo> !eval import std/posix; var r: Rusage; RUSAGE_SELF.getrusage(r.addr); echo r.ru_utime.tv_sec |
07:34:01 | NimBot | Compile failed: /usercode/in.nim(1, 70) Error: type mismatch: got <Time> |
07:35:03 | FromDiscord | <Zectbumo> !eval import std/posix; var r: Rusage; RUSAGE_SELF.getrusage(r.addr); echo r.ru_utime |
07:35:06 | NimBot | (tv_sec: ..., tv_usec: 431) |
07:36:32 | FromDiscord | <Zectbumo> I'm not sure why `.tv_sec` doesn't work |
07:37:37 | FromDiscord | <Rika> Its some object with no $ proc |
07:37:41 | * | ltriant joined #nim |
07:38:11 | FromDiscord | <Zectbumo> oh, it's yet another level. sheesh that's a lot |
07:41:26 | FromDiscord | <retkid> Rika what are the chances it nukes my other 2 partitions if its unpartitioned |
07:41:29 | FromDiscord | <retkid> 🥺 |
07:41:35 | FromDiscord | <Rika> In reply to @retkid "Rika what are the": What? |
07:41:39 | FromDiscord | <Rika> Windows? I don’t know |
07:41:44 | FromDiscord | <Zectbumo> it's gotta be low chances |
07:41:47 | FromDiscord | <Rika> Windows is fickle or something |
07:41:54 | FromDiscord | <retkid> https://media.discordapp.net/attachments/371759389889003532/977476311763279962/unknown.png |
07:42:12 | FromDiscord | <retkid> gonna backup my code |
07:42:20 | FromDiscord | <Zectbumo> it's going to nuke your EFI partition |
07:43:01 | FromDiscord | <Zectbumo> wait, that's not normal. your EFI is HUGE |
07:43:02 | * | ltriant quit (Ping timeout: 260 seconds) |
07:43:17 | FromDiscord | <Zectbumo> oh, "EFI System" I see |
07:43:26 | FromDiscord | <Zectbumo> that is some tiny font |
07:43:40 | FromDiscord | <retkid> https://media.discordapp.net/attachments/371759389889003532/977476757902995456/unknown.png |
07:43:42 | FromDiscord | <retkid> its so large |
07:43:44 | FromDiscord | <retkid> thats it gpt |
07:44:28 | FromDiscord | <Zectbumo> I hope that's on ssd |
07:44:42 | FromDiscord | <retkid> https://media.discordapp.net/attachments/371759389889003532/977477014644748388/unknown.png |
07:44:49 | FromDiscord | <retkid> what do you think nvme stands for |
07:45:15 | FromDiscord | <Zectbumo> non volatile memory something |
07:45:16 | FromDiscord | <Rika> Something express |
07:45:21 | FromDiscord | <Zectbumo> express |
07:45:24 | FromDiscord | <Rika> Oh how neat |
07:45:26 | FromDiscord | <demotomohiro> sent a code paste, see https://paste.rs/nHy |
07:45:29 | FromDiscord | <Rika> Our guesses combine |
07:45:52 | FromDiscord | <Zectbumo> teamwork 🙂 |
07:46:00 | FromDiscord | <Elegantbeef> demo that's a big ol' bug |
07:46:14 | FromDiscord | <Elegantbeef> Upcasting value types is an error |
07:46:38 | FromDiscord | <Elegantbeef> A -\> B is invalid but B -\> A should be valid |
07:46:42 | FromDiscord | <Elegantbeef> Assuming A is the parent type |
07:47:28 | FromDiscord | <Andreas> In reply to @demotomohiro "https://github.com/nim-lang/Nim/wiki/Unofficial-FAQ": ty, that reminds of another book "Women, fire, and dangerous things : what categories reveal about the mind" by G. Lakoff - he clearly forgot to mention "unsigned integers" - little oversight. |
07:48:59 | FromDiscord | <demotomohiro> I think both casting A <-> B is invalid for object type and it should be error. |
07:50:17 | FromDiscord | <demotomohiro> It seems copying value type `b: BaseObj = a` also copies runtime type info and `b of InheritObj` returns true. |
07:52:56 | FromDiscord | <Elegantbeef> No converting from B -\> A is completely safe |
07:53:43 | FromDiscord | <Elegantbeef> You lose fields but you can do it safely |
07:54:00 | FromDiscord | <Elegantbeef> also consider `proc doThing(a: var T)` |
07:54:07 | FromDiscord | <Elegantbeef> sorry `var A` |
07:54:19 | FromDiscord | <Elegantbeef> You can safely convert to `A` |
07:54:41 | FromDiscord | <Elegantbeef> `A -> B` should always be an error though like i said |
07:56:06 | FromDiscord | <Elegantbeef> Really stack allocated inheritance types should not even have type information imo |
07:56:11 | FromDiscord | <demotomohiro> Thank you, you are right. B -> A is safe. |
08:03:05 | * | dithpri joined #nim |
08:04:46 | FromDiscord | <retkid> So windows nuked grub |
08:04:49 | FromDiscord | <retkid> Not a good sign |
08:05:09 | FromDiscord | <Elegantbeef> Windows does that |
08:05:23 | FromDiscord | <Elegantbeef> Best way to dual boot is to disconnect your drive with grub on it and install windows then reconnect it |
08:06:05 | FromDiscord | <Rika> It will do that every time you update so |
08:06:56 | * | dithpri quit (Remote host closed the connection) |
08:07:14 | FromDiscord | <retkid> In reply to @Elegantbeef "Windows does that": sola un hard dive di me |
08:07:45 | FromDiscord | <Zectbumo> windows blows away boot partition (grub) and EFI and primary partition |
08:07:55 | FromDiscord | <Phil> In reply to @Rika "It will do that": Not every time, I#ve gone through like a year of updates before it did that to me |
08:08:03 | FromDiscord | <retkid> In reply to @Zectbumo "windows blows away boot": Primary?! |
08:08:04 | FromDiscord | <Phil> The second time I was done with windows and uninstalled |
08:08:10 | FromDiscord | <Phil> (edit) "The second time I was done with windows and uninstalled ... " added "it" |
08:08:28 | FromDiscord | <Zectbumo> In reply to @retkid "Primary?!": yeah where else do you think it's going to go? 😄 |
08:08:38 | FromDiscord | <Zectbumo> Windows is never #2 |
08:08:57 | FromDiscord | <Phil> For the move of bombing grub on the regular windows can kiss my ass |
08:09:07 | FromDiscord | <retkid> In reply to @Zectbumo "yeah where else do": That’s it I’m burning all of Seattle |
08:09:21 | FromDiscord | <Phil> Thankfully proton allows me to fullfill all of my gamer needs and for all other usecases Linux is easier to deal with |
08:10:09 | FromDiscord | <Rika> Too bad it doesn’t for me xd |
08:10:16 | FromDiscord | <Zectbumo> Seattle will be sad and Microsoft (in Redmond) will be scared |
08:10:31 | FromDiscord | <retkid> Redmond is Seattle to me |
08:12:28 | FromDiscord | <retkid> https://media.discordapp.net/attachments/371759389889003532/977484004657889390/IMG_2253.png |
08:12:33 | FromDiscord | <retkid> This is unfortunate |
08:12:40 | FromDiscord | <Zectbumo> well, they are 15 miles apart, so your fire better be big and waterproof because you are going to need to jump a 2 mile lake |
08:13:31 | FromDiscord | <Zectbumo> meh, logistics |
08:14:27 | FromDiscord | <demotomohiro> At least, installing grub on usb flash and installing windows and linux on same SSD works for me. |
08:14:58 | FromDiscord | <Zectbumo> In reply to @retkid "This is unfortunate": You think MS didn't think of this already with all the people that wants to burn them down 😉 |
08:15:10 | FromDiscord | <Zectbumo> they built a moat! |
08:15:42 | FromDiscord | <Elegantbeef> Cant moat a nuclear blast |
08:16:04 | FromDiscord | <retkid> In reply to @demotomohiro "At least, installing grub": I’m installing grub again lmao it knows how to disable wbl |
08:16:07 | FromDiscord | <0ffh> In reply to @retkid "So windows nuked grub": It did that kind of shit from the beginning. When dual-booting you'd always have to either install Windows first, then linux, or manually restore lilo after. |
08:16:57 | FromDiscord | <Zectbumo> linux is a subsystem (#2) |
08:18:17 | FromDiscord | <retkid> Rufus arch and install grub is my current plan lmao |
08:18:34 | FromDiscord | <Yardanico> can we maybe switch the discussions between #main and #offtopic 🤔 |
08:18:40 | FromDiscord | <Zectbumo> I was thinking that too |
08:18:49 | FromDiscord | <Zectbumo> back to topic, how do I get fields from posix.Time? |
08:21:01 | FromDiscord | <0ffh> Now I have a setup with easily removable hdds. When I want to windows (for gaming, no other use really), I physically remove my linux hdd and insert the windows hdd. As an additional plus, I'm sure that no windows malware can tamper with my linux setup. |
08:26:59 | FromDiscord | <untoreh> `arc` is still stop the world gc right? |
08:27:17 | FromDiscord | <Phil> I am not sure what a "stop the world gc" is |
08:27:21 | FromDiscord | <Yardanico> In reply to @untoreh "`arc` is still stop": not at all |
08:27:38 | FromDiscord | <Yardanico> it just calls =destroy on the variables in scope right at the end of the scope |
08:27:49 | FromDiscord | <Yardanico> do you call refcounting or destructors "stop the world"? |
08:28:17 | FromDiscord | <Yardanico> In reply to @Yardanico "it just calls =destroy": for non-ref types this just calls their destructor, for ref types it decrements the refcounter, and if it's 0, destroys the underlying data and frees the reference |
08:28:18 | FromDiscord | <untoreh> but destructors don't run in parallel? |
08:28:22 | FromDiscord | <Elegantbeef> Refc isnt even stop the world |
08:28:27 | FromDiscord | <Rika> In reply to @untoreh "but destructors don't run": ? |
08:28:30 | FromDiscord | <Yardanico> In reply to @untoreh "but destructors don't run": but that still doesn't make it "stop the world" |
08:28:37 | FromDiscord | <Yardanico> it's sequential code, why would it run in parallel |
08:28:43 | FromDiscord | <Yardanico> even C++ destructors "don't run in parallel" |
08:29:10 | FromDiscord | <retkid> It would be slower to run it in parallel |
08:29:26 | FromDiscord | <retkid> Because of how threads are instantiated |
08:29:36 | FromDiscord | <retkid> Though I’m probably wrong lmao |
08:29:44 | FromDiscord | <Elegantbeef> Well you also cant do it on threads |
08:29:44 | FromDiscord | <Rika> You could just use thread pooling |
08:29:48 | FromDiscord | <untoreh> ok so I think that's why I can't acquire python gil from within a destructor 😛 |
08:29:54 | FromDiscord | <Rika> But that’s besides the point |
08:30:00 | FromDiscord | <Elegantbeef> There could be thread local resources that need to be disposed of |
08:30:10 | FromDiscord | <Yardanico> In reply to @untoreh "ok so I think": maybe you can ask your actual question instead of trying to speculate :) |
08:30:14 | FromDiscord | <retkid> In reply to @Elegantbeef "There could be thread": Threads all the way down |
08:30:14 | FromDiscord | <Elegantbeef> Guess it doesnt matter for arc/orc |
08:30:22 | FromDiscord | <Yardanico> destructors have some quirks, e.g. they might be called multiple times sometimes |
08:30:28 | FromDiscord | <demotomohiro> !eval echo "Ρ"[0].int, ", ", "P"[0].int |
08:30:28 | FromDiscord | <Yardanico> so you need to check if the underlying data is already destroyed |
08:30:30 | NimBot | 206, 80 |
08:30:45 | FromDiscord | <untoreh> it's this https://github.com/yglukhov/nimpy/issues/263 |
08:31:03 | FromDiscord | <Rika> In reply to @demotomohiro "!eval echo "Ρ"[0].int, ",": Oi oi oi wait a minute |
08:31:13 | FromDiscord | <Elegantbeef> Unicode goes brr |
08:31:18 | FromDiscord | <Yardanico> In reply to @Rika "Oi oi oi wait": greek P vs ascii P |
08:31:22 | FromDiscord | <Rika> I know |
08:31:45 | FromDiscord | <Yardanico> also the way .int is used is wrong because it's not a single byte character :) |
08:32:01 | FromDiscord | <demotomohiro> But you can use unicode characters for username in Github? |
08:32:04 | FromDiscord | <Yardanico> no |
08:32:06 | FromDiscord | <Elegantbeef> "wrong" in that they care |
08:32:27 | FromDiscord | <Yardanico> you can use them for the nickname (the displayed name), but not your username |
08:33:44 | FromDiscord | <Yardanico> In reply to @untoreh "it's this https://github.com/yglukhov/nimpy/issues/": do you have some code to reproduce it maybe? it would help for people who might try solving the issue |
08:34:02 | FromDiscord | <demotomohiro> So you cannot use greek P or other unicode for impersonating in Github. |
08:34:08 | FromDiscord | <Yardanico> yes, you can't |
08:35:12 | FromDiscord | <Yardanico> github username is 1-39 chars, can only contain a-z, A-Z, 0-9 and dash (-) and cannot start with a dash |
08:35:45 | FromDiscord | <demotomohiro> So only lower case 'L' and upper case 'I' can be used for impersonating in Github? |
08:36:26 | FromDiscord | <aph> petition forcing github to use a better font |
08:37:28 | FromDiscord | <demotomohiro> Or use case insensitivity for user name? |
08:37:47 | FromDiscord | <aph> true, that sounds better |
08:37:48 | FromDiscord | <Yardanico> In reply to @demotomohiro "Or use case insensitivity": how would that solve capitalized i vs l ? |
08:37:54 | FromDiscord | <Yardanico> Il |
08:38:00 | FromDiscord | <Yardanico> `Il` |
08:38:04 | FromDiscord | <Yardanico> they're different letters |
08:39:36 | FromDiscord | <demotomohiro> Ah, it solves only `I` and `l`, but `i` and `l`. |
08:39:52 | FromDiscord | <Elegantbeef> homoglyphs suck |
08:44:15 | FromDiscord | <Zectbumo> ah I finally got it. the answer was `.int` |
08:44:20 | FromDiscord | <Zectbumo> !eval import std/posix; var r: Rusage; RUSAGE_SELF.getrusage(r.addr); echo r.ru_utime.tv_sec.int |
08:44:22 | NimBot | 0 |
08:45:28 | FromDiscord | <Yardanico> In reply to @Zectbumo "!eval import std/posix; var": i just hope you're not planning to use Rusage for benchmarking :) |
08:46:26 | FromDiscord | <Zectbumo> no, I was looking into the question https://discord.com/channels/371759389889003530/371759389889003532/977471686880395287 |
08:47:12 | FromDiscord | <Elegantbeef> Zect if instead of copying a link to the message you replied to it, that'd be great |
08:47:30 | FromDiscord | <Zectbumo> but I ran across time_t which for some reason echo can't print |
08:47:43 | FromDiscord | <Elegantbeef> It's a distinct probably |
08:48:02 | FromDiscord | <Zectbumo> `Time {.importc: "time_t", header: "<time.h>".} = distinct clonglong` |
08:48:31 | FromDiscord | <Elegantbeef> Distinct if you dont know is identical shape to the type but not the same type |
08:49:04 | FromDiscord | <Elegantbeef> It's one of the best type features since sliced bread |
08:49:08 | FromDiscord | <Zectbumo> I read about it, but haven't used it. It would be nice if it exported $ |
08:49:33 | FromDiscord | <Zectbumo> (edit) "exported" => "borrowed" |
08:51:47 | FromDiscord | <Zectbumo> hmm, maybe I can PR that |
08:52:34 | FromDiscord | <Elegantbeef> No |
08:52:42 | FromDiscord | <Elegantbeef> It shouldnt borrow any operations by default |
08:52:47 | FromDiscord | <Elegantbeef> That's the entire point of it |
08:58:04 | FromDiscord | <Zectbumo> well, it does |
08:58:14 | FromDiscord | <Elegantbeef> It does what? |
08:58:18 | FromDiscord | <Zectbumo> borrow |
08:58:21 | FromDiscord | <Elegantbeef> It only borrows `=` by default |
08:58:26 | FromDiscord | <Zectbumo> and... |
08:58:35 | FromDiscord | <Elegantbeef> It doesnt borrow anything else |
08:59:09 | FromDiscord | <Zectbumo> https://github.com/nim-lang/Nim/blob/devel/lib/posix/posix.nim#L677-L678 |
08:59:19 | FromDiscord | <Elegantbeef> By default |
08:59:35 | FromDiscord | <Zectbumo> yeah so it borrows == and - |
08:59:37 | FromDiscord | <Elegantbeef> I misread your intention |
08:59:47 | FromDiscord | <Elegantbeef> I thought you were implying make distinct borrow `$` by default |
08:59:58 | FromDiscord | <Zectbumo> oh. no Time borrow $ |
09:00:11 | FromDiscord | <Yardanico> In reply to @Zectbumo "yeah so it borrows": are you talking about Time or distinct |
09:00:14 | FromDiscord | <Yardanico> Beef is talking about distinct itself |
09:00:16 | FromDiscord | <Yardanico> not Time specifically |
09:00:27 | FromDiscord | <Elegantbeef> Yea yard we resolved the mix up |
09:00:28 | FromDiscord | <Zectbumo> Time |
09:00:53 | FromDiscord | <retkid> https://media.discordapp.net/attachments/371759389889003532/977496189882740736/IMG_2254.mov |
09:01:07 | FromDiscord | <Yardanico> you meant to post that to #offtopic ? |
09:01:24 | FromDiscord | <retkid> UHM YES SIR DEFINITELY MOD SAMA |
09:01:59 | FromDiscord | <Zectbumo> In reply to @Elegantbeef "Yea yard we resolved": too many "it" for me \:D |
09:03:06 | FromDiscord | <Zectbumo> @ElegantBeef , if `-` is borrowed then wouldn't you think `+` be borrowed too? |
09:03:18 | FromDiscord | <Elegantbeef> No clue |
09:03:30 | FromDiscord | <Zectbumo> (edit) "@ElegantBeef , if `-` is borrowed then wouldn't you think `+` ... be" added "should" |
09:03:37 | FromDiscord | <Zectbumo> "should" |
09:03:44 | FromDiscord | <Elegantbeef> Depends on the API |
09:03:58 | FromDiscord | <Elegantbeef> If the API calls for it then yes, otherwise no |
09:04:18 | FromDiscord | <Zectbumo> well, I think typically you do: now - then |
09:05:03 | FromDiscord | <Zectbumo> but it's possible that `then + someTime` would happen. I should add `+` to my PR too |
09:08:45 | FromDiscord | <planetis> Since it's time I would prefer to see a formatted message not just an integer |
09:09:00 | FromDiscord | <Yardanico> In reply to @planetis "Since it's time I": its raw Time though (from posix) |
09:09:05 | FromDiscord | <Yardanico> we have std/times for all the fancy time stuff |
09:09:09 | FromDiscord | <Yardanico> and std/monotimes |
09:12:31 | FromDiscord | <Forest> If i have two libraries that define a type that has the same fields as eachother, is there a way i could combine them in Nim for cleaner code? |
09:12:45 | FromDiscord | <Forest> Don't wanna have to keep casting them to the other |
09:13:07 | FromDiscord | <Elegantbeef> Use a converter |
09:13:21 | FromDiscord | <Elegantbeef> Other than that nope they're in sub modules you need to make them rely on the same type then |
09:13:21 | FromDiscord | <Forest> Wdym? |
09:13:40 | FromDiscord | <Yardanico> In reply to @Forest "Wdym?": https://nim-lang.org/docs/manual.html#converters |
09:14:35 | FromDiscord | <Forest> Ah thanks! |
09:15:23 | FromDiscord | <Zectbumo> In reply to @planetis "Since it's time I": it's seconds since epoc |
09:17:42 | FromDiscord | <Zectbumo> okay I'm not going to add `+`. I didn't realize that the `-` doesn't handle an int literal. and a `time + time` doesn't make sense unless you are trying to make a multiverse |
09:21:01 | FromDiscord | <Rika> Hey what’s wrong with that |
09:24:02 | FromDiscord | <Zectbumo> which part? |
09:24:22 | FromDiscord | <Rika> Making a multiverse |
09:24:46 | FromDiscord | <Zectbumo> I haven't tried it yet, but I hear it's the rage |
09:25:56 | FromDiscord | <Zectbumo> whoa, this is awesome. so I just edit the .nim source and the very next run I do already has my change in it?? whoa! no compiling?? this is tripping me out |
09:26:32 | FromDiscord | <Yardanico> what |
09:26:51 | FromDiscord | <Yardanico> if you use `nim r` it's just an alias for compiling and then running the resulting binary |
09:28:11 | FromDiscord | <Zectbumo> I don't know why I'm surprised. but I edited possix.nim std lib and ran my example code that used to not work with echo and now does. I guess I'm not used to modifying core libs and having them work so easily |
09:29:15 | FromDiscord | <Zectbumo> In reply to @Yardanico "if you use `nim": yes, I was `nim r` on my example.nim file but I didn't expect it to compile the std lib file I edited |
09:29:28 | FromDiscord | <Rika> Nim doesn’t do precompiling like Python or whatever else |
09:29:44 | FromDiscord | <Yardanico> In reply to @Zectbumo "yes, I was `nim": well that would be the same in any language that has statically linked stdlib |
09:30:14 | FromDiscord | <Zectbumo> er dynamically linked you mean? |
09:30:25 | FromDiscord | <Yardanico> no, statically linked |
09:30:33 | FromDiscord | <Yardanico> since all stdlib modules always get compiled into your binary |
09:30:40 | FromDiscord | <Yardanico> they're not separate shared libraries |
09:30:42 | FromDiscord | <Zectbumo> ah I see |
09:31:26 | FromDiscord | <Zectbumo> yeah, makes sense once it's all laid out. I'm just so pleased with nim all around |
09:31:51 | FromDiscord | <Yardanico> there is nimrtl that makes some of the stdlib dynamically linked, but it's rarely used and doesn't work with arc/orc as of now |
09:31:57 | FromDiscord | <Elegantbeef> Source stdlib is nice |
09:32:35 | FromDiscord | <Yardanico> although probably main reason nimrtl exist is to put the GC into a separate library so you can write multiple .dll's in Nim and have them interact with each other with GC'd objects |
09:33:55 | FromDiscord | <Yardanico> because nimrtl doesn't work for ARC/ORC for now if you want to share GC'd objects between the host app and .dlls if they're all written in Nim you have to use `-d:useMalloc` (you can also use `-d:useMalloc` together with another allocator, like mimalloc) |
09:34:22 | FromDiscord | <Yardanico> i mean specifically for arc/orc |
09:40:32 | FromDiscord | <Zectbumo> huh, I think I may have to make a further change. I don't think the `-` proc for Time is right. It returns a Time object, which is incorrect. That is a time delta and Time is epoc relative. It should return at least int or if there is a delta time, that |
09:41:22 | FromDiscord | <Zectbumo> https://github.com/nim-lang/Nim/blob/devel/lib/posix/posix.nim#L678 |
09:41:54 | FromDiscord | <Yardanico> again, this is std/posix :P |
09:42:06 | FromDiscord | <Zectbumo> ? |
09:42:18 | FromDiscord | <Yardanico> In reply to @Zectbumo "?": it's just a raw wrapper over posix APIs |
09:42:24 | FromDiscord | <Yardanico> why don't you just convert it into std/times Time ? |
09:42:26 | FromDiscord | <Zectbumo> not this part |
09:43:01 | FromDiscord | <Yardanico> https://nim-lang.org/docs/times.html#fromUnix%2Cint64 and then you'll have a lot of nice Nim APIs |
09:43:04 | FromDiscord | <Rika> It’s returning the wrong type |
09:43:06 | FromDiscord | <Rika> Is what he means |
09:43:14 | FromDiscord | <Yardanico> In reply to @Rika "It’s returning the wrong": is it though? |
09:43:34 | FromDiscord | <Zectbumo> yeah, it's not returning a Time anymore once you subtract it from another Time |
09:43:36 | FromDiscord | <Rika> Tell me why not |
09:43:38 | FromDiscord | <Yardanico> i mean since Time is `distinct clonglong` there's not much difference to begin with |
09:44:09 | FromDiscord | <Zectbumo> it's distinctly different 😉 |
09:44:59 | FromDiscord | <Zectbumo> If you get Time and subtract Time you get a delta seconds, which is int. Not Time which is seconds since epoch |
09:46:35 | FromDiscord | <Yardanico> In reply to @Zectbumo "If you get Time": isn't https://nim-lang.org/docs/posix.html#difftime%2CTime%2CTime made for that? |
09:46:37 | FromDiscord | <Yardanico> https://www.cplusplus.com/reference/ctime/difftime/ |
09:47:09 | FromDiscord | <Zectbumo> hmm, a `cdouble` |
09:47:13 | FromDiscord | <Zectbumo> yes |
09:47:51 | FromDiscord | <Zectbumo> so, specifically it should be a cdouble |
09:48:00 | FromDiscord | <Yardanico> not at all |
09:48:12 | FromDiscord | <Zectbumo> I mean `difftime()` kind makes my point |
09:48:19 | FromDiscord | <Zectbumo> (edit) "kind" => "kinda" |
09:48:22 | FromDiscord | <Yardanico> `difftime` specifically returns a `cdouble` because `time_t` can be represented with different types |
09:48:33 | FromDiscord | <Yardanico> on POSIX specifically it's in seconds |
09:48:40 | FromDiscord | <Yardanico> https://stackoverflow.com/questions/34457931/why-does-difftime-return-a-double |
09:48:52 | FromDiscord | <Yardanico> i wonder why is `-` borrowed in the first place if there's `difftime` :P |
09:49:23 | FromDiscord | <Zectbumo> maybe `-` should just turn into `difftime` call |
09:49:45 | FromDiscord | <Zectbumo> and then I get my cdouble \:D |
09:49:58 | FromDiscord | <Yardanico> maybe you should just use std/times :) |
09:50:28 | FromDiscord | <Zectbumo> It's not me. it's rusage |
09:50:43 | FromDiscord | <Yardanico> In reply to @Zectbumo "It's not me. it's": as I said, you can just convert it into a std/times Time |
09:50:49 | FromDiscord | <Yardanico> and then rely on nice Nim APIs |
09:50:54 | FromDiscord | <Yardanico> https://nim-lang.org/docs/times.html#fromUnix%2Cint64 |
09:50:55 | FromDiscord | <Zectbumo> I see |
10:00:58 | FromDiscord | <Zectbumo> int64! now that's thinking beyond 2032 |
10:01:14 | FromDiscord | <Zectbumo> only 10 more years 😮 |
10:01:34 | FromDiscord | <Zectbumo> y2k 2.0 |
10:01:36 | FromDiscord | <Yardanico> In reply to @Zectbumo "int64! now that's thinking": time_t is also 64-bit nowadays |
10:01:44 | FromDiscord | <Yardanico> on most modern systems |
10:01:46 | FromDiscord | <Zectbumo> is your bank's tho? |
10:02:23 | FromDiscord | <Yardanico> In reply to @Zectbumo "is your bank's tho?": withdraw money just before that day comes, see if something bad happens, if not, just put the money back |
10:02:23 | FromDiscord | <Yardanico> ez |
10:02:48 | FromDiscord | <Rika> Smart |
10:03:06 | FromDiscord | <Rika> Inb4 global bank collapse because everyone does it |
10:03:32 | FromDiscord | <Zectbumo> oh, they had to roll back the database. you now have all your money back 😉 |
10:04:13 | FromDiscord | <Rika> Gotta love fractional reserve banking |
10:22:36 | FromDiscord | <ambient> i dont think fractional reserve exists anymore, its all about central banks and their fronts |
10:43:04 | FromDiscord | <Zectbumo> well my PR is underway 💪 |
10:48:18 | FromDiscord | <jmiven> In reply to @Zectbumo "int64! now that's thinking": It doesn't change much, but it's 2038, not 2032 🙂 |
10:48:52 | FromDiscord | <Zectbumo> oh thank you 🙂 it's good to know it's still far away |
10:49:01 | * | dithpri joined #nim |
10:49:10 | FromDiscord | <Zectbumo> oh I see what I did "32" 32bit |
10:49:17 | FromDiscord | <Rika> I don’t know man 6 more years isn’t much further |
10:55:22 | FromDiscord | <Zectbumo> it's enough time that we may all be speaking russian by then |
11:10:07 | * | pro joined #nim |
11:27:05 | * | pro quit (Quit: pro) |
11:33:15 | FromDiscord | <sheerluck> or Nuclear winter |
11:39:40 | * | ltriant joined #nim |
11:44:27 | * | ltriant quit (Ping timeout: 246 seconds) |
11:48:25 | FromDiscord | <Bung> @PMunch I've done the nimlsp's windows compatibility |
12:57:45 | ehmry | banks aready have time problems because today they are dealing with contracts that go beyond 2038 |
13:12:55 | ehmry | also, I made an obnouxiously esoteric clock https://git.sr.ht/~ehmry/tonaltime |
13:14:14 | FromDiscord | <Rika> cool it still neatly fits into a day |
13:15:50 | * | noeontheend joined #nim |
13:19:58 | * | xaltsc quit (Remote host closed the connection) |
13:26:33 | FromDiscord | <Forest> How is unix epoch gonna be solved then? |
13:26:57 | FromDiscord | <Rika> 64 bit is "enough" |
13:26:59 | FromDiscord | <Forest> If changing it to int64 isn't gonna do much, how can it be fixed? Will we have to throw that out? |
13:27:13 | FromDiscord | <Forest> Wait but i thought that was only limited to 2038 |
13:27:17 | FromDiscord | <Rika> do you want to know how many years itll take for 64 bit |
13:27:18 | FromDiscord | <Rika> no |
13:27:19 | FromDiscord | <Rika> thats 32 |
13:27:29 | FromDiscord | <Forest> Oh I'm dumb lmao |
13:27:35 | FromDiscord | <Forest> In reply to @Rika "do you want to": Yeah actually |
13:27:58 | FromDiscord | <Rika> for 64 bit its "AD `292 277 026 596`-12-04 15:30:08 UTC" |
13:28:17 | FromDiscord | <Rika> do you think the universe would still exist in 300 billion years |
13:28:21 | FromDiscord | <Forest> Huh... Neat |
13:28:27 | FromDiscord | <Forest> Lmao idk |
13:28:45 | FromDiscord | <Rika> the sun dies in 5 billion years |
13:28:54 | FromDiscord | <Rika> for reference |
13:28:57 | ehmry | and if you are worried about running over 300 billion years you can use a float64, just with less precision |
13:29:41 | FromDiscord | <Rika> if you're using nanosecond precision i guess 64 bits range is prolly a bit more worrying |
13:29:55 | FromDiscord | <Rika> you have other issues though when you need ns precision |
13:31:08 | ehmry | I saw a protocol proposal that used use jan 1, 3000CE as a reference |
13:31:29 | ehmry | if we are going to do something drastic then might as well set a new epoch in the future |
13:32:41 | FromDiscord | <Rika> for nanosecond precision it seems like "Friday, April 11, 2262 11:47:16 PM" is the limit of 64 bit |
13:33:53 | FromDiscord | <Rika> i checked too btw, it seems like the universe would be effectively dead in 1-100 trillion years so i guess for higher beings 64 bit would be a concern |
13:53:41 | * | noeontheend quit (Ping timeout: 244 seconds) |
14:11:34 | om3ga | Hello! Update on my Issue, my code had problems, but not the criminal ones. So now ubsan prints that: /home/lenz/.choosenim/toolchains/nim-1.6.6/lib/system/excpt.nim:554:51: runtime error: member access within misaligned address 0x0000ffffffff for type 'struct TFrame', which requires 8 byte alignment |
14:11:55 | om3ga | Is this a bug in excpt.nim? |
14:14:02 | om3ga | I doubt that this caused by passing pointers, or something related to "undafe" things. with previous version, lldb poined to the same excpt.nim |
14:19:07 | FromDiscord | <Andreas> i found that nimlsp does not like includes very much. Apart from that - is there a better way to make a app configurable ? i'm using a combination of compiler-switches and includes ? |
14:19:43 | FromDiscord | <Andreas> (edit) "i found that nimlsp does not like includes very much. Apart from that - is there a better way to make a app configurable ? i'm using a combination of compiler-switches and includes ? ... " added "Nimble ?" |
14:21:58 | FromDiscord | <d4rckh> https://github.com/treeform/ws/issues/39#issuecomment-1133600597 |
14:22:03 | FromDiscord | <d4rckh> does anyone have any idea about this? |
14:23:50 | FromDiscord | <!Patitotective> sent a code paste, see https://paste.rs/g3n |
14:26:41 | FromDiscord | <Andreas> In reply to @Patitotective "im not sure i": yes, correct, thats what i'm doing right now. But the `doSomething()`s are includes which nimlsp struggles a bit. And as my first option was a switch for 32- or 64-Bit support, i'd like to have some more. And the include-files get a bit hairy to organize.. |
14:29:03 | FromDiscord | <!Patitotective> In reply to @Andreas "yes, correct, thats what": what about three modules: `main.nim`, `main32.nim` and `main64.nim`↵and you can _import_ those two modules into `main.nim`↵no need for includes_ |
14:29:05 | FromDiscord | <!Patitotective> (edit) "includes_" => "_includes_" |
14:33:32 | FromDiscord | <Andreas> In reply to @Patitotective "what about three modules:": ty, i'll try that.. |
14:37:34 | FromDiscord | <Bung> sent a code paste, see https://paste.rs/jqc |
14:58:49 | ehmry | what is the name of the nim mascot? |
15:02:23 | FromDiscord | <Rika> the badger? |
15:02:31 | ehmry | nevermind |
15:02:39 | ehmry | I don't think there is oneo |
15:05:58 | FromDiscord | <demotomohiro> https://github.com/nim-lang/RFCs/issues/104 |
15:13:59 | NimEventer | New thread by Stoneface86: Windows compile --app:staticlib error, see https://forum.nim-lang.org/t/9165 |
15:18:50 | FromDiscord | <Andreas> In reply to @demotomohiro "https://github.com/nim-lang/RFCs/issues/104": why not Chimera ? https://en.wikipedia.org/wiki/Chimera_(mythology) |
15:28:43 | * | xet7 quit (Remote host closed the connection) |
15:30:34 | * | xet7 joined #nim |
15:32:14 | FromDiscord | <exelotl> tbh nimi is perfect and everyone who says otherwise has no taste :P |
15:32:36 | FromDiscord | <Rika> nimi is cute |
15:32:42 | FromDiscord | <Rika> a cute name |
15:38:18 | FromDiscord | <exelotl> (i meant the design for the mascot in the thread, but yes nimi is indeed a cute name for it) |
15:41:22 | * | ltriant joined #nim |
15:46:10 | NimEventer | New Nimble package! capstone - Capstone3 high-level wrapper, see https://github.com/hdbg/capstone-nim |
15:46:19 | * | ltriant quit (Ping timeout: 244 seconds) |
16:01:46 | * | rockcavera quit (Remote host closed the connection) |
16:03:53 | om3ga | Finally excluded "possible bug" in nim . but still strange behavior. Now binary not causes UB, but strange thing, one function from shared lib don't works. |
16:04:32 | om3ga | please ignore posted above debug log |
16:05:47 | FromDiscord | <Ayy Lmao> Is there a way to tell a template that it's okay to not put `gensym` after everything? |
16:07:27 | FromDiscord | <Yardanico> it's not putting "gensym", it's just making fresh symbols, but you can get what you want with {.dirty.} |
16:07:52 | FromDiscord | <Yardanico> by default template are hygienic, with `{.dirty.}` however all identifiers will be kept as-is |
16:09:24 | FromDiscord | <Ayy Lmao> In reply to @Yardanico "by default template are": Awesome, I'll have to try it out. My use case is for generating top level functions with a template. If you get something wrong somewhere else, then the compiler's error message is spammed with `gensym` in all the arguments which is ugly. |
16:09:54 | FromDiscord | <Yardanico> eh, it's not really that ugly, and instead you can use `{.inject.}` for specific parts that you dont want to get gensym'd |
16:11:06 | FromDiscord | <Ayy Lmao> I hadn't thought of inject. I'll have to try that too. For some reason my eyes glaze over when I'm greeted with an error message where half of the content is `gensym` |
16:22:57 | * | wallabra quit (Quit: ZNC 1.8.2 - https://znc.in - Stopping for maintenance... Leave messages at my XMPP ([email protected]), or my Discord (Gustavo6046#9009), or possibly my Mastodon [email protected]), or email ([email protected]).) |
16:34:26 | FromDiscord | <Andreas> how can on pass a (sub)-range to a proc ? `proc (a: seq[byte], ra: range[int])` does not work ? |
16:35:08 | FromDiscord | <Andreas> (edit) "on" => "one" |
16:36:53 | FromDiscord | <Rika> a "range" is a `Slice[int]` |
16:36:55 | FromDiscord | <Rika> i think |
16:37:15 | FromDiscord | <Rika> !eval echo (typeof 0..1) == Slice[int] |
16:37:17 | NimBot | Compile failed: /usercode/in.nim(1, 20) Error: type mismatch: got <typedesc[int], typedesc[Slice[system.int]]> |
16:37:24 | FromDiscord | <Rika> eeh |
16:37:33 | FromDiscord | <Rika> i guess i have to value-ize 0..1 somehow idk |
16:38:17 | FromDiscord | <spoon> sent a code paste, see https://paste.rs/Mn2 |
16:38:42 | FromDiscord | <spoon> not sure if it's my options usage or the api usage, but i'm testing by updating roles |
16:38:45 | FromDiscord | <Rika> then that means `o` is none |
16:39:07 | FromDiscord | <spoon> ah, so it's the api |
16:41:39 | FromDiscord | <huantian> !eval echo 0..3 is Slice[int] |
16:41:42 | NimBot | false |
16:41:45 | FromDiscord | <huantian> Wonder does that work |
16:41:49 | FromDiscord | <huantian> Nope |
16:45:21 | FromDiscord | <demotomohiro> !eval echo typeof(0..3) |
16:45:23 | NimBot | int |
16:57:46 | FromDiscord | <planetis> !eval echo typeof(0..3, typeOfProc) |
16:57:48 | NimBot | HSlice[system.int, system.int] |
16:57:58 | FromDiscord | <Rika> oh yeah that thing |
16:58:23 | FromDiscord | <planetis> which reminded me, collect needs to be fixed |
17:07:26 | om3ga | Yardanico, finally fixed everything. The problem was with bindings to struct request, it was incomplete |
17:07:50 | om3ga | so the FCGX_Accept_r used to corrupt memory |
17:08:35 | om3ga | probably when I did mappings c2nim ignored something... |
17:09:40 | om3ga | or.. I accidentally deleted block of code... crazy |
17:30:52 | * | xet7 quit (Remote host closed the connection) |
17:33:23 | * | xet7 joined #nim |
19:19:53 | * | xet7 quit (Remote host closed the connection) |
19:28:26 | FromDiscord | <d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=3YiI |
19:28:30 | FromDiscord | <d4rckh> (edit) "https://play.nim-lang.org/#ix=3YiI" => "https://paste.rs/D5h" |
19:28:30 | FromDiscord | <d4rckh> I am trying to use `ws` with `jester` |
19:37:24 | FromDiscord | <d4rckh> https://media.discordapp.net/attachments/371759389889003532/977656374806859846/unknown.png |
19:37:33 | FromDiscord | <d4rckh> for some reason, this ws library is not sending anything back to my ws client |
19:37:45 | FromDiscord | <d4rckh> can any of you catch what's wrong? |
19:39:35 | FromDiscord | <Rika> dont use sleep |
19:39:40 | FromDiscord | <Rika> that will block your async code |
19:39:52 | FromDiscord | <Rika> use sleepAsync |
19:39:59 | FromDiscord | <Rika> `await sleepAsync(1000)` |
19:40:04 | FromDiscord | <d4rckh> ah, thanks |
19:40:13 | FromDiscord | <d4rckh> okay, changed asyncCheck to await |
19:40:15 | FromDiscord | <d4rckh> now it works |
19:40:35 | FromDiscord | <d4rckh> now i want all of those connections to be available in my entire program |
19:40:38 | FromDiscord | <d4rckh> (edit) "now i want all of those ... connections" added "ws" |
19:40:55 | FromDiscord | <d4rckh> i have this `Server` ref object which is passed around in mostly every proc |
19:42:32 | FromDiscord | <d4rckh> can i just make a sequence of WebSockets there? |
19:42:58 | * | ltriant joined #nim |
19:43:58 | * | redj quit (Ping timeout: 246 seconds) |
19:44:36 | * | redj joined #nim |
19:47:36 | * | ltriant quit (Ping timeout: 244 seconds) |
19:49:28 | FromDiscord | <d4rckh> Okay, I did something |
19:49:38 | FromDiscord | <d4rckh> but now i get `Exception message: Missing route action, did you forget to use \`resp\` in your route?` |
19:49:44 | FromDiscord | <d4rckh> (edit) "\`resp\`" => "'resp'" |
19:50:07 | FromDiscord | <d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=3YiL |
19:50:18 | FromDiscord | <d4rckh> (edit) "https://play.nim-lang.org/#ix=3YiL" => "https://play.nim-lang.org/#ix=3YiM" |
19:50:24 | FromDiscord | <d4rckh> (edit) "https://play.nim-lang.org/#ix=3YiM" => "https://play.nim-lang.org/#ix=3YiN" |
19:52:46 | * | xet7 joined #nim |
19:58:43 | FromDiscord | <huantian> gotta respond with something, `resp "success"` or something |
19:58:51 | FromDiscord | <huantian> (edit) "gotta respond with something, `resp "success"` ... or" added "at the end" |
20:02:11 | FromDiscord | <d4rckh> i see |
20:02:13 | FromDiscord | <d4rckh> thanks |
20:02:30 | FromDiscord | <d4rckh> now that function sends nothing |
20:02:34 | FromDiscord | <d4rckh> (edit) removed "function" |
20:02:49 | FromDiscord | <d4rckh> i have that while loop that sends things while the socket is connected |
20:02:57 | FromDiscord | <d4rckh> which stops as soon as i try to send something from another file |
20:08:28 | * | redj quit (Ping timeout: 246 seconds) |
20:09:17 | FromDiscord | <d4rckh> omg i changed from `hello` to `hi` |
20:09:22 | FromDiscord | <d4rckh> it worked well |
20:09:37 | FromDiscord | <d4rckh> until i restarted the ws server, and now it closes the connection randomly |
20:11:04 | * | xet7 quit (Remote host closed the connection) |
20:11:06 | FromDiscord | <d4rckh> i didnt change a single line of code |
20:24:12 | FromDiscord | <N00nehere> does pas2nim convert stuff like gui? |
20:31:28 | * | claudius joined #nim |
20:34:07 | * | claudius left #nim (#nim) |
20:36:17 | * | xet7 joined #nim |
21:50:51 | * | jjido joined #nim |
22:13:57 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
22:25:12 | * | ltriant joined #nim |
22:29:50 | * | ltriant quit (Ping timeout: 244 seconds) |
23:01:22 | FromDiscord | <!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3Yjq |
23:01:50 | FromDiscord | <Elegantbeef> You know you can write code? |
23:01:53 | FromDiscord | <Andreas> there ist a delete( seq, idx) |
23:02:13 | FromDiscord | <Andreas> (edit) "there ist a delete( seq, idx) ... " added "in system.." |
23:03:08 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "You know you can": you mean the second |
23:03:20 | FromDiscord | <Elegantbeef> Nope |
23:03:41 | FromDiscord | <!Patitotective> then :[ |
23:04:15 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Yjr |
23:04:48 | FromDiscord | <Elegantbeef> That removes all entires of `val` |
23:05:04 | FromDiscord | <!Patitotective> thanks :] |
23:09:54 | FromDiscord | <Andreas> In reply to @Patitotective "you mean the second": sry, just checked it - yes second version works for me.. a remove.fn is nice&easy |
23:11:04 | FromDiscord | <Andreas> (edit) "nice&easy" => "nice&easy↵Remove first hit of 'b' or all ?" |
23:55:30 | * | ltriant joined #nim |