<< 29-09-2021 >>

00:00:12FromDiscord<Elegantbeef> Yea i mean they work fine but nim has string casestatements which map tables
00:00:19FromDiscord<Elegantbeef> Which gives you more control
00:00:58hexologyso instead of an `inputConverters` table, you'd just have a proc that raises an exception or something?
00:01:03hexologyor returns nil
00:01:20FromDiscord<Elegantbeef> Yea
00:03:55hexologyi 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:33hexologyi would also be interested in any 3rd-party libraries for cli arg parsing, with a higher-level and/or more-declarative interface
00:05:02FromDiscord<Elegantbeef> There's https://github.com/c-blake/cligen
00:05:05nrds<R2D299> itHub: 7"Nim library to infer/generate command-line-interfaces / option / argument parsing; Docs At"
00:05:09FromDiscord<Elegantbeef> It's one of the more popular ones
00:06:01FromDiscord<Elegantbeef> Yea deech i think the way yo do it is to emit a new macro which has the typedesc
00:07:33FromDiscord<deech> @ElegantBeef Could you elaborate?
00:08:43FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=3Ah8
00:09:18FromDiscord<Elegantbeef> If you have an example i could see what makes more sense
00:09:31FromDiscord<deech> Oh wow.
00:11:40FromDiscord<deech> So there's no way to "recover" that typedesc directly?
00:12:12FromDiscord<Elegantbeef> Well it's decayed to a Nimnode so requires the compiler to return the type
00:13:22FromDiscord<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:45FromDiscord<Professor Actual Factual> sent a code paste, see https://play.nim-lang.org/#ix=3Ahf
00:28:35FromDiscord<Elegantbeef> Wish i could tell you
00:31:53hexologyshould 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:35FromDiscord<Elegantbeef> You should use ref when you need reference semantics
00:37:45FromDiscord<Elegantbeef> People have weird views of ref vs value
00:37:46FromDiscord<Professor Actual Factual> sent a long message, see http://ix.io/3Ahj
00:38:15FromDiscord<Elegantbeef> Here are reasons to consider them https://forum.nim-lang.org/t/8426#54529
00:40:35hexologyah, interesting. nim has move semantics
00:41:26hexologyor, will have them?
00:41:33FromDiscord<Elegantbeef> It has them
00:41:38FromDiscord<Elegantbeef> Though they make more sense with arc/orc
00:41:42FromDiscord<impbox [ftsf]> @ElegantBeef really nice writeup! should include that in the manual =)
00:43:16FromDiscord<Elegantbeef> Well i should fill in the `any other traits i missed` and make it more authorative
00:43:42FromDiscord<Elegantbeef> But yea a concise reason to consider ref vs non would be nice
00:44:27hexologyseems like ref-less is a good default. immutability is good
00:44:36hexologywhat's this stuff i'm seeing about arc/orc and multiple gc versions?
00:44:54hexologyi found this... will read https://nim-lang.org/blog/2020/10/15/introduction-to-arc-orc-in-nim.html
00:46:36FromDiscord<Elegantbeef> Arc/orc are new memory management methods and in araqs words "the only way to manage memory" 😛
00:49:26FromDiscord<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:19FromDiscord<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:37FromDiscord<Professor Actual Factual> (edit) "is" => "and ORC are" | "then ORC." => "than traditional GC."
00:55:03FromDiscord<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:24FromDiscord<Elegantbeef> Yea they work lovely + enable cooler features
00:56:08FromDiscord<Elegantbeef> Now have copy, sink, destroy, and trace hooks
01:12:30FromDiscord<cabboose> Yeah I have definitely destroyed my memory
01:32:31FromDiscord<Rika> In reply to @Professor Actual Factual "Probably opinionated question. I've": Second scenario would still fit object
01:38:16FromDiscord<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:07FromDiscord<Professor Actual Factual> (edit) "objects." => "objects with lots of many-to-many relationships."
01:44:21FromDiscord<impbox [ftsf]> slow copies?
01:44:42FromDiscord<impbox [ftsf]> if you have large objects
01:44:52FromDiscord<impbox [ftsf]> and you're passing by value
01:45:39FromDiscord<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:03FromDiscord<Professor Actual Factual> (edit) "objects." => "objects that changed per iteration/cycle."
02:12:06*arkurious quit (Quit: Leaving)
02:15:51hexologyhttps://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:22hexologycould you generate all these overloaded proc definitions with a macro?
02:16:28hexologyor is there just some other way to do this
02:28:32FromDiscord<Elegantbeef> You could of course, not that it's overly suggested
02:29:18hexologythis 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:47FromDiscord<Elegantbeef> You do know defects are special right?
02:30:07hexologyi was under the impression that they were "things that shouldn't ever happen"
02:30:12FromDiscord<Elegantbeef> They're not to be caught and if they're raised the program should be ended
02:30:23FromDiscord<Elegantbeef> Yes they are, just making sure you knew that
02:30:45hexologyyeah, in this case it means "the programmer tried to use an unsupported exception, go file a bug report"
02:31:17hexologyand this one which just has an assertion, equally nasty imo: https://play.nim-lang.org/#ix=3AhE
02:31:19FromDiscord<Elegantbeef> You might be able just do https://play.nim-lang.org/#ix=3AhF
02:32:05FromDiscord<Elegantbeef> Oh sorry those second two should be `ref object of CliUsageError`
02:34:14NimEventerNew Nimble package! selenimum - WebDriver for Selenium(selenium-hub)., see https://github.com/myamyu/selenimum
02:34:17nrds<R2D299> itHub: 7"WebDriver for Selenium(selenium-hub) by Nim."
02:34:19hexologyoh dear, did the playground go down?
02:34:34hexology@Elegantbeef i could also make them all inherit from some base type, right?
02:35:06FromDiscord<Elegantbeef> Yea that's what that link was https://hatebin.com/nsieohqruk
02:35:48hexologyand 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:01hexologythe ref just allows you to inherit?
02:36:25FromDiscord<Elegantbeef> Well it's no different since you exceptions are raised references
02:36:35FromDiscord<Elegantbeef> But yea ref is typically used for normal OOp
02:36:49FromDiscord<Elegantbeef> In Nim tagged unions are called object variants https://nim-lang.org/docs/manual.html#types-object-variants
02:37:04FromDiscord<Elegantbeef> I dumbly move between speech since i talk a bit to people that write other system langauges
02:38:35hexologyah, so you can't really make a "tagged union" of Exceptions then?
02:39:01hexologyat least, it wouldn't be any more type-safe than the if/else, it just allows you to use `case`
02:39:37FromDiscord<Elegantbeef> Indeed
02:40:12FromDiscord<Elegantbeef> The benefit is mostly not having a pointer, you still of course need to delimit logic for specific casees
02:45:39FromDiscord<Elegantbeef> Doesnt work for user extended types though
02:56:46hexologymakes sense
03:33:50*clemens3 quit (Ping timeout: 246 seconds)
03:34:22NimEventerNew 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:43hexologyhttps://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:56FromDiscord<Elegantbeef> What's `InvalidInputFormatError` type definition?
03:41:34FromDiscord<Elegantbeef> Oh it might be the strformat try `"Unknown input format: " & $key`
03:46:13hexologywasn't the strformat. here it is again w/ the types: https://bpa.st/RXZQ
03:46:38hexologyi was attempting to follow the example you gave me
03:48:51FromDiscord<Elegantbeef> Seems it's the ref, i havent used exceptions much so my bad
03:50:03hexologyaha, removing that fixed it
04:06:01*supakeen quit (Quit: WeeChat 3.3)
04:06:30*supakeen joined #nim
04:38:22FromDiscord<cabboose> Beef doesn’t believe in exceptions
04:38:34FromDiscord<cabboose> You can’t have errors if you don’t code them in
04:38:36FromDiscord<Elegantbeef> Indeed
04:38:55FromDiscord<Elegantbeef> Alternatively my software never gets to the point it needs to worry about errors
04:39:20FromDiscord<cabboose> it’s hard to get past writing the file name sometimes yeah
04:39:32FromDiscord<Elegantbeef> Fuck you get the file name, i dont even open up my text editor
04:39:57FromDiscord<cabboose> At least you have a computer
04:40:10FromDiscord<cabboose> Pen and paper coding sucks
04:40:10FromDiscord<Elegantbeef> My text editor is a literal notebook
04:40:53FromDiscord<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:55FromDiscord<cabboose> Man I can’t even sign up to the forum
05:14:57FromDiscord<cabboose> what is this
05:15:42FromDiscord<cabboose> How am I supposed to advertise my steamin turd library if I can’t get to the forum
05:33:25FromDiscord<NullCode> lmao
05:33:29FromDiscord<NullCode> whats this library
05:38:08FromDiscord<cabboose> well now hold on
05:38:15FromDiscord<cabboose> are you going to do some malware trickery with it
05:38:32FromDiscord<cabboose> đŸ€Ł
05:39:03FromDiscord<Elegantbeef> Remember they're not a malware author they just have malware on the github
05:39:44FromDiscord<NullCode> he fyi
05:39:57FromDiscord<NullCode> In reply to @cabboose "are you going to": idek what sort of lib it is
05:40:49FromDiscord<NullCode> In reply to @Elegantbeef "Remember they're not a": yeah someone else made them
05:40:54FromDiscord<NullCode> and I'm storing them on github
05:41:13FromDiscord<Elegantbeef> No one is going to believe that
05:41:35FromDiscord<NullCode> why not
05:45:32FromDiscord<cabboose> SoCiOpAtHy101
05:45:46FromDiscord<cabboose> instead of trying to resist evidence
05:46:02FromDiscord<cabboose> use a more relatable reason that is innocent of the connotation
05:46:04FromDiscord<cabboose> like
05:46:05FromDiscord<cabboose> yessir
05:46:21FromDiscord<cabboose> I am a white hat malware dev for security company bla
05:46:22FromDiscord<cabboose> I mean
05:46:48FromDiscord<cabboose> that sells better than having malware on your github and trying to say its not yours or you dont use it \>.\>
05:47:31FromDiscord<cabboose> either way its just an innocent MPMC lock & leak free queue
05:47:55FromDiscord<cabboose> https://github.com/nim-works/loony
05:47:58nrds<R2D299> itHub: 7"Experimenting to make a high throughput MPMC lock-free queue based on a paper by Giersch, Nolte et al."
05:53:27FromDiscord<NullCode> nice i didn't understand a single thing
05:53:51FromDiscord<NullCode> well i did start coding this year
05:54:04FromDiscord<NullCode> so not up-to-snuff about everything
05:56:35FromDiscord<Rika> Many “malware devs” are just script kiddies though
05:56:43*Guest18 quit (Ping timeout: 256 seconds)
05:58:05FromDiscord<NullCode> yes
05:58:16FromDiscord<NullCode> which is why i want to make sure nobody calls me a script kiddie
05:58:44FromDiscord<impbox [ftsf]> maybe don't post your age then ;)
05:59:00FromDiscord<NullCode> a script kiddie is defined by the usage of uhh
05:59:03FromDiscord<NullCode> whats that thing called
05:59:05FromDiscord<NullCode> metasploit
05:59:06FromDiscord<NullCode> and stuff
05:59:09FromDiscord<NullCode> not by your age ;)
06:00:09*vicfred quit (Quit: Leaving)
06:00:49FromDiscord<NullCode> even a 10 year old could be a real haxor
06:01:23FromDiscord<impbox [ftsf]> for sure, i'm joking, age has nothing to do with anything
06:01:31FromDiscord<NullCode> yes
06:01:33FromDiscord<impbox [ftsf]> though it does colour people's expectations
06:01:51FromDiscord<NullCode> meh
06:01:57FromDiscord<NullCode> my parents have 0 expectations from me
06:02:03FromDiscord<NullCode> i don't expect anybody else to have any
06:02:10FromDiscord<impbox [ftsf]> ahh i mean more in terms of getting work in the industry
06:02:14FromDiscord<impbox [ftsf]> if that is your goal
06:02:21FromDiscord<NullCode> oh
06:02:30FromDiscord<NullCode> i thought if you had good code in github
06:02:39FromDiscord<NullCode> you could get work easier?
06:02:54FromDiscord<Elegantbeef> impbox dont say experience in the industry when they have malware on the github!
06:03:08FromDiscord<NullCode> once again, he
06:03:34FromDiscord<NullCode> and yeah i know most of you are adults and stuff
06:03:37FromDiscord<impbox [ftsf]> yeah, but maybe don't lead with your age if you don't want to be considered a "script kiddy"
06:03:47FromDiscord<NullCode> but that doesn't mean i can't get to code until I'm 20 or stuff
06:03:47FromDiscord<Elegantbeef> Luckily `they` is completely gender neutral
06:04:23FromDiscord<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:39FromDiscord<NullCode> i can show i don't use bullshit like metasploit and airgeddon
06:04:41FromDiscord<NullCode> etc et
06:04:43FromDiscord<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:43FromDiscord<NullCode> (edit) "et" => "etc"
06:04:54FromDiscord<impbox [ftsf]> if at all
06:05:31FromDiscord<Elegantbeef> Yea like impbox knows i'm a terrible programmer thanks to the myriad of bad PR's he's' accepted \:D
06:05:37FromDiscord<NullCode> In reply to @impbox "i've been coding since": i see good idea
06:05:46FromDiscord<impbox [ftsf]> @ElegantBeef they ;)
06:06:02FromDiscord<Elegantbeef> I'll fucking break they's legs
06:06:34FromDiscord<NullCode> LMFAO
06:06:40FromDiscord<NullCode> now i see why beef uses they
06:07:11FromDiscord<NullCode> anyway i do want to make legitimate programs
06:07:15FromDiscord<Elegantbeef> It's a gender neutral pronoun that's easy to avoid people raging about incorrect usage
06:07:19FromDiscord<NullCode> but i just have 0 ideas
06:07:30FromDiscord<NullCode> and since I've been watching danoct for YEARS
06:07:37FromDiscord<NullCode> i just thought why not make some fun stuff
06:08:34FromDiscord<NullCode> (edit) "YEARS" => "YEARS↔↔(context: dan used to review old old malware https://www.youtube.com/c/danooct1)"
06:09:01FromDiscord<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:23FromDiscord<NullCode> In reply to @Elegantbeef "It's a gender neutral": people who fuss about gender are plain stupid
06:09:57FromDiscord<Elegantbeef> Says the person that corrected 'they' twice
06:10:14FromDiscord<impbox [ftsf]> a bit #offtopic but using people's preferred pronouns or they is polite
06:11:12FromDiscord<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:35FromDiscord<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:41FromDiscord<NullCode> (edit) "60" => "69"
06:11:50FromDiscord<NullCode> i just politely told I'm a guy
06:11:54FromDiscord<NullCode> so it's alright in my books
06:12:12FromDiscord<NullCode> In reply to @Elegantbeef "Anywho there is tons": can you give some examples tho
06:12:18FromDiscord<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:36FromDiscord<impbox [ftsf]> use code to solve problems you have
06:12:45FromDiscord<impbox [ftsf]> or problems other people have
06:12:56FromDiscord<impbox [ftsf]> make pretty things
06:12:57FromDiscord<Elegantbeef> No the problem cannot be "i want that guy's password"
06:13:01FromDiscord<impbox [ftsf]> make fun things
06:13:22FromDiscord<Elegantbeef> Easy for us to say impbox being game focused developers 😛
06:13:34FromDiscord<impbox [ftsf]> ehh i make all sorts of things, not just games =)
06:13:44FromDiscord<NullCode> In reply to @impbox "use code to solve": i think I've already done that
06:13:54FromDiscord<NullCode> automated basically anything possible with ahk
06:13:58FromDiscord<Elegantbeef> I said game focused 😛
06:14:18FromDiscord<Elegantbeef> I'd say the compiler isnt a game, but it's pretty much a weird version of whack a mole
06:14:18FromDiscord<NullCode> In reply to @impbox "make pretty things": argh i can't make GUIs
06:14:27FromDiscord<impbox [ftsf]> don't need guis
06:14:34FromDiscord<NullCode> thats just the one thing I'd love to do
06:14:35FromDiscord<NullCode> but can't
06:14:36FromDiscord<NullCode> GUis
06:14:46FromDiscord<NullCode> just don't fit in my head very well
06:14:50FromDiscord<NullCode> (edit) "GUis" => "GUIs"
06:14:59FromDiscord<impbox [ftsf]> dear imgui is great, i hate doing GUIs but it makes it a pleasure
06:15:22FromDiscord<impbox [ftsf]> made a cool music visualiser + trippy visual creator
06:15:27FromDiscord<Elegantbeef> Though not overly great for a proper desktop application, but for tooling works well
06:15:43FromDiscord<NullCode> whats a good one for "proper desktop applications"
06:15:48FromDiscord<NullCode> cuz thats the thing i want to do
06:16:06FromDiscord<impbox [ftsf]> win32 api
06:16:09FromDiscord<Elegantbeef> Gtk, Qml, Nigui
06:16:33FromDiscord<NullCode> In reply to @impbox "win32 api": what
06:16:47FromDiscord<NullCode> you mean creating msgboxes with vbscript? :P
06:17:12FromDiscord<Rika> Challenge: game in pure NimScript
06:17:46FromDiscord<Elegantbeef> Rika making challenges that are only difficult on a compiler without libcffi
06:17:49FromDiscord<impbox [ftsf]> yeah, don't actually use win32 api
06:19:29FromDiscord<NullCode> https://media.discordapp.net/attachments/371759389889003532/892656807766532106/unknown.png
06:19:36FromDiscord<NullCode> oh also whats this weird font i get when running nim stuff
06:19:39FromDiscord<NullCode> can't i change it
06:20:20FromDiscord<Elegantbeef> Not a clue might just be a setting on the terminal output
06:21:33FromDiscord<cabboose> nimqml
06:22:08FromDiscord<cabboose> although I am a fan of qt shit anyway
06:22:14FromDiscord<cabboose> but their qml stuff is good
06:22:20FromDiscord<NullCode> ohhhhhhh it's the TrueType font
06:22:48FromDiscord<Elegantbeef> But cabboose i dont have qt themed so it's blindingly white 😛
06:23:07FromDiscord<NullCode> In reply to @cabboose "although I am a": only thing i like about qt is qt-designer
06:23:35FromDiscord<cabboose> you’re mad beef
06:23:44FromDiscord<cabboose> thats qt widgets
06:23:46FromDiscord<impbox [ftsf]> no they're elegant
06:23:47FromDiscord<Rika> Took you a while to realise
06:23:51FromDiscord<cabboose> you bonk
06:24:01FromDiscord<cabboose> i said qml
06:24:09FromDiscord<NullCode> In reply to @cabboose "thats qt widgets": what
06:24:21FromDiscord<NullCode> ok i see now
06:24:22FromDiscord<cabboose> qt widgets uses QtDesigner
06:24:24FromDiscord<cabboose> qml uses Designer Studio
06:24:33FromDiscord<impbox [ftsf]> is QT still c++?
06:24:40FromDiscord<cabboose> ye
06:24:44FromDiscord<impbox [ftsf]> i remember that made it a real pain to bind
06:24:59FromDiscord<cabboose> there are working bindings for qml engine
06:25:11FromDiscord<cabboose> and hax is doing qt when hcparse is up and running
06:25:31FromDiscord<cabboose> I mean the front end can all be done in qml and backend in nim pretty easily
06:26:07FromDiscord<cabboose> and qml has a good designer to back it up
06:26:10FromDiscord<cabboose> the biggest issue is just licensing
06:26:46FromDiscord<cabboose> Time to go back to the library to try cram another 10 lectures
06:26:48FromDiscord<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:01NimEventerNew 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:49FromDiscord<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:05FromDiscord<enthus1ast> when i have a header only lib, do i have other options than ` {.emit: "#include <" & getProjectPath() / "tinyjpeg.h" & ">".}`
10:52:19FromDiscord<enthus1ast> (which does not work correctly btw)
10:53:09FromDiscord<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:35FromDiscord<haxscramper> your other option is to properly use `header`
10:53:44FromDiscord<enthus1ast> but this can only be bound to an object
10:53:45FromDiscord<haxscramper> `header: absolute-or-relative-path`
10:53:52FromDiscord<haxscramper> no
10:53:58FromDiscord<haxscramper> this can be bound to anything
10:54:12FromDiscord<enthus1ast> but not on module scope
10:54:19FromDiscord<enthus1ast> at least it did not work for me
10:54:30FromDiscord<haxscramper> what module scope is even?
10:54:30FromDiscord<haxscramper> there are types and procs
10:54:36FromDiscord<haxscramper> you need to import what? proc?
10:54:44FromDiscord<haxscramper> then put `header:` on proc definition
10:55:41FromDiscord<enthus1ast> this i can try
10:56:05FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=3Ajd
10:56:20FromDiscord<haxscramper> you didn't mention you also need `#define`
10:56:28FromDiscord<haxscramper> and NO
10:56:32FromDiscord<haxscramper> you put header on proc
10:56:37FromDiscord<haxscramper> not on module scope
10:56:39FromDiscord<enthus1ast> yeah this is the reason i emitted include
10:56:47FromDiscord<haxscramper> you put `header` on the thing you want to import
10:58:27FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3Ajf
10:58:57FromDiscord<haxscramper> You can put anything in `header` text, it does not have to be a file only
10:59:10FromDiscord<haxscramper> you can put any random garbage and it would be pasted in the generated headers as-si
10:59:17FromDiscord<haxscramper> `<file>` and `"file"` just get special treatment
10:59:24FromDiscord<enthus1ast> just once or several time?
10:59:30FromDiscord<haxscramper> should do it once
10:59:36PMunchYou could copy tinyjpeg into the cache directory
10:59:41FromDiscord<haxscramper> buy you can `#ifdef` around it if it does so multiple times
10:59:43PMunchWait
11:00:01PMunchYou need to do `#include ""` and not `#include <>` right?
11:00:10FromDiscord<haxscramper> this would require copying into cache directory of every build↔(<@709044657232936960_=50=4dunch=5b=49=52=43=5d>)
11:00:12FromDiscord<haxscramper> al
11:00:19PMunchOtherwise it searches the compiler search path..
11:00:20FromDiscord<haxscramper> also you can do it really proeprly
11:00:20FromDiscord<enthus1ast> then afaik its easier to just have a import emit on top of the module
11:00:25FromDiscord<haxscramper> and just use default compiler features
11:00:26FromDiscord<haxscramper> such as
11:00:38FromDiscord<haxscramper> `{.passc: "-I<dir>".}`
11:00:48FromDiscord<haxscramper> And C compiler would search the headers when compiling
11:00:53FromDiscord<haxscramper> at least this is the best approach IMO
11:00:57FromDiscord<haxscramper> for this specific issue
11:00:58FromDiscord<enthus1ast> yes
11:01:21FromDiscord<haxscramper> you still need to do `header: "zzzzz.h"` of course
11:01:39FromDiscord<haxscramper> If you want to save yourself some typing you can `{.push.}` the header
11:01:42PMunchYeah just `#include "tinyjpeg.h"` and `"-I" & getProjectPath()` should work
11:02:04FromDiscord<haxscramper> there is a `getProjectPath()`?
11:02:05FromDiscord<haxscramper> TIL
11:02:15FromDiscord<enthus1ast> yeah in macros
11:02:17FromDiscord<enthus1ast> BUT
11:02:27FromDiscord<enthus1ast> this uses the current module
11:02:29FromDiscord<haxscramper> no, the project path is incorrect from what i understand
11:02:48FromDiscord<haxscramper> it uses thing I started compilation with, not relative to the current source
11:02:57FromDiscord<enthus1ast> yes exactly
11:03:07FromDiscord<haxscramper> so I can't reliably predict where getProjectPath() would be
11:03:20FromDiscord<haxscramper> IMO there should be a currentSourceDir() in addition to source path
11:04:07PMunchI mean there is https://nim-lang.org/docs/system.html#currentSourcePath.t
11:04:37FromDiscord<haxscramper> source DIR
11:04:48PMunchcurrentSourcePath.parentDir
11:04:50PMunchThere
11:04:59FromDiscord<haxscramper> `import std/os`
11:05:02FromDiscord<haxscramper> forgot this
11:08:39FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=3Ajk
11:09:00FromDiscord<haxscramper> ...
11:09:05FromDiscord<haxscramper> well, okay, if it works then it works
11:09:28FromDiscord<enthus1ast> why do you think should it not work?
11:10:11FromDiscord<haxscramper> no, this is like the most hacky solution of all ones presented
11:10:41FromDiscord<haxscramper> and does this work when you import things?
11:10:48FromDiscord<haxscramper> because some proc might be required in multiple modules
11:11:02FromDiscord<haxscramper> `emit` has a property of failing for multi-file projects as well
11:11:20FromDiscord<enthus1ast> mh i see
11:11:24FromDiscord<haxscramper> because there might be call somehwere else, but codegen does only one emit, so other calls are broken
11:11:44FromDiscord<enthus1ast> then prolly i must do #ifdef cage
11:12:07FromDiscord<enthus1ast> this and pasl
11:12:08FromDiscord<haxscramper> there is already one in header, at least if it is written properly
11:12:09FromDiscord<haxscramper> so no need to
11:12:10FromDiscord<enthus1ast> or passc
11:12:52FromDiscord<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:01FromDiscord<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:03nrds<R2D299> itHub: 7"Running Clang/LLD in WebAssembly Demo"
11:39:33FromDiscord<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:42FromDiscord<fae> https://media.discordapp.net/attachments/371759389889003532/892737390647607336/Screen_Shot_2021-09-29_at_4.37.18_AM.png
11:40:32FromDiscord<fae> (edit) "take" => "compile" | removed "compiled" | "world," => "world in Nim to c,"
11:41:58FromDiscord<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:25FromDiscord<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:18FromDiscord<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:56FromDiscord<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:42FromDiscord<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:43FromDiscord<fae> Like I couldn't get any files parsing, much less compiling to c output
11:48:47FromDiscord<haxscramper> from `.nim` to `.c`
11:49:09FromDiscord<haxscramper> you can try to use `.tcc` library, there is a `--lean-compiler` option or something similar in koch
11:49:17FromDiscord<haxscramper> when it builds
11:49:32FromDiscord<haxscramper> but generally I didn't go any further than parsing
11:49:33FromDiscord<haxscramper> And I don't even know whether my earlier example still works
11:50:26FromDiscord<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:30FromDiscord<fae> one thing i'd like to do is enable pulling nimble packages in the playground
11:51:56ehmryfae: is there ever a reason to run a compiler in a browser?
11:52:08FromDiscord<haxscramper> the eaiest one would be to run nim vm
11:52:13FromDiscord<haxscramper> it does not require anything else
11:52:16FromDiscord<haxscramper> and it is fairly capable
11:52:25FromDiscord<haxscramper> so you just run nim compiler
11:52:33FromDiscord<haxscramper> I have an example for it as well, let me see
11:53:26FromDiscord<fae> In reply to @ehmry "fae: is there ever": fun, idk
11:54:13FromDiscord<haxscramper> https://github.com/haxscramper/hack/blob/4b3672348cef91bb8e9441d29c127e73be5d4b69/testing/nim/compilerapi/test6.nim#L78
11:54:15FromDiscord<haxscramper> okay
11:54:23FromDiscord<haxscramper> again, no promises about it working
11:54:32FromDiscord<haxscramper> but thisis a REPL turned inside out
11:54:48FromDiscord<haxscramper> so I can feed it using queue of lines, I was testing something like
11:54:58FromDiscord<haxscramper> "can VM handle failures in input"
11:55:11FromDiscord<haxscramper> test 6 or test 8 might have something else
11:55:29FromDiscord<fae> nice I'll have a look through these tomorrow, sleep time for now
11:55:32FromDiscord<haxscramper> but honestly this is a huge pile of garbage, sorry i didn't try to keep these examples really
11:55:39FromDiscord<haxscramper> good for examples
11:55:53FromDiscord<haxscramper> So if you have any question you can ping me sometimes later, right now I got to go
11:58:40FromDiscord<xflywind> https://github.com/slangmgh/nims
11:58:42nrds<R2D299> itHub: 7"simple nim repl"
11:58:52FromDiscord<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:07FromDiscord<DMisener> !eval 1+2
12:12:08NimBotCompile failed: /usercode/in.nim(1, 2) Error: expression '3' is of type 'int literal(3)' and has to be used (or discarded)
12:13:03FromDiscord<DMisener> !help
12:13:41FromDiscord<DMisener> !eval echo 1+2
12:13:43NimBot3
12:25:36PMunch@DMisener, the eval command just runs your code with the Nim playground and copies one line of output here
12:28:35FromDiscord<Yardanico> not one line though :P
12:28:54FromDiscord<Yardanico> !eval for x in ..10: echo x
12:28:56NimBot0↔1↔2↔3↔4↔5↔6↔7↔8↔9↔10
12:32:08PMunchAh okay, it only spits out one line though
12:36:04PMunchHmm, 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:32PMunchEssentially 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:28FromDiscord<haxscramper> fixing enums?
13:02:50FromDiscord<haxscramper> for futhark
13:05:22PMunchNah, macros
13:05:42PMunchclang already handles enums just fine
13:06:28PMunchBut 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:40PMunch#define FIVE 2+3
13:07:48FromDiscord<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:51PMunchprintf("%d\n", FIVE * FIVE);
13:07:55PMunchGuess what that prints out
13:08:00FromDiscord<haxscramper> offs
13:08:10FromDiscord<haxscramper> I don't care about this bullshit honestly
13:08:15FromDiscord<haxscramper> and neither should you
13:08:21FromDiscord<haxscramper> how many libs there is that
13:08:25FromDiscord<haxscramper> (1) worht wrapping
13:08:31FromDiscord<haxscramper> (2) use dirty hacks like this?
13:08:40FromDiscord<haxscramper> this is hardly possible to replicate in nim anyway
13:08:43*Guest9380 joined #nim
13:08:50PMunchOh yeah, I wouldn't want to have that behaviour in Nim
13:09:09PMunchI 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:23FromDiscord<haxscramper> because it is not the same
13:09:31FromDiscord<haxscramper> enums are handled by sema
13:09:44FromDiscord<haxscramper> macros are handled by preprocessor callbacks that run two pipeline stages earlier
13:10:00*jjido joined #nim
13:10:04Guest9380Hello 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:05FromDiscord<haxscramper> did you notice macro expansions are placed on top of the translation unit for example?
13:10:12FromDiscord<haxscramper> they are always on the toplevel
13:10:24PMunchThere 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:25FromDiscord<Yardanico> @Guest9380 yes, because arrays are value types
13:10:28FromDiscord<haxscramper> `proc changesArray(arr: var array[3, int])`↔(<@709044657232936960_=47uest9380=5b=49=52=43=5d>)
13:10:41Guest9380Thank you!
13:10:42FromDiscord<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:10Guest9380Great to know.
13:11:16FromDiscord<haxscramper> The best approach that I managed to come up with is↔(<@709044657232936960_=50=4dunch=5b=49=52=43=5d>)
13:11:22FromDiscord<haxscramper> I take macro definition token sequence
13:11:26PMunchGuest9380, 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:05PMunchBut if you use `unsafeAddr` you might be able to modify the underlying array that was passed into your procedure.
13:12:32FromDiscord<haxscramper> and then i replace `<tok> ## <tok>` with specially constructed token names like `TOK_INDEX_1CONCATTOK_INDEX_2`
13:12:36FromDiscord<haxscramper> And then I reparse things backj
13:12:57*jjido quit (Client Quit)
13:12:57FromDiscord<haxscramper> but we have stilk have to operate under assumption that token body forms a valid C code
13:13:00FromDiscord<haxscramper> which is of course not the case
13:13:22FromDiscord<haxscramper> so I need to effectively emulate token expansion process, cutting out as soon as I can ensure that declaration is valid
13:13:31PMunchYeah, currently I just try to parse the value of a macro as an int or a hex number and emit that..
13:13:36FromDiscord<haxscramper> so one level of expansion might not be correct
13:13:42FromDiscord<haxscramper> but two levels of expansion might be correct
13:13:53PMunchThat would probably cover 80% of usecases
13:14:20PMunchWith identifiers and some simple math and bit shifting implemented I think it would be closer to 95% of all usecases
13:15:18FromDiscord<haxscramper> laughs in X11 api↔(<@709044657232936960_=50=4dunch=5b=49=52=43=5d>)
13:15:40FromDiscord<haxscramper> but constant defines are important
13:15:58FromDiscord<haxscramper> so might not be eighty percent, but still the best when it comes to effort/value
13:18:14PMunchX11 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:27FromDiscord<haxscramper> anyway, this is not really important, I might be confusing it with something else
13:19:36FromDiscord<haxscramper> but C preprocessor is still the
13:19:37FromDiscord<haxscramper> well
13:19:39FromDiscord<haxscramper> `const`
13:19:45FromDiscord<haxscramper> and `#define`
13:20:01FromDiscord<haxscramper> two horrors that will haunt nim interop for a long time
13:20:27FromDiscord<haxscramper> of course there are also `virtual`, `T...` and other things
13:20:39FromDiscord<haxscramper> but those are mostly about C++
13:21:48FromDiscord<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:00FromDiscord<haxscramper> For extracting semantic value from macros
13:22:24FromDiscord<haxscramper> but tree-sitter is the best implementation approximation for handling this
13:22:41FromDiscord<haxscramper> boost wave allows to hook into macro transformation process
13:22:50FromDiscord<haxscramper> so I can implement replay I was talking about
13:24:31FromDiscord<haxscramper> https://ruche-home.net/program/boost/wave#hooks-member-expanded-macro
13:25:10FromDiscord<haxscramper> https://www.boost.org/doc/libs/1_75_0/libs/wave/doc/class_reference_ctxpolicy.html#expanding_function_like_macro
13:27:13FromDiscord<haxscramper> if only C was a single language ...
13:27:31FromDiscord<haxscramper> This is literally this meme with "if X was ..." a
13:28:34FromDiscord<haxscramper> https://www.cs.cmu.edu/~ckaestne/pdf/tse17-refactoringifdef.pdf "Refactoring of Preprocessor↔Directives in the #ifdef Hell"
13:28:43FromDiscord<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:01PMunchOkay, pushed something to Futhark that should allow it to wrap simple macros
14:22:06PMunchTotally untested..
14:22:12PMunchAnd 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:01FromDiscord<Yandong Zhang> Hello everyone. Would anyone recommend a format prettier for the Nim?
15:04:44FromDiscord<xflywind> nimpretty
15:05:19FromDiscord<Yandong Zhang> Thank you. I will try it.
15:11:15nrds<Prestige99> Hm just found morepretty, maybe I'll try that out
15:11:19nrds<Prestige99> https://github.com/treeform/morepretty
15:11:20nrds<R2D299> itHub: 7"Morepretty - like nimpretty but with more stuff."
15:13:42FromDiscord<xflywind> It seems to be an enhanced nimpretty using its own parser.
15:16:30FromDiscord<xflywind> Using compiler API may be more robust https://github.com/FedericoCeratto/nimfmt
15:16:33nrds<R2D299> itHub: 7"Nim code formatter / linter / style checker"
15:17:15FromDiscord<xflywind> (though it is more easily broken caused by compiler changes)
15:19:38FromDiscord<Yandong Zhang> I guess that the nimpretty is the most reliable one since it is installed by default (I just tried).
15:20:19FromDiscord<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:23FromDiscord<Daniel> show us after and before 😄
15:48:09FromDiscord<Yandong Zhang> @Daniel\: Supposedly, those formatter/prettier/... should keep the original somewhere by default.
15:49:16FromDiscord<Yandong Zhang> Maybe I can add a wrapper to do\: Step 1\: save the backup Step2. nimfmt
15:51:04FromDiscord<NullCode> In reply to @Daniel "show us after and": I wanna see too
15:51:14FromDiscord<NullCode> Before format and after format
15:59:34FromDiscord<konsumlamm> PMunch: btw, are you aware that futhark is also the name of a programming language?↔https://futhark-lang.org/
16:00:00FromDiscord<NullCode> I wonder what futhark is
16:00:43FromDiscord<NullCode> Damn the lang is pretty cool
16:00:55FromDiscord<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:21FromDiscord<Lefl> sent a long message, see http://ix.io/3Ala
16:25:56FromDiscord<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:07FromDiscord<Gumber> just giving us your SQL statement(s) isn't really going to help....
16:26:42FromDiscord<Lefl> (edit) "long message," => "code paste," | "http://ix.io/3Ala" => "https://play.nim-lang.org/#ix=3Alb"
16:26:49FromDiscord<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:00FromDiscord<Gumber> That's still not enough info @Lefl
16:27:05FromDiscord<Gumber> we need to see the error / stacktrace
16:27:06FromDiscord<Gumber> thanks
16:27:11FromDiscord<Lefl> sent a code paste, see https://play.nim-lang.org/#ix=3Alc
16:27:18FromDiscord<Gumber> okay soooooo you're not using `MariaDB` right?
16:27:22FromDiscord<Lefl> I am
16:27:24FromDiscord<Gumber> you're using `MySQL`?
16:27:27FromDiscord<Lefl> no
16:27:48FromDiscord<Gumber> now I'm very confused because above you mentioned MySQL
16:28:01FromDiscord<Lefl> It doesn't matter, the syntax is fine
16:28:08FromDiscord<Gumber> well apparently it's not
16:28:14FromDiscord<Lefl> It is
16:28:16FromDiscord<Gumber> at least the SQL the DB engine is receiving is not
16:28:39FromDiscord<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:42FromDiscord<enthus1ast> @Lefl\: split the commands by ";" and run them command by command
16:28:55FromDiscord<Lefl> hmm I'll try
16:28:56FromDiscord<Gumber> okay you have to understand though
16:29:12FromDiscord<Gumber> you have a layer in between your SQL's execution engine and your SQL statement now
16:29:19FromDiscord<Gumber> which is your Nim program / the db client lib
16:29:28FromDiscord<Lefl> Yes
16:29:31FromDiscord<Lefl> I know
16:29:31FromDiscord<Gumber> so you can't say I get this result when I run this in my SQL editor
16:29:37FromDiscord<Lefl> Yes I can
16:29:38FromDiscord<Gumber> so it is totally valid SQL for my Nim program right?
16:29:47FromDiscord<Gumber> okay please just be patient with my typing and responses
16:30:06FromDiscord<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:16FromDiscord<Gumber> appears to be the problematic statement
16:30:17FromDiscord<Gumber> sent a code paste, see https://play.nim-lang.org/#ix=3Ale
16:30:54FromDiscord<Gumber> now can you please give me the full Nim code you're using to execute these statements?
16:30:59FromDiscord<Gumber> so I can understand what modules you're importing
16:31:04FromDiscord<Gumber> etc....
16:31:19FromDiscord<Gumber> I don't need the entire codebase just the module that is executing these SQL statements
16:31:42FromDiscord<Lefl> db_mysql
16:32:15FromDiscord<Gumber> thanks
16:32:49FromDiscord<Lefl> In reply to @enthus1ast "<@241571229692198915>\: split the commands": Ah splitting it seems to have worked
16:32:56FromDiscord<Gumber> Nice
16:33:01FromDiscord<Lefl> Thanks
16:33:08FromDiscord<Gumber> Well it was all enthus1ast
16:33:24FromDiscord<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:35FromDiscord<Gumber> my goal was to help you 🙂
16:33:40FromDiscord<Lefl> Don't worry
16:33:44FromDiscord<Gumber> but I'm glad you've gotten it figured out now!
16:33:53FromDiscord<Lefl> Sorry if I seemed angry or something
16:33:56FromDiscord<Gumber> nah it's cool
16:34:00FromDiscord<Gumber> I have ADHD / spectrum stuff
16:34:05FromDiscord<deech> sent a code paste, see https://paste.rs/ewg
16:34:07FromDiscord<Gumber> so I can't always like relate / interpret things correctly
16:34:34FromDiscord<Gumber> but yeah - I'm glad it's sorted out now 😄
16:48:13*Guest55 joined #nim
16:48:46Guest55Hello everyone, I found this interesting repository . https://github.com/oakes/vim_cubed
16:48:55nrds<R2D299> itHub: 7"Vim rendered on a cube for no reason"
16:49:17Guest55But when I run the
16:49:18Guest55nimble install, it is reported error
16:49:32Guest55Error: Could not find a file with a .nimble extension inside the specified directory: C:\WINDOWS\system32
16:49:52Guest55This line work well: nimble install paravim
16:50:06Guest55But the "nimble install" does not work
16:50:56Guest55Have anyone tried it?
16:53:03FromDiscord<Marcin> any MySQL ORM for windows are there maby?
16:53:52FromDiscord<Gumber> for windows?
16:53:56FromDiscord<Marcin> yep
16:53:58FromDiscord<Gumber> ORMs generally aren't platform specific
16:53:59FromDiscord<enthus1ast> well we have ormin and norm
16:54:02FromDiscord<Gumber> just FYI
16:54:08FromDiscord<Gumber> they're DB specific
16:54:13FromDiscord<Gumber> or dbengine specific rather
16:54:21FromDiscord<Gumber> and sometimes not even then
16:54:24FromDiscord<enthus1ast> and another one but i forgot the name
16:54:29FromDiscord<Gumber> sometimes they can handle a bunch of db engines
16:54:32FromDiscord<Gumber> like spring data
16:55:02FromDiscord<Marcin> In reply to @enthus1ast "well we have ormin": but i see they aren't support mysql? 😩
16:55:30FromDiscord<enthus1ast> ah good point
16:55:34FromDiscord<enthus1ast> i guess then not
16:55:41FromDiscord<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:07FromDiscord<Marcin> business need this for now so im lookin around to get something working at the moment
16:56:59FromDiscord<Gumber> gotcha
16:57:02FromDiscord<Marcin> ok so we know now what we need for expand the community of Nim 😉
16:57:11FromDiscord<Marcin> maby if i ll get some free time il make one
16:57:14FromDiscord<Gumber> well, to expand the web dev sector anyway xD
16:57:17FromDiscord<Gumber> or app dev sector
16:57:22FromDiscord<Marcin> yep 🙂
16:57:24FromDiscord<Gumber> I don't have much use for ORMs or MySQL
16:57:25FromDiscord<Gumber> 🙂
16:57:39FromDiscord<enthus1ast> i like ormin but it lacks a lot of features
16:57:40FromDiscord<Marcin> by default im fan of raw sql
16:57:46FromDiscord<Marcin> but somethimes to make prototypes
16:57:51FromDiscord<Gumber> I mean I'm pretty sure ou can just do prepared statements w/ Nim etc
16:57:57FromDiscord<Marcin> its nice to get some production speed 😉
16:57:58FromDiscord<Gumber> but yeah I feel you sometimes ORMs are nice
16:58:03FromDiscord<Gumber> Spring data spoiled me a lot
16:58:14FromDiscord<Gumber> but I don't do web dev in my spare time anymore - only game dev and soon embedded stuff hopefully
16:58:20FromDiscord<Gumber> once I get my pine64 phone
16:58:28FromDiscord<Gumber> and I start building my ADHD software
16:59:09FromDiscord<Marcin> In reply to @Gumber "but I don't do": yeah it's can help to make some of network code.
16:59:30FromDiscord<Marcin> but for network code of games we dont use ORM right? 😉
17:00:05FromDiscord<Marcin> but anyway its nice to have in ecosystem
17:00:16FromDiscord<Marcin> so ill help with that in free time
17:00:20FromDiscord<Gumber> well a lot of games don't use databases
17:00:26FromDiscord<Marcin> yea u right
17:00:27FromDiscord<Gumber> like mine doesn't - and it's a 3d networked RTS
17:00:34FromDiscord<Gumber> but I mean - some games do, especially MMOs etc
17:00:45FromDiscord<Gumber> a lot of games that need a DB type deal will use flatfiles or an in-memory DB
17:00:46FromDiscord<Marcin> yeah online games are based
17:00:54FromDiscord<Gumber> and the abstraction could be useful there - but IMO simple is better always
17:00:55FromDiscord<Marcin> if not for game - for analytics, telemetry etc
17:00:59FromDiscord<Gumber> yeah
17:01:02FromDiscord<Gumber> exactly that kind of stuff
17:01:07FromDiscord<Gumber> but my games are like thick client desktop apps
17:01:14FromDiscord<Gumber> the only network communication they do is to steam / other gamer services
17:01:18FromDiscord<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:24Guest55The vim3 is totally amazing. https://github.com/oakes/vim_cubed
17:01:26nrds<R2D299> itHub: 7"Vim rendered on a cube for no reason"
17:01:26FromDiscord<Gumber> well I'm making one that works for me 🙂
17:01:27FromDiscord<Marcin> In reply to @Gumber "and the abstraction could": simple is better - You are 100% right 😉
17:01:30FromDiscord<Gumber> because I have really really bad ADHD
17:01:35Guest55Eveyone should use it to do the code review.
17:01:46Guest55So we can have a wide vision.
17:01:52FromDiscord<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:06FromDiscord<Gumber> In reply to @Guest55 "So we can have": Not really sure what you're talking about
17:02:15FromDiscord<Gumber> get them sent to my smartwatch
17:02:42FromDiscord<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:53FromDiscord<Gumber> without the ridiculous interfaces / flashy crap a lot of the productivity apps have
17:03:01*Guest55 quit (Quit: Client closed)
17:03:41FromDiscord<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:55FromDiscord<Gumber> nothing I've found really works in that way - or at least doesn't solve the whole picture for me
17:04:22FromDiscord<Gumber> anywho - gotta run to my dr appt, bbl!
17:04:27FromDiscord<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:27FromDiscord<fae> @haxscramper was trying out your minimal compiler example but was having issues with `hmisc` on osx
17:06:50FromDiscord<fae> `clang: error: the clang compiler does not support -pg option on versions of OS X 10.9 and later`
17:07:25FromDiscord<haxscramper> I can't do anything with this, I don't even know where `-pg` comes from
17:07:34FromDiscord<haxscramper> And why it was added
17:07:36FromDiscord<fae> i imagine here https://github.com/haxscramper/hmisc/blob/06873884a15d06483bc688839c3d50e547913b75/src/hmisc/scripts/nim.cfg#L3
17:08:01FromDiscord<fae> is there a way to override cfg from a consuming package?
17:08:19FromDiscord<haxscramper> this cfg should not be touched in the first place
17:08:20FromDiscord<haxscramper> and no
17:08:36FromDiscord<haxscramper> well, you can just go to the `.nimble` and edit things there
17:08:45FromDiscord<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:53FromDiscord<haxscramper> `~/.nimble/pkgs/hmisc-...`
17:09:03FromDiscord<haxscramper> just edit the file
17:09:13FromDiscord<fae> yea i already did that, was just letting you know
17:27:29FromDiscord<konsumlamm> In reply to @Gumber "huh? it's not a": it's also the name of a language: https://futhark-lang.org/
17:29:41FromDiscord<Yardanico> lol
17:29:56FromDiscord<dom96> Naming is hard
17:30:10FromDiscord<Recruit_main707> ^
17:42:07FromDiscord<Shoto> In reply to @Gumber "because I have really": Oh a fellow neurodivergent-
17:56:52FromDiscord<reilly> sent a code paste, see https://play.nim-lang.org/#ix=3AlB
17:57:50FromDiscord<Rika> Setting and using that value at the same time
18:06:33FromDiscord<reilly> In reply to @Rika "Setting and using that": But since there's no condition, what ends the loop?
18:10:29FromDiscord<Rika> When the value is falsey
18:10:37FromDiscord<Rika> C has no Booleans
18:10:53FromDiscord<Rika> 0 is “falsey” and anything else is truths I believe
18:10:58FromDiscord<Rika> (edit) "truths" => "truthy"
18:20:08FromDiscord<reilly> When `instr` is falsey?
18:20:36FromDiscord<Rika> When it is set to a false value
18:27:30FromDiscord<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:44FromDiscord<Gumber> In reply to @konsumlamm "it's also the name": oh jesus, thanks for waking me up to that lol
19:10:51FromDiscord<Gumber> too many similar named things
19:11:28FromDiscord<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:01FromDiscord<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:03FromDiscord<Gumber> (edit) "sorry~!" => "sorry!"
19:17:23*FromDiscord quit (Ping timeout: 252 seconds)
19:17:40*FromDiscord joined #nim
19:22:40nrds<Prestige99> What is the use of the `end` keyword?
19:23:43FromDiscord<konsumlamm> In reply to @Gumber "btw <@!312654963694108674> I need": i don't remember anything like that, so all fine
19:29:22FromDiscord<Yardanico> @Prestige it's used for SCFs\
19:29:23FromDiscord<Yardanico> (edit) "SCFs\" => "SCFs"
19:30:00FromDiscord<Yardanico> well, those are deprecated now anyway
19:30:12FromDiscord<Yardanico> ah right, they're not
19:30:13FromDiscord<Yardanico> https://nim-lang.org/docs/filters.html
19:30:47nrds<Prestige99> hmm
19:44:44NimEventerNew 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:20FromDiscord<Yardanico> wonder what's the usefulness of using "distinct" in his code
19:48:18nrds<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:47FromDiscord<Shoto> Is it possible to make Nim output the C code that's compilable on any platform?
20:49:57FromDiscord<Gumber> Nim already does this?
20:50:07FromDiscord<Gumber> you need to invoke the correct compiler toolchain
20:50:15FromDiscord<Gumber> for your target OS / cpu arch
20:50:15FromDiscord<haxscramper> I don't think so, most platform-specific stuff is generated based on nim compilation checks
20:50:28FromDiscord<haxscramper> so things like `when defined(windows)` in the stdlib etc.
20:50:42FromDiscord<Gumber> oh yeah I mean you need to handle platform specific stuff on the Nim side
20:51:02FromDiscord<Gumber> but as far as the generated code - it will generate for whatever platform / cpu arch you say it should
20:51:11FromDiscord<Gumber> in Nim
20:51:32FromDiscord<Gumber> and with the generated C code as long as you invoke the correct compiliation toolchain
20:51:36FromDiscord<Gumber> (edit) "compiliation" => "compilation"
20:51:50FromDiscord<Gumber> you can target whatever you want.... as long as Nim supports it (and it supports a lot of targets)
20:51:58FromDiscord<Gumber> if you want an ezmode solution I'd check out zigcc
20:52:01FromDiscord<Gumber> (edit) "zigcc" => "`zigcc`"
20:53:12*rockcavera joined #nim
20:53:49FromDiscord<Shoto> Oh okay then
20:53:53FromDiscord<Shoto> Ezmode?
20:54:31FromDiscord<Gumber> easier than having to use a separate compilation toolchain
20:54:54FromDiscord<Shoto> Oh okay
21:00:24*Vladar quit (Quit: Leaving)
21:05:38FromDiscord<Yardanico> Oo, new hacktoberfest rules are even stricter than the last year
21:05:42FromDiscord<Yardanico> "I acknowledge that I will be disqualified indefinitely from Hacktoberfest if I submit two invalid pull requests."
21:05:52FromDiscord<dom96> oooh
21:06:05FromDiscord<dom96> the time for another t-shirt is here
21:06:20FromDiscord<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:44FromDiscord<Yardanico> Also this year hacktoberfest supports GitLab
21:07:31FromDiscord<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:40Mister_Magisterhow do you clear sequence?
21:09:03FromDiscord<Elegantbeef> `yourSeq.setLen(0)`
21:09:03FromDiscord<Yardanico> setLen(0)
21:09:27FromDiscord<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:32FromDiscord<Yardanico> It's quite unlikely anyway
21:10:17FromDiscord<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:20Mister_Magisterwhy isn't setLen in docs
21:10:26FromDiscord<Yardanico> it is though
21:10:27Mister_Magisterwait
21:10:28Mister_Magisterit is
21:10:30FromDiscord<Yardanico> system module
21:10:37Mister_Magisterthats kinda dumb tho
21:10:41Mister_Magisterbut whatever
21:10:42Mister_Magisterthanks
21:11:48nrds<Prestige99> Yeah it's hard to find things sometimes
21:12:10nrds<Prestige99> if you're having trouble usually check the manual or system page
21:13:12Mister_Magister!eval echo test
21:13:13NimBotCompile failed: /usercode/in.nim(1, 6) Error: undeclared identifier: 'test'
21:13:16nrds<R2D299> /usercode/in.nim(1, 6) Error: undeclared identifier: 'test'
21:13:21Mister_Magisterwhy two
21:14:14Mister_Magister!eval var test: seq[string] = @["test"]; open(test[0])
21:14:15NimBotCompile 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:17nrds<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:26Mister_Magister!eval var test: seq[string] = @["test"]; discard open(test[0])
21:14:29NimBot/usercode/in.nim(1) in↔/playground/nim/lib/system/io.nim(741) open↔Error: unhandled exception: cannot open: test [IOError]
21:14:31nrds<R2D299> /usercode/in.nim(1) in /playground/nim/lib/system/io.nim(741) open Error: unhandled exception: cannot open: test [IOError]
21:14:36Mister_Magisterhmm
21:14:46Mister_Magisterthats weird
21:15:10Mister_Magisterahhh i see, problem is somewhere else
21:15:31Mister_Magister!eval var test: seq[string] = @["test", "0"]; discard open(test[test[1]])
21:15:32NimBotCompile failed: /usercode/in.nim(1, 58) Error: type mismatch: got <seq[string], string>
21:15:34nrds<R2D299> /usercode/in.nim(1, 58) Error: type mismatch: got <seq[string], string>
21:15:36Mister_Magisterexactly
21:16:01Mister_Magisterhow do you convert string to itn
21:16:07Mister_MagisterparseInt
21:16:15Mister_Magister!eval var test: seq[string] = @["test", "0"]; discard open(test[parseInt(test[1])])
21:16:17NimBotCompile failed: /usercode/in.nim(1, 59) Error: undeclared identifier: 'parseInt'
21:16:18nrds<R2D299> /usercode/in.nim(1, 59) Error: undeclared identifier: 'parseInt'
21:16:29Mister_Magister!eval use strutils; var test: seq[string] = @["test", "0"]; discard open(test[parseInt(test[1])])
21:16:30NimBotCompile failed: /usercode/in.nim(1, 1) Error: undeclared identifier: 'use'
21:16:32nrds<R2D299> /usercode/in.nim(1, 1) Error: undeclared identifier: 'use'
21:16:41Mister_Magister!eval import strutils; var test: seq[string] = @["test", "0"]; discard open(test[parseInt(test[1])])
21:16:45NimBot/usercode/in.nim(1) in↔/playground/nim/lib/system/io.nim(741) open↔Error: unhandled exception: cannot open: test [IOError]
21:16:46nrds<R2D299> /usercode/in.nim(1) in /playground/nim/lib/system/io.nim(741) open Error: unhandled exception: cannot open: test [IOError]
21:16:52Mister_Magisterperfecto
21:17:15FromDiscord<Elegantbeef> you know there are REPLs and also multiple websites that run nim code?
21:17:28Mister_Magisteryeah sorry
21:17:45Mister_Magisterjust thought i would ask for help with example but instead i got answer
21:18:56Mister_Magisterwhat is openArray exactly?
21:19:31Mister_Magister!eval var s: openArray[uint8]
21:19:33NimBotCompile failed: /usercode/in.nim(1, 5) Error: invalid type: 'openArray[uint8]' for var
21:19:34nrds<R2D299> /usercode/in.nim(1, 5) Error: invalid type: 'openArray[uint8]' for var
21:19:39FromDiscord<Elegantbeef> https://nim-lang.org/docs/manual.html#types-open-arrays
21:19:39Mister_Magisteryeah here, why
21:19:46Mister_Magisterwhy is it invalid type?
21:20:46Mister_Magisterit should be fine but its not
21:24:24nrds<Prestige99> openArray can only be used as a param
21:25:02FromDiscord<Yardanico> @Prestige what's this nrds bot?
21:25:11Mister_Magisterah
21:25:41FromDiscord<Yardanico> And can you please disable its !eval in this chat as it conflicts with the one we have in NimBot
21:28:59nrds<Prestige99> nrds is just the relay it's another bot in here but I'll disable it for your side
21:29:43FromDiscord<Yardanico> huh, what does it relay to? your telegram group or something?
21:30:17nrds<Prestige99> another irc network
21:30:35Mister_Magisterhttps://nim-lang.org/docs/io.html#readBytes%2CFile%2CopenArray%5B%5D%2CNatural%2CNatural
21:30:38Mister_Magisterthis, this is dumb
21:31:02Mister_Magisterif i have 1TB file and i want to read 1 byte at the end of it i have to allocate 1TB array
21:31:06Mister_Magisterjust to read one byte
21:31:18FromDiscord<Yardanico> no?
21:31:36Mister_Magisteryes?
21:31:44Mister_Magisterreads len bytes into the buffer a starting at a[start].
21:31:49Mister_Magisterstarting at a[start].
21:31:58FromDiscord<Yardanico> https://nim-lang.org/docs/io.html#setFilePos%2CFile%2Cint64%2CFileSeekPos
21:32:15Mister_Magisterstill dumb
21:32:28FromDiscord<Yardanico> ok
21:34:22FromDiscord<Elegantbeef> It's how it works everywhere
21:34:33FromDiscord<Elegantbeef> You open a file you move the file to X pos and read data
21:34:40FromDiscord<Elegantbeef> Welcome to file streaming
21:44:17FromDiscord<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:30FromDiscord<dom96> stop calling things you think don't make sense 'dumb'
21:46:59nrds<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:42nrds<Prestige99> each Vec2 is essentially an object with an arr: array[2, float]
21:50:08nrds<Prestige99> Only thing I can really think of is duplicating the vertices into a single array
21:50:19Mister_Magister@dom96 why
21:57:37*max22- quit (Quit: Leaving)
22:20:36FromDiscord<MaksimBoyarkin> Hello, MS Defender find Malware in Nim archive for windows
22:20:38FromDiscord<MaksimBoyarkin> https://www.microsoft.com/en-us/wdsi/threats/malware-encyclopedia-description?Name=TrojanDropper:Win32/Zpevdo.B&ThreatID=2147774529
22:20:44FromDiscord<Elegantbeef> Why what? Why do you have to seek to the end or stop calling things dumb?
22:21:00FromDiscord<MaksimBoyarkin> https://media.discordapp.net/attachments/371759389889003532/892898783715811388/SPOILER_unknown.png
22:21:20FromDiscord<Elegantbeef> Yea windows defender falsely things nim tooling is a virus
22:22:51FromDiscord<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:37FromDiscord<dom96> which exe did it highlight as malware?
22:30:54*stkrdknmibalz joined #nim
22:31:10FromDiscord<MaksimBoyarkin> In reply to @dom96 "which exe did it": nim-1.4.8\bin\nimble.exe
22:40:28*cyraxjoe joined #nim
23:05:00FromDiscord<dom96> also new RC2 also affected https://forum.nim-lang.org/t/8466#54728
23:11:37FromDiscord<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:32FromDiscord<MaksimBoyarkin> Perhaps these things allow you to add an antivirus signature to the company database
23:26:03NimEventerNew 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/