<< 27-10-2024 >>

03:46:35*Artea quit (Read error: Connection reset by peer)
04:58:36*SchweinDeBurg quit (Quit: WeeChat 4.5.0-dev)
04:59:01*SchweinDeBurg joined #nim
06:19:33FromDiscord<Robyn [She/Her]> In reply to @bubbly_avocado_86424 "i've used computers for": Cargo, Golang?
06:19:44FromDiscord<Robyn [She/Her]> Rust, Golang
06:31:33FromDiscord<bubbly_avocado_86424> yeah, i stand at least partially corrected
06:33:51FromDiscord<Robyn [She/Her]> Zig doesn't even have a package manager
06:34:20FromDiscord<Robyn [She/Her]> In reply to @bubbly_avocado_86424 "yeah, i stand at": Though, what compiled languages that have package managers don't require compiling the package?
06:34:36FromDiscord<Robyn [She/Her]> VM languages don't really count, I'm talking about languages that target native code
06:35:08FromDiscord<Robyn [She/Her]> this isn't me taking the piss or anything, i genuinely can't think of any rn
06:35:17FromDiscord<random.visitor> plenty of people apt install blah-dev ; ./compile stuff
06:35:27FromDiscord<random.visitor> but ... apart from that, I can't think of any
06:35:34FromDiscord<random.visitor> and my example is a bit of a stretch
06:36:07FromDiscord<Robyn [She/Her]> yeahhh
06:36:21FromDiscord<random.visitor> maybe in the embedded world? single board chips and all that?
06:36:30FromDiscord<random.visitor> but no idea, not really my forte
06:36:51FromDiscord<random.visitor> cause otherwise imagine having to deal with glibc, uclibc, musl-libc, x86, x64, aarch, powerpc, etc
06:37:11FromDiscord<Robyn [She/Her]> aren't the sources available usually?
06:37:47FromDiscord<random.visitor> I was thinking back to a while ago I was playing with esp-32, and I vaguely recall ./something to pull a pre-compiled library and source code
06:38:08FromDiscord<Robyn [She/Her]> hm...
06:38:10FromDiscord<random.visitor> but I'd have to go back several years to look at notes - not really my thing anymore
06:38:17FromDiscord<Robyn [She/Her]> that'd make sense ig
06:38:20FromDiscord<Robyn [She/Her]> and fair
06:40:46FromDiscord<random.visitor> I can't remember if I'm thinking of nim or another language - but wasn't there a watch and rebuild webserver for nim someone did?
06:41:07FromDiscord<random.visitor> it'd try to compile it when it noticed the source changed?
06:42:56FromDiscord<bubbly_avocado_86424> After struggeling with httpYac in vscode I came to think i would be able to get the code working in Nim in just a few hours (since zero practical exposure to Nim)↵I'm getting close and it's been less than one hour, almost no programming experience beforehand
06:43:04FromDiscord<Robyn [She/Her]> In reply to @random.visitor "it'd try to compile": huh... no clue but seems fairly standard
06:43:47FromDiscord<Robyn [She/Her]> In reply to @bubbly_avocado_86424 "After struggeling with httpYac": have you followed the docs on the site to install Nim?
06:44:11FromDiscord<Robyn [She/Her]> the nim-lang.org Nim extension should install the lang server automatically once you have Nim set up
06:45:27FromDiscord<bubbly_avocado_86424> I'm using Zed now since VSCode on Linux has this sandbox since running in Flatpak
06:45:53FromDiscord<Robyn [She/Her]> In reply to @bubbly_avocado_86424 "I'm using Zed now": ah
06:47:01*coldfeet joined #nim
06:47:49FromDiscord<bubbly_avocado_86424> nph keeps blurting about "formatting failed"
06:48:24FromDiscord<bubbly_avocado_86424> i copied the config from the nph home page into settings.json but no real clue why it fails
06:49:05FromDiscord<Robyn [She/Her]> what are you trying to do, exactly?
06:49:21FromDiscord<bubbly_avocado_86424> have inline completion working
06:49:25FromDiscord<bubbly_avocado_86424> that actually works
06:49:39FromDiscord<Robyn [She/Her]> `nph` is a formatting tool
06:49:57FromDiscord<bubbly_avocado_86424> oh, sorry, yes
06:49:59FromDiscord<Robyn [She/Her]> No clue about Zed but nimlangserver should just work, and it does for me
06:50:29FromDiscord<Robyn [She/Her]> Sorry I can't really help, since I use VSC
06:52:18FromDiscord<bubbly_avocado_86424> progressing though
06:53:16FromDiscord<bubbly_avocado_86424> able to query the json from an http site↵can determine type of json key↵now looking how to iterate the json and print each key + key type
07:02:16FromDiscord<bubbly_avocado_86424> sent a long message, see https://pasty.ee/YOLigcRq
07:48:12*Artea joined #nim
07:48:37FromDiscord<xtrayambak> In reply to @bubbly_avocado_86424 "i've used computers for": Try downloading a binary package from Cargo ;)
07:56:34*ntat joined #nim
10:59:29*ntat quit (Quit: Leaving)
11:16:54FromDiscord<bubbly_avocado_86424> sent a long message, see https://pasty.ee/umKFeJEB
11:17:29FromDiscord<bubbly_avocado_86424> Nim is to me the easiest and most powerful language I ever learned↵a game changer for my projects and efforts
11:17:49FromDiscord<bubbly_avocado_86424> (edit) "learned↵a" => "started to learn↵a"
11:36:39*coldfeet quit (Quit: leaving)
11:39:35*coldfeet joined #nim
11:50:06*coldfeet quit (Quit: leaving)
13:35:39FromDiscord<odexine> The closest one has to a list of “audited” packages is the awesome list
13:35:51FromDiscord<odexine> https://github.com/ringabout/awesome-nim
13:51:13FromDiscord<rakgew> besides the std lib in each language -↵which language really does have this?↵(@bubbly_avocado_86424)
14:35:30*Artea quit (Remote host closed the connection)
14:41:14*ryuukk left #nim (https://quassel-irc.org - Chat comfortably. Anywhere.)
14:41:48*xet7 quit (Quit: Leaving)
14:42:05*xet7 joined #nim
15:54:59FromDiscord<bubbly_avocado_86424> In reply to @rakgew "besides the std lib": it is not sensible to compare with "what others have" or "what others do"↵it is a well meant comment and given the future where SBOM / reproducible builds will become important this would help Nim to grow
15:56:01FromDiscord<bubbly_avocado_86424> In reply to @odexine "https://github.com/ringabout/awesome-nim": thanks but that's not what "audited" means↵audited means paired with code review reports and such (SCA,DCA) etc.
15:56:10FromDiscord<odexine> i know it is not
15:56:17FromDiscord<odexine> there is none otherwise
15:56:41FromDiscord<odexine> closest thing to actually audited is stuff that Status uses, i guess
15:56:50FromDiscord<odexine> In reply to @odexine "i know it is": (i put audited in quotes for a reason)
15:57:50FromDiscord<bubbly_avocado_86424> In reply to @odexine "(i put audited in": i guessed so yet try to not go forth on guessing
15:58:05FromDiscord<odexine> well yeah, true
15:58:21FromDiscord<bubbly_avocado_86424> i know for Perl there was this move to ActiveState Perl at one point for a similar reason
15:58:27FromDiscord<odexine> better to err on the side of caution kinda thing
15:58:56FromDiscord<odexine> we're nowhere near big enough for a large collection of audited packages
15:59:15FromDiscord<bubbly_avocado_86424> either way, most concerns wrt supply chain i think can be addressed by vetting package sources for any project with such criticality / sensitivity
16:00:02FromDiscord<bubbly_avocado_86424> I'm also curious how this transpiling from Nim to other languages can support 'secure code by design' so to speak. Transpiling should offer a means to 'do the right thing' wrt memory safety and such
16:00:39FromDiscord<bubbly_avocado_86424> In reply to @odexine "we're nowhere near big": true yet is has to start somewhere and should a business have a casual look this may become a spearhead for Nim
16:04:37FromDiscord<odexine> the trouble is finding one willing to
16:05:35*ntat joined #nim
16:13:29FromDiscord<bubbly_avocado_86424> sent a long message, see https://pasty.ee/ghieJuRq
16:39:14*lucasta joined #nim
17:00:12*coldfeet joined #nim
18:34:14FromDiscord<bubbly_avocado_86424> when writing a simple program i'm using one proc to walk a json, i then call a second proc and would like to call the first proc from the second proc↵such does not seem possible with what I know today, what approach is recommended ?
18:35:10FromDiscord<logan.plug0> sent a long message, see https://pasty.ee/tdoMIRbo
18:35:12FromDiscord<logan.plug0> sent a long message, see https://pasty.ee/nTulKPXK
18:38:14FromDiscord<solitudesf> In reply to @bubbly_avocado_86424 "when writing a simple": forward declare second proc
18:39:20FromDiscord<solitudesf> In reply to @solitudesf "forward declare second proc": or first. your description is bit confusing.
18:39:59FromDiscord<bubbly_avocado_86424> In reply to @solitudesf "forward declare second proc": makes sense, how do i do that ?
18:40:13FromDiscord<solitudesf> just write a function signature without a body
18:40:19FromDiscord<bubbly_avocado_86424> eh ?
18:40:58FromDiscord<bubbly_avocado_86424> found this https://nim-lang.org/docs/manual.html#types-procedural-type
18:41:34FromDiscord<michaelb.eth> sent a code paste, see https://play.nim-lang.org/#pasty=ylbGDPlC
18:44:35FromDiscord<bubbly_avocado_86424> sent a long message, see https://pasty.ee/AuaazsVM
18:45:20FromDiscord<michaelb.eth> so you want to leave the = part off dive declaration, then define dive below walk
18:46:26FromDiscord<michaelb.eth> sent a code paste, see https://play.nim-lang.org/#pasty=RCRMHlKX
18:46:37FromDiscord<bubbly_avocado_86424> aaahhh
18:48:09FromDiscord<bubbly_avocado_86424> sure i'm going to spend a few more hours on getting that to work
18:48:33FromDiscord<bubbly_avocado_86424> much similar to bash i guess, forgot how i solved that 😄
18:54:07FromDiscord<bubbly_avocado_86424> ok, almost works now, thanks
18:54:35FromDiscord<bubbly_avocado_86424> ok, almost works now, thanks
18:58:21FromDiscord<bubbly_avocado_86424> I guess this means i've to start over since this does not work with json + iteration? ↵`node.kind == JObject` : pairs() can not iterate a JsonNode of kind JArray [AssertionDefect]
19:07:36*ntat quit (Quit: Leaving)
19:27:39*coldfeet quit (Remote host closed the connection)
19:30:07FromDiscord<frusadev> Hi there! How to define a type before implementing it?
19:30:50FromDiscord<Elegantbeef> You don't
19:30:57FromDiscord<frusadev> Oh!
19:32:23FromDiscord<frusadev> sent a code paste, see https://play.nim-lang.org/#pasty=lXEAJzyr
19:32:55FromDiscord<frusadev> (edit) "https://play.nim-lang.org/#pasty=WTdQkwkG" => "https://play.nim-lang.org/#pasty=sNYXpgpy"
19:33:21FromDiscord<Elegantbeef> Declare them in the same type block and that also will not work
19:33:54FromDiscord<frusadev> Oh! So i declare both of them in the same `type` block
19:33:57FromDiscord<frusadev> ?
19:34:08FromDiscord<Elegantbeef> Yes
19:34:16FromDiscord<Elegantbeef> But `ValueType | Object` is not a valid type
19:35:14FromDiscord<frusadev> 🤔 Oh!
19:38:01FromDiscord<frusadev> But it actually compiles🤔↵I guess i have to manually check that...
19:59:07FromDiscord<bubbly_avocado_86424> @elegea
20:00:34FromDiscord<bubbly_avocado_86424> @ElegantBeef does it makes sense to consider a macro for iterating over json types which are reporting↵node.kind == JObject : pairs() can not iterate a JsonNode of kind JArray [AssertionDefect]↵↵this because the json is read, types identified, when an array or object is hit, it dives into that array / object looking for other array / object until it is exhausted doing so
20:00:55FromDiscord<bubbly_avocado_86424> (edit) "which are reporting↵node.kind" => "with this error↵node.kind"
20:07:12FromDiscord<Elegantbeef> No
20:07:18FromDiscord<Elegantbeef> Procedures exist, so use them
20:43:28FromDiscord<bubbly_avocado_86424> reading this type of doc is not proven 'easy'↵maybe i'm rushing
20:44:03FromDiscord<Elegantbeef> You just need a case statement to traverse a Json tree
20:47:31FromDiscord<bubbly_avocado_86424> yes, but this json i'm training on is nested, the one I aim to parse is larger and has rather complex structure
20:49:58FromDiscord<Elegantbeef> A macro is not for complex runtime values
20:50:04FromDiscord<bubbly_avocado_86424> i've used the case statement to match with each type, works fine↵in other languages i believe a json[0][0] would return the first value of the first key↵with Nim such does not work apparently
20:50:30FromDiscord<bubbly_avocado_86424> In reply to @Elegantbeef "A macro is not": yes, i read the warning to only use a macro in rare cases
20:50:45FromDiscord<Elegantbeef> `[0][0]` returns a `JsonObject` you need to extract your data
20:50:58FromDiscord<Elegantbeef> Sorry JsonNode
20:52:05FromDiscord<bubbly_avocado_86424> before i walked the json with ↵↵for k,v in pairs(myjson):
20:52:21FromDiscord<bubbly_avocado_86424> followed by the case of for each type
20:52:48FromDiscord<bubbly_avocado_86424> but use of pairs() fails when iterating
20:53:36FromDiscord<bubbly_avocado_86424> scratching my head on that one
20:55:20FromDiscord<bubbly_avocado_86424> oh, wait, this actually works without pairs() too
20:56:32FromDiscord<Elegantbeef> Causue `pairs` only works on JObject
20:56:33FromDiscord<Elegantbeef> so guard for non JObjects
20:57:48FromDiscord<bubbly_avocado_86424> thanks, i think it's enough for today↵i made progress and Nim feels natural↵when I read it was built on Pascal and Modula i felt happy↵it is reasonably easy to work with and the logic sinks in eventually
21:33:02*lucasta quit (Quit: Leaving)
21:35:52*coldfeet joined #nim
22:03:21*coldfeet quit (Remote host closed the connection)
22:20:17*Artea joined #nim