00:00:12 | FromDiscord | <Elegantbeef> Yea i mean they work fine but nim has string casestatements which map tables |
00:00:19 | FromDiscord | <Elegantbeef> Which gives you more control |
00:00:58 | hexology | so instead of an `inputConverters` table, you'd just have a proc that raises an exception or something? |
00:01:03 | hexology | or returns nil |
00:01:20 | FromDiscord | <Elegantbeef> Yea |
00:03:55 | hexology | i tend to try to avoid calling a function like quit() inside anything but main() -- so maybe i'd raise various exceptions and then handle them in main(). that's a lot like how i write my python programs nowadays |
00:04:33 | hexology | i would also be interested in any 3rd-party libraries for cli arg parsing, with a higher-level and/or more-declarative interface |
00:05:02 | FromDiscord | <Elegantbeef> There's https://github.com/c-blake/cligen |
00:05:05 | nrds | <R2D299> itHub: 7"Nim library to infer/generate command-line-interfaces / option / argument parsing; Docs At" |
00:05:09 | FromDiscord | <Elegantbeef> It's one of the more popular ones |
00:06:01 | FromDiscord | <Elegantbeef> Yea deech i think the way yo do it is to emit a new macro which has the typedesc |
00:07:33 | FromDiscord | <deech> @ElegantBeef Could you elaborate? |
00:08:43 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=3Ah8 |
00:09:18 | FromDiscord | <Elegantbeef> If you have an example i could see what makes more sense |
00:09:31 | FromDiscord | <deech> Oh wow. |
00:11:40 | FromDiscord | <deech> So there's no way to "recover" that typedesc directly? |
00:12:12 | FromDiscord | <Elegantbeef> Well it's decayed to a Nimnode so requires the compiler to return the type |
00:13:22 | FromDiscord | <Elegantbeef> For other types you annotate it with `static` but that doesnt work for typedesc is seems as it's a complicated generic |
00:27:45 | FromDiscord | <Professor Actual Factual> sent a code paste, see https://play.nim-lang.org/#ix=3Ahf |
00:28:35 | FromDiscord | <Elegantbeef> Wish i could tell you |
00:31:53 | hexology | should i be using ref types "by default"? e.g. for little scripts like mine that just do some quick computaions and then quit |
00:37:35 | FromDiscord | <Elegantbeef> You should use ref when you need reference semantics |
00:37:45 | FromDiscord | <Elegantbeef> People have weird views of ref vs value |
00:37:46 | FromDiscord | <Professor Actual Factual> sent a long message, see http://ix.io/3Ahj |
00:38:15 | FromDiscord | <Elegantbeef> Here are reasons to consider them https://forum.nim-lang.org/t/8426#54529 |
00:40:35 | hexology | ah, interesting. nim has move semantics |
00:41:26 | hexology | or, will have them? |
00:41:33 | FromDiscord | <Elegantbeef> It has them |
00:41:38 | FromDiscord | <Elegantbeef> Though they make more sense with arc/orc |
00:41:42 | FromDiscord | <impbox [ftsf]> @ElegantBeef really nice writeup! should include that in the manual =) |
00:43:16 | FromDiscord | <Elegantbeef> Well i should fill in the `any other traits i missed` and make it more authorative |
00:43:42 | FromDiscord | <Elegantbeef> But yea a concise reason to consider ref vs non would be nice |
00:44:27 | hexology | seems like ref-less is a good default. immutability is good |
00:44:36 | hexology | what's this stuff i'm seeing about arc/orc and multiple gc versions? |
00:44:54 | hexology | i found this... will read https://nim-lang.org/blog/2020/10/15/introduction-to-arc-orc-in-nim.html |
00:46:36 | FromDiscord | <Elegantbeef> Arc/orc are new memory management methods and in araqs words "the only way to manage memory" đ |
00:49:26 | FromDiscord | <cabboose> But I have Alzheimerâs |
00:50:51 | * | Guest18 joined #nim |
00:54:03 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzzâŠ) |
00:54:19 | FromDiscord | <Professor Actual Factual> ARC is more experimental then ORC. I've tried ORC a while back and it was amazing. Anywhere between 1-3x on memory heavy workloads |
00:54:37 | FromDiscord | <Professor Actual Factual> (edit) "is" => "and ORC are" | "then ORC." => "than traditional GC." |
00:55:03 | FromDiscord | <Professor Actual Factual> (edit) "ARC and ORC are more experimental than traditional GC. I've tried ORC a while back and it was amazing. Anywhere between 1-3x ... on" added "performance" |
00:55:24 | FromDiscord | <Elegantbeef> Yea they work lovely + enable cooler features |
00:56:08 | FromDiscord | <Elegantbeef> Now have copy, sink, destroy, and trace hooks |
01:12:30 | FromDiscord | <cabboose> Yeah I have definitely destroyed my memory |
01:32:31 | FromDiscord | <Rika> In reply to @Professor Actual Factual "Probably opinionated question. I've": Second scenario would still fit object |
01:38:16 | FromDiscord | <Professor Actual Factual> In reply to @Rika "Second scenario would still": Can you further elaborate? I've done some naive benchmarks back in the day with simulations of 1M+ objects vs ref objects. The ref objects gave me 2x performance. Am I missing something? |
01:39:07 | FromDiscord | <Professor Actual Factual> (edit) "objects." => "objects with lots of many-to-many relationships." |
01:44:21 | FromDiscord | <impbox [ftsf]> slow copies? |
01:44:42 | FromDiscord | <impbox [ftsf]> if you have large objects |
01:44:52 | FromDiscord | <impbox [ftsf]> and you're passing by value |
01:45:39 | FromDiscord | <Professor Actual Factual> Ya I think that was the case, I was dealing with a history array which was an array of objects. When i changed it to ref objects I got the speed up. The objects were pretty large (lots of string fields too). |
01:46:03 | FromDiscord | <Professor Actual Factual> (edit) "objects." => "objects that changed per iteration/cycle." |
02:12:06 | * | arkurious quit (Quit: Leaving) |
02:15:51 | hexology | https://play.nim-lang.org/#ix=3Ahy is there a better way to do this? the goal is to have some kind of type-level guarantee about what kinds of exceptions are used within the application. |
02:16:22 | hexology | could you generate all these overloaded proc definitions with a macro? |
02:16:28 | hexology | or is there just some other way to do this |
02:28:32 | FromDiscord | <Elegantbeef> You could of course, not that it's overly suggested |
02:29:18 | hexology | this one checks at runtime, but involves this other ugly exception type and the risk of the user seeing it: https://play.nim-lang.org/#ix=3AhC |
02:29:47 | FromDiscord | <Elegantbeef> You do know defects are special right? |
02:30:07 | hexology | i was under the impression that they were "things that shouldn't ever happen" |
02:30:12 | FromDiscord | <Elegantbeef> They're not to be caught and if they're raised the program should be ended |
02:30:23 | FromDiscord | <Elegantbeef> Yes they are, just making sure you knew that |
02:30:45 | hexology | yeah, in this case it means "the programmer tried to use an unsupported exception, go file a bug report" |
02:31:17 | hexology | and this one which just has an assertion, equally nasty imo: https://play.nim-lang.org/#ix=3AhE |
02:31:19 | FromDiscord | <Elegantbeef> You might be able just do https://play.nim-lang.org/#ix=3AhF |
02:32:05 | FromDiscord | <Elegantbeef> Oh sorry those second two should be `ref object of CliUsageError` |
02:34:14 | NimEventer | New Nimble package! selenimum - WebDriver for Selenium(selenium-hub)., see https://github.com/myamyu/selenimum |
02:34:17 | nrds | <R2D299> itHub: 7"WebDriver for Selenium(selenium-hub) by Nim." |
02:34:19 | hexology | oh dear, did the playground go down? |
02:34:34 | hexology | @Elegantbeef i could also make them all inherit from some base type, right? |
02:35:06 | FromDiscord | <Elegantbeef> Yea that's what that link was https://hatebin.com/nsieohqruk |
02:35:48 | hexology | and why are the `ref`s important here? i saw in your post that you said tagged unions were the equivalent for non-ref types. got a link to read about those in nim? i couldn't find it in the manual |
02:36:01 | hexology | the ref just allows you to inherit? |
02:36:25 | FromDiscord | <Elegantbeef> Well it's no different since you exceptions are raised references |
02:36:35 | FromDiscord | <Elegantbeef> But yea ref is typically used for normal OOp |
02:36:49 | FromDiscord | <Elegantbeef> In Nim tagged unions are called object variants https://nim-lang.org/docs/manual.html#types-object-variants |
02:37:04 | FromDiscord | <Elegantbeef> I dumbly move between speech since i talk a bit to people that write other system langauges |
02:38:35 | hexology | ah, so you can't really make a "tagged union" of Exceptions then? |
02:39:01 | hexology | at least, it wouldn't be any more type-safe than the if/else, it just allows you to use `case` |
02:39:37 | FromDiscord | <Elegantbeef> Indeed |
02:40:12 | FromDiscord | <Elegantbeef> The benefit is mostly not having a pointer, you still of course need to delimit logic for specific casees |
02:45:39 | FromDiscord | <Elegantbeef> Doesnt work for user extended types though |
02:56:46 | hexology | makes sense |
03:33:50 | * | clemens3 quit (Ping timeout: 246 seconds) |
03:34:22 | NimEventer | New thread by Rb3: Advice needed on exporting symbols from DLL, see https://forum.nim-lang.org/t/8468 |
03:35:42 | * | clemens3 joined #nim |
03:39:43 | hexology | https://bpa.st/2D5A what am i doing wrong here? i was following this: https://nim-lang.org/docs/tut2.html#exceptions-raise-statement |
03:40:56 | FromDiscord | <Elegantbeef> What's `InvalidInputFormatError` type definition? |
03:41:34 | FromDiscord | <Elegantbeef> Oh it might be the strformat try `"Unknown input format: " & $key` |
03:46:13 | hexology | wasn't the strformat. here it is again w/ the types: https://bpa.st/RXZQ |
03:46:38 | hexology | i was attempting to follow the example you gave me |
03:48:51 | FromDiscord | <Elegantbeef> Seems it's the ref, i havent used exceptions much so my bad |
03:50:03 | hexology | aha, removing that fixed it |
04:06:01 | * | supakeen quit (Quit: WeeChat 3.3) |
04:06:30 | * | supakeen joined #nim |
04:38:22 | FromDiscord | <cabboose> Beef doesnât believe in exceptions |
04:38:34 | FromDiscord | <cabboose> You canât have errors if you donât code them in |
04:38:36 | FromDiscord | <Elegantbeef> Indeed |
04:38:55 | FromDiscord | <Elegantbeef> Alternatively my software never gets to the point it needs to worry about errors |
04:39:20 | FromDiscord | <cabboose> itâs hard to get past writing the file name sometimes yeah |
04:39:32 | FromDiscord | <Elegantbeef> Fuck you get the file name, i dont even open up my text editor |
04:39:57 | FromDiscord | <cabboose> At least you have a computer |
04:40:10 | FromDiscord | <cabboose> Pen and paper coding sucks |
04:40:10 | FromDiscord | <Elegantbeef> My text editor is a literal notebook |
04:40:53 | FromDiscord | <cabboose> The paper I use is made from the loose hair on my head |
04:45:32 | * | rockcavera quit (Remote host closed the connection) |
05:14:55 | FromDiscord | <cabboose> Man I canât even sign up to the forum |
05:14:57 | FromDiscord | <cabboose> what is this |
05:15:42 | FromDiscord | <cabboose> How am I supposed to advertise my steamin turd library if I canât get to the forum |
05:33:25 | FromDiscord | <NullCode> lmao |
05:33:29 | FromDiscord | <NullCode> whats this library |
05:38:08 | FromDiscord | <cabboose> well now hold on |
05:38:15 | FromDiscord | <cabboose> are you going to do some malware trickery with it |
05:38:32 | FromDiscord | <cabboose> đ€Ł |
05:39:03 | FromDiscord | <Elegantbeef> Remember they're not a malware author they just have malware on the github |
05:39:44 | FromDiscord | <NullCode> he fyi |
05:39:57 | FromDiscord | <NullCode> In reply to @cabboose "are you going to": idek what sort of lib it is |
05:40:49 | FromDiscord | <NullCode> In reply to @Elegantbeef "Remember they're not a": yeah someone else made them |
05:40:54 | FromDiscord | <NullCode> and I'm storing them on github |
05:41:13 | FromDiscord | <Elegantbeef> No one is going to believe that |
05:41:35 | FromDiscord | <NullCode> why not |
05:45:32 | FromDiscord | <cabboose> SoCiOpAtHy101 |
05:45:46 | FromDiscord | <cabboose> instead of trying to resist evidence |
05:46:02 | FromDiscord | <cabboose> use a more relatable reason that is innocent of the connotation |
05:46:04 | FromDiscord | <cabboose> like |
05:46:05 | FromDiscord | <cabboose> yessir |
05:46:21 | FromDiscord | <cabboose> I am a white hat malware dev for security company bla |
05:46:22 | FromDiscord | <cabboose> I mean |
05:46:48 | FromDiscord | <cabboose> that sells better than having malware on your github and trying to say its not yours or you dont use it \>.\> |
05:47:31 | FromDiscord | <cabboose> either way its just an innocent MPMC lock & leak free queue |
05:47:55 | FromDiscord | <cabboose> https://github.com/nim-works/loony |
05:47:58 | nrds | <R2D299> itHub: 7"Experimenting to make a high throughput MPMC lock-free queue based on a paper by Giersch, Nolte et al." |
05:53:27 | FromDiscord | <NullCode> nice i didn't understand a single thing |
05:53:51 | FromDiscord | <NullCode> well i did start coding this year |
05:54:04 | FromDiscord | <NullCode> so not up-to-snuff about everything |
05:56:35 | FromDiscord | <Rika> Many âmalware devsâ are just script kiddies though |
05:56:43 | * | Guest18 quit (Ping timeout: 256 seconds) |
05:58:05 | FromDiscord | <NullCode> yes |
05:58:16 | FromDiscord | <NullCode> which is why i want to make sure nobody calls me a script kiddie |
05:58:44 | FromDiscord | <impbox [ftsf]> maybe don't post your age then ;) |
05:59:00 | FromDiscord | <NullCode> a script kiddie is defined by the usage of uhh |
05:59:03 | FromDiscord | <NullCode> whats that thing called |
05:59:05 | FromDiscord | <NullCode> metasploit |
05:59:06 | FromDiscord | <NullCode> and stuff |
05:59:09 | FromDiscord | <NullCode> not by your age ;) |
06:00:09 | * | vicfred quit (Quit: Leaving) |
06:00:49 | FromDiscord | <NullCode> even a 10 year old could be a real haxor |
06:01:23 | FromDiscord | <impbox [ftsf]> for sure, i'm joking, age has nothing to do with anything |
06:01:31 | FromDiscord | <NullCode> yes |
06:01:33 | FromDiscord | <impbox [ftsf]> though it does colour people's expectations |
06:01:51 | FromDiscord | <NullCode> meh |
06:01:57 | FromDiscord | <NullCode> my parents have 0 expectations from me |
06:02:03 | FromDiscord | <NullCode> i don't expect anybody else to have any |
06:02:10 | FromDiscord | <impbox [ftsf]> ahh i mean more in terms of getting work in the industry |
06:02:14 | FromDiscord | <impbox [ftsf]> if that is your goal |
06:02:21 | FromDiscord | <NullCode> oh |
06:02:30 | FromDiscord | <NullCode> i thought if you had good code in github |
06:02:39 | FromDiscord | <NullCode> you could get work easier? |
06:02:54 | FromDiscord | <Elegantbeef> impbox dont say experience in the industry when they have malware on the github! |
06:03:08 | FromDiscord | <NullCode> once again, he |
06:03:34 | FromDiscord | <NullCode> and yeah i know most of you are adults and stuff |
06:03:37 | FromDiscord | <impbox [ftsf]> yeah, but maybe don't lead with your age if you don't want to be considered a "script kiddy" |
06:03:47 | FromDiscord | <NullCode> but that doesn't mean i can't get to code until I'm 20 or stuff |
06:03:47 | FromDiscord | <Elegantbeef> Luckily `they` is completely gender neutral |
06:04:23 | FromDiscord | <NullCode> In reply to @impbox "yeah, but maybe don't": well if anyone wants to call me a script kiddie, thats where my github comes in |
06:04:39 | FromDiscord | <NullCode> i can show i don't use bullshit like metasploit and airgeddon |
06:04:41 | FromDiscord | <NullCode> etc et |
06:04:43 | FromDiscord | <impbox [ftsf]> i've been coding since i was a kid too, so totally agree, but sometimes it's best to keep that info hidden, let people find out later |
06:04:43 | FromDiscord | <NullCode> (edit) "et" => "etc" |
06:04:54 | FromDiscord | <impbox [ftsf]> if at all |
06:05:31 | FromDiscord | <Elegantbeef> Yea like impbox knows i'm a terrible programmer thanks to the myriad of bad PR's he's' accepted \:D |
06:05:37 | FromDiscord | <NullCode> In reply to @impbox "i've been coding since": i see good idea |
06:05:46 | FromDiscord | <impbox [ftsf]> @ElegantBeef they ;) |
06:06:02 | FromDiscord | <Elegantbeef> I'll fucking break they's legs |
06:06:34 | FromDiscord | <NullCode> LMFAO |
06:06:40 | FromDiscord | <NullCode> now i see why beef uses they |
06:07:11 | FromDiscord | <NullCode> anyway i do want to make legitimate programs |
06:07:15 | FromDiscord | <Elegantbeef> It's a gender neutral pronoun that's easy to avoid people raging about incorrect usage |
06:07:19 | FromDiscord | <NullCode> but i just have 0 ideas |
06:07:30 | FromDiscord | <NullCode> and since I've been watching danoct for YEARS |
06:07:37 | FromDiscord | <NullCode> i just thought why not make some fun stuff |
06:08:34 | FromDiscord | <NullCode> (edit) "YEARS" => "YEARSâ”â”(context: dan used to review old old malware https://www.youtube.com/c/danooct1)" |
06:09:01 | FromDiscord | <NullCode> (edit) "used to review old old" => "reviews" | "https://www.youtube.com/c/danooct1)" => "from the DOS days â”https://www.youtube.com/c/danooct1)" |
06:09:23 | FromDiscord | <NullCode> In reply to @Elegantbeef "It's a gender neutral": people who fuss about gender are plain stupid |
06:09:57 | FromDiscord | <Elegantbeef> Says the person that corrected 'they' twice |
06:10:14 | FromDiscord | <impbox [ftsf]> a bit #offtopic but using people's preferred pronouns or they is polite |
06:11:12 | FromDiscord | <Elegantbeef> Anywho there is tons of software that isnt malicious you can make, so try to not aid in the software i'd not mind to get nuked from orbit |
06:11:35 | FromDiscord | <NullCode> In reply to @Elegantbeef "*Says the person that": no i mean like "HOW DARE YOU ASSUME MY GENDER, I'M A QUEER TRANS BI 60 420" |
06:11:41 | FromDiscord | <NullCode> (edit) "60" => "69" |
06:11:50 | FromDiscord | <NullCode> i just politely told I'm a guy |
06:11:54 | FromDiscord | <NullCode> so it's alright in my books |
06:12:12 | FromDiscord | <NullCode> In reply to @Elegantbeef "Anywho there is tons": can you give some examples tho |
06:12:18 | FromDiscord | <Elegantbeef> Itch.io for instance is flooded with malware similar to what you created and it makes it harder to trust the platform/downloads from there |
06:12:36 | FromDiscord | <impbox [ftsf]> use code to solve problems you have |
06:12:45 | FromDiscord | <impbox [ftsf]> or problems other people have |
06:12:56 | FromDiscord | <impbox [ftsf]> make pretty things |
06:12:57 | FromDiscord | <Elegantbeef> No the problem cannot be "i want that guy's password" |
06:13:01 | FromDiscord | <impbox [ftsf]> make fun things |
06:13:22 | FromDiscord | <Elegantbeef> Easy for us to say impbox being game focused developers đ |
06:13:34 | FromDiscord | <impbox [ftsf]> ehh i make all sorts of things, not just games =) |
06:13:44 | FromDiscord | <NullCode> In reply to @impbox "use code to solve": i think I've already done that |
06:13:54 | FromDiscord | <NullCode> automated basically anything possible with ahk |
06:13:58 | FromDiscord | <Elegantbeef> I said game focused đ |
06:14:18 | FromDiscord | <Elegantbeef> I'd say the compiler isnt a game, but it's pretty much a weird version of whack a mole |
06:14:18 | FromDiscord | <NullCode> In reply to @impbox "make pretty things": argh i can't make GUIs |
06:14:27 | FromDiscord | <impbox [ftsf]> don't need guis |
06:14:34 | FromDiscord | <NullCode> thats just the one thing I'd love to do |
06:14:35 | FromDiscord | <NullCode> but can't |
06:14:36 | FromDiscord | <NullCode> GUis |
06:14:46 | FromDiscord | <NullCode> just don't fit in my head very well |
06:14:50 | FromDiscord | <NullCode> (edit) "GUis" => "GUIs" |
06:14:59 | FromDiscord | <impbox [ftsf]> dear imgui is great, i hate doing GUIs but it makes it a pleasure |
06:15:22 | FromDiscord | <impbox [ftsf]> made a cool music visualiser + trippy visual creator |
06:15:27 | FromDiscord | <Elegantbeef> Though not overly great for a proper desktop application, but for tooling works well |
06:15:43 | FromDiscord | <NullCode> whats a good one for "proper desktop applications" |
06:15:48 | FromDiscord | <NullCode> cuz thats the thing i want to do |
06:16:06 | FromDiscord | <impbox [ftsf]> win32 api |
06:16:09 | FromDiscord | <Elegantbeef> Gtk, Qml, Nigui |
06:16:33 | FromDiscord | <NullCode> In reply to @impbox "win32 api": what |
06:16:47 | FromDiscord | <NullCode> you mean creating msgboxes with vbscript? :P |
06:17:12 | FromDiscord | <Rika> Challenge: game in pure NimScript |
06:17:46 | FromDiscord | <Elegantbeef> Rika making challenges that are only difficult on a compiler without libcffi |
06:17:49 | FromDiscord | <impbox [ftsf]> yeah, don't actually use win32 api |
06:19:29 | FromDiscord | <NullCode> https://media.discordapp.net/attachments/371759389889003532/892656807766532106/unknown.png |
06:19:36 | FromDiscord | <NullCode> oh also whats this weird font i get when running nim stuff |
06:19:39 | FromDiscord | <NullCode> can't i change it |
06:20:20 | FromDiscord | <Elegantbeef> Not a clue might just be a setting on the terminal output |
06:21:33 | FromDiscord | <cabboose> nimqml |
06:22:08 | FromDiscord | <cabboose> although I am a fan of qt shit anyway |
06:22:14 | FromDiscord | <cabboose> but their qml stuff is good |
06:22:20 | FromDiscord | <NullCode> ohhhhhhh it's the TrueType font |
06:22:48 | FromDiscord | <Elegantbeef> But cabboose i dont have qt themed so it's blindingly white đ |
06:23:07 | FromDiscord | <NullCode> In reply to @cabboose "although I am a": only thing i like about qt is qt-designer |
06:23:35 | FromDiscord | <cabboose> youâre mad beef |
06:23:44 | FromDiscord | <cabboose> thats qt widgets |
06:23:46 | FromDiscord | <impbox [ftsf]> no they're elegant |
06:23:47 | FromDiscord | <Rika> Took you a while to realise |
06:23:51 | FromDiscord | <cabboose> you bonk |
06:24:01 | FromDiscord | <cabboose> i said qml |
06:24:09 | FromDiscord | <NullCode> In reply to @cabboose "thats qt widgets": what |
06:24:21 | FromDiscord | <NullCode> ok i see now |
06:24:22 | FromDiscord | <cabboose> qt widgets uses QtDesigner |
06:24:24 | FromDiscord | <cabboose> qml uses Designer Studio |
06:24:33 | FromDiscord | <impbox [ftsf]> is QT still c++? |
06:24:40 | FromDiscord | <cabboose> ye |
06:24:44 | FromDiscord | <impbox [ftsf]> i remember that made it a real pain to bind |
06:24:59 | FromDiscord | <cabboose> there are working bindings for qml engine |
06:25:11 | FromDiscord | <cabboose> and hax is doing qt when hcparse is up and running |
06:25:31 | FromDiscord | <cabboose> I mean the front end can all be done in qml and backend in nim pretty easily |
06:26:07 | FromDiscord | <cabboose> and qml has a good designer to back it up |
06:26:10 | FromDiscord | <cabboose> the biggest issue is just licensing |
06:26:46 | FromDiscord | <cabboose> Time to go back to the library to try cram another 10 lectures |
06:26:48 | FromDiscord | <cabboose> \~yay\~ |
06:31:34 | * | kayabaNerve joined #nim |
07:01:26 | * | Vladar joined #nim |
07:01:36 | * | max22- joined #nim |
07:07:40 | * | NimEventer quit (Remote host closed the connection) |
07:07:48 | * | NimEventer joined #nim |
07:27:01 | NimEventer | New thread by DPixie: Errors in VM code called from Nimscript is hidden, see https://forum.nim-lang.org/t/8469 |
07:39:14 | * | PMunch joined #nim |
08:22:25 | * | Terry[m] quit (Quit: Bridge terminating on SIGTERM) |
08:22:28 | * | happycorsair[m] quit (Quit: Bridge terminating on SIGTERM) |
08:22:28 | * | nixfreak_nim[m] quit (Quit: Bridge terminating on SIGTERM) |
08:25:49 | FromDiscord | <dom96> In reply to @impbox "a bit <#371759607934353448> but": this++ |
08:25:58 | * | nixfreak_nim[m] joined #nim |
08:29:20 | * | ozzz quit (Ping timeout: 265 seconds) |
08:41:18 | * | happycorsair[m] joined #nim |
08:41:30 | * | Terry[m] joined #nim |
09:29:27 | * | ozzz joined #nim |
10:17:18 | * | jjido joined #nim |
10:31:30 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzzâŠ) |
10:52:05 | FromDiscord | <enthus1ast> when i have a header only lib, do i have other options than ` {.emit: "#include <" & getProjectPath() / "tinyjpeg.h" & ">".}` |
10:52:19 | FromDiscord | <enthus1ast> (which does not work correctly btw) |
10:53:09 | FromDiscord | <enthus1ast> the issue then is that the c files where move to the cache location and the relative include does not find it any more |
10:53:35 | FromDiscord | <haxscramper> your other option is to properly use `header` |
10:53:44 | FromDiscord | <enthus1ast> but this can only be bound to an object |
10:53:45 | FromDiscord | <haxscramper> `header: absolute-or-relative-path` |
10:53:52 | FromDiscord | <haxscramper> no |
10:53:58 | FromDiscord | <haxscramper> this can be bound to anything |
10:54:12 | FromDiscord | <enthus1ast> but not on module scope |
10:54:19 | FromDiscord | <enthus1ast> at least it did not work for me |
10:54:30 | FromDiscord | <haxscramper> what module scope is even? |
10:54:30 | FromDiscord | <haxscramper> there are types and procs |
10:54:36 | FromDiscord | <haxscramper> you need to import what? proc? |
10:54:44 | FromDiscord | <haxscramper> then put `header:` on proc definition |
10:55:41 | FromDiscord | <enthus1ast> this i can try |
10:56:05 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=3Ajd |
10:56:20 | FromDiscord | <haxscramper> you didn't mention you also need `#define` |
10:56:28 | FromDiscord | <haxscramper> and NO |
10:56:32 | FromDiscord | <haxscramper> you put header on proc |
10:56:37 | FromDiscord | <haxscramper> not on module scope |
10:56:39 | FromDiscord | <enthus1ast> yeah this is the reason i emitted include |
10:56:47 | FromDiscord | <haxscramper> you put `header` on the thing you want to import |
10:58:27 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3Ajf |
10:58:57 | FromDiscord | <haxscramper> You can put anything in `header` text, it does not have to be a file only |
10:59:10 | FromDiscord | <haxscramper> you can put any random garbage and it would be pasted in the generated headers as-si |
10:59:17 | FromDiscord | <haxscramper> `<file>` and `"file"` just get special treatment |
10:59:24 | FromDiscord | <enthus1ast> just once or several time? |
10:59:30 | FromDiscord | <haxscramper> should do it once |
10:59:36 | PMunch | You could copy tinyjpeg into the cache directory |
10:59:41 | FromDiscord | <haxscramper> buy you can `#ifdef` around it if it does so multiple times |
10:59:43 | PMunch | Wait |
11:00:01 | PMunch | You need to do `#include ""` and not `#include <>` right? |
11:00:10 | FromDiscord | <haxscramper> this would require copying into cache directory of every buildâ”(<@709044657232936960_=50=4dunch=5b=49=52=43=5d>) |
11:00:12 | FromDiscord | <haxscramper> al |
11:00:19 | PMunch | Otherwise it searches the compiler search path.. |
11:00:20 | FromDiscord | <haxscramper> also you can do it really proeprly |
11:00:20 | FromDiscord | <enthus1ast> then afaik its easier to just have a import emit on top of the module |
11:00:25 | FromDiscord | <haxscramper> and just use default compiler features |
11:00:26 | FromDiscord | <haxscramper> such as |
11:00:38 | FromDiscord | <haxscramper> `{.passc: "-I<dir>".}` |
11:00:48 | FromDiscord | <haxscramper> And C compiler would search the headers when compiling |
11:00:53 | FromDiscord | <haxscramper> at least this is the best approach IMO |
11:00:57 | FromDiscord | <haxscramper> for this specific issue |
11:00:58 | FromDiscord | <enthus1ast> yes |
11:01:21 | FromDiscord | <haxscramper> you still need to do `header: "zzzzz.h"` of course |
11:01:39 | FromDiscord | <haxscramper> If you want to save yourself some typing you can `{.push.}` the header |
11:01:42 | PMunch | Yeah just `#include "tinyjpeg.h"` and `"-I" & getProjectPath()` should work |
11:02:04 | FromDiscord | <haxscramper> there is a `getProjectPath()`? |
11:02:05 | FromDiscord | <haxscramper> TIL |
11:02:15 | FromDiscord | <enthus1ast> yeah in macros |
11:02:17 | FromDiscord | <enthus1ast> BUT |
11:02:27 | FromDiscord | <enthus1ast> this uses the current module |
11:02:29 | FromDiscord | <haxscramper> no, the project path is incorrect from what i understand |
11:02:48 | FromDiscord | <haxscramper> it uses thing I started compilation with, not relative to the current source |
11:02:57 | FromDiscord | <enthus1ast> yes exactly |
11:03:07 | FromDiscord | <haxscramper> so I can't reliably predict where getProjectPath() would be |
11:03:20 | FromDiscord | <haxscramper> IMO there should be a currentSourceDir() in addition to source path |
11:04:07 | PMunch | I mean there is https://nim-lang.org/docs/system.html#currentSourcePath.t |
11:04:37 | FromDiscord | <haxscramper> source DIR |
11:04:48 | PMunch | currentSourcePath.parentDir |
11:04:50 | PMunch | There |
11:04:59 | FromDiscord | <haxscramper> `import std/os` |
11:05:02 | FromDiscord | <haxscramper> forgot this |
11:08:39 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=3Ajk |
11:09:00 | FromDiscord | <haxscramper> ... |
11:09:05 | FromDiscord | <haxscramper> well, okay, if it works then it works |
11:09:28 | FromDiscord | <enthus1ast> why do you think should it not work? |
11:10:11 | FromDiscord | <haxscramper> no, this is like the most hacky solution of all ones presented |
11:10:41 | FromDiscord | <haxscramper> and does this work when you import things? |
11:10:48 | FromDiscord | <haxscramper> because some proc might be required in multiple modules |
11:11:02 | FromDiscord | <haxscramper> `emit` has a property of failing for multi-file projects as well |
11:11:20 | FromDiscord | <enthus1ast> mh i see |
11:11:24 | FromDiscord | <haxscramper> because there might be call somehwere else, but codegen does only one emit, so other calls are broken |
11:11:44 | FromDiscord | <enthus1ast> then prolly i must do #ifdef cage |
11:12:07 | FromDiscord | <enthus1ast> this and pasl |
11:12:08 | FromDiscord | <haxscramper> there is already one in header, at least if it is written properly |
11:12:09 | FromDiscord | <haxscramper> so no need to |
11:12:10 | FromDiscord | <enthus1ast> or passc |
11:12:52 | FromDiscord | <haxscramper> passc does not work properly if you need to define, so the best approach given requiremenets would be to hack around with `const headerText = ` which includes `#define` and `#include` |
11:39:01 | FromDiscord | <fae> messing around a little bit more with trying to make a pure wasm Nim playground, based on this https://github.com/binji/wasm-clang |
11:39:03 | nrds | <R2D299> itHub: 7"Running Clang/LLD in WebAssembly Demo" |
11:39:33 | FromDiscord | <fae> I was able to take a compiled hello world, get the `stdlib_system.c` and `stdlib_io.c` compiled in the browser and all linked |
11:39:42 | FromDiscord | <fae> https://media.discordapp.net/attachments/371759389889003532/892737390647607336/Screen_Shot_2021-09-29_at_4.37.18_AM.png |
11:40:32 | FromDiscord | <fae> (edit) "take" => "compile" | removed "compiled" | "world," => "world in Nim to c," |
11:41:58 | FromDiscord | <fae> had to hack a few things out and im sure there is plenty broken if I were to try a slightly more complex example, but kind of excited that i got this working considering I have not much idea what i'm really doing lol |
11:42:25 | FromDiscord | <fae> now back to trying to get the Nim compiler running in the browser |
11:42:36 | * | stkrdknmibalz quit (Quit: WeeChat 3.0.1) |
11:45:18 | FromDiscord | <haxscramper> In reply to @fae "now back to trying": https://github.com/haxscramper/hack/tree/4b3672348cef91bb8e9441d29c127e73be5d4b69/testing/c/wasm/niminterop this builds nim parser and runs it in browser via wasm |
11:47:56 | FromDiscord | <fae> In reply to @haxscramper "https://github.com/haxscramper/hack/tree/4b3672348c": Thanks, I'll look at this for reference. It's been a few days since I last worked on this, but I had gotten the nim compiler compiled to wasm and running in the browser, but didn't get much further than that |
11:48:42 | FromDiscord | <haxscramper> also this is a simplified example of the full compilation pipeline https://github.com/haxscramper/hack/blob/master/testing/nim/compilerapi/test11/full_compilation_pipeline.nim |
11:48:43 | FromDiscord | <fae> Like I couldn't get any files parsing, much less compiling to c output |
11:48:47 | FromDiscord | <haxscramper> from `.nim` to `.c` |
11:49:09 | FromDiscord | <haxscramper> you can try to use `.tcc` library, there is a `--lean-compiler` option or something similar in koch |
11:49:17 | FromDiscord | <haxscramper> when it builds |
11:49:32 | FromDiscord | <haxscramper> but generally I didn't go any further than parsing |
11:49:33 | FromDiscord | <haxscramper> And I don't even know whether my earlier example still works |
11:50:26 | FromDiscord | <fae> Do you actually think this whole pipeline is a viable approach? i.e. putting both nim and clang in the browser and having the full pipeline. I thought about just doing nim -> js but this seems cooler. |
11:51:30 | FromDiscord | <fae> one thing i'd like to do is enable pulling nimble packages in the playground |
11:51:56 | ehmry | fae: is there ever a reason to run a compiler in a browser? |
11:52:08 | FromDiscord | <haxscramper> the eaiest one would be to run nim vm |
11:52:13 | FromDiscord | <haxscramper> it does not require anything else |
11:52:16 | FromDiscord | <haxscramper> and it is fairly capable |
11:52:25 | FromDiscord | <haxscramper> so you just run nim compiler |
11:52:33 | FromDiscord | <haxscramper> I have an example for it as well, let me see |
11:53:26 | FromDiscord | <fae> In reply to @ehmry "fae: is there ever": fun, idk |
11:54:13 | FromDiscord | <haxscramper> https://github.com/haxscramper/hack/blob/4b3672348cef91bb8e9441d29c127e73be5d4b69/testing/nim/compilerapi/test6.nim#L78 |
11:54:15 | FromDiscord | <haxscramper> okay |
11:54:23 | FromDiscord | <haxscramper> again, no promises about it working |
11:54:32 | FromDiscord | <haxscramper> but thisis a REPL turned inside out |
11:54:48 | FromDiscord | <haxscramper> so I can feed it using queue of lines, I was testing something like |
11:54:58 | FromDiscord | <haxscramper> "can VM handle failures in input" |
11:55:11 | FromDiscord | <haxscramper> test 6 or test 8 might have something else |
11:55:29 | FromDiscord | <fae> nice I'll have a look through these tomorrow, sleep time for now |
11:55:32 | FromDiscord | <haxscramper> but honestly this is a huge pile of garbage, sorry i didn't try to keep these examples really |
11:55:39 | FromDiscord | <haxscramper> good for examples |
11:55:53 | FromDiscord | <haxscramper> So if you have any question you can ping me sometimes later, right now I got to go |
11:58:40 | FromDiscord | <xflywind> https://github.com/slangmgh/nims |
11:58:42 | nrds | <R2D299> itHub: 7"simple nim repl" |
11:58:52 | FromDiscord | <xflywind> Maybe also play with libffi |
12:00:44 | * | max22- quit (Ping timeout: 268 seconds) |
12:06:01 | * | supakeen quit (Quit: WeeChat 3.3) |
12:06:30 | * | supakeen joined #nim |
12:12:07 | FromDiscord | <DMisener> !eval 1+2 |
12:12:08 | NimBot | Compile failed: /usercode/in.nim(1, 2) Error: expression '3' is of type 'int literal(3)' and has to be used (or discarded) |
12:13:03 | FromDiscord | <DMisener> !help |
12:13:41 | FromDiscord | <DMisener> !eval echo 1+2 |
12:13:43 | NimBot | 3 |
12:25:36 | PMunch | @DMisener, the eval command just runs your code with the Nim playground and copies one line of output here |
12:28:35 | FromDiscord | <Yardanico> not one line though :P |
12:28:54 | FromDiscord | <Yardanico> !eval for x in ..10: echo x |
12:28:56 | NimBot | 0â”1â”2â”3â”4â”5â”6â”7â”8â”9â”10 |
12:32:08 | PMunch | Ah okay, it only spits out one line though |
12:36:04 | PMunch | Hmm, anyone got a parser for some simple C statements? I guess I could rip something out of c2nim.. |
12:41:10 | * | arkurious joined #nim |
12:42:32 | PMunch | Essentially I want to parse things like `(1 << 2)` and `0x07U` |
12:59:02 | * | Vladar quit (Remote host closed the connection) |
13:01:00 | * | Vladar joined #nim |
13:02:28 | FromDiscord | <haxscramper> fixing enums? |
13:02:50 | FromDiscord | <haxscramper> for futhark |
13:05:22 | PMunch | Nah, macros |
13:05:42 | PMunch | clang already handles enums just fine |
13:06:28 | PMunch | But macros by their very nature can't be described the same way. Since they're essentially text expansion in C it would be wrong to pre-compute the result |
13:07:40 | PMunch | #define FIVE 2+3 |
13:07:48 | FromDiscord | <haxscramper> well, then I don't think you can implement this using 'simple' parser. The best approach I've managed to comu with is |
13:07:51 | PMunch | printf("%d\n", FIVE * FIVE); |
13:07:55 | PMunch | Guess what that prints out |
13:08:00 | FromDiscord | <haxscramper> offs |
13:08:10 | FromDiscord | <haxscramper> I don't care about this bullshit honestly |
13:08:15 | FromDiscord | <haxscramper> and neither should you |
13:08:21 | FromDiscord | <haxscramper> how many libs there is that |
13:08:25 | FromDiscord | <haxscramper> (1) worht wrapping |
13:08:31 | FromDiscord | <haxscramper> (2) use dirty hacks like this? |
13:08:40 | FromDiscord | <haxscramper> this is hardly possible to replicate in nim anyway |
13:08:43 | * | Guest9380 joined #nim |
13:08:50 | PMunch | Oh yeah, I wouldn't want to have that behaviour in Nim |
13:09:09 | PMunch | I was just saying why clang won't give me the value of a macro but will give me the value of an enum |
13:09:23 | FromDiscord | <haxscramper> because it is not the same |
13:09:31 | FromDiscord | <haxscramper> enums are handled by sema |
13:09:44 | FromDiscord | <haxscramper> macros are handled by preprocessor callbacks that run two pipeline stages earlier |
13:10:00 | * | jjido joined #nim |
13:10:04 | Guest9380 | Hello everyone. I have a very naĂŻve question since I am very new to Nim. Did nim pass the array by value to a function (changes of the array within the function is invisible to the caller's scope)? |
13:10:05 | FromDiscord | <haxscramper> did you notice macro expansions are placed on top of the translation unit for example? |
13:10:12 | FromDiscord | <haxscramper> they are always on the toplevel |
13:10:24 | PMunch | There are a couple of ways of doing it. I can either A) try to parse them, which is fine for simple things like magic numbers and masks or B) output some kind of statement that equals the name of the macro and re-parse the file |
13:10:25 | FromDiscord | <Yardanico> @Guest9380 yes, because arrays are value types |
13:10:28 | FromDiscord | <haxscramper> `proc changesArray(arr: var array[3, int])`â”(<@709044657232936960_=47uest9380=5b=49=52=43=5d>) |
13:10:41 | Guest9380 | Thank you! |
13:10:42 | FromDiscord | <Yardanico> if you want to modify the values in the array in a function, you need to use the `var` modifier for the argument, like haxscramper showed above |
13:11:10 | Guest9380 | Great to know. |
13:11:16 | FromDiscord | <haxscramper> The best approach that I managed to come up with isâ”(<@709044657232936960_=50=4dunch=5b=49=52=43=5d>) |
13:11:22 | FromDiscord | <haxscramper> I take macro definition token sequence |
13:11:26 | PMunch | Guest9380, that's a truth with some modifications. Nim will probably pass it by reference simply because it's faster. But it won't allow you to modify it if you don't tag it as `var` |
13:12:05 | PMunch | But if you use `unsafeAddr` you might be able to modify the underlying array that was passed into your procedure. |
13:12:32 | FromDiscord | <haxscramper> and then i replace `<tok> ## <tok>` with specially constructed token names like `TOK_INDEX_1CONCATTOK_INDEX_2` |
13:12:36 | FromDiscord | <haxscramper> And then I reparse things backj |
13:12:57 | * | jjido quit (Client Quit) |
13:12:57 | FromDiscord | <haxscramper> but we have stilk have to operate under assumption that token body forms a valid C code |
13:13:00 | FromDiscord | <haxscramper> which is of course not the case |
13:13:22 | FromDiscord | <haxscramper> so I need to effectively emulate token expansion process, cutting out as soon as I can ensure that declaration is valid |
13:13:31 | PMunch | Yeah, currently I just try to parse the value of a macro as an int or a hex number and emit that.. |
13:13:36 | FromDiscord | <haxscramper> so one level of expansion might not be correct |
13:13:42 | FromDiscord | <haxscramper> but two levels of expansion might be correct |
13:13:53 | PMunch | That would probably cover 80% of usecases |
13:14:20 | PMunch | With identifiers and some simple math and bit shifting implemented I think it would be closer to 95% of all usecases |
13:15:18 | FromDiscord | <haxscramper> laughs in X11 apiâ”(<@709044657232936960_=50=4dunch=5b=49=52=43=5d>) |
13:15:40 | FromDiscord | <haxscramper> but constant defines are important |
13:15:58 | FromDiscord | <haxscramper> so might not be eighty percent, but still the best when it comes to effort/value |
13:18:14 | PMunch | X11 API? I wrapped that the other day with Futhark and wrote a small compositor thingy with it for my epaper display. Didn't have any issues with macros that didn't fall into those 80% |
13:19:27 | FromDiscord | <haxscramper> anyway, this is not really important, I might be confusing it with something else |
13:19:36 | FromDiscord | <haxscramper> but C preprocessor is still the |
13:19:37 | FromDiscord | <haxscramper> well |
13:19:39 | FromDiscord | <haxscramper> `const` |
13:19:45 | FromDiscord | <haxscramper> and `#define` |
13:20:01 | FromDiscord | <haxscramper> two horrors that will haunt nim interop for a long time |
13:20:27 | FromDiscord | <haxscramper> of course there are also `virtual`, `T...` and other things |
13:20:39 | FromDiscord | <haxscramper> but those are mostly about C++ |
13:21:48 | FromDiscord | <haxscramper> https://ink.library.smu.edu.sg/cgi/viewcontent.cgi?article=1494&context=sis_research http://mbeddr.com/files/tomassettiratiu-extractingvariabilityfromcandliftingittombeddr.pdf there should be something along those lines |
13:22:00 | FromDiscord | <haxscramper> For extracting semantic value from macros |
13:22:24 | FromDiscord | <haxscramper> but tree-sitter is the best implementation approximation for handling this |
13:22:41 | FromDiscord | <haxscramper> boost wave allows to hook into macro transformation process |
13:22:50 | FromDiscord | <haxscramper> so I can implement replay I was talking about |
13:24:31 | FromDiscord | <haxscramper> https://ruche-home.net/program/boost/wave#hooks-member-expanded-macro |
13:25:10 | FromDiscord | <haxscramper> https://www.boost.org/doc/libs/1_75_0/libs/wave/doc/class_reference_ctxpolicy.html#expanding_function_like_macro |
13:27:13 | FromDiscord | <haxscramper> if only C was a single language ... |
13:27:31 | FromDiscord | <haxscramper> This is literally this meme with "if X was ..." a |
13:28:34 | FromDiscord | <haxscramper> https://www.cs.cmu.edu/~ckaestne/pdf/tse17-refactoringifdef.pdf "Refactoring of Preprocessorâ”Directives in the #ifdef Hell" |
13:28:43 | FromDiscord | <haxscramper> Very telling names tbh |
13:30:11 | * | rockcavera joined #nim |
13:30:12 | * | rockcavera quit (Changing host) |
13:30:12 | * | rockcavera joined #nim |
13:58:57 | * | Guest9380 quit (Ping timeout: 256 seconds) |
13:59:35 | * | max22- joined #nim |
14:22:01 | PMunch | Okay, pushed something to Futhark that should allow it to wrap simple macros |
14:22:06 | PMunch | Totally untested.. |
14:22:12 | PMunch | And now I've gotta run |
14:22:12 | * | PMunch quit (Quit: Leaving) |
14:31:09 | * | tiorock joined #nim |
14:31:09 | * | tiorock quit (Changing host) |
14:31:09 | * | tiorock joined #nim |
14:31:09 | * | rockcavera is now known as Guest2225 |
14:31:10 | * | Guest2225 quit (Killed (sodium.libera.chat (Nickname regained by services))) |
14:31:10 | * | tiorock is now known as rockcavera |
15:04:01 | FromDiscord | <Yandong Zhang> Hello everyone. Would anyone recommend a format prettier for the Nim? |
15:04:44 | FromDiscord | <xflywind> nimpretty |
15:05:19 | FromDiscord | <Yandong Zhang> Thank you. I will try it. |
15:11:15 | nrds | <Prestige99> Hm just found morepretty, maybe I'll try that out |
15:11:19 | nrds | <Prestige99> https://github.com/treeform/morepretty |
15:11:20 | nrds | <R2D299> itHub: 7"Morepretty - like nimpretty but with more stuff." |
15:13:42 | FromDiscord | <xflywind> It seems to be an enhanced nimpretty using its own parser. |
15:16:30 | FromDiscord | <xflywind> Using compiler API may be more robust https://github.com/FedericoCeratto/nimfmt |
15:16:33 | nrds | <R2D299> itHub: 7"Nim code formatter / linter / style checker" |
15:17:15 | FromDiscord | <xflywind> (though it is more easily broken caused by compiler changes) |
15:19:38 | FromDiscord | <Yandong Zhang> I guess that the nimpretty is the most reliable one since it is installed by default (I just tried). |
15:20:19 | FromDiscord | <Yandong Zhang> Do want to have a distaste by the beauty. đ |
15:23:36 | * | Guest6265 joined #nim |
15:23:57 | * | Guest6265 quit (Client Quit) |
15:27:23 | FromDiscord | <Daniel> show us after and before đ |
15:48:09 | FromDiscord | <Yandong Zhang> @Daniel\: Supposedly, those formatter/prettier/... should keep the original somewhere by default. |
15:49:16 | FromDiscord | <Yandong Zhang> Maybe I can add a wrapper to do\: Step 1\: save the backup Step2. nimfmt |
15:51:04 | FromDiscord | <NullCode> In reply to @Daniel "show us after and": I wanna see too |
15:51:14 | FromDiscord | <NullCode> Before format and after format |
15:59:34 | FromDiscord | <konsumlamm> PMunch: btw, are you aware that futhark is also the name of a programming language?â”https://futhark-lang.org/ |
16:00:00 | FromDiscord | <NullCode> I wonder what futhark is |
16:00:43 | FromDiscord | <NullCode> Damn the lang is pretty cool |
16:00:55 | FromDiscord | <NullCode> But i can only do so much googling on mobile |
16:11:09 | * | max22- quit (Quit: Leaving) |
16:11:59 | * | max22- joined #nim |
16:25:21 | FromDiscord | <Lefl> sent a long message, see http://ix.io/3Ala |
16:25:56 | FromDiscord | <Gumber> In reply to @Lefl "Hey there, I'm": going to be pretty difficult to debug your issue without a stacktrace or any other error information.... |
16:26:07 | FromDiscord | <Gumber> just giving us your SQL statement(s) isn't really going to help.... |
16:26:42 | FromDiscord | <Lefl> (edit) "long message," => "code paste," | "http://ix.io/3Ala" => "https://play.nim-lang.org/#ix=3Alb" |
16:26:49 | FromDiscord | <Gumber> In reply to @NullCode "I wonder what futhark": huh? it's not a language from my understanding - it's another take on using tree sitter (I think) to produce C bindings automatically |
16:27:00 | FromDiscord | <Gumber> That's still not enough info @Lefl |
16:27:05 | FromDiscord | <Gumber> we need to see the error / stacktrace |
16:27:06 | FromDiscord | <Gumber> thanks |
16:27:11 | FromDiscord | <Lefl> sent a code paste, see https://play.nim-lang.org/#ix=3Alc |
16:27:18 | FromDiscord | <Gumber> okay soooooo you're not using `MariaDB` right? |
16:27:22 | FromDiscord | <Lefl> I am |
16:27:24 | FromDiscord | <Gumber> you're using `MySQL`? |
16:27:27 | FromDiscord | <Lefl> no |
16:27:48 | FromDiscord | <Gumber> now I'm very confused because above you mentioned MySQL |
16:28:01 | FromDiscord | <Lefl> It doesn't matter, the syntax is fine |
16:28:08 | FromDiscord | <Gumber> well apparently it's not |
16:28:14 | FromDiscord | <Lefl> It is |
16:28:16 | FromDiscord | <Gumber> at least the SQL the DB engine is receiving is not |
16:28:39 | FromDiscord | <Lefl> I'm running it through DBeaver and it works. if I print the sql before running it and copy it into dbeaver it works |
16:28:42 | FromDiscord | <enthus1ast> @Lefl\: split the commands by ";" and run them command by command |
16:28:55 | FromDiscord | <Lefl> hmm I'll try |
16:28:56 | FromDiscord | <Gumber> okay you have to understand though |
16:29:12 | FromDiscord | <Gumber> you have a layer in between your SQL's execution engine and your SQL statement now |
16:29:19 | FromDiscord | <Gumber> which is your Nim program / the db client lib |
16:29:28 | FromDiscord | <Lefl> Yes |
16:29:31 | FromDiscord | <Lefl> I know |
16:29:31 | FromDiscord | <Gumber> so you can't say I get this result when I run this in my SQL editor |
16:29:37 | FromDiscord | <Lefl> Yes I can |
16:29:38 | FromDiscord | <Gumber> so it is totally valid SQL for my Nim program right? |
16:29:47 | FromDiscord | <Gumber> okay please just be patient with my typing and responses |
16:30:06 | FromDiscord | <Gumber> I'm not trying to be critical of you I'm trying to help you understand why it's not an apples to apples comparison |
16:30:16 | FromDiscord | <Gumber> appears to be the problematic statement |
16:30:17 | FromDiscord | <Gumber> sent a code paste, see https://play.nim-lang.org/#ix=3Ale |
16:30:54 | FromDiscord | <Gumber> now can you please give me the full Nim code you're using to execute these statements? |
16:30:59 | FromDiscord | <Gumber> so I can understand what modules you're importing |
16:31:04 | FromDiscord | <Gumber> etc.... |
16:31:19 | FromDiscord | <Gumber> I don't need the entire codebase just the module that is executing these SQL statements |
16:31:42 | FromDiscord | <Lefl> db_mysql |
16:32:15 | FromDiscord | <Gumber> thanks |
16:32:49 | FromDiscord | <Lefl> In reply to @enthus1ast "<@241571229692198915>\: split the commands": Ah splitting it seems to have worked |
16:32:56 | FromDiscord | <Gumber> Nice |
16:33:01 | FromDiscord | <Lefl> Thanks |
16:33:08 | FromDiscord | <Gumber> Well it was all enthus1ast |
16:33:24 | FromDiscord | <Gumber> and I apologize if I came off a certain way - it's not my intention at all, it's just the way I type / my brain works |
16:33:35 | FromDiscord | <Gumber> my goal was to help you đ |
16:33:40 | FromDiscord | <Lefl> Don't worry |
16:33:44 | FromDiscord | <Gumber> but I'm glad you've gotten it figured out now! |
16:33:53 | FromDiscord | <Lefl> Sorry if I seemed angry or something |
16:33:56 | FromDiscord | <Gumber> nah it's cool |
16:34:00 | FromDiscord | <Gumber> I have ADHD / spectrum stuff |
16:34:05 | FromDiscord | <deech> sent a code paste, see https://paste.rs/ewg |
16:34:07 | FromDiscord | <Gumber> so I can't always like relate / interpret things correctly |
16:34:34 | FromDiscord | <Gumber> but yeah - I'm glad it's sorted out now đ |
16:48:13 | * | Guest55 joined #nim |
16:48:46 | Guest55 | Hello everyone, I found this interesting repository . https://github.com/oakes/vim_cubed |
16:48:55 | nrds | <R2D299> itHub: 7"Vim rendered on a cube for no reason" |
16:49:17 | Guest55 | But when I run the |
16:49:18 | Guest55 | nimble install, it is reported error |
16:49:32 | Guest55 | Error: Could not find a file with a .nimble extension inside the specified directory: C:\WINDOWS\system32 |
16:49:52 | Guest55 | This line work well: nimble install paravim |
16:50:06 | Guest55 | But the "nimble install" does not work |
16:50:56 | Guest55 | Have anyone tried it? |
16:53:03 | FromDiscord | <Marcin> any MySQL ORM for windows are there maby? |
16:53:52 | FromDiscord | <Gumber> for windows? |
16:53:56 | FromDiscord | <Marcin> yep |
16:53:58 | FromDiscord | <Gumber> ORMs generally aren't platform specific |
16:53:59 | FromDiscord | <enthus1ast> well we have ormin and norm |
16:54:02 | FromDiscord | <Gumber> just FYI |
16:54:08 | FromDiscord | <Gumber> they're DB specific |
16:54:13 | FromDiscord | <Gumber> or dbengine specific rather |
16:54:21 | FromDiscord | <Gumber> and sometimes not even then |
16:54:24 | FromDiscord | <enthus1ast> and another one but i forgot the name |
16:54:29 | FromDiscord | <Gumber> sometimes they can handle a bunch of db engines |
16:54:32 | FromDiscord | <Gumber> like spring data |
16:55:02 | FromDiscord | <Marcin> In reply to @enthus1ast "well we have ormin": but i see they aren't support mysql? đŠ |
16:55:30 | FromDiscord | <enthus1ast> ah good point |
16:55:34 | FromDiscord | <enthus1ast> i guess then not |
16:55:41 | FromDiscord | <Marcin> Gumber yeah but i try allographer and its great but not working on windows for example. I'll make PR later but i need it for now đ |
16:56:07 | FromDiscord | <Marcin> business need this for now so im lookin around to get something working at the moment |
16:56:59 | FromDiscord | <Gumber> gotcha |
16:57:02 | FromDiscord | <Marcin> ok so we know now what we need for expand the community of Nim đ |
16:57:11 | FromDiscord | <Marcin> maby if i ll get some free time il make one |
16:57:14 | FromDiscord | <Gumber> well, to expand the web dev sector anyway xD |
16:57:17 | FromDiscord | <Gumber> or app dev sector |
16:57:22 | FromDiscord | <Marcin> yep đ |
16:57:24 | FromDiscord | <Gumber> I don't have much use for ORMs or MySQL |
16:57:25 | FromDiscord | <Gumber> đ |
16:57:39 | FromDiscord | <enthus1ast> i like ormin but it lacks a lot of features |
16:57:40 | FromDiscord | <Marcin> by default im fan of raw sql |
16:57:46 | FromDiscord | <Marcin> but somethimes to make prototypes |
16:57:51 | FromDiscord | <Gumber> I mean I'm pretty sure ou can just do prepared statements w/ Nim etc |
16:57:57 | FromDiscord | <Marcin> its nice to get some production speed đ |
16:57:58 | FromDiscord | <Gumber> but yeah I feel you sometimes ORMs are nice |
16:58:03 | FromDiscord | <Gumber> Spring data spoiled me a lot |
16:58:14 | FromDiscord | <Gumber> but I don't do web dev in my spare time anymore - only game dev and soon embedded stuff hopefully |
16:58:20 | FromDiscord | <Gumber> once I get my pine64 phone |
16:58:28 | FromDiscord | <Gumber> and I start building my ADHD software |
16:59:09 | FromDiscord | <Marcin> In reply to @Gumber "but I don't do": yeah it's can help to make some of network code. |
16:59:30 | FromDiscord | <Marcin> but for network code of games we dont use ORM right? đ |
17:00:05 | FromDiscord | <Marcin> but anyway its nice to have in ecosystem |
17:00:16 | FromDiscord | <Marcin> so ill help with that in free time |
17:00:20 | FromDiscord | <Gumber> well a lot of games don't use databases |
17:00:26 | FromDiscord | <Marcin> yea u right |
17:00:27 | FromDiscord | <Gumber> like mine doesn't - and it's a 3d networked RTS |
17:00:34 | FromDiscord | <Gumber> but I mean - some games do, especially MMOs etc |
17:00:45 | FromDiscord | <Gumber> a lot of games that need a DB type deal will use flatfiles or an in-memory DB |
17:00:46 | FromDiscord | <Marcin> yeah online games are based |
17:00:54 | FromDiscord | <Gumber> and the abstraction could be useful there - but IMO simple is better always |
17:00:55 | FromDiscord | <Marcin> if not for game - for analytics, telemetry etc |
17:00:59 | FromDiscord | <Gumber> yeah |
17:01:02 | FromDiscord | <Gumber> exactly that kind of stuff |
17:01:07 | FromDiscord | <Gumber> but my games are like thick client desktop apps |
17:01:14 | FromDiscord | <Gumber> the only network communication they do is to steam / other gamer services |
17:01:18 | FromDiscord | <JohnAD (John Dupuy)> You are making an app that solves ADHD? You, sir, are going to make a fortune selling that to programmers. |
17:01:24 | Guest55 | The vim3 is totally amazing. https://github.com/oakes/vim_cubed |
17:01:26 | nrds | <R2D299> itHub: 7"Vim rendered on a cube for no reason" |
17:01:26 | FromDiscord | <Gumber> well I'm making one that works for me đ |
17:01:27 | FromDiscord | <Marcin> In reply to @Gumber "and the abstraction could": simple is better - You are 100% right đ |
17:01:30 | FromDiscord | <Gumber> because I have really really bad ADHD |
17:01:35 | Guest55 | Eveyone should use it to do the code review. |
17:01:46 | Guest55 | So we can have a wide vision. |
17:01:52 | FromDiscord | <Gumber> I'm not sure how useful it will be to others - but my goal is to streamline all of my todolists / reminders / notifications / etc.... |
17:02:06 | FromDiscord | <Gumber> In reply to @Guest55 "So we can have": Not really sure what you're talking about |
17:02:15 | FromDiscord | <Gumber> get them sent to my smartwatch |
17:02:42 | FromDiscord | <Gumber> and also just kind of build a custom tailored software solution that helps me with forgetfulness, time management, staying on task, prioritizing life and organizing plans to achieve long term goals |
17:02:53 | FromDiscord | <Gumber> without the ridiculous interfaces / flashy crap a lot of the productivity apps have |
17:03:01 | * | Guest55 quit (Quit: Client closed) |
17:03:41 | FromDiscord | <Gumber> no gamification or journey crap - just like here's a tool to help you manage your life with high usability and acessibility |
17:03:55 | FromDiscord | <Gumber> nothing I've found really works in that way - or at least doesn't solve the whole picture for me |
17:04:22 | FromDiscord | <Gumber> anywho - gotta run to my dr appt, bbl! |
17:04:27 | FromDiscord | <JohnAD (John Dupuy)> That would be nice; especially if it can do good filters to block stuff also. I'm often asking, how can get less communication. And yet still see the important things. |
17:06:27 | FromDiscord | <fae> @haxscramper was trying out your minimal compiler example but was having issues with `hmisc` on osx |
17:06:50 | FromDiscord | <fae> `clang: error: the clang compiler does not support -pg option on versions of OS X 10.9 and later` |
17:07:25 | FromDiscord | <haxscramper> I can't do anything with this, I don't even know where `-pg` comes from |
17:07:34 | FromDiscord | <haxscramper> And why it was added |
17:07:36 | FromDiscord | <fae> i imagine here https://github.com/haxscramper/hmisc/blob/06873884a15d06483bc688839c3d50e547913b75/src/hmisc/scripts/nim.cfg#L3 |
17:08:01 | FromDiscord | <fae> is there a way to override cfg from a consuming package? |
17:08:19 | FromDiscord | <haxscramper> this cfg should not be touched in the first place |
17:08:20 | FromDiscord | <haxscramper> and no |
17:08:36 | FromDiscord | <haxscramper> well, you can just go to the `.nimble` and edit things there |
17:08:45 | FromDiscord | <fae> (edit) "https://github.com/haxscramper/hmisc/blob/06873884a15d06483bc688839c3d50e547913b75/src/hmisc/scripts/nim.cfg#L3" => "https://github.com/haxscramper/hmisc/blob/master/src/hmisc/scripts/nim.cfg#L3" |
17:08:53 | FromDiscord | <haxscramper> `~/.nimble/pkgs/hmisc-...` |
17:09:03 | FromDiscord | <haxscramper> just edit the file |
17:09:13 | FromDiscord | <fae> yea i already did that, was just letting you know |
17:27:29 | FromDiscord | <konsumlamm> In reply to @Gumber "huh? it's not a": it's also the name of a language: https://futhark-lang.org/ |
17:29:41 | FromDiscord | <Yardanico> lol |
17:29:56 | FromDiscord | <dom96> Naming is hard |
17:30:10 | FromDiscord | <Recruit_main707> ^ |
17:42:07 | FromDiscord | <Shoto> In reply to @Gumber "because I have really": Oh a fellow neurodivergent- |
17:56:52 | FromDiscord | <reilly> sent a code paste, see https://play.nim-lang.org/#ix=3AlB |
17:57:50 | FromDiscord | <Rika> Setting and using that value at the same time |
18:06:33 | FromDiscord | <reilly> In reply to @Rika "Setting and using that": But since there's no condition, what ends the loop? |
18:10:29 | FromDiscord | <Rika> When the value is falsey |
18:10:37 | FromDiscord | <Rika> C has no Booleans |
18:10:53 | FromDiscord | <Rika> 0 is âfalseyâ and anything else is truths I believe |
18:10:58 | FromDiscord | <Rika> (edit) "truths" => "truthy" |
18:20:08 | FromDiscord | <reilly> When `instr` is falsey? |
18:20:36 | FromDiscord | <Rika> When it is set to a false value |
18:27:30 | FromDiscord | <treeform> In reply to @exelotl "there's also treeform's nimtemplate:": Yeah I use it a ton, but its not for everyone. |
18:32:27 | * | max22- quit (Ping timeout: 240 seconds) |
18:56:01 | * | max22- joined #nim |
19:02:11 | * | jjido joined #nim |
19:10:11 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzzâŠ) |
19:10:44 | FromDiscord | <Gumber> In reply to @konsumlamm "it's also the name": oh jesus, thanks for waking me up to that lol |
19:10:51 | FromDiscord | <Gumber> too many similar named things |
19:11:28 | FromDiscord | <Gumber> btw @konsumlamm I need to apologize to you - I think I replied to something you said and maybe i didn't understand it and I think my reply was a little callous / not very helpful or productive so if you remember what I'm speaking to, I apologize |
19:12:01 | FromDiscord | <Gumber> I don't even remember the specific context at this point, but I know I said something that I later regretted / didn't mean to make it sound the way I did, so if I did so, I'm sorry~! |
19:12:03 | FromDiscord | <Gumber> (edit) "sorry~!" => "sorry!" |
19:17:23 | * | FromDiscord quit (Ping timeout: 252 seconds) |
19:17:40 | * | FromDiscord joined #nim |
19:22:40 | nrds | <Prestige99> What is the use of the `end` keyword? |
19:23:43 | FromDiscord | <konsumlamm> In reply to @Gumber "btw <@!312654963694108674> I need": i don't remember anything like that, so all fine |
19:29:22 | FromDiscord | <Yardanico> @Prestige it's used for SCFs\ |
19:29:23 | FromDiscord | <Yardanico> (edit) "SCFs\" => "SCFs" |
19:30:00 | FromDiscord | <Yardanico> well, those are deprecated now anyway |
19:30:12 | FromDiscord | <Yardanico> ah right, they're not |
19:30:13 | FromDiscord | <Yardanico> https://nim-lang.org/docs/filters.html |
19:30:47 | nrds | <Prestige99> hmm |
19:44:44 | NimEventer | New post on r/nim by wrestlingwithbadgers: How to iterate over a distinct type, see https://reddit.com/r/nim/comments/py3142/how_to_iterate_over_a_distinct_type/ |
19:47:20 | FromDiscord | <Yardanico> wonder what's the usefulness of using "distinct" in his code |
19:48:18 | nrds | <Prestige99> maybe just an example |
19:59:00 | * | jjido joined #nim |
20:14:45 | * | rockcavera quit (Remote host closed the connection) |
20:17:59 | * | dom96 quit (Ping timeout: 268 seconds) |
20:22:49 | * | dom96 joined #nim |
20:48:47 | FromDiscord | <Shoto> Is it possible to make Nim output the C code that's compilable on any platform? |
20:49:57 | FromDiscord | <Gumber> Nim already does this? |
20:50:07 | FromDiscord | <Gumber> you need to invoke the correct compiler toolchain |
20:50:15 | FromDiscord | <Gumber> for your target OS / cpu arch |
20:50:15 | FromDiscord | <haxscramper> I don't think so, most platform-specific stuff is generated based on nim compilation checks |
20:50:28 | FromDiscord | <haxscramper> so things like `when defined(windows)` in the stdlib etc. |
20:50:42 | FromDiscord | <Gumber> oh yeah I mean you need to handle platform specific stuff on the Nim side |
20:51:02 | FromDiscord | <Gumber> but as far as the generated code - it will generate for whatever platform / cpu arch you say it should |
20:51:11 | FromDiscord | <Gumber> in Nim |
20:51:32 | FromDiscord | <Gumber> and with the generated C code as long as you invoke the correct compiliation toolchain |
20:51:36 | FromDiscord | <Gumber> (edit) "compiliation" => "compilation" |
20:51:50 | FromDiscord | <Gumber> you can target whatever you want.... as long as Nim supports it (and it supports a lot of targets) |
20:51:58 | FromDiscord | <Gumber> if you want an ezmode solution I'd check out zigcc |
20:52:01 | FromDiscord | <Gumber> (edit) "zigcc" => "`zigcc`" |
20:53:12 | * | rockcavera joined #nim |
20:53:49 | FromDiscord | <Shoto> Oh okay then |
20:53:53 | FromDiscord | <Shoto> Ezmode? |
20:54:31 | FromDiscord | <Gumber> easier than having to use a separate compilation toolchain |
20:54:54 | FromDiscord | <Shoto> Oh okay |
21:00:24 | * | Vladar quit (Quit: Leaving) |
21:05:38 | FromDiscord | <Yardanico> Oo, new hacktoberfest rules are even stricter than the last year |
21:05:42 | FromDiscord | <Yardanico> "I acknowledge that I will be disqualified indefinitely from Hacktoberfest if I submit two invalid pull requests." |
21:05:52 | FromDiscord | <dom96> oooh |
21:06:05 | FromDiscord | <dom96> the time for another t-shirt is here |
21:06:20 | FromDiscord | <Yardanico> also the opt in thing for maintainers is still there, but we have the hacktoberfest tag on the repo since last year |
21:06:44 | FromDiscord | <Yardanico> Also this year hacktoberfest supports GitLab |
21:07:31 | FromDiscord | <dom96> In reply to @Yardanico ""I acknowledge that I": hm, couldn't malicious people really screw someone up by marking their PRs as invalid? |
21:08:40 | Mister_Magister | how do you clear sequence? |
21:09:03 | FromDiscord | <Elegantbeef> `yourSeq.setLen(0)` |
21:09:03 | FromDiscord | <Yardanico> setLen(0) |
21:09:27 | FromDiscord | <Yardanico> In reply to @dom96 "hm, couldn't malicious people": that's possible, but I guess you'll be able to solve those types of things with the support |
21:09:32 | FromDiscord | <Yardanico> It's quite unlikely anyway |
21:10:17 | FromDiscord | <Yardanico> last year hacktoberfest had to introduce opt-in because a certain YouTube video showed how to get t-shirts "for free" by committing a useless change to a readme of some repository |
21:10:20 | Mister_Magister | why isn't setLen in docs |
21:10:26 | FromDiscord | <Yardanico> it is though |
21:10:27 | Mister_Magister | wait |
21:10:28 | Mister_Magister | it is |
21:10:30 | FromDiscord | <Yardanico> system module |
21:10:37 | Mister_Magister | thats kinda dumb tho |
21:10:41 | Mister_Magister | but whatever |
21:10:42 | Mister_Magister | thanks |
21:11:48 | nrds | <Prestige99> Yeah it's hard to find things sometimes |
21:12:10 | nrds | <Prestige99> if you're having trouble usually check the manual or system page |
21:13:12 | Mister_Magister | !eval echo test |
21:13:13 | NimBot | Compile failed: /usercode/in.nim(1, 6) Error: undeclared identifier: 'test' |
21:13:16 | nrds | <R2D299> /usercode/in.nim(1, 6) Error: undeclared identifier: 'test' |
21:13:21 | Mister_Magister | why two |
21:14:14 | Mister_Magister | !eval var test: seq[string] = @["test"]; open(test[0]) |
21:14:15 | NimBot | Compile failed: /usercode/in.nim(1, 40) Error: expression 'open(test[0], fmRead, -1)' is of type 'File' and has to be used (or discarded) |
21:14:17 | nrds | <R2D299> /usercode/in.nim(1, 40) Error: expression 'open(test[0], fmRead, -1)' is of type 'File' and has to be used (or discarded) |
21:14:26 | Mister_Magister | !eval var test: seq[string] = @["test"]; discard open(test[0]) |
21:14:29 | NimBot | /usercode/in.nim(1) inâ”/playground/nim/lib/system/io.nim(741) openâ”Error: unhandled exception: cannot open: test [IOError] |
21:14:31 | nrds | <R2D299> /usercode/in.nim(1) in /playground/nim/lib/system/io.nim(741) open Error: unhandled exception: cannot open: test [IOError] |
21:14:36 | Mister_Magister | hmm |
21:14:46 | Mister_Magister | thats weird |
21:15:10 | Mister_Magister | ahhh i see, problem is somewhere else |
21:15:31 | Mister_Magister | !eval var test: seq[string] = @["test", "0"]; discard open(test[test[1]]) |
21:15:32 | NimBot | Compile failed: /usercode/in.nim(1, 58) Error: type mismatch: got <seq[string], string> |
21:15:34 | nrds | <R2D299> /usercode/in.nim(1, 58) Error: type mismatch: got <seq[string], string> |
21:15:36 | Mister_Magister | exactly |
21:16:01 | Mister_Magister | how do you convert string to itn |
21:16:07 | Mister_Magister | parseInt |
21:16:15 | Mister_Magister | !eval var test: seq[string] = @["test", "0"]; discard open(test[parseInt(test[1])]) |
21:16:17 | NimBot | Compile failed: /usercode/in.nim(1, 59) Error: undeclared identifier: 'parseInt' |
21:16:18 | nrds | <R2D299> /usercode/in.nim(1, 59) Error: undeclared identifier: 'parseInt' |
21:16:29 | Mister_Magister | !eval use strutils; var test: seq[string] = @["test", "0"]; discard open(test[parseInt(test[1])]) |
21:16:30 | NimBot | Compile failed: /usercode/in.nim(1, 1) Error: undeclared identifier: 'use' |
21:16:32 | nrds | <R2D299> /usercode/in.nim(1, 1) Error: undeclared identifier: 'use' |
21:16:41 | Mister_Magister | !eval import strutils; var test: seq[string] = @["test", "0"]; discard open(test[parseInt(test[1])]) |
21:16:45 | NimBot | /usercode/in.nim(1) inâ”/playground/nim/lib/system/io.nim(741) openâ”Error: unhandled exception: cannot open: test [IOError] |
21:16:46 | nrds | <R2D299> /usercode/in.nim(1) in /playground/nim/lib/system/io.nim(741) open Error: unhandled exception: cannot open: test [IOError] |
21:16:52 | Mister_Magister | perfecto |
21:17:15 | FromDiscord | <Elegantbeef> you know there are REPLs and also multiple websites that run nim code? |
21:17:28 | Mister_Magister | yeah sorry |
21:17:45 | Mister_Magister | just thought i would ask for help with example but instead i got answer |
21:18:56 | Mister_Magister | what is openArray exactly? |
21:19:31 | Mister_Magister | !eval var s: openArray[uint8] |
21:19:33 | NimBot | Compile failed: /usercode/in.nim(1, 5) Error: invalid type: 'openArray[uint8]' for var |
21:19:34 | nrds | <R2D299> /usercode/in.nim(1, 5) Error: invalid type: 'openArray[uint8]' for var |
21:19:39 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/manual.html#types-open-arrays |
21:19:39 | Mister_Magister | yeah here, why |
21:19:46 | Mister_Magister | why is it invalid type? |
21:20:46 | Mister_Magister | it should be fine but its not |
21:24:24 | nrds | <Prestige99> openArray can only be used as a param |
21:25:02 | FromDiscord | <Yardanico> @Prestige what's this nrds bot? |
21:25:11 | Mister_Magister | ah |
21:25:41 | FromDiscord | <Yardanico> And can you please disable its !eval in this chat as it conflicts with the one we have in NimBot |
21:28:59 | nrds | <Prestige99> nrds is just the relay it's another bot in here but I'll disable it for your side |
21:29:43 | FromDiscord | <Yardanico> huh, what does it relay to? your telegram group or something? |
21:30:17 | nrds | <Prestige99> another irc network |
21:30:35 | Mister_Magister | https://nim-lang.org/docs/io.html#readBytes%2CFile%2CopenArray%5B%5D%2CNatural%2CNatural |
21:30:38 | Mister_Magister | this, this is dumb |
21:31:02 | Mister_Magister | if i have 1TB file and i want to read 1 byte at the end of it i have to allocate 1TB array |
21:31:06 | Mister_Magister | just to read one byte |
21:31:18 | FromDiscord | <Yardanico> no? |
21:31:36 | Mister_Magister | yes? |
21:31:44 | Mister_Magister | reads len bytes into the buffer a starting at a[start]. |
21:31:49 | Mister_Magister | starting at a[start]. |
21:31:58 | FromDiscord | <Yardanico> https://nim-lang.org/docs/io.html#setFilePos%2CFile%2Cint64%2CFileSeekPos |
21:32:15 | Mister_Magister | still dumb |
21:32:28 | FromDiscord | <Yardanico> ok |
21:34:22 | FromDiscord | <Elegantbeef> It's how it works everywhere |
21:34:33 | FromDiscord | <Elegantbeef> You open a file you move the file to X pos and read data |
21:34:40 | FromDiscord | <Elegantbeef> Welcome to file streaming |
21:44:17 | FromDiscord | <dom96> Mister_Magister: no you don't need to alloc a 1TB array, you just seek the file to the end |
21:44:19 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzzâŠ) |
21:44:30 | FromDiscord | <dom96> stop calling things you think don't make sense 'dumb' |
21:46:59 | nrds | <Prestige99> Hmm this is interesting - this sdl api that fills in polygons requires a pointer to a cfloat - it expects vertices to be laid out like [x1, y1, x2, y2...] etc. I have a seq of Vec2s (from vmath), I wonder if there's an easy way I could do this... |
21:47:42 | nrds | <Prestige99> each Vec2 is essentially an object with an arr: array[2, float] |
21:50:08 | nrds | <Prestige99> Only thing I can really think of is duplicating the vertices into a single array |
21:50:19 | Mister_Magister | @dom96 why |
21:57:37 | * | max22- quit (Quit: Leaving) |
22:20:36 | FromDiscord | <MaksimBoyarkin> Hello, MS Defender find Malware in Nim archive for windows |
22:20:38 | FromDiscord | <MaksimBoyarkin> https://www.microsoft.com/en-us/wdsi/threats/malware-encyclopedia-description?Name=TrojanDropper:Win32/Zpevdo.B&ThreatID=2147774529 |
22:20:44 | FromDiscord | <Elegantbeef> Why what? Why do you have to seek to the end or stop calling things dumb? |
22:21:00 | FromDiscord | <MaksimBoyarkin> https://media.discordapp.net/attachments/371759389889003532/892898783715811388/SPOILER_unknown.png |
22:21:20 | FromDiscord | <Elegantbeef> Yea windows defender falsely things nim tooling is a virus |
22:22:51 | FromDiscord | <MaksimBoyarkin> I suspect that this is due to the fact that finish.exe is downloading the compiler |
22:23:07 | * | rockcavera quit (Remote host closed the connection) |
22:24:32 | * | rockcavera joined #nim |
22:24:33 | * | rockcavera quit (Changing host) |
22:24:33 | * | rockcavera joined #nim |
22:26:37 | FromDiscord | <dom96> which exe did it highlight as malware? |
22:30:54 | * | stkrdknmibalz joined #nim |
22:31:10 | FromDiscord | <MaksimBoyarkin> In reply to @dom96 "which exe did it": nim-1.4.8\bin\nimble.exe |
22:40:28 | * | cyraxjoe joined #nim |
23:05:00 | FromDiscord | <dom96> also new RC2 also affected https://forum.nim-lang.org/t/8466#54728 |
23:11:37 | FromDiscord | <MaksimBoyarkin> It seems to me that automation after unpacking and downloading the compiler is redundant. Before starting programming, a person must be able to independently set environment variables and the compiler. |
23:13:32 | FromDiscord | <MaksimBoyarkin> Perhaps these things allow you to add an antivirus signature to the company database |
23:26:03 | NimEventer | New post on r/nim by mescobal: Get the first and last day of current month in Nim?, see https://reddit.com/r/nim/comments/py7b4n/get_the_first_and_last_day_of_current_month_in_nim/ |