<< 14-04-2023 >>

00:00:38*ltriant joined #nim
00:17:10*rockcavera quit (Read error: Connection reset by peer)
00:17:57*rockcavera joined #nim
00:17:57*rockcavera quit (Changing host)
00:17:57*rockcavera joined #nim
00:21:52*ltriant quit (Ping timeout: 248 seconds)
00:42:00*ltriant joined #nim
00:47:10*ltriant quit (Ping timeout: 276 seconds)
00:52:06FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4tnD
01:01:32FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4tnH
01:06:21*ltriant joined #nim
01:09:14*nanxiao joined #nim
01:10:25FromDiscord<sOkam!> is it possible to narrow T to be only signed integers in some way in that template?
01:10:45*ltriant quit (Ping timeout: 240 seconds)
01:17:55rockcaverasOkam! uses: when T isnot SomeSignedInt: {.fatal: "Error msg".}
01:20:55FromDiscord<sOkam!> i don't think the template works at all tbh. its not letting me instantiate it. I figure I will just use the explicit version 🤷‍♂️ ↵`template iaddr (num: uint32): ptr int32 = cast[ptr int32](num.addr)`
01:23:13rockcaverasOkam! https://play.nim-lang.org/#ix=4tnM
01:28:22*ltriant joined #nim
01:31:18termerWhat's the best way to create a table with string keys and values that are ref of any type?
01:31:37termerTable[string, ref RootObj]?
01:35:07FromDiscord<sOkam!> In reply to @rockcavera "sOkam! https://play.nim-lang.org/#ix=4tnM": helpful, thx
01:37:13*ltriant quit (Ping timeout: 276 seconds)
01:44:57FromDiscord<Gabben> In reply to @demotomohiro "This code compiles without": Good as workaround
01:51:18*ltriant joined #nim
01:52:39FromDiscord<Elegantbeef> Termer `RootRef` does exist but i think with Orc/Arc one wants `pointer`
01:53:10termerI could do ref RootObj but doing `table["val"] is Thing` would fail
01:53:27termerWouldn't the pointer thing cause memory to not be freed ?
01:53:29termer*freed?
01:53:33termersince it's not a normal ref
01:54:01FromDiscord<Elegantbeef> `table["val"] of Thing`
01:54:18FromDiscord<Elegantbeef> `is` is for compile time checks `of` is for runtime
01:54:23termeroh
01:55:23termerit looks like I need to do something like wrap objects in containers
01:55:25FromDiscord<Elegantbeef> I mean you're doing type erasure so that's just hell
01:55:44termerIt's hard to have a dynamic map
01:55:56FromDiscord<Elegantbeef> https://internet-of-tomohiro.netlify.app/nim/faq.en.html#type-how-to-store-different-types-in-seqqmark
01:56:06FromDiscord<Elegantbeef> Code example provided from me solves this
01:56:25termerPerfect
01:56:40termeryeah I was doing a boxed type but didn't think of having the BoxBase type
01:57:07*ltriant quit (Ping timeout: 250 seconds)
01:57:47FromDiscord<Elegantbeef> Just to ensure you do not, do not attempt to use methods unless it's the same across all implementations
01:58:17termerwhat do you mean
01:58:22FromDiscord<Elegantbeef> Otherwise you should have a pointer proc like `myMethod: proc(b: BoxBase)` and inside you do `let unboxed = MyType(b)`
01:58:34termeroh yeah of course
01:58:39FromDiscord<Elegantbeef> I mean generic methods do not work unless the body is identical across the board
01:58:40termercustom getters that make sure it's the right type
01:58:48FromDiscord<Elegantbeef> So practically they do not work
01:59:19termerThey do work if you need to provide a common interface for data to be passed to different blackbox plugins or something
01:59:38FromDiscord<Elegantbeef> I say they do not work
01:59:43termerI'm building a web framework where you can write custom middleware to attach data to a request context that will be consumed by handlers
01:59:58FromDiscord<Elegantbeef> If you cannot have a method like `method doThing[T](b: Boxed[T]) = echo T` work they do not work
02:00:18termerUnless the middleware have access to the context implementation (they don't) and they all agree on an implementation (they won't), I need to give some sort of interface to let them attach arbitrary pointers
02:00:50termerThe only thing I need to do is have a table that lets you put pointers to data in it
02:01:04termerand then you're responsible for getting and setting those pointers
02:01:07*rockcavera quit (Read error: Connection reset by peer)
02:02:37*rockcavera joined #nim
02:02:37*rockcavera quit (Changing host)
02:02:37*rockcavera joined #nim
02:04:48FromDiscord<Raynei486> How can I delete a function like in C++?
02:04:58FromDiscord<Raynei486> so when I call the function the compiler will give an error
02:06:05termeryou can store a pointer to a proc and then set it to nil
02:06:20termervar myProc = proc () = ...
02:06:23termermyProc = nil
02:06:46*ltriant joined #nim
02:07:04FromDiscord<Elegantbeef> I think they mean like the hooks
02:07:30FromDiscord<Elegantbeef> The error pragma works
02:07:30termeroh
02:08:09FromDiscord<Elegantbeef> `proc `=copy`(dest: var T; source: T) {.error.}`
02:09:38FromDiscord<Raynei486> yeah that works thanks
02:10:40termerElegantbeef, Wouldn't creating a ref object type and then making a ref object type of that object be a double-pointer?
02:11:02termerlike type BoxBase = ref object of RootObj and then Boxed[T] = ref object of BoxBase
02:11:04termerthat's 2 refs
02:13:21FromDiscord<Elegantbeef> Yes it is
02:13:25FromDiscord<Elegantbeef> If you want you can skip it
02:14:06FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4tnU
02:14:06FromDiscord<Elegantbeef> But that means unpacking isnt the same
02:14:18FromDiscord<Elegantbeef> Best to just live with double pointer indirection cause that's what the user wants
02:14:33FromDiscord<Elegantbeef> Apparently generic methods do work i'm just daft
02:15:39termerwhat I'm saying is, can't you do BoxBase = ref object of RootObj and then Boxed[T] = object of BoxBase and it'll still be a ref type?
02:15:39FromDiscord<Elegantbeef> Nevermind Nim is daft
02:15:58FromDiscord<Elegantbeef> Oh no it's still single indirection
02:16:07FromDiscord<Elegantbeef> `object of X` is stack allocated
02:18:23termerso even though it's inheriting from a ref object, if you don't specify `ref` on the second, it'll still be stack allocated?
02:20:37FromDiscord<Elegantbeef> Should be
02:20:57termerInteresting
02:21:01termerA bit confusing
02:21:10FromDiscord<Elegantbeef> Think about how many pointers there'd be in a massive tree if otherwise
02:21:56termerwell that's what I was worried about happening to begin with
02:22:30termerIt's a good design choice they did but not particularly obvious or explicit when there's no way of knowing whether some types are refs or not without digging around with nimsuggest
02:23:09FromDiscord<Elegantbeef> If you follow status' advice you put `ref` after the object name
02:23:25*ltriant quit (Ping timeout: 240 seconds)
02:24:13termerYou should yeah
02:26:55FromDiscord<sOkam!> you guys should stop having names of equivalent length. its so hard to know who is talking! 🙈 https://media.discordapp.net/attachments/371759389889003532/1096260264048996393/image.png
02:28:42FromDiscord<Elegantbeef> I disagree but I also am a numpty
02:29:57termerBridged users of suspiciously similar name lengths rule this channel, sorry
02:30:16termerThe lowly discord user simply cannot compete
02:30:25FromDiscord<Elegantbeef> You should just use matrix
02:30:31FromDiscord<Elegantbeef> Problem solved sokam
02:30:37termeror IRC
02:30:57FromDiscord<Elegantbeef> Nah never use irc that's for boomers who need nitroglycerine else their heart gives out
02:31:15FromDiscord<Elegantbeef> Termer literally is only alive due to dynamite
02:31:26termerLOOOOOL
02:31:45termerI'm routinely the youngest person in any given IRC channel
02:33:40FromDiscord<Elegantbeef> Well give it time and you'll be the oldest cause they're sure die off
02:34:08termerIRC 4ever
02:34:22FromDiscord<sOkam!> tru
02:34:23FromDiscord<Elegantbeef> Eventually you'll be in a void of just you
02:34:38termerI keep finding new people to get on IRC to replace me once I die
02:34:58FromDiscord<Elegantbeef> Irc's userbase is like grey beards and people that want some obscure wisdom from an obscure channel from a grey beard
02:35:13*ltriant joined #nim
02:35:18termerI've duped people using a chat system I wrote into being on IRC by implementing an IRC gateway built into it
02:35:22termerthen convincing them to connect over IRC
02:35:32FromDiscord<Elegantbeef> You're a terrible person
02:35:56termerI've written an entire library just for implementing IRC gateways for existing protocols
02:36:01FromDiscord<Elegantbeef> Next you're going to convince people that telegraph is the way to communicate
02:36:02termerjust to use more IRC
02:36:15FromDiscord<sOkam!> does matrix have the same type of integration with apps as irc? from what i saw, irc can be even part of an engine
02:36:25FromDiscord<Elegantbeef> Matrix is a protocol
02:36:29termerIRC is so incredibly simple that it can be part of anything
02:36:29FromDiscord<Elegantbeef> You can plug it anywhere you want
02:36:35termerMatrix is also a protocol but it's much more complicated
02:36:41FromDiscord<sOkam!> ic
02:36:45termerit'll take you more than a weekend to write an implementation for it
02:37:39FromDiscord<Elegantbeef> I do think a basic non encrypted client probably isnt that complicated
02:37:42FromDiscord<sOkam!> by implementation you mean something like libmatrix (random name, not anything specific) or something like -using- said libmatrix?
02:37:57FromDiscord<Elegantbeef> They mean from scratch
02:38:16FromDiscord<Elegantbeef> Matrix is a relatively simple protocol based on json, the complexity is due to all of the features it has really
02:38:30FromDiscord<sOkam!> ic
02:38:36termeryou can call me he by the way
02:39:00termerbut yes matrix isn't terribly hard to understand until you do the encryption thing
02:39:05termerit's more about the volume of features
02:39:29termermeanwhile IRC has nearly no features and is a line-based protocol so it's piss easy to figure out and interface with
02:39:48FromDiscord<Elegantbeef> Spaces, rooms, voip, code blocks, ...
02:40:11FromDiscord<Elegantbeef> Element even supports embedding shared webapps
02:40:24termervoip was always some nonsense jitsi thing when I tried it
02:40:38FromDiscord<Elegantbeef> They have 1\:1 calls and element voice is in beta
02:40:44FromDiscord<Elegantbeef> So they'll have a builtin voip solution soon
02:40:54termerFucking finally
02:41:23FromDiscord<Elegantbeef> Though i wish matrix had channel based voip, yea it'll be nice
02:41:36termerjust do what I do and stick random protocols together
02:41:48termerand then write extensions for features they don't support
02:41:49FromDiscord<Elegantbeef> Nah not really sellable to friends
02:41:56termeryou'd be surprised
02:42:03termerbut yes generally it's difficult
02:42:05termerthat's the main issue
02:42:08FromDiscord<Elegantbeef> Like i could make a mumble webap for element that hooks into mumble and host a mumble server
02:42:11termerso hard to get friends to use anything besides discord
02:42:19FromDiscord<Elegantbeef> But like fuck that's a pain in the ass
02:42:21termerI host a teamspeak and mumble server
02:42:43termerI was writing a screen sharing system that would be implemented as a teamspeak and mumble plugin but wasn't very experienced in Nim when I started it
02:42:48FromDiscord<Elegantbeef> I used to selfhost a teamspeak server before discord caught on main reason i swapped was cause I was hosting on my PC 😄
02:42:53termernot sure whether I'm gonna try rewriting it in Rust or try again in Nim
02:43:19termerMumble is really poorly designed in terms of moderation
02:43:23FromDiscord<Elegantbeef> Voip going down cause my PC died is not a very good situation
02:43:30termerit's hard to manage a mumble server beyond small numbers of friends
02:43:36FromDiscord<Elegantbeef> Meh i do not care about moderation it's only my friends
02:43:36termerYeah put that shit in a VPS
02:43:50FromDiscord<Elegantbeef> I mean this was in highschool for me
02:43:59FromDiscord<Elegantbeef> It wasnt a big deal it worked fine for like a year or two
02:44:01termerI've been hosting a TS server on a VPS since highschool
02:44:04termerbut not on my PC
02:44:08termerinternet's always been too bad for that
02:44:17termervoice chat is never a problem anymore though cause I have access to like 5 mumble servers at any given time
02:44:18FromDiscord<Elegantbeef> Yea mine was sufficient
02:44:21termerso many friends host them
02:44:45*ltriant quit (Ping timeout: 255 seconds)
02:44:52termerI wanna implement the Mumble protocol and write a server that supports WebRTC
02:45:04termerbut that's filled with so much nonsense that makes it hard to do
02:45:19FromDiscord<Elegantbeef> I do want to make a matrix client in Nim but the amount of busy work of inanely pipeing json requests around
02:45:40FromDiscord<Elegantbeef> Yea you pretty much cannot use google's webrtc and have to use another implementation
02:45:49FromDiscord<Elegantbeef> Google's webrtc library is awful in so many regards
02:46:12termerWebRTC is hard to get right across FF and Chrome too
02:52:17*nanxiao quit (Quit: Client closed)
02:56:48*ltriant joined #nim
03:00:02FromDiscord<Dudugz> 🤔 but why use web rtc? If it's an API with an endpoint, you can use nim's httpclient to make the requests.
03:00:27FromDiscord<Dudugz> The problem is having a good and easy-to-use interface library for development.
03:01:25*ltriant quit (Ping timeout: 240 seconds)
03:01:48FromDiscord<Dudugz> Oh ok, sorry I took the subject over so I misunderstood. In the case of creating a Matrix client as I said you just need a good UI lib and make requests to the matrix API
03:02:59FromDiscord<Dudugz> This if you are going to do it in Nim, if you are going to copy the discord and do it in some library that emulates an application with a browser, it is easier to do.
03:07:10FromDiscord<Elegantbeef> What's even the point of doing it using Nim if it's a webapp really
03:13:54*ltriant joined #nim
03:18:25*ltriant quit (Ping timeout: 240 seconds)
03:21:57*nanxiao joined #nim
03:33:44*ltriant joined #nim
03:38:46*ltriant quit (Ping timeout: 276 seconds)
03:44:51*rockcavera quit (Remote host closed the connection)
03:50:37*ltriant joined #nim
03:54:25*rockcavera joined #nim
03:55:44*ltriant quit (Ping timeout: 265 seconds)
03:59:29*hochata quit (Read error: Connection reset by peer)
04:05:24FromDiscord<spoon> aren't there platforms that can port to both native apps and web?
04:11:10*arkurious quit (Quit: Leaving)
04:11:12*nanxiao quit (Quit: Client closed)
04:18:23FromDiscord<Gumbercules> sent a code paste, see https://play.nim-lang.org/#ix=4tof
04:18:40FromDiscord<Gumbercules> https://news.ycombinator.com/item?id=35559925 for context
04:25:53*ltriant joined #nim
04:28:41*xet7 quit (Remote host closed the connection)
04:35:19*ltriant quit (Ping timeout: 276 seconds)
04:40:01FromDiscord<Rika> Damn LMAO
04:52:21*ltriant joined #nim
04:57:05*ltriant quit (Ping timeout: 240 seconds)
05:36:23FromDiscord<qb> sent a code paste, see https://paste.rs/apO
05:40:45*rockcavera quit (Remote host closed the connection)
05:44:41*nanxiao joined #nim
05:58:46*ltriant joined #nim
06:00:05*m5zs7k quit (Ping timeout: 240 seconds)
06:00:28*m5zs7k joined #nim
06:11:00*ltriant quit (Ping timeout: 252 seconds)
06:20:21*nanxiao quit (Quit: Client closed)
06:25:44FromDiscord<Arathanis> In reply to @qb "Anyone who is experienced": any particular reason you want to keep it as a pyobject in nim?
06:32:42FromDiscord<Elegantbeef> thindil do you have time right now so I can bounce ideas off of you to fix this issue?
06:37:36*ltriant joined #nim
06:39:07*kenran joined #nim
06:40:53FromDiscord<Arathanis> @qb still there?
06:41:01FromDiscord<qb> Yep
06:42:13FromDiscord<qb> Erm. The reason is I want to have a argument which accepts a string or an int. Because `proc foobar(a: int|string) {.exportpy.}` won't compile
06:42:43*ltriant quit (Ping timeout: 276 seconds)
06:43:36FromDiscord<Arathanis> sent a code paste, see https://play.nim-lang.org/#ix=4toL
06:43:48FromDiscord<Arathanis> (edit) "https://play.nim-lang.org/#ix=4toL" => "https://paste.rs/gyl"
06:44:05FromDiscord<Elegantbeef> Is that better than just exporting a `fooBarStr` and `fooBarInt` and doing the dispatch inside python?
06:44:18FromDiscord<Arathanis> In reply to @Elegantbeef "Is that better than": i was about to suggest this
06:44:27FromDiscord<Arathanis> I agree with beef @qb
06:44:49FromDiscord<Arathanis> rather than call python from inside nim, let nimpy marshal it to nim types and figure out what to call in python itself
06:45:00FromDiscord<Arathanis> but this IS how to do what you want
06:45:06FromDiscord<Arathanis> i just think you shouldn't
06:45:25FromDiscord<Arathanis> id think the whole point of making a pyd file w/ nim is to implement some slow function w/ more performance
06:45:31FromDiscord<Arathanis> calling python within nim kind of defeats that purpose
06:45:43*PMunch joined #nim
06:45:54FromDiscord<Arathanis> in fact, in python you can use `functools.singledispatch` and make this extremely easy on yourself
06:46:57FromDiscord<qb> In reply to @Arathanis "id think the whole": Actually I got a little game hacking library. With a compiled library you dont need to install tons of third party libraries in python. Makes it easy to use
06:47:31FromDiscord<qb> And yea performance is a point as well
06:49:27FromDiscord<qb> How could I export nim types? Guess I tried that already
06:50:08FromDiscord<Arathanis> sent a code paste, see https://play.nim-lang.org/#ix=4toN
06:50:32FromDiscord<Elegantbeef> Look what they need to mimic a fraction of our power
06:50:36FromDiscord<Arathanis> (edit) "https://play.nim-lang.org/#ix=4toN" => "https://play.nim-lang.org/#ix=4toO"
06:51:02FromDiscord<Arathanis> sent a code paste, see https://play.nim-lang.org/#ix=4toP
06:51:44FromDiscord<Arathanis> python is my favorite language, and I love nim for being so ergonomically and syntactically close. its my favorite statically type and compiled language
06:51:52FromDiscord<Arathanis> I use nim to accelerate python all the time
06:51:56FromDiscord<Arathanis> match made in heaven imo
06:52:19FromDiscord<Elegantbeef> Wait people actually write python?
06:52:22FromDiscord<Elegantbeef> I thought it was a meme
06:52:28FromDiscord<Arathanis> they absolutely do lol
06:52:48FromDiscord<Arathanis> everyone just wants to take potshot 😭
06:52:51FromDiscord<Arathanis> (edit) "potshot" => "potshots"
06:53:06FromDiscord<Elegantbeef> It's all too easy
06:53:34FromDiscord<Arathanis> what is too easy?
06:53:41FromDiscord<qb> sent a code paste, see https://play.nim-lang.org/#ix=4toQ
06:54:15FromDiscord<qb> (edit) "https://play.nim-lang.org/#ix=4toQ" => "https://play.nim-lang.org/#ix=4toS"
06:54:20FromDiscord<Arathanis> are you using nimpy to ffi into python but your app is in nim?
06:54:35FromDiscord<qb> https://github.com/qb-0/pyMeow
06:55:05FromDiscord<qb> I'm a pretty newbish nim coder. Dont blame me ;D
06:55:06FromDiscord<Arathanis> see this seems like you want to do what i suggested
06:55:13FromDiscord<Arathanis> you can write the whole thing in nim, like 98% of it
06:55:25FromDiscord<Arathanis> then make a thin interface in actual Python to provide an ergonomic API
06:55:36*Amun-Ra quit (Quit: Gdyby mi się chciało tak jak mi się nie chce...)
06:56:10FromDiscord<Arathanis> what they actually import is your .py file, but under the hood its just calling your nim code
06:56:27FromDiscord<Arathanis> you can provide a much cleaner, more pythonic interface for your users that way
06:56:31FromDiscord<Arathanis> and your nim code can be blazing fast
06:56:52FromDiscord<Arathanis> the python wrapper acts as a dispatcher and nim can perform its high speed work without dropping into python like you are planning
06:57:05*Amun-Ra joined #nim
06:57:46FromDiscord<Arathanis> you can also make your life easier with a .pyi file, this is mostly for your purposes but you will thank yourself
06:57:56FromDiscord<Arathanis> (edit) "you can also make your life easier with a .pyi file, this is mostly for your ... purposes" added "development"
06:58:24FromDiscord<qb> yea I'm including a stub file
07:00:39FromDiscord<Arathanis> sent a long message, see http://ix.io/4toV
07:00:58*ltriant joined #nim
07:01:04FromDiscord<Arathanis> also if you name your project `pyMeow` and force python people to import a module with caps in it they gonna shame you for it :P
07:01:43FromDiscord<qb> Really? Noone said smth yet 😄
07:01:57FromDiscord<Arathanis> not to your face 😎
07:01:58Amun-Rasame with camel case :>
07:02:01FromDiscord<qb> haha
07:02:13FromDiscord<Arathanis> im just telling you, python naming conventions for modules are snake case
07:02:16FromDiscord<Arathanis> check PEP8
07:02:32FromDiscord<Arathanis> everytime I have to use a library with capitals in the module name I die a little inside
07:02:32Amun-Raand check your program with pylint
07:02:38FromDiscord<Arathanis> don't get me started on "import PIL"
07:02:40FromDiscord<Arathanis> i shudder
07:02:57FromDiscord<Arathanis> (edit) ""import PIL"" => "`import PIL`"
07:03:08FromDiscord<qb> Was just going to mention pil
07:03:21FromDiscord<Arathanis> its a horrible abomination
07:03:29FromDiscord<Arathanis> to say nothing of python's `logging` module
07:03:31FromDiscord<Arathanis> what a blemish
07:03:39FromDiscord<Arathanis> camel case functions in a standard librar
07:03:40FromDiscord<Arathanis> (edit) "librar" => "library"
07:03:42FromDiscord<Arathanis> 🤢
07:03:49Amun-Raright
07:04:22FromDiscord<Arathanis> this is why i use `loguru` instead
07:04:34FromDiscord<Arathanis> cause not only does it have appropriate naming conventions, its just miles better than `logging`
07:04:36Amun-Raand I use my own
07:04:49FromDiscord<Arathanis> check out loguru if you ever feel the need, incredible library for logging
07:04:52FromDiscord<Arathanis> i absolutely recommend
07:05:05*fredrikhr joined #nim
07:05:06FromDiscord<Arathanis> (edit) "need," => "~~need~~ inclination,"
07:05:32*fredrikhr quit (Client Quit)
07:05:52*ltriant quit (Ping timeout: 252 seconds)
07:07:33*Notxor joined #nim
07:14:46*nanxiao joined #nim
07:15:36*fredrikhr joined #nim
07:33:42*ltriant joined #nim
07:39:12FromDiscord<thindil> Elegantbeef\: a couple of hours too late probably, but now, yes I have. 😉
07:39:12FromDiscord<thindil> Same
07:39:13FromDiscord<Elegantbeef> I'm still alive
07:39:39FromDiscord<Elegantbeef> Hmm with choosenim `$nim` is located inside `version/bin/nim`
07:40:25*ltriant quit (Ping timeout: 240 seconds)
07:42:04FromDiscord<thindil> Yes, with choosenim everything should work, compiler then is in `version/lib/`. The problems start when we try to use a system package, which usually drop the whole Nim in a dozen places.
07:42:18FromDiscord<Elegantbeef> Yea i know i'm trying to reason how to resolve this
07:44:07FromDiscord<Elegantbeef> Hmmm is lib next to your sources still
07:45:11FromDiscord<Elegantbeef> does `import "$lib"/../compiler/nimeval` compile?
07:46:26NimEventerNew thread by alexeypetrushin: Won't compile without `void` return type, see https://forum.nim-lang.org/t/10096
07:47:06FromDiscord<thindil> By opening issue at Nim? 🤣 After all, configuration option works, `$nim` doesn't want to work in `import` statement. And compilation, no, but `import "$lib"/compiler/nimeval` works.
07:48:28FromDiscord<thindil> `libnimrtl.so` is in `/usr/local/lib` and compiler in `/usr/local/nim/`.
07:49:00FromDiscord<Elegantbeef> This is a cruel joke
07:49:37FromDiscord<Elegantbeef> Can you open the issue for me, since you have a better test case of what works and what doesnt?
07:51:29FromDiscord<thindil> Unix? Yeah. 🤣 But it is standard how Linux and BSD's handle libraries\: library in lib and the rest of things in lib/something. Or include. Or include/something. 🙄 Sure, I will open soon. I will try to gather more info about it.
07:54:25*derpydoo joined #nim
08:07:41*nanxiao quit (Quit: Client closed)
08:08:13FromDiscord<thindil> The path to compiler should be `/usr/local/lib/nim`, but there can be one more problem. I'm looking at Debian and its derivatives\: they don't install the compiler package by default, thus here can be more dragons. And Alpine Linux install it in complete different location\: `/usr/share/nimble/pkgs/nim-1.6.12/`. I have a feeling that use `compiler` nimble package can save a lot of sanity.
08:23:12*nanxiao joined #nim
08:34:03*ltriant joined #nim
08:36:17FromDiscord<Elegantbeef> thindil\: Except it solves nothing since `compiler` package is not tied to the Nim version you're using
08:38:26*azimut quit (Ping timeout: 255 seconds)
08:39:01*ltriant quit (Ping timeout: 240 seconds)
08:42:08FromDiscord<Elegantbeef> No you cannot use MajorMinorPatch cause devel exists
08:44:20FromDiscord<thindil> Ah, I see. But it not works either\: `Error: expression expected, but found 'keyword import` line 1 col 15
08:44:44FromDiscord<thindil> Also, imports cannot be nested.
08:45:28FromDiscord<Elegantbeef> What?
08:45:31FromDiscord<Elegantbeef> Imports can be in a when
08:47:37FromDiscord<Elegantbeef> Should suffice
08:47:38FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4tpd
08:47:54FromDiscord<Elegantbeef> automatic importing for those that use choosenim and `$nim` support for those that dont
08:49:52FromDiscord<thindil> Right, my bad about imports. And yes, this works, but now I see a different problem, but probably related to the system package
08:52:35*jmdaemon quit (Ping timeout: 246 seconds)
09:04:31*jmdaemon joined #nim
09:21:57FromDiscord<Clonkk> Since upgrading to 2.0-RC the Nim compiler can't find any package installed by nimble. I tried downgrading back to 1.6.12 and it's still the same
09:22:01FromDiscord<Clonkk> Anyone knows what it's about ?
09:22:10FromDiscord<Clonkk> Is there a config file somewhere that's missing ?
09:26:03FromDiscord<Yardanico> In reply to @Clonkk "Since upgrading to 2.0-RC": probably something to do with new nimble
09:26:13FromDiscord<Yardanico> did you fully upgrade, including the nim config file?
09:28:36FromDiscord<Clonkk> `choosenim update devel`
09:28:39FromDiscord<Clonkk> So I suppose, yes
09:28:51FromDiscord<ringabout> They use different package systems. You need to delete `/pkgs` and install everything again, which is installed under `/pkgs2`.
09:29:18PMunch(and then you need to only use Nimble, because Nim by default doesn't understand pkgs2)
09:29:29PMunchAt least my install doesn't seem to understand it
09:29:45FromDiscord<Clonkk> I have my package under mkgs2 already
09:29:53FromDiscord<Yardanico> In reply to @PMunch "(and then you need": it does understand
09:30:08PMunchReally? It doesn't seem to for me
09:30:19FromDiscord<Yardanico> nim compiler config has pkgs2 as well, but yeah, there will must be a big warning when 2.0 gets released that nimble package folder must be wiped
09:30:28FromDiscord<Yardanico> @PMunch idk pmunch, it just works for me
09:30:47FromDiscord<Yardanico> I don't even have normal pkgs folder anymore, only pkgs2, yet I can import nimble-installed pkgs just fine
09:31:25FromDiscord<Clonkk> So if i delete pkgs and pkgs2, and reinstal my package I should be able to run "nim cpp ..."
09:31:54PMunchI guess it might be because I still have a pkgs folder
09:32:06PMunchFor when I switch to an older version of Nim to test things
09:39:40FromDiscord<Clonkk> Didn't work
09:39:55FromDiscord<Yardanico> idk, i haven't used choosenim for years, can't help :(
09:40:09PMunch@Yardanico, what?
09:40:14PMunchHow do you install Nim?
09:40:14FromDiscord<Yardanico> ?
09:40:26FromDiscord<Yardanico> i just have the latest devel installed from git with build_all.sh
09:40:29FromDiscord<Yardanico> i don't need choosenim
09:40:40FromDiscord<Yardanico> and periodically I just git pull and sh build_all.sh or just koch boot -d:release
09:42:24FromDiscord<Clonkk> So there is no way to have the nim compiler see the package installed thorugh `nimble install ...` in latest versions ?
09:43:47FromDiscord<Clonkk> That's kinda annoying
09:44:34FromDiscord<Yardanico> Clonkk, again, there is
09:44:42FromDiscord<Yardanico> it should just work by default, but it doesn't work for you for some reason
09:44:58FromDiscord<Yardanico> maybe choosenim didn't update the nim config or something?
09:45:05FromDiscord<Yardanico> can you check and see that it has an entry for pkgs2 ?
09:45:49FromDiscord<Clonkk> It has an entry for the wrong folder
09:46:00FromDiscord<Clonkk> It adds /opt/nimble/pkgs
09:46:58FromDiscord<Clonkk> The goal isn't just to fix my setup; it's so that if I recommand the Nim installation steps to someone new to Nim, it works out of the box↵(@Yardanico)
09:47:18FromDiscord<Yardanico> @Clonkk are you sure your config doesn't have this? https://github.com/nim-lang/Nim/blob/devel/config/nim.cfg#L71
09:48:06FromDiscord<Clonkk> Yes, actually it does have that
09:48:15FromDiscord<Clonkk> my bad, didn't scroll far enough
09:49:14FromDiscord<Clonkk> Is there some sort of weird interaction if you add `--path:...` in local config files ? Or is there something different happening by virtue of being in a nimble package subfolder
09:50:11FromDiscord<Clonkk> I also have a `nimble.lock` files in the parent directory 4 level above
09:50:38FromDiscord<Clonkk> Could the presence of a nimble lock file mess with config ?
09:51:41*ltriant joined #nim
09:52:09*nanxiao quit (Quit: Client closed)
09:52:11FromDiscord<Clonkk> It seems the presence of a nimble.lock file in `../../../../ ` add `noNimblePath` automatically. How many levels of folder does the compiler checks for a `nimble.lock` files ?
09:53:21FromDiscord<Yardanico> for the whole root i think
09:53:28FromDiscord<Yardanico> <https://github.com/nim-lang/Nim/blob/devel/compiler/nim.nim#L44>
09:53:57FromDiscord<Yardanico> https://nim-lang.org/docs/os.html#parentDirs.i%2Cstring
09:54:00FromDiscord<Clonkk> hmm that's a bit annoying
09:54:55FromDiscord<Clonkk> Somehow the presence of the nimble.lock adds noNimblePath but then do not uses the version in nimble.lock file instead ?
10:02:03FromDiscord<Clonkk> I see. nimble.lock removes nimblePath from the compiler, but only reads the lock file for build and install tasks. And you need to call `nimble setup` manually to generate a config file"
10:12:56*PMunch_ joined #nim
10:13:31FromDiscord<Clonkk> Thank you for pointing me in the right direction, that helped a lot↵(@Yardanico)
10:13:48FromDiscord<Yardanico> no problem, I just searched for nimble.lock in the github repo :)
10:14:06FromDiscord<Clonkk> Yeah I don't have the habit of going through the source code
10:14:12FromDiscord<Clonkk> I should do that more
10:14:31FromDiscord<Clonkk> I trust the compiler abit too blindly perhaps
10:15:25*PMunch quit (Ping timeout: 240 seconds)
10:23:25*ltriant quit (Ping timeout: 240 seconds)
10:26:57*PMunch__ joined #nim
10:28:11*junaid_ joined #nim
10:30:13*PMunch_ quit (Ping timeout: 276 seconds)
10:36:40*junaid_ quit (Remote host closed the connection)
10:52:42*ltriant joined #nim
10:56:25*PMunch__ is now known as PMunch
10:59:05*ltriant quit (Ping timeout: 240 seconds)
10:59:56FromDiscord<dennisritchie> never relax
11:03:48*derpydoo quit (Ping timeout: 255 seconds)
11:11:33NimEventerNew thread by noah: How to specify output directory for `nim genDepend` ?, see https://forum.nim-lang.org/t/10097
11:34:41*ltriant joined #nim
11:39:32*ltriant quit (Ping timeout: 250 seconds)
11:43:25*PMunch_ joined #nim
11:46:06*PMunch quit (Ping timeout: 255 seconds)
12:08:36*ltriant joined #nim
12:13:05*ltriant quit (Ping timeout: 240 seconds)
12:21:25*advesperacit joined #nim
12:26:43*ltriant joined #nim
12:31:25*ltriant quit (Ping timeout: 240 seconds)
12:40:37FromDiscord<System64 ~ Flandre Scarlet> Can I cast an uint32 to a Tile object without confusing the GC?
12:48:15PMunch_A uint32 isn't garbage collected, so it wouldn't confuse the GC
12:51:45FromDiscord<System64 ~ Flandre Scarlet> In reply to @PMunch_ "A uint32 isn't garbage": Ah alright↵By cast I meant bit reinterpretation, and not conversion
12:52:31PMunch_Yup, doesn't make it any more garbage collected though :P
12:53:17FromDiscord<System64 ~ Flandre Scarlet> In reply to @PMunch_ "Yup, doesn't make it": Ah so the tile is not tracked by GC?
12:53:53*PMunch_ is now known as PMunch
12:54:03PMunchIf it's just a Tile then no
12:54:09PMunchan object*
12:54:23PMunchIf it's a ref object you'll have issues
12:55:28FromDiscord<System64 ~ Flandre Scarlet> It's an object
12:55:39FromDiscord<System64 ~ Flandre Scarlet> (so it is a value type)
12:56:49FromDiscord<Rika> Then it is fine
13:00:32*ltriant joined #nim
13:04:54NimEventerNew question by treeyossy: How can I import python libaray into Nim&#39;s source code?, see https://stackoverflow.com/questions/76015379/how-can-i-import-python-libaray-into-nims-source-code
13:05:17*ltriant quit (Ping timeout: 246 seconds)
13:07:31*progranner joined #nim
13:08:55*progranner quit (Client Quit)
13:18:20*progranner joined #nim
13:28:10NimEventerNew thread by 4n0n4me: How can I know whether an untyped argument of a template can be stringified?, see https://forum.nim-lang.org/t/10099
13:41:27*PMunch_ joined #nim
13:43:45*PMunch quit (Ping timeout: 240 seconds)
13:49:10*rockcavera joined #nim
13:56:34*lucasta quit (Read error: Connection reset by peer)
14:19:34*PMunch_ quit (Quit: Leaving)
14:50:39*kenran quit (Remote host closed the connection)
15:12:41*advesperacit quit (Read error: Connection reset by peer)
15:16:28NimEventerNew thread by haydenb: Windows Containers for Windows Server 2019 Deprecated, see https://forum.nim-lang.org/t/10100
15:19:01*ltriant joined #nim
15:24:11*ltriant quit (Ping timeout: 264 seconds)
15:53:35*arkurious joined #nim
16:20:50*progranner quit (Quit: My Mac has gone to sleep. ZZZzzz…)
16:22:19FromDiscord<Prestige> hm is there no module for converting strings to camel case, pascal case, etc?
16:24:18FromDiscord<ringabout> https://github.com/lamartire/anycase
16:24:21FromDiscord<ringabout> Perhaps?
16:29:00*tiorock joined #nim
16:29:00*tiorock quit (Changing host)
16:29:00*tiorock joined #nim
16:29:00*rockcavera is now known as Guest5296
16:29:00*tiorock is now known as rockcavera
16:30:56*Guest5296 quit (Ping timeout: 248 seconds)
16:33:15*azimut joined #nim
16:36:57FromDiscord<Takemichi Hanagaki> In reply to @Avahe "hm is there no": I wrote one sometime ago, but in python...
16:37:35FromDiscord<Takemichi Hanagaki> (edit) "In reply to @Avahe "hm is there no": I wrote one sometime ago, but in python... ... " added "I never thought anyone would need this. Lol"
16:37:49arkanoidI want to plug async into nigui update loop, so I need a function to call manually each update. Do you know how?
16:39:07arkanoidnevermind, found poll
16:47:56FromDiscord<Prestige> Could be useful, I kinda assumed it existed already lol
18:02:23*progranner joined #nim
18:57:01*progranner quit (Quit: My Mac has gone to sleep. ZZZzzz…)
19:01:45*ltriant joined #nim
19:06:25*ltriant quit (Ping timeout: 240 seconds)
19:43:34*azimut_ joined #nim
19:47:08*azimut quit (Ping timeout: 255 seconds)
20:04:53FromDiscord<frank34> "I'll help anyone interested on how to earn 100k in just 72hours from the crypto market. But you will have to pay me my commission! when you receive your profit! if interested send me a direct message https://t.me/victormarck by asking me HOW
20:17:23FromDiscord<Dudugz> In reply to @frank34 ""I'll help anyone interested": <@&371760044473319454> is this allowed? It doesn't look "official" to me.
20:18:07FromDiscord<Phil> It isn't and given that it goes against the rules that is an instant ban for suspicion of being a crypto bot
20:18:58FromDiscord<Phil> @Yepoleb if you would be so kind, it appears my matrix account still is not a mod for some reason
20:22:28FromDiscord<huantian> also in #science
20:24:49FromDiscord<Vindaar> In reply to @Isofruit "<@144300201857777664> if you would": check again 👀
20:26:09FromDiscord<Phil> Ahhh there we go
20:26:26FromDiscord<Phil> Sidenote vin, I think you and PMunch banned frank34 at the same time and that lead to unbanning him
20:26:37FromDiscord<Phil> in the science channel, not here
20:26:37FromDiscord<newlibarian> what does nimble init and nimble setup do?
20:26:44FromDiscord<Yepoleb> i don't think i can mod people
20:27:00FromDiscord<Dudugz> init starts a new project, setup i think installs the dependencies?
20:27:37FromDiscord<Phil> nimble setup is kinda pointless since installing dependencies is done basically every time for every thing nimble does
20:27:49FromDiscord<Phil> Unless I missed something about it
20:28:08FromDiscord<Phil> One sec, double checking docs
20:28:39FromDiscord<Phil> sent a long message, see http://ix.io/4ts5
20:31:38FromDiscord<newlibarian> does it install anything or change path in systems variables on windows?
20:31:53FromDiscord<newlibarian> https://github.com/samdze/playdate-nim
20:32:33FromDiscord<newlibarian> i was unsuccessful at setting up the above github.
20:32:51FromDiscord<newlibarian> the instructions were un clear.
20:33:25FromDiscord<newlibarian> how can i undo what it did? where can i located the installs or files i need to delete and start fresh again?
20:58:41FromDiscord<Phil> In reply to @newlibarian "how can i undo": I don't think you really need to delete the nimble.paths file it created.↵What you need to check out is your config.nims file, that one actually affects your compilation
20:59:31FromDiscord<Phil> You should have a config.nims file somewhere near the root level of your project, I think even actually at the root level
21:01:11FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4tsa
21:09:59*ltriant joined #nim
21:14:45*ltriant quit (Ping timeout: 240 seconds)
22:00:02*dza quit (Quit: )
22:01:22*dza joined #nim
22:36:13NimEventerNew post on r/nim by Mekelaina: how to compile a whole project of multiple nim files?, see https://reddit.com/r/nim/comments/12mg722/how_to_compile_a_whole_project_of_multiple_nim/
23:02:31*Notxor quit (Remote host closed the connection)
23:30:09*lucasta joined #nim
23:45:17*ltriant joined #nim