<< 26-03-2021 >>

00:00:45FromDiscord<dk> I think they use decorators mostly because they don't have other metaprogramming features
00:00:53FromDiscord<dk> it's propably not even a design choice
00:01:50FromDiscord<no name fits> I see πŸ€” Do you have a personal preference, while we're at it?
00:02:25FromDiscord<dk> it's been a while, I'll need to look at my code
00:03:12FromDiscord<no name fits> Alright. Well I should really go sleep before I do another all-nighter. Thanks for the feedback
00:03:55FromDiscord<dk> I did something like this `addRoute HttpGet, "/", proc(vars: var ReqVars) =`
00:04:09FromDiscord<dk> in my server """framework"""
00:04:22FromDiscord<dk> so not very special
00:04:43FromDiscord<dk> maybe beacuse I didn't need much
00:06:55FromDiscord<zija1504> In reply to @no name fits "I'll take a look": You can always build routing based on radix tree. I think nim lacks framework that use radix for routing. I know asp net core implements routing middleware with radix
00:10:17FromDiscord<no name fits> In your opinion then, what would the tree be based on? method names?
00:10:50FromDiscord<no name fits> file layout in the os?
00:10:56FromDiscord<no name fits> @zija1504
00:12:01FromDiscord<jfmonty2> If I have a `[]` proc for my type that just passes through the indexing to one of its fields, why does it take 4-5x as long as indexing on the field directly? https://play.nim-lang.org/#ix=2U5A
00:13:15FromDiscord<ElegantBeef> templates/inline are quicker https://play.nim-lang.org/#ix=2U6o
00:14:06FromDiscord<ElegantBeef> Also are you testing in release, debug or danger?
00:15:04FromDiscord<ElegantBeef> anyway if you're wanting code to directly plopped in use a template
00:16:19FromDiscord<jfmonty2> hm ok
00:30:13*fputs quit (Quit: WeeChat 3.1)
00:30:32*fputs joined #nim
00:35:12FromDiscord<dk> isn't compiler supposed to inline simple procs on it's own? :^(
00:37:02*zedeus quit (Ping timeout: 246 seconds)
00:40:40FromDiscord<ElegantBeef> Well that depends on if it's debug or release afaik
00:41:21FromDiscord<ElegantBeef> yea both are at 0ms in release
00:42:41FromDiscord<ElegantBeef> 1 microsecond and 350 nanoseconds for the proc and 232 nanoseconds for the manual indexing
00:44:11FromDiscord<jfmonty2> mmm, ok but that's still about a factor of 6
00:44:33FromDiscord<ElegantBeef> Yea well let's benchmark it properly
00:47:37FromDiscord<ElegantBeef> Cant t ell if the benchmark is fucking up but with `-d:lto` they go down to 0ms
00:47:41FromDiscord<ElegantBeef> (edit) "t ell" => "tell"
00:49:25FromDiscord<ElegantBeef> So an actual benchmark https://media.discordapp.net/attachments/371759389889003532/824807212932268052/unknown.png
00:49:47FromDiscord<jfmonty2> huh
00:50:14FromDiscord<ElegantBeef> Well release with 10000 runs
00:50:52FromDiscord<jfmonty2> it seems that most of the variance was coming from computing the duration inline in the call to `echo`
00:51:01FromDiscord<jfmonty2> foolishly I assumed that wouldn't make a difference
00:51:12FromDiscord<ElegantBeef> For bench marking i highly suggest using benchy
00:51:24FromDiscord<jfmonty2> I'll have to check it out
00:51:44FromDiscord<ElegantBeef> https://play.nim-lang.org/#ix=2U6I
00:51:48FromDiscord<ElegantBeef> What i was testing
00:51:57FromDiscord<jfmonty2> Meanwhile why does it not seem to make a difference if I go from 1M to 100M iterations? That seems... odd. Is the compiler just completely optimizing away my array indexing?
00:52:17FromDiscord<ElegantBeef> Probably since it's indexing `0` always
00:52:28FromDiscord<jfmonty2> ahh
00:52:55FromDiscord<ElegantBeef> do `i.mod(wrap.inner.len)` for more varied logic
00:53:02FromDiscord<jfmonty2> ok there we go, changing it to `[i mod 16]` gives me 47ms for the proc and 36ms for the direct.. exactly πŸ˜„
00:53:37FromDiscord<ElegantBeef> It's always important to benchmark what you want to and nothing more πŸ˜„
00:53:51FromDiscord<ElegantBeef> Also important to do it on release with the optimizer is turned on
00:53:57FromDiscord<ElegantBeef> (edit) removed "is"
00:54:20FromDiscord<jfmonty2> And of course you are correct that using a template instead of a proc makes them exactly the same
00:54:29FromDiscord<jfmonty2> but _hoo_ boy does turning on lto make a difference here
00:54:32FromDiscord<ElegantBeef> Well even the proc in my tests is identical
00:55:08FromDiscord<ElegantBeef> Yea i'm uncertain if LTO is showing actual values or not considering benchy is showing 0.000ms for all πŸ˜„
00:55:10FromDiscord<jfmonty2> I guess it probably just optimizes the whole benchmark away again, since it goes back down to 100ns
00:55:17FromDiscord<jfmonty2> yeah
00:55:22FromDiscord<jfmonty2> compilers are smart
00:55:46FromDiscord<ElegantBeef> Yea are we benchmarking actual computation or whether the compiler did thinks super smart πŸ˜„
00:56:02FromDiscord<ElegantBeef> But anyway, there it's most likely inlined and we're all happy
00:56:06FromDiscord<ElegantBeef> If still concerned look at the C
00:56:12FromDiscord<ElegantBeef> If still concerned look at the asm
00:56:18FromDiscord<ElegantBeef> If still concerned hit your pc with a hammer
00:56:29FromDiscord<jfmonty2> if still concerned hit my head with another hammer?
00:56:39FromDiscord<ElegantBeef> Nah same hammer, we arent made of money
00:56:43FromDiscord<jfmonty2> fair enough πŸ˜„
01:00:31FromDiscord<that_dude> sent a long message, see https://paste.rs/aX9
01:01:18FromDiscord<exelotl> huh ix.io seems down
01:01:39FromDiscord<jfmonty2> I think it's erratic, I got a Cloudflare error a while back but it's working for me now
01:02:10FromDiscord<exelotl> ah I can see the code now
01:02:19FromDiscord<ElegantBeef> @that_dude use `var: Big` and `.mitems` when iterating
01:02:27FromDiscord<ElegantBeef> `var` is a mutable reference
01:02:45FromDiscord<ElegantBeef> Oh wait i misread
01:03:04FromDiscord<InventorMatt> you can also make small a ref object
01:03:35FromDiscord<jfmonty2> Yeah, without that `big_obj.temp` will just be a copy of the original `Small`
01:04:21*njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
01:04:28FromDiscord<that_dude> @InventorMatt I tried to make it a ref object in the proc but it didn't compile
01:04:42*njoseph joined #nim
01:05:09FromDiscord<InventorMatt> this doesn't work https://play.nim-lang.org/#ix=2U6L
01:05:29FromDiscord<that_dude> oh in the type
01:06:28FromDiscord<exelotl> there are performance ramifications for changing it to a seq[<some ref type>] though
01:07:27FromDiscord<that_dude> Is that the only only downside to using ref type? I remember reading that I should always use a regular object when I don't know which one to use
01:07:41FromDiscord<ElegantBeef> Yep that and nils
01:07:59FromDiscord<ElegantBeef> reference objects can be thrown all over the heap which means when doing logic over a list it's slower
01:08:27FromDiscord<ElegantBeef> They also are nilable if you dont use notniil
01:08:29FromDiscord<ElegantBeef> (edit) "notniil" => "notnil"
01:09:03FromDiscord<that_dude> What does nilable mean? I haven't needed to look into it before
01:09:11FromDiscord<that_dude> something like deletable?
01:09:29FromDiscord<ElegantBeef> There is nothing where the reference is pointing
01:09:43FromDiscord<ElegantBeef> So attempting to access anything there will throw a nice nilreference error
01:09:49FromDiscord<ElegantBeef> so you do that good ol
01:10:06FromDiscord<ElegantBeef> `if yourRef != nil: # do something`
01:10:21FromDiscord<ElegantBeef> or use`std/wrapnils` and do it automagically
01:11:38*shmorgle joined #nim
01:12:49FromDiscord<exelotl> the thing is, if all you want is mutability you shouldn't have to resort to ref
01:13:28FromDiscord<exelotl> sent a code paste, see https://play.nim-lang.org/#ix=2U6O
01:14:33FromDiscord<that_dude> I guess it's a two step thing I wanted to do. First find an object via a proc and then store it to a common location for other procs later
01:15:54FromDiscord<exelotl> yeah refs should give you the semantics you want there
01:16:12FromDiscord<that_dude> Alright, cool.
01:19:44FromDiscord<that_dude> Another thing while I'm here, recently I've been trying to write things similar to engines, and I've needed to worry about current parameters and settings. I haven't been able to find anything about global variables so I've taken the approach of creating a settings object and then passing it around into my procs for when I need to find some of setting values. Is there a better approach that I should be using instead?
01:24:15FromDiscord<that_dude> I take it back I have found a little about global variable, but I don't think in a way directly useful to me
01:24:22FromDiscord<that_dude> (edit) "variable," => "variables,"
01:24:45FromDiscord<that_dude> (edit) "I take it back ... I" added "partially"
01:24:51FromDiscord<that_dude> (edit) "partially" => "partially,"
01:25:39FromDiscord<exelotl> you can add an export marker to variables to make them accessible to anything that imports that module, as in `var foo: Settings`↡if there's only one instance of the settings object then it's probably OK to do that and refer to it directly rather than passing it around?
01:26:59FromDiscord<ElegantBeef> Depends on you view of global variables
01:27:05FromDiscord<ElegantBeef> (edit) "you" => "your"
01:27:50FromDiscord<that_dude> Yes, there is only one instance of settings. If I do `var foo: Settings`, in any proc, it will work in any later proc provided I created it first right?
01:27:51FromDiscord<ElegantBeef> worth noting you can make a `proc settings: lent Settings = foo` though if you want to read/write to them it's less useful
01:28:26FromDiscord<that_dude> I do want to be able to edit the setting at any time based on user input
01:28:32FromDiscord<that_dude> (edit) "setting" => "settings"
01:28:39FromDiscord<ElegantBeef> `lent T` is a read only reference, so it can be nice in areas you dont want to mutate them
01:28:46FromDiscord<exelotl> the `var foo: Settings` has to be at the top level in the module, outside of any function
01:29:35FromDiscord<exelotl> as in, export markers only work at the top level
01:30:08FromDiscord<exelotl> https://nim-lang.org/docs/manual.html#procedures-export-marker
01:30:44FromDiscord<that_dude> I think I understand. I'll be back if I need more help
01:32:02FromDiscord<ElegantBeef> Sorry you've expired all the help, you'll have to come back next year
01:32:07FromDiscord<that_dude> rq, is there any concerns about the ordering of the exported var? ie putting it before or after the procs that use it?
01:32:13FromDiscord<that_dude> lol
01:32:22FromDiscord<ElegantBeef> You need to declare all symbols before they're used
01:33:03FromDiscord<ElegantBeef> You can play with `{.experimental:"codeReordering".}` or just write code "proper"
01:33:34FromDiscord<that_dude> Alright, thanks.
01:34:52FromDiscord<ElegantBeef> Eventually declaration order is supposed to a lifted requirement, but it's not that hard to write code that abides by it imo
01:36:39FromDiscord<that_dude> True, I'm just a little bad at making sure everything is in the correct order when I'm 15+ procs
01:37:16FromDiscord<ElegantBeef> Well you can forward declare procedures if you need to
01:37:31FromDiscord<ElegantBeef> that way they can call any of them in any order
01:37:36FromDiscord<that_dude> I just kinda throw my new ones in where it feels like it has similar purpose to the ones around it
01:54:37FromDiscord<sealmove> is `nativesockets` module equivalent to rawsocket API?
01:57:21FromDiscord<Mustache Man> sent a code paste, see https://play.nim-lang.org/#ix=2U6V
01:58:14FromDiscord<Hi02Hi> doesnt that work fine?
01:59:23FromDiscord<Mustache Man> as a proc, yes.. i'm not sure why i'd choose a macro over a proc, but I'd like to know why it doesn't seem to work as a macro
01:59:48FromDiscord<sealmove> what do you mean "work as a macro"?
01:59:57FromDiscord<Mustache Man> i mean, change proc to macro
02:00:22FromDiscord<sealmove> erm... well... you might want to read up on macros, they work in completely different way than procs.
02:02:12FromDiscord<sealmove> macros are for code generation. you input some code and it gets transformed into different code. so inside its body you describe how the code is transformed, on AST level.
02:03:47FromDiscord<Mustache Man> ah, gotcha. in my head the distinction wasn't clear
02:04:20FromDiscord<sealmove> sent a code paste, see https://play.nim-lang.org/#ix=2U6Z
02:04:49FromDiscord<sealmove> if you want to write the code that you want to generate explicitly in your macro, you must use `quote do`.
02:05:37FromDiscord<Mustache Man> thank you! is there any advantage to either approach in this case?
02:05:38FromDiscord<sealmove> (edit) "https://play.nim-lang.org/#ix=2U6Z" => "https://play.nim-lang.org/#ix=2U70"
02:05:39FromDiscord<sealmove> and quote stuff that you want to get replaced
02:05:50FromDiscord<ElegantBeef> Macros are meant for introspection or things the language doesnt support
02:06:00FromDiscord<sealmove> yes, there is an important principle, give me a minute, I'll quote it from the manual
02:06:24FromDiscord<ElegantBeef> "Use the simplest tool at your disposal"
02:06:39FromDiscord<ElegantBeef> Dont use a template when a proc will suffice, dont use a macro when a template will suffice
02:06:44FromDiscord<sealmove> yes, that
02:07:15FromDiscord<sealmove> In reply to @ElegantBeef "Macros are meant for": yes, you can think of them as a way to extend the language for your needs. it's how you make DSLs.
02:07:39FromDiscord<sealmove> but important thing is, everything happens in compile-time, you just generate code instead of writing it by hand
02:08:00FromDiscord<sealmove> you can use `echo repr result` at the end of your macro to actually see the generated code
02:08:13FromDiscord<ElegantBeef> or `--expandMacro:name` from the cli πŸ˜„
02:08:21FromDiscord<sealmove> yup
02:08:37FromDiscord<Mustache Man> awesome! so much yet to learn
02:08:51FromDiscord<Mustache Man> i feel like I'm really exercising my brain to learn Nim
02:09:07FromDiscord<ElegantBeef> But the point to hit home is that they're "procedures" that are run at compile time and can expand or change code passed into πŸ˜„
02:09:41FromDiscord<ElegantBeef> It's a language with a bunch of features that you wouldnt have seen coming from most higher level languages
02:11:17FromDiscord<sealmove> sent a code paste, see https://play.nim-lang.org/#ix=2U72
02:11:24FromDiscord<ElegantBeef> Lol
02:11:44FromDiscord<ElegantBeef> Was going to mention the return type was wrong
02:12:12FromDiscord<sealmove> i haven't seen a macro with a return type like this, but it doesn't bother the compiler. `result` is wrong though
02:13:55FromGitter<deech> Are there any docs on how to use the `magic` pragma?
02:15:40*Tlangir quit (Remote host closed the connection)
02:16:05*Tlangir joined #nim
02:16:21*rockcavera quit (Remote host closed the connection)
02:17:16FromDiscord<ElegantBeef> The magic pragma afaik is just "Hey this is implemented in the compiler"
02:17:55FromDiscord<sealmove> If I want to do raw sockets, I just use `posix` module?
02:18:17FromDiscord<ElegantBeef> Wouldnt nativesockets be "raw sockets"
02:18:45FromDiscord<sealmove> I thought so, but I don't see same functionality. Maybe I'm mistaken, trying to figure it out...
02:19:57FromDiscord<sealmove> I mean, if it can do the same things it looks awesome! Because it looks like it's higher level than the rawsocket API, not a thin wrapper.
02:22:59FromDiscord<ElegantBeef> Yea idk, i'm a numpty
02:24:56FromDiscord<sealmove> ok... so these 2 libraries (`net` and `nativesockets`) can do the same things as C but they do it in a higher-level/better way -the Nim way-. And then we also have `posix` which thinly wraps the C headers (for example `sys/socket.h`), and if you are mad and want to do things the C way you use those. Maybe `nativesockets` have limitations, I'll have to find out after using them.
02:59:46*Lord_Nightmare quit (Quit: ZNC - http://znc.in)
03:03:18*Lord_Nightmare joined #nim
03:31:26*mal`` quit (Quit: Leaving)
03:52:46*mal`` joined #nim
04:48:16*Xe is now known as Cadey
04:56:08*waleee-cl quit (Quit: Connection closed for inactivity)
05:00:42*spiderstew_ joined #nim
05:01:36*spiderstew quit (Ping timeout: 245 seconds)
05:19:41*jxy joined #nim
05:20:29*narimiran joined #nim
05:28:35*Gustavo6046 joined #nim
05:32:18*letto quit (Quit: Konversation terminated!)
05:32:48*letto joined #nim
05:53:38FromGitter<glyh> Hello everyone! How do we think our language compare to crystal lang?
05:54:00FromDiscord<Rika> more mature
05:54:11FromDiscord<Rika> ~~can compile on windows~~ i dont remember if thats still a thing on crystal
05:54:27FromGitter<glyh> Anything else?
05:54:41FromDiscord<Rika> i dont know, most likely
05:54:50FromDiscord<Rika> but i'd say theyre incomparable anyway
05:55:28FromDiscord<Rika> syntax differs a lot
05:55:43FromGitter<glyh> I just get to know these two. And it seems like they're both trying to have an expressive language of high performance
05:56:08FromGitter<glyh> They're trying to solve the same problem I think
05:56:18FromDiscord<Rika> crystal syntax is more reminiscent of ruby
05:56:43FromDiscord<Rika> nim syntax is reminiscent of a whole bunch of languages (prolly "most python looking") but not ruby
05:56:51FromDiscord<Rika> ...i believe
05:57:09Prestigedidn't python stem from ruby
05:57:25Prestigeor maybe the other way, icr
05:57:59FromDiscord<Rika> like saying that we look similar to fish since we stemmed from them
05:58:01FromDiscord<Rika> πŸ˜›
05:58:17FromGitter<glyh> fish shell?
05:58:21Prestigemore like apes
05:58:24FromDiscord<ElegantBeef> We as humans
05:59:57FromGitter<glyh> Funny
06:00:11FromGitter<glyh> πŸ˜›
06:19:48qwrmaybe i'm wrong, but afaik crystal was quite slow to compile - nim on the other hand compiles fast
06:23:39qwrand yeah, the semantics and solutions to many problems are quite different
06:25:18qwrnim while python looking has imho more Pascal/Modula influences
06:27:35qwrwhile crystal seems to be derived from idea of what ruby would be with somewhat sane static type inference and AOT compilation
06:40:10*timdorohin quit (Ping timeout: 258 seconds)
06:40:20*qwr also thinks that Nim has generally more focus on leanness and performance
06:41:58qwrthough crystal seems to actually optimize code very well: https://framework.embarklabs.io/news/2019/11/18/nim-vs-crystal-part-1-performance-interoperability/
06:50:40FromDiscord<Yardanico> that benchmark is not the greatest but yeah
06:51:05FromDiscord<Yardanico> those json benchmarks are pretty artificial but nim's stdlib json module can be a little slow
06:51:11FromDiscord<Yardanico> same for base64 :D
06:51:17FromDiscord<Yardanico> you can also check out https://github.com/kostya/benchmarks
06:51:20FromDiscord<ElegantBeef> Yea was going to say, they're not very good
06:51:40FromDiscord<ElegantBeef> https://github.com/treeform/jsony
06:51:46FromDiscord<ElegantBeef> Benches a bunch there
06:52:07FromDiscord<ElegantBeef> Yard have you fixed <urls> sending the `>` to irc?
06:52:13FromDiscord<Yardanico> no
06:52:22FromDiscord<Yardanico> no one even asked me but I know that issue myself :P
06:52:27FromDiscord<ElegantBeef> I made an issue
06:52:52FromDiscord<ElegantBeef> Or i thought it did
06:52:58FromDiscord<Yardanico> lol
07:03:05*vicfred joined #nim
07:05:46*l1x quit (Ping timeout: 240 seconds)
07:06:16*kinkinkijkin quit (Read error: Connection reset by peer)
07:06:44*kinkinkijkin joined #nim
07:07:31*l1x joined #nim
07:35:54*lritter joined #nim
07:44:09ForumUpdaterBotNew thread by User71383: Error: unknown substition variable: attype, see https://forum.nim-lang.org/t/7702
07:45:52*PMunch joined #nim
07:46:43qwrthese (from github) benchmark results are more what i would have expected
08:12:34FromDiscord<Yardanico> they're also much newer :)
09:09:37FromDiscord<wiremoons> How frequently do the docs (generated from the Nim source code) on the https://www.nim-lang.org/docs/ web site get updated/refreshed?
09:12:21FromDiscord<wiremoons> Just curious as the 'Terminal' docs are not in sync with the source code version - which was confusing me in relation to a depreciation message I was seeing when compiling some older code.
09:12:34FromDiscord<ElegantBeef> They should be on parity with the latest stable branch
09:13:52FromDiscord<ElegantBeef> the terminal module has no deprecated symbols
09:16:30FromDiscord<wiremoons> The docs on the web site say to use: `system.addQuitProc(resetAttributes)` When I compile code using that (Nim version 1.4.4.) it states that that proc is depreciated and instead use: `exitprocs.addExitProc(resetAttributes)` instead.
09:17:41FromDiscord<ElegantBeef> Well that's what the docs say
09:17:51FromDiscord<ElegantBeef> So you can make your first PR to update the docs! πŸ˜„
09:19:13FromDiscord<ElegantBeef> I put my full faith in you to resolve this πŸ˜› https://github.com/nim-lang/Nim/blob/version-1-4/lib/pure/terminal.nim#L15
09:19:22FromDiscord<wiremoons> Was going fix - but the GitHub Nim version of `terminal.nim` is correct already... in `lib/pure/terminal.nim`
09:19:39FromDiscord<ElegantBeef> Ah then it's been fixed in devel and wasnt backported
09:20:11FromDiscord<ElegantBeef> https://nim-lang.github.io/Nim/terminal.html devel docs
09:20:22FromDiscord<wiremoons> Ok - so the docs on the web site will get back in sync in a future release ?
09:21:17FromDiscord<ElegantBeef> Well the docs on actual site are for stable, devel is on the git repo and is `1.5.X` at the moment, `1.6.0` is the next stable release
09:21:51FromDiscord<ElegantBeef> So when `1.6.0` releases the docs will be corrected unless the change gets backported, which means it'll be released with `1.4.6`
09:22:10FromDiscord<demotomohiro> Nim document in devel:↡https://nim-lang.github.io/Nim/
09:22:16FromDiscord<ElegantBeef> Yea i linked dit
09:22:18FromDiscord<ElegantBeef> (edit) "dit" => "it"
09:23:34FromDiscord<ElegantBeef> So the docs are proper on devel, so we can rejoice and throw a party
09:23:41FromDiscord<ElegantBeef> But sorta cry since they're wrong on stable
09:24:44FromDiscord<wiremoons> Ok - thanks for explaining πŸ™‚ Still unclear why I get a depreciation warning on stable (Nim version 1.4.4?) for a devel change? Probably just me being dumb! Main thing is it is ok and correct!
09:24:57FromDiscord<ElegantBeef> Ah the issue is the docs werent updated in stable
09:25:28FromDiscord<ElegantBeef> At some point the `addQuitProc` was deprecated, but someone missed it's reference in `terminal`
09:28:13FromDiscord<wiremoons> Ok - so the doc change only it was missing in `terminal.nim` when stable (1.4.4) was released (and the web site docs generated) - but has subsequently be updated in devel now (to correct it) - so will be in sync for the next stable release ?
09:28:55FromDiscord<ElegantBeef> Yes, the human error occurred, and will be resolved in the next release
09:29:13FromDiscord<wiremoons> Thanks - I got there in the end.... LOL
09:29:19FromDiscord<ElegantBeef> The github.io docs are the devel docs which will be what you see next major release
09:29:32FromDiscord<ElegantBeef> so when 1.6 comes along
09:31:47*kitech1 quit (Remote host closed the connection)
09:32:03*kitech1 joined #nim
10:16:36*Vladar joined #nim
10:34:38*tribly left #nim ("WeeChat 3.0.1")
10:51:19*WilhelmV1nWeiner quit (Quit: leaving)
10:51:28*WilhelmVonWeiner joined #nim
11:01:30FromGitter<HJarausch_gitlab> I am baffled. I have the file *withFile.nim* in my current directory : ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ I get the error message ``Error: undeclared identifier: 'withFile'`` - why ? [https://gitter.im/nim-lang/Nim?at=605dbf0a3a9448256c2f65fa]
11:02:52*Torro joined #nim
11:07:52FromDiscord<konsumlamm> you didn't export your template
11:08:08FromDiscord<Yardanico> also try to name the symbols and the module itself differently
11:08:15FromDiscord<Yardanico> otherwise it can lead to some confusing errors
11:08:17*vicfred quit (Quit: Leaving)
11:08:18FromDiscord<konsumlamm> you have to mark it with ``
11:09:01FromDiscord<Rika> an asterisk (its not shown in gitter it seems)
11:09:27FromDiscord<Yardanico> https://nim-lang.org/docs/tut1.html#modules
11:15:48*xet7 quit (Quit: Leaving)
11:18:41FromDiscord<Zachary Carter> how is gitter even still a thing?
11:20:38ForumUpdaterBotNew thread by Alexeypetrushin: How to use global immutable variables in Threads?, see https://forum.nim-lang.org/t/7703
11:21:34FromDiscord<Yardanico> @Zachary Carter i guess because it offers an easy integration with github/gitlab (can login easily?)
11:21:39FromDiscord<Yardanico> also they recently started the merge with matrix
11:21:44FromDiscord<Zachary Carter> ahhh okay
11:21:51FromDiscord<Zachary Carter> I knew about the first statement you made
11:21:55FromDiscord<Zachary Carter> but not the second πŸ™‚
11:21:57FromDiscord<Yardanico> but yeah almost no one uses it nowadays
11:24:18*mfiano left #nim ("WeeChat 3.0")
12:06:18*jegfish[m] joined #nim
12:07:57*WilhelmVonWeiner quit (Quit: leaving)
12:08:05*WilhelmVonWeiner joined #nim
12:12:13FromGitter<HJarausch_gitlab> Thanks to you all, konsumlamm, Yardanico and Rika
12:17:09*leorize quit (Ping timeout: 240 seconds)
12:18:14*leorize joined #nim
12:18:25*sacredfrog quit (Quit: ZNC 1.8.2 - https://znc.in)
12:19:06*sacredfrog joined #nim
12:25:36*Gustavo6046 quit (Ping timeout: 252 seconds)
12:25:45*Gustavo6046_ joined #nim
12:27:52*Gustavo6046_ is now known as Gustavo6046
12:37:47*WilhelmVonWeiner quit (Quit: leaving)
12:45:28*Torro quit (Remote host closed the connection)
12:45:34*T0rr0 joined #nim
12:47:18*clyybber joined #nim
12:50:41*rockcavera joined #nim
13:04:24FromGitter<iffy> When my program exits with SIGSEGV, is it a true segfault or is it Nim safely handling a segfault? I'm guessing it's the latter
13:06:15*T0rr0 left #nim ("bye")
13:09:08FromDiscord<Yardanico> when you get SIGSEGV message in the output, it's Nim
13:09:17FromDiscord<Yardanico> Because Nim has default signal handlers on its own
13:15:46FromGitter<iffy> Okay, that was my understanding -- thanks for confirming!
14:00:53FromDiscord<Yardanico> you can disable them with -d:noSignalHandler
14:02:25leorize@iffy it's still a true segfault, it's just that we print you a nice stacktrace before we crash
14:07:27FromDiscord<Rika> what is "safely handling a segfault"?
14:15:56FromDiscord<ttx> Would I use {.fatal} to enforce ast standards?
14:20:55FromDiscord<Rika> in macros? you can
14:36:18FromDiscord<Zachary Carter> In reply to @Rika "what is "safely handling": I guess actually handling the signal rather than just allowing the program to terminate?
14:36:28FromDiscord<Zachary Carter> But I'm probably wrong πŸ™‚
14:40:50FromDiscord<Zachary Carter> I mean the program is going to terminate either way, but was the signal handled is the distinction I'm driving at if it wasn't clear. And again I'm probably wrong haha
14:40:51FromDiscord<Yardanico> @ttx for macros it's better to use macros-specific procs
14:41:03FromDiscord<Yardanico> https://nim-lang.org/docs/macros.html#error%2Cstring%2CNimNode
14:41:34FromDiscord<Yardanico> so the compiler can also propagate the node that's wrong and show it in the error message (and not some cryptic path to your macro code)
14:59:55*D_ quit (Ping timeout: 252 seconds)
15:01:07*anoj[m] joined #nim
15:03:04FromDiscord<rayman22201> so.... I'm at the Jitsi link, but the room is empty? https://meet.jit.si/NimDevMeet
15:03:23PrestigeIsn't that in 2 hours?
15:03:49FromDiscord<rayman22201> 4 UTC right?
15:03:58*D_ joined #nim
15:03:59PMunch1 hour, isn't it 4PM UTC?
15:04:18PMunchIt's 3PM UTC now
15:04:24Prestigeman why is daylight savings time a thing, throws me off
15:04:39FromDiscord<rayman22201> damnit! you are right! I forgot about DST
15:04:45PMunchIt might not be a thing for much longer in the EU :P
15:05:08*PMunch quit (Quit: leaving)
15:06:00FromDiscord<rayman22201> I got up early in my time zone for nothing πŸ˜›
15:06:04FromDiscord<Rika> F
15:06:23FromDiscord<Rika> sure is unfortunate that these are held at 1 am where i live
15:08:27FromDiscord<Zachary Carter> @rayman22201 o/ long time no see
15:12:48FromDiscord<rayman22201> o/
15:13:25FromDiscord<rayman22201> I mostly lurk these days. Good to see you
15:26:23FromDiscord<dom96> It’s that lovely time when the US ended DST but EU hasn’t yet lol
15:31:04*astronavt quit (Quit: ...)
15:31:20*Yardanico quit (Remote host closed the connection)
15:31:27*astronavt joined #nim
15:33:26*Yardanico joined #nim
15:40:15*Mister_Magister quit (Ping timeout: 240 seconds)
15:49:19FromDiscord<Yardanico> just as a final reminder - meeting starts in ~10 minutes :)
15:49:20FromDiscord<Yardanico> https://meet.jit.si/NimDevMeet
15:49:45*NimBot joined #nim
15:50:14*Mister_Magister joined #nim
15:50:16*letto_ joined #nim
15:50:35*letto quit (Ping timeout: 265 seconds)
16:00:30narimiranended DST?
16:08:08*clyybber quit (Quit: WeeChat 3.1)
16:13:04*j joined #nim
16:13:05*Mister_Magister quit (Quit: bye)
16:13:36*Mister_Magister joined #nim
16:14:00*Mister_Magister is now known as Guest66453
16:14:22*j is now known as jess
16:15:13*Guest66453 quit (Client Quit)
16:15:24*jegfish[m] is now known as Jeff[m]
16:15:48*Mister_Magister_ joined #nim
16:16:09FromDiscord<Zachary Carter> Yeah we haven't ended dst at all dom
16:16:22*Mister_Magister_ quit (Remote host closed the connection)
16:16:49*Mister_Magister_ joined #nim
16:17:02FromDiscord<Zachary Carter> We love DST and the imperial system. We protect them like we protect our guns. You're gonna have to come take em from us!
16:17:35FromDiscord<zajrik> I think Dom meant DST rolled over for the year, rather than the system was abolished
16:17:46Prestige^
16:17:50FromDiscord<Zachary Carter> Please come take them from us?
16:17:54PrestigeBut also, nobody likes DST
16:17:55FromDiscord<zajrik> lmao
16:18:01FromDiscord<zajrik> Yes, please come take them
16:18:13FromDiscord<Zachary Carter> Ah right - it's ended for the year.
16:18:16FromDiscord<Yardanico> the meeting is on-going btw :P
16:18:21FromDiscord<zajrik> I love gaining an hour of sleep once a year but I HATE losing an hour of sleep later in the year
16:19:09FromDiscord<Zachary Carter> Actually this time was lovely. I got to sleep for an extra hour even though we sprang forward because my employer is based in Poland.
16:19:26FromDiscord<zajrik> How fortunate
16:19:28FromDiscord<zajrik> :drakeLUL:
16:19:44FromDiscord<Zachary Carter> Now I get to wake up at 5am instead of 4am
16:20:26FromDiscord<zajrik> That's far too early still for my taste but if it works for you that's what matters lol
16:21:52FromDiscord<Zachary Carter> Yeah there are pluses and minuses. I work for a game studio so it's still better than getting to work at 9 and working on something I have little to no interest in.
16:22:39FromDiscord<zajrik> Very true
16:22:53FromDiscord<zajrik> Loving what you do is always the most important thing
16:24:44*haxscramper joined #nim
16:25:13narimiranPrestige: i like DST!!
16:25:54Prestigenarimiran: I'm disappointed
16:26:03narimiranhi disappointed, i'm dad
16:26:14*Prestige throws a shoe
16:27:08FromDiscord<Zachary Carter> dad is it really you?
16:27:40narimiran@Zachary Carter yes, it is me, i'm still out buying cigarettes
16:27:47FromDiscord<Zachary Carter> throws another shoe
16:28:12FromDiscord<Zachary Carter> damn Prestige! We just gave him a free pair of shoes!
16:28:32narimirannice, now i have two shoes. both left, but ok. free shoes.
16:29:01Prestigenow I have no shoes left
16:29:12narimiranbut you have shoes right, right?
16:29:15FromDiscord<Zachary Carter> yeah - I wasn't about to throw mine!
16:29:17Prestigeright
16:38:46FromDiscord<zajrik> I love that pretty much everything is an expression
16:38:54FromDiscord<zajrik> being able to use try/except in an assignment is so nice
16:40:35FromDiscord<zajrik> sent a code paste, see https://play.nim-lang.org/#ix=2Ub6
16:43:30FromDiscord<no name fits> So is that except the empty one?
16:43:39FromDiscord<no name fits> Or the default one or whatever the correct term is?
16:49:37FromDiscord<no name fits> no?
16:58:18*Mister_Magister_ is now known as Mister_Magister
16:59:36FromDiscord<zajrik> In reply to @no name fits "So is that except": Aye, `except: newJObject()` produces an empty JObject JsonNode which causes `isValidConfig` to be false since it won't match the pattern, so when I check `isValidConfig` later I can handle the invalid config
16:59:43FromDiscord<haxscramper> https://github.com/nim-lang/RFCs/issues/245#issuecomment-697354273 I also had idea for optional `or doError()` clause on failed match
17:00:14FromDiscord<haxscramper> But it didn't make into the final version
17:02:27FromDiscord<zajrik> I think that's not a bad idea but definitely clunky
17:05:26FromDiscord<zajrik> would it give you access to control flow for the block that contains the pattern? (`break`, `return`, etc)
17:07:47FromDiscord<zajrik> sent a code paste, see https://play.nim-lang.org/#ix=2Ubg
17:10:30FromDiscord<zajrik> would it have allowed that had it been implemented, rather
17:12:17FromDiscord<zajrik> (just to satisfy my curiousity)
17:13:24FromDiscord<no name fits> Also sorry to interject, but any recommended reading on closures?
17:15:23FromDiscord<Yardanico> as in?
17:15:37FromDiscord<Yardanico> closures are basically procs that capture the outside environment
17:15:42FromDiscord<Yardanico> (things outside of their body)
17:16:15FromDiscord<no name fits> Ah, alright
17:16:39FromDiscord<no name fits> Just trying to get more into functional programming and closures keep popping up
17:16:45FromDiscord<no name fits> closures and monads
17:17:43FromDiscord<haxscramper> sent a code paste, see https://paste.rs/ks7
17:17:57FromDiscord<haxscramper> Basically `isnot` was shot down because it is a feature overload
17:18:28FromDiscord<haxscramper> Which `fusion/matching` is already full of to be honest, but it is just so hard to drop out things
17:18:36FromDiscord<zajrik> totally valid
17:39:31*zedeus joined #nim
17:41:49*fredrikhr quit (Quit: Client Disconnecting)
17:42:55FromDiscord<no name fits> sent a code paste, see https://play.nim-lang.org/#ix=2Ubp
17:43:48FromDiscord<konsumlamm> no
17:43:54FromDiscord<konsumlamm> it works on the bit representation
17:44:18FromDiscord<no name fits> so the bits for "hou"?
17:45:23FromDiscord<konsumlamm> it looks at the bit representation of `house` and `hound`
17:45:43FromDiscord<konsumlamm> the first bit where they differ is the critical bit (thus the name critbit)
17:45:51FromDiscord<no name fits> aah
17:45:54FromDiscord<no name fits> and then it branches
17:46:27FromDiscord<konsumlamm> ye
17:46:54FromDiscord<no name fits> alright, so I suppose I don't have to do my own radix implementation
17:47:07FromDiscord<no name fits> cool
17:52:08FromDiscord<jtiai> Does nim have concept of macros?
17:52:40FromDiscord<no name fits> πŸ™‚ <https://nim-lang.github.io/Nim/manual.html#macros>
17:54:51FromDiscord<haxscramper> In reply to @jtiai "Does nim have concept": If you are looking for simple code substitution you can also check out https://nim-lang.org/docs/manual.html#templates, they are much simpler then macros
17:55:43FromDiscord<jtiai> Yes, looking something like #DEFINE in C
17:56:34FromDiscord<no name fits> Well, if it's for config, you could have a config file and use ``when``
17:56:59FromDiscord<Yardanico> @jtiai we have source code filters and templates
17:57:08FromDiscord<Yardanico> Usually templates can replace what you do in C with macros
18:00:54FromDiscord<jtiai> In reply to @no name fits "Well, if it's for": Nope, not for config. For inlining some assembly to do debugging.
18:01:05FromDiscord<no name fits> Ah, ok
18:01:31FromDiscord<haxscramper> In reply to @jtiai "Yes, looking something like": If you are looking for exact copy of `#define` you can do `const` https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-compileminustime-define-pragmas, and then check for this in `when myDefine == someValue`
18:01:51FromDiscord<haxscramper> Or just declare `const myConst = 1` in your code and check via `when`
18:02:13FromDiscord<haxscramper> `when` is a `#if` from C basically
18:06:21*krux02 joined #nim
18:08:38FromDiscord<jtiai> Woo. It works. πŸ™‚
18:08:52FromDiscord<jtiai> My OS doesn't work though.
18:10:48FromDiscord<haxscramper> ``when defined(os)``
18:10:53*lritter quit (Ping timeout: 246 seconds)
18:11:31FromDiscord<haxscramper> If you need to check if particular value is just defined (like OS, or CPU or some compiler feature), you need to use `defined()`
18:12:16FromDiscord<jtiai> I have some issues with IRQ handlers. Probably something broken in IDT or something.
18:13:45FromDiscord<jtiai> I mean that I'm writing currently my very own OS with Nim. Something that doesn't really exist... πŸ˜„
18:18:53FromDiscord<haxscramper> @zajrik I wrote spec for `opt` - https://github.com/haxscramper/fusion/commit/61a43cd945c70a6b89d5386a4cc04dc4b2ecc39e?short_path=a977874#diff-a977874b0033ac3f009aaebae6f7d3b5b8abd954fabc7a8856714aa1c1a5a80d, if it looks good to you, I will start working on it. Also @konsumlamm
18:19:04FromDiscord<haxscramper> In reply to @haxscramper "To match `Option[T]` you": Relevant part of yesterday's discussion
18:19:40FromDiscord<konsumlamm> is this something that's already supported or a new feature?
18:20:38FromDiscord<haxscramper> This is a proposal for a new feature.
18:20:38FromDiscord<haxscramper> tl;dr - it is not possible to `@capture or default` for fields, which I think is a needed feature
18:21:01FromDiscord<haxscramper> So this adds it in the form of `field: @capture or "default"`
18:22:15*krux02 quit (Remote host closed the connection)
18:22:16FromDiscord<haxscramper> Everything else in documentation just explains how it can be user-extended, and what is the difference between `Option[T]` and `opt @capture`
18:23:12*krux02 joined #nim
18:27:21FromDiscord<konsumlamm> hmm, i'm not sure what to think of it
18:27:26FromDiscord<konsumlamm> there are a few typos btw
18:29:01FromDiscord<konsumlamm> i feel like pattern matching already has enough special cases and most of the time you can just capture the field and then later use `Option.get` or something
18:29:36FromDiscord<haxscramper> `field: (get: ` does not allow for default value.
18:30:04FromDiscord<haxscramper> And we already have `{ "key" : @capture or default }` for key-value pairs, which is very useful
18:30:53FromDiscord<haxscramper> Same goes for `[@head, opt @tail]`, which is also supported by current implementation. So this is mostly a consistency imporvement
18:30:53FromDiscord<konsumlamm> for keys that are missing, right?
18:30:56FromDiscord<haxscramper> yes
18:31:32FromDiscord<konsumlamm> though for fields/procs, it's not really missing
18:31:34FromDiscord<haxscramper> In reply to @haxscramper "Same goes for `[@head,": ... consistency improvement that allows you to say "use `opt` when there you can have no value for an element"
18:31:47FromDiscord<zajrik> I'll take a look here in like 30 mins
18:31:57FromDiscord<haxscramper> In reply to @konsumlamm "though for fields/procs, it's": I consider `none()`, `nil` to be a "no value" entry
18:32:07FromDiscord<konsumlamm> i don't
18:32:37FromDiscord<konsumlamm> that can be a possible interpretation, but it's not always
18:32:42FromDiscord<haxscramper> So that is the question really - it does make sense from convenience/consistency standpoint
18:32:51FromDiscord<haxscramper> But the idea itself is open to interpretation
18:33:39FromDiscord<haxscramper> But it sure is convenient to have a fallback for any "optional" entry
18:35:12FromDiscord<haxscramper> In reply to @haxscramper "I consider `none()`, `nil`": `nil` being "no value" is not hardcoded into implementation, what constitutes "no value" is defined by `optHasValue()`,
18:35:55FromDiscord<haxscramper> But some default ones will be provided, when it makes sense? probably
18:37:38FromDiscord<haxscramper> But this is another collection of magic procs that are somehow captured by pattern matching, implicitly at that. So maybe only allowing `opt` for fields to work with `Option[]` would make sense
18:38:31FromDiscord<haxscramper> and not try to account for every possible use case in the existence, especially when interpretation of what "no value" is varies by a lot
18:39:08FromDiscord<konsumlamm> agreed that it's too magical, but i'm not sure special casing `Option[T]` further is a good idea either
18:40:19FromDiscord<haxscramper> First - we don't exactly special case `std/options.Option`, but instead we special-case very narrow subset of its API. Specifically `isNone()`, `isSome()` and `get()`
18:40:51FromDiscord<haxscramper> Second - this use case is so obvious that I doubt it makes sense to avoid special casing this time
18:41:03FromDiscord<konsumlamm> well yeah, but realistically, that will only be used for `std/options.Option`
18:41:09FromDiscord<haxscramper> no. why?
18:41:20FromDiscord<haxscramper> ah, yes, then why not special-case it a little more?
18:44:54FromDiscord<zajrik> Spec looks good barring those couple typos. I'm still all for the idea.
18:46:23FromDiscord<haxscramper> https://github.com/haxscramper/fusion/commit/021232ea72d4ad86410a1ff39412d8aae97b0760?short_path=a977874#diff-a977874b0033ac3f009aaebae6f7d3b5b8abd954fabc7a8856714aa1c1a5a80d scaled down version of feature set
18:46:33FromDiscord<zajrik> I feel like those situations where one would not consider `None` to be a nil-like value are the situations in which you would just capture the entire Option and work with it manually
18:46:56FromDiscord<haxscramper> (edit) removed "of feature set"
18:47:26FromDiscord<zajrik> So avoiding having a means to supply defaults to matched Options that may be None doesn't really make sense imo
18:48:46*krux02 quit (Remote host closed the connection)
18:49:51FromDiscord<haxscramper> Alright, so because main concern is handling of `Option[T]` and fallback values for it does not really make sense to add this whole notion of 'user-extensible-"no-value"', and instead just allow `opt: @capture or default` for fields, and tuples
18:50:18FromDiscord<Mr Axilus> Is there anyway in nim to create a long seq of uint32s without having 'u32 after every elmenet?
18:50:36FromDiscord<haxscramper> just `'u32` first element in array `[1'u32, 1,2,3,4,5]`
18:50:43FromDiscord<konsumlamm> ig i'm fine with the scaled down version, given that `opt` and `or` are already used
18:50:55FromDiscord<haxscramper> !eval typeof [1'u8, 4,5,65,6]
18:50:56NimBotCompile failed: /usercode/in.nim(1, 8) Error: expression 'typeof([1'u8, 4, 5, 65, 6])' is of type 'type array[0..4, uint8]' and has to be used (or discarded)
18:51:21FromDiscord<haxscramper> In reply to @konsumlamm "ig i'm fine with": Good, then I will implement it now
18:51:35FromDiscord<rayman22201> ok. I bought nim.fm, so we if we do decide to do a Nim podcast that's a thing we can do now
18:51:58FromDiscord<rayman22201> brought up at the end of the nim dev chat
18:52:39*superbia joined #nim
18:53:21FromDiscord<zajrik> In reply to @haxscramper "Alright, so because main": Agreed. The syntax is there, just gotta change how it works a bit for Options, yeah?
18:53:26*superbia left #nim (#nim)
18:54:02*vicfred joined #nim
18:54:24FromDiscord<zajrik> Also to clarify, for `opt @capture or "default"` on an Option, `capture` will be the value the option contains, correct?
18:55:16FromDiscord<haxscramper> Correct. Though `opt @capture` without `or` clause will effectively be the same as `Some(@capture)` ...
18:55:52FromDiscord<konsumlamm> though `@capture` could be any pattern, right?
18:56:15FromDiscord<zajrik> Would it make sense to also allow `Some(@capture) or "default"` as well then?
18:56:19FromDiscord<haxscramper> yes, `Some(<pattern>)`, but only `opt @captureVar`
18:56:51FromDiscord<haxscramper> So `opt` works only with variable captures, directly next to them, but allows to specify fallback value
18:57:18FromDiscord<haxscramper> `Some()`/`None()` is just a syntax sugar for access inside `Option[]`
18:57:58FromDiscord<haxscramper> In reply to @zajrik "Would it make sense": No, `Some()` can have arbitrarily complex pattern inside, and in this case it is not clear what `default` refers to
18:58:16FromDiscord<haxscramper> In case of `opt` the rule is simple - `opt @capture` and that's it
18:59:10*fputs quit (Quit: WeeChat 3.1)
18:59:21FromDiscord<zajrik> Okay, makes sense I think
19:04:14FromDiscord<zajrik> my thinking was that `or <default>` after a pattern could always be the default in the event that a pattern does not match, which I know seems super silly outside of nil-like values (`foo: @bar or "1"` would be silly in the event that `foo` is always guaranteed to have a value, since you can just define `bar: string = "1"` yourself outside of the pattern), but I think what I mean is obvious here
19:18:17*krux02 joined #nim
19:22:26FromDiscord<Mr Axilus> Are there any known issues with converters? I wrote one for a distinct type of uint32 and sometimes it converts to GLuint (working with opengl bindings) and sometimes it gives me an error, so I have to manually convert it by calling my converter function, when it should just convert it automatically (as it works for the same function call in other places of the same program)
19:29:58*waleee-cl joined #nim
19:42:32FromDiscord<XxDiCaprioxX> Hi I could use some assistance with choosenim
19:42:41FromDiscord<XxDiCaprioxX> I installed it on my freshly set-up Linux Mint 20
19:42:45FromDiscord<XxDiCaprioxX> and it doesnt work
19:43:01FromDiscord<XxDiCaprioxX> it says `choosenim: command not found`
19:44:28FromDiscord<Goel> You probably need to add choosenim to your PATH (Into the two files .profile and / or .bashrc) in your root
19:44:36FromDiscord<XxDiCaprioxX> but I did
19:45:30FromDiscord<XxDiCaprioxX> https://media.discordapp.net/attachments/371759389889003532/825093120772276280/unknown.png
19:45:51FromDiscord<XxDiCaprioxX> or is it at the wrong place?
19:49:10FromDiscord<zajrik> did you restart your shell?
19:49:18FromDiscord<XxDiCaprioxX> how do I do that?
19:49:18FromDiscord<Goel> export PATH=/home/user/.nimble/bin:$PATH↡Mine looks like this, but i don't know about your problem
19:49:32FromDiscord<zajrik> just close your terminal window and open it back up lol
19:49:48FromDiscord<XxDiCaprioxX> didnt help
19:50:09FromDiscord<zajrik> weird
19:50:22FromDiscord<zajrik> what shell do you use? bash?
19:50:24FromDiscord<dom96> echo $PATH
19:50:27FromDiscord<dom96> which choosenim
19:50:39FromDiscord<dom96> ls ~/.nimble/bin
19:50:41FromDiscord<dom96> check if it's there
19:51:14FromDiscord<XxDiCaprioxX> I just used the terminal
19:51:50FromDiscord<XxDiCaprioxX> echo $PATH: `/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin`
19:52:55FromDiscord<XxDiCaprioxX> I think that is the problem
19:53:05FromDiscord<queersorceress> you need to source the shell's config/init file
19:53:12FromDiscord<XxDiCaprioxX> huh
19:53:20FromDiscord<XxDiCaprioxX> im a linux noob i should add
19:53:22FromDiscord<queersorceress> close the terminal and open it again
19:53:27FromDiscord<XxDiCaprioxX> i did that already
19:53:37FromDiscord<XxDiCaprioxX> I think it wasnt added to the path
19:53:46FromDiscord<XxDiCaprioxX> even though I put it in the file
19:53:54FromDiscord<queersorceress> is that file actually getting loaded?
19:54:06FromDiscord<XxDiCaprioxX> you mean /.profile ?
19:54:41FromDiscord<queersorceress> yeah
19:55:14FromDiscord<XxDiCaprioxX> good question, how do I check that
19:55:18FromDiscord<XxDiCaprioxX> I assume it is not tho
19:58:04FromDiscord<zajrik> It should be loaded any time you start your shell
19:58:09FromDiscord<queersorceress> if you are a "linux noob" then you should probably be familiarizing yourself with how to use a shell, how to customize your env and various other things first before asking us here.
19:58:41FromDiscord<XxDiCaprioxX> In reply to @zajrik "It should be loaded": hm, strange
19:58:48*tane joined #nim
19:59:18FromDiscord<queersorceress> not that this is a general linux/unix support channel, though i think many of us do use a non-windows based OS for development and can theoretically help you, it is off topic to the main purpose of this channel which is software development with nim.
20:00:04leorize@XxDiCaprioxX logging out then log back in might help with the issue
20:00:05FromDiscord<XxDiCaprioxX> I know what you mean but I wasn't asking "how do I do x and x" on linux but just asking for support on why choosenim doesnt work, preventing me from software development
20:00:14FromDiscord<Mr Axilus> In reply to @mraxilus "Are there any known": Anyone experienced this before?
20:00:15FromDiscord<XxDiCaprioxX> In reply to @leorize "<@376323735747035148> logging out then": aight, I'll try that thanks
20:01:03leorize@mraxilus @mratsim is an avid user of converters, but I don't think he's online rn
20:01:20leorizeand yea, converters do glitch out sometimes :(
20:01:26FromDiscord<XxDiCaprioxX> In reply to @XxDiCaprioxX "aight, I'll try that": didn't work shit
20:01:55FromDiscord<queersorceress> though it sounds to me like there is a number of things you need to learn first to be properly equipped to embark on your development journey.
20:02:14leorize@XxDiCaprioxX uh... why are you editing the /root/.profile?
20:02:41leorizeor is that just your editor being weird?
20:03:02FromDiscord<queersorceress> like that, you shouldn't be doing stuff as root, if that's the only account, make another one that is not 'root' to do your daily work in.
20:03:02leorizethe .profile you should edit is ~/.profile, without sudo or anything like that
20:03:23FromDiscord<XxDiCaprioxX> I thought that was the /.profile
20:03:38FromDiscord<XxDiCaprioxX> my bad
20:03:40FromDiscord<queersorceress> if you don't know why you shouldn't do stuff as 'root' then you need to get yourself an intro to linux/unix
20:04:02FromDiscord<XxDiCaprioxX> i know why I shouldnt do that but I thought this was the only .profile file
20:04:58leorizethe .profile file that is sourced is in your user directory :P
20:05:08FromDiscord<XxDiCaprioxX> yeah I just found that out too lol
20:05:51FromDiscord<XxDiCaprioxX> yea it works now
20:06:09FromDiscord<queersorceress> okay, i'm gonna stop cuz i feel like i'm flagellating you for not knowing things yet, which i cannot expect but i'm not sure how you successfully learn all this stuff without understanding the environment you are operating in.
20:06:58leorizeyou don't have to master all of them at once y'know
20:07:22FromDiscord<zajrik> oof I didn't even catch that it was the root .profile. Good eye πŸ‘€
20:07:25FromDiscord<queersorceress> yeah, but you have to know the basics at least.
20:07:29FromDiscord<XxDiCaprioxX> i understand a few things but I dont even know the file system of windows which I used for the last 6 years so how am I supposed to know the one of linux
20:07:57FromDiscord<zajrik> You'll get there
20:08:08FromDiscord<zajrik> Even this was a learning experience for you πŸ‘
20:08:20FromDiscord<XxDiCaprioxX> I also just installed it like 2h ago
20:08:31FromDiscord<XxDiCaprioxX> anyway, thank you for your help, at least I got it now πŸ˜„
20:08:52FromDiscord<XxDiCaprioxX> In reply to @zajrik "You'll get there": ~~see me next year going to it with arch~~ yeah, hopefully haha
20:09:06FromDiscord<zajrik> lmao
20:09:22leorizeif you managed to install arch you would know how most of this work :P
20:09:48FromDiscord<XxDiCaprioxX> lmao I assume
20:09:56FromDiscord<zajrik> if your only intention is to use linux to facilitate development, I feel like you're better off using a distro with a lot more handholding :drakeLUL:
20:10:05leorizethough Arch got rid of their Beginner Guide due to lack of maintainence iirc
20:10:13FromDiscord<XxDiCaprioxX> In reply to @zajrik "if your only intention": more handholding than mint?
20:10:18FromDiscord<XxDiCaprioxX> or arch
20:10:27FromDiscord<zajrik> I meant more handholding than arch
20:10:33FromDiscord<zajrik> mint is the way to go for handholding for sure
20:10:58FromDiscord<queersorceress> yeah, i guess my point is like, what you are doing (building your own software) is leaping over miles and miles of things that you need to know for the sake of developing software (how to use software).
20:11:02FromDiscord<XxDiCaprioxX> In reply to @zajrik "I meant more handholding": yea it was a joke, I will probably not be able to handle arch for the next few years
20:11:40FromDiscord<XxDiCaprioxX> In reply to @queersorceress "yeah, i guess my": I mean, on windows I could just go at it, it is not that easy making that transition
20:11:51FromDiscord<XxDiCaprioxX> for unix/linux you need a brain
20:11:56leorizeif you can spend the time (a day or two), just try installing and configuring Arch in a VM
20:12:13FromDiscord<XxDiCaprioxX> i failed at vm-ing kali
20:12:14leorizeyou will understand how Linux is glued together in no time
20:12:23FromDiscord<zajrik> I wanna do that one of these days
20:12:42leorizekali don't have a good wiki
20:12:46leorizearch does :P
20:12:54FromDiscord<zajrik> I've never actually tried arch. I stick with the easy stuff for sure lol. Ubuntu + Gnome for me when I actually ran a linux desktop.
20:12:56FromDiscord<queersorceress> In reply to @XxDiCaprioxX "for unix/linux you need": eh, i dunno if i'd say that. this is kinda moot anyway but good luck.
20:13:04FromDiscord<zajrik> Now I just use Ubuntu on WSL
20:13:17FromDiscord<XxDiCaprioxX> In reply to @queersorceress "eh, i dunno if": either way, thanks and I wont bother you with linux questions again dw xD
20:13:18FromDiscord<dom96> Best way to learn is to try, I remember asking people what `cd` meant when I started out
20:13:33FromDiscord<jtiai> A bit far reached but if someone has experience with OS dev and GDT/IDT and IRQ handling and would like to help to make same stuff happen with Nim I would be happy to receive some help.
20:13:34FromDiscord<XxDiCaprioxX> I didnt know for a long time, only what it did
20:13:42FromDiscord<XxDiCaprioxX> then it dawned on me it means change directory
20:13:51FromDiscord<XxDiCaprioxX> ~~it does mean that, right?~~
20:13:54FromDiscord<dom96> yep
20:13:58FromDiscord<XxDiCaprioxX> k good lol
20:13:59FromDiscord<queersorceress> In reply to @XxDiCaprioxX "either way, thanks and": that wasn't what i was trying to say at all, i was just saying it was the wrong specific channel for it.
20:14:09FromDiscord<dom96> I think it's fair to ask these questions
20:14:22FromDiscord<dom96> in an ideal world choosenim would just add it to the path for you
20:14:22FromDiscord<queersorceress> it absolutely is fair to ask these questions
20:14:32FromDiscord<XxDiCaprioxX> I thought this was the best bet cuz I thought it was an issue with choosenim exclusively
20:14:40FromDiscord<dom96> it's fair to ask the nim channel how to get started with nim
20:15:07FromDiscord<XxDiCaprioxX> but as I said, for the rest I'll harass ppl on reddit or sth
20:15:16FromDiscord<XxDiCaprioxX> here I will only ask dumb nim questions
20:15:34leorizeyou can ask here when it's calm (or in #offtopic)
20:16:04leorizethough it's not like we have a discussion storm nowadays since we have topic channels now
20:16:05FromDiscord<dom96> I'm sure there are Discord's for Linux questions by now. I know there are chat rooms for this on IRC, but alas, it's a dying chat protocol πŸ™‚
20:16:09FromDiscord<queersorceress> yes, that, the existance of #offtopic was the whole point of my comment, i'm sorry if it wasn't clear.
20:17:16FromDiscord<XxDiCaprioxX> In reply to @dom96 "I'm sure there are": yeah it is less intuitive than discord, I have noticed that when trying to connect last time πŸ˜›
20:17:24FromDiscord<XxDiCaprioxX> In reply to @queersorceress "yes, that, the existance": I got it now
20:19:13FromDiscord<XxDiCaprioxX> I'm off to developing now, cya and thanks for the help!
20:19:34FromDiscord<zajrik> πŸ‘‹
20:19:40FromDiscord<queersorceress> cool, sorry, i was trying not to come off as a rtfm type, because i hate that in other people - but i also want to stress that you would greatly benefit from having a firm grounding in using your operating system before you start making it do things for you. that doesn't mean you gotta read the source code or some such nonsense, but knowing how to navigate your shell and build tools is key.
20:48:18*narimiran quit (Ping timeout: 252 seconds)
21:22:02FromDiscord<Mr Axilus> Hmm, I introduced a bug in my program which gives an out of memory error, but when I try to run/compile with --debuginfo to investigate the problem goes away...
21:22:06FromDiscord<Mr Axilus> I'm very confused
21:22:18FromDiscord<JSGRANT> In reply to @leorize "though Arch got rid": There's only like 20-50 videos on youtube that hold people's hand at this point. lol Really Arch is pretty dang trivial to get up and running, after you set up your disk partitioning it's like maybe 10 or-so steps?
21:22:51FromDiscord<JSGRANT> leorize: Ping? lol Still don't know how Discord 'replies' work with irc...
21:23:21leorizeI wouldn't say that it's trivial when you're a complete beginner
21:23:55leorize> In reply to @usernamehere: "short quote of msg"
21:23:57leorize^ that's what I see
21:25:14FromDiscord<JSGRANT> I mean it's certainly not as easy as using a gui installer; Probably the ONLY reason Manjaro is popular afaict. lol But idk I probably installed Arch for the first-time like 2-3 months into switching to Linux & this was over a decade ago at this point ... that being said, I'm also the guy who effectively learned to program in Emacs-Lisp ... so maybe I'm not a good case study. loooool
21:25:36FromDiscord<JSGRANT> Also interesting re: reply from discord-to-irc
21:28:27FromDiscord<JSGRANT> Also-also MAN, I wish Nim was a thing (and not just 'technically' I know it was actually "a thing") 10-15 years ago; Would of been such a nice first-introduction into programming.
21:32:00FromDiscord<sealmove> Does anyone have problems with firefox save as dialog in arch (not showing up)?
22:02:10FromDiscord<jtiai> sent a code paste, see https://play.nim-lang.org/#ix=2UcO
22:03:08FromDiscord<jtiai> And then I need to do 256 times: `cast[uint32](cast[pointer]foo(...))`
22:03:23FromDiscord<InventorMatt> you may be able to do it with a macr
22:03:28FromDiscord<InventorMatt> (edit) "macr" => "macro"
22:04:01FromDiscord<jtiai> macro seemed quite complex considering I only need 2 proc calls.
22:04:31FromDiscord<ElegantBeef> A template might work aswell
22:04:45FromDiscord<InventorMatt> macros can actually be pretty simple depending on how a simple a thing you need
22:04:47FromDiscord<ElegantBeef> Dont exactly know what you're doing
22:04:51FromDiscord<jtiai> IDT.
22:05:16FromDiscord<jtiai> Interrupt Descriptor Table to handle IRQs
22:05:21FromDiscord<ElegantBeef> Thanks for words πŸ˜„
22:05:32FromDiscord<jtiai> Writing an operating system with nim.
22:05:53FromDiscord<jtiai> IDT requires pointers to IRQ handlers. memory addresses.
22:06:16FromDiscord<haxscramper> @zajrik `opt` is mostly done, I've added your original question as part of unit test - https://github.com/nim-lang/fusion/pull/77/files#diff-33abcca7f03798f7fd369f34051711499dee90cea8d05859cd933d31ce115f09R2329
22:06:31FromDiscord<ElegantBeef> Could you show an example of the type of thing you need?
22:06:51FromDiscord<ElegantBeef> I know you had the procedure and the cast, but i'm uncertain how they play together
22:07:24FromDiscord<jtiai> They play well and it works. Unfortunately there is something fishy and I need to know which one of 256 IRQs got called...
22:07:56FromDiscord<ElegantBeef> ah so you want to inject an echo statement in a bunch of procedures?
22:08:07FromDiscord<jtiai> sent a code paste, see https://play.nim-lang.org/#ix=2UcQ
22:08:08FromDiscord<zajrik> In reply to @haxscramper "<@!214628307201687552> `opt` is mostly": Awesome! I'll install your fork here when I get the chance and play with it
22:08:34FromDiscord<jtiai> And then a in a loop I do `cast[uint32](cast[pointer](irq_handler))`
22:09:15FromDiscord<jtiai> Now I need to have 256 handler which know how to print their IRQ number.
22:10:22FromDiscord<ElegantBeef> Ok so you have a bunch of procedures and you want to echo their address
22:11:09FromDiscord<jtiai> I would prefer number if possible makes easier than debug memory.
22:11:25FromDiscord<ElegantBeef> How would one get the number from the procedure?
22:12:03FromDiscord<jtiai> Normally I would do this with objects by creating necessary number of them.
22:14:38*zedeus quit (Ping timeout: 240 seconds)
22:15:11FromDiscord<jtiai> but as I understood nim doesn't have traditional classes which for example c++ has...
22:15:20FromDiscord<ElegantBeef> I mean that doesnt really matter
22:15:23FromDiscord<ElegantBeef> It's the same logic
22:17:30FromDiscord<ElegantBeef> Idk this might be similar to what you want https://play.nim-lang.org/#ix=2UcT
22:17:42FromDiscord<ElegantBeef> Makes an array at compile time of the procs marked with `irqProc`
22:17:59FromDiscord<ElegantBeef> Though due to different signatures you may need to box them using an object variant
22:18:34FromDiscord<jtiai> That's very close I think.
22:18:35FromDiscord<ElegantBeef> Also could emit an enum so you could index using that instead
22:18:41ForumUpdaterBotNew Nimble package! termui - Simple UI components for the terminal., see https://github.com/jjv360/nim-termui
22:19:03FromDiscord<ElegantBeef> So you could do something like `IrqLut[Irq.Handler]`
22:19:27FromDiscord<jtiai> Just have to check what I can do because I'm pretty short on libraries I can use πŸ™‚
22:20:01FromDiscord<ElegantBeef> Yea makes sense, though a lot of the stdlib should be usable
22:20:07FromDiscord<ElegantBeef> Pretty much anything but OS/Terminal
22:20:21FromDiscord<ElegantBeef> pure stdlib
22:21:22FromDiscord<jtiai> But getting close to have keyboard working. And it boots and writes text to screen!
22:21:27FromDiscord<ElegantBeef> Nice πŸ˜„
22:22:59FromDiscord<jtiai> Aaargh found the bug... 🀯
22:23:24FromDiscord<jtiai> In PIT IRQ handler I forgot to ACK it. Way to go.
22:24:01FromDiscord<ElegantBeef> For the enum i mentioned https://play.nim-lang.org/#ix=2UcW
22:24:19FromDiscord<ElegantBeef> Much nicer than using random integers and should be the same cost πŸ˜„
22:24:42*Vladar quit (Quit: Leaving)
22:24:47FromDiscord<haxscramper> I think that an array of enum-indexed procs would actually be a good solution, because (at least if I remember correctly), there is a specific handler for each type of interrupt [right?], and if you are going to have all interrupts listed anyway
22:25:04FromDiscord<ElegantBeef> Yep enum indexed arrays are glorious for anything like this
22:25:07FromDiscord<haxscramper> It makes a ton of sense to use `array[enum, handler]`
22:25:50FromDiscord<haxscramper> It is the fastest, most compact and zero-dependency solution (not even necessary to import anything from stdlib)
22:26:18FromDiscord<ElegantBeef> Hmm, considering it'd be completely automated could convert the `handler` to a pointer, then make a helper to convert it back to the proc signature so you wouldnt have to manually box it
22:27:02FromDiscord<haxscramper> you can store information about handler signatures in some compile-time array (indexed using the same `enum`)
22:27:41FromDiscord<ElegantBeef> Well yea, but i mean you could just do a whole `IrqLut[handlerId].asProc(args)`
22:28:17FromDiscord<ElegantBeef> Which would cast that pointer to the correct proc time from that enum index, and make it so it's very ergonomic to use
22:28:24FromDiscord<ElegantBeef> Since you only have to remember the handler name πŸ˜„
22:28:38FromDiscord<ElegantBeef> And i guess it's args
22:28:54FromDiscord<ElegantBeef> ~~I have a problem with macros, i put them everywhere~~
22:29:58FromDiscord<jtiai> Well I don't need that stuff anymore since bug was fixed.
22:30:11FromDiscord<ElegantBeef> Shame
22:30:21FromDiscord<haxscramper> turn it back on and use macros to fix it differently, that's the only way
22:31:00FromDiscord<jtiai> Handlers are interrupt specific.
22:37:15FromDiscord<jtiai> Next task - writing some kind of console...
22:38:33*haxscramper quit (Remote host closed the connection)
23:22:01*krux02 quit (Remote host closed the connection)
23:24:11*xet7 joined #nim
23:24:40*xet7 quit (Remote host closed the connection)
23:25:36*xet7 joined #nim
23:57:12*zedeus joined #nim