00:01:28 | FromDiscord | <Technisha Circuit> Thanks |
00:04:14 | FromDiscord | <k1tt3hk4t> Should I assume that using dealloc on a null pointer is safe, as it is in C? |
00:04:26 | Yardanico | no |
00:04:56 | FromDiscord | <k1tt3hk4t> gotcha' |
00:06:17 | Yardanico | you 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:23 | Yardanico | there are also other files probably |
00:06:37 | Yardanico | (by default Nim has it's own allocator which uses OSes memory allocation APIs directly) |
00:07:11 | Yardanico | ah wait wrong branch |
00:07:42 | Yardanico | https://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:13 | FromDiscord | <k1tt3hk4t> thanks for sourcing your answer |
00:09:54 | Yardanico | you might also like to read https://nim-lang.org/docs/intern.html and https://nim-lang.org/docs/destructors.html |
00:11:08 | Yardanico | although some stuff in intern doesn't really apply to arc and friends |
00:11:19 | Yardanico | e.g. --gc:arc doesn't really have RTTI |
00:13:18 | FromDiscord | <Shucks> https://paste.sh/en44Pq-B#bIRvQaEWy-Gr3u5Fu63DuxHA |
00:13:29 | Yardanico | ? |
00:13:50 | FromDiscord | <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:09 | Yardanico | can you show the code? |
00:14:21 | Yardanico | I mean to the example to compile :P |
00:14:41 | FromDiscord | <Clyybber> > I guess I should make yet another gource video for nim↵hell yeah :D |
00:16:20 | FromDiscord | <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:34 | Yardanico | can you try casting to cstring instead? |
00:17:00 | Yardanico | like https://play.nim-lang.org/#ix=2q13 |
00:20:13 | FromDiscord | <Shucks> Works perfectly fine. What exactly happens |
00:20:54 | * | marquisdefalbala quit (Quit: Konversation terminated!) |
00:20:59 | Yardanico | cstring is a string with a null terminator |
00:21:08 | Yardanico | I'm not sure if memory leaks or not though :D but it shouldn't I guess |
00:21:59 | FromDiscord | <Shucks> Great thank you 🙂 |
00:22:59 | FromDiscord | <Technisha Circuit> https://github.com/rnowley/nim-ncurses isn't working in Nim 1.2.0 :/ |
00:25:09 | FromDiscord | <Elegant Beef> What's the issue aside from the nimble file? |
00:28:03 | Yardanico | haha nico go brrr https://i.imgur.com/75cpyNU.png |
00:28:12 | Yardanico | used my old reddit r/place nim code to read pixels and set with nico |
00:28:14 | Yardanico | 1000x1000 canvas |
00:28:32 | Yardanico | maybe I can try adding the slider and then also zooming |
00:29:09 | * | endragor joined #nim |
00:31:39 | FromDiscord | <Elegant Beef> Nice |
00:31:54 | FromDiscord | <Elegant Beef> See zed 256 colours is plenty! |
00:31:58 | Yardanico | no 256 colors |
00:32:05 | Yardanico | r/place had it's own palette of 16 colors |
00:32:09 | Yardanico | I just made a GPL palette for nico |
00:32:12 | Yardanico | with same colors |
00:32:24 | Yardanico | yes there are only 16 colors in that picture really |
00:32:28 | FromDiscord | <Elegant Beef> i mean if that's 16 imagine 256 😄 |
00:32:28 | leorize | r/place was epic :P |
00:32:34 | Yardanico | it was |
00:32:47 | Yardanico | my old code is https://github.com/Yardanico/nim-snippets/blob/master/read_reddit_place.nim btw |
00:32:57 | leorize | the taskbar people was big though |
00:33:05 | Yardanico | need to reupload diffs.bin myself coz from downloading from web archive takes ages |
00:33:08 | * | marquisdefalbala joined #nim |
00:33:26 | Yardanico | diffs.bin is some unofficial file with all timestamps for r/place with info: x, y, color id, timestamp |
00:33:28 | Yardanico | all are 32-bit ints |
00:33:40 | * | endragor quit (Ping timeout: 246 seconds) |
00:33:56 | Yardanico | so the whole size is 183mb ( 11_968_422 * 16 / 1024 / 1024) |
00:40:03 | * | marquisdefalbala quit (Quit: Konversation terminated!) |
00:43:37 | FromDiscord | <Technisha Circuit> Where's the docs for Nimterop? :P |
00:56:55 | FromDiscord | <Synth> I need help using Nimterop ;-; |
00:57:05 | Yardanico | check projects using nimterop |
00:57:15 | Yardanico | https://github.com/nimterop/nimterop/wiki/Wrappers |
00:57:26 | Yardanico | and 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:59 | leorize | shashlick: ^ |
01:08:57 | FromDiscord | <ikrima> sent a code paste, see http://ix.io/2q18 |
01:09:01 | FromDiscord | <KingDarBoja> Wtf I just checke Technisha and I have common Xbox friends |
01:09:11 | FromDiscord | <KingDarBoja> Which is weird because I don't remember linking discord lol |
01:09:29 | Yardanico | @ikrima you mean the generic type? |
01:09:38 | Yardanico | so you want to get NodeBase ? |
01:09:44 | FromDiscord | <ikrima> @Yardanico yeah |
01:09:59 | FromDiscord | <ikrima> i want to get the `T` out of `seq[T]` |
01:10:01 | Yardanico | try https://nim-lang.org/docs/typetraits.html#genericParams.t%2Ctypedesc |
01:10:19 | leorize | @ikrima: in Nim lingo those are generics :P |
01:10:28 | Yardanico | ah I think it won't work with typeof |
01:10:44 | Yardanico | there was another way iirc |
01:12:02 | FromDiscord | <ikrima> @Yardanico I've tried `genericParams` but can't get that to work either (complains that its an invalid expression) |
01:12:09 | Yardanico | yeah I forgot about that |
01:13:00 | leorize | @ikrima can you create a small example on the playground? |
01:13:18 | Yardanico | leorize: https://play.nim-lang.org/#ix=2q19 |
01:13:31 | Yardanico | genericParams only works with literals |
01:14:46 | leorize | this should be fixed I guess |
01:15:33 | Yardanico | maybe there was another way, I don't remember now |
01:15:54 | * | endragor joined #nim |
01:19:57 | leorize | well I got a fix for this, gonna PR it real quick :P |
01:25:43 | * | NimBot joined #nim |
01:29:30 | shashlick | What's up |
01:29:38 | Yardanico | @Synth ^ |
01:29:47 | Yardanico | they asked for nimterop docs :) |
01:30:11 | shashlick | Nimterop can handle ncurses no problem |
01:30:35 | shashlick | It's linked off the readme which is large by itself |
01:40:04 | * | xicheng[m] joined #nim |
01:42:03 | FromDiscord | <ikrima> @leorize sure, here's a sample, annotated with failure points: |
01:42:05 | FromDiscord | <ikrima> https://play.nim-lang.org/#ix=2q1d |
01:43:16 | * | casaca joined #nim |
01:43:27 | FromDiscord | <Synth> I'm stll confused |
01:44:30 | FromDiscord | <ikrima> @Yardanico re: genericParams - that's good to know; btw, how did you figure out it only works with literals? |
01:44:33 | shashlick | How can I help |
01:44:39 | Yardanico | @ikrima because I tried? :) |
01:45:00 | shashlick | What would you like to wrap @Synth |
01:45:44 | FromDiscord | <ikrima> haha, fair enough! thought i was missing some language insight |
01:49:10 | FromDiscord | <Synth> I would like to wrap ncurses.h |
01:50:59 | shashlick | Which os |
01:51:15 | shashlick | Do you want to statically link or shared |
01:51:18 | * | chemist69_ joined #nim |
01:52:06 | shashlick | Do 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:24 | FromDiscord | <Synth> I want it to be cross platform if possible ;- |
01:52:25 | FromDiscord | <Synth> (edit) ';-' => ';-;' |
01:52:53 | shashlick | Anything is possible :) |
01:53:26 | * | pbb joined #nim |
01:53:47 | FromDiscord | <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:33 | shashlick | What os are you developing on |
01:58:54 | shashlick | looks like i have a ncurses wrapper lying around, will test and send you |
02:03:35 | FromDiscord | <Technisha Circuit> Okay, what's the best way to make a websocket server which broadcasts everything it recieves to all connected clients? |
02:03:46 | Yardanico | ????? |
02:03:49 | Yardanico | just use a websocket lib? |
02:04:19 | Yardanico | https://github.com/treeform/ws/blob/master/tests/chat.nim |
02:04:46 | FromDiscord | <Technisha Circuit> Thanks :p |
02:05:37 | FromDiscord | <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:15 | Prestige | Does 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:27 | Yardanico | I don't think there's a way to _format_ code automatically on server-side |
02:31:33 | Yardanico | there's a way to lint code though |
02:31:40 | Yardanico | but nimpretty still has bugs :) |
02:36:00 | Prestige | Hm |
02:36:22 | Yardanico | https://github.com/nim-lang/nim/issues?q=is%3Aissue+is%3Aopen+nimpretty |
02:36:26 | Prestige | I miss self-hosting everything |
02:45:32 | * | muffindrake quit (Ping timeout: 246 seconds) |
02:46:59 | FromDiscord | <KingDarBoja> I have never used nimpretty :( |
02:48:02 | * | muffindrake joined #nim |
02:50:13 | FromDiscord | <impbox> nim is pretty enough |
02:50:35 | Yardanico | unless you use a nimbraces -> nim transpiler and tabs instead of spaces :P |
02:50:48 | Yardanico | ah, and of course identifiers like f_O_o_B_a_R |
02:50:48 | * | endragor joined #nim |
02:50:58 | Yardanico | XD |
02:55:29 | FromGitter | <ynfle> Can I cast from StringTable to Table? |
02:55:35 | Yardanico | no |
02:55:41 | Yardanico | you'll need to convert :) |
02:55:48 | Yardanico | like 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:01 | FromDiscord | <Zed> Yardinco, again have you got something against nim with braces :P |
03:02:08 | Yardanico | yes |
03:02:09 | Yardanico | its not nim |
03:02:11 | FromDiscord | <Zed> it looks beautiful |
03:02:15 | FromDiscord | <Zed> functional |
03:02:27 | FromDiscord | <Zed> powerful |
03:02:38 | FromDiscord | <Zed> it's what nim was missing all along |
03:02:45 | Yardanico | no |
03:02:54 | FromDiscord | <Zed> you just cant escape the braces |
03:03:03 | FromDiscord | <Zed> embrace the change |
03:04:12 | FromGitter | <ynfle> Speaking of functional... Yardanico, `toSeq(strTable.pairs).toTable` |
03:04:22 | Yardanico | but that's probably not very efficient :P |
03:04:29 | FromGitter | <ynfle> Why? |
03:04:34 | Yardanico | because you're creating copies |
03:04:42 | Yardanico | i mean more copies |
03:04:53 | * | endragor joined #nim |
03:04:54 | Yardanico | you copy the entire string table into a sequence, then make a table out of it |
03:06:22 | Yardanico | but yeah it's okay |
03:09:44 | FromGitter | <ynfle> Thanks for the validation |
03:10:22 | FromGitter | <ynfle> It's just once for JSON |
03:27:23 | FromDiscord | <Technisha Circuit> > unless you use a nimbraces -> nim transpiler and tabs instead of spaces :P↵Nimbraces? |
03:28:59 | FromDiscord | <KingDarBoja> Nim with {} |
03:31:12 | FromDiscord | <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:12 | FromDiscord | <Technisha Circuit> Oh? |
03:31:47 | Yardanico | @k1tt3hk4t you need an object which wraps the pointer then |
03:31:47 | FromDiscord | <Technisha Circuit> So I could use braces instead of indents? |
03:31:48 | Yardanico | I think |
03:31:53 | FromDiscord | <k1tt3hk4t> hm ok |
03:32:08 | Yardanico | "ref" pointers are automatically managed |
03:32:16 | Yardanico | ptr/pointer are not managed at all |
03:32:28 | Yardanico | so yeah, just create an object which wraps your own pointer if you wish to wrap some pointer |
03:33:05 | FromDiscord | <k1tt3hk4t> gotcha |
03:38:43 | * | rockcavera joined #nim |
03:39:22 | Yardanico | oh yes I think I solved my telenim issue |
03:39:34 | Yardanico | idk why I didn't realise it when I encountered it |
03:39:43 | Yardanico | i forgot % for JsonNode works and it's a no-op anyway |
03:39:50 | Yardanico | although 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:47 | shashlick | @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:14 | FromDiscord | <Synth> Oh? Thank you |
04:06:37 | * | supakeen joined #nim |
04:06:51 | shashlick | please try and see if it works for you |
04:07:07 | shashlick | also, use nimterop@#conan since i've not merged some changes to master yet |
04:07:48 | shashlick | in fact, hold off for a minute, i need to push some changes |
04:15:00 | FromDiscord | <Technisha Circuit> sent a code paste, see https://discordapp.com/channels/371759389889003530/371759389889003532/725202289647812680 |
04:15:10 | FromDiscord | <Technisha Circuit> ~~Don't ask why since that doesn't matter~~ |
04:15:16 | Yardanico | why |
04:15:28 | Yardanico | why are you suddently switching to js backend again |
04:15:43 | FromDiscord | <Technisha Circuit> Because my friend TwT |
04:15:46 | Yardanico | what? |
04:15:52 | Yardanico | tell him to compile JS to native code instead |
04:16:04 | FromDiscord | <Technisha Circuit> What? |
04:16:16 | Yardanico | tell him to learn nim |
04:16:20 | FromDiscord | <Technisha Circuit> Okay |
04:16:37 | FromDiscord | <Technisha Circuit> :p |
04:17:07 | Yardanico | but generally there's nothing difficult in replicating that JS code |
04:17:14 | Yardanico | just define nim procs which will be imported from js |
04:18:05 | Yardanico | e.g. https://nim-lang.org/docs/jsffi.html#require%2Ccstring |
04:20:32 | shashlick | @Synth - okay pushed |
04:21:42 | Yardanico | @Technisha it's really easy to do, something like https://play.nim-lang.org/#ix=2q1D although I didn't test it |
04:21:46 | Yardanico | just skimmed through jsffi |
04:22:22 | Yardanico | seems to work actually |
04:23:17 | Yardanico | just tested locally |
04:23:40 | Yardanico | works just fine, used a nim websocket lib to connect as a client |
04:23:44 | Yardanico | to nodejs running this |
04:23:54 | Yardanico | but you have to remember - Nim's JS backend is NOT for NodeJS |
04:23:55 | Yardanico | it's for browsers |
04:27:13 | FromDiscord | <Technisha Circuit> Oh cool |
04:27:35 | FromDiscord | <Technisha Circuit> But doesn't any Nim generated JS work in NodeJS too? |
04:27:40 | * | marnix joined #nim |
04:27:46 | FromDiscord | <Technisha Circuit> And isn't there also a NodeJS flag? |
04:27:51 | Yardanico | it does, I tested in NodeJS, but you'll have to map a lot of nim stuff to NodeJS manually |
04:28:00 | Yardanico | yes, but as I said - NodeJS support is there just for the tests |
04:28:17 | Yardanico | you'll have to wrap even simplest stuff as stdin/stdout/file reading/writing, as those are not mapped to nodejs |
04:29:08 | FromDiscord | <Synth> Thank you shashlick! |
04:29:52 | FromDiscord | <Technisha Circuit> Oh okay |
04:31:54 | Yardanico | See some discussion in https://github.com/nim-lang/Nim/pull/14519 |
04:31:55 | disbot | ➥ os module nodejs support |
04:31:58 | Yardanico | it was also in other PRs |
04:34:09 | shashlick | @Synth - thank me after it works 😄 |
04:35:46 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
04:40:47 | FromDiscord | <Synth> I will thank you in advance |
04:40:57 | FromDiscord | <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:02 | shashlick | Ok 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:08 | Yardanico | I really wonder if there's a way to somehow enhance native debug info for default Nim backend without workarounds like nim-gdb |
05:19:32 | Yardanico | I'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:15 | Yardanico | well 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:06 | Yardanico | well 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:58 | skrylar[m] | hoi |
06:12:54 | Araq | Yardanico: what does "not so much better" mean? |
06:13:06 | Yardanico | well I didn't understand how would I get type info in the debugger and stuff |
06:13:14 | Yardanico | e.g. a sequence just displays as (void*) pointer in lldb |
06:14:03 | FromDiscord | <Elegant Beef> Anyone know the JSON module that lets you annotate the json object names for an object? |
06:14:14 | Yardanico | https://github.com/status-im/nim-json-serialization/tree/master/json_serialization |
06:14:16 | FromDiscord | <Elegant Beef> or is this a fever dream 😄 |
06:14:17 | Yardanico | or my json.to fork |
06:14:23 | * | chemist69_ quit (Ping timeout: 272 seconds) |
06:14:33 | Yardanico | although it's one way only |
06:14:43 | Yardanico | (from JSON to Nim) |
06:14:55 | Yardanico | https://github.com/Yardanico/telenim/blob/master/src/telenim/json_custom.nim |
06:15:05 | * | chemist69 joined #nim |
06:15:07 | Yardanico | just copy it in your project, import and then use jsonName pragma on your object fields :D |
06:15:21 | Yardanico | I maybe will try to make a PR when the macros pragma PR gets merged |
06:15:41 | Yardanico | https://github.com/nim-lang/Nim/pull/11526 I mean |
06:15:42 | disbot | ➥ getCustomPragma is split up in more usable chunks |
06:16:02 | FromDiscord | <Elegant Beef> yea i dont need it im just talking about ways we can annotate in nim similar to C# |
06:16:08 | Yardanico | pragmas |
06:16:15 | Yardanico | check https://github.com/Yardanico/telenim/blob/master/src/telenim/types.nim |
06:16:29 | Yardanico | (be careful, it's 14k loc) |
06:16:41 | FromDiscord | <Elegant Beef> Yea i know, just wanted a visible version |
06:16:51 | Yardanico | well in https://github.com/Yardanico/telenim/blob/master/src/telenim/json_custom.nim at the bottom there's a small test |
06:18:26 | Yardanico | https://play.nim-lang.org/#ix=2q1R |
06:20:02 | FromDiscord | <Elegant Beef> Thanks |
06:20:36 | FromDiscord | <Elegant Beef> Ooh the object variance usage is nice |
06:22:34 | FromDiscord | <Elegant Beef> And that reminded me i needed to updoot the RFC for object variances 😄 |
06:22:57 | Yardanico | you mean the shared fields one? which variant (pun not intended) of implementation you prefer? |
06:23:28 | FromDiscord | <Elegant Beef> The modification of case inside of object |
06:23:33 | Yardanico | ? |
06:23:52 | Yardanico | https://github.com/nim-lang/RFCs/issues/19#issuecomment-173529871 or https://github.com/nim-lang/RFCs/issues/19#issuecomment-633684323 |
06:23:52 | disbot | ➥ Allow usage of the same attribute name in different branches within variant types |
06:24:25 | Yardanico | I don't think the one in the issue body itself will be approved :) |
06:24:51 | FromDiscord | <Elegant Beef> the one 4raq suggested |
06:24:55 | Yardanico | yeah it's nice |
06:25:20 | FromDiscord | <Elegant Beef> Well write less code not more, especially when more just is redundant |
06:25:46 | FromDiscord | <Elegant Beef> i'd even wager just stop using the `word` case inside object and use `variant` |
06:25:58 | FromDiscord | <Elegant Beef> (edit) '`word` case' => 'word `case`' |
06:25:59 | FromDiscord | <Elegant Beef> Im tired |
06:26:00 | FromDiscord | <Elegant Beef> 😄 |
06:26:11 | Yardanico | lol |
06:26:50 | FromDiscord | <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:08 | Yardanico | well it means introducing yet another keyword :P |
06:28:17 | FromDiscord | <Elegant Beef> shhh |
06:28:31 | Yardanico | the last keyword change was 3 years ago https://github.com/nim-lang/Nim/commit/cae5e33a4a66406813769361233438c7d2df6009 |
06:28:40 | Yardanico | well, 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:16 | skrylar[m] | custom pragmas are nice yes |
06:56:36 | skrylar[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:27 | skrylar[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:33 | FromDiscord | <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:04 | Yardanico | see https://github.com/olliNiinivaara/GuildenStern/blob/master/src/guildenstern/dispatcher.nim#L248 |
07:05:09 | Yardanico | it runs weave in a background thread |
07:05:11 | Yardanico | not in the main one |
07:07:08 | FromDiscord | <Rika> doesnt that still require an init(Weave)? |
07:07:15 | Yardanico | why? |
07:07:19 | FromDiscord | <Rika> if not, why is exit(Weave) called? |
07:07:41 | Yardanico | you know you can just check the source of weave? |
07:07:51 | FromDiscord | <Rika> sounds scary |
07:08:59 | FromDiscord | <Rika> yeah i dont understand anything here |
07:09:37 | Yardanico | https://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:59 | FromDiscord | <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:08 | FromDiscord | <Rika> rather now i have new questions |
07:13:24 | * | chemist69 joined #nim |
07:16:47 | FromDiscord | <Elegant Beef> Now a follow up question to the pragmas, it seems you cant annotate enums values with pragmas? |
07:17:01 | Yardanico | not really |
07:18:13 | * | endragor quit (Ping timeout: 264 seconds) |
07:18:52 | * | endragor joined #nim |
07:18:58 | FromDiscord | <Elegant Beef> damn |
07:19:06 | Yardanico | btw 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:02 | FromDiscord | <Rustem B.> hello |
08:00:37 | FromDiscord | <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:41 | FromDiscord | <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:14 | FromDiscord | <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:58 | FromDiscord | <Elegant Beef> Seems fine |
08:02:46 | FromDiscord | <Rika> most popular -> ? |
08:03:05 | FromDiscord | <Rustem B.> > most popular -> ?↵@Rika Russian 😄 |
08:03:10 | FromDiscord | <Yardanico> For a start we might have Chinese, Spanish, Russian, maybe some European ones like German, French? |
08:03:39 | FromDiscord | <Elegant Beef> Spanish ... "Maybe some european ones" |
08:03:41 | FromDiscord | <Elegant Beef> Lol |
08:03:45 | skrylar[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:48 | FromDiscord | <Elegant Beef> Rest in America Spanish |
08:03:54 | FromDiscord | <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:11 | FromDiscord | <Yardanico> Well the thing is that there's a lot of languages :) |
08:04:34 | FromDiscord | <Yardanico> I think the max limit would be 10 |
08:04:48 | FromDiscord | <Yardanico> 10 language specific channels |
08:05:21 | FromDiscord | <Elegant Beef> I'll say do it |
08:05:56 | FromDiscord | <Elegant Beef> Only if you make the category named "Dirty Foreigners" 😛 |
08:06:37 | FromDiscord | <impbox> any reason to not just have non-english chat in the appropriate channel for topic rather than language based? |
08:07:01 | FromDiscord | <impbox> surely many people here are multilingual? |
08:07:17 | FromDiscord | <Elegant Beef> I know English and Cuntish |
08:07:19 | FromDiscord | <Yardanico> Yes, but most are English and their native language |
08:07:20 | skrylar[m] | noise |
08:07:21 | FromDiscord | <Rustem B.> > Only if you make the category named "Dirty Foreigners" 😛↵@Elegant Beef and "Oh, this Russians..." 😛 |
08:08:03 | skrylar[m] | if i just started babbling away in gaelic the room looks busy but it doesn't help most anone here |
08:08:13 | FromDiscord | <impbox> if someone asks a question here in language X, someone else who understands language X can respond. |
08:08:15 | skrylar[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:34 | FromDiscord | <Elegant Beef> Well an issue will arise that english people are going to make the questions fade away |
08:08:35 | FromDiscord | <impbox> sure not everyone will understand |
08:08:45 | FromDiscord | <Elegant Beef> They will obviously be less trafficked but could be more helpful |
08:08:55 | FromDiscord | <impbox> that's a fair point @Elegant Beef |
08:09:15 | skrylar[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:25 | FromDiscord | <impbox> even if english is not first language, people might still be able to help via translator assistance |
08:09:30 | FromDiscord | <Elegant Beef> We dont get many shitheads here |
08:09:38 | FromDiscord | <Yardanico> True that |
08:09:49 | FromDiscord | <Elegant Beef> Idk which part the true is |
08:10:03 | FromDiscord | <Yardanico> We only have two banned people here |
08:10:08 | FromDiscord | <impbox> we could all be shitheads here, but pretending we're not >_> |
08:10:15 | FromDiscord | <Elegant Beef> *coud* |
08:10:19 | FromDiscord | <Elegant Beef> *could** |
08:10:20 | FromDiscord | <Yardanico> That's how society works |
08:10:59 | FromDiscord | <Elegant Beef> Im clearly the prime example of a shit head |
08:11:03 | FromDiscord | <Elegant Beef> I just control myself 😛 |
08:12:08 | FromDiscord | <impbox> #rust-comparison-questions |
08:13:07 | FromDiscord | <Rika> #case-insensitivity-complaints-counter |
08:17:02 | FromDiscord | <Yardanico> #slower-than-python |
08:17:31 | FromDiscord | <Rustem B.> #pascal |
08:17:42 | FromDiscord | <Yardanico> lol |
08:19:19 | FromDiscord | <exelotl> #ampersand-hard-to-reach |
08:19:37 | FromDiscord | <Yardanico> #no-dollar-on-keyboard |
08:23:07 | FromDiscord | <Rustem B.> #russian-on-keyboard |
08:30:07 | FromDiscord | <Technisha Circuit> ? |
08:32:45 | narimiran | #ampersand-hard-to-reach --> my favourite nim moment! |
08:38:24 | PMunch | TBF, some of the characters Nim and other programming languages are pretty hard to reach on some keyboards |
08:39:50 | Tlanger | Maybe time for a new keyboard layout? |
08:40:11 | Tlanger | The next dvorak |
08:41:09 | FromDiscord | <Yardanico> So @narimiran what do you think about creating channels for other languages here in Discord? |
08:41:24 | narimiran | i don't have an opionion about it :) |
08:41:32 | FromDiscord | <Yardanico> Although I probably wouldn't map them to IRC since no one will use these IRC channels |
08:41:35 | FromDiscord | <Rika> i dont understand the hard to reach argument |
08:41:42 | PMunch | Tlanger, I actually did have numbers and symbols swapped on my keyboard before, but I couldn't quite get used to it.. |
08:42:02 | PMunch | Besides, some keys on Norwegian boards require AltGr to get to.. |
08:42:24 | PMunch | @Rika, what don't you understand about it |
08:42:36 | PMunch | Not all the symbols on your keyboard are as easy to reach as others |
08:42:38 | FromDiscord | <Rika> its misworded |
08:43:04 | FromDiscord | <Rika> its more of "the layers on my keyboard are different" then is it not |
08:43:16 | FromDiscord | <Rika> when i think of reach i think of physically reaching for a symbol |
08:43:33 | FromDiscord | <Rika> not requiring more modifiers to access the symbo |
08:43:35 | FromDiscord | <Rika> l |
08:44:08 | PMunch | Eh, hard to type then I guess |
08:45:06 | * | casaca quit (Remote host closed the connection) |
08:48:48 | FromDiscord | <KrispPurg> I think creating channels for other languages is good. |
08:50:54 | PMunch | Hmm, 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:08 | PMunch | ref: https://github.com/github/linguist/pull/4866 |
08:51:09 | disbot | ➥ Change Nim's colour to better match the logo |
08:53:17 | FromDiscord | <KrispPurg> Why isn't the new Nim colour on GitHub yet? |
08:53:56 | PMunch | Read the last couple comments on the PR |
08:54:30 | PMunch | Basically another language named Daphne got a colour that crashes with the new Nim one before the Nim PR was accepted |
08:54:36 | PMunch | So it got rolled back |
08:54:55 | Zevv | Hey that's the color of my bikeshed |
08:55:04 | PMunch | Zevv, hahaha :P |
08:55:12 | FromDiscord | <Yardanico> Yeah, I then found a couple of a bit similar good colors |
08:55:24 | FromDiscord | <Yardanico> But then some people started saying they don't want the change |
08:55:37 | FromDiscord | <Yardanico> So I kinda thought it's not needed |
08:55:45 | FromDiscord | <KrispPurg> Oh ;-; |
08:56:06 | FromDiscord | <Recruit_main707> it could be nice, but i dont think they would really be used |
08:56:29 | FromDiscord | <Yardanico> See https://forum.nim-lang.org/t/6350 |
08:58:38 | narimiran | #keepNimGreen |
08:59:28 | PMunch | Why should it be green though? |
09:00:47 | FromDiscord | <Yardanico> Because a GitHub employee in 2012 decided that it should be green |
09:00:56 | FromDiscord | <Yardanico> And people are "used to the current color" |
09:02:00 | PMunch | I know why it is green, but why do people want to keep it green? |
09:02:02 | FromDiscord | <Recruit_main707> its not the best, (but it could be worse) |
09:02:22 | FromDiscord | <Recruit_main707> i do think it should be changed to something more fitting |
09:02:47 | FromDiscord | <Recruit_main707> a nice deep dark blue for example |
09:03:00 | FromDiscord | <Rika> ~~new color too close to js~~ |
09:04:29 | FromDiscord | <Vindaar> the fact that nim is green will guarantee nim will become the dominant language in our sustainable "everything is green" future! |
09:04:35 | FromDiscord | <Rika> lmao |
09:05:44 | PMunch | Here is for all you Green Nim fans: https://uploads.peterme.net/greennim.png |
09:05:58 | FromDiscord | <Recruit_main707> ewww |
09:06:15 | FromDiscord | <Recruit_main707> nim already gets roasted without an ugly logo :P |
09:06:40 | FromDiscord | <Rika> ugly? |
09:06:43 | FromDiscord | <Rika> oh misread |
09:06:45 | FromDiscord | <Yardanico> There was blue Nim |
09:07:12 | FromDiscord | <Recruit_main707> this is the color i think it should have in github https://media.discordapp.net/attachments/371759389889003532/725275826681020426/unknown.png |
09:07:34 | FromDiscord | <Recruit_main707> something like that |
09:07:53 | PMunch | @Recruit_main707, royal blue? |
09:08:07 | PMunch | @Yardanico, yeah I'm trying to remember where I found those :P |
09:08:20 | FromDiscord | <Yardanico> https://raw.githubusercontent.com/nim-lang/assets/68c7559921fc98d47d96f0bd1d446e27d53bd8c4/Unused/Web%20Concept/web%20design.svg |
09:08:42 | FromDiscord | <Yardanico> https://raw.githubusercontent.com/nim-lang/assets/68c7559921fc98d47d96f0bd1d446e27d53bd8c4/Unused/Web%20Concept/design.svg |
09:09:10 | FromDiscord | <Recruit_main707> it looks nice, but that blue is to go-ish |
09:09:16 | FromDiscord | <Recruit_main707> too* |
09:10:02 | FromDiscord | <KrispPurg> PMunch, that logo is cursed. |
09:11:07 | FromDiscord | <KrispPurg> Interesting concept |
09:11:59 | PMunch | There's also these: https://raw.githubusercontent.com/nim-lang/assets/68c7559921fc98d47d96f0bd1d446e27d53bd8c4/Unused/Web%20Concept/new-logos.png |
09:12:48 | FromDiscord | <KrispPurg> Huh. |
09:15:00 | PMunch | Hmm, 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:46 | PMunch | Like 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:53 | FromDiscord | <Yardanico> Well there's Nake |
09:18:03 | FromDiscord | <Yardanico> But it compiles a native binary which then does the stuff |
09:18:14 | * | casaca joined #nim |
09:18:34 | PMunch | Yeah, another build tool isn't really solving anything :P |
09:19:08 | PMunch | This is what adding an app looks like now: https://github.com/eried/portapack-mayhem/commit/e43f8148610a40df0d01864d7fa825759fa75c4c |
09:20:11 | * | krux02 joined #nim |
09:21:12 | PMunch | As 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:07 | PMunch | Basically 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:27 | pietroppeter | @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:14 | FromDiscord | <Yardanico> Oh nice |
09:29:19 | FromDiscord | <Yardanico> I had a similar idea too |
09:29:20 | * | lpirl joined #nim |
09:34:26 | PMunch | pietroppeter, it does produce a small difference for me between those colours |
09:36:06 | PMunch | Although the ones from the "color-proximity ruby gem README" fails |
09:36:36 | pietroppeter | ah 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:54 | lpirl | Dear 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:20 | pietroppeter | I did it a couple of weeks ago and I already forgot what was working and what not... |
09:37:47 | pietroppeter | I may have to check again |
09:38:55 | * | fredrikhr joined #nim |
09:46:44 | * | oddp joined #nim |
10:06:28 | FromDiscord | <Clyybber> @Yardanico: Regarding #14788 can you merge the test into tests/misc/tcast.nim ? |
10:06:28 | disbot | https://github.com/nim-lang/Nim/pull/14788 -- 3Reject casts to builtin typeclasses |
10:07:10 | FromDiscord | <Yardanico> @Clyybber okay |
10:09:00 | * | lritter joined #nim |
10:09:56 | Yardanico | @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:10 | Yardanico | https://github.com/nim-lang/Nim/pull/14788/commits/c0546bc82e688911081deb432e99e55f914f2705 |
10:13:12 | disbot | ➥ Reject 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:36 | PMunch | lpirl, 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:53 | lpirl | PMunch, 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:52 | PMunch | Double check first though that addTimer does in fact drift, I would think it had protection against that |
10:38:58 | FromDiscord | <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:23 | PMunch | pietroppeter, have you tried to see if the ruby version complies with the test vectors from the paper? |
10:45:50 | pietroppeter | well 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:55 | pietroppeter | so all is good actually! |
10:46:12 | PMunch | Aah, so it's a bug in their documentation? :P |
10:48:36 | pietroppeter | yep |
10:49:06 | PMunch | Maybe create an issue? |
10:49:15 | pietroppeter | I will create a PR |
10:49:26 | PMunch | Even better :) |
10:49:37 | FromDiscord | <Clyybber> @Yardanico Yeah, its perfect |
10:51:47 | lpirl | PMunch cheers, will do. |
10:52:00 | * | lpirl quit (Quit: Connection closed) |
10:58:28 | * | marnix joined #nim |
11:00:00 | PMunch | Hmm, 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:07 | FromDiscord | <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:58 | Zevv | I'm having this discussion with a colluage about sharing memory between threads without holding a mutex/lock on the reader side |
13:19:16 | Zevv | where do I find authoritive documentation to throw at him |
13:20:42 | FromDiscord | <mratsim> Perdersen algorithm |
13:20:49 | FromDiscord | <mratsim> Lamport's Bakery algorithm |
13:20:55 | FromDiscord | <mratsim> Dekker's algorithm |
13:21:05 | FromDiscord | <mratsim> Use TLA+ to prove soundness |
13:21:07 | Zevv | nah, something simple and short that says "just don't do that" |
13:21:17 | FromDiscord | <mratsim> ah |
13:21:25 | Zevv | he's too high level schooled |
13:21:28 | FromDiscord | <mratsim> googling for "torn reads" might help |
13:21:44 | Zevv | thanks |
13:21:46 | FromDiscord | <mratsim> and also my talk |
13:21:50 | Zevv | haha :) |
13:22:00 | Zevv | It's a C++ discussion, but sure |
13:22:16 | * | thomasross quit (Ping timeout: 246 seconds) |
13:22:50 | FromDiscord | <mratsim> well the initial example I used was from C++ |
13:23:30 | Zevv | lemme check |
13:23:36 | FromDiscord | <mratsim> sent a code paste, see http://ix.io/2q3i |
13:23:53 | Zevv | yeah sure, but you're not authoritive are you :) |
13:24:03 | FromDiscord | <mratsim> you can have (1,0), (0, 1), (1, 1) |
13:24:10 | Zevv | to _me_ you are, though |
13:24:39 | FromDiscord | <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:59 | Zevv | sure |
13:25:11 | FromDiscord | <mratsim> if you don't tell that you have sharing, by the use of critical sections or atomics, anything can happen |
13:27:15 | FromDiscord | <mratsim> In terms of authoritative, maybe there is a summary of Herb Sutter talk, weapons of Atomic<> destruction |
13:28:11 | Zevv | yeah, 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:25 | Zevv | Don't share. Keeps your locks localized. |
13:41:27 | * | Senny quit (Ping timeout: 260 seconds) |
13:41:42 | FromDiscord | <mratsim> I learned a lot and I hade a slide "Share nothing" :p |
13:41:48 | FromDiscord | <mratsim> (edit) 'hade' => 'had' |
13:42:35 | FromDiscord | <mratsim> And yes, everything that deals with synchronization should be tucked into a as simple module as possible |
13:43:36 | FromDiscord | <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:25 | haxscramper | Under 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:57 | alehander92_ | you can use expandMacros |
13:56:04 | alehander92_ | to see what does it generate maybe |
13:56:22 | FromDiscord | <mratsim> everytime there is a semcheck error for whatever reason, macros with untyped parameter throws an undeclared identifier error unfortunately |
13:57:00 | FromDiscord | <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:20 | FromDiscord | <mratsim> and replace the macro call with the expanded Nim code that is output |
14:13:12 | Zevv | well, 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:03 | alehander92_ | you didnt fight with books did ya |
14:25:05 | Zevv | Well, 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:08 | Zevv | But here we are |
14:25:36 | Zevv | And I was always refusing to use threads, and they found me a bit of a whiner. |
14:25:43 | Zevv | so I must admit, this feels good :) |
14:27:21 | FromDiscord | <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:11 | FromDiscord | <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:57 | FromDiscord | <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:17 | FromDiscord | <Zachary Carter> so there are a few virtual methods that need overrides but I also need to implement a constructor |
14:41:48 | Zevv | mratsim: where was this list of weave-vs-the-rest-of-the-world performance? |
14:52:15 | FromDiscord | <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:40 | FromDiscord | <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:29 | Zevv | !seen treeform |
14:58:30 | disbot | treeform spoke in 12#nim 22 hours ago 12https://irclogs.nim-lang.org/23-06-2020.html#16:13:39 |
14:58:52 | alehander92_ | !seen disruptek |
14:58:52 | disbot | disruptek spoke in 12disbot 12 hours ago |
15:01:06 | FromDiscord | <willyboar> !last disruptek |
15:01:07 | disbot | disruptek spoke in 12disbot 12 hours ago |
15:04:16 | alehander92_ | !read !last |
15:04:29 | alehander92_ | 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:52 | FromDiscord | <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:45 | FromDiscord | <Zachary Carter> How would I `importcpp` this constructor? ```constexpr Arguments(int& argc, char** argv) noexcept: argc{argc}, argv{argv} {}``` |
16:33:54 | euantor | Araq: 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:55 | disbot | ➥ Patch #14716 - add missing `when` |
16:39:05 | FromDiscord | <Recruit_main707> how do i set a project to use arc from .nimble? |
16:43:04 | FromDiscord | <Recruit_main707> you cant right?↵then will it use the .nims files? |
16:49:17 | * | D_ quit (Ping timeout: 260 seconds) |
16:54:24 | FromDiscord | <BRxMayor> Hi all.. where can i read docs of previous releases? |
16:56:37 | leorize | @Zachary just import it as described in the manual |
16:57:31 | leorize | @BRxMayor: https://nim-lang.org/<version>/overview.html |
16:57:49 | FromDiscord | <Yardanico> @Recruit_main707 guy can use nims or Nim config |
16:57:57 | FromDiscord | <Yardanico> You* |
16:58:05 | FromDiscord | <Recruit_main707> ok |
16:58:08 | leorize | If you want 1.0.0 for example: https://nim-lang.org/1.0.0/overview.html |
17:02:59 | * | D_ joined #nim |
17:09:06 | FromDiscord | <BRxMayor> @leorize[IRC]#0000 thanks a lot |
17:10:03 | * | bung joined #nim |
17:12:43 | FromDiscord | <juan_carlos> Python will get Pattern Matching on std lib after 3.10+ 🤔 |
17:13:19 | bung | anyone has experience using https://github.com/treeform/typography ? am wondering how to extract sub glyphs then combine to new font |
17:19:37 | Zevv | treeform: 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:45 | FromDiscord | <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:58 | FromDiscord | <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:11 | FromDiscord | <Zachary Carter> not sure why |
17:37:56 | * | mujina joined #nim |
17:38:19 | leorize[m] | maybe look at the generated code? |
17:43:49 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
17:46:56 | FromDiscord | <Rika> https://github.com/apense/shimsham this is a nice library, sadly the dude just suddenly disappeared from github |
17:55:56 | Yardanico | why |
17:55:57 | Yardanico | this |
17:55:57 | Yardanico | again |
17:55:58 | Yardanico | https://forum.nim-lang.org/t/6482 |
18:00:14 | Araq | probably I got the growth factor wrong for seqs_v2 |
18:00:54 | Araq | Yardanico: please have a look |
18:01:06 | Araq | so ... scope based memory management works for "Hello world" |
18:01:13 | Araq | good enough for a day |
18:01:32 | Araq | and the code isn't a clusterfuck of special cases |
18:02:17 | Yardanico | why me? :P test stuff with it? |
18:02:50 | FromDiscord | <treeform> Zevv, thansk! |
18:07:35 | * | dddddd quit (Ping timeout: 260 seconds) |
18:23:46 | planetis[m] | only thing different is ``max(resize(oldCap), len+1)`` |
18:29:09 | FromDiscord | <Shucks> How would I check if a object variable got constructed? |
18:29:24 | FromDiscord | <Shucks> e.g.: https://paste.sh/ZkPLA49s#7xMLPeX4GXUhEnFZEJ4bZyUp |
18:29:49 | FromDiscord | <Shucks> I mean I could check if x is 0 but guess thats not the cool way ;p |
18:29:58 | leorize | that's actually how it's done lol |
18:30:08 | leorize | in Nim we don't have the idea of a "constructed" object :P |
18:30:16 | FromDiscord | <Shucks> oh, alright |
18:30:56 | * | mujina quit (Ping timeout: 256 seconds) |
18:31:04 | leorize | if 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:19 | leorize | usually the default 0-init state works well enough :P |
18:32:00 | FromDiscord | <Shucks> oh good to know that pragma, thanks 🙂 |
18:32:58 | * | fredrikhr quit (Read error: Connection reset by peer) |
18:33:49 | FromGitter | <timotheecour> @araq can I merge https://github.com/nim-lang/Nim/pull/14777 ? I’ve reviewed it thoroughly |
18:33:50 | disbot | ➥ Cleanup |
18:34:12 | Araq | No, I don't like it |
18:34:38 | FromGitter | <timotheecour> why not? |
18:36:28 | Araq | replied with my remarks |
18:37:50 | * | vikfret joined #nim |
18:40:58 | * | fredrikhr joined #nim |
18:43:30 | FromDiscord | <lqdev> leorize: when was that pragma introduced? |
18:45:17 | leorize[m] | 1.2 is when an implementation that work reasonably well shipped |
18:45:25 | leorize[m] | exactly when it was introduced, I don't know |
18:45:47 | FromDiscord | <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:10 | FromDiscord | <treeform> bung, you can extract parts of glyphs though. That is not a problem. |
18:46:18 | leorize | isn't svg font a tiny bit worse because you can't do hinting on them? |
19:01:34 | FromDiscord | <treeform> I don't think ppl care about hinting with high dpi screens. |
19:02:07 | FromDiscord | <treeform> They support kerning which is all I need. |
19:02:09 | FromDiscord | <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:37 | leorize | @treeform there are still plenty of low dpi screens out there |
19:02:43 | leorize | most people are still on 1080p for example |
19:03:02 | leorize | and some poor lad like me are on 786p... |
19:03:52 | FromDiscord | <Generic> me too 😦 |
19:04:24 | FromDiscord | <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:08 | FromDiscord | <lqdev> that's why I didn't adopt treeform's typography lib into my engine :( |
19:12:36 | FromDiscord | <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:57 | haxscramper | How 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:25 | Yardanico | fieldPairs doesn't work with case objects |
19:24:34 | Yardanico | you'll have to use a macro |
19:26:25 | Zevv | treeform: how do I get the figma plugin without having to do typescript locally? |
19:26:40 | Zevv | it'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:08 | Yardanico | 11 |
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:20 | FromDiscord | <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:17 | FromDiscord | <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:50 | FromDiscord | <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:19 | Yardanico | 1666 issues now, nice |
20:50:14 | zedeus | nice |
20:50:26 | FromDiscord | <lqdev> nice |
20:55:51 | FromDiscord | <Rika> cursed |
20:58:30 | FromDiscord | <KrispPurg> Oh boy. https://media.discordapp.net/attachments/371759389889003532/725454828633063544/Screenshot_20200624-215809_Discord.jpg |
21:01:29 | FromDiscord | <willyboar> You are used to it after a while |
21:02:15 | * | Vladar quit (Quit: Leaving) |
21:04:41 | * | dddddd joined #nim |
21:08:39 | FromDiscord | <willyboar> disbot: where is disruptek? |
21:09:05 | FromDiscord | <willyboar> disbot: are you here? |
21:09:16 | leorize | !seen disruptek |
21:09:17 | disbot | disruptek spoke in 12disbot 18 hours ago |
21:11:44 | FromDiscord | <willyboar> I have days to see him. Before conf |
21:14:16 | leorize | hhe last spoke in PM with disbot it appears |
21:14:18 | leorize | he* |
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:48 | FromDiscord | <willyboar> Maybe don't like Nim anymore because he prefer unconferenced languages |
21:27:05 | FromDiscord | <Clyybber> he's just busy probably :) |
21:31:26 | shashlick | is 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:29 | FromDiscord | <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:28 | FromDiscord | <Generic> it really depends |
21:59:11 | FromDiscord | <Generic> without position independent code loading or thread local storage loading a global variable is a load from an immediate position |
22:00:08 | FromDiscord | <Generic> but once you throw these into the mix accessing the global variable will be more expensive |
22:00:25 | FromDiscord | <Generic> if you pass in a local variable you're essentially passing a pointer |
22:00:38 | FromDiscord | <Generic> which needs to come from somewhere as well |
22:01:07 | * | thomasross joined #nim |
22:01:08 | FromDiscord | <Generic> so if you then just pass in a global variable, it's the exact same cost |
22:02:09 | FromDiscord | <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:24 | shashlick | ok ran some tests, not too specific but didn't see any noticeable difference |
22:34:21 | FromDiscord | <Shucks> So I'm able to cast procs into pointers. But how would I cast them back? |
22:35:49 | FromDiscord | <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:01 | FromDiscord | <Shucks> for example `proc foo = echo "Hello"` |
22:38:09 | Yardanico | yes? |
22:38:11 | FromDiscord | <Shucks> no args and no return value. `proc` should be enough |
22:39:01 | Yardanico | not exactly |
22:40:10 | FromDiscord | <Shucks> mh? |
22:40:49 | Yardanico | the best way is |
22:41:16 | Yardanico | cast[typeof(myproc)](cast[pointer](myproc)) |
22:41:23 | Yardanico | to not specify type yourself |
22:41:58 | Yardanico | otherwise |
22:42:04 | Yardanico | if you have "p" as a pointer to the normal proc |
22:42:11 | Yardanico | cast[proc () {.nimcall.}](p)() to run it |
22:42:25 | Yardanico | nimcall is needed because otherwise the compiler will assume you're trying to cast to a closure |
22:42:43 | FromDiscord | <Shucks> ❤️ |
22:42:45 | FromDiscord | <Shucks> sent a code paste, see http://ix.io/2q5W |
22:42:57 | FromDiscord | <Shucks> Once again thank you lol |
22:52:10 | Yardanico | don't forget that casting closures is much harder though |
22:52:23 | Yardanico | and generally you rarely need to cast procs to pointers unless you do C ffi or for some reason need type erasure |
22:52:34 | Yardanico | ah wait wrong term |
22:55:03 | * | polypus74 quit (Ping timeout: 272 seconds) |
22:55:38 | FromDiscord | <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:45 | Yardanico | ah okay |
22:55:52 | Yardanico | but be careful |
22:59:30 | * | dddddd_ is now known as dddddd |
23:03:20 | FromDiscord | <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:16 | Yardanico | doesn't c2nim handle that? |
23:04:25 | Yardanico | i think it does |
23:04:46 | FromDiscord | <gokr> Well, it gives them names like `ano_blabla_120` etc |
23:04:56 | Yardanico | well yes but you can just rename |
23:05:21 | FromDiscord | <gokr> But... in C AFAIK an anonymous union in a struct makes the members of the union accessible in the struct. |
23:06:36 | FromDiscord | <lqdev> that's not really possible in Nim |
23:06:44 | FromDiscord | <lqdev> the whole object would have to be a union |
23:06:51 | FromDiscord | <gokr> So in C - one can then write `myStruct.oneOfTheUnionMembers`. But in c2nim code it turns into `myStruch.x.oneOfTheUnionMembers`. |
23:07:16 | Yardanico | well yes |
23:07:20 | Yardanico | Nim doesn't claim to be C |
23:07:27 | FromDiscord | <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:32 | Yardanico | you can always make templates |
23:07:34 | Yardanico | and macros |
23:07:41 | Yardanico | to achieve same code as in C for this case if you want |
23:07:55 | shashlick | @gokr did you see the nimterop wrapper |
23:08:08 | Yardanico | shashlick: how does it handle anonymous structs? |
23:08:16 | FromDiscord | <gokr> I haven't yet looked much at it, no. |
23:08:19 | Yardanico | embeds them in the same type? |
23:10:06 | shashlick | Nim doesn't support that |
23:10:16 | shashlick | I have to create names too |
23:10:45 | shashlick | https://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:34 | Yardanico | https://gist.github.com/treeform/3e8c3be53b2999d709dadc2bc2b4e097 |
23:31:36 | Yardanico | more 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:49 | FromDiscord | <treeform> hey thats mine! |
23:56:08 | * | krux02_ quit (Remote host closed the connection) |
23:56:40 | Yardanico | yes exactly |
23:56:47 | Yardanico | you should make a guest blog post :P |
23:57:29 | FromDiscord | <ikrima> sent a long message, see http://ix.io/2q6b |
23:57:38 | Yardanico | ?? |
23:57:47 | Yardanico | can you explain |
23:57:49 | FromDiscord | <ikrima> (playground sample: https://play.nim-lang.org/#ix=2q1d) |
23:58:04 | leorize | see #14791 |
23:58:04 | disbot | https://github.com/nim-lang/Nim/pull/14791 -- 3typetraits: features and fixes |
23:58:43 | leorize | since it's fully macro based you can just grab the code and change the names |
23:59:06 | leorize | (or not and just gate it behind a conditional for Nim < 1.3.5) |