<< 23-07-2020 >>

00:14:38FromDiscord<Varriount> @disruptek: Did you relocate to Antarctica?
00:15:31*oddp quit (Ping timeout: 244 seconds)
00:18:28FromDiscord<Elegant Beef> Nah he's a moleman now
00:18:59FromDiscord<Elegant Beef> He's currently bumming internet off the someones basement, but will run a cable to their router tomorrow
00:21:06FromDiscord<Varriount> Yardanico: If you stream, I will join (at least to chat)
00:24:58*testtttttttttttt joined #nim
00:25:25*testtttttttttttt quit (Remote host closed the connection)
00:29:57Yardanico@Varriount ok sure :D
00:30:21Yardanicoalthough right now I'll be mostly finished work with ircord
00:37:09*hyiltiz_ joined #nim
00:40:34Prestigerefs can be nil, yeah?
00:40:51Yardanicoyes
00:42:36Yardanico@Varriount I'm live :P
00:42:38Yardanico~ystream
00:42:38disbotystream: 11Stream at https://twitch.tv/yardanico, voice chat either on Mumble (mumble://uberalles.mumbl.io/) or in Discord (https://discord.com/invite/ezDFDw2) -- Yardanico
00:43:52FromDiscord<Varriount> Yardanico: I'm on Mumble
00:43:54Yardanicooh nice
00:43:57Yardanicolemme join
00:43:58PrestigeHm so why can I pass in a nil ref but can't explicitly pass in nil?wa
00:44:18Yardanicoref itself uses memory too
00:44:27Yardanicohmm
00:44:35Yardanicobut you should be able to pass it, what's the proc?
00:44:40Prestigehttps://play.nim-lang.org/#ix=2bFu
00:45:07FromDiscord<Elegant Beef> nil isnt a var
00:45:30FromDiscord<Elegant Beef> https://play.nim-lang.org/#ix=2bFD
00:45:31FromDiscord<Elegant Beef> There
00:45:46FromDiscord<juan_carlos> Does anyone know if imageman compiles if you do not have the libjpeg-turbo?, I want it to NOT compile if lib is not installed.
00:45:53FromDiscord<Elegant Beef> the requirement of using `var Foo` is that the passed in needs to be a predeclared `var`
00:46:01PrestigeSo I have to create a dummy variable? hmm
00:46:14FromDiscord<Elegant Beef> Well yea you use var
00:47:51PrestigeWish I could just pass in nil, maybe I'll make a template for this
00:50:08FromDiscord<Elegant Beef> It's a reference you dont need var
00:50:16FromDiscord<Elegant Beef> https://play.nim-lang.org/#ix=2bvI
00:50:37PrestigeDid you send the right paste?
00:50:49FromDiscord<Elegant Beef> yea
00:50:52FromDiscord<Elegant Beef> The most recent one
00:50:58FromDiscord<Elegant Beef> Run it
00:51:17Prestigeit just isn't what I want
00:51:27PrestigeEnded up doing this: https://play.nim-lang.org/#ix=2bPT
00:51:40FromDiscord<Elegant Beef> It literally is↵https://play.nim-lang.org/#ix=2bPV
00:51:53FromDiscord<Elegant Beef> non of that template bafoonery
00:52:03*waleee-cl quit (Quit: Connection closed for inactivity)
00:52:31PrestigeYour paste you are creating a new var, that's what I'm avoiding
00:52:39FromDiscord<Elegant Beef> Look at the most recent one
00:52:42FromDiscord<Elegant Beef> i send a nil directly in
00:52:57FromDiscord<Elegant Beef> Not using var means you dont need to make a new var
00:53:05FromDiscord<Elegant Beef> references are mutable when passed to procs
00:53:24PrestigeYeah it's just an example, I need a var param for my actual use case
00:53:37FromDiscord<Elegant Beef> Not if it's a reference
00:54:20PrestigeI'm reassigning the reference
00:54:29FromDiscord<Elegant Beef> huh?
00:54:59FromDiscord<Rika> he's replacing the pointer
00:55:02FromDiscord<Rika> so it has to be a var
00:55:06Prestige^
00:57:19*testtttttttttttt joined #nim
00:57:31*testtttttttttttt quit (Remote host closed the connection)
00:59:06PrestigeHi Yardanico
00:59:11Yardanico:P
01:00:17*zedeus_ is now known as zedeus
01:01:49*vicfred quit (Quit: Leaving)
01:18:52*maier joined #nim
01:22:41*apahl quit (Ping timeout: 244 seconds)
01:23:00*hyiltiz_ quit (Quit: hyiltiz_)
01:24:04*maier quit (Ping timeout: 256 seconds)
01:24:42*apahl joined #nim
01:29:18FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/735669834993500271/unknown.png
01:29:28FromDiscord<Yardanico> irc formatting to markdown and markdown to IRC 😛
01:42:44FromDiscord<Rika> :thonk:
01:43:21FromDiscord<Yardanico> https://github.com/Yardanico/ircord/blob/master/src/utils.nim#L24 and https://github.com/Yardanico/ircord/blob/master/src/utils.nim#L150
01:43:33FromDiscord<Yardanico> not gonna roll it out today (maybe later in the evening), since need to do some stuff later and this might break
02:13:37*muffindrake quit (Ping timeout: 260 seconds)
02:15:50*muffindrake joined #nim
02:21:32PrestigeVery nice
02:23:55*hyiltiz_ joined #nim
02:24:14*hyiltiz quit (Quit: hyiltiz)
02:25:08*hyiltiz_ quit (Client Quit)
02:25:57*hyiltiz joined #nim
03:00:35*leorize quit (Remote host closed the connection)
03:00:55*lritter quit (Ping timeout: 258 seconds)
03:01:21*leorize joined #nim
03:01:25*lritter joined #nim
03:19:51*maier joined #nim
03:24:41*maier quit (Ping timeout: 258 seconds)
03:45:36FromDiscord<Varriount> Zevv, Yardanico: I'm still confused about CPS. It looks pretty much like what the compiler does to generate iterators
03:47:30*narimiran joined #nim
03:47:52FromDiscord<Varriount> Except that it doesn't split up a procedure into a bunch of smaller procedures, it just uses a hidden parameter to indicate what sub-section should be executed.
03:50:45*baysao joined #nim
04:03:51*hyiltiz quit (Quit: hyiltiz)
04:04:15*hyiltiz joined #nim
04:04:15*hyiltiz quit (Changing host)
04:04:16*hyiltiz joined #nim
04:06:02*supakeen quit (Quit: WeeChat 2.8)
04:06:40*supakeen joined #nim
04:07:47*lritter quit (Ping timeout: 240 seconds)
04:23:20*bozaloshtsh quit (Quit: ZNC 1.7.5 - https://znc.in)
04:23:21*Zectbumo quit (Remote host closed the connection)
04:23:32*bozaloshtsh joined #nim
04:23:32*bozaloshtsh quit (Changing host)
04:23:32*bozaloshtsh joined #nim
04:23:41*Zectbumo joined #nim
04:29:23*endragor quit (Quit: Leaving...)
04:30:17icyphoxhow would i write the Nim equivalent of Python's `if x in ["foo", "bar"]: ...`
04:31:18*NimBot joined #nim
04:31:49*endragor joined #nim
04:32:54FromDiscord<Rika> icyphox: exactly the same
04:33:44icyphoxyeah... then the error is something else then
04:34:12icyphoxand i negate by writing `if x not in...`?
04:35:29FromDiscord<Varriount> notin
04:35:46FromDiscord<Varriount> icyphox: one token
04:35:58icyphoxoh
04:36:00icyphoxTIL
04:36:17icyphoxthanks!
04:37:41FromDiscord<Rika> icyphox: if you dont like how `notin` looks, you can use`not_in`
04:37:55FromDiscord<Rika> since style insensitivity still applies to it
04:38:25FromDiscord<Varriount> Or notIn, NOTin, and NoTiN
04:38:32Yardanicono
04:38:36Yardaniconot the second or third one
04:38:42Yardanico@Varriount you forget a lot about nim :P
04:38:47Yardanicoforgot*
04:38:55Yardanicowe don't have first letter case insensitivity since long time
04:39:03FromDiscord<Varriount> Oh yeah, first letter is case sensitivity
04:39:19icyphoxlol
04:39:24FromDiscord<Varriount> Well then, notIN and nOtIn
04:39:27icyphoxrika: thanks, but i hate underscores lol
04:39:38Yardanicobut no one writes like that anyway @varriount
04:39:39Yardanico:P
04:39:49icyphoxi mean, they're fine in python but ew in nim
04:39:51icyphoxxd
04:40:12FromDiscord<Varriount> I like underscores for the plain fact that there's no confusion over abbreviations.
04:40:35FromDiscord<Rika> icyphox: only suggested it anyway, """idiomatic""" would be `notin` anyway
04:40:48icyphoxgotcha :)
04:57:44*solitudesf joined #nim
05:00:01FromDiscord<Varriount> Araq: Would it ever be possible to isolate an entire closure?
05:03:13Zevvvarriount: CPS is basically two things: split your functions into self contained parts that have no knowledge of each other, and to eliminate the stack
05:03:52Zevvwhat was once on the stack, is now stored into a little blob for each of these parts
05:04:03*baysao_ joined #nim
05:04:07Zevvthe little blob is a pointer to the part, and its "stack" data
05:04:34Zevvso you can store this little blob somewhere, send it to someone else or store it in your freezer for a week
05:04:45Yardanicoxd
05:04:53Zevvwhen you want to "continue" your program, you just call the pointer in your little blob and pass it the data
05:05:01Zevvand *poof* you're back in business
05:05:31Zevvif you now originally had 2 functions, you can suddenly call their little blobs round robin
05:06:02Zevvthat's coroutines. Or you have a little blob that says "call me whenever there is data on socket X"
05:06:05Zevvthat's async
05:06:49*baysao quit (Ping timeout: 264 seconds)
05:06:55Zevvor you have a little blob that sais "call me whenever you want to something with the next element of this list"
05:06:58Zevvand thats an iterator
05:07:14Zevvso yes, its very related, but it goes deeper then iterators only
05:07:54*superbia joined #nim
05:08:03Zevvproblem if that silly nimcsp project is that we're trying to do that in nim macros and not in the compiler. it might pull of a proof of concept, but i feel it will never fly
05:09:21Yardanicowell to be fair AFAIK 4raq had to do a lot of stuff to make closure iterators work properly :P
05:09:26Yardanicothe whole lambda lifting thing
05:10:45Zevvright. and some of that might be perfecly reusable, but I still cant see how we can use those parts from a nim macro
05:11:14Zevvbut a macro could do similar things of course, up to a certain point
05:11:48Zevvanyway, i spent a few evenings on it and then I basically got stuck in the mud
05:11:58Yardanicodisruptek continued and had some more success :P
05:12:11YardanicoZevv: you did see https://github.com/disruptek/cps right?
05:13:10Yardanicoand this https://github.com/disruptek/cps/blob/master/tests/tock.nim works
05:16:59*endragor quit (Ping timeout: 240 seconds)
05:18:21*endragor joined #nim
05:20:39*maier joined #nim
05:25:23*maier quit (Ping timeout: 240 seconds)
05:30:13FromGitter<bung87> it's alternative solution to something in nim ?
05:31:20Yardanicoto current async
05:32:34*ForumUpdaterBot quit (Remote host closed the connection)
05:32:41*ForumUpdaterBot joined #nim
05:32:54FromGitter<bung87> ah , it look more light weight than async right?
05:34:35*baysao joined #nim
05:36:24*baysao_ quit (Ping timeout: 256 seconds)
05:39:06Zevvdang he's such a prick. just finishing the work i don't want to.
05:39:13Yardanicoexactly
05:39:35Zevvand he even knows how to spell cps
05:39:40Yardanicocspssda?
05:39:44Yardanicocsps
05:39:46Yardanicoscp
05:39:48Yardanicocsp
05:39:58Zevvnope, hadn't seen that yet, let me see what's in there!
05:40:01Yardanicospeshimen
05:40:03Yardanicofinal answer
05:40:55*risorg23` quit (Ping timeout: 272 seconds)
05:42:19Zevvbung: its a potential building block for async, iterators, coroutines, exceptions
05:42:26Yardanicoexceptions?
05:42:30Yardanicodo you not like goto exceptions? :P
05:42:39Zevvsure, anything that involves non-linear code flow
05:43:01Yardanicobtw I slept like 6 hours and now im in this weird state
05:43:04Zevvwith cps you can make exceptions in the langugae, without needing support from the language core, in theory
05:43:10Yardanicowhere I'm kinda awake and not sleepy but also want to go to sleep
05:43:17Yardanicoargh
05:43:20Zevvwhats your local time
05:43:25Yardanico08:43 am rn
05:43:31YardanicoI woke up on ~21:00 yesterday
05:43:59Zevvdude. at my age that kind of behaviour probably throws me in a coma
05:44:13Yardanicoyou're not even 90 are you
05:45:31Yardanicoactually how old are you if you don't want to hide it? :P
05:46:09Zevvdisruptek and me, we're statler and waldorf
05:46:30ZevvI'm 45, and he must be, like, 90 or so
05:46:34Yardanicowaaaaaaaaaaaat
05:46:41Yardanicoi honestly thought you're much younger
05:46:48YardanicoI feel too young now
05:46:49Zevvthat what she said
05:47:02Yardanico🤔
05:47:08FromGitter<bung87> she ?
05:47:21Yardanicowell, it can be a he if you fancy /s
05:48:13FromGitter<bung87> oh, I thought I misgender to disruptek
05:48:19YardanicoLOL
05:48:32Yardanicopoor disruptek
05:49:40Zevvwell, I do feel pretty sorry for him, but thats for other reasons. being stuck without a job in a country on the brink of collapse, pff
05:50:34narimiranYardanico: " i honestly thought you're much younger" --> that's not how you treat an elderly person! shame on you!
05:51:26Zevvnah, we are used to these things. it only hurts the first, like, fifty times or so
05:51:27Yardanicowait am I not supposed to say something like "wow I thought you're younger!" to everyone who's more than 1.5x older than me? :P
05:52:42FromGitter<bung87> interesting, 1.5x sounds like performance thing.
05:52:43narimiranif 1.5x is the formula to go by, there are people here who would say that to 25 year olds!
05:52:47Zevvanyway, I have this little dictionary of internet slangs to bluff my way through
05:52:59Zevvand I go "hello, fellow kids"
05:53:18YardanicoXD
05:53:29ZevvI even learned "ikr" the other day. it was in my little dictionary
05:53:30Yardanicobtw, about clyybber - I honestly thought he's older :P
05:53:51narimiranhe's 17, 19 or something like that, right?
05:53:57Yardanico19
05:54:00Yardanicoi'm 20
05:54:10ZevvI really stopped caring and thinking about all thay I guess. There's cool people, and not-so-cool peopl
05:54:13Yardanicolqdev is younger
05:54:20YardanicoI think he's like ~16
05:54:32Yardanico@Rika is ~17-19 afaik
05:54:34Zevvtons of 50 year olds who never got beyond 14, mentally
05:54:55Yardanicotime to make a poll on the forum about age :DDD
05:55:25ZevvAnd I know ar4q is at least 15
05:55:29FromGitter<bung87> both of you younger to me
05:55:35YardanicoZevv: actually it's not hard to know his real age
05:55:40YardanicoI know it +-2 years
05:55:49narimiran36 iirc
05:55:52Yardanicoyeah
05:55:56Yardanico36-38 i think
05:55:58Zevvgood for you :)
05:56:04Yardanicohe even has a wikidata page!
05:56:10Yardanicohttps://www.wikidata.org/wiki/Q60678874
05:56:25Yardanico"instace of human"
05:56:26narimiranwait, 4raq is a human????
05:56:31Yardanicoi was surprised too
05:56:39Yardanicoalso apparently a programmer
05:56:54FromDiscord<Rika> I am 18
05:56:54FromDiscord<Elegant Beef> His name isnt short for a real quasi alien?
05:56:55Zevvyeah, he's a mere morta. He's not like Fabrice Bellard or Mike Pall or so
05:57:03YardanicoD:
05:57:05Zevvthese are both robots from outer space
05:57:10narimirantrue
05:57:13Yardanicohttps://ih1.redbubble.net/image.1047432253.9167/poster,840x830,f8f8f8-pad,1000x1000,f8f8f8.u1.jpg
05:57:20FromDiscord<Elegant Beef> Wait rika im older than you 😦
05:57:26FromDiscord<Rika> I like to believe lq is not human too
05:57:29Zevvlets do a bubblesort
05:57:33Yardanicointernet is a good thing, we can forget about age when chatting
05:57:34FromDiscord<Rika> Beef you didn't know
05:57:35FromDiscord<Rika> ?
05:57:39YardanicoZevv: there's a stalin sort implementation in Nim
05:57:41Yardanicoit's even in nimble
05:57:47FromDiscord<Elegant Beef> Nope i just assumed you were older than i 😄
05:57:47Zevvhaha
05:57:50Yardanicohttps://github.com/Knaque/stalinsort
05:57:51FromDiscord<Rika> Why?
05:58:03FromDiscord<Rika> Do i sound mature or tired of this world or smth
05:58:05*xet7 quit (Quit: Leaving)
05:58:11Yardanicoeveryone sounds tired of the world nowadays
05:58:13FromDiscord<Elegant Beef> Cause i forget that i've aged 😛
05:58:19Yardanicome too honestly
05:58:36FromDiscord<Elegant Beef> i think oh i'm.... shit 21
05:58:37FromDiscord<Elegant Beef> fuck
05:59:29FromDiscord<Rika> you're shit?
05:59:34FromDiscord<Elegant Beef> Yea
05:59:48Zevvaren't we all
06:00:02FromDiscord<Rika> true...
06:00:08narimiranbtw, you guys know my age? (even better, those who don't know - can you guess?)
06:00:16FromDiscord<Elegant Beef> 26.8
06:00:32Yardaniconarimiran: I didn't know at first, now I roughly know
06:00:39Zevvdo you grow facial hair yet?
06:00:46Yardanicoit's annoying
06:00:49Yardanicoi don't know what to do with it
06:00:53Zevvlet it go
06:01:05narimiranmore than 26.8 ;)
06:01:09FromGitter<bung87> I guess 30+?
06:01:18Yardanico@bung87 lemme guess your age..
06:01:20narimiran30+ is correct, but not precise
06:01:27Yardanico~33
06:01:28disbotno footnotes for `33`. 🙁
06:01:36Zevvon the grand scale of the cosmos, precise enough
06:01:49narimiranyeah, currently 33, in a week it will be 34
06:01:53FromGitter<bung87> Yardanico my born year is contained in my nick name...
06:02:02Yardanicoyes
06:02:04FromDiscord<Rika> yall are old
06:02:20ZevvI'm so old, I just made my volvo go past 314159, and the trip odometer set to 265.4
06:02:29narimiran@Rika but our behaviour is infantile, so it is ok....
06:02:38FromDiscord<Rika> oof
06:03:00YardanicoZevv: but why not 42069
06:03:01narimiranZevv: volvo 240?
06:03:06Yardanicolike all cool kids
06:04:24Zevvhttps://zevv.nl/div/400018900082_280045.jpg
06:04:32Zevvtrue story, that ^
06:06:57Yardanicowaow
06:11:59FromDiscord<Avatarfighter> All the kids go 42069 smh
06:14:19narimiranyou guys do realize that 314159 is higher than 42069, and Zevv should drive in reverse for 272k km to reach the number you want :P
06:14:30Yardanicobtw, just re-tested binary size with 1-line hello world
06:14:32Yardanico5616 bytes
06:14:43Yardanicothat's nim c --cc:clang --os:any -d:posix --gc:arc --panics:on -d:danger --opt:size -d:useMalloc -d:noSignalHandler --clang.exe="zigcc" --clang.linkerexe="zigcc" --passC:"-flto -target x86_64-linux-musl" --passL:"-flto -target x86_64-linux-musl" hello.nim
06:14:51Yardanicoand then strip -s hello and strip -R .comment -R .note -R .note.ABI-tag hello
06:14:53narimirani know some of these words
06:14:55YardanicoXD
06:15:19Yardanicoand it's 100% static
06:15:20ZevvYardanico: show me the C
06:15:23YardanicoZevv: sure
06:15:30Yardanicoalso it allocates 0 bytes
06:15:37Zevvyeah that's useless.
06:15:44Yardanicosince arc now can place static strings as static
06:15:46Yardanicono heap allocation at all
06:16:03Zevvoh wow does arc do that these days
06:16:07Yardanicoyes
06:16:08Zevvthat's pretty sweet
06:16:11Zevvalso const arrays?
06:16:13Yardanicoidk
06:16:30ZevvI'll give https://github.com/zevv/nim-arduino a spin one of these days
06:16:33YardanicoZevv: main file https://gist.github.com/Yardanico/6d2ad51fd861a11205468a7c362ab459
06:16:39Yardanicoactually
06:16:41Yardanicolemme add other to gist
06:16:54Zevvcan we *please* get disrupteks name mangling into nim
06:16:57Zevvpretty pretty please
06:17:07Yardanicoupdated in https://gist.github.com/Yardanico/6d2ad51fd861a11205468a7c362ab459
06:17:09Yardanicoall 3 C files
06:17:16Yardanico"static const struct"
06:17:56ZevvI think I got reportUnhandledError out somehow once as well
06:17:58Zevvbut can't remember
06:18:20*fredrikhr joined #nim
06:18:49Yardaniconim is getting good enough for making router botnets
06:19:13YardanicoZevv: does it matter in the end? hmm lemme check
06:19:29Yardanico"nm: hello: no symbols" ah right
06:19:35Yardanicotime to launch ghidra
06:19:37Yardanicoto disassemble
06:22:24Zevvoh right: I was sure I got much lower then you, but I just measured text+data, and you're measruing the whole elf, right
06:22:29Yardanicoyes
06:22:35Zevvnice
06:22:38Yardanicobloaty?
06:22:41Yardanicofor measuring text + data
06:22:42Zevvwhat does 'size' do for you
06:22:51Zevv`size hello`
06:22:52Yardanicotext 4026
06:22:53Yardanicodata 340
06:22:55Yardanicobss 1664
06:23:34Zevvsweet. Shared gcc is 2424 text, 584 data
06:23:40Zevvno musl and other tricks
06:23:45Yardanicolemme try shared
06:24:06Zevv2320
06:24:10Yardanico4064 :c
06:24:12Yardanicowhat did you do
06:24:18FromDiscord<Rika> magic
06:24:18Zevvnim c --os:any -d:posix --gc:arc --panics:on -d:danger --opt:size -d:useMalloc -d:noSignalHandler hello.nim && size hello
06:24:23Yardanico ah lemme try with gcc
06:24:40Zevvfor the tiny stuff like atmels, text+data is all that matters
06:24:47Zevvelf is for grown ups
06:25:34YardanicoZevv: text 2575 data 624
06:25:51Yardanicobut why total size is 14432
06:26:01Yardanicobss 136
06:28:16Zevvelf stuff
06:28:25Yardanicoi am confuse
06:28:27Zevvyou can go down if you like that kind of thing
06:28:30Zevvbut its stupid work
06:28:42*Zevv off, need to take a drive
06:29:06*marnix joined #nim
06:29:26Yardanicobtw binary size for echo vs stdout.write (with \n added) is 100% same
06:29:52narimiranZevv: nooooooo
06:29:55Yardanicoah wait
06:30:01narimiranyou'll ruin your odometer if you go on a drive
06:30:10ZevvI did yesterday already
06:30:14narimiranyou won't be a cool kid anymore
06:30:19YardanicoAHAHA
06:30:28Zevvwhen the police summoned me from standing still in the middle of the highway to take a picture
06:30:36FromDiscord<Rika> LOL
06:30:37Yardanicobinary size for stdout.write is 4x of echo
06:30:41Yardanicoidk why but it's 19kb
06:30:52Zevvuse the source, luke
06:31:19Yardanicoseems like it pulls much more from system
06:32:34Yardanicoc system loc with stdout.write - 906
06:32:41Yardanicowith echo - 205
06:35:24Yardanicobtw trying to use the compiler after compiling it with arc on latest devel gives a funny error
06:35:26Yardanico"Error: unhandled exception: 'sons' is not accessible using discriminant 'kind' of type 'TNode' [FieldDefect]"
06:35:40Yardanicosadly it regressed a bit
06:35:50Yardanicobefore it could compile hello world with sink inference disabled
06:36:13Yardanicojust need to minimize the compiler to reproduce the error, ez
06:36:15YardanicoXD
06:36:47FromDiscord<Rika> glhf
06:36:54Yardanicoits only ~60k cloc
06:37:23Yardanicoah nice
06:37:31Yardanicowith ORC i get a crash in refs_v2.nim
06:37:33FromDiscord<Rika> "only"
06:37:53YardanicoZevv: btw wanna learn a cool trick?
06:38:16Yardanico-d:nimArcDebug -d:traceArc
06:38:37Yardanicogives spammy output about refcounting stuff
06:39:51Yardanico"nim c --gc:arc -d:leanCompiler --sinkInference:off -o:bin/nimarc -r compiler/nim.nim c -r hello.nim"
06:39:51Yardanicometa
06:40:39Yardanicowait did I break something "/home/dian/Things/Nim/lib/system.nim(26, 3) Error: expression 'float' is of type 'type float' and has to be used (or discarded)"
06:43:05Yardanicoi'm just testing all these nim libs for arc bugs in hope that this helps running the compiler with arc :P
06:43:18narimiranYardanico: what nim libs?
06:43:19Yardanicobecause i'm scared of directly understanding the issues
06:43:33Yardaniconarimiran: well, there's https://github.com/nim-lang/Nim/wiki/Status-of-gc:arc-and-gc:orc-(library-compatibility) but it's not full
06:43:59narimiranok, because the other day i've run all the important packages
06:44:07YardanicoI did too a few days ago
06:44:16narimiranyay, duplicated work :)
06:44:23Yardanicohow did you pass --gc:arc ?
06:44:29Yardanicowell, I used orc though
06:44:31narimiranone by one
06:44:33Yardanicoheh
06:44:37Yardanicoi cheated
06:44:46Yardanicohttps://gist.github.com/Yardanico/fed1d44965987ffbfc32eed5118e9d7f
06:45:02narimiranhehe, nice touch!
06:45:27Yardanicoresults in https://github.com/Yardanico/random-stuff/issues/6
06:45:28disbotimportant packages new
06:45:33narimiranbtw, manual testing did discover that some of the packages weren't tested at all
06:45:44Yardanicoyeah I was surprised too
06:45:48YardanicoI noticed it when testing too
06:46:10narimirannow it should be fixed in the latest devel, i pushed the fix yesterday
06:46:19*marnix quit (Ping timeout: 246 seconds)
06:46:20Yardanicoi've seen that too :P
06:47:24Yardanicoso out of 121 packages 28 failed
06:47:32Yardanicohalf of them because of closure sink inference
06:47:38Yardanicomaybe I should retest
06:47:41Yardanicowith --sinkInference:off
06:47:58Yardanicoactually i guess I'll do it right now
06:49:13narimiranyeah, i've seen three main categories of failures:
06:49:22Yardanicodid you check my results link? :P
06:49:48Yardanicobut yeah, pls share
06:49:50*theelous3 quit (Remote host closed the connection)
06:50:09*theelous3 joined #nim
06:50:17narimiran1. sink inference; 2. deep copy; 3. cannot bind another `=destroy`
06:50:29Yardanico3 is due to order of finalizers and types and constructors
06:50:35Yardanicoit's fixable manually
06:50:41Yardaniconeed to reorder code
06:51:19narimiranoh, and some failed assertions here and there; also some sigsegvs
06:51:26Yardanico:)
06:52:26Yardanicook testing without sink inference now
06:52:27narimiranbtw, did you notice any difference in arc and orc?
06:52:36narimirane.g. one works, other doesn't?
06:52:49narimirani tested first half of the packages with both and no difference
06:53:00narimiranso i tested second half only with arc
06:53:04Yardanicowell ideally there should be no difference except for memory leaks
06:53:16Yardanicobut if nim compiler is doing something wrong the stack traces might be different :)
06:53:21Yardanicowith arc/orc when a program SIGSEGVs
06:53:58Yardanicoe,g, see https://github.com/nim-lang/Nim/issues/15039
06:54:00disbot[ARC] Weird cursorifier bug with methods + doubly-linked lists ; snippet at 12https://play.nim-lang.org/#ix=2dH6
06:55:05*theelous3 quit (Ping timeout: 240 seconds)
06:56:08Yardanico"FAILURE! total: 46 passed: 35 skipped: 0 failed: 11" for first batch
06:56:16Yardanicosame stuff
06:57:04Yardanicoarraymancer, cello, chronicles, chronos, combparser, ggplotnim, hts-nim, karax, macroutils, nim-markdown, INim (that one is because nimscript doesn't like --gc:arc or --gc:orc in configs, will need to manually test)
06:57:57Yardanicoseems like without sink inference things are better
06:58:39Yardanicoand yeah it's still a not-decided topic
07:00:41Yardanicobtw seems like people are very original in naming nim libs :)
07:00:43Yardanicome too
07:00:54Yardanicotake a shot every time you see a nim library which starts with the letter "n"
07:01:06Yardanicoah actually not that much
07:01:06Yardanicosad
07:01:09Yardanico"FAILURE! total: 60 passed: 47 skipped: 0 failed: 13"
07:01:21Yardanicomostly deepCopy
07:01:26Yardanicoalso PNimType
07:02:08Yardanicoim interested in this PNimType thing
07:02:10Yardanicogonna check it out
07:02:43Yardanicomaybe I should also go batshit crazy and do my old stuff
07:02:48Yardanicowhen I cloned all nimble repos
07:02:52Yardanicoand run tests in ALL of them with orc
07:03:57Yardanicoweird, can't reproduce that PNimType thing when testing manually
07:05:15Yardanicothis one is legit though "/macroutils.nim(1137, 7) Error: cannot generate destructor for generic type: seq[tuple[node: NimNode, pos: seq[int]]]"
07:10:54Yardanicooh that one is easy to repro
07:11:00*nikita` joined #nim
07:12:53*maier joined #nim
07:16:26Yardanicohttps://github.com/nim-lang/Nim/issues/15043
07:16:35Yardanicodisbot ded
07:16:40Yardanico~strema
07:16:41disbotno footnotes for `strema`. 🙁
07:16:44Yardanicowait disbot not ded
07:21:57YardanicoI love rain
07:22:21Yardanicooh nice with nimyaml compiler just crashes, more fun
07:29:40*pbb quit (Read error: Connection reset by peer)
07:30:55*pbb joined #nim
07:34:11*marnix joined #nim
07:40:23*matti quit ()
07:41:21*matti joined #nim
07:46:11Yardanicook minimized the crash
07:51:31*xet7 joined #nim
08:04:56*letto quit (Quit: Konversation terminated!)
08:06:49*letto joined #nim
08:34:46*idf31 joined #nim
08:40:39FromGitter<bung87> https://github.com/bung87/mozjpeg/blob/master/src/mozjpeg.nim
08:40:45FromGitter<bung87> I got `Undefined symbols for architecture x86_64: ⏎ "_jpeg_CreateCompress", referenced from: ⏎ ⏎ ``` _optimizeJPG in api.c.o```` [https://gitter.im/nim-lang/Nim?at=5f194d0c9360cb1f46640159]
08:40:55FromGitter<bung87> what am I doing wrong ?
08:41:17Yardanicoyou need to link with libjpeg
08:41:36Yardanicotry adding --passC:"-ljpeg"
08:41:47Yardanicoi mean in config or command-line when compiling
08:45:50FromGitter<bung87> nim c --passL:"-ljpeg" "/Users/bung/nim_works/mozjpeg/src/mozjpeg.nim"
08:46:12FromGitter<bung87> I got one error now, less than before
08:46:33Yardanicoah well you're not building mozjpeg itself
08:46:38YardanicoI can't really help but you need to build it as well
08:46:44YardanicoI mean https://github.com/bung87/mozjpeg/tree/master/src/mozjpeg/mozjpeg-3.3.1
08:47:47FromGitter<bung87> I need use it as shared lib ?
08:48:42Yardanicothen you're doing it wrong?
08:50:50FromGitter<bung87> am trying wrap its c api , not intend to build mozjpeg as dll
09:01:36*oddp joined #nim
09:07:00*baysao quit (Ping timeout: 258 seconds)
09:07:24*baysao joined #nim
09:12:50*krisppurg joined #nim
09:19:31ForumUpdaterBotNew thread by Sirinath: Single Open Intermediate Language (SOIL) Initiative, see https://forum.nim-lang.org/t/6578
09:19:43Yardanicopls stop
09:20:31Yardanico"it is the aspiration that there be a Single Open Intermediate Language that supports all major languages on all major platforms."
09:20:37Yardanicoit's all https://xkcd.com/927/ again
09:25:25Araqit's worse
09:25:40Araq"What about the JVM and the CLI/CLR/.NET?
09:25:40AraqBoth of these (proprietary) systems were designed to primarily support a single language, "
09:25:52Yardanicoproprietary?
09:26:03Araqnot true, .NET is pretty complete for any language
09:26:17Araq> the fact that both of these systems needed extensions specifically to support dynamically typed languages are demonstrative of their failure to be language agnostic.
09:26:35Araqas opposed to webassemlby that cannot even get the calling stack right?
09:26:44Araqmadness
09:26:58Araq> WebAssembly operates at a much lower level, providing each language the freedom to specify its own optimized implementation without the need for built-in support.
09:27:19Araqer and .NET cannot do that?
09:27:36Araqbut ok, .NET is from evil M$ so let's instead use wasm.
09:29:03Araqhow do I create a thread in webassembly btw
09:29:11*ehmry joined #nim
09:29:18Yardanicoto be fair it is possible
09:29:24Yardanicowith emscripten :P
09:30:05*marnix quit (Ping timeout: 240 seconds)
09:31:25Araqhttps://emscripten.org/docs/porting/pthreads.html
09:31:45Araq"As of Sep 2019, some browsers have disabled SharedArrayBuffer due to the Spectre set of vulnerabilities. Until it is restored you can still experiment with it if you flip a pref in those browsers."
09:32:57AraqI'll say it once again. please give me a x86 DOS emulator instead
09:34:22Araqthe x86 instruction set produces dense code anyway, it's good format, and extensible and it survived 40 years
09:35:10*theelous3 joined #nim
09:35:11Araqplus compilers can produce code for it and it supports arbitrary control flow too. every PL can be mapped to it, it's great stuff
09:39:26Araqjust what is the point of all of this, grow wasm until it supports POSIX and runs on the CPU directly without a VM...
09:39:40*fredrikhr quit (Read error: Connection reset by peer)
09:40:08Yardanico> supports POSIX - you're very close to reality :P
09:40:08*fredrikhr joined #nim
09:40:09Yardanicohttps://wasi.dev/
09:41:02Araqwell I'm not kidding, I know how these things work
09:41:18alehander92oii
09:41:20alehander92how is it
09:42:18alehander92hmm something like soil might work one day
09:42:18*marnix joined #nim
09:43:07Araqfirst you want some "declarative" stuff because Alan Turing was evil (HTML), then you figure out you need to run real programs (JS), then you need to run the programs faster (wasm). then you need more features like I dunno, threads and access to a file system maybe. And debugging support.
09:44:45Araqwe have "Soil". today. It's called x86 code. Yes, there are multiple different OSes on top of it. Yes interop between programming languages is terrible. it always is, Haskell is simply quite different from Python.
09:44:55Araqbbl
09:53:36*Vladar joined #nim
09:53:47*fredrikhr quit (Read error: Connection reset by peer)
09:54:12*fredrikhr joined #nim
10:03:30Yardanicohm, someone commented on a russian translation ( of https://medium.com/better-programming/a-python-substitute-i-tried-out-the-best-programming-language-youve-never-heard-of-9e29cd1893c0 - also read https://forum.nim-lang.org/t/6577 )
10:03:42Yardanicothat nim is lying in the main page a bit (for now)
10:03:49Yardanicoabout "Nim's memory management is deterministic and customizable with destructors and move semantics, inspired by C++ and Rust. It is well-suited for embedded, hard-realtime systems." - since it's not the default yet
10:04:20FromDiscord<Varriount> Yardanico: The point I was trying to make earlier about CPS is that it's equivalent in spirit to iterators, and that we should leverage iterators for a new async implementation.
10:05:43*waleee-cl joined #nim
10:05:50FromDiscord<Varriount> The separate continuations are equivalent to the separate logic states in an iterator, and the parameters passed between continuations are equivalent to a (closure) iterator's state data.
10:06:38Zevvcurrent async *is* built on iterators
10:06:43Zevvbut iterators are too limited
10:07:17FromDiscord<Varriount> It's built on a weird pass-one-iterator to another architecture
10:07:20*krux02 joined #nim
10:09:26FromDiscord<Varriount> The problem with implementing the CPS strategy as actual separate procedures is there will be many more memory allocations/moves as parameters are shuffled from continuation to continuation. Plus, thing like 'try' and 'defer' would need to be emulated.
10:09:45FromDiscord<Varriount> https://man7.org/linux/man-pages/man2/readlink.2.html
10:11:14FromDiscord<Varriount> See https://medium.com/google-developer-experts/coroutines-suspending-state-machines-36b189f8aa60
10:11:29FromDiscord<impbox> So I'm looking at 13375 again (compileTime->runtime barrier crossing), https://github.com/nim-lang/Nim/issues/13375#issuecomment-662925429 between modules
10:11:30disbotAccessing compileTime variable at runtime returns zeroed data. ; snippet at 12https://play.nim-lang.org/#ix=2bba
10:13:21FromDiscord<impbox> has anyone managed to get compileTime registering and runtime accessing stuff working between modules?
10:18:11Yardanico@impbox I made your example work with tables :P
10:18:15Yardanicoa workaround
10:18:38FromDiscord<impbox> ooh
10:18:51Yardanicohttps://gist.github.com/Yardanico/bb201d2d1e17373f1ab31d24cf21273f
10:19:31FromDiscord<impbox> wow!
10:19:32*apahl quit (Ping timeout: 260 seconds)
10:20:13FromDiscord<impbox> weird that it can work with tables but not seqs
10:20:20*apahl joined #nim
10:21:33Yardanicoyour solution was a bit wrong I feel also
10:21:38Yardanicoyou used compileTime but not static block
10:21:45Yardanicoso you added them to a seq at runtime
10:21:51Yardanicoto a compile-time seq :P
10:22:05Yardanicoif you want to assign them at runtime, it'll work just fine I think
10:22:23FromDiscord<impbox> ahh i took mine from the manual https://nim-lang.org/docs/manual.html#pragmas-compiletime-pragma
10:22:38Yardanicohrm
10:22:38FromDiscord<impbox> maybe that manual example needs fixing
10:23:05*marnix quit (Ping timeout: 240 seconds)
10:23:37FromDiscord<impbox> thanks for your help though, any idea why it works with tables and not seqs? I can use tables for my use case so it's ok
10:23:37Yardanicothe runtime solution - https://gist.github.com/Yardanico/4ba733120dbf283c0d17bb1403659f47
10:23:43Yardanicoyeah, I'm not sure why :P
10:23:53Yardanico(although you could use tables for runtime soultion too if you want)
10:24:18FromDiscord<impbox> mmm i want all registration to happen at compile time
10:24:30*marnix joined #nim
10:24:34Yardanicothen that compile-time table solution should work I guess
10:24:40FromDiscord<impbox> seems like that works with the static block
10:24:41FromDiscord<impbox> \o/
10:28:43Yardanicowell seems like the table solution is not the most efficient one as it recreates the table each time you call the callProc proc(??)
10:28:53Yardanicoso it's technically still runtime (well of course)
10:29:43Yardanicomaybe the c compiler optimizes it, idk
10:29:49Yardanicohttps://i.imgur.com/mOuGV3k.png with arc
10:30:04*couven92 joined #nim
10:30:20*fredrikhr quit (Disconnected by services)
10:30:26*couven92 is now known as fredrikhr
10:35:56*marnix quit (Ping timeout: 258 seconds)
10:36:38*marnix joined #nim
10:36:38*beatmox- quit (Read error: Connection reset by peer)
10:37:47*beatmox joined #nim
10:38:34*m4r35n357 joined #nim
10:38:43*clemens3 joined #nim
10:40:49*abm joined #nim
10:44:42*vicfred joined #nim
10:47:03FromDiscord<impbox> interesting!
10:49:14*baysao_ joined #nim
10:51:23*baysao quit (Ping timeout: 240 seconds)
10:54:32*hzx joined #nim
11:08:23Zevvdisruptek: I'm kind of offended by how charming your CPS implementation is
11:16:22*baysao joined #nim
11:17:17*vicfred quit (Quit: Leaving)
11:18:01*superbia1 joined #nim
11:18:37*baysao_ quit (Ping timeout: 246 seconds)
11:20:45*superbia quit (Ping timeout: 240 seconds)
11:22:33*leorize quit (Remote host closed the connection)
11:22:56*leorize joined #nim
11:26:06AraqYardanico: 1.2 ships with --gc:arc and the default doesn't matter IMO. if you need it, you can use it easily. the fact that e.g. NimYaml doesn't work on it isn't relevant as you don't need a YAML parser on a CPU with 16KB of storage
11:26:25FromDiscord<ShalokShalom> @Araq Do you have a little bit of time? I considered multiple options to solve our problem with the overwhelming amount of documentation, and how to fit all into one category. I considered this: https://example.docsy.dev/docs/
11:26:41FromDiscord<ShalokShalom> Its a static homepage, made with either Jekyll or Hugo.
11:27:05FromDiscord<ShalokShalom> And I could transfer the whole content in Learn and Documentation and fuse it together.
11:27:58Araqwe don't have to fit all into one category, we can have two
11:28:21FromDiscord<ShalokShalom> There are multiple issues with that
11:28:33FromDiscord<ShalokShalom> You dont like the software shown?
11:30:04hzxI'd love to see Nim's documentation in Dash/Zeal format
11:30:22Araqwe already use Jekyll for the website and I will never ever accept Hugo. if we rewrite it once again, we'll rewrite it in Nim
11:31:17Araqbut sorry, I have to go, will be back tonight
11:31:30FromDiscord<ShalokShalom> I know that we use Jekyll already.
11:31:33FromDiscord<ShalokShalom> Thanks a lot.
11:32:36*krisppurg quit (Quit: Connection closed for inactivity)
11:36:55FromDiscord<dom96> > It's built on a weird pass-one-iterator to another architecture↵@Varriount What's weird about the implementation? how else would you implement it?
11:37:20FromDiscord<dom96> I think you may be mistaken with how it works, iterators are not passed around
11:44:06ForumUpdaterBotNew thread by Jasonfi: Web app architecture?, see https://forum.nim-lang.org/t/6580
11:47:20*marnix quit (Read error: Connection reset by peer)
11:47:52*marnix joined #nim
11:50:02*marnix quit (Read error: Connection reset by peer)
11:52:47*marnix joined #nim
11:53:07Yardanicoseems like these SOIL guys are really KEEN on inviting everyone to their initiative
11:53:08Yardanicohttps://github.com/ziglang/zig/issues/5915
11:53:09disbotSingle Open Intermediate Language (SOIL) Initiative
11:54:02FromDiscord<ShalokShalom> Wouldnt IR from LLVM be more suitable for that?
11:54:20Yardanicothey have "what about llvm" in their faq
12:01:45*Zectbumo quit (Remote host closed the connection)
12:02:16*hzx left #nim (#nim)
12:03:39*vicfred joined #nim
12:06:02*supakeen quit (Quit: WeeChat 2.8)
12:06:42*supakeen joined #nim
12:06:51alehander92hm
12:06:55alehander92i have two ideas for rfc-s
12:07:05alehander92but maybe the second one needs a pre-rfc: here it is
12:08:54alehander92do we need a pattern matching solution inside the stdlib/language, or in fusion? or should it remain as a third party lib thing as it is now?
12:08:55alehander92(python and ruby seem to add pattern matching as well?)
12:09:59alehander92if we do, should a rfc be about a stdlib addition or about fusion one? (and should it be a new dsl based on more research on other systems, or mostly adaptation of patty / gara)
12:10:10alehander92+ ast_pattern_matching by krux02
12:10:12alehander92Araq ^
12:25:43*fredrikhr quit (Read error: Connection reset by peer)
12:26:10*fredrikhr joined #nim
12:32:35*sacredfrog quit (Quit: ZNC 1.8.1 - https://znc.in)
12:35:04*idf31 quit (Remote host closed the connection)
12:36:35FromDiscord<ShalokShalom> Did anyone railway oriented programming in Nim?↵https://vimeo.com/97344498
12:38:34*sacredfrog joined #nim
12:39:22FromDiscord<Varriount> dom96: I would essentially copy Rust's architecture.
12:39:52*endragor quit (Remote host closed the connection)
12:40:20*endragor joined #nim
12:41:16FromDiscord<dom96> Yes, I would do too if I had the time
12:41:17FromDiscord<Varriount> The only component missing that would make that architecture truly performant for Nim is the current hard separation between closure iterators and inline iterators. Ideally the compiler would be able to decide whether a iterator call/instantiation requires a closure-type setup or an inline one.
12:41:35FromDiscord<dom96> But Rust doesn't use iterators at all AFAIK
12:41:57FromDiscord<Varriount> dom96: To be clear, I'm not blaming you or your lack of time. We all have work and personal matters to attend to.
12:43:11FromDiscord<Varriount> dom96: No, but (from what I've read) it does rewrite async functions into a state machine. `if state == 0: go to beginning block. if state == 1: go to second block`.
12:43:52FromDiscord<Varriount> Iterators essentially boil down to the same kind of logic.
12:45:12*endragor quit (Ping timeout: 256 seconds)
12:45:54FromDiscord<Varriount> By "state machine", I mean a function that accepts, as a parameter, an indicator of what section of logic should be executed.
12:46:19FromDiscord<Varriount> (since I know the term by itself is vague)
12:46:57FromDiscord<Varriount> That parameter doesn't have to be the only one the function accepts, but it does have to be passed.
12:47:38FromDiscord<dom96> Sure. I have suggested that others look into this as well
12:47:50FromDiscord<dom96> Don't understand the sudden excitement for CSP
12:48:06FromDiscord<dom96> It would give me more confidence if there was at least one language that successfully makes use of it for async
12:48:26shashlick@hzx: https://github.com/genotrance/nim-docset
12:49:23FromDiscord<Yardanico> @Varriount just FYI - there's a person active in Nim Telegram who came from Rust
12:49:32FromDiscord<Yardanico> And liked Nim's async more
12:49:36FromDiscord<Yardanico> Even performance wise
12:50:31FromDiscord<Yardanico> He said he had issued with borrow checking in async code
12:50:46FromDiscord<dom96> ooh, performance-wise? how?
12:51:07FromDiscord<Yardanico> I don't know, but that's what he said in a comment :P
12:51:19FromDiscord<Varriount> I would be interested in knowing more about their take on the two systems.
12:51:25FromDiscord<Yardanico> https://m.habr.com/ru/company/vdsina/blog/512028/comments/#comment_21877684
12:51:31FromDiscord<dom96> @Yardanico can you quote reply that comment to me in Telegram?
12:51:41FromDiscord<Yardanico> It's in Russian but hopefully Google translate can do it
12:52:05FromDiscord<Yardanico> @dom96 that comment is from the link I gave, but he's in telegram
12:52:18ForumUpdaterBotNew thread by Serge: Is it possible to mimic Go's Goroutines, see https://forum.nim-lang.org/t/6582
12:52:27FromDiscord<Yardanico> Also that article is Russian translation of that (not very good) article about Nim
12:52:38FromDiscord<Yardanico> The one with Fibonacci benchmark
12:52:59FromDiscord<Yardanico> But it already got over 100 comments (I also commented under some comments to clear some confusions)
12:54:58FromDiscord<Varriount> dom96: One downside to a state-machine system like that is that it is heavily dependent on the compiler inlining intermediate calls to other async procedures.↵If you have a call stack like this:↵` handleHTTP -> handleRoute -> routeImpl -> retrieveFromDatabase`↵and `retrieveFromDatabase` pauses the async procedure, the event loop will have to call `handleHTTP` again, and the call stack will need to be reconstructed.
12:56:20FromDiscord<Varriount> (the reason this call stack destruction/construction doesn't affect the async procedure's state is because the state is stored in the closure's environment)
12:57:11FromDiscord<dom96> @Yardanico yeah, please tell them that we're not "getting rid of the GC"
12:57:42*marnix quit (Ping timeout: 260 seconds)
12:57:53*marnix joined #nim
12:58:44FromDiscord<Varriount> Meh, Java really poisoned the term "GC"/"garbage collector". Everyone seems to think that having a GC automatically means your program will be slower than a snail in molasses.
13:03:02FromDiscord<Yardanico> There also was this article about one person's experience with Nim↵https://habr.com/ru/post/462577/
13:06:34FromDiscord<Yardanico> Habrahabr is easily the biggest CIS (commonwealth of independent states) technology-oriented website
13:06:49FromDiscord<Yardanico> Imagine medium.com but more centralised
13:08:16FromDiscord<Yardanico> And it's quite old as well (2006). To get full access you need to get an invite - you can either ask someone who has enough karma to give an invite to you, or write an article in the sandbox and hope that someone (either another user or website moderators) will give you an invite
13:08:51FromDiscord<Varriount> Huh, interesting model. How well does it work?
13:09:21FromDiscord<Yardanico> Pretty well, there's virtually no spam or anything like that
13:09:28FromDiscord<Yardanico> And a lot of interesting content
13:09:35FromDiscord<Yardanico> Unique content :P
13:09:44*endragor joined #nim
13:10:03FromDiscord<Yardanico> I got an invite from a very small "article" about Nim generics and converters which I wrote in 2017 lol
13:10:25FromDiscord<Yardanico> Some user gave me an invite after I published it in the sandbox
13:11:20FromDiscord<Yardanico> It's really small, I'm embarrassed of myself now when I read it - https://m.habr.com/ru/post/333702/
13:11:29FromDiscord<Yardanico> (edit) 'https://m.habr.com/ru/post/333702/' => 'https://habr.com/ru/post/333702/'
13:12:43*fredrikhr quit (Read error: Connection reset by peer)
13:13:08*fredrikhr joined #nim
13:15:56shashlickStill looking for feedback on nimble issues that should be prioritize for fixing - if there's something that really blocks you, let me know
13:19:05*marnix quit (Ping timeout: 240 seconds)
13:19:33FromDiscord<dom96> Might want to ask in the forum 🙂
13:19:44*marnix joined #nim
13:28:06FromGitter<bung87> Yardanico you still not sleep ?
13:29:00*marnix quit (Ping timeout: 256 seconds)
13:29:12*marnix joined #nim
13:32:19FromDiscord<Yardanico> Yeah not yet lol
13:32:20FromDiscord<Yardanico> Soon
13:35:30FromGitter<bung87> oh crazy
13:35:40*fredrikhr quit (Read error: Connection reset by peer)
13:36:06*fredrikhr joined #nim
13:36:36FromDiscord<Yardanico> Well, I've only been awake for ~20 hours
13:39:55alehander92isn't it very
13:39:57alehander92wait what
13:40:01alehander92why didnt you sleep
13:40:23FromGitter<bung87> thats long enough to me
14:09:47FromDiscord<tomck> i'm making a lang, i've written the IR/backend in Nim so far - haven't got a parser yet & i'm lazy so i probably won't for a while, BUT testing the IR is getting... painful↵Since, instead of testing something like `let x = 3`, I have to test `newLet(newSym("x"), none(Type), newIntLit(3))`↵Is nim's macro system expansive enough to let me dfefine my language's grammar within nim as a DSL?
14:09:47*marnix quit (Read error: Connection reset by peer)
14:11:19FromDiscord<lqdev> i'm probably not one to judge, but it would be a waste of time. you're better off creating the parser.
14:12:03FromDiscord<lqdev> but nim's macros are indeed powerful enough to allow the creation of such DSLs
14:14:32FromDiscord<tomck> fair, would it be a faff to create or are nim's macros very easy to use?
14:14:49FromDiscord<tomck> If i was in lisp this'd be a no-brainer, but i'm assuming manipulating nim's AST is a bit trickier
14:16:23FromDiscord<tomck> can i write some macros to turn nim's AST into my lang, then have a function which converts a string to nim's AST at runtime? (so that i can write my 'parser' once, e.g. nim ast -> my ast, then use that for both embedding my lang at compile-time and loading it at runtime?)
14:26:47FromDiscord<dom96> sure you can
14:27:00*marnix joined #nim
14:27:09FromDiscord<dom96> The only trouble you may have is if your language is not easily representable in Nim's AST
14:27:18FromDiscord<dom96> but even then, that's just a case of more work rather than it being impossible
14:27:54FromDiscord<tomck> so, i can run my macro at runtime too then?
14:30:28FromDiscord<dom96> you can emit it and have Nim compile it for you
14:31:08FromDiscord<tomck> no i mean, if i have a string, can I parse & eval that using nim's parser and my macro at runtime?
14:31:24FromDiscord<tomck> (so that my macro can double as a runtime and compile-time 'parser')
14:32:10FromDiscord<dom96> For that you'd have to import the compiler's source code afaik
14:33:42FromDiscord<tomck> ok cool ta
14:34:52*rridley[m] joined #nim
14:35:58alehander92but wait
14:36:04alehander92why do you need nim macros at all
14:36:20alehander92ah, i see you want to reuse nim's syntax
14:36:34alehander92yeah, reusing nim's parser as the compiler does
14:36:37alehander92might be easiest
14:39:25*maier quit (Ping timeout: 240 seconds)
14:39:43alehander92https://github.com/alehander92/learn-compiler/blob/master/learn.nim#L37
14:39:48alehander92i do that here as an example
14:44:33alehander92hey Araq about the other rfc
14:44:46Araqyes?
14:44:47*sagax quit (Read error: Connection reset by peer)
14:48:39alehander92so basically, should i open a pattern matching rfc (1) and should i open a enum/variant-flow-typing rfc (2)
14:49:31alehander92(i don't want to spend time on a feature which sounds not useful)
14:52:14Araqsure but only after you looked at the newish case statement macros
14:58:28alehander92ok
15:06:58*Vladar quit (Quit: Leaving)
15:08:49*Kaivo joined #nim
15:13:53Araq bug #15036 is the strangest bug since a looong time
15:13:54disbothttps://github.com/nim-lang/Nim/issues/15036 -- 3[ARC] C compiler error when creating a var of a const seq ; snippet at 12https://play.nim-lang.org/#ix=20D9
15:23:04disruptekZevv: honestly, your work was much more elegant. hopefully, we can get back there eventually.
15:26:34*marnix quit (Read error: Connection reset by peer)
15:28:09*marnix joined #nim
15:31:02alehander92you elegant people
15:31:39*NimBot joined #nim
15:33:06disruptekit's the second most important metric, afaic.
15:36:47FromDiscord<exelotl> Is there a ref equivalent of `pointer` (i.e. a type that represents any reference type)
15:37:33disrupteknope.
15:37:47FromGitter<bung87> `const unsigned char* input_data` I pass a cstring to this c api, inside the c function it print `����`
15:37:59FromDiscord<exelotl> wah 😭
15:38:20disruptekuse a pointer and cast it. that's what you want.
15:38:58disrupteki think i used `distinct pointer` to hack it, once.
15:39:36FromDiscord<lqdev> @exelotl actually there is
15:39:41FromDiscord<lqdev> `ref RootObj`
15:45:06FromGitter<bung87> oh I got 4 bytes, It's same when I dealing with compressed data
15:47:30FromDiscord<Yardanico> @Araq you're welcome :P didn't know it'd be so strange
15:48:06FromDiscord<😬🤣> all the time I thought it's nim's lsp that is so slow, but it's actually the vscode extension
15:48:20FromDiscord<😬🤣> the feedback is instant in kakoune
15:48:51FromGitter<bung87> wait what extension you use ?
15:49:17FromDiscord<lqdev> with enums, does Nim do The Right Thing and choose the smallest possible integer type that could fit the enum's values?
15:49:53PrestigeI can't believe discord allows emojis as names lol
15:50:06FromDiscord<😬🤣> bung, in vscode or kakoune?
15:50:31FromDiscord<😬🤣> either way it's the first ones I found
15:50:38FromGitter<bung87> in vscode
15:50:49FromDiscord<😬🤣> https://github.com/pragmagic/vscode-nim.git
15:51:12FromGitter<bung87> !eval type A = enum a,b,c;echo sizeof(a)
15:51:14NimBotCompile failed: /usercode/in.nim(1, 20) Error: identifier expected, but got ';'
15:51:25FromGitter<bung87> it gives 1
15:51:55FromGitter<bung87> that one does not use nim lsp
15:53:40FromDiscord<😬🤣> https://github.com/GaryM-exkage/vscode-nim-alt.git doesn't seem faster either
15:53:53FromDiscord<😬🤣> maybe it's just the editor :(
15:54:43FromGitter<bung87> it also not use nim lsp
15:55:13FromDiscord<😬🤣> so which one does?
15:55:25PrestigeI dislike having to restart my lsp server every time I edit more than 1 file
15:55:44Araqlqdev: yes it does
15:56:01FromGitter<bung87> https://github.com/bung87/vscode-nim-lsp
15:56:10FromDiscord<lqdev> Araq: cool, thanks!
15:56:47FromGitter<bung87> Prestige you can fork nim-lsp change its behavior
15:57:35PrestigeYeah, I should
15:57:51FromDiscord<😬🤣> Ok, this is instantenous too
15:58:11FromGitter<bung87> vscode try restart multiple times in minutes , when it still fails , it never try
15:58:18FromDiscord<😬🤣> I wouldn't expect both of the most popular extensions not to use the lsp
15:58:40*fredrikhr quit (Read error: Connection reset by peer)
15:59:04*fredrikhr joined #nim
16:00:00FromGitter<bung87> the nim lsp server parts can ignore compile error continue serve , so that not easy get server down
16:01:34*marnix quit (Ping timeout: 260 seconds)
16:05:05*marnix joined #nim
16:07:13*Vladar joined #nim
16:07:59FromGitter<bung87> how I can pass compressed data to c api , I remenber used to change wrap proc accept string, but this time I got error it can identify as jpeg format
16:08:18FromGitter<bung87> can't
16:13:20FromDiscord<😬🤣> I don't understand the question tbh
16:13:31disrupteksomeone else had a similar problem with compressed data. you might want to search the irc logs. this was a few months ago, iirc.
16:15:40FromDiscord<dom96> huh, how can the LSP server be faster than nimsuggest?
16:15:46FromDiscord<dom96> doesn't the LSP server use nimsuggest?
16:17:25FromGitter<bung87> how to search irc logs
16:17:25*marnix quit (Read error: Connection reset by peer)
16:17:41FromDiscord<dom96> using google
16:18:01superbia1which vscode extensions should I install for nim?
16:18:05Araqlol it's Clyybber's hack, inspired by my hacks
16:18:07*marnix joined #nim
16:18:19Araqconst sfSingleUsedTemp = sfExported # so that's why the export marker influences the code generator
16:18:55disruptekdoh
16:21:18Araqwell it only took an hour to find, it's fine
16:25:08*wishywashywoon joined #nim
16:25:11FromDiscord<Yardanico> Well guess that my spontaneous decision to test that TUI Tetris in Nim wasn't so useless :P
16:25:20FromDiscord<Yardanico> I honestly didn't expect to find anything in there
16:25:29FromGitter<bung87> I found my question about compressed data in irc logs , it solved by using string type
16:27:35FromDiscord<Yardanico> Why not seq[byte] ?
16:29:26*wishywashywoon quit (Quit: The Lounge - https://thelounge.chat)
16:31:36FromGitter<bung87> hmm ,not work still `Not a JPEG file: starts with 0xb7 0x2c`
16:35:23FromGitter<bung87> I tried `openarray[byte]` got `type mismatch: got <TaintedString,`
16:35:38*maier joined #nim
16:35:56FromDiscord<Yardanico> seq[byte]
16:36:13FromDiscord<Yardanico> But your issue is probably not the
16:36:17FromDiscord<Yardanico> *there
16:39:28FromGitter<bung87> hmm, I might just wrap the file handle api, read file from c
16:39:46FromDiscord<Shucks> Did anyone tried to code a custom dllmain on windows yet? This thread doesn't gets launched. I don't think DllMain gets called at all. https://play.nim-lang.org/#ix=2j3a
16:40:25*maier quit (Ping timeout: 240 seconds)
16:45:22Zevvdisruptek: tell me, how far did you get, functionality wise?
16:45:49disrupteki just noticed that a while loop that used to work, does not.
16:46:21Zevvdid you start from scratch or is it evolution?
16:46:26disrupteki updated the readme a minute ago.
16:46:44disruptekit's technically an evolution.
16:47:07disruptekbut the dispatcher is scratch, i guess.
16:47:13ZevvMine was better :P)
16:47:31disrupteki know. but i needed it to work. 😁
16:47:36Zevvha ha ha ha
16:47:56Zevvwell, I admire your persistence
16:48:05disrupteki haven't done "extruded" vars, also.
16:48:16Zevv¿Extruded?
16:48:33FromDiscord<ShalokShalom> @Araq[IRC]#0000 do you like the Jekyll theme I showed you for the documentation?
16:49:00Araqwe already have a theme, please focus on the content
16:49:11disrupteki think they call relocations from stack to heap, extruded.
16:49:34disrupteklike, we need to handle HiddenAddr and stuff.
16:49:59FromDiscord<ShalokShalom> @Araq[IRC]#0000 i dont think the content fits nicely into the current theme
16:50:06Zevvlifted
16:50:13FromDiscord<ShalokShalom> Learn and Documentation is essentially the same
16:50:19FromDiscord<ShalokShalom> Some items are duplicates
16:50:22*endragor quit (Remote host closed the connection)
16:50:47FromDiscord<ShalokShalom> And you could swap around items as you want, you would basically change no context.
16:50:49*endragor joined #nim
16:50:57disrupteknot merely lifted, but boxed.
16:51:19Zevvoh right
16:51:21Zevvthat's the word
16:51:24FromDiscord<ShalokShalom> I think our documentation has grown to a point, where a dedicated wiki makes sense.
16:51:39Zevvwere you able to find everything in the AST or do you make assumptions/guesses
16:51:53Zevvbecause I felt I needed two passes, one untyped and one typed, to get everything I needed
16:51:53*sagax joined #nim
16:52:23disruptekthe only missing piece is probably just a phase issue that we can fix, which is type inference.
16:52:49disruptekalso, i need to do reparenting of the env so that you can redefine the type of a symbol in a lower scope.
16:52:52AraqShalokShalom: I looked at it again and it's mostly
16:53:01AraqLearn --> should be "Beginners"
16:53:11AraqDocumenation --> should be "Advanced"
16:53:33FromDiscord<ShalokShalom> Thats fine
16:53:38FromDiscord<ShalokShalom> Drop down menus?
16:53:59FromDiscord<dom96> disruptek: sounds like you're reimplementing the compiler 😛
16:54:06FromDiscord<ShalokShalom> So Documentation splits up into beginners, advanced and maybe community
16:54:31disrupteki mean, it's not even 1000 lines.
16:54:33FromDiscord<ShalokShalom> Couple of things are actually straight duplicates
16:54:50disrupteki'd be happy if i could reimpl the compiler in less than 5k.
16:54:55Zevvany obvious limitations expect for the not-able-to-work-with-templates-and-for-loops?
16:54:58Araqwell it's not like we need to do anything at all really. you didn't click on "learn", happens
16:54:58*endragor quit (Ping timeout: 246 seconds)
16:55:15disruptekwhy don't templates work?
16:55:28Zevvyou can't look inside them in your transform, right?
16:55:38Araqplenty of other people managed to navigate our site though
16:55:42Araqbbl
16:55:44Zevvif there's control flow in a template you are calling, you can't transform that
16:56:25disrupteki dunno, try it. one annoyance is that i cannot provide the degraded experience i wanted to.
16:56:40disruptekie. when you call a cps proc out of context, i wanted a nice compile error.
16:56:49disrupteki think that's also fixable with macro hax, though.
16:57:01Zevvthat's hard. Also it's probably pretty tough to keep sane error messages relating to the original pre-transformed code
16:57:34disruptekit requires vigilance, and it's not perfect, but it's okay.
16:57:52ZevvI think what frustrated me most was that I was kind of making progress-by-accident
16:58:06ZevvI lost control, just fixing thing after thing without having a good overview anymore
16:58:07alehander92disruptek are we reimplementing it
16:58:13Zevvdisruptek is
16:58:17alehander92i planned doing that
16:58:22alehander92probably a very bad idea
16:58:28disruptekthe compiler?
16:58:33alehander92everything man
16:58:37disruptekdude.
16:58:41alehander92i have git there
16:58:56disruptekgit + alehander = everything, man.
16:59:00Zevvinstead of fixing arc we could just reimplement the compiler. that makes sense
16:59:09Zevvand it's always good to have more then one implementation
16:59:16disruptektrue.
16:59:20disrupteki'm warming to the idea.
16:59:28ZevvI bet you are
16:59:41Zevvafter all, it's just transforming AST, right
16:59:45Zevvhow hard can it be
16:59:50FromDiscord<ShalokShalom> @Araq[IRC]#0000 yeah, its more about doing elegant
16:59:52FromDiscord<dom96> Sounds like fun.
17:00:01FromDiscord<ShalokShalom> Not saying its not possible
17:00:03alehander92that was one of my ideas with learn-compiler
17:00:05disrupteki mean, it's a good weekend project.
17:00:09FromDiscord<ShalokShalom> Just confusing and looks unprofessional
17:00:13alehander92but i always thought i'd just reimplement a small subset
17:00:18FromDiscord<dom96> Weekend? One evening, tops.
17:00:21alehander92but running in parallel
17:00:30alehander92dom96 duh just do it in a job interview
17:00:33alehander92on a whiteboard
17:00:35disruptekdom96: we aren't all minute-men like you.
17:00:37ZevvIts a shame Rod stalled and uses curly syntax. It should have been made Nim syntax and slowly grow into Nim2
17:01:38disruptekdon't take tables.add away from me. 😭
17:01:47FromDiscord<dom96> disruptek: man, I live my life a quarter-mile at a minute
17:01:51alehander92qwhere we are going
17:01:54alehander92we dont need tables
17:02:07alehander92so obviously it's not LUA
17:02:14alehander92this place where we're going
17:02:43FromDiscord<dom96> alehander92: challenge accepted
17:02:59disrupteki owned a mkiv supra turbo when that movie came out.
17:03:08ForumUpdaterBotNew thread by Shucks: Custom DllMain Windows, see https://forum.nim-lang.org/t/6583
17:03:10alehander92such a unique job skill
17:03:43Zevvoh disruptek I wanted to share my latest milestone with you: http://zevv.nl/div/schlukki-volvo-pi.jpg
17:03:44disruptekthat car got more attention than any of my turbo porsches.
17:03:52FromDiscord<dom96> disruptek: 😮
17:04:03disruptekpeople are stupid, what can i say.
17:04:16disruptekis that your volvo, Zevv?
17:04:18Zevvit is
17:04:23disrupteklol that's awesome.
17:04:26disruptektook some planning.
17:04:35Zevvtook some planning.
17:04:39FromDiscord<lqdev> cool
17:04:43FromDiscord<dom96> Kid me would have been jealous. Who am I kidding, I'd still be jealous
17:04:54FromDiscord<lqdev> now you can't drive that thing anymore
17:04:56disruptekdo you have the moose badge on your fender?
17:05:02disruptekturbo brick mofo
17:05:05Zevvlqdev: too bad, it's already gone
17:05:09Zevvthe police chased me of the highway
17:05:13FromDiscord<lqdev> :(
17:05:15Zevv"sir, you can't just park here"
17:05:19disrupteklol
17:05:26disrupteksir, this is a wendy's.
17:05:43FromDiscord<lqdev> "but guys look my mileage is π * 100_000
17:05:46alehander92maybe this can be an app
17:05:53alehander92you can talk on the radio
17:05:58alehander92with all people having the same mileage
17:05:59alehander92as you
17:06:01Zevvhaha
17:06:23*ehmry quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
17:06:36FromDiscord<dom96> shit, apply for YC right now
17:06:42disruptekright up there with the twitch-based game-of-life startup.
17:06:43alehander92dude just was thinking about tht
17:06:58alehander92posting on HN
17:07:02alehander92looking for donations
17:07:17disruptekthere's already an app that lets you talk to everyone with the same weight.
17:07:21disruptekit's lonely at the top.
17:07:23alehander92i have to go and see what is happening on the protests
17:07:27*lritter joined #nim
17:07:28alehander92so see ya
17:07:32disruptekaight, peace
17:09:18disruptekwtf c-blake mentioned me in #15047
17:09:19disbothttps://github.com/nim-lang/Nim/pull/15047 -- 3deprecate tables.add
17:09:55disruptekam i really that vocal about this?
17:10:33FromDiscord<dom96> wow, when was this introduced
17:10:39FromDiscord<dom96> would have been very useful for HttpHeaders
17:10:53Zevvwhat
17:10:59Zevvdeprecating tables.add?!
17:11:12FromDiscord<dom96> what, this is apparently pre-1.0?
17:12:23FromDiscord<dom96> 6 years, frick me
17:12:53disruptekno idea what you mean.
17:13:25FromDiscord<dom96> so if there are duplicate keys, how do I retrieve the two values that are in the table?
17:14:25disruptekyou can retrieve them during iteration.
17:15:02FromDiscord<treeform> hashes can store duplicate keys??? Hash to seq[T] makes more sense?
17:15:23disruptekthese are not hashes. they are tables.
17:15:30FromDiscord<dom96> https://nim-lang.org/docs/httpcore.html#HttpHeaders
17:15:54disruptekmy views on httpheaders /are/ well-recorded.
17:16:07FromDiscord<dom96> I had no idea you could add duplicate keys to tables
17:16:16disruptekgtfo
17:16:22disruptekseriously?
17:16:44FromDiscord<treeform> If I saw that you could add multiple keys to a table, I would file it under a bug!
17:16:53Zevvtables is not a map
17:16:59FromDiscord<dom96> yes, why would I ever implement HttpHeaders that way otherwise
17:17:01disruptekhey, you can add two lines in a spreadsheet with the same values, too.
17:17:04Zevvhey what about
17:17:08Zevvwe add a map
17:17:11Zevvand call it map
17:17:16Zevvbecause that's what people expect these days
17:17:31FromDiscord<dom96> I didn't realise `tables` had its own meaning lol
17:17:37disrupteki had to fork sorta to add `add`.
17:17:39*drdee joined #nim
17:17:39Zevvjust build it on tables, with a map-only API
17:17:45FromDiscord<dom96> I just thought it was another name for `Map`
17:17:59disruptekgah, this is blowing my mind right now and i'm not even high.
17:18:14FromDiscord<Shucks> oh dicts
17:18:15Zevvyou're all just ignoring me right, but I'm not joking
17:18:17FromDiscord<Shucks> ops.
17:18:25disruptekZevv: i am right there with you, buddy.
17:19:08disrupteklemme see a pic of your 240
17:19:15disrupteki think i saw one once but i cannot remember.
17:19:17Zevv940, sorry
17:19:26disruptekoh pffbt, keep it to yourself, then.
17:19:32Zevvyeah bye
17:19:34*Zevv left #nim (#nim)
17:19:45*marnix quit (Ping timeout: 240 seconds)
17:19:45disrupteklol
17:19:47*Zevv joined #nim
17:19:55disrupteksalty bitch
17:19:59Zevvyou're what?
17:20:03disrupteknothin'
17:20:09Zevvanyway
17:20:54ZevvAdd map, with a very minimal API, doing only map things. No confusion, a map is map, and people coming to #irc and the forum no longer have to ask where Nims maps are
17:21:02Zevvbecause, hey, we have maps
17:21:11disruptekyep.
17:21:17disruptekthis should be an RFC, anyway.
17:21:36FromDiscord<dom96> lol
17:21:53FromDiscord<dom96> This isn't a common enough problem to warrant a new type
17:21:57Zevvproblem is, every time I RFC something deep or complicated, I get a tiny review from clybbeer or crux and stuff get merged. Everytime I RFC something bloody obvious I get obliterated in the comments and I hide away crying
17:22:09Zevvdom96: it's just suger over Tables with a better name
17:22:28disruptekit's pretty damned common. think about it; it's a bug that you may have been /adding/ to all the nim you've written in 6 years.
17:22:43FromDiscord<dom96> lol alright. If Araq agrees to it then I honestly won't care enough to fight it
17:23:57FromDiscord<dom96> wish we could easily grep for `Table[.*, seq[` in most Nim codebases
17:24:49disruptekwe can see what breaks, but we cannot know who is relying on this functionality.
17:24:54FromDiscord<treeform> Like dom, I assumed Table was Map, Dict, HashMap in other languages.
17:25:28FromDiscord<dom96> I wouldn't be surprised if most people assume this
17:25:47FromDiscord<treeform> Having a TreeMap and a HashMap as separate types might not be a bad idea... then you know the data-structure backing and expect things from it.
17:26:24disrupteki agree that it's a common assumption, certainly.
17:26:30FromDiscord<treeform> Rather then OrderedTable (I assumed was a treemap) and Table (I assumed was a hashmap)
17:27:06disruptekit makes much more sense to add a constrained type that may be more performant in some case.
17:27:20FromDiscord<treeform> We don't have AssociativeMap, which would also be useful.
17:27:26*marnix joined #nim
17:27:27Zevvyou go rfc that, boy!
17:27:40disruptekaraq has a bitable impl which i could use.
17:36:18Zevv?
17:44:35YardanicoZevv: BiTable
17:44:38Yardanicokey -> value and value -> key
17:44:51Yardanicomapping
17:44:56Yardanicohttps://github.com/nim-lang/compilerdev/blob/master/compiler/bitabs.nim
17:46:10Zevvoh right
17:53:08*Vladar quit (Quit: Leaving)
17:55:34PrestigeJust making sure - is there no difference between x.isNil and x != nil?
17:55:39Yardanicono :(
17:56:04Prestigeah okay, ty
17:57:13FromDiscord<lqdev> Yardanico: why the frown
17:57:19Yardanicobecause I used isNil a lot
17:57:22Yardanicobecause I thought it is the way
17:57:28Yardanicomust be from old nim days
17:59:10*drdee quit (Quit: Leaving)
18:00:05*waleee-cl quit (Quit: Connection closed for inactivity)
18:00:05*kungtotte quit (Read error: Connection reset by peer)
18:00:34*kungtotte joined #nim
18:02:05disrupteki still think it's a good idea.
18:02:32disruptekit's more likely to survive a not-nil-ref change.
18:02:59ZevvWell, there *is* a difference between x.isNil and x != nil
18:04:44FromDiscord<lqdev> yeah, it looks different
18:04:51bunglol
18:05:19Zevvwell, if one is true, the other one is like, not true, right?
18:05:28Zevv`x == nil`
18:07:07bungwell , interesting aspect
18:07:37Yardanicoapparently, from rust docs:
18:07:38Yardanico"So how do you know which type of integer to use? If you’re unsure, Rust’s defaults are generally good choices, and integer types default to i32: this type is generally the fastest, even on 64-bit systems. "
18:08:19disruptekthat's true for blondes, too.
18:09:10ZevvI always use BiggestInt, better safe then sorry!
18:09:48FromDiscord<Avatarfighter> Imagine not using int16 as your integer sMh
18:10:03*superbia joined #nim
18:10:09*superbia1 quit (Ping timeout: 265 seconds)
18:12:20reversem3Has anyone created OS scripts using nim-lang? like backup scripts or simple scripts for everyday tasks ?
18:17:56*endragor joined #nim
18:20:30superbiadon't reinvent the wheel, use bash, and use other great linux cli apps
18:21:37Yardanicoreversem3: I mean nim is a nice thing for this
18:21:42Yardanicoyou can even use it as a scripting language
18:21:52Yardanicothere's also https://github.com/Vindaar/shell
18:22:49Araqsuperbia: bash is cryptic error prone unportable junk, the nice thing about reinventing the wheel is that you can get a round one
18:23:14AraqI use Nim for scripting all the time.
18:23:25*marnix quit (Ping timeout: 240 seconds)
18:23:26*endragor quit (Ping timeout: 256 seconds)
18:29:25reversem3Araq: could you send me to some links or gists you might have that I could see some examples maybe ?
18:29:48Araqreversem3: the first line of your script is
18:29:51Araqinclude prelude
18:30:02Araqand then you have os, tables, strutils etc
18:30:20Araqand then you run your code via the new 'nim r foo.nim' command
18:34:19reversem3so this isn't nimscript then I take it
18:34:32*Vladar joined #nim
18:34:49Yardanicoreversem3: yeah it isn't :)
18:34:59Yardanicoalso you can use tcc for much faster compilation if you want to modify a lot
18:35:00Zevvdisruptek: I commented on https://github.com/nim-lang/Nim/pull/15047 about `Map`. let's see what that brings :)
18:35:02disbotdeprecate tables.add
18:35:11Yardanicobut if you "compile" without changing nim source, for most cases it'll be fast
18:36:26*maier joined #nim
18:37:29bunghow does c store compressed data in memory?
18:38:02alehander92ok our protest
18:38:04alehander92isnt very big
18:39:46reversem3Araq: and then you run your code via the new 'nim r foo.nim' command
18:39:46reversem3 Don't you have to compile first ? nim c -r foo.nim ?
18:39:51Yardanicono
18:39:55Yardanico"nim r" is exactly nim c -r
18:39:58Yardanicobut it saves the binary in nimcache
18:40:07superbiaok, in my defence, if your bash scripts and cli scripts are so complicated that you need to use propper language like python or nim to write them, you are doing something wrong
18:40:11reversem3ohhhh ok ,
18:40:30Yardanicosuperbia: tell that to people who have bash programs with more than 1k loc
18:41:07Prestigebash isn't very readable
18:41:10Yardanicoexactly
18:41:16reversem3I still use bash also , but to learn more about nim its easier (In my opinion) to work with the language with doing real world things
18:41:38*maier quit (Ping timeout: 260 seconds)
18:42:09Yardanicook now nimyaml doesn't crash the compiler but there's a finalizer ->destructor conversion thing
18:42:14Yardanicowill need to think how to solve it hrm
18:43:04Yardaniconimyaml apparently has two procedures for making a new yaml lexer - one which takes a stream, and other which takes a string
18:43:21Yardanicoand then it takes a pointer of that and makes a finalizer which (depending on the type) frees it with GC_unref
18:43:25Yardanico(well, there's GC_ref first too)
18:43:33Yardanicowhy though
18:45:47reversem3Why am I not finding prelude in this docs ? https://nim-lang.org/docs/theindex.html
18:45:59Yardanicobecause it's not a module which should be imported really
18:46:13Yardanicoand it's not really documented
18:46:20Yardanicojust "include prelude"
18:46:22Yardanicohttps://github.com/nim-lang/Nim/blob/devel/lib/prelude.nim
18:46:29FromDiscord<krisppurg> just out of curiosity, what is multisync and what is template mostly used for?
18:46:48Yardanicomultisync is when you want to define both sync/async version of your proc
18:46:51Yardanicoand don't want to duplicate code
18:47:00Yardanicohttpclient uses it so it doesn't have code duplication for sync/async
18:47:12Yardanicoyou usually have a generic type which has a different type depening on sync/async
18:47:15Yardanicoe.g. sync socket vs async socket
18:47:22FromDiscord<krisppurg> o
18:53:32*endragor joined #nim
18:58:59*endragor quit (Ping timeout: 240 seconds)
19:00:31Yardanicowhat will happen if you GC_unref a ref object of a wrong type?
19:00:50disrupteknothing.
19:00:54Yardanicoe.g. it's "B = ref object", but you cast it to pointer and then cast back to A = ref object
19:01:00Yardanicoand GC_unref it as A
19:01:06Yardanicodisruptek: nothing as in memory leak or it'll work?
19:01:12disruptekit'll work.
19:01:30disruptekthe rc is stored at the head, so the type is irrelevant afaik.
19:01:34Yardanicooh nice
19:02:01*Allain joined #nim
19:02:10reversem3prelude is nice , especially using inim to test
19:02:19Yardanicoyou can make your own prelude easily :)
19:02:25reversem3does nim have a help like python yet ? like help(os)
19:02:37Yardanicono, since it's not focused on interactive programming (at least not yet)
19:02:45Yardanicowe have proper IDE support though :P
19:02:55YardanicoI mean we have go to definition or code completion
19:03:03reversem3I use neonim for everything
19:03:03Yardanicoabout including files - you can even do that with a config
19:03:14Yardanicoe.g. if you have a folder with nim "scripts" and don't want to type "include file" in each
19:03:19reversem3neovim sorry
19:03:38Yardanicocreate nim.cfg and then put --include:pathtofile.nim
19:03:47Yardaniconot sure how it'll resolve the path though
19:05:25reversem3hmm nim r foo.nim doesn't work for e
19:05:28reversem3 * hmm nim r foo.nim doesn't work for me
19:05:38YardanicoI think it's not in stable yet
19:05:47Yardanico:)
19:05:55Yardanicoit's a new feature so it wasn't backported
19:05:57reversem3ahh I will use devel then
19:06:23reversem3hmm not in devel either
19:06:30Yardanicoit is in devel lol
19:06:35Yardanicountil you're on ancient devel
19:06:40Yardanico:P
19:06:47*reversem3 sent a long message: < https://matrix.org/_matrix/media/r0/download/matrix.org/tWZEOkZuKjKEUWDnWZBdiYXN >
19:07:01Yardanicoyeah update devel with choosenim
19:07:06Yardanicoit's a bit weird sometimes
19:07:07*marnix joined #nim
19:07:08reversem3ok
19:07:10Yardanicowhen dealing with devel
19:09:01*bung quit (Quit: Lost terminal)
19:11:38*Zectbumo joined #nim
19:11:54reversem3Waiting sucks when you want to play with stuff
19:12:03Yardanicowaiting?
19:12:11reversem3building C sources
19:12:11Yardanicoyou mean compiling nim devel? :P
19:12:16Yardanicooh well I don't do that
19:12:24reversem3????
19:12:37Yardanicoyou don't need C sources when you already have nim really
19:12:42YardanicoI just use the nim repo manually
19:12:51Yardanicoand to update "git pull" and "./koch boot -d:danger"
19:13:15Yardanicoyou need c sources for the initial bootstrap
19:13:34reversem3I'm just using choosenim to do it , but your right I could just do a git pull
19:14:24reversem3lol yep
19:25:08*haxscramper joined #nim
19:29:22haxscramperWhat is the possible reason for function decides to run at runtime even though I haven't done anything that could cause such behaviour? The function is very simple - constructor with one string parameter.
19:29:40reversem3Thats cool as hell nim r sample.nim
19:29:40Yardanicoyou mean it's being run even though you didn't call it?
19:29:54Yardanicoyou can easily debug this
19:29:58Yardanicodo writeStackTrace() in the proc itself
19:30:06Yardanicoand when the proc is called it'll print out the stack trace
19:30:09reversem3ok so I just need to switch off debug mode in the conf right ? then i won' t get all the compile output?
19:30:10Yardanicowhich led to the proc
19:30:18haxscramperNo, I called it using `let a = funct()` and I can clearly see it's output /before/ compiler warnings etc.
19:30:33Yardanicowell, maybe you called it in a static context?
19:31:44haxscramperNo, no static context, nothing unusual. That's the problem - I don't have a slightest idea what could cause it to run at compile-time. There is no static, no macro/template or whatewher.
19:31:56YardanicoCan you share some code? sounds really weird
19:32:30haxscramperOk, I will try and cut out whole chunk that reproduces the error
19:40:39*nikita` quit (Quit: leaving)
19:43:18haxscramperI think I found the reason - I had `const alias = fff()` where `fff` used `ref` object - and `alias(...)` was executed at runtime. When I switched `fff` to work with regular object I haven't changed `const alias = ` to something else and this caused `alias(...)` to be executed at runtime. https://play.nim-lang.org/#ix=2sbj
19:44:08Yardanicohuh, interesting
19:45:37*narimiran quit (Quit: leaving)
19:45:59Yardanicodisruptek: seems like you're wrong :P
19:46:14YardanicoI actually need to cast to the corresponding ref type to properly GC_unref it
19:46:20Yardanicootherwise I get a SIGSEGV
19:46:40Yardanicohttps://i.imgur.com/LSjmiLo.png this passes in nimyaml
19:46:43Yardanicoand then sigsegv :)
19:46:57disruptekgot a minimal repro?
19:47:07Yardanicofor sigsegv or GC_unref ?
19:47:17disruptekthe unref
19:47:20Yardanicolemme make one
19:47:43*ehmry joined #nim
19:48:20disruptekare the two types vaguely similar?
19:48:25Yardanicono
19:48:27disruptekie. objects, seqs, something.
19:48:29alehander92https://github.com/nim-lang/RFCs/issues/245
19:48:31disbotEarly version of RFC: Pattern matching ? ; snippet at 12https://play.nim-lang.org/#ix=2sbl
19:48:33alehander92please commment
19:48:42disruptekoh, well seqs/strings/objects may have differing semantics.
19:48:59disrupteklook at how it works in refs_v2.nim
19:50:20Yardanicoactually seems like it works if I make a "ref object" type (empty)
19:50:23Yardanicoand cast to it and unref
19:50:26Yardaniconot sure if it leaks or not though
19:50:41disruptekno reason to think it won't leak.
19:50:50Yardanicothanks mr obvious :PP
19:51:10disrupteknp
19:51:10haxscramperCompile-time call to `fff` generated value with some fields missing - e.g. 'case' field had non-default value but string one was missing. I failed to reproduce this one with simple example though - it works as I would've expected if I knew about this feature (e.g. value is generated at compile-time and passed to runtime where possible). https://play.nim-lang.org/#ix=2sbq
19:59:21Yardanicoyay another ARC bug hunted
20:00:41*couven92 joined #nim
20:01:56Yardanicolol we really don't have enough tests for arc :P
20:03:25*fredrikhr quit (Ping timeout: 240 seconds)
20:06:16Yardanicohttps://github.com/nim-lang/Nim/issues/15052
20:06:34Yardanicomaybe due to lent stuff again? :P
20:07:06disruptekyou should propose some additions to important packages.
20:08:03Yardanicoactually mitems for strings seems to be wrong?
20:08:22Yardanicoah no nvm
20:08:30Yardanicoit's just expandArc output confusing me a bit
20:10:31Yardanicoin compiled C it has
20:10:47Yardanico(in the loop) c = (&data.p->data[i]); and then (*c) = 97;
20:10:51Yardanicoseems to be right for me?
20:12:43Yardanicoactually gdb says it SIGSEGVs at (*c) = 97;
20:16:51*endragor joined #nim
20:17:29Zevvis data const?
20:17:34Yardanicoyeah I thought the same
20:17:36Yardanicolemme try readLine
20:17:38*marnix quit (Ping timeout: 246 seconds)
20:17:42Yardanicoso it's on the heap
20:17:48*marnix joined #nim
20:17:50Zevvvalgrind
20:17:57Yardanicoyeah it works with readLine
20:18:03disrupteki wish there was a way to disambiguate user events in selectors.
20:18:45YardanicoZevv: static const NimStringV2 TM__R8RUzYq41iOx0I9bZH5Nyrw_3 = {5, (NimStrPayload*)&TM__R8RUzYq41iOx0I9bZH5Nyrw_2};
20:19:10YardanicoI guess compiler doesn't know it should allocate string on the heap to modify or something?
20:20:06*Trustable joined #nim
20:20:56Yardanicowhy C compilers can't give a better error for this?
20:21:01YardanicoZevv: valgrind doesn't say anything lol
20:21:20haxscramperI have `const val = ...` and when I execute function in static and regular contexts I get different results. Runtime version is missing all elements from sequence field but string fields are present.
20:21:36Yardanicohaxscramper: yeah the compiletime -> runtime boundary is a bit broken in some cases
20:21:42Yardanicosee https://github.com/nim-lang/Nim/issues/13375
20:21:43disbotAccessing compileTime variable at runtime returns zeroed data. ; snippet at 12https://play.nim-lang.org/#ix=2bba
20:21:49*endragor quit (Ping timeout: 264 seconds)
20:23:47*endragor joined #nim
20:24:37Yardanicohonestly I'm really surprised sometimes
20:24:41Yardanicohow some complex libs work with arc just fine
20:24:47Yardanicobut some seemingly simplest things can fail :P
20:25:19haxscramper`let a = constA` fixed everything.
20:26:21*waleee-cl joined #nim
20:26:32haxscramperThis hack requires at least 300IQ to execute properly and I've spent last 40 minutes adding echo everywhere trying to figure out if I'm just not assigning something properly.
20:26:50disruptekget four friends to help you.
20:27:17disrupteksorry, that was rude. it was just a joke.
20:27:57haxscramperNo problem
20:29:41*vsantana joined #nim
20:31:16*marnix quit (Read error: Connection reset by peer)
20:31:38*endragor quit (Ping timeout: 258 seconds)
20:32:06FromGitter<bung87> alehander92 match to,match in , else ,thats looks good to me
20:32:39disruptekhaxscramper: do you have a repro?
20:32:46Yardanicodisruptek: check that issue
20:33:17FromGitter<bung87> maybe a extro match of
20:34:55FromGitter<bung87> I Dont like much punctuations
20:37:18*maier joined #nim
20:42:30*maier quit (Ping timeout: 260 seconds)
20:45:55FromDiscord<Technisha Circuit (LGBTQIAP+)> Okay, I'm using Nim's JS backend, please do not question me why, instead ask me why not.↵↵How do i make it so certain variables are in `module.exports`?
20:46:00FromDiscord<Technisha Circuit (LGBTQIAP+)> It's for a NodeJS app
20:46:03Yardanicodo it manually
20:46:31Yardanicolike https://github.com/bung87/datetime_parse/blob/master/src/datetime_parse.nim#L262
20:47:31*abm quit (Quit: Leaving)
20:47:53Yardanicothere's a draft PR for adding that support
20:49:15Yardanicoah, it's not a draft but still
20:49:15Yardanicohttps://github.com/nim-lang/Nim/pull/13381
20:49:17disbotjsgen improvements for ES module support, JS decorators etc ; snippet at 12https://play.nim-lang.org/#ix=2sbM
20:49:28Yardanicoand sorry, it doesn't handle the module.exports
20:49:36Yardanicoyou can of course make a macro to ease its usage
20:49:50Yardanicobut NodeJS is not a priority for Nim's JS backend
20:52:52*endragor joined #nim
20:57:45*endragor quit (Ping timeout: 240 seconds)
21:09:28shashlick@leorize - you around?
21:10:59leorize[m]yes
21:12:33*endragor joined #nim
21:14:18shashlicklooking at your nimble PR
21:14:34shashlickhere's a thought - instead of processing .cfg and nims files in the project dir
21:14:41shashlickwhy not simply copy any we find into the cache dir
21:15:07shashlickwill it still work or not really
21:15:12shashlickhttps://github.com/nim-lang/nimble/pull/768
21:15:13leorize.nims will be the biggest problem
21:15:13disbotnimscript{wrapper,api}: don't copy generated script to package directory
21:15:20leorize.cfg probably still work
21:15:32leorizebut .nims contains too many side effects
21:15:45shashlickok, then will just consider the nimconf method
21:16:09shashlickhad another question though - why do you send and save nimbleFile to nimscriptapi
21:16:34shashlickyou don't really use it for anything - https://github.com/nim-lang/nimble/pull/768/files#diff-ebde39c224fff9573ba2baf830999f1cR56
21:16:35disbotnimscript{wrapper,api}: don't copy generated script to package directory
21:17:12*endragor quit (Ping timeout: 265 seconds)
21:17:21FromDiscord<Clyybber> Araq: Haha, looks like my hack bote back
21:17:23FromDiscord<Clyybber> *bit
21:18:08leorizeshashlick: that variable is a misnomer :P
21:18:37Yardanico@Clyybber btw https://github.com/nim-lang/Nim/issues/15052
21:18:39disbot[ARC] Crash when modifying a string with mitems iterator ; snippet at 12https://play.nim-lang.org/#ix=2sbY
21:18:41Yardaniconot sure how no one caught this :P
21:18:54Yardanicoit's been here at least for a month
21:18:59FromDiscord<Clyybber> huh
21:19:19shashlick@leorize - what about line 52
21:19:19FromDiscord<Clyybber> oh probably because its only at toplevel
21:19:23Yardanicono
21:19:25Yardanicosame when in proc
21:19:40FromDiscord<Clyybber> oh
21:19:41leorizeshashlick: I passed some extra variables into the script
21:20:04FromDiscord<Clyybber> well then because it isn't too common in practice due to its suspectable usefulness :P
21:20:16shashlickright, I see the extra -p which is good but don't see what nimbleFile is for - seems like you had something in mind on the nim e side
21:21:14leorizeshashlick: scriptFile is basically the .nims we generated and projectFile is the .nimble
21:21:40FromDiscord<çaingue lainglin> sent a code paste, see https://play.nim-lang.org/#ix=2sbZ
21:21:48leorizegetPkgDir() depends on where the projectFile
21:21:58leorizeso I simply directed it to use the nimble file :P
21:22:03leorizethe change is sneaky though :P
21:22:20leorize!eval import times; echo now()
21:22:24NimBot2020-07-23T21:22:23+00:00
21:22:25Yardanico@çaingue well, first of all, why do you subtract an empty DateTime() ?
21:22:32leorize!eval import times; echo now().date
21:22:34NimBotCompile failed: /usercode/in.nim(1, 25) Error: undeclared field: 'date' for type times.DateTime [declared in /playground/nim/lib/pure/times.nim(312, 3)]
21:22:40FromDiscord<çaingue lainglin> ah sorry
21:22:40Yardanicofor example, to determine my age you can do
21:22:51FromDiscord<çaingue lainglin> i mean it's a proper DateTime in my case 🙂
21:24:08Yardanico!eval import times; let age = (now() - initDateTime(17, mApr, 2000, 0, 0, 0, 0, utc())); echo age.years
21:24:10NimBotCompile failed: /usercode/in.nim(1, 92) Error: type mismatch: got <Duration>
21:24:12Yardanicoshoot
21:24:26FromDiscord<çaingue lainglin> yes that's it
21:24:34FromDiscord<çaingue lainglin> it give me a Duration
21:24:48FromDiscord<çaingue lainglin> and i suppose i need a TimeInterval
21:25:37*m4r35n357 quit (Quit: Ex-Chat)
21:25:55leorize`Duration.inDays()` will give you the number of days
21:26:05leorizeyou can then `div 365` to get years
21:26:10Yardanicoyeah
21:26:44Yardanicoimport times; let age = (now() - initDateTime(17, mApr, 2000, 0, 0, 0, 0, utc())); echo "I'm already ", age.inDays() div 365, " years old, how?!"
21:26:47Yardanico!eval import times; let age = (now() - initDateTime(17, mApr, 2000, 0, 0, 0, 0, utc())); echo "I'm already ", age.inDays() div 365, " years old, how?!"
21:26:50NimBotI'm already 20 years old, how?!
21:27:27shashlick@leorize - i see what you are saying
21:27:28leorizewe don't have `inYears()` since not all years have the same number of days I think
21:27:29FromDiscord<Recruit_main707> @Yardanico something weird happened in the <#707912794246217758> channel, and i pinged shucks from the forums, but not in <#725987465856548919>
21:27:37FromDiscord<çaingue lainglin> that's it
21:27:40FromDiscord<Yardanico> ??? @Recruit_main707
21:27:53FromDiscord<Yardanico> there's nothing weird really
21:27:58FromDiscord<çaingue lainglin> div 356 is not accurate
21:27:58FromDiscord<Yardanico> it's just how ircord works
21:28:05leorizeYardanico: is that your birthday? :P
21:28:05FromDiscord<Yardanico> there's no ircord in <#725987465856548919>
21:28:07ForumUpdaterBotNew thread by Sschwarzer: What code is affected by runtime check pragmas?, see https://forum.nim-lang.org/t/6585
21:28:14Yardanicoyes leorize
21:28:27FromDiscord<çaingue lainglin> because of leap years
21:28:38FromDiscord<Recruit_main707> Ok, just in case it was unkown
21:28:40FromDiscord<Clyybber> @Yardanico happy bd \o/
21:28:41FromDiscord<Yardanico> @çaingue lainglin https://nim-lang.org/docs/times.html#countYears%2Cint
21:28:47FromDiscord<Yardanico> @Clyybber wat, not today? 😄
21:28:47leorizedeprecated though
21:28:52FromDiscord<Yardanico> it's 17.04
21:28:52FromDiscord<Clyybber> oh
21:28:59FromDiscord<Clyybber> haha
21:29:00Yardanicoah right deprecated
21:29:09FromDiscord<Recruit_main707> Intention is what matters :p
21:29:24FromDiscord<Yardanico> well there's a way to make it 100% correct
21:30:09leorizeuse `between()`
21:30:30FromDiscord<çaingue lainglin> !!!
21:30:32FromDiscord<çaingue lainglin> yess
21:30:56leorize!eval import times; let age = between(now(), initDateTime(17, mApr, 2000, 0, 0, 0, 0, utc())).years; echo "I'm already ", age.inDays() div 365, " years old, how?!"
21:30:59NimBotCompile failed: /usercode/in.nim(1, 120) Error: type mismatch: got <int>
21:31:10leorize!eval import times; let age = between(now(), initDateTime(17, mApr, 2000, 0, 0, 0, 0, utc())).years; echo "I'm already ", age, " years old, how?!"
21:31:12Yardanicohehe
21:31:14NimBotI'm already -20 years old, how?!
21:31:18alehander92bung87
21:31:20leorizeoh lol
21:31:21Yardanico-20 lol
21:31:21alehander92thanks
21:31:29Yardanicowhen time machine broke
21:31:37alehander92but it seems Araq likes case macros and they might fit better
21:31:38*Vladar quit (Quit: Leaving)
21:31:57alehander92so case / match : i dont mind too much
21:32:19FromDiscord<çaingue lainglin> perfect
21:34:15*audiophile_ joined #nim
21:34:18audiophile_hi
21:34:20audiophile_whats new in nim
21:34:48Yardanicowell it's easy to check
21:34:53Yardanicojust see merged PRs
21:35:39Yardanicohttps://github.com/nim-lang/Nim/pulls?q=is%3Apr+is%3Amerged+sort%3Aupdated-desc+
21:37:00audiophile_ty
21:37:11audiophile_wow it is very active
21:37:11Yardanicoor be like me and watch nim repo :p
21:37:14Yardanicoand read all new notifications
21:37:42audiophile_I did but inbox overflow xD
21:37:59FromDiscord<XeroOl> is there a good way to get the type of a variable at compile time?
21:38:08Yardanicotypeof
21:38:19Yardanico!eval echo typeof(1+1)
21:38:22NimBotint
21:38:39FromDiscord<XeroOl> is there a way for me to see it without running the code?
21:38:51Yardanicouse an IDE with nimsuggest support?
21:38:56Yardanicoor with LSP support and nimlsp
21:39:05FromDiscord<XeroOl> I'm not sure how to check
21:39:13Yardanicoin vscode just hover over a variable
21:39:17Yardanicobut it won't work in "let a = 5"
21:39:21Yardanicoonly when you use "a" later
21:40:03Yardanicohttps://i.imgur.com/r41wwiy.png
21:40:40*ForumUpdaterBot quit (Remote host closed the connection)
21:40:48*ForumUpdaterBot joined #nim
21:40:51FromDiscord<XeroOl> I'm using atom with the `nim` extension
21:40:57FromDiscord<XeroOl> it says that it uses nimsuggest
21:41:00FromDiscord<çaingue lainglin> (is there vim support for nimsuggest ?)
21:41:03Yardanicothen it should support that
21:41:08Yardanico@çaingue - neovim - yes
21:41:23Yardanicohttps://github.com/alaviss/nim.nvim idk if you can use that in vim
21:41:45Yardanico@XeroOl well I don't know, I've never used Atom for Nim
21:41:50Yardanicoit should show the types just like vscode did
21:41:54Yardaniconimsuggest gives that information
21:42:07Yardanicomaybe you can somehow configure a custom LSP client? then you could use nimlsp
21:42:17Yardanicohttps://github.com/PMunch/nimlsp
21:42:33FromDiscord<çaingue lainglin> i am not sure neovim plugins are vim compatible , but will give it a try 🙂
21:42:40Yardanicojust switch to neovim :)
21:53:51FromDiscord<Varriount> Does NimLSP still write the dirty file out to disk so that Nimsuggest can use it?
21:54:10Yardanicoidk
22:00:36AraqVarriount: I hope so. showed you many times you can do thousands of times per second without noticing
22:04:38*solitudesf quit (Ping timeout: 260 seconds)
22:17:28FromDiscord<Admin> Hi everyone
22:17:51FromDiscord<Admin> Just want to say I'm loving nim so far
22:18:25FromDiscord<Elegant Beef> Nice
22:18:30FromDiscord<Elegant Beef> It's a good language
22:18:43FromDiscord<Elegant Beef> *We totally arent biased here*
22:19:23FromDiscord<Admin> I was wondering if it was possible to changing tls settings for https requests
22:20:12FromDiscord<Elegant Beef> when you make a httpclient you can change the sslContext
22:20:23FromDiscord<Admin> Like tls version, ciphers, extensions, elliptic curves ...
22:20:28Yardanicoyes, exactly
22:20:31YardanicosslContext can be used for that
22:20:53Yardanicosee https://nim-lang.org/docs/net.html#newContext%2Cstring%2Cstring%2Cstring%2Cstring%2Cstring
22:20:59FromDiscord<Elegant Beef> Damn beat me yard
22:21:07Yardanicoyou can then provide it in "sslContext" argument in https://nim-lang.org/docs/httpclient.html#newHttpClient%2Cint%2CProxy
22:22:25FromDiscord<Admin> Ok thank you
22:23:32FromDiscord<Admin> I dont see the options for extensions
22:27:49FromDiscord<Admin> https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml
22:30:40*Trustable quit (Remote host closed the connection)
22:33:05*haxscramper quit (Remote host closed the connection)
22:35:49FromGitter<bung87> is there better way ? when shared lib installed like `const mozjpeg = "/usr/local/opt/mozjpeg/lib/libjpeg.dylib"`
22:35:57Yardanicoit's probably in PATH, no?
22:36:27FromGitter<bung87> no, brew will suggest me to export something ,but I dont
22:36:39Yardanicothen you have to do that, yes
22:36:55Yardanicoi mean either provide full path or add it to PATH
22:37:06*audiophile joined #nim
22:37:17FromGitter<bung87> but still has problem, you see the name "libjpeg.dylib"
22:37:49FromGitter<bung87> user could install both version
22:38:13Yardanicowell .so libraries usually export the version
22:38:18Yardanicoso you can use dynlib module directly
22:39:20FromGitter<bung87> oh ,yeah I have `libjpeg.8.dylib `
22:39:31Yardanicono, I didn't mean that
22:39:44Yardanicolibraries usually export symbols (functions) with which you can get the version, etc
22:40:34*audiophile_ quit (Ping timeout: 260 seconds)
22:40:40*audiophile is now known as audiophile_
22:41:50FromGitter<bung87> I tried import import dylib and get symbol, I tried to get the version in static: block, it gives me the emulator cant handle ty...
22:43:05FromGitter<bung87> I have `passc:"-DJPEG_LIB_VERSION=80 -DBITS_IN_JSAMPLE=8"` actually need this, otherwise I just write some instruction into readme.
22:47:50FromGitter<bung87> well , am not sure there's `JPEG_LIB_VERSION` after compiled
22:56:58*vsantana_ joined #nim
22:58:59*vsantana quit (Ping timeout: 246 seconds)
23:10:32*krux02_ joined #nim
23:13:45*krux02 quit (Ping timeout: 240 seconds)
23:14:51FromGitter<bung87> almost done https://github.com/bung87/web_preprocessor
23:22:45FromDiscord<Admin> how would i make default values for an object ?
23:22:59FromDiscord<Technisha Circuit (LGBTQIAP+)> Is it possible to make Inim use the JS backend?
23:23:24FromDiscord<Recruit_main707> Wasn’t Inim a vm?
23:23:24FromDiscord<Technisha Circuit (LGBTQIAP+)> Just so i can quickly test things
23:23:36FromDiscord<Technisha Circuit (LGBTQIAP+)> Not really sure-
23:23:47FromDiscord<Technisha Circuit (LGBTQIAP+)> !repo inim
23:23:48disbothttps://github.com/inim-repl/INim -- 9INim: 11Interactive Nim Shell / REPL / Playground 15 320⭐ 19🍴
23:23:57FromDiscord<Technisha Circuit (LGBTQIAP+)> A repl/shell
23:24:34FromDiscord<Recruit_main707> > how would i make default values for an object ?↵@Admin you would create a constructor function, and set them from within there
23:25:42FromDiscord<Admin> aha ok thanks
23:26:17FromDiscord<Admin> and how would i exit the process
23:26:58FromGitter<bung87> alehander92 I think match fit the semantics, but if it named as case maybe go to std
23:28:15FromGitter<bung87> Technisha Circuit , yeah you can write a nodejs program and then request to https://play.nim-lang.org/ get results , print to users
23:33:05*vsantana_ quit (Ping timeout: 240 seconds)
23:33:19*pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
23:34:38*pbb joined #nim
23:49:35PrestigeI'm looking to create a wrapper for x11/Xproto.h, but have hit a snag...The variables in Xproto.h match function names (with an added underscore) that exist in x11/xlib.h - not sure how I should get around this
23:50:09Prestigee.g. XSetInputFocus and X_SetInputFocus
23:50:22FromDiscord<Elegant Beef> you can do XProtoSetInputFocus
23:50:27FromDiscord<Elegant Beef> (edit) 'XProtoSetInputFocus' => 'xProtoSetInputFocus'
23:50:33FromDiscord<Elegant Beef> then use the importc parameter to specfy the name
23:51:51PrestigeYeah, just slightly annoying to have to change the name used in C but I guess it isn't that big of a deal
23:54:41FromDiscord<Admin> sorry to interput but how would i convert json object (currently using getFields) to httpheaders
23:54:52Yardanicowdym "convert"
23:54:58FromDiscord<Admin> (edit) 'sorry to interput but how would i convert json object (currently using getFields) to httpheaders ... ' => 'sorry to interput but how would i convert json object (currently using getFields) to httpheaders(which i will use in newHttpHeaders)'
23:54:59Yardanicoin what type of representation?
23:55:05FromDiscord<Admin> well i literally just want to pass it there
23:55:09Yardanico??
23:55:12Yardanicojust key: value or what?
23:55:28FromDiscord<Admin> yes i will be passing headers in json format as process argument
23:55:42FromDiscord<Admin> then i just want to parseJson the argument and pass to newHttpHeaders
23:55:56Yardanicoone sec
23:56:37FromDiscord<Elegant Beef> Prestige you could share name but when importing change it
23:56:42FromDiscord<Elegant Beef> But yea i dont know of any other way
23:56:48Yardanico@Admin well the way you're currently doing it is totally fine I think
23:56:48FromDiscord<Admin> sent a code paste, see https://play.nim-lang.org/#ix=2sci
23:56:57Yardanicoyeah that won't work
23:57:13FromDiscord<Admin> sent a code paste, see https://play.nim-lang.org/#ix=2scj
23:57:15Yardanicoyou want as little lines of code as possible? :D
23:57:22FromDiscord<Admin> yes sir
23:57:25Yardanicolol ok
23:57:26FromDiscord<Admin> i know the format will be correct
23:57:41*Jjp137_ joined #nim
23:58:06*Jjp137 quit (Read error: Connection reset by peer)
23:59:28Yardanicoyou need sequtils and tables (and json too of course)
23:59:41Yardanicolet f = toSeq(data.getFields().pairs()).mapIt((it[0], it[1].getStr()))
23:59:52Yardanicobut I wouldn't write like that myself honestly :P