00:00:15 | fn | <ForumUpdaterBot99> New thread by Sixte: Nonlinear module behaviour in Nim, see https://forum.nim-lang.org/t/8197 |
00:30:26 | FromDiscord | <@bracketmaster-5a708063d73408ce4> Thx @\_discord\_145405730571288577\:t2bot.io |
00:30:41 | FromDiscord | <timotheecour> In reply to @@bracketmaster-5a708063d73408ce4 "say I have an": `typetraits.enumLen` |
00:33:19 | FromDiscord | <@bracketmaster-5a708063d73408ce4> @\_discord\_427948629249228800\:t2bot.io , not seeing that? https://nim-lang.org/docs/typetraits.html |
00:34:03 | FromDiscord | <@bracketmaster-5a708063d73408ce4> I do however see TupleLen - maybe convert enum to Tuple?🤷 |
00:36:47 | FromDiscord | <ElegantBeef> probably just on devel |
00:38:43 | FromDiscord | <timotheecour> ya devel |
01:18:45 | FromDiscord | <@bracketmaster-5a708063d73408ce4> ah |
02:19:10 | FromDiscord | <aleclarson> sent a code paste, see https://play.nim-lang.org/#ix=3s01 |
02:19:15 | FromDiscord | <aleclarson> So this isn't possible then?↵https://discord.com/channels/371759389889003530/371759389889003532/861324736856719361 |
02:23:02 | FromDiscord | <aleclarson> btw is there documentation on what all the `macro` pragmas do?↵https://nim-lang.org/docs/compiler/pragmas.html#macroPragmas |
02:25:29 | * | arkurious quit (Quit: Leaving) |
02:33:26 | FromDiscord | <ElegantBeef> It's sorta possible |
02:33:36 | FromDiscord | <ElegantBeef> But you have to play with the syntax nim lets you parse |
02:34:44 | FromDiscord | <ElegantBeef> https://play.nim-lang.org/#ix=3s03 |
02:35:29 | FromDiscord | <ElegantBeef> Ah that didnt work for multiple statements, https://play.nim-lang.org/#ix=3s04 this could be a starter |
02:36:24 | FromDiscord | <ElegantBeef> That's all internal compiler stuff that corresponds to stuff here https://nim-lang.org/docs/manual.html#pragmas |
02:37:56 | FromDiscord | <ElegantBeef> @aleclarson as i just noticed when you posted that 😄 |
02:47:48 | * | rockcavera joined #nim |
02:47:48 | * | rockcavera quit (Changing host) |
02:47:48 | * | rockcavera joined #nim |
03:25:32 | * | vicfred quit (Quit: Leaving) |
03:31:31 | FromDiscord | <Raws> @zetashift Have you had any more progress working with neovim and msgpack? I have mostly been trying in an isolated project. My attempts to work with nvim_client were brief because it seemed like a bigger undertaking than doing what I need from scratch. But it turns out I'm struggling with both 🤷♂️. |
03:37:09 | FromDiscord | <aleclarson> is there nothing like `parseEnum` for ordinal enums? (ie: to convert the ordinal to an ident string) |
03:38:38 | FromDiscord | <ElegantBeef> `strutils` has a parseEnum that goes str -> enum |
03:38:43 | FromDiscord | <Raws> @aleclarson https://stackoverflow.com/questions/63931540/string-enum-type-in-nim |
03:39:34 | FromDiscord | <aleclarson> yeah i saw that, but i want to convert `NimNodeKind` integer back to the `nnkProc` string, for example |
03:39:37 | FromDiscord | <aleclarson> for debugging |
03:40:29 | FromDiscord | <aleclarson> i could make a massive `case` stmt that does it manually, but i'd like to that |
03:40:35 | FromDiscord | <aleclarson> (edit) "i could make a massive `case` stmt that does it manually, but i'd like to ... that" added "avoid" |
03:41:33 | fn | <Prestige99> you want to go from int to enum? |
03:47:34 | FromDiscord | <aleclarson> more like "int to string" if you know what i mean |
03:48:42 | FromDiscord | <aleclarson> so i can know what a specific `NimNodeKind` represents when echoing it |
03:49:21 | FromDiscord | <ElegantBeef> Can you provide an example? |
03:49:34 | FromDiscord | <aleclarson> i guess i can reverse engineer it, so to speak, by running a single statement in isolation and checking its `kind` |
03:49:51 | FromDiscord | <aleclarson> (edit) "running" => "passing" |
03:56:12 | FromDiscord | <aleclarson> sent a code paste, see https://play.nim-lang.org/#ix=3s0d |
03:57:40 | FromDiscord | <ElegantBeef> but that's just `$foo == "foo"` |
03:58:16 | FromDiscord | <aleclarson> oh perfect xD |
03:58:20 | FromDiscord | <aleclarson> thx |
03:58:52 | FromDiscord | <ElegantBeef> All things but `ptr`, `ref`, and `distinct` will have a `$` by default |
03:59:20 | FromDiscord | <aleclarson> yeah i dumbly assumed `$foo` would just stringify the int value |
03:59:34 | FromDiscord | <ElegantBeef> it returns the actual ident or the given string |
03:59:49 | FromDiscord | <ElegantBeef> so if you did `foo = "SomeLongString"` it'd return that string |
04:00:42 | FromDiscord | <aleclarson> sent a code paste, see https://paste.rs/s30 |
04:00:46 | FromDiscord | <aleclarson> this is what confused me i think |
04:01:20 | fn | <Prestige99> can you just do $MyInt(i) |
04:01:34 | fn | <Prestige99> Where MyInt is the enum name |
04:02:04 | FromDiscord | <ElegantBeef> That should work |
04:02:11 | FromDiscord | <ElegantBeef> Assuming `i` is a valid enum value |
04:02:25 | FromDiscord | <ElegantBeef> And now for the safest way to know that refer to arne's forum post with no concrete single solution 😛 |
04:04:26 | FromDiscord | <aleclarson> sent a code paste, see https://play.nim-lang.org/#ix=3s0i |
04:04:33 | FromDiscord | <aleclarson> whatever im just glad i got a solution \:) |
04:04:50 | FromDiscord | <ElegantBeef> Maybe you aliased the enum with a variable? |
04:06:02 | * | supakeen quit (Quit: WeeChat 3.2) |
04:06:38 | * | supakeen joined #nim |
04:25:11 | * | rockcavera quit (Remote host closed the connection) |
05:01:55 | * | mjsir911 quit (*.net *.split) |
05:01:55 | * | emery quit (*.net *.split) |
05:01:55 | * | joast quit (*.net *.split) |
05:01:55 | * | redj quit (*.net *.split) |
05:01:55 | * | crem quit (*.net *.split) |
05:02:07 | * | mjsir911 joined #nim |
05:02:07 | * | mjsir911 quit (Changing host) |
05:02:07 | * | mjsir911 joined #nim |
05:02:10 | * | crem joined #nim |
05:03:58 | * | jfinkhaeuser quit (*.net *.split) |
05:03:58 | * | blackbeard420 quit (*.net *.split) |
05:04:07 | * | blackbeard420_ joined #nim |
05:05:18 | * | mal`` quit (*.net *.split) |
05:05:18 | * | Oddmonger quit (*.net *.split) |
05:05:18 | * | dom96 quit (*.net *.split) |
05:05:18 | * | Amun-Ra quit (*.net *.split) |
05:05:18 | * | mst quit (*.net *.split) |
05:05:18 | * | mahlon quit (*.net *.split) |
05:05:18 | * | pjz quit (*.net *.split) |
05:05:24 | * | mst joined #nim |
05:05:48 | * | pjz joined #nim |
05:05:49 | * | Oddmonger joined #nim |
05:05:54 | * | mahlon joined #nim |
05:05:58 | * | Amun-Ra joined #nim |
05:06:18 | * | nisstyre quit (*.net *.split) |
05:06:18 | * | snowolf quit (*.net *.split) |
05:06:18 | * | oz quit (*.net *.split) |
05:06:26 | * | snowolf joined #nim |
05:06:30 | * | mal`` joined #nim |
05:06:47 | * | nisstyre joined #nim |
05:10:42 | * | emery joined #nim |
05:12:57 | * | ox joined #nim |
05:13:43 | * | redj joined #nim |
05:14:14 | * | jfinkhaeuser joined #nim |
05:14:27 | FromDiscord | <aleclarson> Are custom pragmas possible? |
05:15:08 | FromDiscord | <ElegantBeef> Yes |
05:15:44 | FromDiscord | <ElegantBeef> Nim's macros can be used like pragmas, but you can also make annotative pragms by doing `template yourPragma {.pragma.}` |
05:15:45 | * | dom96 joined #nim |
05:15:49 | FromDiscord | <ElegantBeef> (edit) "pragms" => "pragmas" |
05:17:01 | FromDiscord | <ElegantBeef> What type of pragma are you after? |
05:18:08 | FromDiscord | <aleclarson> A pragma that can alter the AST, so i guess `macro` is the way to go? |
05:18:29 | FromDiscord | <ElegantBeef> Well yea but i mean where's the usecase, on a procbody? |
05:18:34 | FromDiscord | <aleclarson> yeah |
05:18:53 | FromDiscord | <ElegantBeef> Then yep a macro will get the proc body and you'll be able to mutate it |
05:19:03 | FromDiscord | <ElegantBeef> I've got many examples of those if you need one, not that they're overly clear 😄 |
05:19:27 | FromDiscord | <aleclarson> haha thx, i'll let you know if i run into any problems \:) |
05:21:42 | FromDiscord | <Rika> ~~`async` is a macro used like a pragma~~ |
05:32:52 | FromDiscord | <emef> is it possible to implement specializations of a generic proc? |
05:32:57 | FromDiscord | <emef> something like this |
05:33:04 | FromDiscord | <emef> sent a code paste, see https://play.nim-lang.org/#ix=3s0s |
05:33:07 | FromDiscord | <ElegantBeef> `T: int32` |
05:33:19 | FromDiscord | <ElegantBeef> then use T elsewhere |
05:33:24 | FromDiscord | <emef> nice |
05:33:24 | FromDiscord | <emef> ty |
05:33:55 | FromDiscord | <saem> There is a sub-type relation hiding in there. |
05:34:11 | FromDiscord | <ElegantBeef> No need to hold that string value inside the object |
05:34:18 | FromDiscord | <ElegantBeef> You can always retrieve that for free |
05:34:31 | FromDiscord | <ElegantBeef> And it makes more sense to do `T: int32 or int64` |
05:34:41 | FromDiscord | <ElegantBeef> Unless you have code that relies on the difference ofc |
05:34:55 | FromDiscord | <emef> yea I do, was just trying to synthesize a simple example |
05:35:43 | FromDiscord | <aleclarson> sent a code paste, see https://play.nim-lang.org/#ix=3s0t |
05:35:51 | FromDiscord | <ElegantBeef> I actually can help here! |
05:35:59 | FromDiscord | <ElegantBeef> With one of those afformentioned examples |
05:36:08 | FromDiscord | <aleclarson> thank the gods |
05:36:43 | FromDiscord | <ElegantBeef> https://github.com/beef331/kashae/blob/master/src/kashae.nim#L113 |
05:37:04 | FromDiscord | <ElegantBeef> It's as simple as that `procBody[3]` is the formal params, so adding a `identDef` will add a new parameter |
05:37:33 | FromDiscord | <aleclarson> hmm, isn't that what my snippet is doing? |
05:37:56 | FromDiscord | <ElegantBeef> You dont set the result |
05:38:07 | FromDiscord | <aleclarson> ahh newb mistake |
05:38:23 | FromDiscord | <ElegantBeef> macros return stuffs, so make it an `: untyped` to make it clear 😄 |
05:38:49 | FromDiscord | <ElegantBeef> Here's me learning there is a params shortcut |
05:38:58 | FromDiscord | <ElegantBeef> What was remembering `[3]` good for then? 😦 |
05:39:12 | FromDiscord | <aleclarson> yay i taught the teacher \:D |
05:39:29 | FromDiscord | <aleclarson> hmm, still not working after adding `: untyped`↵https://play.nim-lang.org/#ix=3s0u |
05:40:18 | FromDiscord | <ElegantBeef> Well this is semantically checked before the macro is ran |
05:40:22 | FromDiscord | <ElegantBeef> So this will never work properly |
05:40:56 | FromDiscord | <aleclarson> ohhhh of course |
05:40:56 | FromDiscord | <ElegantBeef> Anything that is a specific parameter in a macro requires that to be semantically checked |
05:41:08 | FromDiscord | <aleclarson> just used `untyped` instead of proc |
05:41:19 | FromDiscord | <ElegantBeef> So you can make the parameter untyped and then inside make sure you do some checking to ensure it only runs on procs |
05:41:24 | FromDiscord | <ElegantBeef> be it `expectKind` or `assert` |
05:41:28 | FromDiscord | <aleclarson> thx alot |
05:43:34 | FromDiscord | <ElegantBeef> https://play.nim-lang.org/#ix=3s0w for the working version of my suggestion 😄 |
05:44:20 | FromDiscord | <emef> I think what I was looking for is more likely a concept, is that feature fairly stable? (I see it's in the experimental docs) |
05:46:23 | FromDiscord | <ElegantBeef> They're fairly stable imo |
05:47:47 | FromDiscord | <emef> maybe someone has a suggestion on a more elegant way to handle this |
05:47:49 | FromDiscord | <emef> https://github.com/emef/nimarrow#typed-tables |
05:47:52 | fn | <R2D299> itHub: 7"<No Description>" |
05:48:43 | FromDiscord | <emef> I would like to be able call `newTypedBuilter[MyType]()` after running the macro |
05:49:24 | FromDiscord | <emef> rather than use this `TypeTag[MyType]()` to work around it |
05:49:37 | FromDiscord | <emef> (edit) "`newTypedBuilter[MyType]()`" => "`newTypedBuilder[MyType]()`" |
05:52:21 | FromDiscord | <ElegantBeef> declareTypeTable subscribes it somewhere right? |
05:54:24 | FromDiscord | <aleclarson> is there any way to insert a statement at a specific index in a statement list? |
05:54:37 | FromDiscord | <ElegantBeef> `insert 0, yourNimNode` |
05:55:19 | FromDiscord | <ElegantBeef> If it doesnt subscribe presently, you should probably do the subscription in there, and then make `newTypeBuilder` a macro that takes a typedef and checks if it's in the macrocache, if not it throws a compile time error that's helpful |
05:55:25 | FromDiscord | <ElegantBeef> @emef ^ that's for you ofc 😄 |
05:56:14 | FromDiscord | <emef> oh interesting |
05:56:26 | FromDiscord | <ElegantBeef> (edit) "typedef" => "typedesc" |
05:56:33 | FromDiscord | <emef> what is the macrocache |
05:56:37 | FromDiscord | <ElegantBeef> https://nim-lang.github.io/Nim/macrocache.html |
05:56:57 | FromDiscord | <ElegantBeef> It's a cross module cache that's designed to hold nimnodes for things like this |
05:58:58 | FromDiscord | <emef> I'll look into using this instead, I was hoping there was some way to do this without having to explicitly call a macro to generate those functions |
05:59:10 | FromDiscord | <emef> macrocache looks like a good option |
05:59:21 | FromDiscord | <ElegantBeef> Oh that's what you were after |
05:59:51 | FromDiscord | <ElegantBeef> You actually can probably use the macrocache in the concept |
06:00:06 | FromDiscord | <ElegantBeef> Though, that might not work |
06:00:44 | FromDiscord | <ElegantBeef> Now has to test that |
06:00:53 | FromDiscord | <emef> thanks for the tip |
06:00:55 | FromDiscord | <aleclarson> is there a reversed `items` iterator? |
06:01:58 | FromDiscord | <ElegantBeef> Doesnt appear so, probably smart to make your own based off the requirements |
06:02:10 | FromDiscord | <ElegantBeef> Are you destroying/adding to a collection? |
06:03:12 | FromDiscord | <aleclarson> since i'm using `insert` on a NimNode, i decided using `ipairs` works just fine \:) |
06:03:25 | FromDiscord | <aleclarson> no, i'm redefining proc params as let stmts |
06:04:51 | FromDiscord | <ElegantBeef> ipairs? |
06:05:46 | FromDiscord | <aleclarson> whoops, i think that's lua terminology slipping thru \:) |
06:06:17 | FromDiscord | <aleclarson> `for index, param in ast.params:` basically |
06:06:33 | FromDiscord | <ElegantBeef> Ah |
06:06:37 | FromDiscord | <ElegantBeef> so `pairs` |
06:06:45 | FromDiscord | <aleclarson> haha ya |
06:16:28 | FromDiscord | <ElegantBeef> @emef So it does work! 😛 https://play.nim-lang.org/#ix=3s0D |
06:24:06 | FromDiscord | <richard stallmen(crazy GNU guy)> sent a code paste, see https://play.nim-lang.org/#ix=3s0G |
06:24:23 | FromDiscord | <ElegantBeef> No trinary operators |
06:24:54 | FromDiscord | <ElegantBeef> What are you after? |
06:27:48 | * | lucerne quit (Remote host closed the connection) |
06:29:52 | FromDiscord | <richard stallmen(crazy GNU guy)> just checking if 3 vars are equal |
06:29:54 | fn | <Prestige99> Like a == b == c as a conditional? |
06:30:01 | FromDiscord | <richard stallmen(crazy GNU guy)> yes |
06:30:55 | fn | <Prestige99> I would just do a == b and b == c |
06:32:09 | FromDiscord | <richard stallmen(crazy GNU guy)> but there are 9 variables lol, thats big |
06:32:17 | FromDiscord | <richard stallmen(crazy GNU guy)> anyways , thanks |
06:32:24 | FromDiscord | <ElegantBeef> well we can do better |
06:32:31 | FromDiscord | <ElegantBeef> https://play.nim-lang.org/#ix=3s0J 😄 |
06:32:56 | FromDiscord | <ElegantBeef> But if you're comparing 9 things might be doing something wrong |
06:33:41 | fn | <Prestige99> There may be an array iterator that exists that you could do this with, without writing something new |
06:33:59 | FromDiscord | <haxscramper> In reply to @richard stallmen(crazy GNU guy) "but there are 9": You can compare tuples |
06:34:01 | FromDiscord | <richard stallmen(crazy GNU guy)> sent a code paste, see https://play.nim-lang.org/#ix=3s0K |
06:34:19 | FromDiscord | <haxscramper> Or you need all of them equal 5o each other? |
06:35:11 | fn | <Prestige99> sequtils.allIt might be a good choice |
06:35:21 | FromDiscord | <ElegantBeef> Well if it's a sequence already |
06:35:35 | FromDiscord | <ElegantBeef> But this just seems odd |
06:35:38 | FromDiscord | <richard stallmen(crazy GNU guy)> like all of them if they are equal |
06:35:46 | FromDiscord | <ElegantBeef> Can we see more of the code? |
06:35:50 | FromDiscord | <richard stallmen(crazy GNU guy)> ok |
06:36:20 | FromDiscord | <richard stallmen(crazy GNU guy)> sent a code paste, see https://play.nim-lang.org/#ix=3s0L |
06:37:15 | FromDiscord | <ElegantBeef> Seems like you could use a vector here and that'd make the comparison simpler |
06:37:38 | FromDiscord | <richard stallmen(crazy GNU guy)> [nūb here] |
06:37:42 | FromDiscord | <ElegantBeef> Eh might be speaking out my arse |
06:38:26 | FromDiscord | <ElegantBeef> Dont know why speaking out one's ass invokes germany, but ok 😄 |
06:50:24 | FromDiscord | <richard stallmen(crazy GNU guy)> sent a code paste, see https://play.nim-lang.org/#ix=3s0N |
06:50:50 | FromDiscord | <richard stallmen(crazy GNU guy)> thanks guys |
06:53:38 | * | max22- joined #nim |
07:00:49 | * | PMunch joined #nim |
07:27:25 | FromDiscord | <Rika> There are better ways to do this but you need a lot of transforms |
07:27:40 | FromDiscord | <Rika> Might be a good idea to look at other matrix libraries? |
07:36:17 | * | Schnouki joined #nim |
07:36:26 | * | Oddmonger quit (Changing host) |
07:36:26 | * | Oddmonger joined #nim |
07:37:03 | FromDiscord | <hamidb80> hey |
07:38:01 | FromDiscord | <hamidb80> https://play.nim-lang.org/#ix=3s0V |
07:38:41 | FromDiscord | <hamidb80> it says my functions have to be `{.closure.}` |
07:40:15 | FromDiscord | <hamidb80> and i don't know what the problem is |
07:40:27 | FromDiscord | <hamidb80> i tried to add {.closure.} pragma to my functions |
07:41:12 | FromDiscord | <hamidb80> but it introduce me into another error:↵> Error: '.closure' calling convention for top level routines is invalid |
07:46:12 | FromDiscord | <hamidb80> new edit↵https://play.nim-lang.org/#ix=3s10 |
07:47:00 | FromDiscord | <ElegantBeef> `func` presently cannot be used in type defnitions you need to use `proc{.noSideEffect.}` |
07:48:56 | FromDiscord | <hamidb80> > Error: type mismatch: got <seq[proc (a: int): int{.noSideEffect, gcsafe, locks: 0.}]> but expected 'seq[proc (t: int): int{.closure, noSideEffect.}]' |
07:49:21 | FromDiscord | <ElegantBeef> Yep type defs default to `proc{.closure.}` |
07:49:29 | FromDiscord | <ElegantBeef> so you need to do `proc{.nimcall.}` |
07:49:41 | FromDiscord | <ElegantBeef> https://play.nim-lang.org/#ix=3s11 as such |
07:51:00 | FromDiscord | <ElegantBeef> https://nim-lang.org/docs/manual.html#types-procedural-type talked about here |
07:51:12 | FromDiscord | <hamidb80> thank u |
07:51:23 | FromDiscord | <hamidb80> i should read manual again |
07:52:05 | FromDiscord | <hamidb80> (edit) "i should read ... manual" added "the whole" |
07:54:14 | * | Vladar joined #nim |
07:57:43 | FromDiscord | <Rika> Well I think the confusion is that you need closure to store a proc or to use a proc as a first class member |
07:57:55 | FromDiscord | <Rika> I’m pretty sure you don’t |
08:00:23 | FromDiscord | <ElegantBeef> You do not need a closure, you just need to annotate with nimcall |
08:05:16 | FromDiscord | <hamidb80> can a seq store both `{.nimcall.}` and `{.closure.}`? |
08:05:40 | FromDiscord | <hamidb80> or i need to create a object? |
08:06:18 | FromDiscord | <hamidb80> type object:↵ case kind:..↵ of closureType:↵ of nimCallTyep |
08:06:24 | FromDiscord | <ElegantBeef> Yea you need to box them |
08:06:36 | * | wan joined #nim |
08:06:38 | FromDiscord | <ElegantBeef> They're not homogenous |
08:06:58 | FromDiscord | <hamidb80> tnks |
08:07:51 | FromDiscord | <ElegantBeef> It's annoying with many procedures |
08:08:30 | FromDiscord | <ElegantBeef> was meaning to test/support this with my object variant generator but forgot to |
08:10:32 | FromDiscord | <ElegantBeef> oh yea it works it's just tedious to use |
08:14:21 | * | wan quit (Quit: WeeChat 3.2) |
09:31:38 | * | arkanoid quit (Quit: WeeChat 2.8) |
09:38:26 | fn | <ForumUpdaterBot99> New thread by Neodim: Nim library for stream video processing?, see https://forum.nim-lang.org/t/8199 |
09:57:42 | * | emery quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
09:58:41 | * | emery joined #nim |
10:05:28 | * | max22- quit (Remote host closed the connection) |
10:06:01 | * | max22- joined #nim |
10:17:08 | * | emery quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
10:17:35 | * | emery joined #nim |
10:32:02 | * | neceve joined #nim |
10:33:37 | * | xet7 joined #nim |
10:53:05 | FromDiscord | <hamidb80> hey |
10:53:31 | FromDiscord | <hamidb80> i'm looking for a nimble package for making ascii tables |
10:54:42 | FromDiscord | <hamidb80> (edit) "for making" => "to print" | "to printascii tables ... " added "in console" |
11:02:33 | FromDiscord | <hamidb80> something like this https://www.npmjs.com/package/cli-table-redemption |
11:03:15 | FromDiscord | <hamidb80> found it https://github.com/xmonader/nim-terminaltables |
11:03:18 | fn | <R2D299> itHub: 7"terminal tables for nim" |
11:23:51 | FromDiscord | <haxscramper> What do you think about `..` also supporting countdown? I wanted to write RFC on that but I guess that's too minor thing for full RFC |
11:24:12 | FromDiscord | <haxscramper> I mean change `..` so that would work |
11:24:13 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3s1T |
11:24:34 | FromDiscord | <haxscramper> Or at least give an errors if range elements are reversed instead of silently iterating zero times |
11:27:15 | FromDiscord | <vindaar> I agree. The one case where implicit countdown might be problematic is if runtime values are used. It may not be obvious what's going on if accidentally (larger, smaller) pairs are passed |
11:28:21 | FromDiscord | <haxscramper> so you mean to introduce `iterator ..(a, b: static[int])`? |
11:28:34 | FromDiscord | <haxscramper> that would work with countdowns, otherwise don't change anything |
11:32:08 | FromDiscord | <Rika> In reply to @haxscramper "What do you think": some code might rely on `a..b` not counting for a > b |
11:32:23 | FromDiscord | <vindaar> a fully static one like you mentioned would be neat anyway (but will probably be refused due to "too much bloat) |
11:32:23 | FromDiscord | <vindaar> I mainly just realized that it's not obvious to me what the best solution is, hehe |
11:32:23 | FromDiscord | <Zoom> Hate to be that guy, but. @richard stallmen(crazy GNU guy)\: could you please change your nick? It's not very funny and is actually vilifying. |
11:32:24 | FromDiscord | <Rika> but i think they should get bug fixes instead |
11:32:27 | FromDiscord | <vindaar> yup |
11:32:54 | FromDiscord | <vindaar> not sure. In a way it's totally fine behavior, no? |
11:33:05 | FromDiscord | <Rika> teeeeechnically yeah |
11:33:34 | FromDiscord | <Rika> but it might be unintentional too |
11:33:58 | FromDiscord | <Rika> well |
11:34:00 | FromDiscord | <Rika> no never mind |
11:34:07 | FromDiscord | <Rika> most of the time its intentional yeah |
11:34:42 | FromDiscord | <haxscramper> well, I meant this |
11:34:43 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3s1W |
11:34:43 | FromDiscord | <vindaar> what I mean is\: it's quite common to write something like `for a in x`, which by intent is supposed to do nothing if `x` has no length. Under certain circumstances that might be extended to a `for i in x .. y` case instead |
11:34:58 | FromDiscord | <haxscramper> since it's too ambiguous |
11:35:08 | FromDiscord | <haxscramper> I'm just going to write `...` for myself or something like that |
11:35:36 | FromDiscord | <vindaar> for statics I don't see any downside to it, so I'd be in favor of that |
11:35:51 | FromDiscord | <vindaar> raising in the runtime case is problematic for the reason I just mentioned |
11:36:13 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3s1X |
11:36:57 | FromDiscord | <Rika> In reply to @vindaar "what I mean is\:": yes i was thinking of that |
11:38:43 | FromDiscord | <haxscramper> Cps uses `...` |
11:39:50 | FromDiscord | <haxscramper> Also it's in the `system`, so I guess it would be easier to not even think about touching that part |
11:40:18 | FromDiscord | <haxscramper> Araq probably has better use for his time then to argue against another crap creeping into `system.nim` |
11:40:34 | FromDiscord | <vindaar> yup, that was on my mind too |
11:42:29 | FromDiscord | <Zoom> Good day everyone! A little question. I'd like to shift a slice of an array left (doesn't matter what happens with the shifted slots). Does HSlice assignment just makes a dumb copy in a loop? What's the right approach here? `copyMem`/`moveMem`? |
11:44:32 | FromDiscord | <vindaar> you mean for an actual `array`? Imo it really depends on what you need. Under certain use cases you may be fine with a `toOpenArray(myArray, N, myArray.len - N)` |
11:45:13 | FromDiscord | <Zoom> Nope, I don't need to do anything besides shifting elements. Just wanted to optimize a bit and not do it one by one |
11:45:24 | FromDiscord | <Zoom> And yes, I'm talking about actual array |
11:47:05 | FromDiscord | <vindaar> So the length of the array should remain unchanged then (that's what you mean by shifted slots don't matter?) |
11:47:29 | FromDiscord | <Zoom> Of course, it's an array, the length doesn't change \:) |
11:47:52 | FromDiscord | <vindaar> you might want to have a statically different array as a result though ;) |
11:48:50 | FromDiscord | <vindaar> I think then you have to copy. An array is just essentially `ptr UncheckedArray[T]`. You need to move those numbers somehow. |
11:48:58 | FromDiscord | <Zoom> That's not what I asked though \:) But thanks for double checking my intent |
11:49:34 | FromDiscord | <Zoom> That was for the previous msg of yours |
11:50:10 | FromDiscord | <Zoom> I think I need moveMem, just was checking if I skipped something that is already there |
11:50:45 | FromDiscord | <richard stallmen(crazy GNU guy)> In reply to @Zoom "Hate to be *that*": :[ ok |
12:06:02 | * | supakeen quit (Quit: WeeChat 3.2) |
12:06:37 | * | supakeen joined #nim |
12:08:39 | FromDiscord | <Zoom> To follow up on my question. Is there a reason `a[i..j] = a[i+n..j+n]` couldn't use `moveMem`? |
12:23:12 | * | arkurious joined #nim |
12:26:10 | FromDiscord | <talaing> sent a code paste, see https://paste.rs/fLF |
12:26:19 | FromDiscord | <talaing> (edit) "https://play.nim-lang.org/#ix=3s29" => "https://play.nim-lang.org/#ix=3s28" |
12:27:23 | * | PMunch quit (Quit: leaving) |
12:27:44 | FromDiscord | <talaing> sent a code paste, see https://play.nim-lang.org/#ix=3s2a |
12:29:29 | FromDiscord | <Rika> use a tuple |
12:29:49 | FromDiscord | <Rika> `Thread[tuple[a: Socket, b: string]]` |
12:30:02 | FromDiscord | <talaing> Thanks, I'll try it out in a moment 🙂 |
12:30:12 | FromDiscord | <Rika> you're actually technically already using one |
12:30:22 | FromDiscord | <Rika> in `thr.createThread(doWork, (socks[i], "HelloWorld"))` you use a tuple |
12:30:31 | FromDiscord | <Rika> doWork needs to be changed too |
12:30:36 | FromDiscord | <konsumlamm> or just `Thread[(Socket, string)]` if you don't want to name the parameters |
12:31:25 | FromDiscord | <Rika> sent a code paste, see https://play.nim-lang.org/#ix=3s2d |
12:35:53 | FromDiscord | <talaing> Works perfectly, thanks! |
12:41:01 | * | Torro joined #nim |
13:10:58 | FromDiscord | <⃟⃟> does the `..` syntax for ranges have a way of specifying a step amount? |
13:11:21 | FromDiscord | <arnetheduck> In reply to @haxscramper "**ALLOW `ITERATOR `..`*(A, B:": whatever you end up with, it will ideally be as consistent as is possible with https://github.com/nim-lang/Nim/issues/16492 |
13:11:48 | FromDiscord | <hugogranstrom> In reply to @⃟⃟ "does the `..` syntax": Don't think so, you have to use the `countup` iterator for steps |
13:12:07 | FromDiscord | <hugogranstrom> `for i in countup(start, stop, step)` |
13:14:51 | FromDiscord | <⃟⃟> !eval echo countup(1,10) |
13:14:53 | NimBot | Compile failed: /usercode/in.nim(1, 13) Error: attempting to call routine: 'countup' |
13:16:33 | FromDiscord | <haxscramper> In reply to @arnetheduck "whatever you end up": I think in the end I won't do anything. Maybe write `...` for myself |
13:16:43 | FromDiscord | <haxscramper> certainly not going to push it in stdlib |
13:17:06 | FromDiscord | <haxscramper> Right now I'm more focused on my nimble RFC, this was almost random idea |
13:21:38 | FromDiscord | <hugogranstrom> In reply to @⃟⃟ "!eval echo countup(1,10)": `countup` is an iterator so you can't just print it, you have to loop over it like this: |
13:22:00 | FromDiscord | <hugogranstrom> https://play.nim-lang.org/#ix=3s2n |
13:22:11 | FromDiscord | <dom96> !eval import sequtils; echo(toSeq(countup(1,10)) |
13:22:13 | NimBot | Compile failed: /usercode/in.nim(1, 43) Error: expected: ')', but got: '[EOF]' |
13:22:24 | FromDiscord | <dom96> !eval import sequtils; echo(toSeq(countup(1,10))) |
13:22:26 | NimBot | @[1, 2, 3, 4, 5, 6, 7, 8, 9, 10] |
13:23:01 | FromDiscord | <⃟⃟> !eval for i in countup(0.5, 10.5): echo i |
13:23:03 | NimBot | Compile failed: /playground/nim/lib/system/iterators_1.nim(64, 12) Error: type mismatch: got <float64, Positive> |
13:23:11 | FromDiscord | <⃟⃟> ?? |
13:23:18 | FromDiscord | <hugogranstrom> You used floats |
13:23:23 | FromDiscord | <hugogranstrom> It can only handle ints |
13:23:42 | FromDiscord | <hugogranstrom> You can't do `0.5 .. 10.5` for that matter either |
13:24:32 | FromDiscord | <hugogranstrom> If you want floats you need to either write a custom version yourself or find someone else who has written it |
13:25:04 | FromDiscord | <hugogranstrom> `arange` is a good search term used for this when working with floats |
13:25:25 | FromDiscord | <⃟⃟> in the documentation it looked like it would handle other types cause i thought it uses generics |
13:25:35 | FromDiscord | <hugogranstrom> Link? |
13:26:34 | FromDiscord | <⃟⃟> i closed it |
13:26:46 | FromDiscord | <hugogranstrom> Ok found it. `T may be any ordinal type, step may only be positive.` |
13:27:06 | FromDiscord | <hugogranstrom> It is generic but `T` must be ordinal, and floats are not ordinal |
13:27:27 | FromDiscord | <hugogranstrom> You can't say "what is the next real number after 1.0" for example |
13:27:45 | FromDiscord | <Rika> ~~technically it exists for floats but that's besides the point~~ |
13:27:46 | FromDiscord | <⃟⃟> if i made a fraction type would it work with this |
13:27:53 | FromDiscord | <Rika> you would have to prove it was ordinal |
13:28:03 | FromDiscord | <Rika> or rather it would need to be included in waht nim considers ordinal |
13:28:13 | FromDiscord | <Rika> which is not a concept i believe |
13:28:14 | FromDiscord | <Rika> so no |
13:28:32 | FromDiscord | <hugogranstrom> In reply to @⃟⃟ "if i made a": Probably not, same thing there. There is no "next fraction" either |
13:28:45 | FromDiscord | <⃟⃟> there would be |
13:29:01 | FromDiscord | <⃟⃟> if the type is exact |
13:29:14 | FromDiscord | <hugogranstrom> Which is the next fraction after 234/13 |
13:29:41 | FromDiscord | <⃟⃟> it depends on the step amount |
13:29:54 | FromDiscord | <⃟⃟> 19/1 |
13:30:00 | * | nisstyre quit (Changing host) |
13:30:00 | * | nisstyre joined #nim |
13:30:03 | FromDiscord | <⃟⃟> if its a step by 1 |
13:30:31 | FromDiscord | <arnetheduck> In reply to @dom96 "!eval import sequtils; echo(toSeq(countup(1,10))": this... allocates the entire thing in memory, zero-initializes it, writes the values of the iterator to the seq then walks the seq. |
13:30:49 | FromDiscord | <hugogranstrom> In reply to @⃟⃟ "it depends on the": No that's besides the point, if it is ordinal it doesn't matter what step we use. There should be an obvious before and after |
13:30:56 | FromDiscord | <hugogranstrom> 1, 2, 3, 4, 5, 6 |
13:31:01 | FromDiscord | <hugogranstrom> a, b, c, d, e, f |
13:31:26 | FromDiscord | <⃟⃟> well i dont know what this thing means exactly |
13:31:29 | FromDiscord | <hugogranstrom> Once you have this list you can start taking steps, but you must know the list beforehand |
13:31:32 | FromDiscord | <⃟⃟> but why it has this restriction |
13:33:32 | FromDiscord | <hugogranstrom> I guess it's because `countup` doesn't just do a loop where it `+= 1`, it rather takes an ordinal and gives you every value between `start` and `stop`. For example if you defined an enum |
13:35:13 | FromDiscord | <hugogranstrom> sent a code paste, see https://play.nim-lang.org/#ix=3s2t |
13:35:18 | FromDiscord | <hugogranstrom> This will count up from `Left` to `Down` |
13:35:44 | fn | <ForumUpdaterBot99> New thread by LemongrabThree: Can a Heap Object Get GC'ed Even Though It's Pointed to??, see https://forum.nim-lang.org/t/8200 |
13:36:04 | FromDiscord | <⃟⃟> are enum numbers? |
13:36:12 | FromDiscord | <Rika> no, theyre ordinals |
13:37:08 | FromDiscord | <⃟⃟> also |
13:37:27 | FromDiscord | <⃟⃟> the step amount is this "positive" type right |
13:37:28 | FromDiscord | <⃟⃟> what is that |
13:38:08 | FromDiscord | <hugogranstrom> https://nim-lang.org/docs/system.html#Positive |
13:38:21 | FromDiscord | <⃟⃟> wait |
13:38:21 | FromDiscord | <hugogranstrom> `Positive = range[1 .. high(int)]` it's just a range |
13:38:36 | FromDiscord | <⃟⃟> so the range is generic |
13:38:47 | FromDiscord | <⃟⃟> but the step amount is not? |
13:39:47 | FromDiscord | <hugogranstrom> Indeed, because we are dealing with ordinals which must have a first element, and one following it and so on. |
13:40:19 | FromDiscord | <⃟⃟> but wouldnt a big int also fit that? |
13:40:54 | FromDiscord | <hugogranstrom> A bigint would fit that, the problem is telling the compiler that a `bigint` is in fact ordinal |
13:41:01 | FromDiscord | <hugogranstrom> Not sure if it's possible |
13:41:04 | * | greyrat quit (Quit: Bye) |
13:41:49 | FromDiscord | <hugogranstrom> https://nim-lang.org/docs/system.html#Ordinal |
13:41:52 | FromDiscord | <⃟⃟> is there a range function that does not have this requirement |
13:42:07 | FromDiscord | <Rika> no |
13:42:20 | FromDiscord | <Rika> nim is a very "make your own" language pretty much |
13:42:32 | FromDiscord | <Rika> or look for it in a 3rd party lib |
13:43:09 | FromDiscord | <hugogranstrom> Here's my impl of `arange` if you want to look how it could look: https://github.com/HugoGranstrom/numericalnim/blob/43a1ea309e4b2508dbc62051f16ea9e078f656ff/src/numericalnim/utils.nim#L322 |
13:44:01 | * | greyrat joined #nim |
13:45:04 | * | lucerne joined #nim |
13:51:15 | FromDiscord | <⃟⃟> what does the `` mean |
13:51:26 | FromDiscord | <⃟⃟> like after a function name |
13:51:32 | FromDiscord | <Rika> export |
13:51:38 | FromDiscord | <Rika> public access modifier |
13:52:07 | FromDiscord | <haxscramper> saem\: the numbers were a little (3x times actually), now I did proper analysis based on full manifests parsing |
13:52:15 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3s2H |
13:52:40 | FromDiscord | <haxscramper> So `bin = ` ('canonical') was specified 362 times |
13:54:00 | FromDiscord | <haxscramper> Though I'm still kind of suspicious of some numbers here |
13:57:19 | FromDiscord | <dom96> what are you looking for in your analysis? |
13:58:39 | FromDiscord | <haxscramper> how different metadata is specified |
13:59:00 | FromDiscord | <haxscramper> toplevel/nested in `task`, argument types |
13:59:36 | FromDiscord | <dom96> what does canon vs ident vs spec mean? |
14:00:02 | FromDiscord | <haxscramper> canonical means "canonical" as described in the RFC - `requires "string literal"`, or `author = "string literal"` |
14:00:12 | FromDiscord | <haxscramper> ident means that instead of a string literal identifier was used |
14:00:20 | FromDiscord | <haxscramper> `include common.nim` |
14:00:29 | FromDiscord | <haxscramper> `version = appVersion` |
14:00:52 | FromDiscord | <haxscramper> special means "special" - idk what exactly, just none of the above |
14:01:16 | FromDiscord | <haxscramper> for `bin` and other lists canonical means `@["string literal", "string literal"]` |
14:01:33 | FromDiscord | <haxscramper> I've seen `namedBin[] = ` in somec packages |
14:01:50 | FromDiscord | <haxscramper> Need to account for that one |
14:02:18 | FromDiscord | <dom96> cool, looks like there isn't much stopping us from making these values static |
14:02:24 | FromDiscord | <dom96> (edit) "values" => "fields" |
14:02:35 | FromDiscord | <haxscramper> yes |
14:03:12 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3s2M |
14:03:17 | FromDiscord | <haxscramper> Still does not exactly match with other `requires` metric |
14:03:27 | FromDiscord | <dom96> I wonder what the special there is |
14:03:38 | FromDiscord | <dom96> nested I'm guessing is `when defined(windows)` |
14:03:57 | FromDiscord | <haxscramper> any non-toplevel |
14:04:04 | FromDiscord | <haxscramper> but I need to differentialte between these cases |
14:04:06 | FromDiscord | <haxscramper> good idea |
14:04:12 | FromDiscord | <haxscramper> `when defined()` is a special case |
14:18:50 | FromDiscord | <haxscramper> Is it possible to really enforce compile-time evaluation of a procedure where all parameters are `static[]`? |
14:19:41 | FromDiscord | <Rika> only when pure |
14:19:48 | * | rockcavera joined #nim |
14:19:48 | * | rockcavera quit (Changing host) |
14:19:48 | * | rockcavera joined #nim |
14:20:16 | FromDiscord | <Rika> and if it's recursive, most likely not |
14:20:40 | FromDiscord | <Rika> (you can try but you might hit limits or whatsoever) |
14:22:25 | FromDiscord | <TennisBowling> does `httpclient` support `async`? I see that `puppy` won't |
14:25:07 | FromDiscord | <dom96> it disappoints me that I cannot do this: ``{.emit: staticRead("fonts/nim_compat.h").}`` |
14:26:19 | FromDiscord | <arnetheduck> In reply to @TennisBowling "does `httpclient` support `async`?": https://forum.nim-lang.org/t/7964#52137 might be useful for that |
14:26:47 | FromDiscord | <TennisBowling> arne! thanks |
14:28:30 | * | xet7 quit (Remote host closed the connection) |
14:29:59 | FromDiscord | <dom96> In reply to @TennisBowling "does `httpclient` support `async`?": yep: https://nim-lang.org/docs/httpclient.html#retrieving-a-website |
14:30:27 | FromDiscord | <TennisBowling> and with `httpclient` you need to ship openssl right? |
14:30:35 | FromDiscord | <TennisBowling> I see that chronos you don't need to |
14:37:06 | * | blackbeard420_ quit (Quit: ZNC 1.8.2 - https://znc.in) |
14:37:26 | * | blackbeard420 joined #nim |
14:41:40 | FromDiscord | <dom96> In reply to @TennisBowling "and with `httpclient` you": yeah, you will need to unless you statically link openssl |
14:42:55 | * | arkanoid joined #nim |
14:46:08 | * | ox is now known as oz |
14:47:53 | fn | <ForumUpdaterBot99> New thread by NameUndefined: Unable to create a flowVar, see https://forum.nim-lang.org/t/8201 |
14:49:30 | FromDiscord | <haxscramper> matrix -\> discord bridge sure have a lot of lag |
14:49:37 | FromDiscord | <Zoom> Eh, how can I specify an array of Natural? Is there a literal? Need this for tests. |
14:49:39 | FromDiscord | <haxscramper> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/861619808536756236): matrix -\> discord bridge sure has a lot of lag |
14:50:03 | FromDiscord | <haxscramper> `array[10, Natural]` |
14:50:22 | FromDiscord | <haxscramper> There is no `Natural` literal since `1` is already occupied by integer |
14:50:24 | FromDiscord | <dom96> Yep, that's why you should come back to Discord 🙂 |
14:50:35 | FromDiscord | <haxscramper> it has message limit |
14:50:51 | FromDiscord | <haxscramper> and it seems like the message simply does not go through |
14:51:27 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3s2U |
14:51:28 | FromDiscord | <Zoom> I meant not only declare, but assign a value without looping |
14:51:58 | FromDiscord | <haxscramper> In reply to @dom96 "Yep, that's why you": and I just happened to like matrix |
14:52:03 | FromDiscord | <haxscramper> it allows monspaced ui |
14:52:49 | FromDiscord | <dom96> what's a "monospaced ui"? |
14:53:03 | FromDiscord | <haxscramper> `var ar: array[2, Natural] = [1.Natural, 2]` |
14:53:07 | FromDiscord | <haxscramper> monospaced text in UI↵(@dom96) |
14:53:20 | FromDiscord | <Zoom> Ah, dot! Thanks! |
14:53:50 | FromDiscord | <Zoom> Oops, missed the message to reply to. |
14:53:59 | FromDiscord | <haxscramper> and also has open API and several differnt clients↵(@dom96) |
14:55:50 | FromDiscord | <dom96> can't you change the font discord uses to a monospace one? |
14:55:59 | FromDiscord | <haxscramper> Anyway, I cut out `other` section for the table, but otherwise it seems like `requires` is almost always used on |
14:56:17 | FromDiscord | <haxscramper> on toplevel and, inside when it happened 44 times total, |
14:56:58 | FromDiscord | <haxscramper> Strangely enough all uses for requires in tasks happened using "special" syntax |
14:57:14 | FromDiscord | <haxscramper> But it is almost universally `requires: "pacakge >= 123"` |
14:57:47 | FromDiscord | <haxscramper> So I assume large portion of these packages are written by the same person |
15:09:47 | FromDiscord | <Rika> discord is only monospace when using code blocks/segments, otherwise no |
15:11:44 | FromDiscord | <System64 ~ Flandre Scarlet> Hello! Is SDL2 nice for sound output? |
15:12:59 | FromDiscord | <haxscramper> Updated the RFC. I also thought about making top-level completely static, something like a makefile. You write some variables, requires, then declare different tasks or hooks |
15:13:16 | FromDiscord | <haxscramper> And task/hook body is mapped to a nimscript code |
15:13:55 | FromDiscord | <haxscramper> Almost the same approach as we do now, though with interdependent tasks |
15:14:22 | FromDiscord | <haxscramper> Not on this iteration of nimble, but the idea looks nice |
15:18:38 | FromDiscord | <dom96> isn't making top-level completely static the real idea proposed? 🙂 |
15:21:37 | FromDiscord | <haxscramper> Right now you can place some code at top-level and it would run each time package is parsed |
15:22:03 | FromDiscord | <haxscramper> And I didn't say anything in the RFC about completely removing this functionality |
15:24:04 | FromDiscord | <haxscramper> Also, there are some values, specifically for installation/build purposes that might be set up in the tasks, or collected through some code that iterates over project files |
15:24:09 | FromDiscord | <dom96> I see, reading what you wrote to me implied this was the idea |
15:24:31 | FromDiscord | <dom96> why not do it this way though? |
15:24:38 | FromDiscord | <dom96> is it because of `when defined(windows)`? |
15:25:22 | FromDiscord | <haxscramper> Ideally yes |
15:25:23 | FromDiscord | <haxscramper> No, that can be evaluated statically. I'm just not sure how much this would break now, I need to get more statis |
15:25:24 | FromDiscord | <haxscramper> Stats\ |
15:25:51 | FromDiscord | <haxscramper> But ultimately, if I get numbers that say it is relatively safe to do so, nothing would really stop us |
15:27:01 | FromDiscord | <dom96> I was expecting cargo to have a nice syntax for this, but nah: https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#platform-specific-dependencies |
15:27:10 | FromDiscord | <haxscramper> Saem and Arne might have stronger arguments in favor of fully purging imperative code from top-level, I personally just want to make sure we are not hang up in the intermediate state when something is guaranteed to be static and something is not |
15:27:12 | FromDiscord | <dom96> I very much prefer `when ...` even if it means we need to parse it |
15:28:47 | FromDiscord | <haxscramper> This is not really hard to implement, I can do a POC implementation when we finalize what we want |
15:29:38 | FromDiscord | <dom96> I've also been thinking about purging imperative code from the top-level for a while now |
15:30:30 | FromDiscord | <dom96> not needing to depend on the Nim compiler for this would be nice |
15:31:22 | FromDiscord | <dom96> (although it's important to note that with `when` the syntax will be complex enough that it won't be trivial for third-party tools to parse it and so in the end they will likely need to depend on Nimble or Nimble's parser anyway) |
15:31:32 | FromDiscord | <haxscramper> Yes. Most of the dependency resolution stuff can be done using only PNode parser (we would still have to import compiler/parser, but that is inevitable unless we redo format from scratch) |
15:32:01 | FromDiscord | <haxscramper> And when you need to execute code, there is nothing wrong (or nothing can be done really) with using compiler |
15:32:42 | FromDiscord | <haxscramper> Yes, this should be exposed in the nimble API↵(@dom96) |
15:32:48 | FromDiscord | <haxscramper> Nim library API from nimblepkg |
15:33:27 | FromDiscord | <haxscramper> The compiler package is quite good, and it would make sense to have something like this for nimble as well |
15:34:40 | * | stkrdknmibalz quit (Quit: WeeChat 3.0.1) |
15:34:52 | FromDiscord | <exelotl> In reply to @System64 "Hello! Is SDL2 nice": Yes, if you want to write your own mixer |
15:35:11 | FromDiscord | <exelotl> or synth or player or whatever |
15:35:17 | FromDiscord | <dom96> In reply to @haxscramper "The compiler package is": for what it's worth, this stuff is already exposed in likely a very similar manner as the compiler API |
15:36:41 | FromDiscord | <dom96> the API is pretty good IMO: https://github.com/nim-lang/nimble/blob/master/src/nimblepkg/packageparser.nim#L424 |
15:41:17 | FromDiscord | <haxscramper> It does not support logging redirection (compiler has structuredErrorHook) and I had to turn off messages twice so it wouldn't log things. Also version type is not semversion but a string which is kind of strange. Otherwise it is pretty usable↵(@dom96) |
15:41:32 | FromDiscord | <haxscramper> Had to rewrite resolution from scratch to use it in haxdoc |
15:41:40 | FromDiscord | <haxscramper> But I mention this in RFC |
15:42:24 | FromDiscord | <haxscramper> And package parser as well, for both types. Don't remember what was wrong with cfg, but for nims I used PNode scanner |
15:42:26 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @exelotl "Yes, if you want": I use the callback to play the music but I still don't have SFX |
15:43:34 | FromDiscord | <dom96> good point about logging. Why'd you need to rewrite resolution? also what does haxdoc use nimble's APIs for? |
15:44:12 | FromDiscord | <haxscramper> I need to get dependency list, and in nimble it is mixed with download/install stages |
15:44:26 | FromDiscord | <haxscramper> And this was not configurable even at code level |
15:45:34 | FromDiscord | <dom96> yeah, there isn't really another way to do it in Nimble unfortunately |
15:45:50 | FromDiscord | <haxscramper> There should be |
15:45:59 | FromDiscord | <haxscramper> With full package registry I mean |
15:46:19 | FromDiscord | <dom96> of course |
15:51:29 | FromDiscord | <exelotl> In reply to @System64 "I use the callback": if you want music and sfx at the same time you have to mix them yourself - for example introduce a "channel" type where each channel has a source (song or sound effect) and a procedure to mix samples from the source into the output buffer (`output[i] += source[j] channelVol`) |
15:56:51 | FromDiscord | <System64 ~ Flandre Scarlet> wow seems complex |
15:59:48 | FromDiscord | <System64 ~ Flandre Scarlet> isn't there a risk of clipping? |
16:00:37 | * | neceve quit (Ping timeout: 246 seconds) |
16:01:07 | * | Torro quit (Quit: leaving) |
16:07:18 | FromDiscord | <aleclarson> is there a way to print the entire tree of a `NimNode` for inspection? |
16:07:56 | FromDiscord | <aleclarson> oh nvm found it: `astGenRepr` |
16:08:37 | FromDiscord | <System64 ~ Flandre Scarlet> > output[i] += source[j] channelVol↵it's for nim right? |
16:14:07 | FromDiscord | <exelotl> just psuedocode to demonstrate the concept |
16:17:18 | FromDiscord | <exelotl> and yeah clipping is a risk, you're best off mixing into a floating point buffer then multiply my the master volume and apply limiting (clamp between -1.0 and 1.0) to the buffer once everything is mixed |
16:17:49 | * | pro joined #nim |
16:20:51 | * | stkrdknmibalz joined #nim |
16:21:03 | FromDiscord | <System64 ~ Flandre Scarlet> isn't it CPU heavy? |
16:27:39 | FromDiscord | <System64 ~ Flandre Scarlet> and the thing is the lib that generates the sound outputs 16-bits sound |
16:28:22 | FromDiscord | <leorize> you should use treeRepr as it has less visual clutter↵(@aleclarson) |
16:32:16 | FromDiscord | <aleclarson> nice \:) |
16:35:51 | * | pro quit (Quit: WeeChat 3.2) |
16:37:12 | * | pro joined #nim |
16:42:23 | FromDiscord | <exelotl> In reply to @System64 "and the thing is": ah I guess you can mix 16-bit samples into a 32-bit buffer and still be able to multiply and clamp the output when converting it back to 16-bits (assuming SDL is doing 16-bit output) |
16:42:45 | FromDiscord | <exelotl> basic mixing likely won't be too CPU heavy |
16:43:46 | FromDiscord | <exelotl> if you wanna do some fancy stuff like EQ and reverb, that's when things can start to get intensive |
17:01:49 | FromDiscord | <System64 ~ Flandre Scarlet> I'll try that |
17:05:15 | * | vicfred joined #nim |
17:06:47 | * | vicfred quit (Remote host closed the connection) |
17:07:54 | * | vicfred joined #nim |
17:22:36 | * | neceve joined #nim |
17:26:15 | FromDiscord | <aleclarson> how do i re-export? |
17:27:00 | FromDiscord | <aleclarson> sent a code paste, see https://play.nim-lang.org/#ix=3s3B |
17:27:38 | FromDiscord | <Rika> ? have you tried it? |
17:28:09 | FromDiscord | <aleclarson> r u saying my guess is correct? lol |
17:28:42 | FromDiscord | <Rika> yes |
17:28:47 | FromDiscord | <Rika> im pretty sure that is correct |
17:29:44 | FromDiscord | <aleclarson> well that's a nice surprise. intuitive syntax \:) |
17:29:56 | FromDiscord | <aleclarson> what about re-exporting an entire module? |
17:30:07 | fn | <Prestige99> works the same way |
17:30:12 | fn | <Prestige99> import foo export foo |
17:30:54 | FromDiscord | <aleclarson> sent a code paste, see https://play.nim-lang.org/#ix=3s3F |
17:31:14 | FromDiscord | <aleclarson> i get `cannot export ./foo` |
17:31:16 | FromDiscord | <Rika> can, just import with relative |
17:31:17 | fn | <Prestige99> export by name |
17:31:20 | FromDiscord | <Rika> then export without ./ |
17:31:30 | fn | <Prestige99> import ../foo export foo for example |
17:31:51 | FromDiscord | <aleclarson> hmm ok thx! |
17:34:59 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3s3H |
17:35:35 | FromDiscord | <haxscramper> Idk whether it qualifies as "safe to use", but the numbers |
17:35:55 | FromDiscord | <haxscramper> Actually wait, I'm being dump with recursive walks again |
17:41:35 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3s3I |
17:41:54 | FromDiscord | <haxscramper> So people define helper procs and import different stuff in toplevel |
17:42:24 | FromDiscord | <haxscramper> Defining procs is totally fine, we can handle that easily. Importing things is also not a problem |
17:43:35 | FromDiscord | <haxscramper> This 9 procedure calls are `mkDir` |
17:43:42 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3s3J |
17:43:57 | FromDiscord | <haxscramper> That have no business being on toplevel in the first palce |
17:44:20 | FromDiscord | <haxscramper> since each time you try to get a package version it would happily make you a directory |
17:44:21 | FromDiscord | <haxscramper> somewhere |
17:46:37 | FromDiscord | <haxscramper> Seems like we are safe, I will consider updating RFC for completely static toplevel |
18:02:58 | * | max22- quit (Ping timeout: 240 seconds) |
18:15:33 | * | supakeen quit (Remote host closed the connection) |
18:15:57 | * | supakeen joined #nim |
18:35:36 | * | nisstyre quit (*.net *.split) |
18:35:36 | * | pjz quit (*.net *.split) |
18:35:37 | * | flynn quit (*.net *.split) |
18:35:38 | * | federico3 quit (*.net *.split) |
18:35:38 | * | mst quit (*.net *.split) |
18:35:38 | * | beshr quit (*.net *.split) |
18:35:38 | * | fn quit (*.net *.split) |
18:39:59 | * | nisstyre joined #nim |
18:39:59 | * | pjz joined #nim |
18:39:59 | * | mst joined #nim |
18:39:59 | * | beshr joined #nim |
18:39:59 | * | fn joined #nim |
18:39:59 | * | flynn joined #nim |
18:39:59 | * | federico3 joined #nim |
18:40:33 | * | flynn quit (Max SendQ exceeded) |
18:41:44 | * | flynn joined #nim |
18:48:48 | FromDiscord | <leorize> [haxscramper](https://matrix.to/#/@haxscramper:matrix.org)\: if you want an example of a static-ish language you can look at meson's build description |
18:48:55 | FromDiscord | <leorize> it's like python, but turing-incomplete |
18:50:08 | FromDiscord | <leorize> btw I noticed the MVS addition, excellent work [haxscramper](https://matrix.to/#/@haxscramper:matrix.org) |
19:01:54 | * | max22- joined #nim |
19:02:38 | FromDiscord | <haxscramper> Is there any specific feature that you like in meson, [leorize](https://matrix.to/#/@leorize:envs.net) ? I did a quick look, and it seems like it is python-like DSL and maybe some nice things for C build system |
19:02:38 | FromDiscord | <haxscramper> But it is a C build system, so it has a lot of complexity to deal with that |
19:02:39 | FromDiscord | <haxscramper> Also it has `foreach/if`, variables, function calls |
19:02:39 | FromDiscord | <leorize> I'm just thinking if we might want something similar, but for nim |
19:06:43 | FromDiscord | <haxscramper> Maybe, but this could be solved by a collection of helper procs |
19:06:43 | FromDiscord | <leorize> the meson system is declarative but still retain some expressiveness, which is why I think might be a good middle ground for making the current nimscript stuff safe to evaluate |
19:08:05 | FromDiscord | <haxscramper> so you mean replace inner content of the `task` with this? |
19:08:05 | FromDiscord | <leorize> no, task is fine the way its working |
19:08:12 | FromDiscord | <leorize> for the top-level that is |
19:09:33 | FromDiscord | <haxscramper> toplevel can simply be static |
19:09:34 | FromDiscord | <haxscramper> nobody needs anything more complex than that |
19:09:34 | FromDiscord | <haxscramper> but some values make sense only in runtime context like .. idk, `bin`? The only thing I've seen being set up with some complicated logic |
19:09:35 | FromDiscord | <leorize> those are build targets |
19:09:46 | FromDiscord | <leorize> they're a different breed |
19:11:36 | FromDiscord | <leorize> the only issue I can think of about the static top-level is OS-specific deps, but I believe you have that figured out |
19:12:16 | FromDiscord | <Double> can you write discord bots in your language? |
19:12:20 | FromDiscord | <haxscramper> yes, `when defined(windows)` is considered static part |
19:12:21 | FromDiscord | <leorize> and an annoying part of OS-specific deps is that you also have to know what is the target os, please don't forget that |
19:12:40 | FromDiscord | <leorize> for cross-compilation, from linux -\> windows for example |
19:13:05 | FromDiscord | <ElegantBeef> In reply to @Double "can you write discord": Are you asking if one can write discord bots in Nim? If so yes |
19:14:03 | FromDiscord | <Double> In reply to @ElegantBeef "Are you asking if": Yes |
19:14:23 | FromDiscord | <haxscramper> Since I literally not doing that |
19:14:23 | FromDiscord | <haxscramper> But right now I just don't have anything to input for cross-compilation dependencies |
19:14:23 | FromDiscord | <leorize> I think going all-in on DSL is better than trying to do a static-ish nim |
19:14:24 | FromDiscord | <haxscramper> I'm going to write RFC extension for static toplevel |
19:14:24 | FromDiscord | <haxscramper> I don't deal with that, so I would need someone's input on that topic |
19:14:26 | FromDiscord | <haxscramper> https://github.com/krisppurg/dimscord↵(@Double) |
19:14:42 | FromDiscord | <ElegantBeef> Damn matrix just lagged, got like 5 messages at once 😄 |
19:14:42 | FromDiscord | <haxscramper> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/861686462025039883): Since I'm literally not doing that |
19:14:48 | FromDiscord | <leorize> but assuming that you're using the compiler's parser, maybe its not a problem |
19:15:01 | FromDiscord | <Double> artificial intelligence bot? |
19:15:26 | FromDiscord | <ElegantBeef> No it's a matrix bridge |
19:15:45 | FromDiscord | <Double> Interesting |
19:15:51 | FromDiscord | <haxscramper> Well, the idea is to have some toplevel static parts that we can reason about easily |
19:15:51 | FromDiscord | <leorize> I'm mostly worried about the flexibility of Nim syntax |
19:15:51 | FromDiscord | <haxscramper> But then we have to write another interpreter on top of manfiest file? |
19:15:52 | FromDiscord | <haxscramper> So far this hasn't been a problem |
19:16:01 | FromDiscord | <ElegantBeef> Though leorize would be a lot cooler if he was a AI bot |
19:16:19 | FromDiscord | <haxscramper> You mean it is overly flexible? |
19:16:19 | FromDiscord | <haxscramper> ... |
19:16:20 | FromDiscord | <haxscramper> Or not enough flexibility |
19:16:20 | FromDiscord | <leorize> if the top-level looks like nim, works like nim, then people will try to write it like nim |
19:16:28 | FromDiscord | <leorize> not an issue if you're importing the compiler to parse it |
19:16:48 | FromDiscord | <haxscramper> ah, yes, I use compiler |
19:16:49 | FromDiscord | <haxscramper> but on top of that |
19:16:49 | FromDiscord | <leorize> but might be an issue for non-compiler |
19:16:50 | FromDiscord | <haxscramper> nope |
19:17:18 | FromDiscord | <haxscramper> everyone writes `requires "string"` |
19:17:21 | FromDiscord | <haxscramper> But of course I will reuse compiler parser |
19:17:21 | FromDiscord | <haxscramper> But of course I will reuse `compiler/parser` |
19:17:30 | FromDiscord | <leorize> I mean, an issue for 3rd party interop that doesn't use the compiler's parser |
19:17:41 | FromDiscord | <leorize> but you can argue that everyone should use the compiler parser, right \:P |
19:18:53 | FromDiscord | <haxscramper> well, yes, I don't think we should optimize manifest format for some undefined external tooling that is not written in nim on top of that |
19:19:27 | FromDiscord | <haxscramper> if it is written in nim it can either use `compiler/parser` or `nimblepkg/manifestparser` |
19:19:28 | FromDiscord | <haxscramper> if you need you can grep for versions |
19:19:28 | FromDiscord | <haxscramper> and all that kind of stuff since it is very simple syntax |
19:19:28 | FromDiscord | <leorize> maybe that portion of nimble should be split into an external package |
19:19:49 | FromDiscord | <leorize> an issue with hybrid packages is that it will always install the binary as well |
19:20:04 | FromDiscord | <haxscramper> There certainly should be nimble-CLI and nimble-library, but I don't see any point in having two separate pacakges |
19:20:37 | FromDiscord | <leorize> `nimble install nimble` -\> `~/.nimble/bin/nimble` is now the preferred nimble |
19:21:15 | FromDiscord | <leorize> which is a slight concern that I have with nimble-cli + nimble-lib in the same package |
19:21:24 | FromDiscord | <haxscramper> isn't that `$PATH` ordering issues? |
19:21:47 | FromDiscord | <haxscramper> nimble packge is not installed by default, isnt it? |
19:21:50 | FromDiscord | <leorize> everyone would have `~/.nimble/bin` above everything else, right? |
19:21:55 | FromDiscord | <haxscramper> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/861688326220939267): nimble package is not installed by default, isn't it? |
19:22:03 | FromDiscord | <leorize> I'm talking about when you build tools that use nimble library |
19:22:13 | FromDiscord | <leorize> then the binary gets installed as well because hybrid packages |
19:23:27 | FromDiscord | <haxscramper> That is a problem that is not nimble-only, I don't always want to build/install binary for hybrid packages |
19:23:38 | FromDiscord | <haxscramper> So better solution would be to disable binary builds for a package |
19:23:59 | FromDiscord | <haxscramper> hmm, actually I was very vague on that part in RFC |
19:23:59 | FromDiscord | <leorize> but some hybrid packages depends on their binary got installed, prime example is nimterop |
19:24:18 | FromDiscord | <haxscramper> I do mention it, but it is a one-line "quality-of-life" feature |
19:24:20 | FromDiscord | <haxscramper> That's why I'm saying to make it optional |
19:24:54 | FromDiscord | <haxscramper> `requires "nimterop", binary = off` |
19:24:54 | FromDiscord | <haxscramper> but that is underexplained |
19:24:55 | FromDiscord | <leorize> I don't think the complexity should be moved to the user |
19:26:06 | FromDiscord | <haxscramper> and who will decide package should not be building binary then? |
19:26:06 | FromDiscord | <haxscramper> I require something |
19:26:06 | FromDiscord | <haxscramper> But not it's binary |
19:26:07 | FromDiscord | <haxscramper> therefore I'm saying `binary = off` |
19:26:07 | FromDiscord | <haxscramper> who else can make this decision for me? |
19:26:31 | FromDiscord | <leorize> what about the case where it doesn't matter, but it happened to be an issue because of global conflicts? |
19:27:11 | FromDiscord | <leorize> I'm building a tool that uses the nimble library, so I `requires "nimble"`, since it's what I want |
19:27:23 | FromDiscord | <leorize> now the binary got installed and messes the users system up |
19:27:34 | FromDiscord | <leorize> I have to dig the docs and use this `binary = off` flag |
19:28:01 | FromDiscord | <haxscramper> because you said nimble you want everything, while in reality you meant "everything but binary" |
19:28:50 | FromDiscord | <haxscramper> alright, if not `binary = off`, what is the alternative? |
19:28:50 | FromDiscord | <haxscramper> Push this to developer and make every hybrid package in two |
19:29:14 | FromDiscord | <leorize> make hybrids use a special requires string |
19:29:15 | FromDiscord | <SolitudeSF> hybrid packages were a mistake |
19:29:31 | FromDiscord | <leorize> they are a `lib` + `cmd` combo, separate them out |
19:29:44 | FromDiscord | <leorize> ie `requires "nimble/cmd"` |
19:29:52 | FromDiscord | <leorize> `requires "nimble/lib"` |
19:30:10 | FromDiscord | <leorize> and ban the `requires "nimble"` syntax |
19:30:10 | FromDiscord | <haxscramper> literally the same as binary off |
19:30:23 | FromDiscord | <leorize> no, it's different |
19:30:42 | FromDiscord | <leorize> communicating the intention is now explicit |
19:31:05 | FromDiscord | <haxscramper> and what if hybrid package provides multiple artifacts |
19:31:24 | FromDiscord | <haxscramper> I think we can generalize it to package features |
19:31:25 | FromDiscord | <haxscramper> again |
19:31:42 | FromDiscord | <leorize> I think we should get rid of hybrid |
19:31:48 | FromDiscord | <haxscramper> well, your solution is fine, but I don't really understand how `requires "nimble/lib"` is that much more explicit compared to `requires "nimble", binary = off` |
19:31:57 | FromDiscord | <haxscramper> But anyway |
19:32:06 | FromDiscord | <leorize> because you can't `requires "nimble"` |
19:32:36 | FromDiscord | <haxscramper> so there would be a differnt requires syntax for hybrid and non-hybrid packages |
19:32:44 | FromDiscord | <haxscramper> and what if I want both |
19:32:49 | FromDiscord | <haxscramper> library and binary part |
19:32:49 | FromDiscord | <leorize> yes, because hybrids are special |
19:33:05 | FromDiscord | <leorize> they are a combo of two packages that pretends to be one |
19:33:32 | FromDiscord | <haxscramper> actually `N >= 2` packages |
19:33:39 | FromDiscord | <leorize> you get the point |
19:33:40 | FromDiscord | <haxscramper> there might be more than one binary |
19:34:34 | FromDiscord | <haxscramper> We can generalize it to package features |
19:35:29 | FromDiscord | <leorize> I think we should look into what is being solved by hybrid and whether we can solve it in a more structured way |
19:35:37 | FromDiscord | <leorize> right, so what is packages features? |
19:35:55 | FromDiscord | <haxscramper> hybrid means, "post-install `build` for an artifact" |
19:36:38 | FromDiscord | <leorize> I mean, look at the problem that hybrid is trying to solve, not what it is |
19:36:47 | FromDiscord | <haxscramper> Way to provide more fine-grained communication between packages. Not just "I need all" |
19:37:16 | FromDiscord | <haxscramper> The hybrid trying to solve the problem "I want to build this binary when package is installed, and I also want to provide a library API" |
19:37:21 | FromDiscord | <haxscramper> I think |
19:37:30 | FromDiscord | <haxscramper> At least that's how I see it for the most part |
19:37:43 | FromDiscord | <haxscramper> So it is not really a feature itself |
19:37:46 | FromDiscord | <haxscramper> just a shortcut for `after install` |
19:38:18 | FromDiscord | <leorize> it's just "I have a binary package but I also want my API to be reusable" |
19:38:54 | FromDiscord | <haxscramper> yes, I meant mostly that |
19:39:57 | FromDiscord | <leorize> I think package features might create a too complicated matrix with its "default enabled/disabled" states |
19:40:51 | FromDiscord | <leorize> what if we think of hybrid as\: a library + one or more binary that is developed together with it? |
19:42:21 | FromDiscord | <leorize> so `requires "nimble"` become just the library, and you need `requires "nimble/nimble"` to get the nimble binary, similar to how nimble work with monorepos |
19:43:33 | * | rockcavera quit (Remote host closed the connection) |
19:43:34 | * | pro quit (Ping timeout: 246 seconds) |
19:45:46 | FromDiscord | <@bracketmaster-5a708063d73408ce4> sent a code paste, see https://play.nim-lang.org/#ix=3s4c |
19:45:48 | * | rockcavera joined #nim |
19:45:48 | * | rockcavera quit (Changing host) |
19:45:48 | * | rockcavera joined #nim |
19:45:56 | FromDiscord | <@bracketmaster-5a708063d73408ce4> maybe overloading `=` isn't allowed? |
19:47:07 | FromDiscord | <leorize> it's called `=copy` now, and its the function called when an object is copied |
19:47:22 | FromDiscord | <leorize> it might not be what you think it is |
19:48:01 | FromDiscord | <@bracketmaster-5a708063d73408ce4> I guess I can't really do what I was trying to do? |
19:48:57 | FromDiscord | <leorize> you can, just make sure `x` takes `var MyType` or `var T` |
19:49:42 | FromDiscord | <leorize> but it won't be triggered if a "move" is performed instead of a "copy" |
19:50:10 | FromDiscord | <leorize> if you want to hook into all `=`, then a term rewriting macro might do the magic, but they are very experimental |
19:51:56 | FromDiscord | <haxscramper> sent a long message, see http://ix.io/3s4e |
19:52:49 | FromDiscord | <haxscramper> But I heard you, and `nimble/lib` seems to be a smaller mental overhead compared to really introducing package features |
19:53:52 | FromDiscord | <haxscramper> There is a problem of multiple binaries, and [saem](https://matrix.to/#/@saem:matrix.org) mentioned he wants to have `bin: .. <build configuration>` instead of simple list |
19:54:04 | * | neceve quit (Ping timeout: 246 seconds) |
19:54:39 | FromDiscord | <leorize> the mental model is very important, since it will be what the user interacts with |
19:55:07 | FromDiscord | <leorize> I couldn't care less how this stuff would be implemented, but it has to let the user communicates what they truly wants |
19:55:12 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3s4g |
19:55:42 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3s4h |
19:56:56 | FromDiscord | <haxscramper> if we would want to introduce package features (which I believe is also very nice feature. But we can postpone it for later) then mental model won't change if we start modeling it in terms of features |
19:57:13 | FromDiscord | <haxscramper> but that does not mean we should dump it all at once to the end user, I agree |
19:57:22 | FromDiscord | <haxscramper> So for now I will stop on `nimble/lib` part |
19:58:20 | FromDiscord | <leorize> I think clear and explicit communication with the tooling will result in the least friction to the user |
19:59:14 | FromDiscord | <leorize> the end goal should be\: using a package should not be harder than using the stdlib, and the tooling should not get in the way of the programmer |
19:59:31 | FromDiscord | <leorize> speaking about package types, there is one special type that we might want to add\: generated packages |
19:59:43 | FromDiscord | <leorize> https://github.com/StefanSalewski/gintro \<- prime example of one |
19:59:45 | fn | <R2D299> itHub: 7"High level GObject-Introspection based GTK3/GTK4 bindings for Nim language" |
20:00:10 | FromDiscord | <haxscramper> how generated package is different from regular one (except for amount of code maybe) |
20:00:31 | FromDiscord | <leorize> this package generates and inject `.nim` into its package folder, of which the content depends on the system state at the time of installation |
20:01:03 | FromDiscord | <leorize> I think the cargo equivalent to this is called a proc macro package |
20:02:12 | FromDiscord | <haxscramper> How generated package handling is different from regular one with complicated `after install` hook? |
20:02:49 | FromDiscord | <leorize> a generated package pins its state to its version + when it is installed |
20:03:06 | FromDiscord | <leorize> it's content is unknown to both the developer and the package manager until its installation is finished |
20:04:25 | FromDiscord | <haxscramper> I still don't understand how this can be useful |
20:04:45 | FromDiscord | <haxscramper> Can you provide an example of an issue this can solve? |
20:05:02 | FromDiscord | <leorize> I think I'm getting ahead of myself a bit |
20:05:11 | FromDiscord | <System64 ~ Flandre Scarlet> Is it normal my cast doesn't work? https://media.discordapp.net/attachments/371759389889003532/861699245504331847/unknown.png |
20:05:40 | FromDiscord | <leorize> we should solve the problem of gintro |
20:05:55 | FromDiscord | <haxscramper> In reply to @System64 "Is it normal my": nim cast is `cast[<target type>](<expression>)` |
20:06:13 | FromDiscord | <haxscramper> `(ptr cshort)` is unholy abomination |
20:06:37 | FromDiscord | <haxscramper> that resulted of a type conversion syntax mixed with UFCS |
20:06:37 | FromDiscord | <System64 ~ Flandre Scarlet> that's what the proc wants |
20:07:33 | FromDiscord | <haxscramper> It's state is undefined until installed? |
20:07:34 | FromDiscord | <haxscramper> I'm not familliar with the package, what problem exactly? |
20:07:39 | FromDiscord | <System64 ~ Flandre Scarlet> and can I do myVar.pointer MusicEmu? |
20:08:05 | FromDiscord | <haxscramper> https://nim-lang.org/docs/manual.html#statements-and-expressions-type-casts |
20:08:17 | FromDiscord | <haxscramper> And `addr` |
20:08:35 | FromDiscord | <haxscramper> Read these sections, you need to know them when working with pointers |
20:08:35 | FromDiscord | <leorize> the fact that it has to be installed to work, and that it has to inject files into its own package folder |
20:10:07 | FromDiscord | <haxscramper> Like, I don't understand the fundamental problem - is it that bad it has to create some additional files? It doesn't matter to `import`, and it doesn't matter to `requires` |
20:11:04 | FromDiscord | <leorize> the files its creating is what you are gonna import |
20:11:29 | FromDiscord | <haxscramper> yes, and when I `import` them they are prefectly fine |
20:12:06 | FromDiscord | <haxscramper> otherwise, if generation failed the installation should've failed as well |
20:12:07 | FromDiscord | <haxscramper> Like `{.error.` or raise |
20:12:37 | FromDiscord | <haxscramper> It seems like I just fundamentally lost trying to understand what is wrong with that |
20:14:21 | FromDiscord | <haxscramper> for `hcparse` I pre-generate code and commit it, but that's because codegen step is so complicated |
20:18:29 | FromDiscord | <haxscramper> And build step depends on 20+ packages, including compiler, haxdoc etc., while generated code does not have any dependencies besides some convenience helpers |
20:19:31 | FromDiscord | <leorize> in gintro case, its because of gobject introspection |
20:19:55 | FromDiscord | <leorize> he is trying to mimic the python's `gi` feeling |
20:21:10 | FromDiscord | <leorize> I'm just letting you know about this stuff because it might be an issue for locking, as the package modifies its stored state |
20:21:19 | FromDiscord | <leorize> I don't have a solution either |
20:21:39 | FromDiscord | <leorize> but the fact that it has to modify its installation state disturbs me |
20:21:49 | FromDiscord | <haxscramper> locking is not a problem I'm concerned with, we have this rewrite-the-world PR from status |
20:21:51 | FromDiscord | <haxscramper> that implements this |
20:24:58 | FromDiscord | <haxscramper> Anyway, I think that's it for me today. Tomorrow I will update RFC to include `nimble/lib` and static toplevel |
20:26:56 | FromDiscord | <leorize> alright, o/ [haxscramper](https://matrix.to/#/@haxscramper:matrix.org) |
20:29:22 | * | max22- quit (Ping timeout: 240 seconds) |
20:29:35 | * | max22- joined #nim |
20:38:42 | fn | <ForumUpdaterBot99> New thread by Lbart: How to return an object of a particular type following a value., see https://forum.nim-lang.org/t/8202 |
20:48:19 | * | max22- quit (Ping timeout: 246 seconds) |
20:51:17 | FromDiscord | <System64 ~ Flandre Scarlet> Randoms crashes happens at any moments, but doesn't output a stacktrace, is it normal? https://media.discordapp.net/attachments/371759389889003532/861710847532859462/unknown.png |
20:54:53 | * | supakeen quit (Remote host closed the connection) |
20:55:17 | * | supakeen joined #nim |
20:55:56 | FromDiscord | <ElegantBeef> I wager it's an issue with your interop, are you making a debug build or release/danger? |
20:58:09 | FromDiscord | <System64 ~ Flandre Scarlet> just nim compile -r helloworld.nim |
20:58:54 | FromDiscord | <System64 ~ Flandre Scarlet> what I can try is running the program without Tilengine |
21:08:14 | FromDiscord | <ynfle (ynfle)> sent a code paste, see https://play.nim-lang.org/#ix=3s4F |
21:09:42 | FromDiscord | <waghanza (Marwan Rabbâa)> 👋,↵I'm having some issue with `httpbeast`↵`Address family not supported by protocol [OSError]` when running on container |
21:10:17 | FromDiscord | <waghanza (Marwan Rabbâa)> anyone has this kind of issue ? |
21:10:42 | FromDiscord | <ElegantBeef> ynfle hard to say without the entire code |
21:11:07 | FromDiscord | <ElegantBeef> sounds like you're using ipv4/6 with a protocol that doesnt support it, but idk anything about networking 😄 |
21:11:15 | FromDiscord | <ynfle (ynfle)> sent a code paste, see https://play.nim-lang.org/#ix=3s4G |
21:11:16 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://paste.rs/zgU |
21:11:37 | FromDiscord | <ElegantBeef> Ah it's saying the range of the descriminant must be `0..X` |
21:11:51 | FromDiscord | <waghanza (Marwan Rabbâa)> sent a long message, see http://ix.io/3s4H |
21:12:03 | FromDiscord | <ElegantBeef> positive is `1..int.high` |
21:12:23 | FromDiscord | <ynfle (ynfle)> So what? |
21:12:47 | FromDiscord | <ElegantBeef> It needs to be `case dim 0..4` or w/e |
21:12:51 | FromDiscord | <ynfle (ynfle)> I tried with int |
21:13:14 | FromDiscord | <ElegantBeef> Or use an enum, either works |
21:13:58 | FromDiscord | <ynfle (ynfle)> sent a code paste, see https://play.nim-lang.org/#ix=3s4I |
21:14:07 | FromDiscord | <ElegantBeef> you're starting at `2` now instead of `1` |
21:14:13 | FromDiscord | <ElegantBeef> the range has to start at 0 |
21:14:16 | FromDiscord | <ElegantBeef> so `0.. 2` |
21:14:18 | FromDiscord | <ElegantBeef> (edit) "`0.. 2`" => "`0..2`" |
21:14:28 | FromDiscord | <ynfle (ynfle)> Why does it have to start at 0? |
21:14:38 | FromDiscord | <ElegantBeef> Cause it makes life easier i imagine |
21:14:50 | FromDiscord | <ElegantBeef> a tagged union that can start at an arbitrary tag is a bit more tedious |
21:15:19 | FromDiscord | <ElegantBeef> Not much more tedious but, a bit :d |
21:16:10 | FromDiscord | <ynfle (ynfle)> \:shrug\: |
21:17:34 | FromDiscord | <waghanza (Marwan Rabbâa)> @ElegantBeef) |
21:17:50 | FromDiscord | <waghanza (Marwan Rabbâa)> > ↵> with a protocol that doesnt support it↵> not understood |
21:17:56 | FromDiscord | <waghanza (Marwan Rabbâa)> > ↵> with a protocol that doesnt support it↵> not understood |
21:17:58 | FromDiscord | <ElegantBeef> Like i said just from the error, i'm speaking out my ass |
21:18:36 | FromDiscord | <ynfle (ynfle)> Nice! |
21:21:09 | * | max22- joined #nim |
21:22:00 | FromDiscord | <exelotl> sent a code paste, see https://paste.rs/Lc5 |
21:22:28 | FromDiscord | <exelotl> I wouldn't recommend to use brackets like this though. It's not idiomatic Nim at all |
21:23:11 | FromDiscord | <System64 ~ Flandre Scarlet> oh alright |
21:25:13 | FromDiscord | <exelotl> sent a code paste, see https://paste.rs/0TM |
21:25:37 | FromDiscord | <exelotl> (edit) "https://play.nim-lang.org/#ix=3s4N" => "https://play.nim-lang.org/#ix=3s4M" |
21:25:48 | FromDiscord | <System64 ~ Flandre Scarlet> Oh I see |
21:30:36 | FromDiscord | <leorize> though that one-liner should be solved by `sugar.dup` |
21:34:49 | FromDiscord | <System64 ~ Flandre Scarlet> alright so I think the problem is related to Tilengine or due to a conflict between Tilengine and LibGME |
21:40:50 | FromDiscord | <dom96> In reply to @waghanza (Marwan Rabbâa) "👋, I'm having some": haven't seen this before, what's the OS? Also can you try just `nim c server.nim` and paste the stack trace? |
21:43:09 | * | max22- quit (Quit: Leaving) |
21:44:05 | * | Vladar quit (Quit: Leaving) |
21:48:36 | FromDiscord | <leorize> if its docker, remember to enable ipv6 |
21:50:37 | * | Schnouki quit (Ping timeout: 246 seconds) |
21:51:57 | FromDiscord | <dom96> alternatively don't use Docker 😄 |
22:07:11 | FromDiscord | <idf> podman is nice |
22:08:17 | FromDiscord | <leorize> +1 for podman |
22:31:06 | FromDiscord | <System64 ~ Flandre Scarlet> is it a good idea to execute 2 differents instances of SDL2? |
23:53:19 | * | riceman joined #nim |
23:54:59 | riceman | Hey all! I'm having some issues with threadpool for a project with a deadline tonight. Keep getting "SIGSEGV: Illegal storage access" crashes while using threadpool to start threads for each line of a file. |
23:56:56 | riceman | I've tried a number of different structures of implementation, different GCs, and even tried sync() every 12 new threads, but it always hangs for ages, then crashes. Any ideas what I might be missing? |