<< 04-06-2021 >>

00:11:11*Gustavo6046 quit (Quit: ZNC 1.8.2 - https://znc.in)
00:11:31*Gustavo6046 joined #nim
00:14:01*Rudd07 joined #nim
00:14:02*Rudd07 quit (Read error: Connection reset by peer)
00:28:17FromDiscord<Rainbow Asteroids> what is tls emulation
00:38:09*Gustavo6046_ joined #nim
00:38:37*Gustavo6046 quit (Ping timeout: 248 seconds)
00:39:50*Gustavo6046_ is now known as Gustavo6046
00:41:47FromDiscord<Varriount> In reply to @Rainbow Asteroids "what is tls emulation": Thread-local storage emulation. Essentially a way to store per-thread global data.
00:42:23FromDiscord<Varriount> Or rather, a way to emulate reading/writing per-thread global data.
00:42:31FromDiscord<Varriount> (edit) "store" => "read/write"
00:48:53*Tanger joined #nim
00:56:27*nphg1 joined #nim
00:59:30*nphg quit (Ping timeout: 252 seconds)
01:01:42*dv^_^_ quit (Ping timeout: 252 seconds)
01:04:27*IgorA3-t joined #nim
01:04:56*IgorA3-t quit (Remote host closed the connection)
01:07:29*NimBot joined #nim
01:08:39*dv^_^ joined #nim
01:16:54*Gigs0 joined #nim
01:16:55*Gigs0 quit (Read error: Connection reset by peer)
01:30:00*xet7 quit (Remote host closed the connection)
01:30:45*xet7 joined #nim
01:35:01FromDiscord<ElegantBeef> Well if anyone wants to give me more critiques on this, that'd be great 😄 https://github.com/beef331/sumtypes
01:39:59Prestige@ElegantBeef woah that's awesome
01:41:04FromDiscord<ElegantBeef> Thanks, just a basic object variant generator, contemplating making an RFC to see if it'd be wanted in fusion but still debating that one
01:45:08FromDiscord<ElegantBeef> Comically it started off as a heterogeneous sequence generator, but i then quickly learned that i was abstracting the variant more than the seq, so modified it to emit variants
01:50:38FromDiscord<ElegantBeef> Maybe one day prestige i'll accidentally make MI 😛
01:50:56PrestigeLol I'm pretty sure I'd have to edit the compiler so idk
01:51:01Prestigemaybe nim 3.0
01:51:27FromDiscord<ElegantBeef> I dont know might be possible with macros although hellish 😛
01:51:47FromDiscord<ElegantBeef> Would rather spend time working on my new concept backed interfaces though
01:53:24*l0rd3 joined #nim
01:53:57*l0rd3 quit (Remote host closed the connection)
02:03:05*arkurious quit (Quit: Leaving)
02:04:13*Starvirus14 joined #nim
02:04:56*Starvirus14 quit (Remote host closed the connection)
02:23:41FromDiscord<exelotl> In reply to @Varriount "Thread-local storage emulation. Essentially": Oh I legit thought it was "transport layer security" emulation 😅
02:26:14FromDiscord<Rainbow Asteroids> same
02:33:08*Cesarr16 joined #nim
02:33:11*Cesarr16 quit (Remote host closed the connection)
02:41:06*rjsalts9 joined #nim
02:41:38*rjsalts9 quit (Remote host closed the connection)
02:46:33*sz0 quit (Quit: Connection closed for inactivity)
03:35:42*blacops joined #nim
03:35:49*blacops quit (Remote host closed the connection)
03:51:05FromDiscord<Bung> bot does not classify this better send to #gamedev
03:53:48*spiderstew joined #nim
03:55:21*spiderstew_ quit (Ping timeout: 260 seconds)
04:07:15*letto_ quit (Quit: Konversation terminated!)
04:09:26*letto joined #nim
04:15:04*bmlzootown_4 joined #nim
04:15:21*bmlzootown_4 quit (Remote host closed the connection)
04:36:09*^Q-Master^ joined #nim
04:36:20*Q-Master quit (Ping timeout: 272 seconds)
04:37:56*Kumool joined #nim
04:48:06FromDiscord<Bung> how to use https://nim-lang.org/docs/highlite.html#deinitGeneralTokenizer%2CGeneralTokenizer , I dont see there's api convert code block directly to html ,I thought I only need turn code to html then inlcude some css files, or it generated emebed styles
05:42:36*narimiran joined #nim
05:51:06*kabaum23 joined #nim
05:51:24*kabaum23 quit (Remote host closed the connection)
05:52:53FromDiscord<Bung> nvm, the apis just low level as this.
06:07:04FromDiscord<codic> sent a long message, see http://ix.io/3oHW
06:07:47FromDiscord<codic> (edit) "sent" => "I've been littering ref object everywhere so I decided to refresh my mind on it, is this correct?↵ - `type X = object`: X is stack allocated ↵ - `type X = ref object`: X is heap allocated with" | "long message, see http://ix.io/3oHW" => "reference ( traced ptr ) stored on the stack"
06:08:10FromDiscord<ElegantBeef> yes
06:18:17FromDiscord<Bung> `<code class="language-nim" data-lang="nim"><span class="k">import</span> <span class="n">strformat</span>↵` how the offical site turn token kind to abbreviation?I want use same syntax highlight color theme.
06:29:53*azazel joined #nim
06:30:33*azazel quit (Remote host closed the connection)
06:41:51*kip18 joined #nim
06:42:09*kip18 quit (Remote host closed the connection)
06:45:25*Vladar joined #nim
06:55:50FromDiscord<Varriount> In reply to @Bung "`<code class="language-nim" data-lang="nim"><span c": Can you explain a bit more?
06:59:23FromDiscord<Rainbow Asteroids> Maybe he's talking about the syntax highlighting in the examples on the <https://nim-lang.org> frontpage? https://media.discordapp.net/attachments/371759389889003532/850267471364620298/2021-06-04-025854.png
07:09:45*zsoltiv joined #nim
07:16:01FromDiscord<ElegantBeef> Should this work? https://play.nim-lang.org/#ix=3oI8
07:18:18FromDiscord<System64 ~ Flandre Scarlet> In reply to @ElegantBeef "Well line 36 to": I still have theses errors https://media.discordapp.net/attachments/371759389889003532/850272228989730867/unknown.png
07:18:56FromDiscord<ElegantBeef> Look at the C source and see where that stuff is
07:19:14zsoltivhi, i'm having trouble with handling form data with jester. i'm sending a POST request with an html form, to the /search endpoint, however it just throws a 404. this is the code i'm trying right now: https://dpaste.com/96KNLZ4SS. what can i do to fix it?
07:19:34zsoltivusing curl to send the request doesn't seem to work either
07:19:36FromDiscord<System64 ~ Flandre Scarlet> In reply to @ElegantBeef "Look at the C": the header file or the code itself?
07:19:44FromDiscord<ElegantBeef> Header file
07:20:37FromDiscord<System64 ~ Flandre Scarlet> https://media.discordapp.net/attachments/371759389889003532/850272815697362964/unknown.png
07:20:51FromDiscord<ElegantBeef> So find the issue, seems it's casing again
07:20:51FromDiscord<System64 ~ Flandre Scarlet> I think it's that
07:23:20FromDiscord<System64 ~ Flandre Scarlet> I don't think Nim supports structs
07:23:33FromDiscord<ElegantBeef> It does but it calls them objects
07:24:02FromDiscord<ElegantBeef> The issue seems to just be the naming
07:24:15FromDiscord<ElegantBeef> Seems you should learn nim a bit before carrying on
07:26:23FromDiscord<System64 ~ Flandre Scarlet> yeah↵About objets does it have the concept of classesN
07:26:25FromDiscord<System64 ~ Flandre Scarlet> (edit) "classesN" => "classes?"
07:26:48FromDiscord<ElegantBeef> It doesnt have classes but has reference types and dynamic dispatch
07:29:06FromDiscord<ElegantBeef> So you can do inheritance and override methods
07:33:25FromDiscord<System64 ~ Flandre Scarlet> And do I necessary need Pointers ?
07:34:54FromDiscord<System64 ~ Flandre Scarlet> I'm afraid of them lol
07:35:02ForumUpdaterBotNew question by No Name: How to read N bytes from file?, see https://stackoverflow.com/questions/67833182/how-to-read-n-bytes-from-file
07:38:10FromDiscord<Rika> In reply to @System64 "And do I necessary": you dont need to think about them until you're at the stage where you know how to deal with them
07:38:18FromDiscord<Rika> (unless you're going too fast)
07:38:46FromDiscord<Rika> ref objects are "pointers" but managed by nim's GC so dont worry
07:41:01FromDiscord<System64 ~ Flandre Scarlet> And when I interop with a C lib ?
07:41:35FromDiscord<ElegantBeef> You need pointers but only when you send stuff to C
07:42:02FromDiscord<System64 ~ Flandre Scarlet> Alright so I guess it's not too hard ?
07:42:17FromDiscord<Rika> yes
07:43:29FromDiscord<Varriount> Araq: Checked out the paper on mimalloc, it's always interesting to read how these allocators are implemented.
07:43:40FromDiscord<System64 ~ Flandre Scarlet> Ah interesting
07:55:07ForumUpdaterBotNew question by hoijui: How to modularize/abstract away os.walkDir and os.walkDirRec - Nim, see https://stackoverflow.com/questions/67833490/how-to-modularize-abstract-away-os-walkdir-and-os-walkdirrec-nim
07:58:16*D4nthr4x joined #nim
07:58:38*D4nthr4x quit (Remote host closed the connection)
08:13:34*Pauli1 joined #nim
08:13:41*Pauli1 quit (Remote host closed the connection)
08:23:24*johnnynitwits quit (Quit: Bridge terminating on SIGTERM)
08:24:08ForumUpdaterBotNew thread by Wag: Io.writeBytes works correctly?, see https://forum.nim-lang.org/t/8081
08:24:39*johnnynitwits joined #nim
08:28:30*PMunch joined #nim
08:33:22*johnnynitwits quit (Quit: Bridge terminating on SIGTERM)
08:33:50*johnnynitwits joined #nim
08:36:21*Morfall[m]18 joined #nim
08:36:24*Morfall[m]18 quit (Remote host closed the connection)
08:40:42*mkbloke6 joined #nim
08:40:44*mkbloke6 quit (Remote host closed the connection)
08:49:08*lucerne joined #nim
08:50:31zsoltivwhy does jester throw 404s on defined routes? for example, if i try to do a GET /foo, it gives me a 404 even though i have code for handling it (resp "bar)". is this a bug or am i missing something?
08:51:10PMunchHard to tell without some code zsoltiv
08:54:59zsoltivsorry, here is the code: https://dpaste.com/87APD3R4F
08:55:46PMunchWorks fine here..
08:55:52PMunchNote that Jester defaults to port 5000
08:56:05PMunchSo you need to go to localhost:5000/foo
08:56:19FromDiscord<Rika> well theyd prolly know that because theyre getting a response
08:56:38FromDiscord<Rika> wow my internet is so fast that sent in under a minute
08:56:38PMunchFair point
08:57:26PMunchThis is the log I got zsoltiv from trying to navigate my browser to localhost:5000/foo http://ix.io/3oIw. Note the second request to /favicon.ico which 404's
08:59:38zsoltivoh, i wrote too 'fooo' instead of foo :D
08:59:41zsoltivnevermind
08:59:48FromDiscord<Rika> lol
08:59:51PMunchHaha, yeah that won't work :P
09:03:01PMunchzsoltiv, try with `get re"^\/foo*$"` :P
09:03:14PMunchMatches foo, fooo, foooo, etc.
09:03:53FromDiscord<ElegantBeef> Strings were a mistake
09:03:54FromDiscord<Rika> and fo
09:04:26*Vladar quit (Remote host closed the connection)
09:04:27FromDiscord<Rika> same
09:04:58PMunch@Rika, no it doesn't match fo
09:05:09PMunch@ElegantBeef, huh?
09:05:54zsoltivalso, how do i handle html form data? is it just '/search/?@query'?
09:05:55FromDiscord<ElegantBeef> Just joking about string related issues
09:06:16FromDiscord<kintrix> In reply to @PMunch "<@259277943275126785>, no it doesn't": why wouldn't it match fo
09:06:35FromDiscord<kintrix> `` means 0 or more
09:06:45FromDiscord<kintrix> `+` means 1 or more
09:06:54PMunchOh shit, you're right
09:07:13PMunchI had it as fo* in my testing and changed it to foo* to avoid that, forgetting that * matches 0 or more
09:07:28PMunchBut you're right, it should be +
09:07:28FromDiscord<kintrix> ¯\\_(ツ)\_/¯
09:07:33FromDiscord<kintrix> ype
09:07:37FromDiscord<kintrix> (edit) "ype" => "yep"
09:08:08FromDiscord<ElegantBeef> And you wonder why i said strings were a mistake
09:08:31PMunch@zsoltiv, you don't have to specify it in the route, but you can access it with `request.formData`
09:08:35*aeverr_ joined #nim
09:09:22*aeverr quit (Ping timeout: 252 seconds)
09:10:13FromDiscord<Rika> smh
09:10:25FromDiscord<Rika> telling me im wrong when its really you who's wrong smh
09:11:07FromDiscord<kintrix> In reply to @ElegantBeef "And you wonder why": Well, I personally love regex :P↵But I'm not gonna deny that
09:11:08zsoltivPMunch: oh i see, thanks
09:13:48PMunchJester really should have some better tutorials/documentation
09:15:25*Retro64XYZ15 joined #nim
09:15:47*Retro64XYZ15 quit (Remote host closed the connection)
09:19:17zsoltivyeah
09:33:21*zcos[m|gr] joined #nim
09:33:46*zcos[m|gr] quit (Remote host closed the connection)
09:40:51FromDiscord<System64 ~ Flandre Scarlet> About Arrays, are there ArrayLists ?
09:42:26PMunchWhat would an ArrayList be?
09:42:43FromDiscord<kintrix> You mean...?↵An array of lists?↵Or just a variable sized array
09:43:10FromDiscord<System64 ~ Flandre Scarlet> Second one
09:43:15FromDiscord<System64 ~ Flandre Scarlet> Like java
09:43:17FromDiscord<kintrix> There is seq, if you want that.
09:43:26FromDiscord<System64 ~ Flandre Scarlet> It's the same thing ?
09:43:35FromDiscord<kintrix> It's sequences
09:43:40FromDiscord<kintrix> yu ocan add items to it
09:43:47FromDiscord<kintrix> and it doesn't hvae a set size
09:43:53FromDiscord<System64 ~ Flandre Scarlet> Ah so I can't change the order, can I ?
09:43:54FromDiscord<kintrix> (edit) "hvae" => "have"
09:44:20FromDiscord<kintrix> You can, by assigning to certain indeces...?
09:44:31FromDiscord<haxscramper> Or using `swap`
09:44:48FromDiscord<System64 ~ Flandre Scarlet> Ah so I can use it like a Java or C# ArrayLists ?
09:45:02FromDiscord<ElegantBeef> It's a dynamically grown array, so yes
09:45:43PMunchIf you want to do a lot of re-ordering though you might want to have a look at LinkedLists
09:45:44FromDiscord<System64 ~ Flandre Scarlet> Oh nice !
09:46:13PMunchBut if you only do a couple or none at all then a sequence is better for performance
09:46:21FromDiscord<System64 ~ Flandre Scarlet> Ah yeah LinkedList are good too, but I have to read it from begining
09:46:43PMunchUhm, you can read a linked list from the beginning
09:47:08FromDiscord<Rika> i think he means that the caveat is he has to read from beginning
09:47:28PMunchNo you don't..
09:47:35PMunchJust keep a reference to the node where you want to start
09:47:47FromDiscord<System64 ~ Flandre Scarlet> Oh I see
09:48:02PMunchSure, it's not indexable, but if you just need to start from a certain point just keep a reference to the node around
09:48:10FromDiscord<System64 ~ Flandre Scarlet> I didn't used LinkedList a lot lol
09:48:12PMunchYou could also make a finger table
09:48:23FromDiscord<System64 ~ Flandre Scarlet> What's that ?
09:48:30*Tanger quit (Ping timeout: 258 seconds)
09:48:59PMunchYou know how you insert your fingers into a book as impromptu bookmarks to flip between pages easily?
09:49:05PMunchIt's like that, just for linked lists :P
09:49:13FromDiscord<System64 ~ Flandre Scarlet> Oh I see !
09:50:25PMunchBasically just a collection of points in the list. So if you want to go to index 15 you can look in the finger table and find the closest index, say 12, and then go from there instead of from the beginning
09:50:50FromDiscord<ElegantBeef> Thought we were going to learn about Pmunch's Norwegian serial murder table made of human fingers 😄
09:51:14FromDiscord<System64 ~ Flandre Scarlet> I guess Python lists are implémented like that ?
09:51:55PMunchHmm, Google has failed me, not a single picture of a table made from fingers..
09:52:12FromDiscord<ElegantBeef> Ah so you're sole owner? Must be worth money
09:52:15FromDiscord<Rika> pmunch: so almost like skiplists?
09:52:55PMunch@Rika, probably. Not quite sure what the differences are, if there are any
09:53:43PMunchSkiplists seems to be for ordered data
09:56:03PMunchPython lists seems to be implemented in a similar way to Nim seqs
09:56:18PMunchThey appear to have O(1) indexing
09:56:32PMunchAre you french by the way?
09:56:56PMunchOr wait, possibly Belgian from the Flandre part :P
09:57:51PMunchAh yes: https://en.wikipedia.org/wiki/Dynamic_array Python PyListObject is a dynamic array with a weird growth factor :P
09:59:15PMunchWhat's the growth factor of Nim seqs?
09:59:30FromDiscord<Rika> flandre scarlet is a character in touhou
09:59:41FromDiscord<Rika> In reply to @PMunch "What's the growth factor": i was pretty sure it was 2x
10:00:01PMunch2 is pretty common, it's what I've assumed as well
10:00:36PMunchAh right, the "are you french" thing was mostly prompted by the é in implemented though
10:09:18FromDiscord<System64 ~ Flandre Scarlet> In reply to @PMunch "Or wait, possibly Belgian": Effectively I'm from belgian but Flandre Scarlet is a well known Touhou Project character
10:10:14PMunchOh cool, I lived a year in Liege
10:10:52FromDiscord<System64 ~ Flandre Scarlet> Oh interesting
10:11:16PMunchWhere in Belgium are you from?
10:11:46FromDiscord<System64 ~ Flandre Scarlet> I prefer not saying it
10:11:52PMunchOh sure
10:12:00PMunchI was just curious :P
10:12:11FromDiscord<System64 ~ Flandre Scarlet> Don't worry
10:17:51FromDiscord<System64 ~ Flandre Scarlet> It's the equivalent of a struct right? https://media.discordapp.net/attachments/371759389889003532/850317411256238080/unknown.png
10:19:23FromDiscord<Rika> yes
10:20:45FromDiscord<System64 ~ Flandre Scarlet> oh I see, thannks!
10:22:51FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=3oIR
10:30:49FromDiscord<Rika> do you know what struct Spriteset is?
10:30:53FromDiscord<Rika> or rather wehre it is
10:33:01FromDiscord<System64 ~ Flandre Scarlet> I found it in the header file
10:33:28FromDiscord<kintrix> In reply to @System64 "It's the equivalent of": I'm not 100% sure, but it's probably better, or at least easier to use `string` instead of `array[64, char]`
10:34:12FromDiscord<System64 ~ Flandre Scarlet> In reply to @kintrix "I'm not 100% sure,": I try to interop with a C dll
10:34:13FromDiscord<kintrix> I'm not sure if Nim has syntactic sugar for character arrays :P
10:34:27FromDiscord<kintrix> In reply to @System64 "I try to interop": my bad 😅
10:34:57FromDiscord<System64 ~ Flandre Scarlet> and I have a lot of trouble with it lol
10:35:22*kbeckmann[m|gr] joined #nim
10:35:50*kbeckmann[m|gr] quit (Remote host closed the connection)
10:42:54FromDiscord<System64 ~ Flandre Scarlet> weird, it's already declared https://media.discordapp.net/attachments/371759389889003532/850323719972192266/unknown.png
10:47:06FromDiscord<whisperdev> What would be the best way to IPC with a Go tool? I need to write a simple torrent client in Go and there dont seem to be libs for that for Nim (and writing those for me is beyond my skills)
10:51:18FromDiscord<Varriount> Araq: Will using mimalloc complicate plans for threading?
10:52:30FromDiscord<Varriount> In reply to @whisperdev "What would be the": Generally reading/writing to standard input/output.
10:59:30FromDiscord<InventorMatt> Araq usually uses his discord account now so you may want to @ him directly
11:02:39*motersen quit (Remote host closed the connection)
11:02:58*motersen joined #nim
11:14:22*Vladar joined #nim
11:19:05FromDiscord<zetashift> In reply to @whisperdev "What would be the": you could use https://github.com/jangko/msgpack4nim
11:29:05*Rodeo joined #nim
11:29:36*Rodeo quit (Remote host closed the connection)
11:31:05*azlev_ joined #nim
11:31:12*azlev_ quit (Read error: Connection reset by peer)
11:40:36*aeverr_ quit ()
11:40:55zsoltivhow do i pass multiple options to -d when compiling? is separating them with commas enough?
11:41:06*aeverr_ joined #nim
11:41:34narimiranzsoltiv: -d:this -d:that
11:41:42*aeverr_ quit (Client Quit)
11:41:43zsoltivoh okay
11:41:45zsoltivthanks
11:42:13*aeverr joined #nim
11:57:16*motersen quit (Remote host closed the connection)
11:57:28*motersen joined #nim
12:02:22*arkurious joined #nim
12:10:56*vsantana joined #nim
12:22:05*narimiran quit (Ping timeout: 248 seconds)
12:30:49*zsoltiv quit (Quit: zsoltiv)
12:42:16*[vxp] joined #nim
12:42:52*[vxp] quit (Remote host closed the connection)
12:44:32*icerider2-m13 joined #nim
12:44:46*icerider2-m13 quit (Remote host closed the connection)
13:04:26*zsoltiv joined #nim
13:08:57*fantis quit (Remote host closed the connection)
13:09:56*fantis joined #nim
13:20:30FromDiscord<Airbus5717> wth https://media.discordapp.net/attachments/371759389889003532/850363381042380830/unknown.png
13:20:35FromDiscord<Airbus5717> WHere did my code go?!!!
13:20:39FromDiscord<Airbus5717> in spacevim
13:21:01FromDiscord<Airbus5717> it was https://media.discordapp.net/attachments/371759389889003532/850363513423265812/unknown.png
13:21:21PMunchHaha, it's folded up
13:21:41FromDiscord<Recruit_main707> Me using vim ^
13:21:55FromDiscord<Airbus5717> hmm i moved the cursor it came back
13:22:02FromDiscord<Airbus5717> but why is this?
13:22:04PMunchYup, it's just folded
13:22:10PMunchRead the spacevim documentation :P
13:22:18FromDiscord<Recruit_main707> It’s a feature
13:22:21PMunchOr hit z E I believe
13:22:33PMunchThat is `z E`
13:23:05PMunch(You see that small + in your left gutter? That means the code is folded)
13:23:38FromDiscord<Airbus5717> shift A worked
13:33:22FromDiscord<System64 ~ Flandre Scarlet> How can I fix that please? https://media.discordapp.net/attachments/371759389889003532/850366620462350366/unknown.png
13:37:17PMunchWhat do you expect SDL_Event* = sDL_Event to do?
13:38:45PMunchAnd not sure where you write `player1` but Nim is case sensitive for the first character, so PLAYER1 is the same as Player1, but not player1.
13:40:36FromDiscord<System64 ~ Flandre Scarlet> I try to interop with a C lib and I used c2nim on a header file
13:43:21PMunchWhat's the header?
13:44:48FromDiscord<System64 ~ Flandre Scarlet> https://media.discordapp.net/attachments/371759389889003532/850369497025216572/Tilengine.h
13:44:58FromDiscord<System64 ~ Flandre Scarlet> this one
13:45:15*deutor_ joined #nim
13:45:54*deutor_ quit (Remote host closed the connection)
13:45:58PMunchHmm, that file doesn't seem to have worked over the Discord bridge..
13:46:28FromDiscord<System64 ~ Flandre Scarlet> ah I'll send a link, wait a second
13:47:08PMunchDon't worry, I found it
13:47:44PMunchIt seems to be this line that confuses c2nim: https://github.com/megamarc/Tilengine/blob/master/include/Tilengine.h#L262
13:48:06*narimiran joined #nim
13:48:44PMunchAnd all that does is to create a type alias for `union SDL_Event`
13:49:12FromDiscord<System64 ~ Flandre Scarlet> how can I fix that so?
13:49:43PMunchIt doesn't seem to really be used for anything. Maybe just try and delete it?
13:50:28FromDiscord<System64 ~ Flandre Scarlet> I think I need it for the binding↵It's dependent of SDL2
14:11:21FromDiscord<System64 ~ Flandre Scarlet> And I'm afraid to break something
14:15:39*n4cht20 joined #nim
14:16:11*n4cht20 quit (Remote host closed the connection)
14:17:53*PMunch quit (Quit: leaving)
14:39:51*Baikonur19 joined #nim
14:39:56*Baikonur19 quit (Remote host closed the connection)
14:47:12*mjsir911 quit (Quit: Goodbye, World!)
14:48:17*mjsir911 joined #nim
15:02:53FromDiscord<codic> sent a code paste, see https://play.nim-lang.org/#ix=3oJW
15:03:04*Kumool left #nim ("Ploop")
15:12:18FromDiscord<Airbus5717> i want to install nimpretty
15:12:20FromDiscord<Airbus5717> how?
15:14:21FromDiscord<Rika> nimpretty is installed when you install nim
15:14:32*aeverr quit ()
15:15:39ForumUpdaterBotNew thread by Mrhdias: Issue when deploying a application with Nginx as a reverse proxy!, see https://forum.nim-lang.org/t/8082
15:25:28FromDiscord<Airbus5717> In reply to @Rika "nimpretty is installed when": hmm the apt pkg is pretty old
15:27:24*tane joined #nim
15:31:53*Zdiggler_ joined #nim
15:32:05*Zdiggler_ quit (Remote host closed the connection)
15:34:40*globs joined #nim
15:34:41*globs quit (Remote host closed the connection)
15:36:26*zsoltiv quit (Quit: zsoltiv)
15:36:40*zsoltiv joined #nim
15:41:23*zsoltiv quit (Client Quit)
15:41:37*zsoltiv joined #nim
15:43:02*zsoltiv quit (Client Quit)
15:43:15*zsoltiv joined #nim
15:44:30*zsoltiv quit (Client Quit)
15:44:45*zsoltiv joined #nim
15:47:30*zsoltiv quit (Client Quit)
15:47:47*zsoltiv joined #nim
15:49:01*zsoltiv quit (Client Quit)
15:49:17*zsoltiv joined #nim
15:50:08*zsoltiv quit (Client Quit)
15:50:21*zsoltiv joined #nim
15:50:23PrestigeYou might want to just use choosenim
15:51:42*mripx joined #nim
15:52:04*mripx quit (Remote host closed the connection)
15:58:33*zsoltiv quit (Quit: zsoltiv)
15:58:50*zsoltiv joined #nim
16:00:39*zsoltiv quit (Client Quit)
16:00:56*zsoltiv joined #nim
16:02:50FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3oK6
16:03:06FromDiscord<haxscramper> Automatic call insertion won't happen, so there would be no double destroy calls
16:14:37*arecaceae quit (Remote host closed the connection)
16:15:55*Cryowolf joined #nim
16:16:17*billCong joined #nim
16:16:24*Cryowolf quit (Remote host closed the connection)
16:16:41*billCong quit (Remote host closed the connection)
16:17:16*zsoltiv quit (Quit: zsoltiv)
16:20:16*arecaceae joined #nim
16:24:43FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=3oKd
16:34:59FromDiscord<haxscramper> `SDLEvent {.importc: "SDL_Event", bycopy.}`. You don't need to treat `union` differently
16:35:30FromDiscord<haxscramper> Since it is a uninon typedef it can be accessed only using `SDL_Event` in the C code, so nothing special here as well
16:35:45FromDiscord<System64 ~ Flandre Scarlet> ah so I don't need union?
16:37:23FromDiscord<haxscramper> Yes. Nim just generates `.field` access to wrapped elements, so it does not really matter I think
16:37:50FromDiscord<System64 ~ Flandre Scarlet> Not the case there https://media.discordapp.net/attachments/371759389889003532/850413043192168458/unknown.png
16:38:03FromDiscord<System64 ~ Flandre Scarlet> that's what C2Nim generated
16:38:33FromDiscord<haxscramper> well, it seems c2nim can't handle this correctly
16:38:58FromDiscord<System64 ~ Flandre Scarlet> so what should I do?
16:39:07FromDiscord<haxscramper> In reply to @haxscramper "`SDLEvent {.importc: "SDL_Event", bycopy.}`.": .
16:39:13FromDiscord<haxscramper> Write this part manually
16:40:20FromDiscord<System64 ~ Flandre Scarlet> Like that? https://media.discordapp.net/attachments/371759389889003532/850413674702176296/unknown.png
16:40:46FromDiscord<haxscramper> Of course you also need `= object` and fields.
16:41:33FromDiscord<haxscramper> Nim interop is about writing out type structure, so you just mirror C code to nim
16:41:49FromDiscord<haxscramper> `union/struct -> object`, `enum -> enum`
16:42:06FromDiscord<haxscramper> callback `-> proc .. {.cdecl.}`
16:42:21*narimiran quit (Ping timeout: 248 seconds)
16:42:40FromDiscord<haxscramper> `T -> ptr T`, `char -> cstring`, `char -> cstringArray` (and so on for all other types)
16:42:53FromDiscord<codic> In reply to @haxscramper "I think `=destroy` is": got it yeah, I think that arc is fine was just playing aroud
16:42:54FromDiscord<codic> (edit) "aroud" => "around"
16:43:08FromDiscord<System64 ~ Flandre Scarlet> I put "= object" it solved the error
16:43:26FromDiscord<haxscramper> `importc(pp)` and `header` to actually let nim work out `#include` parts and `bycopy` to use `C` argument passing semantics
16:44:46FromDiscord<System64 ~ Flandre Scarlet> I just have this error now https://media.discordapp.net/attachments/371759389889003532/850414786918744084/unknown.png
16:45:35FromDiscord<haxscramper> Port `player1` as `const` too
16:46:13FromDiscord<haxscramper> `const player1 = "Some C code value"`
16:46:51FromDiscord<System64 ~ Flandre Scarlet> there is an enum there https://media.discordapp.net/attachments/371759389889003532/850415310851014715/unknown.png
16:47:54FromDiscord<haxscramper> Put `const` before the enum?
16:48:54FromDiscord<System64 ~ Flandre Scarlet> const TLN_Player ... ?
16:48:56FromDiscord<haxscramper> This part won't work since nim does not allow duplicate enum values, you would need to do `const INPUT_A = input_button1` afterwards https://media.discordapp.net/attachments/371759389889003532/850415836048654396/unknown.png
16:48:56*ammar226 joined #nim
16:49:24FromDiscord<haxscramper> In reply to @System64 "const TLN_Player* ... ?": How `player1` is defined in C code?
16:49:27*ammar226 quit (Remote host closed the connection)
16:49:56FromDiscord<haxscramper> As an integer constant? Then put `const player1 = 12312` before `type TLN_Player ...`
16:50:19FromDiscord<haxscramper> As I said, nim wrapper code should mostly mirror C implementation, no specific changes must be made
16:51:54FromDiscord<haxscramper> (edit) "As I said, nim wrapper code should mostly mirror C implementation, no specific ... changesunless" added "structural/implementation" | "structural/implementationchanges must be made ... " added "unless you go for "cleanup" wrapper that also removes `SCREAM_SCASE` etc."
16:52:21FromDiscord<System64 ~ Flandre Scarlet> it's in caps in the header, maybe if I turn it to caps...
16:53:21FromDiscord<System64 ~ Flandre Scarlet> alright it's even worse
16:53:59FromDiscord<System64 ~ Flandre Scarlet> https://media.discordapp.net/attachments/371759389889003532/850417107291471953/unknown.png
16:54:13FromDiscord<haxscramper> no, that's better
16:54:24FromDiscord<System64 ~ Flandre Scarlet> I have more errors now
16:54:51FromDiscord<haxscramper> Those are different errors. You can't `shl` enum value in nim, but `PLAYER1` is now ported correctly
16:55:01FromDiscord<haxscramper> You might want to do `PLAYER1.int shl 2`
16:56:30FromDiscord<haxscramper> There is no implicit `enum -> int` conversion in nim so code like this might need some changes. I just got confused by the code with `player1 shl 2` and didn't realize it was another enum value and not some integer constant
16:57:00FromDiscord<System64 ~ Flandre Scarlet> and why shl 2 instead of 5?
16:57:22FromDiscord<haxscramper> `shl 5`
16:57:37FromDiscord<haxscramper> Just my typo
16:58:38FromDiscord<System64 ~ Flandre Scarlet> https://media.discordapp.net/attachments/371759389889003532/850418274907062322/unknown.png
17:00:25FromDiscord<haxscramper> https://nim-lang.org/docs/manual.html#types-enumeration-types "the ordinal values have to be in ascending order."
17:00:49FromDiscord<haxscramper> And no duplicates allowed. Reorder enums and move duplicates into separate `const` section
17:01:43FromDiscord<System64 ~ Flandre Scarlet> where are there duplicates?
17:02:53FromDiscord<haxscramper> In reply to @haxscramper "This part won't work": `INPUT_1`
17:03:41FromDiscord<System64 ~ Flandre Scarlet> did you meant "INPUT_P1"?
17:04:20*Guest94576 joined #nim
17:04:37FromDiscord<haxscramper> I put screenshot of the part I was talking about. `INPUT_A` and other parts that are defined as `input_Button1` (unless `input_Button1` is a separate constant value defined elsewhere)
17:04:52FromDiscord<haxscramper> (edit) "I put screenshot of the part I was talking about. `INPUT_A` and other parts that are defined as ... `input_Button1`" added "equal to"
17:05:22FromDiscord<haxscramper> What are you trying to wrap specifically? I.e can you give me the original C code?
17:06:01FromDiscord<System64 ~ Flandre Scarlet> sure
17:06:09FromDiscord<System64 ~ Flandre Scarlet> https://media.discordapp.net/attachments/371759389889003532/850420173340672020/Tilengine.h
17:09:20*hyiltiz quit (Ping timeout: 252 seconds)
17:09:50*hyiltiz joined #nim
17:09:50*hyiltiz quit (Changing host)
17:09:50*hyiltiz joined #nim
17:11:48FromDiscord<haxscramper> https://wandbox.org/permlink/nGRbXSmac4bXnWLB
17:12:26FromDiscord<haxscramper> `INPUT_P1 = (PLAYER1.int shl 5)` was a duplicate since `PLAYER1.int` is equal to zero, `0 shl 5` is still zero, and the value is the same as `INPUT_NONE`
17:14:10*nojeffrey joined #nim
17:14:19FromDiscord<System64 ~ Flandre Scarlet> and what is it in the header file?
17:14:27*nojeffrey quit (Remote host closed the connection)
17:14:43FromDiscord<haxscramper> your code
17:15:15FromDiscord<haxscramper> I just showed how you can map enum like this to nim code
17:16:47*Gustavo6046 quit (Quit: ZNC 1.8.2 - https://znc.in)
17:16:58FromDiscord<System64 ~ Flandre Scarlet> Ah so I should try to copy that?
17:22:00*vsantana quit (Quit: Leaving)
17:33:40FromDiscord<System64 ~ Flandre Scarlet> you also remplaced ``TLN_Input {.size: sizeof(cint).} = enum`` by ``TLN_Input {.importc: "TLN_Input"} = enum``, what does it change?
17:33:51*Gustavo6046 joined #nim
17:43:52FromDiscord<codic> sent a code paste, see https://play.nim-lang.org/#ix=3oKu
17:47:34PrestigeAnyone know a way to debug regex in Nim, or a playground that has the same matching? https://play.nim-lang.org/#ix=3oKv is not matching but the pattern works in https://regex101.com/r/IoOhJ8/1
17:47:58PrestigeI assume there are some slight differences that need to be made but I don't know what they would be
17:48:45Zevvreduce and simplify until it matches, and then grow it out agian
17:49:45FromDiscord<Bung> basically they share same rules
17:49:49*FromGitter quit (Remote host closed the connection)
17:50:06*FromGitter joined #nim
17:59:09FromDiscord<kintrix> also, with `r""`, you do not need to double escape backslashes
17:59:49FromDiscord<kintrix> As far as I know
17:59:51FromDiscord<kintrix> sent a code paste, see https://play.nim-lang.org/#ix=3oKz
18:00:02FromDiscord<System64 ~ Flandre Scarlet> Okay some progress! https://media.discordapp.net/attachments/371759389889003532/850433727644696636/unknown.png
18:00:02FromDiscord<kintrix> (edit) "https://play.nim-lang.org/#ix=3oKz" => "https://play.nim-lang.org/#ix=3oKA"
18:00:52PrestigeI can't seem to use r with the regex pattern
18:02:02FromDiscord<kintrix> Also, it might be the `.+` part
18:02:08FromDiscord<kintrix> as the `+` is greedy
18:02:23FromDiscord<kintrix> so `.+` most likely matches the whole part thing left
18:02:27FromDiscord<kintrix> for example
18:02:47PrestigeIf I add .* to the start and end of the pattern, it finds the id I'm searching for when using the =~ template
18:03:22FromDiscord<kintrix> sent a code paste, see https://play.nim-lang.org/#ix=3oKD
18:03:55FromDiscord<kintrix> I'm not sure this is the error, but it might be related \:P
18:04:06FromDiscord<kintrix> So I'm just telling it, in case it might help
18:04:07Prestigehttps://play.nim-lang.org/#ix=3oKE
18:04:10PrestigeYeah
18:04:32PrestigeI think the problem might be how I'm searching for matches.. Don't want to have to wrap everything in .*
18:04:57FromDiscord<kintrix> sent a code paste, see https://play.nim-lang.org/#ix=3oKG
18:05:07FromDiscord<kintrix> since by adding `?` after the `+`, it becomes lazy
18:05:23FromDiscord<kintrix> And matches the least it can get away with
18:05:52FromDiscord<kintrix> While, without the `?`, it is greedy, so it matches as much as it can!
18:05:55FromGitter<kaushalmodi> Prestige: if you do `re""" .. """` , it will save you from a lot of escaping. See https://play.nim-lang.org/#ix=3oKH
18:06:15Prestigeah I forgot I can use triple quotes, thanks
18:06:20FromGitter<kaushalmodi> (it's your same example but with `\\` changed to `\` and `\"` changed to `"`
18:06:22*Gustavo6046 quit (Quit: ZNC 1.8.2 - https://znc.in)
18:06:32FromGitter<kaushalmodi> the main difference is using `re"..`
18:06:59FromGitter<kaushalmodi> there's a difference between `re"..` and ( `re "` or `re ("..`)
18:08:36FromGitter<kaushalmodi> > there's a difference between re".. and ( re " or re ("..) ⏎ ⏎ I cannot find the reference to that now ..
18:08:36*Gustavo6046 joined #nim
18:09:48FromDiscord<kintrix> https://nim-lang.org/docs/re.html#12
18:09:48FromDiscord<kintrix> source
18:09:54PrestigeStill curious why this only works with .* wrapping the whole expression
18:10:04FromDiscord<haxscramper> https://nim-lang.org/docs/manual.html#lexical-analysis-generalized-raw-string-literals
18:10:22FromDiscord<kintrix> In reply to @kintrix "source": Well, one source
18:10:57FromGitter<kaushalmodi> haxscramper: Yes, that was it. thanks. ⏎ ⏎ kintrix: Yep, the `re` docs also mention that "extended raw string"
18:12:05FromDiscord<kintrix> I pretty much just meant this part of it \:P https://media.discordapp.net/attachments/371759389889003532/850436758356230184/unknown.png
18:15:36*bung joined #nim
18:16:36PrestigeI wonder if it just looks for the pattern at index 0, fails, and immediately exits
18:20:02*SebastianM joined #nim
18:21:46FromGitter<kaushalmodi> > I wonder if it just looks for the pattern at index 0, fails, and immediately exits ⏎ ⏎ Looks like it
18:24:00FromGitter<kaushalmodi> Prestige: I get the same outcome as re with nimble package `regex` (which is believe is now more preferred compared to the stdlib versions, mainly because it supports PCRE-like regex without PCRE dependency). ⏎ ⏎ regex package is already preloaded on the Nim Playground: https://play.nim-lang.org/#ix=3oKN
18:33:07*paradx18 joined #nim
18:33:36*paradx18 quit (Remote host closed the connection)
18:33:39*armando_ joined #nim
18:34:02*armando_ quit (Remote host closed the connection)
18:36:52*sinicaid joined #nim
18:37:32*sinicaid quit (Remote host closed the connection)
18:51:57*bung quit (Ping timeout: 248 seconds)
18:52:30*PMunch joined #nim
18:52:40*SebastianM left #nim (#nim)
18:52:40*bung joined #nim
18:58:07FromDiscord<System64 ~ Flandre Scarlet> Does Objects have the notion of public / private ?
18:58:21*bung quit (Ping timeout: 248 seconds)
18:58:34*kzemek0 joined #nim
18:58:35*kzemek0 quit (Remote host closed the connection)
18:59:59FromDiscord<haxscramper> field can be exported/non-exported
19:00:09FromDiscord<System64 ~ Flandre Scarlet> What does it mean ?
19:00:56FromDiscord<haxscramper> It means a field can be visible in other modules if it is exported and only visible in one module if it is not exported
19:01:32FromDiscord<System64 ~ Flandre Scarlet> Oh I see↵And what is the défault thing ?
19:01:51FromDiscord<haxscramper> Non-exported. https://nim-lang.org/docs/manual.html#procedures-export-marker
19:02:06FromDiscord<System64 ~ Flandre Scarlet> Oh interesting
19:03:00*Guest94576 quit (Quit: Guest94576)
19:11:54FromDiscord<System64 ~ Flandre Scarlet> @haxscramper btw I did some progress but I have some huge problems
19:14:19*bung joined #nim
19:18:46*bung quit (Ping timeout: 252 seconds)
19:34:40*bung joined #nim
19:37:26*ml|1 joined #nim
19:38:02*ml|1 quit (Remote host closed the connection)
19:38:53*bung quit (Ping timeout: 248 seconds)
19:49:55*bung joined #nim
19:56:27FromDiscord<System64 ~ Flandre Scarlet> I tried to load a tilemap but the image isn't displayed
20:00:45ForumUpdaterBotNew thread by Sixte: Sequtils insert sink problem, see https://forum.nim-lang.org/t/8083
20:01:04*mjsir911 quit (Quit: Goodbye, World!)
20:01:58FromDiscord<Varriount> In reply to @System64 "I tried to load": Any errors? Are all your C bindings correct?
20:02:38FromDiscord<System64 ~ Flandre Scarlet> In reply to @Varriount "Any errors? Are all": I think, I dunno, can I send a zip with my project?
20:02:57FromDiscord<Varriount> It's not on GitHub?
20:03:10FromDiscord<Varriount> Or GitLab, BitBucket, etc?
20:03:17FromDiscord<System64 ~ Flandre Scarlet> I still not released it
20:03:27FromDiscord<System64 ~ Flandre Scarlet> I can if you want
20:04:43FromDiscord<System64 ~ Flandre Scarlet> do you want I put it on GitHub?
20:14:16*terabyte joined #nim
20:14:51*terabyte quit (Remote host closed the connection)
20:38:41*dv^_^ quit (Ping timeout: 260 seconds)
20:40:52ForumUpdaterBotNew thread by IvanS: NiGui can't set start directory for SelectDirectoryDialog, see https://forum.nim-lang.org/t/8084
21:23:26*PMunch quit (Quit: leaving)
21:26:48*ZoomZoomZoom joined #nim
21:36:01*foobaz21 joined #nim
21:36:15*foobaz21 quit (Remote host closed the connection)
21:39:10*Vladar quit (Remote host closed the connection)
22:05:41*groepaz15 joined #nim
22:06:17*groepaz15 quit (Remote host closed the connection)
22:22:36FromDiscord<deech> How do I use case as an expression? eg. `return ( case blah of .. )`?
22:24:24FromDiscord<ElegantBeef> https://play.nim-lang.org/#ix=3oLY
22:24:30FromDiscord<ElegantBeef> Might be odd with explicit return
22:25:42FromDiscord<Rainbow Asteroids> adding `return` before the `case` keyword still compiles
22:30:37*ZoomZoomZoom quit (Ping timeout: 248 seconds)
22:30:47*tane quit (Quit: Leaving)
22:52:54*Stealth19 joined #nim
22:53:09*Stealth19 quit (Remote host closed the connection)
23:03:07FromDiscord<deech> Thanks!
23:12:45*bung quit (Ping timeout: 248 seconds)
23:28:19*bung joined #nim
23:33:06*bung quit (Ping timeout: 260 seconds)
23:47:56*mjsir911 joined #nim
23:48:46*bung joined #nim
23:52:00*mjsir911 quit (Quit: Goodbye, World!)
23:52:57*tacegory joined #nim
23:53:01*mjsir911 joined #nim
23:53:13*tacegory is now known as Guest95985
23:53:17*bung quit (Ping timeout: 248 seconds)
23:53:41*Guest95985 quit (Remote host closed the connection)
23:53:49*mjsir911 quit (Remote host closed the connection)
23:54:50*mjsir911 joined #nim