<< 11-09-2020 >>

00:13:49disrupteksets in bed, nothing like it.
00:14:12disrupteki've gotten so used to sets outside, i don't even know if i'd be able to perform in bed.
00:15:40alehander92noo
00:16:28FromDiscord<Avatarfighter> anddd thats enough disruptek for me today
00:17:11disruptekwut
00:17:27disruptekgroup theory is far more interesting one your hands and knees.
00:17:44disruptekc'mon fighter.
00:17:48disruptekyou know what i'm talkin' about.
00:19:42FromDiscord<Avatarfighter> ahahah
00:20:13FromDiscord<Avatarfighter> I think I might've fucked up making the main drive of my laptop a microsd card
00:20:25FromDiscord<Avatarfighter> it has an unfortunate habit of corrupting itsel
00:21:30disrupteksee, you can't blame me for /all/ corruption.
00:21:46*abm quit (Read error: Connection reset by peer)
00:23:52FromDiscord<Avatarfighter> lmao
00:27:17disruptekkeep your fingers crossed for me.
00:28:02alehander92survive
00:28:04alehander92oh man
00:29:01disruptekthing is, arraymancer works for me. i don't get it.
00:29:24disruptekit works on #head and it works on v0.6.0.
00:34:02FromDiscord<Avatarfighter> Just curious, does anyone know the best way to add/remove from hosts file programmatically?
00:34:22disruptekthe best way?
00:34:39FromDiscord<Avatarfighter> how about the most practical
00:35:17disruptekeh.. echo "foo # stupid" >> /etc/hosts; grep -v "foo # stupid" /etc/hosts
00:35:31FromDiscord<Avatarfighter> hm ok
00:35:37FromDiscord<Avatarfighter> time to make that a nim library >:)
00:35:39disruptekwhere stupid is, i dunno, `echo foo | sum`.
00:36:08FromDiscord<Avatarfighter> i would like to mitm a specific ip but only when my program is running
00:36:44FromDiscord<Avatarfighter> so the plan is to change the hosts file and have the specific ip point to my program so that the game client remains untouched
00:37:22disrupteki guess it's not the worst idea i've heard tonight.
00:37:58FromDiscord<Avatarfighter> yeah
00:38:42FromDiscord<Avatarfighter> i wanted to transparently proxy the connection but im not good enough at programming for that
00:39:32disruptekwhy would you need to do that?
00:40:03disruptekanother way would be to inject your own lookup routine.
00:40:15disruptekor run your own dns server with a lua script or something.
00:41:17FromDiscord<Avatarfighter> well the idea is that while my program is running I can modify the packets flying between the client and the server and while the program isn't running it keeps running normally. Ultimately I'd like it to all be self contained in the exe
00:43:27disruptekwell, you can preload a lib when you launch the game.
00:46:25FromDiscord<Avatarfighter> yeah i realize i can probably just inject
00:46:33FromDiscord<Avatarfighter> that was kind of dumb of me to assume otherwise
00:46:49FromDiscord<Avatarfighter> what ever 😛 we'll see lol
01:26:32FromDiscord<Elegant Beef> So i have a template that takes a enum and a proc, how can i write it such that i can just attach it to a proc and not have to call it?
01:26:47disruptekwhat?
01:26:51FromDiscord<Elegant Beef> Template signature https://play.nim-lang.org/#ix=2x8T
01:27:04FromDiscord<Elegant Beef> I want to use it as a pragma
01:27:23FromDiscord<Elegant Beef> it complains about illformed AST when i attach it
01:28:13FromDiscord<Rika> That's not how a template as pragma's signature would look like isn't it
01:28:22FromDiscord<Elegant Beef> I dont think so i think it needs to be untyped
01:28:23disruptekwhy is it even a template?
01:28:43FromDiscord<Elegant Beef> I mean it can just be a compiletime proc, but it's a moot point
01:28:52disruptekwhy is it even that?
01:29:01FromDiscord<Elegant Beef> What do you mean?
01:29:34disrupteksomearray[entType] = someproc
01:29:37disruptekright?
01:29:39FromDiscord<Elegant Beef> Yea
01:29:59disruptekwhy are you making this more complex?
01:30:23FromDiscord<Elegant Beef> Why not?
01:30:39disruptekbecause you don't get any extra points for confusing people.
01:30:43disruptekbelieve me, i've tried.
01:30:47FromDiscord<Rika> Why would you need a template for that
01:30:57FromDiscord<Elegant Beef> You dont
01:31:01FromDiscord<Rika> Sorry, I don't think
01:31:06disruptekwe know.
01:31:24FromDiscord<Rika> I'm surprised you're capable of knowing
01:31:24FromDiscord<Elegant Beef> I wanted to attach it to a proc body, to subscribe the proc to a lut
01:31:33disrupteka lut?
01:31:38FromDiscord<Elegant Beef> lookuptable
01:32:47disrupteki think what you want is like, `proc foo(...) {.lookup: [EntityType.A].}` -- right?
01:32:52FromDiscord<Elegant Beef> yea
01:32:58disruptekwell, so do that.
01:33:17FromDiscord<Elegant Beef> I was asking how
01:33:42disruptekmake a macro lookup that sets the proc symbol into the lut.
01:33:48*Tanger joined #nim
01:33:58disruptekit has to be typed, of course.
01:34:39disrupteki don't really know why you'd want this, though.
01:35:15FromDiscord<Elegant Beef> Is there a better way to annotate that the proc is or a specific enum in a lut?
01:35:38disruptekbetter how?
01:36:03FromDiscord<Elegant Beef> More acceptable in your eyes
01:36:26disrupteki don't really know why some people want anal beads, but their acceptability in my eyes isn't what's important, right?
01:36:56disruptekcompTimeArray[SomeType] = someProc
01:40:34disruptekdo you want to talk about the beads?
01:40:51disruptekor would you rather i ranted about simplification?
01:41:04disruptekyou have this array. it's compile-time, sure.
01:41:15disruptekit encapsulates everything you need to know about the data.
01:41:25disruptekhow do i know this? because it's what you're using.
01:41:37disruptekyou know what's nice about an array versus a pragma macro?
01:41:44disruptekprogrammers know how to program with it.
01:41:47*apahl quit (Ping timeout: 260 seconds)
01:41:51disruptekthey know how to enumerate its contents.
01:41:57disruptekthey know all sorts of things they can do with it.
01:42:02disruptekindexing stuff.
01:42:09disruptekwriting macros against it. other procs.
01:42:13disruptekpassing it to procs they already have.
01:42:17disruptekcopying it around in memory.
01:42:25disruptekit's a fucking miracle, that little array.
01:42:33disruptekand now you want to take that miracle away from me.
01:42:50FromDiscord<Elegant Beef> I mean this is just for a game and a method of abstracting the entity init procs to an entity type
01:43:04disruptekI WILL FIND YOU.
01:43:08FromDiscord<Elegant Beef> So there isnt really any reason to do anything but set the array index to the proc
01:43:18*apahl joined #nim
01:48:48*femtotones quit (Ping timeout: 260 seconds)
01:50:47disruptekif ever there is, what would you do?
01:51:04disruptekyou'd just create a `[]=`() for the array, right?
01:51:59FromDiscord<Elegant Beef> idk what you mean, if there was a quick and easy method to attach a pragma to the proc to subscribe it to the array, without having to dick around with macros i'd have done it
01:52:29disruptekthere is. it's called `system.[]=`() and it's fucking brilliant.
01:52:51FromDiscord<Elegant Beef> "attach a pragma to the proc to subscribe it"
01:54:27FromDiscord<Elegant Beef> Dont worry disruptek i'm just using the array as an array
02:03:32Prestigeoh wow, netty looks cool
02:06:25*endragor joined #nim
02:12:08FromDiscord<Elegant Beef> It is
02:12:24FromDiscord<Elegant Beef> I toyed around with it to make an RPC system
02:19:11FromDiscord<Theodore> Imagine using IRC
02:19:26FromDiscord<Elegant Beef> You dont need to you can just do it
02:25:12PrestigeFucking love irc
02:40:37disruptekhe really does love irc.
02:49:27*muffindrake quit (Ping timeout: 260 seconds)
02:51:32*muffindrake joined #nim
02:53:11*NimBot joined #nim
03:35:39*vicfred quit (Quit: Leaving)
04:06:01*supakeen quit (Quit: WeeChat 2.9)
04:06:32*supakeen joined #nim
04:31:54*drewr joined #nim
04:55:17*vicfred joined #nim
04:59:15FromDiscord<Avatarfighter> disruptek go to bed
05:16:38*narimiran joined #nim
05:54:03*leorize quit (Ping timeout: 240 seconds)
05:56:53*leorize joined #nim
06:00:11*waleee-cl quit (Quit: Connection closed for inactivity)
06:08:17*solitudesf joined #nim
06:27:19*PMunch joined #nim
06:47:15*a_chou quit (Quit: a_chou)
06:56:24*PMunch quit (Quit: leaving)
06:56:40*PMunch joined #nim
06:57:02PMunchHmm, is pakku not maintained any longer?
07:03:12FromDiscord<Elegant Beef> I mean this isnt really reassuring "Say hello to stillborn AUR helper written in stillborn programming language!"
07:03:29FromDiscord<Elegant Beef> It's not archived and was update 5 months ago
07:04:01PMunchYeah I just realised that there is a PR in for it
07:04:27PMunchNot great though..
07:05:16PMunchI'm guessing @kitsunyan isn't too active here?
07:09:03FromDiscord<Elegant Beef> They arent a discord member
07:10:42PMunchHmm, maybe I should go through the rigamarole of taking over their AUR package and make a fork out of it on GitHub..
07:21:02FromDiscord<Elegant Beef> You do you, im still just waiting for your VM
07:21:20FromGitter<alehander92> PMunch what vm
07:21:33PMunchWM
07:21:43FromDiscord<Elegant Beef> His window manager, it's a joke cause of how he was pronouncing it on his stream
07:21:49PMunch-_-
07:22:22*krux02 joined #nim
07:22:26FromDiscord<Elegant Beef> Reason #300091 why pmunch doesnt want me to talk to him
07:22:32PMunchMaybe I should call it PimoVM just as a joke :P
07:22:41FromGitter<alehander92> ohh ahaha
07:22:52PMunchEy, I don't have anything against you talking to me!
07:23:59*Sgeo quit (Read error: Connection reset by peer)
07:26:06FromDiscord<Elegant Beef> Now you reading my responses is where you have issue 😛
07:27:10PMunchHaha :P
07:47:57FromDiscord<lqdev> vindow manager™️
07:49:22*vicfred quit (Quit: Leaving)
07:52:14PMunchWirtual Machine
07:53:03FromDiscord<Elegant Beef> I have a VM running in KWM
07:59:41FromDiscord<Recruit_main707> whats the recommended way of writing object fields:↵`position*: Vector3` or↵`position* : Vector3`
07:59:58PMunch`position*: Vector3`
08:00:19FromDiscord<Recruit_main707> ok, its just that ive seen a lot of people using the other way
08:00:52PMunchYeah, lots of weird styles out there
08:01:37FromDiscord<Elegant Beef> I wasa one that did the latter
08:01:42FromDiscord<Rika> ~~Wector3~~
08:01:47FromDiscord<Elegant Beef> (edit) 'wasa' => 'was'
08:02:27PMunchGuess it should be mentioned in the NEP-1: https://nim-lang.org/docs/nep1.html
08:03:00PMunchI should just set up an IRC client plug-in that changes all my Ws to Vs..
08:03:27FromDiscord<Elegant Beef> Lol, confuse the fuck out of anyone out of loop "Is he writting with a russian accent?"
08:03:35FromGitter<alehander92> that would be wery good
08:03:39PMunchHaha :P
08:04:43alehander92my accent is very strong on interviews
08:05:01alehander92i wonder if people are getting the right impressions
08:06:15ZevvYou should hear my standup these days
08:06:17Zevvits hilarious
08:06:38alehander92plug us in
08:06:45alehander92Zeww
08:07:01alehander92btw man i wanted to ask
08:07:12alehander92does anyone maintain some helpers for drawing graphs in the compiler
08:07:26FromDiscord<Elegant Beef> Zevv no one ever laughs at my standup so i resort to sit down, its the same jokes but with even fewer laughs
08:07:32alehander92i want to write one simple but i wondered if we have something more reusable
08:07:41alehander92as there are many graphs there
08:07:44*gmaggior joined #nim
08:07:56Tangerhey folks, I'm looking to implement the GeoJSON spec (https://tools.ietf.org/html/rfc7946), which essentially involves casting JSON to a few different types. One thing I'll need is heterogeneous sequences with different types in. Would this be a job for object variants or object inheritance?
08:08:21TangerThe plan was to just cast geoJSON to objects using `to` from the json lib
08:08:50alehander92this is not casting!
08:08:52TangerBuuut, I don't think that'll work with object variants, as in the spec, different objects have different types for a shared property name
08:09:23alehander92cast usually preseerves the runtime value, `to` converts it
08:10:15alehander92so `a: A` and `a: B` ?
08:11:02Zevv"drawing graphs in the compiler"?
08:11:15TangerAh, my bad alehander92
08:11:22TangerPoorly chosen terminology
08:11:40alehander92zevv i mean printing representations of them
08:12:47FromDiscord<Ricky Spanish> @shashlick i tried again using nimterop again and didnt actually even need to do anywork to nimterop to get it working with vcc for the onnxruntime - literally just added the vcc flag to getcompiler and it worked and seems to be fully functional somehow, atleast for my use-case
08:12:52euantoranoLooks like the 1.2.6 package is broken on OpenBSD :( https://builds.sr.ht/~euantorano/job/299484 - seems it's still using `gcc` rather than `clang`
08:14:48euantoranoIt looks like `config/nim.cfg` isn't backported, which is a shame. I'll have to build from Git instead
08:18:00*AndChat|21441 joined #nim
08:19:16PMunchZevv, I think he means like you're doing for npeg
08:19:31alehander92i didn't think of it
08:19:38alehander92but sounds good?
08:20:01*gmaggior quit (Ping timeout: 264 seconds)
08:22:47alehander92wow those are good
08:22:54alehander92well i didn't really want dot graphs tho
08:23:00alehander92just ascii stuff
08:23:20alehander92but i'll write something simple for this usecase only
08:23:28ZevvInterestingly, the ascii graph building in npeg is *very* similar to the IR building
08:23:34Zevvit's recursively putting boxes in boxes
08:23:38Zevvthat would probably work for AST as well
08:25:30alehander92hmm
08:25:42alehander92the diagrams ?
08:25:55alehander92i am really imagining something simpler
08:26:05alehander92e.g. `{a} ---18:5---> {b}`
08:27:19alehander92maybe `edge("{a}", "{b}", vertexText="18:5")`
08:27:47*krux02_ joined #nim
08:30:07*krux02 quit (Ping timeout: 260 seconds)
08:35:46*gmaggior joined #nim
08:37:27*AndChat|21441 quit (Ping timeout: 258 seconds)
08:41:40*Tanger quit (Ping timeout: 258 seconds)
08:46:02*AndChat|21441 joined #nim
08:47:05*gmaggior quit (Ping timeout: 240 seconds)
08:47:05FromGitter<ynfle> Are any of the standard types implemented as objects? Like strings and seqs?
08:47:55alehander92yes!
08:48:23alehander92strings and seqs are
08:50:20*hnOsmium0001 quit (Quit: Connection closed for inactivity)
08:52:03alehander92Araq i .. kinda wonder about the hash stuff in general
08:52:25alehander92do people take `kind` of variant objects into account? because otherwise you get `a.b` == `a[b]`
08:52:32alehander92or at least something like that
08:53:19*Vladar joined #nim
08:58:15*gmaggior joined #nim
08:59:46*AndChat|21441 quit (Ping timeout: 256 seconds)
09:00:37Araqalehander92, usually I don't hash trees
09:01:04Araqbut we do hash the kind, result = ord(n.kind)
09:01:08alehander92yeah so i need to just `!&` the kinds
09:01:15alehander92ah hm
09:01:30alehander92ok so this should be fine
09:05:13*awe00 joined #nim
09:14:31*AndChat|21441 joined #nim
09:16:11*gmaggior quit (Ping timeout: 240 seconds)
09:25:35*gmaggior joined #nim
09:26:13FromDiscord<Ricky Spanish> sent a code paste, see https://play.nim-lang.org/#ix=2xaH
09:26:53FromDiscord<Ricky Spanish> (edit) 'https://play.nim-lang.org/#ix=2xaH' => 'https://play.nim-lang.org/#ix=2xaI'
09:27:28*AndChat|21441 quit (Ping timeout: 256 seconds)
09:27:37FromDiscord<Ricky Spanish> (edit) 'https://play.nim-lang.org/#ix=2xaI' => 'https://play.nim-lang.org/#ix=2xaJ'
09:27:52FromDiscord<Ricky Spanish> (edit) 'https://play.nim-lang.org/#ix=2xaJ' => 'https://play.nim-lang.org/#ix=2xaK'
09:28:07FromDiscord<Ricky Spanish> (edit) 'https://play.nim-lang.org/#ix=2xaK' => 'https://play.nim-lang.org/#ix=2xaL'
09:28:13*FromDiscord quit (Remote host closed the connection)
09:28:28*FromDiscord joined #nim
09:30:22*superbia quit (Ping timeout: 256 seconds)
09:31:18*superbia joined #nim
09:32:38alehander92wow minitel was an interesting piece of tech
09:32:47alehander92mratsim have you used it
09:37:09ZevvI did. It was called 'viditel' here
09:37:53*AndChat|21441 joined #nim
09:39:26*gmaggior quit (Ping timeout: 256 seconds)
09:42:42*gmaggior joined #nim
09:43:36FromDiscord<lqdev> @Ricky Spanish the struct is incomplete because it doesn't have a definition in the header file, only a declaration
09:44:10FromDiscord<lqdev> this means that the struct is created by the wrapped library, so one of the library's functions probably returns an opaque pointer to it
09:44:28*AndChat|21441 quit (Ping timeout: 256 seconds)
09:46:28*abm joined #nim
09:53:55FromDiscord<Ricky Spanish> yeh that is the problem, OrtApi works because its declared in the header but ortEnv seems to be the result of a inout function, but its weird in their sample they directly use a raw pointer ``` OrtEnv* env;``` where the only include is the header im wrapping so iv no idea where they are getting the type defintion for that from, anyway thanks @lqdev
10:00:49*awe00 quit (Ping timeout: 246 seconds)
10:01:01*dddddd_ is now known as dddddd
10:01:40*awe00 joined #nim
10:11:01*abm quit (Ping timeout: 264 seconds)
10:11:04*zyklon quit (*.net *.split)
10:11:04*einichi quit (*.net *.split)
10:11:05*LyndsySimon quit (*.net *.split)
10:11:05*d10n-work quit (*.net *.split)
10:11:05*blackbeard420 quit (*.net *.split)
10:11:05*npgm_ quit (*.net *.split)
10:11:05*dom96 quit (*.net *.split)
10:11:05*dgb quit (*.net *.split)
10:11:23*dgb joined #nim
10:12:03*blackbeard420 joined #nim
10:12:07*d10n-work joined #nim
10:12:21*dom96 joined #nim
10:12:22*dom96 quit (Changing host)
10:12:22*dom96 joined #nim
10:13:25*Cthalupa quit (Ping timeout: 246 seconds)
10:16:16*Cthalupa joined #nim
10:16:59*einichi joined #nim
10:16:59*npgm_ joined #nim
10:16:59*LyndsySimon joined #nim
10:17:00*npgm_ quit (Changing host)
10:17:00*npgm_ joined #nim
10:17:02*AndChat|21441 joined #nim
10:17:04*einichi quit (Changing host)
10:17:04*einichi joined #nim
10:18:38*gmaggior quit (Ping timeout: 260 seconds)
10:28:56*letto quit (Quit: Konversation terminated!)
10:31:56*letto joined #nim
10:37:17*gmaggior joined #nim
10:38:45*AndChat|21441 quit (Ping timeout: 240 seconds)
10:41:51*arecacea1 quit (Remote host closed the connection)
10:42:43*arecacea1 joined #nim
11:11:32*AndChat|21441 joined #nim
11:13:16*gmaggior quit (Ping timeout: 246 seconds)
11:16:10*newUser joined #nim
11:16:40newUserhi, how can I check if a file is open or closed?
11:23:02*gmaggior joined #nim
11:24:07*AndChat|21441 quit (Ping timeout: 246 seconds)
11:28:38*AndChat|21441 joined #nim
11:29:52*gmaggior quit (Ping timeout: 256 seconds)
11:35:56*gmaggior joined #nim
11:37:23newUserhow can I check if a file is open or closed?
11:37:48*AndChat|21441 quit (Ping timeout: 256 seconds)
11:38:21*abm joined #nim
11:41:39*AndChat|21441 joined #nim
11:42:35*gmaggior quit (Ping timeout: 240 seconds)
11:50:37*newUser quit (Remote host closed the connection)
11:51:09*pietroppeter joined #nim
11:57:11FromDiscord<Ricky Spanish> which level do you mean at? in your program i presume nim uses fopen or something of the sort so should be presumed to be open until youre done with it, at the os level youd probably have to deal with polling or something to see what programs are using it
11:58:47FromDiscord<Ricky Spanish> i.e like lsof on linux
12:04:39FromDiscord<Ricky Spanish> sent a code paste, see https://play.nim-lang.org/#ix=2xbD
12:06:01*supakeen quit (Quit: WeeChat 2.9)
12:06:32*supakeen joined #nim
12:11:43*krux02_ quit (Read error: Connection reset by peer)
12:12:36*krux02_ joined #nim
12:18:13*awe00 quit (Ping timeout: 260 seconds)
12:24:35*awe00 joined #nim
12:26:41AraqnewUser: write the code in a way that you know it's been opened. worked for every program I ever wrote.
12:35:34*gmaggior joined #nim
12:35:52alehander92Araq
12:36:01alehander92do you dislike distinct int-s / seq-s a lot?
12:36:23alehander92i wanted to use GraphId / VarId instead of int-s for the seq-s/handles in the graph
12:36:46alehander92but i can just use `GraphId = int` instead of distinct is being viewed as too much
12:37:07*AndChat|21441 quit (Ping timeout: 240 seconds)
12:42:43Araqdistinct ints are fine, distinct seqs are shit
12:43:16*AndChat|21441 joined #nim
12:43:22Araqbut maybe I change my mind if I see your solution
12:44:27*gmaggior quit (Ping timeout: 240 seconds)
12:47:29alehander92ok, i'll show it later
12:53:29*lritter joined #nim
12:56:09FromDiscord<shashlick> @Ricky Spanish that's pretty cool, maybe there's gcc flag support or something
12:56:29FromDiscord<dk> Out of curiosity - is there any reason to assign a new seq instead of calling `setLen 0`?
12:57:48PMunchNot sure if seqs will ever shrink their internal buffer
12:58:10PMunchSo with setLen 0 you won't have the possibility to free the memory of the seqs buffer
12:58:16PMunchBut that's the only reason I can think of
12:58:27FromDiscord<dk> Right
12:58:57PMunchBut that really only applies if you've got a freakishly massive buffer..
13:00:02FromDiscord<lqdev> you're essentially avoiding unnecessary allocations
13:07:24FromDiscord<dk> Nim doesn't release memory to the OS immediately so I don't think it matters
13:07:57FromDiscord<lqdev> yeah but setLen will reuse the currently allocated data store
13:08:08FromDiscord<lqdev> while x = @[] will allocate a new one
13:08:35FromDiscord<lqdev> really it's just a microoptimization since nim's allocator is O(1) iirc
13:10:02FromDiscord<Recruit_main707> i know you can do comparisons on concepts, but im not sure why this throws an error, basically saying there is no `not` function for type bool.↵https://play.nim-lang.org/#ix=2xbU
13:10:32FromDiscord<Recruit_main707> `Non-matching candidates for not (this.form == None)`
13:10:46FromDiscord<Recruit_main707> running the code will output the whole message
13:10:51alehander92umm
13:10:54alehander92how can it know that
13:11:26alehander92the value of `form` ? eventually something like that might be possible with enum flow-based constraints
13:11:33alehander92but i doubt this can work now
13:15:14*agent0x00 joined #nim
13:16:05FromDiscord<Recruit_main707> sent a long message, see http://ix.io/2xbZ
13:17:29alehander92hm, maybe
13:18:05alehander92i think the enum thing would be cool tho but .. should showcase it one day
13:18:08alehander92bbl
13:18:56FromDiscord<Recruit_main707> this is a bit dirtier, but a bit more practical i think
13:22:26Araqlqdev: Nim's allocator is O(1) but it can make a big difference in practice, not so much for arc though
13:23:54FromDiscord<haxscramper> I wrote RFC for implicit initialization hooks - https://github.com/nim-lang/RFCs/issues/252 - mostly it just summarizes previous ones, but I'm interested in comments on the general idea / proposed implementation.
13:23:56disbotUser-defined implicit initialization ; snippet at 12https://play.nim-lang.org/#ix=2xc2
13:25:33FromDiscord<lqdev> Araq: wdym in practice?
13:26:27AraqI mean that triggering Nim's GC run can be expensive, there is more to a GC than just an O(1) allocator
13:27:25Araqso here is a riddle
13:27:33Araqthe code is roughly:
13:28:01Araqobjects = traverse(graph)
13:28:09Araqfor o in objects: free(o)
13:28:50Araqand valgrind says 'traverse' accesses an object that's been freed
13:29:10Araqbut since we free them all *after* traverse that's logically impossible
13:29:26Araqunless these two lines would run in a loop
13:30:53Araqand the code does run frequently but in the end the graph is emptied
13:31:52PMunchHmm, well this is a weird bug..
13:33:27PMunchI created a request object which I then send a pointer to over a channel. This request object has a fulfilled boolean that the receiver sets to true after it has filled in all the correct information in the memory location of the request. The sending threads then busy loop on this boolean until it's true.
13:33:56PMunchFor some reason this just seemed to hang, so I echoed out the request during every iteration, and all of a sudden it works
13:34:47Araqyeah, you're better off with a global bool flag
13:34:52Araqatomic operations and polling
13:34:58PMunchI wonder if this is just Nim or C optimising away the check for a variable that can't change (without taking into consideration the sending thread) and just outputting a "while true: discard" or something
13:35:17PMunchWell I can't have a global bool
13:35:42PMunchBasically the main thread is going to be a cache handler which will keep an up to date record of some data
13:35:56Araqit's usually a more subtle timing issue (data race?), rarely an optimizer thing but who knows
13:36:07PMunchWhen another thread needs this data it sends a request and needs to get a reply
13:36:28FromGitter<ynfle> Is there an easy way to insert commas in to `int`s for printing?
13:36:57PMunchBut the sending thread doesn't write anything, and the reading thread is the only writer
13:37:06PMunchSo a data race shouldn't happen..
13:37:15Araqthere is strutils.insertSep but don't do that, commas are American style, others prefer dots
13:38:09FromDiscord<lqdev> maybe insert _ or '
13:38:24FromDiscord<lqdev> _ nim-style and ' calculator LCD style
13:41:06PMunchIt works even if I just do discard $request in my loop
13:42:20PMunchHmm, it works as long as I echo anything..
13:42:53PMunchMight actually be timing, sleep(1) also works..
13:45:13PMunchWorks if I switch the reading of the boolean to atomic operations
13:45:20PMunchMight've been some strange caching behaviour..
13:50:06FromGitter<ynfle> Thanks @Araq
13:50:33FromDiscord<mbenam> Good morning all. How do we see the documentation of the package nimpdf? I looked in the pkgs folder. Didn't see anything.
13:53:01PMunchYou need to build the documentation yourself
13:53:22FromDiscord<mbenam> Any guidance please?
13:55:43PMunchOh wait, it's not documented the way I thought..
13:57:02PMunchHmm, I could've sworn I had read some documentation for it
13:57:11PMunchBut I might've just looked at the examples and the docs.txt file
13:57:52FromDiscord<mbenam> It says in the git to use docutils
14:00:15PMunchI guess you could try
14:01:27FromDiscord<mbenam> I am trying to convert existing pdf pages to jpgs. Without looking at the documentation, not sure if this package will help. I will do some digging how to use docutils.
14:01:52PMunchAh, I don't think it will
14:02:02PMunchThis is for creating PDFs IIRC
14:02:25FromDiscord<mbenam> Yes, I was afraid of the same thing.
14:02:40FromDiscord<mbenam> Any other package that you can think of?
14:03:50PMunchNot really, I'd probably just use inkscape or something like pdftoppm
14:04:15PMunchOr imagemagick
14:05:07disruptek!repo imagemagick
14:05:08disbothttps://github.com/zedeus/nimagemagick -- 9nimagemagick: 11ImageMagick wrapper for Nim (MagickCore/MagickWand) 15 5⭐ 1🍴
14:05:11FromDiscord<mbenam> I am aware of those. Just didn't want to install all these mega apps for this
14:05:37PMunchImagemagick takes 10Mb on my machine..
14:05:39PMunchNot exactly mega
14:06:05PMunchAbout 1/20th of what VSCode takes
14:06:14FromDiscord<mbenam> I will look into that.
14:06:53FromDiscord<mbenam> I was trying to get a small self contained package that I could give to my other team members.
14:07:45alehander92Araq ok
14:08:13alehander92another thing i see is .. the pointer analysis just gives you a final group of sets right
14:08:38disruptekdude, it's too early in the morning for group sets.
14:08:40alehander92but this is not great
14:08:46alehander92oi disruptek!
14:09:01alehander92as a = b; a = A() can mean
14:09:28alehander92i mean
14:09:31alehander92it would be wrong
14:09:36alehander92at one of the lines
14:09:59alehander92either {a} {b} (but its {a, b} on 1) or {a, b} (but its {a} {b} on 2)
14:10:49alehander92so one just needs sets for each step (so basically to build them parallelly to the flow traversal)
14:14:12*Kaivo quit (Ping timeout: 256 seconds)
14:16:10*Kaivo joined #nim
14:18:20disruptekAraq: is concepts ready for testing?
14:20:18alehander92huh and in both cases: too liberal and too conservative alias sets, it seems one can have a bug on theory
14:20:32FromDiscord<lqdev> PMunch: that's deep underestimation. vscode takes about 1600Mb
14:20:52FromDiscord<lqdev> 10Mb*20 = 200Mb
14:21:34alehander92too liberal can wrongly see a, b as aliased and permit deref b based on a check
14:22:02superbiaTotal Installed Size: 77.09 MiB
14:22:22alehander92too conservative can wrongly see a, b as not aliased and permit deref b.field after b check ; mutation a.field
14:22:51alehander92so it's like one just needs correct sets at each point
14:24:38alehander92ok this is not a problem: one can just not permit stuff for aliased, but only warn (and require checks otherwise)
14:24:49alehander92so this means more liberal is better
14:25:51FromDiscord<lqdev> superbia: i checked with `du -h /usr/share/vscodium-bin` and it says `216M` which i rounded off to 200MiB. which is about 1600Mb
14:26:19FromDiscord<lqdev> unless you're talking about imagemagick, didn't check that one
14:27:28superbiai have the open source versionen then, hence less megs
14:29:14alehander92so in this case we can use the final alias set but it wouldn't be very precise
14:29:19alehander92so it might have more false positives
14:31:52FromDiscord<mbenam> decided to install poppler library on windows finally and use pdftocairo. Total install size 17mb.
14:37:11*vicfred joined #nim
14:40:12*gmaggior joined #nim
14:41:25*narimiran quit (Ping timeout: 240 seconds)
14:41:31*AndChat|21441 quit (Ping timeout: 246 seconds)
14:44:14*superbia1 joined #nim
14:46:06*superbia quit (Disconnected by services)
14:46:08*superbia1 is now known as superbia
14:55:20*AndChat|21441 joined #nim
14:55:36FromDiscord<LiteLotus> just double checking, continue in a while loop skips this iteration of the while loop and goes to the next one right?
14:55:48FromDiscord<lqdev> kind of
14:56:08FromDiscord<lqdev> every loop has an implicit `block` in it
14:56:15FromDiscord<lqdev> and `continue` simply `break`s that block
14:56:30FromDiscord<LiteLotus> oh ok
14:56:35*gmaggior quit (Ping timeout: 240 seconds)
14:56:39FromDiscord<lqdev> so it does skip the iteration yes
14:56:40FromDiscord<LiteLotus> but does it break out of the loop?
14:56:46FromDiscord<lqdev> no
14:56:50FromDiscord<LiteLotus> ok good
14:57:15FromDiscord<lqdev> sent a code paste, see https://play.nim-lang.org/#ix=2xcq
14:57:21FromDiscord<lqdev> so the effect is the same
14:57:28FromDiscord<LiteLotus> nice ok
14:57:31FromDiscord<dk> the block should be outside
14:58:03FromDiscord<lqdev> no
14:58:05FromDiscord<LiteLotus> not if you dont want to break out of the loop
14:58:06FromDiscord<lqdev> it's _inside_
14:58:14FromDiscord<dk> nvm, delet
14:58:25FromDiscord<lqdev> https://nim-lang.org/docs/manual.html#statements-and-expressions-continue-statement
14:58:31FromDiscord<LiteLotus> thanks
15:02:59*gmaggior joined #nim
15:04:07*AndChat|21441 quit (Ping timeout: 240 seconds)
15:07:43FromDiscord<LiteLotus> sent a code paste, see https://play.nim-lang.org/#ix=2xcE
15:08:03FromDiscord<LiteLotus> (edit) 'https://play.nim-lang.org/#ix=2xcE' => 'https://play.nim-lang.org/#ix=2xcF'
15:08:28FromDiscord<lqdev> nim-lang.org/docs/strformat.html
15:08:31FromDiscord<lqdev> (edit) 'nim-lang.org/docs/strformat.html' => 'https://nim-lang.org/docs/strformat.html'
15:08:40FromDiscord<lqdev> it's even better
15:08:50FromDiscord<lqdev> since you can embed expressions directly in strings
15:08:54FromDiscord<LiteLotus> it looks like a version of regexp
15:09:05FromDiscord<LiteLotus> i saw it but dont see how it does what i want
15:09:15FromDiscord<lqdev> otherwise you have https://nim-lang.org/docs/strutils.html#%25%2Cstring%2CopenArray%5Bstring%5D
15:09:57FromDiscord<lqdev> sent a code paste, see https://play.nim-lang.org/#ix=2xcH
15:10:05FromDiscord<LiteLotus> fuf
15:10:08FromDiscord<LiteLotus> (edit) 'fuf' => 'huh'
15:10:13FromDiscord<LiteLotus> yeah that is better
15:10:44FromDiscord<LiteLotus> why is an example like that not in the docuimentation?
15:10:56FromDiscord<lqdev> there is.
15:11:05FromDiscord<lqdev> literally at the top of the page
15:11:05FromDiscord<LiteLotus> not in str format
15:11:12FromDiscord<lqdev> in this section https://nim-lang.org/docs/strformat.html#fmt-vsdot-amp
15:11:15FromDiscord<lqdev> the first code example.
15:11:30FromDiscord<LiteLotus> oh
15:11:36FromDiscord<LiteLotus> hes doing it with a do assert
15:11:36FromDiscord<LiteLotus> why
15:11:37FromDiscord<lqdev> but i guess it's not really worded well
15:11:49FromDiscord<LiteLotus> i thought it was some form of regex testing
15:12:13FromDiscord<lqdev> because doAssert asserts that an expression is true. if it's not, it raises an exception
15:12:23FromDiscord<LiteLotus> but this isnt live code
15:12:30FromDiscord<LiteLotus> i cant see if its raising anyghint
15:12:34FromDiscord<lqdev> contrary to regular `assert`, `doAssert` works also in release mode
15:12:35FromDiscord<LiteLotus> i mean i guess it isnt
15:12:50FromDiscord<lqdev> you can be sure it doesn't raise because all examples in the documentation are checked
15:13:09FromDiscord<LiteLotus> yeah but thats not what im reading when i see this in documentation
15:13:23FromDiscord<LiteLotus> what im seing is a test not someone saying this wequals this
15:13:43FromDiscord<lqdev> i don't get what you mean.
15:13:48FromDiscord<LiteLotus> no documentation does that anywhere
15:14:09FromDiscord<LiteLotus> no documentation that i have ever read says that 1 ==1 with some form of test function
15:14:42FromDiscord<lqdev> really?
15:14:46FromDiscord<LiteLotus> yeah
15:14:52FromDiscord<LiteLotus> read the C# documentation
15:14:57FromDiscord<lqdev> well nim docs have that all around
15:14:59FromDiscord<LiteLotus> or any of the TS / JS documentation
15:15:08FromDiscord<LiteLotus> or any Python documentation
15:15:11FromDiscord<lqdev> it's a form of explaining how something works, but with actual code examples
15:15:24FromDiscord<lqdev> cppreference.com also has examples like those
15:15:35FromDiscord<LiteLotus> i guess its a cpp thing
15:15:47FromDiscord<LiteLotus> or low level language thing
15:16:26FromDiscord<LiteLotus> but in c#, js /ts, and python documentation they will give you the code snippet and then show you what it equals
15:16:37FromDiscord<LiteLotus> but they wont relate the too with a test function
15:16:42FromDiscord<LiteLotus> (edit) 'too' => 'two'
15:16:47FromDiscord<LiteLotus> im not a compiler
15:16:57FromDiscord<LiteLotus> im a human reading text
15:17:00FromDiscord<lqdev> um
15:17:05FromDiscord<lqdev> but the meaning of `doAssert` is clear
15:17:08FromDiscord<lqdev> it's an assertion
15:17:33FromDiscord<lqdev> by reading the example you know that a proc/macro/iterator/whatever works that way
15:17:59FromDiscord<lqdev> haven't you seen an assertion before?
15:18:01FromDiscord<LiteLotus> i mean sure, but there is doing things one way because you want to and there is doing it another because its widely used and easy to read
15:18:11FromDiscord<LiteLotus> not in documentation
15:18:22FromDiscord<LiteLotus> when writing tests sure
15:18:26FromDiscord<LiteLotus> never in documentation
15:18:35FromDiscord<lqdev> it's not just because you want to, the documentation also serves as a test suite this way while simultaneously being human-readable
15:18:51FromDiscord<lqdev> show me a concrete example how other docs solve this problem.
15:19:14FromDiscord<LiteLotus> https://www.typescriptlang.org/docs/handbook/basic-types.html
15:19:23disrupteki'm not a fan of doAssert, either.
15:19:35FromDiscord<lqdev> but that's a handbook, not the reference documentation.
15:19:51FromDiscord<LiteLotus> it serves as reference if you go through the examples
15:20:04disrupteklitelotus: the reason those docs aren't something to aspire to is that they don't convey meaning.
15:20:09FromDiscord<LiteLotus> https://www.typescriptlang.org/docs/handbook/unions-and-intersections.html
15:20:17disruptekassertions are literally truths.
15:20:34disrupteksimply assigning a value doesn't impart any semantics to the user's comprehension.
15:20:49disruptekthis is why unittests use assertion-like constructs and not mere assignments.
15:20:59FromDiscord<LiteLotus> i mean it does if we are talking about a strong typed language
15:21:08FromDiscord<LiteLotus> because i know what something does or doesnot equal
15:21:15FromDiscord<LiteLotus> pretty simple
15:21:27FromDiscord<LiteLotus> i would agree if it was a soft typed language like python
15:21:27disruptekthis concept of preconceived knowledge misses the point.
15:21:39disruptekwe're trying to convey the semantics of the types.
15:21:42disruptekassertions show that.
15:21:54FromDiscord<lqdev> assertions are runtime, not compile-time
15:21:56disruptekyou don't find words used to define themselves in the dictionary.
15:22:00*endragor quit (Remote host closed the connection)
15:22:08FromDiscord<lqdev> so by using an assertion you're checking the actual value, not the type.
15:22:33*endragor joined #nim
15:22:33FromDiscord<LiteLotus> but logic would dictate that if you understand the type you would know if they are or are not equal
15:22:50disruptekif you understand the type, you don't need the String section in the docs you linked.
15:22:54FromDiscord<LiteLotus> if you dont you dont understand the type and ned to read up on it
15:23:07disruptekthen without running this documentation, i cannot determine what it does.
15:23:13disruptekthat's not great.
15:23:18disruptekin fact, it's piss-poor.
15:23:40FromDiscord<LiteLotus> then why is that easier to understand than the nim documentation
15:23:56disrupteki would say it's not.
15:24:02FromDiscord<vieru> sent a long message, see http://ix.io/2xcM
15:24:13disrupteklook, they literally say "you can do this thing..." and this is equivalent to "this other thing".
15:24:18disruptekthat's basically an assertion.
15:24:26disruptekthey would do well to take a hint from nim's docs.
15:24:51disruptekour docs aren't just unambiguous, they are literally code that is compiled and run during the documentation process.
15:25:02disruptekthe benefit of this should be obvious.
15:25:19FromDiscord<LiteLotus> its not immediately human readable
15:25:35FromDiscord<lqdev> no, it _is_.
15:25:38FromDiscord<LiteLotus> at least to me comming from a higher level language like C#
15:25:39FromDiscord<lqdev> you just have to know the language.
15:25:44disrupteki guess you need to make friends with a human.
15:25:48FromDiscord<lqdev> the _basics_ of the language.
15:25:56*arecacea1 quit (Remote host closed the connection)
15:26:02FromDiscord<LiteLotus> i guess i dont then
15:26:08disruptekhttps://disruptek.github.io/gram/gram.html
15:26:19*arecacea1 joined #nim
15:26:41FromDiscord<LiteLotus> because assert seems like a silly way to tell me that "this" == "this"
15:27:00disruptekwhat would you prefer?
15:27:03FromDiscord<LiteLotus> just remove the do assert
15:27:11FromDiscord<LiteLotus> it would immediately make more sense
15:27:17FromDiscord<lqdev> then you're literally discarding the result of the expression goddamnit
15:27:21FromDiscord<lqdev> and literally ignoring the test
15:27:28FromDiscord<lqdev> doAssert makes sure that the expression is true
15:27:32disrupteklqdev: this might be a lost cause.
15:27:33FromDiscord<lqdev> is that really that hard to understand?
15:27:43FromDiscord<LiteLotus> nvm
15:27:51FromDiscord<LiteLotus> look thi sis going in circles
15:27:52*endragor quit (Ping timeout: 256 seconds)
15:28:16FromDiscord<LiteLotus> all im saying is as someone that writes webcode for a living this documentation is hard to read
15:28:21FromDiscord<LiteLotus> thats it
15:28:29FromDiscord<lqdev> i mean, it seemed pretty obvious to _me_ how this works. not sure what's hard to understand here
15:28:34FromDiscord<lqdev> assertions are common across many languages
15:28:40FromDiscord<LiteLotus> not everyone reads the same tho
15:28:41FromDiscord<vieru> just prepend the documentation with "doAssert does this"
15:28:57FromDiscord<vieru> and all people are happy
15:28:58FromDiscord<LiteLotus> that would work
15:29:20FromDiscord<LiteLotus> any statement following doAssert is true
15:29:42FromDiscord<lqdev> i mean, it's not like system docs are hidden or something
15:29:52FromDiscord<lqdev> you can cross-reference that pretty easily
15:30:01FromDiscord<LiteLotus> i dont want to have to go down a rabit hole of pages to find out if i can format a string
15:30:05disrupteki'm not a fan of doAssert, but you'd be surprised just how many people have opened tickets saying "the use of assert in the docs is confusing."
15:30:43FromDiscord<LiteLotus> i dont want to spend time in the doc pages when i could be coding
15:30:53FromDiscord<vieru> wasn't that hard figuring it out tbh
15:30:57FromDiscord<LiteLotus> make something simple to understand and quick to navigate to so i can get back to coding
15:31:09disruptekprobably best to code without understanding.
15:31:28FromDiscord<LiteLotus> i dont know if i can agree there
15:31:35FromDiscord<LiteLotus> i want to understand
15:31:39FromDiscord<LiteLotus> but i learn by doing
15:31:41disruptekotherwise you're just going to spend years pursuing a career you're not suited for.
15:31:51FromDiscord<vieru> lol
15:32:00FromDiscord<vieru> roasted and toasted i guess
15:32:14FromDiscord<LiteLotus> i mean im already a programmer
15:32:23FromDiscord<LiteLotus> its already my career bub
15:32:37FromDiscord<vieru> sksk
15:32:56FromDiscord<LiteLotus> im learning nim for fun
15:33:06disruptekwell, are you hiring?
15:33:25disrupteki am looking to go pro and i rarely let understanding stand in the way of coding.
15:33:41FromDiscord<vieru> sent a long message, see http://ix.io/2xcQ
15:34:16FromDiscord<LiteLotus> i never said understanding got in my way of coding, i just said i learn by doing it rather than reading it
15:34:29FromDiscord<LiteLotus> so make it quick so i can do it
15:34:47FromDiscord<LiteLotus> and at least get a surface understanding of whetever im trying to do
15:34:48disruptekvieru: sure, you want them automagically applied?
15:34:56FromDiscord<vieru> yep
15:35:14disruptek!repo nim-strenc
15:35:15disbothttps://github.com/Yardanico/nim-strenc -- 9nim-strenc: 11A tiny library to automatically encrypt string literals in Nim code 15 12⭐ 1🍴
15:35:32disruptekthat should be a good demo.
15:36:41disrupteklitelotus: you've come to the wrong place. #nim is about understanding. you need to download an editor.
15:36:59FromDiscord<LiteLotus> ...........
15:37:12FromDiscord<LiteLotus> i have an editor
15:37:16FromDiscord<LiteLotus> what do you take me for?
15:37:34disruptekbest that i don't answer that.
15:37:35FromDiscord<LiteLotus> this is going from instructional to insulting
15:37:48FromDiscord<LiteLotus> no i think you should
15:37:54FromDiscord<LiteLotus> i want to see your true colours
15:38:01disruptekit's embarrassing.
15:38:09FromDiscord<LiteLotus> say it
15:38:28FromDiscord<vieru> > !repo nim-strenc↵i can't really figure out how this works lol↵↵`gkkaekgaEE` this might be my g function right ?
15:38:37disruptekyeah.
15:38:45*hnOsmium0001 joined #nim
15:39:42FromDiscord<vieru> sent a code paste, see https://play.nim-lang.org/#ix=2xcT
15:40:01disruptekwould you mind not pasting code?
15:40:08disruptekit's a huge pita for irc people to read it.
15:40:28FromDiscord<vieru> oh sry
15:40:33disrupteki mean, just paste it without code formatting so i don't have to open a web-browser just to see what you've said. 😉
15:40:51FromDiscord<vieru> i dont use irc
15:40:58FromDiscord<vieru> its line 26-27
15:40:59FromDiscord<vieru> https://github.com/Yardanico/nim-strenc/blob/master/src/strenc.nim
15:41:03FromDiscord<LiteLotus> its a boomer thing
15:41:05disruptekthe encrypt macro is rewriting the string literals.
15:41:12*a_chou joined #nim
15:41:34FromDiscord<vieru> and what's doing the decryption ?
15:41:49FromDiscord<vieru> (edit) 'decryption' => 'decryption/decoding'
15:42:02FromDiscord<LiteLotus> hashes im guessing
15:42:31disruptekthe proc gkkaekgaEE is decrypting it.
15:43:42disruptekthe macro emits something like `gkkasdlfkasldf("garbage here", somekeyInteger)`
15:44:05disruptekso the "garbage here" is the literal that goes into your code.
15:44:12disrupteker, into your binary.
15:44:30disruptekthe code decrypts it on the fly.
15:45:21FromDiscord<vieru> sry for the dumb questions but what's the proc that encrypts ?
15:45:24FromDiscord<vieru> is it the macro ?
15:45:39disruptekthe encryption is the first line of the macro.
15:45:56disruptekthe macro is applying to all string literals automatically due to term rewriting.
15:46:24FromDiscord<vieru> ooh so gkkaekgaEE is used for both decryption and encryption ?
15:46:29disruptekright.
15:46:43FromDiscord<vieru> that was the thing confusing me
15:47:50disruptekthat line is compile-time while the macro's result, code of course, is runtime.
15:48:47FromDiscord<vieru> sent a long message, see http://ix.io/2xcZ
15:48:47*maier quit (Ping timeout: 240 seconds)
15:48:55disruptek...
15:49:12disruptekyes.
15:49:17FromDiscord<vieru> sry again lol
15:49:45FromDiscord<vieru> thanks
15:50:10disruptekis that kinda what you're trying to do?
15:50:19FromDiscord<vieru> yep
15:50:34disruptekcool.
15:51:02FromDiscord<vieru> im messing with the idea of polymorphism and im trying out things
15:51:35*NimBot joined #nim
15:52:15disruptekterm-rewriting macros are in danger of being redesigned.
15:52:53FromDiscord<vieru> why so ?
15:53:20disrupteki dunno what araq's goals are for them, but i think they are arguably too powerful.
15:53:48disruptekthey are practically magic.
15:54:39FromDiscord<vieru> this means in the future my code won't be able to do magic ↵or magic is nerfed
15:54:57FromDiscord<vieru> cus either way its bad
15:55:10disrupteki would seriously question why you need such magic.
15:56:03FromDiscord<vieru> hiding keys i guess ?
15:56:25FromDiscord<vieru> and if you have all that power
15:56:31FromDiscord<vieru> why not hide all the strings
15:56:50FromDiscord<LiteLotus> im getting a type mismatch when using strformat and i'm not sure why. i have followed the documentation almost exactly, the only difference being i have no end line character
15:57:02FromDiscord<LiteLotus> im using the & version
15:57:07disruptek~paste
15:57:07disbotpaste: 11a frowned-upon behavior in chat; please use a service such as https://play.nim-lang.org/ or http://ix.io/ or https://gist.github.com/ and supply us a URL instead. -- disruptek
15:57:23disruptekvieru: because it's obfuscation.
15:57:30disruptekit's hard for others to service your code.
15:57:32FromDiscord<LiteLotus> i hsvent pasted it yet
15:57:33*abm quit (Read error: Connection reset by peer)
15:57:36*endragor joined #nim
15:57:42disruptekplease do so.
15:57:49FromDiscord<LiteLotus> i was about to write an example
15:57:54disruptekor at least hold your laptop closer to the router so i can read the code.
15:57:55FromDiscord<LiteLotus> patience
15:58:05FromDiscord<LiteLotus> you know what
15:58:10FromDiscord<LiteLotus> fuck you ill solve it on my own
15:58:14FromDiscord<vieru> disruptek on a killing streak
15:58:17FromDiscord<vieru> lol
15:58:49FromDiscord<LiteLotus> what the fuck is with people, just becaue i either dont dev like you and dont do everything like you
15:58:50FromDiscord<vieru> > it's hard for others to service your code.↵idk what `service your code` means
15:59:02FromDiscord<LiteLotus> read it and help fix it
15:59:09FromDiscord<vieru> eng is not my first language
15:59:10disruptekit will be hard for you to understand what you've written after a few weeks/months.
15:59:18disruptekharder still for others to understand it.
15:59:32disrupteklitelotus: have some humility.
15:59:42FromDiscord<LiteLotus> about what?
15:59:51FromDiscord<LiteLotus> im literally asking for help
15:59:51disruptekabout learning.
15:59:59FromDiscord<LiteLotus> i dont know how much more humble i can get
16:00:07FromDiscord<LiteLotus> im litterally asking for help
16:00:13FromDiscord<LiteLotus> what more do you want?
16:00:19FromDiscord<LiteLotus> me to fucking bend over?
16:00:23disruptekan open mind, for a start.
16:00:28FromDiscord<LiteLotus> i do
16:00:36FromDiscord<LiteLotus> all i said was the documentation was hard ro read
16:00:50FromDiscord<LiteLotus> you yourself said a lot of people dont immediately understand it
16:00:57disruptekyou are literally criticising the use of "assert" and suggesting that the docs should be simplified so that you can get to coding sooner.
16:01:01FromDiscord<LiteLotus> how is that a hard concept for you to grasp
16:01:02disrupteki was being sarcastic.
16:01:31FromDiscord<LiteLotus> jesus
16:01:38FromDiscord<LiteLotus> you really do have your head up tour own ass
16:01:43FromDiscord<vieru> > it will be hard for you to understand what you've written after a few weeks/months.↵oh i get it now
16:01:50*slackytude[m] quit (Quit: Idle for 30+ days)
16:02:10disruptekmacros are inherently magical and hard to understand. term rewriting macros take this to another level.
16:02:46FromDiscord<vieru> well if term rewriting macros get removed ill just use a older nim version lol↵imma make my own nim2 and start propaganda
16:02:50FromDiscord<vieru> lol
16:02:59disruptekthat's the spirit. 👍
16:03:18FromDiscord<LiteLotus> your this much of a dick over me saying i didnt get the use of do assert in example documentation
16:03:30FromDiscord<LiteLotus> 👏
16:03:34disruptekjust ignore me.
16:03:53FromDiscord<vieru> dude chill that's how disruptek is ↵youll get used to him
16:03:56FromDiscord<vieru> lol
16:04:04FromDiscord<LiteLotus> nah man
16:04:08FromDiscord<vieru> its nothing personal
16:04:24FromDiscord<LiteLotus> its people like him that make newbies learning stuff turn away
16:04:44FromDiscord<LiteLotus> its the exavt same problem people had with araq
16:04:54FromDiscord<vieru> im a newbie and im laughing my ass of with disruptek
16:04:57FromDiscord<vieru> (edit) 'of' => 'off'
16:05:24FromDiscord<LiteLotus> well you two can be two dicks in a gay bar
16:05:29FromDiscord<LiteLotus> that fine
16:05:36FromDiscord<LiteLotus> im out
16:05:44FromDiscord<LiteLotus> :Peace:
16:05:57FromDiscord<vieru> see im not the one insulting you ↵you started with the gay shit lol
16:06:04voidpithe fuck with these oversensitive people?
16:06:19FromDiscord<vieru> exactly lol
16:06:21FromDiscord<LiteLotus> i was trying to be nice
16:06:32FromDiscord<LiteLotus> they started with the sarcastic shit
16:06:51FromDiscord<vieru> u fight sarcasm with sarcasm
16:07:00FromDiscord<LiteLotus> it wasnt called for
16:07:04FromDiscord<LiteLotus> at all
16:07:31FromDiscord<LiteLotus> i was asking a question
16:07:37disruptekyou didn't realize it was sarcasm until i pointed it out.
16:07:44FromDiscord<LiteLotus> exactly
16:07:46disruptekso how exactly could you've been offended by it?
16:07:56FromDiscord<LiteLotus> because i was asking a question and trying to have a conversation
16:07:59FromDiscord<vieru> dude stop that's just the way he is ↵if you dont like him or anyone on the server just don't talk with them↵none is going to kick you out of the server
16:08:15FromDiscord<vieru> try asking at a different time
16:08:17FromDiscord<vieru> as
16:08:26disruptektry asking, period.
16:08:33disrupteki'm still waiting to hear what the problem is.
16:08:35FromDiscord<vieru> (edit) 'as' => 'answers aren't like stackoverflow questions'
16:08:53FromDiscord<vieru> you won't find them when you want
16:09:03FromDiscord<vieru> ask at different times
16:09:10FromDiscord<vieru> with different people
16:09:14FromDiscord<vieru> that's what everbody does
16:09:19FromDiscord<vieru> (edit) 'everbody' => 'everybody'
16:09:48voidpiblack box!
16:09:50FromDiscord<vieru> > i'm still waiting to hear what the problem is.↵disruptek on that killing streak again lol
16:10:01*gmaggior quit (Quit: Bye)
16:10:26FromDiscord<vieru> tf im i doing im wasting my precious coding time
16:11:00FromDiscord<vieru> tryna solve internet arguments lol
16:11:22FromDiscord<vieru> (edit) 'tryna ... solve' => 'trynahelp'
16:11:22disrupteksounds like he figured it out. 🤷
16:11:43FromDiscord<LiteLotus> https://play.nim-lang.org/#ix=2xdb
16:12:25FromDiscord<LiteLotus> https://play.nim-lang.org/#ix=2xdd corrected version
16:12:25disruptekhttps://play.nim-lang.org/#ix=2xde
16:12:35*endragor quit (Ping timeout: 240 seconds)
16:12:44disruptekthe & operator comes from the strformat module.
16:12:50FromDiscord<mratsim> I'm not sure if people on IRC will see your deleted messages/edits correctly
16:12:56disruptekthey do.
16:13:00FromDiscord<LiteLotus> it was imported on my ide
16:13:08FromDiscord<LiteLotus> didnt bother to include it because thats obvious
16:13:20disruptekit's not obvious to the playground.
16:13:33FromDiscord<LiteLotus> well im assuming you have a brain
16:13:38disruptekto those reading your code, it's a conspicuous omission.
16:13:56FromDiscord<vieru> > https://play.nim-lang.org/#ix=2xde↵fuck dude you're quick
16:14:44disruptekit was only two bugs.
16:14:45FromDiscord<LiteLotus> its a linter error
16:15:00disruptekthere's no error afaict.
16:15:09FromDiscord<LiteLotus> looks like its just my linter that sees it as a type missmatch
16:15:31disruptekvim works well for me with leorize's nim.nvim package.
16:15:33disruptek!repo nim.nvim
16:15:34FromDiscord<LiteLotus> a linter error means that my linter isnt reading it properly
16:15:34disbothttps://github.com/alaviss/nim.nvim -- 9nim.nvim: 11Nim plugin for NeoVim 15 95⭐ 13🍴 7& 3 more...
16:15:52FromDiscord<LiteLotus> ty
16:16:03disrupteknp
16:16:58FromDiscord<vieru> enough to make a grown man cry https://media.discordapp.net/attachments/371759389889003532/754012619219664925/unknown.png
16:17:14FromDiscord<LiteLotus> im fine when your direct
16:17:44FromDiscord<vieru> type mismatch
16:17:49FromDiscord<vieru> word 4
16:17:56FromDiscord<vieru> line 1
16:18:16FromDiscord<vieru> did you mean "you're" ?
16:18:24FromDiscord<vieru> lol
16:18:28FromDiscord<LiteLotus> yeah i did
16:18:46FromDiscord<LiteLotus> though wouldnt that be unrecognised symbol?
16:19:03FromDiscord<ache of head> “Your” is a word, so I guess not
16:19:06FromDiscord<vieru> nah sry we don't do that
16:19:07FromDiscord<ache of head> If it said skdjwiwnsiddnwja
16:19:16FromDiscord<ache of head> That would be an unrecognized symbol 😆
16:19:28FromDiscord<vieru> @LiteLotus fix your eng linter lol
16:19:43FromDiscord<LiteLotus> it was born defective, im dyslexic
16:19:51FromDiscord<vieru> thats cap
16:20:11FromDiscord<vieru> dyslexic people cant write dyslexic
16:20:17FromDiscord<vieru> even i struggle lol
16:20:53FromDiscord<LiteLotus> im pretty high functioning tho, just bad at grammar, not so much the words themselves
16:21:08FromDiscord<alehander42> hey guys
16:21:27FromDiscord<alehander42> yeah i've seen the struggle
16:21:28FromDiscord<ache of head> Wassup
16:21:41FromDiscord<alehander42> it's so strange when we all have faces!
16:21:46FromDiscord<alehander42> i am used to irc/gitter
16:21:54FromDiscord<vieru> im a cat
16:22:00FromDiscord<JSGRANT> @alehander42 Don't worry; Most are memes
16:22:19FromDiscord<LiteLotus> i tried irc, just thought everything else did it better. and gitter is always dead
16:22:29FromDiscord<alehander42> hm gitter works for me
16:22:42FromDiscord<LiteLotus> not the nim one, just all the other ones xD
16:22:43FromDiscord<alehander42> but i like to switch
16:22:55FromDiscord<alehander42> crystal is also ok
16:22:57FromDiscord<LiteLotus> couldnt justify using gitter just for nim
16:22:59FromDiscord<alehander42> typing etc
16:23:07FromDiscord<alehander42> but it depends on which communities you need
16:23:15FromDiscord<JSGRANT> IRC is slooooowly dying in-general; Freenode during the early 2000s was 'poppin' but has been on a major decline without anything really firmly taking its place
16:23:25FromDiscord<alehander42> discord is a bit dangerous
16:23:28FromDiscord<LiteLotus> i was 3 in 2000
16:23:34FromDiscord<alehander42> as it's just a company i think
16:23:43FromDiscord<alehander42> dude my wife was 4 in 2000
16:23:49FromDiscord<alehander42> you want scare me with your youth!
16:23:59FromDiscord<JSGRANT> @LiteLotus I'm not even 30 yet ... stop making me feel 50 lol
16:24:13FromDiscord<alehander42> (i was 8, so i almost remember the big new year stuff!)
16:24:32FromDiscord<JSGRANT> @alehander42 About the same, yeah
16:24:41FromDiscord<LiteLotus> i remember arriving in the UK 2 months after 2000 jan 1st
16:24:45FromDiscord<alehander42> @JSGRANT you look 42
16:24:50FromDiscord<alehander42> in a good way
16:24:53FromDiscord<LiteLotus> i was 3 1/2
16:25:06FromDiscord<vieru> i wasn't even existing in 2000
16:25:12FromDiscord<vieru> lol
16:25:25FromDiscord<JSGRANT> @alehander42 That was taken when I was like 21 too; I'm nearlu 7 years older now
16:25:36FromDiscord<LiteLotus> <a:s_eyes:722096794833649725>
16:25:39FromDiscord<JSGRANT> n e a r l u
16:25:41FromDiscord<alehander42> i remember 4 years old atsea
16:25:43FromDiscord<JSGRANT> ahahahaha
16:25:50FromDiscord<alehander42> wow well good stuff
16:25:57FromDiscord<alehander42> i am not very good with dates probably
16:26:01*natrys joined #nim
16:26:21FromDiscord<LiteLotus> @JSGRANT you look like my old room mate but a little older
16:27:06FromDiscord<LiteLotus> @disruptek i need to setup my NVIM properly
16:27:07FromDiscord<JSGRANT> Did he also wear a comically small hat?
16:27:16FromDiscord<LiteLotus> yrah, a tiny fez
16:27:22FromDiscord<LiteLotus> (edit) 'yrah,' => 'yeah,'
16:27:42disruptekhttps://github.com/alaviss/nim.nvim#auto-completion
16:27:50FromDiscord<JSGRANT> How are you sure I'm not him, then? lol
16:28:24FromDiscord<LiteLotus> is your name Jake Adams
16:28:56FromDiscord<LiteLotus> @disruptek tyvm
16:30:02FromDiscord<JSGRANT> The first and last-name have the same amount of letters with the J being in the same places and the second-a in Adams being in the same places for Josh Grant -- so, pretty close; Explains my 5 years of amnesia
16:30:35FromDiscord<LiteLotus> :wheeze:
16:40:20*PMunch quit (Quit: leaving)
16:41:02*Trustable joined #nim
16:43:52*endragor joined #nim
16:50:40*waleee-cl joined #nim
16:56:09*FromDiscord quit (Remote host closed the connection)
16:56:24*FromDiscord joined #nim
16:58:05*krux02__ joined #nim
17:01:22*endragor quit (Ping timeout: 256 seconds)
17:01:27*krux02_ quit (Ping timeout: 240 seconds)
17:08:15*endragor joined #nim
17:12:55*endragor quit (Ping timeout: 256 seconds)
17:21:52*solitudesf quit (Remote host closed the connection)
17:23:27*agent0x00 quit (Ping timeout: 240 seconds)
17:24:52*Trustable quit (Remote host closed the connection)
17:27:22FromDiscord<Rika> who's incrementing the "times disruptek annoyed a newbie" counter
17:38:06disrupteki think it rolled over again.
17:40:59*pietroppeter quit (Quit: Connection closed for inactivity)
17:42:07*endragor joined #nim
17:42:28superbiawhy is doAssert("--port=1234"[7 .. ^3] == "12") not 1
17:42:54disruptekindices are inclusive.
17:43:11superbiawhere is ^0
17:43:48disrupteki guess it's just past the end of the collection.
17:44:03superbiaso ^1 is "4"
17:44:06disruptekyes.
17:44:14superbiawhat logix is that
17:44:36disruptekthink of it this way, does it make sense to write down values that /don't/ correspond to indices you want to retrieve?
17:44:42disruptekhow is /that/ logical?
17:45:28superbiathis is the first time I see Splice so my brain can't digest it
17:45:35superbias/splice/slice
17:45:46disruptekit will grow on you.
17:46:21disruptekif it helps, ranges are inclusive, too.
17:46:27disruptek1 .. 10 includes both 1 and 10.
17:46:40disruptekso [1 .. 10] is of course of the same length.
17:46:42superbia"0123456789"[3 .. ^3] := 3456 ?
17:46:56disruptek^3 is 7, so, no.
17:47:19superbiaok i get it now
17:47:33FromDiscord<Rebel> you know you could just go to the playground and run these snippets
17:47:33FromDiscord<Rika> `^n` is `nth to the last`
17:47:40FromDiscord<Rika> or used eval
17:47:53FromDiscord<Rika> `!eval echo "0123456789"[3 .. ^3] == "3456"`
17:47:59FromDiscord<Rika> oops, without the ``
17:48:03FromDiscord<Rika> !eval echo "0123456789"[3 .. ^3] == "3456"
17:48:05NimBotfalse
17:48:26superbiadisruptek: ok thanks. i understand it perfectly now
17:48:32disrupteksee also ..<
17:48:36superbiai had some stuff in the past where this could be useful
17:50:07*krux02__ quit (Remote host closed the connection)
18:04:35*endragor quit (Ping timeout: 265 seconds)
18:06:26*awe001 joined #nim
18:08:48*tsujp quit (Ping timeout: 260 seconds)
18:09:53FromDiscord<Rebel> Is there a convenient way to convert nim to nimscript?
18:09:58*awe00 quit (Ping timeout: 260 seconds)
18:10:28Zevvleorize: I feel stupid. I have my nvim config on one machine that does not want to :q
18:10:31Zevvoh damn
18:12:34FromDiscord<Rika> @Rebel most nim code can be run in nimscript, but not all, so what's the issue?
18:13:00FromDiscord<Rebel> FFI
18:13:22FromDiscord<Rika> yeah that cant be dont in nimscript, what exactly about ffi?
18:13:25FromDiscord<Rika> done*
18:13:35*narimiran joined #nim
18:15:35FromDiscord<Rebel> hmmm just realized that wouldn't solve my predicament ignore that
18:15:51FromDiscord<Rebel> if I want to use Windows API functions in nimscript I just need to take the functionality and port it to pure nim
18:15:52FromDiscord<Rebel> (edit) 'nim' => 'nimscript'
18:16:47*a_chou quit (Ping timeout: 240 seconds)
18:24:30*gmaggior joined #nim
18:35:39*awe001 quit (Ping timeout: 256 seconds)
18:36:29FromDiscord<Lod> Just noticed github changed Nim color! 😄
18:38:28federico3if only it supported Nim properly
18:39:04*arecacea1 quit (Remote host closed the connection)
18:39:36*arecacea1 joined #nim
18:41:57FromDiscord<haxscramper> > if I want to use Windows API functions in nimscript I just need to take the functionality and port it to pure nimscript↵@Rebel If you want you can export nim procs to nimscript using `compiler/nimeval.implementRoutine`. Use example: https://github.com/nim-lang/Nim/blob/devel/tests/compilerapi/tcompilerapi.nim#L26
18:42:58*solitudesf joined #nim
18:43:13FromDiscord<exelotl> I don't understand this PR, how is it different from `pairs`? https://github.com/nim-lang/Nim/pull/15297
18:43:14disbotadd `enumerate` macro
18:44:46FromDiscord<Rebel> hmmmm thanks haxscramper that's pretty cool
18:45:26*endragor joined #nim
18:45:33narimiran@exelotl it might replace `pairs` at some point. maybe.
18:46:54Zevvbah why does walkDir return a different type then walkDirRec
18:46:58FromDiscord<haxscramper> > I don't understand this PR, how is it different from `pairs`? ↵@exelotl `pairs` with indexes is implemented for `seq[]` openarray, but for user-defined collections (and types that already implement `pairs` differently) you need to use somewhat awkward loop constructs with `var idx`
18:48:27FromDiscord<Rebel> hexscramper any chance you have an example of exporting a proc that uses importc and the dynlib pragma such as TerminateProcess https://github.com/khchen/winim/blob/d300192c588f73dddef26e3c317f148aa23465c3/winim/inc/winbase.nim#L1939 and using nimeval.implementRoutine?
18:55:07FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2xeF
19:06:34gmaggiors.delete(0,high(s)) is this the idiomatic way to delete all elements in a seq s?
19:06:49FromDiscord<Elegant Beef> `s.setlen(0)`
19:06:50FromDiscord<lqdev> s.setLen(0)
19:06:59gmaggiorthanks!
19:07:28FromDiscord<Elegant Beef> sadly i dont think there is a way to just clear the seq whilst saving the capacity
19:07:43*endragor quit (Ping timeout: 260 seconds)
19:07:46FromDiscord<lqdev> wdym?
19:07:59FromDiscord<Elegant Beef> I believe setLen resets the capacity, so it frees memory
19:08:03FromDiscord<Rika> setlen doesnt lower capacity i dont think
19:08:06FromDiscord<lqdev> it doesn't
19:10:51FromDiscord<Elegant Beef> it didnt explictly state the capacity doesnt decrease so i was skeptical if it left the capacity 😄
19:17:28*Perkol joined #nim
19:21:24FromDiscord<lqdev> it's an implementation detail
19:21:38FromDiscord<lqdev> you shouldn't worry about it, the stdlib will do the right thing.
19:21:46*a_chou joined #nim
19:22:41FromDiscord<Rebel> hmmm thanks hexscramper that doesn't look too bad I will play around with it later today
19:30:47*narimiran quit (Ping timeout: 240 seconds)
19:32:14*zyklon joined #nim
19:32:59*Perkol quit (Remote host closed the connection)
19:33:27*endragor joined #nim
19:36:47*Vladar quit (Quit: Leaving)
19:40:52Araqso ... optimizing my ORC algorithm makes valgrind happy what's up with that...
19:42:20FromDiscord<whisperdev> Is there any p2p lib for Nim?
19:42:26FromDiscord<Elegant Beef> You optimized the valgrind happiness generator?
19:43:11*endragor quit (Ping timeout: 265 seconds)
19:56:54FromDiscord<whisperdev> Araq is Denis Felsing someone you personally know?
20:00:05FromDiscord<Rika> kinda suspicious to ask that
20:00:25disruptekAraq: concepts... are they ready for testing?
20:02:28FromDiscord<Yardanico> @whisperdev that's def- https://github.com/def-
20:10:29*krux02 joined #nim
20:11:10disruptekadding timing to testes was totally worthwhile.
20:16:42*endragor joined #nim
20:18:09*femtotones joined #nim
20:24:36shashlickBusy morning looks like
20:24:58disruptekskiplists on arc are ~2.5x faster than refc.
20:25:21disruptekshashlick: can't wait for that nimble release to make it into nightlies.
20:25:50disrupteki've been working outside. gorgeous day here.
20:25:51shashlickWhat is it good for?
20:25:59disruptektesting packages.
20:26:13shashlickJust added namedBin
20:26:34disruptekthe hits, the hits, the hits they just keep comin'.
20:27:30shashlickcontemplating https://github.com/nim-lang/nimble/issues/542
20:27:31disbotPossible to make `nimble install` install the binary built using a NimScript task
20:28:34FromDiscord<Avatarfighter> Ello everyone
20:28:42disrupteki don't understand it.
20:28:44FromDiscord<lqdev> hi
20:29:05FromDiscord<Avatarfighter> What is new @lqdev ?
20:29:34FromDiscord<lqdev> nothin', i'm on a creative block rn
20:29:45disruptekshashlick: why don't you just let people override the `install` task like they do `test`?
20:29:52FromDiscord<Avatarfighter> rip
20:30:10shashlick29 nimble issues closed since Aug 1
20:30:33disruptekhe had to go for a run after that convo with litelotus.
20:31:01disruptekyou are a badass shashlick, i don't care what rika says about you.
20:31:03shashlickI think he really wants `nimble build` to be overridden
20:31:31shashlickor at least a custom task that can add to the list of binaries
20:31:39FromDiscord<Avatarfighter> disruptek what is new are you on the west coast yet
20:31:53shashlickhe's in the north eeeeast I think
20:32:21disrupteknaw dawg, i can't travel without cashish.
20:32:29FromDiscord<Avatarfighter> yes but he said he was coming towards westcoast soon! Im trying to figure out when disruptekcon2020 is taking place
20:32:34disruptekanyway, i have to hit austin first.
20:32:46disruptekmy truck only gets like 8mpg with my house behind it.
20:32:53FromDiscord<Avatarfighter> ah
20:33:10shashlickif that nimble proposal goes thru, we can kill another 11 issues, and perhaps even more
20:33:12disruptekideally, i'd be in ca by spring.
20:33:17shashlickstill need to go thru the full issue list
20:33:23FromDiscord<Avatarfighter> by spring jesus
20:33:28*lritter quit (Ping timeout: 260 seconds)
20:33:33disruptekwell, i'm stone broke right now.
20:33:33FromDiscord<Avatarfighter> You taking the Oregon trail?
20:33:45disruptekfighting the feds to keep 'em from taking my shop.
20:33:48FromDiscord<Avatarfighter> aw 😦
20:33:50shashlickwhat's in CA man, Austin's the place
20:33:59*lritter joined #nim
20:34:17disruptekpffbt texas can't compete with ca; it's embarrassing that you try.
20:34:44shashlickI don't try anything so it works
20:34:47FromDiscord<Avatarfighter> CA has me shashlick, hence why austin cant compete
20:34:58disruptekwhere are you, fighter?
20:35:09FromDiscord<Avatarfighter> im a bit south of SF
20:35:18disruptekbig sur?
20:35:35FromDiscord<Avatarfighter> nah im in the middle of the silicon valley
20:35:43FromDiscord<Avatarfighter> mountain view
20:36:00disrupteklovely rents out there.
20:36:09FromDiscord<Avatarfighter> yeahhh
20:36:22FromDiscord<Avatarfighter> its definitely a bit of a problem
20:36:22disruptekcamping in that area runs me almost $3k/month.
20:36:50*xet7 joined #nim
20:36:58FromDiscord<Avatarfighter> What sucks is that most of the area around me is on fire
20:37:08disruptekthere is that, too, yeah.
20:37:22*krux02 quit (Remote host closed the connection)
20:37:29FromDiscord<Avatarfighter> i went camping to a campground and a week later its gone now
20:37:44disrupteki had to flee a fire in the sierras a couple years ago.
20:37:56FromDiscord<Avatarfighter> Fire is a little too fast
20:38:07*endragor quit (Ping timeout: 258 seconds)
20:38:09FromDiscord<Avatarfighter> its barely faster than the nim compile time
20:38:22disruptek🔥
20:39:39FromDiscord<LiteLotus> does anyone have a link to the enum documentation?
20:39:44FromDiscord<LiteLotus> i cant seem to find it
20:40:16FromDiscord<LiteLotus> im trying to see if an enum has a value equal to a string
20:40:32disruptek$someEnum == "someString"
20:40:32FromDiscord<haxscramper> https://nim-lang.org/docs/manual.html#types-enumeration-types
20:41:04disruptekhttps://nim-by-example.github.io/types/enums/
20:41:24FromDiscord<Avatarfighter> https://nim-lang.org/docs/manual.html#types-enumeration-types
20:41:27disruptekthis site is almost illegible on my display.
20:44:23FromDiscord<Avatarfighter> Im going to see if i can get nim to compile on my phone
20:44:28FromDiscord<Avatarfighter> im burnt out rn 😦
20:44:46FromDiscord<LiteLotus> i really should say what i really want to do. i want to set a variable to an enum valu but get the enum value from a string
20:44:58FromDiscord<LiteLotus> @Avatarfighter prety easy with termux
20:45:06disruptekparseEnum[SomeEnumType]("someString")
20:45:19FromDiscord<LiteLotus> termux has nim in its default repository
20:45:22FromDiscord<Avatarfighter> @LiteLotus on iOS though?
20:45:23disruptekstrutils module.
20:45:45FromDiscord<LiteLotus> @Avatarfighter might be fucked on ios <:shrug_:641054621430841345>
20:45:55FromDiscord<LiteLotus> @disruptek ty my man
20:45:59FromDiscord<Avatarfighter> im jailbroken so i can probably do it just need to make sure nim doesnt consume my phone
20:49:15FromDiscord<LiteLotus> @disruptek ive gotten used to the doAssert thing
20:49:23disrupteki don't believe it.
20:49:51FromDiscord<LiteLotus> i know right
20:50:28disruptekwhat else is confusing?
20:52:09FromDiscord<LiteLotus> why i live
20:53:15FromDiscord<Avatarfighter> hey disruptek want to make httpclient support socks
20:53:20disrupteknope.
20:53:27FromDiscord<Avatarfighter> pretty please
20:53:33disruptekworking on ic.
20:53:37FromDiscord<Avatarfighter> ic?
20:53:44disruptekincremental compilation.
20:53:50FromDiscord<Avatarfighter> ewwww
20:53:56FromDiscord<LiteLotus> 👀
20:54:08FromDiscord<LiteLotus> is disruptek god?
20:54:22FromDiscord<Avatarfighter> no disruptek is disruptek
20:54:32disruptek100% disruptek
20:54:56FromDiscord<Avatarfighter> Disruptek is built different 😈
20:55:24disruptek!package disruptek
20:55:24disbotdisruptek hung like rhinocerous🦏
20:55:33FromDiscord<Avatarfighter> LMAO
20:55:37FromDiscord<ache of head> lmao
20:55:52disruptekdisbot: you so horny?
20:55:53disbotyep. 😊
20:56:00disruptekhmm.
20:56:21FromDiscord<Avatarfighter> Can irc see images i send?
20:56:45disruptekwe usually get links.
20:57:23FromDiscord<LiteLotus> :No:
20:58:05bozaloshtshwill nim ever be able to infer none() as none[T]() when my proc returns Option[T]?
20:58:13bozaloshtsh(sorry if sent twice, may have been dc'd first time)
20:58:22disruptekit does this already.
20:58:31bozaloshtshoh.
20:59:20bozaloshtshhttp://ix.io/2xfk
20:59:25bozaloshtshthis gives me "could not instantiate: T"
20:59:50disruptekresult is none() by default; so simply `result = some` or don't set result.
21:00:01bozaloshtshah gotcha
21:00:14disruptekif g.getMoveCount > 0: some(...) # sufficient
21:00:32bozaloshtshwould be nice if it could deduce that T=MCMove, this is a bit of a simplified example
21:00:46disruptekwell, help us out by making it a generic.
21:01:13disruptek!repo badresults
21:01:14disbothttps://github.com/disruptek/badresults -- 9badresults: 11like results but worse 15 0⭐ 0🍴
21:01:30disruptekwho here knows how to use koch?
21:01:52FromDiscord<Recruit_main707> when a function argument type is `ptr T` isnt `nil` a valid arg?
21:01:56disrupteki'm told there's some trick involving the motion of the ocean.
21:02:11disruptekrecruit: nil.SomeType
21:02:38disrupteknil as ptr argument will eventually require such a conversion to avoid bugs.
21:04:58femtotoneswhy % not mod
21:05:08FromDiscord<Recruit_main707> `nil.GLint`↵`Error: type mismatch: got <typeof(nil)> but expected 'GLint = int32'`
21:05:23femtotonesrecruit: 4 % 2
21:05:58disruptekit doesn't appear to accept a ptr.
21:06:10femtotonesisnt that an expression
21:06:13femtotonesoh sorry nvm
21:06:27FromDiscord<Recruit_main707> nvm, it works now with only nil, magic moment of the day
21:06:52disruptekcreepy.
21:06:52femtotonesoh sorry thought you were a bot lmao
21:07:12FromDiscord<Rika> recruit is now a bot lol
21:07:38FromDiscord<Recruit_main707> lmfao
21:07:50FromDiscord<Recruit_main707> this is too good
21:08:38FromDiscord<Recruit_main707> you can do !eval ... for a real bot
21:13:52*gmaggior quit (Ping timeout: 246 seconds)
21:16:28FromDiscord<JSGRANT> @disruptek That results lib should've been called "badnews" lol
21:17:07disrupteki tried to pr results but they didn't like my changes.
21:17:24disruptek!repo nim-results
21:17:25disbothttps://github.com/xyb/googlesearch.nim -- 9googlesearch.nim: 11Nim library for scraping google search results 15 4⭐ 1🍴 7& 3 more...
21:17:28disruptek!repo results
21:17:29disbothttps://github.com/xyb/googlesearch.nim -- 9googlesearch.nim: 11Nim library for scraping google search results 15 4⭐ 1🍴 7& 7 more...
21:17:31disruptekdamnit.
21:17:33FromDiscord<JSGRANT> rip
21:17:43disruptekwell, there's one out there.
21:17:57FromDiscord<JSGRANT> https://github.com/arnetheduck/nim-result ?
21:18:00disruptekyeah.
21:19:15FromDiscord<JSGRANT> @disruptek Btw, that was an attempt at a pun; "On negative / bad news." and not a statement about the existence of the lib -- if I wasn't clear lol
21:19:24disruptekno, i get it.
21:19:44disruptekjust explaining why it has to be `badresults` instead. 😉
21:20:45FromDiscord<JSGRANT> Spurned lover territory; lol
21:24:20*endragor joined #nim
21:26:55*gmaggior joined #nim
21:30:57FromGitter<janni-adamski> Hi! Does nim support introspection? And if yes, is there an easy example? A link would be great. :)
21:31:05disrupteknot really, no.
21:31:22disrupteki assume you mean runtime introspection.
21:31:44FromGitter<janni-adamski> compile time introspecction would be good too
21:31:54disrupteknim is not python. you can do everything you might want to do at compile-time.
21:32:52disruptek~manual
21:32:53disbotmanual: 11the Nim Manual is https://nim-lang.org/docs/manual.html -- disruptek
21:32:56disruptekcheck out the section on macros.
21:32:58FromGitter<janni-adamski> so an example of how to read e.g. the properties of a type or a subtype
21:33:30disrupteksee also
21:33:33disruptek!repo macroutils
21:33:34disbothttps://github.com/PMunch/macroutils -- 9macroutils: 11A package that makes creating macros easier 15 15⭐ 1🍴
21:35:44FromGitter<janni-adamski> thanks!
21:36:51disrupteksure thing.
21:37:54FromDiscord<LiteLotus> @disruptek what am i missing? $ checks the type right? https://play.nim-lang.org/#ix=2xfw
21:38:06disruptek$ converts the argument to a string.
21:38:15FromDiscord<LiteLotus> ah
21:38:37*solitudesf quit (Ping timeout: 264 seconds)
21:38:42FromDiscord<LiteLotus> how would i check to see if the string is a valid option for this enum?
21:39:34disruptektry to parse it, or see if it appears in a hashset of enums-as-strings, or iterate over all the enums and compare their string values, or or or
21:39:56FromDiscord<LiteLotus> ok. i guess i could put a try catch around a parse
21:45:40FromDiscord<Recruit_main707> I whish those macro utils were a thing by default
21:46:00disruptekthey need more testing, imo.
21:46:08disruptek!requires macroutils
21:46:09disbotmacroutils: 11haxscramper/misc, 11juancarlospaco/3fision, 11mhessler97/3NimFuzzy 73 total
21:46:19disrupteknot exactly wide deployment.
21:58:08FromDiscord<XxDiCaprioxX> trying to reference# a file in the same folder is `/filename.type` correct?
21:58:14FromDiscord<XxDiCaprioxX> (edit) 'reference#' => 'reference'
21:58:24FromDiscord<XxDiCaprioxX> (edit) 'trying' => 'the path' | removed 'reference'
21:58:28disruptekitym `./filename`
21:58:48FromDiscord<XxDiCaprioxX> `openingsPath = "/db.json"`
21:58:50disruptek`filename` would work, too. 😉
21:58:51FromDiscord<XxDiCaprioxX> this does not work
21:59:00FromDiscord<XxDiCaprioxX> it is in the same folder
21:59:04FromDiscord<XxDiCaprioxX> what do I need to change?
21:59:04disruptekecho getCurrentDir()
21:59:14FromDiscord<Rika> i think one of the main reasons people arent using macroutils is because "they dont want to add more dependencies" or w/e
21:59:40FromDiscord<XxDiCaprioxX> wdym with echo getCurrentDir() ?
21:59:40disruptekthat's one reason i didn't use it in cps.
21:59:47FromDiscord<XxDiCaprioxX> Let my program do that?
22:00:06disrupteki have a feeling you and your program may disagree about where it is executing.
22:00:08FromDiscord<Rika> you can use `getCurrentDir() / "filename"` or so
22:00:11FromDiscord<LiteLotus> echo getCurrentDir() gets the programs folder path. you can append the file to that
22:00:19FromDiscord<LiteLotus> what rika said
22:00:30disruptekyou shouldn't need to, though.
22:00:35FromDiscord<Rika> yeah
22:00:39FromDiscord<XxDiCaprioxX> actually the '/' was the problem
22:00:42FromDiscord<Rika> `"./filename"` should work
22:00:43FromDiscord<XxDiCaprioxX> thanks anyways
22:00:51FromDiscord<Rika> yeah, the period is important
22:01:02FromDiscord<LiteLotus> yeah i think he just forgot the `.` before the `/`
22:01:14disruptekjust use `filename` so it's more portable.
22:01:22FromDiscord<LiteLotus> true
22:01:49FromDiscord<LiteLotus> but if this is designed to run on linux you'll be storing / reading a file in the bin folder if its installed
22:02:00disruptekif you must use paths, use them like `"directory" / "filename"` and nim will insert the correct DirSep.
22:02:27FromDiscord<LiteLotus> goot to know
22:02:31FromDiscord<LiteLotus> (edit) 'goot' => 'good'
22:02:40FromDiscord<Rika> ...after `import`ing `os` because / for strings is only found in os
22:02:46FromDiscord<LiteLotus> i've been writing them out as a full string
22:03:12FromDiscord<LiteLotus> i mean if your doing file stuff it would be smart to import os anyway
22:03:28disruptekcompiler/pathutils is actually a much better approach.
22:07:02FromDiscord<Avatarfighter> hey rika
22:10:41federico3odd, the compiler is ignoring --cpu:arm64
22:12:59FromDiscord<XxDiCaprioxX> Is there a way of quickly removing quotes from a string?
22:13:17disruptekyou mean, like, unescape?
22:13:21FromDiscord<XxDiCaprioxX> Like `var str = ""Hello""` and the nget rid of the second set of quotes
22:13:29FromDiscord<XxDiCaprioxX> (edit) 'the nget' => 'then get'
22:13:35disrupteksee strutils.unescape.
22:14:50*natrys quit (Quit: natrys)
22:15:42FromDiscord<XxDiCaprioxX> I dont understand do I write `unescape(str, """, """)` ?
22:16:20FromDiscord<XxDiCaprioxX> no thats incorrect runtime error
22:16:45FromDiscord<Avatarfighter> unescape defaults to escaping quotes
22:16:46disruptekvar str = """"Hello""""
22:16:55disruptekecho unescape(str)
22:17:24FromDiscord<XxDiCaprioxX> what
22:17:40FromDiscord<XxDiCaprioxX> Okay so what exactly is the command for removing a quote and beginning and end?
22:17:48disruptek!eval import strutils; var s = """"Hello""""; echo unescape(s)
22:17:50NimBotHello
22:18:06disruptek!eval import strutils; var s = """goat "Hello" fucker"""; echo unescape(s)
22:18:08NimBot/usercode/in.nim(1) in↵/playground/nim/lib/pure/strutils.nim(2232) unescape↵Error: unhandled exception: String does not start with: " [ValueError]
22:18:15FromDiscord<Avatarfighter> sent a code paste, see https://play.nim-lang.org/#ix=2xfF
22:18:22FromDiscord<XxDiCaprioxX> okay thanks perfect
22:18:55disruptekthe """ syntax allows you to embed " inside the string.
22:19:09disruptek!eval import strutils; var s = "\"Hello\""; echo unescape(s)
22:19:11NimBotHello
22:19:19disruptekalternatively, escape the quotes.
22:19:21FromDiscord<XxDiCaprioxX> Okay I got it now thanks
22:19:57*arecacea1 quit (Remote host closed the connection)
22:20:16*arecacea1 joined #nim
22:25:51federico3oh what a bug
22:34:00*a_chou quit (Ping timeout: 256 seconds)
22:47:51FromDiscord<Sabena Sema> where the heck are the docs for type bound procs
22:47:55FromDiscord<Sabena Sema> I can't find em anymore
23:08:19FromDiscord<Rika> type bound procs?
23:11:22FromDiscord<Rika> did we ever have type bound procs?
23:23:08FromDiscord<Sabena Sema> like =sink =destroy and so on
23:24:22FromDiscord<Rika> https://nim-lang.org/docs/destructors.html
23:24:22FromDiscord<Sabena Sema> it's ... been a while since I've used nim
23:24:54FromDiscord<Sabena Sema> hmm nim-lang.org/docs could use a link to that
23:25:43*lritter quit (Quit: Leaving)
23:32:27*endragor quit (Ping timeout: 240 seconds)
23:33:39*gmaggior quit (Read error: Connection reset by peer)
23:33:51*abm joined #nim
23:39:40*endragor joined #nim
23:44:13*endragor quit (Ping timeout: 260 seconds)
23:47:37*krux02 joined #nim
23:50:16*endragor joined #nim
23:53:44FromDiscord<Avatarfighter> Is there a nim webview library or something?
23:54:03FromDiscord<Avatarfighter> Is there a way for me to render html/css as a gui ?
23:55:06*endragor quit (Ping timeout: 256 seconds)
23:55:40FromDiscord<Avatarfighter> found one
23:55:49FromDiscord<Avatarfighter> time to see if it works with ARC >:)