<< 24-07-2021 >>

00:25:57FromDiscord<carmysilna> sent a code paste, see https://play.nim-lang.org/#ix=3tVU
00:29:25FromDiscord<saem> 2 days ago\: https://github.com/nim-lang/Nim/commit/01fc9e58ca8b694eac6c07b05c26c9d98cbd141c
01:07:02fn<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:43FromDiscord<carmysilna> sent a code paste, see https://paste.rs/sYQ
02:36:34FromDiscord<generic linux user> more data?
02:37:17FromDiscord<carmysilna> what do you want/need? It's pretty weird, just randomly started occurring after making some benign changes
02:37:38FromDiscord<generic linux user> the errors?
02:37:55FromDiscord<carmysilna> That's all it gives me `Execution failed with exit code 35584`
02:38:20FromDiscord<carmysilna> sent a code paste, see https://play.nim-lang.org/#ix=3tWe
02:41:29FromDiscord<@bracketmaster-5a708063d73408ce4> can I echo a stmtlist as it would appear in an actual nim file?
02:43:56FromDiscord<carmysilna> Fails on both stable and devel with that error code
02:43:57FromDiscord<ElegantBeef> `.repr`
02:48:50*TejasAgarwal joined #nim
02:52:35*TejasAgarwal quit (Client Quit)
02:52:54*TejasAgarwal joined #nim
03:59:00FromDiscord<Jakraes> Quick question, is there a way to know my current IPV4?
03:59:11FromDiscord<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:22FromDiscord<Jakraes> Nvm I figured it out
04:40:34*rockcavera quit (Remote host closed the connection)
05:09:26fn<ForumUpdaterBot99> New thread by Doongjohn: Nim online playground using Monaco and Wandbox api, see https://forum.nim-lang.org/t/8263
05:11:27FromDiscord<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:15FromDiscord<Varriount> Anyone know how I can resolve this error from Nimble: "Could not download: No SSL/TLS CA certificates found."?
06:43:40FromDiscord<Varriount> I'm on Windows, so I would have assumed that Nimble would pick up the system certificates automatically.
06:49:23FromDiscord<hamidb80> you should download and put `cacert.pem` and put ut in `~/.nimble/bin`
06:50:46FromDiscord<hamidb80> https://forum.nim-lang.org/t/7551
06:55:09FromDiscord<hamidb80> @Varriount
07:08:25FromDiscord<rishavs (Rishav Sharan)> is random next much more efficient than using rand?
07:14:47*max22- quit (Ping timeout: 252 seconds)
07:30:53FromDiscord<haxscramper> `rand` calls `next`
07:31:44FromDiscord<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:40FromDiscord<rishavs (Rishav Sharan)> Thanks!
08:42:59*max22- joined #nim
09:30:47FromDiscord<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:05FromDiscord<haxscramper> I would assume you need to use multiple prepared statements
09:39:29FromDiscord<haxscramper> And execute them in sequence
09:40:45FromDiscord<rishavs (Rishav Sharan)> I really want to make a single db call. Otherwise it would take too many calls
09:44:40FromDiscord<haxscramper> then make a query in a single statement somehow, judging from quick search it is a postgres-specific question
09:45:07FromDiscord<haxscramper> I.e. nim bindings can only give you as much options as postgres itself in that scenario
09:46:04FromDiscord<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:37FromDiscord<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:28FromDiscord<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:57FromDiscord<generic linux user> should i take json or csv?
10:57:14FromDiscord<generic linux user> for a small nunber of exported data?
10:57:39FromDiscord<zidsal> Isn't that going to depend on where you need to export it to and what consumes that?
10:58:09FromDiscord<generic linux user> nono, it has been exported, i am importing it
10:58:55FromDiscord<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:31FromDiscord<generic linux user> its 1 dimensional
11:01:38FromDiscord<generic linux user> In reply to @zidsal "And is the exported": its just some links tho
11:02:26FromDiscord<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:24FromDiscord<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:53FromDiscord<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:38FromDiscord<krisppurg> alright
11:14:10FromDiscord<generic linux user> its simple it doesnt even need csv parser
11:19:21FromDiscord<krisppurg> sent a long message, see https://paste.rs/XJS
11:19:30*max22- quit (Ping timeout: 276 seconds)
11:21:05FromDiscord<zidsal> I don't think that cast does you need it to do 1 sec let me get to my pc
11:21:58FromDiscord<krisppurg> The reason why I casted is because I want to convert a flag to an integer
11:22:34FromDiscord<zidsal> are you trying to get the sum of all the values in your set?
11:22:39FromDiscord<konsumlamm> casting a `HashSet[UserFlags]` to an `int` will obviously fail, those two aren't related in any way
11:23:04FromDiscord<konsumlamm> i feel like you want a builtin set, but don't want to set the `enum` members to such high values
11:23:39FromDiscord<konsumlamm> the discord flags are only powers of 2 because it already is a bitset
11:23:41*arkurious joined #nim
11:24:27FromDiscord<konsumlamm> so `set[UserFlag]` should be equivalent to discords "`UserFlags`"
11:25:01FromDiscord<krisppurg> In reply to @konsumlamm "so `set[UserFlag]` should be": yes that is what I want to do
11:25:13FromDiscord<konsumlamm> alternatively, just use an `int`/`uint` to represent the flags
11:25:48FromDiscord<krisppurg> example?
11:27:49FromDiscord<konsumlamm> i mean, just do the exact thing the discord API says
11:30:45FromDiscord<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:32FromDiscord<krisppurg> @konsumlamm?
11:43:40FromDiscord<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:05FromDiscord<konsumlamm> the `set` will do the "making the variants powers of two" for you
11:44:42FromDiscord<konsumlamm> apart from that, your currently assigned numbers seem to be wrong anyway
11:50:10arkanoidwhich 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:47FromDiscord<Rika> Zig
11:53:24FromDiscord<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:58FromDiscord<konsumlamm> but for example `ufTeamUser` is 68, instead of 1 << 10
11:56:41FromDiscord<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:44arkanoidRika, 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:53FromDiscord<konsumlamm> In reply to @arkanoid "which languages can be": Zig, D, C++ (limited), Rust (limited), Jai (if it ever gets released)
11:58:20FromDiscord<Rika> In reply to @konsumlamm "Zig, D, C++ (limited),": Good list
11:58:45FromDiscord<haxscramper> I don't think C++ qualify - `consteval` is nowhere near
12:00:16arkanoidYeah my experience with C++ would not out it in same list
12:00:58FromDiscord<konsumlamm> that's why i wrote "(limited)" :P
12:02:03arkanoid:)
12:03:58arkanoiddo you have any experience with Zig or D? Are there major features I get with these languages that are missing with Nim?
12:04:26FromDiscord<Rika> You lose a good bit with Zig but that’s their philosophy
12:05:23FromDiscord<krisppurg> sent a code paste, see https://play.nim-lang.org/#ix=3tYn
12:05:35FromDiscord<haxscramper> Exceptions, overloading, pure functions (i think)
12:05:45FromDiscord<haxscramper> inheritance, operator overloading (for zig)
12:05:54FromDiscord<haxscramper> Js backend
12:05:57FromDiscord<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:19FromDiscord<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:23FromDiscord<haxscramper> oh, that's other way around
12:06:38*supakeen joined #nim
12:06:59FromDiscord<haxscramper> yes, I think Zig and C pushed a lot harder for seamless C interop
12:07:02FromDiscord<haxscramper> Both have some built-in way to `@importc` things, though I would argue that solution is still somewhat inferior
12:07:03FromDiscord<Rika> Zig has painless custom allocators though I believe
12:07:09FromDiscord<haxscramper> to the intermediate bindings
12:08:01FromDiscord<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:21FromDiscord<konsumlamm> one big difference is that Nim has macros, while D doesn't
12:08:48arkanoidexceptions: 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:16FromDiscord<konsumlamm> D also has better support for inheritance (and proper interfaces)
12:09:40FromDiscord<konsumlamm> and you can specify compile time constraints for type parameters
12:09:42arkanoidthanks for the link!
12:09:55FromDiscord<konsumlamm> also no custom operators
12:09:57FromDiscord<haxscramper> I don't think there is any imperative languages that do side effect tracking the way nim does it
12:10:23arkanoidyeah to me Nim effect trackins is THE nim selling point
12:11:04FromDiscord<haxscramper> I don't think it majority things that way honestly
12:11:43FromDiscord<haxscramper> Selling point to functional programmers - maybe, but in most cases it is not developed enough
12:11:47FromDiscord<haxscramper> Like, there might be interesting applications for that feature
12:11:48FromDiscord<haxscramper> But so far I haven't seen a lot ofthem
12:11:53FromDiscord<haxscramper> Basically the same thing as TRM
12:11:53FromDiscord<haxscramper> sounds great
12:12:17FromDiscord<haxscramper> probably would work out great, if someone smart enough would figure out good usage patterns
12:12:52FromDiscord<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:57FromDiscord<krisppurg> (edit) "value" => "values"
12:13:33FromDiscord<haxscramper> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/868465303565271040): I don't think it majority thinks that way honestly
12:14:17FromDiscord<haxscramper> Though TRMs are also broken right now with `{.noRewrite.}` not functioning correctly
12:14:30arkanoidwell, 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:16FromDiscord<konsumlamm> In reply to @haxscramper "Basically the same thing": TRM?
12:15:26FromDiscord<konsumlamm> oh, term rewrite macros
12:15:26FromDiscord<haxscramper> Term rewriting macros
12:15:46FromDiscord<konsumlamm> idk, they seem rather like a hack useful for optimizations to me
12:15:56FromDiscord<konsumlamm> at least rewrite rules in Haskell are used that way
12:16:02FromDiscord<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:14FromDiscord<haxscramper> Not `ReadIOEffect`, `ReadDirEffect`
12:16:40FromDiscord<haxscramper> Also as user-defined warnings↵(@konsumlamm)
12:16:40arkanoidTerm 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:26FromDiscord<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:13FromDiscord<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:18FromDiscord<haxscramper> the situation is somewhat tricky, because it needs someone to either show they are useful
12:18:23FromDiscord<haxscramper> Or show they are useless
12:18:38FromDiscord<haxscramper> and with language feature this powerful it is not really easy
12:19:14FromDiscord<haxscramper> `> completely break any assumptions you have about your code` - that part I mostly agree with
12:19:36arkanoidthis one, for example, is good https://github.com/Yardanico/nim-strenc
12:19:38fn<R2D299> itHub: 7"A tiny library to automatically encrypt string literals in Nim code"
12:20:38FromDiscord<gerwy> what is the best way to handle API?
12:21:01FromDiscord<gerwy> like i have some API i want to connect to and get data
12:21:35FromDiscord<konsumlamm> "some API" is about as general as it gets
12:21:44FromDiscord<gerwy> hehe
12:22:00FromDiscord<gerwy> lets say this↵https://openweathermap.org/api
12:22:22FromDiscord<haxscramper> AST-based overloading might be another very useful feature
12:22:27FromDiscord<gerwy> or better↵https://pokeapi.co/
12:22:39FromDiscord<haxscramper> And that one is not really broken, and I even use it sometimes
12:23:06FromDiscord<gerwy> pokeapi is cool, but idk how to use it, i heard about REST API and i guess its this
12:24:08FromDiscord<gerwy> do i just connect to server via http or https client in nim↵get the data, parse it in JSON↵done?
12:24:48arkanoidnever felt the necessity to do AST based overloading. Whas the use case?
12:25:38FromDiscord<krisppurg> @konsumlamm?↵↵https://discord.com/channels/371759389889003530/371759389889003532/868465755149185024
12:25:50arkanoidthe 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:50FromDiscord<haxscramper> Writing macros with more concrete argument constraints
12:25:57FromDiscord<haxscramper> Like `untyped` vs `untyped{nkBracket}`
12:26:27FromDiscord<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:28arkanoidah, ok, within macros make some sense
12:27:23FromDiscord<haxscramper> Also, you can track side effects, purity and other things when passing `typed` arguments
12:27:39arkanoidhow?
12:27:49FromDiscord<haxscramper> `typed{const}`
12:28:04FromDiscord<haxscramper> `typed{noSideEffect}`
12:28:40FromDiscord<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:47arkanoidis consts an effect?
12:28:53FromDiscord<krisppurg> Thanks
12:28:58FromDiscord<haxscramper> Should be `typed{var}`
12:29:08FromDiscord<haxscramper> `> is consts an effect?` - no, why?
12:29:35FromDiscord<haxscramper> `typed{const}` means `A symbol which is a constant.`
12:29:39FromDiscord<haxscramper> https://nim-lang.org/docs/manual_experimental.html#term-rewriting-macros-parameter-constraints
12:30:31arkanoidOh! thanks, I have to bridge TRM and AST overloading to make sense. Thanks
12:37:09FromDiscord<haxscramper> And I think nim is the only language with ast overloading
12:38:10FromDiscord<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:24FromDiscord<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:24FromDiscord<haxscramper> So maybe it really just a matter of someone figuring out righ tuse
12:40:10FromDiscord<haxscramper> why can't you just do bitmaksing?↵(@krisppurg)
12:40:17FromDiscord<haxscramper> Without `set` at all
12:40:25FromDiscord<haxscramper> If you need such tight control over where each bit goes
12:40:30FromDiscord<konsumlamm> In reply to @krisppurg "I have CallBackDataFlags, but": hmm, i think you need a few dummy variant for 0..5 then
12:40:45FromDiscord<konsumlamm> or just use `int`/`uint`, that's probably easier
12:41:15FromDiscord<haxscramper> Prints 64
12:41:23FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3tYE
12:41:31FromDiscord<haxscramper> But better use `int`/`uint` & bit(and\|or)
12:41:39FromDiscord<haxscramper> from std/bitops
12:41:57FromDiscord<krisppurg> but the flags are only 1↵cast[int]({cdfEphemeral})
12:42:07FromDiscord<krisppurg> https://discord.com/developers/docs/interactions/slash-commands#interaction-response-object-interaction-application-command-callback-data-flags
12:42:09FromDiscord<haxscramper> then use bit operations
12:42:15FromDiscord<krisppurg> (edit) "1↵cast[int]({cdfEphemeral})" => "1"
12:42:16arkanoidhttps://github.com/sealmove/binarylang
12:42:18fn<R2D299> itHub: 7"Binary parser/encoder DSL"
12:42:31FromDiscord<haxscramper> `EPHEMERAL 1 << 6 only the user receiving the message can see it`
12:42:45FromDiscord<haxscramper> It says `1 << 6`
12:43:15FromDiscord<haxscramper> I don't think you can explicitly say the same thing with `set` and than safely cast it
12:44:49FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3tYG
12:44:51FromDiscord<haxscramper> But this one also depens on node positions
12:45:04FromDiscord<haxscramper> enum field positions\
12:47:54FromDiscord<krisppurg> So, cast[int](cdfEphemeral)?
12:48:20FromDiscord<haxscramper> why cast?
12:48:27FromDiscord<Rika> i would like to help but i am unsure of what the issue is
12:48:39FromDiscord<haxscramper> `cdfEphemeral.int`
12:48:57FromDiscord<haxscramper> or rather `const cdfEphemeral 1 shl 6`, you don't even need an enum if you have a single value
12:49:11FromDiscord<Rika> missing = before 1
12:49:21FromDiscord<Rika> or wait did the bridge eat it
12:49:22FromDiscord<Rika> smh
12:50:28FromDiscord<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:06FromDiscord<Rika> use `set` if combinations of values are possible; otherwise just use consts
12:51:11FromDiscord<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:42arkanoidand 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:44fn<R2D299> itHub: 7"DUST is Unattended Syntax Truncation"
13:23:11FromDiscord<Rika> im pretty sure disruptek was against using nimble
13:23:14FromDiscord<Rika> so he didnt add it
13:23:36arkanoidwhat's the point of not using nimble?
13:23:59arkanoidI mean, the project uses nimble, it is just not published on the package list
13:24:46arkanoidI'm not raising any critic, just curious. I'd have used it
13:25:20FromDiscord<Rika> i dont think it is wise to say in case of being wrong...
13:27:12arkanoidI mean I'd have used the dust tool, not "I'd have used nimble to publish the tool"
13:28:08FromDiscord<Rika> i mean "i dont really know why he didnt use nimble so maybe i shouldnt say"
13:30:03arkanoidso now the nimble package list is not really the package lise, as some of the best resources lives elsewhere
13:30:14arkanoids/lise/list
13:31:59FromDiscord<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:08FromDiscord<haxscramper> arkanoid\: there are some issues with nimble
13:32:16FromDiscord<haxscramper> Like a lot actually
13:33:02FromDiscord<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:32FromDiscord<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:06arkanoidthere might be problems with nible, but what's the alternative? Should users just search "desired tool + nim" on google or github?
13:34:46FromDiscord<haxscramper> he developed his package manager as well https://github.com/disruptek/nimph
13:34:47arkanoidsurely there's zero desire to publish someone else tool to public repo
13:34:49fn<R2D299> itHub: 7"Nim package hierarchy manager from the future 🧚"
13:35:00*max22- joined #nim
13:35:15*fputs_ joined #nim
13:35:50FromDiscord<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:15FromDiscord<haxscramper> Well, at least that's what I think on that topic, though it seems it is close to an average opinion
13:37:20FromDiscord<zetashift> a very well made RFC
13:37:21FromDiscord<haxscramper> ye
13:37:25FromDiscord<haxscramper> almost a week total
13:37:48arkanoidoh! 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:05FromDiscord<haxscramper> And I'm still not sure - there are so few comments because I laid it out so well, or something else
13:43:02arkanoidnim + 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:10FromDiscord<dom96> We’re just waiting for the implementation to get going 🙂
13:43:14*max22- quit (Remote host closed the connection)
13:43:22FromDiscord<Rika> impl of what?
13:43:45FromDiscord<dom96> Of the changes proposed by the RFC
13:43:54FromDiscord<haxscramper> literally just that?
13:45:19FromDiscord<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:24FromDiscord<Rika> rfc already wholly approved?
13:46:05FromDiscord<haxscramper> no, it is not marked as accepted
13:46:29FromDiscord<haxscramper> I thought it could be discussed at one of the dev meetings
13:46:44FromDiscord<dom96> Who are you waiting to approve it?
13:46:46FromDiscord<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:06FromDiscord<haxscramper> Araq usually adds "Accepted RFC" tag↵(@dom96)
13:47:18FromDiscord<haxscramper> At least if we talk about formal approval
13:48:35FromDiscord<haxscramper> I forgot to add notes from our `#nimble` MVS discussion, I think that could be added as well
13:49:04FromDiscord<haxscramper> And I haven't seen any opinion on things like `package/lib` for optional dependencies
13:49:14FromDiscord<haxscramper> I discussed it with [leorize](https://matrix.to/#/@leorize:envs.net) , but that's it
13:49:46FromDiscord<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:07FromDiscord<haxscramper> `package/lib`, `package/bin`
13:50:23FromDiscord<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:56FromDiscord<haxscramper> I guess if nobody objects, it is completely fine ...
13:53:34FromDiscord<dom96> If you start splitting this up you’ll likely get more comments too. I.e creating those sub-tasks I proposed
13:54:18FromDiscord<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:28FromDiscord<haxscramper> I can split this into more actionable entries and add them as issues into nimble directoy
13:54:35FromDiscord<haxscramper> directory\
13:54:48FromDiscord<dom96> Nimble directory?
13:54:58FromDiscord<carmysilna> An update on my earlier problem: now the exit code is 11, not 35584. still no message
13:54:59FromDiscord<haxscramper> repo\
13:55:31FromDiscord<dom96> Sure. It’s a necessity. You can’t do everything yourself.
13:55:50FromDiscord<dom96> Let’s have tasks that others can pick up 🙂
13:57:59arkanoidI'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:14FromDiscord<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:37FromDiscord<haxscramper> Yes, but IIRC nix does not do dependency resolution, and there are multiple other problems that have to be considered
14:01:25arkanoidnix doesn't do dependency resolution?! Nix is all about dependency resolution
14:01:26FromDiscord<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:45FromDiscord<haxscramper> Also we already have PR for lockfiles & reproducible builds are required by status
14:02:11arkanoidhaxscramper, just have a look: https://www.tweag.io/blog/2019-02-06-mapping-open-source/
14:03:14FromDiscord<haxscramper> for dep resolution I was referring to https://news.ycombinator.com/item?id=13200603
14:03:39FromDiscord<haxscramper> maybe that's changed
14:06:46arkanoidif 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:43FromDiscord<haxscramper> for reproducible build we can have lockfiles
14:15:06arkanoidit 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:07emeryarkanoid: I've tried autopacking nimble for nix, it kind of works https://github.com/nix-community/flake-nimble
14:15:09fn<R2D299> itHub: 7"Nimble packages Nix flake [[email protected]]"
14:16:06emerybut detection of non-nim depedencies does not work
14:18:49arkanoidLong 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:01arkanoidemery: that's superb!
14:19:09arkanoidhow log have you been working on this?
14:19:27FromDiscord<haxscramper> libc is out of the scope of nim package management
14:19:30emeryi don't remember, I wrote that a while ago and stopped updating it
14:19:35FromDiscord<haxscramper> we have `foreignDep`
14:19:47FromDiscord<haxscramper> Maybe we could bild something on top of that
14:19:53emeryyea, changes to libc propragate from the compiler
14:20:12emeryat least in nix land
14:20:16arkanoidso reproducible build is not possible with nim package management alone, and should not be named as that
14:20:46FromDiscord<haxscramper> why can't we name it that way
14:21:08FromDiscord<haxscramper> we make it so nim part of the build is reproducible
14:23:57arkanoidyeah, 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:14arkanoidand you are not tracking why
14:24:44*supakeen quit (Remote host closed the connection)
14:25:00FromDiscord<haxscramper> if we try to use term "reproducible project" everybody would have to be used to that
14:25:06FromDiscord<haxscramper> And I don't think anyone uses this term
14:25:09*supakeen joined #nim
14:26:18FromDiscord<haxscramper> like, our scope, right now, is nim
14:26:21FromDiscord<haxscramper> not whole universe
14:26:23FromDiscord<haxscramper> but nim
14:26:59arkanoidyeah, 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:45FromDiscord<haxscramper> we can already depend on `nim >= 1.4.0`
14:28:06FromDiscord<haxscramper> dependency hashing is another issue, but we might get to it later on
14:28:09FromDiscord<haxscramper> if that is really necessary
14:29:38arkanoidjust 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:13arkanoidI 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:40FromDiscord<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:42fn<R2D299> itHub: 7"Nimble packages Nix flake [[email protected]]"
14:39:22FromDiscord<dom96> That is a good point arkanoid. The C compiler that is used for compilation is something we should consider tracking
14:39:38FromDiscord<dom96> Compile time/date is usually handled by env vars that override this AFAIK
14:41:46arkanoidyeah it is possible to do reproducible builds today with nim, I'm already doing it with nix
14:42:33FromDiscord<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:24FromDiscord<haxscramper> we can communicate this between choosenim and nimble somehow
14:44:09FromDiscord<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:11emeryFWIW 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:57emeryif that works then its a matter of having good nimble metadata to feed to some nix expression
14:48:08arkanoidexactly! it is more important to have a good nim package repo with metadata to assest the requirements for reproducible builds
14:48:36FromDiscord<haxscramper> that is covered by an RFC
14:49:14FromDiscord<haxscramper> I don't mention package hash on publish, but I guess that can be easily added
14:50:11emeryI should update my stuff to generate a report of what doesn't build and why
14:57:06arkanoidemery, 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:05FromDiscord<dom96> how are reproducible builds with nim impossible?
15:05:16*max22- joined #nim
15:06:00FromDiscord<haxscramper> In reply to @arkanoid "it is not as": this
15:06:26FromDiscord<haxscramper> In reply to @arkanoid "I mean, it's hard,": and this
15:07:54arkanoiddom96: 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:15FromDiscord<krisppurg> sent a long message, see http://ix.io/3tZB
15:15:21FromDiscord<dom96> In reply to @arkanoid "<@132595483838251008>: when nim loads": I mean... it could. You could also statically link everything
15:15:31FromDiscord<dom96> Nothing about Nim makes this "impossible"
15:18:42arkanoiddom96: 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:36arkanoidin that case yeah, you don't need anything else, but statically linking everything is not an option every time
15:22:32FromDiscord<dom96> Well of course, the point is it's not impossible 🙂
15:23:35arkanoidwhat 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:13arkanoiddom96: yet is impossible, as you don't pin gcc clang version even with a static build
15:30:09arkanoidI mean, you can, but that's outside the scope of nim. That's the whole point
15:31:45FromDiscord<dom96> We're just arguing over technicalities, I just don't think it's fair to describe it as "impossible"
15:31:54FromDiscord<dom96> it's possible, maybe with a lot of effort, but definitely possible
15:33:50arkanoidwell, given that, everything is possible. You can make nim compile straight to machine code while embedding posix interface to os
15:34:20FromDiscord<dom96> yes
15:34:27FromDiscord<dom96> a better description then is that "it's not practical"
15:34:58arkanoidterraforming venus is possible, but it's not practical
15:35:14FromDiscord<dom96> I agree
15:35:25FromDiscord<dom96> So I wouldn't say "terraforming venus is impossible"
15:37:48arkanoidtaking 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:11arkanoidthis is just my opinion
15:39:19FromDiscord<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:27FromDiscord<dom96> I agree that an external tool should handle this
15:40:12arkanoidwell, what nim lacks to get reproducible builds is larger than what is already in
15:42:48arkanoidand 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:48FromDiscord<krisppurg> someone?
15:51:51FromDiscord<krisppurg> https://discord.com/channels/371759389889003530/371759389889003532/868510366735413340
15:55:31federico3@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:32FromDiscord<PsychoClay> where does the dynlib pragma look for library files?
17:12:49*ming joined #nim
17:15:18arkanoidfederico3: exactly
18:10:03FromDiscord<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:09FromDiscord<exelotl> Zig has a different philosophy - favours explicitness over conciseness or extensibility
18:34:10FromDiscord<exelotl> from the homepage: No hidden control flow. No hidden memory allocations. No preprocessor, no macros.
18:34:54FromDiscord<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:03fn<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:00FromDiscord<leorize> nim is not aiming to be "better c", whatever that means \:P
19:28:02FromDiscord<Daniel> i think ppl might see it as better c due to the reason it translates to c/cpp then it compiles
19:33:52FromDiscord<haxscramper> I think any statically compiled, "3E" language seems like a better C nowdays
19:40:06FromDiscord<willyboar> ...or a faster python/ruby etc
19:51:07*Guest54 joined #nim
19:52:41*Guest54 quit (Client Quit)
21:09:54FromDiscord<@bracketmaster-5a708063d73408ce4> zig principles remind me somewhat of V
21:10:35FromDiscord<@bracketmaster-5a708063d73408ce4> has anyone here used nim for serious embedded programming?
21:13:29FromDiscord<InventorMatt> PMunch made firmware for his keyboard in nim
21:14:23FromDiscord<InventorMatt> he gave a talk at nimconf about it
21:24:33FromDiscord<willyboar> iirc federico3
21:25:37FromDiscord<dom96> I'm using Nim for quite a big embedded project
21:25:42FromDiscord<dom96> works well
21:30:23*max22- quit (Quit: Leaving)
21:30:28*Vladar quit (Quit: Leaving)
21:42:22FromDiscord<exelotl> same :D
21:44:51FromDiscord<Jakraes> How do I turn a string into an int?
21:45:11FromDiscord<exelotl> parseInt from the strutils module
21:45:18FromDiscord<Jakraes> Thank you
21:49:05FromDiscord<ElegantBeef> And as it can raise an exception you probably should throw it in a try except for program stabillity 😛
21:50:03FromDiscord<@bracketmaster-5a708063d73408ce4> has nimconf been in person before?
21:53:28FromDiscord<exelotl> nope, first one was in 2020 a few months into the pandemic
22:14:01FromDiscord<zetashift> FOSDEM nim room is basically a mini in person nimconf tho
22:15:32FromDiscord<@bracketmaster-5a708063d73408ce4> ah OK
22:38:36FromDiscord<Valor> In reply to @haxscramper "I think any statically": whats "3E"
22:46:12FromDiscord<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:52FromDiscord<Hi02Hi> In reply to @バロザード "whats "3E"": I think its the "Efficient, expressive, elegant" thats on the nim homepage
23:02:05FromDiscord<Valor> ah
23:28:10*max22- joined #nim
23:29:24*max22- quit (Remote host closed the connection)
23:44:13FromDiscord<carmysilna> What's the most idiomatic way to define a set of tags for one `when defined(x)` predicate and another set otherwise