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