<< 19-03-2021 >>

00:19:07FromDiscord<Livingstone> sent a code paste, see https://play.nim-lang.org/#ix=2TmJ
00:19:48FromDiscord<Yardanico> shortest would be with https://nim-lang.org/docs/algorithm.html#sortedByIt.t%2Cuntyped%2Cuntyped
00:19:54FromDiscord<Yardanico> distances.sortedByIt(it[1])
00:20:53FromDiscord<Yardanico> I mean var distances = distances.sortedByIt(it[1])
00:20:55FromDiscord<Yardanico> that makes a copy though
00:21:03*rockcavera joined #nim
00:21:42FromDiscord<Yardanico> https://nim-lang.org/docs/algorithm.html#sort,openArray[T],proc(T,T) for an in-place one
00:22:06FromDiscord<Livingstone> what does an in place one mean?
00:22:16FromDiscord<Yardanico> modifies the original variable without creating a copy
00:22:21FromDiscord<Yardanico> "in-place" - modifies the original variable
00:22:32FromDiscord<Yardanico> "out-of-place" - creates a "new variable"
00:22:52FromDiscord<Yardanico> in-place operations are usually more efficient because you don't need to make copies
00:26:40*Vladar quit (Quit: Leaving)
00:33:23*abm joined #nim
00:49:05ForumUpdaterBotNew thread by Bonesinger: Experimenting with reflections to create SQL statements, got some questions, see https://forum.nim-lang.org/t/7659
01:04:54*Tanger joined #nim
01:06:26*rockcavera is now known as Guest70980
01:06:26*Guest70980 quit (Killed (verne.freenode.net (Nickname regained by services)))
01:06:27*rockcavera joined #nim
01:20:10*njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
01:20:28*njoseph joined #nim
01:26:40FromDiscord<Livingstone> sent a code paste, see https://paste.rs/o0o
01:27:09FromDiscord<Livingstone> (edit) "https://play.nim-lang.org/#ix=2Tnd" => "https://play.nim-lang.org/#ix=2Tnc"
01:41:49*icebattle quit (Quit: leaving)
02:17:35FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2Tnr
02:17:43FromDiscord<Yardanico> ah wait
02:18:19FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2Tns
02:19:35*Jjp137 quit (Quit: Leaving)
02:22:42*Jjp137 joined #nim
02:26:40*jxy quit (Remote host closed the connection)
02:26:58*jxy joined #nim
02:54:24*abm quit (Quit: Leaving)
03:13:17FromDiscord<Livingstone> thanks, how would you make a list including two different data types are arrays my only option?
03:13:29FromDiscord<Livingstone> distances.add(train_row,dist)
04:09:39*spiderstew_ joined #nim
04:10:03*rockcavera quit (Remote host closed the connection)
04:10:50*spiderstew quit (Ping timeout: 264 seconds)
04:33:24*SofarUpYa joined #nim
04:48:32*Gustavo6046 quit (Ping timeout: 240 seconds)
04:52:19ForumUpdaterBotNew post on r/nim by nuL808: Overloaded procs interfering?, see https://reddit.com/r/nim/comments/m89koq/overloaded_procs_interfering/
05:14:53*lritter joined #nim
05:22:48*derfnok joined #nim
05:32:50*rockcavera joined #nim
05:35:38FromDiscord<Daniel> Imagine av1 encoder made in nim.
05:36:19FromDiscord<ElegantBeef> Well go make it then we wont have to
05:40:22FromDiscord<jfmonty2> Is it impossible to make a copy of an `openArray` param within a proc?
05:40:45FromDiscord<jfmonty2> I'd like to make a copy, mutate the copy, etc. but I get `invalid type: 'openArray[int]' for var`
05:43:21FromDiscord<ElegantBeef> I believe this is the best way to copy it↵https://play.nim-lang.org/#ix=2TnJ
05:45:37FromDiscord<jfmonty2> ok, and we have to make it a seq because you can always convert an array to a seq but not necessarily vice versa?
05:47:18FromDiscord<ElegantBeef> You dont have any size information from the openarray at compile time so you cannot make an array
05:47:29FromDiscord<jfmonty2> right
05:47:39FromDiscord<ElegantBeef> Atleast assuming you want the entire collection copied
05:48:22FromDiscord<jfmonty2> as an aside, I notice you have `import std/sequtils`, is there an official guideline on when to use `std/` and when not?
05:50:35FromDiscord<ElegantBeef> if you're importing system you should be using `std`
05:50:40FromDiscord<ElegantBeef> (edit) "system" => "stdlib"
05:51:06FromDiscord<ElegantBeef> New packages are only accessible with it, and generally it's just the proper way to do it now
05:51:29FromDiscord<jfmonty2> huh, ok. So the examples that don't have it are just old?
05:51:45FromDiscord<ElegantBeef> Yea, also not everyone has adopted that method
05:52:17FromDiscord<ElegantBeef> worth noting you can also do `import std/[sequtils, math, strutils]` which makes it pretty neat
05:53:08FromDiscord<jfmonty2> oh nice, that's good to know
05:53:30FromDiscord<jfmonty2> seems like one-line-per-namespace might be a nice style then
05:53:50FromDiscord<jfmonty2> (I've been wondering how to break up lists of imports, since Nim obviously doesn't follow the python convention of one per line)
05:55:55FromDiscord<ElegantBeef> Yep it even works for packages in the current project assuming they're in the same folder
05:56:18FromDiscord<jfmonty2> like `./[a, b, c]`?
05:57:35FromDiscord<ElegantBeef> Yea though the `./` might not be needed
05:57:50FromDiscord<ElegantBeef> By same folder i meant next to eachother
05:58:05FromDiscord<ElegantBeef> Since the module system works off the directory
06:26:13*superbia joined #nim
06:32:18*narimiran joined #nim
06:43:45*johannes joined #nim
06:56:54*letto quit (Quit: Konversation terminated!)
06:57:40*SofarUpYa quit (Quit: I couldn't repair your brakes, so I made your horn louder.)
07:00:35ForumUpdaterBotNew thread by Drkameleon: Easiest way of charting module inter-dependencies, see https://forum.nim-lang.org/t/7660
07:11:53*johannes quit (Read error: Connection reset by peer)
07:12:53*superbia quit (Quit: WeeChat 3.1)
07:20:33*Tanger quit (Quit: Leaving)
07:22:53*letto joined #nim
07:24:38FromDiscord<Varriount> Anyone know what the state of multi-threading and/or CPS is?
07:25:35FromDiscord<Varriount> And if it can be sponsored?
07:26:03PrestigeIdk who is taking it on now that disruptek left
07:27:27FromDiscord<InventorMatt> I believe mratsim has plans for it currently
07:30:59saemYup, last I heard mratsim was reviewing the transform code.
07:31:29saemIn terms of sponsorship what were you thinking?
07:32:43*PMunch joined #nim
07:32:59Prestigehello PMunch
07:33:10PMunchHi :)
07:33:24PrestigeHappy Friday
07:33:34PMunchYay!
07:33:56PMunchUnfortunately I'm redoing my bathroom, so the weekend will likely be spent on that :(
07:33:58saemSup
07:34:23saemYeah, butt you get an upgraded bathroom.
07:34:32PMunchTrue
07:34:39PMunchThat feels further and further away though :P
07:34:49saemThat's normal.
07:34:49PMunchHad quite a large setback yesterday
07:34:52PMunchSuper annoying
07:35:49saemI've done a few of those, they're a whole thing.
07:36:14FromDiscord<ElegantBeef> It's only a setback if you care how it looks 😛
07:42:30PMunchNot quite, I'm putting up something akin to respatex on the walls. Two of the panels didn't connect properly and I ended up breaking one in the process of forcing them together. So now I have to get another pack which needs 3 days of conditioning indoors
07:43:13PMunchMeaning I'm 3 days behind schedule, not counting the half day I spent struggling with that and taking the panelling up and down..
07:44:47saemHmm, I wonder what's a good approach to memoize type relations (converters). Currently thinking an ordered table and counters to know how many to remove when scope changes. 🤔
07:45:02saemUgh, that sounds painful.
07:45:41saemStill gotta benchmark or after to see if I make a dent in compile time afterwards.
07:52:47*berknok joined #nim
07:55:38*derfnok quit (Ping timeout: 260 seconds)
08:12:45ForumUpdaterBotNew thread by Dabod: How do I get a reference to a object, see https://forum.nim-lang.org/t/7661
09:05:12PMunchPlumber just finished! Looks great. Now I just need to finish the walls and such :)
09:10:58FromDiscord<ElegantBeef> resisting making the german plumber joke 😄
09:14:20PMunchGerman plumber joke?
09:15:50FromDiscord<ElegantBeef> "Hopefully if it was a german plumber you check to see the gas isnt hooked to the shower"
09:17:13PMunchHaha, is this a thing?
09:17:20FromDiscord<ElegantBeef> It's a joke yes
09:17:25PMunchGerman plumber jokes I mean
09:17:38FromDiscord<ElegantBeef> I mean jokes about german plumbers yes
09:20:19*rockcavera quit (Read error: Connection reset by peer)
09:20:46*rockcavera joined #nim
09:22:18*fredrikhr joined #nim
09:28:13*xet7 quit (Quit: Leaving)
09:29:39*xet7 joined #nim
09:55:19Clonkk[m]Is there foreseeable issues to use both pragmas "header" and "dynlib" when importing symbol from C ? Some symbol will be declared in header, defined in lib, others will be fully defined in header. I'm wondering if I can just use ``{.push header: header.h, dynlib. lib.so.}`` without troubles
10:03:06ForumUpdaterBotNew thread by Mantielero: Json - update, see https://forum.nim-lang.org/t/7662
10:18:57ForumUpdaterBotNew question by Saeed Baig: Import a specific macro from a module in Nim, see https://stackoverflow.com/questions/66706277/import-a-specific-macro-from-a-module-in-nim
10:27:02*Vladar joined #nim
10:53:21*superbia joined #nim
11:06:33*Gustavo6046 joined #nim
11:11:02*Gustavo6046 quit (Ping timeout: 256 seconds)
11:12:03*superbia quit (Quit: WeeChat 3.1)
11:30:18*nokrealm joined #nim
11:33:06*berknok quit (Ping timeout: 260 seconds)
11:43:36PMunch@Clonkk[m], not sure, we really should have better documentation for this kind of stuff..
11:57:29ForumUpdaterBotNew thread by Wongboo: Compile a nim single file to a single c file that only depends standard c header and lib, see https://forum.nim-lang.org/t/7663
11:58:20FromDiscord<Yardanico> ^ again people trying to use Nim when they're only allowed to use C :)
11:58:29FromDiscord<Yardanico> i mean it's true it's sometimes needed, but still
11:59:21Clonkk[m]Compile your nim program for the target platform and write a C file with the elf binary as a const that execute the elf from C
12:00:39*nokrealm quit (Quit: Leaving)
12:01:30PMunchHaha
12:02:28FromDiscord<Yardanico> but anyway, the idea to create single C might be interesting
12:02:34FromDiscord<Yardanico> aren't there tools to combine multiple C files into one
12:02:52PMunchIndeed, if for nothing else to make it easier to link Nim into other projects
12:05:39PMunchSeems to be some suggestions here: https://stackoverflow.com/questions/5995773/merge-c-files-into-a-single-source-file
12:10:19FromDiscord<Yardanico> from that link there's https://github.com/cil-project/cil
12:10:24FromDiscord<Yardanico> but seems to be quite abandoned
12:10:31PMunchYeah I'm looking into that one
12:11:42FromDiscord<Goel> Does nim compiler and nimble auto-update when installed with choosenim?
12:12:15PMunchDefine auto-update?
12:12:27FromDiscord<Yardanico> @Goel no, that would be quite bad
12:12:40FromDiscord<Yardanico> The following dependencies couldn't be met: - cil → ocaml < 4.06.0
12:12:41FromDiscord<Yardanico> hehe
12:12:41FromDiscord<Goel> For example, when there will be a new release of Nim, lets say 1.4.5 or 1.5
12:12:50FromDiscord<Yardanico> @Goel you could update with a single command then, but not automatically
12:13:01FromDiscord<Yardanico> automatic updates are not a good thing for languages
12:13:12FromDiscord<Yardanico> also 1.4.5 and 1.5 aren't stable releases
12:13:23FromDiscord<Yardanico> in nim odd versions = development releases
12:13:26FromDiscord<Yardanico> even = stable
12:13:37FromDiscord<Yardanico> that's why we have 1.0... 1.2 ... 1.4... and soon we'll have 1.6 ...
12:13:39FromDiscord<Goel> Indeed, thats why i was asking. I don't want to work on a project with dependencies for 1.4.4 and then it auto update to another newer version
12:15:02FromDiscord<Goel> Why passing from 1.4.5 to 1.6 and not 1.5? What happend with 1.5?
12:15:04FromDiscord<Yardanico> @PMunch oh apparently opam can auto-downgrade ocaml, let's see how far that goes
12:15:12FromDiscord<Yardanico> @Goel read above
12:15:39PMunchHmm, sure the dependency is real?
12:16:01FromDiscord<Yardanico> well, opam install cil told me so
12:16:06FromDiscord<Yardanico> I think it's building an older ocaml compiler now
12:16:08PMunchMight be easier to just tell CIL to allow a newer version if there isn't actually an issue :P
12:17:24FromDiscord<Yardanico> also seems like CIL doesn't work with newer gcc without a patch
12:17:35FromDiscord<Yardanico> https://github.com/cil-project/cil/issues/30
12:18:04PMunchThis is starting to feel like more work than it's worth :P
12:18:07FromDiscord<Yardanico> oh cil installed
12:19:42FromDiscord<Yardanico> oh it seems to work as described in https://people.eecs.berkeley.edu/~necula/cil/merger.html
12:19:45FromDiscord<Yardanico> now lets try on a nim program :P
12:22:11FromDiscord<Yardanico> i forgot, is there a way to make nim accept gcc.exe and gcc.linkerexe with spaces?
12:22:44PMunchHmm, I tried the codingame-merge JS thingy
12:22:52PMunchIt created a file but didn't write anything to it :P
12:22:57FromDiscord<Yardanico> guess I need to use the same workaround as with zig
12:23:06FromDiscord<Yardanico> (create a script with no spaces in the name for calling cilly)
12:23:12PMunchCan't you just escape them?
12:23:19PMunchWith a backslash?
12:23:44FromDiscord<Yardanico> no
12:23:53FromDiscord<Yardanico> nim quotes the compiler binary when calling it
12:23:59FromDiscord<Yardanico> ''cilly --merge --keepmerged' -c -w -fmax-errors=3
12:24:02PMunchAh..
12:24:41FromDiscord<Rika> y tho
12:25:02FromDiscord<Yardanico> @Rika for security I guess?
12:25:05FromDiscord<Yardanico> @PMunch got further
12:25:05FromDiscord<Yardanico> /home/dian/Things/Nim/lib/nimbase.h[327:15-16] : syntax error
12:25:09FromDiscord<Yardanico> (comes from CIL)
12:25:15FromDiscord<Yardanico> that line is NIM_STATIC_ASSERT(sizeof(NIM_BOOL) == 1, ""); // check whether really needed
12:25:20FromDiscord<Yardanico> ill try to comment :D
12:25:55FromDiscord<Yardanico> hm it still fails, maybe the error isn't on that line
12:26:42PMunchWelp, that script seems broken..
12:28:38FromDiscord<Yardanico> wait I'm confused, even if I move nimbase.h the error is still the same
12:28:50FromDiscord<Yardanico> oh it caches stuff
12:28:51FromDiscord<Yardanico> got it
12:29:31FromDiscord<Yardanico> "/usr/include/stdlib.h[140:8-16] : syntax error" uhh
12:30:01FromDiscord<Rika> uhhh
12:30:03FromDiscord<Rika> lmao
12:30:33FromDiscord<Rika> whats the line? lol
12:31:12FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2ToX
12:31:39ForumUpdaterBotNew thread by Pumpus: F6 on visual studio code, see https://forum.nim-lang.org/t/7664
12:31:56FromDiscord<Rika> isnt that a cpp thing
12:32:03FromDiscord<Yardanico> how so?
12:32:12FromDiscord<Rika> nvm, prolly delusional
12:33:11PMunchIt kinda seem to not like macros Yardanico
12:34:33FromDiscord<Yardanico> yeah :(
12:34:54FromDiscord<Yardanico> wait
12:34:57FromDiscord<Yardanico> there's a maintained fork I think
12:34:58FromDiscord<Yardanico> https://github.com/goblint/cil
12:35:03FromDiscord<Yardanico> I checked the fork network to see maintained ones
12:35:09FromDiscord<Yardanico> this one is 223 commits ahead
12:35:31PMunchOoh, seems promising
12:38:32FromDiscord<Yardanico> trying to install it now
12:39:20FromDiscord<Yardanico> oo, I think I built it
12:43:28PMunchThe suspense is killing me!
12:44:41FromDiscord<Yardanico> same error :(
12:45:36FromDiscord<Yardanico> hmmmmm
12:45:37FromDiscord<Yardanico> https://github.com/goblint/cil/pull/24
12:46:29PMunchAre you compiling to C or Cpp?
12:47:36FromDiscord<Yardanico> c of course
12:48:06PMunchSo your trying to build that version now?
12:48:29FromDiscord<Yardanico> I'll try it from this PR, yeah
12:48:43FromDiscord<Yardanico> but I think that the most reliable way would be to try with an older gcc
12:48:44FromDiscord<Yardanico> like 7 or 8
12:48:48FromDiscord<Yardanico> I have 10.2
12:50:11PMunchWhat does GCC do in this case?
12:50:26PMunchWhere you able to generate the single file already? Just not compile it?
12:50:54FromDiscord<Yardanico> no, as I said cil parsing fails
12:51:13FromDiscord<Yardanico> extern _Float32 strtof32 (const char restrict nptr,
12:51:16FromDiscord<Yardanico> it fails to parse _Float32 here
12:51:44FromDiscord<Yardanico> that said, I found https://github.com/stephenrkell/cil/commit/7c550e93438b52ea3859e4e261d530c34ca9907b which might be able to help
12:55:45FromDiscord<Goel> Is it possible to have several procedures with the same name? What happens once i call it? All the procedures with the same name will be called together? I'm asking this because i noticed this between the procs made to convert the OpenGL procs from C to Nim↵`proc toGlEnum(hint: Hint)`↵`proc toGlEnum(facing: Facing)`↵`proc toGlEnum(mode: AccessMode)`
12:56:11FromDiscord<Yardanico> yes of course it's totally fine
12:56:21FromDiscord<Yardanico> nim has overloading
12:56:28FromDiscord<Yardanico> based on the number of arguments, types of arguments, names of arguments
12:56:41FromDiscord<Yardanico> https://nim-lang.org/docs/manual.html#overloading-resolution
12:56:46FromDiscord<aryn> you can overload based on names?
12:56:46FromDiscord<aryn> nice
12:56:53FromDiscord<Yardanico> yeah
12:57:12FromDiscord<aryn> i came from the JVM so not too used to stuff like that
12:57:19FromDiscord<Yardanico> https://github.com/nim-lang/Nim/wiki/Lesser-known-Nim-features#overloading-based-on-the-named-argument
12:57:42FromDiscord<aryn> ah ofc, because you can name the args
12:58:18PMunchHuh, even I didn't know about that one :P
13:04:26PMunchOkay, if you pass arguments solely like this then there's something wrong with you: https://github.com/nim-lang/Nim/wiki/Lesser-known-Nim-features#less-known-examples-of-nim-argument-passing-syntax
13:04:57FromDiscord<Yardanico> XDDD
13:05:06PMunchBut I can see it being practical if you want to call one procedure with the result of a longer statement that you really don't want to keep in a variable
13:06:03FromDiscord<aryn> In reply to @PMunch "Okay, if you pass": D:
13:06:35FromDiscord<Rika> i will make sure to code like that just to irritate everyone
13:07:30FromDiscord<Goel> and will comment it with # You're welcome
13:08:57*Vladar quit (Quit: Leaving)
13:09:43PMunchOkay, this is just wrong.. https://github.com/nim-lang/Nim/wiki/Lesser-known-Nim-features#lvalue-type-conversion-for-distinct-or-equivalent-types-better-explained-with-code
13:10:08FromDiscord<Yardanico> why? :P
13:10:17PMunchI guess a.int = 3 kinda makes sense, but still..
13:10:24PMunchWhy not 3.Dollar
13:10:30FromDiscord<Yardanico> shorter to write :P
13:10:36PMunchMaybe for generic programming..
13:10:40FromDiscord<Yardanico> but anyway most of these are just some cool things
13:10:50PMunchYou could accept something that's not strictly an int, but int-compatible
13:11:01PMunchOh for sure
13:11:12PMunchI'm just trying to find some use for them
13:11:20FromDiscord<Rika> pmunch the example doesnt do it justice but the usecases are there
13:11:30PMunchLike what?
13:15:09FromDiscord<clyybber> PMunch: For giving us bugs like https://github.com/nim-lang/Nim/issues/14160 of course!
13:16:00PMunchWait, what's a RootRef?
13:17:22*Gustavo6046 joined #nim
13:17:30PMunchWould be interesting if you could miss an index when they where explicitly defined: https://github.com/nim-lang/Nim/wiki/Lesser-known-Nim-features#using-enums-as-array-indexes
13:17:35FromDiscord<clyybber> the object that every object inherits from
13:18:17FromDiscord<clyybber> is RootObj, and I guess RootRef is the same thing but as a ref object
13:18:40FromDiscord<clyybber> it doesn't matter what you use most of the time since `object of X` is lenient like that
13:18:45FromDiscord<clyybber> (edit) "`object" => "`type = object"
13:22:31FromDiscord<Yardanico> @PMunch I made it work but not sure how viable is that
13:22:39PMunchOh really?
13:22:46PMunchHow'd you do it?
13:22:50FromDiscord<Yardanico> basically I had to comment lines 78-80, 327, 546 in nimbase.h
13:22:51FromDiscord<Yardanico> that's all
13:23:06PMunchAnd are those, uhm, important?
13:23:06FromDiscord<Yardanico> 78-80 defines _GNU_SOURCE if possible
13:23:09FromDiscord<Yardanico> idk :P
13:23:13PMunchHaha :P
13:23:47FromDiscord<Yardanico> that said, cil amalgamates EVERYTHING
13:23:50FromDiscord<Yardanico> all includes, even system ones
13:24:11PMunchOooh
13:24:25PMunchHow big is the end result?
13:24:35PMunchFor lets say a simple "hello world"
13:25:43FromDiscord<Yardanico> full debug hello world build (no compiler switches) - 15k lines of C code, but there are #line directives everywhere, without them ~10k lines
13:25:51FromDiscord<Yardanico> -d:danger 6.6k lines
13:25:58FromDiscord<Yardanico> with arc - 4.5k lines
13:26:16FromDiscord<Yardanico> with useMalloc on top of that - 2.6k lines
13:26:25*spiderstew joined #nim
13:26:41FromDiscord<Yardanico> the result for 2.6k lines - https://gist.github.com/Yardanico/65f192e6b861634bcdd275549ece06a7
13:26:44FromDiscord<Goel> sent a code paste, see https://play.nim-lang.org/#ix=2Tpn
13:26:54FromDiscord<Yardanico> @Goel you're compiling from the wrong folder
13:26:57FromDiscord<Goel> (edit) "https://play.nim-lang.org/#ix=2Tpn" => "https://play.nim-lang.org/#ix=2Tpo"
13:27:03FromDiscord<Yardanico> you should compile from the root pixie folder, not from the "examples" folder
13:28:10PMunchHaha, well that's an easy way to annoy your TA and fail your assignment :P
13:28:16FromDiscord<Yardanico> nimbase diff https://gist.github.com/Yardanico/1d4170877f0d3c0c777cc0505742c5ae
13:28:30FromDiscord<Yardanico> (forgot to mention line 22, it's here though)
13:28:47*oprypin_ joined #nim
13:29:09FromDiscord<Yardanico> but still, it's cool that it works
13:29:14FromDiscord<Yardanico> need to try some more advanced programs
13:29:15PMunchYeah, pretty neat
13:29:38*lritter quit (Ping timeout: 245 seconds)
13:29:56PMunchHmm, so objects inherited from RootObj has run-time type information right? Any way to access that information?
13:30:10FromDiscord<Yardanico> https://nim-lang.org/docs/typeinfo.html
13:32:12PMunchHmm
13:33:52*letto quit (*.net *.split)
13:33:52*spiderstew_ quit (*.net *.split)
13:33:52*FromGitter quit (*.net *.split)
13:33:52*oprypin quit (*.net *.split)
13:34:14*FromGitter joined #nim
13:34:33FromDiscord<Yardanico> HAHAHAHHA
13:34:45FromDiscord<Yardanico> i amalgamated the compiler itself
13:34:51FromDiscord<Yardanico> guess how many lines are in the amalgamated file
13:35:00FromDiscord<Yardanico> in a single C file for the whole compiler
13:35:44FromDiscord<clyybber> half a million?
13:36:03FromDiscord<Yardanico> HOW DID YOU GUESS THAT?
13:36:05FromDiscord<Yardanico> it's 504k
13:36:17FromDiscord<Yardanico> gcc surely took a long time to compile that
13:36:27FromDiscord<Gary M> Hey clyybber
13:36:31FromDiscord<clyybber> hey
13:36:34FromDiscord<Gary M> you seen the vulkan progress?
13:36:45FromDiscord<clyybber> oh, you drawn the monke right?
13:36:49FromDiscord<Gary M> ye
13:36:51FromDiscord<clyybber> pretty awesome
13:36:58FromDiscord<Gary M> I'm working on wrapping a C gltf importer now too.
13:37:00FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2Tpv
13:37:01FromDiscord<Gary M> It's going really well
13:37:13FromDiscord<Goel> How much RAM does it need to open a single file of 21m?
13:37:22FromDiscord<Yardanico> @Goel who?
13:37:26FromDiscord<Gary M> we'll see if it's actually easy to parse into my Meshes or not yet but the wrapping is going well
13:37:30FromDiscord<Yardanico> the compiler does much more than just open a file
13:37:32PMunchDamn, that was a good guess!
13:37:35FromDiscord<Gary M> using c2nim
13:37:40FromDiscord<clyybber> nice
13:37:47FromDiscord<Yardanico> I had to patch 1 line in stdlib, that's all
13:37:53FromDiscord<Gary M> Question is, should a c type just be a single `ptr` in nim
13:37:57FromDiscord<Yardanico> make this branch false https://github.com/nim-lang/Nim/blob/version-1-4/lib/pure/hashes.nim#L99
13:37:58FromDiscord<Goel> No i just on your system, to open a text file of 504k lines
13:38:06FromDiscord<Goel> (edit) "i just" => "I mean"
13:38:07FromDiscord<Yardanico> since cil doesn't seem to support uint128_t
13:38:17PMunchThat's pretty damn cool
13:38:21FromDiscord<Yardanico> now lets try to compile the nim compiler from this compiled one
13:38:23FromDiscord<Yardanico> to see if it broke
13:38:38PMunchOh you didn't actually try to compile it?
13:38:43FromDiscord<clyybber> PMunch, Yardanico: Heh, tbf I had something like that in the back of my mind, probably because I sometimes use git init/diff in the nimcache to debug compiler stuff
13:38:54FromDiscord<Yardanico> @PMunch nonono
13:39:11FromDiscord<Yardanico> I compiled it successfully, I want to see if the nim compiler from the amalgamation will be able to compile itself
13:39:31FromDiscord<Yardanico> `compiler/nim c -o:nim_test -d:danger compiler/nim.nim`
13:39:34*letto_ joined #nim
13:39:52*letto_ quit (*.net *.split)
13:40:02FromDiscord<Yardanico> it actually works
13:40:09FromDiscord<clyybber> nice haha
13:40:10FromDiscord<Yardanico> amazing
13:40:22FromDiscord<Yardanico> who wants nim compiler in a single, EASY TO DISTRIBUTE c file?
13:40:25FromDiscord<Gary M> `cgltf_node joints;` this is the c code being wrapped to nim which naively tried to do `ptr ptr cgltf_node` which is obviously invalid
13:40:30FromDiscord<Gary M> should it just be a single ptr
13:40:34FromDiscord<Yardanico> @Gary M why invalid?
13:40:35FromDiscord<Yardanico> this is valid
13:40:38FromDiscord<clyybber> In reply to @Yardanico "who wants nim compiler": compress it with a C uglifier
13:40:40PMunchHaha, I mean for what it's worth that is pretty cool
13:40:51FromDiscord<Yardanico> but it's probably a ptr ptr UncheckedArray[cgltf_node]
13:41:00FromDiscord<Gary M> oh it's valid? 😄 then something else wasn't parsed
13:41:07FromDiscord<Yardanico> @clyybber hm
13:41:29FromDiscord<Gary M> `typedef struct cgltf_node cgltf_node;`
13:41:57FromDiscord<Gary M> I remember wrapping something like that in Vulkan Memory Allocator
13:42:35FromDiscord<Yardanico> lol https://media.discordapp.net/attachments/371759389889003532/822465073682448494/unknown.png
13:42:49FromDiscord<Yardanico> (I remember dom had a project like that, didn't know it would pop up in google search)
13:43:00FromDiscord<Gary M> I think I literally just used a `pointer` for those typedef structs lol
13:43:03*letto_ joined #nim
13:43:17FromDiscord<Gary M> `ptr ptr pointer` sounds amazing
13:43:30FromDiscord<clyybber> In reply to @Yardanico "lol": haha nice, doesn't show up with ddg tho, so it's probably google knowing you are related to nim
13:43:39FromDiscord<Yardanico> 👀
13:43:48FromDiscord<Yardanico> it shows up in DDG
13:43:50FromDiscord<Yardanico> just not at the top
13:43:51FromDiscord<Yardanico> but first page
13:43:55FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/822465409227030658/unknown.png
13:44:04FromDiscord<Yardanico> 8th result
13:44:11FromDiscord<clyybber> oh
13:44:58FromDiscord<clyybber> should find one that has an option to make identifiers as short as possible
13:45:03FromDiscord<clyybber> as opposed to hashing them
13:45:14FromDiscord<Yardanico> i wonder if it's possible to do simple amalgamation by just merging files together
13:45:17FromDiscord<Yardanico> since nim has mangling by itself
13:45:33FromDiscord<clyybber> probably
13:46:10*superbia joined #nim
13:46:10PMunchHmm, quite possible
13:47:19FromDiscord<Gary M> is there a way to get c2nim to convert snake_case to camel and pascal case?
13:48:09FromDiscord<clyybber> @Gary M nope, but I have this hack: perl -pi -e 's/(?<!")(VK|PFN)|\G_([[:alnum:]]+)/\1\L\u\2/g' $output #Convert snake case to camel case, but not in string literals: VK_SOME_THING -> VKSomeThing
13:48:37FromDiscord<Gary M> whoa that's some cursed regex
13:48:40FromDiscord<clyybber> yeah lol
13:49:01FromDiscord<clyybber> you wouldn't want to see what sed/perl shit my wrapper used to be built on
13:49:08FromDiscord<Gary M> I bet I could do this with nim lol
13:49:12FromDiscord<clyybber> that's why I switched to the xml generating approach
13:54:20FromDiscord<Yardanico> documented stuff in https://forum.nim-lang.org/t/7663#48655
13:54:25FromDiscord<Yardanico> also there's a link if you want to download that C file
13:54:32FromDiscord<Yardanico> be careful though, it's 504k lines
13:54:58FromDiscord<Yardanico> I had to kill the VSCode C tokenizer extension process after opening the file because I didn't know that it would actually try to tokenize the file
13:55:05FromDiscord<Yardanico> it got to like 10GB RAM usage before I killed it
13:58:30FromDiscord<Yardanico> GCC compiles that file in 14.2 seconds on my machine and uses 678MB RAM
13:58:33FromDiscord<Yardanico> (max resident)
13:59:52PMunchWait what?! Didn't ever consider that these can have multiple arguments: https://github.com/nim-lang/Nim/wiki/Lesser-known-Nim-features#python-style-indexing-operators-with-commas
14:01:23FromDiscord<Yardanico> XDDDD
14:01:26FromDiscord<Yardanico> :)
14:06:23FromDiscord<Gary M> so I can use strutils' `replace` but is there a way to make it capitalize the following char after the substring?
14:06:30FromDiscord<Gary M> or do I need to do things more manually
14:07:44FromDiscord<Seedofarson> man
14:07:51FromDiscord<Seedofarson> Nim is so often
14:07:54FromDiscord<Seedofarson> (edit) "often" => "awesome"
14:08:31FromDiscord<Seedofarson> the only drawback personally is the immaturity of the language, it seems entirely amazing though
14:10:38FromDiscord<Yardanico> guess I should finally make a real blog post on my forum, will do it about this amalgamation thing
14:10:54FromDiscord<Yardanico> (edit) "forum," => "blog,"
14:12:41*azed joined #nim
14:14:46FromDiscord<InventorMatt> with the compiler all in one file could it then be converted into wasm and run directly in the browser?
14:15:33*lritter joined #nim
14:16:01Prestige@ElegantBeef are you around? I'm getting an error with nimscripter (just following the video on github), cannot open file: strutils
14:16:05PMunchOh shit, that might possibly work..
14:16:30FromDiscord<aryn> you can ping people from IRC? neat
14:16:59PrestigeI have strutils in ./stdlib/pure/strutils.nim so idk what's wrong here
14:17:13PMunchPrestige, not sure how relevant it is to nimsripter but this might help: https://peterme.net/how-to-embed-nimscript-into-a-nim-program-embedding-nimscript-pt-2.html
14:17:34PMunch@aryn, yeah the bot is pretty clever :)
14:23:29Prestigeaha, the stdlib directory has to be very particular..
14:24:12*lritter quit (Ping timeout: 260 seconds)
14:24:33PMunchWell, it has to be the stdlib :P
14:24:57Prestigeparts of it, and some parts can't be in directories
14:25:11FromDiscord<Seedofarson> what is nimscript?
14:26:19PMunchThe subset of Nim that the compiler can run
14:26:21FromDiscord<hamidb80> does anyone here know `npeg`?
14:26:24PMunchYes
14:27:00PMunchPretty much the part of Nim that you can use an a macro or static procedures. It is also possible to import the Nim compiler into your own project and load NimScript from files on runtime.
14:27:33PMunch@hamidb80, that yes was for you by the way :P
14:29:08PrestigeI don't think I'm going to get this working without input from Beef
14:29:40PMunchWhat's the issue?
14:29:50PMunchStill just not being able to load strutils?
14:29:57saemHmm, for the single C file, I wonder if people are aiming for something like wherever there is an import treat it as an include and do that recursively.
14:29:59FromDiscord<hamidb80> i want to know the recursion level in `npeg`, is that possible?
14:30:20PrestigeI got that part working PMunch but now his exportToScript pragma doesn't seem to be working
14:30:34Prestigejust following the first example on the README
14:30:38PMunch@hamidb80, not without some trickery I think
14:30:47PMunchYou can try to ping @Zevv
14:31:05FromDiscord<hamidb80> for example the recursion level of `(2)` ↵1 + (12 + `(2)` )
14:31:13FromDiscord<hamidb80> is 2
14:31:38FromDiscord<hamidb80> In reply to @PMunch "You can try to": ping by IRC?
14:31:57PMunchJust mentioning him does that, but he's not in here atm
14:32:23FromDiscord<hamidb80> ok tnx
14:32:57FromDiscord<hamidb80> another quesiton
14:33:16FromDiscord<hamidb80> can i have optional catures?
14:33:21PMunchYes
14:33:31FromDiscord<hamidb80> like i wanna check is $1 exists or not
14:33:42FromDiscord<hamidb80> (edit) removed "is"
14:33:59FromDiscord<hamidb80> how?
14:34:20FromDiscord<hamidb80> (edit) "catures?" => "captures?"
14:34:28FromDiscord<Yardanico> did you see the npeg docs in readme ?
14:34:35FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/822478160578871356/unknown.png
14:34:37PMunchPrestige, hmm I get /home/peter/.nimble/pkgs/nimscripter-0.1.0/nimscripter/nimscripter.nim(178, 9) Error: attempting to call undeclared routine: 'registerErrorHook'
14:34:50FromDiscord<Yardanico> you can check the length of the returned sequence
14:35:05FromDiscord<Yardanico> also don't forget that there's always $0 which is the full match of the current rule
14:35:31FromDiscord<hamidb80> In reply to @Yardanico "": no thats not the case
14:35:35FromDiscord<Yardanico> ??
14:35:37PrestigeI fixed it PMunch I needed -d:scripted even though I was already using -d:debugScript
14:35:54FromDiscord<hamidb80> In reply to @hamidb80 "like i wanna": i want this
14:36:09FromDiscord<Yardanico> yes, you will be able to do it with this
14:36:17PMunchHmm, the docs for NimScripter could be better..
14:36:27PMunchPrestige, what are you planning on using it for?
14:36:38FromDiscord<Yardanico> just check if len of the seq returned from captures is more than 1 ($0 which always exists, and $1, and possibly other captures)
14:36:41saemRighteous hacks
14:36:43PrestigeAn irc bot, hot reloading scripts (plugins)
14:37:33FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2TpW
14:37:35FromDiscord<Yardanico> in npeg $0, $1, etc are just sugar for capture[i]
14:37:58FromDiscord<aryn> In reply to @PMunch "<@637032376731566082>, yeah the bot": nice
14:38:04FromDiscord<aryn> can you lot see replies aswell?
14:38:11FromDiscord<Yardanico> yes
14:38:16FromDiscord<aryn> nice
14:38:21FromDiscord<Yardanico> only a start of them though, since inserting the full original message wouldn't be very good
14:38:28FromDiscord<Yardanico> the bridge is https://github.com/Yardanico/ircord/
14:38:39FromDiscord<aryn> oh you made it? lol
14:38:54FromDiscord<aryn> ah dimscord
14:39:16FromDiscord<aryn> is there not a seperate webhook lib? or is it all in dimscord
14:39:25FromDiscord<Yardanico> wdym "webhook lib"?
14:39:35FromDiscord<Yardanico> I don't use dimscord for webhooks at all, webhooks are just simple GET/POST requests
14:39:43FromDiscord<Gary M> if you want http requests that's in the nim libs
14:39:59FromDiscord<Gary M> async too
14:40:05FromDiscord<Yardanico> for IRC -> Discord you don't need dimscord, you only need webhoks, but for Discord -> IRC you need dimscord (or write your own Discord API library)
14:40:07FromDiscord<aryn> oh ofc, you need the bot to get the messages here
14:40:11FromDiscord<Yardanico> https://github.com/Yardanico/ircord/blob/master/src/ircord.nim#L43
14:41:22*icebattle joined #nim
14:43:42*icebattle quit (Client Quit)
14:44:02*icebattle joined #nim
14:45:57*PMunch quit (Quit: leaving)
14:47:50FromDiscord<Gary M> what's the easiest way to parse cli args
14:50:06leorize[m]you use a parser like argparse or cligen
14:50:06FromDiscord<Gary M> or just one string arg 😄
14:51:07FromDiscord<exelotl> For simple programs "parseopt" in the standard library is not so bad
14:51:58FromDiscord<exelotl> If you're looking to avoid dependencies
14:52:12FromDiscord<Gary M> I'm really just doing something quick and dirty
14:54:33FromDiscord<Gary M> so initOptParser then next() on it?
14:56:40FromDiscord<aryn> sent a code paste, see https://play.nim-lang.org/#ix=2Tq8
15:01:32FromDiscord<exelotl> @Gary M here's how I use it: https://gist.github.com/exelotl/9789c77253db296f2622196ae991cf8f#file-gbafix-nim-L99
15:02:35FromDiscord<aryn> the noval stuff is handy
15:04:58Prestigecrap. I can't send objects to scripts with nimscripter
15:05:54FromDiscord<exelotl> sent a code paste, see https://play.nim-lang.org/#ix=2Tqi
15:06:01FromDiscord<aryn> i was just playing about with it
15:06:08FromDiscord<aryn> but yeah that could be handy
15:06:18FromDiscord<aryn> the doc mentioned the OS module aswell
15:12:02*superbia quit (Quit: WeeChat 3.1)
15:28:08liblq-devany news on 1.6 progress?
15:28:09*Simon[m]4 joined #nim
15:28:23FromDiscord<Gary M> are enums idiomatically lowercase?
15:28:52liblq-dev@Gary they're camelCase, prefixed with an abbreviated name of the enum
15:35:10FromDiscord<Gary M> woo!
15:35:16FromDiscord<Gary M> another C lib wrapped
15:36:33*shmorgle quit (Ping timeout: 264 seconds)
15:42:27*icebattl1 joined #nim
15:46:28*icebattle quit (Ping timeout: 260 seconds)
15:46:44FromDiscord<Rika> congrats
15:50:53FromDiscord<aryn> what would the best way to approach regex in nim be? cursory google search brings up a few git repos but i'm not sure whats good and whats not
15:52:07FromDiscord<Kiloneie> @narimiran could you share my last video on nim_lang pretty please? I did @ mention
15:53:08FromDiscord<exelotl> In reply to @aryn "what would the best": this one is the best I think: https://github.com/nitely/nim-regex↵but I personally find it hard to figure out how to use it for basic tasks :(
15:53:35FromDiscord<aryn> yeah i saw that, although nimble didnt want to work. was complaining about SSL. so i grabbed the source but appear to be missing deps
15:53:41FromDiscord<aryn> >import pkg/unicodedb/properties↵↵is dead
15:53:55FromDiscord<exelotl> oh, hmm
15:54:01FromDiscord<aryn> wait i think i got tio
15:54:04FromDiscord<aryn> (edit) "tio" => "it"
15:54:23FromDiscord<aryn> ya, found the dep
15:54:24narimiran@Kiloneie sure, i thought giving it some more days in between
15:54:28FromDiscord<aryn> made by the same guy
15:55:40FromDiscord<exelotl> in the stdlib it's worth checking out https://nim-lang.org/docs/strscans.html and https://nim-lang.org/docs/pegs.html
15:55:51FromDiscord<exelotl> you can often use them instead of regex
15:56:10FromDiscord<aryn> its a fairly complex regex
15:59:20Clonkk[m]Is there any github actions wizard that could help me understand why executing tests github actions refuse to link properly (when locally it works) ?
15:59:30Clonkk[m] * Is there any github actions wizard that could help me understand why executing tests with github actions refuse to link properly (when locally it works) ?
16:00:08*zazi[m] quit (Quit: Idle for 30+ days)
16:00:08*Zoom[m] quit (Quit: Idle for 30+ days)
16:00:50FromDiscord<aryn> hm, on the regex lib i'm getting warns about IndexError being deprecated, anyone familiar with its replacement?
16:00:59FromDiscord<aryn> or should i ignore it
16:04:14*icebattle joined #nim
16:04:55liblq-devIndexDefect
16:05:08*icebattl1 quit (Ping timeout: 260 seconds)
16:05:27FromDiscord<aryn> thank
16:05:46FromDiscord<aryn> (edit) "thank" => "thanks"
16:07:33*timdorohin joined #nim
16:07:51*haxscramper joined #nim
16:17:42FromDiscord<Yardanico> well, I finished writing the post about amalgamations
16:17:46FromDiscord<Yardanico> since my blog needs some posts at least
16:17:49FromDiscord<Yardanico> even if not that interesting
16:25:03*shmorgle joined #nim
16:25:13FromDiscord<Kiloneie> In reply to @narimiran "<@605421432083709952> sure, i thought": Not a bad idea, imma do a reupload today myself gotta add some pictures, also an excuse to bump myself again xD
16:25:55FromDiscord<Kiloneie> I thought that you forgot :P
16:30:13FromDiscord<Yardanico> https://zen.su/posts/amalgamating-nim-programs/
16:36:29*superbia joined #nim
16:50:07liblq-devyard please
16:50:08*liblq-dev uploaded an image: (6KiB) < https://matrix.org/_matrix/media/r0/download/gacko.pl/cfJxjDWlGbWnxbAcxoaLhJpL/image.png >
16:50:19liblq-devi know you have better taste than using light fonts with small font sizes
16:51:09FromDiscord<Yardanico> wat
16:51:13FromDiscord<Yardanico> it looks fine for me 🤔
16:51:26liblq-devperhaps you're not using subpixel rgb rendering
16:51:34FromDiscord<Yardanico> which wont should I use?
16:51:37FromDiscord<Yardanico> (edit) "wont" => "font"
16:51:52*NimBot joined #nim
16:52:00FromDiscord<Yardanico> also does the actual page content look fine for you?
16:52:02liblq-devi mean up the font weight
16:52:03liblq-devwith 300 it looks fine
16:52:09liblq-devyeah
16:52:11liblq-devjust the headings
16:52:50FromDiscord<Yardanico> done
16:53:07FromDiscord<Yardanico> lemme reset the cache
16:53:40FromDiscord<Yardanico> done
16:57:55FromDiscord<Rika> thats better thanks
16:58:21FromDiscord<Yardanico> i guess I'll also post on dev.to with canonical url for better publicity: P
16:58:23FromDiscord<Yardanico> (edit) "publicity: P" => "publicity :P"
17:04:29*DaKnig[m] joined #nim
17:04:51DaKnig[m]does nim have C unions?
17:05:12FromDiscord<clyybber> yep
17:05:24FromDiscord<clyybber> we have {.union.} and case objects, which are tagged unions
17:08:23DaKnig[m]it would be useful if I end up writing an emulator in nim- for registers on x86-like architectures
17:09:23FromDiscord<Yardanico> the amalgamation seems to be pretty portable https://media.discordapp.net/attachments/371759389889003532/822517116015083520/unknown.png
17:09:33FromDiscord<Yardanico> testing on online compilers it works just fine with gcc 4.4.7 and clang 3.1
17:13:46*Perkol joined #nim
17:19:30FromDiscord<Rika> 69 warnings
17:19:42FromDiscord<Yardanico> @Rika they don't affect anything
17:19:49FromDiscord<Yardanico> ah
17:19:50FromDiscord<Yardanico> nice :)
17:19:56FromDiscord<Yardanico> 🥴
17:30:05FromDiscord<Rika> lmao
17:32:48*rockcavera quit (Remote host closed the connection)
17:47:17*superbia quit (Quit: WeeChat 3.1)
17:50:09*fredrikhr quit (Quit: Client Disconnecting)
17:50:45FromDiscord<Goel> sent a code paste, see https://play.nim-lang.org/#ix=2Trt
17:52:44FromDiscord<Hi02Hi> its an or for types, so this is a `Red8` or `Rg8` or ...
17:52:56FromDiscord<haxscramper> https://nim-lang.org/docs/manual.html#generics-type-classes
18:12:52FromDiscord<Seedofarson> is it possible to have a Nodejs/electron frontend and a Nim backend?
18:12:53FromDiscord<Seedofarson> Nim is a compiled language
18:13:11FromDiscord<Seedofarson> I cant just compile to JS cuz some modules wont work with compiling to JS
18:13:38FromDiscord<Yardanico> what do you mean by "Nodejs/electron"?
18:13:44FromDiscord<sealmove> You know there is a JS backend :ρ
18:13:47FromDiscord<Yardanico> you want to create GUI apps with Electron and Nim?
18:13:53FromDiscord<Yardanico> @sealmove "I cant just compile to JS cuz some modules wont work with compiling to JS"
18:15:05FromDiscord<Seedofarson> yeah
18:15:13FromDiscord<Seedofarson> I want to create a GUI app with electron and nim
18:15:30FromDiscord<Yardanico> well, then go ahead
18:15:34FromDiscord<Yardanico> there's nothing stopping you
18:15:53FromDiscord<Yardanico> learn how to do FFI in Electron, compile Nim part as a library, use it from Electron side
18:16:04FromDiscord<Yardanico> or you can also go the websockets/http/etc route
18:18:47FromDiscord<Seedofarson> In reply to @Yardanico "learn how to do": compile nim as a libary?
18:18:50FromDiscord<Yardanico> yes
18:18:52FromDiscord<Yardanico> --app:lib
18:19:01FromDiscord<Yardanico> or, if you go the websockets/http route, then as a normal program
18:20:05FromDiscord<Seedofarson> nim c --app:lib -d:ssl exmaple.nim
18:25:40FromDiscord<Seedofarson> omgggg
18:25:43FromDiscord<Seedofarson> thats so awesome
18:31:16timdorohinSeedofarson: WASM is always an option
18:31:51*icebattle quit (Read error: Connection reset by peer)
18:32:04*icebattle joined #nim
18:34:48FromDiscord<Seedofarson> web assembly?!?
18:35:07FromDiscord<Yardanico> yes?>!?!?
18:35:40FromDiscord<Seedofarson> can nim transpile to web assembly?
18:35:47FromDiscord<Seedofarson> (edit) "transpile" => "compile"
18:36:44FromDiscord<Yardanico> via emscripten or clang's wasm32 backend or nlvm's wasm32 target
18:38:11FromDiscord<Seedofarson> but
18:38:19FromDiscord<Seedofarson> wouldnt some modules not work
18:38:23FromDiscord<Seedofarson> cuz of C stuff?
18:38:30FromDiscord<Seedofarson> like the JS compiler
18:38:39timdorohinC compiles to WebAssembly
18:39:38stefantalpalaruAny idea what introduced "Error: unguarded access" for a bound template var, in version-1-4, but after 1.4.4 was tagged?
18:41:17stefantalpalaruThis seems to have touched binding: https://github.com/nim-lang/Nim/commit/cf1ecee79419e532680ef01693c2ee7779e835c1
18:42:50FromDiscord<Seedofarson> In reply to @timdorohin "C compiles to WebAssembly": I didnt think about this
18:43:33FromDiscord<Seedofarson> Nim ---> C
18:43:39FromDiscord<Seedofarson> C ----> webassembly
18:43:44FromDiscord<Seedofarson> C -----> golang
18:43:48FromDiscord<Yardanico> no
18:43:50FromDiscord<Seedofarson> C -----> Rust
18:43:52FromDiscord<Yardanico> again, no
18:44:14FromDiscord<Seedofarson> Nim --> C --> Webassembly?
18:44:25FromDiscord<Yardanico> also, deleting messages is useless since they've already been bridged and logged. and please try to not write too much short messages, instead make longer messages :)
18:44:37FromDiscord<Seedofarson> okay, sorry!
18:48:00FromDiscord<Seedofarson> @DefinitelyNotYardanico well why not? I suppose the compilers arent perfect, so, like, maybe something would get lost along the way? As far as I have experienced the nim --> C compiler has almost no limitations, so why when you get that C code could you not compile to WASM? no disrepect haha, just curious
18:48:08FromDiscord<haxscramper> In reply to @haxscramper "I have a small": @Seedofarson
18:48:18FromDiscord<Yardanico> @Seedofarson I replied to your "C -> Rust" and "C -> Go"
18:48:53FromDiscord<Yardanico> These make no real sense, however C -> WASM does and it already exists, and above I described the main 3 options you could use to use Nim for WASM - Emscripten, Clang's wasm32 backend, nlvm's wasm32 target
18:49:07FromDiscord<haxscramper> In reply to @haxscramper "<@!798398880584171530>": On compiling nim to wasm. As you can see even nim compiler itself (at least parser part) can be compiled to wasm and runs perfectly fine
18:55:06FromDiscord<Seedofarson> In reply to @Yardanico "These make no real": https://github.com/immunant/c2rust↵https://github.com/elliotchance/c2go↵https://github.com/yanghuan/CSharp.lua
18:55:16FromDiscord<Seedofarson> (edit) "https://github.com/immunant/c2rust↵https://github.com/elliotchance/c2go↵https://github.com/yanghuan/CSharp.lua" => "https://github.com/immunant/c2rust↵https://github.com/elliotchance/c2go↵https://github.com/yanghuan/CSharp.lua↵hmmm"
18:55:25FromDiscord<Seedofarson> (edit) "https://github.com/immunant/c2rust↵https://github.com/elliotchance/c2go↵https://github.com/yanghuan/CSharp.lua↵hmmm" => "https://github.com/immunant/c2rust↵https://github.com/elliotchance/c2go↵https://github.com/yanghuan/CSharp.lua↵idk"
18:55:26FromDiscord<Yardanico> and neither of them are actually complete
18:55:57FromDiscord<Yardanico> but really, we're not talking about them, we're talking about Nim -> WASM, not sure why you brought other languages up
18:56:55FromDiscord<Seedofarson> just curious to be honest
18:57:05FromDiscord<Seedofarson> if i am being annoying or anthing Its tottally fine and i will stop
19:01:29FromDiscord<Ayy Lmao> How can I read in a big endian uint16 from a string?
19:05:37FromDiscord<Ayy Lmao> I'm trying to port over this thing from Python and the code did `np.ndarray((1,), ">H", event_bytes, location)[0]` and I can't seem to find any similar way in Nim.
19:06:03FromDiscord<Yardanico> @Ayy Lmao https://nim-lang.org/docs/streams.html or https://github.com/treeform/flatty/blob/master/src/flatty/binny.nim
19:06:55FromDiscord<Yardanico> https://nim-lang.org/docs/endians.html https://github.com/status-im/nim-stew/blob/master/stew/endians2.nim
19:07:03nisstyredoesn't casting it require you know the cpu endianness?
19:07:05nisstyrefor it to be correct?
19:07:16FromDiscord<Yardanico> you can just swap later
19:07:19FromDiscord<Yardanico> since the size is the same
19:07:45FromDiscord<Ayy Lmao> I will take a look at those links. Thanks!
19:08:43nisstyreI had done it this way before https://play.nim-lang.org/#ix=2TrW
19:08:51nisstyreprobably not the most efficient though
19:09:01FromDiscord<Yardanico> @haxscramper me trying compiler as an api - eval nimscript https://media.discordapp.net/attachments/371759389889003532/822547225095045230/unknown.png
19:09:12FromDiscord<Yardanico> @nisstyre huh
19:09:26FromDiscord<Yardanico> you can just swap based on https://nim-lang.org/docs/system.html#Endianness
19:09:42FromDiscord<Yardanico> https://nim-lang.org/docs/system.html#cpuEndian
19:09:43nisstyreyeah that is probably more efficient
19:09:48nisstyresince if the architectures match it will be a noop
19:10:36*krux02 joined #nim
19:10:47FromDiscord<Yardanico> well you must do it that way
19:11:01FromDiscord<Yardanico> since if you try to swap a little-endian int on little-endian, you'll get incorrect results
19:11:11nisstyretrue yeah
19:11:14FromDiscord<Yardanico> unless you only care about little endian :P
19:11:16nisstyreI just meant you won't have to swap anything
19:11:29nisstyrewell usually it's big endian to little endian
19:11:33FromDiscord<Yardanico> i was referring to your code I mean
19:11:38nisstyreoh, yeah
19:12:04nisstyrethe code that came from only cared about little endian
19:13:04FromDiscord<haxscramper> In reply to @Yardanico "<@!608382355454951435> me trying compiler": `make run` and then open `http://0.0.0.0:8000/main.html`
19:13:18FromDiscord<Yardanico> I'm trying out myself, not from your example :P
19:13:41FromDiscord<Yardanico> do you do anything special?
19:13:42FromDiscord<haxscramper> ah, well, then I can't say anything
19:13:53FromDiscord<haxscramper> what do you mean "special"?
19:14:32FromDiscord<Yardanico> yeah, sorry, I mean the parser might work
19:14:35FromDiscord<Yardanico> I was trying nimscript
19:14:41FromDiscord<Yardanico> and the browser tab just SIGSEGVs
19:14:59FromDiscord<Yardanico> i didn't ping you to ask for help, just to show :P
19:15:06FromDiscord<haxscramper> Ah, yes, I've just misunderstood. I though this thing doesn't even build for you
19:15:15FromDiscord<haxscramper> `s/thing/my example`
19:16:08FromDiscord<Yardanico> apparently in firefox it doesn't crash but there's out of bounds
19:16:15FromDiscord<Yardanico> anyway, nim compiler still has bugs when compiled with arc
19:24:25Mister_MagisterHi i want to iterate through a…z, A…Z, 0…9, i could use Letters and Digits from strutils but idk how to connect them
19:25:00Mister_Magisterah so + works
19:25:03Mister_Magisternice, nvm
19:35:28jfondren[m]yep, those are documented at https://nim-lang.org/docs/manual.html#types-set-type
19:49:32Mister_Magisterhow can i run httpclient post in thread? tried using spawn from threadpool but that closes connection for some reason
19:53:35FromDiscord<ElegantBeef> Prestige like i said you need to make your own stdlib and point the interpreter to it, i have an example version in the repo
19:53:48PrestigeYeah I got that bit working
19:54:04FromDiscord<ElegantBeef> So you resolved the strutils?
19:54:10PrestigeI just had to mess with the structure of the directory, don't really know how it's trying to resolve modules
19:54:26FromDiscord<Yardanico> @Mister_Magister it should work just fine
19:54:29FromDiscord<Yardanico> threads don't affect it
19:54:33PrestigeYeah I had to pull everything from core and pure up a level
19:54:34Mister_Magisteroh
19:54:34FromDiscord<ElegantBeef> Think it jusut needs all first level inside the stdlib folder
19:54:45Mister_Magisterthen maybe server rejects me lol
19:54:46FromDiscord<Yardanico> maybe the issue is something different?
19:55:01Mister_Magisterwell, it works without threads
19:55:02Prestigebtw I wanna talk at some point about nimscripter if you have time
19:55:02Mister_Magisterso idk
19:56:37*icebattle quit (Quit: leaving)
20:00:36FromDiscord<dom96> Miste_Magister: why do you need threads? 🙂
20:01:03Mister_Magister@dom96 SPEED
20:01:13Mister_Magisterbtw, how do i get last letter of a string?
20:01:18Mister_Magisterdoes it work like array?
20:01:22FromDiscord<ElegantBeef> I'll be back in a bit prestige and we can talk then
20:01:26FromDiscord<ElegantBeef> Yep `s[^1]`
20:01:27PrestigeKk thanks
20:01:42Mister_Magisterthanks
20:01:45PrestigeI'm still at work but I'll be free in an hour
20:02:04FromDiscord<dom96> Have you actually benchmarked it without threads to be too slow? Premature optimisation is the root of all evil you know 😛
20:03:06FromDiscord<exelotl> https://twitter.com/pervognsen/status/1252736617510350848
20:04:21FromDiscord<Livingstone> anyone got a code for checking run time on nim?
20:04:33FromDiscord<Yardanico> https://nim-lang.org/docs/monotimes.html
20:05:15FromDiscord<Yardanico> sent a code paste, see https://paste.rs/WdB
20:06:06FromDiscord<Yardanico> Although you might want to use libs like https://github.com/treeform/benchy for benchmarking
20:19:30*SebastianM joined #nim
20:23:31*gpanders quit (Ping timeout: 268 seconds)
20:24:53*gpanders joined #nim
20:30:32*narimiran quit (Ping timeout: 240 seconds)
20:34:51*fputs joined #nim
20:36:06*SebastianM quit (Quit: -a- Bye Bye)
20:38:37FromDiscord<Valor> did treeform wake up one day and be like
20:38:45FromDiscord<Valor> "Im just going to make an entire standard library"
20:38:51FromDiscord<Valor> "All on my own."
20:39:37FromDiscord<Yardanico> no, he is just making a big project :)
20:39:41FromDiscord<Yardanico> a lot of the libs are byproducts
20:40:32FromDiscord<Valor> oh
20:50:20FromDiscord<zidsal> sent a long message, see http://ix.io/2Tsy
20:52:45*Perkol quit (Quit: Leaving)
20:56:15*superbia joined #nim
21:00:07*jess is now known as JESS
21:12:14*JESS is now known as jess
21:37:14*haxscramper quit (Remote host closed the connection)
21:37:38*haxscramper joined #nim
21:43:27*haxscramper quit (Remote host closed the connection)
21:51:38*azed quit (Quit: WeeChat 3.0.1)
21:54:16FromDiscord<ElegantBeef> Hey prestige!
21:55:47PrestigeHey Beef, I'm about to eat but can we talk this evening?
21:56:29FromDiscord<ElegantBeef> I suppose
21:56:44FromDiscord<ElegantBeef> If i'm alive i'm reachable 😛
21:57:00FromDiscord<ElegantBeef> The "benefits" of being a leach
21:57:02FromDiscord<ElegantBeef> (edit) "leach" => "leech"
22:12:20*NimBot joined #nim
22:12:56*nekits07 quit (Read error: Connection reset by peer)
22:13:45*teasea quit (Ping timeout: 264 seconds)
22:14:03*teasea joined #nim
22:15:16FromDiscord<ElegantBeef> https://play.nim-lang.org/#ix=2TsU
22:15:46FromDiscord<ElegantBeef> Making the `seq[seq[T]]` with the `: tuple` means any tuple can be placed at compile time and it'l work
22:15:49FromDiscord<ElegantBeef> (edit) "it'l" => "it'll"
22:23:38FromDiscord<ElegantBeef> @Casey.McMahon worth noting to make it less tedious to construct this simple procedure will work https://play.nim-lang.org/#ix=2TsY
22:30:52FromDiscord<Casey.McMahon> Ah, nice. Thanks for the assistance, ElegantBeef!
22:32:10FromDiscord<ElegantBeef> Also worth noting you can just use a `seq[T]` assuming each element is supposed to be a single pixel
22:33:15FromDiscord<ElegantBeef> I attempt to avoid nested collections, mostly cause it's rather easy to reason about it 1 dimensionally
22:35:59*superbia quit (Ping timeout: 260 seconds)
22:39:43*abm joined #nim
22:39:57FromDiscord<Casey.McMahon> I think I see what you mean, just read each row by using the image.width.
22:46:59*abm quit (Read error: Connection reset by peer)
22:47:36FromDiscord<ElegantBeef> Yep or height depending on how you want to index it
23:28:29FromGitter<redblack3_gitlab> Would be cool if `varargs[auto]` worked for procs: https://play.nim-lang.org/#ix=2Tt8. Crashes at the moment.
23:31:28FromDiscord<ElegantBeef> well that cannot be done, but you can do `varargs[T, operator]` like echo does `varargs[string, '$']` which invokes the operator on all passed in values if they arent string
23:32:08FromGitter<redblack3_gitlab> I saw you mention something about tuples and tried this: https://play.nim-lang.org/#ix=2Ttc. another cool trick. it compiles
23:32:38FromDiscord<ElegantBeef> Well yea cause it turns into `test(args: (int, int, string))`
23:33:36FromDiscord<ElegantBeef> Well you did find a bug with `varArgs[auto]` it does throw an internal error
23:33:59FromDiscord<ElegantBeef> Though auto is a shitty keyword and should only be used when absolutely required 😄
23:35:58FromGitter<redblack3_gitlab> Ya agreed, very hard to read what a function does if u use it. I just use it with macros to avoid having to compute types that are passed around, so it's pretty useful there.
23:50:48FromDiscord<ShadowElf37> sent a code paste, see https://play.nim-lang.org/#ix=2Tti
23:51:38FromDiscord<ElegantBeef> Well give the code so we can reinstate the happiness
23:52:22FromDiscord<ElegantBeef> Unless that was sincerity and not sarcasm
23:52:24FromDiscord<ShadowElf37> sent a code paste, see https://play.nim-lang.org/#ix=2Ttj
23:52:28FromDiscord<ShadowElf37> it was 😉
23:52:45FromDiscord<ShadowElf37> anyway is there a way to force X to be >3
23:52:55FromDiscord<ShadowElf37> or would i have to limit that myself in newShape()
23:53:03FromDiscord<ElegantBeef> What is vector's typedef?
23:53:18FromDiscord<ShadowElf37> sent a code paste, see https://play.nim-lang.org/#ix=2Ttk
23:53:19FromDiscord<ShadowElf37> vector works fine
23:54:14FromGitter<bung87> Downloading Official package list ⏎ 9 ⏎ ⏎ ``` ... Could not download: No SSL/TLS CA certificates found.``` [https://gitter.im/nim-lang/Nim?at=605539a69ebdfd164086dbb7]
23:54:26FromDiscord<ElegantBeef> Windows?
23:54:27FromGitter<bung87> how to solve this on GitHub CI
23:54:58FromGitter<bung87> yeah, occurs on ci's windows
23:55:42FromDiscord<ElegantBeef> Wonder if it's the 1.4.4 fix for the openssl certs
23:56:02FromDiscord<ElegantBeef> https://forum.nim-lang.org/t/7551#48663
23:56:13FromDiscord<ElegantBeef> Damn it linked the comment
23:58:55FromDiscord<ShadowElf37> sent a code paste, see https://play.nim-lang.org/#ix=2Ttn
23:58:57FromGitter<bung87> thanks, I think I need make ci allow fails on windows
23:59:00FromDiscord<ShadowElf37> so maybe the compiler hates .. in generics?
23:59:11FromDiscord<ElegantBeef> Well yea `3..high(int)` is a shortcut for range creation
23:59:21FromDiscord<ElegantBeef> Nah