<< 24-06-2020 >>

00:01:28FromDiscord<Technisha Circuit> Thanks
00:04:14FromDiscord<k1tt3hk4t> Should I assume that using dealloc on a null pointer is safe, as it is in C?
00:04:26Yardanicono
00:04:56FromDiscord<k1tt3hk4t> gotcha'
00:06:17Yardanicoyou can check memory alloc stuff in https://github.com/nim-lang/Nim/blob/master/lib/system/alloc.nim https://github.com/nim-lang/Nim/blob/master/lib/system/osalloc.nim
00:06:23Yardanicothere are also other files probably
00:06:37Yardanico(by default Nim has it's own allocator which uses OSes memory allocation APIs directly)
00:07:11Yardanicoah wait wrong branch
00:07:42Yardanicohttps://github.com/nim-lang/Nim/blob/devel/lib/system/alloc.nim https://github.com/nim-lang/Nim/blob/devel/lib/system/osalloc.nim https://github.com/nim-lang/Nim/blob/devel/lib/system/memalloc.nim
00:08:13FromDiscord<k1tt3hk4t> thanks for sourcing your answer
00:09:54Yardanicoyou might also like to read https://nim-lang.org/docs/intern.html and https://nim-lang.org/docs/destructors.html
00:11:08Yardanicoalthough some stuff in intern doesn't really apply to arc and friends
00:11:19Yardanicoe.g. --gc:arc doesn't really have RTTI
00:13:18FromDiscord<Shucks> https://paste.sh/en44Pq-B#bIRvQaEWy-Gr3u5Fu63DuxHA
00:13:29Yardanico?
00:13:50FromDiscord<Shucks> im a bit confused. I've tried to reproduce that issue on the nimplayground and the arrays get casted to the correct strings
00:14:09Yardanicocan you show the code?
00:14:21YardanicoI mean to the example to compile :P
00:14:41FromDiscord<Clyybber> > I guess I should make yet another gource video for nim↵hell yeah :D
00:16:20FromDiscord<Shucks> like that? https://play.nim-lang.org/#ix=2q12 However like i've said i can't reproduce that issue. But somehow im getting weird results casting char arrays into strings
00:16:34Yardanicocan you try casting to cstring instead?
00:17:00Yardanicolike https://play.nim-lang.org/#ix=2q13
00:20:13FromDiscord<Shucks> Works perfectly fine. What exactly happens
00:20:54*marquisdefalbala quit (Quit: Konversation terminated!)
00:20:59Yardanicocstring is a string with a null terminator
00:21:08YardanicoI'm not sure if memory leaks or not though :D but it shouldn't I guess
00:21:59FromDiscord<Shucks> Great thank you 🙂
00:22:59FromDiscord<Technisha Circuit> https://github.com/rnowley/nim-ncurses isn't working in Nim 1.2.0 :/
00:25:09FromDiscord<Elegant Beef> What's the issue aside from the nimble file?
00:28:03Yardanicohaha nico go brrr https://i.imgur.com/75cpyNU.png
00:28:12Yardanicoused my old reddit r/place nim code to read pixels and set with nico
00:28:14Yardanico1000x1000 canvas
00:28:32Yardanicomaybe I can try adding the slider and then also zooming
00:29:09*endragor joined #nim
00:31:39FromDiscord<Elegant Beef> Nice
00:31:54FromDiscord<Elegant Beef> See zed 256 colours is plenty!
00:31:58Yardanicono 256 colors
00:32:05Yardanicor/place had it's own palette of 16 colors
00:32:09YardanicoI just made a GPL palette for nico
00:32:12Yardanicowith same colors
00:32:24Yardanicoyes there are only 16 colors in that picture really
00:32:28FromDiscord<Elegant Beef> i mean if that's 16 imagine 256 😄
00:32:28leorizer/place was epic :P
00:32:34Yardanicoit was
00:32:47Yardanicomy old code is https://github.com/Yardanico/nim-snippets/blob/master/read_reddit_place.nim btw
00:32:57leorizethe taskbar people was big though
00:33:05Yardaniconeed to reupload diffs.bin myself coz from downloading from web archive takes ages
00:33:08*marquisdefalbala joined #nim
00:33:26Yardanicodiffs.bin is some unofficial file with all timestamps for r/place with info: x, y, color id, timestamp
00:33:28Yardanicoall are 32-bit ints
00:33:40*endragor quit (Ping timeout: 246 seconds)
00:33:56Yardanicoso the whole size is 183mb ( 11_968_422 * 16 / 1024 / 1024)
00:40:03*marquisdefalbala quit (Quit: Konversation terminated!)
00:43:37FromDiscord<Technisha Circuit> Where's the docs for Nimterop? :P
00:56:55FromDiscord<Synth> I need help using Nimterop ;-;
00:57:05Yardanicocheck projects using nimterop
00:57:15Yardanicohttps://github.com/nimterop/nimterop/wiki/Wrappers
00:57:26Yardanicoand of course read the readme
00:58:56*endragor joined #nim
01:04:31*oddp quit (Ping timeout: 265 seconds)
01:05:31*endragor quit (Ping timeout: 246 seconds)
01:06:59leorizeshashlick: ^
01:08:57FromDiscord<ikrima> sent a code paste, see http://ix.io/2q18
01:09:01FromDiscord<KingDarBoja> Wtf I just checke Technisha and I have common Xbox friends
01:09:11FromDiscord<KingDarBoja> Which is weird because I don't remember linking discord lol
01:09:29Yardanico@ikrima you mean the generic type?
01:09:38Yardanicoso you want to get NodeBase ?
01:09:44FromDiscord<ikrima> @Yardanico yeah
01:09:59FromDiscord<ikrima> i want to get the `T` out of `seq[T]`
01:10:01Yardanicotry https://nim-lang.org/docs/typetraits.html#genericParams.t%2Ctypedesc
01:10:19leorize@ikrima: in Nim lingo those are generics :P
01:10:28Yardanicoah I think it won't work with typeof
01:10:44Yardanicothere was another way iirc
01:12:02FromDiscord<ikrima> @Yardanico I've tried `genericParams` but can't get that to work either (complains that its an invalid expression)
01:12:09Yardanicoyeah I forgot about that
01:13:00leorize@ikrima can you create a small example on the playground?
01:13:18Yardanicoleorize: https://play.nim-lang.org/#ix=2q19
01:13:31YardanicogenericParams only works with literals
01:14:46leorizethis should be fixed I guess
01:15:33Yardanicomaybe there was another way, I don't remember now
01:15:54*endragor joined #nim
01:19:57leorizewell I got a fix for this, gonna PR it real quick :P
01:25:43*NimBot joined #nim
01:29:30shashlickWhat's up
01:29:38Yardanico@Synth ^
01:29:47Yardanicothey asked for nimterop docs :)
01:30:11shashlickNimterop can handle ncurses no problem
01:30:35shashlickIt's linked off the readme which is large by itself
01:40:04*xicheng[m] joined #nim
01:42:03FromDiscord<ikrima> @leorize sure, here's a sample, annotated with failure points:
01:42:05FromDiscord<ikrima> https://play.nim-lang.org/#ix=2q1d
01:43:16*casaca joined #nim
01:43:27FromDiscord<Synth> I'm stll confused
01:44:30FromDiscord<ikrima> @Yardanico re: genericParams - that's good to know; btw, how did you figure out it only works with literals?
01:44:33shashlickHow can I help
01:44:39Yardanico@ikrima because I tried? :)
01:45:00shashlickWhat would you like to wrap @Synth
01:45:44FromDiscord<ikrima> haha, fair enough! thought i was missing some language insight
01:49:10FromDiscord<Synth> I would like to wrap ncurses.h
01:50:59shashlickWhich os
01:51:15shashlickDo you want to statically link or shared
01:51:18*chemist69_ joined #nim
01:52:06shashlickDo you want to use the version installed by package manager or download a specific version
01:52:10*pbb quit (Remote host closed the connection)
01:52:24FromDiscord<Synth> I want it to be cross platform if possible ;-
01:52:25FromDiscord<Synth> (edit) ';-' => ';-;'
01:52:53shashlickAnything is possible :)
01:53:26*pbb joined #nim
01:53:47FromDiscord<Synth> But I have no clue how...
01:54:38*tiorock joined #nim
01:54:38*rockcavera quit (Killed (hitchcock.freenode.net (Nickname regained by services)))
01:54:38*tiorock is now known as rockcavera
01:54:38*rockcavera quit (Changing host)
01:54:38*rockcavera joined #nim
01:54:47*chemist69 quit (Ping timeout: 265 seconds)
01:55:06*thomasross joined #nim
01:56:33shashlickWhat os are you developing on
01:58:54shashlicklooks like i have a ncurses wrapper lying around, will test and send you
02:03:35FromDiscord<Technisha Circuit> Okay, what's the best way to make a websocket server which broadcasts everything it recieves to all connected clients?
02:03:46Yardanico?????
02:03:49Yardanicojust use a websocket lib?
02:04:19Yardanicohttps://github.com/treeform/ws/blob/master/tests/chat.nim
02:04:46FromDiscord<Technisha Circuit> Thanks :p
02:05:37FromDiscord<Technisha Circuit> I just need either a broadcast function, or a way to loop over all connected clients and send them the message, just wanted to make sure since Python's ws lib was limited as hell
02:08:13*rockcavera quit (Remote host closed the connection)
02:21:51*endragor quit (Ping timeout: 265 seconds)
02:30:15PrestigeDoes anyone here automatically format code with nimpretty on github? Was looking for a way to do it with server side hooks but I'm not seeing a way to do that
02:31:27YardanicoI don't think there's a way to _format_ code automatically on server-side
02:31:33Yardanicothere's a way to lint code though
02:31:40Yardanicobut nimpretty still has bugs :)
02:36:00PrestigeHm
02:36:22Yardanicohttps://github.com/nim-lang/nim/issues?q=is%3Aissue+is%3Aopen+nimpretty
02:36:26PrestigeI miss self-hosting everything
02:45:32*muffindrake quit (Ping timeout: 246 seconds)
02:46:59FromDiscord<KingDarBoja> I have never used nimpretty :(
02:48:02*muffindrake joined #nim
02:50:13FromDiscord<impbox> nim is pretty enough
02:50:35Yardanicounless you use a nimbraces -> nim transpiler and tabs instead of spaces :P
02:50:48Yardanicoah, and of course identifiers like f_O_o_B_a_R
02:50:48*endragor joined #nim
02:50:58YardanicoXD
02:55:29FromGitter<ynfle> Can I cast from StringTable to Table?
02:55:35Yardanicono
02:55:41Yardanicoyou'll need to convert :)
02:55:48Yardanicolike in a for loop or something
02:57:37*endragor quit (Ping timeout: 265 seconds)
03:01:58*thomasross quit (Ping timeout: 265 seconds)
03:02:01FromDiscord<Zed> Yardinco, again have you got something against nim with braces :P
03:02:08Yardanicoyes
03:02:09Yardanicoits not nim
03:02:11FromDiscord<Zed> it looks beautiful
03:02:15FromDiscord<Zed> functional
03:02:27FromDiscord<Zed> powerful
03:02:38FromDiscord<Zed> it's what nim was missing all along
03:02:45Yardanicono
03:02:54FromDiscord<Zed> you just cant escape the braces
03:03:03FromDiscord<Zed> embrace the change
03:04:12FromGitter<ynfle> Speaking of functional... Yardanico, `toSeq(strTable.pairs).toTable`
03:04:22Yardanicobut that's probably not very efficient :P
03:04:29FromGitter<ynfle> Why?
03:04:34Yardanicobecause you're creating copies
03:04:42Yardanicoi mean more copies
03:04:53*endragor joined #nim
03:04:54Yardanicoyou copy the entire string table into a sequence, then make a table out of it
03:06:22Yardanicobut yeah it's okay
03:09:44FromGitter<ynfle> Thanks for the validation
03:10:22FromGitter<ynfle> It's just once for JSON
03:27:23FromDiscord<Technisha Circuit> > unless you use a nimbraces -> nim transpiler and tabs instead of spaces :P↵Nimbraces?
03:28:59FromDiscord<KingDarBoja> Nim with {}
03:31:12FromDiscord<k1tt3hk4t> Are Nim destructors defined for pointers? I would expect it to call destroy on the pointed-to thing then also run dealloc on the pointer, but I'm not sure if this is actually the case
03:31:12FromDiscord<Technisha Circuit> Oh?
03:31:47Yardanico@k1tt3hk4t you need an object which wraps the pointer then
03:31:47FromDiscord<Technisha Circuit> So I could use braces instead of indents?
03:31:48YardanicoI think
03:31:53FromDiscord<k1tt3hk4t> hm ok
03:32:08Yardanico"ref" pointers are automatically managed
03:32:16Yardanicoptr/pointer are not managed at all
03:32:28Yardanicoso yeah, just create an object which wraps your own pointer if you wish to wrap some pointer
03:33:05FromDiscord<k1tt3hk4t> gotcha
03:38:43*rockcavera joined #nim
03:39:22Yardanicooh yes I think I solved my telenim issue
03:39:34Yardanicoidk why I didn't realise it when I encountered it
03:39:43Yardanicoi forgot % for JsonNode works and it's a no-op anyway
03:39:50Yardanicoalthough we lose type checking, hmm
03:47:44*B4s1l3 joined #nim
03:47:52*B4s1l3 is now known as opDispatch
03:59:55*polypus74 quit (Quit: WeeChat 2.8)
04:05:27*team\andinus joined #nim
04:05:47shashlick@Synth - here's an ncurses wrapper using nimterop - https://gist.github.com/genotrance/a05279d6ca27abcd3e45d7e89ca251e4
04:06:02*supakeen quit (Quit: WeeChat 2.8)
04:06:14FromDiscord<Synth> Oh? Thank you
04:06:37*supakeen joined #nim
04:06:51shashlickplease try and see if it works for you
04:07:07shashlickalso, use nimterop@#conan since i've not merged some changes to master yet
04:07:48shashlickin fact, hold off for a minute, i need to push some changes
04:15:00FromDiscord<Technisha Circuit> sent a code paste, see https://discordapp.com/channels/371759389889003530/371759389889003532/725202289647812680
04:15:10FromDiscord<Technisha Circuit> ~~Don't ask why since that doesn't matter~~
04:15:16Yardanicowhy
04:15:28Yardanicowhy are you suddently switching to js backend again
04:15:43FromDiscord<Technisha Circuit> Because my friend TwT
04:15:46Yardanicowhat?
04:15:52Yardanicotell him to compile JS to native code instead
04:16:04FromDiscord<Technisha Circuit> What?
04:16:16Yardanicotell him to learn nim
04:16:20FromDiscord<Technisha Circuit> Okay
04:16:37FromDiscord<Technisha Circuit> :p
04:17:07Yardanicobut generally there's nothing difficult in replicating that JS code
04:17:14Yardanicojust define nim procs which will be imported from js
04:18:05Yardanicoe.g. https://nim-lang.org/docs/jsffi.html#require%2Ccstring
04:20:32shashlick@Synth - okay pushed
04:21:42Yardanico@Technisha it's really easy to do, something like https://play.nim-lang.org/#ix=2q1D although I didn't test it
04:21:46Yardanicojust skimmed through jsffi
04:22:22Yardanicoseems to work actually
04:23:17Yardanicojust tested locally
04:23:40Yardanicoworks just fine, used a nim websocket lib to connect as a client
04:23:44Yardanicoto nodejs running this
04:23:54Yardanicobut you have to remember - Nim's JS backend is NOT for NodeJS
04:23:55Yardanicoit's for browsers
04:27:13FromDiscord<Technisha Circuit> Oh cool
04:27:35FromDiscord<Technisha Circuit> But doesn't any Nim generated JS work in NodeJS too?
04:27:40*marnix joined #nim
04:27:46FromDiscord<Technisha Circuit> And isn't there also a NodeJS flag?
04:27:51Yardanicoit does, I tested in NodeJS, but you'll have to map a lot of nim stuff to NodeJS manually
04:28:00Yardanicoyes, but as I said - NodeJS support is there just for the tests
04:28:17Yardanicoyou'll have to wrap even simplest stuff as stdin/stdout/file reading/writing, as those are not mapped to nodejs
04:29:08FromDiscord<Synth> Thank you shashlick!
04:29:52FromDiscord<Technisha Circuit> Oh okay
04:31:54YardanicoSee some discussion in https://github.com/nim-lang/Nim/pull/14519
04:31:55disbotos module nodejs support
04:31:58Yardanicoit was also in other PRs
04:34:09shashlick@Synth - thank me after it works 😄
04:35:46*waleee-cl quit (Quit: Connection closed for inactivity)
04:40:47FromDiscord<Synth> I will thank you in advance
04:40:57FromDiscord<Synth> If it doesn’t work, it’ll most likely be myfault
04:41:37*narimiran joined #nim
04:45:02*Romanson joined #nim
04:46:02shashlickOk I'm headed to bed, will check back tomorrow if you have any questions
04:47:58*rockcavera quit (Remote host closed the connection)
05:19:08YardanicoI really wonder if there's a way to somehow enhance native debug info for default Nim backend without workarounds like nim-gdb
05:19:32YardanicoI'm compiling nlvm right now, just curious how debugging works with it (the README says that it has proper debug information for all stuff)
05:22:14*dddddd quit (Ping timeout: 240 seconds)
05:26:15Yardanicowell yeah, it's not so much better in nlvm :P
05:27:10*nekits quit (Quit: The Lounge - https://thelounge.chat)
05:28:43*nekits0 joined #nim
05:35:15*nekits0 quit (Quit: The Lounge - https://thelounge.chat)
05:36:51*nekits0 joined #nim
05:45:06Yardanicowell one good thing is that the variable names aren't mangled
06:02:22*solitudesf joined #nim
06:02:48*letto quit (Quit: Konversation terminated!)
06:03:24*vikfret joined #nim
06:04:42*letto joined #nim
06:08:41*ftsf quit (Ping timeout: 272 seconds)
06:10:58skrylar[m]hoi
06:12:54AraqYardanico: what does "not so much better" mean?
06:13:06Yardanicowell I didn't understand how would I get type info in the debugger and stuff
06:13:14Yardanicoe.g. a sequence just displays as (void*) pointer in lldb
06:14:03FromDiscord<Elegant Beef> Anyone know the JSON module that lets you annotate the json object names for an object?
06:14:14Yardanicohttps://github.com/status-im/nim-json-serialization/tree/master/json_serialization
06:14:16FromDiscord<Elegant Beef> or is this a fever dream 😄
06:14:17Yardanicoor my json.to fork
06:14:23*chemist69_ quit (Ping timeout: 272 seconds)
06:14:33Yardanicoalthough it's one way only
06:14:43Yardanico(from JSON to Nim)
06:14:55Yardanicohttps://github.com/Yardanico/telenim/blob/master/src/telenim/json_custom.nim
06:15:05*chemist69 joined #nim
06:15:07Yardanicojust copy it in your project, import and then use jsonName pragma on your object fields :D
06:15:21YardanicoI maybe will try to make a PR when the macros pragma PR gets merged
06:15:41Yardanicohttps://github.com/nim-lang/Nim/pull/11526 I mean
06:15:42disbotgetCustomPragma is split up in more usable chunks
06:16:02FromDiscord<Elegant Beef> yea i dont need it im just talking about ways we can annotate in nim similar to C#
06:16:08Yardanicopragmas
06:16:15Yardanicocheck https://github.com/Yardanico/telenim/blob/master/src/telenim/types.nim
06:16:29Yardanico(be careful, it's 14k loc)
06:16:41FromDiscord<Elegant Beef> Yea i know, just wanted a visible version
06:16:51Yardanicowell in https://github.com/Yardanico/telenim/blob/master/src/telenim/json_custom.nim at the bottom there's a small test
06:18:26Yardanicohttps://play.nim-lang.org/#ix=2q1R
06:20:02FromDiscord<Elegant Beef> Thanks
06:20:36FromDiscord<Elegant Beef> Ooh the object variance usage is nice
06:22:34FromDiscord<Elegant Beef> And that reminded me i needed to updoot the RFC for object variances 😄
06:22:57Yardanicoyou mean the shared fields one? which variant (pun not intended) of implementation you prefer?
06:23:28FromDiscord<Elegant Beef> The modification of case inside of object
06:23:33Yardanico?
06:23:52Yardanicohttps://github.com/nim-lang/RFCs/issues/19#issuecomment-173529871 or https://github.com/nim-lang/RFCs/issues/19#issuecomment-633684323
06:23:52disbotAllow usage of the same attribute name in different branches within variant types
06:24:25YardanicoI don't think the one in the issue body itself will be approved :)
06:24:51FromDiscord<Elegant Beef> the one 4raq suggested
06:24:55Yardanicoyeah it's nice
06:25:20FromDiscord<Elegant Beef> Well write less code not more, especially when more just is redundant
06:25:46FromDiscord<Elegant Beef> i'd even wager just stop using the `word` case inside object and use `variant`
06:25:58FromDiscord<Elegant Beef> (edit) '`word` case' => 'word `case`'
06:25:59FromDiscord<Elegant Beef> Im tired
06:26:00FromDiscord<Elegant Beef> 😄
06:26:11Yardanicolol
06:26:50FromDiscord<Elegant Beef> I only say that so it's more verbose and less "why is there a case statement that fires for multiple things"
06:27:08Yardanicowell it means introducing yet another keyword :P
06:28:17FromDiscord<Elegant Beef> shhh
06:28:31Yardanicothe last keyword change was 3 years ago https://github.com/nim-lang/Nim/commit/cae5e33a4a66406813769361233438c7d2df6009
06:28:40Yardanicowell, 2.5
06:36:58*PMunch joined #nim
06:38:38*zedeus quit (Ping timeout: 256 seconds)
06:42:48*Vladar joined #nim
06:56:16skrylar[m]custom pragmas are nice yes
06:56:36skrylar[m]i remember when we didn't have them and the answer was "make a macro to hold the typedef, and then take an aspirin"
06:57:27skrylar[m]although for something like json, i suppose the macro could just be a much simpler field->name mapping and just output the encode/decode functions behind it
06:59:47*tane_ joined #nim
07:04:33FromDiscord<Rika> i'm trying to understand how guildenstern starts weave but i dont see where `init(Weave)` is called, is it not needed here? https://github.com/olliNiinivaara/GuildenStern/blob/master/src/guildenstern/dispatcher.nim
07:05:04Yardanicosee https://github.com/olliNiinivaara/GuildenStern/blob/master/src/guildenstern/dispatcher.nim#L248
07:05:09Yardanicoit runs weave in a background thread
07:05:11Yardaniconot in the main one
07:07:08FromDiscord<Rika> doesnt that still require an init(Weave)?
07:07:15Yardanicowhy?
07:07:19FromDiscord<Rika> if not, why is exit(Weave) called?
07:07:41Yardanicoyou know you can just check the source of weave?
07:07:51FromDiscord<Rika> sounds scary
07:08:59FromDiscord<Rika> yeah i dont understand anything here
07:09:37Yardanicohttps://github.com/mratsim/weave/blob/master/weave/runtime.nim#L32
07:12:14*endragor quit (Remote host closed the connection)
07:12:40*endragor joined #nim
07:12:59FromDiscord<Rika> man if i understood this would i have asked↵i mean i do understand some things but its still not answered my question
07:13:03*chemist69 quit (Quit: WeeChat 2.7)
07:13:08FromDiscord<Rika> rather now i have new questions
07:13:24*chemist69 joined #nim
07:16:47FromDiscord<Elegant Beef> Now a follow up question to the pragmas, it seems you cant annotate enums values with pragmas?
07:17:01Yardaniconot really
07:18:13*endragor quit (Ping timeout: 264 seconds)
07:18:52*endragor joined #nim
07:18:58FromDiscord<Elegant Beef> damn
07:19:06Yardanicobtw apparently ./koch test is pretty fast on 16 threads :P
07:23:08*Tlanger joined #nim
07:24:05*pietroppeter joined #nim
07:25:37*Tongir quit (Ping timeout: 246 seconds)
07:29:01*marnix quit (Ping timeout: 264 seconds)
07:39:11*casaca quit (Remote host closed the connection)
07:40:21*casaca joined #nim
08:00:02FromDiscord<Rustem B.> hello
08:00:37FromDiscord<Yardanico> What do you guys think about making non-english channels in Discord (in a separate section from General). It'll allow people who don't know English a lot to ask questions in their language (well I guess I'll create channels for most popular ones)
08:00:41FromDiscord<Yardanico> @Rustem B. hi
08:01:07*nikita` joined #nim
08:01:07*nikita` quit (Changing host)
08:01:07*nikita` joined #nim
08:01:14FromDiscord<Rustem B.> > What do you guys think about making non-english channels in Discord (in a separate section from General). It'll allow people who don't know English a lot to ask questions in their language (well I guess I'll create channels for most popular ones)↵@Yardanico good idea
08:01:58FromDiscord<Elegant Beef> Seems fine
08:02:46FromDiscord<Rika> most popular -> ?
08:03:05FromDiscord<Rustem B.> > most popular -> ?↵@Rika Russian 😄
08:03:10FromDiscord<Yardanico> For a start we might have Chinese, Spanish, Russian, maybe some European ones like German, French?
08:03:39FromDiscord<Elegant Beef> Spanish ... "Maybe some european ones"
08:03:41FromDiscord<Elegant Beef> Lol
08:03:45skrylar[m]i had the realization earlier when looking at using zeromq for something in nim... mostly that if you don't care about most of the stuff in http, you can actually use http to control stuff with not really that much code :think:
08:03:48FromDiscord<Elegant Beef> Rest in America Spanish
08:03:54FromDiscord<Rustem B.> i know some italian prbbly here↵> For a start we might have Chinese, Spanish, Russian, maybe some European ones like German, French?↵@Yardanico
08:04:11FromDiscord<Yardanico> Well the thing is that there's a lot of languages :)
08:04:34FromDiscord<Yardanico> I think the max limit would be 10
08:04:48FromDiscord<Yardanico> 10 language specific channels
08:05:21FromDiscord<Elegant Beef> I'll say do it
08:05:56FromDiscord<Elegant Beef> Only if you make the category named "Dirty Foreigners" 😛
08:06:37FromDiscord<impbox> any reason to not just have non-english chat in the appropriate channel for topic rather than language based?
08:07:01FromDiscord<impbox> surely many people here are multilingual?
08:07:17FromDiscord<Elegant Beef> I know English and Cuntish
08:07:19FromDiscord<Yardanico> Yes, but most are English and their native language
08:07:20skrylar[m]noise
08:07:21FromDiscord<Rustem B.> > Only if you make the category named "Dirty Foreigners" 😛↵@Elegant Beef and "Oh, this Russians..." 😛
08:08:03skrylar[m]if i just started babbling away in gaelic the room looks busy but it doesn't help most anone here
08:08:13FromDiscord<impbox> if someone asks a question here in language X, someone else who understands language X can respond.
08:08:15skrylar[m]although if this was zulip you'd just put the language code in your topic and people could ignore or read it /shrug
08:08:34FromDiscord<Elegant Beef> Well an issue will arise that english people are going to make the questions fade away
08:08:35FromDiscord<impbox> sure not everyone will understand
08:08:45FromDiscord<Elegant Beef> They will obviously be less trafficked but could be more helpful
08:08:55FromDiscord<impbox> that's a fair point @Elegant Beef
08:09:15skrylar[m]altho depending on where the server is i'm not sure "our mods don't speak that language" is a valid defense
08:09:25FromDiscord<impbox> even if english is not first language, people might still be able to help via translator assistance
08:09:30FromDiscord<Elegant Beef> We dont get many shitheads here
08:09:38FromDiscord<Yardanico> True that
08:09:49FromDiscord<Elegant Beef> Idk which part the true is
08:10:03FromDiscord<Yardanico> We only have two banned people here
08:10:08FromDiscord<impbox> we could all be shitheads here, but pretending we're not >_>
08:10:15FromDiscord<Elegant Beef> *coud*
08:10:19FromDiscord<Elegant Beef> *could**
08:10:20FromDiscord<Yardanico> That's how society works
08:10:59FromDiscord<Elegant Beef> Im clearly the prime example of a shit head
08:11:03FromDiscord<Elegant Beef> I just control myself 😛
08:12:08FromDiscord<impbox> #rust-comparison-questions
08:13:07FromDiscord<Rika> #case-insensitivity-complaints-counter
08:17:02FromDiscord<Yardanico> #slower-than-python
08:17:31FromDiscord<Rustem B.> #pascal
08:17:42FromDiscord<Yardanico> lol
08:19:19FromDiscord<exelotl> #ampersand-hard-to-reach
08:19:37FromDiscord<Yardanico> #no-dollar-on-keyboard
08:23:07FromDiscord<Rustem B.> #russian-on-keyboard
08:30:07FromDiscord<Technisha Circuit> ?
08:32:45narimiran#ampersand-hard-to-reach --> my favourite nim moment!
08:38:24PMunchTBF, some of the characters Nim and other programming languages are pretty hard to reach on some keyboards
08:39:50TlangerMaybe time for a new keyboard layout?
08:40:11TlangerThe next dvorak
08:41:09FromDiscord<Yardanico> So @narimiran what do you think about creating channels for other languages here in Discord?
08:41:24narimirani don't have an opionion about it :)
08:41:32FromDiscord<Yardanico> Although I probably wouldn't map them to IRC since no one will use these IRC channels
08:41:35FromDiscord<Rika> i dont understand the hard to reach argument
08:41:42PMunchTlanger, I actually did have numbers and symbols swapped on my keyboard before, but I couldn't quite get used to it..
08:42:02PMunchBesides, some keys on Norwegian boards require AltGr to get to..
08:42:24PMunch@Rika, what don't you understand about it
08:42:36PMunchNot all the symbols on your keyboard are as easy to reach as others
08:42:38FromDiscord<Rika> its misworded
08:43:04FromDiscord<Rika> its more of "the layers on my keyboard are different" then is it not
08:43:16FromDiscord<Rika> when i think of reach i think of physically reaching for a symbol
08:43:33FromDiscord<Rika> not requiring more modifiers to access the symbo
08:43:35FromDiscord<Rika> l
08:44:08PMunchEh, hard to type then I guess
08:45:06*casaca quit (Remote host closed the connection)
08:48:48FromDiscord<KrispPurg> I think creating channels for other languages is good.
08:50:54PMunchHmm, anyone wants to modify this script to output the valid ranges of colours? Would be cool to be able to visually see what colours are available to be able to pick one: https://github.com/github/linguist/blob/master/test/test_color_proximity.rb
08:51:08PMunchref: https://github.com/github/linguist/pull/4866
08:51:09disbotChange Nim's colour to better match the logo
08:53:17FromDiscord<KrispPurg> Why isn't the new Nim colour on GitHub yet?
08:53:56PMunchRead the last couple comments on the PR
08:54:30PMunchBasically another language named Daphne got a colour that crashes with the new Nim one before the Nim PR was accepted
08:54:36PMunchSo it got rolled back
08:54:55ZevvHey that's the color of my bikeshed
08:55:04PMunchZevv, hahaha :P
08:55:12FromDiscord<Yardanico> Yeah, I then found a couple of a bit similar good colors
08:55:24FromDiscord<Yardanico> But then some people started saying they don't want the change
08:55:37FromDiscord<Yardanico> So I kinda thought it's not needed
08:55:45FromDiscord<KrispPurg> Oh ;-;
08:56:06FromDiscord<Recruit_main707> it could be nice, but i dont think they would really be used
08:56:29FromDiscord<Yardanico> See https://forum.nim-lang.org/t/6350
08:58:38narimiran#keepNimGreen
08:59:28PMunchWhy should it be green though?
09:00:47FromDiscord<Yardanico> Because a GitHub employee in 2012 decided that it should be green
09:00:56FromDiscord<Yardanico> And people are "used to the current color"
09:02:00PMunchI know why it is green, but why do people want to keep it green?
09:02:02FromDiscord<Recruit_main707> its not the best, (but it could be worse)
09:02:22FromDiscord<Recruit_main707> i do think it should be changed to something more fitting
09:02:47FromDiscord<Recruit_main707> a nice deep dark blue for example
09:03:00FromDiscord<Rika> ~~new color too close to js~~
09:04:29FromDiscord<Vindaar> the fact that nim is green will guarantee nim will become the dominant language in our sustainable "everything is green" future!
09:04:35FromDiscord<Rika> lmao
09:05:44PMunchHere is for all you Green Nim fans: https://uploads.peterme.net/greennim.png
09:05:58FromDiscord<Recruit_main707> ewww
09:06:15FromDiscord<Recruit_main707> nim already gets roasted without an ugly logo :P
09:06:40FromDiscord<Rika> ugly?
09:06:43FromDiscord<Rika> oh misread
09:06:45FromDiscord<Yardanico> There was blue Nim
09:07:12FromDiscord<Recruit_main707> this is the color i think it should have in github https://media.discordapp.net/attachments/371759389889003532/725275826681020426/unknown.png
09:07:34FromDiscord<Recruit_main707> something like that
09:07:53PMunch@Recruit_main707, royal blue?
09:08:07PMunch@Yardanico, yeah I'm trying to remember where I found those :P
09:08:20FromDiscord<Yardanico> https://raw.githubusercontent.com/nim-lang/assets/68c7559921fc98d47d96f0bd1d446e27d53bd8c4/Unused/Web%20Concept/web%20design.svg
09:08:42FromDiscord<Yardanico> https://raw.githubusercontent.com/nim-lang/assets/68c7559921fc98d47d96f0bd1d446e27d53bd8c4/Unused/Web%20Concept/design.svg
09:09:10FromDiscord<Recruit_main707> it looks nice, but that blue is to go-ish
09:09:16FromDiscord<Recruit_main707> too*
09:10:02FromDiscord<KrispPurg> PMunch, that logo is cursed.
09:11:07FromDiscord<KrispPurg> Interesting concept
09:11:59PMunchThere's also these: https://raw.githubusercontent.com/nim-lang/assets/68c7559921fc98d47d96f0bd1d446e27d53bd8c4/Unused/Web%20Concept/new-logos.png
09:12:48FromDiscord<KrispPurg> Huh.
09:15:00PMunchHmm, I have a guy at work who's maintaining some firmware for the PortaPack(HackRF) project. He asked me if it was possible to use Nim to help with how tedious it is to create new "apps" for it as that currently requires edits to multiple files to add in graphics and CMake entries. Have anyone done something like this before?
09:15:46PMunchLike create a small wrapper that replaces all the logic in a CMake file in Nim, and use compile-time features to read through files and folders to automatically add stuff.
09:17:53FromDiscord<Yardanico> Well there's Nake
09:18:03FromDiscord<Yardanico> But it compiles a native binary which then does the stuff
09:18:14*casaca joined #nim
09:18:34PMunchYeah, another build tool isn't really solving anything :P
09:19:08PMunchThis is what adding an app looks like now: https://github.com/eried/portapack-mayhem/commit/e43f8148610a40df0d01864d7fa825759fa75c4c
09:20:11*krux02 joined #nim
09:21:12PMunchAs you can see, adding some stuff in CMake files, adding graphics as a C++ array into a file, adding references to it in the navigation part, etc.
09:22:07PMunchBasically he would want to rewrite the parts of the program that are just listings of stuff in Nim, to have it do it automatically, and then have Nim build the whole thing.
09:25:10*vikfret quit (Quit: Leaving)
09:26:27pietroppeter@PMunch and @Yardanico : I did implement in Nim the color distance used in linguist color proximity test, but I got stuck while trying to reproduce the failing test between Dafny and Nim. Here is a repo with my implementation. The idea was, once I can reproduce color proximity to start from a color and find the closest that is valid for linguist. Here is my repo: https://github.com/pietroppeter/color_distance
09:27:15*drdee joined #nim
09:29:14FromDiscord<Yardanico> Oh nice
09:29:19FromDiscord<Yardanico> I had a similar idea too
09:29:20*lpirl joined #nim
09:34:26PMunchpietroppeter, it does produce a small difference for me between those colours
09:36:06PMunchAlthough the ones from the "color-proximity ruby gem README" fails
09:36:36pietroppeterah yes, you are right. in fact rerunning nimble test that one goes ok. I think it is the actual value that was off (looking at the test failure probably I could find it) and that lead me to check against color-proximity
09:36:54lpirlDear nim community. A beginner question: How would one implement monotonic tasks? I found asyncdispatch.addTimer which could maybe used, no? But looking at the source, this would drift, I guess. To avoid the drift, would one need to fiddle with absolute times and sleep timers manually?
09:37:20pietroppeterI did it a couple of weeks ago and I already forgot what was working and what not...
09:37:47pietroppeterI may have to check again
09:38:55*fredrikhr joined #nim
09:46:44*oddp joined #nim
10:06:28FromDiscord<Clyybber> @Yardanico: Regarding #14788 can you merge the test into tests/misc/tcast.nim ?
10:06:28disbothttps://github.com/nim-lang/Nim/pull/14788 -- 3Reject casts to builtin typeclasses
10:07:10FromDiscord<Yardanico> @Clyybber okay
10:09:00*lritter joined #nim
10:09:56Yardanico@Clyybber is it fine if I make it like https://gist.github.com/Yardanico/9b76d9029b374320c35d0ce73fe38a47
10:11:33*chemist69 quit (Ping timeout: 244 seconds)
10:11:59*chemist69 joined #nim
10:12:10*Tongir joined #nim
10:13:10Yardanicohttps://github.com/nim-lang/Nim/pull/14788/commits/c0546bc82e688911081deb432e99e55f914f2705
10:13:12disbotReject casts to builtin typeclasses
10:14:32*Tlanger quit (Ping timeout: 256 seconds)
10:17:01*Romanson quit (Quit: Connection closed for inactivity)
10:29:36PMunchlpirl, what you could do is record time since you started the previous iteration and then asyncSleep delayTime - spentTime
10:33:13*dddddd joined #nim
10:37:53lpirlPMunch, alright, thank you. This is what I was referring to with "fiddle manually". :) Maybe I work with absolute times + multiples of delayTime. Anyway, just wanted to make sure there is no library functionality I missed.
10:38:22*Lord_Nightmare quit (Quit: ZNC - http://znc.in)
10:38:52PMunchDouble check first though that addTimer does in fact drift, I would think it had protection against that
10:38:58FromDiscord<Yardanico> For mono times there's std/monotimes module btw :)
10:40:44*lpirl quit (Quit: Connection closed)
10:41:12*lpirl joined #nim
10:41:21*Lord_Nightmare joined #nim
10:44:23PMunchpietroppeter, have you tried to see if the ruby version complies with the test vectors from the paper?
10:45:50pietroppeterwell actually I just tried the example usage from color-proximity readme and the results are different from what they are reported. with correct results my test is passed!
10:45:55pietroppeterso all is good actually!
10:46:12PMunchAah, so it's a bug in their documentation? :P
10:48:36pietroppeteryep
10:49:06PMunchMaybe create an issue?
10:49:15pietroppeterI will create a PR
10:49:26PMunchEven better :)
10:49:37FromDiscord<Clyybber> @Yardanico Yeah, its perfect
10:51:47lpirlPMunch cheers, will do.
10:52:00*lpirl quit (Quit: Connection closed)
10:58:28*marnix joined #nim
11:00:00PMunchHmm, now to figure out how NimYaml works so I can pare the colour codes out from the languages file..
11:04:44*Romanson joined #nim
11:45:37*sacredfrog quit (Quit: ZNC 1.8.1 - https://znc.in)
11:46:36*sacredfrog joined #nim
12:00:53*marnix quit (Ping timeout: 265 seconds)
12:06:01*supakeen quit (Quit: WeeChat 2.8)
12:06:38*supakeen joined #nim
12:22:33*rockcavera joined #nim
12:23:07FromDiscord<Clyybber> @dom96 Hit an issue with using `nimble develop pkg`; it doesn't work with binary only pkgs
12:23:10*solitudesf quit (Ping timeout: 256 seconds)
12:34:22*waleee-cl joined #nim
12:38:51*thomasross joined #nim
12:52:35*abm joined #nim
12:54:28*zedeus joined #nim
13:18:58ZevvI'm having this discussion with a colluage about sharing memory between threads without holding a mutex/lock on the reader side
13:19:16Zevvwhere do I find authoritive documentation to throw at him
13:20:42FromDiscord<mratsim> Perdersen algorithm
13:20:49FromDiscord<mratsim> Lamport's Bakery algorithm
13:20:55FromDiscord<mratsim> Dekker's algorithm
13:21:05FromDiscord<mratsim> Use TLA+ to prove soundness
13:21:07Zevvnah, something simple and short that says "just don't do that"
13:21:17FromDiscord<mratsim> ah
13:21:25Zevvhe's too high level schooled
13:21:28FromDiscord<mratsim> googling for "torn reads" might help
13:21:44Zevvthanks
13:21:46FromDiscord<mratsim> and also my talk
13:21:50Zevvhaha :)
13:22:00ZevvIt's a C++ discussion, but sure
13:22:16*thomasross quit (Ping timeout: 246 seconds)
13:22:50FromDiscord<mratsim> well the initial example I used was from C++
13:23:30Zevvlemme check
13:23:36FromDiscord<mratsim> sent a code paste, see http://ix.io/2q3i
13:23:53Zevvyeah sure, but you're not authoritive are you :)
13:24:03FromDiscord<mratsim> you can have (1,0), (0, 1), (1, 1)
13:24:10Zevvto _me_ you are, though
13:24:39FromDiscord<mratsim> but you can also have (0, 0) because the compiler is free to reorder reads if there is no observable effect on the program semantics
13:24:59Zevvsure
13:25:11FromDiscord<mratsim> if you don't tell that you have sharing, by the use of critical sections or atomics, anything can happen
13:27:15FromDiscord<mratsim> In terms of authoritative, maybe there is a summary of Herb Sutter talk, weapons of Atomic<> destruction
13:28:11Zevvyeah, UB was my argument. I found that in my career I should either learn everything there is to know about this stuff to do it right, or just stick to one or two very simple rules.
13:28:25ZevvDon't share. Keeps your locks localized.
13:41:27*Senny quit (Ping timeout: 260 seconds)
13:41:42FromDiscord<mratsim> I learned a lot and I hade a slide "Share nothing" :p
13:41:48FromDiscord<mratsim> (edit) 'hade' => 'had'
13:42:35FromDiscord<mratsim> And yes, everything that deals with synchronization should be tucked into a as simple module as possible
13:43:36FromDiscord<mratsim> That' why I have a couple of modules that are just glorified atomic int or atmoic pointers: https://github.com/mratsim/weave/blob/master/weave/cross_thread_com/scoped_barriers.nim#L57↵https://github.com/mratsim/weave/blob/master/weave/cross_thread_com/channels_spsc_single_ptr.nim#L45
13:43:50*haxscramper joined #nim
13:48:25haxscramperUnder what conditions macro with `untyped` arguments might trigger `undeclared identifier` error? Error goes away if I define `const/var/let` with required name. And I'm failing to replicate the error with simple macro - it does not give any errors.
13:55:57alehander92_you can use expandMacros
13:56:04alehander92_to see what does it generate maybe
13:56:22FromDiscord<mratsim> everytime there is a semcheck error for whatever reason, macros with untyped parameter throws an undeclared identifier error unfortunately
13:57:00FromDiscord<mratsim> if you can't use expandMacros if the error is in the generated code, put "result.toStrLit" at the end of your code
13:57:20FromDiscord<mratsim> and replace the macro call with the expanded Nim code that is output
14:13:12Zevvwell, in the end it was Ye Olde 'Prograaming with POSIX Threads" book from my bookshelf that had to make the final verdict on this.
14:14:20*PMunch quit (Quit: Leaving)
14:19:03alehander92_you didnt fight with books did ya
14:25:05ZevvWell, the fun part is that some time ago I was moving rooms and wanted to get rid of some books. So I put a picture of my bookshelf on the company slack, and got laughed at
14:25:08ZevvBut here we are
14:25:36ZevvAnd I was always refusing to use threads, and they found me a bit of a whiner.
14:25:43Zevvso I must admit, this feels good :)
14:27:21FromDiscord<Zachary Carter> @mratsim - I'm read through that markdown document you shared with me about messing with vtables to satisfy C++ pure virtual function classes, but I don't know if it will help me with what I'm trying to do. In fact I'm kind of stuck as far as how to proceed.
14:28:11FromDiscord<Zachary Carter> https://github.com/mosra/magnum-examples/blob/master/src/triangle/TriangleExample.cpp - is essentially what I need to produce in Nim
14:28:57FromDiscord<Zachary Carter> https://github.com/mosra/magnum/blob/master/src/Magnum/Platform/Sdl2Application.h#L432-L1218 - is the class that class inherits from
14:29:17FromDiscord<Zachary Carter> so there are a few virtual methods that need overrides but I also need to implement a constructor
14:41:48Zevvmratsim: where was this list of weave-vs-the-rest-of-the-world performance?
14:52:15FromDiscord<Zachary Carter> so if I emit a C++ class and it defines a constructor - is there any way I can implement it in Nim or do I need to implement it in C++?
14:52:40FromDiscord<Zachary Carter> I guess the easy thing to do would be to just have a constructor that calls some Nim proc to initialize everything
14:58:29Zevv!seen treeform
14:58:30disbottreeform spoke in 12#nim 22 hours ago 12https://irclogs.nim-lang.org/23-06-2020.html#16:13:39
14:58:52alehander92_!seen disruptek
14:58:52disbotdisruptek spoke in 12disbot 12 hours ago
15:01:06FromDiscord<willyboar> !last disruptek
15:01:07disbotdisruptek spoke in 12disbot 12 hours ago
15:04:16alehander92_!read !last
15:04:29alehander92_that would be useful , linking to source or stuff
15:10:16*endragor quit (Remote host closed the connection)
15:44:28*Romanson quit (Quit: Connection closed for inactivity)
15:56:04*haxscramper quit (Remote host closed the connection)
15:57:00*solitudesf joined #nim
15:58:42*vikfret joined #nim
16:04:37*abm quit (Quit: Leaving)
16:04:52FromDiscord<treeform> Zevv, I see you.
16:05:29*solitudesf- joined #nim
16:07:34*solitudesf quit (Ping timeout: 240 seconds)
16:11:28*NimBot joined #nim
16:33:45FromDiscord<Zachary Carter> How would I `importcpp` this constructor? ```constexpr Arguments(int& argc, char** argv) noexcept: argc{argc}, argv{argv} {}```
16:33:54euantorAraq: Sorry, seems I made a minor error in #14716 which we all missed - I've opened https://github.com/nim-lang/Nim/pull/14792 to resolve it, should be good to merge
16:33:55disbotPatch #14716 - add missing `when`
16:39:05FromDiscord<Recruit_main707> how do i set a project to use arc from .nimble?
16:43:04FromDiscord<Recruit_main707> you cant right?↵then will it use the .nims files?
16:49:17*D_ quit (Ping timeout: 260 seconds)
16:54:24FromDiscord<BRxMayor> Hi all.. where can i read docs of previous releases?
16:56:37leorize@Zachary just import it as described in the manual
16:57:31leorize@BRxMayor: https://nim-lang.org/<version>/overview.html
16:57:49FromDiscord<Yardanico> @Recruit_main707 guy can use nims or Nim config
16:57:57FromDiscord<Yardanico> You*
16:58:05FromDiscord<Recruit_main707> ok
16:58:08leorizeIf you want 1.0.0 for example: https://nim-lang.org/1.0.0/overview.html
17:02:59*D_ joined #nim
17:09:06FromDiscord<BRxMayor> @leorize[IRC]#0000 thanks a lot
17:10:03*bung joined #nim
17:12:43FromDiscord<juan_carlos> Python will get Pattern Matching on std lib after 3.10+ 🤔
17:13:19bunganyone has experience using https://github.com/treeform/typography ? am wondering how to extract sub glyphs then combine to new font
17:19:37Zevvtreeform: just a complimet on your vid, I just watched it today. I like your enthausiasm a lot, good marketing. And I admit I didn't properly graps what fidget when you gave a brieff demo in Brussels, but it's pretty darn cool!
17:23:45FromDiscord<Yardanico> @treeform ^
17:24:32*team\andinus is now known as notandinus
17:32:50*vikfret quit (Quit: Leaving)
17:34:50*pbb quit (Remote host closed the connection)
17:36:06*pbb joined #nim
17:36:19*livcd_ quit (Ping timeout: 265 seconds)
17:36:58FromDiscord<Zachary Carter> leorize: I tried - ```proc constructArguments(argc: var cint; argv: cstringArray): Arguments {.constructor, importcpp: "Magnum::Platform::Sdl2Application::Arguments(@)", header: MagnumPlatformHeaderPath/"Sdl2Application.h".}``` however I just get - ```note: candidate constructor not viable: requires 2 arguments,↵ but 0 were provided↵ /*implicit*/ constexpr Arguments(int& argc, char** argv) noexcept: argc{argc},
17:37:11FromDiscord<Zachary Carter> not sure why
17:37:56*mujina joined #nim
17:38:19leorize[m]maybe look at the generated code?
17:43:49*waleee-cl quit (Quit: Connection closed for inactivity)
17:46:56FromDiscord<Rika> https://github.com/apense/shimsham this is a nice library, sadly the dude just suddenly disappeared from github
17:55:56Yardanicowhy
17:55:57Yardanicothis
17:55:57Yardanicoagain
17:55:58Yardanicohttps://forum.nim-lang.org/t/6482
18:00:14Araqprobably I got the growth factor wrong for seqs_v2
18:00:54AraqYardanico: please have a look
18:01:06Araqso ... scope based memory management works for "Hello world"
18:01:13Araqgood enough for a day
18:01:32Araqand the code isn't a clusterfuck of special cases
18:02:17Yardanicowhy me? :P test stuff with it?
18:02:50FromDiscord<treeform> Zevv, thansk!
18:07:35*dddddd quit (Ping timeout: 260 seconds)
18:23:46planetis[m]only thing different is ``max(resize(oldCap), len+1)``
18:29:09FromDiscord<Shucks> How would I check if a object variable got constructed?
18:29:24FromDiscord<Shucks> e.g.: https://paste.sh/ZkPLA49s#7xMLPeX4GXUhEnFZEJ4bZyUp
18:29:49FromDiscord<Shucks> I mean I could check if x is 0 but guess thats not the cool way ;p
18:29:58leorizethat's actually how it's done lol
18:30:08leorizein Nim we don't have the idea of a "constructed" object :P
18:30:16FromDiscord<Shucks> oh, alright
18:30:56*mujina quit (Ping timeout: 256 seconds)
18:31:04leorizeif your object requires initialization, you can use `{.requireInit.}` on the type to ensure that the object must be created via a full construction
18:31:19leorizeusually the default 0-init state works well enough :P
18:32:00FromDiscord<Shucks> oh good to know that pragma, thanks 🙂
18:32:58*fredrikhr quit (Read error: Connection reset by peer)
18:33:49FromGitter<timotheecour> @araq can I merge https://github.com/nim-lang/Nim/pull/14777 ? I’ve reviewed it thoroughly
18:33:50disbotCleanup
18:34:12AraqNo, I don't like it
18:34:38FromGitter<timotheecour> why not?
18:36:28Araqreplied with my remarks
18:37:50*vikfret joined #nim
18:40:58*fredrikhr joined #nim
18:43:30FromDiscord<lqdev> leorize: when was that pragma introduced?
18:45:17leorize[m]1.2 is when an implementation that work reasonably well shipped
18:45:25leorize[m]exactly when it was introduced, I don't know
18:45:47FromDiscord<treeform> bung, I don't have a way to create new fonts. If you going to create new fonts I recommend making .svg fonts as they are much simpler format. Then use tools like fontforge to make it into a ttf.
18:46:10FromDiscord<treeform> bung, you can extract parts of glyphs though. That is not a problem.
18:46:18leorizeisn't svg font a tiny bit worse because you can't do hinting on them?
19:01:34FromDiscord<treeform> I don't think ppl care about hinting with high dpi screens.
19:02:07FromDiscord<treeform> They support kerning which is all I need.
19:02:09FromDiscord<brainproxy> I'm having a problem compiling a project on Windows 10 using mingw `x86_64-8.1.0-release-posix-seh-rt_v6-rev0`↵https://gist.github.com/michaelsbradleyjr/cafe65e5fb7f87aa6c835aae60c93ca0↵↵it seems some type defs in nim are conflicting with same types as provided in `.h` files that are part of mingw
19:02:37leorize@treeform there are still plenty of low dpi screens out there
19:02:43leorizemost people are still on 1080p for example
19:03:02leorizeand some poor lad like me are on 786p...
19:03:52FromDiscord<Generic> me too 😦
19:04:24FromDiscord<Generic> subpixel font rendering still has it's place
19:04:52*zedeus quit (Ping timeout: 256 seconds)
19:10:18*zedeus joined #nim
19:12:08FromDiscord<lqdev> that's why I didn't adopt treeform's typography lib into my engine :(
19:12:36FromDiscord<lqdev> freetype produces really crisp text with its hinting and it looks amazing on my low-res 1080p screen
19:13:51*pietroppeter quit (Quit: Connection closed for inactivity)
19:13:54*waleee-cl joined #nim
19:17:34*natrys joined #nim
19:17:58*haxscramper joined #nim
19:19:57haxscramperHow I can iterate over `fieldPairs` and check if particular field is a `case`? Is there any built-in way or I have to write macro and process `getImpl` output.
19:24:25YardanicofieldPairs doesn't work with case objects
19:24:34Yardanicoyou'll have to use a macro
19:26:25Zevvtreeform: how do I get the figma plugin without having to do typescript locally?
19:26:40Zevvit's also not part of the nimble, is it?
19:32:08*rockcavera is now known as Guest46705
19:32:08*tiorock joined #nim
19:32:09*Guest46705 quit (Killed (tolkien.freenode.net (Nickname regained by services)))
19:32:09*tiorock is now known as rockcavera
19:41:07*D_ quit (Ping timeout: 240 seconds)
19:41:37*chemist69 quit (Ping timeout: 260 seconds)
19:42:01*chemist69 joined #nim
19:43:22*FromDiscord quit (Remote host closed the connection)
19:43:35*FromDiscord joined #nim
19:44:08Yardanico11
19:44:41*D_ joined #nim
19:45:03*lritter quit (Quit: Leaving)
19:56:23*polypus74 joined #nim
19:57:56*zedeus quit (Ping timeout: 265 seconds)
19:58:43*pietroppeter joined #nim
19:59:31*zedeus joined #nim
20:02:20FromDiscord<treeform> Zevv, I do typescript locally. I submit my plugin into the Figma's plugin place. So hopefully it will just be there and you would add it as a normal plugin.
20:02:29*haxscramper left #nim ("ERC (IRC client for Emacs 26.3)")
20:04:09*Senny joined #nim
20:11:36*dmi0 joined #nim
20:25:17FromDiscord<treeform> leorize, Generic, I know I alone can't compete with FreeType, ClearType and Core Text features set. They are made by like 100s of people.
20:26:50FromDiscord<lqdev> it's fine dude, typography is still an amazing project
20:28:08*rockcavera quit (Remote host closed the connection)
20:33:49*zedeus quit (Ping timeout: 246 seconds)
20:35:44*zedeus joined #nim
20:46:45*narimiran quit (Ping timeout: 265 seconds)
20:49:00*drdee quit (Remote host closed the connection)
20:49:19Yardanico1666 issues now, nice
20:50:14zedeusnice
20:50:26FromDiscord<lqdev> nice
20:55:51FromDiscord<Rika> cursed
20:58:30FromDiscord<KrispPurg> Oh boy. https://media.discordapp.net/attachments/371759389889003532/725454828633063544/Screenshot_20200624-215809_Discord.jpg
21:01:29FromDiscord<willyboar> You are used to it after a while
21:02:15*Vladar quit (Quit: Leaving)
21:04:41*dddddd joined #nim
21:08:39FromDiscord<willyboar> disbot: where is disruptek?
21:09:05FromDiscord<willyboar> disbot: are you here?
21:09:16leorize!seen disruptek
21:09:17disbotdisruptek spoke in 12disbot 18 hours ago
21:11:44FromDiscord<willyboar> I have days to see him. Before conf
21:14:16leorizehhe last spoke in PM with disbot it appears
21:14:18leorizehe*
21:20:22*mutanttu1key is now known as mutantturkey
21:20:52*mutantturkey is now known as Guest28269
21:21:23*Guest28269 is now known as argv_turk
21:22:26*argv_turk is now known as mutantturkey
21:22:56*mutantturkey is now known as Guest28609
21:22:56*Guest28609 is now known as argv_turk
21:26:48FromDiscord<willyboar> Maybe don't like Nim anymore because he prefer unconferenced languages
21:27:05FromDiscord<Clyybber> he's just busy probably :)
21:31:26shashlickis accessing a global directly faster or passing it in as a local var faster
21:35:35*mfx joined #nim
21:37:35*mfx quit (Client Quit)
21:41:11*argv_turk quit (Changing host)
21:41:11*argv_turk joined #nim
21:41:11*argv_turk is now known as mutantturkey
21:49:34*solitudesf- quit (Ping timeout: 260 seconds)
21:49:51*dddddd_ joined #nim
21:53:14*dddddd quit (Ping timeout: 240 seconds)
21:54:29FromDiscord<treeform> my gut feeling say it would be the same, but my gut feeling is mostly wrong, so probably not? Thats why I profile with vTune.
21:57:02*natrys quit (Quit: natrys)
21:58:28FromDiscord<Generic> it really depends
21:59:11FromDiscord<Generic> without position independent code loading or thread local storage loading a global variable is a load from an immediate position
22:00:08FromDiscord<Generic> but once you throw these into the mix accessing the global variable will be more expensive
22:00:25FromDiscord<Generic> if you pass in a local variable you're essentially passing a pointer
22:00:38FromDiscord<Generic> which needs to come from somewhere as well
22:01:07*thomasross joined #nim
22:01:08FromDiscord<Generic> so if you then just pass in a global variable, it's the exact same cost
22:02:09FromDiscord<Generic> or slightly more costly
22:07:06*tane_ quit (Quit: Leaving)
22:09:50*Jesin quit (Quit: Leaving)
22:19:17*D_ quit (Quit: No Ping reply in 180 seconds.)
22:20:11*D_ joined #nim
22:23:10*fredrikhr quit (Ping timeout: 260 seconds)
22:29:24shashlickok ran some tests, not too specific but didn't see any noticeable difference
22:34:21FromDiscord<Shucks> So I'm able to cast procs into pointers. But how would I cast them back?
22:35:49FromDiscord<Rika> you'll need to know what kinda proc they are, then you cast with `cast[proc (args): rettype](theptr)` and replace args and rettype as needed
22:38:01FromDiscord<Shucks> for example `proc foo = echo "Hello"`
22:38:09Yardanicoyes?
22:38:11FromDiscord<Shucks> no args and no return value. `proc` should be enough
22:39:01Yardaniconot exactly
22:40:10FromDiscord<Shucks> mh?
22:40:49Yardanicothe best way is
22:41:16Yardanicocast[typeof(myproc)](cast[pointer](myproc))
22:41:23Yardanicoto not specify type yourself
22:41:58Yardanicootherwise
22:42:04Yardanicoif you have "p" as a pointer to the normal proc
22:42:11Yardanicocast[proc () {.nimcall.}](p)() to run it
22:42:25Yardaniconimcall is needed because otherwise the compiler will assume you're trying to cast to a closure
22:42:43FromDiscord<Shucks> ❤️
22:42:45FromDiscord<Shucks> sent a code paste, see http://ix.io/2q5W
22:42:57FromDiscord<Shucks> Once again thank you lol
22:52:10Yardanicodon't forget that casting closures is much harder though
22:52:23Yardanicoand generally you rarely need to cast procs to pointers unless you do C ffi or for some reason need type erasure
22:52:34Yardanicoah wait wrong term
22:55:03*polypus74 quit (Ping timeout: 272 seconds)
22:55:38FromDiscord<Shucks> im messing around with some hooking on windows. Theres a nim wrapper for `https://github.com/Zeex/subhook`
22:55:43*polypus74 joined #nim
22:55:45Yardanicoah okay
22:55:52Yardanicobut be careful
22:59:30*dddddd_ is now known as dddddd
23:03:20FromDiscord<gokr> In wrapping ORX I have stumbled upon a bunch of struct types that have anonymous unions in them. Is there a strategy for how to deal with this in Nim?
23:04:16Yardanicodoesn't c2nim handle that?
23:04:25Yardanicoi think it does
23:04:46FromDiscord<gokr> Well, it gives them names like `ano_blabla_120` etc
23:04:56Yardanicowell yes but you can just rename
23:05:21FromDiscord<gokr> But... in C AFAIK an anonymous union in a struct makes the members of the union accessible in the struct.
23:06:36FromDiscord<lqdev> that's not really possible in Nim
23:06:44FromDiscord<lqdev> the whole object would have to be a union
23:06:51FromDiscord<gokr> So in C - one can then write `myStruct.oneOfTheUnionMembers`. But in c2nim code it turns into `myStruch.x.oneOfTheUnionMembers`.
23:07:16Yardanicowell yes
23:07:20YardanicoNim doesn't claim to be C
23:07:27FromDiscord<lqdev> and c2nim has no way of knowing whether the union is tagged or not so it can't make a case object
23:07:32Yardanicoyou can always make templates
23:07:34Yardanicoand macros
23:07:41Yardanicoto achieve same code as in C for this case if you want
23:07:55shashlick@gokr did you see the nimterop wrapper
23:08:08Yardanicoshashlick: how does it handle anonymous structs?
23:08:16FromDiscord<gokr> I haven't yet looked much at it, no.
23:08:19Yardanicoembeds them in the same type?
23:10:06shashlickNim doesn't support that
23:10:16shashlickI have to create names too
23:10:45shashlickhttps://gist.github.com/genotrance/7c7a6fcba38ab2d968ea27f2c9d709a4
23:16:26*bung_ joined #nim
23:18:49*thomasross quit (Ping timeout: 264 seconds)
23:19:52*bung quit (Ping timeout: 256 seconds)
23:26:26*nikita` quit (Remote host closed the connection)
23:31:34Yardanicohttps://gist.github.com/treeform/3e8c3be53b2999d709dadc2bc2b4e097
23:31:36Yardanicomore orc advertising
23:43:22*krux02_ joined #nim
23:44:49*zedeus_ joined #nim
23:44:52*zedeus quit (Quit: zedeus)
23:45:15*zedeus_ is now known as zedeus
23:46:02*krux02 quit (Ping timeout: 260 seconds)
23:55:49FromDiscord<treeform> hey thats mine!
23:56:08*krux02_ quit (Remote host closed the connection)
23:56:40Yardanicoyes exactly
23:56:47Yardanicoyou should make a guest blog post :P
23:57:29FromDiscord<ikrima> sent a long message, see http://ix.io/2q6b
23:57:38Yardanico??
23:57:47Yardanicocan you explain
23:57:49FromDiscord<ikrima> (playground sample: https://play.nim-lang.org/#ix=2q1d)
23:58:04leorizesee #14791
23:58:04disbothttps://github.com/nim-lang/Nim/pull/14791 -- 3typetraits: features and fixes
23:58:43leorizesince it's fully macro based you can just grab the code and change the names
23:59:06leorize(or not and just gate it behind a conditional for Nim < 1.3.5)