00:25:57 | FromDiscord | <carmysilna> sent a code paste, see https://play.nim-lang.org/#ix=3tVU |
00:29:25 | FromDiscord | <saem> 2 days ago\: https://github.com/nim-lang/Nim/commit/01fc9e58ca8b694eac6c07b05c26c9d98cbd141c |
01:07:02 | fn | <ForumUpdaterBot99> New thread by JPLRouge: Two questions on Import relating to strip , see https://forum.nim-lang.org/t/8262 |
01:21:07 | * | stkrdknmibalz joined #nim |
02:23:59 | * | arkurious quit (Quit: Leaving) |
02:35:43 | FromDiscord | <carmysilna> sent a code paste, see https://paste.rs/sYQ |
02:36:34 | FromDiscord | <generic linux user> more data? |
02:37:17 | FromDiscord | <carmysilna> what do you want/need? It's pretty weird, just randomly started occurring after making some benign changes |
02:37:38 | FromDiscord | <generic linux user> the errors? |
02:37:55 | FromDiscord | <carmysilna> That's all it gives me `Execution failed with exit code 35584` |
02:38:20 | FromDiscord | <carmysilna> sent a code paste, see https://play.nim-lang.org/#ix=3tWe |
02:41:29 | FromDiscord | <@bracketmaster-5a708063d73408ce4> can I echo a stmtlist as it would appear in an actual nim file? |
02:43:56 | FromDiscord | <carmysilna> Fails on both stable and devel with that error code |
02:43:57 | FromDiscord | <ElegantBeef> `.repr` |
02:48:50 | * | TejasAgarwal joined #nim |
02:52:35 | * | TejasAgarwal quit (Client Quit) |
02:52:54 | * | TejasAgarwal joined #nim |
03:59:00 | FromDiscord | <Jakraes> Quick question, is there a way to know my current IPV4? |
03:59:11 | FromDiscord | <Jakraes> With a Nim library that is |
04:03:47 | * | stkrdknmibalz quit (Quit: WeeChat 3.0.1) |
04:06:02 | * | supakeen quit (Quit: WeeChat 3.2) |
04:06:39 | * | supakeen joined #nim |
04:30:22 | FromDiscord | <Jakraes> Nvm I figured it out |
04:40:34 | * | rockcavera quit (Remote host closed the connection) |
05:09:26 | fn | <ForumUpdaterBot99> New thread by Doongjohn: Nim online playground using Monaco and Wandbox api, see https://forum.nim-lang.org/t/8263 |
05:11:27 | FromDiscord | <Rika> no link? in the forum post i mean lol |
05:21:27 | * | TejasAgarwal quit (Quit: Ping timeout (120 seconds)) |
05:23:55 | * | TejasAgarwal joined #nim |
05:50:18 | * | max22- joined #nim |
05:55:21 | * | TejasAgarwal quit (Quit: The Lounge - https://thelounge.chat) |
06:43:15 | FromDiscord | <Varriount> Anyone know how I can resolve this error from Nimble: "Could not download: No SSL/TLS CA certificates found."? |
06:43:40 | FromDiscord | <Varriount> I'm on Windows, so I would have assumed that Nimble would pick up the system certificates automatically. |
06:49:23 | FromDiscord | <hamidb80> you should download and put `cacert.pem` and put ut in `~/.nimble/bin` |
06:50:46 | FromDiscord | <hamidb80> https://forum.nim-lang.org/t/7551 |
06:55:09 | FromDiscord | <hamidb80> @Varriount |
07:08:25 | FromDiscord | <rishavs (Rishav Sharan)> is random next much more efficient than using rand? |
07:14:47 | * | max22- quit (Ping timeout: 252 seconds) |
07:30:53 | FromDiscord | <haxscramper> `rand` calls `next` |
07:31:44 | FromDiscord | <haxscramper> in a loop, so yes, `next` is faster than `rand` |
07:41:14 | * | max22- joined #nim |
07:51:30 | * | max22- quit (Ping timeout: 276 seconds) |
07:53:40 | FromDiscord | <rishavs (Rishav Sharan)> Thanks! |
08:42:59 | * | max22- joined #nim |
09:30:47 | FromDiscord | <rishavs (Rishav Sharan)> how would I go about updating multiple rows in a single call using db\_postgres?↵I created a single string as `var query = "update mytable set x = x1 where id = id1 ; update mytable set x = x2 where id = id2 ; .... update mytable set x = xn where id = idn ;"`↵and then tried to execute it as `db.exec(sql query)`↵but I am getting the error `Exception message: ERROR: cannot insert multiple commands into a prepared sta |
09:39:05 | FromDiscord | <haxscramper> I would assume you need to use multiple prepared statements |
09:39:29 | FromDiscord | <haxscramper> And execute them in sequence |
09:40:45 | FromDiscord | <rishavs (Rishav Sharan)> I really want to make a single db call. Otherwise it would take too many calls |
09:44:40 | FromDiscord | <haxscramper> then make a query in a single statement somehow, judging from quick search it is a postgres-specific question |
09:45:07 | FromDiscord | <haxscramper> I.e. nim bindings can only give you as much options as postgres itself in that scenario |
09:46:04 | FromDiscord | <haxscramper> And Postgres does not seem to allow multiple statements in single prepared one |
10:09:46 | * | max22- quit (Ping timeout: 240 seconds) |
10:17:00 | * | max22- joined #nim |
10:27:41 | * | xet7 quit (Remote host closed the connection) |
10:28:20 | * | xet7 joined #nim |
10:50:53 | * | Vladar joined #nim |
10:54:37 | FromDiscord | <krisppurg> Hey guys, I have a problem with sets for some reason I seem to get the error ↵`Error: set is too large`↵https://play.nim-lang.org/#ix=3tY3↵Any reasons why I am getting this? |
10:56:28 | FromDiscord | <zidsal> So a set is really a bit set↵↵For signed integers the set's base type is defined to be in the range 0 .. MaxSetElements-1 where MaxSetElements is currently always 2^16. |
10:56:57 | FromDiscord | <generic linux user> should i take json or csv? |
10:57:14 | FromDiscord | <generic linux user> for a small nunber of exported data? |
10:57:39 | FromDiscord | <zidsal> Isn't that going to depend on where you need to export it to and what consumes that? |
10:58:09 | FromDiscord | <generic linux user> nono, it has been exported, i am importing it |
10:58:55 | FromDiscord | <zidsal> And is the exported data suitable for a CSV format (1 dimensional) or when it's exported do rows refer to other rows |
11:00:31 | FromDiscord | <generic linux user> its 1 dimensional |
11:01:38 | FromDiscord | <generic linux user> In reply to @zidsal "And is the exported": its just some links tho |
11:02:26 | FromDiscord | <krisppurg> In reply to @zidsal "So a set is": So what should I do instead? I have an enum PermissionFlags and it is way larger than UserFlags. |
11:04:24 | FromDiscord | <zidsal> If you just want sets for quick intersection checks e.t.c you could just use a hash set it won't be as memory efficient as it's not stored as uint bitset but it will have the same functionality. Given that you only have 20 or so entries in the set I doubt you would notice the memory difference |
11:05:53 | FromDiscord | <zidsal> @generic linux user I would just use Nims built in CSV parser, just check how the parser handles escaped commas as you can technically get them in urls |
11:06:38 | FromDiscord | <krisppurg> alright |
11:14:10 | FromDiscord | <generic linux user> its simple it doesnt even need csv parser |
11:19:21 | FromDiscord | <krisppurg> sent a long message, see https://paste.rs/XJS |
11:19:30 | * | max22- quit (Ping timeout: 276 seconds) |
11:21:05 | FromDiscord | <zidsal> I don't think that cast does you need it to do 1 sec let me get to my pc |
11:21:58 | FromDiscord | <krisppurg> The reason why I casted is because I want to convert a flag to an integer |
11:22:34 | FromDiscord | <zidsal> are you trying to get the sum of all the values in your set? |
11:22:39 | FromDiscord | <konsumlamm> casting a `HashSet[UserFlags]` to an `int` will obviously fail, those two aren't related in any way |
11:23:04 | FromDiscord | <konsumlamm> i feel like you want a builtin set, but don't want to set the `enum` members to such high values |
11:23:39 | FromDiscord | <konsumlamm> the discord flags are only powers of 2 because it already is a bitset |
11:23:41 | * | arkurious joined #nim |
11:24:27 | FromDiscord | <konsumlamm> so `set[UserFlag]` should be equivalent to discords "`UserFlags`" |
11:25:01 | FromDiscord | <krisppurg> In reply to @konsumlamm "so `set[UserFlag]` should be": yes that is what I want to do |
11:25:13 | FromDiscord | <konsumlamm> alternatively, just use an `int`/`uint` to represent the flags |
11:25:48 | FromDiscord | <krisppurg> example? |
11:27:49 | FromDiscord | <konsumlamm> i mean, just do the exact thing the discord API says |
11:30:45 | FromDiscord | <krisppurg> I have permission flags and it is an enum, which larger than UserFlags, but should UserFlags be a const then?↵https://play.nim-lang.org/#ix=3tYe |
11:40:32 | FromDiscord | <krisppurg> @konsumlamm? |
11:43:40 | FromDiscord | <konsumlamm> In reply to @krisppurg "I have permission flags": you can do the same for `UserFlags`, if you don't assign the variants custom numbers |
11:44:05 | FromDiscord | <konsumlamm> the `set` will do the "making the variants powers of two" for you |
11:44:42 | FromDiscord | <konsumlamm> apart from that, your currently assigned numbers seem to be wrong anyway |
11:50:10 | arkanoid | which languages can be considered nim competitors on the topic "moving computations at compile time"? That implies static types, baking consts and so forth. |
11:51:47 | FromDiscord | <Rika> Zig |
11:53:24 | FromDiscord | <krisppurg> In reply to @konsumlamm "apart from that, your": How come? ufHouseBravery is equivalent to 1 << 6, ufBugHunterLevel2 is equal to 1 << 14 and finally ufVerifiedBot is equal to 1 << 16 |
11:54:58 | FromDiscord | <konsumlamm> but for example `ufTeamUser` is 68, instead of 1 << 10 |
11:56:41 | FromDiscord | <Rika> When using set[T], the values of T correspond to the bit that will be set on the bitset, not the value that will be OR’ed into the bitset |
11:57:44 | arkanoid | Rika, do you know any good Nim vs Zig comparison? I know some Nim but zero Zig, but all the comparisons I'm finding are just complaining about GC where actually there's none now |
11:57:53 | FromDiscord | <konsumlamm> In reply to @arkanoid "which languages can be": Zig, D, C++ (limited), Rust (limited), Jai (if it ever gets released) |
11:58:20 | FromDiscord | <Rika> In reply to @konsumlamm "Zig, D, C++ (limited),": Good list |
11:58:45 | FromDiscord | <haxscramper> I don't think C++ qualify - `consteval` is nowhere near |
12:00:16 | arkanoid | Yeah my experience with C++ would not out it in same list |
12:00:58 | FromDiscord | <konsumlamm> that's why i wrote "(limited)" :P |
12:02:03 | arkanoid | :) |
12:03:58 | arkanoid | do you have any experience with Zig or D? Are there major features I get with these languages that are missing with Nim? |
12:04:26 | FromDiscord | <Rika> You lose a good bit with Zig but that’s their philosophy |
12:05:23 | FromDiscord | <krisppurg> sent a code paste, see https://play.nim-lang.org/#ix=3tYn |
12:05:35 | FromDiscord | <haxscramper> Exceptions, overloading, pure functions (i think) |
12:05:45 | FromDiscord | <haxscramper> inheritance, operator overloading (for zig) |
12:05:54 | FromDiscord | <haxscramper> Js backend |
12:05:57 | FromDiscord | <konsumlamm> In reply to @konsumlamm "you can do the": i said don't assign them values, the `set` will do that for you |
12:06:01 | * | supakeen quit (Quit: WeeChat 3.2) |
12:06:19 | FromDiscord | <Rika> In reply to @haxscramper "Exceptions, overloading, pure functions": Just to clarify hax is listing features not in Zig but is in Nim |
12:06:23 | FromDiscord | <haxscramper> oh, that's other way around |
12:06:38 | * | supakeen joined #nim |
12:06:59 | FromDiscord | <haxscramper> yes, I think Zig and C pushed a lot harder for seamless C interop |
12:07:02 | FromDiscord | <haxscramper> Both have some built-in way to `@importc` things, though I would argue that solution is still somewhat inferior |
12:07:03 | FromDiscord | <Rika> Zig has painless custom allocators though I believe |
12:07:09 | FromDiscord | <haxscramper> to the intermediate bindings |
12:08:01 | FromDiscord | <konsumlamm> In reply to @arkanoid "do you have any": timothee has a comparison between Nim and D (<https://github.com/timotheecour/D_vs_nim>) |
12:08:21 | FromDiscord | <konsumlamm> one big difference is that Nim has macros, while D doesn't |
12:08:48 | arkanoid | exceptions: I feel that Monads are a better way (like Option) but unsure, overloading: sweet necessity, pure functions: must have (but nim pure is not really pure), inheritance: I consider inharitance a bad pattern, operator overloading: meh |
12:09:16 | FromDiscord | <konsumlamm> D also has better support for inheritance (and proper interfaces) |
12:09:40 | FromDiscord | <konsumlamm> and you can specify compile time constraints for type parameters |
12:09:42 | arkanoid | thanks for the link! |
12:09:55 | FromDiscord | <konsumlamm> also no custom operators |
12:09:57 | FromDiscord | <haxscramper> I don't think there is any imperative languages that do side effect tracking the way nim does it |
12:10:23 | arkanoid | yeah to me Nim effect trackins is THE nim selling point |
12:11:04 | FromDiscord | <haxscramper> I don't think it majority things that way honestly |
12:11:43 | FromDiscord | <haxscramper> Selling point to functional programmers - maybe, but in most cases it is not developed enough |
12:11:47 | FromDiscord | <haxscramper> Like, there might be interesting applications for that feature |
12:11:48 | FromDiscord | <haxscramper> But so far I haven't seen a lot ofthem |
12:11:53 | FromDiscord | <haxscramper> Basically the same thing as TRM |
12:11:53 | FromDiscord | <haxscramper> sounds great |
12:12:17 | FromDiscord | <haxscramper> probably would work out great, if someone smart enough would figure out good usage patterns |
12:12:52 | FromDiscord | <krisppurg> In reply to @konsumlamm "i said don't assign": Then the some of the value like ufCertifiedModerator does not correspond with 1 << 18.↵https://play.nim-lang.org/#ix=3tYo |
12:12:57 | FromDiscord | <krisppurg> (edit) "value" => "values" |
12:13:33 | FromDiscord | <haxscramper> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/868465303565271040): I don't think it majority thinks that way honestly |
12:14:17 | FromDiscord | <haxscramper> Though TRMs are also broken right now with `{.noRewrite.}` not functioning correctly |
12:14:30 | arkanoid | well, it depends on the experience probably. To control complexity you need a way to isolate problems in logica boxes, and assert some level of trust on them, and purity + assest full set of input parameters is the best way according to math |
12:15:16 | FromDiscord | <konsumlamm> In reply to @haxscramper "Basically the same thing": TRM? |
12:15:26 | FromDiscord | <konsumlamm> oh, term rewrite macros |
12:15:26 | FromDiscord | <haxscramper> Term rewriting macros |
12:15:46 | FromDiscord | <konsumlamm> idk, they seem rather like a hack useful for optimizations to me |
12:15:56 | FromDiscord | <konsumlamm> at least rewrite rules in Haskell are used that way |
12:16:02 | FromDiscord | <haxscramper> I was talking about general effect tracking system, "purity" does not directly require it, we can go on with just "dirty" and "pure" functions |
12:16:14 | FromDiscord | <haxscramper> Not `ReadIOEffect`, `ReadDirEffect` |
12:16:40 | FromDiscord | <haxscramper> Also as user-defined warnings↵(@konsumlamm) |
12:16:40 | arkanoid | Term rewriting macros is the nearest thing I've found to Aspect programming, but the way it can be used at compile time makes also possible to do horrible hacks. Way too powerful to handle |
12:17:26 | FromDiscord | <haxscramper> And "hack useful for optimization" really does not do it enough justice IMO. Like yes, but I would not consider it a hack |
12:18:13 | FromDiscord | <konsumlamm> i'd consider it a hack in the sense that it allows you to completely break any assumptions you have about your code |
12:18:18 | FromDiscord | <haxscramper> the situation is somewhat tricky, because it needs someone to either show they are useful |
12:18:23 | FromDiscord | <haxscramper> Or show they are useless |
12:18:38 | FromDiscord | <haxscramper> and with language feature this powerful it is not really easy |
12:19:14 | FromDiscord | <haxscramper> `> completely break any assumptions you have about your code` - that part I mostly agree with |
12:19:36 | arkanoid | this one, for example, is good https://github.com/Yardanico/nim-strenc |
12:19:38 | fn | <R2D299> itHub: 7"A tiny library to automatically encrypt string literals in Nim code" |
12:20:38 | FromDiscord | <gerwy> what is the best way to handle API? |
12:21:01 | FromDiscord | <gerwy> like i have some API i want to connect to and get data |
12:21:35 | FromDiscord | <konsumlamm> "some API" is about as general as it gets |
12:21:44 | FromDiscord | <gerwy> hehe |
12:22:00 | FromDiscord | <gerwy> lets say this↵https://openweathermap.org/api |
12:22:22 | FromDiscord | <haxscramper> AST-based overloading might be another very useful feature |
12:22:27 | FromDiscord | <gerwy> or better↵https://pokeapi.co/ |
12:22:39 | FromDiscord | <haxscramper> And that one is not really broken, and I even use it sometimes |
12:23:06 | FromDiscord | <gerwy> pokeapi is cool, but idk how to use it, i heard about REST API and i guess its this |
12:24:08 | FromDiscord | <gerwy> do i just connect to server via http or https client in nim↵get the data, parse it in JSON↵done? |
12:24:48 | arkanoid | never felt the necessity to do AST based overloading. Whas the use case? |
12:25:38 | FromDiscord | <krisppurg> @konsumlamm?↵↵https://discord.com/channels/371759389889003530/371759389889003532/868465755149185024 |
12:25:50 | arkanoid | the example shows a function that only works with a consts. So what about baking the result of that function application into a const? |
12:25:50 | FromDiscord | <haxscramper> Writing macros with more concrete argument constraints |
12:25:57 | FromDiscord | <haxscramper> Like `untyped` vs `untyped{nkBracket}` |
12:26:27 | FromDiscord | <konsumlamm> In reply to @krisppurg "<@!312654963694108674>? https://discord.com/channe": just assign them `n` when they're `1 << n` in the discord API |
12:26:28 | arkanoid | ah, ok, within macros make some sense |
12:27:23 | FromDiscord | <haxscramper> Also, you can track side effects, purity and other things when passing `typed` arguments |
12:27:39 | arkanoid | how? |
12:27:49 | FromDiscord | <haxscramper> `typed{const}` |
12:28:04 | FromDiscord | <haxscramper> `typed{noSideEffect}` |
12:28:40 | FromDiscord | <haxscramper> Main problem - most of the macro I write I tape together to make them somewhat working, but ideally macro that for example mutates variable in-place |
12:28:47 | arkanoid | is consts an effect? |
12:28:53 | FromDiscord | <krisppurg> Thanks |
12:28:58 | FromDiscord | <haxscramper> Should be `typed{var}` |
12:29:08 | FromDiscord | <haxscramper> `> is consts an effect?` - no, why? |
12:29:35 | FromDiscord | <haxscramper> `typed{const}` means `A symbol which is a constant.` |
12:29:39 | FromDiscord | <haxscramper> https://nim-lang.org/docs/manual_experimental.html#term-rewriting-macros-parameter-constraints |
12:30:31 | arkanoid | Oh! thanks, I have to bridge TRM and AST overloading to make sense. Thanks |
12:37:09 | FromDiscord | <haxscramper> And I think nim is the only language with ast overloading |
12:38:10 | FromDiscord | <krisppurg> I have CallBackDataFlags, but I want my first value to be `64`, but however doing `cast[int]({cdfEphemeral})` outputs `1`, I want it to be `64`↵https://play.nim-lang.org/#ix=3tYA |
12:38:24 | FromDiscord | <krisppurg> (edit) "I have CallBackDataFlags, but I want my first value to be `64`, but however doing `cast[int]({cdfEphemeral})` outputs `1`, ... I`64`.↵https://play.nim-lang.org/#ix=3tYA" added "but" | "`64`↵https://play.nim-lang.org/#ix=3tYA" => "`64`.↵https://play.nim-lang.org/#ix=3tYA" |
12:38:24 | FromDiscord | <haxscramper> So maybe it really just a matter of someone figuring out righ tuse |
12:40:10 | FromDiscord | <haxscramper> why can't you just do bitmaksing?↵(@krisppurg) |
12:40:17 | FromDiscord | <haxscramper> Without `set` at all |
12:40:25 | FromDiscord | <haxscramper> If you need such tight control over where each bit goes |
12:40:30 | FromDiscord | <konsumlamm> In reply to @krisppurg "I have CallBackDataFlags, but": hmm, i think you need a few dummy variant for 0..5 then |
12:40:45 | FromDiscord | <konsumlamm> or just use `int`/`uint`, that's probably easier |
12:41:15 | FromDiscord | <haxscramper> Prints 64 |
12:41:23 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3tYE |
12:41:31 | FromDiscord | <haxscramper> But better use `int`/`uint` & bit(and\|or) |
12:41:39 | FromDiscord | <haxscramper> from std/bitops |
12:41:57 | FromDiscord | <krisppurg> but the flags are only 1↵cast[int]({cdfEphemeral}) |
12:42:07 | FromDiscord | <krisppurg> https://discord.com/developers/docs/interactions/slash-commands#interaction-response-object-interaction-application-command-callback-data-flags |
12:42:09 | FromDiscord | <haxscramper> then use bit operations |
12:42:15 | FromDiscord | <krisppurg> (edit) "1↵cast[int]({cdfEphemeral})" => "1" |
12:42:16 | arkanoid | https://github.com/sealmove/binarylang |
12:42:18 | fn | <R2D299> itHub: 7"Binary parser/encoder DSL" |
12:42:31 | FromDiscord | <haxscramper> `EPHEMERAL 1 << 6 only the user receiving the message can see it` |
12:42:45 | FromDiscord | <haxscramper> It says `1 << 6` |
12:43:15 | FromDiscord | <haxscramper> I don't think you can explicitly say the same thing with `set` and than safely cast it |
12:44:49 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3tYG |
12:44:51 | FromDiscord | <haxscramper> But this one also depens on node positions |
12:45:04 | FromDiscord | <haxscramper> enum field positions\ |
12:47:54 | FromDiscord | <krisppurg> So, cast[int](cdfEphemeral)? |
12:48:20 | FromDiscord | <haxscramper> why cast? |
12:48:27 | FromDiscord | <Rika> i would like to help but i am unsure of what the issue is |
12:48:39 | FromDiscord | <haxscramper> `cdfEphemeral.int` |
12:48:57 | FromDiscord | <haxscramper> or rather `const cdfEphemeral 1 shl 6`, you don't even need an enum if you have a single value |
12:49:11 | FromDiscord | <Rika> missing = before 1 |
12:49:21 | FromDiscord | <Rika> or wait did the bridge eat it |
12:49:22 | FromDiscord | <Rika> smh |
12:50:28 | FromDiscord | <haxscramper> Anyway, if you only need to send data with `1 shl 6` bitflag set, the easiest way would be to just do exactly that |
12:51:06 | FromDiscord | <Rika> use `set` if combinations of values are possible; otherwise just use consts |
12:51:11 | FromDiscord | <Rika> (edit) "possible;" => "possible," |
13:03:52 | * | max22- joined #nim |
13:05:58 | * | max22- quit (Client Quit) |
13:10:05 | * | max22- joined #nim |
13:11:24 | * | max22- quit (Remote host closed the connection) |
13:22:42 | arkanoid | and then I find that package that would have saved a lot of time weeks ago: https://github.com/disruptek/dust why arent's these great tools in nimble list!? |
13:22:44 | fn | <R2D299> itHub: 7"DUST is Unattended Syntax Truncation" |
13:23:11 | FromDiscord | <Rika> im pretty sure disruptek was against using nimble |
13:23:14 | FromDiscord | <Rika> so he didnt add it |
13:23:36 | arkanoid | what's the point of not using nimble? |
13:23:59 | arkanoid | I mean, the project uses nimble, it is just not published on the package list |
13:24:46 | arkanoid | I'm not raising any critic, just curious. I'd have used it |
13:25:20 | FromDiscord | <Rika> i dont think it is wise to say in case of being wrong... |
13:27:12 | arkanoid | I mean I'd have used the dust tool, not "I'd have used nimble to publish the tool" |
13:28:08 | FromDiscord | <Rika> i mean "i dont really know why he didnt use nimble so maybe i shouldnt say" |
13:30:03 | arkanoid | so now the nimble package list is not really the package lise, as some of the best resources lives elsewhere |
13:30:14 | arkanoid | s/lise/list |
13:31:59 | FromDiscord | <zetashift> You can make an issue and ask disruptek to add it to the list, but knowing him he really does not like nimble, and nimble shouldn't be in charge of forcing people to submit their packages to the list |
13:32:08 | FromDiscord | <haxscramper> arkanoid\: there are some issues with nimble |
13:32:16 | FromDiscord | <haxscramper> Like a lot actually |
13:33:02 | FromDiscord | <haxscramper> he said he is not goting to add packages to any list, but you are free to add them anywhere [zetashift](https://matrix.to/#/@sp33der89:matrix.org) |
13:33:32 | FromDiscord | <zetashift> ah I missed that, that's nice, but personally it feels wrong to add a package to a list that isn't mine \:P |
13:34:06 | arkanoid | there might be problems with nible, but what's the alternative? Should users just search "desired tool + nim" on google or github? |
13:34:46 | FromDiscord | <haxscramper> he developed his package manager as well https://github.com/disruptek/nimph |
13:34:47 | arkanoid | surely there's zero desire to publish someone else tool to public repo |
13:34:49 | fn | <R2D299> itHub: 7"Nim package hierarchy manager from the future 🧚" |
13:35:00 | * | max22- joined #nim |
13:35:15 | * | fputs_ joined #nim |
13:35:50 | FromDiscord | <haxscramper> and if you want comprehensive explanation as to what can be improved in nimble see https://github.com/nim-lang/RFCs/issues/398 |
13:36:15 | FromDiscord | <haxscramper> Well, at least that's what I think on that topic, though it seems it is close to an average opinion |
13:37:20 | FromDiscord | <zetashift> a very well made RFC |
13:37:21 | FromDiscord | <haxscramper> ye |
13:37:25 | FromDiscord | <haxscramper> almost a week total |
13:37:48 | arkanoid | oh! ok, if he delivers his own package manager it makes sense. I'm quite aware of some nimble problems as I'm into reproducible builds, but I mainly use it to reach out community resources |
13:38:05 | FromDiscord | <haxscramper> And I'm still not sure - there are so few comments because I laid it out so well, or something else |
13:43:02 | arkanoid | nim + effect tracking + reproducible builds = huge selling point. I'm currently using nix-shell to layout my project dir and leveraging on purity/Monads as much as possible |
13:43:10 | FromDiscord | <dom96> We’re just waiting for the implementation to get going 🙂 |
13:43:14 | * | max22- quit (Remote host closed the connection) |
13:43:22 | FromDiscord | <Rika> impl of what? |
13:43:45 | FromDiscord | <dom96> Of the changes proposed by the RFC |
13:43:54 | FromDiscord | <haxscramper> literally just that? |
13:45:19 | FromDiscord | <haxscramper> Even if I discard my doubts and really convince myself that whatewher I wrote is exactly what we need, there are still things left to discuss |
13:45:24 | FromDiscord | <Rika> rfc already wholly approved? |
13:46:05 | FromDiscord | <haxscramper> no, it is not marked as accepted |
13:46:29 | FromDiscord | <haxscramper> I thought it could be discussed at one of the dev meetings |
13:46:44 | FromDiscord | <dom96> Who are you waiting to approve it? |
13:46:46 | FromDiscord | <haxscramper> Quoting myself from the #nimble discussion> I don't think it is really necessary to focus too much on dependency resolution algorithm alone - after all it is a pretty self-contained implementation part, and it has a lot of prerequisites that we should also discuss↵> Such as requires "package/source" or requires "package/bin" for example↵> Or what exactly optional dependency is and whether everyone agrees their semantics (I'm talki |
13:47:06 | FromDiscord | <haxscramper> Araq usually adds "Accepted RFC" tag↵(@dom96) |
13:47:18 | FromDiscord | <haxscramper> At least if we talk about formal approval |
13:48:35 | FromDiscord | <haxscramper> I forgot to add notes from our `#nimble` MVS discussion, I think that could be added as well |
13:49:04 | FromDiscord | <haxscramper> And I haven't seen any opinion on things like `package/lib` for optional dependencies |
13:49:14 | FromDiscord | <haxscramper> I discussed it with [leorize](https://matrix.to/#/@leorize:envs.net) , but that's it |
13:49:46 | FromDiscord | <haxscramper> Althoug that discussion was quite comprehensive as well, so it is not like I came up with idea at random and decided to plug it into rfc, so maybe that's fine |
13:50:07 | FromDiscord | <haxscramper> `package/lib`, `package/bin` |
13:50:23 | FromDiscord | <dom96> I’ll just link again to what I wrote in the RFC: https://github.com/nim-lang/RFCs/issues/398#issuecomment-873658656. ↵I don’t see a reason not to move forward with this. |
13:52:56 | FromDiscord | <haxscramper> I guess if nobody objects, it is completely fine ... |
13:53:34 | FromDiscord | <dom96> If you start splitting this up you’ll likely get more comments too. I.e creating those sub-tasks I proposed |
13:54:18 | FromDiscord | <dom96> Approving an RFC like this won’t mean much since there is a lot of proposed changes. The detail will always need to be discussed. |
13:54:28 | FromDiscord | <haxscramper> I can split this into more actionable entries and add them as issues into nimble directoy |
13:54:35 | FromDiscord | <haxscramper> directory\ |
13:54:48 | FromDiscord | <dom96> Nimble directory? |
13:54:58 | FromDiscord | <carmysilna> An update on my earlier problem: now the exit code is 11, not 35584. still no message |
13:54:59 | FromDiscord | <haxscramper> repo\ |
13:55:31 | FromDiscord | <dom96> Sure. It’s a necessity. You can’t do everything yourself. |
13:55:50 | FromDiscord | <dom96> Let’s have tasks that others can pick up 🙂 |
13:57:59 | arkanoid | I've not read the RFC, have you ever read how nix-os (nix in general) or gnu guix handles this? With that system you can define everything and get reproducible builds out of the box in a functional way |
14:00:14 | FromDiscord | <carmysilna> Okay, so in zsh-started-from-fish and bash-started-from-zsh-started-from-fish it fails with exit code 11 but in bash-started-from-fish and fish it fails with exit code 35584. very weird bug |
14:00:37 | FromDiscord | <haxscramper> Yes, but IIRC nix does not do dependency resolution, and there are multiple other problems that have to be considered |
14:01:25 | arkanoid | nix doesn't do dependency resolution?! Nix is all about dependency resolution |
14:01:26 | FromDiscord | <gerwy> okay every weather api requires me to log in even tho its "free" ehh what a world we live in↵i guess time for some web page data fetching↵↵is there any nimble package specialized in that or do i need to do it myself? |
14:01:45 | FromDiscord | <haxscramper> Also we already have PR for lockfiles & reproducible builds are required by status |
14:02:11 | arkanoid | haxscramper, just have a look: https://www.tweag.io/blog/2019-02-06-mapping-open-source/ |
14:03:14 | FromDiscord | <haxscramper> for dep resolution I was referring to https://news.ycombinator.com/item?id=13200603 |
14:03:39 | FromDiscord | <haxscramper> maybe that's changed |
14:06:46 | arkanoid | if with dependency resolution you mean doing that in the way that breaks reproducible builds, not, that's would be an hell of a problem (see python + conda) |
14:12:43 | FromDiscord | <haxscramper> for reproducible build we can have lockfiles |
14:15:06 | arkanoid | it is not as easy as that. You need an offline box with modified system clock and isolated dependencies up to libc to have reproducible build. |
14:15:07 | emery | arkanoid: I've tried autopacking nimble for nix, it kind of works https://github.com/nix-community/flake-nimble |
14:15:09 | fn | <R2D299> itHub: 7"Nimble packages Nix flake [maintainer=@ehmry]" |
14:16:06 | emery | but detection of non-nim depedencies does not work |
14:18:49 | arkanoid | Long story short reproducible builds means that the hash of the builded exe/lib is 1:1 and never changing given the same input information. locking file is just part of the game, what if libc changes? |
14:19:01 | arkanoid | emery: that's superb! |
14:19:09 | arkanoid | how log have you been working on this? |
14:19:27 | FromDiscord | <haxscramper> libc is out of the scope of nim package management |
14:19:30 | emery | i don't remember, I wrote that a while ago and stopped updating it |
14:19:35 | FromDiscord | <haxscramper> we have `foreignDep` |
14:19:47 | FromDiscord | <haxscramper> Maybe we could bild something on top of that |
14:19:53 | emery | yea, changes to libc propragate from the compiler |
14:20:12 | emery | at least in nix land |
14:20:16 | arkanoid | so reproducible build is not possible with nim package management alone, and should not be named as that |
14:20:46 | FromDiscord | <haxscramper> why can't we name it that way |
14:21:08 | FromDiscord | <haxscramper> we make it so nim part of the build is reproducible |
14:23:57 | arkanoid | yeah, but that's kinda misleading. It just makes build reproducible until something changes in the context. You take your "reproducible project", move it to another system, you build it and is potentially different |
14:24:14 | arkanoid | and you are not tracking why |
14:24:44 | * | supakeen quit (Remote host closed the connection) |
14:25:00 | FromDiscord | <haxscramper> if we try to use term "reproducible project" everybody would have to be used to that |
14:25:06 | FromDiscord | <haxscramper> And I don't think anyone uses this term |
14:25:09 | * | supakeen joined #nim |
14:26:18 | FromDiscord | <haxscramper> like, our scope, right now, is nim |
14:26:21 | FromDiscord | <haxscramper> not whole universe |
14:26:23 | FromDiscord | <haxscramper> but nim |
14:26:59 | arkanoid | yeah, that's just a terminology issue. I'm just saying that to make a package manager capable to handle reproducibility, it has to depends on the hash on the nim compiler and it's dependencies |
14:27:45 | FromDiscord | <haxscramper> we can already depend on `nim >= 1.4.0` |
14:28:06 | FromDiscord | <haxscramper> dependency hashing is another issue, but we might get to it later on |
14:28:09 | FromDiscord | <haxscramper> if that is really necessary |
14:29:38 | arkanoid | just consider that final assert of reproducibility is sha256(oldbin) == sha256(newbin) wherever you build it. nim >= 1.4.0 won't pass that |
14:34:13 | arkanoid | I mean, it's hard, but it is a requirement for many pipelines. There are already solutions out there to fix this, and yeah when you say that is outside the scope of nim that's exactly the point, as a nim package manager can't do reproducible builds. Another example: nim compilation depends on system clock (compilation time), and you have to disable it |
14:36:40 | FromDiscord | <haxscramper> to solve this problem we can just package nim for one of the existing solutions. If I understand correctly, that's what https://github.com/nix-community/flake-nimble does |
14:36:42 | fn | <R2D299> itHub: 7"Nimble packages Nix flake [maintainer=@ehmry]" |
14:39:22 | FromDiscord | <dom96> That is a good point arkanoid. The C compiler that is used for compilation is something we should consider tracking |
14:39:38 | FromDiscord | <dom96> Compile time/date is usually handled by env vars that override this AFAIK |
14:41:46 | arkanoid | yeah it is possible to do reproducible builds today with nim, I'm already doing it with nix |
14:42:33 | FromDiscord | <dom96> the problem for Nimble is that it's not in charge of downloading Nim/GCC for you, so I'm not sure how we would handle those requirements |
14:43:24 | FromDiscord | <haxscramper> we can communicate this between choosenim and nimble somehow |
14:44:09 | FromDiscord | <dom96> Perhaps. I think we don't have to worry about this for now, we can write this data into lock files but not worry about Nimble enforcing this |
14:44:11 | emery | FWIW there work on nix to make it capabable of evaluating metadata fetched from a package manager like nimble or opam, I was prefetching that metadata, which has been done with opam https://github.com/NixOS/rfcs/pull/92 |
14:45:57 | emery | if that works then its a matter of having good nimble metadata to feed to some nix expression |
14:48:08 | arkanoid | exactly! it is more important to have a good nim package repo with metadata to assest the requirements for reproducible builds |
14:48:36 | FromDiscord | <haxscramper> that is covered by an RFC |
14:49:14 | FromDiscord | <haxscramper> I don't mention package hash on publish, but I guess that can be easily added |
14:50:11 | emery | I should update my stuff to generate a report of what doesn't build and why |
14:57:06 | arkanoid | emery, I think you did an important work and your ideas are worth sharing in the general topic of nim package management. Point is not "make reproducible builds with nim" as that's impossible, but "enable easy reproducibility via external tools" |
15:02:05 | FromDiscord | <dom96> how are reproducible builds with nim impossible? |
15:05:16 | * | max22- joined #nim |
15:06:00 | FromDiscord | <haxscramper> In reply to @arkanoid "it is not as": this |
15:06:26 | FromDiscord | <haxscramper> In reply to @arkanoid "I mean, it's hard,": and this |
15:07:54 | arkanoid | dom96: when nim loads a .so will it ensure that it's hash doesn not change from first build? |
15:08:36 | * | max22- quit (Remote host closed the connection) |
15:10:15 | FromDiscord | <krisppurg> sent a long message, see http://ix.io/3tZB |
15:15:21 | FromDiscord | <dom96> In reply to @arkanoid "<@132595483838251008>: when nim loads": I mean... it could. You could also statically link everything |
15:15:31 | FromDiscord | <dom96> Nothing about Nim makes this "impossible" |
15:18:42 | arkanoid | dom96: if your target is a small statically linked (musl-like) executable, your're reducing the problem to the point that it makes it trivial to solve |
15:19:36 | arkanoid | in that case yeah, you don't need anything else, but statically linking everything is not an option every time |
15:22:32 | FromDiscord | <dom96> Well of course, the point is it's not impossible 🙂 |
15:23:35 | arkanoid | what you need is to pin all your dependencies (up to libc) to a git commit, build the dependency tree with same requirements of reproducible build, at the end you have your reproducible exe. That exactly what nix and gnu-guix do |
15:29:13 | arkanoid | dom96: yet is impossible, as you don't pin gcc clang version even with a static build |
15:30:09 | arkanoid | I mean, you can, but that's outside the scope of nim. That's the whole point |
15:31:45 | FromDiscord | <dom96> We're just arguing over technicalities, I just don't think it's fair to describe it as "impossible" |
15:31:54 | FromDiscord | <dom96> it's possible, maybe with a lot of effort, but definitely possible |
15:33:50 | arkanoid | well, given that, everything is possible. You can make nim compile straight to machine code while embedding posix interface to os |
15:34:20 | FromDiscord | <dom96> yes |
15:34:27 | FromDiscord | <dom96> a better description then is that "it's not practical" |
15:34:58 | arkanoid | terraforming venus is possible, but it's not practical |
15:35:14 | FromDiscord | <dom96> I agree |
15:35:25 | FromDiscord | <dom96> So I wouldn't say "terraforming venus is impossible" |
15:37:48 | arkanoid | taking the discussion to blacks and whites is not going to get far. I mean, I just wanted to address the point that bending nim packaging and building system to address the reproducibility build problem is just part of the solution. It is better to focus on enabling an external tool to do that |
15:38:11 | arkanoid | this is just my opinion |
15:39:19 | FromDiscord | <dom96> The way you worded it sounded to me like you were saying there is an innate property of Nim making true reproducible builds impossible |
15:39:27 | FromDiscord | <dom96> I agree that an external tool should handle this |
15:40:12 | arkanoid | well, what nim lacks to get reproducible builds is larger than what is already in |
15:42:48 | arkanoid | and this is actually a good thing, from my point of view, and I hope that the dev effort won't go in this direction. I'd be happy if the manual would say "to get reproducible builds, enable these flags in the compiler to assure X and Y and use Nix or other tools to address the problem" |
15:43:48 | FromDiscord | <krisppurg> someone? |
15:51:51 | FromDiscord | <krisppurg> https://discord.com/channels/371759389889003530/371759389889003532/868510366735413340 |
15:55:31 | federico3 | @dom96 yet Nim should not prevent reproducible builds https://tests.reproducible-builds.org/debian/rb-pkg/unstable/amd64/nim.html |
16:10:31 | * | max22- joined #nim |
16:14:32 | FromDiscord | <PsychoClay> where does the dynlib pragma look for library files? |
17:12:49 | * | ming joined #nim |
17:15:18 | arkanoid | federico3: exactly |
18:10:03 | FromDiscord | <Valor> What’s the difference between nim and zig. They both seem to want to be “better c” I think? |
18:20:03 | * | max22- quit (Ping timeout: 268 seconds) |
18:24:18 | * | ming quit (Ping timeout: 240 seconds) |
18:33:09 | FromDiscord | <exelotl> Zig has a different philosophy - favours explicitness over conciseness or extensibility |
18:34:10 | FromDiscord | <exelotl> from the homepage: No hidden control flow. No hidden memory allocations. No preprocessor, no macros. |
18:34:54 | FromDiscord | <exelotl> Nim has all those things, which means of course it has the potential for devs to misuse all those things. |
18:58:14 | * | max22- joined #nim |
19:01:03 | fn | <ForumUpdaterBot99> New post on r/nim by m33-m33: Tsoding does a video on programming in Nim, see https://reddit.com/r/nim/comments/oqw0zt/tsoding_does_a_video_on_programming_in_nim/ |
19:03:00 | FromDiscord | <leorize> nim is not aiming to be "better c", whatever that means \:P |
19:28:02 | FromDiscord | <Daniel> i think ppl might see it as better c due to the reason it translates to c/cpp then it compiles |
19:33:52 | FromDiscord | <haxscramper> I think any statically compiled, "3E" language seems like a better C nowdays |
19:40:06 | FromDiscord | <willyboar> ...or a faster python/ruby etc |
19:51:07 | * | Guest54 joined #nim |
19:52:41 | * | Guest54 quit (Client Quit) |
21:09:54 | FromDiscord | <@bracketmaster-5a708063d73408ce4> zig principles remind me somewhat of V |
21:10:35 | FromDiscord | <@bracketmaster-5a708063d73408ce4> has anyone here used nim for serious embedded programming? |
21:13:29 | FromDiscord | <InventorMatt> PMunch made firmware for his keyboard in nim |
21:14:23 | FromDiscord | <InventorMatt> he gave a talk at nimconf about it |
21:24:33 | FromDiscord | <willyboar> iirc federico3 |
21:25:37 | FromDiscord | <dom96> I'm using Nim for quite a big embedded project |
21:25:42 | FromDiscord | <dom96> works well |
21:30:23 | * | max22- quit (Quit: Leaving) |
21:30:28 | * | Vladar quit (Quit: Leaving) |
21:42:22 | FromDiscord | <exelotl> same :D |
21:44:51 | FromDiscord | <Jakraes> How do I turn a string into an int? |
21:45:11 | FromDiscord | <exelotl> parseInt from the strutils module |
21:45:18 | FromDiscord | <Jakraes> Thank you |
21:49:05 | FromDiscord | <ElegantBeef> And as it can raise an exception you probably should throw it in a try except for program stabillity 😛 |
21:50:03 | FromDiscord | <@bracketmaster-5a708063d73408ce4> has nimconf been in person before? |
21:53:28 | FromDiscord | <exelotl> nope, first one was in 2020 a few months into the pandemic |
22:14:01 | FromDiscord | <zetashift> FOSDEM nim room is basically a mini in person nimconf tho |
22:15:32 | FromDiscord | <@bracketmaster-5a708063d73408ce4> ah OK |
22:38:36 | FromDiscord | <Valor> In reply to @haxscramper "I think any statically": whats "3E" |
22:46:12 | FromDiscord | <Alea> on windows, how does nim c --run go about hiding the terminal that pops when running the executable by itself? |
22:53:19 | * | supakeen quit (Remote host closed the connection) |
22:53:44 | * | supakeen joined #nim |
23:01:52 | FromDiscord | <Hi02Hi> In reply to @バロザード "whats "3E"": I think its the "Efficient, expressive, elegant" thats on the nim homepage |
23:02:05 | FromDiscord | <Valor> ah |
23:28:10 | * | max22- joined #nim |
23:29:24 | * | max22- quit (Remote host closed the connection) |
23:44:13 | FromDiscord | <carmysilna> What's the most idiomatic way to define a set of tags for one `when defined(x)` predicate and another set otherwise |