<< 30-11-2020 >>

00:00:26FromGitter<gogolxdong> It was perfect ,but according to the statement of author, his work was stolen in purpose of business, so he stopped opensourcing it on 2019-6-17
00:01:33FromGitter<gogolxdong> binary release only from then on.
00:03:10FromDiscord<ElegantBeef> I mean this repo had a commit 11days ago https://github.com/weolar/miniblink49
00:05:00*abm quit (Quit: Leaving)
00:07:19*kinkinkijkin quit (Remote host closed the connection)
00:08:11*Jjp137 quit (Quit: Leaving)
00:08:16*Jjp137_ joined #nim
00:09:32FromGitter<gogolxdong> yeah, no relatived new code I think. node.dll is required to run it.
00:10:01FromGitter<raydf> @EleganBeef i really don't know much about the js backend. I suppose it wouldn't work with Karax.
00:15:14FromGitter<gogolxdong> We used Karax to build one of our productions. https://cloudfastnet.com/
00:22:01FromGitter<raydf> @gogolxdong is this a webapp?
00:23:55FromGitter<raydf> (https://files.gitter.im/5602f03e0fc9f982beb19f61/sJvw/image.png)
00:24:12FromGitter<raydf> Let me show an example of what i'm trying to avoid, using your app as an example:
00:24:46FromGitter<raydf> There's a lot of scripts code that is not needed in your signup route.
00:28:13FromGitter<raydf> I'm almost sure in your project it won't matter
00:29:33FromGitter<raydf> But i'm creating a integrated transactional webapp with a CMS. So i'll have a lot of routes and i'm just worried about SEO implications of not having code splitting.
00:40:58voltistIs there a proc to 'rotate' an arraymancer array by 90 degrees? Like swap the first and second axis
00:41:22FromDiscord<Rika> transpose i assume?
00:41:29FromDiscord<Rika> or i dont really get it
00:42:44voltistOh yeah that looks right
00:42:45voltistThanks
00:43:40*nixfreak quit (Ping timeout: 246 seconds)
00:49:46Zoom[m]What is Cond in locks and how to use it? The docs are empty, besides the facts that it needs to be [de]initialized, can be wait on and sent "signals" to
00:59:21*hmmm quit ()
01:19:35*Tanger joined #nim
01:20:45FromGitter<gogolxdong> @raydf you are professional bro, karax creates a monolithic js file, splitting code is the work of js specific packaging tools which requires a lot of js backend background experience to make it right.
01:22:46FromGitter<gogolxdong> SEO was led to a js-specific world, while karax creates a monolithic js file only.
01:44:05*lritter quit (Ping timeout: 256 seconds)
01:45:09*krux02 quit (Remote host closed the connection)
01:55:14FromDiscord<fwsgonzo> it looks like nims build system is fundamentally incompatible with cmake
01:55:42FromDiscord<fwsgonzo> there is no way for cmake to read any input from a tool and then use that as the input for source files
01:56:35FromDiscord<fwsgonzo> the best way right now seems to be to run cmake twice each time, once to run nim - if it builds, it builds, otherwise run it again - now it will scoop up new files in the nimcache
01:58:25FromDiscord<ElegantBeef> @fwsgonzo @nikki does use cmake, but idk what you're going for
01:58:30*nixfreak joined #nim
02:00:02FromDiscord<fwsgonzo> its just a normal CMake project
02:03:22*sagax joined #nim
02:08:38*mbomba joined #nim
02:09:50FromDiscord<fwsgonzo> (edit) there is no way for cmake to read any input from a tool and then use that as the input for source files, at build-time
02:16:09FromGitter<raydf> @gogolxdong yeah, i believe is not the scope of Karax to do that, is there a framework like Ruby On Rails but for nim-lang?
02:16:14FromDiscord<nikki> @fwsgonzo -- i indeed do something like that in https://github.com/nikki93/ng-public -- the `run.sh` script reads off of nim's generated .json file listing sources, and then i cmake generate and then also build. the whole thing still leads to fast build times for me though (cmake configure part is just like 0.2 sec usually and not the bottleneck)
02:20:11*apahl quit (Ping timeout: 272 seconds)
02:22:10*apahl joined #nim
02:27:08FromDiscord<Quibono> So for UI choices, are any fully fleshed out yet?
02:27:32*vsantana joined #nim
02:28:13FromDiscord<ElegantBeef> You can use GTK, or QT, but for more Nim Pure things we've got Nimx, Fidget, and i guess WebView if you want to go that route
02:28:45FromDiscord<Quibono> So Nimx or fidget, gotcha, thanks
02:29:03FromDiscord<ElegantBeef> Guess also Nigui or w/e that Crossplatform abstraction for native gui is
02:29:25*mbomba quit (Quit: WeeChat 3.0)
02:29:50FromDiscord<Quibono> Fidget seems like the prettiest out the box lol.
02:30:53FromDiscord<fwsgonzo> it looks like it's possible to generate an amalgamation .cpp file from the nimcache JSON, but that was stopped short by re-defined macros in each generated source
02:30:58FromDiscord<fwsgonzo> too bad
02:31:14FromDiscord<ElegantBeef> Well it's not really a toolkit as much as it is just a renderer for simple commands
02:31:29FromDiscord<ElegantBeef> It's like html+css combined inside nim ๐Ÿ˜„
02:32:02FromDiscord<fwsgonzo> (edit) "macros" => "stuff"
02:33:16FromDiscord<ElegantBeef> I say that just cause you say "out of the box" but it doesnt really have a "box" since you make the components you want yourself
02:34:03FromDiscord<nikki> @fwsgonzo yeah also i like that i don't have to rebuild all the source for my project every time
02:34:14FromDiscord<nikki> (as an amalgamation would do)
02:36:03FromDiscord<fwsgonzo> the problem is that im not making shell scripts
02:36:05FromDiscord<nikki> the run.sh + CMakeLists.txt setup in that repo makes it all work -- there's a bunch of other convenience stuff i added but the core part is the `nim_gen_srcs` part of the bash script and the `NIM_GEN_SRCS` variable that shows up in cmake as a result
02:36:41FromDiscord<fwsgonzo> sent a code paste, see https://play.nim-lang.org/#ix=2FZu
02:36:48FromDiscord<fwsgonzo> (edit) "https://play.nim-lang.org/#ix=2FZu" => "https://play.nim-lang.org/#ix=2FZv"
02:37:17*vsantana quit (Quit: Leaving.)
02:37:20FromDiscord<nikki> i already had a shell script for my proj just as a convenience over the cmake steps so i can eg. run with one command, and it didn't feel like a big addition
02:37:32FromDiscord<fwsgonzo> (edit) "https://play.nim-lang.org/#ix=2FZv" => "https://play.nim-lang.org/#ix=2FZw"
02:37:35FromDiscord<nikki> and i wasn't sure that i could make this work with just cmake logic (seems like that's what you're about to find out)
02:38:01FromDiscord<fwsgonzo> i already found out: the cmake manual is pretty clear - you can't generate the list of sources during build-time
02:38:20FromDiscord<fwsgonzo> if there was a static, finite list of nimcache files, it would have been OK
02:38:22FromDiscord<nikki> can you do it as the result of the running of an external program
02:38:24FromDiscord<fwsgonzo> i would just have listed them all
02:38:47FromDiscord<fwsgonzo> no, because at build-time CMake (and really, ninja/make) wants the files to be known
02:39:16FromDiscord<nikki> another approach is -- if you delete old nim files you can use cmake's glob stuff
02:39:20FromDiscord<fwsgonzo> I think what I have now can work, but it works until someone imports something new... ๐Ÿ™‚
02:39:25FromDiscord<nikki> but then yeah you do need to configure_depends it
02:39:49FromDiscord<nikki> delete old nim cache files is what i mean
02:39:59FromDiscord<fwsgonzo> https://gist.github.com/fwsGonzo/6f07bd636e75ba2e6553c940040641ba
02:40:08FromDiscord<fwsgonzo> that's what I have now
02:40:26FromDiscord<fwsgonzo> as you can see, I just list all the nimcache imports that I have seen so far
02:40:33FromDiscord<fwsgonzo> it will fail if you import something new
02:40:41FromDiscord<nikki> yeah that just sounds pretty bad
02:40:50FromDiscord<nikki> so wondering if there's a way around it
02:41:08FromDiscord<nikki> bc. if a convenient magic thing just breaks when i do something normal, then it's not convenient magic, is it
02:41:29FromDiscord<nikki> hmm
02:41:31FromDiscord<fwsgonzo> the best way would be if nim generated source files that could be joined together into an amalgamation .cpp file
02:41:42FromDiscord<fwsgonzo> I already wrote a python script to join the generated sources into a single file
02:41:50FromDiscord<fwsgonzo> unfortunately, there's a ton of re-defined structs and macros
02:42:22FromDiscord<fwsgonzo> but it's certainly doable
02:42:41FromDiscord<nikki> that does sound like one way, but i'm not sure it's close to the best way bc. of the added time when changing something and building again bc. of recompiling all the code
02:43:01FromDiscord<nikki> in my project's scenario at least, a lot of time is saved by nim's way of splitting the code up
02:43:03FromDiscord<fwsgonzo> right, that's true
02:43:26FromDiscord<nikki> depends on use case, for sure. if it's just for the inclusing of a nim-made library as a cmake subdirectory, may be fine
02:43:28FromDiscord<fwsgonzo> well I just wanted to see if there existed a CMake solution - guess not
02:43:49FromDiscord<nikki> i wouldn't write it out just yet, because the cmake manual's suggestion that it isn't possible doesn't seem exhaustive
02:43:49FromDiscord<fwsgonzo> I could just build the generated sources as a library using a shell script
02:44:53FromDiscord<nikki> re: the amalgamation at least --
02:45:24FromDiscord<nikki> i wonder if some crazy nim metaprogramming thing could be done at all
02:45:33FromDiscord<nikki> where you change what the main module emits -- haha
02:46:03FromDiscord<nikki> also `CONFIGURE_DEPENDS` with a glob actually works for me for example without an extra script
02:46:27FromDiscord<nikki> so i wonder if for example -- you could have a post build step with nim somehow that symlinks all of the stuff in the json into a specific subdir in the cache that you glob
02:46:29FromDiscord<nikki> and that subdir is always del'd before
02:48:25FromDiscord<fwsgonzo> the shell script idea is not going to work either - i can't add a library that doesn't exist yet, even if i were to generate it
02:51:03FromDiscord<fwsgonzo> I already have access to all the files, I just don't know every name at configure time, which is where CMake wants to know about all the files and libraries
02:51:41FromDiscord<fwsgonzo> that is, CMake simply won
02:51:49FromDiscord<fwsgonzo> (edit) "won" => "won't even run if there's something it can't find"
02:52:20FromDiscord<fwsgonzo> so whatever is needed really needs to be known beforehand, or it has to be generated before running cmake
02:58:12FromDiscord<fwsgonzo> I'll go to bed for now, but I might give this a forth try some other day ๐Ÿ˜›
02:59:20FromDiscord<nikki> did you see the "`CONFIGURE_DEPENDS` with glob" part
03:00:08FromDiscord<reilly> I asked more or less this same question months and months ago. How do I do CSS w/ Jester?
03:03:49FromDiscord<fwsgonzo> Yes, just tried it - it seems to kinda work if you run cmake twice
03:03:59FromDiscord<fwsgonzo> it's better than guessing all the filenames
03:04:17FromDiscord<reilly> I figured it out, it was obvious in retrospect.
03:06:27FromDiscord<fwsgonzo> I can reliably build if i run ninja twice, at least - it's an improvement ๐Ÿ˜‰
03:07:43FromDiscord<fwsgonzo> alright, im out - and thanks for the help!
03:19:44FromDiscord<reilly> New question: Trying to do `resp meta(http-equiv="Refresh", content="0; url='/'")`. Obviously `http-equiv` isn't a valid keyword, so what am I supposed to use? `httpEquiv` (and all of it's case-insensitive variants) don't seem to work.
03:20:12FromDiscord<reilly> I wrote "it's" instead of "its" and now I want to shoot myself in the foot. Doesn't change the question though.
03:21:47FromDiscord<Rika> all of it is case-insensitive
03:21:49FromDiscord<Rika> ๐Ÿ˜›
03:23:23FromDiscord<Rika> where is "meta" from?
03:23:24FromDiscord<reilly> I know. I'm saying I wrote "httpEquiv," nimsuggest complained ("invalid attribute for 'meta' element: httpequiv"), and despite knowing that Nim was case-sensitive, wrote "httpequiv" and "http_equiv" anyway.
03:23:37FromDiscord<reilly> `meta()` is from htmlgen.
03:23:55FromDiscord<reilly> case-insensitive
03:23:58FromDiscord<Rika> i mean the expansion of it's ๐Ÿ˜› just poking fun
03:24:24FromDiscord<reilly> Oh, clearly we're not on the same page.
03:24:57FromDiscord<reilly> Nevermind, doesn't matter. What does matter is http-equiv.
03:25:55FromDiscord<Rika> you dont need to put the name
03:25:58FromDiscord<Rika> so uh
03:26:36FromDiscord<Rika> `meta("", "Refresh", "0....")` i believe?
03:27:47FromDiscord<reilly> `resp meta("", "Refresh", "0; url='/'")` -> "element meta cannot be nested"
03:33:07FromDiscord<Rika> wait
03:33:11FromDiscord<Rika> sorry huhuh
03:34:25FromDiscord<reilly> I wish htmlgen was better documented, or at least used actual arguments instead of varargs.
03:35:18leorize[m]1htmlgen is kinda deprecated, I don't think it has been updated in awhile
03:35:56leorize[m]1now karax is just better
03:36:27leorize[m]1though I don't think the static rendering portions of it is documented
03:41:42*bung joined #nim
03:54:22FromDiscord<flywind> find this: https://users.rust-lang.org/t/rust-to-nim-a-comparison/52096
03:59:50FromDiscord<ElegantBeef> Well seems they didnt use arc for the number -> string, so i guess there is the chance for arc to get it even faster
04:03:35*waleee-cl quit (Quit: Connection closed for inactivity)
04:05:16*bung quit (Ping timeout: 246 seconds)
04:05:35*bung joined #nim
04:05:52FromDiscord<ElegantBeef> I also did suggest to use the C++ backend
04:05:58FromDiscord<ElegantBeef> So hey maybe it'll get even faster ๐Ÿ˜„
04:06:01*supakeen quit (Quit: WeeChat 2.9)
04:06:35*supakeen joined #nim
04:12:00FromDiscord<tinygiant> sent a code paste, see https://play.nim-lang.org/#ix=2FZI
04:12:01FromDiscord<Rika> but it still means nim defaults are slow
04:12:51FromDiscord<ElegantBeef> Sure the defaults might be slow, if it's a easy toggle to break that slight distance with rust it's nice
04:13:15FromDiscord<ElegantBeef> Like we dont know how slow in comparison atm, but we'll see i guess ๐Ÿ˜„
04:13:37FromDiscord<Rika> i guess same goes with rust and binary size lol
04:14:11FromDiscord<ElegantBeef> This person seems interested in Rust vs. Other languages so it's fair to tinker with both as i see it with those binary comments
04:14:36FromDiscord<Rika> feel like rust can get to around 200% instead of 1000% binary size ww
04:15:43FromDiscord<ElegantBeef> Yea i'm interested in seeing the results from these additional tests if they do them, i know C++ builds tend to outperform the C builds, and arc should be a bit faster than the normal GC
04:16:14leorize[m]1they wrote some very unidiomatic Nim
04:16:41FromDiscord<ElegantBeef> Yea i didnt read the code, just looked at build commands, we could also give more idiomatic Nim
04:16:43leorize[m]1but I think I can guess why it's slow
04:17:49FromDiscord<ElegantBeef> What's your guess?
04:19:29leorize[m]1string allocs
04:20:06leorize[m]1and tuple unpacking is "slightly" slow
04:21:35leorize[m]1looks like the code they use is on rosettacode so we can optimize that fairly quick
04:22:05*bung quit (Ping timeout: 240 seconds)
04:22:08FromDiscord<ElegantBeef> Well get on it, i already did my suggestion ๐Ÿ˜›
04:24:12FromDiscord<Rika> lmao
04:30:14FromDiscord<ElegantBeef> I thought "Hey i can make even a basic code editor for NimX" and now i'm here completely clueless on how to get the `onTextInput` method to actual be invoked
04:34:33FromDiscord<Rika> congrats you baited yourself
04:38:40FromDiscord<Rebel> Why would C++ builds outperform C builds?
04:38:48FromDiscord<ElegantBeef> C++ compiler optimizations?
04:39:06FromDiscord<Rebel> Invoked via Nim or just baked in?
04:39:10leorize[m]1because exceptions
04:40:29leorize[m]1at least until orc becomes the default (exceptions:goto is generally superior)
04:41:06FromDiscord<ElegantBeef> Is it just soley exceptions and nothing else?
04:42:36FromDiscord<Rebel> really? Just due to exceptions that is impressive
04:43:01FromDiscord<nikki> exceptions:goto has codegen errors for me with std/json ๐Ÿค” i should make a gh issue soon
04:43:06FromDiscord<Rebel> I wonder if it would be more optimized if you used nlvm and did some llvm optimization afterwards
04:43:17FromDiscord<Rebel> (edit) "I wonder if it would be more optimized if you used nlvm and did some llvm optimization ... afterwards" added "on the IR"
04:43:21FromDiscord<nikki> i use c++ exceptions now but emscripten doesn't actually do c++ exceptions do well
04:44:09FromDiscord<ElegantBeef> I mean in some cases we're out preforming Rust already and it's LLVM so... ๐Ÿ˜„
04:44:16FromDiscord<nikki> @Rebel there's a lot of c-specific optimizations in clang that nim benefits from, and it's not that abstracted from the c output; but yeah would be interesting if nlvm benefits from it more
04:44:53FromDiscord<nikki> i use clang for the c/c++ compilation of nim output for macos and emscripten
04:45:33FromDiscord<Rebel> clang is hot
04:45:35FromDiscord<Rebel> so is wclang ๐Ÿ˜›
04:46:00FromDiscord<Rebel> What's even hotter is having some fun custom LLVM passes that do "fun" things to the IR ๐Ÿ˜„
04:46:42FromDiscord<Rebel> There is a really good master's thesis that is around 200 pages about LLVM obfuscation it's quite a read
04:48:50FromDiscord<ElegantBeef> I guess i'm very much weird, since i've never cared if my code is obfuscated
04:51:49leorize[m]1sigh, their nim code is not even the same as the rust code
05:00:06*superbia quit (Read error: Connection reset by peer)
05:00:11*superbia1 joined #nim
05:06:35ForumUpdaterBotNew thread by Tinygiant: SIGSEGV on deleteContent, see https://forum.nim-lang.org/t/7174
05:12:48*bung joined #nim
05:17:31*bung quit (Ping timeout: 272 seconds)
05:22:37leorize[m]1@ElegantBeef I managed to beat rust :p
05:22:44leorize[m]1I did it by... just copying the rust code
05:23:15*bung joined #nim
05:23:23FromDiscord<InventorMatt> are you going to post it on their thread?
05:23:43FromDiscord<ElegantBeef> Lol leorize, good job
05:24:03FromDiscord<ElegantBeef> With the default nim code did arc or cpp break the gap?
05:25:32leorize[m]1I doubt it, it's too inefficient
05:25:48leorize[m]1@InventorMatt probably, after I run the rust code
05:26:26FromDiscord<InventorMatt> okay, we just need to show rust people we are just as good as they are
05:26:49leorize[m]1lol arc slows things down
05:27:40FromGitter<bung87> can `async` ` await` pragma transform exception raise to result `future.fails()` ?
05:28:21FromDiscord<ElegantBeef> ARC has let us down, i'm going back to nim 1.0
05:33:39FromGitter<xflywind> https://github.com/nim-lang/Nim/issues/15392
05:33:41disbotโžฅ ARC/ORC loop string allocation slowdown ; snippet at 12https://play.nim-lang.org/#ix=2FZT
05:34:25FromGitter<xflywind> I sometimes benchmark string in loops too, it did not well than default gc.
05:38:32bungit may also a sequence assignment performance issue
05:39:27*njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
05:39:31*vsantana joined #nim
05:39:35*njoseph joined #nim
05:39:42*njoseph quit (Client Quit)
05:39:48*njoseph joined #nim
05:41:17*njoseph quit (Client Quit)
05:41:23*njoseph joined #nim
05:41:44*njoseph quit (Client Quit)
05:41:51*njoseph joined #nim
05:44:55*bung quit (Ping timeout: 256 seconds)
05:49:15*vsantana quit (Quit: Leaving.)
05:56:13*narimiran joined #nim
05:56:46FromDiscord<tinygiant> sent a code paste, see https://play.nim-lang.org/#ix=2FZY
05:58:36FromDiscord<ElegantBeef> The best way to get Nil like behaviour is to use an option
05:58:46leorize[m]1@ElegantBeef just replied to the thread
05:58:57FromDiscord<ElegantBeef> https://nim-lang.org/docs/options.html
05:58:58FromDiscord<ElegantBeef> Nice
05:59:08FromDiscord<ElegantBeef> I need to find something to program or i'm going to go mad
05:59:24FromDiscord<ElegantBeef> Lol i didnt post it
05:59:26FromDiscord<ElegantBeef> You lied! ๐Ÿ˜›
06:01:48FromDiscord<tinygiant> @ElegantBeef Thanks, I'll start reading up on them.
06:04:53leorize[m]1@ElegantBeef ah yea, sorry :P
06:04:55leorize[m]1fixed
06:08:15leorize[m]1fun fact: the Nim version can still be faster
06:08:39FromDiscord<ElegantBeef> I'm sure both can be
06:08:55leorize[m]1the rust version use a simple ascii string reverse
06:09:06leorize[m]1the nim version use the costlier unicode-aware reverse
06:10:22FromGitter<gogolxdong> By how much has ARC let you down?
06:10:27leorize[m]1dropped another second using the dumb reverse proc
06:12:27*a_chou joined #nim
06:12:40*thomasross quit (Ping timeout: 246 seconds)
06:16:55*bung joined #nim
06:16:59FromDiscord<j-james> in what order does `walkDir` iterate through files?
06:17:28FromDiscord<j-james> it certainly does not seem to be alphanumerical unless something's wacked out in my code
06:18:01FromDiscord<Rika> I believe there is no order
06:18:19FromGitter<bung87> your program relys order?
06:19:01FromGitter<bung87> I havn't seen that kind of use case
06:19:22FromDiscord<j-james> not currently, but i'd like to go through them alphanumerically
06:19:55FromGitter<bung87> then store them seq do sort
06:19:57FromDiscord<j-james> it's parsing a bunch of json files named `2019-07-02` and the like
06:19:59FromDiscord<ElegantBeef> Well you could capture that walkdir into a seq then sort it then go through it
06:20:16FromDiscord<ElegantBeef> `sequtils` has a `toSeq` which lets you capture iterators
06:20:53FromDiscord<j-james> ooh, i'll look into that
06:21:05FromDiscord<j-james> haven't done much with iterators yet
06:21:16*bung quit (Ping timeout: 240 seconds)
06:21:58FromDiscord<ElegantBeef> `algorithm` has a sort proc for sequences, so you'll probably just have to write the comparison for the tuple
06:25:19*NimBot joined #nim
06:32:25*bung joined #nim
06:35:36*a_chou quit (Remote host closed the connection)
06:39:25*vicfred quit (Quit: Leaving)
06:41:35*nixfreak quit (Ping timeout: 256 seconds)
06:58:37*habamax joined #nim
07:00:25FromDiscord<Kaynato> Say that I want to call an efficient free on a sequence of some object that contains some unsafe memory. If I implement both a destructor for the single object and a destructor for the seq of that object, should I have the seq destructor call the efficient free and then the single-object destructor, if the single-object destructor inefficiently performs that free since it's called once for each single object instead of once per sequence?
07:01:42FromDiscord<Kaynato> Or would it be fine to, for example, in the T destructor just do, say, obj.handle != nil: customFree(obj.handle) or something
07:14:22FromDiscord<mratsim> a proper destructor has to do if obj.foo != nil anyway
07:15:14FromDiscord<mratsim> or more if not obj.handle.isNil: https://github.com/mratsim/weave/blob/master/weave/cross_thread_com/flow_events.nim#L176-L178
07:15:27FromDiscord<mratsim> prefer isNil to == nil or != nil
07:17:14FromDiscord<mratsim> and a sequence will call each elements destructors on destruction
07:17:48FromDiscord<mratsim> unless it's a type that "supportsCopyMem" (i.e. not a ref, seq, string or custom =destroy) in that case it won't do a thing
07:20:44FromDiscord<flywind> What should be preferred: isNil or != nil?
07:20:46FromDiscord<flywind> https://discord.com/channels/371759389889003530/371759389889003532/696718991019999252
07:22:42FromDiscord<flywind> if `!= nil` is preferred according to the link I posts above, we should add comments to `isNil` at least.
07:43:44FromDiscord<mratsim> ah that changed
07:44:07FromDiscord<mratsim> I remember Araq saying that we should use isNil because maybe nil will be removed in the future.
07:44:21FromDiscord<mratsim> while isNil will be kept and be mapped to whatever we end up using
07:46:41*romkin joined #nim
07:46:45FromDiscord<flywind> It is a bit confusing. So I make a PR to clarify it.
07:50:06*romkin quit (Remote host closed the connection)
07:51:07FromDiscord<flywind> https://github.com/nim-lang/Nim/pull/16191
07:51:08disbotโžฅ prefer x == nil to x.isNil
08:00:24*superbia1 quit (Quit: WeeChat 2.9)
08:02:40FromDiscord<lqdev> meanwhile `x == nil` tripping up the compiler so bad it produces a completely unrelated generic instantiation error
08:03:06FromDiscord<ElegantBeef> Guess flywind disregard mratsim ๐Ÿ˜„
08:03:11FromDiscord<ElegantBeef> (edit) "disregard" => "disregarded"
08:06:33FromDiscord<flywind> Yeah, I see it now.
08:07:39FromDiscord<flywind> I will convert it to draft.
08:08:06FromDiscord<Kaynato> Hmm, I guess what my case is, is that there's vkFree... type function calls that expect pointer-len convention input
08:08:46FromDiscord<Kaynato> presumably calling it once on a collection is better than calling it one time per element, so I wanted to know if there was a general convention for that sort of case
08:09:30FromDiscord<Kaynato> And thanks about preferring !=/== nil, writing not isNil was getting frustrating
08:17:28*bung quit (Ping timeout: 260 seconds)
08:36:09*habamax_ joined #nim
08:43:26*PMunch joined #nim
08:50:54*bung joined #nim
08:51:31*vsantana joined #nim
08:57:23*habamax_ quit (Quit: leaving)
09:00:05*brainbomb[m] quit (Quit: Idle for 30+ days)
09:01:14*vsantana quit (Quit: Leaving.)
09:05:12*Tanger quit (Quit: Leaving)
09:15:22*hnOsmium0001 quit (Quit: Connection closed for inactivity)
09:24:56*krux02 joined #nim
09:27:16*krux02 quit (Remote host closed the connection)
09:30:28*Vladar joined #nim
09:32:02*hmmmmm joined #nim
09:34:54*habamax_ joined #nim
09:35:30*habamax_ quit (Client Quit)
09:56:05*bung quit (Ping timeout: 240 seconds)
09:57:45*bung joined #nim
10:21:25ForumUpdaterBotNew thread by Kobi: Cs2nim update, see https://forum.nim-lang.org/t/7175
10:28:38*MTRNord[m] is now known as MTRNord
10:49:22FromDiscord<fizzle_coder[terrorist]> hi how to setup nim with geany ide or how to setup aporia ide???
10:53:14*kiwi_83 joined #nim
10:53:18kiwi_83hi so % is overridden by json module as a create-new-json-object proc but what happens if I import another module that defines % again?
10:53:25kiwi_83compiletime error?
10:54:29FromDiscord<Vindaar> kiwi_83 yes, if the signature is the same you get an ambiguous identifier error at compile time
10:59:23kiwi_83hmm that is a bit odd to me...can the user redefine a differentn operator instead?
11:03:35FromDiscord<exelotl> @mixbot Aporia is outdated, you can find a list of Nim editor plugins here: https://github.com/nim-lang/Nim/wiki/Editor-Support
11:05:26Clonkk[m]What do you by 'redefine a different operator' ?
11:05:42Clonkk[m] * What do you mean by 'redefine a different operator' ?
11:05:57kiwi_83if i write a library A and there is already another library B existing, both which define %, how can someone who imports both libraries use both definitions of %?
11:06:06kiwi_83can you import % as something else
11:09:29FromDiscord<exelotl> sent a code paste, see https://play.nim-lang.org/#ix=2G13
11:10:33Clonkk[m]You can use ``module.proc`` syntax to remove ambiguity. You can use template to define alias as well ``template jsonpercentproc(x)= json.`%`(x) ``
11:10:58FromDiscord<exelotl> yep, template solution can work ^^
11:11:14FromDiscord<exelotl> (edit) "yep, template solution can work ... ^^" added "too"
11:16:31*vsantana joined #nim
11:21:34*bung quit (Ping timeout: 265 seconds)
11:21:40*Q-Master quit (Quit: ะฃัˆะตะป)
11:33:06*abm joined #nim
11:35:41*Q-Master joined #nim
11:36:04kiwi_83thanks, that code snippet is useful. what does qualified mean??
11:36:22*Q-Master quit (Client Quit)
11:36:33*Q-Master joined #nim
11:36:55kiwi_83and that `` around % is that stropping?
11:37:03kiwi_83but % isnt a keyword is it?
11:37:38FromDiscord<haxscramper> `%` is not a keyword - you can define custom operators
11:38:31FromDiscord<haxscramper> Backticks are necessary to use operators as regular functions - `` `%`(arg1, arg2)``
11:38:44*narimiran quit (Ping timeout: 260 seconds)
11:39:47FromDiscord<exelotl> kiwi_83: by qualified I meant prefixed with the name of the module
11:40:11*vsantana quit (Quit: Leaving.)
11:40:18*kiwi_835 joined #nim
11:40:33*vsantana joined #nim
11:41:07*kiwi_835 quit (Client Quit)
11:41:27kiwi_83thanks @exelotl that clears it up
11:42:17kiwi_83anyone know if the exercism nim track mentors are checking solutions?
11:42:29kiwi_83I am unable to progress because no response from mentors :(
11:42:45*vsantana quit (Read error: Connection reset by peer)
11:42:51PMunchkiwi_83, probably no-one has been active
11:42:56PMunchI'll log on and have a look .)
11:43:18kiwi_83thanks PMunch but only if you're not busy...wouldn't want to interrupt what youre doiing
11:43:58kiwi_83can someone give me rule of thumb on when to use Distinct Types?
11:44:15kiwi_83seems useful having to force type conversion but not sure when it will come in handy
11:44:38*vsantana joined #nim
11:45:10FromDiscord<lqdev> one example is units
11:45:21FromDiscord<lqdev> you can do `type Degrees = distinct float` and `type Radians = distinct float`
11:45:23PMunchIn general most people tend to use them when you need to be absolutely sure you don't mix types, or as you say if you want to have automatic type conversions
11:45:36FromDiscord<lqdev> yeah
11:45:54*vsantana quit (Client Quit)
11:50:28kiwi_83ohhh i see
11:50:38kiwi_83so it prevents this type of implicit coercion? https://play.nim-lang.org/#ix=2G1b
11:50:53FromDiscord<lqdev> yes
11:53:47*bung joined #nim
11:55:52*krux02 joined #nim
11:56:04PMunchkiwi_83, what's your nick on exercism?
11:58:18*bung quit (Ping timeout: 265 seconds)
11:59:20PMunchFeel free to PM it to me if you don't want to share it here
12:01:29*bung joined #nim
12:02:03*vsantana joined #nim
12:06:01*supakeen quit (Quit: WeeChat 2.9)
12:06:36*supakeen joined #nim
12:08:15*krux02 quit (Remote host closed the connection)
12:09:46kiwi_83pm'ed
12:10:00kiwi_83I like the block break from loops; which other languages have this?
12:10:14kiwi_83afaik you have to 'break' out of each loop separately
12:10:19kiwi_83no jumping
12:10:27kiwi_83i hope i make sense
12:10:36*bung quit (Ping timeout: 240 seconds)
12:11:48PMunchWell in C you can use jump
12:11:56PMunchLike goto
12:12:39PMunchBut yeah, most languages have to use something like a variable declared outside the loops and then check against that in all the loops.
12:12:55*bung joined #nim
12:16:37FromDiscord<exelotl> It's a little known feature of JavaScript: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/label
12:17:54kiwi_83oh wow, TIL
12:19:19FromDiscord<exelotl> haha, I think I used it once in my 2 years of writing mobile games in JS ๐Ÿ˜…
12:19:35PMunchHuh, TIL indeed
12:29:05*vsantana quit (Quit: Leaving.)
12:32:49FromDiscord<mixbot> tnx I have setup nim with geany successfully
12:35:30FromDiscord<exelotl> nice! :)
12:41:32FromDiscord<mixbot> can nim just compile to the pure machine code without using gcc?
12:42:31FromDiscord<Imperatorn> @mixbot wdym, without compiling? ๐Ÿค”
12:42:32Clonkk[m]The closest thing I know of is nlvm
12:42:41Clonkk[m]Which used llvm to generate machine code
12:43:02*habamax_ joined #nim
12:43:30*habamax_ left #nim (#nim)
12:44:15FromDiscord<mixbot> btw rust does use llvm, r8? why choose llvm as backend?
12:44:52*hmmmmm quit (Remote host closed the connection)
12:44:54FromDiscord<mixbot> is there any chance that nim will adopt nlvm in future?
12:46:03PMunchDefine adopt
12:46:14PMunchMove away from C compilers? Probably not
12:46:30PMunchNot that I see why we'd want to
12:46:49FromDiscord<mixbot> yea I meant shifting from gcc to nlvm
12:47:18FromDiscord<Cloufish> A silly question from a complete novice that is interested in nim: Can you use python libraries inside in nim lang?
12:47:34FromDiscord<Cloufish> (edit) "inside" => ""
12:48:12*Kaivo quit (Quit: WeeChat 2.9)
12:48:39FromDiscord<mixbot> I also think, because crystal has llvm backend but has no support for windows. and it compiles veey slow
12:49:36PMunch@Cloufish, have a look at nimpy and nimporter
12:50:01FromDiscord<flywind> Also you could look at this tutorial https://github.com/nim-lang/Nim/wiki/Nim-for-Python-Programmers
12:50:09FromDiscord<mixbot> but I am kind of curious over a statement about nim that I encounter many times that is "performance of nim is very close to c/c++" what does it mean???
12:50:37*bung quit (Ping timeout: 264 seconds)
12:51:08PMunch@mixbot, but why would we want to? Using a C compiler (you can use other ones than GCC) gives you great C interop, and all the years of optimisations that has gone into C, not to mention the incredible platform support
12:51:32PMunch@mixbot, well it means pretty much what it says. If you write a program in Nim, or in C/C++ they will perform about the same
12:57:10FromDiscord<exelotl> Nim(rod) originally caught my attention specifically because it compiles to C/C++
12:57:19FromDiscord<exelotl> it's such a brilliant idea and so few langs do it
12:57:43FromDiscord<mixbot> sent a long message, see http://ix.io/2G1B
12:58:10FromDiscord<Quibono> Kinda wish it was still called Nimrod
12:59:09FromDiscord<mixbot> it is indeed a good idea. What other languages do the same??
12:59:34FromDiscord<Quibono> Mixbot thatโ€™s kind of like saying โ€œIsnโ€™t Cโ€™s performance really assemblyโ€™s performanceโ€
12:59:54PMunchAh, Nim actually compiles to C, you can't go back from C to Nim code, partially because Nim has the powerful macro system
13:00:10PMunchBut yes, Nim code -> C code -> binary
13:00:33PMunchWell it's not redundant, it is easy to write a language that compiles to extremely inefficient C code
13:00:47PMunchNim in most cases maps to very efficient C code
13:02:35FromDiscord<mixbot> okay I understood it. then I have another question for you. That is, is it essential to have gcc to run a nim code?
13:03:26FromDiscord<exelotl> > What other languages do the same??โ†ตI was previously using a language called "ooc" which did the same, but it's abandoned now.โ†ตHaxe compiles to C++, JS and others, though I believe it's heavier than Nim (not suitable for embedded devlopment etc.)
13:03:27PMunchWell you need some kind of C compiler to compile C code, but to run the resulting binary you don't need one.
13:03:52PMunch(And again, you don't need GCC, pretty much any C compiler will do)
13:05:15FromDiscord<mixbot> Thanks for the info...
13:05:33Clonkk[m]You can compile Nim using as well clang
13:05:44Clonkk[m] * You can compile Nim using clang as well
13:06:04*DrWhax joined #nim
13:06:18FromDiscord<exelotl> Unity has some magic to compile C# to C++ for better performance. Likewise, Game Maker language also compiles to C++. But they are both closed source / proprietary solutions.
13:06:25kiwi_83maybe offtopic but why name change from nimrod to nim?
13:06:41FromDiscord<flywind> `cython` compiles python like syntax to C.
13:06:42FromDiscord<Clyybber> Nim is shorter, more memorable
13:07:13kiwi_83+1 makes sense
13:08:31FromDiscord<mixbot> is that true, nim was created for game development at first?
13:09:26FromDiscord<flywind> http://157.245.209.254/andreas-rumpf-on-creating-and-growing-nim/#why-did-you-start-nim
13:10:14kiwi_83nim has a lot of interesting ideas and feels a bit more liberating to use (doesn't feel limited when programming) so I really hope it becomes the next python
13:10:43FromDiscord<exelotl> that article is really good
13:11:11kiwi_83curious who the other 2 full time programmers working on nim are
13:12:52FromDiscord<mixbot> what is the USP for nim? As rust has one "Fearless Concurrency" or "No GC"
13:17:09FromDiscord<Idefau> "being epic"
13:17:21*bung joined #nim
13:17:48FromDiscord<haxscramper> I don't think there is official USP, but to me it has always been convenience-orientation. There is no ideology that you are advised to follow, and instead you can just code things
13:17:54Clonkk[m]<kiwi_83 "nim has a lot of interesting ide"> I know you mean well :), but thinking of Nim as "a better python" is a bad way to look at things. Beside, identation syntax Nim is not close to Python. Thinking in Nim feels very similar to C / C++ / Ada
13:18:21Clonkk[m]At least from my personal experience
13:18:30FromDiscord<haxscramper> Like eveything is optional and you can do OOP/FP/pure procedural etc. just as easily
13:18:45FromDiscord<flywind> The comment is very suitable to describe the advantage of Nim: https://old.reddit.com/r/programming/comments/jc91xp/nim_14/g90vg0j/
13:18:53FromDiscord<haxscramper> But metaprogramming of this level is really uncommon.
13:19:11FromDiscord<haxscramper> My personal opinion is that nim beats even lisp family and by a large margin
13:20:51Clonkk[m]Maybe OCaml would come close ?
13:21:06Clonkk[m]Haven't used OCaml that much but I know it is quite powerful
13:21:55kiwi_83 Clonkk[m] oh i shouldve clarified. I meant in terms of popularity
13:22:37FromDiscord<haxscramper> It like, Perl has "there is more one to do this", Python "there should be one way to do this", and in nim it is "do it however you like"
13:22:37kiwi_83what does sigil mean in that context flywin
13:24:23FromDiscord<haxscramper> I haven't used Ocaml metaprogramming either, but this is a first time I hear ocaml has good metaprogramming capabilities. Will look into it, thanks
13:24:29*habamax quit (Quit: leaving)
13:24:33FromDiscord<mixbot> my friend says perl is like regex, dont know what he meant though
13:24:47*habamax joined #nim
13:25:51FromDiscord<haxscramper> You can condense really complex text-processing logic in very few absolutely unreadable statements
13:26:55PMunchkiwi_83, there is actually a longer answer to the Nimrod -> Nim change, it's pretty fascinating
13:26:57FromDiscord<mixbot> Ocaml has been a major influence to rust i guess...
13:27:14FromDiscord<mixbot> tell us the story then
13:31:01Clonkk[m]<FromDiscord "<haxscramper> I haven't used Oca"> OCaml can have pre processor extensions which modify the AST before the compiler parse it.
13:32:39FromDiscord<haxscramper> Oh, well, this is not really a metaprogramming "in the language". Technically yes, but you need to write preprocessor extension and then use when compiling your code, and this is really bothersome
13:32:39*lritter joined #nim
13:32:49Clonkk[m]> <@freenode_FromDiscord:matrix.org> <haxscramper> I haven't used Ocaml metaprogramming either, but this is a first time I hear ocaml has good metaprogramming capabilities. Will look into it, thanks
13:32:49Clonkk[m] * OCaml can have pre processor extensions which modify the AST before the compiler parse it. It's called PPX (PreProcesor eXtension). That said, I've only used superfically (and it was a few years ago) so I'm not an expert by any means.
13:32:53FromDiscord<haxscramper> But this might count as metaprogramming techincally
13:33:51kiwi_83PMunch any link for that? im curious
13:33:58PMunchNim was originally called Nimrod after the king of Babel from the stories (which of is why Nim's logo is a crown. There is of course an even longer story for how the name came about). Nimrod the king is known as the great hunter king, and also the king that reigned during the building of the tower of Babel. The problem is that Bugs Bunny the cartoon has an episode in which Bugs sarcastically calls Elmer (which is trying to hunt him) for Nimrod.
13:33:58PMunchUnfortunately no-one in the US took the reference, and to this day a nimrod is synonymous to an idiot in the US. This isn't something you would know if you aren't from the US or have picked this up elsewhere, so Ar4q didn't think anything of it when he named the language Nimrod. But as more users came to the question about this was raised and the language finally changed name to Nim to avoid association with idiots.
13:34:18PMunchOh wow, that was quite a bit longer than I expected :P
13:34:46kiwi_83ohhh wow! that is even more satisfying to read haha
13:35:26Clonkk[m]<PMunch "Nim was originally called Nimrod"> So when is the next Nim-trivia night :D ?
13:36:15PMunchHaha, not sure what other trivia we have :P
13:39:42FromDiscord<Quibono> PMunch knowing the story of nimrod and bugs bunny, I still wish it was Nimrod. Biblical best hunter is cooler than whatever Nim is
13:40:08PMunchWell I like Nim, it has some story to it now :)
13:40:26PMunchAnd it allows us to call ourselves Nimrods when using Nim :P
13:43:31Clonkk[m]It also allows us to call ourselves Bunnies to confuse Americans :D
13:51:53FromDiscord<alehander42> the whole naming story is more nuanced than it seems biblically imo , but this is another discussion
13:51:55FromDiscord<alehander42> ๐Ÿ˜„
13:52:17FromDiscord<alehander42> btw i started looking at greek / koine greek
13:52:27FromDiscord<alehander42> and it seems pretty cool ฮบฮฑฮปฮนฮผฮตฯฮฑ
13:52:37FromDiscord<alehander42> did we have greek ppl
13:54:13*lritter quit (Ping timeout: 264 seconds)
13:54:24*Kaivo joined #nim
13:58:54*lritter joined #nim
14:07:16*bung quit (Ping timeout: 240 seconds)
14:07:51kiwi_83im about as greek as eating greek salad goes. that counts? ;)
14:19:29*bung joined #nim
14:22:25FromDiscord<Idefau> i want to learn greek
14:28:59FromDiscord<reilly> Follow-up from yesterday. I can't use Karax because my application needs multiple pages, and I need to make use of Jester's routes. Can I just `resp` an html file?
14:29:29PMunchYup
14:29:39PMunchOr you can resp multiple karax pages
14:29:46PMunchOr anything else really
14:31:17FromDiscord<๐˜€๐˜๐—ฎ๐—ฟ> Ist here a way to connect nim with rust lang
14:31:22FromDiscord<๐˜€๐˜๐—ฎ๐—ฟ> (edit) "Ist here" => "Is there"
14:32:29*habamax_ joined #nim
14:32:40miprithey can both compile to the C ABI, and they both have an FFI for that, and they both can make static and shared libraries. So use one or the other as if it were a C library.
14:32:41*habamax_ left #nim (#nim)
14:36:35FromDiscord<reilly> How can I do that? My first guess was to read the file as a string `let index = readFile("html/index.html")` then just `resp index` in my `"/"` route, but that gives me "template/generic instantiation of `routes` from here" on my line with `routes:`.
14:40:16*narimiran joined #nim
14:42:20avassis there any good way of getting around '... is not gc-safe as it accesses ... which is a global ...' for dependencies?
14:47:21*habamax quit (Quit: leaving)
14:47:28*bung quit (Ping timeout: 265 seconds)
14:47:38*habamax joined #nim
14:48:56*habamax_ joined #nim
14:50:44*grorkster joined #nim
14:51:50PMunchBy not doing that?
14:51:57PMunchOr using --gc:arc
14:53:20avasswell then I'd need to fix the library, I might need to read up on the difference between --gc:boehm and --gc:arc
14:55:01FromDiscord<Imperatorn> I'm a nimrod. Feels good to say
14:56:49*grorkster left #nim ("Leaving")
14:58:34avassI guess there's no way to {.threadvar.} an entire library :)
15:00:17*vicfred joined #nim
15:03:25FromDiscord<Zachary Carter> You use `threadvar` where otherwise you'd use thread local storage
15:03:33FromDiscord<Zachary Carter> if you were writing C for instance
15:04:00avassyeah but the global variable is defined in a library
15:04:06FromDiscord<Zachary Carter> I'm guessing you can store the result of a call to `dlopen` or `loadSymbol` in a `threadvar`
15:04:34avass(not my library)
15:05:08FromDiscord<Zachary Carter> I'm not really sure what you're trying to do so I can't really comment further
15:05:52*PMunch quit (Quit: leaving)
15:06:42avassTrying to render the tui with illwill (https://github.com/johnnovak/illwill) in a separate thread, but that uses a global to store the state of the previous buffer which causes nim to complain
15:07:19avassmore specifically this variable when calling display: https://github.com/johnnovak/illwill/blob/master/illwill.nim#L1106
15:07:58Clonkk[m]<avass "Trying to render the tui with il"> Eh, you could try using Atomic ?
15:08:27FromDiscord<reilly> I was going through literally this exact same thing a while back. If I remember correctly, you can mark your illwill thread as {.gcsafe.} and it will be ignored.
15:08:30avassClonkk[m]: Atomic?
15:08:42avasshmm thought I tried that
15:09:13Clonkk[m]https://nim-lang.org/docs/atomics.html#Atomic
15:09:20FromDiscord<reilly> Maybe there was something else to it, it was long ago enough that I can't remember exactly. Sounds about right to me.
15:09:34FromDiscord<Zachary Carter> `gPrevTerminalBuffer` isn't exported so how are you going to access it
15:10:10avassI'm not, I'm calling a function which modifies it's state
15:10:29avasshttps://github.com/johnnovak/illwill/blob/master/illwill.nim#L1210
15:11:07FromDiscord<Zachary Carter> if you use `gc:arc` this shouldn't be an issue
15:11:15avassit didn't change anything
15:12:21FromDiscord<Zachary Carter> what verison of Nim are you using? stable?
15:12:59avassyeah
15:13:22FromDiscord<Zachary Carter> hmm - well that module would also have to be compiled with `--gc:arc`
15:13:46*bung joined #nim
15:13:51*kiwi_83 quit (Quit: Connection closed)
15:14:03FromDiscord<Zachary Carter> but assuming it is - it's strange it's not working
15:14:07FromDiscord<Zachary Carter> do you have any code to share?
15:14:24avassI think this is the current state https://github.com/albinvass/hatty/pull/10
15:14:26disbotโžฅ Separate requests into own thread
15:14:33FromDiscord<Zachary Carter> thanks let me take a look
15:14:51avassvery much WIP :)
15:15:04FromDiscord<Zachary Carter> yeah no worries, no judgement here ๐Ÿ™‚
15:17:28FromDiscord<Zachary Carter> okay I have it running with that branch checked out - do I need to do anything to reproduce the error?
15:18:20FromDiscord<Zachary Carter> https://media.discordapp.net/attachments/371759389889003532/782988893548183552/Screen_Shot_2020-11-30_at_10.18.01_AM.png
15:18:24*bung quit (Ping timeout: 265 seconds)
15:18:35avassIt should probably be enough to remove the --threadAnalysis:off in nim.cfg
15:18:45FromDiscord<Zachary Carter> okay
15:19:26avassoh I think it might complain about the 'refresh' thread, but just remove that or comment it out or something
15:19:46avasss/thread/proc
15:20:01*waleee-cl joined #nim
15:27:56FromDiscord<Zachary Carter> Yeah - this one is a little complex because you're using `asyncdispatch` and `addCallback`... I know that Nim's async implementation requires `--gc:orc` first of all, because of cyclic data structures in its implementation (at least I believe that's still the case)
15:28:02FromDiscord<shadow.> how do you pass types to a generic call with `macros` `newCall`?
15:28:15FromDiscord<shadow.> like if i wanted to call `initTable[type, type]()` with `newCall`
15:28:52FromDiscord<Zachary Carter> but ultimately, as you've figured out, you're running into an issue where you're required to pass a function pointer that is GC safe to another procedure, and you're function isn't gcsafe because it mutates a global
15:29:22avasszachary: yeah, the requests is supposed to be reworked so that's not the main issue
15:29:37*habamax_ quit (Quit: leaving)
15:32:06FromDiscord<shadow.> ah ok so i think i need a bracket expression
15:32:13FromDiscord<shadow.> is there a proc to make a new bracket expression in macros?
15:32:42FromDiscord<Zachary Carter> you just create a new bracket expression node
15:33:07FromDiscord<shadow.> with newNimNode?
15:33:12FromDiscord<Zachary Carter> yeah you can do it that way
15:33:23FromDiscord<shadow.> kk
15:33:36FromDiscord<shadow.> ah right ive never really understood how do i add information to that node if i make it with newNimMode?
15:33:40FromDiscord<shadow.> like the types im passing
15:34:16FromDiscord<reilly> I still don't know how to `resp` an html document in Jester. If I can do that, I should be good to go.
15:35:33FromDiscord<reilly> Karax is not an option, by the way.
15:35:44*bung joined #nim
15:36:38avasszachary: I'll take it that the fix is: "Fork the library and push fix upstream" :)
15:36:48FromDiscord<Zachary Carter> avass: okay so the problem you're trying to solve is calling `display` from another thread
15:37:00avassyeah
15:37:05avassor not another thread
15:37:20avassit's supposed to only be used in a single thread unless I missed removing something
15:37:24FromDiscord<Zachary Carter> well - I just want to create a minimal reproducible example and then see if I can figure out a solution without you having to do that
15:37:35FromDiscord<Zachary Carter> hmm
15:38:06FromDiscord<Zachary Carter> no - you didn't, it doesn't look like you're calling `newThread` anywhere
15:38:34avasshuh?
15:38:55avassoh sorry, got it
15:39:45bung@araq when you mark PR suggestions to resolved what I need to do ?
15:40:25bungright now I want take that suggestions
15:41:38narimiranbung: he has already commited that suggestion
15:41:48ZevvAraq: you here
15:41:58bungso he can merge PR with suggestions ?
15:42:17narimiranbung: yes, look at the PR page, you can see "Update lib/pure/strutils.nim" commit
15:42:55bungI thought suggestions need the PR author to commit, ok get new knowlege.
15:43:30narimiranbung: check https://github.com/nim-lang/Nim/pull/16193/files to see the latest changes from the PR - it is already incorporated there
15:43:32disbotโžฅ toXXAscii use xor op, saving 30%~50% time ; snippet at 12https://play.nim-lang.org/#ix=2G2L
15:45:34bungoh ,that's behavior like someone can commits code to my branch..
15:45:50narimiranbung: btw, i don't understand why you prefer cast in those examples?
15:46:15FromDiscord<shadow.> hmm
15:46:46bungwell , char unit8 convert is fine , but other type like int to uint convert are different thing right ?
15:47:15FromDiscord<shadow.> how can i do the `[]=` operator with infix?
15:47:39Zevvhow do you mena?
15:47:44bungwhen I write that code in my mind I dont want convert A type to different B type
15:47:45Zevvwhat should that look like?
15:47:53FromDiscord<shadow.> wait lemme check the dumptree nvm
15:50:45*rockcavera joined #nim
15:52:17*hnOsmium0001 joined #nim
15:54:11FromDiscord<reilly> I'm losing my mind here, please tell me why this throws an error (https://hastebin.com/uhejadeyab.nim) yet replacing `index` with `"<h1>Hello, world</h1>"` works just fine.
15:54:25bungnarimiran does that explanation sound make sense ?
15:55:19FromDiscord<reilly> No, nevermind, it works, but Nimsuggest is complaining anyway.
15:55:26bungthey all give that down vote, suprise me.
15:55:53FromDiscord<Clyybber> bung: Don't worry about it :)
15:56:00FromDiscord<Clyybber> but yeah the no cast way is better
15:56:32FromDiscord<Clyybber> bung: conversion from uint8 to char and back doesn't introduce any unneccessary checks so its fine for performance too
15:57:02FromDiscord<Clyybber> And after all nim's cast isn't really a "reinterpreting" cast either, since its not an lvalue
15:58:00*vicfred quit (Quit: Leaving)
15:58:25bungI've seen jsgen that convert doing more work
15:58:58*vicfred joined #nim
16:05:05FromDiscord<fwsgonzo> sent a code paste, see https://play.nim-lang.org/#ix=2G2U
16:06:12FromDiscord<fwsgonzo> (edit) "https://play.nim-lang.org/#ix=2G2U" => "https://play.nim-lang.org/#ix=2G2W"
16:07:38FromGitter<HJarausch_gitlab> Thanks! โŽ int <> cint Is there a way out? โŽ I try to use the ncurses library which interfaces directly to the dynamic system library. It defines many parameters like lengths, positions, etc of type *cint*. โŽ When I try to call these with expressions like *i-line_start+1* I always get compiler errors since *i, line_start* etc are just ints. โŽ Do I have to declare all variable as *cint* or is there a
16:07:38FromGitter... nicer way out. ... [https://gitter.im/nim-lang/Nim?at=5fc518ca9cdc3e0d754e8667]
16:09:04FromGitter<iffy> How do I tell `ndb` to use a different sqlite3 dylib on macOS? https://github.com/xzfc/ndb.nim It keeps using v3.24.0 but I want to use /usr/local/Cellar/sqlite/3.33.0/lib/
16:10:32FromGitter<iffy> I just realized that might not be a nim question...
16:15:29FromGitter<bung87> why not just convert your operands to cint ?
16:17:29FromDiscord<flywind> !eval for i in high(int64) .. high(int64): discard
16:17:32NimBot/playground/nim/lib/system/iterators_1.nim(97) inโ†ต/playground/nim/lib/system/fatal.nim(49) sysFatalโ†ตError: unhandled exception: over- or underflow [OverflowDefect]
16:18:14FromDiscord<๐˜€๐˜๐—ฎ๐—ฟ> Is there a way to execute nim from rust
16:18:16FromDiscord<๐˜€๐˜๐—ฎ๐—ฟ> https://developers.redhat.com/blog/2017/11/16/speed-python-using-rust/
16:18:28FromDiscord<๐˜€๐˜๐—ฎ๐—ฟ> Like that or smth sinilar
16:18:43FromDiscord<๐˜€๐˜๐—ฎ๐—ฟ> (edit) "execute" => "use" | "from" => "with"
16:19:11miprithey can both compile to the C ABI, and they both have an FFI for that, and they both can make static and shared libraries. So use one or the other as if it were a C library.
16:20:24FromDiscord<flywind> !eval for i in high(int32) .. high(int32): discard
16:20:26NimBot/playground/nim/lib/system/iterators_1.nim(97) inโ†ต/playground/nim/lib/system/fatal.nim(49) sysFatalโ†ตError: unhandled exception: over- or underflow [OverflowDefect]
16:20:33FromDiscord<flywind> !eval for i in high(int16) .. high(int16): discard
16:20:35NimBot<no output>
16:20:55bung!eval for i in 1 .. 1 :discard
16:20:57NimBot<no output>
16:22:49FromDiscord<Zachary Carter> avass: I went ahead and reduced your example to only the code that messes with the TUI thread. I checked out `illwill` and made the three or four global vars, threadvars. This fixed all the issues with gc safety in your code - so I would recommend just issuing a PR to do that
16:23:11FromDiscord<Zachary Carter> I'm not sure why you want a terminal buffer per thread, but that's another issue ๐Ÿ™‚
16:24:45FromDiscord<fwsgonzo> how do you convert a json object to a string?
16:25:23FromDiscord<fwsgonzo> looks like the pretty function ๐Ÿ™‚
16:26:29FromDiscord<๐˜€๐˜๐—ฎ๐—ฟ> How do u compile it to c?
16:29:55FromDiscord<lqdev> @HJarausch_gitlab use x.cint to convert x to a cint, or x.int to convert x to an int
16:30:17FromDiscord<lqdev> this works with any primitive type
16:30:19avasszachary: yep that was my initial idea as well, but I thought I'd check to see if there's a better way to handle it without needing to push something upstream :)
16:30:20FromGitter<bung87> just $yourObj
16:30:26avassthanks anyway!
16:31:02FromGitter<HJarausch_gitlab> @Bung I had hoped for an automatic conversion plus something for let all *ints* be of type *int32*. I don't "long int" anywhere.
16:31:03FromDiscord<Zachary Carter> No problem - sorry I don't think there is.
16:31:28FromDiscord<lqdev> nim is not C
16:31:49FromDiscord<lqdev> cint is potentially smaller than an int and all narrowing conversions are disallowed
16:31:59FromDiscord<Zachary Carter> `cint = int32`
16:32:04FromDiscord<lqdev> precisely
16:32:06FromDiscord<Zachary Carter> alwys
16:32:09FromDiscord<๐˜€๐˜๐—ฎ๐—ฟ> How so
16:32:12FromDiscord<Zachary Carter> (edit) "alwys" => "always"
16:32:38FromGitter<HJarausch_gitlab> Therefore I'd like to set "standard" int to int32 in my code.
16:32:44FromDiscord<lqdev> but int may be int8, int16, int32 or int64 depending on your arch
16:32:52narimiranwrite nim in nim.
16:32:53FromDiscord<Zachary Carter> IMO just don't use `cint` use `int32`
16:32:58FromDiscord<lqdev> just use int always
16:33:05FromGitter<bung87> write a convert toCint(v:int) = v.cint ?
16:33:15FromDiscord<lqdev> unless you need super fast performance or are tight on memory
16:33:22FromDiscord<Zachary Carter> well if you're interoping with c code
16:33:26FromDiscord<Zachary Carter> or C++
16:33:26FromDiscord<lqdev> or that
16:33:48FromDiscord<Zachary Carter> my point there is - don't use `cint` it's just confusing and at the end of the day, an alias
16:33:55FromDiscord<Zachary Carter> be specific and use `int32` if you need a 32 bit signed integer
16:33:57FromGitter<bung87> that need export that `convertor` everywhere
16:34:58FromDiscord<Giamby> Is there any way I can pass a reference to a `seq[ptr myObject]` to an object constructor so that if other pieces of code change that variable such changes reflect immediately everywhere?
16:34:58FromDiscord<Zachary Carter> I think `cstring` is fine because most people understand that C doesn't have Nim strings so this a type to specifically address that
16:35:02FromGitter<HJarausch_gitlab> @Bung Thanks, I'll try that. Isn't there something like a pragma to tell the compiler that I want *int32* as standard *int* on my 64bits architecture.
16:35:06FromDiscord<Giamby> Basically I need to pass by reference rather than by value
16:35:32FromDiscord<lqdev> @Giamby nope
16:35:36FromDiscord<Zachary Carter> you can use a `ptr`
16:35:40FromDiscord<Zachary Carter> or box your seq
16:35:43FromDiscord<lqdev> you can store your seq in a ref object
16:35:50FromDiscord<Zachary Carter> or that
16:35:55FromDiscord<InventorMatt> if you only want to access nim code from rust then you can check out this https://gradha.github.io/articles/2015/01/writing-c-libraries-with-nim.html for how to make a nim library into a c library
16:36:03FromDiscord<Giamby> yeah but then I'll have to dereference every time
16:36:04FromGitter<bung87> I dont think so these type design to match machine arch
16:36:07FromDiscord<Giamby> that's messy ๐Ÿ˜ฆ
16:36:20FromDiscord<lqdev> seqs inherently have value semantics
16:36:27FromDiscord<Giamby> bummer
16:36:31FromDiscord<Zachary Carter> not if you use a `var seq`
16:36:33FromDiscord<lqdev> you can make your enclosing object ref and pass that around
16:36:50FromDiscord<Giamby> that would add an unneeded layer of indirection tho
16:37:02FromDiscord<Giamby> is that so? let me give it a try ๐Ÿ‘€
16:37:27FromDiscord<Zachary Carter> just make the proc accesspting the seq take a `var seq[T]` as an argument instead of a `seq[T]`
16:37:38FromDiscord<lqdev> you can't store a var seq in an object
16:37:55FromDiscord<lqdev> unless you use EXPERIMENTAL!!! view types
16:38:12FromDiscord<Zachary Carter> yeah - this only works for passing a `seq` to a proc
16:38:15FromDiscord<lqdev> i shouted that out because in practice they barely work, but that's what makes them experimental
16:39:42FromDiscord<Giamby> yeaah that does not quite work
16:39:57FromDiscord<Giamby> `The VM:ObjectType type requires the following fields to be initialized: stack.`, but i I inizialize it other weird stuff happens
16:40:14FromDiscord<Giamby> so I guess my last chance is a ref seq
16:40:34FromDiscord<Zachary Carter> yeah - would need to see some example code
16:42:11FromDiscord<Giamby> it's a huge project, hard to take a small piece without making it useless
16:42:30FromDiscord<Giamby> I'll resort to using `self.stack[].stuff()`
16:42:57FromDiscord<Giamby> or maybe not, what was the pragma to automatically dereference the first parameter passed to a proc?
16:45:48FromDiscord<Zachary Carter> `{.experimental: "implicitDeref".}`
16:46:09FromDiscord<Giamby> it seems like everything is working ๐Ÿ‘€
16:46:21FromDiscord<Giamby> nice to notice that weeks and weeks of debugging were basically useless
16:46:39FromDiscord<Giamby> note-to-self: ALWAYS check value vs ref semantics before anything else, lol
16:48:09FromDiscord<Zachary Carter> yeah - those are good to understand
16:48:20FromDiscord<Avatarfighter> Hello hello everyone
16:48:44FromDiscord<Zachary Carter> and seqs and strings can be confusing
16:48:51FromDiscord<Zachary Carter> o/ @Avatarfighter
16:50:44FromDiscord<Giamby> the funniest part of all that
16:51:00FromDiscord<Giamby> is that literally changing 2 lines resolved weeks of debugging
16:51:23FromDiscord<Giamby> it's incredible how a tiny little error can destroy a 2k+ lines codebase, now I wanna die ๐Ÿ˜‚
16:55:39FromDiscord<Zachary Carter> I mean I've spent weeks debugging a `+` vs a `-`
16:55:50FromDiscord<Zachary Carter> it happens
16:56:07FromDiscord<Zachary Carter> or maybe it was a ` -1` I don't remember
16:56:11FromDiscord<lqdev> @Giamby if i were you i'd just make VM a ref object and forget about it
16:57:26FromDiscord<shadow.> is it possible to do this with a `quote do:`?
16:57:32FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2G3b
16:57:40FromDiscord<shadow.> if i use a quote do to add then later on fStringResult is an unidentified identifier
16:57:46FromDiscord<shadow.> (edit) "add" => "add,"
16:58:17FromDiscord<๐˜€๐˜๐—ฎ๐—ฟ> sent a code paste, see https://play.nim-lang.org/#ix=2G3c
16:58:23FromDiscord<๐˜€๐˜๐—ฎ๐—ฟ> (edit)
16:58:41FromDiscord<shadow.> have you checked your compile cache?
16:59:17FromDiscord<Recruit_main707> nim c --nimcache:,/cache test.nim
16:59:26FromDiscord<Recruit_main707> ./ not ,/
16:59:44FromDiscord<lqdev> @shadow. yes. you need to declare `let fStringResult = ident"fStringResult"` outside of the quote do: block and then use that
16:59:53FromDiscord<lqdev> because quote do genSyms all identifiers
17:00:00FromDiscord<shadow.> ohhhh ok lemme try that ty
17:00:30FromDiscord<Giamby> the VM _is_ a ref object
17:00:37FromDiscord<lqdev> oh
17:00:48FromDiscord<lqdev> soโ€ฆ store the seq there and just access it?
17:01:18FromDiscord<Giamby> I tried and the seq wouldn't get updated whenever my vm pushed and popped to it
17:01:22FromDiscord<๐˜€๐˜๐—ฎ๐—ฟ> Nd what would be the main C file
17:01:24FromDiscord<lqdev> i usually structure my VMs to not have a stack stored inside of an object :p
17:01:25FromDiscord<Giamby> not inside my custom object
17:01:32FromDiscord<lqdev> just as a local variable in `interpret()` or whatever
17:01:43FromDiscord<Giamby> how would you make call frames work
17:01:43FromDiscord<๐˜€๐˜๐—ฎ๐—ฟ> sent a long message, see http://ix.io/2G3e
17:02:00FromDiscord<Giamby> without storing a reference to where it starts and ends
17:02:00FromDiscord<lqdev> last time i managed to do this https://github.com/liquid600pgm/hayago/blob/master/src/hayago/private/vm.nim
17:02:18FromDiscord<lqdev> mainly to support reentrancy
17:02:38FromDiscord<lqdev> anyways, how do you initialize your stack
17:02:43FromDiscord<Giamby> so is it thread safe?
17:02:45FromDiscord<lqdev> yeah
17:02:50FromDiscord<Giamby> empty seq? xd
17:02:56FromDiscord<lqdev> no i mean
17:02:57FromDiscord<Giamby> new(seq[ptr thing])
17:03:01FromDiscord<lqdev> hm
17:03:18FromDiscord<Giamby> before it was just self.stack = @[]
17:03:27FromDiscord<Giamby> is that vm based off craftinginterpreters?
17:03:32FromDiscord<lqdev> a bit
17:03:34FromDiscord<lqdev> but not really
17:03:53FromDiscord<lqdev> that sort of init should work
17:04:03FromDiscord<lqdev> if `self` is a ref object
17:04:22FromDiscord<Giamby> and it is
17:04:26FromDiscord<lqdev> you should be able to pass `self` around and stuff and `stack` should be shared between all the references to `self`
17:04:33FromDiscord<Giamby> idk, now it works, I need to fix recursion rn lol
17:04:41FromDiscord<lqdev> gl on your vm btw
17:04:46FromDiscord<Giamby> thx
17:04:54FromDiscord<Giamby> how feature complete is your lang btw?
17:05:02FromDiscord<๐˜€๐˜๐—ฎ๐—ฟ> sent a long message, see http://ix.io/2G3f
17:05:19FromDiscord<Giamby> I see the vm is pretty small, mine is over 600 lines already xd
17:05:42FromDiscord<InventorMatt> @star the @mtest.nim.c would be the main c file the others are nim libraries it pulls in
17:06:24FromDiscord<lqdev> @Giamby the lang is quite feature complete except the stdlib, closures, and a bunch of features i wanted to impl like coroutines
17:06:35FromDiscord<lqdev> abandoned in favor of something simplerโ€ฆ i got lost in type checking
17:06:44FromDiscord<Giamby> I see
17:06:49FromDiscord<Giamby> is it object oriented?
17:06:59FromDiscord<lqdev> not really, more procedural
17:07:02FromDiscord<lqdev> like nim
17:07:15FromDiscord<Giamby> Makes sense and keeps the code simple and small
17:07:15FromDiscord<lqdev> the new one i'm working on is more OO though
17:07:28FromDiscord<Giamby> I wanna implement coroutines too
17:07:35FromDiscord<Giamby> it seems quite trivial once you have generators
17:07:53FromDiscord<Giamby> and generators are basicallty functions that store a bytecode offset to the last position before yielding
17:07:56FromDiscord<Giamby> soo yeah
17:08:01*habamax quit (Quit: leaving)
17:08:06FromDiscord<Giamby> (edit) "basicallty" => "basically"
17:08:23FromDiscord<lqdev> i had a theory on how to implement coro but never got around to it D:
17:08:36FromDiscord<Giamby> My approach would be simple
17:09:01FromDiscord<Giamby> whenever you await (and therefore yield) the function returns but also store a reference to where to resume the next time you call it
17:09:12FromDiscord<Giamby> which is really what coroutines/generators are
17:09:28FromDiscord<๐˜€๐˜๐—ฎ๐—ฟ> Oh well my gcc compiler wont find nimbase.h
17:09:31FromDiscord<๐˜€๐˜๐—ฎ๐—ฟ> :ferrisThonk:
17:09:32FromDiscord<lqdev> yeah my approach was also storing a call stack
17:09:48FromDiscord<Giamby> I'd store just an integer
17:09:59FromDiscord<Giamby> an index in the bytecode sequence
17:10:21FromDiscord<Giamby> the stack would implicitly remain because of the way I've structured functions (as objects)
17:10:29FromDiscord<lqdev> mmkay
17:10:42FromDiscord<๐˜€๐˜๐—ฎ๐—ฟ> Any1 wanna help?
17:10:50FromDiscord<Giamby> so the next time you resume, the function will start executing again from offset x
17:11:01FromDiscord<Giamby> where x is the instruction pointer of the last yield + 1
17:11:14FromDiscord<๐˜€๐˜๐—ฎ๐—ฟ> :ferrisThonk:
17:11:36FromDiscord<lqdev> cool. i'mma head back to work now, gotta get those method calls going
17:14:37*natrys joined #nim
17:14:47ForumUpdaterBotNew thread by Viralpoetry: Simple way to have a dynamic shared list/sequence between threads, see https://forum.nim-lang.org/t/7176
17:15:28FromDiscord<๐˜€๐˜๐—ฎ๐—ฟ> Hm
17:15:44FromDiscord<InventorMatt> nimbase.h should be in your path path under the lib folder
17:15:57FromDiscord<๐˜€๐˜๐—ฎ๐—ฟ> (edit) "Hm" => "Hm, help?"
17:15:57FromDiscord<InventorMatt> nim path
17:16:59FromDiscord<fwsgonzo> is the reasoning behind not being able to create a JSON object at compile time because of memory allocation?
17:28:46bungall ref objects maybe
17:33:01FromDiscord<๐˜€๐˜๐—ฎ๐—ฟ> @InventorMatt wont find
17:41:57FromDiscord<InventorMatt> so you don't have nimbase.h in here nim\1.4.0\lib ?
17:45:14*bung quit (Quit: Lost terminal)
17:52:01FromDiscord<๐˜€๐˜๐—ฎ๐—ฟ> I found tho now i get other errors
17:52:43FromDiscord<๐˜€๐˜๐—ฎ๐—ฟ> sent a code paste, see https://play.nim-lang.org/#ix=2G3w
17:52:53FromDiscord<๐˜€๐˜๐—ฎ๐—ฟ> sent a code paste, see https://play.nim-lang.org/#ix=2G3x
17:54:40FromDiscord<๐˜€๐˜๐—ฎ๐—ฟ> Yikes
17:57:10FromDiscord<InventorMatt> now that I don't now how to solve. I've never attempted a c library with nim before. maybe someone that is more knowledgeable later can help. you could also try making a thread on the forum and see if you can someone there who can help
17:58:01FromGitter<deech> `./koch docs` is giving me the following error: `Error: unhandled exception: cannot open: doc/codeowners.rst [IOError]`. This is a fresh pull, should I be doing something different to generate docs, this is my first time.
17:59:22*vicfred quit (Quit: Leaving)
17:59:58*rockcavera quit (Remote host closed the connection)
18:02:57FromDiscord<Giamby> ok so I'm having a tini tiny issue here
18:03:43FromDiscord<Giamby> I've made so that all my procs now use `ref VM` rather than `var VM`, but now I'm having issues with my `initVM` procedure. When I set the fields of the object I get a NilAccessError
18:05:23FromDiscord<Giamby> sent a long message, see http://ix.io/2G3F
18:05:47FromDiscord<lqdev> you need to do `new result` at the top of your `initVM` proc
18:05:50*vsantana joined #nim
18:06:01FromDiscord<lqdev> also you said you were using a ref object alreadyโ€ฆ
18:06:12FromDiscord<Giamby> yeah but for some reason I was not using new
18:06:16FromDiscord<Giamby> my code is probably a mess
18:06:23FromDiscord<Giamby> that's what 6 years of python do
18:06:38pixtum[m]Is work still being done on nim-lang/ui?
18:06:49pixtum[m]It says the last commit was last year
18:07:50FromDiscord<Giamby> mhh nope, same error, same line
18:08:33FromDiscord<Giamby> I hadn't felt this noob in a while lol
18:19:15*vicfred joined #nim
18:20:08*vicfred quit (Max SendQ exceeded)
18:20:50*vicfred joined #nim
18:21:43*vicfred quit (Max SendQ exceeded)
18:22:13*vicfred joined #nim
18:26:37FromDiscord<Giamby> it's weird because the object should be initialized
18:28:48FromDiscord<lander> @deech from fresh, ` ./build_all.sh && ./koch docs` should work.
18:29:46FromGitter<deech> lander: hmm that is what I'm doing.
18:32:07FromGitter<deech> Is subtyping inside a wrapper type expected to work? Here's an example of a dispatching on a subtype inside an `Option` causes a compiler error: https://play.nim-lang.org/#ix=2G3N
18:32:28FromDiscord<lander> No, idea, do you have a previous nim in the path?
18:33:29FromGitter<deech> lander: I did: `./koch boot -d:release && ./koch docs`. I *think* this is the same as what you suggested.
18:36:42FromDiscord<lander> But that's not bootstrapping, how did you compile koch? Not sure if it should work just with your that. I tried fully bootstrapped with ./build_all.sh and it worked for me
18:37:10FromGitter<deech> I'll try that. Thanks!
18:41:30*vsantana quit (Quit: Leaving.)
18:44:59ForumUpdaterBotNew thread by Deech: Does subtyping inside a parameterized type work?, see https://forum.nim-lang.org/t/7177
18:46:01*thomasross joined #nim
18:50:55*vsantana joined #nim
18:54:16*habamax joined #nim
18:54:16*natrys quit (Ping timeout: 246 seconds)
18:59:49reversem3What libs do I need to extract information on an OS ? I found to extract Disk Free, network activity, CPU speed, Ram usage ect..
19:01:36FromDiscord<Giamby> there are some constants defined in the system module such as `hostOS` and `hostCPU`
19:07:30*natrys joined #nim
19:08:10reversem3sysinfo , osproc
19:09:19*superbia joined #nim
19:23:04*hmmm joined #nim
19:23:14hmmmhallo
19:24:12hmmmI miss disruptek :|
19:29:06FromDiscord<Giamby> can anyone help?
19:29:22hmmmstate the nature of your emergency
19:30:02*apahl quit (Ping timeout: 264 seconds)
19:30:26*apahl joined #nim
19:32:30FromDiscord<tinygiant> sent a long message, see http://ix.io/2G48
19:34:39FromDiscord<lqdev> @Giamby define your object as `type VM = ref object` first of all
19:35:05FromDiscord<lqdev> then, you'll need to use `new VM` to create your object
19:35:07FromDiscord<lqdev> or just `VM()`
19:35:49FromDiscord<lqdev> the default value for anything is binary 0, and because refs are really just pointers, that means that the default value of your ref is `nil`, so you must always initialize it with something
19:36:13*vicfred quit (Quit: Leaving)
19:36:20FromDiscord<lqdev> also, what do you need `ptr Obj` for?
19:36:31FromDiscord<lqdev> ptr is inherently unsafe, you should avoid it at all costs
19:36:48FromDiscord<lqdev> unless you really know what you're doing
19:37:09*vicfred joined #nim
19:38:03*vicfred quit (Max SendQ exceeded)
19:38:32*vicfred joined #nim
19:40:00*rockcavera joined #nim
19:42:23*rockcavera quit (Remote host closed the connection)
19:45:09*vicfred quit (Quit: Leaving)
19:47:16FromDiscord<fwsgonzo> is there a performance penalty when combining ARC with -d:useMalloc ?
19:47:48FromDiscord<Recruit_main707> Depending on the situation
19:49:02*habamax quit (Quit: leaving)
19:53:18*rockcavera joined #nim
19:55:56FromDiscord<Giamby> I plan to add a custom GC
19:56:09FromDiscord<Giamby> already did that
19:56:40FromDiscord<lqdev> @Giamby would you mind sharing the code? that would make it easier for us both
19:59:34*superbia quit (Quit: WeeChat 2.9)
20:01:29FromDiscord<Giamby> what code do you need specifically? I already shared the proc initializing the VM, do you need the type declaration too?
20:01:50FromDiscord<lqdev> that would help
20:02:22FromDiscord<lqdev> but really to see your problem i'd need to see the entire thing, it's hard to cross-reference stuff just based on some snippets
20:02:41FromDiscord<lqdev> is the return type of `initVM` still `ref VM`?
20:05:10ForumUpdaterBotNew thread by Eyes: Nim (1.4 ORC) v.s. Rust in terms of safety?, see https://forum.nim-lang.org/t/7179
20:07:22*rockcavera quit (Remote host closed the connection)
20:11:46FromDiscord<Giamby> Yep. If you give me a sec I'll push to my repo so that you can read the full code
20:14:06FromDiscord<Giamby> sent a long message, see http://ix.io/2G4B
20:14:49FromDiscord<nikki> you should return `: VM` not `ref VM` unless you actually want two levels of `ref`
20:15:07FromDiscord<Giamby> oh oof?
20:15:09FromDiscord<nikki> if you change that, the code you had with `new result` will work
20:15:26FromDiscord<lqdev> and you can get rid of `ref seq`
20:15:49FromDiscord<nikki> yeah unclear why you used `seq` everywhere else but `ref seq` for that one field
20:15:56FromDiscord<Giamby> tbh idk
20:16:05FromDiscord<Giamby> probably in an attempt to fix call frames
20:16:16FromDiscord<Giamby> ah yes the stack used to be a ref because the vm was not
20:17:12FromDiscord<Giamby> there is a slight problem
20:17:30FromDiscord<Giamby> if I don't set the return type as ref VM then the code kind of breaks where it expects a ref VM
20:17:52FromDiscord<Giamby> for instance I have the freeVM() proc that wants a ref VM and gets a VM instead and the compiler doesn't like it of course
20:18:26FromDiscord<nikki> freeVM should also not take a ref VM
20:18:37FromDiscord<nikki> your VM type is already a ref type, so it sounds like you want to take VM everywhere
20:19:30FromDiscord<Giamby> oh I see
20:19:31FromDiscord<nikki> you can't just keep adding / removing `ref` randomly until it compiles, it has to make sense ๐Ÿ˜…
20:19:38FromDiscord<Giamby> so what I'm doing is a ref to a ref
20:19:42FromDiscord<Giamby> that sounds dumb
20:19:51FromDiscord<nikki> it's not dumb, it's just not what you probably want to do right now
20:19:54FromDiscord<Giamby> I thought that ref thing was just a type hint
20:20:00FromDiscord<Giamby> like "hey this is a ref to this"
20:20:10*vicfred joined #nim
20:20:10FromDiscord<Giamby> not that it actually made a ref to the thing you're passing
20:20:13FromDiscord<nikki> it is. you already defined `VM` as `ref object ...`
20:20:18FromDiscord<Giamby> yeaah
20:20:23FromDiscord<nikki> so `ref VM` is `ref ref object ...`
20:20:30FromDiscord<Giamby> I think it's quite evident this is a PEBKAC
20:20:31FromDiscord<nikki> it is the hint, it's not not the hint. it's just that you are saying this ^
20:20:53FromDiscord<Giamby> is it so evident that I've been using Python for so long?
20:21:14*vicfred quit (Max SendQ exceeded)
20:21:14FromDiscord<nikki> only because you keep saying that
20:21:42*vicfred joined #nim
20:21:51FromDiscord<nikki> personally, i never really define types as `ref object`
20:21:52FromDiscord<Giamby> never had to deal with ref vs value semantics
20:22:05FromDiscord<nikki> i always explicitly write `ref X` in places. things can 'hide refs' by having them as fields, for sure
20:22:08FromDiscord<Giamby> It says it's recommended for inheritance on the docs and I do that
20:22:17FromDiscord<nikki> ah word. well, i don't really use inheritance lol so
20:22:29FromDiscord<Giamby> I'm too OOP biased not to use it I fear
20:22:34FromDiscord<nikki> but yeah i like the clarity of having `ref T` somewhere
20:22:47FromDiscord<Giamby> well for sure you can't make such mistakes by having a ref to a ref
20:22:59FromDiscord<Giamby> only god knows how deep the reference calls in my code were
20:23:00FromDiscord<Giamby> lol
20:26:19*Vladar quit (Quit: Leaving)
20:28:19Zevv!last disruptek
20:28:19disbotdisruptek spoke in 12disbot 2 days ago
20:30:24*narimiran quit (Ping timeout: 256 seconds)
20:34:00FromDiscord<alehander42> hey guys, do you need any update from me about the nil thing before december
20:36:44*vicfred quit (Quit: Leaving)
20:37:28*vicfred joined #nim
20:46:54FromGitter<deech> How do I use the covariance feature ( https://nim-lang.org/docs/manual_experimental.html#covariance )? Hunting around the source I see `nimEnableCovariance` flag but setting it with `-d:nimEnableCovariance` doesn't seem to enable it.
20:47:47FromGitter<deech> Also tried `--experimental`.
20:51:11mipriI don't see a feature for it in compiler/options.nim, and the code doesn't work as is, so there may not be a way to do that
20:52:39FromGitter<deech> There's a test for it but I guess that never gets run: https://github.com/nim-lang/Nim/blob/devel/tests/cpp/tcovariancerules.nim
20:55:05*vicfred quit (Quit: Leaving)
21:01:16*vesper11 quit (K-Lined)
21:17:45*vicfred joined #nim
21:18:37*vicfred quit (Max SendQ exceeded)
21:19:05*vicfred joined #nim
21:20:16*vicfred quit (Max SendQ exceeded)
21:20:50*vicfred joined #nim
21:21:52*vicfred quit (Max SendQ exceeded)
21:22:24*vicfred joined #nim
21:33:54*vicfred_ joined #nim
21:36:51*vicfred quit (Ping timeout: 265 seconds)
21:39:51*rockcavera joined #nim
21:40:28*vicfred joined #nim
21:40:53*vicfred_ quit (Ping timeout: 256 seconds)
21:41:45*vicfred quit (Client Quit)
21:44:58FromDiscord<reilly> I have a Jester web app I want to deploy. What service would be easiest to do this on? I ask because I don't know how well-supported Nim is.
21:47:30FromDiscord<Zachary Carter> probably digital ocean
21:51:20*hmmm quit (Ping timeout: 272 seconds)
21:53:25*vicfred joined #nim
22:01:59*gangstacat quit (Ping timeout: 272 seconds)
22:17:42*NimBot joined #nim
22:26:05FromDiscord<Recruit_main707> Disruptek still banned?
22:26:52FromDiscord<Recruit_main707> @Zachary Carter is digital ocean free?
22:27:02*gangstacat joined #nim
22:27:14FromDiscord<ache of head> wait what
22:27:20FromDiscord<ache of head> is disruptek banned????
22:27:27FromDiscord<Recruit_main707> Muted
22:27:39FromDiscord<Quibono> I believe so.
22:27:45FromDiscord<Zachary Carter> lol why did he get banned?
22:28:08FromDiscord<Recruit_main707> Async argument got a bit personal w/ dom iirc
22:29:01FromDiscord<ache of head> dang
22:29:35miprihe's since been unmuted.
22:31:33FromDiscord<Zachary Carter> ah
22:31:52FromDiscord<Recruit_main707> He hasnโ€™t talked in 2 days, without being muted?
22:34:05*natrys quit (Quit: natrys)
22:35:25*hmmm joined #nim
22:35:30FromDiscord<Recruit_main707> I wonder if I can contact him through discord then
22:42:02*hmmm quit ()
22:56:41FromDiscord<squid> What is escape character \L?
22:58:24mipri!eval echo '\L'.int
22:58:27NimBot10
22:58:38FromDiscord<squid> Is that the ascii character?
22:59:33FromDiscord<squid> I would think so as Ascii 10 is Line Return
22:59:44FromDiscord<squid> So thats \n in other languages
22:59:59reversem3@treeform are you around
23:00:20miprihttps://nim-lang.org/docs/manual.html#lexical-analysis-string-literals
23:01:00FromDiscord<squid> I was trying to communicate with async tcp server and C#
23:01:10FromDiscord<squid> So I had some problems with RecvLine
23:01:34FromDiscord<squid> Checked documentation and said something about "\r\L". Tried to google to figure out \L
23:01:36*reversem3 sent a long message: < https://matrix.org/_matrix/media/r0/download/matrix.org/ccvEjPMbddvadWxMCZFZRIdr/message.txt >
23:01:46FromDiscord<squid> Thank you for the help
23:01:52reversem3what does sub and key mean ?
23:02:44FromDiscord<squid> Seems to just to be arguments to the wmic command
23:03:02miprithat's what they are, just arguments. the meaning probably would make more sense if I knew what 'wmic' was.
23:03:05reversem3so it could be x and y also right
23:03:22reversem3wmic is just a way to interface with windows cli
23:03:24FromDiscord<squid> wmic <sub here> get < key here >
23:03:30miprias a rule, don't do that though -- don't build a string to pass to the OS. it's asking for a backdoor, intentional or not.
23:03:30FromDiscord<squid> It runs that on cmd
23:03:48FromDiscord<squid> Might depend on usage tho.
23:04:03FromDiscord<squid> If its his own program not supposed to be handed out might not matter but sure.
23:04:22FromDiscord<squid> Cant be bad to have that embedded into his mind
23:04:33miprihence, as a rule. It's incredibly rare to actually need to do that.
23:05:10reversem3yeah not finding anything on sub and key for wmic , its weird
23:05:15miprithe alternative is just execProcess and using the args array
23:05:49reversem3he's using osproc cmdexec
23:05:49FromDiscord<squid> reversem3, It is just arguments passed. On wmic they are probably not named sub and key
23:06:07reversem3ok , thats what I thought
23:06:07mipriyes, I see what he's using. That is what I am suggesting he not use.
23:08:24FromDiscord<squid> reversem, "wmic PROCESS GET NAME" It seems like sub means the specific process and key might be specific options of that process
23:08:38reversem3well it works great lol , just trying to figure out how to get network stats now
23:08:50reversem3psutil doesn't work with 1.4 right now
23:10:58*FromDiscord quit (Remote host closed the connection)
23:11:11*FromDiscord joined #nim
23:11:58*qwertfisch quit (Quit: ZNC - http://znc.in)
23:12:11*qwertfisch joined #nim
23:19:23*vsantana quit (Quit: Leaving.)
23:25:30FromDiscord<treeform> @reversem3 what do you need?
23:27:43*oprypin quit (Quit: Bye)
23:27:51*oprypin joined #nim
23:37:37*apahl quit (Ping timeout: 272 seconds)
23:38:25*apahl joined #nim
23:42:48FromDiscord<Rebel> What are you trying to do with wmic? Are you just creating a wrapper for it in Nim?
23:48:06FromDiscord<Rebel> Could also use osqury
23:48:09FromDiscord<Rebel> (edit) "osqury" => "osquery"
23:50:30FromDiscord<Imperatorn> Not my business, but shouldn't you use the wmi api directly instead? ๐Ÿค”
23:50:46FromDiscord<Rebel> Also whoever said there was no task scheduling lib in Nim is a liar
23:50:54FromDiscord<Rebel> Weave looks pretty hot
23:51:40FromDiscord<Rebel> I mean it really depends what you are trying to do... osquery is cross-platform as well.
23:54:38FromDiscord<Imperatorn> Cool, didn't know about osquery
23:56:07FromDiscord<Rebel> (edit) I mean it really depends on what you are trying to do... osquery is cross-platform as well.