<< 16-10-2022 >>

00:21:06FromDiscord<auxym> In reply to @Isofruit "That might turn into": @40yd alternatives might also include object inheritance, simulating interfaces sort of like in std/streams, or closures
00:24:35FromDiscord<Patitotective> In reply to @Patitotective "i have this code": copying std/jsonutils worked :p↵couldnt copy josny (also jsony for some reason doesnt allow multiple discriminators)
00:25:47FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=4dhN
00:35:03FromDiscord<Patitotective> jsony hooks look so copyable
00:43:29*droidrage joined #nim
01:07:30FromDiscord<Elegantbeef> `result = default(T)`
01:07:34FromDiscord<Elegantbeef> 😄
01:19:45FromDiscord<Patitotective> In reply to @Elegantbeef "`result = default(T)`": huh↵now it warns the same but in `system.default`
01:20:05FromDiscord<Elegantbeef> No clue then
01:20:37FromDiscord<Patitotective> may be because of `range`s
01:21:08FromDiscord<Elegantbeef> Ah yea `when x is range: result = T.low`
01:22:30*xet7 quit (*.net *.split)
01:22:31*rez quit (*.net *.split)
01:22:31*genpaku quit (*.net *.split)
01:22:31*sagax quit (*.net *.split)
01:22:31*koltrast quit (*.net *.split)
01:22:31*dtomato quit (*.net *.split)
01:22:31*qwr quit (*.net *.split)
01:22:31*tk quit (*.net *.split)
01:22:31*ldlework quit (*.net *.split)
01:22:31*cornfeedhobo quit (*.net *.split)
01:22:31*Amun-Ra quit (*.net *.split)
01:22:45*qwr joined #nim
01:23:09*Amun-Ra joined #nim
01:23:17*genpaku joined #nim
01:23:35*dtomato joined #nim
01:24:14*tk joined #nim
01:25:05*hexeme joined #nim
01:25:20*koltrast joined #nim
01:27:48*arkurious quit (Quit: Leaving)
01:31:18*cornfeedhobo joined #nim
01:49:45FromDiscord<Patitotective> 🌃
02:14:34FromDiscord<sOkam!> How can you write a Nim type into a string buffer byte by byte?
02:14:41FromDiscord<Elegantbeef> `copyMem`
02:15:27*Jjp137 quit (Quit: Leaving)
02:16:03FromDiscord<sOkam!> does copyMem allow starting at a certain position in the string?
02:16:24FromDiscord<Elegantbeef> Yes you'd do `copyMem(myStr[index].addr, myData.addr, sizeof(myData))`
02:16:40FromDiscord<sOkam!> tyty
02:16:43FromDiscord<Elegantbeef> This doesnt work for any type that has references of course
02:16:57FromDiscord<Elegantbeef> So like `string, seq, ref, ptr, pointer` or any types that build on those
02:17:09FromDiscord<sOkam!> oh
02:17:15FromDiscord<sOkam!> crap
02:17:29FromDiscord<Elegantbeef> To do that you need to use something like flatty or frosty
02:17:58FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4dhY
02:18:12FromDiscord<sOkam!> In reply to @Elegantbeef "To do that you": oh do you happen to know how to do it with flatty? I'm already using it
02:19:25*Jjp137 joined #nim
02:20:29FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4di0
02:21:11FromDiscord<Elegantbeef> `toFlatty`
02:21:14FromDiscord<Elegantbeef> Iirc
02:21:18FromDiscord<Elegantbeef> I now use frosty so dont recall
02:33:51*kenran joined #nim
02:34:47*kenran quit (Remote host closed the connection)
02:36:55FromDiscord<sOkam!> What does toFlatty do exactly? Just convert any type into a string?
02:40:55FromDiscord<Elegantbeef> Yes
02:47:58FromDiscord<sOkam!> Is there a way to not need to use `enumField.ord` for getting the index of an enum as a regular type?
02:48:10FromDiscord<Elegantbeef> "a regular type"
02:48:16FromDiscord<sOkam!> int or whatever
02:48:28FromDiscord<Elegantbeef> You mean as an integer, you can write a converter
02:48:43FromDiscord<sOkam!> kk
02:51:19FromDiscord<Elegantbeef> `converter toInt(myEnum: MyEnum): int = ord(myEnum)`
03:18:02FromDiscord<ChocolettePalette> How does this work? Does it just remove "to" from function name and converts your stuff to the type name left?
03:18:17FromDiscord<Elegantbeef> Converters are implicitly called
03:24:37FromDiscord<ChocolettePalette> Right, but is it some predefined set of converters like toInt, toString etc which you can overload, or some kind of metaprogramming magic which makes it possible to write converters for your own types to your own types?
03:24:45FromDiscord<Elegantbeef> No it's based off of return type
03:27:37FromDiscord<ChocolettePalette> So the name doesn't matter and I can write such converters to convert anything to anything else?
03:27:42FromDiscord<Elegantbeef> Yes
03:27:52FromDiscord<Elegantbeef> The name only matters if you want to explicitly call it
03:27:59FromDiscord<ChocolettePalette> Omg, that's so cool actually
03:28:35FromDiscord<sOkam!> agreed. but careful of hiding stuff with converters. might make the code hard to read if its not an obvious one
03:29:01FromDiscord<sOkam!> depends if you like abstracting away stuff, cpp style, or not. so more a style choice, probably
03:38:30*kenran joined #nim
04:15:15*kenran quit (Remote host closed the connection)
04:37:25*fallback quit (Ping timeout: 246 seconds)
05:22:00*fallback joined #nim
05:31:25*LuxuryMode quit (Quit: Connection closed for inactivity)
06:10:23FromDiscord<ringabout> It's weird that even I tried to switch to locally installed Nim, choosenim need to download dlls which blocks forever.
06:10:30FromDiscord<ringabout> https://media.discordapp.net/attachments/371759389889003532/1031086714237755503/unknown.png
07:24:45*xet7 joined #nim
08:08:02FromDiscord<FM> Could someone explain to me this sentence from the manual please?↵↵"A character literal that does not end in ' is interpreted as ' if there is a preceeding backtick token."
08:09:59FromDiscord<Elegantbeef> It's talking numerical/custom literal syntax
08:10:08FromDiscord<Elegantbeef> !eval echo 100'i32
08:10:15NimBot100
08:14:55FromDiscord<FM> Thank you!
09:02:12FromDiscord<UrNightmaree> what's the best way to practice nim without doing `echo "Hello World!"` or things?
09:02:40FromDiscord<Rika> think of a project
09:02:42FromDiscord<Rika> a small one
09:02:44FromDiscord<Rika> work on that with nim
09:03:01FromDiscord<Rika> lets say oh i want to make a website; okay, what website?
09:03:21FromDiscord<Rika> perhaps a cache layer or maybe a quiz website or a blog
09:03:39FromDiscord<UrNightmaree> well that's too much for making website 💀
09:03:48FromDiscord<UrNightmaree> maybe just some random parser?
09:03:56FromDiscord<Rika> sure
09:03:59FromDiscord<UrNightmaree> or just guess number
09:04:00*xet7 quit (Ping timeout: 264 seconds)
09:04:02FromDiscord<Rika> if thats your interest then thats good
09:04:27FromDiscord<Rika> i guess i start hard when moving languages :InaTehe:
09:06:29*xet7 joined #nim
09:06:55*kevinsjoberg joined #nim
09:07:22FromDiscord<FM> sent a long message, see http://ix.io/4diY
09:08:35FromDiscord<FM> Should it be written 0b10000000'i8 == 0x80'i8 == -128 instead?
09:08:36FromDiscord<Elegantbeef> `0x80` is only a single bit
09:08:54FromDiscord<Elegantbeef> single byte
09:08:57FromDiscord<ShalokShalom> In reply to @Rika "i guess i start": How often do you do that?
09:08:59FromDiscord<Elegantbeef> Cannot cause an overflow from a literal
09:09:06FromDiscord<ShalokShalom> You seem to be loyal to Nim for years
09:09:09FromDiscord<Rika> In reply to @ShalokShalom "How often do you": only rarely
09:09:22FromDiscord<Rika> ive only really switched from python then to nim then now im doing it with elixir
09:09:38FromDiscord<Rika> In reply to @ShalokShalom "You seem to be": only three years
09:09:46FromDiscord<Rika> it hasnt been that long yet
09:10:00FromDiscord<Rika> wow its been 3 years since 1.0
09:10:11FromDiscord<ShalokShalom> Just checked out Elixir again, like the past hour
09:10:21FromDiscord<ShalokShalom> In reply to @Rika "wow its been 3": Yeah, bonkers
09:10:25FromDiscord<ShalokShalom> Time flies
09:10:40FromDiscord<ShalokShalom> Elixir is just too much noise (for me)
09:10:46FromDiscord<ShalokShalom> Nice language, otherwise
09:10:50FromDiscord<Rika> ive been enjoying it so far
09:10:59FromDiscord<Rika> it hasnt been noisy to me it seems
09:11:04FromDiscord<Rika> as in the language syntax
09:11:59FromDiscord<ShalokShalom> Well, Nim is much shorter
09:12:06FromDiscord<ShalokShalom> Despite being typed
09:12:06FromDiscord<FM> In reply to @Elegantbeef "Cannot cause an overflow": So shouldn't it be written "0b10000000'i8 == 0x80'i8 == -128" ? This is the part I don't get
09:12:47FromDiscord<FM> instead of `0b10000000'i8 == 0x80'i8 == -1`
09:13:02FromDiscord<Elegantbeef> !eval echo 0b10000000i8
09:13:07NimBot-128
09:13:14FromDiscord<Elegantbeef> !eval echo 0b10000000'i8
09:13:19NimBot-128
09:13:26FromDiscord<Rika> In reply to @ShalokShalom "Well, Nim is much": i guess so yes, but i like the features elixir gives, like the crazy amount of pattern matching
09:13:44FromDiscord<Rika> overloading on steroids
09:13:45FromDiscord<Rika> pretty cool
09:14:25FromDiscord<ShalokShalom> Mhn
09:14:40FromDiscord<ShalokShalom> I am very sensitive to syntax
09:14:50FromDiscord<ShalokShalom> Too much of it quickly overloads my brian
09:14:52FromDiscord<FM> Yes, I understand that `echo 0b10000000i8` prints out -128.↵So this means that it was a typo in the manual?
09:15:01FromDiscord<ShalokShalom> (edit) "brian" => "brain"
09:15:07FromDiscord<FM> https://media.discordapp.net/attachments/371759389889003532/1031133176334127104/unknown.png
09:15:14FromDiscord<Rika> im sensitive in a different way, if i do not like it then i cannot make myself like it
09:15:24FromDiscord<ShalokShalom> Yeah, same.
09:15:31FromDiscord<ShalokShalom> I often try hard.
09:15:35FromDiscord<Elegantbeef> Likely
09:15:50FromDiscord<Elegantbeef> 'PRs welcome' is what i'll say
09:16:07FromDiscord<Rika> they accidentally forgot twos complement i guess lol
09:16:14FromDiscord<ShalokShalom> @FM Nim's best error messages are the community↵↵Nim's best tutorials are the community
09:16:36FromDiscord<ShalokShalom> Those two things, I still struggle to find differently.
09:17:22FromDiscord<ShalokShalom> Is there testing, or proof reading going on for documentation?
09:17:34FromDiscord<FM> In reply to @Elegantbeef "Likely": Thank you
09:18:13FromDiscord<Elegantbeef> The manual is untested as it's mostly human written documentation to convey the loose definition of Nim
09:18:15FromDiscord<Elegantbeef> There is proper testing for module documentation
09:39:15*xet7 quit (Ping timeout: 248 seconds)
09:43:13*xet7 joined #nim
10:05:53FromDiscord<Rika> In reply to @ShalokShalom "You seem to be": well, there isnt really anything that can replace it for me, but ive kind of been growing discontent with it i guess
10:43:01*xet7 quit (Ping timeout: 268 seconds)
10:51:47*jmdaemon quit (Ping timeout: 248 seconds)
10:53:15FromDiscord<FM> Does anyone else also get hundreds of nimsuggest.exe process? I use VS Code with nimsaem's extension https://media.discordapp.net/attachments/371759389889003532/1031157869791412274/unknown.png
10:56:31FromDiscord<baalajimaestro> Lemme check
10:56:59FromDiscord<FM> I had 1000+
10:59:21FromDiscord<baalajimaestro> image.png https://media.discordapp.net/attachments/371759389889003532/1031159407259684904/image.png
10:59:35FromDiscord<baalajimaestro> just having 2 processes of nimsuggest
11:03:03*PMunch joined #nim
11:03:36FromDiscord<FM> 😢↵i'll try to find the source of the issue https://media.discordapp.net/attachments/371759389889003532/1031160474022187038/unknown.png
11:06:10FromDiscord<FM> It seems to only happen if I work on a single file
11:06:28FromDiscord<FM> If I open the folder in VS code and work on a nim file, there is no issue
11:06:46PMunchDo you use NimLSP?
11:07:11FromDiscord<FM> I use this extension: https://media.discordapp.net/attachments/371759389889003532/1031161375780765706/unknown.png
11:07:23PMunchSo no
11:07:34PMunchIt could be a project-root detection issue
11:08:34PMunchnimsuggest needs to be provided with the root of the project. It could be that that plug-in isn't able to automatically detect the project root and therefore keeps spinning up nim nimsuggest processes
11:08:49FromDiscord<FM> I remember this thread:↵https://forum.nim-lang.org/t/9499
11:09:39FromDiscord<FM> it's a related problem, it gave me the "workaround"
11:16:11PMunchAh yes, so it seems to be what I said, project folder detection gone awry
11:21:39FromDiscord<Bung> that's sad , after years still have problem with that.
11:32:45FromDiscord<40yd> sent a code paste, see https://play.nim-lang.org/#ix=4djG
11:40:37PMunchI don't think so. And I'm having a hard time to reason about how such a thing would even be implemented
11:51:25FromDiscord<40yd> sent a code paste, see https://play.nim-lang.org/#ix=4djJ
12:10:17FromDiscord<vestel> how nim's linter is called?
12:19:13FromDiscord<sOkam!> When should I use `doAssert` instead of `assert`?↵I have read the documentation, asking about practical used for when its best to use one or the other
12:19:24FromDiscord<sOkam!> (edit) "used" => "uses"
12:20:33FromDiscord<Bung> `assert` when u want debug
12:21:05FromDiscord<sOkam!> doesnt doAssert do debugging too?
12:21:23FromDiscord<sOkam!> aren't they both debugging tools in essence?
12:21:26FromDiscord<Bung> assert is removed after release your program
12:22:00FromDiscord<sOkam!> yeah, I understood that part. which is why I asked to begin with
12:24:07FromDiscord<Rika> In reply to @sOkam! "doesnt doAssert do debugging": It can also be used for validation
12:24:14FromDiscord<Rika> Though I wouldn’t recommend it personally
12:26:56FromDiscord<sOkam!> For example, I saw some glfw and opengl examples that used both `doAssert glfwInit()` and `assert glfwInit()`↵Different examples used different assertion types, even for the same function. So made me wonder why even use one or the other to begin with
12:27:16FromDiscord<Rika> Probably unintentional
12:28:03FromDiscord<sOkam!> In reply to @Rika "It can also be": What happens if a production app hits a doAssert? Does it just stop working?
12:28:25FromDiscord<Rika> It raises an assertion error which I think is a defect too so yes in some cases
12:33:47*arkurious joined #nim
13:43:53*estiquelapice quit ()
13:45:05*estiquelapice joined #nim
13:46:14*xet7 joined #nim
13:46:49*xet7 quit (Remote host closed the connection)
13:47:03*xet7 joined #nim
14:42:40*vicecea quit (Remote host closed the connection)
15:08:51*krux02 joined #nim
15:12:42FromDiscord<vestel> how do I get all identifiers exported by module in macro?
15:17:49*krux02 quit (Remote host closed the connection)
15:18:32*krux02 joined #nim
15:33:47*vicecea joined #nim
15:50:54*rwb is now known as rb
16:18:08PMunch@vestel, that's not (trivially) possible
16:18:21FromDiscord<vestel> In reply to @PMunch "<@961348955080388659>, that's not (trivially)": Ye I see
16:18:33FromDiscord<vestel> took different approach
16:21:03*al1ranger joined #nim
16:21:57*al1ranger quit (Client Quit)
17:26:44FromDiscord<vestel> Can I just print code generated by macros and not compile it?
17:28:24FromDiscord<Patitotective> In reply to @vestel "Can I just print": `--expandMacro:MACRO dump every generated AST from MACRO`
17:28:38FromDiscord<Patitotective> you have to compile it afaik
17:28:42FromDiscord<Patitotective> (edit) "you have to compile it ... afaik" added "though"
17:29:06FromDiscord<Patitotective> (edit) "you" => "compile with the above (you" | "though afaik" => "though)"
17:29:27FromDiscord<Patitotective> you can also `echo repr result` at the end of the macro
17:30:50FromDiscord<vestel> In reply to @Patitotective "you can also `echo": Yeah, that works. Thanks!
17:31:01FromDiscord<Patitotective> :]
17:44:34FromDiscord<Horizon [She/Her]> `literal: string | float64` isn't possible, is there a way to do something similar? Because I don't want to make it so you do `MyType[T](literal: literal)` since then I'd imagine I won't be able to have a list of tokens with different literal types
17:47:11FromDiscord<vestel> In reply to @Event Horizon "`literal*: string | float64`": ref objects + methods?
17:47:31FromDiscord<Patitotective> In reply to @Event Horizon "`literal*: string | float64`": object variants?
17:47:50FromDiscord<vestel> In reply to @Patitotective "object variants?": ye, like nimnodes do
17:49:47FromDiscord<Horizon [She/Her]> Ah alright
18:00:41FromDiscord<d4rckh> went back to an older nim project where i use asynchttpserver
18:00:53FromDiscord<d4rckh> it didnt cause problems before but now it does
18:00:54FromDiscord<d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=4dlR
18:00:58FromDiscord<d4rckh> it complains that cb is not gcsafe
18:01:04FromDiscord<d4rckh> (edit) "it complains that ... cbpro" added "the" | "thecb ... is" added "pro"
18:01:06FromDiscord<d4rckh> (edit) "pro" => "proc"
18:01:27FromDiscord<d4rckh> did anything change?
18:06:17FromDiscord<System64 ~ Flandre Scarlet> Hi, is there a way to make that kind of GUI on Nim please? https://media.discordapp.net/attachments/371759389889003532/1031266848685162496/unknown.png
18:16:12FromDiscord<Patitotective> In reply to @System64 "Hi, is there a": should be able to do it on imgui (https://github.com/nimgl/nimgl) by using the draw list (or if you mind wrapping https://github.com/thedmd/imgui-node-editor)↵i guess you can also do it with wxwidgets (https://github.com/PMunch/wxnim) by manually drawing things with `wxGraphicsContext` https://forums.wxwidgets.org/viewtopic.php?t=47474
18:17:40FromDiscord<System64 ~ Flandre Scarlet> In reply to @Patitotective "should be able to": and is that something that is hard to do? Also, what is a Draw List?
18:19:37FromDiscord<Patitotective> In reply to @System64 "and is that something": you would have to know imgui really well↵a draw list is imgui's way of custom drawing
18:19:54FromDiscord<System64 ~ Flandre Scarlet> In reply to @Patitotective "you would have to": Ah, I don't know imgui at all :/
18:20:41FromDiscord<Patitotective> its not that hard↵take a look at https://github.com/Patitotective/ImTemplate https://github.com/Patitotective/ImDemo↵https://nimgl.dev/docs/imgui.html#addRect%2Cptr.ImDrawList%2CImVec2%2CImVec2%2Cuint32%2Cfloat32%2CImDrawCornerFlags%2Cfloat32
18:21:06FromDiscord<Patitotective> https://pthom.github.io/imgui_manual_online/manual/imgui_manual.html (cpp though its easily translatable to nim)
18:21:40FromDiscord<Patitotective> can also try wrapping https://github.com/thedmd/imgui-node-editor
18:23:41FromDiscord<System64 ~ Flandre Scarlet> In reply to @Patitotective "can also try wrapping": Can Futhark do its job for wrapping this?
18:24:08*ephaptic joined #nim
18:24:13PMunchFuthark can't do C++ (yet)
18:24:44FromDiscord<System64 ~ Flandre Scarlet> Ah alright, thanks
18:25:10PMunchHmm, this is suuper weird..
18:25:41PMunchI compare a int32 number to the value 25000. It says that it is always higher than that. But if I print it out, it is 17000..
18:26:31FromDiscord<Patitotective> `25000i32` :P
18:26:33FromDiscord<Patitotective> (edit) ":P" => ":p"
18:27:34PMunchLooking at the C code it does that conversion..
18:28:06FromDiscord<System64 ~ Flandre Scarlet> In reply to @Patitotective "can also try wrapping": And I need to wrap all this stuff? https://media.discordapp.net/attachments/371759389889003532/1031272336093085807/unknown.png
18:28:56NimEventerNew thread by Aetopia: Using Multi file select with wNim's File Dialog returns an empy sequence., see https://forum.nim-lang.org/t/9533
18:29:51FromDiscord<Patitotective> you can try looking for an imgui node editor that uses cimgui and try the same that nimgl does for wrapping cimgui itself (maybe futhark would even work)
18:30:30FromDiscord<System64 ~ Flandre Scarlet> what is cimgui? C implementation of imgui?
18:30:42FromDiscord<Patitotective> yes
18:31:39FromDiscord<Patitotective> https://github.com/cimgui/cimnodes
18:31:53FromDiscord<System64 ~ Flandre Scarlet> Lol I just found the same thing
18:43:20FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4dm1
18:44:01FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=4dm1" => "https://play.nim-lang.org/#ix=4dm2"
18:44:51FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=4dm2" => "https://play.nim-lang.org/#ix=4dm3"
18:45:10FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=4dm3" => "https://play.nim-lang.org/#ix=4dm4"
18:46:33FromDiscord<hovsater> sent a code paste, see https://play.nim-lang.org/#ix=4dm5
18:46:57FromDiscord<hovsater> (edit) "https://play.nim-lang.org/#ix=4dm5" => "https://play.nim-lang.org/#ix=4dm6"
18:47:07FromDiscord<hovsater> (edit) "https://play.nim-lang.org/#ix=4dm6" => "https://play.nim-lang.org/#ix=4dm7"
18:47:24FromDiscord<hovsater> (edit) "https://play.nim-lang.org/#ix=4dm7" => "https://play.nim-lang.org/#ix=4dm8"
18:48:00FromDiscord<hovsater> (edit) "https://play.nim-lang.org/#ix=4dm8" => "https://play.nim-lang.org/#ix=4dm9"
18:50:17FromDiscord<Phil> If you have a distinct type alias, any proc defined for the original will not work with the type alias unless it has its own proc with the same name (which may be borrowed from the original).↵Could be the author wasn't aware that Port has its own stringification proc, if that works it's all good anyway, the uint16 just "converts" the Port-variable into a uint16 type for the stringifier proc
18:52:10FromDiscord<hovsater> @Phil right got it. So it works in this case due to https://nim-lang.org/1.4.8/nativesockets.html#%24%2CPort.
18:52:15FromDiscord<Phil> I mean, it could also be for example that the Port specific proc is defined as `proc $(x: Port): string = "Port " & $x.uint16` , which you wouldn't want in this scenario.
18:52:28FromDiscord<hovsater> If this wasn't defined, casting it to `uint16` would help as `$` is defined for that type?
18:52:42FromDiscord<Phil> Correct
18:52:56FromDiscord<hovsater> Got it. Thanks for the explanation. 👍
18:52:59FromDiscord<Phil> What you see in that part of the code is the type alias "borrowing" the original `$` proc from uint16
18:54:29PMunchFigured out it was me using snprintf wrong..
18:54:37PMunchBut Nims $ got it wrong as well..
18:54:48PMunchBut now everything works!
18:55:03PMunchI'm able to run a BME280 on an Attiny85 with pure Ratel code!
18:55:10FromDiscord<hovsater> I have another question, while I'm at it. `HttpStatus` is a type defined as a range from 0 to 599. That's all fine. But then there's constants like `Http200` that are defined as ` Http200 = HttpCode(200)`. What does this mean? Is `Http200` a type or a value here? Both?
18:55:21FromDiscord<hovsater> (edit) "`HttpStatus`" => "`HttpCode`"
18:55:42FromDiscord<hovsater> (edit) "599." => "599 (https://github.com/nim-lang/Nim/blob/version-1-4/lib/pure/httpcore.nim#L26)."
18:59:34FromDiscord<Phil> In reply to @hovsater "I have another question,": HttpCode is the type as in "I can be any value between 0 and 599".↵That's just a type definition, not an actual instance or value of anything.↵`Http200 = HttpCode(200)` is for convenience, if you want to have an `Http200` you can't just pass in `200` into a proc that expects an `HttpCode` instance.↵It's a distinct range, you need to convert the number 200 first into the type `HttpCod
19:00:42FromDiscord<Phil> And doing the conversion of 200 to `HttpCode(200)` (or various other ways as nim supports a lot of different syntax variations) is very annoying, thus these shortcuts for convenience
19:00:47FromDiscord<hovsater> Got it. So `Http200` is an actual value here (200) but conforming to the type `HttpCode`. `HttpCode` is a type as in something I can annotate my procs with.
19:00:57FromDiscord<Phil> In reply to @hovsater "Got it. So `Http200`": Correct
19:03:18FromDiscord<hovsater> I must say, I've been doing Nim for about two hours now, and I'm already productive. I have an HTTP server going, I render HTML and I'm about to look into getting some JS on the screen (written in Nim of course). That's pretty dang sweet! 🙂
19:07:13FromDiscord<Phil> In reply to @hovsater "I must say, I've": If you're checking out webdev, taken a look at Jester and/or Prologue yet?↵They're pretty much the 2 backend frameworks around (I've heard of nexus being in development, but no idea how far it is).↵For frontend there's karax if you want SPA or nimja if you want Server Side Rendering
19:08:06FromDiscord<Phil> Jester e.g. starts you up a webserver with ridiculously few lines of code (due to some macro magic that you need to be aware about to use properly)
19:08:18FromDiscord<Phil> (edit) "about" => "off"
19:08:21FromDiscord<Phil> (edit) "off" => "of"
19:09:00FromDiscord<hovsater> In reply to @Isofruit "If you're checking out": Cool. I'll definitely look into those later! I tend to explore languages by basically writing as much as possible myself to really learn the ins and outs of the language. 🙂
19:21:23*PMunch quit (Quit: leaving)
19:23:36*wallabra quit (Ping timeout: 260 seconds)
19:24:02*wallabra joined #nim
19:30:53*wallabra quit (Ping timeout: 268 seconds)
19:32:12FromDiscord<vestel> Why does macro prints its output as ast repr when added NimNode return type?
19:33:37FromDiscord<Patitotective> In reply to @vestel "Why does macro prints": example?
19:33:47FromDiscord<Patitotective> In reply to @hovsater "I must say, I've": thats how nim is :]
19:34:13FromDiscord<vestel> In reply to @Patitotective "example?": my example is too huge to provide (14k > lines printed)
19:34:25FromDiscord<vestel> (edit) ">" => "<"
19:34:44FromDiscord<vestel> but i think it works with any macro
19:35:47FromDiscord<Patitotective> In reply to @vestel "but i think it": example?
19:42:22FromDiscord<jos> choosenim installed the amd64 version of nim on my m1 mac and it's messing up a bunch of FFI stuff
19:42:33FromDiscord<jos> i noticed the choosenim install script doesn't support arm
19:42:45FromDiscord<jos> is there some way to get choosenim working with arm64, even if you have to build from source
19:50:01FromDiscord<auxym> In reply to @jos "is there some way": https://github.com/dom96/choosenim/issues/149
19:50:35FromDiscord<jos> i did see that, was wondering if there was a workaround
19:50:49FromDiscord<FM> sent a code paste, see https://play.nim-lang.org/#ix=4dmp
19:51:56FromDiscord<jos> what error do you get?
19:52:59FromDiscord<FM> `Error: execution of an external program failed: 'pathToMyFolder\test2.exe '
19:55:17FromDiscord<FM> ah this does compile, but the .exe can't be run
19:55:40FromDiscord<jos> maybe your stack size is too small, that's the only thing i can think of
19:56:36FromDiscord<jos> the MSVC default is 1mb, and since nim compiles to C and uses MSVC on windows, probably that
19:59:08FromDiscord<auxym> 510 int64's works out to only 4kb though. but yeah I also don't see another reason it would crash
19:59:36FromDiscord<auxym> though nim uses mingw64 (aka gcc) by default on windows I think
19:59:40FromDiscord<FM> tried this on 2 Windows 10 laptops, both crash (the other crashes at 509)
20:01:04FromDiscord<FM> i'll install Nim on WSL and try again
20:01:22FromDiscord<auxym> which C compiler are you using on windows? and which version of nim?
20:02:33*ephaptic quit (Quit: WeeChat 3.7)
20:02:56FromDiscord<FM> Nim version 1.6.8
20:03:38FromDiscord<FM> and I'm pretty sure the C compiler is MinGW (but where can I check to be sure of that?)
20:05:19FromDiscord<FM> I used choosenim to install nim
20:07:31FromDiscord<auxym> you can compile with `--verbosity:2` to output the full C compiler command line
20:11:10FromDiscord<FM> ok it's MinGW
20:11:14FromDiscord<FM> it says gcc.exe
20:12:01FromDiscord<FM> and I have this in my choosenim installation folder https://media.discordapp.net/attachments/371759389889003532/1031298487712747640/unknown.png
20:17:04*disso_peach quit (Quit: Leaving)
20:27:08FromDiscord<jos> In reply to @auxym "510 int64's works out": isn't it 510510 int32s
20:27:11FromDiscord<jos> which is 1mb
20:27:29FromDiscord<auxym> oh yeah
20:27:32FromDiscord<auxym> missed that
20:27:37FromDiscord<FM> On WSL, it crashes at a==1024
20:27:49FromDiscord<FM> with the gcc compiler
20:28:05FromDiscord<auxym> see https://stackoverflow.com/questions/156510/increase-stack-size-on-windows-gcc
20:28:12FromDiscord<FM> Segmentation fault
20:28:25FromDiscord<jos> Jesus, the default stack size is 8mb on most Linux distros
20:28:30FromDiscord<jos> what do you aim to achieve FM?
20:28:34FromDiscord<Elegantbeef> `--passC:"--stack, 321321321321321"`
20:28:37FromDiscord<jos> at some point you're going to overflow the stack
20:28:56FromDiscord<jos> do you want to allocate your array on the heap instead?
20:29:05FromDiscord<FM> I'm just trying to have an array like a numpy array
20:29:07FromDiscord<Elegantbeef> Anywho yea heap is better
20:29:14FromDiscord<FM> and work on it
20:29:33FromDiscord<Elegantbeef> `var a = new array[a, array[a, T]]`
20:29:45FromDiscord<Elegantbeef> This heap allocates it which is how you should do it for something this large
20:29:45FromDiscord<auxym> In reply to @Elegantbeef "`--passC:"--stack, 321321321321321"`": wouldn't that be passL?
20:29:58FromDiscord<Elegantbeef> No clue auxym i dont know C compilers
20:30:03FromDiscord<Elegantbeef> I barely know Nim's compiler
20:30:13FromDiscord<auxym> so you pretend 😉
20:31:26FromDiscord<Elegantbeef> Eh i'm still fighting implementing `toOpenArray` in the VM so who knows what i know
20:32:07FromDiscord<FM> In reply to @jos "do you want to": Yes I think that was my problem, thank you
20:32:31FromDiscord<Elegantbeef> Heap allocated types are nilable so be conscious of that
20:33:25FromDiscord<FM> sent a code paste, see https://play.nim-lang.org/#ix=4dmE
20:33:34FromDiscord<Elegantbeef> Yes `T` is the type you want
20:33:40FromDiscord<Elegantbeef> so if you want `int` you put `int` there
20:33:51FromDiscord<Elegantbeef> also you want `freq = new array[a, array[a, int]`
20:34:00FromDiscord<Elegantbeef> `:` is for type annotations, not for assignment
20:34:01FromDiscord<FM> I get `Error: expected type, but got: new array[a, array[a, int]]`
20:34:36FromDiscord<FM> oh right sorry
20:35:21FromDiscord<FM> i don't know how I missed that
20:35:35FromDiscord<Elegantbeef> Well the compiler told you 😛
20:39:07FromDiscord<FM> thank you all!
21:20:47*disso_peach joined #nim
21:29:44*jmdaemon joined #nim
21:46:35FromDiscord<SirOlaf> Why does this add a space for used names https://play.nim-lang.org/#ix=4dmV
21:46:48FromDiscord<SirOlaf> If you replace add with something that isn't defined it does not add a space
22:05:24FromDiscord<SirOlaf> `xor add f` keeps all spaces, why does it participate in resolution
22:24:43FromDiscord<SirOlaf> https://github.com/nim-lang/Nim/blob/devel/compiler/lookups.nim#L48
22:24:59FromDiscord<SirOlaf> Turns out I got scammed, x is a nkOpenSymChoice which is not handled
22:25:16*attah quit (Ping timeout: 246 seconds)
22:26:37FromDiscord<SirOlaf> So it never reaches lookup and instead raises
22:35:53*attah joined #nim
23:20:49*arkanoid joined #nim
23:21:17arkanoidis there any reason why nim prefers c2nim/futhark to swig? https://www.swig.org/exec.html
23:38:57*adium quit (Quit: Stable ZNC by #bnc4you)
23:46:55*adium joined #nim