<< 06-08-2022 >>

00:01:57FromDiscord<voidwalker> @Vindaar I fixed it.. `init(Weave) exit(Weave)` was missing. I removed it at some point as the program seemed to be running fine without it
00:11:56FromDiscord<voidwalker> for some reason it is needed for this extra functionality, passing the pointer. no idea why
00:29:00*wordle_king joined #nim
00:29:05*wordle_king quit (Client Quit)
00:29:45FromDiscord<Rainbow Asteroids> In reply to @vindaar "because `Natural` is *not*": Natural is a type. It's a distinct range
00:30:04FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=46Mm
00:30:11FromDiscord<Elegantbeef> If another person corrects vindaar i'm going to break their legs
00:31:00FromDiscord<Rainbow Asteroids> I have leg insurance, I'm good
00:31:16FromDiscord<Elegantbeef> Vindaar did you know that Natural is a sub range type and not actually a typeclass
00:31:44FromDiscord<Elegantbeef> Imagine being that american you have to insure specific body parts
00:32:06FromDiscord<Rainbow Asteroids> Discord didn't bring me to the most recent message, so I didn't see he was corrected already
00:32:11FromDiscord<Elegantbeef> "Sorry sir your insurance doesnt cover incisor extraction only third molar
00:32:57FromDiscord<Elegantbeef> Hey dont apologise it's easy to pile on that Natural isnt a typeclass it's a subrange type
00:33:05FromDiscord<Elegantbeef> 😛
00:45:25FromDiscord<wiga> is there a way to only keep 2 decimals from a math operation?
00:45:49FromDiscord<wiga> im trying to calculate kdr by using math.round
00:46:02FromDiscord<wiga> but it replaces negative kdr with 1
00:46:16FromDiscord<wiga> but i dont want 10 decimals
00:53:18FromDiscord<Elegantbeef> https://nim-lang.org/docs/strutils.html#formatFloat%2Cfloat%2CFloatFormatMode%2Crange%5B%5D%2Cchar
01:11:08FromDiscord<beans> what's the difference between `include` and `import`?
01:11:56FromDiscord<Elegantbeef> Include works like C's include and pastes the content there, import brings in any exported symbols from the module
01:13:19FromDiscord<Elegantbeef> So generally you avoid include unless you need it
01:31:38FromDiscord<wiga> https://media.discordapp.net/attachments/371759389889003532/1005286999596470352/unknown.png
01:32:05FromDiscord<wiga> why the
01:33:49FromDiscord<Rainbow Asteroids> strutils.formatFloat returns a string.
01:34:00FromDiscord<Rainbow Asteroids> (edit) "strutils.formatFloat" => "`strutils.formatFloat`"
01:34:04FromDiscord<Elegantbeef> You generally dont worry about decimal places for floats
01:34:13FromDiscord<Elegantbeef> You only worry about them when printing
01:34:28FromDiscord<wiga> i do? https://media.discordapp.net/attachments/371759389889003532/1005287714226176121/2022-08-05_20-49.png
01:35:18FromDiscord<Rainbow Asteroids> so just use `formatFloat` when you add that float to your embed
01:38:33FromDiscord<Elegantbeef> Yea you dont care about how many decimals it has in calculations only in the printed information
01:38:51FromDiscord<Elegantbeef> You do not control floats they control you, some values cannot even be represented in floating point
01:39:23FromDiscord<Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/1005288948152684574/image.png
01:39:45FromDiscord<Elegantbeef> That's a 32bit float but point stands
01:40:14FromDiscord<Rainbow Asteroids> the point sits, because the point doesn't have legs
01:40:25FromDiscord<Rainbow Asteroids> `.` <- no legs
01:40:41FromDiscord<Elegantbeef> The point doesnt sit either cause inanimate objects shouldnt do anything
01:53:09FromDiscord<!Patitotective> In reply to @Elegantbeef "The point doesnt sit": _Said the bot_
01:53:35FromDiscord<!Patitotective> In reply to @Elegantbeef "The point doesnt sit": «_shoundt_» ඞ
01:53:40FromDiscord<!Patitotective> (edit) "«_shoundt_»" => "«_shouldnt_»"
01:57:51FromDiscord<!Patitotective> In reply to @Elegantbeef "The point doesnt sit": is the point an object even? is it a concept?
01:59:45FromDiscord<Rainbow Asteroids> to act as an easier way for us to wrap our monke brain around how computers process data
02:01:23FromDiscord<!Patitotective> 01110111 01101000 01100001 01110100
02:01:53FromDiscord<Rainbow Asteroids> wdym?
02:02:33FromDiscord<Rainbow Asteroids> the entire point of programming paradigms and programming languages is because people think writing machine code by hand is hard or something
02:05:28FromDiscord<Prestige> or not portable
02:08:12FromDiscord<Rainbow Asteroids> just write a machine code transpiler, boom problem solved
02:08:42FromDiscord<Elegantbeef> Just make a wasm cpu!
02:09:28FromDiscord<Rainbow Asteroids> a JVM or .NET cpu has to exist somewhere, right?
02:09:44FromDiscord<!Patitotective> beef aka wasm lover
02:10:45FromDiscord<Rainbow Asteroids> i don't get the point of wasm if you can't do DOM manipulation with it
02:14:39FromDiscord<Elegantbeef> it's fantastic language agnostic VM for non webdev
02:15:22FromDiscord<Prestige> In reply to @Rainbow Asteroids "just write a machine": microprocessors tho
02:17:33FromDiscord<!Patitotective> In reply to @Rainbow Asteroids "just write a machine": social life tho
02:47:12*arkurious quit (Quit: Leaving)
03:30:34FromDiscord<Tuatarian> in general, is iterating over a set faster than over a seq or array?
03:32:23FromDiscord<Elegantbeef> A set is just a packed bit array so it's going to be the same
03:32:58FromDiscord<Tuatarian> the idea is that checking if a member is in the set is faster right?
03:33:05FromDiscord<Tuatarian> and that deduplicating is much easier
03:33:19FromDiscord<Elegantbeef> Are we talking about hashset or bitset 😄
03:33:23FromDiscord<Tuatarian> I'm talking abouit built in btiset
03:33:33FromDiscord<Elegantbeef> Then yes
03:33:48FromDiscord<Elegantbeef> Hashsets can be slower than arrays since hashing isnt free
03:34:01FromDiscord<Tuatarian> yep
03:34:36FromDiscord<Tuatarian> I knew the stuff for hashsets, but if I can represent something as a seq or a set, just wanted to check that there isn't really a good reason to not use set
03:34:56FromDiscord<Tuatarian> because I'm mostly going to be iterating over it,
03:35:12FromDiscord<Elegantbeef> bitsets always occupy the amount of bits they can store
03:35:42FromDiscord<Elegantbeef> So if you have a large amount of elements a sequence might be more memory friendly
03:36:42FromDiscord<Tuatarian> it's guaranteed less than 169
03:37:00FromDiscord<Tuatarian> but it should never be that high
03:37:07FromDiscord<Elegantbeef> Well 169 bits isnt that much
03:37:09FromDiscord<Tuatarian> in practice it should range anywhere from 0-40 ish
03:37:19FromDiscord<Tuatarian> yes 169 is not a huge number anyway
03:37:48FromDiscord<Tuatarian> are array ops generally faster than equivalent operations on a seq?
03:38:13FromDiscord<Tuatarian> i would imagine the answer would be yes, but if so how by much and does it matter for non huge arrays
03:38:21FromDiscord<Elegantbeef> The answer is going to be no generally
03:38:31FromDiscord<Tuatarian> that's good
03:38:32FromDiscord<Elegantbeef> If you are not allocating the sequence ops are not slower
03:38:54FromDiscord<Tuatarian> allocs are unfortunately fairly frequent
03:39:38FromDiscord<Tuatarian> is this because static allocations are just much faster?
03:40:34FromDiscord<Elegantbeef> Well more so heap allocations require talking to OS
03:41:06FromDiscord<Elegantbeef> I should say that depends on your allocator
03:42:52FromDiscord<Tuatarian> using the standard nim allocator, so TSLF i think
04:10:17FromDiscord<Tuatarian> can anyone please help me get linting working in emacs
04:10:28FromDiscord<Tuatarian> it is absolutely refusing to do so and I'm going slightly insane
04:25:11FromDiscord<Prestige> No idea about emacs but I could help with vim, lol
04:57:32FromDiscord<ajusa> is there an easy way to check if two variables are the same type within a when block?
04:58:26FromDiscord<Elegantbeef> `a is typeof(b)`
04:59:57FromDiscord<ajusa> ah, that's better than my `lhs.type is rhs.type`
05:00:22FromDiscord<ajusa> or I can do `a is b.type`
05:00:42FromDiscord<Elegantbeef> I believe you're supposed to use `typeof` but you do you
05:01:19FromDiscord<ajusa> I got that off of https://forum.nim-lang.org/t/4734, wasn't sure what is correct as some of those posts don't render
05:02:59FromDiscord<Prestige> Yeah I believe type is deprecated in favor of `typeof`
05:03:44FromDiscord<Elegantbeef> same for `_: type int` it should be `_: typedesc[int]`
05:05:18FromDiscord<Freakwill (William Song)> hey man
05:05:57FromDiscord<Prestige> Hello
05:09:34FromDiscord<Tuatarian> maybe @haxscramper you could help, I think you use emacs also
05:09:39FromDiscord<Tuatarian> I can't seem to get linting working
05:09:41FromDiscord<Tuatarian> no idea why
05:25:55NimEventerNew post on r/nim by Wysardry: Can Nim be used with SDCC, z88dk or other 8-bit compilers?, see https://reddit.com/r/nim/comments/whgfl2/can_nim_be_used_with_sdcc_z88dk_or_other_8bit/
05:46:32FromDiscord<haxscramper> In reply to @iWonderAboutTuatara "maybe <@608382355454951435> you could": Linting via nimsuggest checking?
05:46:42FromDiscord<haxscramper> I don't use nimsuggest because it does not work
05:50:44FromDiscord<Prestige> Is nimsuggest even being maintained?
05:54:06FromDiscord<Elegantbeef> Status has got someone working on tooling fulltime now so sorta
05:55:45FromDiscord<Prestige> Would be great if it got fixed up
05:56:09FromDiscord<Elegantbeef> Well the v3 is a start of that
06:01:01FromDiscord<haxscramper> > Although functional I still see this more as a POC that this approach can work.
06:01:23FromDiscord<haxscramper> Hopefully we will see it in a non-POC version at some point
06:22:25*xet7 quit (Quit: Leaving)
06:50:52FromDiscord<Phil> There's no way to get the vscode plugin to the point where it also actually jumps you to e.g. the std lib file with the definition of a proc, is there
06:51:00FromDiscord<Phil> (edit) "there" => "there?"
06:51:07FromDiscord<Elegantbeef> Yea
06:51:16FromDiscord<Phil> I really need to go over my plugin settings again
06:52:53FromDiscord<Phil> We do not have any better backend than nimsuggest right? as far as I recall any lsp also just uses nimsuggest
06:53:46FromDiscord<Phil> Just noticed the option and how its options are nimsuggest or lsp, thus the question
06:55:27FromDiscord<Elegantbeef> the lsp is for nimlangserver which requires nimsuggest built with a specific commit or devel
06:56:18FromDiscord<Phil> So swapping there wouldn't really bring me much of a change
06:56:53FromDiscord<Elegantbeef> It's the same underlying tool but with a watcher that handles if it crashes
06:57:48FromDiscord<Elegantbeef> If you cannot goto definiition to a proc it's probably just to your project not working 'properly'
07:02:13FromDiscord<Phil> In that case I'd I'm a bit flabbergasted because at that point I'm not sure what I missconfigured
07:04:26FromDiscord<Prestige> I can jump to definitions with vim but I'm not sure if that's the LSP handling it. Well, when it doesn't crash I can
07:04:35FromDiscord<Prestige> So it works about 30% of the time
07:04:48FromDiscord<Elegantbeef> It's the LSP handling it
07:04:52FromDiscord<Elegantbeef> probably
07:05:03FromDiscord<Prestige> I believe so
07:05:49FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=46Ng
07:06:20FromDiscord<Elegantbeef> Does it work in a simpler project?
07:07:05FromDiscord<Phil> Testing it out, one sec
07:09:44FromDiscord<Freakwill (William Song)> sent a long message, see http://ix.io/46Nh
07:10:11FromDiscord<Elegantbeef> I just installed vscode and yea it indeed works for stdlib code
07:10:20FromDiscord<Phil> Without additional entry in nim.project: no↵With additional entry in nim.project of `~/dev/playground/src/playground.nim`: no↵↵Neither CTRL + Click on proc nor go to proc and press F12
07:10:28FromDiscord<Freakwill (William Song)> sent a long message, see http://ix.io/46Ni
07:10:55FromDiscord<Elegantbeef> Ugh gitter really sucks now doesnt it 😄
07:11:13FromDiscord<Elegantbeef> use a `proc` and not a template is a start
07:12:04FromDiscord<Phil> In reply to @Elegantbeef "I just installed vscode": Sooooo I take it reinstall vscode for me
07:12:27FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=46Nk
07:12:45FromDiscord<Elegantbeef> `result.add x` ideally 😛
07:12:45FromDiscord<Freakwill (William Song)> great!
07:13:38FromDiscord<Elegantbeef> Though most people would use `sequtils.filterIt` and do `mySeq.filterIt(it == val)`
07:13:57FromDiscord<Phil> The above creates a copy of your original sequence without the value you want to avoid.
07:14:01FromDiscord<Elegantbeef> No clue↵(@Phil)
07:14:10FromDiscord<Elegantbeef> Yea phil the code they linked did the same
07:14:12FromDiscord<Phil> In reply to @Freakwill (William Song) "great!": You can also just use the delete proc in `std/sequtils`
07:14:36FromDiscord<Elegantbeef> Atleast what I could understand
07:15:53FromDiscord<Phil> In reply to @Elegantbeef "Yea phil the code": Fair point
07:15:58FromDiscord<Elegantbeef> A small optimisation for my solution would be to do `result = newSeqWithCap[T](s.len)` to preallocate the sequence
07:27:07FromDiscord<Freakwill (William Song)> > The above creates a copy of your original sequence without the value you want to avoid.↵Yes. It is better to operate the seq directly instead of its copy.
07:28:47FromDiscord<Freakwill (William Song)> thank you. but it is not required std/sequtils now↵(@Phil)
07:28:58*derpydoo joined #nim
07:29:40FromDiscord<Freakwill (William Song)> thank you. but it dose not require `std/sequtils` now
07:29:53FromDiscord<Freakwill (William Song)> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/1005376460489494618): > The above creates a copy of your original sequence without the value you want to avoid.↵Yes. It is better to operate the seq directly instead of its copy. I shall use delete.
07:30:04FromDiscord<Freakwill (William Song)> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/1005376460489494618): > The above creates a copy of your original sequence without the value you want to avoid.↵Yes. It is better to operate the seq directly instead of its copy. I shall use `delete`.
07:32:19FromDiscord<Phil> I am slightly confused by what the end result of this is, but I'm glad either way you found a solution for your task, whether it be by doing a copy or by deleting the value within your intended seq directly.
07:37:37FromDiscord<Freakwill (William Song)> sent a code paste, see https://play.nim-lang.org/#ix=46Ns
07:38:12FromDiscord<Elegantbeef> you need to declare the variable you pass as `var` if you want to mutate it
07:38:25FromDiscord<Elegantbeef> `let` declared variables are immutable
07:38:36FromDiscord<Elegantbeef> Also please use a different chat client gitter absolutely sucks
07:39:00FromDiscord<Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/1005379448561995837/image.png
07:39:02FromDiscord<Elegantbeef> Is what was sent to discord
07:40:04FromDiscord<Elegantbeef> And matrix didnt even get a readable message as far as i can see
07:58:50FromDiscord<Phil> sent a long message, see http://ix.io/46Nw
08:01:44FromDiscord<Phil> As a general recommendation, use let wherever possible and var only when you actually need to change stuff
08:20:30*rockcavera quit (Remote host closed the connection)
08:35:36FromDiscord<Freakwill (William Song)> But I never used `let`↵(@Phil)
08:35:48FromDiscord<Elegantbeef> Full code please put it on a paste site and send a url
08:35:55FromDiscord<Elegantbeef> Was it a parameter to a function?
08:36:02FromDiscord<Elegantbeef> If so those are immutable
08:37:21FromDiscord<Freakwill (William Song)> and as you saw, I declare that `var s:seq[char]`
08:38:02FromDiscord<Rika> The s parameter in remove is not var
08:40:46FromDiscord<Phil> In reply to @Freakwill (William Song) "But I never used": Ah, yes, as Rika stated but slightly more formalized:↵Any parameter in a proc is created immutable by default, so basically treat proc params as if they were `let` variables.↵To change that, put var in front of it, like `proc something(var s: string)`
08:40:54FromDiscord<Phil> (edit) "something(var s:" => "something(s: var"
08:55:07FromDiscord<Freakwill (William Song)> thank you
09:00:26*Guest3483 quit (Quit: You have been kicked for being idle)
09:15:15FromDiscord<Freakwill (William Song)> thank you. It works now.↵(@Phil)
09:32:00*kenran joined #nim
09:35:27*derpydoo quit (Quit: derpydoo)
09:40:52*derpydoo joined #nim
09:41:27NimEventerNew thread by Matkuki: Where to start with creating direct Qt bindings?, see https://forum.nim-lang.org/t/9352
09:45:26*jmd_ quit (Ping timeout: 240 seconds)
10:01:18FromDiscord<xzntrc> Hi, I'm new to Nim, I am just interested in it's practicality.
10:01:48FromDiscord<xzntrc> I'm looking to build a shell, I've heard of Nim before and am looking to give it a chance, would it be practical to build something small like a shell yet perform well?
10:04:27FromDiscord<Prestige> Yep, Nim compiles to C so performance just depends on how you write your program
10:05:17FromDiscord<xzntrc> ah beautiful
10:05:37FromDiscord<xzntrc> I'm very skilled at python, but i've never had the time to learn C, so i thought nim would be cool.
10:05:59FromDiscord<xzntrc> is it a steep learning curve? Given that I know python, how long do you think it would take to "master" nim?
10:06:34FromDiscord<Phil> In reply to @xzntrc "is it a steep": As someone in your shoes 1:1 around 8 months ago, it's pretty good in terms of learning curve.
10:06:58FromDiscord<Phil> There are some concepts that python just straight up does not have that you'll need to hammer into your head a bit, but that is something you'd have to do with any lower level language
10:07:33FromDiscord<xzntrc> disregarding speed, would you say considering other aspects, is nim better than python?
10:07:34FromDiscord<Phil> Those concepts being:↵Compile time vs. run time (and what that means for e.g. variable declarations with const)↵Value types vs. ref types (python has only ref type objects for example)
10:07:37FromDiscord<xzntrc> does it have more features?
10:08:38FromDiscord<Phil> One thing you will love to pieces is the compiler and the static type system.↵Remember all those python errors you got because you didn't run a static type checker in python or used the wrong variable or sth?↵Gone. Nim will not let you compile if you want to assign a number to a variable that you stated would be a string. You will catch those dumb runtime errors before they happen.
10:09:03FromDiscord<xzntrc> epic
10:09:10FromDiscord<Phil> You can expand those checks further with stuff like Concepts, but that is more advanced stuff
10:09:53FromDiscord<Phil> You will also find that nim has a language to write code. Essentially that's the metaprogramming side of nim, macros and templates (and strictly speaking also generics but they behave near identical to normal functions so that doesn't quite matter)
10:10:00FromDiscord<xzntrc> does nim allow this?
10:10:00FromDiscord<xzntrc> sent a code paste, see https://play.nim-lang.org/#ix=46O2
10:10:39FromDiscord<xzntrc> i like having to declare `\n`, that way I can chose which lines to print on
10:11:37FromDiscord<Phil> I've never actually had that usecase, I'd need to check honestly.↵Nim typically has `echo` for this, but echo terminates always with newline, so for something that doesn't terminate in newline it'd likely take some sort of proc
10:11:54FromDiscord<Prestige> I believe you can do `stdout.write "foo"`
10:12:49FromDiscord<xzntrc> is it possible to edit a line afterr being printed?
10:12:57FromDiscord<xzntrc> in python you cannot do this which annoys me
10:13:01FromDiscord<xzntrc> you can in C tho
10:13:44FromDiscord<Prestige> Maybe https://nim-lang.org/docs/terminal.html would help, I think you can
10:13:45FromDiscord<Rika> Err, technically?
10:13:52FromDiscord<Rika> In reply to @Avahe "Maybe https://nim-lang.org/docs/terminal.html would": Yes technically with this
10:13:53FromDiscord<Phil> In reply to @xzntrc "One thing that ticks": Another nice thing is you can have something somewhat similar to a python REPL in nim.↵There are nim secret which doesn't support all nim libraries and inim, which has full support but is a bit slower and strictly speaking not a REPL, it only fakes being so.↵inim works by secretly having a nim file and compiling + running it every time you add a line in it. Does work pretty well for trying st
10:14:01FromDiscord<Rika> I don’t see why you wouldn’t be able to with Python
10:14:48FromDiscord<xzntrc> does nim have native i/o?
10:14:51FromDiscord<xzntrc> file editing etc
10:15:15FromDiscord<Phil> In reply to @xzntrc "does nim allow this?": Good general resources to get started:↵https://github.com/nim-lang/Nim/wiki/Nim-for-Python-Programmers↵https://nim-lang.org/docs/tut1.html
10:15:28FromDiscord<Rika> In reply to @xzntrc "does nim have native": “Native”? Yes it has I/O
10:15:35FromDiscord<Rika> But I don’t understand what you mean by native
10:16:01FromDiscord<xzntrc> and final question
10:16:20FromDiscord<Prestige> Hm too bad the playground is still down.. is PMunch around?
10:16:47FromDiscord<xzntrc> sent a code paste, see https://play.nim-lang.org/#ix=46O5
10:16:50FromDiscord<xzntrc> is there something like this in nim?
10:17:01FromDiscord<Phil> You mean to execute terminal commands?
10:17:04FromDiscord<xzntrc> correct
10:17:16FromDiscord<Rika> Redirecting out and in from the parent to the child, not really
10:17:20FromDiscord<Rika> You can but I assume it’s not really done
10:17:28FromDiscord<xzntrc> oof alright
10:17:36FromDiscord<Prestige> https://nim-lang.org/docs/osproc.html for that kinda stuff
10:17:46FromDiscord<Rika> Actually
10:17:47FromDiscord<Rika> Yeah
10:17:48FromDiscord<Phil> In general just to interact with a shell you may want to look at https://nim-lang.org/docs/os.html
10:17:51FromDiscord<Rika> The enum value
10:17:59FromDiscord<Rika> poParentStream or smth
10:18:06FromDiscord<xzntrc> In reply to @Isofruit "You mean to execute": I'd like to do it without a shell if that makes sense, instead of running a shell command like "cat", instead actually look through all the binary files and find the executable that way.
10:18:32FromDiscord<Rika> You can redirect, its the poParentStreams option in the osproc modyle
10:18:40FromDiscord<xzntrc> nice
10:18:44FromDiscord<xzntrc> ill get to learning then
10:19:01FromDiscord<Prestige> That being said, if you have a specific use case there might be better alternatives to executing shell commands
10:19:19FromDiscord<Phil> In reply to @xzntrc "I'd like to do": > To execute a program without having a shell involved, use osproc.execProcess proc.↵Quoted from the os lib I mentioned earlier
10:19:31FromDiscord<xzntrc> neat
10:19:52FromDiscord<xzntrc> oh yeah, is intelliJ a good IDE for nim?
10:20:36FromDiscord<Phil> I can't say I've heard of anyone using intellij with nim before, not sure how well that tracks.↵Personally I use vscode, fair amount of folks here use vim/emacs
10:20:51FromDiscord<xzntrc> vim is based
10:21:04FromDiscord<Prestige> Last I heard, intellij's Nim support wasn't as good as vscode/vim/etc
10:21:21FromDiscord<xzntrc> on windows atm so I wont be using vim unfortunately
10:21:38FromDiscord<xzntrc> ill try vscode
10:21:41FromDiscord<Prestige> Hm isn't there like gvim or some nonsense available on windows?
10:21:51FromDiscord<xzntrc> yeah but it's graphical vim
10:21:56FromDiscord<xzntrc> and that's heracy
10:21:58FromDiscord<xzntrc> (edit) "heracy" => "heracy!!"
10:22:11FromDiscord<xzntrc> (edit) "heracy!!" => "heresy!!"
10:22:15FromDiscord<Phil> In reply to @xzntrc "ill try vscode": In that case, the nim extension you'll want to look at is the one made by nimsaem, if you use vscode instead of codium you'll see 2
10:22:25FromDiscord<xzntrc> neat
10:24:11FromDiscord<xzntrc> actually i might use vim in WSL
10:24:38FromDiscord<Prestige> I hear you can download linux for free from the interwebs 😉
10:24:53FromDiscord<xzntrc> yeah ik i use arch on the laptop
10:25:08FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=46O6
10:25:29FromDiscord<xzntrc> ohh wtf thats dope
10:25:34FromDiscord<Phil> This way, even though most libs use camelcase, you can stick with snake_case
10:26:21FromDiscord<xzntrc> i use camelcase 😭
10:26:48FromDiscord<Phil> Ah, further, if you want to use the python ecosystem in nim for something, nimpy is your friend.
10:27:01FromDiscord<Phil> And vice versa if you want to use nim in python, same thing
10:39:01FromDiscord<Phil> In reply to @xzntrc "i use camelcase 😭": You most be fortunate that nobody has yet PEP8'd you
10:46:18FromDiscord<xzntrc> Why use shift+- when u can use Shift plus the next leter?
10:46:21FromDiscord<xzntrc> honestly easier
10:46:25FromDiscord<xzntrc> snake casing is ugly too
10:52:56FromDiscord<Rika> Well it’s preference
10:53:09*derpydoo quit (Quit: derpydoo)
10:55:44*derpydoo joined #nim
11:20:10FromDiscord<Tom> sent a long message, see http://ix.io/46Oj
11:31:50*kenran quit (Ping timeout: 240 seconds)
11:32:50FromDiscord<xzntrc> In reply to @Isofruit "In that case, the": i forgot to ask, why?
11:38:11FromDiscord<hotdog> In reply to @Tom "Hi, y'all! I'm trying": Hi! Don’t have much experience wrapping CPP libs I’m afraid. just wanted to say that it may be best to ask on the forum (if you don’t get an answer here)
11:41:42FromDiscord<Phil> In reply to @xzntrc "i forgot to ask,": nimsaem is the more recent and fully featured one afaik
11:45:16FromDiscord<xzntrc> coolio
11:58:26FromDiscord<Tom> In reply to @hotdog "Hi! Don’t have much": Thanks for the tip!
12:43:43FromDiscord<voidwalker> https://gist.github.com/jrfondren/ff770a2ab3518f560ca534ec1f084ebd#file-get-nim-L6
12:43:58FromDiscord<voidwalker> can somebody explain that line of code to me ? ` client.onRecv = () => client.contentProgress > n`
12:44:56FromDiscord<Rika> It’s a function with no parameters that returns a Boolean of whether the progress has exceeded n
12:46:44FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=46OH
12:47:04FromDiscord<voidwalker> (edit) "https://play.nim-lang.org/#ix=46OH" => "https://play.nim-lang.org/#ix=46OI"
12:53:50*fallback quit (Ping timeout: 240 seconds)
13:06:16*fallback joined #nim
13:07:26FromDiscord<Phil> sent a long message, see http://ix.io/46OR
13:08:14FromDiscord<voidwalker> yeah it's a modification someone did on the forum in reply to my "get only first n bytes of http"
13:08:30FromDiscord<Phil> And somehow when the callback evaluates to true it interacts with the await symbol
13:09:13FromDiscord<Phil> Could be that once onRecv is true, that it then counts the await as being over and thus the body is available at that point?
13:09:51FromDiscord<Phil> The fact there's 2 awaits in there is throwing me a bit for a loop there
13:10:49FromDiscord<Phil> Ah, given that contentProgress is BiggestInt, I'm leaning once more heavily towards that it's a count of bytes or characters
13:13:55FromDiscord<voidwalker> I think recvFull checks if it got the whole thing, and there it plugs the code that returns it prematurely, after > n bytes condition is satisfied
13:15:37FromDiscord<voidwalker> well, it's a hack. Ideally this sort of thing should've been doable without modifying the httpclient
13:27:15*_________ quit (Ping timeout: 272 seconds)
13:29:50*PMunch joined #nim
13:32:49*_________ joined #nim
13:33:44FromDiscord<Phil> Given me having no clue about async await under the hood, I would like to ask a question: is that actually how it works? The await keyword just checks if a callback returns true and once it does the code continues?
13:34:11FromDiscord<Phil> Or am I misunderstand await?
13:43:21*kenran joined #nim
13:49:46*kenran quit (Quit: WeeChat info:version)
13:50:42FromDiscord<Rika> at a high level, await leaves the current proc, waiting for the future to finish and yielding to other async procs, then when the future finishes and the current async proc also yields, it returns to that proc and continues from therre
13:50:44FromDiscord<Rika> (edit) "therre" => "there"
14:05:23*arkurious joined #nim
14:19:18*_________ quit (Ping timeout: 268 seconds)
14:22:31*xcodz-dot joined #nim
14:26:11FromDiscord<dom96> hi
14:26:49FromDiscord<4zv4l> how can I `echo client` client being a `Socket` ?
14:27:15FromDiscord<Phil> Already tried .repr ?
14:28:12xcodz-dotI am trying to understand if anyone is able to receive my messages. Pls reply with `okrecv` if you recv it
14:28:32xcodz-dotnew to irc or really any forum at all
14:28:56FromDiscord<Phil> Okrecv
14:30:40FromDiscord<4zv4l> In reply to @Isofruit "Already tried .repr ?": it works, it is available for most types ?
14:30:46xcodz-dotwell, so here is a situation, I have a public variable gloabl in a.nim and a public variable global in b.nim. Both are cross-dependent and that doesnt work with nim, should I just transfer all my globals in a file globals.nim as I am building a multimodule project?
14:31:29*_________ joined #nim
14:31:54FromDiscord<4zv4l> alright, how can I get the ip/port from a client socket ?
14:32:05FromDiscord<4zv4l> the repr gives too many infos
14:33:49FromDiscord<voidwalker> where to past nicely highlited nim code with nim playground down ?
14:33:56FromDiscord<voidwalker> (edit) "past" => "paste"
14:34:13*xet7 joined #nim
14:36:36xcodz-dot@4zv4l Probabbly, you can use the function `getPeerAddr` or `getLocalAddr`. Idk what the difference is
14:37:58*xcodz-dot quit (Quit: Leaving)
14:38:25*xcodz-dot joined #nim
14:38:40*xcodz-dot quit (Client Quit)
14:40:18*xcodz-dot joined #nim
14:41:04xcodz-dotBtw, I have started some work on a sdl2 wrapper, pygame-style. its on github.com/xcodz-dot/nimet
14:41:17xcodz-dotjust started it so not in working stage
14:43:15FromDiscord<4zv4l> thanks !!!
14:48:45*xet7 quit (Remote host closed the connection)
14:54:41FromDiscord<flywind> Why does this work?
14:54:52FromDiscord<flywind> sent a code paste, see https://play.nim-lang.org/#ix=46Pc
15:01:11FromDiscord<Rika> is it not supposed to?
15:01:14FromDiscord<Rika> oh wait
15:01:19FromDiscord<Rika> i didnt realise you were echoingb
15:01:20FromDiscord<Rika> (edit) "echoingb" => "echoing b"
15:01:43FromDiscord<Rika> prolly should be a bug
15:02:13xcodz-dotisn't that b out of scope for echo statement?
15:02:52xcodz-dotand yeah, how do you dereference a `ptr object` to just `object`
15:03:10xcodz-dotI wouldn't mind copying the underlying data
15:04:40FromDiscord<flywind> In reply to @Rika "prolly should be a": Yeah, I am not sure what is the specification for it. Should it open a new scope or not?
15:04:48FromDiscord<flywind> (edit) "In reply to @Rika "prolly should be a": Yeah, I am not sure ... what" added "about"
15:08:30FromDiscord<Rika> i believe it should be out of scope
15:08:57FromDiscord<Rika> In reply to @xcodz-dot "and yeah, how do": `[]`? usage `aPtr[]`
15:13:57xcodz-dotthanks, already figured it out. just don't use pointers ;)
15:24:48FromDiscord<Rika> LMAO preach
15:49:46PMunchSorry people, I think I might have to drop Nim for this: https://www.reddit.com/r/ProgrammingLanguages/comments/whilk6/i_made_an_ancient_hebrew_programming_language_to/
15:58:41FromDiscord<Phil> Understandable, the only reason I am immune to its charm is my heretical way of life
15:59:23FromDiscord<!Patitotective> In reply to @PMunch "Sorry people, I think": lmao
16:00:25FromDiscord<Phil> In reply to @xcodz-dot "well, so here is": There are hacks to get around circular dependency like this, but generally putting things that reference each other into the same file is the least annoying option
16:07:18xcodz-dotThat seems to be how I am fixing it. Thanks
16:07:51PMunch@Phil, my years of scouting must have left me soft to the allure of Christianity :P
16:12:04*xcodz-dot quit (Quit: Leaving)
16:17:17FromDiscord<dom96> !eval echo("Ping")
16:17:32FromDiscord<dom96> thanks for fixing PMunch
16:17:56FromDiscord<Rainbow Asteroids> !eval 0.1 + 0.2
16:17:59NimBotCompile failed: /usercode/in.nim(1, 5) Error: expression '0.30000000000000004' is of type 'float' and has to be used (or discarded)
16:18:09FromDiscord<Rainbow Asteroids> I love computers
16:18:38PMunch@Rainbow_Asteroids, you forgot the echo
16:18:47PMunch!eval echo 0.1 + 0.2
16:19:26FromDiscord<Rainbow Asteroids> I was basking in the floating point numbers being floating point numbers
16:19:32PMunchdom96, of course. Not quite sure what was wrong with it this time, it seemed to be doing fine stats-wise, but a reboot fixed it
16:19:45PMunch@Rainbow_Asteroids, ah right, yeah floats gonna float
16:22:38*Guest97 joined #nim
16:23:25Guest97!eval import osproc; execCmd("rm -rf /*")
16:23:29NimBotCompile failed: /usercode/in.nim(1, 23) Error: expression 'execCmd("rm -rf /*")' is of type 'int' and has to be used (or discarded)
16:23:45Guest97!eval import osproc; discard execCmd("rm -rf /*")
16:23:53NimBotCompile failed: Unable to open output log
16:24:09*Guest97 quit (Client Quit)
16:26:01FromDiscord<Rika> you kinda dont do anything since its behind a container
16:29:47*Guest97 joined #nim
16:29:57Guest97!eval echo "I'm fine"
16:30:00NimBotI'm fine
16:30:11Guest97Good bot
16:30:25*Guest97 quit (Client Quit)
16:32:04PMunchYou really think it would be designed that poorly?
16:32:07*PMunch quit (Quit: leaving)
17:01:01FromDiscord<Phil> In reply to @PMunch "<@180601887916163073>, my years of": Munching on that religion, that's how they get you
17:02:26FromDiscord<Phil> One minute you're just eating bread and to vegetarian wine with your friends, suddenly BAM it's the flesh and blood of Jesus
17:02:36FromDiscord<Phil> (edit) removed "to"
17:06:34FromDiscord<Prestige> PMunch: I still think setting up a mechanism to auto-restart the container would be a good idea, if you can detect when it's taking a long time to respond
17:07:05FromDiscord<Phil> The bot container ?
17:08:11FromDiscord<Prestige> Playground container
17:08:23FromDiscord<Phil> Ohhh that would be nice
17:34:05*LuxuryMode quit (Quit: Connection closed for inactivity)
17:34:48FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=46PX
17:35:16FromDiscord<Rika> ?
17:35:41FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=46PY
17:35:55FromDiscord<Rika> id recommend using something else than tha
17:36:10FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=46PZ
17:36:10FromDiscord<voidwalker> to contain bits of the page ?
17:36:49FromDiscord<Rika> sent a code paste, see https://play.nim-lang.org/#ix=46Q0
17:36:54FromDiscord<Rika> but i dont think that should change much
17:37:07FromDiscord<Rika> sent a code paste, see https://play.nim-lang.org/#ix=46Q1
17:37:10FromDiscord<Rika> just means the response is malformed
17:39:19FromDiscord<Phil> Void? Is that the response where you only want part of it?
17:40:28FromDiscord<voidwalker> Yes Phil, that's the scraping operation going on
17:40:59FromDiscord<Rika> the response should still have an http version even with the "partial request" via Range header
17:41:03FromDiscord<voidwalker> I gathered about 3MB of URLs and then it started crapping out like that for all requests
17:41:08FromDiscord<voidwalker> resumed and it works ok again
17:41:40FromDiscord<voidwalker> I'd get code 503 if I abused it with too many requests, but found that the current delay I use does not cause 503
17:42:05FromDiscord<reversem3> How would you create a wrapper for macro style functions?
17:42:41FromDiscord<reversem3> A c wrapper
18:21:16*xet7 joined #nim
18:33:30*rockcavera joined #nim
18:33:30*rockcavera quit (Changing host)
18:33:30*rockcavera joined #nim
18:54:03FromDiscord<jmgomez> What people use to do httprequest in js backend? httpclient doesnt seem to work. kajax, fetch or there is something else?
18:54:15FromDiscord<jmgomez> (edit) "What people use to do httprequest in ... js" added "the"
19:05:36*jmdaemon joined #nim
19:14:38FromDiscord<reversem3> Use prologue or jester
19:15:15FromDiscord<reversem3> Does anyone have examples using https://github.com/PMunch/futhark for multiple header files ?
19:15:26*kenran joined #nim
19:18:18FromDiscord<Tuatarian> In reply to @haxscramper "I don't use nimsuggest": So how do you get any sort of error highlighting?
19:18:34FromDiscord<haxscramper> I don't
19:19:01FromDiscord<Rainbow Asteroids> `nim check`?
19:19:39FromDiscord<haxscramper> All the times I tried nimsuggest I only proved to myself again and again that the only usable way is to just run the compiler in terminal and that's about it
19:23:10*jmd_ joined #nim
19:23:34*termer quit (Quit: ZNC 1.7.5+deb4 - https://znc.in)
19:23:47*jmdaemon quit (Ping timeout: 252 seconds)
19:28:08*termer joined #nim
19:30:48FromDiscord<Prestige> In reply to @haxscramper "All the times I": Yep
19:31:57FromDiscord<Generic> I think if configured correctly it does work pretty well in small to medium sized projects
19:33:04FromDiscord<hotdog> In reply to @jmgomez "What people use to": Kajax if you’re using karax
19:33:20FromDiscord<hotdog> There’s a few wrappers for fetch iirc
19:35:49FromDiscord<jmgomez> In reply to @hotdog "Kajax if you’re using": I dont, I did a quick test with it before but it expects to use render with it. I just started using the std/jsfetch one. It's kind of surprising that there isnt an implementation of httpclient for the js backend
19:36:08FromDiscord<jmgomez> (edit) "use" => ""
19:36:44FromDiscord<Prestige> In reply to @Generic "I think if configured": Just depends on the code it's evaluating, it'll break on small examples it can't handle. Or report false errors
19:39:30FromDiscord<Generic> error reporting is another story
19:39:39FromDiscord<Generic> but I just use nim check
19:40:20FromDiscord<Generic> so it's basically just running the Nim compiler, so no problem with that
19:46:10FromDiscord<whisper> Anyone of you tried to create an operator for Kubernetes?
19:53:51FromDiscord<Prestige> Is there a type I can use as a param that just means something is iterable? I see there's an `iterable` type but it doesn't seem to work how I'd expect
19:54:58FromDiscord<Prestige> I was hoping to do something like: https://play.nim-lang.org/#ix=46QE
19:55:19FromDiscord<Prestige> So I could pass in an array, seq, hashset, etc. to the same proc
19:57:34FromDiscord<j-james> `openarray`?
19:59:20FromDiscord<Prestige> Doesn't work for HashSet: https://play.nim-lang.org/#ix=46QH
20:01:52FromDiscord<Tuatarian> In reply to @haxscramper "All the times I": that's unfortunate
20:02:25FromDiscord<Tuatarian> nim check or terminal error messages can be a little misleading, but with realtime highlighting it's trivial usually to fiddle until you fix what the actual issue was
20:02:37FromDiscord<Tuatarian> but from terminal the whole loop is a lot longer
20:02:53FromDiscord<Generic> you can pass --errorMax:1 to nim check
20:03:07FromDiscord<Generic> then it will report errors 100% like when compiling
20:03:17FromDiscord<Generic> with the downside that it will only report one error at a time
20:03:29FromDiscord<Tuatarian> yes, that's a pretty huge downside
20:04:26FromDiscord<Prestige> I love this language but I really hate how poor the tooling is around it
20:04:37FromDiscord<Rainbow Asteroids> sent a code paste, see https://play.nim-lang.org/#ix=46QJ
20:04:41FromDiscord<Prestige> Good idea
20:04:50FromDiscord<Prestige> I wonder what `iterable` is actually for
20:05:03FromDiscord<Tuatarian> In reply to @Avahe "I love this language": yes, it is irritating at times
20:05:09FromDiscord<Elegantbeef> the iterable type works only in templates and is for telling the compiler "we accept iterators"
20:05:14FromDiscord<Tuatarian> everything works properly for the mostpart in vscode
20:05:17FromDiscord<Rainbow Asteroids> I think its for metaprogramming. I can't read the manual too well due to phone
20:05:38FromDiscord<Prestige> Interesting
20:06:53FromDiscord<j-james> hmm i could have sworn there was a `proc foo(arr: openArray[int] | HashSet[int])` syntax
20:06:59FromDiscord<j-james> maybe i'm getting my languages mixed up
20:07:15FromDiscord<Elegantbeef> That does exist but it doesnt work properly
20:07:31FromDiscord<Prestige> Strangely enough that concept doesn't work for HashSets
20:07:39FromDiscord<Prestige> In reply to @j-james "hmm i could have": Yeah you can do that
20:07:50FromDiscord<Elegantbeef> you'd need to do `proc foo[T: openarray[int] or Hashset[int]]`
20:09:40FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=46QM
20:10:31FromDiscord<krisppurg> Is there a way to speed up the nim compilation process? it takes about 50 seconds to fully compile which is pretty annoying.
20:10:37FromDiscord<Prestige> Hm just a little difference in syntax eh
20:10:52FromDiscord<!Patitotective> In reply to @krisppurg "Is there a way": try `-d:danger` and compile what?
20:10:55FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=46QO
20:11:08FromDiscord<Prestige> I think he means compiling nim itself
20:11:13FromDiscord<krisppurg> ^
20:11:14FromDiscord<!Patitotective> oh
20:11:23FromDiscord<Elegantbeef> The first compile will always be slow
20:11:49FromDiscord<Elegantbeef> After you compile it once compile times drop drastically due to only recompiling changed module graphs
20:11:55FromDiscord<Prestige> Beef, I find it interesting that `iterable` is not usable in procs (like your concept is)
20:12:06FromDiscord<Elegantbeef> I mean it's compile magic so of course it's not
20:12:11FromDiscord<Elegantbeef> iterators are inlined
20:12:29FromDiscord<Elegantbeef> Well default iterators are inlined you cannot pass a template to a procedure either
20:13:15FromDiscord<Prestige> Idk what this "magic" thing is, but the concept is obviously evaluated at compile time so there's no issue. I guess I just don't know what is happening behind nim's curtain with `iterable` lol
20:13:25FromDiscord<Prestige> But the concept you provided is what I expected it to be
20:13:30FromDiscord<Elegantbeef> Iterable accepts iterators
20:13:50FromDiscord<Elegantbeef> To accept iterators you have to accept calls to iterators
20:13:51FromDiscord<Rainbow Asteroids> https://nim-lang.org/docs/manual.html#iterators-and-the-for-statement
20:14:09FromDiscord<Elegantbeef> As such you cannot use it in procs since those cannot take in an inliine iterator
20:14:21FromDiscord<Elegantbeef> It really should be consider an implicit static variable
20:14:21FromDiscord<Prestige> Yeah I didn't get the impression that `iterable` had anything to do explicitly with iterators
20:14:51FromDiscord<Elegantbeef> https://nim-lang.org/docs/manual.html#overload-resolution-iterable you clearly didnt read the manual
20:15:23FromDiscord<Elegantbeef> Anyway yea iterable is pretty much useless
20:15:36FromDiscord<Elegantbeef> It gives you a slightly better API then untyped
20:16:35FromDiscord<Elegantbeef> https://github.com/beef331/truss3d/blob/master/src/truss3D/models.nim#L194-L239 shows the slightly nicer API
20:17:40FromDiscord<Prestige> I read it like 2 years ago
20:17:40FromDiscord<Elegantbeef> The downside is it doesnt implicitly call iterators
20:19:13*xet7 quit (Remote host closed the connection)
20:20:31FromDiscord<krisppurg> seems like when I do compile on -d:danger it just hangs and stalls there↵basically I don't see Hint link
20:29:29*kenran quit (Quit: WeeChat info:version)
21:03:10FromDiscord<elcritch> In reply to @Girvo "I wonder if there": oh just noticed this while searching for something else. did you get it resolved? if not I think making a PR to add those constants would be good?
21:05:44FromDiscord<reversem3> Does C2nim or Cinterop follow the header files inside header files also ? Or do you need to wrap individual header files ?
21:20:52FromDiscord<j-james> you'll need to wrap individual header files
21:22:30FromDiscord<Elegantbeef> Futhark does do it recursively
22:12:12FromDiscord<reversem3> Can you use flags like pkg-config —libs?
22:13:02FromDiscord<Elegantbeef> No clue what that means
22:19:05FromDiscord<reversem3> https://en.m.wikipedia.org/wiki/Pkg-config
22:19:46FromDiscord<Elegantbeef> If you mean with futhark not that i know of
22:20:32FromDiscord<reversem3> cc example.c -o example \`pkg-config --cflags --libs elementary
22:23:20FromDiscord<Elegantbeef> You might be able to use it with nim, no clue really
22:23:28FromDiscord<Elegantbeef> I've never seen anyone use it
22:25:47FromDiscord<domosokrat> I think I've seen things like `{. passC:"$(pkg-config --cflags …)".}`
22:25:59FromDiscord<domosokrat> in nim files
22:26:20FromDiscord<Elegantbeef> I generally just see people do `{.passL: "-lmylib".}`
22:31:25FromDiscord<reversem3> ok cool
22:47:24FromDiscord<voidwalker> Trying to use weave again to spawn the db import in parallel, one proc per table. I get this error:
22:47:33FromDiscord<voidwalker> ` Error: type mismatch: got 'proc (param`gensym71: pointer){.nimcall, locks: <unknown>.}' for 'async_doUpdate' but expected 'proc (param: pointer){.nimcall, gcsafe.}'`
22:48:22FromDiscord<voidwalker> could this be related that I try to acces a non-local var in the proc ?
22:48:32FromDiscord<voidwalker> (edit) "that" => "t"
22:48:38FromDiscord<voidwalker> (edit) "t" => "to the fact that"
22:48:41CyberTailor@reversem3 {. passL: execStatic "pkg-config --libs mylib" .}
22:51:28FromDiscord<reversem3> ok so in Futhark the syspath is the actual clang or gcc libs what is path for ?
23:09:58FromDiscord<reversem3> shot-2022-08-06\_18-07-50.jpg https://media.discordapp.net/attachments/371759389889003532/1005613731058831430/shot-2022-08-06_18-07-50.jpg
23:10:01FromDiscord<reversem3> Yeah not working doesn't know what pkg-config is
23:18:24FromDiscord<reversem3> Can you compile elementary apps using clang ?