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:06 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4tnD |
01:01:32 | FromDiscord | <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:25 | FromDiscord | <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:55 | rockcavera | sOkam! uses: when T isnot SomeSignedInt: {.fatal: "Error msg".} |
01:20:55 | FromDiscord | <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:13 | rockcavera | sOkam! https://play.nim-lang.org/#ix=4tnM |
01:28:22 | * | ltriant joined #nim |
01:31:18 | termer | What's the best way to create a table with string keys and values that are ref of any type? |
01:31:37 | termer | Table[string, ref RootObj]? |
01:35:07 | FromDiscord | <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:57 | FromDiscord | <Gabben> In reply to @demotomohiro "This code compiles without": Good as workaround |
01:51:18 | * | ltriant joined #nim |
01:52:39 | FromDiscord | <Elegantbeef> Termer `RootRef` does exist but i think with Orc/Arc one wants `pointer` |
01:53:10 | termer | I could do ref RootObj but doing `table["val"] is Thing` would fail |
01:53:27 | termer | Wouldn't the pointer thing cause memory to not be freed ? |
01:53:29 | termer | *freed? |
01:53:33 | termer | since it's not a normal ref |
01:54:01 | FromDiscord | <Elegantbeef> `table["val"] of Thing` |
01:54:18 | FromDiscord | <Elegantbeef> `is` is for compile time checks `of` is for runtime |
01:54:23 | termer | oh |
01:55:23 | termer | it looks like I need to do something like wrap objects in containers |
01:55:25 | FromDiscord | <Elegantbeef> I mean you're doing type erasure so that's just hell |
01:55:44 | termer | It's hard to have a dynamic map |
01:55:56 | FromDiscord | <Elegantbeef> https://internet-of-tomohiro.netlify.app/nim/faq.en.html#type-how-to-store-different-types-in-seqqmark |
01:56:06 | FromDiscord | <Elegantbeef> Code example provided from me solves this |
01:56:25 | termer | Perfect |
01:56:40 | termer | yeah 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:47 | FromDiscord | <Elegantbeef> Just to ensure you do not, do not attempt to use methods unless it's the same across all implementations |
01:58:17 | termer | what do you mean |
01:58:22 | FromDiscord | <Elegantbeef> Otherwise you should have a pointer proc like `myMethod: proc(b: BoxBase)` and inside you do `let unboxed = MyType(b)` |
01:58:34 | termer | oh yeah of course |
01:58:39 | FromDiscord | <Elegantbeef> I mean generic methods do not work unless the body is identical across the board |
01:58:40 | termer | custom getters that make sure it's the right type |
01:58:48 | FromDiscord | <Elegantbeef> So practically they do not work |
01:59:19 | termer | They do work if you need to provide a common interface for data to be passed to different blackbox plugins or something |
01:59:38 | FromDiscord | <Elegantbeef> I say they do not work |
01:59:43 | termer | I'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:58 | FromDiscord | <Elegantbeef> If you cannot have a method like `method doThing[T](b: Boxed[T]) = echo T` work they do not work |
02:00:18 | termer | Unless 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:50 | termer | The only thing I need to do is have a table that lets you put pointers to data in it |
02:01:04 | termer | and 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:48 | FromDiscord | <Raynei486> How can I delete a function like in C++? |
02:04:58 | FromDiscord | <Raynei486> so when I call the function the compiler will give an error |
02:06:05 | termer | you can store a pointer to a proc and then set it to nil |
02:06:20 | termer | var myProc = proc () = ... |
02:06:23 | termer | myProc = nil |
02:06:46 | * | ltriant joined #nim |
02:07:04 | FromDiscord | <Elegantbeef> I think they mean like the hooks |
02:07:30 | FromDiscord | <Elegantbeef> The error pragma works |
02:07:30 | termer | oh |
02:08:09 | FromDiscord | <Elegantbeef> `proc `=copy`(dest: var T; source: T) {.error.}` |
02:09:38 | FromDiscord | <Raynei486> yeah that works thanks |
02:10:40 | termer | Elegantbeef, Wouldn't creating a ref object type and then making a ref object type of that object be a double-pointer? |
02:11:02 | termer | like type BoxBase = ref object of RootObj and then Boxed[T] = ref object of BoxBase |
02:11:04 | termer | that's 2 refs |
02:13:21 | FromDiscord | <Elegantbeef> Yes it is |
02:13:25 | FromDiscord | <Elegantbeef> If you want you can skip it |
02:14:06 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4tnU |
02:14:06 | FromDiscord | <Elegantbeef> But that means unpacking isnt the same |
02:14:18 | FromDiscord | <Elegantbeef> Best to just live with double pointer indirection cause that's what the user wants |
02:14:33 | FromDiscord | <Elegantbeef> Apparently generic methods do work i'm just daft |
02:15:39 | termer | what 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:39 | FromDiscord | <Elegantbeef> Nevermind Nim is daft |
02:15:58 | FromDiscord | <Elegantbeef> Oh no it's still single indirection |
02:16:07 | FromDiscord | <Elegantbeef> `object of X` is stack allocated |
02:18:23 | termer | so 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:37 | FromDiscord | <Elegantbeef> Should be |
02:20:57 | termer | Interesting |
02:21:01 | termer | A bit confusing |
02:21:10 | FromDiscord | <Elegantbeef> Think about how many pointers there'd be in a massive tree if otherwise |
02:21:56 | termer | well that's what I was worried about happening to begin with |
02:22:30 | termer | It'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:09 | FromDiscord | <Elegantbeef> If you follow status' advice you put `ref` after the object name |
02:23:25 | * | ltriant quit (Ping timeout: 240 seconds) |
02:24:13 | termer | You should yeah |
02:26:55 | FromDiscord | <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:42 | FromDiscord | <Elegantbeef> I disagree but I also am a numpty |
02:29:57 | termer | Bridged users of suspiciously similar name lengths rule this channel, sorry |
02:30:16 | termer | The lowly discord user simply cannot compete |
02:30:25 | FromDiscord | <Elegantbeef> You should just use matrix |
02:30:31 | FromDiscord | <Elegantbeef> Problem solved sokam |
02:30:37 | termer | or IRC |
02:30:57 | FromDiscord | <Elegantbeef> Nah never use irc that's for boomers who need nitroglycerine else their heart gives out |
02:31:15 | FromDiscord | <Elegantbeef> Termer literally is only alive due to dynamite |
02:31:26 | termer | LOOOOOL |
02:31:45 | termer | I'm routinely the youngest person in any given IRC channel |
02:33:40 | FromDiscord | <Elegantbeef> Well give it time and you'll be the oldest cause they're sure die off |
02:34:08 | termer | IRC 4ever |
02:34:22 | FromDiscord | <sOkam!> tru |
02:34:23 | FromDiscord | <Elegantbeef> Eventually you'll be in a void of just you |
02:34:38 | termer | I keep finding new people to get on IRC to replace me once I die |
02:34:58 | FromDiscord | <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:18 | termer | I've duped people using a chat system I wrote into being on IRC by implementing an IRC gateway built into it |
02:35:22 | termer | then convincing them to connect over IRC |
02:35:32 | FromDiscord | <Elegantbeef> You're a terrible person |
02:35:56 | termer | I've written an entire library just for implementing IRC gateways for existing protocols |
02:36:01 | FromDiscord | <Elegantbeef> Next you're going to convince people that telegraph is the way to communicate |
02:36:02 | termer | just to use more IRC |
02:36:15 | FromDiscord | <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:25 | FromDiscord | <Elegantbeef> Matrix is a protocol |
02:36:29 | termer | IRC is so incredibly simple that it can be part of anything |
02:36:29 | FromDiscord | <Elegantbeef> You can plug it anywhere you want |
02:36:35 | termer | Matrix is also a protocol but it's much more complicated |
02:36:41 | FromDiscord | <sOkam!> ic |
02:36:45 | termer | it'll take you more than a weekend to write an implementation for it |
02:37:39 | FromDiscord | <Elegantbeef> I do think a basic non encrypted client probably isnt that complicated |
02:37:42 | FromDiscord | <sOkam!> by implementation you mean something like libmatrix (random name, not anything specific) or something like -using- said libmatrix? |
02:37:57 | FromDiscord | <Elegantbeef> They mean from scratch |
02:38:16 | FromDiscord | <Elegantbeef> Matrix is a relatively simple protocol based on json, the complexity is due to all of the features it has really |
02:38:30 | FromDiscord | <sOkam!> ic |
02:38:36 | termer | you can call me he by the way |
02:39:00 | termer | but yes matrix isn't terribly hard to understand until you do the encryption thing |
02:39:05 | termer | it's more about the volume of features |
02:39:29 | termer | meanwhile IRC has nearly no features and is a line-based protocol so it's piss easy to figure out and interface with |
02:39:48 | FromDiscord | <Elegantbeef> Spaces, rooms, voip, code blocks, ... |
02:40:11 | FromDiscord | <Elegantbeef> Element even supports embedding shared webapps |
02:40:24 | termer | voip was always some nonsense jitsi thing when I tried it |
02:40:38 | FromDiscord | <Elegantbeef> They have 1\:1 calls and element voice is in beta |
02:40:44 | FromDiscord | <Elegantbeef> So they'll have a builtin voip solution soon |
02:40:54 | termer | Fucking finally |
02:41:23 | FromDiscord | <Elegantbeef> Though i wish matrix had channel based voip, yea it'll be nice |
02:41:36 | termer | just do what I do and stick random protocols together |
02:41:48 | termer | and then write extensions for features they don't support |
02:41:49 | FromDiscord | <Elegantbeef> Nah not really sellable to friends |
02:41:56 | termer | you'd be surprised |
02:42:03 | termer | but yes generally it's difficult |
02:42:05 | termer | that's the main issue |
02:42:08 | FromDiscord | <Elegantbeef> Like i could make a mumble webap for element that hooks into mumble and host a mumble server |
02:42:11 | termer | so hard to get friends to use anything besides discord |
02:42:19 | FromDiscord | <Elegantbeef> But like fuck that's a pain in the ass |
02:42:21 | termer | I host a teamspeak and mumble server |
02:42:43 | termer | I 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:48 | FromDiscord | <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:53 | termer | not sure whether I'm gonna try rewriting it in Rust or try again in Nim |
02:43:19 | termer | Mumble is really poorly designed in terms of moderation |
02:43:23 | FromDiscord | <Elegantbeef> Voip going down cause my PC died is not a very good situation |
02:43:30 | termer | it's hard to manage a mumble server beyond small numbers of friends |
02:43:36 | FromDiscord | <Elegantbeef> Meh i do not care about moderation it's only my friends |
02:43:36 | termer | Yeah put that shit in a VPS |
02:43:50 | FromDiscord | <Elegantbeef> I mean this was in highschool for me |
02:43:59 | FromDiscord | <Elegantbeef> It wasnt a big deal it worked fine for like a year or two |
02:44:01 | termer | I've been hosting a TS server on a VPS since highschool |
02:44:04 | termer | but not on my PC |
02:44:08 | termer | internet's always been too bad for that |
02:44:17 | termer | voice chat is never a problem anymore though cause I have access to like 5 mumble servers at any given time |
02:44:18 | FromDiscord | <Elegantbeef> Yea mine was sufficient |
02:44:21 | termer | so many friends host them |
02:44:45 | * | ltriant quit (Ping timeout: 255 seconds) |
02:44:52 | termer | I wanna implement the Mumble protocol and write a server that supports WebRTC |
02:45:04 | termer | but that's filled with so much nonsense that makes it hard to do |
02:45:19 | FromDiscord | <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:40 | FromDiscord | <Elegantbeef> Yea you pretty much cannot use google's webrtc and have to use another implementation |
02:45:49 | FromDiscord | <Elegantbeef> Google's webrtc library is awful in so many regards |
02:46:12 | termer | WebRTC 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:02 | FromDiscord | <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:27 | FromDiscord | <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:48 | FromDiscord | <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:59 | FromDiscord | <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:10 | FromDiscord | <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:24 | FromDiscord | <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:23 | FromDiscord | <Gumbercules> sent a code paste, see https://play.nim-lang.org/#ix=4tof |
04:18:40 | FromDiscord | <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:01 | FromDiscord | <Rika> Damn LMAO |
04:52:21 | * | ltriant joined #nim |
04:57:05 | * | ltriant quit (Ping timeout: 240 seconds) |
05:36:23 | FromDiscord | <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:44 | FromDiscord | <Arathanis> In reply to @qb "Anyone who is experienced": any particular reason you want to keep it as a pyobject in nim? |
06:32:42 | FromDiscord | <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:53 | FromDiscord | <Arathanis> @qb still there? |
06:41:01 | FromDiscord | <qb> Yep |
06:42:13 | FromDiscord | <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:36 | FromDiscord | <Arathanis> sent a code paste, see https://play.nim-lang.org/#ix=4toL |
06:43:48 | FromDiscord | <Arathanis> (edit) "https://play.nim-lang.org/#ix=4toL" => "https://paste.rs/gyl" |
06:44:05 | FromDiscord | <Elegantbeef> Is that better than just exporting a `fooBarStr` and `fooBarInt` and doing the dispatch inside python? |
06:44:18 | FromDiscord | <Arathanis> In reply to @Elegantbeef "Is that better than": i was about to suggest this |
06:44:27 | FromDiscord | <Arathanis> I agree with beef @qb |
06:44:49 | FromDiscord | <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:00 | FromDiscord | <Arathanis> but this IS how to do what you want |
06:45:06 | FromDiscord | <Arathanis> i just think you shouldn't |
06:45:25 | FromDiscord | <Arathanis> id think the whole point of making a pyd file w/ nim is to implement some slow function w/ more performance |
06:45:31 | FromDiscord | <Arathanis> calling python within nim kind of defeats that purpose |
06:45:43 | * | PMunch joined #nim |
06:45:54 | FromDiscord | <Arathanis> in fact, in python you can use `functools.singledispatch` and make this extremely easy on yourself |
06:46:57 | FromDiscord | <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:31 | FromDiscord | <qb> And yea performance is a point as well |
06:49:27 | FromDiscord | <qb> How could I export nim types? Guess I tried that already |
06:50:08 | FromDiscord | <Arathanis> sent a code paste, see https://play.nim-lang.org/#ix=4toN |
06:50:32 | FromDiscord | <Elegantbeef> Look what they need to mimic a fraction of our power |
06:50:36 | FromDiscord | <Arathanis> (edit) "https://play.nim-lang.org/#ix=4toN" => "https://play.nim-lang.org/#ix=4toO" |
06:51:02 | FromDiscord | <Arathanis> sent a code paste, see https://play.nim-lang.org/#ix=4toP |
06:51:44 | FromDiscord | <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:52 | FromDiscord | <Arathanis> I use nim to accelerate python all the time |
06:51:56 | FromDiscord | <Arathanis> match made in heaven imo |
06:52:19 | FromDiscord | <Elegantbeef> Wait people actually write python? |
06:52:22 | FromDiscord | <Elegantbeef> I thought it was a meme |
06:52:28 | FromDiscord | <Arathanis> they absolutely do lol |
06:52:48 | FromDiscord | <Arathanis> everyone just wants to take potshot 😭 |
06:52:51 | FromDiscord | <Arathanis> (edit) "potshot" => "potshots" |
06:53:06 | FromDiscord | <Elegantbeef> It's all too easy |
06:53:34 | FromDiscord | <Arathanis> what is too easy? |
06:53:41 | FromDiscord | <qb> sent a code paste, see https://play.nim-lang.org/#ix=4toQ |
06:54:15 | FromDiscord | <qb> (edit) "https://play.nim-lang.org/#ix=4toQ" => "https://play.nim-lang.org/#ix=4toS" |
06:54:20 | FromDiscord | <Arathanis> are you using nimpy to ffi into python but your app is in nim? |
06:54:35 | FromDiscord | <qb> https://github.com/qb-0/pyMeow |
06:55:05 | FromDiscord | <qb> I'm a pretty newbish nim coder. Dont blame me ;D |
06:55:06 | FromDiscord | <Arathanis> see this seems like you want to do what i suggested |
06:55:13 | FromDiscord | <Arathanis> you can write the whole thing in nim, like 98% of it |
06:55:25 | FromDiscord | <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:10 | FromDiscord | <Arathanis> what they actually import is your .py file, but under the hood its just calling your nim code |
06:56:27 | FromDiscord | <Arathanis> you can provide a much cleaner, more pythonic interface for your users that way |
06:56:31 | FromDiscord | <Arathanis> and your nim code can be blazing fast |
06:56:52 | FromDiscord | <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:46 | FromDiscord | <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:56 | FromDiscord | <Arathanis> (edit) "you can also make your life easier with a .pyi file, this is mostly for your ... purposes" added "development" |
06:58:24 | FromDiscord | <qb> yea I'm including a stub file |
07:00:39 | FromDiscord | <Arathanis> sent a long message, see http://ix.io/4toV |
07:00:58 | * | ltriant joined #nim |
07:01:04 | FromDiscord | <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:43 | FromDiscord | <qb> Really? Noone said smth yet 😄 |
07:01:57 | FromDiscord | <Arathanis> not to your face 😎 |
07:01:58 | Amun-Ra | same with camel case :> |
07:02:01 | FromDiscord | <qb> haha |
07:02:13 | FromDiscord | <Arathanis> im just telling you, python naming conventions for modules are snake case |
07:02:16 | FromDiscord | <Arathanis> check PEP8 |
07:02:32 | FromDiscord | <Arathanis> everytime I have to use a library with capitals in the module name I die a little inside |
07:02:32 | Amun-Ra | and check your program with pylint |
07:02:38 | FromDiscord | <Arathanis> don't get me started on "import PIL" |
07:02:40 | FromDiscord | <Arathanis> i shudder |
07:02:57 | FromDiscord | <Arathanis> (edit) ""import PIL"" => "`import PIL`" |
07:03:08 | FromDiscord | <qb> Was just going to mention pil |
07:03:21 | FromDiscord | <Arathanis> its a horrible abomination |
07:03:29 | FromDiscord | <Arathanis> to say nothing of python's `logging` module |
07:03:31 | FromDiscord | <Arathanis> what a blemish |
07:03:39 | FromDiscord | <Arathanis> camel case functions in a standard librar |
07:03:40 | FromDiscord | <Arathanis> (edit) "librar" => "library" |
07:03:42 | FromDiscord | <Arathanis> 🤢 |
07:03:49 | Amun-Ra | right |
07:04:22 | FromDiscord | <Arathanis> this is why i use `loguru` instead |
07:04:34 | FromDiscord | <Arathanis> cause not only does it have appropriate naming conventions, its just miles better than `logging` |
07:04:36 | Amun-Ra | and I use my own |
07:04:49 | FromDiscord | <Arathanis> check out loguru if you ever feel the need, incredible library for logging |
07:04:52 | FromDiscord | <Arathanis> i absolutely recommend |
07:05:05 | * | fredrikhr joined #nim |
07:05:06 | FromDiscord | <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:12 | FromDiscord | <thindil> Elegantbeef\: a couple of hours too late probably, but now, yes I have. 😉 |
07:39:12 | FromDiscord | <thindil> Same |
07:39:13 | FromDiscord | <Elegantbeef> I'm still alive |
07:39:39 | FromDiscord | <Elegantbeef> Hmm with choosenim `$nim` is located inside `version/bin/nim` |
07:40:25 | * | ltriant quit (Ping timeout: 240 seconds) |
07:42:04 | FromDiscord | <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:18 | FromDiscord | <Elegantbeef> Yea i know i'm trying to reason how to resolve this |
07:44:07 | FromDiscord | <Elegantbeef> Hmmm is lib next to your sources still |
07:45:11 | FromDiscord | <Elegantbeef> does `import "$lib"/../compiler/nimeval` compile? |
07:46:26 | NimEventer | New thread by alexeypetrushin: Won't compile without `void` return type, see https://forum.nim-lang.org/t/10096 |
07:47:06 | FromDiscord | <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:28 | FromDiscord | <thindil> `libnimrtl.so` is in `/usr/local/lib` and compiler in `/usr/local/nim/`. |
07:49:00 | FromDiscord | <Elegantbeef> This is a cruel joke |
07:49:37 | FromDiscord | <Elegantbeef> Can you open the issue for me, since you have a better test case of what works and what doesnt? |
07:51:29 | FromDiscord | <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:13 | FromDiscord | <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:17 | FromDiscord | <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:08 | FromDiscord | <Elegantbeef> No you cannot use MajorMinorPatch cause devel exists |
08:44:20 | FromDiscord | <thindil> Ah, I see. But it not works either\: `Error: expression expected, but found 'keyword import` line 1 col 15 |
08:44:44 | FromDiscord | <thindil> Also, imports cannot be nested. |
08:45:28 | FromDiscord | <Elegantbeef> What? |
08:45:31 | FromDiscord | <Elegantbeef> Imports can be in a when |
08:47:37 | FromDiscord | <Elegantbeef> Should suffice |
08:47:38 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4tpd |
08:47:54 | FromDiscord | <Elegantbeef> automatic importing for those that use choosenim and `$nim` support for those that dont |
08:49:52 | FromDiscord | <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:57 | FromDiscord | <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:01 | FromDiscord | <Clonkk> Anyone knows what it's about ? |
09:22:10 | FromDiscord | <Clonkk> Is there a config file somewhere that's missing ? |
09:26:03 | FromDiscord | <Yardanico> In reply to @Clonkk "Since upgrading to 2.0-RC": probably something to do with new nimble |
09:26:13 | FromDiscord | <Yardanico> did you fully upgrade, including the nim config file? |
09:28:36 | FromDiscord | <Clonkk> `choosenim update devel` |
09:28:39 | FromDiscord | <Clonkk> So I suppose, yes |
09:28:51 | FromDiscord | <ringabout> They use different package systems. You need to delete `/pkgs` and install everything again, which is installed under `/pkgs2`. |
09:29:18 | PMunch | (and then you need to only use Nimble, because Nim by default doesn't understand pkgs2) |
09:29:29 | PMunch | At least my install doesn't seem to understand it |
09:29:45 | FromDiscord | <Clonkk> I have my package under mkgs2 already |
09:29:53 | FromDiscord | <Yardanico> In reply to @PMunch "(and then you need": it does understand |
09:30:08 | PMunch | Really? It doesn't seem to for me |
09:30:19 | FromDiscord | <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:28 | FromDiscord | <Yardanico> @PMunch idk pmunch, it just works for me |
09:30:47 | FromDiscord | <Yardanico> I don't even have normal pkgs folder anymore, only pkgs2, yet I can import nimble-installed pkgs just fine |
09:31:25 | FromDiscord | <Clonkk> So if i delete pkgs and pkgs2, and reinstal my package I should be able to run "nim cpp ..." |
09:31:54 | PMunch | I guess it might be because I still have a pkgs folder |
09:32:06 | PMunch | For when I switch to an older version of Nim to test things |
09:39:40 | FromDiscord | <Clonkk> Didn't work |
09:39:55 | FromDiscord | <Yardanico> idk, i haven't used choosenim for years, can't help :( |
09:40:09 | PMunch | @Yardanico, what? |
09:40:14 | PMunch | How do you install Nim? |
09:40:14 | FromDiscord | <Yardanico> ? |
09:40:26 | FromDiscord | <Yardanico> i just have the latest devel installed from git with build_all.sh |
09:40:29 | FromDiscord | <Yardanico> i don't need choosenim |
09:40:40 | FromDiscord | <Yardanico> and periodically I just git pull and sh build_all.sh or just koch boot -d:release |
09:42:24 | FromDiscord | <Clonkk> So there is no way to have the nim compiler see the package installed thorugh `nimble install ...` in latest versions ? |
09:43:47 | FromDiscord | <Clonkk> That's kinda annoying |
09:44:34 | FromDiscord | <Yardanico> Clonkk, again, there is |
09:44:42 | FromDiscord | <Yardanico> it should just work by default, but it doesn't work for you for some reason |
09:44:58 | FromDiscord | <Yardanico> maybe choosenim didn't update the nim config or something? |
09:45:05 | FromDiscord | <Yardanico> can you check and see that it has an entry for pkgs2 ? |
09:45:49 | FromDiscord | <Clonkk> It has an entry for the wrong folder |
09:46:00 | FromDiscord | <Clonkk> It adds /opt/nimble/pkgs |
09:46:58 | FromDiscord | <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:18 | FromDiscord | <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:06 | FromDiscord | <Clonkk> Yes, actually it does have that |
09:48:15 | FromDiscord | <Clonkk> my bad, didn't scroll far enough |
09:49:14 | FromDiscord | <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:11 | FromDiscord | <Clonkk> I also have a `nimble.lock` files in the parent directory 4 level above |
09:50:38 | FromDiscord | <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:11 | FromDiscord | <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:21 | FromDiscord | <Yardanico> for the whole root i think |
09:53:28 | FromDiscord | <Yardanico> <https://github.com/nim-lang/Nim/blob/devel/compiler/nim.nim#L44> |
09:53:57 | FromDiscord | <Yardanico> https://nim-lang.org/docs/os.html#parentDirs.i%2Cstring |
09:54:00 | FromDiscord | <Clonkk> hmm that's a bit annoying |
09:54:55 | FromDiscord | <Clonkk> Somehow the presence of the nimble.lock adds noNimblePath but then do not uses the version in nimble.lock file instead ? |
10:02:03 | FromDiscord | <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:31 | FromDiscord | <Clonkk> Thank you for pointing me in the right direction, that helped a lot↵(@Yardanico) |
10:13:48 | FromDiscord | <Yardanico> no problem, I just searched for nimble.lock in the github repo :) |
10:14:06 | FromDiscord | <Clonkk> Yeah I don't have the habit of going through the source code |
10:14:12 | FromDiscord | <Clonkk> I should do that more |
10:14:31 | FromDiscord | <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:56 | FromDiscord | <dennisritchie> never relax |
11:03:48 | * | derpydoo quit (Ping timeout: 255 seconds) |
11:11:33 | NimEventer | New 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:37 | FromDiscord | <System64 ~ Flandre Scarlet> Can I cast an uint32 to a Tile object without confusing the GC? |
12:48:15 | PMunch_ | A uint32 isn't garbage collected, so it wouldn't confuse the GC |
12:51:45 | FromDiscord | <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:31 | PMunch_ | Yup, doesn't make it any more garbage collected though :P |
12:53:17 | FromDiscord | <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:03 | PMunch | If it's just a Tile then no |
12:54:09 | PMunch | an object* |
12:54:23 | PMunch | If it's a ref object you'll have issues |
12:55:28 | FromDiscord | <System64 ~ Flandre Scarlet> It's an object |
12:55:39 | FromDiscord | <System64 ~ Flandre Scarlet> (so it is a value type) |
12:56:49 | FromDiscord | <Rika> Then it is fine |
13:00:32 | * | ltriant joined #nim |
13:04:54 | NimEventer | New question by treeyossy: How can I import python libaray into Nim'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:10 | NimEventer | New 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:28 | NimEventer | New 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:19 | FromDiscord | <Prestige> hm is there no module for converting strings to camel case, pascal case, etc? |
16:24:18 | FromDiscord | <ringabout> https://github.com/lamartire/anycase |
16:24:21 | FromDiscord | <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:57 | FromDiscord | <Takemichi Hanagaki> In reply to @Avahe "hm is there no": I wrote one sometime ago, but in python... |
16:37:35 | FromDiscord | <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:49 | arkanoid | I want to plug async into nigui update loop, so I need a function to call manually each update. Do you know how? |
16:39:07 | arkanoid | nevermind, found poll |
16:47:56 | FromDiscord | <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:53 | FromDiscord | <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:23 | FromDiscord | <Dudugz> In reply to @frank34 ""I'll help anyone interested": <@&371760044473319454> is this allowed? It doesn't look "official" to me. |
20:18:07 | FromDiscord | <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:58 | FromDiscord | <Phil> @Yepoleb if you would be so kind, it appears my matrix account still is not a mod for some reason |
20:22:28 | FromDiscord | <huantian> also in #science |
20:24:49 | FromDiscord | <Vindaar> In reply to @Isofruit "<@144300201857777664> if you would": check again 👀 |
20:26:09 | FromDiscord | <Phil> Ahhh there we go |
20:26:26 | FromDiscord | <Phil> Sidenote vin, I think you and PMunch banned frank34 at the same time and that lead to unbanning him |
20:26:37 | FromDiscord | <Phil> in the science channel, not here |
20:26:37 | FromDiscord | <newlibarian> what does nimble init and nimble setup do? |
20:26:44 | FromDiscord | <Yepoleb> i don't think i can mod people |
20:27:00 | FromDiscord | <Dudugz> init starts a new project, setup i think installs the dependencies? |
20:27:37 | FromDiscord | <Phil> nimble setup is kinda pointless since installing dependencies is done basically every time for every thing nimble does |
20:27:49 | FromDiscord | <Phil> Unless I missed something about it |
20:28:08 | FromDiscord | <Phil> One sec, double checking docs |
20:28:39 | FromDiscord | <Phil> sent a long message, see http://ix.io/4ts5 |
20:31:38 | FromDiscord | <newlibarian> does it install anything or change path in systems variables on windows? |
20:31:53 | FromDiscord | <newlibarian> https://github.com/samdze/playdate-nim |
20:32:33 | FromDiscord | <newlibarian> i was unsuccessful at setting up the above github. |
20:32:51 | FromDiscord | <newlibarian> the instructions were un clear. |
20:33:25 | FromDiscord | <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:41 | FromDiscord | <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:31 | FromDiscord | <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:11 | FromDiscord | <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:13 | NimEventer | New 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 |