<< 02-08-2021 >>

01:23:04FromDiscord<lamersc.com 🐧> So for the difference between Rust and Nim ARC, does rust place calls to free memory at compile time, while Nim actively frees memory as their reference count hits 0?
01:26:02FromDiscord<Elegantbeef> Arc is CT afaik
01:26:38FromDiscord<Elegantbeef> You can compile with `--expandArc` iirc to see where it inserts calls
01:26:53FromDiscord<lamersc.com 🐧> In reply to @Elegantbeef "Arc is CT afaik": What does CT stand for?
01:26:58FromDiscord<Elegantbeef> Compile time
01:27:12FromDiscord<lamersc.com 🐧> Ohhhh okay, I’ll check it out
01:27:49*krux02 quit (Remote host closed the connection)
01:28:02FromDiscord<Elegantbeef> Might be a good read https://nim-lang.org/blog/2020/10/15/introduction-to-arc-orc-in-nim.html
02:25:39FromDiscord<theangryepicbanana> does anyone know why this isn't working? https://replit.com/@theangryepicbanana/nim-interface-test
02:26:38FromDiscord<theangryepicbanana> basically a generic type isn't matching a generic concept with the equivalent type parameter constraints
02:26:46FromDiscord<theangryepicbanana> (edit) removed "the"
02:27:31FromDiscord<theangryepicbanana> when implicitly calling a converter
02:32:13FromDiscord<theangryepicbanana> basically something along the lines of ``converter convert[C: MyConcept](x: C): Values[C.T] = ...``
02:32:27FromDiscord<theangryepicbanana> (edit) "Values[C.T]" => "MyObj[C.T]"
02:33:02FromDiscord<theangryepicbanana> (as a side note, do edits work on the irc bridge?)
02:38:23*arkurious quit (Quit: Leaving)
02:59:09FromDiscord<Elegantbeef> Could you minimize it a bit so it's more clear what's going on?
03:26:14FromDiscord<theangryepicbanana> In reply to @Elegantbeef "Could you minimize it": yeah sure, I'll make a small thing for it real quick
03:36:04*xet7 quit (Remote host closed the connection)
03:37:08*xet7 joined #nim
03:41:08FromDiscord<theangryepicbanana> In reply to @Elegantbeef "Could you minimize it": https://play.nim-lang.org/#ix=3uKU
03:41:43FromDiscord<theangryepicbanana> if the \`is-a\` constraint is removed, it works just fine
03:44:01FromDiscord<Rika> I believe converters don’t really mix with concepts
03:44:02*thunder quit (Remote host closed the connection)
03:44:16FromDiscord<theangryepicbanana> In reply to @Rika "I believe converters don’t": they actually do, it's just undocumented
03:44:28*thunder joined #nim
03:44:53FromDiscord<Rika> Which either means they actually don’t or no one has written docs of it, depending on if you look at the compiler code or not
03:45:17FromDiscord<Rika> What I mean is
03:45:22FromDiscord<Rika> It might just be a coincidence that they do
03:45:35FromDiscord<Rika> That they do to a degree
03:45:39FromDiscord<theangryepicbanana> https://github.com/nim-lang/Nim/blame/1fb9a6d94631bf7f3570d3382874ba2d59e6ddbb/doc/manual_experimental.rst#L685-L716
03:45:56FromDiscord<theangryepicbanana> wrong ref
03:46:18FromDiscord<theangryepicbanana> well either way it's somewhere in there
03:46:56FromDiscord<theangryepicbanana> but again, my code works just fine without the proc constraint
03:47:19FromDiscord<theangryepicbanana> which means that something about the proc is wonky, which is weird because it ain't doing anything special
03:48:33FromDiscord<theangryepicbanana> oh I suppose it would help if I actually added the type params
03:48:40FromDiscord<theangryepicbanana> https://play.nim-lang.org/#ix=3uKW
03:49:43FromDiscord<theangryepicbanana> but basically, it seems like `MyConcept` is no longer able to see its type parameters once that constraint is added
03:55:02*xet7 quit (Remote host closed the connection)
03:56:11*xet7 joined #nim
04:00:51FromDiscord<Rika> Perhaps this is yet another bug of the current implementation of concepts lol
04:05:30*vicfred joined #nim
04:06:02*supakeen quit (Quit: WeeChat 3.2)
04:06:35*supakeen joined #nim
04:15:20FromDiscord<theangryepicbanana> In reply to @Rika "Perhaps this is yet": oof lol
04:15:28FromDiscord<theangryepicbanana> guess imma report that later
04:15:36FromDiscord<Elegantbeef> I mean you're using concepts wrong in that case arent you?
04:15:44FromDiscord<Elegantbeef> You're mixxing old style with new style arent you?
04:16:10FromDiscord<Rika> Oh
04:16:14FromDiscord<Elegantbeef> I havent got a working version, just pointing out my guess
04:16:27FromDiscord<Rika> No that’s wrong old style syntax
04:16:50FromDiscord<Rika> I didn’t bother actually reading the concept ayy lmao
04:16:58FromDiscord<theangryepicbanana> wait whar
04:17:00FromDiscord<theangryepicbanana> (edit) "whar" => "what"
04:17:06FromDiscord<theangryepicbanana> pretty sure I'm using old concepts
04:17:41FromDiscord<theangryepicbanana> sent a code paste, see https://play.nim-lang.org/#ix=3uL2
04:17:49FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3uL3
04:17:55FromDiscord<theangryepicbanana> ah
04:18:26FromDiscord<theangryepicbanana> well calling `is-a` normally actually gave me a recursion error, so I switched it to a type check
04:18:38FromDiscord<theangryepicbanana> (edit) "well calling `is-a` normally ... actually" added "in the concept"
04:18:51FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3uL4
04:19:39FromDiscord<theangryepicbanana> well then the former is closer to what I'm doing
04:20:00FromDiscord<theangryepicbanana> it should theoretically work fine I think
04:20:38FromDiscord<Elegantbeef> Nope, cause you dont have a sym named `is-a` that matches that signature
04:21:03FromDiscord<theangryepicbanana> well the thing is that it does
04:21:35FromDiscord<theangryepicbanana> the main issue is that `MyConcept` can't find its `T` parameter when it has the `is-a`
04:22:01FromDiscord<theangryepicbanana> (edit) "the main issue is that `MyConcept` can't find its `T` parameter when it has the `is-a` ... " added "check"
04:22:30FromDiscord<Elegantbeef> No you dont have that
04:22:47FromDiscord<Elegantbeef> You have it looking for a `is-a` symbol, not a procedure bound to the type
04:22:50FromDiscord<theangryepicbanana> sent a code paste, see https://play.nim-lang.org/#ix=3uL5
04:23:08FromDiscord<theangryepicbanana> well yes that's intentional
04:23:20FromDiscord<Elegantbeef> It's why you have to declare that procedure before that concept
04:23:22FromDiscord<Elegantbeef> Is it really?
04:23:25FromDiscord<theangryepicbanana> yes
04:23:55FromDiscord<theangryepicbanana> I'm wanting to check the signature of `is-a` to see if it matches `C, SubObj[T]`
04:24:19FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3uL7
04:24:29FromDiscord<theangryepicbanana> it can have multiple overloads, which is why I declare a dummy version (`(a, b: void)`) before hand
04:24:42FromDiscord<theangryepicbanana> (edit) "before hand" => "beforehand"
04:25:01FromDiscord<Elegantbeef> I dont think it'll work that way, but i could be wrong
04:25:13FromDiscord<theangryepicbanana> it should, because it'll work if the types aren't generic
04:25:38FromDiscord<theangryepicbanana> however when they are generic, then we get these weird errors
04:28:16FromDiscord<theangryepicbanana> I'm going to assume it's some sort of variance issue, but I'm not entirely sure
04:29:29FromDiscord<Elegantbeef> Well this does the trick afaik https://play.nim-lang.org/#ix=3uL8
04:30:01FromDiscord<Elegantbeef> Remove the generics until it explodes
04:34:01FromDiscord<theangryepicbanana> looks hacky, I like it
04:34:03FromDiscord<theangryepicbanana> thx
04:34:33FromDiscord<Elegantbeef> Hacky?
04:34:49FromDiscord<Elegantbeef> Isnt it just what you wanted but done properly? 😛
04:37:11FromDiscord<theangryepicbanana> In reply to @Elegantbeef "Isnt it just what": I consider type params that use other type params sorta hacky since nim doesn't always like it ;)
04:37:47FromDiscord<theangryepicbanana> I did the same in haxe for quite a while, and apparently it's an "accidental feature"
04:38:14FromDiscord<Elegantbeef> For generics it should be fine since they're always sem'd first in first out
04:38:18*vicfred quit (Quit: Leaving)
04:38:28FromDiscord<theangryepicbanana> 👍
04:38:34FromDiscord<theangryepicbanana> thanks for the help
04:39:04FromDiscord<theangryepicbanana> if you're wandering, I'm attempting to make fully-featured interfaces for nim, including generic interfaces
04:39:12FromDiscord<Elegantbeef> Now if you're using inferred + explicit generics, you're off the path. The compiler cannot reason them
04:39:16FromDiscord<theangryepicbanana> (edit) "wandering," => "wondering,"
04:39:23FromDiscord<theangryepicbanana> hmm
04:39:50FromDiscord<theangryepicbanana> well I suppose I'll figure that out once it becomes an issue
04:39:55FromDiscord<Elegantbeef> I investigated them for a while and it's a complicated case of explicit generics and inferred generics take two paths and i dont speak compiler enough to fix it
04:40:12FromDiscord<theangryepicbanana> sounds like a bug
04:40:19FromDiscord<Elegantbeef> I mean it is
04:40:26FromDiscord<theangryepicbanana> weird though, may take a peek at that later
04:41:02FromDiscord<Elegantbeef> The issue is only on calling
04:41:37FromDiscord<theangryepicbanana> but for types and converters, it'd be fine?
04:41:46FromDiscord<theangryepicbanana> or would converters also have issues?
04:42:08FromDiscord<Elegantbeef> What happens in the case of `a[int](10)` is `a[int]` is semd and instantiates a generic without regard to `(10)` so it cannot be called
04:42:33FromDiscord<theangryepicbanana> huh
04:42:43FromDiscord<theangryepicbanana> interesting
04:42:58FromDiscord<Elegantbeef> talking about `proc a[T](c: int or float)` for instance
04:43:51FromDiscord<theangryepicbanana> oh I see now
04:44:10FromDiscord<theangryepicbanana> yeah that makes sense then
05:22:31FromDiscord<lamersc.com 🐧> In reply to @Elegantbeef "Might be a good": Thank you, read it and it made things very clear 😄
05:22:53FromDiscord<lamersc.com 🐧> I should definitely looking into the older blogs more
05:22:57FromDiscord<lamersc.com 🐧> Lots of good information
06:13:20*max22- joined #nim
06:22:59*Jjp137 quit (Read error: Connection reset by peer)
06:23:38*Jjp137 joined #nim
07:16:00*pro joined #nim
07:16:04*pro quit (Client Quit)
08:42:12*max22- quit (Remote host closed the connection)
08:50:27*max22- joined #nim
08:55:58*max22- quit (Ping timeout: 256 seconds)
11:02:40*krux02 joined #nim
11:24:24FromDiscord<bolino> Hello there,↵I have a MySQL table in UTF-8 collation. When I run a query inserting a row with UTF-8 values, like this one: it works fine
11:28:38FromDiscord<bolino> sent a long message, see http://ix.io/3uMw
11:29:12FromDiscord<bolino> (edit) "http://ix.io/3uMw" => "http://ix.io/3uMx"
11:29:28FromDiscord<bolino> (edit) "http://ix.io/3uMx" => "http://ix.io/3uMy"
11:38:58FromDiscord<haxscramper> Nim strings are sequence of bytes, so maybe you need to somehow convert them. If you do `echo @"ホワイト"`
11:39:40FromDiscord<haxscramper> Maybe try to use prepared statements, or configure mysql connection somehow
11:44:28FromDiscord<bolino> In reply to @haxscramper "Nim strings are sequence": Indeed: `@['\xE3', '\x83', '\x9B', '\xE3', '\x83', '\xAF', '\xE3', '\x82', '\xA4', '\xE3', '\x83', '\x88']`
11:44:33FromDiscord<bolino> thanks
11:44:57FromDiscord<bolino> Isn't that a prepared statement already?
11:45:46FromDiscord<bolino> `configure mysql connection somehow` The DB is collated in UTF-8, I don't know where
11:47:24FromDiscord<bolino> `configure mysql connection somehow`↵The DB is collated in UTF-8 already. I have been looking at Nim db `open` proc doc (https://nim-lang.org/docs/db_mysql.html#examples-opening-a-connection-to-a-database) but can't see anything about character set
11:54:51FromDiscord<haxscramper> In reply to @bolino "Isn't that a prepared": no, `let someRandomText: string = "text"`; `db.exec(sql(someRandomText))` is not a prepared statement
11:55:29FromDiscord<haxscramper> It seems like `db_mysql` in nim cannot create prepared statements
11:56:40FromDiscord<haxscramper> and yes, `echo @"ホワイト"` is exactly `ホワイト` if you use extended ascii table
11:58:13FromDiscord<haxscramper> Nim devel finally got "side effect" error cause messages
11:58:14FromDiscord<haxscramper> https://wandbox.org/permlink/NIq9aKTtGrUoK2IL
11:58:28FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3uMJ
11:59:01FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3uMK
11:59:11FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3uML
12:00:15FromDiscord<haxscramper> wandbox nim `head` is only three days old
12:03:08FromDiscord<haxscramper> https://github.com/nim-lang/Nim/pull/18418
12:04:30FromDiscord<haxscramper> @quantimnot if you are the same person who made the PR - thanks a lot
12:04:40*arkurious joined #nim
12:06:02*supakeen quit (Quit: WeeChat 3.2)
12:06:34*supakeen joined #nim
12:18:06FromDiscord<bolino> In reply to @haxscramper "no, `let someRandomText: string": Oh ok
12:19:45FromDiscord<bolino> I see thanks. Any hint about how to configure the connection to manage those characters?
12:23:26FromDiscord<haxscramper> try prepared statements
12:23:27FromDiscord<haxscramper> https://nim-lang.org/docs/mysql.html#stmt_prepare%2CPSTMT%2Ccstring%2Cint
12:24:00FromDiscord<haxscramper> I don't work with mysql, but if you still have troubles try to search for solutions on passing utf8 strings in C+mysql
12:33:02fn<ForumUpdaterBot99> New Nimble package! ballpark - An amateur radio tool to get you a ballpark estimate of where a given Maidenhead grid square is., see https://github.com/Mihara/ballpark
12:33:03fn<R2D299> itHub: 7"Command line utility for quick Maidenhead grid lookup."
12:40:35FromDiscord<bolino> In reply to @haxscramper "https://nim-lang.org/docs/mysql.html#stmt_prepare%2": I'm a bit confused about the documentation about PSTMT. If by any chance you have an example that'd be great!
12:41:16FromDiscord<bolino> (edit) "PSTMT." => "PSTMT type."
12:43:08FromDiscord<haxscramper> No I don't have any, but you can look for C/C++ examples, since std/mysql is just a simple wrapper on top of the C API
12:45:23FromDiscord<bolino> In reply to @haxscramper "No I don't have": I'll try. Thanks again
13:02:02*kayabaNerve_ quit (Read error: Connection reset by peer)
13:02:07*kayabaNerve joined #nim
13:07:03FromDiscord<demotomohiro> !eval echo"ホワイト"
13:07:06NimBotホワイト
13:12:52FromDiscord<bolino> In reply to @demotomohiro "!eval echo"ホワイト"": Yep, that works fine... It seems the conversion in ascii is only done when using sql request in nim
13:17:24FromDiscord<haxscramper> Maybe you just need to configure connection character sets as well?
13:17:30FromDiscord<haxscramper> Nim connection
13:26:35FromDiscord<bolino> In reply to @haxscramper "Maybe you just need": You mean something like↵`db.exec(sql"SET NAMES utf8mb4;")`↵before the INSERT query?
13:29:00FromDiscord<bolino> In reply to @bolino "You mean something like": Oh, it works!
13:29:37FromDiscord<bolino> I'll execute it just after the connection, as the very first query
14:24:42*rockcavera joined #nim
14:24:42*rockcavera quit (Changing host)
14:24:43*rockcavera joined #nim
14:29:57msthmmm ... if I generate shared objects that use a dynamically linked runtime shared object ... is there any hope of upgrading the runtime .so and having the nimcode .sos still work?
14:30:12mst(I'm assuming there's no guarantee, but "any hope" is a different question)
14:32:49FromDiscord<leorize> there's little hope
14:33:22FromDiscord<leorize> we don't version any abi exposed in nimrtl
14:50:35FromDiscord<no name fits> What are the real world usecases for concepts in Nim? I'm just a little confused on how you'd actually use them
14:52:23FromDiscord<generic linux user> game
14:52:43FromDiscord<generic linux user> for android(c) and ios(objc)
14:54:26fn<Prestige99> https://nim-lang.github.io/Nim/manual_experimental.html#concepts they are used like interfaces in java/typescript, if you're familiar with either. Used to make sure objects have a certain "form", so you can treat 2 different objects in the same manner
14:56:04fn<Prestige99> https://en.wikipedia.org/wiki/Polymorphism_(computer_science) might be a good read
14:59:42FromDiscord<haxscramper> In reply to @no name fits "What are the real": Explicitly state requirements for generic arguments. For example .len, [], etc.
15:00:13FromDiscord<haxscramper> Like LenIndexable must have these operators, and I can explicitly require this in procedure signature
15:01:34mstleorize, right, thought as much. this may complicate my life slightly in a couple cases but I was already factoring that in as 'probably' ;)
15:06:00FromDiscord<exelotl> My library exposes operations for various "asset" enum types (sprite gfx, backgrounds and sfx), but those enums are unique to each project using the library.↵Originally I was using `include` to achieve this but then Beef pointed out that concepts were a good fit
15:06:15FromDiscord<no name fits> Without requiring a certain inheritance or implementation on the generic then?
15:06:46FromDiscord<haxscramper> Yes, only existence of some procs or fields
15:06:46FromDiscord<no name fits> Like implementing an interface i mean
15:06:50FromDiscord<no name fits> Right ok
15:07:01FromDiscord<no name fits> So it's good for generic libraries I guess
15:07:05FromDiscord<haxscramper> But you have to implement them for a concrete type of course
15:07:12FromDiscord<no name fits> Right yeah
15:07:42FromDiscord<haxscramper> In reply to @no name fits "So it's good for": Yes, but you don't have to have geneneric-heavy library to benefit from this.
15:07:52FromDiscord<no name fits> No?
15:08:55FromDiscord<haxscramper> For example you can automatically create overload for [a..^b] (so it takes backwards index) as long as you have .len and [a..b]. So you can make a generic implementation for this single proc
15:09:19FromDiscord<haxscramper> And don't bother adding more overloads for [] for different slices
15:09:20FromDiscord<no name fits> Oh I see
15:09:48FromDiscord<haxscramper> For any of your types. Stuff like this is better be at stdlib, but users certainly have a lot of similar thing's
15:10:01FromDiscord<no name fits> Are there examples somewhere other than the docs? Now I kind of want to try it out
15:10:56FromDiscord<haxscramper> Docs have old concepts if I remember correctly, and new ones are not documented fully yet (I think).
15:11:31FromDiscord<no name fits> Oh :c
16:17:06FromDiscord<theangryepicbanana> wtf https://media.discordapp.net/attachments/371759389889003532/871788710151192646/unknown.png
16:18:31FromDiscord<theangryepicbanana> what on earth is this thing
16:44:54FromDiscord<leorize> it's possible candidate for that symbol in particular
16:54:52nixfreak_nim[m]does anyone know if Fidget2 is still being worked on? I really like pixie and GLFW
16:59:32nixfreak_nim[m]or TreeForm slowly replacing fidget into fidget 2.0 ?
16:59:37nixfreak_nim[m] * or is TreeForm slowly replacing fidget into fidget 2.0 ?
17:14:52*dmu quit (Quit: leaving)
17:14:58FromDiscord<dom96> it is being worked on
17:18:31*dmu joined #nim
17:28:22*stkrdknmibalz joined #nim
17:56:01*fn quit (Remote host closed the connection)
18:01:22*fn joined #nim
18:01:56*fn quit (Remote host closed the connection)
18:44:33FromDiscord<theangryepicbanana> In reply to @leorize "it's possible candidate for": I'm not sure what that means? It's supposed to be untyped
18:45:20FromDiscord<theangryepicbanana> the only things doing this are dashes and brackets
18:57:51FromDiscord<@bracketmaster-5a708063d73408ce4> I vaguely remember seeing a nim proc return a nim tuple sometime ago, but I can't quite remember the syntax for it
18:59:14FromDiscord<@bracketmaster-5a708063d73408ce4> Was I dreaming, or is that something nim can do?
19:01:34FromDiscord<theangryepicbanana> In reply to @@bracketmaster-5a708063d73408ce4 "Was I dreaming, or": try `proc(): (T, U)`
19:04:58FromDiscord<@bracketmaster-5a708063d73408ce4> thx
19:05:01FromDiscord<@bracketmaster-5a708063d73408ce4> proc testReturn() \: tuple[name\: string, age\: int] =↵ ("john", 3)↵↵echo testReturn().name
19:05:06FromDiscord<@bracketmaster-5a708063d73408ce4> this also seems to worok
19:45:20FromDiscord<krisppurg> Not sure if this would irrelevant, but...↵↵On Neovim, I have nim.nvim installed, but I just created a new file and I seem to have this message appear; Does anyone know what this means? I know it is kind of self-explanatory. https://media.discordapp.net/attachments/371759389889003532/871841111545614346/unknown.png
19:45:25FromDiscord<RattleyCooper> How do I get the original type back from a distinct type? I want to turn the `nativesockets` `Port` back into a `uint16`
19:46:49FromDiscord<RattleyCooper> (edit) "type" => "type/value"
19:47:11FromDiscord<Rika> In reply to @krisppurg "Not sure if this": shows before you save, as you type it will go away
19:51:13FromDiscord<RattleyCooper> Nvm, figured it out
20:39:44FromDiscord<dankrad> sent a code paste, see https://play.nim-lang.org/#ix=3uPz
20:41:18FromDiscord<haxscramper> `not defined(nimdoc)`
20:42:34FromDiscord<dankrad> thank you
21:27:27*bkay joined #nim
21:28:08*beshr quit (Ping timeout: 252 seconds)
23:04:08*thunder quit (Remote host closed the connection)
23:18:38*thunder joined #nim
23:21:42*auxym joined #nim