<< 23-06-2022 >>

00:11:22FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=40GD
00:11:37FromDiscord<jan0809> heey, how can i get what echo prints as string? (in py its called `repr`)
00:11:52FromDiscord<Elegantbeef> What do you mean jan?
00:12:01FromDiscord<!Patitotective> In reply to @jan0809 "heey, how can i": define a proc `$` for your type
00:12:08FromDiscord<Elegantbeef> you can do `import std/sugar` and `dump` if that's what you mean or use treeform's printy
00:13:18FromDiscord<jan0809> In reply to @Patitotective "define a proc `$`": ah yeah that seem to be similar to `repr`
00:13:20FromDiscord<!Patitotective> sent a code paste, see https://paste.rs/nUM
00:13:49FromDiscord<jan0809> In reply to @Elegantbeef "you can do `import": and that captures `stdout` ? usefull aswell
00:13:52FromDiscord<!Patitotective> In reply to @Elegantbeef "What do you mean": beefs not pythonic :p
00:14:48FromDiscord<jan0809> saw oolib on git
00:15:15FromDiscord<Elegantbeef> Uhoh someone is going to write Nim like python 😄
00:16:49FromDiscord<jan0809> sent a code paste, see https://paste.rs/oLj
00:17:10FromDiscord<jan0809> (edit) "https://paste.rs/IP1" => "https://play.nim-lang.org/#ix=40GF"
00:18:10FromDiscord<jan0809> but tbh the way nim does kinda makes more sense(?)
00:18:22FromDiscord<jan0809> tbh i hated oop in python at first
00:19:32FromDiscord<jan0809> In reply to @Patitotective "define a proc `$`": and whats the init dunder? `€`?
00:20:00FromDiscord<Elegantbeef> There are no dunders in Nim
00:20:56FromDiscord<jan0809> well `proc `$`` is basiclally the same thing as `repr` dunder
00:21:03FromDiscord<huantian> wellll
00:21:06FromDiscord<jan0809> (edit) "`$``" => "$`"
00:21:25FromDiscord<huantian> bridge be alive again
00:21:30FromDiscord<jan0809> or isnt it(?)
00:21:37FromDiscord<huantian> technically $ is more like str
00:21:37FromDiscord<huantian> `str`
00:21:44FromDiscord<huantian> there we go
00:22:05FromDiscord<jan0809> In reply to @huantian "`__str__`": no `str` is called with str() not print()
00:22:16FromDiscord<jan0809> print calls repr
00:22:24FromDiscord<Elegantbeef> Nim is not python
00:22:36FromDiscord<Elegantbeef> Nim's echo calls `$` which is the stringification operator
00:22:54FromDiscord<Elegantbeef> The only reason it's `$` is a convention and you can write your own echo variant that calls whatever
00:24:04FromDiscord<jan0809> In reply to @Elegantbeef "Nim's echo calls `$`": yes just please tell me the `operator` for `init` or `new`, there must be something similar
00:24:34FromDiscord<Elegantbeef> Nim doesnt have init or new built into the language it's all userspace
00:25:01FromDiscord<jan0809> oooh i c
00:25:04FromDiscord<huantian> usually you either make your objects valid by default
00:25:22FromDiscord<huantian> or make a proc like `initMyObject` or `newMyRefObject`
00:25:38FromDiscord<jan0809> yeah i undestand now
00:26:01FromDiscord<Elegantbeef> or the better `proc init(_: typedesc[T], args): T`
00:26:52FromDiscord<jan0809> look, mainig python messed up my perceptions
00:31:13*vicecea quit (Remote host closed the connection)
00:31:43*vicecea joined #nim
00:36:05*wallabra joined #nim
00:46:11FromDiscord<impbox [ftsf]> is it a known issue of stacktraces having incorrect line numbers/function names? eg. I have a stacktrace that has an entry with `path/m8i.nim(941) readFM` but line 941 does is a different function in a different part of the file
00:46:49FromDiscord<Elegantbeef> Do you call a template?
00:47:18FromDiscord<impbox [ftsf]> hmm this is in async code... so i assume there's lots of magic going on
00:47:38FromDiscord<Elegantbeef> Then it's just the typical async stack trace being bad
00:47:41FromDiscord<impbox [ftsf]> specifically jester
00:47:44FromDiscord<impbox [ftsf]> ok
00:47:49FromDiscord<impbox [ftsf]> known issue then i guess
00:48:08FromDiscord<Elegantbeef> Yea someone needs to clean up the async macro's stack trace afaik
01:35:01*noeontheend joined #nim
01:40:50*toluene quit (Ping timeout: 240 seconds)
01:43:32*toluene joined #nim
01:50:02FromDiscord<Tuatarian> this might be a stupid question (all the more reason to ask it ig) but why would you have cyclical references?
01:50:17FromDiscord<Tuatarian> it seems frankly like it's almost unviersally a headache to deal with from the programmer and compiler end
01:50:26FromDiscord<Tuatarian> language end
01:50:32FromDiscord<Elegantbeef> Why or how? 😄
01:50:41FromDiscord<Elegantbeef> Why is that you have a data type that needs to be self referential
01:51:31*rockcavera joined #nim
01:51:31*rockcavera quit (Changing host)
01:51:31*rockcavera joined #nim
01:51:39FromDiscord<Elegantbeef> Sometimes you just need a cyclical graph
02:06:27FromDiscord<Tuatarian> how often though?
02:06:35FromDiscord<Tuatarian> actually no nevermind you're right
02:07:29FromDiscord<Elegantbeef> I mean you can always turn it into an ID system instead of a direct graph
02:07:36FromDiscord<Tuatarian> I can see a usecase for cyclic functions
02:07:43FromDiscord<Tuatarian> yeah that's what I was thinking
02:07:53FromDiscord<Tuatarian> I feel like it would be easier to reason about in many cases that way
02:08:03FromDiscord<Tuatarian> but also if it's complex enough it could make it much harder
02:08:05FromDiscord<Elegantbeef> It's basically how you serialize cyclical data to Json
02:08:09FromDiscord<Tuatarian> what about cyclical types?
02:08:39FromDiscord<Elegantbeef> You'd have a collection of your cyclical references and just have an id to index it
02:09:41FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=40GL
02:10:46FromDiscord<Elegantbeef> This is kinda how data oriented ASTs work
02:12:35FromDiscord<Elegantbeef> It's much easier to serialize
02:12:46FromDiscord<Elegantbeef> I guess the actual thing would be `root: int`
02:12:51FromDiscord<Elegantbeef> Or just assume `0` is root
02:17:18FromDiscord<pongsu> this is also a easy way to build some graph struct and can avoid some complex pointer operation.
02:18:02FromDiscord<Elegantbeef> Yea it's better for the cache so for things like compilers is very beneficial
02:18:12FromDiscord<Elegantbeef> Since you have all your data stored sequentially instead of all over the heap
02:28:54*noeontheend quit (Ping timeout: 264 seconds)
03:06:42FromDiscord<Tuatarian> though i can see why this might be a bit harder to reason about than a recursive type
03:07:00FromDiscord<Elegantbeef> Eh you can make it 1\:1 if you use macros 😛
03:07:10FromDiscord<Tuatarian> oh true
03:07:19FromDiscord<Tuatarian> I always forget how useful metaprogramming is
03:07:31FromDiscord<Tuatarian> another question
03:07:37FromDiscord<Tuatarian> what exactly are algebraic data types?
03:07:45FromDiscord<Elegantbeef> Rust enums
03:07:59FromDiscord<Tuatarian> never used rust
03:08:06FromDiscord<Elegantbeef> Neither have i
03:08:13FromDiscord<Elegantbeef> They're just object variants with less typign
03:08:33FromDiscord<huantian> sum types are pretty nice tho
03:08:37FromDiscord<Tuatarian> oh ok so like variations on a type without making a whole new type
03:08:38FromDiscord<Tuatarian> sum type?
03:09:05FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=40GW
03:09:06FromDiscord<Elegantbeef> It's just a tagged union generator
03:09:18FromDiscord<Tuatarian> oh I see
03:09:38FromDiscord<Tuatarian> effectively a named subtype
03:09:49FromDiscord<Tuatarian> or field I guess
03:10:01FromDiscord<Tuatarian> isn't this just a tuple with named fields?
03:10:16FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=40GX
03:10:17FromDiscord<Elegantbeef> I mean it's a tagged union
03:10:52FromDiscord<Elegantbeef> The structs are overlapped in memory and a hidden value is used to reason which it is
03:11:17FromDiscord<Tuatarian> so in this case, how would I compare two objects of `PretendThisIsValid` type?
03:11:31FromDiscord<Tuatarian> or lets say I wanted some function taking `PretendThisIsValid` as input
03:11:33FromDiscord<huantian> I'd assume they'd be statically typed as opposed to nim's object variants which are kinda statically typed
03:11:40FromDiscord<Elegantbeef> You'd ensure they have the same descrim thenthe same fields
03:11:59FromDiscord<Elegantbeef> But that's hidden away from the internal impl
03:12:00FromDiscord<Tuatarian> can you give an example of a problem this would make easier?
03:12:07FromDiscord<Elegantbeef> Shapes
03:12:20FromDiscord<Tuatarian> surely you'd just want to do each shape as a type itself right?
03:12:31FromDiscord<Elegantbeef> No what if you want to store them in a list
03:12:36FromDiscord<Tuatarian> like type triangle, type square, etc
03:12:37FromDiscord<Elegantbeef> You cannot unless you make them references
03:12:38FromDiscord<huantian> I think the other common is a tree with `Node`s and `Leaf`s
03:12:42FromDiscord<Elegantbeef> Here's a Nim version
03:13:47FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=40GY
03:13:54FromDiscord<Elegantbeef> It's much more verbose than ADTs
03:14:02FromDiscord<Elegantbeef> But you can see how you'd compare these
03:14:24FromDiscord<Elegantbeef> you'd first check if `kind` is equal then check if the other fields are equal
03:14:25FromDiscord<Tuatarian> you'd basically need to check that they're comparable
03:14:27FromDiscord<Tuatarian> right
03:14:40FromDiscord<Elegantbeef> The benefit is that these can be stored together in memory
03:14:43FromDiscord<Elegantbeef> Without a heap allocation
03:15:06FromDiscord<huantian> is there a way to statically assure that your `Shape` is a `rectangle` in nim?
03:15:11FromDiscord<Tuatarian> sent a code paste, see https://play.nim-lang.org/#ix=40GZ
03:15:22FromDiscord<huantian> I'd assume like Rust does that
03:15:26FromDiscord<Elegantbeef> No↵(@huantian)
03:15:41FromDiscord<Elegantbeef> I mean Nim will bitch if you dont properly descrim
03:15:45FromDiscord<Elegantbeef> So it already does that
03:15:52FromDiscord<Elegantbeef> Atleast iirc it does
03:15:55FromDiscord<huantian> but doesn't it only do that at runtime?
03:16:27FromDiscord<Elegantbeef> I could swear there were some static checked accesses
03:16:37FromDiscord<Tuatarian> this kinda seems like a huge mess frankly
03:16:46FromDiscord<huantian> https://play.nim-lang.org/#ix=40H0
03:16:50FromDiscord<huantian> I see no error
03:16:53FromDiscord<Elegantbeef> Well it gives you inheritance without having to use references
03:17:29FromDiscord<Elegantbeef> It does have some static checking huan i just dont remember how to kick it in
03:18:09FromDiscord<Elegantbeef> Like i know i had some problems with it in my game
03:18:22FromDiscord<Tuatarian> what library do you use for your games?
03:18:39FromDiscord<Elegantbeef> Opengl + sdl2 + assimp + miniaudio
03:18:57FromDiscord<Elegantbeef> It's my own framework
03:19:06FromDiscord<Elegantbeef> It's nothing much but it does the trick
03:19:13FromDiscord<Elegantbeef> https://github.com/beef331/truss3d
03:19:28FromDiscord<Tuatarian> sdl2 deals with input and such?
03:19:33FromDiscord<Elegantbeef> Yes
03:22:13FromDiscord<Tuatarian> so basically does the same stuff raylib does?
03:22:19FromDiscord<Tuatarian> except you put it together so more fun
03:22:53FromDiscord<Elegantbeef> Some of the same stuff yes
03:23:12FromDiscord<Tuatarian> what are the main differences if any?
03:23:22FromDiscord<Elegantbeef> No clue havent used raylib
03:23:30FromDiscord<Elegantbeef> It's not written in Nim so that's a big one 😄
03:23:37FromDiscord<Elegantbeef> It's also probably more developed and documented
03:23:53FromDiscord<Tuatarian> it's probably more developed but raylib documentation is mostly just function headers
03:24:02FromDiscord<Tuatarian> there's almost literallly nothing outside function headers
03:24:10FromDiscord<Elegantbeef> I dont have any comments whatsoever
03:24:23FromDiscord<Tuatarian> yeah so raylib is quite a bit better then lmao
03:24:33FromDiscord<Elegantbeef> Fuck you too! 😛
03:24:35FromDiscord<Tuatarian> but the params and proc name often give away a good amount
03:24:48FromDiscord<Tuatarian> lamo
03:24:50FromDiscord<Tuatarian> lmao
03:24:55FromDiscord<Tuatarian> does matrix see discord emoji reacts?
03:25:39FromDiscord<🐒🧠br4n_d0n> Wait so Nim has export as well?
03:25:54FromDiscord<Rika> yes
03:26:47FromDiscord<Elegantbeef> So huan you cannot access enum fields in rust without explicitly converting into the type
03:26:47FromDiscord<Elegantbeef> So i mean i guess rust has static assurances but i mean yea.... they're not pretty
03:26:53FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=40H2
03:27:02FromDiscord<🐒🧠br4n_d0n> Man, I was struggling with the macros and template nonsense and now I added another item to the ever growing list
03:27:06FromDiscord<Elegantbeef> No matrix doesnt see discord reactions
03:27:17FromDiscord<Elegantbeef> Export is just public it's not anything fancy
03:27:55FromDiscord<🐒🧠br4n_d0n> I need a language for monkey brains
03:29:49FromDiscord<huantian> sent a code paste, see https://paste.rs/pDa
03:30:02FromDiscord<Elegantbeef> I was going to write the valid rust but i cannot understand the valid rust
03:30:29FromDiscord<Rika> mfw
03:31:20FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=40H4
03:31:20FromDiscord<huantian> sent a code paste, see https://paste.rs/XJB
03:31:32FromDiscord<Elegantbeef> No no no huan we know the type you dont need to pattern match
03:31:51FromDiscord<Elegantbeef> You need to do the funky if expr and probably make it a `let mut`
03:31:58FromDiscord<huantian> uh huh
03:32:31FromDiscord<Elegantbeef> Fuck if i know how to do it, i guess the answer is just "all field access is forced to be inside a match or let expr so it's statically safe"
03:33:39FromDiscord<huantian> can you explicitly mark your function as taking a Circle or a Rectangle?
03:33:49FromDiscord<Elegantbeef> No
03:34:34FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=40H5
03:35:12FromDiscord<Elegantbeef> Const generic i guess for that
03:35:23FromDiscord<Elegantbeef> Const generic pretend distinct\ 😛
03:35:51FromDiscord<Elegantbeef> Damn it huan a `Boxed` distinct enum type sounds so nice now
03:36:31FromDiscord<huantian> sent a code paste, see https://play.nim-lang.org/#ix=40H6
03:36:38FromDiscord<Elegantbeef> Nope
03:37:57FromDiscord<huantian> In reply to @Elegantbeef "Damn it huan a": what do you mean by that?
03:39:55FromDiscord<Elegantbeef> One second
03:41:23*arkurious quit (Quit: Leaving)
03:41:42*toluene quit (Quit: Ping timeout (120 seconds))
03:43:43*toluene joined #nim
03:45:13FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=40H9
03:45:52FromDiscord<Elegantbeef> It's not much nicer than `assert someVal.kind == a` at the start of like a `render` proc
03:46:32FromDiscord<Elegantbeef> But it's a nice idea to dispatch off the value automatically instead of a name
03:49:35FromDiscord<huantian> yeah not sure how I would feel about using this in "production" code but it's kinda neat
03:50:38FromDiscord<Elegantbeef> You can use the `.` and `()` operators to make it be treated like it's base where needed so it's just interesting
03:53:58FromDiscord<Elegantbeef> Cmon it's now super interesting and not just a over complicated `assert`!
03:54:00FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=40Ha
03:54:53FromDiscord<huantian> yeah it has generics it's much more cool
03:55:19FromDiscord<huantian> also we got some more experimental features with concepts and dotoperators so it's even cooler
03:55:37FromDiscord<Elegantbeef> Hey leave concepts out of this!
03:58:34FromDiscord<!Patitotective> how would you create a template that can be used as a pragma?
03:58:46FromDiscord<Elegantbeef> `template myPragma {.pragma.}`
04:01:12FromDiscord<Tuatarian> In reply to @Elegantbeef "No matrix doesnt see": ah I see
04:01:29FromDiscord<Tuatarian> I hearted the "fuck you too" message (lmao) and was unsure if u saw
04:03:39FromDiscord<Tuatarian> In reply to @Elegantbeef "I was going to": I resonate so strongly with this lmao
04:04:47FromDiscord<Elegantbeef> In closing about my framework it's mainly for me 😄
04:05:20FromDiscord<Elegantbeef> Oh i do have one thing raylib doesnt, a nice GUI DSL 😛
04:06:13FromDiscord<Tuatarian> I really need to do some stuff to make gui easier for me
04:06:28FromDiscord<Tuatarian> it's not super time consuming but I really don't like doing it lmao
04:06:33FromDiscord<Elegantbeef> Steal my GUI code but use raylibs API
04:06:42FromDiscord<Tuatarian> not a terrible idea tbh
04:06:50*wallabra quit (Ping timeout: 268 seconds)
04:06:58FromDiscord<Elegantbeef> You can steal a lot of the layout just not the UI elements and the like
04:07:11FromDiscord<Tuatarian> bit too lazy rn but I'll probably do that once I get to gui stage for my current project
04:07:17FromDiscord<Elegantbeef> I mean if you're using raylib you can just steal the frame and handle that all
04:07:22FromDiscord<Elegantbeef> Did you see my gui's DSL?
04:07:27FromDiscord<Tuatarian> haven't looked yet no
04:07:53FromDiscord<Elegantbeef> https://github.com/beef331/truss3d/blob/master/examples/guitest.nim#L25-L140
04:08:23FromDiscord<Tuatarian> oh yeah I can just steal that outright
04:08:46FromDiscord<Elegantbeef> You probably dont want to reuse any of my code but you can steal the idea and the macro
04:08:51FromDiscord<Tuatarian> almost I would have to change some stuff
04:09:00FromDiscord<Tuatarian> your code is 100% going to be better than anything I could write tbh
04:09:07FromDiscord<Tuatarian> but more fun to do it yourself I agree
04:09:15FromDiscord<Elegantbeef> I mean it's my first attempt ever at making a GUI system
04:09:19FromDiscord<Elegantbeef> So i woulldnt say that
04:09:32FromDiscord<Tuatarian> I havent tried before either 🙂
04:10:07FromDiscord<Tuatarian> but yeah making a dsl for gui is a really good idea and I will definitely be stealing the base concept + lot of the elements
04:10:32FromDiscord<Tuatarian> something to automatically construct buttons, sliders, and such
04:10:49FromDiscord<Elegantbeef> If you can use closures it'll make your life a good one
04:10:55FromDiscord<Tuatarian> closures?
04:10:58FromDiscord<Tuatarian> like closure iterators?
04:11:06FromDiscord<Elegantbeef> No like closure procedures
04:11:17FromDiscord<Elegantbeef> I heavily use closures in my API as it's pure nim i can
04:11:20FromDiscord<Tuatarian> wait what is that lmao
04:11:36FromDiscord<Elegantbeef> A closure is a procedure which captures it's environment and stores it
04:11:45FromDiscord<Elegantbeef> It's like a closure iterator but doesnt iterate
04:12:02FromDiscord<Tuatarian> so if I import some file with the closure proc in it it can access globals from the file I import into?
04:12:15FromDiscord<Elegantbeef> No
04:12:51FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=40Hc
04:12:57FromDiscord<huantian> dang that's the exact example I was gonna do
04:13:30FromDiscord<Elegantbeef> In this example the closure allocates an `int` and stores it so it remembers it's state
04:13:35FromDiscord<Tuatarian> ohhh
04:13:38FromDiscord<Elegantbeef> It captures a value
04:13:44FromDiscord<Elegantbeef> or value(s)
04:14:14FromDiscord<Tuatarian> it basically remembers it's state from the prior call
04:14:22FromDiscord<Tuatarian> that's really cool
04:14:58FromDiscord<Tuatarian> oh so the proc would be able to hold relevant aspects of the button's state (hover, click, etc)?
04:15:18FromDiscord<Elegantbeef> Well more so the state of things it cares about
04:15:37FromDiscord<Tuatarian> such as?
04:15:52FromDiscord<Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/989383266933039105/image.png
04:16:04FromDiscord<Elegantbeef> Look at these `proc`s
04:16:39FromDiscord<Elegantbeef> `visibleCond`s watch a boolean expression and if it's matched it'll render
04:16:59FromDiscord<Elegantbeef> `watchValue` watches the value and in update will set itself to that if it's changed
04:17:08FromDiscord<Tuatarian> so things the button neds to care about
04:17:08FromDiscord<Tuatarian> I see
04:17:22FromDiscord<Tuatarian> if the game is on the relevant screen where it needs to be drawn etc
04:17:23FromDiscord<Elegantbeef> I mean this is one way of making a UI that i really like
04:17:32FromDiscord<Elegantbeef> It's very declarative and easy to write with
04:17:47FromDiscord<Tuatarian> it's fairly easy to read as well
04:18:14FromDiscord<Elegantbeef> Though depending on what you're doing you need to either make `ref object` or ensure your closures dont outlive the object 😄
04:18:45FromDiscord<Tuatarian> I'm wondering here, since the closure keeps it's own state is there a concern of heavy memory usage if you overuse?
04:19:01FromDiscord<Elegantbeef> I mean if you capture large data types sure
04:19:43FromDiscord<Tuatarian> we can destroy the variable holding the proc with `=destroy` right
04:19:53FromDiscord<Elegantbeef> You dont need to manually destroy them
04:20:06FromDiscord<Tuatarian> gc handles?
04:20:11FromDiscord<Tuatarian> yeah that makes sense
04:20:13FromDiscord<Elegantbeef> Yes the GC handles closures
04:33:13*cornfeedhobo quit (Remote host closed the connection)
04:44:44*cornfeedhobo joined #nim
04:55:51*Lord_Nightmare quit (Quit: ZNC - http://znc.in)
04:59:29*Lord_Nightmare joined #nim
05:07:17*rockcavera quit (Remote host closed the connection)
05:28:31*wallabra joined #nim
05:42:15*matt_13372 joined #nim
05:42:55*matt_1337 quit (Ping timeout: 256 seconds)
05:43:58*matt_13372 is now known as matt_1337
05:53:32*matt_1337 quit (Quit: Ping timeout (120 seconds))
05:58:38*matt_1337 joined #nim
06:01:56*matt_1337 quit (Client Quit)
06:06:49*matt_1337 joined #nim
06:11:07*matt_1337 quit (Client Quit)
06:11:54*matt_1337 joined #nim
06:38:00FromDiscord<ripluke> How can I shorten a string?
06:39:37*msimm-nzi joined #nim
06:40:25FromDiscord<Elegantbeef> `setLen`
06:53:38FromDiscord<ripluke> Oh
06:54:38*msimm-nzi quit (Ping timeout: 240 seconds)
07:02:35*ltriant quit (Ping timeout: 268 seconds)
07:06:37*matt_13377 joined #nim
07:08:08*matt_1337 quit (Ping timeout: 268 seconds)
07:10:24*matt_133776 joined #nim
07:11:38*matt_13377 quit (Ping timeout: 240 seconds)
07:11:38*matt_133776 is now known as matt_13377
07:11:59FromDiscord<pongsu> robot?😱
07:12:22FromDiscord<Elegantbeef> perhaps, but also perhaps not
07:12:43FromDiscord<Elegantbeef> I often fail the turing test
07:12:47FromDiscord<Elegantbeef> Though i dont study for it
07:13:17FromDiscord<pongsu> i can't believe you are a robot
07:13:35FromDiscord<Elegantbeef> Neither can my parents
07:14:30FromDiscord<pongsu> but you are always online and answer so quickly.
07:14:35FromDiscord<pongsu> amazing
07:14:39FromDiscord<pongsu> 🤔
07:15:02FromDiscord<Elegantbeef> I always have a matrix client open and dont do anything important ever
07:15:16FromDiscord<ripluke> In reply to @Elegantbeef "I always have a": 💀
07:15:29FromDiscord<ripluke> I should do that
07:15:48FromDiscord<ripluke> But if I had discord open 24/7 my ram would hate me
07:17:05FromDiscord<pongsu> https://tenor.com/view/%E5%B0%8F%E7%8C%AB%E5%90%83%E6%83%8A-what-amazed-gif-15665604
07:24:42*matt_13377 quit (Ping timeout: 264 seconds)
07:27:43*matt_13377 joined #nim
07:47:28*matt_133772 joined #nim
07:48:56*matt_13377 quit (Ping timeout: 272 seconds)
07:48:56*matt_133772 is now known as matt_13377
07:52:43*msimm-nzb joined #nim
08:11:04*msimm-nzb quit (Quit: Connection closed)
08:20:12*msimm-nze joined #nim
08:22:22FromDiscord<Phil> In reply to @ripluke "But if I had": That's why you have lots of RAM so you don't have to care that one small region of it hates you
08:36:26*wallabra quit (Ping timeout: 272 seconds)
08:37:27*msimm-nze quit (Quit: Ping timeout (120 seconds))
08:59:13FromDiscord<Prestige> I need to get a better matrix client, element is not great
08:59:24FromDiscord<Elegantbeef> Works fine here
08:59:31FromDiscord<Elegantbeef> nheko might be up your alley
08:59:46FromDiscord<Prestige> Does element take like 1 or two minutes to load up for you?
09:00:19FromDiscord<Prestige> I also just hate their UI tbh
09:01:35FromDiscord<Elegantbeef> It doesnt
09:02:04FromDiscord<Prestige> Weird, I wonder why mine always takes forever to load
09:32:59FromDiscord<luteva> Hi! I was trying the nimwave (quite cool project btw.) and used the nimwave starter app: https://github.com/ansiwave/nimwave_starter↵when i run the gui app, it uses 100% of one CPU. Even if I do not do anything in the app. So there seems to be some problem. Maybe it is an opengl based thing? Does anyone have the same problem? And if yes, is there any way to fix that (maybe something like a compiler switch or parameter)?
09:39:50FromDiscord<Elegantbeef> Welcome to programs that use sdl2/gflw for their update loop 😄
09:45:33FromDiscord<Prestige> vsync disabled I guess?
09:45:36FromDiscord<luteva> yey it is probably the update loop, that was my first idea, too.↵the question is: is there an easy way to solve this?
09:45:55FromDiscord<ripluke> Is matrix any good?
09:46:28FromDiscord<Elegantbeef> seems fine to me
09:46:58FromDiscord<ripluke> Like what makes it better than discord
09:47:12FromDiscord<Elegantbeef> It's an open standard
09:47:26FromDiscord<Elegantbeef> You can self host servers and write/use any client you want
09:47:50FromDiscord<Elegantbeef> You can enable e2e encryption for rooms/dm
09:48:36FromDiscord<Elegantbeef> https://stackoverflow.com/questions/25938859/why-does-simple-glfw-program-eat-all-the-available-cpu-even-though-progam-is-idl↵(@luteva)
09:48:49FromDiscord<Prestige> Tbh I think element's mobile app is better than discord's
09:49:01FromDiscord<Elegantbeef> No clue dont use mobile devices
09:49:33FromDiscord<Prestige> like at all?
09:50:07FromDiscord<Elegantbeef> I have an android phone i bought in 2016 that still runs android 5.0 and lasts like a week on it's original battery
09:50:17FromDiscord<Elegantbeef> If that doesnt explain how little i touch it i dont think anything would
09:50:31FromDiscord<Elegantbeef> It's a clock
09:50:32FromDiscord<Elegantbeef> and a pager
09:51:31FromDiscord<Prestige> mine is from 2015 I think but I still use it
09:51:47FromDiscord<Elegantbeef> Does your battery last a week?
09:51:51FromDiscord<Prestige> actually it's 2016 just looked it up
09:52:03FromDiscord<Prestige> lasts like 3 days
09:52:38FromDiscord<Prestige> Used to only last a day till I put lineage os on it and removed all google services, lol
09:52:46FromDiscord<Elegantbeef> Ah that's cheating 😄
10:01:41FromDiscord<enthus1ast> I could complain a lot about matrix (also hosting my own server), the clients etc, but it's the best (open source) chatsystem we have...↵(@ripluke)
10:03:01FromDiscord<Prestige> I hope it gets a _lot_ better and attracts the "normal" audience so we can move more away from discord
10:03:38FromDiscord<ripluke> So is a matrix server like a discord server lol
10:04:10FromDiscord<Prestige> It's like a discord replacement, but open source, encrypted, etc. It's better in a lot of ways
10:04:25FromDiscord<Prestige> https://matrix.org/ if you want to read more
10:05:05FromDiscord<ripluke> Ok I'll check it out
10:07:07FromDiscord<Rika> It’s both better and worse in certain ways
10:07:39*ltriant joined #nim
10:07:47FromDiscord<Prestige> Yeah definitely
10:08:51FromDiscord<Prestige> My parents use it for video calls, which is kind of impressive because they can barely manage to send emails on a computer
10:37:45*jmdaemon quit (Ping timeout: 248 seconds)
10:56:47FromDiscord<j-james> In reply to @Avahe "Does element take like": yeah, mine always does if i leave it for more than a day or two
10:56:59FromDiscord<j-james> really dampens the experience
10:57:21FromDiscord<j-james> i've heard that it may be a problem with being on the (very large) matrix.org server
10:59:24FromDiscord<Prestige> Hmm maybe so
10:59:42FromDiscord<Phil> Is dom present?
11:00:57FromDiscord<Phil> Mostly asking because I'm curious about the differences it would make in the end if a prologue web-application were served either through httpbeast or stdlib asynchttpserver.↵Since he's knee deep in httpbeast I thought he might give a good answer
11:01:33FromDiscord<Phil> Like, I can't use stdlib asynchttpserver at the moment either way because of the file upload issue, I'm just curious whether that causes me to actually miss out on anything.
11:03:12FromDiscord<xflywind> httpbeast suppports multiple threads, uses epoll/kqueue internally and tends to have better performance than asynchttpserver.
11:04:08FromDiscord<xflywind> Both of them are wriiten by dom.
11:04:15FromDiscord<Phil> And asynchttpserver was useable on windows? I recall back when I first googled around for web frameworks
11:04:17FromDiscord<xflywind> (edit) "wriiten" => "written"
11:04:23FromDiscord<Phil> (edit) "And asynchttpserver was useable on windows? I recall back when I first googled around for web frameworks ... " added "there was something"
11:04:48FromDiscord<xflywind> Yeah, httpbeast doesn't support windows while asynchttpserver does.
11:05:08FromDiscord<Phil> Ahhh check, so basically... that sort of issue is pretty much mitigated if you just use a linux docker image, isn't it?
11:05:19FromDiscord<Phil> Assuming your server has to run windows
11:06:19FromDiscord<xflywind> One of the solution is to use wsl2 on windows.
11:06:53FromDiscord<Phil> Interesting. Alrighty, so not that much of an issue and as an application dev you can pretty much just prefer httpbeast and use it everywhere
11:09:05FromDiscord<xflywind> I think if some applications like game server running locally on windows, you have to choose asynchhttpserver.
11:09:19FromDiscord<xflywind> (edit) removed "if"
11:09:41FromDiscord<Phil> Right, gaming server, that's actually a usecase I've never considered, hmm
11:10:41FromDiscord<xflywind> wsl/wsl2 is also a barrier for newcomers though.
11:11:56FromDiscord<Phil> Yes-ish. I mean, you're doing webdev, I'd assume that's alright
11:11:57FromDiscord<xflywind> Like Crystal langauge haven't had complete windows support. It is not very user-friendly.
11:12:22FromDiscord<Phil> Then again, I have no idea how wsl "feels" like on windows so I can't really judge
11:14:58FromDiscord<xflywind> As a wprkaround, it works well.
11:15:02FromDiscord<xflywind> (edit) "wprkaround," => "workaround,"
12:24:47FromDiscord<Prestige> Is there an idiomatic way in Nim to create a string of spaces with a certain number of characters? I'm currently doing `indent("", numSpaces)` which seems fine, don't know if there's a more appropriate solution
12:26:18FromDiscord<Yardanico> In reply to @Avahe "Is there an idiomatic": just https://nim-lang.org/docs/strutils.html#repeat%2Cchar%2CNatural ?
12:26:29FromDiscord<Prestige> Neat, thanks
12:26:30FromDiscord<Yardanico> I mean, there's no "idiomatic" way, it's simple
12:26:37FromDiscord<Yardanico> it's not some complex stuff
12:26:48FromDiscord<Prestige> Yeah didn't know that function existed
12:26:51FromDiscord<Prestige> kind of a big module
12:39:08FromDiscord<Zoom> Oh, I completely missed Crystal's already working on Win. Thanks. If anyone's interested, the tracking issue is\: https://github.com/crystal-lang/crystal/issues/5430↵(@xflywind)
12:59:41FromDiscord<xflywind> concurrency doesn't seem to work.
13:23:46FromDiscord<!Patitotective> In reply to @Elegantbeef "I have an android": I have a 2016 redmi that runs android 4.4.4 😎
13:31:30FromDiscord<eyecon> In reply to @S3cur3Th1sSh1t "I found, that compiling": Look at wNim's Reversi example for linking resources via nim files: https://github.com/khchen/wNim/blob/master/examples/resource/resource.nim (also the other files and the script in the same project are interesting)
13:32:25FromDiscord<eyecon> (I know you asked decades ago, but I can look here only so often)
13:34:05FromDiscord<Require Support> how to declare `uintptr_t` in nim 🤔
13:41:24FromDiscord<d4rckh> In reply to @Patitotective "I have a 2016": Redmi Pro?
13:42:05FromDiscord<enthus1ast> Is it not just nims "pointer" type? Would look (or use) how winim has defined it↵(@Require Support)
13:53:01FromDiscord<Generic> uintptr_t is `ptr pointer` in Nim
13:53:11FromDiscord<Generic> (edit) "uintptr_t" => "`uintptr_t`"
13:58:36FromDiscord<eyecon> sent a code paste, see https://paste.rs/ozl
13:59:03FromDiscord<Generic> you cannot
13:59:30FromDiscord<Generic> what you're trying to do is solved by view types, though they're still experimental
14:00:08FromDiscord<Require Support> In reply to @enthus1ast "Is it not just": honestly no idea, i should probably learn what `uintptr_t` first i guess 😅
14:00:14FromDiscord<eyecon> In reply to @Generic "what you're trying to": Ty, I appreciate the answer
14:04:59FromDiscord<eyecon> @Require Support find out what the type (without ``) maps to, in the C code you have, then you will get an easier answer probably
14:06:11FromDiscord<eyecon> If it is e.g. a pointer to a pointer to an uint, then it is probably a pointer to an uint array, which I'm sure someone here can tell the winim idiom for 🙂
14:06:38FromDiscord<!Patitotective> In reply to @d4rckh "Redmi Pro?": it says HM 2LTE-BR
14:08:04FromDiscord<d4rckh> Ah that's the Redmi 2
14:08:08FromDiscord<d4rckh> Pretty cool
14:08:35FromDiscord<d4rckh> All of my phone has been redmis
14:08:44FromDiscord<d4rckh> (edit) "phone has" => "phoes have"
14:08:49FromDiscord<enthus1ast> my google search tells me\:↵↵uintptr\_t Unsigned integer of size equal to a pointer
14:08:57FromDiscord<enthus1ast> so yea, its a nim pointer
14:09:27FromDiscord<enthus1ast> or a uint \:)
14:10:11FromDiscord<enthus1ast> so 32bit on ia3; 64bit on amd64 etc.
14:14:03FromDiscord<Require Support> thanks guys
14:14:30*arkurious joined #nim
14:32:16*noeontheend joined #nim
14:38:31*noeontheend quit (Remote host closed the connection)
14:39:16*noeontheend joined #nim
14:56:55FromDiscord<m4ul3r> sent a code paste, see https://play.nim-lang.org/#ix=3IV8
15:04:05FromDiscord<Yardanico> In reply to @m4ul3r "Is it possible to": `p` is paragraph
15:04:09FromDiscord<Yardanico> you want `b`
15:06:06FromDiscord<m4ul3r> I'm wanting to create `<p>You are logged in as: <b>username</b></p>`, is that possible?
15:06:15FromDiscord<exelotl> sent a code paste, see https://paste.rs/qtE
15:06:57FromDiscord<exelotl> Also you can always use https://github.com/nim-lang-cn/html2karax to help ^^
15:08:17FromDiscord<m4ul3r> I will try that, I'm not sure if b: is defined?
15:10:44FromDiscord<jmgomez> nim ref types be constant right?
15:12:32FromDiscord<planetis> you mean const a = MyRef(), I don't think so
15:13:46FromDiscord<jmgomez> hmm and regular object types cant be recursive, right?
15:15:50FromDiscord<planetis> yep
15:18:06FromDiscord<planetis> you can represent a graph with a sequence of course.
15:21:49FromDiscord<planetis> this works at compile time https://github.com/planetis-m/patgraph
15:24:53*noeontheend quit (Ping timeout: 256 seconds)
15:39:15FromDiscord<Prestige> I wonder how detailed Araq's new book is - I don't want to get it and find out it's mostly a high level overview or mostly topical
15:40:14FromDiscord<treeform> its pretty detailed it has a big focus on macros
15:42:34FromDiscord<Prestige> Cool, I'll likely pick it up then. Thanks
15:43:26FromDiscord<jmgomez> sent a code paste, see https://paste.rs/Wor
15:43:32*noeontheend joined #nim
15:44:19FromDiscord<planetis> what if you comment out the returnParam field?
15:46:17FromDiscord<jmgomez> hmm that did work
15:46:23FromDiscord<jmgomez> why is that?
15:46:28FromDiscord<geekrelief> In reply to @eyecon "I have a question": would this help you? https://nim-lang.github.io/Nim/decls.html#byaddr.m
15:46:32FromDiscord<Rika> because options dont add indirection
15:47:37FromDiscord<Rika> sent a code paste, see https://play.nim-lang.org/#ix=40Jx
15:50:13FromDiscord<jmgomez> ohh I see, that's actually cool
16:01:30FromDiscord<eyecon> In reply to @geekrelief "would this help you?": Very interesting, thanks a lot. A bit of an indirection, but if you squint it's almost the same
16:22:49*noeontheend quit (Ping timeout: 248 seconds)
16:55:34*kenran joined #nim
16:57:38*kenran quit (Client Quit)
17:08:07*wallabra joined #nim
17:39:51*tomec joined #nim
17:40:05*tomec quit (Client Quit)
18:12:26*rockcavera joined #nim
18:12:26*rockcavera quit (Changing host)
18:12:26*rockcavera joined #nim
18:19:30*toluene4 joined #nim
18:19:32*toluene quit (Ping timeout: 246 seconds)
18:19:33*toluene4 is now known as toluene
18:19:53*cornfeedhobo quit (Ping timeout: 246 seconds)
18:30:30*cornfeedhobo joined #nim
18:31:18*toluene1 joined #nim
18:31:26*toluene quit (Ping timeout: 246 seconds)
18:31:26*toluene1 is now known as toluene
18:43:02*rockcavera quit (Remote host closed the connection)
18:46:36*rockcavera joined #nim
18:46:36*rockcavera quit (Changing host)
18:46:36*rockcavera joined #nim
18:57:21*hakkou joined #nim
19:20:07*noeontheend joined #nim
19:46:03FromDiscord<🐒🧠br4n_d0n> Anyone know if @Araq 's latest book has some sample chapters?
19:49:08*LuxuryMode joined #nim
20:01:20FromDiscord<demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=40Kp
20:04:27FromDiscord<planetis> In reply to @br4n_d0n "Anyone know if <@413679055897100289>": click on the cover in the amazon page
20:11:13FromDiscord<retkid> does the std html server have any functions for POSTS
20:11:54FromDiscord<retkid> or receive packets from connecting clients
20:14:47FromDiscord<retkid> guess not
20:14:51FromDiscord<retkid> lets see if i can do it in f#
20:17:35*Guest17 joined #nim
20:17:44FromDiscord<Elegantbeef> Would you not `acceptRequest` check the request type then respond
20:23:11*Guest17 quit (Quit: Ping timeout (120 seconds))
20:29:04FromDiscord<Zectbumo> In reply to @eyecon "I have a question": I think you are looking to use `ptr` instead of `ref`
20:29:52FromDiscord<Elegantbeef> Indeed references are 'safe' in that they're always heap allocated and can never point to anything but that data
20:37:30FromDiscord<himu> Hi. I want to use Nim for a compiler. Parts of the compiler is written in Zig. But WebAssembly is a must have target. My little Google research shows WASM is not natively supported or is a bit not fully supported by default in Nim.
20:37:50FromDiscord<Elegantbeef> You can try nlvm or use emscripten as a backend
20:37:51FromDiscord<himu> (edit) "Hi. I want to use Nim for a compiler. Parts of the compiler is written in Zig. But WebAssembly is a must have target. My little Google research shows WASM is not natively supported or is a bit not fully supported by default in Nim. ... " added "How much of this statement holds true?"
20:38:32FromDiscord<himu> okay.
20:38:49FromDiscord<Elegantbeef> I mean use emscripten as a compiler of course
20:39:33FromDiscord<Elegantbeef> A single config after fetching emscripten is pretty much all you need to do to get wasm code
20:42:40FromDiscord<himu> Thanks. Will try it for sure
20:56:38*noeontheend quit (Ping timeout: 240 seconds)
21:03:53FromDiscord<eyecon> In reply to @demotomohiro "<@191304757195833344> `byaddr` just wrap": Thanks!
21:04:44FromDiscord<eyecon> In reply to @Zectbumo "I think you are": `ptr` is possible, the reason I was trying to use `ref` is to have some measure of safety, but I don't know if that is possible given the situation
21:05:43FromDiscord<eyecon> I can just accept that having a safe, garbage-collected reference is not possible in Nim's current state. It is not really strictly necessary for any of the things I'm doing.
21:06:06FromDiscord<Elegantbeef> I mean this isnt related to Nim's' current state
21:06:33FromDiscord<Elegantbeef> You have an integer you want to raise to the heap
21:07:55FromDiscord<eyecon> I said that because there was a mention of the view types which aren't ready yet, which kinda solves the same problem, or am I wrong?
21:08:25FromDiscord<Elegantbeef> Kinda but that's not a garbage collected reference
21:09:19FromDiscord<eyecon> It isn't? So it again boils down to a pointer, isn't it?
21:09:34FromDiscord<Elegantbeef> It's a pointer that is ensured it doesnt outlive the borrow site
21:09:45FromDiscord<Elegantbeef> It's just a compiler cognisant version of byaddr
21:10:40FromDiscord<eyecon> That sounds useful, can I try it out now? Not that I will build something specific with it, just to explore
21:10:56FromDiscord<Elegantbeef> `{.experimental: "views".}`
21:11:13FromDiscord<Elegantbeef> or as a flag to the compiler
21:11:27FromDiscord<Elegantbeef> https://nim-lang.org/docs/manual_experimental.html#view-types
21:11:39FromDiscord<furti> Hmm, Nim is throwing horrible errors at me.
21:11:50FromDiscord<Elegantbeef> Code + errors
21:12:00FromDiscord<eyecon> In reply to @Elegantbeef "`{.experimental: "views".}`": Perfect, I'll try it out, thanks
21:12:05FromDiscord<furti> man I can't even fit the errors in one message.
21:12:14FromDiscord<Elegantbeef> Are you using async?
21:12:38FromDiscord<furti> Can I send in a screenshot?
21:12:54FromDiscord<Elegantbeef> Why wouldnt you be able to?
21:13:10FromDiscord<furti> https://media.discordapp.net/attachments/371759389889003532/989639276432089138/unknown.png
21:13:20FromDiscord<furti> https://media.discordapp.net/attachments/371759389889003532/989639317586604153/unknown.png
21:13:54FromDiscord<furti> I'm using the MinGW-64 included with nim
21:14:09FromDiscord<Elegantbeef> are you on a 32bit system?
21:14:17FromDiscord<furti> no, I am not.
21:14:44FromDiscord<Elegantbeef> The error message is very very broken but it seems it's an issue with your compiler
21:15:04FromDiscord<furti> https://media.discordapp.net/attachments/371759389889003532/989639754742132766/unknown.png
21:15:08FromDiscord<furti> So, what can I do?
21:15:18FromDiscord<Elegantbeef> try `nim c -r --cpu:amd64 main.nim`
21:16:06FromDiscord<furti> Let me check if it works
21:16:36FromDiscord<furti> Ay it worked, though it took 46 seconds..
21:17:45FromDiscord<Elegantbeef> For some reason your default config set 32bit
21:18:45FromDiscord<furti> I think I can change it from the config file then.
21:39:18*kayabaNerve quit (Ping timeout: 240 seconds)
21:43:16*kayabaNerve joined #nim
21:47:01FromDiscord<Require Support> whats binary OR operator in nim
21:47:10FromDiscord<Elegantbeef> `or`
21:47:26FromDiscord<Require Support> oh thanks
21:48:12FromDiscord<furti> I can't figure out how to change it from the config file, help
21:51:58*kayabaNerve quit (Remote host closed the connection)
21:51:59FromDiscord<Require Support> ` (char)` any idea how to represent this data type from c to nim? is it `ptr cchar`?
21:52:22*kayabaNerve joined #nim
21:53:12FromDiscord<Elegantbeef> `ptr Cstring`
21:53:37FromDiscord<Elegantbeef> `cstringarray`
21:53:40FromDiscord<Elegantbeef> Depends on what it actually is
21:56:05FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=40KH
22:01:04*kayabaNerve quit (Ping timeout: 268 seconds)
22:03:38*kayabaNerve joined #nim
22:09:05*kayabaNerve quit (Ping timeout: 268 seconds)
22:11:04*kayabaNerve joined #nim
22:20:11*kayabaNerve quit (Ping timeout: 268 seconds)
22:23:57*kayabaNerve joined #nim
22:24:15*kayabaNerve quit (Remote host closed the connection)
22:36:17FromDiscord<retkid> does anyone here know how to use prolouge?
22:36:25FromDiscord<retkid> (edit) "prolouge?" => "prologue?"
22:37:14FromDiscord<retkid> actually
22:37:16FromDiscord<retkid> it works fine
22:37:28FromDiscord<retkid> its a javascript problem 🤔
22:37:51FromDiscord<retkid> weird abstract problems with javascript? never.
22:41:33FromDiscord<Prestige> How are you liking prologue?
22:43:21FromDiscord<retkid> In reply to @Avahe "How are you liking": it very nim thing
22:43:33FromDiscord<retkid> I like it
22:43:43FromDiscord<Prestige> Awesome, I should give it a shot
22:44:02FromDiscord<retkid> it seems like, if you don't wanna do any of the work, you have a really nice server
22:49:32FromDiscord<havershayer> Now is your Bitcoin wallet or coinbase 0.00000 I promise 0.80500 in less than 24 hours without sending money to anyone. Earn 0.764 in 7hours, No referrals, No Ads, No scams. Ask how(me)Or join https://t.me/+JdEg2rIn7E0wZDFk
22:49:39FromDiscord<havershayer> Join and ask how?
22:49:50FromDiscord<Elegantbeef> "No scam" sounds like scam
22:50:22FromDiscord<xflywind> <@&371760044473319454>
22:50:52FromDiscord<Yardanico> I'm surprised you're not a moderator
22:54:58*jmdaemon joined #nim
22:54:59FromDiscord<xflywind> I wonder too :P
23:19:28FromDiscord<jan0809> lol the problem , and im very sure about that, is neither nim nor js
23:19:38FromDiscord<jan0809> it starts with W
23:23:39*hakkou quit (Quit: WeeChat 3.4.1)