00:00:39 | Yardanico | https://docs.microsoft.com/en-us/windows/win32/fileio/file-management-functions ? |
00:00:39 | leorize | a fair bit of them do |
00:08:43 | Yardanico | yass, the joy when you find a C compiler error when compiling a terminal tetris in nim with arc |
00:15:26 | Yardanico | wait what |
00:15:53 | Yardanico | LOL |
00:15:57 | Yardanico | the * makes a difference |
00:16:03 | Yardanico | const normalMinos = @[1, 2]; var minos = normalMinos works just fine |
00:16:12 | Yardanico | const normalMinos* = @[1, 2]; var minos = normalMinos results in a C compiler error for ARC |
00:16:18 | Yardanico | magic |
00:17:31 | Yardanico | ah it's because nim eliminates both normalMinos and minos if normalMinos is not exported |
00:17:36 | Yardanico | in the frontend |
00:17:58 | Yardanico | well it doesn't, sorry, I'm just a bit fast to come to conclusions |
00:20:12 | Yardanico | https://github.com/nim-lang/Nim/issues/15036 |
00:20:14 | disbot | ➥ [ARC] C compiler error when creating a var of a const seq ; snippet at 12https://play.nim-lang.org/#ix=20D9 |
00:25:47 | * | oddp quit (Ping timeout: 240 seconds) |
00:39:04 | * | maier joined #nim |
00:43:47 | * | maier quit (Ping timeout: 240 seconds) |
00:55:23 | * | fredrikhr quit (Ping timeout: 240 seconds) |
00:59:30 | ForumUpdaterBot | New thread by Oyster: Wierd "SIGSEGV: Illegal storage access" information, see https://forum.nim-lang.org/t/6568 |
01:07:03 | * | karmayogi joined #nim |
01:07:17 | * | karmayogi quit (Remote host closed the connection) |
01:11:51 | * | endragor joined #nim |
01:24:13 | * | apahl quit (Ping timeout: 272 seconds) |
01:25:43 | * | apahl joined #nim |
01:27:09 | * | OmegaDoug joined #nim |
01:27:19 | mbuchel | !repo judy |
01:27:21 | disbot | https://github.com/Walkud/JudyKotlinMvp -- 9JudyKotlinMvp: 11Kotlin + Mvp + RxJava + Retrofit 心得体会 15 63⭐ 9🍴 7& 29 more... |
01:27:32 | Yardanico | lol |
01:27:40 | mbuchel | i am looking for judy arrays in nim |
01:27:44 | mbuchel | does one exist |
01:28:03 | Yardanico | https://github.com/search?q=language%3Anim+judy+array&type=Code |
01:28:11 | Yardanico | seems only like a test in the test suite |
01:28:24 | Yardanico | https://github.com/nim-lang/Nim/blob/devel/tests/concepts/tmapconcept.nim and not sure if it's complete |
01:29:09 | Yardanico | ah it seems it's not really a judy array, just some testing for same stuff |
01:31:02 | mbuchel | shameful |
01:31:06 | Yardanico | lol |
01:31:29 | mbuchel | i was shitposting about judy arrays and was wondering if one existed in nim-lang |
01:32:23 | Yardanico | "Judy arrays are extremely complicated. The smallest implementations are thousands of lines of code." lol |
01:32:39 | mbuchel | yes they are absolutely necessary for an embedded project |
01:33:07 | * | hyiltiz joined #nim |
01:33:54 | Yardanico | seems like it's also patented but should be expiring relatively soon |
01:34:09 | FromDiscord | <Elegant Beef> > In addition, Judy arrays are optimized for machines with 64 byte cache lines |
01:34:21 | FromDiscord | <Elegant Beef> Does embedded have 64 byte cache lines? |
01:34:32 | Yardanico | https://patents.google.com/patent/US6735595B2/en for the patent btw |
01:35:05 | Yardanico | oh "2022-01-24 Adjusted expiration" |
01:35:07 | Yardanico | not so soon :D |
01:35:14 | Yardanico | 1.5 more years |
01:36:19 | Yardanico | FINALLY once in my life i managed to reproduce a crash without minimizing the original source, but instead using the same rough "idea" how the code behaved to reproduce it |
01:36:45 | FromDiscord | <Elegant Beef> Nice |
01:38:23 | Yardanico | just tried to run @impbox 's nimsynth with arc :D |
01:38:29 | Yardanico | on devel |
01:38:50 | FromDiscord | <impbox> did it work? |
01:38:54 | FromDiscord | <impbox> i'd be surprised |
01:38:56 | Yardanico | with refc - yes, kinda |
01:39:01 | Yardanico | I had to fix some deprecations and stuff |
01:39:08 | Yardanico | although for me right click drag doesn't work :D |
01:39:17 | Yardanico | but thanks to nimsynth I think I found another bug in arc :) |
01:39:21 | Yardanico | related to closures |
01:40:15 | Yardanico | this one https://play.nim-lang.org/#ix=20Nk |
01:41:40 | Yardanico | it seems to destroy mCreator when it goes out of scope |
01:41:44 | Yardanico | which is of course not valid |
01:41:51 | Yardanico | since it was captured by the add |
01:43:07 | FromDiscord | <impbox> aye |
01:46:00 | Yardanico | maybe not the right title, but https://github.com/nim-lang/Nim/issues/15038 |
01:46:01 | disbot | ➥ [ARC] Closure captured in a seq gets destroyed in the end of the scope ; snippet at 12https://play.nim-lang.org/#ix=20Nl |
01:46:12 | Yardanico | ah btw @impbox |
01:46:20 | Yardanico | I replaced marshal with json and nimsynth still compiled :D |
01:46:25 | Yardanico | json.to and json.% |
01:46:28 | FromDiscord | <impbox> nice |
01:47:37 | Yardanico | @impbox whole diff for compiling it on devel with refc - https://gist.github.com/Yardanico/d95d07151a2f3dbfd6c92f6907707318 |
01:47:47 | Yardanico | also you'll probably need -d:nimWorkaround14447 |
01:48:12 | FromDiscord | <impbox> thanks |
01:48:25 | Yardanico | yeah just tested, it at least compiles with this |
01:48:54 | Yardanico | how do I connect nodes though? :D |
01:49:36 | FromDiscord | <impbox> for me right click drag works |
01:50:30 | FromDiscord | <impbox> that said it's not building for me atm |
01:50:32 | Yardanico | ah seems like my mouse coords aren't translated the right way for some reason |
01:50:36 | Yardanico | what error? |
01:51:09 | Yardanico | I used "nim c -p:src -d:nimWorkaround14447 -o:synth src/main.nim" |
01:51:35 | Yardanico | oh seems like some tests fail |
01:51:38 | Yardanico | on startup |
01:52:07 | FromDiscord | <impbox> ahh the button thing you fixed |
01:52:20 | FromDiscord | <impbox> i'll apply your patch |
01:52:20 | Yardanico | yeah, also random -> rand |
01:52:23 | Yardanico | yeah sure |
01:52:41 | Yardanico | not sure if the marshal -> json replacement actually worked though :D |
01:52:45 | Yardanico | but if it compiled, it probably should |
01:53:19 | FromDiscord | <reilly> sent a code paste, see https://play.nim-lang.org/#ix=20Nn |
01:53:35 | Yardanico | on line 4? can you show full stacktrace? |
01:53:49 | Yardanico | and what happens if you add "import segfaults" after importing winim and run it? |
01:54:10 | FromDiscord | <impbox> \o/ compiling after your patch. and works right click dragging to join nodes |
01:54:46 | Yardanico | yeah it seems a problem with tiling WM or sway or xwayland :P |
01:55:05 | FromDiscord | <impbox> right click works to open menu yeah? |
01:55:08 | Yardanico | yes |
01:55:16 | Yardanico | lemme try with Xephyr |
01:55:29 | FromDiscord | <reilly> sent a code paste, see https://play.nim-lang.org/#ix=20OQ |
01:56:01 | Yardanico | but PCRAWINPUTDEVICE is a pointer |
01:56:04 | Yardanico | you need to allocate it first |
01:56:12 | Yardanico | and instead you're assinging to a nil pointer :) |
01:56:21 | Yardanico | well, on dot access nim automatically dereferences the pointer |
01:56:43 | FromDiscord | <reilly> I was about to say that, actually. I have absolutely zero idea how pointers are used. |
01:56:45 | Yardanico | I don't really know winapi, but you need to somehow allocate that, either with winapi or with nim's own allocation procedures |
01:57:06 | Yardanico | are you sure you don't need to call stuff like GetRawInputDeviceInfoA ? |
01:57:14 | Yardanico | but anyway, you can try this: |
01:57:56 | Yardanico | replace RID line with "var RID = alloc(sizeof(RAWINPUTDEVICE))" |
01:58:14 | FromDiscord | <reilly> This: https://gist.github.com/luluco250/ac79d72a734295f167851ffdb36d77ee is about the only decent reference I have for how to do raw input, and it doesn't use `GetRawInputDeviceInfoA()` anywhere. |
01:58:41 | Yardanico | well, but it's allocating |
01:58:57 | Yardanico | ah sorry about the code I sent |
01:59:01 | Yardanico | it should actually be |
01:59:17 | Yardanico | var RID = cast[PCRAWINPUTDEVICE](alloc(sizeof(RAWINPUTDEVICE)) |
01:59:39 | Yardanico | you're casting a pointer you just allocated to the PCRAWINPUTDEVICE type, I'm not sure if this is 100% neccessary, but just in case |
02:00:00 | Yardanico | but wait actually I think you need a different approach |
02:00:01 | Yardanico | ah right |
02:00:08 | Yardanico | you did it differently from C++ :P |
02:02:33 | * | NimBot joined #nim |
02:02:37 | Yardanico | https://github.com/nim-lang/RFCs/issues/230 |
02:02:38 | disbot | ➥ Nim's NRVO is C++'s inplace construction (placement new) ; snippet at 12https://play.nim-lang.org/#ix=2oor |
02:02:44 | Yardanico | @reilly try https://play.nim-lang.org/#ix=20Pt |
02:03:32 | Yardanico | ah actually it should be an array |
02:04:18 | Yardanico | if that doesn't work also try https://play.nim-lang.org/#ix=211C |
02:04:38 | FromDiscord | <reilly> Now it's just throwing `Error: unhandled exception: Unable to register raw input. [OSError]`, which I can't decide whether to take as an improvement or not. |
02:04:44 | FromDiscord | <reilly> w/ https://play.nim-lang.org/#ix=20Pt |
02:04:50 | FromDiscord | <tomck> Yardanico: so... is it signalling that it couldn't apply a RVO here? |
02:05:16 | Yardanico | well kinda, I'm not 100% sure, and it'll probably changed :) |
02:05:16 | FromDiscord | <tomck> Don't understand the issue |
02:05:21 | Yardanico | it shouldn't be a warning without the proper explanation, yeah |
02:05:25 | Yardanico | you can comment in that issue |
02:06:18 | Yardanico | @tomck basically the thing is |
02:06:31 | Yardanico | that before the patch Nim would still populate the fields in the result variable even if there was an exception |
02:06:46 | FromDiscord | <reilly> Same exception for https://play.nim-lang.org/#ix=211C, and to be honest, I was hoping it'd never get thrown because I have absolutely zero idea where to even begin fixing that one. |
02:06:59 | Yardanico | but after that patch it's conforming to the spec and the result variable doesn't get populated in the case of a exception |
02:07:13 | FromDiscord | <tomck> right i see, ta |
02:08:14 | Yardanico | @reilly i'll try a bit |
02:08:30 | Yardanico | but maybe you should set the window too? |
02:09:12 | Yardanico | also I found quite a lot of examples of RegisterRawInputDevices in c++, hm |
02:09:49 | FromDiscord | <tomck> I have a tree structure, and want to create a way to walk the tree, what's the best way to structure this in nim? (in C++ i'd use either an iterator, or a function which accepted a lambda) |
02:10:01 | Yardanico | you can make an iterator for nim |
02:10:16 | Yardanico | nim iterators are quite fast since they're inlined (not the closure iterators though) |
02:10:30 | FromDiscord | <tomck> would that be the idiomatic solution here? (rather than some template magic? i've seen mapIt in sequtils uses a template) |
02:10:45 | OmegaDoug | Is nimble able to pass command line arguments to the nim compiler? I'm interested in trying out the new arc gc. |
02:10:49 | Yardanico | just a normal iterator, yeah |
02:11:09 | FromDiscord | <tomck> There are non-normal iterators? |
02:11:13 | Yardanico | closure iterators :P |
02:11:25 | FromDiscord | <tomck> oh i fund the manual page, ta |
02:11:28 | FromDiscord | <tomck> (edit) 'fund' => 'found' |
02:13:50 | FromDiscord | <reilly> Yardanico: No idea what I would set for the window handle, but since 'If NULL it follows the keyboard focus,' I would assume that it would be fine, at least for now. |
02:13:51 | mbuchel | <Elegant Beef>: yes embedded devices can have 64 byte cache lines in the higher end appliances (Nvidia Jetsons) |
02:14:12 | Yardanico | I wouldn't exactly call that "embedded" lol |
02:14:35 | Yardanico | for me embedded is more like esp32, etc |
02:14:37 | Yardanico | @reilly lemme try getting the exact error |
02:15:05 | Yardanico | you could also use it in the future to get the exact error code :) |
02:15:07 | * | muffindrake quit (Ping timeout: 260 seconds) |
02:15:23 | Yardanico | I got the error code 87 |
02:15:25 | FromDiscord | <tomck> so the manual doesn't really explain it, what's the difference between a closure / inline iterator? Does a closure iterator have some internal state? |
02:15:25 | Yardanico | ERROR_INVALID_PARAMETER |
02:15:39 | FromDiscord | <Elegant Beef> That isnt embedded that's a singleboard computer |
02:15:39 | Yardanico | @tomck closure iterator is like a closure proc, but an iterator :P |
02:15:51 | Yardanico | inline iterator is a bit like a template, but not really |
02:16:00 | Yardanico | basically inline iterator gets inlined instead of the loop |
02:16:07 | Yardanico | so it's really fast and zero-cost really |
02:16:32 | FromDiscord | <tomck> Why would you ever use a closure iterator if it's slower |
02:16:41 | Yardanico | because sometimes you need to capture state |
02:16:48 | Yardanico | nim's async is entirely based on closure iterators btw :) |
02:17:03 | Yardanico | and macros transforming normal nim procedures (with async pragma) into closure iterators |
02:17:25 | * | muffindrake joined #nim |
02:19:05 | FromDiscord | <tomck> So i have a tree, defined by a `Node` object that contains `ref`s to child `Node`s - If I define an iterator which took my root `ref Node`, that could be an inline iterator just fine? I'm struggling to understand what 'capture state' entails |
02:19:16 | Yardanico | yeah sure of course |
02:19:24 | Yardanico | just a normal iterator will work fine |
02:19:33 | FromDiscord | <tomck> Ohhh, or is it that a closure iterator can be passed around and flexibly iterated, and an inline iterator *must* be used completely in a loop |
02:19:41 | Yardanico | yes |
02:19:42 | Yardanico | :P |
02:19:49 | Yardanico | inline iterators are not first-class really |
02:19:58 | Yardanico | they always expand in loops |
02:20:07 | Yardanico | e.g. lemme show you an example |
02:20:11 | Yardanico | simple iteration over a seq right? |
02:20:24 | Yardanico | let a = @[1, 2, 3, 4, 5]; for x in a: echo x |
02:20:26 | Yardanico | simple stuff really |
02:20:29 | Yardanico | it gets transformed to: |
02:21:09 | Yardanico | (that's without release/danger and with arc) - https://gist.github.com/Yardanico/954dbd6bc1f14f0890c42db6c4e0a457 |
02:21:31 | Yardanico | with danger, so it's easier to follow - https://gist.github.com/Yardanico/ad9c3c92d35f11cab9c106d1c3c35e01 |
02:21:49 | FromDiscord | <Doof Doof> does anyone know why this was removed and how to get the same functionality? https://github.com/nim-lang/Nim/issues/905↵--header option doesn't seem to output header files anymore and it's still in the documentation here: https://nim-lang.org/docs/backends.html#backend-code-calling-nim-nim-invocation-example-from-c |
02:21:51 | disbot | ➥ Add emit header pragma |
02:21:58 | Yardanico | so it actually gets transformed to a while loop |
02:22:18 | Yardanico | which gets elements by index and "assigns" them to the variable you have in for loop which is "x" in this case |
02:22:51 | FromDiscord | <tomck> I see |
02:23:27 | Yardanico | @Doof it still works for me though |
02:23:38 | FromDiscord | <tomck> In this case, it's a weird decision to have an iterator defined as inline/closure at the definition - rather than just defining an iterator, then instantiating it as either a closure/inline as it's created |
02:23:51 | FromDiscord | <Doof Doof> I tried out the example with the exact contents and command and nothing popped out :/ |
02:24:07 | Yardanico | you need to set nimcache folder |
02:24:13 | Yardanico | otherwise the header will end up in the default nimcache folder |
02:24:17 | Yardanico | e.g. --nimcache:mydir |
02:24:22 | Yardanico | and then your header will be in that directory |
02:24:32 | * | OmegaDoug quit (Remote host closed the connection) |
02:24:53 | FromDiscord | <tomck> so are there any restrictions on how I *write* an inline iter vs a closure iter? or is it purely how it's used? |
02:25:14 | Yardanico | @tomck I don't think you should really care about closure iterators at this point :) normal iterators will work just fine for your case |
02:25:16 | FromDiscord | <Doof Doof> @Yardanico I'm dumb - thanks! |
02:25:31 | Yardanico | closure iterator is all about capturing the state and returning/storing it |
02:25:34 | Yardanico | like storing a closure proc |
02:25:47 | Yardanico | you can't store or capture some data outside of the normal iterator |
02:26:36 | Yardanico | also for closure iterators you can get the next value of it |
02:26:41 | Yardanico | a bit like with python iterators |
02:27:02 | FromDiscord | <tomck> hmmm, in my mind an 'iterator' is an object with a 'next' method, that's a closure iterator right? |
02:27:05 | FromDiscord | <tomck> An inline iterator is a template |
02:27:15 | Yardanico | well, almost like a template, yes, with special rules |
02:27:23 | FromDiscord | <tomck> *but* it seems like inline iterators can store local state during their iteration? |
02:27:30 | Yardanico | it's not "local" really |
02:27:33 | Yardanico | as I said it gets inlined |
02:27:39 | FromDiscord | <tomck> yes |
02:27:39 | Yardanico | and capturing and storing data is not the same |
02:27:46 | Yardanico | lemme show you an example |
02:29:42 | Yardanico | and sorry, closure iterators don't have a "next" proc really |
02:30:16 | FromDiscord | <tomck> hmm they don't? Well that's confused me even more |
02:30:31 | FromDiscord | <tomck> so they can't be passed around and arbitrarily iterated at different parts of the code? |
02:30:37 | Yardanico | argh |
02:30:56 | Yardanico | @tomck you can't do that with an inline iterator at all - https://paste.debian.net/plain/1157370 |
02:31:28 | Yardanico | since here you see 1) capturing external variable "data" 2) first-class closure iterator (storing it in a variable) 3) calling it until it's finished |
02:31:37 | Yardanico | with an inline iterator it just replaced the for loop |
02:32:47 | Yardanico | actually that should be https://play.nim-lang.org/#ix=212E, sorry |
02:32:51 | Yardanico | also see https://nim-by-example.github.io/for_iterators/ :) |
02:33:13 | Yardanico | it seems pretty simple for me |
02:33:46 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
02:34:59 | FromDiscord | <tomck> I don't understand why an iterator is defined to be inline/closure at its implementation |
02:35:07 | Yardanico | because they're very different |
02:35:17 | FromDiscord | <tomck> but it seems like the restrictions on ly apply to their usage |
02:35:32 | Yardanico | you can't just pass around an inline iterator |
02:35:36 | FromDiscord | <tomck> it seems like any closure iterator could be inlined if it was instantiated & immediately used in a for loop |
02:35:45 | Yardanico | but that's not that easy to detect :P |
02:35:50 | FromDiscord | <tomck> whereas it seems any inline iterator could be trivially converted to a closure iterator |
02:35:54 | Yardanico | and closure iterators are opt-in, not opt-out |
02:36:14 | FromDiscord | <tomck> if i wanted to create both an inline and closure iterator, would the code used to define that iterator be any different |
02:36:46 | Yardanico | depending on the context you might not be able to create an inline iterator at all |
02:37:08 | Yardanico | it's the same question as to why we use normal procs vs closure procs |
02:37:19 | FromDiscord | <tomck> ohhhhhhhhhhhhh i get it now |
02:37:26 | disruptek | it's an optimization. |
02:37:57 | Yardanico | disruptek: so seems like you have major progress with cps? :) |
02:38:04 | Yardanico | time for nim async with your cps lib? :P |
02:38:38 | disruptek | it's starting to work, but there is a lot to be done yet. |
02:38:56 | Yardanico | also do you use a patched compiler or something? |
02:39:05 | disruptek | nah. |
02:39:34 | disruptek | the demo in the README doesn't work, for example. |
02:39:37 | Yardanico | yes |
02:39:44 | disruptek | also, it's a terrible demo. |
02:39:46 | Yardanico | I thought it'd work :P |
02:39:49 | Yardanico | why no, it's a good demo |
02:39:53 | Yardanico | showing that it's actually working |
02:39:58 | * | maier joined #nim |
02:40:02 | disruptek | it's not obvious what it's supposed to do or why. |
02:40:09 | disruptek | the test.nim works. |
02:40:11 | Yardanico | same as with current nim async? :P |
02:40:28 | Yardanico | for me it's pretty obvious what it will do on high-level |
02:40:33 | disruptek | i'm gonna write a web-server as a proof-of-concept. |
02:40:37 | Yardanico | nice |
02:42:47 | disruptek | it's fun to see it kinda work, though. it's going to be a really big deal for nim, i hope. |
02:43:13 | Yardanico | as I understand it'll work with normal (non-closure) procs right? |
02:43:23 | disruptek | yeah. |
02:43:32 | Yardanico | procs (at low level) will just take pointers of higher-up procs as arguments |
02:43:49 | Yardanico | I understand cps at a basic level |
02:44:11 | disruptek | it's easier to read the output than it is to read a paper. |
02:44:45 | * | maier quit (Ping timeout: 240 seconds) |
02:44:54 | Yardanico | i already starred your repo :P |
02:45:12 | disruptek | yeah, i had to recreate it because travis is dumb. |
02:45:19 | disruptek | and yet it's still broken. |
02:45:25 | Yardanico | use github actions then :P |
02:45:40 | Yardanico | but wait it's not dumb I think |
02:45:47 | disruptek | i'm waiting for someone to do it for me once and then i'll just copy their work to all my repos. |
02:45:55 | * | krux02_ quit (Remote host closed the connection) |
02:45:57 | Yardanico | it fails because "C:\Users\travis\build\disruptek\cps\cps\eventqueue.nim(121, 16) Error: undeclared identifier: 'registerTimer'" |
02:46:21 | disruptek | probably on windows or something. |
02:46:44 | Yardanico | yes |
02:46:46 | disruptek | i cannot link it to my travis user because i pushed it before doing so. travis bug. |
02:46:51 | Yardanico | selectors module isn't fully available on nim |
02:46:59 | Yardanico | in nim* |
02:47:05 | Yardanico | "Partially supported OS: Windows (only sockets and user events)," |
02:47:08 | Yardanico | no timers |
02:47:26 | disruptek | well, we'll impl those differently on windows. |
02:48:05 | Yardanico | this is how asyncdispatch does it for windows - https://github.com/nim-lang/Nim/blob/devel/lib/pure/asyncdispatch.nim#L982 |
02:48:27 | disruptek | i'll do conditional variables tomorrow, i guess. |
02:48:39 | disruptek | i don't really care how windows works. i have my hands full with linux. |
02:48:46 | Yardanico | XD |
02:48:50 | Yardanico | you're gonna upset 4raq |
02:49:03 | disruptek | i don't care. |
02:49:17 | disruptek | i don't ask him to run my os, either. |
02:50:05 | disruptek | when i get the web-server working on cps, i'll add yourang and then we should have the fastest web-server by a mile. |
02:50:11 | disruptek | on linux, at least. |
02:51:06 | FromDiscord | <tomck> I can't seem to import queues - https://nim-lang.org/0.19.0/queues.html |
02:51:15 | FromDiscord | <tomck> ```↵Error: cannot open file: queues↵``` |
02:51:18 | FromDiscord | <tomck> was this removed? |
02:51:22 | disruptek | seems so. |
02:51:26 | Yardanico | https://nim-lang.org/docs/deques.html |
02:51:31 | disruptek | see deques. |
02:51:34 | Yardanico | or https://nim-lang.org/docs/heapqueue.html if you need that instead |
02:51:41 | Yardanico | also be aware - seqs can act as queues too |
02:51:52 | Yardanico | they have "pop" at least |
02:52:01 | disruptek | our deques are missing a rotate() which is annoying. |
02:52:31 | FromDiscord | <tomck> which of these is just a ring-buffer queue implemented with seq? i'd assumed that was what `queues` was |
02:52:40 | disruptek | deques |
02:53:12 | Yardanico | @tomck you can see the definition of a Deque in https://nim-lang.org/docs/deques.html#Deque :) |
02:54:20 | FromDiscord | <tomck> bril, ta |
02:56:35 | disruptek | where are you from with that accent? |
02:56:38 | disruptek | UK? |
02:56:48 | FromDiscord | <tomck> yeah englang |
02:56:52 | FromDiscord | <tomck> england* |
02:56:54 | FromDiscord | <tomck> wbu? |
02:57:01 | disruptek | states |
02:57:10 | FromDiscord | <tomck> seems everyone is |
02:57:49 | Yardanico | nah |
02:57:54 | disruptek | nah, only 20% or less from the states in nim. |
02:57:55 | Yardanico | most people here are from europe :) |
02:58:18 | FromDiscord | <tomck> Is `==` on `seq[T]` a deep-equality, or does it just compare whether the instnaces are the same? (also, are there any docs for these procedures? I can't find where any `seq` procs or other builtin procs are defined) |
02:58:35 | FromDiscord | <tomck> oh interesting, i always feel like 99% of the internet are americans |
02:58:35 | Yardanico | in the system module |
02:58:41 | Yardanico | and yes, it's a bit hard to find them there :) |
02:59:01 | Yardanico | @tomck it's deep equality of cousre |
02:59:03 | Yardanico | course* |
02:59:06 | Yardanico | since nim seqs are value types |
02:59:11 | Yardanico | (well, they have value semantics) |
02:59:15 | Yardanico | they're not value types since they're on heap |
02:59:17 | Yardanico | https://nim-lang.org/docs/system.html#%3D%3D%2Cseq%5BT%5D%2Cseq%5BT%5D |
03:00:18 | disruptek | americans are just 99% of the noise. |
03:00:20 | Yardanico | but they have value semantics, so if you do "var a = @[1, 2, 3]; var b = a; b.add(5)" a will not be modified |
03:00:26 | Yardanico | same for strings |
03:01:15 | FromDiscord | <tomck> cool, makes sense |
03:01:26 | FromDiscord | <tomck> can i pass an inline iter to a function? |
03:01:29 | Yardanico | no |
03:01:34 | Yardanico | it's not a first-class value as I said :) |
03:01:41 | FromDiscord | <tomck> ahhh but i can to a template |
03:01:43 | Yardanico | the only way to somewhat abstract it is with templates |
03:01:45 | Yardanico | yes, like toSeq |
03:02:02 | Yardanico | toSeq can "collect" all values of an inline iterator |
03:02:05 | * | lritter quit (Ping timeout: 240 seconds) |
03:02:10 | Yardanico | it just expands to a template which calls that inline iterator |
03:02:27 | Yardanico | well it's actually more complex since it works for more types |
03:02:48 | FromDiscord | <tomck> Oh lol toSeq is what i want, ta |
03:03:08 | * | lritter joined #nim |
03:21:28 | FromDiscord | <tomck> Is there a way to 'macroexpand' a file rather than compiling, so i can see how ugly my inline iterator turned out? |
03:23:09 | FromDiscord | <Yardanico> You shouldn't generally do that |
03:23:15 | FromGitter | <ynfle> either with the https://nim-lang.org/docs/macros.html#expandMacros.m%2Ctyped or CLI argument `--expandMacro:` https://nim-lang.org/docs/nimc.html |
03:23:22 | FromDiscord | <Yardanico> I used expandArc which is only on devel and only for arc |
03:23:36 | FromDiscord | <Yardanico> @ynfle that won't work for expanding iterators |
03:24:37 | FromDiscord | <tomck> so there's no way to expand iterators? |
03:24:49 | FromDiscord | <tomck> How did you get that expanded iterator example that you linked me @Yardanico |
03:24:55 | FromDiscord | <Rika> how inefficient are closure iterators over inline ones? |
03:25:09 | FromDiscord | <Yardanico> @tomck I used expandArc on devel with arc |
03:25:28 | FromDiscord | <Yardanico> Which shows Nim after all passes and optimizing just before it goes into the backend |
03:26:03 | FromDiscord | <tomck> i see, if i got it from the main site i probably don't have this flag? |
03:26:05 | FromGitter | <ynfle> Wouldn't it expand the template? |
03:26:47 | FromDiscord | <tomck> my iterator has 14 distinct `yield`s, is this a bad sign |
03:26:52 | FromDiscord | <Yardanico> @ynfle of course |
03:27:22 | FromDiscord | <Yardanico> But not inline iterators |
03:27:28 | FromDiscord | <Yardanico> I mean expandMacros |
03:27:29 | FromGitter | <ynfle> I thought tomck wanted to expand his template with an iterator inside |
03:28:34 | FromDiscord | <tomck> hmmm, i have a variant object where each variant is an object with some fields - my iterator is designed to iterate over these fields, by switching on the variant kind and calling `yield` on each field of the variant in each arm of the `case` statement. This obviously produces a huge amount of `yield` statements - any good way around this? |
03:44:57 | * | hyiltiz quit (Ping timeout: 260 seconds) |
04:00:23 | * | hyiltiz joined #nim |
04:00:23 | * | hyiltiz quit (Changing host) |
04:00:23 | * | hyiltiz joined #nim |
04:03:35 | FromDiscord | <Elegant Beef> Can you show the iterator? |
04:06:02 | * | supakeen quit (Quit: WeeChat 2.8) |
04:06:40 | * | supakeen joined #nim |
04:17:35 | Zevv | ping @varriount |
04:23:06 | * | vicfred quit (Quit: Leaving) |
04:27:57 | FromDiscord | <Varriount> I looked at the implementation of toSeq. It's bonkers |
04:28:03 | Yardanico | not really |
04:28:08 | Yardanico | the inline iterator case is very simple |
04:28:17 | FromDiscord | <Varriount> Zevv: pong |
04:40:48 | * | maier joined #nim |
04:45:47 | * | maier quit (Ping timeout: 240 seconds) |
04:46:02 | Zevv | oi! |
04:46:08 | Zevv | about the resuming |
04:46:41 | Zevv | a lot of it is in place, there needs to be some additional state to keep track of offsets in the current block and offsets in the total subject, for example |
04:47:04 | Zevv | but the biggest problem is that "old" data that might be needed to complete a capture might be gone |
04:47:30 | Zevv | I have this nice picture behind my eyes of how this could be done, but I was never able to put it in properly |
04:48:03 | Zevv | I guess it needs to keep a copy around of all chunks passed in that are still referenced by one or more open captures |
04:48:45 | Zevv | alternative would be to actually store each character in the current open captures as the data comes in, but I think that'll be quite a performance hit |
04:52:04 | * | Zevv quit (Quit: Lost terminal) |
04:52:17 | * | Zevv joined #nim |
04:52:29 | Zevv | well that was my irssii hanging, first time in decades |
04:53:09 | Zevv | anyway, its about not having old parts of the subject around when you close a capture |
04:54:09 | Zevv | so practically that will mean something like npeg making a copy of each chunk as you stream it in, and keep that copy aroun until the last capture that (potentially) references it closes out |
04:54:43 | Zevv | if we just had immutable strings and slices! :) |
05:00:30 | Zevv | i also do have another problem - there's some comments on github from a guy who clearly really understands all this and he things the capturing should be done totally different. Problem is that I really don't understand what he means |
05:02:01 | Zevv | and I'm kind of too intimidated by his remarks to ask |
05:02:15 | Zevv | because that would admit I have no clue what Im doing |
05:04:33 | Zevv | he says that I'm trying to hammer a circle in a square, or something like that |
05:05:03 | Yardanico | haha, guess what |
05:05:17 | Yardanico | even in brainfuck for bench.b in https://github.com/kostya/benchmarks latest arc is faster |
05:06:18 | Yardanico | I guess it's time to make a forum thread with all benchmark results arc vs refc on latest devel for this |
05:06:28 | Yardanico | ~1.261s vs ~1.425s for bf.nim for bench.b btw |
05:06:28 | disbot | no footnotes for `1.261s`. 🙁 |
05:07:18 | Yardanico | hmm actually wait, maybe refc takes longer to initialize or read? |
05:07:42 | Yardanico | so the kostya benchmarks does benchmarks as in: starting the program, only then reporting over the sockets that it start, then doing the benchmarks and notifying that it ended that |
05:07:52 | Yardanico | so if I only take that time refc vs arc are mostly tied |
05:08:00 | Yardanico | but if we take full time for binary to execute, arc is 0.2s faster |
05:08:08 | Yardanico | (that was without this socket functionality) |
05:08:16 | Yardanico | 10 runs for both |
05:08:22 | * | apahl quit (Ping timeout: 260 seconds) |
05:08:57 | * | apahl joined #nim |
05:12:05 | * | hyiltiz quit (Quit: hyiltiz) |
05:15:02 | * | hyiltiz joined #nim |
05:15:07 | * | lritter quit (Quit: Leaving) |
05:28:17 | ForumUpdaterBot | New thread by TheSpydog: Questions about object construction, see https://forum.nim-lang.org/t/6570 |
05:33:12 | * | drewr quit (Ping timeout: 260 seconds) |
05:36:53 | Zevv | Why can I create an object with a constructor like `This(that: value)`, but why is there no constructor for *ref* objects? |
05:37:00 | Yardanico | there is? |
05:37:06 | Yardanico | it's the same syntax |
05:37:23 | Yardanico | object construction automatically allocates an object if it's a ref object |
05:37:53 | Zevv | yes but no but yes but |
05:38:05 | Yardanico | ??? |
05:38:11 | Zevv | (zevv is typing...) |
05:38:21 | Yardanico | ¿que |
05:38:26 | * | cornfeedhobo quit (Ping timeout: 260 seconds) |
05:38:34 | * | _ofelas quit (Quit: shutdown -h now) |
05:38:56 | * | ofelas joined #nim |
05:39:09 | Zevv | http://ix.io/219D |
05:39:17 | Yardanico | oh, in this case |
05:39:20 | Zevv | you can do that if the *type* is a ref object |
05:39:27 | Yardanico | yes\\\ |
05:39:41 | Zevv | yes what?! :) |
05:39:46 | Yardanico | yes no yes but yes |
05:40:03 | Yardanico | i mean yeah, i don't know how to use object construction here |
05:40:08 | Yardanico | make a ThingRef type dammit :P |
05:40:19 | Zevv | Yes but no but |
05:40:24 | Zevv | I want my constructor! |
05:40:33 | Zevv | So it's not me then :) |
05:40:56 | Zevv | I propose `var t = new Thing(val: 42)` |
05:41:08 | Yardanico | if it's possible to implement - i'm for it |
05:41:17 | Yardanico | ashtually |
05:41:42 | Yardanico | Zevv: https://play.nim-lang.org/#ix=21cJ |
05:41:50 | Yardanico | I mean you probably already figured it out yourself :P |
05:42:06 | Zevv | warempel |
05:42:22 | FromDiscord | <Rika> cant you do (ref Obj)(constructor stuff)? |
05:42:37 | Yardanico | no what |
05:42:40 | FromDiscord | <Rika> or does that make no sense |
05:42:41 | FromDiscord | <Rika> i dunno |
05:42:43 | Zevv | Why don't we put that new of yours in the stdlib |
05:42:44 | Zevv | right away |
05:42:45 | Yardanico | what did you smoke sir :thinking: |
05:42:46 | Yardanico | Zevv: lmao |
05:42:56 | Yardanico | need to make it a magic! |
05:42:57 | Yardanico | to optimize |
05:42:58 | FromDiscord | <Rika> yardanico: massive argument happened in another server |
05:43:03 | FromDiscord | <Rika> i'm very tired |
05:43:13 | FromDiscord | <Rika> despite having been awake for 4 hours or so |
05:43:29 | Yardanico | its okay |
05:43:40 | Yardanico | go watch some anime or vtubers hooman |
05:43:43 | Zevv | have a coffee, sit outside for a while, breath in |
05:44:19 | Zevv | Yardanico: is this issue-worthy you think? |
05:44:23 | Yardanico | yeah |
05:44:28 | Yardanico | it's a nice little sugar addition |
05:44:30 | Yardanico | not gonna hurt |
05:44:47 | Yardanico | but I think it might need a compiler implementation to be more efficient, idk lol |
05:44:55 | Yardanico | I mean as a compiler magic |
05:45:06 | Zevv | I don't dare making issues about these things anymore. I always get obliterated with people bikeshedding the issue away and telling me not to whine about stupid small things |
05:45:10 | Yardanico | C code for gc arc with danger for my new - https://play.nim-lang.org/#ix=21cK |
05:45:15 | Yardanico | Zevv: wat |
05:45:34 | FromDiscord | <Rika> kinda wish we didnt need the initXXX thing anymore |
05:45:43 | FromDiscord | <Rika> feels like a hack |
05:45:46 | Yardanico | ?? |
05:45:52 | Zevv | C code is not that bad even. It *is* a copy, of course |
05:45:52 | FromDiscord | <Rika> its one of the things in nim i dont really like |
05:45:56 | Zevv | it needs to come from somewhere |
05:46:09 | FromDiscord | <Rika> how initXXX and newXXX is the "idiomatic thing to do in nim" |
05:46:28 | Yardanico | well, I mean default values for type fields would be nice, yes |
05:46:32 | Yardanico | but why is this not idiomatic? |
05:46:35 | Yardanico | it's pretty easily understood |
05:46:40 | Zevv | When I moved to Nim I noticed all these funny quirks like that, and was bothered by it |
05:46:54 | Zevv | then just forgot about it and thought "Well, that's probably how it goes with newish languages" |
05:47:02 | Zevv | then I did some go the other day. and it's just the same |
05:47:13 | Zevv | newThis |
05:47:33 | Yardanico | Zevv: actually current arc isn't that bad - today's arc https://play.nim-lang.org/#ix=21dq |
05:47:48 | Yardanico | https://play.nim-lang.org/#ix=21eg one month old arc |
05:47:51 | * | maier joined #nim |
05:48:04 | Yardanico | don't ask why I have a "nimmonth" binary which is nim devel from a month ago |
05:48:19 | Zevv | yeah quite some work has been done there over the last weeks it seems |
05:48:22 | Yardanico | wait i sent same stuff |
05:48:30 | Yardanico | ah i didn't |
05:48:34 | Zevv | oh I have about 9 nim binaries around I believe :) |
05:48:36 | Yardanico | Zevv: optimizer + cursorifier yeah |
05:48:53 | Zevv | problem is that now I can't wait to actually write code that uses it all |
05:48:59 | Zevv | but then it won't work properly on GC anymore |
05:49:03 | Yardanico | why? |
05:49:08 | Yardanico | destructors are mapped to finalizers on refc |
05:49:08 | Zevv | =destroy[] |
05:49:12 | Yardanico | yes |
05:49:15 | Yardanico | refc supports them |
05:49:25 | Yardanico | don't ask how, I don't know |
05:49:29 | Zevv | yeh but not normal GC right |
05:49:33 | Yardanico | ?? |
05:49:34 | Yardanico | refc |
05:49:36 | Yardanico | the default GC |
05:49:39 | Zevv | waitamin |
05:49:44 | Yardanico | refc is the default GC sire |
05:49:50 | Yardanico | it's been the default nim GC for years |
05:50:01 | Yardanico | "deferred reference counting + mark & sweep for cycle collection" = refc |
05:50:15 | Yardanico | "automatic reference counting + move semantics" = arc |
05:51:05 | Yardanico | Zevv: https://play.nim-lang.org/#ix=21kT |
05:51:12 | Zevv | https://play.nim-lang.org/#ix=21eh |
05:51:14 | Zevv | this never desroys |
05:51:19 | Yardanico | because it's deferred |
05:51:28 | Yardanico | nim's default GC doesn't always check for garbage remember |
05:51:32 | Zevv | right |
05:51:39 | Yardanico | it will take a bit of time unless you do GC_fullCollect() or just end the program |
05:51:44 | Yardanico | same as finalizers |
05:51:47 | Yardanico | it's funny actually |
05:51:52 | Yardanico | finalizers are mapped to destructors on arc |
05:51:55 | Zevv | nope still doesnt |
05:52:00 | Yardanico | destructors are mapped to finalizers on refc |
05:52:15 | Yardanico | Zevv: seems a global scope thing |
05:52:26 | Zevv | Right. All that makes it kind of useless without arc |
05:52:42 | Yardanico | well why? no |
05:52:43 | Zevv | I don't have a holiday project yet, I'm considering making part 2 of my nim memory writeup |
05:52:46 | Yardanico | oh |
05:52:47 | Yardanico | nice |
05:52:48 | Zevv | and go deep on arc |
05:53:00 | * | cornfeedhobo joined #nim |
05:53:06 | Zevv | because the only docs are ar4qs techincal notes, which are totally useless for the Normal Man |
05:53:10 | Yardanico | I've found a few new regressions though, and they're both are a bit non-trivial (I mean the codebases, even though they're relatively small) |
05:53:23 | Yardanico | Zevv: what data structure would you expect a markdown parser to use? |
05:53:26 | Yardanico | just a random question |
05:53:38 | Yardanico | in nim |
05:53:50 | Zevv | hmm. |
05:53:57 | Zevv | tree-ish |
05:54:04 | Zevv | nested lists, nested sections |
05:54:28 | Yardanico | how about doubly linked lists of ref tokens with methods and inheritance? |
05:54:53 | Zevv | some people like pain, so I've heard |
05:54:58 | Yardanico | https://github.com/soasme/nim-markdown/blob/master/src/markdown.nim |
05:55:04 | Yardanico | in that package I found an cursorifier bug |
05:55:08 | Zevv | maybe these kind of people implement these kind of things with ref tokens with methods and inheritance |
05:55:15 | Yardanico | it uses doubly linked lists + inheritance + methods |
05:55:19 | Yardanico | for parsing markdown in nim :) |
05:55:27 | Zevv | well, it's not *wrong*, is it |
05:55:30 | Yardanico | well yeah |
05:55:32 | Yardanico | it *works* |
05:55:41 | Zevv | I would just make a tree of sum types I guess |
05:55:44 | Yardanico | same |
05:55:45 | * | narimiran_ joined #nim |
05:55:51 | Yardanico | but I minimized it to 1.2k loc but I can't do it further really XD |
05:56:00 | Yardanico | actually sorry it's more like 2k loc |
05:56:00 | Yardanico | https://gist.github.com/Yardanico/05963f165604854ef84863da34102c54 |
05:56:04 | Zevv | it's a great test case I bet |
05:56:14 | Yardanico | the one which triggers the cursorifier bug is this proc exactly https://gist.github.com/Yardanico/05963f165604854ef84863da34102c54#file-markdown-nim-L2253 |
05:56:21 | Yardanico | I tested because I disabled cursorifier that that exact proc and it worked |
05:56:41 | Yardanico | (I modified it of course, it wasn't called doStuff and it didn't have hard-coded indexes) |
05:56:42 | Zevv | pff the patience you have to dig into all that shit |
05:56:54 | Yardanico | I can't easily reproduce it because the token passed to doStuff is cyclic |
05:56:57 | Yardanico | I can't repr it |
05:57:16 | Yardanico | Zevv: well I mean it's manageable |
05:57:29 | Yardanico | at least today I had the joy of making a test case without monkey work |
05:57:54 | Yardanico | just tried running nimsynth with arc - read the stack trace - read a bit of code and made https://github.com/nim-lang/Nim/issues/15038 |
05:57:55 | disbot | ➥ [ARC] SIGSEGV when calling a closure as a tuple field in a seq ; snippet at 12https://play.nim-lang.org/#ix=20Nl |
05:58:01 | Yardanico | well not just, 4 hours ago |
05:58:07 | Yardanico | but it was a pleasant experience |
05:58:29 | Yardanico | the final boss still awaits us though |
05:58:32 | Yardanico | The Nim Compiler |
05:58:36 | Zevv | yeah |
05:58:39 | Yardanico | making it work with ARC :P |
05:58:40 | Zevv | but that was not written in Nim right |
05:58:42 | Zevv | that's just pascal |
05:58:44 | Yardanico | XD |
05:59:00 | Yardanico | yeah its delphi pascal with a windows gui |
05:59:09 | Yardanico | AST is stored in checkboxes |
05:59:16 | Zevv | ghehe |
05:59:59 | Zevv | is there like this one obvious big problem that makes ARC not work, or is it just a thousand different things? |
06:00:12 | Yardanico | it's mostly rare edge cases which weren't handled |
06:00:17 | Yardanico | no "big stuff", that's rare and most of it was fixed already |
06:00:19 | Zevv | which should be in the end |
06:00:23 | Yardanico | yeah |
06:00:32 | Zevv | Nim is Nim is Nim, you'd think |
06:00:51 | Zevv | but really, only since a month or so I feel it's really going to happen this time |
06:01:04 | Zevv | the whole "newruntime" promis that has been looming over 2018/2019 |
06:01:06 | Zevv | and never pulled off |
06:01:12 | Yardanico | let mut (#%#%!?%$#!@% |
06:01:46 | FromDiscord | <Rika> 👀 |
06:02:45 | Yardanico | but yeah Zevv, this time everyone is commited to ARC :P |
06:02:49 | Yardanico | and ORC |
06:03:17 | Zevv | yeah, the final step would just be to throw out arc and use orc only |
06:03:26 | Yardanico | D: that's not nice |
06:03:28 | Zevv | I can live with the 2.5% overhead |
06:03:37 | Yardanico | ORC will be the default anyway |
06:03:42 | Zevv | right |
06:03:53 | Yardanico | but actually with latest optimizers 4raq said that for simple cases there's no overhead with ORC at all |
06:04:00 | Zevv | I don't want to think about all that stuff anymore. I've been thinking about all that stuff for decades and it makes me soo tired |
06:04:05 | Zevv | I just want my language to do the Right Thing |
06:04:17 | Yardanico | the epic test |
06:04:18 | Zevv | I've been corrected and harassed by a flock of Juniors last week |
06:04:22 | Yardanico | wtf |
06:04:30 | Yardanico | epic test - https://github.com/nim-lang/Nim/blob/devel/tests/arc/topt_refcursors.nim |
06:04:32 | Zevv | my c++ was bad because I don't pass my strings as `const ref std::string &` |
06:04:41 | Zevv | Why the HELL do *I* need to type all that shit in if I have a compiler? |
06:05:00 | Yardanico | sounds strange :( |
06:05:14 | Yardanico | wait what does it mean |
06:05:18 | Yardanico | const = non-mutable |
06:05:23 | Yardanico | std::string - c++ string |
06:05:31 | Zevv | (Whining voice) "yeah well you can't pass your strings just like that because it will make a copy and thats baaad mkaah, so you need to pass a reference but you need to make it const if you don't want the function to mutate" |
06:06:03 | Zevv | c++ compilers are apparently not smart enough |
06:06:13 | Zevv | if you pass as string, it will *always* copy |
06:06:16 | Yardanico | use rust instead! it'll solve all your problems |
06:06:23 | Zevv | rust hurts |
06:06:28 | FromDiscord | <Rika> and cause 99 more |
06:06:38 | Yardanico | Zevv: about copy |
06:06:40 | FromDiscord | <Rika> of course rust hurts, you'd get tetanus if you had an open wound |
06:06:46 | Yardanico | check https://forum.nim-lang.org/t/6549 bottom of the opening post |
06:06:53 | Yardanico | "Which might not be impressive but it means the compiler optimized away all hidden constructions, destructions and copies. Try the same with C++'s std::string and Godbolt." |
06:06:55 | Yardanico | 4raq savage |
06:07:00 | Zevv | I was really pleased with Go. It's hard to hate, but also hard to love tho |
06:07:16 | Zevv | ah yeah I saw that remark. That was pretty funny |
06:08:58 | Yardanico | moe works with arc btw (all tests of it pass at least) |
06:09:07 | Zevv | moe? |
06:09:09 | Yardanico | https://github.com/fox0430/moe |
06:09:25 | Yardanico | its ~9k cloc of Nim |
06:09:30 | Zevv | nice |
06:09:38 | Yardanico | after I reported two bugs of course ;P |
06:09:42 | FromDiscord | <Rika> nice idolmaster avatar |
06:09:54 | Yardanico | but they're an actual japanese person |
06:10:02 | Yardanico | they have the anime pic pass |
06:10:17 | FromDiscord | <Rika> why does it matter if theyre japanese or not |
06:10:28 | Yardanico | because im trying to be funny |
06:10:39 | FromDiscord | <Rika> you're trying too hard xd |
06:11:21 | FromDiscord | <Rika> god damn thats a lot of contributions though |
06:11:30 | Yardanico | yeah I was surprised when I first saw it |
06:14:10 | Yardanico | can anyone recommend a good way to try to understand the structure of a cyclic datastructure in nim? |
06:14:13 | Yardanico | so I can reproduce that markdown thing |
06:16:36 | Yardanico | I guess I can recursively traverse and unsafeAddr to ignore nodes I already went through .. |
06:16:57 | Zevv | how do you mean "try to understand"? |
06:17:05 | Yardanico | to manually construct it |
06:17:14 | Yardanico | without the 2k lines of code |
06:17:29 | Zevv | ah not just any, but exactly *that* data structure |
06:17:33 | Yardanico | yes |
06:17:49 | Zevv | hm |
06:17:58 | Zevv | I dont have time today to go grok all that code |
06:18:02 | Yardanico | it's okay |
06:18:05 | Yardanico | I will find a way |
06:18:16 | Zevv | but I guess Id start with some visualizations with dot/graphviz |
06:18:18 | Yardanico | I once minified all nigui (well to be fair win32 and gtk3 are separated there) for an arc bug |
06:22:21 | FromDiscord | <Varriount> Zevv: don't be afraid to learn new things |
06:23:07 | Yardanico | ok nice |
06:23:17 | Yardanico | so in that token 11 freaking children point to same thing in memory |
06:23:18 | Yardanico | wtf |
06:26:42 | FromDiscord | <Varriount> Zevv: sorry for not responding, I fell asleep |
06:26:48 | Yardanico | happens :P |
06:34:03 | Zevv | Nah, I'm never afraid to learn new things, I was just whining :) |
06:34:13 | FromDiscord | <Varriount> Zevv: Reading that issue in NPeg's repo, it sounds like they are suggesting that there should be a way to execute code on match, and on backtrack |
06:34:41 | Zevv | right. The problem with the current method is that nim code block captures always run |
06:34:53 | Zevv | in practice, this is usually just fine. until its not |
06:35:00 | Zevv | and then you have no way of telling you've been backtracked |
06:35:12 | Zevv | but I'm shunned of a bit by the added complexity it will bring |
06:35:13 | FromDiscord | <Varriount> Yes, but there's no way to run code on backtrack |
06:36:59 | Zevv | also I'm not sure if I agree with having the stack at the rule level |
06:37:22 | Zevv | but then again, I still didn't find or take the time to properly look into all this |
06:37:49 | Zevv | my job has been kind of sucking up all my brain juice over the last few months |
06:37:56 | Zevv | and I guess it will keep doing that for some time |
06:38:31 | FromDiscord | <Varriount> Zevv: I understand that. Mine has too. |
06:39:30 | Zevv | such is life |
06:39:35 | FromDiscord | <Varriount> Zevv: What I think they meant was, currently there's a way to execute code on match. They also wanted a way to execute code on backtrack. |
06:40:28 | Zevv | I think not on backtrack, but on commit |
06:40:34 | Zevv | so when the choice has been made final |
06:41:22 | FromDiscord | <Varriount> Yeah, but that's something that can really already be done - it's no different than processing a list of captures. |
06:42:04 | Zevv | right, but that makes it harder to construct a tree, if that's what you want to do |
06:42:26 | Zevv | of course part of the problem is that a parser is a beast that can be used for lots of things |
06:42:33 | Zevv | and every use has its own additional requirements |
06:44:04 | * | Senketsu joined #nim |
06:44:31 | FromDiscord | <Varriount> I don't really see how that's possible without running through the entire input, since its entirely possible that the grammar you construct with NPeg has no "atomic" points where backtracking is guaranteed to not occur. |
06:46:17 | FromDiscord | <Varriount> Zevv: Before I go further, I just want to confirm, this is what your referring to? https://github.com/zevv/npeg/issues/24 |
06:46:18 | disbot | ➥ Question about code blocks and backtracking |
06:48:05 | Zevv | nope, its this one: |
06:48:16 | Zevv | https://github.com/zevv/npeg/issues/14 |
06:48:18 | disbot | ➥ Input wanted: design and implement a proper API for code blocks ; snippet at 12https://play.nim-lang.org/#ix=21zU |
06:48:26 | Zevv | shumy-tools |
06:48:30 | Zevv | they are both related, tho |
06:50:14 | Zevv | I do like the possible synax where there are optional blocks in code captures like `commit:` or `validate:` |
06:50:21 | Zevv | this would keep the current behaviour compatible |
06:50:52 | Zevv | instead of running the code there, that could store a callback closure when the capture gets commited |
06:50:57 | Zevv | and only then run that snippet |
06:51:30 | Zevv | problem is that getting the captures work as they do now has been about 50% of the total effort of making npeg - the parsing was relatively trivial. |
06:51:45 | Zevv | and is suggestions of throwing that all out and redoing it is kind of a mental struggle for me :) |
07:01:07 | FromDiscord | <Varriount> Zevv: Hm. |
07:01:57 | FromDiscord | <Varriount> I think I mostly understand what they are proposing. |
07:07:38 | FromDiscord | <Varriount> Zevv: Isn't the proposal fairly similar to what one might get if they put a capture around each rule? |
07:07:54 | * | solitudesf joined #nim |
07:08:08 | Zevv | well, there *is* already an implicit capture around each rule |
07:08:15 | Zevv | that's the capture[0] or $0 |
07:12:26 | * | marnix joined #nim |
07:12:55 | * | icy quit (Quit: catch you on the flipside :^)) |
07:12:57 | * | marnix quit (Read error: Connection reset by peer) |
07:13:40 | * | marnix joined #nim |
07:17:00 | * | icyphox joined #nim |
07:17:23 | FromDiscord | <Varriount> Bah, the problem with things like PEGs is that it's hard to come up with an example that's both realistic _and_ short. |
07:17:54 | FromDiscord | <Varriount> I wanted to describe my interpretation, but I don't think its worth the effort. |
07:21:11 | FromDiscord | <Varriount> Zevv: With regards to NPeg (and PEGs in general) I guess I don't necessarily see them as always optimal for producing an AST. If I have one criticism/caution on that proposal, it's that the most readable/performant set of PEG rules for a given language doesn't necessarily match up with the syntax tree of the language. |
07:21:35 | Zevv | also true |
07:21:52 | Zevv | but then again, it would be nice if npeg could at least facilitate one good method for building AST |
07:22:13 | Zevv | I now do this with the help of an additional stack on the 'outside', which does actually work fine |
07:22:32 | Zevv | remains only the problem of getting code to run for captures that might backtrack |
07:22:48 | Zevv | funnily, I never ran into that myself |
07:26:31 | FromDiscord | <Varriount> Zevv: I guess I'll add my 2 cents to that issue, and see if it gets any reply. |
07:27:03 | Zevv | thanks! |
07:27:05 | FromDiscord | <Varriount> Once again, thanks for creating such a useful library. |
07:27:21 | Zevv | pleasure :) |
07:28:29 | FromDiscord | <Varriount> By the way, what have you used NPeg for? |
07:30:49 | Zevv | I mostly use it for ad hoc data crunching |
07:34:11 | Zevv | some custom scripts I have to do my administration and bookkeeping |
07:38:40 | Zevv | parsing DSLs to generate wireshark protocol analizers |
07:38:50 | Zevv | oh and parsing RTSP and SIP |
07:40:38 | ForumUpdaterBot | New thread by Tedlavarias: Problem installing Nim compiler on Linux Mint 20 with curl, see https://forum.nim-lang.org/t/6571 |
07:40:55 | * | Senketsu quit (Read error: Connection reset by peer) |
07:44:33 | * | endragor quit (Ping timeout: 256 seconds) |
07:46:11 | * | marnix quit (Ping timeout: 240 seconds) |
07:55:31 | * | endragor joined #nim |
07:58:24 | * | d10n_ is now known as d10n |
07:58:24 | * | d10n quit (Changing host) |
07:58:25 | * | d10n joined #nim |
08:04:09 | * | marnix joined #nim |
08:16:36 | * | beatmox- joined #nim |
08:16:43 | * | beatmox quit (Read error: Connection reset by peer) |
08:16:50 | * | qwertfisch_ joined #nim |
08:16:51 | * | qwertfisch quit (Quit: ZNC - http://znc.in) |
08:18:18 | Yardanico | ok apparently for that nim-markdown the sledgehammer approach seems to be working |
08:18:21 | Yardanico | from 2k loc to 200 loc |
08:20:28 | FromDiscord | <Clyybber> @Yardanico That new thing is nice, I don't think it needs to be magic |
08:24:16 | FromDiscord | <Varriount> If you want to get rid of the copy, you could always just make it a template. |
08:26:33 | FromDiscord | <Clyybber> @tomck You can use getImplTransformed |
08:32:24 | FromGitter | <bung87> `fftpack.dct` with param `norm="ortho"` which is the equals way in nim ? |
08:33:02 | Araq | callHere(norm="ortho") is the syntax for named parameters, like in Python |
08:33:36 | FromGitter | <bung87> ah, the point is not the param thing , |
08:33:38 | FromDiscord | <Rika> what is fftpack.dct? |
08:33:44 | * | superbia joined #nim |
08:34:05 | FromGitter | <bung87> Return the Discrete Cosine Transform of arbitrary type sequence x. |
08:34:17 | Araq | er, didn't the stdlib offer "fractions"? where are they? |
08:35:40 | Araq | ah, "rationals" it is |
08:38:04 | * | superbia quit (Client Quit) |
08:38:21 | * | superbia joined #nim |
08:38:52 | * | superbia quit (Client Quit) |
08:40:15 | Yardanico | Araq: minimized this nim-markdown thing, I really don't understand why it crashes, but it does (and doesn't on a month-old nim with arc or with refc) - https://play.nim-lang.org/#ix=21Qn |
08:40:38 | Yardanico | also had to keep methods since they are apparently important to trigger this crash |
08:40:48 | FromGitter | <bung87> thank you |
08:41:09 | Yardanico | ah wait it still crashes if I remove seq[Chunk] now |
08:41:18 | Yardanico | nice |
08:41:47 | Yardanico | and it is a cursorifier bug, works with cursorifier disabled |
08:41:59 | Yardanico | i'll make an issue |
08:43:26 | Yardanico | https://github.com/nim-lang/Nim/issues/15039 |
08:43:28 | disbot | ➥ [ARC] Weird cursorifier bug with methods + doubly-linked lists ; snippet at 12https://play.nim-lang.org/#ix=21R8 |
08:43:36 | Yardanico | i didn't know a good title for this one :P |
08:43:53 | Araq | it's good |
08:47:27 | * | oddp joined #nim |
08:53:15 | * | muffindrake quit (Ping timeout: 272 seconds) |
08:54:01 | * | muffindrake joined #nim |
08:54:15 | * | superbia joined #nim |
08:55:45 | * | nikita` joined #nim |
08:58:50 | ForumUpdaterBot | New thread by JPLRouge: Typefino or type trait for --gc:arc choix ???, see https://forum.nim-lang.org/t/6572 |
08:59:32 | FromDiscord | <Rika> what |
08:59:37 | Yardanico | I understood them :) |
08:59:41 | FromDiscord | <Rika> i dont understand what they mean |
09:00:10 | Yardanico | They're asking if "typetraits" will remain available long-term for the --gc:arc |
09:00:17 | Yardanico | because they switched from typeinfo to typetraits |
09:00:50 | FromDiscord | <Rika> will it? |
09:01:00 | Yardanico | why wouldn't it? |
09:01:09 | Yardanico | it doesn't matter which gc you're using for typetraits really |
09:02:50 | FromDiscord | <Rika> TIL distinctBase... |
09:03:05 | Yardanico | also typetraits in devel got a very good addition |
09:03:23 | Yardanico | https://github.com/nim-lang/Nim/pull/14791 |
09:03:24 | disbot | ➥ typetraits: features and fixes |
09:03:32 | Yardanico | genericParams improvements |
09:09:24 | FromDiscord | <dom96> This is interesting and it mentions Nim https://reddit.com/r/programming/comments/hvfj2c/complexity_of_hello_world_what_comes_after/ |
09:09:29 | Yardanico | oh yeah saw that |
09:09:45 | Yardanico | that person included nim in some other videos as well |
09:11:17 | Yardanico | @dom96 https://www.youtube.com/watch?v=-9SGIB946lw :P |
09:11:34 | Yardanico | same channel |
09:20:46 | FromDiscord | <Varriount> Hm, do YouTube videos count as secondary sources? These might be good to add to the Wikipedia page |
09:20:50 | Yardanico | yes |
09:21:07 | Yardanico | but well |
09:21:16 | Yardanico | wikipedia doesn't consider them reliable sources |
09:21:19 | Yardanico | https://en.wikipedia.org/wiki/Wikipedia:Reliable_source_examples#Are_IRC,_Myspace,_Facebook,_and_YouTube_reliable_sources? |
09:21:28 | FromDiscord | <Clyybber> Yardanico Regarding 15036 the * is needed so that the const is generated |
09:21:37 | FromDiscord | <Clyybber> otherwise deadcode elim comes into play |
09:21:41 | Yardanico | @Clyybber yeah I figured that out |
09:22:30 | FromDiscord | <Varriount> Bah. The problem with Wikipedia's rules is that they don't really apply to certain kinds of subject matter. |
09:23:09 | FromDiscord | <Varriount> */apply to/fit well with/ |
09:28:09 | superbia | what if you don't consider wikipedia as a reliable source |
09:28:13 | * | marnix quit (Read error: Connection reset by peer) |
09:28:21 | * | marnix joined #nim |
09:31:13 | * | Vladar joined #nim |
09:32:02 | * | muffindrake quit (Quit: muffindrake) |
09:37:25 | Araq | lol, indeed |
09:37:36 | Araq | and I don't |
09:38:00 | FromDiscord | <Recruit_main707> Depends on the topic |
09:41:52 | FromDiscord | <dom96> > @dom96 https://www.youtube.com/watch?v=-9SGIB946lw :P↵@Yardanico[IRC]#0000 oh cool |
09:48:19 | Araq | do you think #15026 is *not* caused by --exceptions:goto because it works with this switch and only fails with --gc:arc ? |
09:48:21 | disbot | https://github.com/nim-lang/Nim/issues/15026 -- 3[ARC] Weird exception behaviour from doAssertRaises ; snippet at 12https://play.nim-lang.org/#ix=204i |
09:48:34 | Araq | well you would be wrong then :P |
09:48:53 | Yardanico | let me guess - exceptions:goto is ignored for refc? :P |
09:49:59 | Araq | I replied, see for yourself. --gc:arc produces a nested try-finally that you didn't see |
09:52:14 | Araq | why are forest ants so much bigger than the usual ants? |
09:52:52 | Yardanico | well I see in the C code that the "wrong" is set to true outside of the exception checks for some reason |
09:53:03 | Yardanico | so it's always set even if the exception is raised |
09:53:57 | Araq | the control flow has to run the 'Finally' section and then inside the finally we forget to rewind further |
09:54:03 | * | waleee-cl joined #nim |
09:57:14 | * | fredrikhr joined #nim |
10:01:02 | Araq | ah, it's simple |
10:01:14 | Araq | only toplevel statements are affected and it's easy to see why |
10:07:47 | Araq | ha, watch this, the most beautiful bugfix ever |
10:07:52 | Yardanico | single line? :D |
10:09:06 | Araq | https://github.com/nim-lang/Nim/pull/15040 |
10:09:07 | disbot | ➥ fixes #15026, no test case since only a special case was affected and… |
10:09:16 | Yardanico | lol |
10:10:00 | FromDiscord | <Rika> That's amazing LOL |
10:11:18 | Yardanico | btw, how does the C backend indent C code? |
10:11:31 | Yardanico | i'm just asking because exception handling stuff isn't indented :P |
10:11:32 | FromDiscord | <Clyybber> by chance :p |
10:11:49 | * | xet7 quit (Quit: Leaving) |
10:11:52 | Yardanico | it's a minor thing of course |
10:12:04 | Araq | there is some logic for it but it isn't maintained really |
10:12:06 | Yardanico | but after all the recent optimizer PRs the C code is easier to read lol |
10:12:22 | Araq | yeah it's getting beautiful :P |
10:12:36 | * | xet7 joined #nim |
10:14:33 | Araq | we need a better backend |
10:14:42 | * | vicfred joined #nim |
10:14:52 | Araq | something based on types |
10:15:03 | Araq | not on ropes |
10:20:34 | * | hyiltiz quit (Quit: No Ping reply in 180 seconds.) |
10:21:50 | * | hyiltiz joined #nim |
10:21:50 | * | hyiltiz quit (Changing host) |
10:21:50 | * | hyiltiz joined #nim |
10:48:42 | * | theelous3 joined #nim |
10:53:44 | Zevv | it's pretty amazing. I like your snippet on the forum post. |
10:54:05 | Zevv | there's just nothing happening. zero overhead |
11:03:28 | alehander92 | oooi |
11:03:33 | alehander92 | what is zero |
11:03:49 | * | maier quit (Ping timeout: 264 seconds) |
11:04:19 | Yardanico | alehander92: https://forum.nim-lang.org/t/6549 |
11:04:23 | Yardanico | bottom of the first post |
11:10:49 | * | oddp quit (Ping timeout: 256 seconds) |
11:17:51 | * | superbia1 joined #nim |
11:20:30 | * | superbia quit (Ping timeout: 260 seconds) |
11:22:38 | * | qwertfisch_ is now known as qwertfisch |
11:32:21 | * | maier joined #nim |
11:43:40 | FromDiscord | <tomck> sent a long message, see http://ix.io/22es |
11:43:56 | FromDiscord | <Yardanico> https://github.com/zero-functional/zero-functional |
11:44:11 | FromDiscord | <tomck> ahhh this is the one |
11:44:19 | FromDiscord | <tomck> shame it's not in the lang |
11:45:37 | FromDiscord | <Rika> Nim is one of the languages where most things are implemented in packages rather than added to the lang, I feel |
11:58:04 | FromDiscord | <tomck> Okay, so i have a `ref object` which is a variant object |
11:58:24 | FromDiscord | <tomck> because it's a variant object, the default `==` implementation seems to not work |
11:58:57 | FromDiscord | <tomck> so, i implemented my own `==` proc, which works fine↵However, some places in the code I am checking for if `x != nil`, which triggers my `==` proc |
11:59:36 | FromDiscord | <tomck> In my proc, how do i check whether a parameter is nil? If i just use `if x == nil`, this will just recursively call my `==` proc |
12:01:01 | FromDiscord | <tomck> Aha, so i got it to work ( i think ) by checking `if x[].addr != nil` |
12:06:01 | * | supakeen quit (Quit: WeeChat 2.8) |
12:06:46 | * | supakeen joined #nim |
12:21:30 | * | maier quit (Ping timeout: 256 seconds) |
12:21:39 | FromDiscord | <Rika> Theres an isNil proc, that might be what you are looking for |
12:24:48 | * | NimBot joined #nim |
12:27:29 | * | fredrikhr quit (Read error: Connection reset by peer) |
12:33:54 | FromDiscord | <exelotl> Ouch, so that's why that exists... |
12:38:44 | * | beatmox- quit (*.net *.split) |
12:38:44 | * | swamptest1[m] quit (*.net *.split) |
12:38:44 | * | leorize[m] quit (*.net *.split) |
12:38:44 | * | Zoom[m] quit (*.net *.split) |
12:38:44 | * | skrylar[m] quit (*.net *.split) |
12:38:45 | * | planetis[m] quit (*.net *.split) |
12:38:45 | * | lnxw37d4 quit (*.net *.split) |
12:38:45 | * | Cadey quit (*.net *.split) |
12:38:45 | * | ldlework quit (*.net *.split) |
12:40:30 | * | j4nvkvc quit (Remote host closed the connection) |
12:40:31 | * | GitterIntegratio quit (Write error: Connection reset by peer) |
12:40:31 | * | k0mpjut0r quit (Write error: Connection reset by peer) |
12:40:31 | * | watzon quit (Write error: Connection reset by peer) |
12:40:32 | * | ee7[m] quit (Read error: Connection reset by peer) |
12:40:32 | * | BitPuffin quit (Write error: Connection reset by peer) |
12:40:32 | * | wontruefree[m] quit (Read error: Connection reset by peer) |
12:40:33 | * | MTRNord[m] quit (Remote host closed the connection) |
12:40:35 | * | xicheng[m] quit (Read error: Connection reset by peer) |
12:40:35 | * | slackytude[m] quit (Read error: Connection reset by peer) |
12:40:37 | * | guelosk[m] quit (Read error: Connection reset by peer) |
12:40:37 | * | reversem3 quit (Remote host closed the connection) |
12:40:38 | * | stisa[m] quit (Read error: Connection reset by peer) |
12:40:38 | * | nerdrat[m]1 quit (Remote host closed the connection) |
12:40:39 | * | oneark quit (Remote host closed the connection) |
12:40:41 | * | codic quit (Write error: Connection reset by peer) |
12:40:41 | * | unclechu quit (Write error: Connection reset by peer) |
12:40:42 | * | dzamo[m] quit (Remote host closed the connection) |
12:40:43 | * | Zambyte[m] quit (Read error: Connection reset by peer) |
12:40:57 | * | fredrikhr joined #nim |
12:42:18 | * | krux02 joined #nim |
12:42:33 | * | beatmox- joined #nim |
12:42:33 | * | Cadey joined #nim |
12:42:33 | * | ldlework joined #nim |
12:45:48 | * | maier joined #nim |
12:49:47 | * | guelosk[m] joined #nim |
13:16:21 | * | oddp joined #nim |
13:20:27 | FromDiscord | <tomck> why is there no default impl for == on variant objects? |
13:21:21 | * | watzon joined #nim |
13:21:21 | * | MTRNord[m] joined #nim |
13:21:21 | * | leorize[m] joined #nim |
13:21:21 | * | dzamo[m] joined #nim |
13:21:21 | * | planetis[m] joined #nim |
13:21:22 | * | lnxw37d4 joined #nim |
13:21:22 | * | nerdrat[m] joined #nim |
13:21:22 | * | reversem3 joined #nim |
13:21:22 | * | unclechu joined #nim |
13:21:22 | * | oneark joined #nim |
13:21:22 | * | k0mpjut0r joined #nim |
13:21:22 | * | codic joined #nim |
13:21:22 | * | Zambyte[m] joined #nim |
13:21:22 | * | j4nvkvc joined #nim |
13:21:22 | * | BitPuffin joined #nim |
13:21:22 | * | GitterIntegratio joined #nim |
13:21:23 | FromDiscord | <tomck> sent a code paste, see https://play.nim-lang.org/#ix=22Ih |
13:21:28 | * | xicheng[m] joined #nim |
13:21:28 | * | wontruefree[m] joined #nim |
13:21:28 | * | Zoom[m] joined #nim |
13:21:28 | * | sendell joined #nim |
13:21:28 | * | neceve joined #nim |
13:21:28 | * | ee7[m] joined #nim |
13:21:29 | * | slackytude[m] joined #nim |
13:21:29 | * | stisa[m] joined #nim |
13:21:30 | * | skrylar[m] joined #nim |
13:21:30 | * | swamptest1[m] joined #nim |
13:24:45 | * | filcuc joined #nim |
13:43:28 | * | muffindrake joined #nim |
13:43:44 | * | drewr joined #nim |
13:51:22 | Araq | tomck: the idiomatic way is to use system.`==`(x, nil) |
13:57:37 | * | Kaivo joined #nim |
14:01:09 | FromDiscord | <tomck> Araq: will that work for variant objects |
14:01:11 | FromDiscord | <tomck> (edit) 'objects' => 'objects?' |
14:01:47 | Araq | no, it's what you can use instead of pointer hack or instead of isNil |
14:02:11 | FromDiscord | <tomck> oh i see, why can't nim implement a generic == proc for variant objects? |
14:02:44 | FromDiscord | <tomck> Is there some edge-case i'm not considering, or could i go ahead & implement my own `==` for variant objects in my project? |
14:03:51 | * | muffindrake quit (Quit: muffindrake) |
14:04:20 | * | muffindrake joined #nim |
14:06:54 | Araq | tomck: it can do it easily. problem is system.nim cannot because it lives in the dark ages before we had type introspection in Nim's macro system |
14:08:37 | FromDiscord | <tomck> ahh ok, so nim could do this in the future? I'll take a look into my own macro for it, thanks! |
14:10:02 | Araq | yeah, it's common complaint in fact |
14:11:52 | * | superbia1 is now known as superbia |
14:23:11 | * | haxscramper joined #nim |
14:28:33 | icyphox | I get a 'SIGSEGV: Illegal storage access. (Attempt to read from nil?)' when I try doing a `req.respond(..)`, using asynchttpserver. |
14:28:42 | icyphox | Any ideas? |
14:38:57 | * | muffindrake quit (Quit: muffindrake) |
14:46:08 | * | haxscramper quit (Remote host closed the connection) |
14:52:12 | * | muffindrake joined #nim |
14:56:38 | * | Kaivo quit (Quit: WeeChat 2.8) |
15:01:03 | Zevv | so araq, I had a little chat with yardanico this morning; nim kind of misses a way to construct a ref object. When T is an object, you can't make a t like `new T(member: value, ...)`, you always need to make a new T first and then fill it in. Do you think we could put something like this in the stdlib: https://play.nim-lang.org/#ix=21cJ, with the new arc its basically one alloc and one copy |
15:01:41 | Araq | what's wrong with MyObj(field: value) ? |
15:01:51 | Araq | it works for MyObj = ref object too |
15:02:17 | Zevv | yeah but then you need to have a ref type |
15:02:20 | disruptek | i think he's talking about an obj and he wants a spontaneous ref version. |
15:02:26 | Zevv | I only have my object type and I want to make a ref |
15:02:41 | Zevv | let t = new T; t.field = value |
15:02:43 | disruptek | (ref Obj)(...) |
15:02:44 | Zevv | that's not so nice |
15:03:38 | Zevv | I like the let t = new Thing(field: value), it's kind of intuitive imho |
15:04:13 | disruptek | i think it's gratuitous. |
15:04:23 | FromDiscord | <lqdev> i'd prefer `let t = mkref T(a: b)` or something |
15:04:25 | FromDiscord | <lqdev> `new` is too generic |
15:04:39 | disruptek | when you want to hack on ast, you discover that fewer constructs is better. |
15:05:20 | Zevv | its just a teeny macro, which might get some magic to get rid of the copy, even, maybe |
15:05:25 | Zevv | but fair enough |
15:06:05 | * | maier quit (Ping timeout: 240 seconds) |
15:07:05 | Araq | well it's (ref Obj)(...) indeed, maybe we can add something to sugar.nim tho |
15:07:28 | Araq | sugar.create Obj(...) |
15:07:36 | Zevv | sweet, I'll PR something that can be bikeshedded into oblivion |
15:07:43 | Zevv | :) |
15:07:52 | Araq | alright |
15:08:40 | disruptek | newref |
15:08:54 | FromDiscord | <lqdev> Zevv: https://play.nim-lang.org/#ix=22WA |
15:09:04 | Zevv | wrong order. first i pr, *then* you bikeshed |
15:09:06 | FromDiscord | <lqdev> feel free to steal |
15:10:16 | Zevv | lqdev how is that different from https://play.nim-lang.org/#ix=21cJ |
15:10:43 | FromDiscord | <lqdev> yours is more flexible. |
15:10:54 | FromDiscord | <lqdev> reading your description, I thought you wanted a macro. |
15:11:04 | Zevv | nah, I want to construct new refs |
15:11:19 | Zevv | I almost never want a macro. |
15:11:37 | disruptek | lol |
15:12:45 | disruptek | it's a lot of code to add parenthesis. |
15:13:00 | alehander92 | <3 |
15:13:32 | alehander92 | syntax sugar |
15:14:02 | disruptek | i can't believe i'm going to have to write a test framework. |
15:14:28 | * | maier joined #nim |
15:15:03 | disruptek | it just seems impossible that there isn't someone smarter that isn't equally annoyed. |
15:16:08 | * | Zevv quit (Quit: Lost terminal) |
15:16:56 | FromDiscord | <Technisha Circuit (LGBTQIAP+)> Is there a way for me to use all of Nim's built-in types in C? |
15:16:57 | * | Zevv joined #nim |
15:17:07 | FromDiscord | <Technisha Circuit (LGBTQIAP+)> Uh- Asking for a friend- |
15:17:12 | disruptek | why? |
15:17:34 | FromDiscord | <Technisha Circuit (LGBTQIAP+)> Because a friend is curious- |
15:17:36 | FromDiscord | <Technisha Circuit (LGBTQIAP+)> ~~I am my own friend-~~ |
15:17:58 | disruptek | you're curious, all right. |
15:18:07 | FromDiscord | <Technisha Circuit (LGBTQIAP+)> Lmao |
15:18:37 | FromDiscord | <lqdev> ~~curiosity killed the cat~~ |
15:18:37 | FromDiscord | <Technisha Circuit (LGBTQIAP+)> It's mainly because I'm an idiot, I'm wondering if i could use Nim modules that use Nim types in C |
15:18:52 | FromDiscord | <Technisha Circuit (LGBTQIAP+)> ~~Who said i wasn't already dead?~~ |
15:19:06 | disruptek | of course. |
15:19:26 | * | maier quit (Ping timeout: 240 seconds) |
15:19:29 | FromDiscord | <Technisha Circuit (LGBTQIAP+)> (edit) removed 'in C' |
15:19:46 | FromDiscord | <Technisha Circuit (LGBTQIAP+)> (edit) 'types' => 'types, in C' |
15:20:12 | FromDiscord | <Technisha Circuit (LGBTQIAP+)> How would i use Nim types in C though? That's the question that needs to be answered first |
15:20:39 | disruptek | export them. |
15:20:39 | disruptek | ~manual |
15:20:39 | disbot | manual: 11the Nim Manual is https://nim-lang.org/docs/manual.html -- disruptek |
15:20:54 | FromDiscord | <Technisha Circuit (LGBTQIAP+)> Thanks! |
15:22:05 | disruptek | i really don't understand why we don't have a plethora of emojis for software engineering. |
15:23:08 | * | NimBot joined #nim |
15:23:46 | Zevv | like cutlery |
15:24:11 | Zevv | valid point. Clones, forks, repos, branches |
15:25:03 | Zevv | I have an idea! We could maybe make groups of existing emojis to represent concepts |
15:25:11 | Zevv | or other unicode points |
15:25:31 | Zevv | hmm for max portability we could choose them from page 1 |
15:25:48 | Zevv | like the combination of 'f', 'o', 'r', and 'k' could mean something like "fork" |
15:25:51 | disruptek | Zevv: i will kill you. |
15:25:56 | Zevv | gee am I smart |
15:26:19 | FromDiscord | <exelotl> Let's use ligatures for it! Kappa |
15:26:23 | disruptek | i will kill you with 🍴. |
15:26:51 | disruptek | maybe i'll garrot you with 🧵 or 🧶. |
15:27:03 | Zevv | with <empty square> or <emtpy square> |
15:27:31 | disruptek | i know these are all □ to you. |
15:28:11 | Zevv | unicode point 0x512b31 LITTLE_GREEN_OPEN_SQUARE |
15:31:53 | FromDiscord | <lqdev> ↑↓←→ |
15:33:00 | * | narimiran_ is now known as narimiran |
15:43:10 | * | filcuc quit (Quit: KVIrc 5.0.0 Aria http://www.kvirc.net/) |
15:50:49 | * | fvs joined #nim |
15:53:49 | * | fvs left #nim (#nim) |
16:01:17 | FromDiscord | <exelotl> If I have a fixed-point number type that should have a custom conversion to int, but not an implicit converter, is it OK to do ``` proc `int`(a: Fixed): int = ... ``` |
16:03:06 | disruptek | wut |
16:07:38 | FromDiscord | <exelotl> If I do: ```nim↵let a: Fixed = fp(1.0)↵echo a.int```↵it prints 256 because it basically does a raw cast (Fixed is a distinct int with 8 fractional bits) |
16:08:26 | FromDiscord | <Clyybber> I think so yeah |
16:08:26 | FromDiscord | <exelotl> Currently I have a toInt() proc which does the correct conversion (shift by 8 places) |
16:08:36 | FromDiscord | <Clyybber> I like your approach |
16:09:02 | FromDiscord | <Clyybber> Oh, wait, does it not call the proc? |
16:09:13 | FromDiscord | <exelotl> It does, if I define it |
16:09:16 | FromDiscord | <Clyybber> k |
16:09:27 | FromDiscord | <exelotl> I just didn't realise I could do it until just now xD |
16:09:30 | disruptek | to me it's too magical. |
16:09:46 | FromDiscord | <Clyybber> I think maybe we should document this to be the canonical way of implementing explicit converters |
16:10:00 | FromDiscord | <Clyybber> disruptek: Less magic than implicit converters :) |
16:11:55 | FromDiscord | <exelotl> Yeah I think its worth it, after all Nim's type conversions are supposed to be human friendly, if you want to do a raw cast, use cast[]() |
16:13:55 | FromDiscord | <exelotl> My friend got tripped up wondering why `.int` was returning 256 yesterday, and it seemed really wrong that I had to explain that he should use `toInt` instead |
16:14:52 | icyphox | https://github.com/nim-lang/Nim/issues/13866 -- this was fixed? i'm still facing this on 1.2.4 |
16:14:53 | disbot | ➥ asynchttpserver documentation example causes SIGSEGV ; snippet at 12https://play.nim-lang.org/#ix=2gAG |
16:17:56 | icyphox | well, not the exact same example |
16:21:27 | FromDiscord | <Clyybber> disruptek: Why are Conts using inheritance? |
16:32:05 | FromDiscord | <lqdev> @exelotl you don't need to strop `int`, it's not a keyword |
16:36:41 | * | opDispatch quit (Quit: Konversation terminated!) |
16:37:09 | * | gsingh93 quit (Quit: ZNC - http://znc.in) |
16:42:35 | icyphox | oh wow, had to set newHttpHeaders() for it to work |
16:42:41 | icyphox | this is probably an issue... |
16:45:01 | disruptek | clyybber: i might be able to optimize cloning them more easily, and it allows the user to extend them. it's currently broken in any event. |
16:45:40 | disruptek | icyphox: sounds like it. |
16:46:15 | icyphox | disruptek: yeah i'll open an issue in a bit |
16:46:31 | icyphox | luckily for me, i did have to set http headers |
16:46:33 | icyphox | so it's ok |
16:46:37 | FromDiscord | <tomck> what're my options for debug-printing an object? |
16:46:44 | FromDiscord | <tomck> 'echo' seems to not like arbitrary objects |
16:46:47 | disruptek | repr |
16:47:19 | FromDiscord | <tomck> ahhhh brill ta |
16:49:02 | disruptek | clyybber: do you have a good reason not to inherit? |
16:52:16 | FromDiscord | <Clyybber> Performance, but I see that you are not using methods so its probably fine |
16:52:53 | disruptek | ah, yeah. |
16:53:00 | disruptek | that would be dumb. |
16:53:04 | FromDiscord | <Clyybber> disruptek: I'm seeing an issue `cps/environment.nim(199, 18) Error: type expected, but symbol 'env' has no type.` when trying to compile the readme example |
16:53:14 | disruptek | yeah, it doesn't work. |
16:53:19 | FromDiscord | <Clyybber> do you know why? |
16:53:29 | disruptek | yeah, it's not dumping all the types. |
16:53:37 | disruptek | the test should work on HEAD. |
16:53:52 | FromDiscord | <Clyybber> weird, pretty sure I just cloneda few minutes ago |
16:54:01 | disruptek | the test.nim, i mean. |
16:54:32 | FromDiscord | <Clyybber> oh, sure test.nim works |
16:54:33 | disruptek | i'm moving the types to get cached in the env. |
16:55:12 | disruptek | maybe you can figure out why i cannot use an Empty in the proc prototypes. |
16:55:36 | FromDiscord | <Clyybber> ok |
16:55:59 | disruptek | first thing i would look at is the child count of the ast. |
16:56:01 | FromDiscord | <Clyybber> What I wonder though, why are we not getting "undeclared identifier "env" then? |
16:56:11 | disruptek | when? |
16:56:20 | FromDiscord | <Clyybber> When compiling the readme example |
16:56:53 | disruptek | it's a gensym. |
16:57:03 | disruptek | so it's a valid symbol, just not one with a type. |
16:57:30 | disruptek | what's happening is that we have a second env being generated but not output. |
16:57:45 | FromDiscord | <Clyybber> Yeah |
16:57:51 | disruptek | one has the proc params and the next has more of the env. |
16:57:58 | FromDiscord | <Clyybber> Ah ok! |
16:58:08 | FromDiscord | <Clyybber> But wait |
16:58:16 | FromDiscord | <Clyybber> We generate a typedef with the env symbol |
16:58:21 | FromDiscord | <Clyybber> then we don't put it in the result |
16:58:26 | FromDiscord | <Clyybber> but we still use the symbol |
16:58:34 | FromDiscord | <Clyybber> I guess the error is kinda appropriate then |
16:58:38 | disruptek | yeah. |
16:58:41 | FromDiscord | <Clyybber> I wonder if it could be better tho |
16:58:54 | disruptek | it could be more descriptive. |
16:58:58 | FromDiscord | <Clyybber> yeah |
16:59:25 | disruptek | i mean, it makes sense to me, but if a user gets it they are going to be pretty damned confused. |
16:59:57 | disruptek | this project has a lot to teach me about testing. |
17:03:02 | * | xet7 quit (Quit: Leaving) |
17:03:26 | FromDiscord | <ShalokShalom> Can somebody explain me, where I find the source code of the tutorials? |
17:03:27 | FromDiscord | <ShalokShalom> https://github.com/nim-lang/website/tree/master/jekyll |
17:06:23 | FromDiscord | <ShalokShalom> It seems to be not there. I run local find tools on the cloned source, it seems to be not there. |
17:06:38 | disruptek | maybe it's generated. |
17:07:10 | FromDiscord | <ShalokShalom> by? |
17:07:22 | FromDiscord | <ShalokShalom> Isnt all in Jekyll generated? |
17:07:34 | * | ehmry quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
17:07:46 | disruptek | how should i know? |
17:07:49 | disruptek | i don't even work here. |
17:07:56 | disruptek | ask that guy over there with the nametag. |
17:15:22 | * | maier joined #nim |
17:19:04 | * | lritter joined #nim |
17:20:46 | * | maier quit (Ping timeout: 260 seconds) |
17:27:03 | * | jken quit (Quit: ZNC - http://znc.in) |
17:28:54 | * | risorg23 joined #nim |
17:31:08 | FromDiscord | <Yardanico> @ShalokShalom you mean in learn? |
17:31:11 | FromDiscord | <Yardanico> It's all Nim doc |
17:33:02 | solitudesf | https://github.com/nim-lang/Nim/blob/devel/doc/tut1.rst |
17:33:56 | FromDiscord | <Yardanico> It's all RST?! 🔫 Always has been |
17:37:34 | FromDiscord | <ShalokShalom> @Solitudesf: thanks a lot |
17:37:54 | FromDiscord | <ShalokShalom> @Yardanico Yes, and its in a completely different repo. |
17:38:23 | FromDiscord | <Yardanico> ??? |
17:38:29 | FromDiscord | <Yardanico> It's in the main Nim repo |
17:38:51 | FromDiscord | <Yardanico> It's not a part of the website really, and it's generated with Nim docgen |
17:39:46 | FromDiscord | <ShalokShalom> It is totally part of the website. |
17:41:51 | FromDiscord | <Yardanico> I mean it's in reality standalone - you don't need any of website sources in the website repo to generate it |
17:42:16 | FromDiscord | <Yardanico> All module documentation, tutorials, manual - everything is docgen |
17:43:03 | * | Jesin quit (Quit: Leaving) |
17:43:55 | FromDiscord | <KingDarBoja> Yesss |
17:45:13 | FromDiscord | <『Bimbo』> I'm trying to write a simple game and i'd like to know how to represent something like a game tile in a matrix in types↵i.e the tile is either empty, a body part, or food in the case of a snake game |
17:45:59 | FromDiscord | <Yardanico> We have <#706542664643772436> just for your information ;) and for your case enums might just work? |
17:46:12 | FromDiscord | <『Bimbo』> oh right.. sorry about that |
17:46:29 | FromDiscord | <Yardanico> if you know the size of the matrix, use an array, and for values you can create an enum and use its values |
17:48:44 | FromDiscord | <『Bimbo』> I'll try it out, thanks! |
17:54:55 | * | Jesin joined #nim |
17:54:59 | * | marnix quit (Ping timeout: 240 seconds) |
18:03:24 | * | hyiltiz quit (Remote host closed the connection) |
18:04:26 | * | haxscramper joined #nim |
18:04:30 | * | hyiltiz joined #nim |
18:06:34 | FromDiscord | <lqdev> otherwise you can use a seq |
18:07:10 | FromDiscord | <lqdev> the most efficient way to store that would be just a flat `seq[Tile]`. then you index it using `tiles[x + y * width]` |
18:07:30 | haxscramper | Is heavy use of `mixin` a good idea? It is not used really often in main nim repo (quick `rg mixin` gives only 72 occuriencies) - are there some edge cases or scenarios where it should be avoided? |
18:08:02 | FromDiscord | <lqdev> haxscramper: it's more like, `mixin` was designed to battle edge cases that cause ordinary symbol resolution to fail. |
18:08:09 | FromDiscord | <lqdev> so you shouldn't really avoid it. |
18:08:35 | FromDiscord | <lqdev> it's used when you need to mix in a symbol from the callsite in a template or generic proc |
18:08:49 | FromDiscord | <lqdev> and that's really the only time you need to use it |
18:09:00 | haxscramper | Because lately I constantly find myself in situation where generic symbol resolution fails and I just started throwing `mixin` everywhere. |
18:09:12 | FromDiscord | <lqdev> it's fine |
18:09:25 | FromDiscord | <lqdev> use it whenever you need to access symbols from a template/generic proc's callsite |
18:19:35 | * | marnix joined #nim |
18:34:47 | reversem3 | So I'm playing around with fidget UI lib right now and came across an error loading a font |
18:35:13 | * | reversem3 sent a long message: < https://matrix.org/_matrix/media/r0/download/matrix.org/ztTXnPBNDrwzQwwsCHxbBeCW > |
18:36:51 | reversem3 | the function is loadFont found here https://github.com/treeform/fidget/tree/master/examples/padofcode/ |
18:37:06 | FromDiscord | <Yardanico> Make sure you're launching it from the correct path |
18:37:20 | FromDiscord | <Yardanico> I think it's relative to the binary |
18:37:32 | reversem3 | The font is in the root directory of the file |
18:37:37 | FromDiscord | <Yardanico> Or to the folder you compiled it from, don't remember now |
18:37:43 | FromDiscord | <Yardanico> @treeform ^ :P |
18:39:34 | reversem3 | if parser.nim works I should be able to import it via inim right |
18:39:44 | reversem3 | to test it ? |
18:41:54 | reversem3 | so basically the compiler is not finding the binary parser in .nimble/pkgs directory? |
18:43:37 | FromDiscord | <Yardanico> Wdym? |
18:45:55 | * | reversem3 sent a long message: < https://matrix.org/_matrix/media/r0/download/matrix.org/pRFExyTWnNFvPUQUcEaUWrre > |
18:46:28 | FromDiscord | <treeform> @reversem3[IRC], sorry the font needs to be in the `data` directory |
18:46:32 | reversem3 | pathofURL or dataDir right |
18:46:48 | FromDiscord | <treeform> the `data` directory is needed so many platforms require packaging of assets. |
18:47:13 | FromDiscord | <treeform> dataDir i think points to `data` |
18:47:22 | reversem3 | dataDir , just create a new directory and put the font in it ? |
18:47:25 | FromDiscord | <treeform> see how most of the examples do it |
18:47:40 | FromDiscord | <treeform> yeah just have data dir next to your nim file |
18:47:49 | reversem3 | oh , I thought that was just for organization , ok I see it |
18:47:54 | reversem3 | thanks |
18:58:13 | * | xet7 joined #nim |
18:59:15 | * | haxscramper quit (Ping timeout: 256 seconds) |
19:05:00 | ForumUpdaterBot | New thread by Snej: Avoiding RangeError getting address of empty seq, see https://forum.nim-lang.org/t/6575 |
19:07:11 | * | reversem3 sent a long message: < https://matrix.org/_matrix/media/r0/download/matrix.org/cnxQyMcwCElatBmMqemyFpOb > |
19:08:50 | reversem3 | so I have updated to the latest nim 1.24 and created a directory called data and put the *.ttf file inside the directory , the program compiles just fine but when I try to run it I get this error. I only get these errors from importing font files |
19:10:05 | disruptek | clyybber: tock.nim finally works. 😉 |
19:11:53 | reversem3 | this is weird though when I run a sample fidget program "objc[98577]: Class zmAppHelper is implemented in both /Library/ScriptingAdditions/zOLPluginInjection.osax/Contents/MacOS/zOLPluginInjection (0x11201a168) and /Library/Application Support/Microsoft/ZoomOutlookPlugin/zOutlookPlugin64.bundle/Contents/MacOS/zOutlookPlugin64 (0x11218bf78). One of the two will be used. Which one is undefined. |
19:11:53 | reversem3 | objc[98577]: class `ERCalendarEventEditorWindowController' not linked into application" |
19:16:12 | * | maier joined #nim |
19:18:59 | FromDiscord | <ShalokShalom> sent a long message, see http://ix.io/28fO |
19:19:58 | FromDiscord | <Yardanico> Not sure, documentation is good but sometimes too much documentation isn't that good |
19:20:08 | FromDiscord | <Yardanico> You might PR to the readme of the website repo of you feel so |
19:21:00 | reversem3 | ok so what does tables.nim in this line mean for getting a key? |
19:21:01 | * | reversem3 sent a long message: < https://matrix.org/_matrix/media/r0/download/matrix.org/RaYymbKsciHgFwigspxczIVT > |
19:21:39 | FromDiscord | <Yardanico> You shouldn't use that |
19:21:49 | * | maier quit (Ping timeout: 264 seconds) |
19:22:11 | FromDiscord | <Yardanico> You should only use exported symbols |
19:22:18 | reversem3 | I'm not directory that one of the errors I get trying to run a fidget app |
19:22:41 | reversem3 | * I'm not directly , that is one of the errors I get trying to run a fidget app |
19:22:57 | * | reversem3 sent a long message: < https://matrix.org/_matrix/media/r0/download/matrix.org/zYaeqLPbnyvLWgkjJhqrClLi > |
19:23:11 | reversem3 | ./.choosenim/toolchains/nim-1.2.4/lib/pure/collections/tables.nim(262) [] |
19:23:58 | * | Senketsu joined #nim |
19:24:09 | reversem3 | Instead of spamming the chan I will just write up issues , but I just wanted to make sure its wasn't me doing something wrong |
19:32:20 | FromDiscord | <Varriount> Hm, what's fidget? I vaguely recall something mentioning that. |
19:32:31 | FromDiscord | <lqdev> treeform's UI framework |
19:32:44 | FromDiscord | <treeform> my UI framework |
19:34:01 | FromDiscord | <treeform> I want to rethink how we programmer do UI stuff. I think there is a room for a paradigm shift. But it's not too crazy. Here is a video about it: https://www.youtube.com/watch?v=IB8Yt2dqZbo |
19:34:43 | reversem3 | its really cool , just getting some errors trying to run it |
19:35:06 | FromDiscord | <treeform> its also is really alpha |
19:35:12 | FromDiscord | <ShalokShalom> I love that also, just prefer open source stuff at the backend |
19:35:14 | reversem3 | even the code is easy to follow |
19:35:36 | reversem3 | I get it |
19:35:41 | FromDiscord | <lqdev> @ShalokShalom it is open-source at the backend, though |
19:36:08 | FromDiscord | <ShalokShalom> It relies on a closed source project |
19:36:14 | FromDiscord | <lqdev> it doesn't rely on it |
19:36:21 | FromDiscord | <lqdev> you can just as well use fidget without figma |
19:36:23 | FromDiscord | <ShalokShalom> Well, effectively it does |
19:36:35 | FromDiscord | <ShalokShalom> And then its no paradigm shift anymore |
19:36:39 | FromDiscord | <lqdev> figma is just an addition to make it easier to work with fidget |
19:36:52 | FromDiscord | <ShalokShalom> Its not "draw your own ui" anymore |
19:37:01 | FromDiscord | <ShalokShalom> And this is exactly what I am interested in |
19:37:18 | FromDiscord | <lqdev> noone prevents you from using fidget without figma, dude. |
19:37:26 | reversem3 | treeform are you using stable or devel version of nim c ? |
19:37:28 | reversem3 | I have tried both so far |
19:37:36 | FromGitter | <alehander92> his explanation is more subtle lqdev |
19:39:01 | FromDiscord | <ShalokShalom> > noone prevents you from using fidget without figma, dude.↵@lqdev That point can also be made about Nim and C. You can use C without Nim, while that is missing the point. |
19:39:18 | FromDiscord | <ShalokShalom> It is just a sneaky way to "win" the argument |
19:39:34 | FromDiscord | <Solitude> no, thats not the point |
19:39:48 | FromDiscord | <ShalokShalom> That kind of stuff is the reason why people dont take such attempts as serious as they deserve |
19:40:08 | FromDiscord | <ShalokShalom> Just say you hard depend on a non free software and be honest about it |
19:40:14 | reversem3 | @treeform do you want me to write up an issue or leave it because its alpha ? |
19:40:21 | FromDiscord | <lqdev> i get what you mean, figma is fidget's main selling point. but someone can write an open-source designer that emits fidget code |
19:40:24 | FromDiscord | <ShalokShalom> What the author of fidget is, in this case. |
19:40:31 | FromDiscord | <Solitude> but it LITERALLY doesnt hard depend on non free software |
19:40:31 | FromDiscord | <ShalokShalom> Sure |
19:40:44 | FromDiscord | <ShalokShalom> But until, it is effectively depending on it |
19:41:01 | FromDiscord | <lqdev> i'm fine writing my UIs by hand, without a designer |
19:41:02 | FromDiscord | <Solitude> you sure are master of research |
19:41:11 | * | Senketsu quit (Read error: Connection reset by peer) |
19:41:17 | FromDiscord | <lqdev> thus, fidget doesn't depend on figma. |
19:41:19 | FromDiscord | <ShalokShalom> Not really saying that it is not interesting, worth exploring and promising |
19:41:21 | FromGitter | <alehander92> just use TUI-s guys |
19:41:24 | FromGitter | <alehander92> like the good old 80s |
19:41:34 | FromDiscord | <ShalokShalom> Just that it not interesting to me, until it is. |
19:41:40 | * | Zectbumo joined #nim |
19:41:44 | * | bung joined #nim |
19:41:54 | reversem3 | yeah right , say that to normal users |
19:42:04 | FromDiscord | <ShalokShalom> > i'm fine writing my UIs by hand, without a designer↵@lqdev Yeah, I am also. |
19:42:16 | FromDiscord | <ShalokShalom> QML and tons of others already offer that |
19:42:28 | FromDiscord | <ShalokShalom> Where do you see the benefit of fidget there? |
19:42:28 | FromDiscord | <Varriount> @alehander42 What would be neat is a desktop TUI interface. |
19:42:42 | FromDiscord | <lqdev> @ShalokShalom it's a different paradigm |
19:42:44 | FromGitter | <alehander92> what does that mean |
19:42:59 | FromDiscord | <ShalokShalom> Yeah, is it declarative? |
19:43:02 | FromGitter | <alehander92> something like iterm? |
19:43:12 | FromGitter | <alehander92> iwm* |
19:43:17 | FromDiscord | <ShalokShalom> > yeah right , say that to normal users↵@reversem3[IRC]#0000 what do you mean? |
19:43:36 | reversem3 | <alehander92> just use TUI-s guys |
19:43:52 | FromDiscord | <lqdev> @ShalokShalom it's kind of like immediate mode UIs. you just write UIs using regular imperative code and not tonnes of objects |
19:44:03 | FromDiscord | <ShalokShalom> Thats nice |
19:44:05 | FromGitter | <alehander92> xmonad ? i really forgot the name of it |
19:44:19 | reversem3 | meaning regular users would not like a TUI , or CLI based |
19:44:29 | FromDiscord | <ShalokShalom> You can have both |
19:44:45 | reversem3 | true |
19:44:48 | FromDiscord | <ShalokShalom> KWin offers half a dozen of scripts to make it a tiling wm |
19:44:55 | Zevv | xmonad++ ! |
19:45:04 | reversem3 | swaywm |
19:45:27 | FromDiscord | <lqdev> i3. |
19:45:42 | reversem3 | I like swaywm because it runs on wayland |
19:45:59 | Zevv | Wow my xmonad.hs started in 2007, it's that old already |
19:45:59 | reversem3 | swaywm + qutebrowser + kitty term = FTW |
19:46:14 | FromDiscord | <lqdev> i don't like swaywm because it runs on wayland |
19:46:20 | FromDiscord | <lqdev> and wayland is quite young for now |
19:47:01 | superbia | ok boomer |
19:47:42 | FromDiscord | <lqdev> ok i'll admit i'm just too lazy to switch. |
19:48:29 | FromDiscord | <ShalokShalom> https://youtu.be/Obzf9ppODJU |
19:49:05 | FromDiscord | <ShalokShalom> > @ShalokShalom it's kind of like immediate mode UIs. you just write UIs using regular imperative code and not tonnes of objects↵@lqdev do you have any example code? |
19:49:35 | FromDiscord | <ShalokShalom> Like, how would a small rectangle with some text in and a button look like or so? |
19:51:40 | FromDiscord | <Solitude> https://github.com/treeform/fidget#minimal-sample |
19:51:46 | FromDiscord | <lqdev> there's plenty of example code in the repository https://github.com/treeform/fidget |
19:52:32 | FromDiscord | <ShalokShalom> https://media.discordapp.net/attachments/371759389889003532/735585082533871626/Screenshot_2020-07-22-21-52-23-41.jpg |
19:53:10 | FromDiscord | <ShalokShalom> I think that is a clear difference |
19:53:13 | FromDiscord | <ShalokShalom> https://media.discordapp.net/attachments/371759389889003532/735585260187680868/Screenshot_2020-07-22-21-52-50-33.jpg |
19:53:32 | FromDiscord | <Solitude> yes, and? |
19:53:37 | FromDiscord | <ShalokShalom> Thanks for the examples |
19:54:23 | FromDiscord | <ShalokShalom> @Solitude which one would you think could a 6 year old do on her own? |
19:55:02 | FromDiscord | <Solitude> none |
19:55:18 | FromDiscord | <ShalokShalom> I am pretty sure you know a couple |
19:55:22 | FromDiscord | <ShalokShalom> I at least do. |
19:55:31 | FromDiscord | <Solitude> i really hope our tools dont target 6 year olds |
19:55:39 | FromDiscord | <ShalokShalom> I actually know a 5 year old who could the first. |
19:55:51 | FromDiscord | <ShalokShalom> Well, if they can work for them, they work for you |
19:55:59 | FromDiscord | <Solitude> no, thats a shitty logic |
19:56:05 | FromDiscord | <ShalokShalom> And even more importantly: They work for UX designers |
19:56:06 | * | risorg23` joined #nim |
19:56:13 | FromDiscord | <ShalokShalom> Who are not even coders on their own. |
19:57:02 | FromDiscord | <juan_carlos> Code examples are doing different things, you can not compare it visually. |
19:57:16 | FromDiscord | <ShalokShalom> A shitty logic is to defend a more complex, less mature and less supported tool with the argument that those things are a benefit. |
19:57:30 | FromDiscord | <ShalokShalom> @juan_carlos Those two things do something very similar |
19:57:37 | FromDiscord | <ShalokShalom> I specifically asked for it |
19:57:40 | FromDiscord | <Solitude> im certain you are trolling at this point |
19:58:05 | FromDiscord | <ShalokShalom> And I know qml good enough to see the pattern and how similar projects would look like. |
19:58:15 | * | risorg23 quit (Ping timeout: 272 seconds) |
19:58:20 | FromDiscord | <ShalokShalom> @Solitude You are free to do so. |
19:58:32 | FromDiscord | <Yardanico> *grabs popcorn* |
19:58:42 | FromDiscord | <juan_carlos> But Nim has a QML module on Nimble. |
19:58:55 | FromDiscord | <ShalokShalom> I just think its not really benefit to be negative towards progress. |
19:59:00 | FromDiscord | <ShalokShalom> @juan_carlos I know. |
19:59:05 | FromDiscord | <ShalokShalom> Thats the point. |
19:59:36 | FromDiscord | <ShalokShalom> (edit) 'benefit' => 'beneficial' |
20:00:58 | FromDiscord | <treeform> @reversem3[IRC], I think use current stable mostly. |
20:01:09 | FromDiscord | <Yardanico> Sometimes "progress" just makes things more complex without any clear benefit |
20:04:57 | * | hyiltiz quit (Ping timeout: 260 seconds) |
20:05:19 | * | hyiltiz joined #nim |
20:05:20 | * | hyiltiz quit (Changing host) |
20:05:20 | * | hyiltiz joined #nim |
20:08:08 | Yardanico | I guess it's time to give ircord a little bit of love |
20:08:23 | Yardanico | fix this reply thing |
20:10:27 | * | NimBot joined #nim |
20:16:26 | Yardanico | I guess it would make sense for replies from discord to IRC to strip the "quote" part? |
20:16:31 | Yardanico | since there's no direct alternative to it in irc |
20:16:41 | disruptek | yeah. |
20:16:52 | Yardanico | btw disruptek be proud |
20:17:05 | Yardanico | I use your block: break block thing in ircord |
20:17:07 | Yardanico | although only once |
20:17:19 | Yardanico | when searching for mentions in the message when irc -> discord |
20:17:24 | disruptek | it's not mine, but okay. |
20:17:33 | Yardanico | well I really didn't see anyone else use it :P |
20:17:36 | Yardanico | as much as you did |
20:17:50 | disruptek | they probably have a better solution. |
20:21:29 | * | marnix quit (Ping timeout: 258 seconds) |
20:26:25 | FromDiscord | <lqdev> Yardanico: I used to use block: break quite often when implementing algorithms |
20:26:44 | Yardanico | ah nice |
20:27:18 | Yardanico | also guess I'll be using regex for this reply thing (i'm already using nim-regex in ircord), because it will be more complicated to replace with npeg or strscans |
20:31:25 | * | Senketsu joined #nim |
20:31:58 | Yardanico | first version - >*[\s\w]@([\w]*)\[([\w]*)]#0000 :D |
20:32:37 | Yardanico | ah sorry >?[\s\w]*@([\w]*)\[([\w]*)]#0000 |
20:39:57 | FromDiscord | <ShalokShalom> > Sometimes "progress" just makes things more complex without any clear benefit↵@Yardanico do you see it in this case or do you see that the current way is more complex? |
20:41:27 | * | superbia quit (Quit: WeeChat 2.9) |
20:42:30 | Yardanico | I meant that Fidget tries to not be very complex, it tries to make UI programming straightforward |
20:46:33 | FromDiscord | <ShalokShalom> But do you see it succeeding, in the example? |
20:47:09 | FromDiscord | <lqdev> I feel like the fidget example is much more straightforward |
20:47:18 | FromDiscord | <lqdev> it doesn't hide any complexity, unlike QML's Rectangle |
20:47:32 | FromDiscord | <lqdev> what does the Rectangle do? does it change layout? how is it really rendered? |
20:47:48 | FromDiscord | <lqdev> with fidget, you just see all of that straight away |
20:49:22 | * | narimiran quit (Ping timeout: 260 seconds) |
20:52:35 | FromDiscord | <ShalokShalom> QML renders, as it says |
20:53:43 | FromDiscord | <ShalokShalom> You just try to win a lost case. |
20:54:17 | FromDiscord | <lqdev> and you're fixated on one specific paradigm that is more complex than it needs to be |
20:54:36 | FromDiscord | <lqdev> programming is all about exploration |
20:54:52 | FromDiscord | <juan_carlos> Its just the way Fidget rolls. |
20:54:52 | FromDiscord | <lqdev> going by your mentality, we'd still be stuck on COBOL in 2020. |
20:55:21 | FromDiscord | <ShalokShalom> This is UI code |
20:55:26 | FromDiscord | <lqdev> *maybe* fidget isn't gonna work. but time will tell if that's true. |
20:55:30 | FromDiscord | <ShalokShalom> Cobol is logic |
20:55:49 | * | clemens3 quit (Quit: rebot) |
20:55:53 | * | apahl quit (Ping timeout: 272 seconds) |
20:55:56 | FromDiscord | <ShalokShalom> Ui code tends to get written by UI designers |
20:56:05 | FromDiscord | <ShalokShalom> So people without a background in CS |
20:56:18 | FromDiscord | <ShalokShalom> They go into a bar and order two beer |
20:56:29 | FromDiscord | <ShalokShalom> They dont give exact instructions to the barkeeper |
20:56:40 | FromDiscord | <treeform> well the fidget example sets up way more then just a rectangle |
20:56:49 | FromDiscord | <treeform> it sets up a window, a frame and 5 other rectangles |
20:56:53 | FromDiscord | <ShalokShalom> Casual people think in declarative terms |
20:56:56 | FromDiscord | <treeform> its not a 1:1 example |
20:57:16 | * | apahl joined #nim |
20:57:17 | FromDiscord | <ShalokShalom> @treeform I asked for a rectangle with a button |
20:57:18 | disruptek | sure, and prolog is a casual language. |
20:57:23 | FromDiscord | <ShalokShalom> This is what I got. |
20:57:48 | FromDiscord | <treeform> No that is not a rectangle with a button |
20:57:52 | FromDiscord | <ShalokShalom> @disruptek[IRC]#0000 Just because something is declarative, doesn't mean its good, usable or anything |
20:58:08 | FromDiscord | <ShalokShalom> @treeform You see the benefit of the qml example? |
20:58:08 | disruptek | who said anything about that? |
20:58:12 | * | nikita` quit (Quit: leaving) |
20:58:15 | FromDiscord | <ShalokShalom> The clarity. |
20:58:28 | Yardanico | !seen zevv |
20:58:28 | disbot | Zevv spoke in 12#nim 72 minutes ago 12https://irclogs.nim-lang.org/22-07-2020.html#19:45:59 |
20:58:52 | FromDiscord | <treeform> @ShalokShalom yes QT example is pretty simple fidget one would look pretty much same? |
20:58:54 | Yardanico | Zevv: sorry if you're busy - is there a way to make NPeg match everything but "<@" multiple times? |
20:59:14 | FromDiscord | <ShalokShalom> @disruptek[IRC]#0000 Because you made the point that Prolog is declarative and set this as an argument that it is "not casual." |
20:59:15 | Yardanico | basically I want to parse "> any text\n <@!1293192312>" |
20:59:30 | Yardanico | ah hm even then it's a bit not correct |
20:59:32 | FromDiscord | <ShalokShalom> @treeform Would like to see that one |
20:59:43 | Yardanico | hrm |
20:59:57 | disruptek | well, i'm done here. |
21:00:02 | FromDiscord | <lqdev> Yardanico: `1 - "<@"`? |
21:00:11 | FromDiscord | <lqdev> that matches one |
21:00:12 | Yardanico | from "> 1234 any text <@!192491294> <@!177365113899057152>" I want to get that ID inside |
21:00:14 | Yardanico | the last one only |
21:00:23 | FromDiscord | <lqdev> more than that would be `*(1 - "<@")` |
21:00:24 | Yardanico | there might be multiple mentions inside of the reply |
21:01:56 | Yardanico | @lqdev ah right forgot about 1 thing |
21:02:06 | Yardanico | and didn't know you can use "-" with strins as well :P |
21:02:10 | Yardanico | I only thought it's for single chars |
21:02:50 | FromDiscord | <lqdev> from the readme: `P1 - P2` matches P1 if P2 does not match |
21:03:41 | Yardanico | ah maybe I can rework how it works, hm |
21:04:27 | Zevv | Yardanico: yes |
21:05:12 | Yardanico | so is it somehow possible to match a thing like "> something <@!177365113899057151> <@!177365113899057152>" (there can be as much of these <@! things) but I only want the number of the last one? |
21:05:14 | Zevv | *(1-"<@") |
21:05:35 | Yardanico | yeah that works for my previous question |
21:09:06 | Yardanico | ah I think I made it work kinda |
21:09:58 | Yardanico | not sure if it's the best but it works |
21:10:01 | Yardanico | "> " * *(*(1 - "<@") * "<@" * ?"!" * >(+Digit) * ">") |
21:10:03 | Yardanico | xd |
21:10:19 | Yardanico | and then I just get capture[^1].s |
21:17:07 | * | maier joined #nim |
21:17:45 | * | arecacea1 quit (Read error: Connection reset by peer) |
21:18:17 | * | arecacea1 joined #nim |
21:20:13 | FromDiscord | <exelotl> @lqdev oh thx that's good to know |
21:21:44 | * | maier quit (Ping timeout: 240 seconds) |
21:23:29 | Zevv | sorry, tonight was battlefield night, nit nim night |
21:23:34 | Zevv | still need a hand Yardanico > |
21:23:35 | Zevv | ? |
21:23:41 | Yardanico | nah I think I figured it out |
21:23:47 | Yardanico | idk if it's the best way, but seems to work |
21:23:51 | Yardanico | even for rare edge cases |
21:23:52 | Zevv | perfect timing : |
21:24:11 | Zevv | what are you parsing? |
21:24:21 | Yardanico | discord replies |
21:24:27 | Yardanico | discord -> discord and discord -> irc replies |
21:24:29 | Yardanico | to strip the quote part |
21:24:32 | Zevv | ah right |
21:24:36 | Yardanico | and [IRC]#0000 |
21:24:48 | Zevv | oh right I also use npeg for ircgraph :) |
21:24:52 | Yardanico | https://i.imgur.com/Z9U2xB0.png |
21:25:04 | Yardanico | discordReply is |
21:25:04 | FromDiscord | <Varriount> Beautiful. |
21:25:06 | Yardanico | "> " * +(*(1 - "<@") * "<@" * ?"!" * >(+Digit) * ">") * ?("[" * serviceName * "]#0000") |
21:25:14 | Yardanico | maybe it's not the best but it works :P |
21:25:21 | Yardanico | even for the rare case when the user is both on irc + discord |
21:25:29 | Zevv | you are very talkative today: http://zevv.nl/div/irc.png |
21:25:30 | Yardanico | so discord replaces the username with special discord id stuff |
21:25:36 | FromDiscord | <treeform> @ShalokShalom I think they look nearly identical: |
21:25:37 | Yardanico | Zevv: haha |
21:25:38 | FromDiscord | <treeform> https://media.discordapp.net/attachments/371759389889003532/735608513006534716/unknown.png |
21:25:45 | FromDiscord | <Varriount> Yardanico: If you use variable interpolation & verbose mode regexes, they are much moree readable. |
21:25:57 | Yardanico | I mean it's not that it's not readable |
21:26:01 | Yardanico | It's pretty understandable for me now |
21:26:44 | Zevv | building pegs feels like writing forth to me |
21:27:12 | Yardanico | match "> ", match one or more of ((anything but "<@"), match "<@", optionally match "!" match and capture one or more digits, match ">"), optionally match "[" serviceName "]#0000" |
21:27:24 | Zevv | you're typically accumulating a growing box of blocks that do small things, put them together into something larger. And two days after you written it, you have *no* clue what the hell you were thinking |
21:27:29 | Yardanico | XD |
21:27:35 | Yardanico | same as writing perl? :D |
21:27:48 | Zevv | nah, has a different feel to it |
21:27:57 | Zevv | perl is more like, I donno, noodles |
21:28:06 | Zevv | and pegs and forth is like self contained thingies |
21:28:18 | Yardanico | maybe I should fully switch to npeg, right now I (sorry) use nim-regex for some stuff |
21:28:21 | FromDiscord | <Elegant Beef> @treeform Yea, i agree they're very close, could get it 1:1 with a few aliases here and there 😄 |
21:28:39 | Zevv | Yardanico: when you have npeg, everything looks like a nail |
21:28:44 | Yardanico | XD |
21:28:57 | Yardanico | but ircord is still pure nim :P it's not so performance critical |
21:28:58 | Zevv | it might be turing complete, so you will never need something else in your life |
21:29:05 | FromDiscord | <Varriount> Yardanico, Zevv: Behold, https://gist.github.com/Varriount/c74b32d19aaa484cacb2578d0d512658 |
21:29:13 | Yardanico | maybe I should look into patt |
21:29:15 | Yardanico | of npeg |
21:29:24 | Yardanico | the problem is that there's no simple way to "find and replace" with npeg |
21:29:37 | Yardanico | which I do right now for finding discord username mentions in irc |
21:29:44 | Zevv | Varriount: I think it's about as readable as npeg |
21:29:47 | Yardanico | ah sorry no I don't do that |
21:29:50 | Zevv | /unreadable/ |
21:30:00 | Zevv | Yardanico: nope, true |
21:30:11 | Yardanico | I mean I don't do it anyway :P |
21:30:18 | Yardanico | I think I can switch to patt in one place |
21:30:29 | Yardanico | not sure about color stripping thing - I could set a no color mode for me via the channel mode |
21:30:41 | Yardanico | but it's async so I don't have reliable way of telling when to send the command |
21:30:43 | Yardanico | ah wait actually |
21:30:51 | Yardanico | maybe I can finally use the magic "once" template from system |
21:30:57 | Yardanico | (magic is sarcasm) |
21:31:07 | Zevv | I once tried once |
21:31:10 | Zevv | but it ran twice |
21:31:12 | Zevv | because of threads |
21:31:14 | Yardanico | lol |
21:31:14 | Zevv | it lied |
21:31:18 | Yardanico | well I have async |
21:31:22 | Yardanico | no need to worry about threads |
21:31:37 | Yardanico | I really feel dirty for using both nim-regex and npeg at the same time |
21:31:54 | Yardanico | in the same program |
21:31:57 | * | Vladar quit (Quit: Leaving) |
21:32:00 | FromDiscord | <Varriount> Zevv: I am using Python + Nimterop to process a boatload of C headers, and wanted a DSL for the various transformations/directives. |
21:32:05 | Zevv | who cares. I do nim and C and asm and JS in one program |
21:32:21 | Zevv | varriount: it's horrendous |
21:32:25 | Zevv | and you know it |
21:32:27 | FromDiscord | <Varriount> I'm not using Nim because the os module's subprocess functionality makes me sad. |
21:32:40 | Zevv | you're not alone |
21:32:50 | Zevv | the problem is, to make that work properly, it needs to work with async |
21:33:01 | Zevv | cheatfate solved this |
21:33:05 | FromDiscord | <Varriount> Zevv: It is, but it took only slightly less time to write than an actual parser. |
21:33:09 | FromDiscord | <Varriount> 😛 |
21:33:23 | Zevv | it's so bad that even the nim compiler can hang itself because of pipes filling up |
21:33:48 | Zevv | if you have nim code that generates tons of errors from the C compiler, 'nim c' will stall and break |
21:33:52 | FromDiscord | <Varriount> Zevv: To be fair, cross-platform subprocess interop is complicated. |
21:34:00 | Zevv | because it's waiting for the compile to finish, but it can't finish because it filled the pipe |
21:34:12 | FromDiscord | <Varriount> Like, if you ever look at Python's subprocess module, it's horrific. |
21:34:14 | Yardanico | this is npegTrace of my current parser https://i.imgur.com/mLr9xiI.png |
21:34:24 | Zevv | Varriount: Yeah, i've heard about that. Cross platform. I should look that up one day |
21:34:31 | Zevv | Yardanico: sweet |
21:34:52 | Zevv | this really is the apex of my career. The npeg graphs |
21:35:23 | Yardanico | actually I can put that [ serviceName #0000 into a separate pattern |
21:35:30 | FromDiscord | <Elegant Beef> I have 0 clue what im looking at but it's cool 😄 |
21:35:32 | FromDiscord | <nero> those are some nice diagrams, is this generated by npeg? have to steal them |
21:35:46 | Zevv | nero: yes |
21:35:53 | Yardanico | -d:npegGraph |
21:36:08 | Yardanico | ok now the patterns don't look that scary |
21:36:11 | Yardanico | "> " * +(*(1 - "<@") * "<@" * ?"!" * >(+Digit) * ">") * ?ircPostfix |
21:36:22 | FromDiscord | <nero> nice, started working on a ebnf to svg program but this looks way nicer |
21:36:27 | Zevv | what is so funny about these graphs: the code that composes the graph is almost similar to the code that composes the parser IR |
21:36:35 | FromDiscord | <Varriount> Zevv: https://github.com/python/cpython/blob/3.8/Lib/subprocess.py |
21:36:56 | Zevv | Varriount: I'm not surprised by the amount of code |
21:37:12 | Zevv | it's just too bad that Nim still has nothing similar |
21:37:53 | Zevv | a good stdlib is *so* much work. I'm very impressed by the cohesion and structure of the golang stdlib. it's super tight |
21:38:02 | * | mbuchel quit (Quit: WeeChat 2.8) |
21:38:04 | FromDiscord | <Varriount> Zevv: Also, I gave up working with the os module when writing commandant, and just wrote my own wrapper: https://github.com/Varriount/commandant/blob/master/commandant/subprocess.nim#L162 |
21:38:20 | FromDiscord | <Varriount> Zevv: It really is. |
21:38:23 | Zevv | makes sense, I made a few of those |
21:38:42 | FromDiscord | <Varriount> I think I translated that implementation from some C code I found somewhere |
21:38:55 | FromDiscord | <Varriount> Well, and cleaned it up with templates and such |
21:39:19 | Zevv | it's basically the default way to do it. But really, to make this work nicely you need integrating with your stdlib native async I/O |
21:39:36 | Zevv | you want to be able to chain pipes, read a pipe without it filling up, etc |
21:39:45 | Zevv | have processes that run forever while consuming output |
21:40:46 | FromDiscord | <Varriount> Zevv: I've heard that D's subprocess module is really nice to work with: https://dlang.org/phobos/std_process.html |
21:43:09 | Yardanico | ah also Zevv, wanted to ask - I'm probably missing it from the readme, but what's the way to for example match Alnum + "_" ? |
21:43:12 | Yardanico | ordered choice? |
21:43:37 | Zevv | yes |
21:43:43 | FromDiscord | <Varriount> `Alnum | "_"` |
21:43:43 | Yardanico | yeah figured it out thanks |
21:43:45 | FromDiscord | <Varriount> ? |
21:43:47 | Zevv | it's smart enough to figure out you're orring to charsets |
21:43:56 | Zevv | so it will just make a charset with Alnum and an extra bit set for '_' |
21:45:02 | Yardanico | hm, so I'm trying to port that simple regex (@[[:word:]]+) |
21:45:07 | Yardanico | but let p = patt @("@" * +(Alnum | '_')) doesn't seem to work |
21:45:12 | Zevv | what does that mean? |
21:45:13 | Yardanico | I just need to find all "@mention" in a string |
21:45:21 | Yardanico | ah forgot to capture |
21:45:23 | Yardanico | dammit |
21:45:32 | Yardanico | let p = patt @>("@" * +(Alnum | '_')) works |
21:45:35 | Yardanico | XD |
21:45:42 | Zevv | right |
21:46:05 | Yardanico | ah hmm but it doesn't seem to capture all |
21:46:49 | Zevv | it does |
21:47:08 | Yardanico | echo p.match("@Yardanico hi @Yardanico hi").captures only shows one @Yardanico |
21:47:17 | Zevv | ah |
21:47:30 | Zevv | you're only searching for one |
21:47:34 | Yardanico | oh right |
21:47:40 | Zevv | * or + it |
21:47:43 | Zevv | the whole thing |
21:47:50 | Zevv | let p = patt +@>("@" * +(Alnum | '_')) |
21:47:51 | Yardanico | let p = patt *@>("@" * +(Alnum | '_')) |
21:47:57 | Yardanico | yeah thanks :P |
21:48:01 | Yardanico | I need zero or more |
21:48:05 | Zevv | but really, you're writing unreadable stuff |
21:48:08 | Yardanico | wdym :D |
21:48:19 | Yardanico | strscans doesn't work for this case really, it can't search |
21:49:32 | Zevv | http://ix.io/28Wh |
21:50:12 | Zevv | without the errors, it's about the idea of naming your stuff :) |
21:50:26 | Yardanico | wait what does the @"*" do here? |
21:50:31 | Zevv | no it's wrong |
21:50:35 | Yardanico | ah ok |
21:50:37 | Zevv | I didn't evne run it |
21:50:40 | Yardanico | its okay |
21:50:49 | Zevv | n it's wrong |
21:50:56 | Zevv | now it's ok: http://ix.io/28WB |
21:51:11 | Zevv | anyway, pick your poison |
21:52:04 | Yardanico | time to test |
21:52:11 | Zevv | time to sleep |
21:52:21 | Yardanico | good night |
21:52:22 | FromDiscord | <ShalokShalom> @treeform thats cute |
21:52:27 | Yardanico | its 00:52 here but I only recently woke up |
21:52:34 | Zevv | you're a bad man |
21:53:04 | Yardanico | bed man* |
21:53:19 | Zevv | and your jokes are bad |
21:53:23 | Yardanico | i know |
21:53:25 | Yardanico | :( |
21:53:26 | * | Cthalupa- quit (Ping timeout: 256 seconds) |
21:53:28 | * | Zevv waves goodby |
21:53:51 | Yardanico | wait it's all npeg? 🔫 always has been |
21:55:29 | * | Cthalupa joined #nim |
21:55:32 | FromDiscord | <Varriount> Anyone know what a '.in' file is? It appears to be used in the context of the C compiler (I suspect the linker) |
21:56:12 | Zevv | it's autoconf stuff |
21:56:16 | Zevv | Makefile.in, configure.in |
21:56:25 | Zevv | it goes through automake and autoconf |
22:07:23 | Yardanico | hmm I'm thinking on how to replace regex for stripping colour codes |
22:07:35 | Yardanico | I forgot /mode #channel +c is only for channel OPs and is set globally for the channel |
22:07:41 | * | Jesin quit (Quit: Leaving) |
22:08:12 | Yardanico | there seems to be no way to tell freenode to not send colors to oneself specifically :P |
22:09:16 | Yardanico | disruptek: you lied to me :P |
22:09:33 | Yardanico | I remember you saying that thing about /mode #channel +c but I thought it works for the bot |
22:09:47 | disruptek | it's likely i lied, but not about that. |
22:09:56 | Yardanico | well how do you strip irc colors? |
22:10:08 | Yardanico | in #nim for example |
22:10:18 | disruptek | i personally enjoy color. |
22:10:53 | Yardanico | ~stream |
22:11:00 | Yardanico | seems like you don't handle them at all :P |
22:11:02 | Yardanico | ~stream |
22:11:02 | disbot | stream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat) |
22:11:05 | * | solitudesf quit (Ping timeout: 240 seconds) |
22:11:06 | Yardanico | ~stream |
22:11:09 | Yardanico | XDD |
22:11:22 | disruptek | why would i strip them? |
22:11:23 | FromDiscord | <Avatarfighter> disruptek is live!? |
22:11:26 | Yardanico | no |
22:11:35 | Yardanico | he wasn't live for a few months now I think |
22:11:46 | FromDiscord | <Avatarfighter> absolute scam http://prnt.sc/tmv3bg |
22:12:03 | Yardanico | maybe I should stream instead |
22:12:08 | Yardanico | as a substitute for disruptek |
22:12:12 | Yardanico | /s |
22:12:33 | FromDiscord | <Avatarfighter> lowkey I'm tempted to stream, I'm sure people would enjoy me rewriting everything 12 times in the span of an hour |
22:12:46 | Yardanico | i streamed a bit of nim |
22:12:57 | FromDiscord | <Avatarfighter> or spending a day trying to use the endian lib only to ask in irc how it works lmfao |
22:13:04 | disruptek | you guys don't watch me when i stream, anyway. |
22:13:10 | Yardanico | i do |
22:13:15 | FromDiscord | <Avatarfighter> i do too |
22:13:20 | FromDiscord | <Avatarfighter> you're just never live when I do watch |
22:13:22 | Yardanico | I have freaking 30k points in your chat |
22:13:25 | Yardanico | 30 THOUSAND |
22:13:33 | FromDiscord | <Avatarfighter> Mega fan |
22:13:39 | Yardanico | I have less points in forsen's chat |
22:14:03 | Yardanico | 30000 / (12 * 50) |
22:14:03 | FromDiscord | <Avatarfighter> lmao |
22:14:04 | disruptek | weird, i thought it was only cool people that watched. |
22:14:07 | FromDiscord | <Avatarfighter> Nim > Forsen |
22:14:09 | Yardanico | meaning I watched at least 50 hours of disruptek's stream |
22:14:22 | Yardanico | of course I wasn't always active but still had his stream open |
22:14:53 | disruptek | well, those days are over. i'm in the wilderness now. |
22:15:23 | FromDiscord | <Avatarfighter> stream the wilderness |
22:15:34 | FromDiscord | <Avatarfighter> overlay nim on the wilderness while streaming |
22:15:58 | disruptek | i have very, very little bandwidth here. |
22:16:42 | disruptek | maybe i'll give it a shot tomorrow. might be able to juice up my network a bit. |
22:18:39 | * | apahl quit (Ping timeout: 244 seconds) |
22:19:29 | * | apahl joined #nim |
22:20:15 | * | Senketsu quit (Read error: Connection reset by peer) |
22:29:53 | * | Jesin joined #nim |
23:11:30 | * | krux02_ joined #nim |
23:15:26 | * | krux02 quit (Ping timeout: 260 seconds) |
23:18:02 | * | maier joined #nim |
23:23:22 | * | maier quit (Ping timeout: 256 seconds) |
23:29:26 | * | fredrikhr quit (Ping timeout: 260 seconds) |
23:35:39 | Yardanico | argh |
23:35:50 | Yardanico | guess I just need to write an irc -> markdown converter at this point |
23:45:20 | * | krux02_ quit (Remote host closed the connection) |