<< 18-02-2021 >>

00:01:09FromDiscord<konsumlamm> when you deem it too big for one module
00:12:41FromDiscord<zetashift> In reply to @leorize "can you make a": I can, but knowing me I'm doing something wrong here 😛
00:19:39*gmaggior quit (Quit: Leaving)
00:21:34FromDiscord<Yardanico> @krux02 you might want to search in the sqlite db I made (it's based on irclogs) https://drive.google.com/file/d/1njJpsBpFUf4MsaDkQokuIRjQqgOgT6/view
00:21:43FromDiscord<Yardanico> you can open it with something like sqlitebrowser
00:22:02FromDiscord<zetashift> Alright I might actually have found something weird, why does `fail` fail and the `foo` work? https://play.nim-lang.org/#ix=2PNj
00:26:17FromDiscord<バロザード> sup, are there any game engines or game related content made with Nim thats not Godot bindings?
00:26:42FromDiscord<ElegantBeef> I like the nico framework and have made a fairly fun game with it 😄
00:27:08*Vladar quit (Quit: Leaving)
00:27:08FromDiscord<ElegantBeef> Raylib bindings are fairly common
00:27:41krux02バロザード: I made OpenGlSandbox here: https://github.com/krux02/opengl-sandbox
00:27:51FromDiscord<バロザード> this? https://github.com/ftsf/nico
00:27:58FromDiscord<ElegantBeef> Yep
00:28:10FromDiscord<バロザード> i see
00:28:25FromDiscord<バロザード> does it come with colliders or will i have to code stuff like that themselves?
00:28:54FromDiscord<バロザード> My main interest in nim is that I want to make games, but i dont want to c++ and im not a huge fan of how rust people really are pushing for ECS in games
00:28:56FromDiscord<ElegantBeef> It is barebones but impbox(the creator) did at one point use chipmunk with it
00:28:57krux02OpenGL sandbox is not a binding in any form. It is completely developed in Nim and it couldn't be implemented in another language that is less powerful like c++.
00:29:23FromDiscord<バロザード> whats chipmunk?
00:29:30FromDiscord<ElegantBeef> A 2D physics engine
00:29:33FromDiscord<バロザード> i see
00:29:34krux02another engine
00:29:55FromDiscord<バロザード> well im interested in making a fighting game so my collider requirements are super specialized 😅 e
00:30:09FromDiscord<バロザード> ill probably have to use godot in the end, but im exploring other options
00:30:18krux02バロザード: Do you look for bindings for something established, or are you looking for new solutions that embrace the possibilites of new programming languages?
00:30:33FromDiscord<バロザード> im looking for something thats fast and i dont have to build everything myself
00:30:53krux02バロザード: please take a look at opengl sandbox and give me feedback about it.
00:31:04krux02It is as fast as handwritten OpenGL can get.
00:31:11*spiderstew_ quit (Quit: ZNC 1.7.2+deb3 - https://znc.in)
00:31:11krux02but it is also fast to develop in.
00:31:20FromDiscord<バロザード> hm, does it come with an animation manager or is that something i will have to build myself?
00:31:25*spiderstew joined #nim
00:31:34krux02you would have to build that.
00:31:55FromDiscord<ElegantBeef> Checkout raylib bindings if you dont want godot, it might have stuff like that idk
00:32:09FromDiscord<バロザード> i see
00:32:25krux02it mainly tries to solve the hassle with writing shaders in bare bone OpenGL without restricting the possibilites to some predefiend attributes and uniforms
00:33:34FromDiscord<バロザード> i guess i dont have much to lose lol ¯\_(ツ)_/¯
00:33:40krux02yea
00:34:40krux02there is probably something wrong with OpenGL sandbox that causes that nobody provides me with feedback for it.
00:35:20krux02So if you try it out, and you decide not to use it for whatever reason, please tell me why you would not want to use it.
00:35:28krux02I need feedback like that.
00:35:47FromDiscord<ElegantBeef> I havent seen it before, similar goal to aglet it seems
00:35:56krux02what is aglet?
00:36:03FromDiscord<ElegantBeef> https://github.com/liquidev/aglet
00:36:10FromDiscord<ElegantBeef> It's lqdev's opengl wrapper
00:37:21krux02well, OpenGL sandbox is not an OpenGL wrapper in any form.
00:37:27FromDiscord<ElegantBeef> Ah
00:37:33krux02You use bare bones OpenGL whereever suitable.
00:37:44krux02The reason for that is, OpenGL is documented.
00:38:06krux02I know it sucks, but at least its behavior is well specified and documented and used a lot.
00:38:10krux02People know what to expect.
00:38:26krux02I don't want to put yet another opinionated layer on top.
00:38:33krux02Also it used SDL2 bare bones.
00:38:41krux02I think SDL2 is quite nice to use.
00:38:52krux02I don't want to put a layer on top of that either.
00:39:14krux02The things that I fix are how shaders are compiled and uniforms and attributes are bound to shaders.
00:39:37krux02that is by far the most annoying part of non-fixed-function-pipeline-opengl
00:40:34krux02no query of uniform location, no messing up of uniform names in shader and code, no accidental invalid pointer passing to opengl.
00:40:42krux02everything wrapped nice and smoothly.
00:40:56FromDiscord<ElegantBeef> I'm a numpty so at the very least i'm interested in something that abstracts it away so i can just load a model and then on render it draw where i need/want it. Anything lower than that and i'll be bored in a few seconds 😄
00:41:09krux02you just render like if you are in immediate mode, but wit full shader flexibility
00:41:47krux02ElegantBeef: well there is an example where I render an IQM mesh.
00:42:19krux02This library is for you if you like to render procedurally
00:42:41krux02generate procedural worlds in no time
00:43:18krux02The idea is not to implement a renderer for a specific data type, like the mesh that you want to render
00:43:44krux02the idea is to be able to render any kind of data from memory as quickly as possible.
00:44:01krux02if you have an array, you can put in on the gpu and use it somehow to render it.
00:44:22FromDiscord<ElegantBeef> Yea it seems to remove the opengl tedium that makes leave even quicker
00:44:55krux02and it generates opengl code under the hood that is close to the optimum you can have
00:45:15krux02but what is leave?
00:45:42FromDiscord<ElegantBeef> Though i'm not a graphics programmer one bit, just a pretend technical artist
00:46:12krux02well yea, OpenGL sandbox is for learning the OpenGL pipeline.
00:46:28krux02After all it doesn't solve things for you, it just does the tedious parts for you.
00:46:38krux02In the end you still write the engine and renderer yourself.
00:49:32FromDiscord<ElegantBeef> If i ever actually try to implement my silly 3D framework idea i might give it a whirl
00:55:28*Tanger quit (Quit: Leaving)
01:13:09*njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
01:13:32*njoseph joined #nim
01:25:08FromDiscord<ajusa> I'm trying to create a 2D array in Nim but I'm failing somehow...↵https://play.nim-lang.org/#ix=2PNz↵Could someone tell me what I'm doing wrong? I thought I followed the tutorial pretty closely for this
01:26:14FromDiscord<ElegantBeef> Nim doesnt support floats without a leading value
01:26:21FromDiscord<ElegantBeef> `0.25` is valid `.25` isnt
01:26:29FromDiscord<ElegantBeef> So it's parsing it as `[.`
01:27:16FromDiscord<ElegantBeef> Secondly the `0` started arrays will complain that they're integers you want to do `0f64`
01:27:29FromDiscord<ElegantBeef> thirdly your arrays have a length of 4 and you declare them saying they're length of 3
01:28:08FromDiscord<ajusa> ah yes, I did notice the last one.
01:28:09FromDiscord<ElegantBeef> Finally you can just do this https://play.nim-lang.org/#ix=2PNB
01:28:44FromDiscord<ajusa> thanks! I forgot how float literals were handled in nim, I though the error message was related to the way I had declared the arrays
01:29:48*Tanger joined #nim
01:29:54FromDiscord<ElegantBeef> No problem, you gave me a problem that was easy to resolve 😛
01:30:32*abm quit (Quit: Leaving)
01:51:47FromDiscord<バロザード> does nico have 3d support?
01:52:15Prestigenah
01:52:30FromDiscord<バロザード> ugh
01:52:45FromDiscord<バロザード> well if i do decide to use it i guess i could just do prerendered 3d sprites
01:52:50PrestigeNot yet, anyway. It looks like it's planned in the readme
01:53:45FromDiscord<バロザード> oof and it doesnt have webrtc support yet
01:53:57FromDiscord<バロザード> welp, it sounds cool enough to do a game jam in or something
01:54:19PrestigeYeah - have you seen any of the games made with it? They are pretty cool
01:57:47FromDiscord<ElegantBeef> Impbox used webtrc for a project aswell
01:58:27FromDiscord<ElegantBeef> Or websockets, dont recall if that's apart of rtc
01:59:05*asdflkj_ quit (Ping timeout: 240 seconds)
02:03:24*Cthalupa quit (Ping timeout: 265 seconds)
02:05:12*Cthalupa joined #nim
02:18:32FromDiscord<exelotl> Is there a way to give an array a size but also have it be unchecked?
02:21:29FromDiscord<exelotl> I'm wrapping a 2D array from C which should either by accessed like arr[0..1][0..512] or arr[0][0..1023]
02:22:32FromDiscord<exelotl> Probably best to make 2 vars for it I guess
02:27:53FromDiscord<ElegantBeef> Just use a 1D array size of `1024` and have a `[]` and `[,]` operator?
02:32:49*krux02 quit (Remote host closed the connection)
02:47:54FromDiscord<exelotl> Hmm that's a neat idea, but I'd like to still be able to use arr[0] to refer to the entire block of 512 tiles
02:48:16FromDiscord<slymilano> New Nimlings up for `assignments` and `if conditionals`! https://github.com/sergiotapia/nimlings/blob/master/src/exercises/exercise_02_assignments.nim
02:48:28FromDiscord<exelotl> (edit) "Hmm that's a neat idea, but I'd like to still be able to use arr[0] ... toan" added "or 1" | "the" => "an"
02:51:40FromDiscord<ElegantBeef> Sly you should use the RST more so you can gen docs to go with this 😄
02:52:19FromDiscord<ElegantBeef> Stuff like this from the `net` module https://github.com/nim-lang/Nim/blob/version-1-4/lib/pure/net.nim#L38
02:52:47FromDiscord<slymilano> hol' up - so Nim has something like Elixir's exdocs called RST? Where's a link to find more?
02:52:49FromDiscord<ElegantBeef> Which generates https://nim-lang.org/docs/net.html#examples
02:54:00FromDiscord<exelotl> @slymilano its restructuredText, which is the same markup that Python uses for docs too
02:54:24FromDiscord<flywind> the docs https://nim-lang.github.io/Nim/rst.html
02:54:52FromDiscord<Anonymous Poet> sent a code paste, see https://play.nim-lang.org/#ix=2PNY
02:54:52FromDiscord<exelotl> Oh neat I didn't know we had docs for that
02:55:27*nickster1 joined #nim
02:55:44FromDiscord<slymilano> Awesome thanks for the suggestion this is helpful!
02:55:45FromDiscord<slymilano> https://nim-lang.github.io/Nim/docgen.html
02:55:49FromDiscord<ElegantBeef> poet i think this is a limitation of the current variants you cannot share names like that so you have to use wrappers for it
02:55:54FromDiscord<ElegantBeef> No problem, glad i can help 😛
02:56:29*grobe0ba_ joined #nim
02:56:54FromDiscord<Anonymous Poet> is there a way to forward declare `kind`? so I can use it in multiple case statements?
02:57:39FromDiscord<exelotl> You could make a getter/setter proc which selects the correct field based on the current kind. But maybe there would be a performance hit there
02:58:02FromDiscord<ElegantBeef> Well if they're the same type you could use a template to make it 0-cost
02:58:08FromDiscord<ElegantBeef> Actually nvm
02:58:12FromDiscord<ElegantBeef> Runtime 😄
02:58:21FromDiscord<Anonymous Poet> i just want nice case classes :/
02:58:35FromDiscord<Anonymous Poet> performance in this case is less important
02:59:05*jxy_ joined #nim
02:59:16*astronavt___ joined #nim
02:59:33*nickster quit (Write error: Connection reset by peer)
02:59:33*grobe0ba quit (Ping timeout: 240 seconds)
02:59:33*jxy quit (Ping timeout: 240 seconds)
02:59:34*astronavt quit (Ping timeout: 240 seconds)
02:59:34*clemens3 quit (Ping timeout: 240 seconds)
02:59:34*kitech1 quit (Quit: ZNC 1.7.5 - https://znc.in)
02:59:34*nickster1 is now known as nickster
02:59:34*grobe0ba_ is now known as grobe0ba
02:59:47*kitech1 joined #nim
03:00:36FromDiscord<exelotl> Another option: Make foo exist for all cases, but don't export it. Export a getter which asserts that the kind is valid
03:01:38FromDiscord<Anonymous Poet> sent a code paste, see https://play.nim-lang.org/#ix=2PO4
03:01:55FromDiscord<ElegantBeef> It should
03:02:02FromDiscord<Anonymous Poet> (edit) "https://play.nim-lang.org/#ix=2PO4" => "https://play.nim-lang.org/#ix=2PO5"
03:02:13FromDiscord<ElegantBeef> I believe you can have multiple discriminators
03:02:43FromDiscord<Anonymous Poet> hmm, that might also be more representative actually, let me play around with that a bit
03:02:43FromDiscord<Anonymous Poet> thanks
03:04:17FromDiscord<ElegantBeef> There is this rfc which is planned to be implemented, so impatiently wait for it https://github.com/nim-lang/RFCs/issues/19
03:10:55FromDiscord<Anonymous Poet> haha, i love nim, but it definitely still needs a few more years to grow into its own
03:11:17FromDiscord<Anonymous Poet> btw, is it currently known that the compiler doesn't complain if you use a wrong property name in a case?
03:13:00FromDiscord<Anonymous Poet> sent a code paste, see https://play.nim-lang.org/#ix=2PO8
03:15:21FromDiscord<ElegantBeef> Invalid field access on variants is a runtime error
03:16:03FromDiscord<ElegantBeef> Though static analysis should be able to stop compilation
03:20:49FromDiscord<Anonymous Poet> this seems like it should be verifiable at compile time :/
03:21:51FromDiscord<ElegantBeef> Yea it's pretty much verifiable whenever the discriminator is checked
03:24:11FromDiscord<Anonymous Poet> 😦
03:26:09*clemens3 joined #nim
03:28:29FromDiscord<ElegantBeef> Can always be come a compiler contributor and add add that checking 😛
03:28:45FromDiscord<ElegantBeef> I've only briefly looked at the compiler and then quickly ran away
03:35:35FromDiscord<Seedofarson> Yoooo
03:35:39FromDiscord<Seedofarson> So
03:35:43FromDiscord<Seedofarson> I was sitting here
03:35:47FromDiscord<Seedofarson> Bored with python
03:36:07FromDiscord<Seedofarson> And that’s how I got here
03:36:09FromDiscord<Seedofarson> The end
03:36:38FromDiscord<ElegantBeef> Hello
03:36:39FromDiscord<Seedofarson> This seems like the love child of node.JS and python
03:36:45FromDiscord<ElegantBeef> Uhh
03:38:27FromDiscord<ElegantBeef> Why does it seem like a child of nodejs?
03:44:16FromDiscord<Seedofarson> Idk
03:44:21FromDiscord<Seedofarson> Some similar elements
03:44:28FromDiscord<Seedofarson> anyways
03:44:30FromDiscord<Seedofarson> I need help
03:44:38FromDiscord<Seedofarson> is there any good http client for nim yet?
03:44:57FromDiscord<Seedofarson> is there a curl to nim http client thing or do you have to manually define your request?
03:45:01FromDiscord<ElegantBeef> https://nim-lang.org/docs/httpclient.html
03:45:41FromDiscord<ElegantBeef> There is a download file procedure in there
03:50:48FromDiscord<Seedofarson> is there a curl to nim http client thing or do you have to manually define your request?
03:57:49FromDiscord<ElegantBeef> The link provided shows a httpclient which can make requests
03:59:26*Gustavo6046 quit (Ping timeout: 264 seconds)
04:00:24FromDiscord<Seedofarson> Uh
04:00:24FromDiscord<Seedofarson> Okay
04:05:27FromDiscord<Seedofarson> But
04:05:35FromDiscord<Seedofarson> Do I have to manually piece it together
04:06:18FromDiscord<Seedofarson> Or is there a way to copy a request from the networking tab on chrome(usually cURL) and have it transformed into Nim httpclient
04:09:45FromDiscord<hamidb80> hey everyone
04:10:31FromDiscord<hamidb80> i heard about NimScript but i don't know how to use it
04:10:40FromDiscord<ElegantBeef> What do you need it for?
04:12:13FromDiscord<hamidb80> In reply to @ElegantBeef "What do you need": i saw somewhere that it can run without compiling ( i think it's something like python since it can executed in VM
04:12:19FromDiscord<ElegantBeef> Yep
04:12:38FromDiscord<ElegantBeef> On linux you can just use a shebang and it'll run in nim
04:12:54FromDiscord<ElegantBeef> Otherwise you do `nim e ./your.nims`
04:13:15FromDiscord<ElegantBeef> Due to the compiler not being built with `libffi` it's somewhat limited atm
04:14:41FromDiscord<hamidb80> is there any information about how it works?
04:15:02FromDiscord<ElegantBeef> https://nim-lang.org/docs/nims.html
04:15:08FromDiscord<hamidb80> tnx
04:17:27FromDiscord<hamidb80> just imagine how cool it can be
04:18:28FromDiscord<apollo> how do i use nim in interpration mode again?
04:18:29FromDiscord<ElegantBeef> I did also work on something to rather easily interop with the VM
04:18:35FromDiscord<apollo> i rember setting an environment variable for it
04:18:37FromDiscord<apollo> but i lost it
04:18:46FromDiscord<apollo> (edit) "environment variable" => "alias"
04:18:47FromDiscord<ElegantBeef> `nim secret`?
04:18:53FromDiscord<apollo> yeah that
04:18:55FromDiscord<ElegantBeef> I suggest using inim for a repl
04:19:23FromDiscord<ElegantBeef> @hamidb80 if you want to use it in your binary checkout https://github.com/beef331/nimscripter
04:22:15FromDiscord<hamidb80> In reply to @ElegantBeef "<@!745944009918251010> if you want": thanks for video tutorial 😅
04:22:25FromDiscord<ElegantBeef> It's somewhat outdated but the underlying logic is the same
04:37:33*spiderstew_ joined #nim
04:40:07*spiderstew quit (Ping timeout: 256 seconds)
04:52:29*kenran joined #nim
05:13:16*letto quit (Quit: Konversation terminated!)
05:15:51*letto joined #nim
05:34:19*haxscramper joined #nim
05:38:58*letto quit (Ping timeout: 265 seconds)
05:39:40*letto joined #nim
05:40:03FromDiscord<hamidb80> i want to interact with terminal in Nim but some words seems unfamiliar to me (e.g. buffer, flush, ...),↵what should i search for in order to get information about it?
05:41:45FromDiscord<ElegantBeef> Due to how stdout works that's overlap with how files work at low level.
05:50:49*njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
05:50:57*njoseph joined #nim
06:01:10*vicfred quit (Quit: Leaving)
06:21:07*waleee-cl quit (Quit: Connection closed for inactivity)
06:41:19*narimiran joined #nim
07:13:55*kenran quit (Quit: leaving)
07:18:30*filcuc_ joined #nim
07:44:16FromDiscord<Solitude> In reply to @Seedofarson "This seems like the": is this an insult?
07:44:24*Tlangir joined #nim
07:44:36FromDiscord<ElegantBeef> Considering nodejs is a js runtime i'm still confusued what that implies
07:46:45*Tanger quit (Ping timeout: 240 seconds)
07:46:45*Q-Master quit (Read error: Connection reset by peer)
07:47:07*Q-Master joined #nim
07:49:28*Tlanger joined #nim
07:51:45*Tlangir quit (Ping timeout: 240 seconds)
07:58:44GreaseMonkeyhonestly, to me, nim feels more like pascal, python and lisp decided to get together and have a baby
07:59:49GreaseMonkey...and also double-downing on the type stuff because i think nim had generic types before python ended up with type annotations
08:01:42FromDiscord<ElegantBeef> Yea it's a very wirthy language
08:02:27FromDiscord<ElegantBeef> The type system is something, pmunch showed off the strength of generics in his fosdem talk 😄
08:03:40GreaseMonkeyif that's the latest FOSDEM then i think i saw the slides for that and honestly the main thing i remember was that it made use of staticLoad and also the generic `[]`/`[]=` methods for stuff stored in flash
08:04:23FromDiscord<ElegantBeef> Yea, he used `w, h` apart of the generic type but only to differentiate them
08:05:04FromDiscord<ElegantBeef> So you couldnt accidentally pass two differently sized sprites due to the type system saying "try again" at compile time
08:12:58*fosred joined #nim
08:23:06*PMunch joined #nim
08:32:16PMunch@Prestige, do you remember specifically what field it was this sent extra? https://github.com/neoclide/coc.nvim/issues/1766
08:35:17*casaca quit (Ping timeout: 272 seconds)
08:47:37*Tlanger quit (Remote host closed the connection)
08:48:59Oddmongercan i do something like: var toto:ref Foo = ref foo # ?
08:49:16Oddmongeri know i can get a ptr with addr(foo) , but a ref ?
08:49:37FromDiscord<ElegantBeef> `new T`
08:49:51Oddmongeryes, for a new Foo
08:49:58Oddmongerbut i want a ref on existing var
08:50:07Oddmongerptr then ?
08:52:17FromDiscord<Rika> ref on existing var needs you to make a new ref and put the value inside
08:52:23FromDiscord<Rika> ptr is unsafe.
08:52:45FromDiscord<ElegantBeef> Or use the experimental view types, though if it's' read only `lent` is fine
08:52:49Oddmongerok so using ref would be make a copy
08:53:07Oddmongerah didn't knew lent
08:53:13Oddmongerthank for the pointers :)
08:53:19FromDiscord<Rika> everything is a copy, its just a matter of what is copied
08:54:24FromDiscord<ElegantBeef> Experimental like i said, but with arc/orc they're rather usable if you want safely borrow https://nim-lang.org/docs/manual_experimental.html#view-types
08:58:49Oddmongeri look
09:00:07FromDiscord<Rika> neuron activation
09:00:11*awici[m] quit (Quit: Idle for 30+ days)
09:01:22Clonkk[m]<Oddmonger "ok so using ref would be make a "> Obtaining a ref from a value without safety check would be dangerous code as you could pass a reference to a stack value that goes out of scope. That's why you need either to work with a ref from the beginning, copy the memory, or have syntax to safely borrow memory
09:01:57FromDiscord<ElegantBeef> Danglers are dangerous tools 😉
09:02:09*krux02 joined #nim
09:02:10*krux02_ joined #nim
09:02:24*krux02_ quit (Remote host closed the connection)
09:02:35FromDiscord<Rika> lewd
09:04:36Clonkk[m]<FromDiscord "<ElegantBeef> Danglers are dange"> Yeah they have to be handled with care or risk exploding to your face.
09:05:40FromDiscord<ElegantBeef> Pst rika, say the line
09:06:17*casaca joined #nim
09:09:50Oddmongeri think my big mistake has been to believe « var shortcut = foo[0].data » was creating a ref on foo[0].data
09:10:09Oddmongerno wonder why i hog cpu
09:10:10FromDiscord<ElegantBeef> Oh there is also `{.byaddr.}`
09:10:27Oddmongeroh
09:10:36Oddmongerwunderbar :)
09:14:19Oddmongermaybe i have read a bit fast
09:14:55Oddmongervar data = addr(foo[0].data) <=?=> var data {.byaddr.} = foo[0].data
09:16:04FromDiscord<ElegantBeef> Well i think you can use byaddr on `foo[0]` but not the data value
09:16:11FromDiscord<ElegantBeef> though i'm uncertain
09:17:11FromDiscord<ElegantBeef> Actually nvm that should work i imagine
09:23:55*filcuc_ quit (Quit: KVIrc 5.0.0 Aria http://www.kvirc.net/)
09:33:46FromDiscord<Rika> In reply to @ElegantBeef "Pst rika, say the": what line xdddddddddd
09:35:38FromDiscord<ElegantBeef> Lewd!
09:39:50FromDiscord<mratsim> @Araq, I always though closure iterators worked on the JS backend. Is it the `{.goto.}` pragma that doesn't work on JS?
09:40:38FromDiscord<Clyybber> @ElegantBeef I think you need to rebase your PR to fix the js ci errors
09:42:06PMunchHmm, is there a package that parses terminal input? Like special keys, Ctrl keys, and mouse clicks
09:42:15FromDiscord<ElegantBeef> Excuse me while i shout in a bag for about 20 minutes so i can say "Nope gotta sleep" 😛
09:42:33PMunchHuh?
09:42:56FromDiscord<ElegantBeef> That was in response to clyybber telling me i need to rebase
09:42:59FromDiscord<Clyybber> lol
09:43:19FromDiscord<ElegantBeef> I mean i can only think of ncurses like stuff that does that, so illwill?
09:44:07FromDiscord<Clyybber> In reply to @PMunch "Hmm, is there a": illwill does, and my library ternim
09:44:22PMunch@Clyybber, illwill does a bit more though..
09:44:48FromDiscord<Clyybber> can just copy the input handling code over
09:44:48FromDiscord<Clyybber> or only use the input handling code
09:45:23*NimBot joined #nim
09:45:27FromDiscord<Clyybber> hey, I just uploaded it so that I dont forget it ;D
09:45:30FromDiscord<ElegantBeef> https://github.com/Clyybber/ternim linky do
09:46:01FromDiscord<Clyybber> no docs
09:46:01PMunchHmm, I guess I could use illwill without any of the drawing tuff
09:46:03PMunchstuff*
09:46:26FromDiscord<Clyybber> oh yeah as opposed to ternim illwill also handles mouse input
09:46:37FromDiscord<Clyybber> and works on windows I think
09:46:51PMunchYeah it's cross-platform
09:46:55FromDiscord<ElegantBeef> Ternim is just a better abstraction over terminal for posix systems?
09:47:09FromDiscord<ElegantBeef> Do you have a `getCursorPos`? 😛
09:47:19FromDiscord<Clyybber> nah
09:48:11FromDiscord<Clyybber> I should get to my pc so I can actually type without correcting 500 typos a minute
09:51:23FromDiscord<Clyybber> In reply to @ElegantBeef "Ternim is just a": it's tailored to games or fullscreen applications
09:51:30FromDiscord<Clyybber> and there is no concept of a cursor
09:52:06FromDiscord<ElegantBeef> encouraging ascii games, shame thought i liked you
09:52:10FromDiscord<Clyybber> :p
09:52:15PMunchHmm, illwill doesn't give me mouse events for some reason (even after turning mouse=true)
09:52:21PMunchBut apart from that it seems to work
09:52:32FromDiscord<Clyybber> PMunch: Are you calling illwillInit?
09:52:46PMunchYe
09:53:07FromDiscord<Clyybber> hmm, maybe it only works in fullscreen mode?
09:53:08PMunchI'm just doing this: http://ix.io/2PPA
09:53:38PMunchDoesn't seem to work fullscreen either
09:53:41FromDiscord<Clyybber> smh, coding the playground and then not using it :p
09:54:01FromDiscord<Clyybber> huh, maybe your terminal doesn't send the sequences that illwill expects
09:54:02PMunchI have a keyboard shortcut for pasting to ix.io :P
09:54:30PMunchBesides, you can always just do play.nim-lang.org/#ix=2PPA
09:55:04FromDiscord<Clyybber> yeah :)
09:56:43*Vladar joined #nim
10:01:46krux02PMunch, I do have that as well.
10:01:55krux02that ix.io shortcut.
10:02:20PMunchIt's pretty handy :)
10:02:36krux02yes
10:02:48krux02But generally I would prefer if I would not need it.
10:03:30FromDiscord<ElegantBeef> Just give this chat your ssh credientials so you dont need to anymore
10:04:05krux02maybe I should use IRC within emacs as well, so that I can open ix.io links in a new buffer as well
10:04:31krux02@ElegantBeef: what do you mean
10:04:54krux02I am on IRC not on discord.
10:04:58FromDiscord<ElegantBeef> Well you said you preferred not needing the ix.io shortcut, so if we could ssh into your computer you wouldnt need it 😄
10:05:20krux02I don't see how that solves anything
10:05:31krux02I use ix.io mostly for chat
10:05:37krux02to send code listings
10:05:40FromDiscord<ElegantBeef> It lets me make a joke about sharing ssh access with thousands of people
10:05:55krux02I would prefer if the chat programs support code listings on their own.
10:06:26krux02Preferably behind a spoiler, but without indirciton.
10:06:44krux02yea
10:06:53krux02I don't expect everybody to have ssh.
10:07:04krux02I don't expect everybody to have even just sh
10:07:12krux02even though they should
10:08:03PMunchIt would certainly be cool to have an IRC client that could read code-listing links automatically
10:08:31krux02Well I have emacs.
10:08:42PMunchSure, but then you need to use emacs
10:08:43krux02I could teach emacs to do that
10:08:48krux02yes
10:08:53krux02I use it anyway.
10:09:02PMunchAh, well in that case
10:09:02krux02even thoguh I really don't like that it is so slow
10:09:13PMunchSlow?
10:09:31krux02i managed to get it fast in Nim, but currently I use it for c++ and it is everything but responsive.
10:09:55krux02When I type a character it should appear on screnn before I release the key
10:10:28krux02if that does(.t happen I want to punch the author who wrote that software that made me wait
10:11:09FromDiscord<ElegantBeef> Ah make them as non-responsive as their code
10:11:13PMunchOh wow, it's that slow
10:11:21FromDiscord<ElegantBeef> Probably as fast as me
10:11:52FromDiscord<ElegantBeef> Well i'm going so you guys get fewer shitty jokes, cheers
10:16:58*SebastianM joined #nim
10:17:10FromDiscord<Clyybber> cheers
10:28:01*SebastianM quit (Quit: -a- IRC for Android 2.1.59)
10:28:55*abm joined #nim
10:34:10*gmaggior joined #nim
10:35:09*gmaggior quit (Client Quit)
10:36:37sekao[m]Anyone using emscripten? nimgl supports it as of today :D https://github.com/nimgl/nimgl
10:37:33sekao[m]There may still be a lingering issue with ARC when using emscripten tho. I reported it here https://github.com/nim-lang/Nim/issues/17026
10:38:09*krux02 quit (Ping timeout: 272 seconds)
10:42:12FromDiscord<hamidb80> https://media.discordapp.net/attachments/371759389889003532/811910429575217202/Screenshot_at_2021-02-18_14-10-20.png
10:42:42FromDiscord<hamidb80> why using global variable is not GC safe?
10:44:24PMunchNot with the default GC
10:44:28PMunchBut gcsafe is mostly used for threading
10:44:41FromDiscord<hamidb80> In reply to @PMunch "Not with the default": what should i do?
10:44:53PMunchglobal variables aren't GC-safe because they are managed by the main thread of your program
10:45:05PMunchRemove you gcsafe pragma unless you actually need it?
10:45:35FromDiscord<hamidb80> In reply to @PMunch "Remove you gcsafe pragma": yes i need it because of async pragma
10:46:11PMunchUhm, you do?
10:48:10FromDiscord<gollark> Is there something like strutils.replace but which takes a set of chars as an argument? I want to replace unsafe-in-filename characters in a string with underscores.
10:48:21OddmongerAraq , can you tell me if {.byaddr.} is going to stay ?
10:49:23Oddmongeri find it so handy for references… far better than my previous var x:ptr z = addr(y) « references »
10:49:45FromDiscord<hamidb80> In reply to @PMunch "Uhm, you do?": if i remove `gcsafe` pragma https://media.discordapp.net/attachments/371759389889003532/811912328802074674/Screenshot_at_2021-02-18_14-18-27.png
10:51:24*NimBot joined #nim
10:51:30PMunchI guess you could use --gc:arc or --gc:orc
10:52:20FromDiscord<hamidb80> In reply to @PMunch "I guess you could": does it make problem if i ignore the `GC-unsafe2` warning?
10:52:23FromDiscord<hamidb80> (edit) "warning?" => "warnings?"
10:53:46FromDiscord<hamidb80> did you suggest any article about it?
10:54:05FromDiscord<hamidb80> (edit) "did" => "could"
10:55:42PMunchHmm, I don't think so
10:55:58PMunchAnd I don't really have any articles on async.
10:56:14PMunchDo have one that is almost ready to publish though, but it doesn't mention this
10:56:36FromDiscord<hamidb80> tnx
10:59:39FromDiscord<hamidb80> @PMunch i heard you had a speech at FOSDEM,
11:00:00PMunchIndeed
11:00:44PMunchhttps://www.youtube.com/watch?v=j0fUqdYC71k
11:01:29FromDiscord<enimatek> is `ref object of RootObj` the same as just using `ref object` since not using the of doesnt seem to really have any impact and i see different uses in codebases
11:02:36FromDiscord<enimatek> (edit) "is `ref object of RootObj` the same as just using `ref object` ... since" added "?"
11:06:00PMunch@enimatek, `of RootObj` is only needed if you need inheritance
11:06:42*krux02 joined #nim
11:06:43*krux02_ joined #nim
11:08:55FromDiscord<enimatek> ah ok, so also the method keyword (over proc) and of RootObj are more related to using inheritance
11:09:21*krux02_ quit (Client Quit)
11:09:35PMunchYes, exactly
11:11:42krux02enimatek, it certainly needs some getting used to, but Nim is one of the few new languages that doesn't embrace OO design patterns. It implements them, you can use them if you want to use them. But it doesn't encourage you to do so.
11:12:06FromDiscord<enimatek> but for my understanding, in eg. Java or C# all classes are inheritable, you could abstract them or interface them, but in nim does this mean by default using of RootObj has an impact on the performance ? or to be 'safe' (eg. later on you suddenly want to extend one of your objects) you can just use it by default?
11:12:54krux02if you want to use inheritance there is no problem to add `of RootObj` to your definition
11:13:04krux02but you should not defensively put it everywhere
11:13:15FromDiscord<mratsim> In reply to @enimatek "but for my understanding,": classes require extra runtime type information which makes the object slightly bigger and require slightly more initialization.
11:13:24FromDiscord<mratsim> this is true in Java, C++ and Nim
11:13:35PMunchWell, don't think of it as adding RootObj impacts performance. Think of it as Nim being able to optimise further than languages that don't allow you to have non-inheritable objects.
11:13:40FromDiscord<mratsim> in practice unless you write very cache sensitive code it doesn't matter
11:13:45krux02of RootObj adds an object header to your type, similar to the vtable pointer in c++ if you use virtual functions
11:14:08FromDiscord<mratsim> when I say slight, it's 8 bytes.
11:14:18FromDiscord<enimatek> ok thanks! makes it more clear, also its not that hard to add the 'of RootObj' later if needed
11:14:29krux02yes
11:14:57krux02and you only need 'of RootObj' if you want to use polymorphic inheritance
11:15:31PMunchBy default objects in Nim are pretty much the same thing as a struct in C if you are familiar with those. It's just a collection of values. If you want to extend an object that doesn't have `of RootObj` on it you can also simply wrap that object within your object and have accessor templates to it.
11:16:28krux02if you are used to Java or C#, not having to put functions into classes might make you feel releaved. Finally you can put your functions where you want them to be.
11:18:35FromDiscord<enimatek> hmja in java 'we' luckly have lombok that makes a more 'structs' like syntax, think java 15 or 16 will have this by default
11:19:26FromDiscord<enimatek> but my younger inner self still has nightmares of codebases that contain 90% getters and setters code
11:21:09PMunchI currently have to implement some stuff in C#, so much code that doesn't actually do anything
11:21:22PMunchWell, it does something, just not anything useful
11:27:58krux02enimatek: it seems like java adopts more and more scala features one by one.
11:28:51krux02scala has these case objects. They look like a struct. They feel like a struct. But they have the overhead of a full blown java object.
11:31:47FromDiscord<enimatek> yea also kotlin is a jvm language that you see doing this
11:39:32FromDiscord<konsumlamm> case objects aren't really supposed to be structs though, their main purpose is for ADTs to allow pattern matching and for "data classes" (classes with less boilerplate)
11:55:31*tane joined #nim
12:11:27FromDiscord<haxscramper> Pattern matching was added way after case objects, and I've always though of them as a way of conditionally hide fields rather than nim's ADT
12:11:42FromDiscord<haxscramper> Though they work for ADT as well
12:11:49krux02ADT?
12:12:12FromDiscord<haxscramper> https://en.wikipedia.org/wiki/Algebraic_data_type
12:12:15FromDiscord<hamidb80> In reply to @krux02 "ADT?": krux, did you get unnbanned ?
12:12:45krux02let me check
12:14:14FromDiscord<haxscramper> IIRC case objects in ALGOL have almost the same syntax as NIM
12:14:26PMunchWhere you banned?
12:14:51PMunchWere*
12:15:02krux02I am still banned on github.com/nim-lang
12:16:00FromDiscord<konsumlamm> In reply to @haxscramper "Pattern matching was added": i was talking about scalas case classes
12:16:33*JustASlacker joined #nim
12:16:45JustASlackerhello peoples of #nim
12:16:53JustASlackeris there some way to read/write ical files
12:17:11PMunch@haxscramper, I think @konsulam, was referring to case objects in Scala
12:17:18PMunchJustASlacker, yes
12:17:23JustASlacker\o/
12:18:46JustASlackerPMunch: what would you suggest
12:18:59PMunchNo idea :P
12:19:11PMunchBut it's certainly possible to read them
12:19:21PMunchAnd write them
12:19:27PMunchWhat kind of format is iCal?
12:19:59JustASlackerhttps://en.wikipedia.org/wiki/ICalendar
12:20:30JustASlackerhttps://pypi.org/project/icalendar/
12:21:07krux02PMunch, here in https://github.com/nim-lang/RFCs/issues/338 issue I commented this
12:21:09krux02http://ix.io/2OXN
12:21:17krux02it was deleted and I got banned for it
12:21:55FromGitter<Araq> you bot banned for more than just this but you know it and you will simply repeat the lies
12:22:37krux02I was away for severl months. Didn't post anything.
12:22:46krux02I came back and you immediately banned me
12:23:01JustASlackerI guess I can cobble something together to ical all the things
12:23:15JustASlackerwhat if I want to make a package out of it so others can abuse it?
12:23:22JustASlackerIs there a doc for that
12:23:27JustASlackerwriting packages I mean
12:24:19FromDiscord<Solitude> https://github.com/nim-lang/nimble#nimble-reference
12:25:12PMunch`nimble init` should give you mostly everything you need
12:26:05PMunchIs iCal a binary format? Or based on XML or something?
12:26:29PMunchkrux02, ah that thing..
12:26:29krux02Two bans of People who contributed a lot to the Nim programming language in just two weeks. I think there is someone too sensitive.
12:26:30JustASlackertext based but not strict xml
12:27:37PMunchHmm, so npeg might be able to help?
12:28:29JustASlackerhttps://termbin.com/eb06
12:28:36JustASlackerlooks like cobol ^_^
12:28:56JustASlackerhrm, it might
12:29:07JustASlackermight be overkill
12:29:09krux02I mean it is not too bad that I got banned on github. I mean you don't listen to what I say anyway, the ban just makes that part official.
12:29:42PMunchJustASlacker, nah that looks like a good match for npeg
12:29:57PMunchI mean you could also split on : it seems
12:31:32ForumUpdaterBotNew thread by Halloleo: "Error: unable to set ODBC driver version." with db-odbc, see https://forum.nim-lang.org/t/7525
12:32:12JustASlackerI'll take a look at npeg
12:38:27*abm quit (Ping timeout: 260 seconds)
12:38:45*abm joined #nim
12:43:15*NimBot joined #nim
12:47:03JustASlackerIs there a npeg for dummies article somewhere
12:51:56PMunchApart from the documentation? https://github.com/zevv/npeg#quickstart
12:53:36PMunchYou could also look through my AoC videos to see how I use it: https://www.youtube.com/watch?v=TrxyCNdI0bw&list=PL9Yd0XwsGAqzeDak6qtp6hQ4m7Qo_XA_4
12:53:42PMunchI explain a bit in there about what I'm doing
12:55:24*lritter joined #nim
13:07:32FromDiscord<BlockListed> Hi guys does anyone know how to execute a command / program from a Nim program? I thought it would be in the os module documentation, but I couldn't find anything about it?
13:07:59liblq-devhttps://nim-lang.org/docs/osproc.html
13:08:24liblq-dev@BlockListed more specifically, https://nim-lang.org/docs/osproc.html#execProcess%2Cstring%2Cstring%2CopenArray%5Bstring%5D%2CStringTableRef%2Cset%5BProcessOption%5D
13:08:30liblq-devgosh these doc URLs suck
13:08:37FromDiscord<BlockListed> Thanks so much
13:09:21krux02Oddmonger, I wasnt aware you can put byaddr tag on local variables.
13:09:51krux02And I just realized I was way too far in the past the this comment is very out of context :P
13:09:53krux02sorry
13:13:27JustASlackerPMunch: noice
13:29:34*abm quit (Quit: Leaving)
13:33:02*NimBot joined #nim
13:40:11FromDiscord<hamidb80> https://www.youtube.com/watch?v=DmYOPkI_LzU
13:43:02FromDiscord<zetashift> @treeform I need a library to draw some simple shapes, mostly lines from `(x1, y2)` to `(x2, y2)`, should I use `flippy` or `pixie`?
13:43:49Oddmongerkrux02: i have read all the backlog since my question about {.byaddr.} , but i don't see why you are sorry ^^'
13:44:03Oddmongerdid you replied to me and i've missed something ?
13:44:30krux02yes I did reply to you
13:44:35krux02but it is not really important
13:45:12krux02if you don't rememeber it is probably not important
14:08:53PrestigePMunch: Nah I don't remember
14:09:04PMunchHmm, damn it..
14:09:23PrestigeI mean PMunch you could disallow extra fields again and try I suppose
14:09:28Prestigewould find out rather quickly
14:09:47PMunchI wanted to leave a comment on that saying they should fix their client. But I wanted to make sure that it hadn't been added to the spec
14:10:19PMunchIt is disallowed again, because it was messing with other stuff
14:10:42Prestigehm shouldn't it be breaking my client then?
14:11:54PMunchOnly if you've updated :P
14:12:03PrestigeI have, so maybe they fixed the issue
14:12:11PMunchHmm, could be
14:12:17PMunchWhen did you last update?
14:12:27Prestigelike 2 weeks ago I think
14:12:58PrestigeAlso, is there any progress on not having to restart the langserver when I make changes across files?
14:13:00PMunchOh that is definitely the new version
14:13:14PMunchI made the reversal on the 18th of November.. https://github.com/PMunch/nimlsp/commit/f6f29360874e3bbd5566589610b53daad2fdd83f
14:13:58PMunchNot really, pretty sure that is a Nimsuggest bug
14:14:11*planetis[m] left #nim ("User left")
14:14:21Prestigeaw :/
14:15:24PrestigeIt's a really annoying workflow
14:16:30PMunchI know :(
14:17:28PrestigeI thought we found out before it was an nimlsp issue of not finding the project file?
14:18:11PMunchOh, did we?
14:18:14PMunchHmm, crap
14:20:10PrestigePretty sure. Idr why but it couldn't locate the *.nimble file
14:20:29PMunchSo we should update the project finding code..
14:20:40PMunchI thought there was something built into nimble nowadays
14:20:42Prestigeor at least make sure that's the prob
14:21:09PrestigeI'll be back in ~20
14:21:41FromDiscord<Rika> Is there an http server that can do ssl in Nim?
14:23:57PMunchI thought HttpClient did nowadays, and probably by extension Jester?
14:24:42PMunchHmm, maybe not
14:25:35PMunchThe best thing is to run your Nim server behind a reverse proxy, which you probably should do anyways
14:25:49FromDiscord<Rika> Not possible
14:25:59PMunchWhy not?
14:26:15FromDiscord<Rika> Let’s just say it isn’t
14:29:16FromDiscord<Rika> It’s not a great look in Nim when you have to tell everyone who wants a secure http server to put it behind nginx or so
14:29:24FromDiscord<Rika> For Nim
14:29:32PMunchWell, that's best practice for lots of web stuff
14:29:42PMunchNginx/Apache have been battle tested for ages
14:31:24FromDiscord<Rika> So what do I do if I cannot use nginx or Apache?
14:31:47PMunchI think you'd have to roll your own..
14:31:54FromDiscord<Rika> Go has options for that, Java too, probably Elixir and Rust and every other large language nowadays
14:40:33PMunchHmm, there really isn't much of anything HTTPS related in Nim..
14:40:38*qwr would probably try to combine rust and nim into single binary or maybe just use ocaml depending on other constraints. though creating server with plain openssl isn't also too hard, if you're somewhat familiar with it
14:42:19FromDiscord<zetashift> Doesn't httpClient work with ssl: https://nim-lang.org/docs/httpclient.html#sslslashtls-support ?
14:42:30PrestigePMunch: anyway, back but I'm at work. If I can help investigate the issue lmk
14:42:35FromDiscord<zetashift> oh thats client
14:42:38FromDiscord<zetashift> nvm I'm dumb haha
14:43:40PMunchPrestige, I'm at work as well. So not really looking into it right now
14:43:50PrestigeKk
14:53:14*Lord_Nightmare quit (Ping timeout: 256 seconds)
14:55:58*PMunch quit (Quit: leaving)
15:15:27FromDiscord<LITeralLANGuage9> Can I use a Makefile to compile my nim projects? Not nake, but a regular GNU Makefile.
15:16:33ozYes.
15:17:18FromDiscord<LITeralLANGuage9> Does nim know where to continue if compilation ends early because of an error? Or would I be forced to restart from the beginning?
15:17:58FromDiscord<haxscramper> Compilation starts from the start each time,
15:18:39oz... but nim has a build cache.
15:18:40FromDiscord<LITeralLANGuage9> Even if I used a Makefile, which for C/C++ knows how to continue where it left off?
15:19:28FromDiscord<haxscramper> In reply to @LITeralLANGuage9 "Even if I used": Nim compiler takes care of module dependencies itself, while C/C++ does not have a notion of "project" and instead reparses all code for each header file, compiles to `.o` and only then links
15:19:46FromDiscord<haxscramper> We do have build cache and IC is being worked on
15:20:09FromDiscord<haxscramper> But nim makefile would be just `main: nim c project.nim`
15:20:56FromDiscord<haxscramper> There is nothing else to put in there basically, since `nim c` would do all search/C codegen/linking etc. by itself anyway
15:21:12FromDiscord<haxscramper> module/dependency search
15:21:49FromDiscord<LITeralLANGuage9> I can use a Makefile to do different types of compilations. That's pretty convenient.
15:23:14FromDiscord<LITeralLANGuage9> Compared to having to write a shell script for unix and batch file for windows.
15:24:50FromDiscord<LITeralLANGuage9> Just to make sure I'm clear. Lets say I've been compiling for an hour and stopped due to an error. Nim would know that the hour was already compiled thanks to build cache and I won't have to compile that hour again?
15:26:20FromDiscord<haxscramper> it depends on what that hour was spent on
15:26:50FromDiscord<haxscramper> If it was mostly spent on C code/linking etc. then yes
15:27:05FromDiscord<konsumlamm> why do you want to use a Makefile in the first place?
15:27:19FromDiscord<LITeralLANGuage9> I like Makefiles. I'm very used to them and it just feels weird not using it.
15:27:30FromDiscord<haxscramper> But if it was a nim code that took that long (though you would really need to try and find something like that) then you probably need to start from scratch
15:27:58FromDiscord<LITeralLANGuage9> Does nim have the ability to only compile changed files?
15:29:09FromDiscord<haxscramper> I can't comment on IC status, but this is main (?) target feature for the next release IIRC
15:29:22FromDiscord<haxscramper> So in short - not now
15:29:29FromDiscord<haxscramper> not sure what about now
15:30:31FromDiscord<haxscramper> Though I don't think you should worry about compilation speed to much TBH, we can't do 5_000_000 sloc/sec, but I hardly ever found this be a major issue that I need to design my workflow around
15:31:36*waleee-cl joined #nim
15:33:25FromDiscord<exelotl> Nim compilation speed is pretty good even without IC. The generated C files won't be recompiled if they didn't change between builds
15:34:46FromDiscord<exelotl> But yes proper IC is coming Soon™️
15:37:44FromDiscord<BlockListed> `var notifs: array = [{"title": "Meeting: 16:00", "time": "1613662536"}.toTable, "title": "Meeting: 16:00", "time": int"1613662234"}.toTable]`
15:38:32PrestigeMissing a { BlockListed?
15:38:46FromDiscord<BlockListed> Didnt finish my message
15:38:51FromDiscord<BlockListed> sry
15:41:22*Lord_Nightmare joined #nim
15:41:44*filcuc joined #nim
15:41:53FromDiscord<BlockListed> sent a long message, see http://ix.io/2PRB
15:42:17FromDiscord<BlockListed> wait
15:42:23FromDiscord<BlockListed> I do be stupid
15:42:30FromDiscord<BlockListed> forgot that int statement
15:42:47FromDiscord<BlockListed> that didn't fix it tho
15:42:49FromDiscord<mratsim> `, "title"`
15:42:55FromDiscord<mratsim> after the comma
15:43:00FromDiscord<BlockListed> thanks so much
15:43:02FromDiscord<mratsim> something is missing
15:43:09FromDiscord<BlockListed> for some reason I can't read
15:43:25FromDiscord<mratsim> put those in 2 or 4 lines
15:43:56FromDiscord<mratsim> sent a code paste, see https://play.nim-lang.org/#ix=2PRE
15:44:25FromDiscord<mratsim> (edit) "https://paste.rs/Jod" => "https://play.nim-lang.org/#ix=2PRF"
15:50:07*lkjasdf joined #nim
15:50:42FromDiscord<BlockListed> Thanks it's only for testing anyway, because the final program will get the data from a json file
15:51:08FromDiscord<BlockListed> Also how do I use ints in tables or convert ints to strings
15:51:25FromDiscord<kaletaa> $var
15:51:29FromDiscord<kaletaa> to convert it to a string
15:51:46FromDiscord<BlockListed> Thanks so much
15:53:21*vicfred joined #nim
15:53:52*vicfred quit (Remote host closed the connection)
15:55:02*vicfred joined #nim
16:01:57FromDiscord<BlockListed> How do I do something like the python time.sleep() command in nim?
16:03:53FromDiscord<zetashift> @BlockListed https://nim-lang.org/docs/os.html#sleep%2Cint `sleep()`
16:04:13FromDiscord<zetashift> (I think, my python isn't up to date)
16:05:17FromDiscord<BlockListed> Thats exactly what I was looking for TSM
16:05:21FromDiscord<BlockListed> (edit) "TSM" => "TYSM"
16:06:03FromDiscord<konsumlamm> btw, you can use the search bar in https://nim-lang.org/docs/lib.html to search for functions etc.
16:09:41Oddmongeris it true that {.discardable.} raises the execution time ?
16:09:55*teasea quit (Quit: teasea)
16:10:02Oddmongersee comment in first answer: https://stackoverflow.com/questions/56976426/nim-function-type-of-int-has-to-be-discarded
16:11:11liblq-devit doesn't
16:12:09ForumUpdaterBotNew thread by Mantielero: Nim.cfg - pragma, see https://forum.nim-lang.org/t/7526
16:12:21liblq-devjesus christ it's just like disruptek predicted
16:12:32liblq-dev"can't use this feature because slow"
16:12:42*teasea joined #nim
16:12:44FromDiscord<haxscramper> There is not enough data to give conclusive answer I think. If they removed `{.discardable.}` and return value then it might be due to lack of return value or something. Or maybe explicitly using `discard` enables some optimization
16:13:12Oddmongerliblq-dev: it's not that, but it's for a bench function
16:13:23liblq-devwhen will people learn that using language features is fine.
16:13:38FromDiscord<haxscramper> I think "can't use this feature because slow" is just common whatever because nobody really cares about doing stuff
16:13:39liblq-devdiscardable is discouraged for other reasons.
16:14:04*lkjasdf quit (Read error: Connection reset by peer)
16:14:06FromDiscord<haxscramper> Like actually implementing features and then fixing slow code when needed
16:14:22*lkjasdf joined #nim
16:14:22Oddmongerlike this: http://ix.io/2PS2
16:15:47liblq-devlet's go back to assembly language then. it can't possibly be slow, right?
16:16:21liblq-devoverly trying to squeeze every last bit of performance prematurely is not a good thing
16:16:45Oddmongeroh you are so like disruptek, i was missing him :')
16:17:32Oddmongerit's not a question of optimization, it's just for having a good measure of time elapsed, without parasites
16:17:45Oddmongerif the overhead is constant, that's ok for me
16:19:12*Vladar quit (Quit: Leaving)
16:20:30*maier joined #nim
16:20:48*Clonkk[m] sent a long message: < https://matrix.org/_matrix/media/r0/download/matrix.org/jWRDveWDjEbVJcwvcrFACmOl/message.txt >
16:21:12FromDiscord<zetashift> In reply to @liblq-dev "let's go back to": this is an sentiment I agree with about people premature optimizing stuff that in the end are neglible
16:21:14FromDiscord<BlockListed> How do I remove something from an Array simularly to the .pop() function in python?
16:22:05FromDiscord<Rika> `delete`?
16:22:09FromDiscord<BlockListed> Ok thanks
16:29:20FromDiscord<mratsim> In reply to @Oddmonger "is it true that": Oddmonger: discardable isn't slow unless somehow your code uses all 16 registers and the unused return value uses one that would be otherwise critical. And even in that case the perf boost would be by 1/16.
16:30:22oz~~
16:40:08FromDiscord<Solitude> In reply to @BlockListed "How do I remove": use sequence, arrays have constant size
16:44:53*Cthalupa quit (Ping timeout: 256 seconds)
16:46:11*Cthalupa joined #nim
16:47:56*maier quit (Quit: leaving)
16:54:14ForumUpdaterBotNew thread by Clonk: Binding to C macros functions, see https://forum.nim-lang.org/t/7527
16:57:34FromDiscord<pointystick> Are the Nim forum account emails working? I registered on the forum earlier today but haven't got an email yet. I remember there was some issue sending the emails in the past
16:58:48*letto quit (Quit: Konversation terminated!)
16:59:26*letto joined #nim
17:03:54liblq-dev@BlockListed `seq` also has a `pop()` proc
17:04:44FromDiscord<BlockListed> Thanks, but delete will work for me.
17:08:28FromDiscord<BlockListed> Btw is there a way to convert a list to a seq, because my data is coming from a json file and I don't know how to get a seq list from a json object.
17:10:22FromDiscord<haxscramper> `getElems()`? it returns `seq[JsonNode]` so not necessary to convert anything
17:12:27FromDiscord<BlockListed> Thanks
17:13:44*haxscram` joined #nim
17:16:30FromDiscord<BlockListed> Btw how do json dicts work if I import them like this? Will they just automagically turn into tables?
17:16:36*haxscramper quit (Ping timeout: 260 seconds)
17:17:17*letto quit (Read error: Connection reset by peer)
17:18:19*letto joined #nim
17:19:12FromDiscord<BlockListed> Wait sry It works fine
17:22:17ForumUpdaterBotNew thread by Benob: Patching existing libraries with "include", see https://forum.nim-lang.org/t/7528
17:25:52FromDiscord<Yardanico> spammer? https://media.discordapp.net/attachments/371759389889003532/812012017085972480/unknown.png
17:25:55FromDiscord<Yardanico> single post on the forum
17:25:57FromDiscord<Yardanico> necroposting
17:26:03FromDiscord<Yardanico> ah nvm he's already marked as such
17:28:47FromDiscord<konsumlamm> iot development is very important today
17:30:42Oddmongerok, thank you @mratsim
17:35:57*JustASlacker quit (Ping timeout: 264 seconds)
17:38:18ForumUpdaterBotNew thread by Mantielero: Windows - #include <dlfcn.h>, see https://forum.nim-lang.org/t/7529
17:39:32FromDiscord<haxscramper> @Yardanico Do you track forum activity (posts per day/comments per hour etc)?
17:39:38FromDiscord<Yardanico> no
17:47:57*letto quit (Ping timeout: 264 seconds)
17:48:18FromDiscord<LITeralLANGuage9> What's the command to get nim to compile to a .so file rather than DLL? I'm a bit confused trying to read the documentation.
17:48:53FromDiscord<mratsim> In reply to @LITeralLANGuage9 "What's the command to": .so are to Unixes what DLLs are to Windows.
17:49:09FromDiscord<mratsim> it's the same thing except one is on Linux and one on Windows.
17:49:50FromDiscord<mratsim> usually you use --app:lib --header:mylib.h
17:50:47FromDiscord<LITeralLANGuage9> So I would use --app=DLL for windows and --app=lib for unix?
17:52:05reversem3Does nim have anything similar to rust traits?
17:52:34PrestigeWhat are rust traits?
17:52:39FromDiscord<mratsim> In reply to @LITeralLANGuage9 "So I would use": you use --app:lib for both and you name the output file .dll on Windows and .so on Linux and .dylib on Mac
17:52:46reversem3I guess a collection of methods ?
17:52:52reversem3https://doc.rust-lang.org/rust-by-example/trait.html
17:53:10FromDiscord<mratsim> In reply to @reversem3 "Does nim have anything": you can use concepts. However there is no Box+traits equivalent, you need to use inheritance.
17:53:13FromDiscord<LITeralLANGuage9> If I can use lib for both, why even use DLL to begin with?
17:53:26FromDiscord<mratsim> lib just means library
17:53:36FromDiscord<mratsim> a DLL is a library on windows and .so a library on Linux
17:53:50reversem3ok so inheritance
17:53:55FromDiscord<mratsim> "why would you use Windows to begine with" is another question altogether
17:54:01FromDiscord<mratsim> (edit) "begine" => "begin"
17:54:35reversem3Maybe thats what the person is comfortable with
17:54:36FromDiscord<konsumlamm> concepts are similar with the major difference being that you explicitly need to implement traits, while concepts are implicitly implemented
17:54:58reversem3ok cool , I will look into concepts thanks
17:55:07*abm joined #nim
17:55:22liblq-devachtung, achtung, danger zone: concepts are experimental.
17:55:48FromDiscord<mratsim> They work, the main issue is debugging why a concept doesn't match.
17:56:04liblq-devthis
17:56:06FromDiscord<mratsim> I use them in all my projects.
17:56:23liblq-devalso symbol duplication
17:56:26FromDiscord<mratsim> well I dropped them for cryptography but that was for another reason
17:56:42liblq-devwhat was the reason?
17:56:57FromDiscord<mratsim> https://github.com/nim-lang/Nim/issues/16897
17:57:18FromDiscord<mratsim> It's annoying when you use concepts with types that are 3000+ bits in size
17:57:21liblq-devah, so performance
17:57:30liblq-devunderstandable
17:57:45FromDiscord<mratsim> code size as well: https://github.com/nim-lang/Nim/issues/13982
17:57:58liblq-devah yes
17:57:59liblq-devthat one i know
17:58:10FromDiscord<mratsim> but that one can be solved by doing all concept instantiation in the same file.
17:58:12*letto joined #nim
17:58:18FromDiscord<mratsim> (edit) "instantiation" => "instantiations"
17:58:37FromDiscord<mratsim> here I had 2 files being corecursive.
17:59:30*filcuc quit (Ping timeout: 272 seconds)
18:05:17FromDiscord<treeform> In reply to @zetashift "<@107140179025735680> I need a": pixie is flippy v2, I would use pixie now.
18:05:59FromDiscord<treeform> we hope to have a 1.0 of pixie release soon
18:06:10FromDiscord<treeform> then we will deprecate flippy
18:06:21ForumUpdaterBotNew thread by Benob: Conjunctions of sum type parameters, see https://forum.nim-lang.org/t/7530
18:06:45*blackpawn quit (Ping timeout: 240 seconds)
18:08:19FromDiscord<hamidb80> In reply to @ForumUpdaterBot "New thread by Benob:": 😕
18:08:21FromDiscord<zetashift> @treeform thanks! I played around with pixie today for a bit, I couldn't figure out how to get the equivalent of `image.line(vec2(11, 11), vec2(100, 100), rgba(0, 0, 0, 255))` in pixie. There is `lineTo` but that only gets 2 arguments and a path and what exactly is path?
18:08:47FromDiscord<zetashift> Cause a path can also contain a rect?
18:08:55FromDiscord<treeform> i'll add a line example
18:09:30FromDiscord<zetashift> oh thanks alot! 😄
18:11:38*JustASlacker joined #nim
18:15:40FromDiscord<treeform> In reply to @zetashift "oh thanks alot! 😄": here you go: https://github.com/treeform/pixie#line
18:16:20FromDiscord<treeform> Pixie has similar API to other vector libraries, create path, stroke/fill the path.
18:16:39FromDiscord<treeform> You can wrap this with your "line" method for your use case.
18:17:02FromDiscord<treeform> Usually people want to connect the lines and its kind of hard.
18:24:11FromDiscord<zetashift> alright I'll look more into it, I have never played with vector libs before, thank you
18:34:25*lkjasdf quit (Ping timeout: 240 seconds)
18:36:50*lkjasdf joined #nim
18:36:51*lkjasdf quit (Read error: Connection reset by peer)
18:37:15*lkjasdf joined #nim
18:53:38*natrys joined #nim
18:54:27*Vladar joined #nim
18:56:45*JustASlacker quit (Ping timeout: 240 seconds)
18:57:09*vicfred quit (Quit: Leaving)
18:58:21*superbia joined #nim
19:02:22reversem3serious question: "Why would you want to port C++ code to nim" ?
19:02:42*fosred quit (Quit: Leaving)
19:05:18FromDiscord<treeform> because its looks nicer, easier to work with, probably be shorter, possible less bugs, with ever rewrite code usually gets better (even C++ to C++ rewrite) etc...
19:06:13FromDiscord<~355/113 Man> better std lib too
19:06:53FromDiscord<zetashift> sent a code paste, see https://play.nim-lang.org/#ix=2PT0
19:06:56reversem3Ok very good thanks
19:07:56FromDiscord<treeform> In reply to @zetashift "<@107140179025735680> am I doing": can I see your line?
19:07:59FromDiscord<~355/113 Man> also random question, I think the answer is yes. does Nim have complex number in standard library?
19:08:48FromDiscord<treeform> In reply to @~355/113 Man "also random question, I": its like a web search away: https://nim-lang.org/docs/complex.html
19:09:55FromDiscord<treeform> In reply to @zetashift "<@107140179025735680> am I doing": are you using C++ mode?
19:10:52*JustASlacker joined #nim
19:10:57FromDiscord<zetashift> Erhm, I'm looping over a grid and drawing a line, as a wall, if it reaches the boundaries for example. My code kind of condensed is: https://play.nim-lang.org/#ix=2PT4, I am not using C++ mode
19:11:17FromDiscord<~355/113 Man> hmm, none of the exponential operations take a `k`
19:13:08FromDiscord<zetashift> I think I'm specifying the `w` and `h` wrong
19:13:20FromDiscord<treeform> In reply to @zetashift "Erhm, I'm looping over": Which OS are you on and what C compiler? It looks like a low level SIMD issue. What happens if you disable simd by passing `-d:pixieNoSimd` ?
19:15:07*kwilczynski quit (Remote host closed the connection)
19:15:07*sz0 quit (Remote host closed the connection)
19:15:07*fowl quit (Remote host closed the connection)
19:15:07*sirn quit (Remote host closed the connection)
19:15:07*robertmeta quit (Remote host closed the connection)
19:15:12FromDiscord<zetashift> I'm on Linux, Ubuntu 20.10, running gcc 10.2.0 and when I run `-d:pixieNoSimd` I get: `Error: attempting to call undeclared routine: 'roundedRect'`
19:16:08FromDiscord<treeform> ^ even more strange, we will look into this.
19:16:19FromDiscord<treeform> Do the simple examples in the readme work for you?
19:16:36FromDiscord<zetashift> oh yea lemme test some
19:16:42FromDiscord<zetashift> I might have jumped in too fast 😛
19:17:14FromDiscord<treeform> are you on 64 bit or 32 bit, x86?
19:17:27FromDiscord<treeform> It appears to be some low level issue with SIMD
19:17:51*casaca quit (Ping timeout: 246 seconds)
19:18:18FromDiscord<zetashift> `example_square` errors out with the same error, I'm on 64bit x86, want me to make an issue about this? I didn't think this would be an issue
19:19:03FromDiscord<treeform> I did not think so too
19:19:09FromDiscord<treeform> could you maybe pull head?
19:19:15FromDiscord<zetashift> `-d:pixieNoSimd` works with example_square tho
19:19:34FromDiscord<treeform> git clone https://github.com/treeform
19:19:37FromDiscord<treeform> cd pixie
19:19:43FromDiscord<treeform> nimble develop
19:21:23FromDiscord<zetashift> oh yea then it works
19:21:38FromDiscord<zetashift> (well the example gotta test my code now)
19:22:06FromDiscord<guzba> kk great yeah last pixie release was 24 days ago which is a very long time considering the daily work being done
19:23:05FromDiscord<zetashift> yea my code works too with head
19:23:35FromDiscord<guzba> cool ok we'll get a release tagged too but glad thats fixed
19:23:42*vicfred joined #nim
19:24:15*Gustavo6046 joined #nim
19:24:26FromDiscord<zetashift> sorry for the false alarm 😛
19:25:07FromDiscord<guzba> all good all good
19:25:25FromDiscord<guzba> we know to tag a new release out so thats nice
19:25:32FromDiscord<guzba> (edit) removed "out"
19:26:34FromDiscord<guzba> kk release is tagged if you prefer to just follow nimble instead of a clone'd repo
19:28:06FromDiscord<zetashift> I'm all set for now!
19:35:14*lkjasdf quit (Read error: Connection reset by peer)
19:35:35*lkjasdf joined #nim
19:36:08*JustASlacker quit (Ping timeout: 260 seconds)
19:40:23*blackpawn joined #nim
19:40:44FromDiscord<LITeralLANGuage9> Is it possible to write nim code that only works on 64 bit processors?
19:41:12FromDiscord<haxscramper> If you can do that with C you can just replicate solution in nim
19:42:42FromDiscord<haxscramper> There are also several consts like https://nim-lang.org/docs/system.html#cpuEndian and we also have https://nim-lang.org/docs/cpuinfo.html < this one is useless for the task, but I think there is something like that, but can't find proper link
19:47:30FromDiscord<mratsim> In reply to @LITeralLANGuage9 "Is it possible to": static: doAssert sizeof(int) == 8, "You shall not pass (on 32-bit)".
19:47:40FromDiscord<mratsim> (edit) "static:" => "`static:" | "32-bit)"." => "32-bit)"`."
19:48:06*robertmeta joined #nim
19:48:25*sirn joined #nim
19:50:10*JustASlacker joined #nim
19:50:16FromDiscord<mratsim> otherwise it depends on the architecture you target, x86 32 and 64 have a sufficiently different calling convention that you can break 32-bit with assembly
19:50:21FromDiscord<mratsim> (in fact I just did that)
19:51:04FromDiscord<haxscramper> Compiling `compiler/parser` to webassembly takes total of `399k` (for `.wasm` file)
19:51:29FromDiscord<haxscramper> with `ARC`, `danger`, `O2`, `release`, `stacktrace:off` etc.
19:51:45FromDiscord<mratsim> that seems large
19:53:10FromDiscord<Yardanico> @haxscramper with wasmrt?
19:54:02FromDiscord<haxscramper> No directly `emcc`
19:54:08FromDiscord<Yardanico> well that's not "directly" :P
19:54:17FromDiscord<Yardanico> emscripten is more "heavy" than compiling to pure wasm
19:54:35FromDiscord<Yardanico> but of course it abstracts a lot of wasm-specific stuff so you can compile programs with little to no modification
19:55:18FromDiscord<mratsim> @Araq you there?
19:55:30FromDiscord<haxscramper> More heavy than what? and should I try and use pure wasm or this is not worth it in the long run?
19:55:40FromDiscord<haxscramper> And "more heavy" by how much
19:56:04FromDiscord<Yardanico> well compiling to pure wasm will require you to do more porting work manually
19:56:10*sz0 joined #nim
19:56:14FromDiscord<haxscramper> I just went with `emcc` because that's what google knows most about, not that I know best
19:56:18FromDiscord<Yardanico> it's fine
19:57:18*fowl joined #nim
19:58:37*Cthalupa quit (Ping timeout: 256 seconds)
19:59:21*kwilczynski_ joined #nim
20:05:30*kwilczynski_ quit ()
20:06:10*kwilczynski joined #nim
20:08:44FromDiscord<haxscramper> Link-time optimization and `-Oz` saved `~83k` in total I think it is fine-(ish) in the end. Current build script is - https://github.com/haxscramper/hack/blob/master/testing/c/wasm/niminterop/build.sh and yes it is ugly as sin because I couldn't find a way to use `--passC` with `emcc` so I had to generate header file from nim and then use it in C's `main`
20:09:01*Cthalupa joined #nim
20:12:01*casaca joined #nim
20:13:25*Cthalupa quit (Ping timeout: 240 seconds)
20:17:42FromDiscord<mratsim> In reply to @haxscramper "Link-time optimization and `-Oz`": Don't worry we won't hold that sin against you
20:22:44*Cthalupa joined #nim
20:23:47FromDiscord<haxscramper> meh
20:24:14FromDiscord<haxscramper> I just realized I want something like https://astexplorer.net/
20:24:45FromDiscord<haxscramper> So maybe (if I finish it sometime) this will be a problem
20:28:18*Cthalupa quit (Ping timeout: 265 seconds)
20:30:46*Cthalupa joined #nim
20:33:37*haxscram` quit (Remote host closed the connection)
20:34:00*haxscramper joined #nim
20:37:37*haxscramper quit (Remote host closed the connection)
20:42:32*mfiano quit (Quit: WeeChat 2.9)
20:42:46*mfiano joined #nim
20:56:50FromDiscord<CodeHz> Is it possible to get custom pragma inside macro?↵the hasCustomPragma from macros is not work if the type is the argument of macro
20:57:17FromDiscord<CodeHz> (edit) "the" => "one of macro's" | removed "of macro"
20:57:23FromDiscord<CodeHz> (edit) "Is it possible to get custom pragma inside macro?↵the hasCustomPragma from macros is not work if the type is one of ... macro's" added "the"
20:58:01FromDiscord<CodeHz> (edit) "argument" => "argument↵https://play.nim-lang.org/#ix=2PTG"
20:59:21*filcuc joined #nim
21:03:08FromDiscord<CodeHz> oh, wait, I can just copy the customPragmaNode's code to achive it.. so why it is not exported
21:05:53*sirn quit (Remote host closed the connection)
21:05:53*fowl quit (Remote host closed the connection)
21:05:53*robertmeta quit (Remote host closed the connection)
21:05:53*kwilczynski quit (Remote host closed the connection)
21:05:54*sz0 quit (Remote host closed the connection)
21:08:21*kinkinkijkin quit (Ping timeout: 264 seconds)
21:09:36*kinkinkijkin joined #nim
21:12:04*robertmeta joined #nim
21:12:25*sirn joined #nim
21:23:49*sz0 joined #nim
21:26:20*fowl joined #nim
21:28:51*kwilczynski_ joined #nim
21:41:22*narimiran quit (Ping timeout: 272 seconds)
22:21:06*natrys quit (Quit: natrys)
22:36:22*superbia quit (Quit: WeeChat 3.0)
22:42:25FromDiscord<treeform> In reply to @LITeralLANGuage9 "Is it possible to": We do that kind of, we need a flag disable SIMD for 32bit for our stuff to work.
22:46:47*kwilczynski_ is now known as kwilczynski
22:46:49*kwilczynski quit ()
22:47:25*kwilczynski joined #nim
22:53:04*filcuc_ joined #nim
22:53:09*filcuc quit (Ping timeout: 256 seconds)
22:57:56*tane quit (Quit: Leaving)
23:01:08JustASlackerSo
23:01:37JustASlackerwhat would be a nice way to get a rest server running in nim
23:01:50JustASlackerlike flask in python or somesuch
23:02:49JustASlackeralso, is the python https://www.python.org/dev/peps/pep-0636/ related to https://github.com/zevv/npeg ?
23:02:57JustASlackeras in, same concept
23:03:17lkjasdfin theory you could convert flask to nim with py2nim (probably not the best option?)
23:05:01FromDiscord<Rika> Just use an http server like prologue or whatever and learn how to use that instead
23:05:05FromDiscord<Rika> Would be easier
23:05:36JustASlackerprologue looks nice
23:06:05JustASlackerIm looking for suggestions for something written in nim
23:06:50JustASlacker:thumbsup:
23:12:59FromDiscord<Rika> Prologue is in nim is it not
23:13:46FromDiscord<ElegantBeef> I think so, hard to tell https://media.discordapp.net/attachments/371759389889003532/812099566761541652/unknown.png
23:29:48ForumUpdaterBotNew thread by Yjuq: GCC Compiler - New to Nim, see https://forum.nim-lang.org/t/7531
23:29:55*filcuc_ quit (Quit: Konversation terminated!)
23:37:48ForumUpdaterBotNew thread by Mantielero: Windows - msys2 - rdynamic, see https://forum.nim-lang.org/t/7532
23:52:00*Lord_Nightmare quit (Quit: ZNC - http://znc.in)
23:55:14*Lord_Nightmare joined #nim