<< 27-03-2020 >>

00:07:14FromGitter<zetashift> Does the playground compile with any special options? My code compiles fine on playground but on my local laptop it fails with a type mismatch
00:07:21FromGitter<zetashift> and the code is just copy pasted ><
00:07:28leorizeno
00:07:54Yardanicocan you share the code?
00:07:59Yardanicoand maybe it's arch/os specific
00:08:41FromGitter<zetashift> https://play.nim-lang.org/#ix=2fBQ
00:08:47FromGitter<zetashift> well it's a type mismatch error
00:09:06FromGitter<zetashift> The error being: `C:\Users\Administrator\.choosenim\toolchains\nim-1.0.6\lib\pure\unittest.nim(665, 14) Error: type mism ⏎ atch: got <Matrix[W - 1, H - 1], Matrix[3, 3]> ⏎ but expected one of: ⏎ proc `==`I, T (x, y: array[I, T]): bool ⏎ first type mismatch at position: 2` [https://gitter.im/nim-lang/Nim?at=5e7d4422d783bb5a9d8dfa18]
00:09:42Yardanicoworks for me on latest devel on linux
00:09:50Yardanicoand passes the test
00:10:25FromGitter<zetashift> I'm on Windows but I really don't see how this could be OS specific
00:10:39FromDiscord<KingDarBoja> I am on Windows, let me see
00:11:39*Guest13532 quit (Ping timeout: 265 seconds)
00:11:58*vivus joined #nim
00:12:11FromDiscord<KingDarBoja> All good here!
00:12:13dom96different nim version?
00:12:22FromGitter<zetashift> I tried with 1.0.6 and devel
00:12:42FromDiscord<KingDarBoja> 1.0.6
00:14:28FromGitter<zetashift> So in my project I do have the `==` operator defined in another file
00:14:46FromGitter<zetashift> might that be an issue? I made that snippet to repro my error
00:15:39Yardanicoand is Matrix defined in the same file too?
00:17:31*dadada joined #nim
00:17:55*dadada is now known as Guest40664
00:30:13*ksandvik quit (Quit: Leaving.)
00:33:37*krux02_ joined #nim
00:35:19FromDiscord<Spy653> Hey do you guys mind if I post a survey I've made? It's about what techies think of IoT products (examples in the survey)
00:35:48Yardanicoit's better if you would post it on the forum, this is a real-time chat after all :)
00:36:06*krux02 quit (Ping timeout: 240 seconds)
00:38:26FromDiscord<Spy653> I'm throwing it around some discord servers
00:41:09*Guest40664 quit (Ping timeout: 250 seconds)
00:43:13*dsrw joined #nim
00:43:26Yardanicowell that's not the best way, it's better to post it on relevant forums
00:46:44FromDiscord<Spy653> Fair, I'll throw it there when I can
00:47:39*dadada_ joined #nim
00:48:20*rnrwashere joined #nim
00:49:22*sagax quit (Remote host closed the connection)
00:51:39*opal joined #nim
00:52:21*rnrwashere quit (Remote host closed the connection)
00:57:48*thomasross joined #nim
01:00:08FromGitter<zetashift> @Yardanico yeah Matrix is defined in the same file as the `==` but not in the same file as the test
01:00:34Yardanicowell it even works for me even if I define matrix and == in a separate file
01:01:49FromGitter<zetashift> Yea, I have an overloaded func of submatrix that takes no parameter and that works fine
01:02:02FromGitter<zetashift> but I have no idea why this one gives me the type mismatch error
01:10:59*dadada_ quit (Ping timeout: 260 seconds)
01:17:26*dadada joined #nim
01:17:50*dadada is now known as Guest8146
01:18:53FromGitter<zetashift> https://github.com/zetashift/naytracer here is my full project
01:19:09FromGitter<zetashift> I'm also calling it night, too tired to look at this ;__;. Good night y'all
01:23:17*Trustable quit (Remote host closed the connection)
01:36:17disruptekfucking alcoholic family members are going to kill us all because they cannot get their drugs delivered like the rest of us.
01:38:39*dsrw quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
01:41:03*Asgaroth_ joined #nim
01:41:23*Guest8146 quit (Ping timeout: 250 seconds)
01:41:25FromDiscord<KingDarBoja> Whaaat
01:42:59disruptekirl intensifies
01:44:18*Asgaroth quit (Ping timeout: 256 seconds)
01:46:12disruptekmight have to handcuff some bitches to the radiator.
01:46:31*vivus quit (Quit: Leaving)
01:46:47*rnrwashere joined #nim
01:47:32*dadada_ joined #nim
01:58:36*endragor joined #nim
02:06:08*krux02_ quit (Remote host closed the connection)
02:09:02*ksandvik joined #nim
02:11:31*dadada_ quit (Ping timeout: 265 seconds)
02:15:14*zacharycarter quit (Ping timeout: 240 seconds)
02:16:15*dsrw joined #nim
02:17:26*dadada joined #nim
02:17:50*dadada is now known as Guest50054
02:22:07*endragor quit (Remote host closed the connection)
02:22:39*dsrw quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
02:23:36*endragor joined #nim
02:26:59*ksandvik quit (Quit: Leaving.)
02:30:29*chemist69_ joined #nim
02:33:14*chemist69 quit (Ping timeout: 240 seconds)
02:36:35*rnrwashere quit (Remote host closed the connection)
02:41:11*Guest50054 quit (Ping timeout: 250 seconds)
02:47:30*dadada_ joined #nim
02:47:56*zacharycarter joined #nim
02:53:14*zacharycarter quit (Ping timeout: 240 seconds)
03:07:18*endragor quit (Remote host closed the connection)
03:10:07*endragor joined #nim
03:10:52*waleee-cl quit (Quit: Connection closed for inactivity)
03:11:29*dadada_ quit (Ping timeout: 258 seconds)
03:14:23*endragor quit (Remote host closed the connection)
03:17:28*dadada joined #nim
03:17:52*dadada is now known as Guest54221
03:21:27*zacharycarter joined #nim
03:25:49*zacharycarter quit (Ping timeout: 250 seconds)
03:28:50*rnrwashere joined #nim
03:38:01FromDiscord<Yardanico> oh noes
03:38:01FromDiscord<Yardanico> https://cdn.discordapp.com/attachments/371759389889003532/692940466315984946/2020-03-27-06-37-39_grim.png
03:38:22FromGitter<Knaque> I made a CLI that makes it a bit easier to host a home Git server: https://github.com/Knaque/prigit/
03:40:07*rnrwashere quit (Remote host closed the connection)
03:41:37*Guest54221 quit (Ping timeout: 264 seconds)
03:47:28*dadada_ joined #nim
03:52:08*muffindrake quit (Ping timeout: 256 seconds)
03:52:19FromDiscord<Benumbed> Problem solved
03:54:15*muffindrake joined #nim
03:59:28*sagax joined #nim
04:03:00*sagax quit (Client Quit)
04:11:38*dadada_ quit (Ping timeout: 256 seconds)
04:17:27*dadada joined #nim
04:17:52*dadada is now known as Guest6997
04:25:50Yardanico!last shashlick
04:25:51disbotshashlick spoke in 12#nim 29 hours ago
04:27:14Yardanicoshashlick: you around? just wanted to ask a question about nimterop - what if it errors on a header while doing cImport (with recurse=true) if that header imports other ones like "vlc/libvlc.h" even if they're in same dir? I wanted to make a libvlc wrapper so I wrote some code but it errors because of this https://play.nim-lang.org/#ix=2fDd
04:28:10Yardanicowell I guess it would work if I cImport every header separately
04:29:02shashlickSup
04:29:23Yardanicoi've never used nimterop before so I'm really stupid with it :P
04:30:03shashlickNo worries
04:30:06*endragor joined #nim
04:30:13shashlickYou need to set the include directory correctly
04:31:05shashlickI don't remember if it gets set automatically with search dir
04:31:16Yardanicooh yeah cIncludeDir(baseDir / "include") worked
04:31:36Yardaniconow I get tons of errors but that's expected :P
04:31:52*rockcavera quit (Remote host closed the connection)
04:31:55Yardanicobut it processes all header files at least
04:32:05shashlickCool ya
04:32:19shashlickI thought someone else had worked on vlc before
04:32:33Yardanicoyeah, I thought the same, but found no repos
04:35:19Yardanicoshashlick: is it ok if I got a sigsegv? :P
04:35:28*nsf joined #nim
04:35:42Yardanicohttps://play.nim-lang.org/#ix=2fDe
04:35:45shashlickI don't think anyone likes those 😄
04:36:38shashlickWhat's the crash
04:37:03YardanicoNo stack traceback available
04:37:03YardanicoSIGSEGV: Illegal storage access. (Attempt to read from nil?) [AssertionError]
04:37:16Yardanicoafter it inputs some generated nim code on the stdout
04:37:32shashlickUgh toast is crashing but it's unclear why
04:38:04shashlickCan you recompile toast?
04:38:20Yardanicoyeah, I can try
04:38:44shashlickI've seen this before and tried to compile with debug but couldn't reproduce again
04:39:46Yardanicodo I just need to compile toast.nim from nimterop and put it in PATH so nimterop picks it?
04:40:45Yardanicoah nvm found toastExePath so I can edit it real quick
04:40:55shashlickhttps://github.com/genotrance/nimarchive/issues/10
04:40:56disbotSIGSEGV Nim 1.2+
04:41:06Yardanicoyeah I have devel too
04:41:13*Guest6997 quit (Ping timeout: 250 seconds)
04:41:57shashlickI discussed this with Juan on telegram few days ago
04:42:11shashlickWill be great if you can get a stack trace
04:42:27Yardanicowair it doesn't sigsegv with a binary compiled manually
04:42:31Yardanicoeither in debug or -d:release
04:42:40shashlickI couldn't get it to print one and it worked fine in gdb as well
04:42:43Yardanicothe one built by nimterop does
04:42:52Yardanico(when it builds toast automatically on installing)
04:43:25YardanicoI just tried reinstalling it and it doesn't sigsegv either :D
04:43:26shashlickYou're able to recreate the crash?
04:43:46shashlickExactly what I saw
04:43:57Yardanicomaybe a codegen/gc issue then?
04:44:09Yardanicoif the same code works or doesn't work sometimes
04:44:17shashlickCould be but how to report such an issue
04:44:56shashlickNimterop is tested with devel in the CI
04:45:12Yardanicoyeah, IDK how to reproduce it now, after recompiling toast binary it just disappeared
04:45:59shashlick4raq's fault :)
04:46:15Yardanicobtw, why don't the generated nim files pick my "dynvlc" thing?
04:46:23Yardaniconimterop puts them all in "failed" cache dir
04:47:27*dadada_ joined #nim
04:47:38shashlickThat's cause the generated code has errors or missing symbols
04:48:31shashlickdynvlc will be set as a pragma but it's only defined in your wrapper
04:49:32Yardanicoseems like there's a lot of code like "media_discoverer_lan* = 1.media_discoverer_category_t"
04:49:57Yardanicobut nim doesn't like it, guess the enum didn't get generated
04:50:08Yardanicoah hmm "defineEnum(media_discoverer_category_t)"
04:50:11shashlickThose are enums remapped to distinct int
04:50:42shashlickSince c enums can be out of order or have duplicates
04:50:51Yardanicoyeah, I know
04:51:02Yardanicoguess that it all fails coz of some syntax error at the beginning on the file :P
04:52:41shashlickWhat's the actual error
04:52:59Yardanicoa ton of errors from nim check
04:53:06Yardanicoit fails for every enum member in all enums
04:53:20Yardanicoah, I guess it all starts because of "'r' << 16* = 1.teletext_key_t"
04:53:26Yardanicothat's of course not corrent Nim syntax :))
04:53:45Yardanicothis enum https://git.videolan.org/?p=vlc.git;a=blob;f=include/vlc/libvlc_media_player.h;h=5e0255a10ac84c449a15e6e3eb2fba2123dd035c;hb=HEAD#l154
04:54:20Yardanicowait why does it try to assign the enum value (?) to itself or something
04:55:01Yardanicothat's how the whole file looks and where it starts - https://gist.github.com/Yardanico/0af5164651914ab17d37daa49af0af41#file-libvlc-nim-L452
04:55:20*dadada_ quit (Ping timeout: 256 seconds)
04:56:04shashlickYou might want to cOverride that and hand wrap it instead
04:56:16Yardanicoyeah, I understand that
04:56:18shashlickAnd report it :)
04:56:41Yardanicoso I just do cOverride and define this values manually or what?
04:56:50Yardanicoso it doesn't generate enum values for this enum
04:57:40shashlickYa
04:59:10shashlickIf you don't need that enum you could hear cSkipSymbol for now
04:59:21shashlickBut it might be used by some other proc
04:59:47shashlickPeople do such crazy things with c
05:08:03Yardanicoshashlick: so I do it like cSkipSymbol(@["libvlc_teletext_key_t"]) ?
05:08:12Yardanicobecause for some reason it's still in generated Nim code
05:12:20Yardanicoit seems that most of the wrapper generated successfully, there's an issue with this enum, vlc_log_t, video_setup_device_info_t and video_output_cfg_t
05:12:27Yardanicoif I remove all procs/types which use these nim check passes
05:16:14shashlickWhat's with those enums
05:16:37Yardanicowell, how can I skip that enum for now? I mean I understand how to rewrite it, but how to say to nimterop to skip it
05:16:54YardanicoI've even tried using cSkipSymbol and put names of all members and enum itself, both with and without the libvlc_ prefix
05:18:01shashlickDo you run with -f
05:18:11shashlickCause it might be caching stuff
05:18:18Yardanicoyeah
05:19:16shashlickIt should be skipping it, I don't see why not
05:19:39Yardanicoi've tried with putting all the possible names https://play.nim-lang.org/#ix=2fDo
05:19:57shashlickRun the toast command with -d
05:20:28shashlickPut rmFile under static
05:20:37Yardanicoit doesn't work there for some reason
05:21:25shashlickAlso cSkipSymbol since it is a proc
05:22:00Yardanicounder static too?
05:22:33shashlickYep
05:27:18*dadada joined #nim
05:27:42*dadada is now known as Guest20842
05:35:18Yardanicoshashlick: well, how I can remove 1 line from the header then? I don't really need that deprecated.h, but vlc.h includes it
05:35:44YardanicoI figured out it removes that file successfully, but then toast fails because vlc.h includes deprecated.h
05:36:10Yardanicowell actually I guess it's mostly ok
05:38:48Yardanicowait, so I just use the code that this program outputs?
05:38:55YardanicoI mean it outputs some generated wrapper
05:39:12Yardanicocan't I make it output to a file?
05:40:54*Guest20842 quit (Ping timeout: 240 seconds)
05:46:50shashlickYou can redirect and save the output
05:47:16Yardanicowell seems like one file in libvlc folder references a type which is not related to vlc but a part of vlc (include file)
05:47:28*dadada_ joined #nim
05:47:38shashlickYou'd have to edit the header before processing to remove deprecated
05:48:05*defection joined #nim
05:48:18shashlickYou can also simply import this wrapper in your code and it will generate only the first time
05:48:33Yardanicocan I cImport multiple files somehow?
05:48:37shashlickAfter that it is cached so is fast
05:48:53shashlickSure just call it multiple times
05:49:21Yardanicoso I don't understand, nimterop will create actual wrapper files only if it finds no issues with nim check?
05:49:23*opal quit (Ping timeout: 240 seconds)
05:49:25shashlickCall that header before vlc
05:49:59shashlickWell when you cimport, it runs parseStmt on the code
05:50:14shashlickIf the wrapper is bad, it will fail compile
05:50:28Yardanicowell seems like it just straight up skipped the struct I needed :P
05:50:43*leorize quit (Ping timeout: 240 seconds)
05:50:46Yardanicoit's this one https://git.videolan.org/?p=vlc.git;a=blob;f=include/vlc_messages.h;h=b6d5843985dccfad5d24a6d7ae1e4a4728023ccd;hb=HEAD#l55
05:50:46shashlickBut the error isn't useful to debug so we write the file and run Nim check so that we get a useful error
05:51:08*silvernode joined #nim
05:51:38shashlickProbably those comments throwing it off
05:51:44Yardanicoah nvm it's my own fault
05:51:49shashlickWhew
05:52:07YardanicoI wanted to ignore it at first but then added vlc_messages.h and forgot to remove them from ignored ones
05:52:15shashlickOk cool
05:52:54Yardanicoseems like it actually generated that object now
05:52:58Yardanicowell I mean struct
05:53:03shashlickNeat
05:54:03Yardanicouh-oh, can nimterop handle this struct? https://git.videolan.org/?p=vlc.git;a=blob;f=include/vlc/libvlc_media_player.h;h=5e0255a10ac84c449a15e6e3eb2fba2123dd035c;hb=HEAD#l511
05:54:13Yardanicoit's a union struct with structs (???)
05:54:31shashlickNope it cannot do nested stuff
05:54:40shashlickAm working on that for ast2
05:54:55shashlickBest to c2nim just that and cOverride
05:55:50*opal joined #nim
06:02:29*narimiran joined #nim
06:02:54Yardanicoshashlick: so how do I actually try again after changing code in the wrapper generator? add -f to nim compiler? it doesn't seem to work
06:03:13Yardanicoah nvm it works I think
06:03:31Yardanicoso another question - what to do if there's a type on cOverrides which uses an enum defined in one of the headers?
06:04:36shashlickIt should get inserted in place
06:05:04shashlickIn context
06:05:31Yardanicowell it seems like if I have 3 cImports, it gets included into all of them, and already fails with the first one
06:05:42Yardanicobut that enum is defined in the second header (so in the second cImport call)
06:06:29shashlickMake sure the cOverride is added after you import those files
06:06:34Yardanicooh
06:07:13Yardanicoit ran with no issues!!!! now where are my files? :P
06:08:07shashlickAwesome!
06:08:36shashlickHow big is this wrapper output
06:08:41shashlickVlc must be huge
06:08:47Yardaniconah it's not the entire vlc
06:08:57Yardanicoit's libvlc
06:09:20Yardanicowait lemme actually make sure it's not failing on something
06:09:41Yardanicoyeah doesn't seem so
06:09:46Yardaniconow how can I get the files it made?
06:11:37*dadada_ quit (Ping timeout: 264 seconds)
06:11:42shashlickLike I said, either import this wrapper in your code
06:11:49Yardanicoah yeah sorry
06:11:57shashlickOr redirect output to file
06:12:37shashlickAnd turn off cDebug if the output is too verbose
06:13:14shashlickAlso look at the docs capability if you want to generate html docs
06:14:09*silvernode quit (Ping timeout: 265 seconds)
06:14:28shashlickhttps://nimterop.github.io/nimterop/docs.html
06:15:53shashlickhttps://github.com/genotrance/nimarchive/blob/master/nimarchive.nimble#L17
06:16:25Yardanicowell, first of all I need to figure out if it works :P
06:16:32YardanicoI initially wanted to use it together with gintro
06:16:48shashlickAgreed
06:17:06*hoffentlichja joined #nim
06:17:32*dadada joined #nim
06:17:55*dadada is now known as Guest99340
06:19:22hoffentlichjaHow does nimble solve package version conflicts?
06:19:24Yardanicook let's try playing a song
06:21:56*rmt quit (Remote host closed the connection)
06:23:13*leorize joined #nim
06:25:12Yardanicoit works!!!!
06:25:14Yardanicoamazing
06:26:09Yardanicoi thought it would be much harder than just *that*
06:38:13*defection quit (Ping timeout: 250 seconds)
06:38:17*arecaceae quit (Remote host closed the connection)
06:38:34*arecaceae joined #nim
06:39:23*silvernode joined #nim
06:41:14*Guest99340 quit (Ping timeout: 256 seconds)
06:43:43Yardanicoshashlick: again thanks a lot :) https://github.com/Yardanico/nim-libvlc
06:47:32*dadada_ joined #nim
06:52:54FromDiscord<Varriount> Araq: I really don't think byaddr should be in Nim. It complicates an already tricky memory situation, especially since the move/copy/borrow stuff is still progressing.
06:53:28leorize+ it's not even documented :P
06:55:49*solitudesf joined #nim
06:58:11*silvernode quit (Ping timeout: 260 seconds)
07:00:00*gmpreussner quit (Quit: kthxbye)
07:01:31FromDiscord<Varriount> leorize: And actually, it's not even memory safe in it's current form: https://github.com/nim-lang/Nim/blob/devel/lib/std/pragmas.nim
07:01:39FromDiscord<Varriount> Of course, the documentation doesn't say that
07:02:00FromDiscord<Varriount> I don't see what advantage it has compared to just using `addr`
07:03:56FromDiscord<Varriount> And yes, I know that you have to import it to use it, but that doesn't mean it should be in the standard library
07:04:40*gmpreussner joined #nim
07:22:25*dddddd quit (Ping timeout: 250 seconds)
07:32:26leorizethe only good thing that come out of it is that we got proper custom pragma support for variables
07:33:34FromDiscord<Varriount> leorize: I did notice that.
07:34:33FromDiscord<Varriount> Right now I'm mostly against new additions to the standard library, unless they really implement functionality that can't already be reasonably achieved using existing language/library functionality.
07:36:29FromDiscord<Varriount> To be blunt, many parts of the standard library are a mess, because various people have built onto the modules without any greater plan for what the api should be.
07:52:33*Yardanico quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
07:53:30*Yardanico joined #nim
07:56:02*dadada_ quit (Ping timeout: 256 seconds)
08:01:20*solitudesf- joined #nim
08:02:31*Yardanico quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
08:02:33*dadada joined #nim
08:02:56*dadada is now known as Guest45313
08:03:59*solitudesf quit (Ping timeout: 260 seconds)
08:05:05*Yardanico joined #nim
08:05:30*Yardanico quit (Client Quit)
08:05:49*Yardanico joined #nim
08:06:18*Yardanico quit (Client Quit)
08:12:31AraqVarriount: it's opt-in though and fills a void
08:13:05Araqand the borrow checking is coming sooner rather than later, other already existing parts of the languae require it
08:20:31*rokups joined #nim
08:26:37*Guest45313 quit (Ping timeout: 264 seconds)
08:28:43*dadada joined #nim
08:29:06*dadada is now known as Guest81327
08:30:46Araqand it's always easy to meta-critic anything (the stdlib has no great plan and is a mess)
08:31:20Araqmaybe it doesn't need a great plan though.
08:32:38FromDiscord<Varriount> Araq: Perhaps not as a whole, but there are plenty of modules that don't really have a clean or well thought out interface.
08:33:14FromDiscord<Varriount> A prime example are the DB modules that always return result values as strings
08:34:40*sleepyqt joined #nim
08:35:32FromDiscord<Varriount> Or the two regex modules
08:36:26*arecaceae quit (Remote host closed the connection)
08:36:50FromDiscord<Varriount> Or strmisc and wordwrap
08:36:50*arecaceae joined #nim
08:37:53*btop_ quit (Quit: Lost terminal)
08:39:50*PMunch joined #nim
08:40:47*krux02 joined #nim
08:40:52FromDiscord<Varriount> (I could go on)
08:44:00FromDiscord<Varriount> And while every standard library has its share of warts, Nim has a far higher relative wart occurrence
08:55:46FromDiscord<Rika> the regex ones are just "wrapper vs higher level version" `pcre` vs `re` isnt it?
08:56:08*Vladar joined #nim
08:56:45FromDiscord<Varriount> Somewhat, but they also have vastly different API styles
08:57:02FromDiscord<Varriount> And it's re vs nre
09:00:52FromDiscord<Rika> i see
09:01:59FromDiscord<Rika> ah so if its re vs nre its more of "theres basically no difference in functionality"
09:05:25lqdev[m]not to mention weird naming like `flushFile` vs `open`, `setPosition` and `getPosition`, and so on
09:06:14lqdev[m]too bad we can't change those.
09:07:54FromDiscord<Rika> `setPosition` in streams, `setFilePos` in io
09:08:08FromDiscord<Rika> `flush` in streams, `flushFile` in io
09:08:23FromDiscord<Rika> basically: just import streams and use that instead 😛
09:11:50lqdev[m]but `seek` and `position` are better names for `setPosition` and `getPosition` respectively
09:12:38lqdev[m]even so, the stdlib naming guidelines discourage the use of `get`/`set` prefixes in favor of getter and setter syntax
09:17:25FromDiscord<Rika> oh man, i used to always type `seek` instead of `setposition`
09:17:40FromDiscord<Rika> also anything with the `get` prefix should have it removed no?
09:18:11FromDiscord<Rika> also i'm not sure about `setPosition` being replaced with `position=`
09:25:35PMunchI agree, the stdlib is a bit wonky in places
09:26:10PMunchDon't get me wrong, it's great, lots of things supported out of the box, but as you mention there are some weird discrepancies in naming and interfaces.
09:26:27PMunchSometimes getting something from one module and passing it to another can also be super inconvenient..
09:26:38PMunchI guess we should write a nonstandard library :P
09:27:09FromDiscord<Rika> a standard nonstandard library let's call it
09:27:28FromDiscord<Rika> perhaps a standardized nonstandard library is more accurate of a name
09:29:04FromDiscord<Varriount> PMunch: I'm currently attempting to port various modules from other stdlibs. Go's is quite nice, though a bit anemic in some areas
09:31:02FromDiscord<Varriount> We will see how that goes
09:33:08FromDiscord<Rika> you got a repo for that?
09:33:23FromDiscord<Varriount> Not yet
09:33:28FromDiscord<Rika> i wanna see it and maybe report possible mistakes
09:35:44PMunchWell I guess it's easier to write a cohesive stdlib if it is a bit sparse :P
09:35:56PMunchMeans there is less places you can mess up at least
09:35:56FromDiscord<Varriount> Rika: I started from the bottom up, function by function. Line 323 is where I've stopped for now.
09:36:36FromDiscord<Rika> incomplete code is code, code doesnt have to be buildable to be pushable 😛
09:39:47FromDiscord<Varriount> Rika: I might take some inspiration from Python's pathlib, but in my opinion it does slightly too much for my taste - https://docs.python.org/3/library/pathlib.html
09:40:11FromDiscord<Rika> i love pathlib
09:40:12FromDiscord<Varriount> Primarily the filesystem operations.
09:40:29Demos[m]Check out c++'s std::filesystem::path, it also takes insparation from pathlib but is a little more focused on just paths
09:40:30FromDiscord<Rika> the FS ones are a bit weird i think too
09:40:40FromDiscord<Varriount> Demos: Thanks, I will
09:40:53FromDiscord<Rika> but there's already `os` though, any issues with os?
09:41:13FromDiscord<Varriount> Rika: Nothing in particular. I just want to do this.
09:41:21FromDiscord<Rika> ah i see that's fine
09:41:50FromDiscord<Varriount> Demos: I'll admit I had discounted C++ - I assumed that any path API would be too foreign to take any ideas from
09:41:56Demos[m]nope!
09:42:10FromDiscord<Varriount> Rika: I like pathlib too, although it's a pain when you end up passing a Path object to a function expecting a string path.
09:42:16Demos[m]tbqh c++ is pretty close to nim semantically
09:44:08FromDiscord<Rika> just `converter toSt`-- well python wouldnt have this but if pathlib were a nim module i'd do this in a heartbeat
09:45:34FromDiscord<Varriount> Eh, you would still have problems if, say, you passed a sequence of Path types to a function expecting a sequence of string paths.
09:47:06FromDiscord<Rika> another `converter toOAString[S: openarray](sq: S[Path]): S[string]` or something or so
09:47:20FromDiscord<Rika> i dont think that'd work but you get my idea
09:47:34FromDiscord<Rika> ahaha, its gonna be a pain yes'
09:47:37FromDiscord<Varriount> Yeah, but what about other containers? Or a sequence of sequence of strings
09:48:01FromDiscord<Varriount> Converters are tempting, though, I'll admit
09:50:01FromDiscord<Varriount> Demos: It's been a while since I've heard from you - are you in a different time zone or something?
09:50:14Demos[m]nah just busy, new job and all
09:50:16Demos[m]less time for nim
09:50:26FromDiscord<Varriount> Don't I know it. :<
09:50:27Demos[m]well less busy now
09:50:29Demos[m]what with covid-19
09:50:45Demos[m]I am in a different timezone though, moved to washington
09:50:54FromDiscord<Varriount> Ah, that would explain it.
09:51:18FromDiscord<Varriount> My sleep schedule has lost all sense of normalcy without the constraint of appointments, etc.
09:51:27Demos[m]same
09:51:33Demos[m]and apperently same for my entire team :D
09:51:47Demos[m]it's 3AM here....
09:54:39FromDiscord<Varriount> Nearly 6 AM here
09:55:21Demos[m]that almost reasonable
09:56:03FromDiscord<Varriount> It might be, if I hadn't woken up at 3:00 yesterday.
09:56:05PMunchDepends, is it 6AM because you got up, or 6AM because you haven't gone to bed..
09:56:24Demos[m]heh
09:56:39*filcuc joined #nim
09:57:00PMunchI at least have video meetings and such still, otherwise my sleep cycle would be completely out of wack as well
09:57:23PMunchLast time I was left to myself for an extended period of time my cycle drifted 12 hours in about two-three weeks
09:57:34Demos[m]yeah we've been less and less productive as this has gone on
09:57:36PMunchSo I got up at 8PM and went to bed around 11-12AM
09:57:52PMunchThat was, strange
09:58:24Demos[m]my problem is I start playing Kerbal Space Program and forget to take my sleepy meds
09:58:52PMunchAnd super inconvenient if I wanted to grab some beers with friends. Basically getting up, having breakfast and then head to a bar. Get home from the bar and realise it's mid-day for me, so now I'm jut going to be drunk for the rest of the day..
09:59:12PMunchThat game is so much fun!
09:59:17Demos[m]you can still go to bars?
09:59:42PMunchNah, this was last time I was without any schedule restrictions
09:59:55PMunchWhen I was studying and my GF was out of town
10:00:09*endragor quit (Remote host closed the connection)
10:01:58*solitudesf- quit (Remote host closed the connection)
10:04:19*solitudesf joined #nim
10:14:57*NimBot joined #nim
10:17:48PMunchnim dump?
10:17:52*endragor joined #nim
10:18:41FromGitter<Vindaar> I remember there was one which just echoed the paths it checked at runtime
10:19:28FromDiscord<Varriount> Verbosity maybe?
10:21:42FromGitter<Vindaar> nope :/
10:24:49FromGitter<Vindaar> well, figured it out without it. I was confused, because I was just testing ggplotnim on windows. And I was sure to get the same "could not load libcairo2.dll" error @Lecale got the other day (and I got a few weeks ago). ⏎ But the thing is, by installing emacs on windows and adding its `bin` dir to PATH I also installed cairo, since emacs on windows uses GTK
10:37:37Araq> A prime example are the DB modules that always return result values as strings
10:37:56Araqno, it's a prime example for ranting about what you don't understand.
10:38:37*filcuc quit (Ping timeout: 264 seconds)
10:38:44Araqand what's wrong with 'wordwrap' anyway
10:39:26FromDiscord<Rika> i think the DB modules are fine
10:39:43FromDiscord<Rika> ive never used wordwrap but i think they think its an issue because its tiny
10:40:08Araqnre was an external contribution and it shows
10:42:01PMunchtil wordwrap
10:43:31*filcuc joined #nim
10:43:41Araqso instead of 'nre' it should have been left in a Nimble package and then others can import nre and the same API differences would exist and in everyday life nothing whatsoever would change
10:44:54Araqbut you couldn't complain about it *shrug*
10:49:40Araq> but `seek` and `position` are better names for `setPosition` and `getPosition` respectively
10:49:44AraqI don't agree
10:50:11FromDiscord<Rika> why so for the 2nd one?
10:50:52Araq'seek' doesn't "seek" (= search) for anything whatsoever, the name is bullshit
10:51:31FromDiscord<Rika> that makes sense yeah
10:51:33FromDiscord<Rika> but the position one?
10:54:58*sunwukong joined #nim
10:58:57AraqgetPosition was chosen but its cost is unclear, could be an expensive syscall (unlikely though)
10:59:06Araqsame for setPosition
11:00:19AraqsetPosition vs setFilePos is a valid complaint but it's nitpicking
11:11:36*narimiran quit (Ping timeout: 256 seconds)
11:21:13*defection joined #nim
11:23:59*abm joined #nim
11:25:21*narimiran joined #nim
11:25:26defectionQuestion, I'm using the terminal module to make a simple little TUI app, is there a nicer way to clear all of the junk in scrollback rather than using `stdout.write("\e[3J")`
11:30:17*rnrwashere joined #nim
11:31:13*filcuc quit (Ping timeout: 265 seconds)
11:32:50*filcuc joined #nim
11:34:37*rnrwashere quit (Ping timeout: 250 seconds)
11:40:46FromDiscord<Rika> that makes me feel like making an ansicodes module or something
11:41:22*filcuc quit (Ping timeout: 265 seconds)
11:41:45*letto quit (Quit: Konversation terminated!)
11:43:43*letto joined #nim
11:50:38defectionThat would be cool, have the possibility of merging some of that into the terminal module too considering there's some common escape sequences in there already.
11:54:51FromDiscord<Rika> well the issue of having an ansicodes library is that i either > only handle output ansicodes or > i require raw mode to handle input ansi codes too or something
11:54:58FromDiscord<Rika> i dont think thats a big issue actually
11:55:57*sunwukong quit (Quit: Leaving)
12:06:39*sleepyqt quit (Ping timeout: 260 seconds)
12:12:01*rockcavera joined #nim
12:13:36Araqdefection, there is only eraseScreen
12:13:49Araqand in general terminal.nim only offers what is portable
12:14:30Araqfor posix specific stuff there is also termios.nim
12:15:39defectionFair enough, I don't know all of the intricacies of terminals/ANSI stuff :P
12:15:59defectionNice, I'll have to take a look!
12:17:36Araqspeaking of which, 'nimble init' is broken on Windows with its terminal based UI
12:18:48FromGitter<zetashift> what's broken on it?
12:19:39FromGitter<zetashift> seems to work fine for me, using Windows 10
12:19:55FromDiscord<Recruit_main707> for me it also seems finew
12:21:36*sleepyqt joined #nim
12:25:03Araqrun it inside VSCode
12:26:47FromDiscord<Recruit_main707> it also seems to work
12:27:11Araqnever mind then, for me it didn't
12:33:19*clemens3 quit (Quit: reboot)
12:36:30*clemens3 joined #nim
12:37:53*dsrw joined #nim
12:38:28PMunchdefection https://nim-lang.org/docs/terminal.html#eraseScreen.t
12:39:12PMunchOh sorry, didn't see that others had answered you already
12:39:12*dsrw quit (Read error: Connection reset by peer)
12:50:58FromGitter<alehander92> guys, what do you think about `nimtrace program.nim` which compiles a program with `-d:nimtrace` and just prints out callgraph in real time
12:51:11FromGitter<alehander92> similar to way `strace program` works for syscalls
12:59:15*zacharycarter joined #nim
12:59:58*filcuc joined #nim
13:01:20*kenran joined #nim
13:02:41*kenran quit (Client Quit)
13:08:14krux02hard to say. Usability highly on the quality of the implementation.
13:08:33krux02also you should explore existing tracers for c++, how much does it apply to Nim as well
13:09:36Araqalehander92: is your zero-functional currently broken or is it my PR...
13:16:42FromGitter<alehander92> sorry!
13:17:06FromGitter<alehander92> krux02 you're right, i work on something like that in my work, but i admit i havent analyzed enough c/c++ solutions
13:17:52FromGitter<alehander92> the fastest way i've done it until now is by producing a minimal binary trace which is later postprocessed to a more analyzeable callgraph
13:18:24FromGitter<alehander92> but i admit this can be also be maybe doable with `-finstrument`* family of gcc/clang(?) + some objdump info
13:18:59FromGitter<alehander92> however i am not sure how easy is to collect sensible info for args this way : i was more playing with the idea of more naive prettyprinting high level hook
13:19:14FromGitter<alehander92> for smaller/mid programs quick introspection
13:19:24FromGitter<alehander92> Araq hm sorry, have to look at it
13:20:38FromGitter<alehander92> https://github.com/nim-lang/Nim/pull/13776/checks?check_run_id=539189372 ?
13:20:39disbot'.push raises: []' now also affects proc types
13:22:35FromGitter<alehander92> honestly sorry, havent looked at it lately no idea
13:25:04FromGitter<alehander92> ugh i pressed re-run, can i like cancel it
13:25:12*nsf quit (Quit: WeeChat 2.7)
13:26:07FromGitter<alehander92> what i dont understand is how can it fail only on windows, if its a type error issue
13:26:27*Tungki joined #nim
13:26:54*filcuc quit (Quit: Konversation terminated!)
13:27:04*filcuc joined #nim
13:28:47*chemist69_ quit (Ping timeout: 272 seconds)
13:29:28*chemist69 joined #nim
13:30:31PMunchalehander92: `when defined(windows)`
13:37:31FromDiscord<Recruit_main707> can somebody from irc or gitter or other try to @ everyone and see if it works in discord?
13:37:47*aEverr joined #nim
13:37:53FromDiscord<Rika> i doubt it doed
13:37:54FromGitter<alehander92> sorry
13:37:54FromDiscord<Rika> does
13:38:06FromGitter<alehander92> i cant think of an obvious when defined(windows)
13:38:22FromGitter<alehander92> recruit this can annoy a lot of people :)
13:38:29FromDiscord<Recruit_main707> personal @s dont woek because we have an special number after the name, but everyone doesnt.
13:38:50FromDiscord<Recruit_main707> alehander92: its in the name of science
13:38:51FromDiscord<Rika> the bot probably does sanitizing nonetheless
13:38:54aEverr<@259277943275126785>
13:38:59FromDiscord<Recruit_main707> wow
13:39:01FromDiscord<Rika> i see
13:39:08aEverr<@386230567571554305>
13:39:14aEverrmuahahaha
13:39:20FromDiscord<Recruit_main707> is this your alt?
13:39:23FromDiscord<Rika> no
13:39:23aEverrno
13:39:25*lritter joined #nim
13:39:35FromDiscord<Recruit_main707> are you copying the number?
13:39:40aEverrno
13:39:41FromDiscord<Rika> no
13:39:45FromDiscord<Rika> (i am)
13:39:53FromDiscord<Recruit_main707> it works out of the box? wow
13:40:12FromDiscord<Recruit_main707> this is new right?
13:40:44FromDiscord<Rika> i am copyinh the number pls
13:40:53FromDiscord<Rika> right click copy id then <@number>
13:40:55FromDiscord<Rika> lmao 😛
13:41:10aEverri'm hesitant on trying an everyone ping though
13:41:15aEverrfor good reasons
13:41:18FromDiscord<Recruit_main707> https://tenor.com/view/not-funny-didnt-laugh-not-funny-didnt-laugh-dancing-money-dance-gif-14496446
13:41:52aEverrcant see gifs on my irc client lol
13:42:21FromDiscord<Recruit_main707> well, we could ping everyone for nim updates and such
13:42:50aEverri really wanna try it but also i dont want to fucking die
13:47:40Araqalehander92: well if you didn't touch it it must be my PR
13:47:52FromGitter<alehander92> guys you can test it in nim-offtopic
13:47:56FromGitter<alehander92> if its connected to discord
13:48:10FromDiscord<Rika> we uh did
13:48:13FromGitter<alehander92> and nim-lang/twitch on gitter
13:48:13FromDiscord<Rika> uh
13:48:15FromDiscord<Recruit_main707> yep, we already have awaken discord offtopic XD
13:48:22*liblq-dev joined #nim
13:48:30FromDiscord<Rika> uh yeah we've prolly incurred the wrath of literally everyone on the discord server
13:48:49FromDiscord<Simula> anyone have experience with the posix module? how do i use `getgrname`?
13:48:50liblq-devquite literally
13:49:05FromDiscord<Simula> no matter what i pass it, i get a null pointer in return
13:49:31FromGitter<alehander92> and gitter
13:50:00FromGitter<alehander92> Araq well, i am not sure but https://github.com/zero-functional/zero-functional/commits/master last commit is from february
13:50:12FromGitter<alehander92> sorry for re-running the ci again
13:54:27*dddddd joined #nim
13:55:34FromDiscord<Simula> oh i'm using the api wrong
13:58:04FromDiscord<Simula> aaaaaand i found a compiler bug
13:58:13FromDiscord<Rika> ? what happened
13:58:25FromDiscord<Simula> `stat` from posix_utils is broken
13:58:53FromGitter<alehander92> thats maybe a stdlib bug
13:59:24Araqso ... how does 'ensures' work
13:59:38FromDiscord<Simula> https://pastebin.com/cgc6QAU6
14:01:14AraqSImula: that's a stdlib/OS combination problem, not a compiler bug
14:01:14FromDiscord<Simula> aaaaaand i can't get a minimal example to fail
14:01:36FromDiscord<Simula> oh fun
14:02:09FromDiscord<Simula> ah, it looks like the `$` is just broken for the Stat type
14:02:41Araqsure continue to claim nonsense, in reality Stat's very definition is broken
14:02:53Araqfor your OS
14:03:12FromDiscord<Rika> what os are you on
14:03:30AraqZergLinux
14:03:32FromDiscord<Simula> im not claiming nonsense lmao, using it properly works fine
14:03:34FromDiscord<Simula> fedora 31
14:03:47FromDiscord<Simula> as long as you don't try `$mystat` it works
14:13:59*filcuc quit (Quit: Konversation terminated!)
14:14:13*filcuc joined #nim
14:28:57FromGitter<alehander92> is it a valid strategy to
14:29:15FromGitter<alehander92> discard async futures on purpose in test code
14:29:30FromGitter<alehander92> to test that internal logic deals with some possible logic races
14:35:02*zacharycarter quit (Read error: Connection reset by peer)
14:35:20krux02Simula: can you try to just delete the filed pad0 and reserved from the definition of Stat?
14:35:48krux02as far as I can tell right now, they are not used and don't serve any purpose.
14:37:03krux02Araq: can you please stop insulting people who report problems in Nim?
14:37:36krux02It is not job of people to correctly categorize a bug in Nim.
14:38:12PMunchalehander42, why would you do that?
14:38:23Araqkrux02: I'm not aware I insulted anybody, I did categorize the bug for the OP
14:40:58FromGitter<alehander92> PMunch well, because my ui can generate events in a bit random order so two operations might happen in a bit interleaving way
14:41:19PMunchAraq, Simula, pretty sure it's this error you're seeing: https://github.com/nim-lang/Nim/pull/12655
14:41:19FromDiscord<Simula> it's not the first time you've gotten aggressive because someone was harmlessly wrong
14:41:20FromGitter<alehander92> so i want my cli test runner to simulate that, but asyncCheck is probably what i want yeah :D
14:41:20disbotFix issue with fields trying to use wrong name ; snippet at 12https://play.nim-lang.org/#ix=2aYc
14:41:39*liblq-dev quit (Ping timeout: 265 seconds)
14:42:00PMunchI don't think he's aggressive, just a limitation of the text medium :P
14:42:09krux02Araq: Here you did isult: "sure continue to claim nonsense,"
14:42:34AraqI didn't.
14:42:39PMunchalehander42, yeah asyncCheck essentially just adds a callback that will raise the error
14:43:08PMunchHi didn't insult him, an insult would be "sure you idiot, continue to claim nonsense"
14:43:24*liblq-dev joined #nim
14:43:59FromDiscord<Simula> the thing is, i wasn't claiming nonsense
14:44:06FromDiscord<Simula> i was wrong at first and corrected myself
14:44:08PMunchWell, it wasn't a compiler bug
14:44:21PMunchSo it was nonsense, just not maliciously so
14:44:22FromDiscord<Simula> and i corrected myself
14:44:33Araqit's neither a compiler bug nor a $ bug
14:44:39PMunchIt's not $ that's broken either
14:44:50FromDiscord<Simula> and yet, trying to use $ on a Stat is bhroken
14:44:54PMunchIt's the Stat type that incorrectly imports fields from the C definition
14:45:10PMunchYes, because it tries to access the field pad0 which doesn't exists
14:45:17PMunchAs the field is called __pad0
14:45:24FromGitter<alehander92> i think its just a language thing maybe
14:45:37AraqSimula: I'm sorry anyway, but no offense was implied
14:45:49FromDiscord<Simula> thank you, i appreciate it
14:45:59PMunchIf you look at the PR I linked you will see that there is an issue with some of the posix parts where this is the case, but I haven't found a good way to detect them all..
14:46:17FromGitter<alehander92> oh well i need to read stuff with nim-prompt, i just realized this is blocking my async loop
14:46:26PMunchBasically that field should be declared with {.importc: "__pad0".}
14:46:34FromGitter<alehander92> that explains why i saw it used in a thread iirc
14:46:39FromGitter<alehander92> ok todo for now
14:48:10*Trustable joined #nim
14:48:34krux02PMunch: that field just needs to be deleted
14:48:56krux02that field is supposed to be private. That is the reason it stearts with __
14:48:57PMunchNope, then Nim and C would disagree on the size of that struct
14:49:03krux02Nope
14:49:04krux02they won't
14:49:14krux02I implemented the sizeof calculation in Nim
14:49:27krux02and when a type is imported, it doesn't calculate the size on the size side.
14:49:30*Trustable quit (Client Quit)
14:49:31PMunchOh, so it actually takes that into consideration? Cool
14:49:36krux02yes
14:49:48krux02you should be able to safely delete it.
14:49:51PMunchI've just run into issues when I've declared a struct wrong
14:49:57krux02you could test it if you are not sure about it.
14:50:11*Trustable joined #nim
14:50:16*waleee-cl joined #nim
14:50:17krux02can you open an issue about it? Then I can take a look into it.
14:50:20PMunchBut those weren't imported, just declared as the same kind
14:50:31PMunchYou can probably reuse my PR?
14:50:51krux02I don.t know how to reuse a PR, never did those git magic tricks.
14:51:03krux02can you link your issue?
14:51:06krux02PR?
14:51:58*filcuc quit (Ping timeout: 256 seconds)
14:52:08PMunchAnd alehander92, I think you are right, it's probably a language thing. I'm from a place known for our rough language and cursing, so my bar for insults is probably a bit higher :P
14:52:30PMunchIt's the one I linked a second ago #12655
14:52:32disbothttps://github.com/nim-lang/Nim/pull/12655 -- 3Fix issue with fields trying to use wrong name ; snippet at 12https://play.nim-lang.org/#ix=2aYc
14:53:03*sagax joined #nim
14:53:40FromGitter<alehander92> PMunch well cursing is bad
14:53:53FromGitter<alehander92> i meant that nonsense might just mean "not reasonable/incorrect
14:54:07FromGitter<alehander92> " in some languages/cultures maybe, not so sure how it translates
14:55:07PMunchWhat do you mean "cursing is bad", it's part of our culture..
14:55:35PMunchTo the point were insulting a policeman is legal where I'm from. Was a ruling on it a couple of years ago
14:56:37*Guest81327 quit (Ping timeout: 264 seconds)
14:57:17FromGitter<sheerluck> I don't like when people quarrel https://bit.ly/33O0WOq
14:57:28PMunchSome drunken guy called a policeman a "jævla hestkuk" (common curse here, translates to something like a fucking horse cock) and was charged with insulting an officer. But the courts said that in northern Norway that isn't considered a curse and the guy was acquitted.
14:59:54*liblq-dev quit (Ping timeout: 256 seconds)
14:59:59*marmotini_ joined #nim
15:00:18*marmotini_ left #nim (#nim)
15:00:26krux02PMunch, I just wrote a comment in your PR. I can't take it over. I am sorry. I have other things to do.
15:01:50*liblq-dev joined #nim
15:02:33*dadada joined #nim
15:02:56*dadada is now known as Guest52804
15:14:12*Tungki quit (Read error: Connection reset by peer)
15:14:26*filcuc joined #nim
15:14:35*Tungki joined #nim
15:16:13*Tungki quit (Client Quit)
15:26:20*Guest52804 quit (Ping timeout: 258 seconds)
15:26:50*clyybber joined #nim
15:32:28*dadada joined #nim
15:32:51*dadada is now known as Guest29904
15:33:42FromGitter<alehander92> well PMunch I believe you , but i still think its ugly
15:35:12clyybberAraq: What does #13778 do ?
15:35:13disbothttps://github.com/nim-lang/Nim/pull/13778 -- 3new minor feature: macros for proc types, to be documented
15:35:49clyybberIs it related to pragma macros like {.async.}
15:35:51clyybber?
15:35:55disrupteklets us annotate for drnim.
15:36:22clyybberhow does it look?
15:36:31clyybberor work?
15:36:44disruptekproc foo(x: int) {.requires: x > 0.}
15:36:56clyybberOh, and that wasn't possible before?
15:37:07clyybberI thought the async macro did something like that?
15:37:25disrupteki think it's the syntax that needed doing.
15:39:32disrupteklooks like it's mostly useful for type foo: proc ... {.requires.}
15:39:39*aEverr quit (Ping timeout: 265 seconds)
15:40:04*aEverr joined #nim
15:45:13FromGitter<alehander92> ok so we can write
15:45:22FromGitter<alehander92> complexity in signatures
15:45:35FromGitter<alehander92> with that !
15:50:17*filcuc quit (Ping timeout: 250 seconds)
15:52:08Araqclyybber: it's for 'async' proc types
15:54:17*endragor quit (Remote host closed the connection)
15:55:20Araqdrnim doesn't need it because drnim simply introduces new pragmas :P
15:57:53shashlickYardanico: nice work! can you please put tests in place and maybe a CI so that I can test ast2 and make sure stuff still works with it
15:58:16*skelett is now known as ssd
15:58:32*ssd is now known as skelett
15:59:41PMunchIs DrNim the proof thingy?
16:01:57Araqyes
16:02:26*shadowbane quit (Quit: Konversation terminated!)
16:10:48*Guest29904 quit (Ping timeout: 256 seconds)
16:14:01FromGitter<alehander92> Araq is there a reason
16:14:19FromGitter<alehander92> hm, `tags` is not picked up when `async` is used
16:14:29FromGitter<alehander92> is this somehow related to your fix
16:14:31Araqwell it allows you to write 'type T = proc () {.async.}'
16:14:37Araqand previously you couldn't
16:14:43FromGitter<alehander92> ah sorry ok
16:17:39*dadada_ joined #nim
16:20:20FromGitter<pigmej> Hey guys
16:20:49FromGitter<pigmej> .choosenim/toolchains/nim-1.0.6/lib/impure/re.nim(77, 28) Error: VM is only allowed to 'cast' between integers and/or floats of same size
16:20:52FromGitter<pigmej> is that known?
16:21:18FromGitter<pigmej> unless I'm doing something very wrong with RE but ... I don't think so
16:27:28leorize[m]you're definitely doing something really wrong :p
16:28:16clyybberAraq: Ah, nice!
16:29:51FromGitter<alehander92> Araq so can i use
16:29:55FromGitter<alehander92> tags: [] with async
16:30:11FromGitter<alehander92> sorry, it just seems it doesnt get triggered in my program
16:31:13FromDiscord<Rika> pigmej what are you doing??
16:31:26FromGitter<pigmej> ok so that was clearly wtf
16:31:37FromGitter<pigmej> I just did `const foo = re"foo"`
16:31:40FromGitter<pigmej> and that raises that error
16:31:57leorize[m]you can't do that
16:31:59leorize[m]it's to be a `let`
16:32:29clyybberbasically, re doesn't work at CT yet
16:32:48leorize[m]this is because re is just a high-level abstraction over libpcre
16:32:54FromDiscord<Rika> is nitely's regex CT compatible?
16:32:57FromGitter<pigmej> I know that I can't
16:33:03FromGitter<pigmej> but still the error is at least awkward
16:33:19leorize[m]@Rika: yes
16:33:25FromDiscord<Rika> noice
16:34:00leorize[m]@pigmej: well what caused the error should be fixed in 1.2
16:34:12leorize[m]since we get integer casting in VM now iirc
16:39:33*tane joined #nim
16:40:22clyybberAraq: Is setLen supposed to zero out the memory?
16:41:18AraqI think so
16:48:53*akitoshi joined #nim
16:50:37FromGitter<alehander92> can i somehow
16:50:46FromGitter<alehander92> preserve a non closure reference to a procedure
16:50:48FromGitter<alehander92> in a field
16:52:03FromGitter<alehander92> nimcall ?
16:52:16FromGitter<alehander92> from older nim chats / github
16:52:53Araqsystem.rawEnv
16:58:47FromGitter<alehander92> so does nimcall check if something is a closure
16:59:55*rokups quit (Quit: Connection closed for inactivity)
17:17:42watzonI have to say, nim has a pretty nice built in PEG parser https://nim-lang.org/docs/pegs.html
17:18:31*Trustable quit (Remote host closed the connection)
17:20:41*Trustable joined #nim
17:33:27*solitudesf quit (Remote host closed the connection)
17:34:03disruptek!repo npeg
17:34:04disbothttps://github.com/zevv/npeg -- 9npeg: 11PEGs for Nim, another take 15 91⭐ 4🍴
17:35:23disrupteki guess i can't use dot operators in the compiler.
17:35:51*solitudesf joined #nim
17:40:43*ksandvik joined #nim
17:41:37*Yardanico joined #nim
17:45:44*hax-scramper joined #nim
17:52:10FromGitter<geotre> Is there anything in stdlib to convert camelCase to snake_case etc? "thisCase" -> "this_case" ?
17:52:17disruptekwhy?
17:52:30Yardaniconim has partial case insensitivity anyway
17:52:32*shadowbane joined #nim
17:52:37YardanicothisCall() == this_call()
17:52:42YardanicothisVar == this_var
17:52:45FromGitter<geotre> Interop with json APIs that use that for keys
17:52:49*dadada_ quit (Ping timeout: 252 seconds)
17:52:54Yardanicoyou don't have to really
17:53:06Yardanicoyou can just define fields in your object as snake_case and then use them as camelCase
17:53:17FromGitter<geotre> Yeah
17:53:30FromGitter<geotre> I just want to ideally write the nim obj defs using camel case
17:53:43FromGitter<geotre> Better for autocomplete etc
17:53:49disruptekgo for it.
17:53:55*shadowbane quit (Client Quit)
17:54:18disrupteki have a sanitizer in openapi that you can adapt. search for sanitizer.
17:54:21disruptek!repo openapi
17:54:22disbothttps://github.com/disruptek/openapi -- 9openapi: 11OpenAPI Code Generator for Nim 15 19⭐ 1🍴 7& 4 more...
17:54:43FromGitter<geotre> Nice one will have a look
17:54:47*shadowbane joined #nim
17:54:57disruptekit will convert any string into a valid nim identifier.
17:55:09FromGitter<geotre> Would be better if it was in stdlib so I could add something to the nim json module
17:55:34FromGitter<geotre> Ah that's not what I'm really looking for
17:55:36disruptekno such animal exists.
17:55:45FromGitter<geotre> Ok thanks
17:56:16disrupteki think you should look at my solution, first.
17:56:48FromGitter<geotre> I will have a look but it sounds like it's doing the opposite (i.e. snake_case -> camelCase)
17:57:01disruptekthat's why you need to look at the code.
17:57:04FromGitter<geotre> https://github.com/disruptek/openapi/search?q=sanitizer&unscoped_q=sanitizer
17:57:06*rnrwashere joined #nim
17:57:09FromGitter<geotre> No results
17:57:15disruptekit has all the levers that you want.
17:58:23disrupteksee src/openapi/codegen.nim -- sanitizeIdentifier()
17:58:34FromGitter<geotre> Ok got it
17:58:43*shadowbane quit (Client Quit)
17:59:22disruptekjust toggle elideUnder.
17:59:23*dadada joined #nim
17:59:46*dadada is now known as Guest13768
18:00:41lbartwhat is the best way to create a type with a const field? example type myNewType = object data: t field = 123
18:00:58Yardanicothere's no such a way
18:01:03FromDiscord<Rika> make it a normal const
18:01:06FromDiscord<Rika> outside the type
18:01:26FromDiscord<Rika> consts are a compile time construct, they no longer "exist" in run time
18:01:33FromDiscord<Rika> imagine them as template variables
18:03:22lbartok thanks
18:04:33*rnrwashere quit (Remote host closed the connection)
18:06:24*rnrwashere joined #nim
18:09:29ksandvikGeneric question, would using const for all cases we know will never change be performance-wise better (compiled away) than let? Or it just looks bad?
18:09:47Yardanicowell it'll be a bit better
18:10:05Yardanicosince you will set it at compile-time, and at runtime it will just *be there*
18:10:18Yardanicoyou wouldn't spend time at runtime calculating that value
18:10:24ksandvikI'm all in for as much as possible compile-time away coding.
18:11:14*silvernode joined #nim
18:11:17Yardanicodon't overdo it pls :P
18:11:27FromDiscord<Rika> let is just an "immutable" RT var
18:11:33FromDiscord<Rika> why? whats wrong with overdoing it?
18:11:34Yardanicobecause then you have programs which do everything at compile-time and then nothing at runtime
18:11:44Yardanicodont abuse compiletime xd
18:11:44disrupteksounds good to me.
18:11:49FromDiscord<Rika> is that an issue?
18:12:01disruptekonly for Yardanico.
18:12:22FromDiscord<Rika> yardanico prolly got scarred by the mainly compile time discord library
18:12:24ksandvikWith large apps there's always some time needed to initialize the runtime. If that's compiled away then the better.
18:14:40ksandvikSmall to medum ones, does not really matter.
18:17:28ksandvikI should read the manual but does Nim have a similar concept as constexpr in C++?
18:17:34*freepump[m] left #nim ("User left")
18:17:51ksandvikWe use that a lot in large systems to build compile time constants from defined functions.
18:18:03YardanicoI think nim compiler automatically figures out if something can be computed at compile-time
18:19:26ksandvikAre macros compile time expresions, that would then do the same thing?
18:22:52leorizeanything when put in a compile-time context will be run at compile time
18:23:03krux02ksandvik, computations at compile time are generally slow as they are computed on a vm similar to a python like VM.
18:23:16krux02runtime is much better at computation.
18:23:25leorize4raq benchmarks show that Nim VM is faster than python :P
18:23:32leorizeyea, but it's still slow :P
18:23:37ksandvikThat is fine with fast computers, I rather take the hit then than for customers running the app.
18:24:17krux02After what really matters is turnaround time. And if you can pick for your initialization to run at compilte time or at startup time of the program. You should pick startup time
18:24:25krux02because it is faster.
18:24:49ksandvikWell, I rather code for users than for myself.
18:25:00*Sembei joined #nim
18:25:05krux02both is important.
18:25:18krux02But during development, you are the most important user of your application.
18:25:42krux02don't underestimate that.
18:25:45ksandvikI'm talking about large scale programs, though, similar to Final cut Pro X and so on, where every millisecond counts. For these small command line tools and so on, does not really matter.
18:26:14krux02Final cut Pro X is an application where everey millisecond counts?
18:26:14*a_b_m joined #nim
18:26:34ksandvikIndeed. Startup time is measured. Same with other large scale apps.
18:26:44krux02yea
18:26:53ksandvikIf we have millions of objects that need to be created it impacts the startup time.
18:27:09krux02you should start thinking about that, as soon as your are as big as tha program.
18:27:23ksandvikSame with embedded systems I'm working on just now. We try to squeeze everything we get from compile time.
18:27:25*a_b_m quit (Client Quit)
18:27:56krux02if you create millions of objects during every compilation, your development experience might become invisible.
18:28:04ksandvikMost embedded system are running low-end ARM chips and not much RAM. And the Flash is also not that fast.
18:28:24krux02just a figure, what would you choose:
18:28:31ksandvikIt depends, with incremental compilation the large sized pro apps actually built really fast, I could tweak something and have it up and running in 10 seconds.
18:28:46krux021 minute extra compilation time vm 1 second extra startup time.
18:28:58FromDiscord<Rika> we dont got incremental compilation yet do we
18:29:10ksandvikEngineering management would say 1 ms startup time gain. or more.
18:29:11krux02somebody is working on it.
18:29:19krux02but we don't have incremental compilation.
18:29:38*abm quit (Ping timeout: 256 seconds)
18:29:51*silvernode quit (Ping timeout: 252 seconds)
18:29:51ksandvikThey just buy us faster workstations if compilation time could squeeze out better performance.
18:29:56FromDiscord<Rika> i think what krux is basically saying is that if you're developing it and it's not released for prod yet go for the startup time first
18:29:58krux02btw how long does final cut pro take to start up?
18:30:06FromDiscord<Rika> and once it's a burden then switch to CT
18:30:14Yardanicoyeah @Rika i agree
18:30:31krux02^^ yes thask you
18:30:34Yardanicoin most cases switching from rt to ct can be as simple as switching "let" to "const"
18:30:39ksandvikI don't remember the exact numbers just now - — I know the flow of what needs tobe set up and it's quite a lot.
18:30:46FromDiscord<Rika> once the importance shifts from "i must finish this as quickly as possible" to "our users need the speed now" switch
18:31:34FromDiscord<Rika> its unnecessary to spend so much time in CT if you're not releasing that binary in prod
18:31:41ksandvikWhat I'm saying is for command line tools and simple stuff like that, no worry about all this.
18:31:43FromDiscord<Rika> just like why we dont dev with -d:release on all the time
18:31:59krux02But honestly, you can't compare final cut pro x, with products that are developed by individuals in Nim.
18:32:02ksandvikIf you do large scale embedded work, web servers, or pro apps, then this is what we are worried about on a daily scale.
18:32:23krux02Final cut pro has apple behind it.
18:32:24FromDiscord<Rika> once theyre released and fully fledged sure i guess
18:32:48krux02no really. You can't.
18:33:27krux02Final Cut pro (never used it), is probably a pretty bloated application that has a lot of startup time wasted on unnecessary stuff.
18:33:41ksandvikIf Nim wants to be a systems/pro app dev language, these are the things engineers look at. I do like Nim, I think it's a good start,
18:33:57krux02I don't know how long it need to start up, but I guess is is probably more than 15 seconds.
18:34:18ksandvikFinal Cut pro X, yes and no. It was a full rewrite but the functionality required is *a lot*.
18:34:50ksandvikJust the UI updating with *thousands* of views takes its own toll.
18:35:02ksandvikAudio apps same thing.
18:35:20krux02ksandvik, I don't know what your message here it.
18:35:56krux02is
18:36:02ksandvikMy message is that for toy apps and command line tools, yes anything goes. For pro apps and embedded systems, thinking about data structures and compile time optimization is a daily task.
18:36:05FromDiscord<Recruit_main707> how is this done: `from x import *` in nim?
18:36:13Yardanico"import module"
18:36:24FromDiscord<Recruit_main707> oki
18:36:38krux02ksandvik, and yet you sound like you have no idea what Nim actually does, otherwise you wouldn't say such things.
18:37:03ksandvikThat's why I asked for constexpr and if macros are compiled time executions.
18:37:25krux02Nim is fast. Quite fast to compile. Extremely fast to execute, and metaprogramming beyond the possibilities of any other languge anybody ever showed to me.
18:37:34Yardanicokrux02: what about the forbidden word
18:37:40Yardanicolisp
18:37:50krux02we recently had a lisper change to Nim
18:38:15krux02axion is his name
18:38:31Yardanicowell another lisper with who I talked on tg uses emacs with lisp and doesn't agree with that :P
18:38:32ksandvikLisp is fine but for runtime execution, uh huh, so many failed Apple projects that tried to use Lisp but that's another story (when I'm retired)
18:38:49Yardanicoyeah, nim is easier to write after all
18:38:52krux02Nim has better metaprogramming possibilities than lisp, because Nim has type information in the AST
18:38:57YardanicoI mean it's easier for new people to understand and stuff
18:39:23krux02I do a bit of Lisp as well, but only emacs lisp.
18:40:04krux02lisp is cool, especially the dynamic lisp environment where everything can be changed at runtime. Nim doesn't have that.
18:40:40*Guest13768 is now known as dadada
18:41:01dadadakrux02: do you know how rust's new metaprogramming capabilities compare?
18:41:11krux02actually I do.
18:41:11Yardanicouh oh
18:41:24krux02Rust metaprogramming work on token streams.
18:41:27*m4r35n357 quit (Quit: Ex-Chat)
18:41:31Yardanico$*>?%*$
18:41:38Yardanico{}#::
18:42:02krux02so you basically write your own parser in it.
18:42:19krux02That also means, no type information.
18:43:01krux02not sure what functions macros can call though.
18:43:52*ksandvik quit (Quit: Leaving.)
18:46:32*ksandvik joined #nim
18:46:37FromDiscord<Rika> sounds super painful to use
18:46:49FromDiscord<Rika> macros on nim are unlike any macros ive ever fuckin seen and i love it
18:48:40*ksandvik quit (Client Quit)
18:54:17*clyybber quit (Quit: WeeChat 2.7.1)
18:55:21*rnrwashere quit (Remote host closed the connection)
18:58:27*akitoshi quit (Quit: Connection closed for inactivity)
19:03:49*solitudesf quit (Ping timeout: 264 seconds)
19:05:40*hax-scramper quit (Quit: Quit)
19:10:15FromGitter<zetashift> this type mismatch error is driving me insane, can somebody try `nimble test` on my repo https://github.com/zetashift/naytracer and see if they get a type mismatch error?
19:11:10*dadada quit (Ping timeout: 256 seconds)
19:11:29Yardanicoi get it too
19:11:42Yardanicoon latest devel
19:12:43FromGitter<zetashift> ok so it shouldn't be an OS thing
19:12:54FromDiscord<Rika> you got no CI?
19:14:18*dadada joined #nim
19:14:41*dadada is now known as Guest77797
19:15:17*rnrwashere joined #nim
19:16:28FromGitter<zetashift> No, I don't really have any experience with CI
19:16:48FromGitter<zetashift> most of my programming stuff are small scripts for bioinformatics D:
19:26:33FromGitter<zetashift> oh wow I can reproduce this problem
19:26:41FromGitter<zetashift> in the playground
19:26:50Yardaniconice! (:P)
19:26:52FromGitter<zetashift> it seems to be because in my tests I have a 3x3 matrix too
19:27:56FromGitter<zetashift> https://play.nim-lang.org/#ix=2fGK anyone know if this is because type inference?
19:38:22*Guest77797 quit (Ping timeout: 256 seconds)
19:39:23*solitudesf joined #nim
19:44:13*lmariscal0641 quit (Ping timeout: 265 seconds)
19:44:18*dadada joined #nim
19:44:36*lmariscal0641 joined #nim
19:44:41*dadada is now known as Guest96016
19:45:02*Ckatt joined #nim
19:45:03*leorize quit (Ping timeout: 240 seconds)
19:45:11*idxu_ joined #nim
19:45:21*gmpreussner_ joined #nim
19:45:23*gmpreussner quit (Read error: Connection reset by peer)
19:45:40*dv^_^ quit (Ping timeout: 265 seconds)
19:45:40*Ckat quit (Ping timeout: 265 seconds)
19:45:40*idxu quit (Ping timeout: 265 seconds)
19:45:43*Ckatt is now known as Ckat
19:46:01*idxu_ is now known as idxu
19:47:13*dwdv joined #nim
19:47:16*dv^_^ joined #nim
19:50:03*leorize joined #nim
19:50:53*Guest96016 quit (Ping timeout: 252 seconds)
19:51:23*ksandvik joined #nim
19:52:39*dadada_ joined #nim
20:04:22*rnrwashere quit (Remote host closed the connection)
20:07:34*dadada_ quit (Ping timeout: 240 seconds)
20:13:53*rnrwashere joined #nim
20:14:23*dadada_ joined #nim
20:23:34*deepend quit (Excess Flood)
20:23:45krux02zetashift: what I can tell, your scipt misses a `let`.
20:25:55*deepend joined #nim
20:26:08FromDiscord<Rika> your `==` proc only allows for equal size matrices to be compared
20:26:43FromDiscord<Rika> wait huh one moment
20:32:51*PMunch quit (Quit: leaving)
20:37:52*dadada_ quit (Ping timeout: 265 seconds)
20:39:20*Vladar quit (Quit: Leaving)
20:43:14*narimiran quit (Ping timeout: 240 seconds)
20:44:11axionI was summoned.
20:44:20FromDiscord<Rika> hello lisp convert
20:44:23*dadada joined #nim
20:44:28axionOh talking about Lisp I see.
20:44:47*dadada is now known as Guest99090
20:45:20axionThere's a lot of well-known software written in Lisp. It's kind of amazing a language 20 years older than C is still kicking strong.
20:45:55FromDiscord<Rika> the discussion passed a few hours ago afaik
20:46:04axionand newer languages like Nim taking advantage of some of its main selling points for a change is welcome
20:46:07FromDiscord<Rika> so yeah sadly it seems like the people who mentioned it are gone
20:48:54*Kaivo quit (Quit: Off to game)
20:49:10ksandvikThere's this saying that each generation of new computer scientists will re-invent something that was available in Li
20:49:18ksandvikLISP in the sixties.
20:49:34FromDiscord<Rika> like haskell?
20:50:02axionGreenspun's Tenth Rule
20:50:47ksandvikI've seen in the parking space here a custom number plate CADR.
20:51:49*Guest99090 is now known as dadada
20:53:20axionUntil last month I was using CL every day for nearly 2 decades. Nim is pretty great.
21:10:24*jjido_ joined #nim
21:15:20*ksandvik quit (Quit: Leaving.)
21:18:28*ksandvik joined #nim
21:19:12*ksandvik quit (Client Quit)
21:26:53*ksandvik joined #nim
21:27:36axionBut I haven't been coding in a couple days. Trying to build something :)
21:27:42FromGitter<zetashift> @krux02 yea because I commented out a wrong line :P: https://play.nim-lang.org/#ix=2fGO
21:30:53ksandviktuལ༏འ
21:31:13ksandvik༣།་མནན \༴qbradley'\349jhngfdsio
21:31:37disruptektbh you had me at tuལ༏འ
21:31:39ksandvikOoops, cleaning my keyboard and had this view focused.
21:31:43ksandvikTibetan :-).
21:32:27ksandvikHave to take care of these MacBookPro keyboards, tiny particles get in and a key is blocked….
21:33:32FromDiscord<treeform> Tibetan is an impossible language to learn...
21:33:38ksandvik I have some non-work related small projects I will try to use Nim for.
21:34:08ksandvikག་ལེ་ག་ལེར་ - slowly slowly.
21:36:07*liblq-dev quit (Quit: WeeChat 2.7.1)
21:36:08axionAlso I never got an answer to my nimble question a couple days ago :/
21:37:27FromDiscord<treeform> what was you nimble question?
21:38:34axionI want a way to be able to run `nimble test` for any project regardless of its nimscript config, and be able to have it placed the compiled code in a dedicated build directory and not clutter up my directory tree, but of course, --outdir:build or any flag for that matter doesn't work with nimble test.
21:39:15*jjido_ quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
21:40:04*jjido joined #nim
21:40:07axionBasically, I'm trying to run all the tests for the project whose file I am visiting with an editor key binding
21:40:26ksandvikSounds reasonable.
21:40:30axionI don't want to have to depend on project-specific nimscript to enable flags or anything like that. I just want it to work for any project
21:40:47FromDiscord<treeform> axion, I have no clue how to do that. I suggest forum post. Probably will require custom reading of nimble files.
21:41:39ksandvikOr maybe a feature request via github. A global nimble test that finds all the test targets and keeps the output separate from the src file system sounds like a good idea.
21:43:17axionIt's just unfortunate that no flags are honored for `nimble test`. I also want to hide hints too. My only solution currently is to edit every project's config.nims
21:43:53axionMostly because I'm still rather new to this tooling and language in general. I'm sure there is a nicer solution somewhere
21:55:33*mal`` quit (Quit: Leaving)
21:57:48krux02axion: my personal recommendation, forget about nimble. It isn't really maintained anymore, and the implementation is beyond repair.
21:59:26kungtottekrux02: even for package management?
21:59:40krux02either make your project use submodules/subtrees for the dependencies and add the paths manually to the build script (just bash/bat but only a single call to nim with many args), or try using https://github.com/disruptek/nimph
22:00:17*mal`` joined #nim
22:00:26krux02kungtotte, if nimble works for you and you like it or you rely on it, you can continue to use it.
22:00:39FromDiscord<Recruit_main707> is there some python to nim transpiler? at least for classes?
22:01:01krux02In other words, if it serves your needs very well. I just realized for my part, that nimble tries to do many things that I don't want.
22:01:23Yardanico@Recruit_main707 There's https://github.com/metacraft-labs/py2nim
22:01:30Yardanicoand https://github.com/metacraft-labs/py2nim_deprecated/
22:02:03krux02like it hides basically every error or warning message. Then something goes wrong and you have to restart your job again but this time with the "verbose" flag and then you drown in massages that you don't care about.
22:02:12Yardanicobut really there's no such a tool which works for most python code
22:02:14Yardanicotranslate by hand :)
22:02:14FromDiscord<Recruit_main707> which is an script that calls another program XD, ill have a look at it.
22:02:33FromDiscord<Recruit_main707> Yaradinco: but im lazyyyyy
22:02:59Yardanicoovercome the laziness
22:03:02Yardanicomake your will stronger!
22:03:13krux02And last but not least, it is impossible to debug a .nimble file.
22:03:51ksandvikLooks like someone is working on nimble sources in github.
22:04:40axionThanks but I was planning on waiting for nimph to mature a bit. I'd rather have reliable yet limited tooling.
22:05:27*mal`` quit (Ping timeout: 252 seconds)
22:05:48krux02axion, yes
22:05:59*mal`` joined #nim
22:06:47krux02but until then, you can just work without a build tool.
22:07:18axionI don't want to mess with git submodules/version pinning etc manually
22:07:26axionThat's _why_ I use a build tool
22:07:45leorizenimph actually works better whan nimble :P
22:08:28axionWell watching disruptek spend hours fixing bugs didn't get me excited about it just yet
22:08:35Yardanicolol
22:08:47ksandvikThere's something beautiful with cargo, hope we only have one official/supported Nim project build tool.
22:08:50leorizebetter than no hours of bug fixing for nimble :P
22:09:26Yardanicowell afaik d0m96 is busy these days
22:09:27ksandvik<whatever> build/run/test/doc/publish
22:10:21ksandvikand new, of course!
22:10:38ksandvikEven better, a way to add custom tools into this <whatever>
22:11:12leorizethat's already a thing
22:11:36leorizenimble files are nimscript, and you can specify custom tasks there that could be run via: nimble <task name>
22:11:40FromGitter<zetashift> dom96 should just bribe a facebook manager to let him work on Nim
22:11:47Yardanicoor just rewrite facebook in nim
22:11:48Yardanicoeasy
22:12:05ksandvikFacebook has turned into a big rust-fanfest place nowadays.
22:12:26FromGitter<zetashift> "The secret tool FB is using to spy on you! Try it out now, Nim!"
22:12:52FromGitter<zetashift> Rust did a lot of things well, can't blame em
22:12:58kungtotteBetter they play around with Rust than yet another JS framework
22:13:08Yardanicobetter Rust than PHP
22:13:28ksandvikrust is used there for their back-end dev tools. Mercury was rewritten in Rust.
22:13:55ksandvikFacebook used to be a big PHP-house, maybe still there are plenty of remnants of that there.
22:15:24FromGitter<zetashift> they are putting a bit of work into a ReasonML/OCaml to PHP compiler
22:15:33FromGitter<zetashift> / transpiler whatever floats your boat
22:15:50axionThe day nimble caves into the "rewrite it in rust" meme is the day I go back to Lisp :)
22:16:04Yardanicowdym lol
22:16:26FromGitter<zetashift> Nim likes dogfooding a lot I don't think it's gonna get rewritten in another language lmao
22:16:31axionEverything is rewritten in Rust these days. That technical debt will undoubtedly have to be paid eventually.
22:16:38axionand plus, this is Nim :)
22:16:41Yardaniconot nim tools though
22:16:47Yardaniconim tries to rewrite everything in nim
22:16:54Yardanicoplayground in nim, forum in nim, nimble in nim, nim in nim
22:17:03leorizenim compiler still haven't been rewritten in (idiomatic) nim yet :P
22:17:09Yardanicosadly the website is not in nim (I mean it's static but the generator isn't in nim)
22:17:17ksandvikYes, Nim should be written in nim. Same with a build tool (note singular)/
22:17:26Yardanicowell, it is written in nim
22:17:33axionYup, which is why I'm here with Nim to stay. Just don't like that _nearly_ everything is being rewritten in Rust
22:18:09*solitudesf quit (Ping timeout: 256 seconds)
22:19:35kungtottenimph can't handle perfectly valid URLs for remotes, so that's kind of a non-starter for me.
22:20:19leorizedisruptek: ^
22:20:21*rnrwashere quit ()
22:20:27leorizeyou gotta investigate that
22:21:39axionI agree there should be a singular build tool. nimble was that, but if it's not maintained and beyond repair, the documentation and official releases need to switch it out
22:21:48Yardanicowell nimble is still maintained
22:22:05leorizethe build tool is the nim compiler itself
22:22:15Yardanicowell yeah
22:22:19Yardaniconimscript is in nim compiler
22:22:23leorizeI'd say nimble is just a dependency manager
22:24:47disruptekkungtotte: gimme an example or file a bug report, please.
22:24:59axionWell, I think more than a compiler and dependency manager is part of build infrastructure, but that's just me
22:25:01kungtotteJust double-checked the nimph url issue, it works on another repo so it's definitely choking on this specific URL
22:25:45watzonI'm confused as to how nimble is "beyond repair"
22:25:46kungtottedisruptek: the URL in question is [email protected]:~kungtotte/dtt
22:25:48watzonWorks pretty well for me
22:26:00ksandvikThe nim community is not that big so the more fractured the build story is, the harder it is to sell.
22:26:32leorizenimble and nimph uses the same project configuration scheme
22:26:35leorizevia .nimble file
22:26:53ksandvikI must say, cargo has been a big evangelizing point for Rust.
22:26:54disruptekhonestly, the only nimph bugs i know about arrive from the compiler.
22:27:25FromDiscord<Rika> `Just don't like that nearly everything is being rewritten in Rust` what's the issue with that?
22:28:30kungtotteBecause most people do RIIR the wrong way and end up costing tons of resources implementing a version of the old code that doesn't actually deliver all of the features of the old code.
22:28:57FromDiscord<Rika> RIIR?
22:29:05leorizerewrite it in rust
22:29:09kungtotte^
22:29:11watzonyep
22:29:18disruptekkungtotte: https://github.com/disruptek/nimph/issues/121
22:29:19disbotspecial handling is needed for either GitHub or non-GitHub URLs
22:29:23axion1) Technical debt. 2) Incompetent developers expecting different results.
22:29:30kungtotteSee? The phenomenon has an acronym. That means it's happening too much.
22:29:35watzonYou end up saying "well I'm rewriting this in rust, may as well rewrite that too"
22:29:55FromDiscord<Rika> *whistles*
22:29:56watzonAnd before you know is the scope has gotten out of control
22:30:03FromDiscord<Rika> I totally don't do that, of course not, no
22:30:10leorizeit's not too surprising tbh
22:30:19FromDiscord<Rika> *whistles harder* I swear I don't
22:30:35leorizeyou can't even get the same result just rewriting in the same language
22:30:37watzonI'm guilty haha. It's easy to get a bit over excited.
22:31:13leorizepeople thought rust is the "magic" fix for all of their bugs
22:31:57leorizethe sad reality is that it's not, usually you end up with more bugs than what you started with
22:32:02ksandvikThe rust rewrites I know of are usually python or similar tools that need to be rewritten for better performance to scale — something where Nim would be as suitable.
22:32:06kungtotteNo programming language has been invented that prevents bugs at a greater rate than writing more code produces bugs.
22:32:58axionSure. After all rubustness is inversely proprtional to the number of users.
22:33:19ksandvikOr then total new system level projects such as Google's Fuchsia OS. They actually tried go for a while.
22:33:36kungtotteksandvik: there's a bunch of zealotry going on where people do driveby suggestions on random projects to rewrite them in Rust. That doesn't really happen (at scale) with any other language.
22:34:05ksandvikRust is just now the 'hipster' language, me thinks. It's not that bad, actually. But overkill for many cases.
22:34:13Yardanicohonestly I just don't understand why Rust is good for writing high-level apps like web server backends or typical GUI apps
22:34:21ksandvikExactly.
22:34:22leorizeit's mainly driven by rust claims of "1000% memory safety"
22:34:24disruptekaxion: if there's something you can criticize in nimph, i'm all ears.
22:34:25YardanicoI understand when it's used for writing more low-level stuff
22:34:30Yardanicowhere safety can actually hel
22:34:32Yardanicohelp
22:35:04kungtotteSafety helps everywhere, it just becomes a problem much faster in certain domains
22:35:27axiondisruptek: I will let you know if I ever decide to use it. For now, I'm sticking with what Nim ships with and mentions in their docs as it's what most users will have and be familiar with.
22:35:34leorizepeople idea was: written in C => full of memory-related bugs
22:35:53leorizeand rust was like this magical cure
22:35:58FromDiscord<Rika> Idk, I've seen bandwagoning when it comes to rust
22:36:39ksandvikIt also helps that the Rust project really focused on a very good developer community.
22:36:49ksandvikThings like that go far.
22:37:12disrupteksure. it'd be great if nim had nice tooling like rust.
22:37:22watzonRight?
22:37:24disruptekbut as long as people refuse to use nice nim tooling, it won't improve.
22:37:33leorizewell when you have mozilla backing and use c++-style syntax, it'd be surprising if it doesn't have that much traction
22:37:44disruptekbecause, as axion claims, use is inversely proportional to robustness.
22:37:52disruptekpeople like this are part of the problem and not part of the solution.
22:38:01axionIt's second main driving point was that it produces efficient machine code. Now look at Rust developers. They are making more use of dynamic dispatch to alleviate the compile times, even though the compiler is 3x faster than it was a year or 2 ago
22:38:03*dadada quit (Ping timeout: 260 seconds)
22:38:47axionThat's mostly because a large project might have the same library in its transitive dependency graph multiple times, with tons of monomorphization for each
22:38:59ksandvikdoesn't that remind me of my morning comments :-) about compilers and runtime.
22:39:23axionIt's kind of ironic that Rust developers are starting to trend towards dynamic dispatch if you ask me.
22:39:48FromDiscord<Recruit_main707> function overloading with `+, -, *, /` doesnt work when compiled to dll?
22:39:51leorizeturns out that rust is not easy to compile :)
22:39:56ksandvikI used to program in Objective-C for 12 years non-stop so I know the pain.
22:40:00Yardanico@Recruit_main707 what do you mean
22:40:02Yardanicoit'll still work lol
22:40:04kungtotteCompile times and binary sizes are both major issues with Rust, IMO. They're getting better, but they're not great.
22:40:18Yardanicoyou're probably doing something wrong :P
22:40:28FromDiscord<Recruit_main707> i guess...
22:40:59kungtotteThis was a while ago but I remember trying some examples from the Rust book and even something as simple as a fibonacci function ended up being like a 5MB binary on my system
22:41:01FromDiscord<Rika> So I just extremely quickly skimmed through how Zig does exceptions and errors, is there a way to "enforce catching errors" like that in nim?
22:41:20Yardanico{.raises: [].} I guess?
22:41:30leorizereturn a value :)
22:41:32Yardanicoannonate your procs with that and you'll have to catch all exceptions :P
22:41:56leorizethe best way to enforce error handling is to return a value :)
22:42:14leorize!repo nim-result
22:42:15FromDiscord<Recruit_main707> its throwing this error, which confuses me if its actually the name: https://play.nim-lang.org/#ix=2fHD
22:42:15disbothttps://github.com/arnetheduck/nim-result -- 9nim-result: 11Friendly, exception-free value-or-error returns, similar to Option[T] 15 24⭐ 2🍴 7& 4 more...
22:42:30disrupteknot that friendly.
22:42:33disruptek!repo badresult
22:42:34disbothttps://github.com/disruptek/badresults -- 9badresults: 11like results but worse 15 0⭐ 0🍴
22:42:43disruptekmore friendly.
22:43:05leorizeRecruit_main707: can you make a reproducible sample and file an issue?
22:43:19FromDiscord<Rika> disruptek what's the differenxe
22:43:25Yardanico@Recruit_main707 that's a codegen issue
22:43:43Yardanicoif it's erroring on the c compiler stage
22:43:45disrupteknim-results requires that you impl a side-effect-free $ for every value you return in a Result.
22:43:56FromDiscord<Recruit_main707> Yaradinco: https://play.nim-lang.org/#ix=2fHE
22:43:58disruptekobnoxious, imo.
22:44:13Yardanicowhy are you doing exportc?
22:44:21*dadada joined #nim
22:44:30FromDiscord<Recruit_main707> dont i need both flags?
22:44:38disruptekfor semaphores, yes.
22:44:44*dadada is now known as Guest76476
22:44:45disruptekhighly recommended.
22:44:48leorizeRecruit_main707: why do you need them?
22:44:56FromDiscord<Recruit_main707> this is compiled to a dll
22:45:01leorizeso?
22:45:08leorizedo you call them from outside the dll?
22:45:22FromDiscord<Recruit_main707> thats it XD, yes, thats the intention
22:45:41FromDiscord<Rika> Yardanico: why?
22:45:50leorizeRecruit_main707: then you need to export them with C-friendly name
22:46:16leorizesomething like `exportc: "add_vector"`
22:46:23FromDiscord<Recruit_main707> well, thinking it better there was no way it worked in python when exported so...
22:50:21leorizewhat are you trying to do lol
22:51:43FromDiscord<Recruit_main707> essentially, someone made a bet, and if i transpile some utils (compatible with python), they will create a nim rocket league bot and will make a branch for my nim version of this utils.
22:52:14FromDiscord<Recruit_main707> so, a python library to sum up :p
22:52:58leorizeok I still don't know why you want to make it a dll :p
22:53:39FromDiscord<Recruit_main707> for interoping with python, i am gonna wrap my functions back to a user friendly python file/s
22:53:48leorizeah, use nimpy
22:53:52leorizeproblem solved :P
22:54:04leorize!repo nimpy
22:54:05disbothttps://github.com/yglukhov/nimpy -- 9nimpy: 11Nim - Python bridge 15 507⭐ 25🍴 7& 4 more...
22:54:08FromDiscord<Recruit_main707> it throwed me some weird errors
22:54:19leorizethey maybe you should investigate that :P
22:54:38leorizenimpy is the best way to interact between nim and python atm
22:54:56disruptek~news
22:54:56disbotnews: 11the #nim-news channel has a Nim news feed of updates to pull requests, issues, and packages. -- disruptek
22:54:59FromDiscord<Recruit_main707> nimpy doesnt like nim objects
22:55:33FromDiscord<Recruit_main707> and messing a bit with objects inside objects seems to make it give up
22:56:33leorizehave you filed an issue to the project?
22:57:57FromDiscord<Recruit_main707> well, it says types and methods are still not very well supported, so i will just let yglukhov extend those functionalities a bit more and then check if the error persists
22:58:23*defection quit (Quit: defection)
22:58:45disruptekwe need to get the ball rolling on the nim coronavirus badge project.
23:01:31FromDiscord<Rika> On the nim what
23:02:50disruptekit's a badge that measures how near you've been to other badges and sums/shares your risk.
23:03:34disrupteka small embedded project; hopefully something we can give away at fosdem, etc.
23:03:41leorizeRecruit_main707: looks like nimpy can help you if you can deal with PyObject directly
23:04:09disrupteki dunno how else to interop with python in any serious way.
23:04:32leorizehmm, actually nimpy does support nim objects
23:05:36FromDiscord<Recruit_main707> yes, it does work keeping things simple, but i have an object, with one field being an object
23:05:39*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
23:06:10disruptekAraq: any reason i shouldn't abstract out the BModule.labels interface?
23:06:21disruptekit's a pain in the ass.
23:06:26leorizeRecruit_main707: yea it might actually supports that
23:06:36Araqdisruptek: what do you mean?
23:06:54FromDiscord<Recruit_main707> its getting confised with PyObjects and my object or something
23:07:20disruptekits manipulated everywhere with inc and creates something too sensitive.
23:07:37disruptektoo sensitive to order, mutation, on and on.
23:08:14disrupteki'm stuck with this damned bug again. something to do with a particular append. maybe it's a reflection of a bug somewhere else.
23:08:34disruptekbut it seems to be labels-related and i dunno. i'm irritated.
23:08:37*Guest76476 quit (Ping timeout: 264 seconds)
23:08:40disruptekdamn alcoholics.
23:09:03disruptekand my dotOperator hack didn't work.
23:09:23disruptekso now i get to somehow bounce from ast to module, which will be... y'know, fun.
23:09:27leorizeRecruit_main707: wdym?
23:09:48Araqwell sure, replace the label counter with something else
23:10:10disruptekyeah. it can be anything else as long as it's anything else.
23:10:51FromDiscord<Recruit_main707> leorize, do you want to see the error?
23:11:05*Sembei quit (Ping timeout: 252 seconds)
23:11:05disruptekit's actually a loc bug but labels are a similar problem.
23:12:49disruptekgenStrAppend takes a mutable TLoc and merely checks that it's empty. does nothing else with it.
23:13:43*tane quit (Quit: Leaving)
23:14:19*dadada_ joined #nim
23:15:58*qbradley quit (Quit: WeeChat 2.6)
23:19:31leorizeRecruit_main707: sure?
23:20:37*leorize quit (Quit: WeeChat 2.7.1)
23:22:02shashlickLooks like the nimble beat down is over
23:22:54shashlickFact is that package management is not easy nor solved, see the dime a dozen attempts at it and continuous innovation
23:23:25ksandvikYes.
23:23:35ksandvikCould be good to focus collectively on one project.
23:23:53shashlickOn top of that nimble takes on building as well which has its own dozen of implementations out there
23:24:52ksandvikThat's fine, we only need one tool with the extension option for additional tools. But that's just my opinion.
23:25:07shashlickI spent some time thinking about it, I'm an expert in neither and unless the community is willing to tolerate some bumbling around, I'm not willing to invest the time
23:25:16ksandvikI've seen so many build systems so far where just a Makefile works really well, but it's the constant re-innovation factor.
23:25:18FromDiscord<Recruit_main707> leorize: https://play.nim-lang.org/#ix=2fHM
23:26:21FromDiscord<Recruit_main707> wait, this one: https://play.nim-lang.org/#ix=2fHO
23:26:29*leorize joined #nim
23:27:28*Trustable quit (Remote host closed the connection)
23:28:12disruptekthe real problem is that we cannot agree on the problem.
23:29:37shashlickThe real problem is that PR's just don't have the same velocity as being a maintainer
23:30:10disrupteki guess you should fork nimble and we'll compete to improve the ecosystem.
23:30:48shashlickThe amount of code I rewrote for nimterop ast2 just wouldn't work as PR's
23:31:28disrupteki'm beginning to wonder if the amount of code i've written for IC will "work."
23:32:20shashlickAnd I'd hate the person who would create a PR with this scale of change
23:33:20disruptekso you're saying that you should have created a new project instead.
23:35:35FromGitter<zetashift> Reminds me of Scala which also has a lot of build systems
23:36:20disruptekimo it should just be done in nimscript, but you can't even fetch your cwd in nimscript, so... fuck it.
23:37:47*NimBot joined #nim
23:38:42shashlickdisruptek: no, I mean that when you want contributors, you need to let them have some free reign else it is too slow and pointless
23:39:09shashlickand I acknowledge that it isn't easy to figure that out since visions need to match
23:39:12disrupteki agree, so why don't you fork nimble and allow contributions?
23:39:32shashlicki'm neck deep in nimterop so perhaps some day
23:39:33disruptekvisions don't need to match, they just need to be compatible.
23:39:58disrupteki'm not a fan of the silly banner added to `bump`, but it's compatible with my goals, so i merged it.
23:40:21*qbradley joined #nim
23:40:45shashlickmore importantly, it should be possible to experiment, mess up and fix things incrementally than expecting an individual PR to be ready to go
23:40:50qbradleyIs there a way in nim to read a file at compile time, and perhaps include it as static data in the resulting executable?
23:40:59disrupteksee staticRead()
23:41:03shashlicknimdeps
23:42:37disruptekshashlick: i dunno what happened but i'm pretty sure you're to blame. now nimph is unable to prevent the compiler's config parser from emitting hints even though i have always omitted hintConf from the config.
23:42:49disruptekany ideas?
23:43:04shashlickdevel?
23:43:16qbradleydisruptek: thank you
23:43:24disrupteki believe so.
23:44:03shashlicki think someone recently merged some code around hints
23:44:10shashlickis it working on 1.0.6
23:44:17*dadada joined #nim
23:44:41*dadada is now known as Guest9910
23:45:16disrupteki will test 1.0.6 now.
23:45:16*sleepyqt quit (Ping timeout: 256 seconds)
23:45:47disruptekqbradley: see also nimdeps
23:45:50disruptek!repo nimdeps
23:45:51disbothttps://github.com/genotrance/nimdeps -- 9nimdeps: 11Nim library to bundle dependency files into executable 15 14⭐ 2🍴
23:46:03dom96I wonder what the context of this Nimble conversation is
23:46:16disruptekseems to be a PR problem.
23:46:38qbradleydisruptek: very cool - thanks
23:47:26dom96Anything I can do to help?
23:47:42disruptekmanage your PR?
23:48:04dom96oh, you mean public relations?
23:48:08disruptekyeah.
23:48:30dom96what's the problem?
23:48:33disruptekshashlick: no extra output in 1.0.6
23:49:01disrupteki think some people are unhappy with the pace of nimble development.
23:52:39dom96Understandable, I'm unhappy with it as well.
23:57:23ksandvikIt's never too late. I could help out with some higher level work, if there's something simple, like just gathering the state and requirements?
23:57:59ksandvikOr just learn the code base, too.
23:58:11ksandvikSorry, have to quit, should be back tomorrow.
23:58:13shashlickWe have 14 commits in nimble in the last six months
23:58:13*ksandvik quit (Quit: Leaving.)
23:58:51shashlickYou had 17 commits in one day