00:07:47 | FromDiscord | <Quibono> If you had like a dozen-100 websockets you wanted to listen to, would a loop be able to handle that okay or would you need something fancier like threads? |
00:08:52 | disruptek | well, you can't use ioselectors on more than 64 handles, but you could chunk them. |
00:09:06 | FromDiscord | <cabboose> Heya; does anyone know with @treeforms fidget package, are you able to define components which you can just create instances of? This is my first time using figma so a lack of documentation is hamstringing my progress |
00:09:19 | disruptek | !requires fidget |
00:09:20 | disbot | fidget: 11treeform[roffy,3nim_emscripten_tutorial,3fidget], 11juancarlospaco/3fision, 11Knaque/3spinner, 11MnlPhlp/3TicTacToe 76 total |
00:09:46 | FromDiscord | <Quibono> Disruptek so by default I can only have 64 open websockets? |
00:09:56 | * | Jesin quit (Ping timeout: 240 seconds) |
00:10:07 | disruptek | you can only select on 64 handles at once. |
00:10:28 | disruptek | read the module documentation. |
00:10:46 | disruptek | i'm not saying it cannot be done, i'm saying you'll need another layer of indirection. |
00:11:39 | disruptek | or, use cps. |
00:11:41 | disruptek | !repo cps |
00:11:41 | disbot | https://github.com/disruptek/cps -- 9cps: 11Continuation-Passing Style for Nim 🔗 15 40⭐ 2🍴 |
00:12:01 | disruptek | read the paper. i think they have like 10,000 clients. something like that. |
00:12:48 | FromDiscord | <treeform> @cabboose fidget is still in heavy development |
00:12:53 | FromDiscord | <treeform> I do want to based it components |
00:13:37 | FromDiscord | <cabboose> so for the moment I'll carry on without that feature; I'm fine with that. |
00:15:01 | FromDiscord | <dom96> > you can only select on 64 handles at once. |
00:15:02 | * | luis1 quit (Ping timeout: 260 seconds) |
00:15:05 | FromDiscord | <dom96> Where in the docs does it say this? |
00:15:27 | * | luis1 joined #nim |
00:21:49 | FromDiscord | <dom96> @Quibono to answer your question, you should be able to handle that easily with async/await. |
00:22:33 | disruptek | yeah, async/await is always a good choice. |
00:22:41 | FromDiscord | <cabboose> can macros and templates be nested inside of each other? Using templates for fidget to mimic component logic is what I'm aiming for, but I understand that fidget uses templates and macros heavily |
00:22:46 | disruptek | yes. |
00:22:50 | FromDiscord | <cabboose> sik |
00:23:58 | FromDiscord | <dom96> For IO it's just about the only choice |
00:24:08 | disruptek | don't get me started. |
00:24:09 | mipri | select() is the most limited selector, only going up to FD_SETSIZE (1024). If anyone ever used poll after epoll, larger numbers of fds would be supported but annoying as you'd have to scan the entire array on each event. epoll reorders the array so you only have to scan an eventing subarray |
00:24:27 | FromDiscord | <martinium> anyone know how to get rid of the too many open files error on linux? |
00:24:32 | mipri | the selectors default on Linux is epoll. |
00:24:47 | disruptek | i think it might have more to do with setData but i don't remember the details. |
00:25:09 | disruptek | the point is, you cannot naively assume that you can add an unlimited number of handles to the event. |
00:25:51 | FromDiscord | <dom96> of course, there are limits to everything, but definitely not 64 |
00:25:53 | mipri | you can't assume that anyway since RAM isn't infinite. if you're doing proper networking you've got to pay for at least separate send/recv buffers for each connection |
00:26:29 | disruptek | thanks for reminding me about infinite ram and how hard it is to come by. |
00:26:29 | FromDiscord | <dom96> also, the underlying implementation for cps isn't going to be any different, it'll use epoll/kqueue too |
00:26:33 | FromDiscord | <ElegantBeef> In the current develop branch of Nim where would one put this? 😄 https://play.nim-lang.org/#ix=2GVE |
00:26:50 | disruptek | right, but cps can thread the listeners automatically. |
00:28:44 | mipri | ElegantBeef: lib/system/setops.nim probably |
00:29:31 | FromDiscord | <dom96> @martinium open less fds or set the limits higher, hard to say as it's not clear what is causing it for you |
00:30:47 | disruptek | hmm, i can't find this in my notes, but i think the limit i ran into was 64. |
00:30:58 | disruptek | anyway, if it works for you, great. enjoy. |
00:45:36 | * | Cthalupa quit (Ping timeout: 240 seconds) |
00:47:31 | * | Cthalupa joined #nim |
00:48:24 | * | Kaivo quit (Quit: WeeChat 2.9) |
01:03:16 | * | luis1 quit (Ping timeout: 240 seconds) |
01:05:31 | * | luis1 joined #nim |
01:10:00 | * | a_chou joined #nim |
01:10:52 | * | Tanger joined #nim |
01:11:26 | * | luis1 quit (Ping timeout: 264 seconds) |
01:29:16 | FromDiscord | <shadow.> can the builtin set[] be used for integers |
01:29:20 | FromDiscord | <shadow.> im getting a `set too large` error |
01:30:13 | FromDiscord | <ElegantBeef> they have to be <= 16bit ordinals |
01:30:17 | FromDiscord | <shadow.> ohh ok i see |
01:30:19 | FromDiscord | <shadow.> hmm should work |
01:30:26 | FromDiscord | <ElegantBeef> so you have to do `{10u8}` |
01:30:34 | FromDiscord | <ElegantBeef> Or w/e your int size is |
01:30:59 | FromDiscord | <shadow.> ah ye i see |
01:31:04 | FromDiscord | <shadow.> hm |
01:31:13 | FromDiscord | <shadow.> if you check if a number under 0 is in it with `in` it raises an error? |
01:32:12 | FromDiscord | <shadow.> nvm whatever it worked fine with hashsets no reason to mess w it |
01:32:17 | * | luis1 joined #nim |
01:32:34 | FromDiscord | <Quibono> Is it faster to see if a string contains a substring, or convert the string to json and then read the value of a key? |
01:33:04 | FromDiscord | <ElegantBeef> Converting to json i think will be certainly vastly slower |
01:33:25 | FromDiscord | <ElegantBeef> @shadow. you want an `10i8` if you want negatives |
01:34:49 | FromDiscord | <shadow.> ohh ok |
01:35:05 | FromDiscord | <ElegantBeef> Depends on your range though |
01:35:19 | * | abm quit (Read error: Connection reset by peer) |
01:35:28 | FromDiscord | <ElegantBeef> you can use int16s or uint16s |
01:36:36 | FromDiscord | <shadow.> fair enough thanks |
01:52:11 | * | luis1 quit (Ping timeout: 246 seconds) |
02:03:01 | * | luis1 joined #nim |
02:08:17 | * | Jesin joined #nim |
02:10:49 | * | luis1 quit (Ping timeout: 272 seconds) |
02:11:16 | * | luis1 joined #nim |
02:12:59 | FromDiscord | <Quibono> This still the compiler? |
02:17:35 | FromDiscord | <Rika> no this is wendys |
02:24:39 | FromDiscord | <Quibono> Can I have a frosty and a chili? |
02:27:46 | * | mbomba joined #nim |
02:29:54 | * | a_chou quit (Quit: a_chou) |
02:34:20 | FromDiscord | <ElegantBeef> How do you run runnable examples? |
02:34:28 | FromDiscord | <ElegantBeef> I've never needed this knowledge before 😄 |
02:36:17 | FromDiscord | <Rika> create the docs |
02:36:19 | FromDiscord | <Rika> afaik |
02:36:21 | FromDiscord | <ElegantBeef> Yea |
02:40:02 | FromDiscord | <shadow.> hmm |
02:40:15 | FromDiscord | <shadow.> does `packedsets` no longer exist? |
02:42:03 | * | mbomba1 joined #nim |
02:43:45 | * | mbomba quit (Ping timeout: 240 seconds) |
02:44:46 | FromDiscord | <shadow.> welp `intsets` works fine for this but still lol |
02:57:48 | FromDiscord | <ElegantBeef> What do you want? |
03:02:01 | * | rockcavera quit (Remote host closed the connection) |
03:21:03 | FromDiscord | <Avatarfighter> they wanted `packedsets` |
03:21:11 | FromDiscord | <Avatarfighter> but now they've found `intsets` |
03:21:35 | FromDiscord | <Rika> yeah but further context is needed |
03:21:39 | FromDiscord | <Avatarfighter> lmao |
03:21:47 | FromDiscord | <Avatarfighter> im trying my hardest 😭 |
03:22:50 | FromDiscord | <Rika> try harder wimp |
03:22:59 | disruptek | tough crowd. |
03:34:07 | * | vesper11 quit (Quit: ZNC 1.7.5 - https://znc.in) |
03:35:29 | * | vesper11 joined #nim |
03:39:09 | * | bozaloshtsh quit (Quit: ZNC 1.7.5 - https://znc.in) |
03:39:17 | * | bozaloshtsh joined #nim |
03:39:17 | * | bozaloshtsh quit (Changing host) |
03:39:17 | * | bozaloshtsh joined #nim |
03:44:32 | * | rockcavera joined #nim |
03:45:30 | * | vicfred quit (Quit: Leaving) |
03:55:14 | * | mbomba1 quit (Quit: WeeChat 3.0) |
03:55:44 | * | mbomba joined #nim |
04:06:01 | * | supakeen quit (Quit: WeeChat 2.9) |
04:06:33 | * | supakeen joined #nim |
04:13:05 | * | spiderstew quit (Ping timeout: 240 seconds) |
04:14:11 | * | spiderstew joined #nim |
04:30:33 | * | lritter quit (Ping timeout: 260 seconds) |
04:30:55 | * | lritter joined #nim |
04:36:55 | * | vesper joined #nim |
04:37:25 | * | vesper11 quit (Ping timeout: 264 seconds) |
04:43:21 | * | narimiran joined #nim |
04:49:35 | FromDiscord | <Xvip> m |
04:49:36 | FromDiscord | <Xvip> m |
04:49:37 | FromDiscord | <Xvip> m |
04:49:38 | FromDiscord | <Xvip> . |
04:50:28 | FromDiscord | <Xvii> hi |
04:50:34 | FromDiscord | <Xvip> hi |
04:50:34 | FromDiscord | <Xvis> hi |
04:50:41 | FromDiscord | <Xvip> oh shit hi xvi |
04:50:46 | FromDiscord | <Xvii> hi xvi |
04:50:49 | FromDiscord | <Xvis> hi xvi |
04:50:53 | FromDiscord | <Xvip> WAIT THEY HAVE AUTO PIC PERMS |
04:51:01 | FromDiscord | <Xvii> o yea |
04:51:06 | FromDiscord | <Xvip> https://media.discordapp.net/attachments/771772843230101564/777955377223434270/image1-1.jpg?width=511&height=680 |
04:51:10 | FromDiscord | <Xvii> pog |
04:51:18 | FromDiscord | <Xvip> sent a long message, see http://ix.io/2GY9 |
04:51:21 | FromDiscord | <ElegantBeef> @impbox might want to deal with this |
04:51:27 | FromDiscord | <Xvip> nigga |
04:51:30 | FromDiscord | <Xvis> stfu |
04:51:31 | FromDiscord | <Xvip> fucking snitch |
04:51:35 | FromDiscord | <Xvip> fuck u |
04:51:35 | FromDiscord | <Xvii> we didnt do anything? |
04:51:38 | FromDiscord | <ElegantBeef> Sure |
04:51:42 | FromDiscord | <Xvii> what did we do |
04:51:45 | FromDiscord | <Xvis> “Elegantbeef” |
04:51:45 | FromDiscord | <Xvii> explain |
04:51:52 | FromDiscord | <Xvis> he’s racists |
04:51:55 | FromDiscord | <ElegantBeef> Sure |
04:51:56 | FromDiscord | <Xvis> (edit) "racists" => "racist" |
04:52:22 | FromDiscord | <ElegantBeef> Thanks whoever it was 😄 |
04:53:01 | FromDiscord | <impbox> hopefully that was everyone, and no one else got caught in the crossfire... |
04:53:11 | FromDiscord | <impbox> @ElegantBeef thanks |
05:12:16 | * | luis1 quit (Ping timeout: 256 seconds) |
05:13:20 | * | luis1 joined #nim |
05:14:45 | * | thomasross quit (Ping timeout: 256 seconds) |
05:19:15 | * | njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
05:19:23 | * | njoseph joined #nim |
05:21:08 | * | njoseph quit (Client Quit) |
05:21:15 | * | njoseph joined #nim |
05:21:18 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
05:23:14 | * | a_chou joined #nim |
05:37:17 | * | luis1 quit (Ping timeout: 272 seconds) |
05:37:26 | * | a_chou quit (Quit: a_chou) |
05:43:56 | * | luis1 joined #nim |
05:58:14 | * | luis1 quit (Ping timeout: 264 seconds) |
06:05:47 | * | vicfred joined #nim |
06:07:21 | FromDiscord | <cabboose> @treeform does fidget support dropShadows? I'm not able to see it functioning as of yet, just want to know if i should keep blindly smashing different methods or leave shadows for when they're implemented |
06:09:48 | FromDiscord | <treeform> I am currently working on a complete rewrite of fidget right now. It support drop shaodws, but I don't think the old one did. |
06:12:13 | FromDiscord | <cabboose> How will API stability go? |
06:13:07 | FromDiscord | <cabboose> Actually that’s fine; I’ll keep the UI simple for its use case until further notice from you. Loving your work |
06:24:08 | FromDiscord | <treeform> The API will totally change. |
06:39:06 | * | luis1 joined #nim |
06:45:03 | * | luis1 quit (Ping timeout: 272 seconds) |
06:50:21 | * | kungtotte quit (Remote host closed the connection) |
06:51:00 | * | astronavt quit (Remote host closed the connection) |
06:51:05 | * | kungtotte joined #nim |
06:51:24 | * | astronavt joined #nim |
06:59:58 | * | habamax joined #nim |
07:04:01 | FromDiscord | <j-james> Nim doesn't allow returning multiple values, does it? |
07:05:12 | FromDiscord | <ElegantBeef> You can use anonymous tuples yes `(int, int)` for instance |
07:05:30 | FromDiscord | <ElegantBeef> you then access the values with `[]` and an index for the one you want |
07:05:51 | * | luis1 joined #nim |
07:08:38 | FromDiscord | <j-james> https://media.discordapp.net/attachments/371759389889003532/785402372896587816/pog.png |
07:09:04 | FromDiscord | <ElegantBeef> you can also unpack them like `let (a,b) = thingThatReturnsTuple` |
07:09:27 | FromDiscord | <j-james> Ooh, that's very nice |
07:13:14 | * | luis1 quit (Ping timeout: 264 seconds) |
07:13:37 | * | luis1 joined #nim |
07:16:51 | FromDiscord | <sealmove> Guys, I am passing a NimNode to a proc. Outside the proc it's nnkCall with 1 child, inside the proc it's just the child (without it being wrapped in an nnkCall). How is this possible? |
07:17:23 | FromDiscord | <j-james> My Day Seven is too recursive to compile: https://play.nim-lang.org/#ix=2GYx |
07:17:27 | FromDiscord | <ElegantBeef> Show the code? |
07:17:41 | FromDiscord | <sealmove> Ah ok w8 I'll make a minimal example |
07:18:58 | mipri | what do you mean "too recursive to compile"? it compiles fine. |
07:20:58 | mipri | the big problem with it is that you're opening a file on each call to the function, and the call tree goes deeper than ulimit will let you open files |
07:21:19 | * | ^Q-Master^ joined #nim |
07:21:49 | * | Q-Master quit (Ping timeout: 264 seconds) |
07:22:35 | FromDiscord | <sealmove> oh what the heck |
07:22:49 | FromDiscord | <ElegantBeef> I'm uncertain if it's even possible to make something so recursive nim cannot output the C equivlent |
07:23:14 | FromDiscord | <sealmove> i am using a `case x` statement and because I am changing the value of `x` in the first branch, it goes through more than 1 branches! |
07:23:22 | FromDiscord | <sealmove> is this expected behavior? |
07:23:30 | FromDiscord | <sealmove> looks like a language bug to me |
07:23:43 | mipri | here you go: https://play.nim-lang.org/#ix=2GYz . now you get a nice call depth limit reached (in debug mode) or a segfault in release. |
07:25:27 | FromDiscord | <ElegantBeef> Seal i'll say yes as i dont have any code to say no 😄 |
07:25:47 | mipri | no, that's not expected behavior. |
07:26:31 | FromDiscord | <ElegantBeef> Well i mean yes it's a bug if so |
07:27:42 | mipri | if it were expected behavior, you'd see it here: https://play.nim-lang.org/#ix=2GYB |
07:28:04 | FromDiscord | <j-james> mipri: much appreciated 😄 |
07:28:28 | FromDiscord | <sealmove> yes, i did this test just now |
07:28:45 | FromDiscord | <sealmove> hmm, maybe I am missing something and something else is happening. |
07:29:53 | mipri | could be. where's the code? |
07:30:49 | FromDiscord | <sealmove> trying to reproduce in minimal example. by the time I do I'll probably realize it's something silly |
07:36:06 | FromDiscord | <sealmove> Ok it was funny business with node pointers. Guys srsly always use .copyNimTree... |
07:37:49 | FromDiscord | <ElegantBeef> Why would we always use it? |
07:38:31 | FromDiscord | <sealmove> sometimes you are using a node in more than 1 places and you think you are not going to modify it, but then you do. |
07:39:00 | FromDiscord | <Cohjellah> Yo guys, so I'm wondering - why do I have to import so many damn libraries that are basic like tables, sequences, etc |
07:39:21 | FromDiscord | <Cohjellah> Wouldn't larger projects just get unnecessarily big import statements at the top? |
07:39:39 | FromDiscord | <sealmove> well, you get to pick exactly what you need, isn't this nice? |
07:43:52 | FromDiscord | <ElegantBeef> I mean the import noise that Nim gives is whole modules and not the selective stuff that is the standard in places like java |
07:46:07 | mipri | a larger project doesn't mean every single file has to have all these imports. you just have more files that still need their own inputs. |
07:46:44 | FromDiscord | <ElegantBeef> Also remember that idiomatic Nim code doesnt really use qualified symbols so it reduces chance for symbol collisions |
07:46:59 | mipri | buf if you ***really*** wanted, you could have a module in the project that does nothing but import and export everything the project needs. Then you just have 'import everything' or whatever across the project's files. |
07:47:43 | * | audiofile joined #nim |
07:47:48 | FromDiscord | <ElegantBeef> ^is how some packages manage exposing the modules they want to |
07:49:25 | mipri | I don't find it onerous anyway. one import std/[strutils, re, tables, sets] and such, then one import npeg, lrucache, karax or whatever. |
07:51:10 | audiofile | is it recommended to do a search if other common packages use overload an operator? |
07:51:19 | audiofile | like can my package also overload % when json package does that too |
07:52:00 | FromDiscord | <ElegantBeef> Yes |
07:52:29 | FromDiscord | <ElegantBeef> Worst comes to worst the overlap will mean you do `import x except '%'` |
07:52:50 | mipri | no the worst case would be someone wanting both operators in the same file. |
07:53:33 | FromDiscord | <ElegantBeef> Yea which means you decide which api you want to be qualified and cry internally |
07:53:52 | mipri | it's not just symbols are in conflict though. it's not "oh that module uses % so I had better not", it's the signature of the proc. json has a bunch of prefix % on common types like string and int, so you generally won't want to make a prefix % on the same common types |
07:53:59 | audiofile | yes that's precisely the case im referring to! |
07:54:00 | audiofile | how to handle |
07:54:02 | audiofile | ? |
07:54:19 | mipri | pick the module you like the least and don't use its operator |
07:54:34 | audiofile | that's like asking to pick a favourite child |
07:54:39 | FromDiscord | <ElegantBeef> alternatively use procs instead of operators 😄 |
07:54:44 | * | audiofile sad older kid noises |
07:54:53 | * | PMunch joined #nim |
07:54:56 | audiofile | ah right there's always that |
07:55:01 | audiofile | heya PMunch |
07:55:11 | audiofile | we were just talking about you |
07:55:24 | PMunch | Hi :) |
07:55:28 | PMunch | Nothing too bad I hope |
07:55:38 | FromGitter | <gogolxdong> What's the usage of coro.nim? |
07:56:10 | Zevv | don't |
07:56:15 | Zevv | it's old and should die |
07:58:55 | mipri | json.%: https://play.nim-lang.org/#ix=2GYG |
08:00:22 | mipri | that coro's old really comes across very well from the source |
08:03:12 | FromDiscord | <ElegantBeef> Clearly we need to be able to write `json%` which gets transform into `json.'%'(a)` 😛 |
08:03:39 | mipri | some situations are inherently ugly and deserve an ugly syntax. |
08:14:37 | * | Cthalupa quit (Ping timeout: 264 seconds) |
08:15:13 | * | Cthalupa joined #nim |
08:16:34 | * | vicfred quit (Quit: Leaving) |
08:17:04 | * | audiofile quit (Quit: Connection closed) |
08:20:15 | * | audiofile joined #nim |
08:23:24 | FromDiscord | <starl0rd> sent a code paste, see https://play.nim-lang.org/#ix=2GYO |
08:24:14 | mipri | what's the problem? |
08:24:25 | FromDiscord | <starl0rd> (edit) "https://play.nim-lang.org/#ix=2GYO" => "https://play.nim-lang.org/#ix=2GYP" |
08:24:35 | FromDiscord | <starl0rd> editied |
08:24:42 | FromDiscord | <starl0rd> (edit) "editied" => "edited" |
08:25:26 | FromDiscord | <starl0rd> how can it be type safe and unsafe at the same time ? |
08:28:41 | mipri | it's a description that involves specific type casts, vs. a description of type casts in general. |
08:30:20 | mipri | !eval echo cast[int]("this is harder to use safely") |
08:30:22 | NimBot | 94433936965152 |
08:32:17 | FromDiscord | <ElegantBeef> Also worth noting that the cast that they demonstrate is to a `cint` which is required for interop with C/C++ |
08:32:56 | FromDiscord | <starl0rd> i understand that type cast look at the exact bits stored for the source type and tries to interpret it as bits of target type |
08:33:08 | * | mbomba quit (Quit: WeeChat 3.0) |
08:33:17 | FromDiscord | <starl0rd> and that'll be unsafe anyway you look at it if not careful |
08:33:17 | FromDiscord | <ElegantBeef> That entire use case seems to be for C/C++ programmers who are used to constant ints or'd together |
08:33:53 | FromDiscord | <ElegantBeef> It probably should be `f.cint`, and not using cast |
08:34:02 | FromDiscord | <ElegantBeef> Cast is only really used for lowlevel/interop |
08:34:05 | narimiran | PMunch: will you stream your today's AoC solving? i really enjoyed your stream yesterday!! |
08:34:21 | PMunch | Well, I'm at work at the moment.. |
08:34:21 | mipri | you still wouldn't want to throw cast[cint]() in your code, because although it has this defined use, it doesn't come with a check--it's not going to throw an error if you cast a float to cint instead of an enum set |
08:34:26 | FromDiscord | <starl0rd> but from the example, i do not understand how are they converted to powers of 2 ? |
08:34:42 | PMunch | It would need to be after work, but I've already solved part1 :P |
08:35:19 | FromDiscord | <ElegantBeef> a set is a bitset by default it's powers of 2 |
08:35:42 | narimiran | PMunch: you have a complete opposite approach than me: read carefully (with extra care for the highlighted stuff), think about the task, and only then solve it (on the first try). in contrast to my: quick quick quick, fail fail fail |
08:35:54 | FromDiscord | <starl0rd> also, another side question, if i use cint or cast int in my code, would it affect how to code compiles in other targets like js, obj c etc ? |
08:36:16 | PMunch | narimiran, well I just read through it once pretty much |
08:36:17 | FromDiscord | <ElegantBeef> !eval echo {1u8,2,4} == 7 |
08:36:18 | NimBot | Compile failed: /usercode/in.nim(1, 16) Error: type mismatch: got <set[uint8], int literal(7)> |
08:36:21 | PMunch | And then solve it :P |
08:36:35 | PMunch | Maybe I go back to check so I don't make an invalid assumption |
08:36:38 | FromDiscord | <ElegantBeef> !eval echo {1u8,2,4}.int == 7 |
08:36:39 | NimBot | Compile failed: /usercode/in.nim(1, 15) Error: type mismatch: got <set[uint8]> but expected 'int' |
08:36:50 | FromDiscord | <ElegantBeef> interesting |
08:37:03 | mipri | 7's also an odd number. |
08:37:18 | mipri | oh misread the 1 as an 8 :/ |
08:37:24 | FromDiscord | <starl0rd> i think sets work diff for enums than ints ? |
08:37:29 | FromDiscord | <ElegantBeef> No |
08:37:31 | FromDiscord | <ElegantBeef> They're bitsets |
08:37:37 | FromDiscord | <starl0rd> sure but |
08:37:48 | narimiran | PMunch: if you decide to stream today, please ping me, i'd love to watch. (today is not hard, but also not trivial) |
08:37:51 | FromDiscord | <starl0rd> !eval sizeof {1,2,4} |
08:37:52 | NimBot | Compile failed: /usercode/in.nim(1, 8) Error: expression '8192' is of type 'int' and has to be used (or discarded) |
08:38:09 | FromDiscord | <ElegantBeef> !eval echo sizeof {1u8,2,4} |
08:38:10 | FromDiscord | <starl0rd> (edit) "!eval ... sizeof" added "echo" |
08:38:11 | NimBot | 32 |
08:38:24 | mipri | !eval echo (sizeof(set[int8]), sizeof(set[int16])) |
08:38:26 | NimBot | (32, 8192) |
08:38:43 | FromDiscord | <ElegantBeef> it's 32 cause a bitset can hold 0..256 |
08:38:52 | FromDiscord | <ElegantBeef> (edit) "0..256" => "0..255" |
08:39:18 | FromDiscord | <starl0rd> !eval type Lol = enum l,O,L,z; echo sizeof {l,O,L} |
08:39:19 | NimBot | Compile failed: /usercode/in.nim(1, 24) Error: identifier expected, but got ';' |
08:39:22 | FromDiscord | <ElegantBeef> !eval echo sizeof {fmread}` |
08:39:23 | NimBot | Compile failed: /usercode/in.nim(1, 22) Error: identifier expected, but got '[EOF]' |
08:39:28 | FromDiscord | <ElegantBeef> !eval sizeof {1,2,4} |
08:39:29 | NimBot | Compile failed: /usercode/in.nim(1, 8) Error: expression '8192' is of type 'int' and has to be used (or discarded) |
08:39:31 | PMunch | narimiran, just completed part2, so it would just be me showing off my solution pretty much.. |
08:39:31 | FromDiscord | <ElegantBeef> fuc |
08:39:38 | FromDiscord | <ElegantBeef> !eval echo sizeof {fmread} |
08:39:39 | PMunch | But I guess that might be interesting |
08:39:40 | mipri | you can try this stuff in inim, locally |
08:39:40 | NimBot | 1 |
08:39:41 | FromDiscord | <starl0rd> !eval type Lol = enum l,O,L,z; echo sizeof {l,O,L}; |
08:39:42 | NimBot | Compile failed: /usercode/in.nim(1, 24) Error: identifier expected, but got ';' |
08:39:52 | narimiran | PMunch: ah, i thought you wouldn't open it until the afternoon |
08:40:06 | PMunch | Oh no, I was already half done when you asked me |
08:40:23 | PMunch | Problem is I kinda want to solve them fast for the leaderboard :P |
08:40:26 | Zevv | PMunch: please do show off |
08:40:37 | PMunch | Otherwise I could've just waited until after work and solve them on stream |
08:41:12 | FromDiscord | <ElegantBeef> !eval echo sizeof set[0..7] |
08:41:13 | FromDiscord | <ElegantBeef> Last one |
08:41:14 | NimBot | 1 |
08:41:22 | PMunch | If you're just curious about my solution I have part1: http://ix.io/2GYU and part2: http://ix.io/2GYV |
08:41:39 | FromDiscord | <ElegantBeef> the bitset for an enum is just a set of the enum range |
08:42:06 | PMunch | (And yes, I know my looping in part1 is ugly :P) |
08:42:17 | FromDiscord | <ElegantBeef> When you say `set[uint8]` you're really saying `set[0..255]` |
08:42:28 | FromDiscord | <starl0rd> sure |
08:43:20 | FromDiscord | <starl0rd> its a bitvector for all numbers in the range |
08:43:45 | FromDiscord | <starl0rd> if a enum has 4 values, it needs 4 bits ? |
08:43:56 | FromDiscord | <starl0rd> but 8 is a nim ? |
08:43:56 | FromDiscord | <ElegantBeef> Well isnt a vector a dynamically size type? |
08:44:02 | FromDiscord | <starl0rd> (edit) "nim ?" => "min" |
08:44:47 | FromDiscord | <starl0rd> yea, Araq: said sets probably need a little looking at |
08:44:49 | narimiran | PMunch, Zevv oh you cool kids and your fancy npeg stuff |
08:45:02 | narimiran | and i'm here in 19th century with scanf |
08:45:44 | PMunch | Once you get the hang of npeg it's really nice |
08:45:45 | * | ^Q-Master^ quit (Ping timeout: 240 seconds) |
08:45:51 | PMunch | (and that doesn't take long) |
08:46:19 | FromDiscord | <ElegantBeef> I couldnt catch it, i tried multiple times and went yea, cool 😄 |
08:46:38 | FromDiscord | <ElegantBeef> Still want to make a sugar version of `scanf` that doesnt need you to predeclare the variables |
08:46:48 | PMunch | narimiran, how did you do all of the restrictions with scanf? |
08:47:03 | Zevv | PMunch: it's just shameless promotion |
08:47:27 | FromDiscord | <ElegantBeef> https://play.nim-lang.org/#ix=2G77 i did make this as a proof of concept, and it makes scanf nicer to use imo |
08:47:29 | PMunch | I just really like npeg :D |
08:47:36 | FromDiscord | <ElegantBeef> Although i should use the parse that scanf uses |
08:47:42 | Zevv | :) |
08:47:42 | narimiran | PMunch: `"$+ bags contain $+"` and then for each bag `"$i $+ bag"` |
08:47:45 | Zevv | :et |
08:47:53 | Zevv | Let's see how many people switch to npeg over the month :) |
08:48:00 | Zevv | 2 down, 999.999 to go |
08:48:08 | PMunch | narimiran, ah, so you did it in stages |
08:48:09 | disruptek | it's pretty great. |
08:48:13 | narimiran | Zevv: nim has 1,000,001 users? wow |
08:48:29 | FromDiscord | <ElegantBeef> No 999.999 that's a decimal point 😛 |
08:48:30 | Zevv | disruptek: down, boi |
08:48:33 | PMunch | No we have 1001 and one almost convinced user |
08:48:48 | narimiran | :D |
08:48:53 | PMunch | Haha :P |
08:49:29 | FromDiscord | <starl0rd> uhm, whats a npeg ? |
08:49:33 | PMunch | I mean just look at the pretty railway diagrams it puts out, how can you not like npeg? :D |
08:49:36 | Zevv | PMunch: {'a'..'z'} -> Alpha, {'1'..'9'} -> Digit |
08:49:38 | narimiran | 2.1 |
08:49:39 | FromDiscord | <ElegantBeef> !repo npeg |
08:49:40 | disbot | https://github.com/zevv/npeg -- 9npeg: 11PEGs for Nim, another take 15 131⭐ 7🍴 |
08:49:58 | PMunch | Zevv, yeah I thought about that |
08:49:59 | FromDiscord | <ElegantBeef> Pmunch i dont like it cause i dont know how to use it |
08:50:15 | Zevv | ElegantBeef: that's a pretty good reason, actually |
08:50:24 | PMunch | Understandable |
08:50:35 | PMunch | I liked it even before I knew how to use it though |
08:50:50 | PMunch | Just looking at what Zevv was able to do with it, watching him with envy |
08:50:58 | disruptek | beef: just look at some example usages. |
08:50:58 | FromDiscord | <ElegantBeef> I mean it seems cool, but it's pretty unwieldy if you dont know how it does what it does |
08:51:01 | FromDiscord | <ElegantBeef> I did |
08:51:04 | disruptek | !requires npeg |
08:51:06 | disbot | npeg: 11disruptek[luu,3gully,3atoz,3gcplat,3gitlab,3openapi,3github,3nimph], 11mildred[3nimnews,3newswebjs,3accountserver], 11sealmove/3nimitai, 11zevv/3nim-arduino, 11rishavs/3fea, 11pseudo-lang/3pseudolang, 11jrfondren/3modsec, 11Yardanico/3ircord, 11logic-state/3logicstate, 11khchen/3wAuto, 11thomastay/3prop_logic_simplifier, 11liquid600pgm/3nadio, 11juancarlos |
08:51:06 | FromDiscord | <ElegantBeef> They're very non descript imo |
08:51:42 | PMunch | Wait, is that all the packages in nimble which requires a certain library? |
08:51:44 | disruptek | find something similar to what you want to do. |
08:51:54 | disruptek | PMunch: what else? |
08:51:57 | FromDiscord | <ElegantBeef> Like i was toying with automating js parsing, and i couldnt even get it to just parse the name/args |
08:52:07 | Zevv | PMunch: not all, it's truncated after "juancarlos" |
08:52:23 | PMunch | disruptek, I was just surprised you've bothered to calculate that |
08:52:29 | disruptek | i had to truncate jc because he was too long. 👀 |
08:52:29 | narimiran | disruptek: (how) can we add new stuff to disbot? i want it to have an entry for `rtfm` and `ninp` (nim is not python) |
08:52:31 | PMunch | Means cloning every single package, no? |
08:52:47 | disruptek | narimiran: we do need an rtfm. |
08:52:47 | PMunch | ~rtfm is read the fucking manual |
08:52:48 | disbot | rtfm: 11read the fucking manual |
08:52:53 | PMunch | ~rtfm |
08:52:53 | disbot | rtfm: 11read the fucking manual -- PMunch |
08:52:57 | disruptek | PMunch: no, it uses codesearch in real-time. |
08:53:07 | FromDiscord | <ElegantBeef> no rtfm should point to `rtfm div operator` |
08:53:22 | narimiran | ~rtfm is https://nim-lang.org/documentation.html |
08:53:22 | disbot | rtfm: 11read the fucking manual |
08:53:22 | disbot | rtfm: 11https://nim-lang.org/documentation.html |
08:53:52 | disruptek | we need an !rtfm that tries to find the /manual/ section and then maybe a separate command to bring up docs for a particular manual or import, which could extend to online package docs. |
08:53:59 | narimiran | ~ninp is nim is not python!! |
08:53:59 | disbot | ninp: 11nim is not python!! |
08:54:10 | disruptek | spelign |
08:54:15 | PMunch | Oh it doesn't tell you who made the comment when there is more than one? |
08:54:29 | PMunch | Oh wait, it's because he set it |
08:54:31 | disruptek | it only reveals the caller's name so as not to ping. |
08:54:39 | narimiran | ~rtf, |
08:54:39 | disruptek | ~pmunch |
08:54:39 | disbot | no footnotes for `rtf,`. 🙁 |
08:54:39 | disbot | PMunch: 11a metaprogramming aficionado and long time Nim user who can be found at peterme.net |
08:54:39 | disbot | PMunch: 11streaming at https://twitch.tv/pmunche |
08:54:41 | narimiran | ~rtfm |
08:54:41 | disbot | rtfm: 11read the fucking manual |
08:54:41 | disbot | rtfm: 11https://nim-lang.org/documentation.html -- narimiran |
08:55:12 | PMunch | Riight |
08:55:30 | PMunch | So if someone put something rude in there then we would have no way to tell who said it :P |
08:55:48 | narimiran | no one would do something like that |
08:55:50 | disruptek | !repo disbot |
08:55:52 | disbot | https://github.com/atomicptr/disbot -- 9disbot: 11Hubot Adapter for discord.js 15 2⭐ 2🍴 7& 29 more... |
08:55:58 | disruptek | !repo disruptek/disbot |
08:55:58 | disbot | https://github.com/disruptek/disbot -- 9disbot: 11disbot data 15 0⭐ 0🍴 |
08:56:00 | PMunch | But yeah, something like !rtfm tables to auto-link the tables page for example would be great |
08:56:15 | disruptek | disbot data stores the footnotes. |
08:57:01 | disruptek | ~manual |
08:57:02 | disbot | manual: 11the Nim Manual is https://nim-lang.org/docs/manual.html -- disruptek |
08:57:02 | disbot | manual: 11just good to Ctrl+F in cases like this |
08:58:04 | PMunch | That's a bit nicer than |
08:58:07 | PMunch | ~rtfm |
08:58:08 | disbot | rtfm: 11read the fucking manual -- PMunch |
08:58:08 | disbot | rtfm: 11https://nim-lang.org/documentation.html |
08:58:31 | FromDiscord | <ElegantBeef> Also zevv i do wanna say since i'm a numpty that it'd be nice to see some more basic applications of npeg on things like (10-20-30) or getting specific parts of a datetime stamp |
08:58:42 | * | Vladar joined #nim |
08:59:01 | disruptek | nimph uses it to parse semver. |
08:59:04 | disruptek | !repo nimph |
08:59:05 | disbot | https://github.com/disruptek/nimph -- 9nimph: 11Nim package hierarchy manager from the future 🧚 15 89⭐ 5🍴 7& 1 more... |
08:59:08 | disruptek | just rtfc |
08:59:55 | FromDiscord | <ElegantBeef> I mean sure disruptek, but i'm probably not going to be the only one that wants a smaller example that's less confusing, hence why i'm mentioning it |
09:00:15 | disruptek | determining date from hyphenated numbers was one of the secret-online-interview questions i got from google. |
09:00:40 | FromDiscord | <ElegantBeef> lol |
09:00:46 | Zevv | ElegantBeef: makes sense. I've started a npeg cookbook a few times, but never got enough motivation to finish it |
09:01:00 | Zevv | I also tried to make some videos, but then I remembered I do not only hate _watching_ videos, but also hate _making_ them |
09:01:27 | FromDiscord | <ElegantBeef> Yea i've looked at the Json parser/http header parsers and it's just a slight understanding mixed with pure lack of understanding 😄 |
09:02:29 | disruptek | just do something simple and then you'll have the confidence to believe you can learn it fully. |
09:02:44 | disruptek | i don't like to hear you talking like this. |
09:03:03 | FromDiscord | <ElegantBeef> I was trying to use it to parse the name of a javascript function |
09:03:22 | FromDiscord | <ElegantBeef> I couldnt get it to capture the name after "function " |
09:04:06 | disruptek | ~paste |
09:04:06 | disbot | paste: 11a frowned-upon behavior in chat; please use a service such as https://play.nim-lang.org/ or http://ix.io/ or https://gist.github.com/ and supply us a URL instead. -- disruptek |
09:04:56 | FromDiscord | <ElegantBeef> I've since replaced it with scanf, then deleted it |
09:05:28 | * | Q-Master joined #nim |
09:05:38 | disruptek | !repo gully |
09:05:39 | * | luis1 quit (Ping timeout: 272 seconds) |
09:05:39 | disbot | https://github.com/disruptek/gully -- 9gully: 11a code comment formatter 15 3⭐ 0🍴 |
09:05:49 | disruptek | this one has an npeg parser that reads nim syntax. |
09:06:50 | Zevv | wait what you parse full Nim? |
09:07:17 | disruptek | no, just for determining comments. |
09:07:22 | * | luis1 joined #nim |
09:07:53 | disruptek | it knows about multiline and different languages, though. |
09:08:30 | disruptek | otherwise i would just use the nim parser, most likely. |
09:09:10 | PMunch | Hmm, I've got QMK working on my custom keyboard now |
09:09:24 | PMunch | I wonder how much work it would be to write it in Nim |
09:09:52 | Zevv | Real men write a USB client implementation from scratch at least once in their life |
09:10:00 | Zevv | get out your HDLC bit stuffer |
09:10:05 | Zevv | go write your descriptors |
09:11:39 | PMunch | Haha, I mean I was fully planning on making use of this: https://www.pjrc.com/teensy/td_keyboard.html |
09:11:48 | PMunch | And not implement my own USB client |
09:12:11 | FromDiscord | <ElegantBeef> I imagine wouldnt be too hard with that |
09:12:14 | * | Tanger quit (Quit: Leaving) |
09:12:23 | Zevv | yeah, that's why I said "real men", right |
09:12:48 | PMunch | <_< |
09:13:06 | Zevv | What does that one mean |
09:13:12 | * | luis1 quit (Ping timeout: 260 seconds) |
09:14:00 | FromDiscord | <ElegantBeef> Depending on the the teensy you get pmunch you can always store the inputs in a file 😄 |
09:14:12 | PMunch | I've got the Teensy 2.0 |
09:14:25 | FromDiscord | <ElegantBeef> still got 32kb of flash 😄 |
09:14:27 | PMunch | Well, I have a bunch of controllers |
09:14:49 | PMunch | I mean I could throw an ESP8266 in there and have built-in WiFi :P |
09:15:09 | disruptek | i did make the bloom filter work while watching a movie: http://ix.io/2GZ3/nim lemme know if you can improve it before i put it into production. |
09:16:09 | Zevv | Man if I'd to bed after 04:15 it would cost me 4 days to recover |
09:16:24 | disruptek | yeah, yeah. |
09:16:40 | disruptek | you probably don't have a biological clock set to Mars time. |
09:16:55 | Zevv | you could just switch to europe time |
09:17:15 | disruptek | it will be night here in 12hrs. |
09:17:25 | disruptek | how about you? |
09:17:34 | Zevv | depends on what you call "night" |
09:17:53 | disruptek | after civil twilight ends, night begins. |
09:18:14 | disruptek | i tend not to be especially civil during twilight, though. just sayin'. |
09:20:46 | PMunch | So it'll be night here at 2PM then.. |
09:22:14 | FromDiscord | <ElegantBeef> Suns two hours fast for you pmunch 😄 |
09:22:44 | PMunch | Huh? |
09:22:52 | PMunch | Sun isn't up at all |
09:23:02 | PMunch | Civil twilight is as bright as it gets here now |
09:24:47 | disruptek | !repo marcazar/bitvector |
09:24:47 | disbot | https://github.com/MarcAzar/BitVector -- 9BitVector: 11BitVector Implementation in Nim 15 13⭐ 2🍴 |
09:24:52 | disruptek | includes a bloom filter. |
09:25:29 | disruptek | probably will impl a cuckoo filter. that one is new to me. |
09:28:56 | * | hnOsmium0001 quit (Quit: Connection closed for inactivity) |
09:29:54 | Araq | cuoco filter? won't make you happy |
09:34:00 | * | luis1 joined #nim |
09:37:09 | FromDiscord | <ElegantBeef> But it will make an annoying noise every 30 minutes |
09:37:47 | FromDiscord | <ElegantBeef> ~~I guess it's not spelled or pronounced that way, so i'm daft as usual~~ |
09:38:16 | FromDiscord | <Rika> nope its spelled cuckoo clock if thats what youre referring to |
09:38:37 | FromDiscord | <ElegantBeef> I mean i was sorta hoping the pronouncation was close |
09:40:27 | FromDiscord | <Rika> i mean disrup.tek did say cuckoo |
09:43:01 | Araq | "use nimlint to enforce best practices" |
09:43:16 | Araq | ok that's good I guess. No idea what nimlint is |
09:43:28 | FromDiscord | <ElegantBeef> I think it's a github action? |
09:44:46 | FromDiscord | <Rika> idk why but nimlint sounds like a food |
09:44:48 | FromDiscord | <flywind> Yeah, that's not ready, now just for hinting some advices from `timotheecour` and I. |
09:44:59 | FromDiscord | <ElegantBeef> Nimlint is what i get when i scratch my belly button |
09:45:04 | FromDiscord | <ElegantBeef> It's the king of the lint hence nim |
09:45:17 | FromDiscord | <flywind> see https://github.com/timotheecour/Nim/issues/415 |
09:45:19 | disbot | ➥ RFC: nimlint: automate enforcing best practices in code ; snippet at 12https://play.nim-lang.org/#ix=2GZd |
09:47:39 | Araq | will "don't use 'defer'" make it into Nimlint :P |
09:48:21 | FromDiscord | <flywind> lol |
09:49:35 | * | luis1 quit (Ping timeout: 246 seconds) |
09:49:35 | Araq | or "don't use break/continue/return"? |
09:49:57 | supakeen | wow |
09:50:07 | supakeen | mrm all of those can be done with goto! |
09:51:00 | Araq | narimiran, please backport https://github.com/nim-lang/Nim/pull/16279, progress of csources_v1 depends on it |
09:51:01 | disbot | ➥ OSX: support for M1 [backport:1.0] |
09:51:21 | narimiran | ok |
09:51:41 | FromDiscord | <flywind> Yeah, I think `nimlint` is not for making codes better. Instead it makes code more maintainable. |
09:51:46 | FromDiscord | <Rika> i dont see the alternatives to break and continue |
09:52:07 | FromDiscord | <Rika> can someone explain to me who has one braincell |
09:52:31 | * | luis1 joined #nim |
09:53:31 | Araq | Rika: it cannot always be avoided |
09:53:41 | Araq | well ok, it can but it sucks |
09:53:54 | Araq | but it's frequently over-used |
09:54:06 | FromDiscord | <Rika> it sucks to always avoid it, i see, but when can it be avoided? |
09:54:22 | Araq | I often see 'if cond: continue else: stuff()' |
09:54:28 | FromDiscord | <ElegantBeef> `for x in 0..100: if x == e: continue` |
09:54:45 | FromDiscord | <ElegantBeef> that e is supposed to be a 0 😄 |
09:54:52 | FromDiscord | <Rika> isnt that 'if not cond: stuff'? |
09:55:02 | FromDiscord | <Rika> that's pretty insane lol |
09:55:13 | FromDiscord | <ElegantBeef> A lot of people do that |
09:55:18 | FromDiscord | <Rika> okay so you just mean those and not some weird new way to look at for loops without continues and breaks |
09:55:27 | FromDiscord | <ElegantBeef> I know i did a lot of `if cond: return` in C# and carried it over a bit in Nim |
09:55:28 | FromDiscord | <lqdev> gosh that's just terrible |
09:55:30 | FromDiscord | <lqdev> why the else |
09:55:51 | FromDiscord | <lqdev> i mean `if cond: return` or `if cond: break` or `if cond: continue` is perfectly acceptable imo |
09:57:03 | FromDiscord | <ElegantBeef> One thing i can see is that since we have an implict result using `return` could cause unintended issues |
09:57:07 | FromDiscord | <lqdev> i know 4raq doesn't particularly like them but tbh i prefer a `continue` over an extra indent level thus even lessening my line column real estate |
09:57:29 | Araq | yeah yeah, indent levels are bad |
09:57:33 | FromDiscord | <flywind> This benchmark is not correct https://github.com/nim-lang/Nim/pull/16193#issue-529458872 |
09:57:34 | disbot | ➥ toXXAscii use xor op, saving 30%~50% time ; snippet at 12https://play.nim-lang.org/#ix=2G2L |
09:57:35 | FromDiscord | <lqdev> damn that last part sounds like i had a stroke |
09:57:57 | Araq | we should go back to asm with gotos, no indentation problems |
09:58:11 | Araq | no "column real estate" problems |
09:58:14 | FromDiscord | <lqdev> Araq: i'm not saying they're bad, i'm saying that two for loops immediately followed by an if inside of them look horrible |
09:58:17 | FromDiscord | <ElegantBeef> Clearly break,continue, and return should just take a condition 😛 |
09:58:22 | FromDiscord | <Rika> too many indent levels are bad of course |
09:58:34 | FromDiscord | <flywind> sent a code paste, see https://play.nim-lang.org/#ix=2GZe |
09:59:00 | FromDiscord | <Rika> speaking of two for loops followed by an if inside |
09:59:04 | Araq | the 'if' inside a loop is a filter, the indentation is simply reflecting your code |
09:59:17 | Araq | it's stupid to mind it IMO |
09:59:20 | FromDiscord | <Rika> that made me laugh a littly |
09:59:22 | FromDiscord | <Rika> e |
09:59:43 | FromDiscord | <lqdev> but i believe an `if x: continue` better signals the filterness |
09:59:57 | FromDiscord | <ElegantBeef> vs `if not x`? |
10:00:09 | FromDiscord | <Rika> you one of those "return early" folks? |
10:00:12 | Araq | it seems wiser to mind nested for loops, the iteration space can be seen as not very interesting |
10:01:10 | FromDiscord | <ElegantBeef> Well sometimes return early is pretty hard to pass up 😄 |
10:01:31 | Araq | I do it too, but rarely and when I do I feel dirty |
10:01:34 | Araq | :P |
10:01:36 | FromDiscord | <Rika> i mean yeah definitely i love it |
10:01:41 | FromDiscord | <ElegantBeef> Looks at my `withSome`/`withNone` macros in pmunch's `\optionutils` |
10:01:51 | FromDiscord | <Rika> i'd prefer that over a long indent |
10:02:09 | FromDiscord | <Rika> i guess i prefer that because it looks nicer |
10:06:58 | * | abm joined #nim |
10:08:59 | * | Torro joined #nim |
10:09:07 | ForumUpdaterBot | New thread by Spamsalty: Passing template's argument to children template?, see https://forum.nim-lang.org/t/7215 |
10:19:08 | ForumUpdaterBot | New thread by B3liever: Can I rename my nimble package?, see https://forum.nim-lang.org/t/7216 |
10:19:09 | audiofile | m1 support!!!! |
10:19:14 | audiofile | nice |
10:28:49 | FromDiscord | <Rika> ? |
10:35:29 | Araq | speaking of which, can I buy these M1 based laptops anywhere? |
10:35:47 | narimiran | @Rika: https://github.com/nim-lang/Nim/pull/16279 |
10:35:48 | disbot | ➥ OSX: support for M1 [backport:1.0] |
10:36:18 | FromDiscord | <Rika> i believe the m1 laptops are for sale now |
10:36:26 | FromDiscord | <Rika> i dont see why you cant |
10:37:04 | Araq | hmm my supplier doesn't have them |
10:37:07 | FromDiscord | <Rika> lol that was the easiest addition of support ive ever seen though i guess its just a matter of telling another compiler what to do |
10:37:09 | ForumUpdaterBot | New thread by Mantielero: C++ wrap - let/var behaviour, see https://forum.nim-lang.org/t/7217 |
10:39:22 | Araq | Rika: it's untested and the work in on-going |
10:39:50 | FromDiscord | <Rika> Ah yeah I see, I'm a bit short sighted today it seems |
10:51:25 | * | lritter quit (Ping timeout: 272 seconds) |
10:54:12 | * | ^Q-Master^ joined #nim |
10:55:33 | * | Q-Master quit (Ping timeout: 260 seconds) |
10:57:17 | * | Tanger joined #nim |
11:01:39 | * | lritter joined #nim |
11:08:06 | FromDiscord | <sealmove> Any idea what " Error: named expression expected" could be? I'm getting when using `quote do`. |
11:12:14 | FromDiscord | <lqdev> not enough information. |
11:12:14 | FromDiscord | <lqdev> how are you using quote do? |
11:13:05 | FromDiscord | <sealmove> In a macro, to generate the result |
11:13:17 | FromDiscord | <lqdev> no shit. |
11:13:30 | FromDiscord | <lqdev> i'm not asking where |
11:13:36 | FromDiscord | <lqdev> i'm asking how are you calling it |
11:13:39 | FromDiscord | <lqdev> what are you passing to it |
11:14:11 | FromDiscord | <sealmove> let `name` = (get: `readerName`, put: `writerName`) |
11:14:28 | FromDiscord | <lqdev> hm |
11:14:37 | FromDiscord | <sealmove> (discord hides the backquotes) |
11:14:40 | FromDiscord | <lqdev> ik |
11:14:57 | FromDiscord | <lqdev> where does the error message point to? |
11:15:30 | FromDiscord | <sealmove> at `get:` |
11:15:40 | FromDiscord | <lqdev> give me a sec |
11:16:58 | FromDiscord | <lqdev> works for me https://play.nim-lang.org/#ix=2GZO |
11:17:07 | FromDiscord | <ache of head> > no shit.↵you're turning into disruptek |
11:17:55 | FromDiscord | <lqdev> is that a good thing or bad thing? |
11:18:15 | FromDiscord | <sealmove> genSym(nskProc) |
11:18:24 | FromDiscord | <sealmove> sorry https://play.nim-lang.org/#ix=2GZP |
11:19:08 | FromDiscord | <lqdev> yea still works with genSym |
11:19:27 | FromDiscord | <lqdev> this happens because your procs are undeclared |
11:19:55 | FromDiscord | <lqdev> if i declare the procs inside the quote do, it works as expected :p |
11:24:33 | audiofile | Araq what do you mean by your supplier? It's available on the apple store for sale...? |
11:24:52 | audiofile | do you have a cool dude who hooks you up with laptops in shady alleys? |
11:25:04 | audiofile | remember, the first laptop is always free...that's how they get you |
11:29:14 | ForumUpdaterBot | New thread by Serge: What is the use of reference (ref) types in Nim. What is ref normally used for in Nim?, see https://forum.nim-lang.org/t/7218 |
11:31:21 | Araq | audiofile, exactly :-) |
11:31:56 | Araq | my guy guy gave me a laptop guy and my laptop guy doesn't deliver |
11:32:07 | * | audiofile54 joined #nim |
11:32:51 | audiofile54 | time to fire the laptop guy |
11:33:45 | FromDiscord | <Rika> You need a guy guy guy |
11:34:05 | FromDiscord | <Recruit_main707> Araq, I’ve been looking a bit into move semantics, can’t they be used to mix manually managed memory libraries with arc/orc? |
11:34:54 | Araq | what do you mean? that's why they exist. much better interop with the manual MM world |
11:35:31 | FromDiscord | <Recruit_main707> Ok, perfect, I was just making sure I understood :p |
11:36:15 | audiofile54 | can someone eli5 what those two brainy fellers above just said? |
11:37:21 | FromDiscord | <Recruit_main707> I will only add that they are an extremely good idea then :) |
11:37:37 | FromDiscord | <Rika> Move semantics is the "not much runtime impact gc" that rust made popular I believe |
11:37:43 | supakeen | audiofile54: "It seem useful to copy memory to interact with external libraries." |
11:38:39 | audiofile54 | oh hmm not sure why that is useful but I guess I'm missing some context, thanks supakeen |
11:38:44 | ForumUpdaterBot | New post on r/nim by cpbotha: Updated Dash docset to Nim v1.4.2, see https://forum.nim-lang.org/t/5050#45577 |
11:39:12 | supakeen | audiofile54: Because if Nim thinks it owns some memory and an external library also thinks it owns some memory you need to be careful not to put something else there from either side. |
11:39:34 | FromDiscord | <Recruit_main707> Rika, yes, but I was talking about how they are/can be used in Nim |
11:39:44 | audiofile54 | ohhh I see hmm so does nim like block off the memory it uses somehow |
11:39:48 | FromDiscord | <Rika> I was trying to explain to audio |
11:40:12 | FromDiscord | <Recruit_main707> Ah, sorry 😅 |
11:40:16 | supakeen | No, which is why they were discussing move semantics which define how memory is copied (and if) :) |
11:40:23 | FromDiscord | <Rika> If two programs think it owns the same piece of memory, a double free might happen |
11:40:54 | FromDiscord | <Rika> Or a lot more reallt |
11:40:59 | FromDiscord | <Recruit_main707> Or a free and then a read |
11:43:14 | audiofile54 | is this move semantics somehow related to copy/reference semantics |
11:44:12 | FromDiscord | <Recruit_main707> sent a long message, see http://ix.io/2GZV |
11:44:44 | FromDiscord | <Recruit_main707> Bruh, why would it think it was code |
11:51:39 | Zoom[m] | Today's aoc is completely unrealistic. Real world rules would be at least 50% cyclic. |
11:52:02 | PMunch | Haha |
11:52:37 | Zoom[m] | PMunch: have you seen my d4 solution? Managed to do it with just std/pegs |
11:54:52 | Zoom[m] | Now I have a comparison point for npeg, if I get to try it |
11:55:12 | PMunch | No I haven't seen that one |
11:55:21 | PMunch | I've seen Zevv's version with npeg though |
11:56:01 | * | luis1 quit (Ping timeout: 246 seconds) |
11:56:29 | FromDiscord | <sealmove> omg i found the problem |
11:56:38 | FromDiscord | <sealmove> i imported modules `options` |
11:56:49 | FromDiscord | <sealmove> and nim is thinking `get` from that module |
11:57:32 | FromDiscord | <sealmove> @lqdev |
11:57:45 | FromDiscord | <lqdev> aah |
11:57:51 | FromDiscord | <lqdev> damn, that sounds like a bug |
11:58:01 | * | luis1 joined #nim |
11:58:45 | FromDiscord | <sealmove> @PMunch I am going full rework on binaryparse 😛 I think it's going to fork because I want to add syntax |
11:59:14 | PMunch | Why a full fork? |
12:00:20 | FromDiscord | <sealmove> well, it might not be kept minimal as you like it. I am thinking https://github.com/PMunch/binaryparse/issues/14 |
12:01:44 | FromDiscord | <sealmove> The changes are heavy, if you are ok with it I have no reason to fork, but I think it will need effort to supervise |
12:06:01 | * | supakeen quit (Quit: WeeChat 2.9) |
12:06:07 | PMunch | I had some questions to that actually |
12:06:12 | PMunch | But I will put them in the issue |
12:06:30 | FromDiscord | <sealmove> great, happy to discuss this |
12:06:35 | * | supakeen joined #nim |
12:07:07 | PMunch | But in short I think all that you're trying to do could be achieved already, and in a similar way to how you did the other plug-ins |
12:09:06 | FromDiscord | <sealmove> Ok I found out 2 major problems with the macro-wrapping-macro approach |
12:10:54 | FromDiscord | <sealmove> 1. It's non-modular. For example I made a `createSizedParser`, a `createConditionalParser` and a `createPositionedParser`, but what if you combinations of them?↵2. These are _parser_ options, not _field_ options. The latter is much better because you can reuse the same parser for many fields, some of which might be conditional, positioned etc. |
12:11:55 | FromDiscord | <sealmove> I've tried many DSL and they all have similar features for a reason |
12:27:35 | PMunch | Hmm, that is a fair point |
12:48:48 | audiofile54 | http://vpaste.net/MpMY9?bg=dark&nu can someone tell me what is wrong in my code? syntactically |
12:49:25 | audiofile54 | can I not change override operator precedence with parentheses? compiler seems to be complaining about tuple |
12:51:14 | audiofile54 | nvm i think i got it |
12:52:18 | Tanger | Hey folks, does anybody have any tips for hitting "Too many files open" when using threads? Do I need to resolve threads in batches? |
12:53:25 | audiofile54 | someone pls explain *this* |
12:53:35 | audiofile54 | !eval not 5 |
12:53:36 | NimBot | Compile failed: /usercode/in.nim(1, 1) Error: expression '-6' is of type 'int literal(-6)' and has to be used (or discarded) |
12:53:46 | audiofile54 | !eval echo(not 4) |
12:53:48 | NimBot | -5 |
12:53:51 | audiofile54 | wtf |
12:54:12 | audiofile54 | !eval echo(not 8) |
12:54:14 | NimBot | -9 |
12:58:05 | FromDiscord | <InventorMatt> it's flipping all of the bits in the binary of the number |
12:58:55 | audiofile54 | ohhh is that the 2's complement thingy |
12:59:00 | FromDiscord | <InventorMatt> yes |
12:59:06 | audiofile54 | thank you inventory matt |
12:59:41 | FromDiscord | <InventorMatt> no problem you can check what it looks like here https://play.nim-lang.org/#ix=2H0D |
13:00:45 | audiofile54 | oh boy that ufcs looks sexy there |
13:01:01 | audiofile54 | keep forgetting to use it, thanks for showing and oh boy did you solve the leap year >_> |
13:01:47 | audiofile54 | i like that .bool instead of bool(...) |
13:26:20 | audiofile54 | inventorymatt you there? |
13:26:40 | FromDiscord | <InventorMatt> yeah, still here |
13:27:31 | FromDiscord | <InventorMatt> ufcs can be really nice for making clean code |
13:27:41 | audiofile54 | do you prefer typcasting like .type instead of type(...)? |
13:28:14 | narimiran | audiofile54: sometimes you might also want to do `foo bar` instead of `foo(bar)` or `bar.foo` ;) |
13:28:31 | * | Kaivo joined #nim |
13:28:32 | audiofile54 | what is that first syntax |
13:28:36 | audiofile54 | never seen that before? |
13:28:40 | narimiran | and for me, it depends on the context which i would use |
13:28:56 | narimiran | audiofile54: you never echo-ed anything in nim? ;) |
13:29:03 | FromDiscord | <InventorMatt> typically yes, but its probably because it is easier to write .type instead of adding parenthesis |
13:29:08 | audiofile54 | 'abc'.echo B) |
13:29:17 | narimiran | type error |
13:29:48 | FromDiscord | <shadow.> lol |
13:29:48 | audiofile54 | !eval "abc".echo |
13:29:50 | NimBot | abc |
13:29:53 | FromDiscord | <shadow.> there we go |
13:29:54 | audiofile54 | ^good bot |
13:30:07 | audiofile54 | sorry, I'm used to python where ' and " are more or less same |
13:30:12 | audiofile54 | but funny that .echo works! |
13:30:16 | FromDiscord | <shadow.> audiofile omitting parentheses is command syntax iirc |
13:30:26 | audiofile54 | !eval bool 2 |
13:30:28 | NimBot | Compile failed: /usercode/in.nim(1, 6) Error: expression 'bool(2)' is of type 'bool' and has to be used (or discarded) |
13:30:33 | FromDiscord | <shadow.> or maybe its just considered part of ufcs |
13:30:42 | audiofile54 | so 3 ways are possiblee in ufcs?? |
13:30:51 | FromDiscord | <InventorMatt> yes, there are 3 ways |
13:30:55 | audiofile54 | !eval (bool 2).echo |
13:30:57 | NimBot | true |
13:31:01 | audiofile54 | lmaooo |
13:31:14 | audiofile54 | feeels like i've committed several cardinal sins at once |
13:31:19 | audiofile54 | and some warcrimes |
13:31:24 | FromDiscord | <shadow.> !eval 2.bool.echo |
13:31:26 | NimBot | true |
13:31:30 | FromDiscord | <shadow.> there ya go |
13:31:31 | FromDiscord | <shadow.> lmao |
13:31:32 | audiofile54 | B R U H |
13:31:40 | FromDiscord | <shadow.> it's nice for things such as .type and .len |
13:31:45 | FromDiscord | <shadow.> disruptek wrote a nice writeup on it |
13:31:50 | FromDiscord | <shadow.> https://gist.github.com/disruptek/6d0cd6774d05adaa894db4deb646fc1d |
13:31:52 | audiofile54 | ngl it is easier to read from left to right like that |
13:32:01 | FromDiscord | <Recruit_main707> Stop this |
13:32:03 | FromDiscord | <Recruit_main707> It hurts |
13:32:14 | FromDiscord | <InventorMatt> the only thing missing from that is case insensitivity |
13:32:16 | audiofile54 | thanks for link |
13:32:26 | audiofile54 | is disrupt the dude who is working on a nim fork |
13:32:46 | FromDiscord | <shadow.> !eval 0_0u8.INT.UINT_64.BOOL.eChO |
13:32:47 | FromDiscord | <shadow.> LMAO |
13:32:48 | NimBot | Compile failed: /usercode/in.nim(1, 6) Error: undeclared field: 'INT' for type system.uint8 [declared in /playground/nim/lib/system/basic_types.nim(9, 3)] |
13:32:52 | FromDiscord | <shadow.> darnnn |
13:33:01 | FromDiscord | <shadow.> !eval 0_0u8.UInT_64.BOOL.eChO |
13:33:04 | NimBot | Compile failed: /usercode/in.nim(1, 6) Error: undeclared field: 'UInT_64' for type system.uint8 [declared in /playground/nim/lib/system/basic_types.nim(9, 3)] |
13:33:11 | FromDiscord | <shadow.> rip |
13:33:19 | FromDiscord | <InventorMatt> !eval 0_0u8.iNT.uINT_64.bOOL.eChO |
13:33:19 | audiofile54 | whoa you can mix case like that? |
13:33:22 | NimBot | false |
13:33:26 | FromDiscord | <shadow.> LMAO |
13:33:27 | FromDiscord | <shadow.> yeah |
13:33:29 | audiofile54 | reads liike the spongebob retard talk lol |
13:33:34 | FromDiscord | <shadow.> you can mix case and put underscores anywhere you want |
13:33:40 | audiofile54 | wait WHAT |
13:33:42 | FromDiscord | <shadow.> in identifiers they don't really matter |
13:33:43 | FromDiscord | <InventorMatt> except for the first letter |
13:33:45 | FromDiscord | <shadow.> yeah |
13:33:52 | FromDiscord | <shadow.> ohh that's why mine didn't work haha |
13:34:10 | audiofile54 | !eval 2.b_o_ol.ecHO |
13:34:13 | NimBot | true |
13:34:16 | FromDiscord | <shadow.> ye |
13:34:20 | FromDiscord | <shadow.> lol |
13:34:25 | audiofile54 | now why would it be allowed |
13:34:28 | FromDiscord | <shadow.> i guess that allows people to use camelCase or snake_case |
13:34:30 | audiofile54 | trying to figure out le usecase |
13:34:34 | audiofile54 | ah |
13:34:38 | audiofile54 | but on standard types? |
13:34:42 | audiofile54 | i mean like your types |
13:34:45 | FromDiscord | <shadow.> camelCase is preferred |
13:35:04 | FromDiscord | <shadow.> rah this aoc is rly tripping me up lmao |
13:35:10 | FromDiscord | <shadow.> im using bfs but my answer is too high somehow |
13:35:13 | FromDiscord | <shadow.> dfs |
13:35:21 | FromDiscord | <InventorMatt> it's also incredibly useful if you ever forget to capitalize the second word |
13:35:34 | FromDiscord | <shadow.> true |
13:35:43 | FromDiscord | <shadow.> like `openarray` `openArray` |
13:35:53 | FromDiscord | <InventorMatt> one of the reasons I stopped learning java years ago was because I kept messing up capitalizations |
13:35:58 | FromDiscord | <lqdev> also `open_array` |
13:36:15 | FromDiscord | <lqdev> it eases the transition to a new language a little bit |
13:36:22 | FromDiscord | <shadow.> also because `thisCouldLegitimatelyBeAClassNameFactoryInitializer` |
13:36:27 | FromDiscord | <shadow.> lmfao |
13:36:31 | FromDiscord | <lqdev> but tbh i prefer to write Nim with camelCase, it looks weird with snake_case |
13:36:36 | FromDiscord | <shadow.> yeah i agreew |
13:36:37 | FromDiscord | <shadow.> agree |
13:36:41 | FromDiscord | <lqdev> like, C looks just fine |
13:36:41 | FromDiscord | <lqdev> C++ too |
13:36:44 | FromDiscord | <lqdev> python - eh |
13:36:50 | FromDiscord | <lqdev> but Nim - camelCase for life |
13:36:56 | audiofile54 | i propos SpOnGeBoBcAsE |
13:36:58 | FromDiscord | <shadow.> it's weird in c++ they say camelCase but stl uses snake_case |
13:37:04 | FromDiscord | <shadow.> to be fair c++ stl is pretty garbage |
13:37:07 | audiofile54 | s/propos/propose |
13:37:10 | FromDiscord | <lqdev> who says camelCase in C++ |
13:37:15 | audiofile54 | java |
13:37:19 | FromDiscord | <lqdev> i'mma go scold them |
13:37:36 | FromDiscord | <shadow.> most people say camelCase for functions and variables lol |
13:37:39 | FromDiscord | <shadow.> and PascalCase for classes ofc |
13:37:43 | audiofile54 | system.out.print.is.somewhere.in.this.package('hello world') <- java be like |
13:37:45 | FromDiscord | <InventorMatt> I sometimes change it based on what the word combo is and what looks best |
13:37:54 | FromDiscord | <shadow.> rah |
13:37:59 | FromDiscord | <shadow.> the only important thing is to be consistent |
13:38:07 | FromDiscord | <shadow.> mixing and matching is a nono in every language |
13:38:08 | FromDiscord | <shadow.> except for |
13:38:09 | FromDiscord | <shadow.> nim |
13:38:09 | FromDiscord | <shadow.> LMAO |
13:38:29 | FromDiscord | <InventorMatt> that's why we have style insensitivity so we can be inconsistent |
13:38:39 | FromDiscord | <shadow.> ye |
13:38:47 | * | tiorock joined #nim |
13:38:47 | * | tiorock quit (Changing host) |
13:38:47 | * | tiorock joined #nim |
13:38:47 | * | rockcavera is now known as Guest20776 |
13:38:47 | * | Guest20776 quit (Killed (hitchcock.freenode.net (Nickname regained by services))) |
13:38:47 | * | tiorock is now known as rockcavera |
13:38:51 | FromDiscord | <InventorMatt> besides the editor usually autocompletes it for you anyways |
13:38:58 | FromDiscord | <shadow.> nimsuggest is pretty spicy |
13:38:59 | audiofile54 | i bet people have set up formatters to format other people's code to their tastes |
13:39:08 | FromDiscord | <shadow.> ye |
13:39:23 | audiofile54 | not sure if there's a formatter that can do the underscore casing to camel hmm |
13:39:24 | FromDiscord | <shadow.> hmm |
13:39:28 | FromDiscord | <shadow.> this aoc is trippppingg me up |
13:39:39 | FromDiscord | <shadow.> yeah ofc lmao it wouldn't be too hard to make your own |
13:39:43 | audiofile54 | no politics >:( |
13:39:47 | audiofile54 | jk |
13:39:47 | FromDiscord | <shadow.> what- |
13:39:57 | FromDiscord | <shadow.> im not talking abt the politician lmfao |
13:40:05 | audiofile54 | aoc is a monitor and a us politician |
13:40:12 | FromDiscord | <shadow.> and advent of code? |
13:40:13 | FromDiscord | <shadow.> 2020 |
13:40:14 | FromDiscord | <shadow.> lmao |
13:40:16 | audiofile54 | oh |
13:40:20 | FromDiscord | <InventorMatt> https://forum.nim-lang.org/t/6497 you can always nuglify your code for optimal appearance |
13:40:22 | FromDiscord | <shadow.> that's what im referring to |
13:40:25 | FromDiscord | <shadow.> LOL |
13:40:29 | FromDiscord | <shadow.> WHAT |
13:40:38 | FromDiscord | <shadow.> love that |
13:40:53 | * | tiorock joined #nim |
13:41:19 | audiofile54 | it's crazy! |
13:41:25 | audiofile54 | I approve |
13:41:38 | audiofile54 | looks like something out of a cheese-fuelled nightmare |
13:41:55 | FromDiscord | <shadow.> lmao |
13:42:15 | audiofile54 | what is 4raq's reply saying below that? |
13:42:20 | audiofile54 | the \x codes |
13:42:21 | audiofile54 | are they hex? |
13:42:46 | FromDiscord | <shadow.> ascii? |
13:42:48 | FromDiscord | <shadow.> iirc |
13:43:16 | * | rockcavera quit (Ping timeout: 240 seconds) |
13:43:51 | audiofile54 | inventorymatt do you havea any more cool links like that? |
13:44:06 | FromDiscord | <shadow.> lmao |
13:44:16 | FromDiscord | <shadow.> did you look at the ufcs writeup i sent? |
13:44:23 | audiofile54 | yeeeee |
13:44:35 | FromDiscord | <shadow.> nvm those were unicode escape sequences |
13:44:41 | audiofile54 | good guidelines |
13:44:51 | FromDiscord | <shadow.> you could try aoc ;) |
13:44:55 | FromDiscord | <Rika> hello |
13:45:00 | FromDiscord | <Rika> oh man nuglifier |
13:45:03 | FromDiscord | <shadow.> yes |
13:45:08 | FromDiscord | <InventorMatt> I don't have any links I can think of at least for nim |
13:45:13 | FromDiscord | <Rika> i was there when it was being made lol |
13:45:16 | FromDiscord | <shadow.> lmaoo |
13:45:33 | FromDiscord | <shadow.> aoc day 7 is proving to be much much harder than day 6 |
13:45:33 | audiofile54 | i expect people who used solarized to write code like that xD |
13:45:37 | FromDiscord | <shadow.> or maybe im just making a dumb mistake |
13:45:38 | FromDiscord | <shadow.> i can tell |
13:45:41 | FromDiscord | <Rika> because nim is totally one of the languages where the source code is the binary /s |
13:45:44 | FromDiscord | <shadow.> cant |
13:45:46 | FromDiscord | <shadow.> lmfao |
13:45:48 | FromDiscord | <Rika> ehemjavascriptehem |
13:45:48 | audiofile54 | im still on aoc 0 |
13:45:54 | FromDiscord | <shadow.> rip |
13:45:57 | FromDiscord | <shadow.> you mean day !? |
13:45:58 | FromDiscord | <shadow.> 1? |
13:46:03 | FromDiscord | <Rika> day nil |
13:46:04 | audiofile54 | haven't started yet lmaooo |
13:46:07 | FromDiscord | <shadow.> smart |
13:46:12 | audiofile54 | planning to start in 2025 |
13:46:17 | FromDiscord | <shadow.> smh |
13:46:20 | FromDiscord | <Rika> 2025 will not come |
13:46:29 | audiofile54 | should give me enough time to complete other stuff im procrastinating |
13:46:30 | FromDiscord | <Rika> we will all be dead by 2022 because of economic collapse |
13:46:37 | FromDiscord | <shadow.> fair |
13:46:38 | audiofile54 | wow, cant wait! |
13:47:00 | FromDiscord | <Rika> ive been watching too many economics videos as you can tell |
13:47:11 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2H0S |
13:47:33 | FromDiscord | <shadow.> the answer is too high |
13:47:38 | FromDiscord | <Rika> let me read one moment |
13:47:40 | FromDiscord | <shadow.> kk |
13:48:12 | FromDiscord | <Rika> its messy to read because of the multiple intertwining of variables |
13:48:33 | * | NimBot joined #nim |
13:48:36 | FromDiscord | <Rika> !eval echo "im okay" |
13:48:38 | NimBot | im okay |
13:48:40 | FromDiscord | <Rika> lol |
13:48:44 | audiofile54 | lmao he bacc |
13:48:50 | FromDiscord | <Rika> not for u tho |
13:48:53 | audiofile54 | the bot left for a bit |
13:48:58 | FromDiscord | <Rika> i dont see the gg |
13:49:04 | audiofile54 | yeah that's why I did gg |
13:49:09 | audiofile54 | cuz it left irc |
13:49:22 | FromDiscord | <Rika> has to take a break |
13:49:42 | FromDiscord | <Rika> bots have rights too you know |
13:49:46 | FromDiscord | <shadow.> rip |
13:49:52 | FromDiscord | <shadow.> should i put my code on hatebin? |
13:49:54 | FromDiscord | <shadow.> or ix |
13:50:12 | audiofile54 | hatebin? |
13:50:15 | FromDiscord | <Rika> ixbin |
13:50:22 | FromDiscord | <shadow.> https://play.nim-lang.org/#ix=2H0V |
13:50:24 | FromDiscord | <Rika> hateix |
13:50:24 | audiofile54 | is there an s missing there or nah |
13:50:29 | FromDiscord | <Rika> no |
13:50:29 | FromDiscord | <shadow.> nope |
13:50:32 | FromDiscord | <shadow.> there's hastebin |
13:50:33 | FromDiscord | <shadow.> pastebin |
13:50:33 | audiofile54 | lmao rly? |
13:50:34 | FromDiscord | <shadow.> and hatebin |
13:50:37 | FromDiscord | <Rika> shatebin |
13:50:39 | FromDiscord | <Rika> xd |
13:50:41 | FromDiscord | <shadow.> lol |
13:50:43 | audiofile54 | hatebin for hatespeech |
13:50:46 | FromDiscord | <shadow.> lmk if there's an obvious flaw in the second part |
13:50:53 | FromDiscord | <shadow.> if it's not obvious ill just dig into it myself |
13:50:58 | FromDiscord | <Rika> basedbin |
13:51:03 | FromDiscord | <shadow.> lmamo |
13:51:05 | FromDiscord | <shadow.> lmaoo |
13:51:10 | FromDiscord | <Rika> day one??? damn let me read the proble |
13:51:14 | FromDiscord | <shadow.> nono |
13:51:16 | FromDiscord | <shadow.> this is day 7 |
13:51:22 | audiofile54 | he dissing you m8 |
13:51:23 | FromDiscord | <shadow.> LMAO |
13:51:25 | FromDiscord | <shadow.> solvePartOne |
13:51:26 | FromDiscord | <shadow.> my bad |
13:51:48 | FromDiscord | <Rika> man fuck not this again i dont wanna do aoc again aaa |
13:51:50 | FromDiscord | <shadow.> i woke up at 7am not my fault :blobpain: |
13:51:54 | FromDiscord | <shadow.> rahh |
13:51:57 | FromDiscord | <Rika> i fizzled out last year because its not my thing |
13:51:58 | FromDiscord | <shadow.> no worries |
13:52:03 | FromDiscord | <shadow.> ill figure out why my answer is |
13:52:05 | FromDiscord | <shadow.> too high |
13:52:06 | FromDiscord | <shadow.> lol |
13:52:07 | FromDiscord | <Rika> so whats the issue |
13:52:40 | FromDiscord | <Rika> you know tuples can be var in nim |
13:52:50 | FromDiscord | <Rika> you dont need to remake the tuple in line 7 and 8 |
13:52:56 | FromDiscord | <Rika> its not python |
13:53:08 | FromDiscord | <shadow.> lemme look |
13:53:25 | FromDiscord | <shadow.> wdym? |
13:53:32 | ForumUpdaterBot | New thread by V3ss3n: Nim Lang requires a proper standard for coding, see https://forum.nim-lang.org/t/7219 |
13:53:54 | FromDiscord | <Rika> sent a code paste, see https://play.nim-lang.org/#ix=2H0W |
13:54:21 | FromDiscord | <shadow.> oh yeah i know |
13:54:30 | FromDiscord | <shadow.> but parsed should be a tuple not seq right |
13:54:33 | FromDiscord | <shadow.> and that would make it a seq |
13:54:42 | FromDiscord | <starl0rd> uhm, can i generalize that if its not a ref or ptr object, it will probably be a value type ? |
13:54:43 | FromDiscord | <shadow.> because split() returns seq |
13:54:44 | FromDiscord | <Rika> oh i see |
13:54:47 | FromDiscord | <Rika> i misunderstood |
13:54:52 | FromDiscord | <shadow.> yeah i really needa make an unpack macro somehow lmao |
13:55:14 | FromDiscord | <shadow.> or somethin idk |
13:55:25 | FromDiscord | <Rika> have fun figuring it out |
13:55:30 | FromDiscord | <Rika> because i aint xddddddddddddddddddddddddddddd |
13:56:31 | FromDiscord | <shadow.> lmaoo |
13:56:41 | FromDiscord | <shadow.> i've never been good at these type of questions |
13:56:49 | FromDiscord | <shadow.> i saw a competitive programmer solving something similar with airline flights |
13:56:58 | FromDiscord | <shadow.> and i was just |
13:57:01 | FromDiscord | <shadow.> my brain stopped functioning |
13:57:11 | FromDiscord | <Rika> my brain works its just not fun |
13:57:19 | audiofile54 | brain? |
13:57:25 | FromDiscord | <shadow.> whats that |
13:57:26 | FromDiscord | <Rika> oof |
13:57:54 | FromDiscord | <Rika> i mean i guess some organisms live without an actual brain |
13:58:42 | FromDiscord | <Rika> man i can type so fast sometimes that my thinkpad's keyboard cant keep up |
13:59:03 | FromDiscord | <Rika> it does this beeping thing indicating the keystroke is (sometimes almost) ambiguous |
13:59:13 | FromDiscord | <shadow.> lmfao same my phone does that |
14:08:07 | audiofile54 | how check string uppercase? |
14:08:14 | audiofile54 | isupperascii is only for char |
14:08:26 | audiofile54 | !eval "abc".isupperascii.echo |
14:08:27 | NimBot | Compile failed: /usercode/in.nim(1, 6) Error: undeclared field: 'isupperascii' for type system.string [declared in /playground/nim/lib/system.nim(34, 3)] |
14:08:37 | narimiran | audiofile54: you write a for loop? |
14:08:39 | audiofile54 | !eval import strutils; "abc".isupperascii.echo |
14:08:41 | NimBot | Compile failed: /usercode/in.nim(1, 23) Error: type mismatch: got <string> |
14:08:51 | audiofile54 | no single function for strings? |
14:08:57 | FromDiscord | <shadow.> make one |
14:09:01 | audiofile54 | or is there something like all() from python |
14:09:10 | audiofile54 | all(<str>, isupperascii) |
14:09:13 | FromDiscord | <shadow.> i mean we don't have generators so |
14:09:13 | narimiran | ~ninp |
14:09:14 | disbot | ninp: 11nim is not python!! -- narimiran |
14:09:24 | FromDiscord | <InventorMatt> you could probably use map to get it in one line |
14:09:29 | FromDiscord | <shadow.> aaaa please don't |
14:09:30 | FromDiscord | <shadow.> lmao |
14:09:35 | FromDiscord | <shadow.> there's zero reason to condense shit into one line |
14:09:38 | audiofile54 | yes but why not?? |
14:09:41 | audiofile54 | >:( |
14:09:46 | FromDiscord | <shadow.> because it's harder to read |
14:09:49 | narimiran | audiofile54: it is ambiguous |
14:10:01 | narimiran | audiofile54: is "THIS HERE" upper ascii? |
14:10:01 | audiofile54 | oh ok |
14:10:15 | audiofile54 | ...space but yes |
14:10:28 | FromDiscord | <shadow.> doesn't it just check that there's no lower ascii in it? |
14:10:31 | narimiran | audiofile54: is "THIS_HERE!?" upper ascii? |
14:10:39 | audiofile54 | nien |
14:10:40 | audiofile54 | nein |
14:10:54 | narimiran | so, space is upper? but `_?!` aren't? |
14:11:00 | audiofile54 | space isn't! |
14:11:22 | FromDiscord | <shadow.> lmao |
14:11:23 | audiofile54 | i mean, ideally i was looking for a function to just check if the alphabets are uppercase |
14:11:33 | FromDiscord | <shadow.> then just loop through every letter |
14:11:40 | FromDiscord | <shadow.> and ensure it's not `isLowerAscii()` |
14:11:48 | audiofile54 | life is too short to loop through every letter T-T |
14:11:49 | FromDiscord | <starl0rd> . |
14:11:56 | FromDiscord | <shadow.> that's what every function does |
14:11:59 | FromDiscord | <Rika> thestr.toUpperAscii() == thestr |
14:12:00 | FromDiscord | <starl0rd> (edit) "." => "anyone ?" |
14:12:00 | FromDiscord | <Rika> or whatever |
14:12:00 | narimiran | audiofile54: also too short to write python in nim |
14:12:23 | FromDiscord | <shadow.> true |
14:12:25 | FromDiscord | <Rika> i believe you also have to add that its not a var object |
14:12:25 | audiofile54 | just looking for equivalent my dudes, no need for pitchforks now |
14:12:52 | FromDiscord | <starl0rd> ? |
14:13:04 | FromDiscord | <shadow.> var T |
14:13:07 | FromDiscord | <shadow.> as type |
14:13:15 | narimiran | audiofile54: maybe this will help? https://github.com/nim-lang/Nim/wiki/Nim-for-Python-Programmers |
14:13:20 | FromDiscord | <Rika> like `proc a(b: var int)` is passed by pointer |
14:15:12 | audiofile54 | Any downside to ` thestr.toUpperAscii() == thestr` ? |
14:16:20 | FromDiscord | <shadow.> uhhhh |
14:16:34 | audiofile54 | extra memory? |
14:16:36 | mipri | it requires allocation, which you can avoid |
14:16:44 | audiofile54 | yeee ok! |
14:16:56 | FromDiscord | <Rika> sequtils has an all i believe |
14:17:05 | mipri | for c in thestr: if c in {'a'..'z'}: return false |
14:17:14 | FromDiscord | <Rika> https://nim-lang.org/docs/sequtils.html#all%2CopenArray%5BT%5D%2Cproc%28T%29 |
14:17:14 | audiofile54 | so i set a bool flag to true and if anywhere in the loop i see nonuppercase i set to false and break ? |
14:17:28 | FromDiscord | <Rika> all(thestr, isUpperAscii) |
14:17:30 | FromDiscord | <Rika> i think |
14:17:34 | audiofile54 | oh hm |
14:17:38 | FromDiscord | <shadow.> well that wouldn;t |
14:17:40 | FromDiscord | <shadow.> wouldnt |
14:17:43 | audiofile54 | yeah *that's* what i was looking for! |
14:17:44 | FromDiscord | <shadow.> ignore non letters |
14:17:48 | audiofile54 | oh why not hm |
14:17:49 | FromDiscord | <Rika> that is true |
14:17:53 | audiofile54 | wdym |
14:17:59 | audiofile54 | pll explain |
14:17:59 | FromDiscord | <shadow.> just do like |
14:18:04 | FromDiscord | <shadow.> here lemme make one one sec |
14:18:09 | audiofile54 | kk |
14:18:15 | FromDiscord | <Rika> in the docs, 7 is not upper ascii |
14:18:26 | audiofile54 | this is weird man what do you consider ascii |
14:18:31 | FromDiscord | <Rika> so youll have to distinguish alphabetic and non alphabetic |
14:18:33 | audiofile54 | alphanumeric? |
14:18:34 | FromDiscord | <shadow.> you can do that |
14:18:35 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2H17 |
14:18:53 | FromDiscord | <shadow.> and import sequtils ofc |
14:18:54 | FromDiscord | <Rika> 7 is still not lower ascii |
14:19:00 | FromDiscord | <shadow.> exactly |
14:19:15 | FromDiscord | <shadow.> i think he would consider "I AM 7 YEARS OLD" upper ascii |
14:19:16 | FromDiscord | <Rika> hm i guess that works yeah |
14:19:28 | FromDiscord | <shadow.> he just wants to make sure there are no lowercase letters |
14:19:33 | FromDiscord | <shadow.> which in that case my solution should work |
14:19:52 | FromDiscord | <Rika> okay |
14:19:58 | FromDiscord | <Rika> i'm a bit oxygen deprived |
14:20:10 | audiofile54 | wots wrong https://play.nim-lang.org#ix=2H19 |
14:20:12 | FromDiscord | <shadow.> lmao |
14:20:22 | audiofile54 | Rika are you underwater |
14:20:30 | FromDiscord | <shadow.> strutils |
14:20:33 | FromDiscord | <shadow.> you needa input strutils lol |
14:20:38 | audiofile54 | oh damn |
14:20:43 | FromDiscord | <Rika> no i biked for a few km a few minutes ago |
14:20:43 | audiofile54 | looks like im the one who needs O2 |
14:21:43 | audiofile54 | ah https://play.nim-lang.org#ix=2H1a |
14:21:46 | FromDiscord | <shadow.> also you dont need the parentheses in this case |
14:21:49 | FromDiscord | <shadow.> `echo all("abcd", c => not c.isLowerAscii)` works |
14:22:10 | audiofile54 | i wish compiler would suggest missing imports from stdlib |
14:22:15 | audiofile54 | or is that nimsuggest's job |
14:22:27 | narimiran | how would that work |
14:22:59 | audiofile54 | ayo you missed X |
14:23:04 | audiofile54 | and X is here lmao |
14:23:10 | FromDiscord | <shadow.> wha |
14:23:16 | narimiran | how would that work |
14:23:32 | FromDiscord | <shadow.> i mean it has been done in languages in java |
14:23:33 | FromDiscord | <shadow.> auto import |
14:23:37 | audiofile54 | if I do all(...) compiler be like "ayo all is in sequtils lol" |
14:23:44 | FromDiscord | <shadow.> i mean |
14:23:45 | narimiran | how would that work |
14:23:49 | FromDiscord | <shadow.> LMAO |
14:23:53 | audiofile54 | huh? |
14:23:57 | FromDiscord | <shadow.> im guessing he wants it to search every proc in every package every time you make a keystroke |
14:24:03 | FromDiscord | <shadow.> lmao |
14:24:13 | audiofile54 | just need to check stdlib for overlap |
14:24:18 | FromDiscord | <shadow.> i mean to be fair it has been done in java |
14:24:20 | audiofile54 | store in a hashmap or something idc |
14:24:25 | audiofile54 | yeah |
14:24:31 | audiofile54 | just sayin |
14:24:35 | FromDiscord | <shadow.> but im surprised a python dev is asking for this |
14:24:36 | FromDiscord | <Rika> itll bloat compile time |
14:24:43 | audiofile54 | im not a python dev? |
14:24:48 | FromDiscord | <shadow.> hmmm |
14:24:51 | FromDiscord | <shadow.> biggest lie ive ever heard |
14:24:56 | FromDiscord | <shadow.> lol |
14:25:06 | FromDiscord | <shadow.> what language do you come from? |
14:25:12 | audiofile54 | C++ -> Java -> Python -> Go -> Brainfk -> Nim |
14:25:12 | FromDiscord | <InventorMatt> it could be done only if a proc is missing which wouldn't mess up most compiletimes |
14:25:18 | audiofile54 | among other detours which I shall not mention |
14:25:21 | FromDiscord | <shadow.> why would you include brainfuck |
14:25:25 | narimiran | "just need to check stdlib for overlap". yeah, "just" |
14:25:33 | audiofile54 | that's what nim feels like to me now xD |
14:25:35 | FromDiscord | <shadow.> what is the largest project you have made in brainfuck |
14:25:47 | audiofile54 | hm I think printing 42 to stdout |
14:25:54 | FromDiscord | <shadow.> then dont include it |
14:25:57 | FromDiscord | <shadow.> lmao |
14:26:00 | audiofile54 | ok sire |
14:26:09 | audiofile54 | pretty sure I wrote a brainfk compiler in one of those languages |
14:26:15 | audiofile54 | but yeeee whatever |
14:26:33 | audiofile54 | i like piet too |
14:27:01 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2H1d |
14:27:02 | FromDiscord | <shadow.> "yeah im a brainfuck dev" |
14:27:03 | FromDiscord | <shadow.> lmao |
14:27:14 | FromDiscord | <shadow.> i suppose it is turing complete |
14:27:17 | FromDiscord | <shadow.> so say what you will lmao |
14:30:53 | * | haxscramper joined #nim |
14:31:05 | FromDiscord | <shadow.> idk why im talking i just made a brainfuck interpreter in nim like 2 days ago |
14:31:39 | * | haxscramper left #nim (#nim) |
14:32:27 | FromDiscord | <Esbeesy> Alright, day 7. |
14:32:36 | FromDiscord | <ache of head> dang |
14:32:48 | FromDiscord | <ache of head> discord has syntax highlighting for brainf? |
14:33:16 | FromDiscord | <shadow.> e |
14:33:17 | FromDiscord | <shadow.> ye |
14:33:20 | FromDiscord | <shadow.> you're trying it? |
14:33:23 | FromDiscord | <Esbeesy> Yeah, it uses CodeHilite and Pygment |
14:33:24 | FromDiscord | <shadow.> also i figured out my issue rika |
14:33:40 | FromDiscord | <shadow.> i think it was if one bag had multiple child bags it was still counting |
14:33:52 | FromDiscord | <Esbeesy> Just finished it shadow - Whipped out that npeg library again 😂 Thanks zevv |
14:33:58 | FromDiscord | <shadow.> damnn |
14:34:00 | FromDiscord | <shadow.> i really need to learn npeg |
14:34:03 | FromDiscord | <shadow.> but i dont understand it lmao |
14:34:10 | FromDiscord | <shadow.> it'll click eventually |
14:34:27 | FromDiscord | <shadow.> im guessing its easier than my janky regex / strscans approach |
14:34:38 | PMunch | @Esbeesy, did you just finish todays AoC in about a minute? |
14:34:40 | FromDiscord | <Esbeesy> I don't tbf, there were a few matches I wrote that didn't work, for example +(word Space) didn't match anything but (word Space)[2] worked every time |
14:35:37 | FromDiscord | <shadow.> rip solved it |
14:35:45 | FromDiscord | <Esbeesy> God no pmunch, took me about half an hour to figure out the npeg parsing, an hour to do part 1, and then smashed part 2 in like 10 seconds haha |
14:35:48 | FromDiscord | <shadow.> welp |
14:35:54 | FromDiscord | <shadow.> the parsing took me about 2 minutes |
14:35:57 | FromDiscord | <shadow.> but this last part |
14:36:02 | PMunch | Haha, okay :P |
14:36:02 | FromDiscord | <shadow.> had me tripped up for 30 mins |
14:36:08 | FromDiscord | <shadow.> before i realized one parent bag only counted for one point |
14:36:16 | narimiran | best task this year? |
14:36:18 | FromDiscord | <shadow.> man do i love iterative dfs / bsf |
14:36:26 | FromDiscord | <shadow.> bfs |
14:36:34 | FromDiscord | <shadow.> i used dfs here but it makes no difference lmao |
14:36:50 | PMunch | According to my filesystem I downloaded input.txt at 9:01, then part2 was compiled at 9:38 |
14:37:02 | FromDiscord | <shadow.> LMAO |
14:37:04 | PMunch | So it took me just over half an hour to solve the whole thing |
14:37:07 | FromDiscord | <shadow.> i really needa learn npeg rahh |
14:37:14 | FromDiscord | <shadow.> alr lemme see part two |
14:37:21 | PMunch | http://ix.io/2GYV |
14:38:20 | FromDiscord | <shadow.> oh no i meant lemme take a stab at it |
14:38:23 | FromDiscord | <shadow.> i havent even tried it yet lmao |
14:38:26 | narimiran | PMunch: i needed half an hour just for part2, because at 6am only thing i know is iteration, and my logic was wrong :) |
14:38:57 | narimiran | but generally, part2 feels easier than part1 |
14:39:12 | FromDiscord | <shadow.> hmm |
14:39:18 | FromDiscord | <shadow.> im guessing bfs will work here lmao |
14:39:28 | FromDiscord | <Esbeesy> https://github.com/sambeckingham/advent-of-code-2020/blob/main/day7/day7.nim↵↵Compare notes? |
14:40:18 | narimiran | `("bags" | "bag")` -- is it ever just "bag"? |
14:40:31 | * | audiofile quit (Quit: Connection closed) |
14:40:55 | * | audiofile54 quit (Quit: Connection closed) |
14:41:00 | FromDiscord | <Esbeesy> Yeah if it's got a count of 1 |
14:41:11 | FromDiscord | <shadow.> damn |
14:41:11 | FromDiscord | <shadow.> hmm |
14:41:19 | PMunch | narimiran, yup |
14:41:22 | narimiran | oh, right. |
14:41:26 | FromDiscord | <Esbeesy> https://media.discordapp.net/attachments/371759389889003532/785516319730303016/unknown.png |
14:41:26 | PMunch | At least in my input set |
14:41:35 | narimiran | good thing i used scanf and ignored that |
14:41:39 | PMunch | Haha :P |
14:42:01 | FromDiscord | <Esbeesy> Man I butchered it with scanf, immediately fell back to npeg. |
14:42:03 | PMunch | I think part2 just feels easier because you have a good solution to part1 |
14:42:21 | FromDiscord | <Esbeesy> Yeah it was just totalling the counts, super easy |
14:42:28 | PMunch | If you do something weird that makes part1 super non-exandable then you basically have to rewrite the whole thing for day2 |
14:42:31 | PMunch | part2* |
14:43:07 | Zevv | i usually hack together day one, put some effort in day2 which then often accomodates part1 more nicely |
14:43:47 | FromDiscord | <Esbeesy> Did that for day 6. I find you can usually guess where part 2 is gonna go in advance, but Day 6 totally caught me off guard |
14:44:06 | FromDiscord | <Esbeesy> I'd also never come across countTable when I was doing part 1, but it made both parts super easy |
14:44:48 | FromDiscord | <shadow.> for day 6? |
14:44:50 | FromDiscord | <shadow.> or day 7 |
14:47:15 | FromDiscord | <Esbeesy> 6 |
14:47:53 | FromDiscord | <Esbeesy> http://ix.io/2H1q |
14:48:28 | FromDiscord | <shadow.> ohh ok |
14:48:36 | FromDiscord | <shadow.> day 6 was surprisingly easy |
14:48:41 | FromDiscord | <shadow.> i finished day 7 part 1 lol |
14:48:44 | FromDiscord | <shadow.> ima switch to npeg after |
14:49:30 | PMunch | @Esbeesy, ah I see you just wrote a parser for a single line and then just loop that |
14:49:35 | narimiran | CountTable for day 6? |
14:50:19 | PMunch | And I guess I was a bit more strict about my ','s :P |
14:51:11 | * | Tanger quit (Remote host closed the connection) |
14:51:31 | PMunch | What does `inc acc, count * multi` do? |
14:52:48 | narimiran | increases acc by count*multi? |
14:53:12 | PMunch | Really? I thought `inc` was a unary |
14:53:31 | PMunch | So it's just another way to write `acc += count*multi`? |
14:53:47 | FromDiscord | <Esbeesy> Inc has a default param set to 1 |
14:53:54 | FromDiscord | <Esbeesy> Yeah exact my that |
14:54:00 | FromDiscord | <Esbeesy> (edit) "exact my" => "exactly" |
14:55:14 | * | waleee-cl joined #nim |
14:55:31 | FromDiscord | <Esbeesy> @Narimiran yeah CountTable for day 6 😂 I’m new to Nim, everything’s a shiny new toy for me |
14:55:34 | PMunch | Huh, TIL |
14:56:36 | PMunch | Updated my repo by the way, just missing day 4.. https://github.com/PMunch/aoc2020 |
14:58:01 | FromDiscord | <shadow.> im so confused about day 7 part 2 lmao |
14:59:00 | PMunch | Just a simple recursion once you have the rules parsed ;) |
14:59:20 | PMunch | Oop, I've gotta go |
14:59:31 | FromDiscord | <shadow.> ahh ok i see |
14:59:40 | * | PMunch quit (Quit: leaving) |
14:59:45 | * | hoijui joined #nim |
15:00:41 | narimiran | you can do it even without recursion :P |
15:00:47 | narimiran | but don't :D |
15:05:10 | FromDiscord | <shadow.> lmao |
15:05:13 | FromDiscord | <shadow.> i never use recursion |
15:05:38 | FromDiscord | <shadow.> i probably just wasted so much memory with this solution but idc |
15:05:42 | FromDiscord | <shadow.> lmaoo |
15:06:11 | FromDiscord | <shadow.> kk solved it |
15:06:25 | FromDiscord | <shadow.> wow im 41 now yay |
15:06:47 | FromDiscord | <shadow.> im coming for you pmunch https://media.discordapp.net/attachments/371759389889003532/785522702085652580/unknown.png |
15:07:00 | FromDiscord | <shadow.> alr time to learn npeg |
15:08:08 | * | Cthalupa quit (Ping timeout: 260 seconds) |
15:09:06 | FromDiscord | <lytedev> thanks, PMunch! didn't realize you can pass peg a block! mine's wrapped in a string haha https://github.com/lytedev/advent-of-code/blob/master/2020/src/day7.nim |
15:09:22 | * | Cthalupa joined #nim |
15:10:56 | FromDiscord | <Esbeesy> Shadow how did you do it without recursion? |
15:11:54 | FromDiscord | <shadow.> for part one? |
15:12:26 | FromDiscord | <shadow.> https://play.nim-lang.org/#ix=2H1J |
15:12:38 | FromDiscord | <shadow.> welp that's part two |
15:12:59 | FromDiscord | <shadow.> i know i should have used math instead of having some 1gb wide queue |
15:13:01 | FromDiscord | <shadow.> but idc |
15:13:02 | FromDiscord | <shadow.> lol |
15:13:03 | FromDiscord | <shadow.> cba rn |
15:13:23 | FromDiscord | <shadow.> https://play.nim-lang.org/#ix=2H1L |
15:13:27 | FromDiscord | <shadow.> there i added part one |
15:17:57 | FromDiscord | <shadow.> 1gb memory is better |
15:17:59 | FromDiscord | <shadow.> smh |
15:18:07 | FromDiscord | <shadow.> i have 24gb might as well use it 🙄 🙄 |
15:18:19 | FromDiscord | <shadow.> reminds me of when i made an n-puzzle-solver and i opened my ram usage and it was at like 4gb LMAO |
15:18:32 | FromDiscord | <shadow.> @Esbeesy how did you make your parser? |
15:18:34 | FromDiscord | <shadow.> im interested in learning npeg |
15:28:37 | Zevv | so what would you need for that |
15:30:43 | FromDiscord | <shadow.> hmm |
15:30:48 | FromDiscord | <shadow.> a manual or docs |
15:30:55 | FromDiscord | <shadow.> im reading the github page rn |
15:31:00 | FromDiscord | <shadow.> but im guessing i should learn normal pegs first? |
15:33:10 | Zevv | there's not such thing as "normal" pegs |
15:33:13 | * | habamax quit (Ping timeout: 264 seconds) |
15:33:17 | narimiran | :) |
15:33:19 | Zevv | and the nim pegs lib is not harder or easier then npeg |
15:34:13 | Zevv | take the example from the quickstart |
15:34:20 | Zevv | copy it into your file, and start from there |
15:34:27 | Zevv | does all of that example make sense? |
15:34:47 | FromDiscord | <shadow.> lemme take a look |
15:34:58 | FromDiscord | <lytedev> looks like npeg more easily lets you build your AST, though |
15:35:28 | FromDiscord | <lytedev> or I misunderstand how to use pegs =D |
15:35:47 | FromDiscord | <lytedev> pegs also limits you to 20 captures within a single parse since it's using PCRE |
15:35:53 | Zevv | building ASTs is always a bit fiddly, I have not found one single way that works for everything. |
15:36:13 | Araq | buildAst |
15:36:16 | Araq | new in fusion |
15:36:17 | FromDiscord | <shadow.> oh hey araq |
15:36:25 | Araq | hey |
15:36:43 | FromDiscord | <shadow.> hm alr zevv ill take a look at the quick start lol |
15:37:50 | FromDiscord | <lytedev> that's for Nim's AST specifically, right? I meant the AST from a parser such as was useful for AoC today |
15:38:19 | FromDiscord | <shadow.> im confused on the significance of "pairs"? |
15:38:35 | FromDiscord | <shadow.> like passing it to the peg function |
15:39:15 | Araq | lytedev: ah yeah |
15:40:07 | Zevv | shadow.: it's just a collection of named rules that call eachother. The top level (aka "main") rule is the one named in the peg definition. |
15:40:17 | Zevv | so "pairs" is the rule where parsing starts in the example |
15:40:27 | FromDiscord | <shadow.> ahh i see ok |
15:40:35 | FromDiscord | <shadow.> hmm |
15:40:35 | * | hoijui quit (Quit: Leaving) |
15:40:57 | FromDiscord | <shadow.> ahh im starting to get it |
15:43:45 | FromDiscord | <shadow.> if + means one or more is there something for just one? |
15:44:45 | Zevv | right. that's all in the manual, pretty elaborate |
15:44:57 | Zevv | read https://github.com/zevv/npeg#syntax |
15:45:00 | FromDiscord | <shadow.> ty |
15:49:01 | FromDiscord | <Esbeesy> With great difficulty 😂 There were things that I thought would work that didn't, like +(+Alpha Space) not matching when (+Alpha Space)[2] did. |
15:49:45 | FromDiscord | <shadow.> hmm |
15:49:56 | FromDiscord | <shadow.> yeah im working on it rn haha |
15:50:09 | FromDiscord | <Esbeesy> Cause I thought +(+Alpha Space) would be equivalent to (+Alpha Space)[1 .. infinity] essentially |
15:50:17 | FromDiscord | <Esbeesy> But apparrently not |
15:50:24 | FromDiscord | <shadow.> yeah i would assume the same that's weird |
15:50:44 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2H28 |
15:50:50 | FromDiscord | <shadow.> and idek if that's correct lol |
15:50:59 | FromDiscord | <shadow.> now i needa make children |
15:51:50 | FromDiscord | <shadow.> ok that was not the way to phrase that |
15:51:54 | FromDiscord | <Esbeesy> Lmao |
15:52:00 | FromDiscord | <shadow.> LOL |
15:52:23 | * | Torro left #nim ("bye") |
15:52:40 | FromDiscord | <shadow.> what happens when you put a colon after a line? |
15:52:41 | FromDiscord | <shadow.> what does that do |
15:53:29 | Zevv | +(+Alpha Space) is a sytnax error |
15:53:39 | Zevv | you mean +(+Alpha * Space) |
15:53:44 | FromDiscord | <Esbeesy> Lol I was just about to ask you if you could explain what I was doing wrong |
15:53:48 | FromDiscord | <Esbeesy> YEah that#s what I meant |
15:53:57 | Zevv | which indeed means 'one or more times (one or more Alpha followed by one space) |
15:54:04 | FromDiscord | <Esbeesy> http://ix.io/2H1p |
15:54:26 | FromDiscord | <Esbeesy> Actually that's a mistake, the top string should have " bags" after it |
15:54:37 | FromDiscord | <lytedev> then that's why =D |
15:54:49 | narimiran | space after beige missing? |
15:54:58 | FromDiscord | <Esbeesy> lmao no I was just trying to send an example for Zevv to illustrate the point |
15:55:02 | FromDiscord | <Esbeesy> but in my haste fucked it up |
15:55:13 | Zevv | right. space missing |
15:55:33 | narimiran | lmao yes :P |
15:56:05 | Zevv | but to be clear: they both do match |
15:56:08 | Zevv | but don't match the full subject |
15:56:27 | Zevv | pegs don't care if they don't match all, if you don't ask for that explicitly |
15:58:18 | * | hnOsmium0001 joined #nim |
15:58:18 | * | luis1 quit (Ping timeout: 244 seconds) |
15:58:41 | * | luis1 joined #nim |
15:59:39 | FromDiscord | <Esbeesy> https://play.nim-lang.org/#ix=2H1L |
16:00:08 | narimiran | oh you didn't! |
16:00:22 | FromDiscord | <Esbeesy> So the second one, which doesn't match, I would have thought would match? |
16:00:24 | narimiran | you add to queue N times of the same thing? madlad! |
16:00:38 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2H2d |
16:01:23 | FromDiscord | <shadow.> can i use variables inside of it? |
16:01:32 | FromDiscord | <Esbeesy> yes |
16:01:36 | FromDiscord | <shadow.> oh damn |
16:02:32 | FromDiscord | <shadow.> so my color (key) and child (digit) are in diff blocks |
16:02:38 | FromDiscord | <shadow.> so how would i set ruleMap[color] = digit |
16:02:48 | Zevv | rulemap[$1] = $0 |
16:03:00 | Zevv | if you have them in 2 places, save one in a tmp var |
16:03:10 | FromDiscord | <shadow.> ahh ok i see |
16:03:11 | FromDiscord | <shadow.> lemme try |
16:03:38 | FromDiscord | <shadow.> vars are accessible cross-block? |
16:03:44 | FromDiscord | <shadow.> not sure how this (macro?) works sorry |
16:03:53 | Zevv | for simple things you can just use variables from outer scopes, or if youre a purist, you can pass a var of a type of your own choice as parser state, but that's for advanced usage |
16:04:03 | Zevv | shadow.: really, look in the examples |
16:04:04 | Zevv | it's all there |
16:04:23 | FromDiscord | <shadow.> ahh ok thanks |
16:04:33 | FromDiscord | <shadow.> can you send a link to the examples |
16:04:42 | Zevv | in the manual |
16:04:42 | FromDiscord | <lqdev> !repo npeg |
16:04:43 | disbot | https://github.com/zevv/npeg -- 9npeg: 11PEGs for Nim, another take 15 131⭐ 7🍴 |
16:04:47 | FromDiscord | <shadow.> oh alr |
16:05:09 | Zevv | I feel the manual is a bit top-heavy for new users |
16:05:25 | Zevv | there should probably be a tutorial-style thing as well |
16:05:29 | Zevv | but I can't bother to write one |
16:05:36 | FromDiscord | <Esbeesy> Haha, I know that feeling |
16:06:01 | FromDiscord | <Esbeesy> The docs still provide good coverage though |
16:06:06 | FromDiscord | <lytedev> yeah it assumes the user knows a good bit about parsers |
16:07:21 | FromDiscord | <shadow.> yeahh ive really only worked with regex lol |
16:07:23 | FromDiscord | <shadow.> but ill figure it out |
16:08:36 | FromDiscord | <Esbeesy> Just realised I didn't even do the coolest part: Generate a diagram! |
16:09:36 | * | hmmmmm joined #nim |
16:10:03 | disruptek | weird. |
16:10:28 | disruptek | cuckoo filter /does/ make me happy. |
16:10:36 | Zevv | you are a funny man |
16:11:40 | hmmmmm | doods how do I scribble-scrabble the manifest of my exe so I can have my spiffy gorilla.ico showing on the icon |
16:11:41 | Zoom[m] | <narimiran "best task this year?"> I actually think it's the worst problem yet. The problem screams 'recursion' and parsing the input doesn't add anything meaningful to the task, just complicates it. |
16:12:38 | FromDiscord | <lqdev> hmmmmm: there's https://github.com/electron/rcedit |
16:12:43 | FromDiscord | <Esbeesy> I was saying this to a friend, I feel more like I'm exercising my input parsing skills than figuring out how to solve problems. Which is fine but I want to learn Nim |
16:13:01 | Zevv | but now everyone is learning npeg \o/ |
16:13:05 | FromDiscord | <Esbeesy> Not just.. npeg. |
16:13:10 | Zevv | muhahaa |
16:13:15 | FromDiscord | <Esbeesy> Lmao I love it though |
16:13:31 | disruptek | too bad so much effort is spent to obfuscate input. |
16:13:44 | narimiran | Zoom[m]: from what i can tell, most of the solutions i've seen use only one Table (`{bag: smallerBags}`) |
16:14:03 | FromDiscord | <Esbeesy> Any of you folks used Elm? That has a really interesting parser |
16:14:09 | FromDiscord | <lytedev> IMO, a tiny parser to extract the bits you need makes perfect sense |
16:14:09 | narimiran | i went with two tables, and now i'm questioning my choice :D |
16:14:23 | FromDiscord | <lytedev> I've used Elm a handful of times |
16:14:23 | hmmmmm | great lqdev, this tool helps with bundling the resources files of my app into the exe too? |
16:14:34 | narimiran | Zevv: give it a few more days, and maybe even i start learning it. what have you done?? |
16:15:01 | Zevv | payed Eric Wastl well |
16:15:06 | FromDiscord | <lqdev> hmmmmm: nope, just the metadata |
16:15:16 | FromDiscord | <lqdev> but you can embed resources easily using slurp() |
16:15:21 | FromDiscord | <Esbeesy> Ah fuck narimiran I just checked your repo, "Bagushkas" 😂 |
16:15:22 | Zoom[m] | I solved the 4th day with std/pegs only, and used it on d7 to parse the input, but that `eventParser` template contrived and I still don't understand if it would be useful :P |
16:15:28 | FromDiscord | <Esbeesy> Sprayed coffee out my nose |
16:15:30 | hmmmmm | oh really? very interesting :o |
16:15:37 | * | omn1present_ joined #nim |
16:15:41 | narimiran | Zevv: btw, am i reading your solution correctly? you assumed the longest chain is 10, and that's it? :D |
16:15:54 | narimiran | @Esbeesy haha, thanks :) glad somebody noticed it :) |
16:16:20 | Zevv | narimiran: I have proven the longest was only 5, and doubling that "for safety" |
16:16:33 | Zevv | cmon I can be lazy, that's a right |
16:16:44 | Zoom[m] | <narimiran "Zoom: from what i can tell, most"> What do you mean? Is it wrong? |
16:17:00 | narimiran | Zevv: and here i am, foolishly building `bag -> larger` and `bag -> smaller` tables |
16:17:23 | Zevv | I could also just iterate until no new ones are found. But that adds a line or two |
16:17:23 | narimiran | Zoom[m]: well, i thought it would be very slow that way. but it isn't |
16:17:38 | * | omn1present_ quit (Client Quit) |
16:18:26 | Zoom[m] | I'd very much prefer to solve it with trees or something instead of recursion, but in this case recursion is much much easier than anything I can think of |
16:18:55 | narimiran | Zoom[m]: see here for my (over-engineered?) solution: https://github.com/narimiran/AdventOfCode2020/blob/master/nim/day07.nim |
16:20:38 | Zoom[m] | Hm, I think I liked all your solutions until today :) |
16:21:28 | narimiran | haha |
16:21:34 | narimiran | but it makes sense |
16:24:35 | FromDiscord | <shadow.> LMAO |
16:24:42 | FromDiscord | <shadow.> also i got the parser working lol |
16:25:01 | * | omn1present_ joined #nim |
16:26:56 | * | omn1present_ quit (Client Quit) |
16:27:12 | narimiran | Zoom[m]: i've tried a quick'n'dirty solution using just `bag -> smallerOnes` table, and it is ~4x slower than mine :/ |
16:27:15 | * | theo_ joined #nim |
16:27:28 | Zoom[m] | I actually thought I'd receive some hateful comments on my solutions, but no feedback of any kind yet. |
16:27:35 | * | theo_ quit (Client Quit) |
16:27:50 | Zoom[m] | I'll read into yours in a bit |
16:27:53 | ForumUpdaterBot | New thread by HJarausch: Pop for a set - is there something prettier?, see https://forum.nim-lang.org/t/7220 |
16:27:53 | * | theo_ joined #nim |
16:28:18 | theo_ | IRC gang' |
16:28:41 | Zoom[m] | I expect parsing with pegs to be the slowest part :) |
16:28:49 | Zoom[m] | ... in mine |
16:29:12 | FromDiscord | <shadow.> hey if you want to see bad practice all you have to do is look at my part two |
16:29:15 | FromDiscord | <shadow.> its 100 times worse than yours zoom |
16:29:19 | * | habamax joined #nim |
16:29:32 | FromDiscord | <shadow.> https://play.nim-lang.org/#ix=2H2s |
16:31:36 | * | theo_ quit (Client Quit) |
16:31:37 | FromDiscord | <shadow.> alr zevv after understanding how this works now npeg is one of the coolest things i have ever used |
16:33:32 | Zoom[m] | @shadow. eh, nothing sticks out except copying ruleMap into queue? Is it what you meant? |
16:34:24 | Zevv | shadow.: cool. send me your money now |
16:35:35 | Zoom[m] | @shadow. have you actually seen mine to say yours is 100 times worse? 😀 |
16:35:43 | narimiran | Zoom[m]: i tried your p1 algorithm with my code, and yes, it is ~4x slower |
16:36:08 | narimiran | (but it looks nicer, indeed; especially when you hide some for-loops behind `map` and such :P) |
16:36:13 | Zoom[m] | I think this is a win for me. Just 4x... |
16:39:39 | Zoom[m] | I measured the previous day and my solution with bitopts is faster than the same approach but with IntSet by like x200 |
16:40:36 | * | tiorock is now known as rockcavera |
16:40:37 | * | rockcavera quit (Changing host) |
16:40:37 | * | rockcavera joined #nim |
16:40:40 | Zoom[m] | I was left with the conclusion that something gets optimized out and timeIt doesn't measure properly. |
16:41:16 | Zoom[m] | But I left it at that |
16:41:46 | Zoom[m] | I'm not sure I'm familiar enough with Nim to focus on optimizations |
16:43:11 | FromDiscord | <shadow.> no zoom |
16:43:13 | Araq | so ... our IntSet is 200x faster, right? |
16:43:13 | FromDiscord | <shadow.> the issue is that |
16:43:15 | FromDiscord | <shadow.> in part two |
16:43:25 | FromDiscord | <shadow.> instead of using math im just adding each child the amount of times |
16:43:31 | FromDiscord | <shadow.> so my queue is gonna become like fuckin 100gb in width |
16:44:33 | narimiran | Araq: faster than the built-in bit-set? i wouldn't say so :) |
16:45:17 | narimiran | Zoom[m]: you're really a fan of zero_functional, huh? :) |
16:45:39 | FromDiscord | <Esbeesy> I benchmarked mine out of curiosity, just under 2x a slow as yours Narimiran |
16:45:51 | narimiran | link? |
16:46:11 | FromDiscord | <Esbeesy> https://github.com/sambeckingham/advent-of-code-2020/blob/main/day7/day7.nim |
16:46:58 | narimiran | why `deduplicate seq` instead of using a set? |
16:47:20 | FromDiscord | <Esbeesy> 👀 Truth be told I was trying to use set but |
16:47:59 | FromDiscord | <Esbeesy> I dumbed out. Are the sets in Nim as simple as set[string]? |
16:48:06 | FromDiscord | <lqdev> no |
16:48:14 | narimiran | see https://nim-lang.github.io/Nim/sets.html |
16:48:17 | FromDiscord | <lqdev> a `set` is a bitset |
16:48:29 | FromDiscord | <lqdev> yeah what narimiran linked is what you're looking for |
16:48:32 | FromDiscord | <Esbeesy> Fuck |
16:48:41 | FromDiscord | <Esbeesy> So I saw that page and thought it was the bitsets still |
16:48:54 | FromDiscord | <Esbeesy> Ah this is dangerous, I fuckin love hash sets man |
16:49:16 | FromDiscord | <Esbeesy> Gonna start jamming FP into my Nim code 😂 |
16:51:24 | Zoom[m] | <narimiran "Zoom: you're really a fan of zer"> Nah, it's far from ergonomic and doesn't behave as expected in some cases. |
16:52:17 | Araq | try sugar.collect |
16:52:22 | Araq | I love it |
16:53:08 | Araq | it's like somebody understood what FP's maps and filters really try to do and threw away the FP parts |
16:53:30 | Araq | and focussed on turning for loop *statements* into *expressions* |
16:56:08 | Zoom[m] | In my mind collect is just a consumer for an iterator. I don't like that a lot of things that are a natural fit for iterators work with seqs or are just macroses like sugar/collect |
16:56:47 | FromDiscord | <shadow.> YESSIR |
16:56:51 | * | luis1 quit (Ping timeout: 256 seconds) |
16:56:54 | FromDiscord | <shadow.> sometimes im just like |
16:57:06 | FromDiscord | <shadow.> "yk i could write 10 lines with creating new variables and appending and blah blah blah" |
16:57:09 | FromDiscord | <shadow.> or... |
16:57:15 | FromDiscord | <shadow.> i could just write 1 huge line of unreadable fp crap |
16:58:09 | FromDiscord | <shadow.> but yeah sugar collect is pretty sick |
16:58:15 | FromDiscord | <Esbeesy> sugar.collect is siiiiick wtf |
16:58:18 | FromDiscord | <shadow.> yeahh |
16:58:23 | disruptek | Zevv: i think you and i have a different definition for "proof." |
16:58:28 | FromDiscord | <shadow.> i made a comprehension template with it really easily lol |
16:58:53 | * | luis1 joined #nim |
16:59:16 | * | sagax quit (Remote host closed the connection) |
16:59:32 | disruptek | ~Esbeesy is "sugar.collect is siiiiick wtf" |
16:59:33 | disbot | Esbeesy: 11"sugar.collect is siiiiick wtf" |
16:59:42 | FromDiscord | <shadow.> wonderful |
17:01:35 | hmmmmm | ~hi disbot |
17:01:35 | disbot | no footnotes for `hi`. 🙁 |
17:01:40 | hmmmmm | :| |
17:02:00 | disruptek | ~Zevv is "I have proven the longest was only 5, and [I'm] doubling that 'for safety.'" |
17:02:20 | disruptek | you broke disbot's brain. |
17:02:26 | hmmmmm | :| |
17:02:35 | disruptek | disbot: you okay, buddy? |
17:02:36 | disbot | yep. 😊 |
17:02:40 | disruptek | ~Zevv is "I have proven the longest was only 5, and [I'm] doubling that 'for safety.'" |
17:02:41 | disbot | Zevv: 11"I have proven the longest was only 5, and [I'm] doubling that 'for safety.'" |
17:02:43 | hmmmmm | your bot can't handle "hi" I don't know what kind of bot it even is |
17:03:04 | disruptek | anti-social, what else? |
17:03:10 | hmmmmm | hehe |
17:03:13 | hmmmmm | fitting I suppos' |
17:03:41 | FromDiscord | <shadow.> id try it but i think disrupted made him ignore me |
17:03:42 | FromDiscord | <shadow.> rip |
17:03:43 | FromDiscord | <shadow.> lmao |
17:03:48 | FromDiscord | <shadow.> disruptek |
17:04:20 | FromDiscord | <Esbeesy> me after reading that sugar module: |
17:04:23 | FromDiscord | <Esbeesy> https://media.discordapp.net/attachments/371759389889003532/785552296439185498/unknown.png |
17:04:24 | disruptek | hmm what does this look like on your screen: :disruptek: |
17:04:25 | hmmmmm | it would be hilarious if the bot corrected people when they misspelled dirupté |
17:04:47 | FromDiscord | <shadow.> it looks like nothing |
17:04:51 | disruptek | rude. |
17:04:54 | FromDiscord | <shadow.> \:disruptek: |
17:04:55 | FromDiscord | <shadow.> try that |
17:05:05 | disruptek | good idea. |
17:05:08 | disruptek | \:disruptek: |
17:05:11 | FromDiscord | <shadow.> rip |
17:05:13 | FromDiscord | <shadow.> still didn't work |
17:05:17 | disruptek | weird. |
17:05:23 | FromDiscord | <shadow.> that's quite odd |
17:05:30 | FromDiscord | <shadow.> :disruptek: what does this look like for you? just the colons? |
17:05:32 | disruptek | it's almost like the chucklehead that wrong the bot didn't think things through... |
17:05:40 | FromDiscord | <shadow.> oop |
17:05:45 | disruptek | s/wrong/wrote/ |
17:05:51 | disruptek | i may be a little stoned right now. |
17:05:57 | FromDiscord | <shadow.> you're good |
17:06:01 | FromDiscord | <shadow.> im glad to find someone else uses sub for edits |
17:06:02 | disruptek | tell me about it. |
17:06:09 | disruptek | i love hearing about how great i am. |
17:06:13 | FromDiscord | <shadow.> ofc |
17:06:17 | FromDiscord | <shadow.> and how great your testes are |
17:06:23 | disruptek | you like my testes? |
17:06:26 | disruptek | nice, right? |
17:06:31 | FromDiscord | <shadow.> yes, very colorful |
17:06:31 | FromDiscord | <Esbeesy> Oh not this again 😂 |
17:06:37 | disruptek | it's a little more spammy now than it was. |
17:06:44 | FromDiscord | <shadow.> true |
17:06:46 | FromDiscord | <shadow.> very spammy testes |
17:06:52 | disruptek | always has been. |
17:06:55 | FromDiscord | <shadow.> ~~the females might like that~~ |
17:07:02 | FromDiscord | <shadow.> anyways |
17:07:03 | hmmmmm | disruptek can u make a noob style guide for when to return and when to result |
17:07:08 | FromDiscord | <shadow.> uhh |
17:07:11 | disruptek | sure. |
17:07:23 | disruptek | never return unless using result will make you look like an asshole. |
17:07:26 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2H2M |
17:07:30 | hmmmmm | :| |
17:07:37 | disruptek | that's literally the style i use. |
17:07:46 | FromDiscord | <shadow.> i mean yeah always result unless it looks stupid |
17:08:00 | disruptek | use result for any >1-statement proc. |
17:08:15 | FromDiscord | <shadow.> hmm so |
17:08:17 | disruptek | use named block instead of temporaries. |
17:08:23 | FromDiscord | <shadow.> true |
17:08:43 | FromDiscord | <Esbeesy> Is there a page or book on idiomatic Nim anywhere? |
17:08:50 | disruptek | use if exprs for one-liners only when it makes the code easier to read; think multiline statement expressions. |
17:08:58 | disruptek | indent if exprs on a new line. |
17:09:27 | disruptek | use try expressions only if there is no except clause. |
17:09:42 | hmmmmm | wat |
17:09:50 | disruptek | use case elif sparingly; it's easy to overlook for the reader. |
17:10:04 | hmmmmm | please take all this stuff into a proper doc my brain is exploding |
17:10:24 | hmmmmm | my idiomatic nim is limited to using 1..high right now |
17:10:25 | disruptek | just look at whatever i'm writing recently. |
17:10:36 | disruptek | 1..high? |
17:10:43 | disruptek | i think maybe two of us are high. |
17:10:47 | hmmmmm | lol |
17:10:56 | hmmmmm | I mean the double dot to mean from a to b |
17:11:05 | hmmmmm | I find it pretty spiffy and I use it all the time |
17:11:10 | disruptek | oh, what would you use otherwise? |
17:11:14 | disruptek | countUp? |
17:11:31 | hmmmmm | I'm sure I was usinge something else on python but can't even remember lol |
17:12:04 | hmmmmm | oh it was the range thing |
17:12:06 | disruptek | we should be able to `for x in 40 to 50:` |
17:12:19 | disruptek | that would be siiiiick. |
17:12:22 | FromDiscord | <Esbeesy> That would be nice, I like it when it's wordy |
17:12:31 | FromDiscord | <Esbeesy> Which is weird cause I despise VB |
17:12:31 | disruptek | yeah baby, i'm almost there. |
17:12:34 | FromDiscord | <shadow.> sadly no character operators |
17:12:44 | FromDiscord | <shadow.> rip |
17:12:50 | FromDiscord | <shadow.> text |
17:12:57 | hmmmmm | also I find the strange inc 1 very fascinating but never had occasion to use it |
17:13:15 | FromDiscord | <shadow.> wdym |
17:13:20 | disruptek | you can use 🙅 as an operator. |
17:13:43 | disruptek | i think we all know what it means. |
17:14:22 | Zevv | disruptek: I have proven that for my data set. and I have 10 fingers |
17:14:23 | FromDiscord | <Esbeesy> I love inc too. I wrote this as part of my day 6 solution, ix.io/2H2P, and I literally guessed reset |
17:14:29 | Zevv | that is a perfectly good reason |
17:14:42 | FromDiscord | <Esbeesy> Like is that just a thing it can do, and it is, mind ==blown |
17:15:42 | FromDiscord | <Esbeesy> For me it's that it makes your code readable in an actual linguistic sense. Like I could show "Inc total, clear table, reset group" to my 80 year old nan and I'm sure she'd have an idea what it did |
17:17:15 | * | Vladar quit (Quit: Leaving) |
17:18:14 | disruptek | ~ufcs |
17:18:15 | disbot | ufcs: 11a misnomer. See https://gist.github.com/disruptek/6d0cd6774d05adaa894db4deb646fc1d for one set of opinions. -- disruptek |
17:18:45 | disruptek | do you want more style opinions? |
17:18:57 | FromDiscord | <Esbeesy> Yeah uniform function call syntax baybeee |
17:19:49 | disruptek | are you my brother? |
17:20:05 | FromDiscord | <Esbeesy> I thought I was an only child |
17:20:12 | FromDiscord | <Esbeesy> Did our mothers lie to us? |
17:20:13 | disruptek | not anymore. |
17:20:21 | FromDiscord | <Esbeesy> https://media.discordapp.net/attachments/371759389889003532/785556314838663258/unknown.png |
17:20:31 | FromDiscord | <Esbeesy> My friend after showing him sugar.collect haha |
17:20:42 | FromDiscord | <Esbeesy> He was doing AoC in Scala |
17:20:42 | disruptek | what is he doing it in? |
17:20:50 | disruptek | THIS |
17:20:50 | disruptek | IS |
17:20:52 | disruptek | SCALA |
17:21:15 | disruptek | i don't really know scala but i think of it as the nim of java. |
17:21:43 | hmmmmm | so it's a faster python with types? :o |
17:22:01 | FromDiscord | <Esbeesy> Wait, if Go has Gophers, and Python has Pythonistas, Rust has Rustaceans and C# has White Boomers |
17:22:07 | FromDiscord | <Esbeesy> Please tell me Nim is Nimphs |
17:22:08 | disruptek | nah, it's more like, "clever and tasteful" |
17:22:24 | disruptek | white boomers; that's hilarious. |
17:22:37 | hmmmmm | nim has nimteks |
17:22:40 | disruptek | that's not true though, really. |
17:22:51 | disruptek | i'm a nimion. |
17:22:59 | disruptek | !repo nimph |
17:22:59 | disbot | https://github.com/disruptek/nimph -- 9nimph: 11Nim package hierarchy manager from the future 🧚 15 89⭐ 5🍴 7& 1 more... |
17:23:02 | hmmmmm | i'm a nimlet |
17:23:03 | disruptek | is already a thing. |
17:23:13 | disruptek | you seem more like a nimpleton to me. |
17:23:16 | hmmmmm | D: |
17:23:22 | hmmmmm | I upgraded from that |
17:23:29 | FromDiscord | <Esbeesy> or Nimrods 😂 |
17:23:32 | disruptek | next stop: nimp |
17:23:37 | FromDiscord | <Esbeesy> Yes! |
17:23:43 | hmmmmm | nimp like nimpleasant? |
17:23:55 | disruptek | a nimp is a clever nimian. |
17:24:00 | hmmmmm | oh |
17:24:01 | FromDiscord | <Quibono> Nim-nuts? |
17:24:02 | hmmmmm | I'm not that |
17:24:21 | FromDiscord | <Quibono> I think I’m a nimpleton |
17:24:44 | FromDiscord | <shadow.> i am a nimpieceofcrap |
17:24:47 | disruptek | my github profile features a nimskull. |
17:24:56 | FromDiscord | <Quibono> Wanna be a Night some day. |
17:25:02 | FromDiscord | <Esbeesy> Nimcompoops |
17:25:28 | FromDiscord | <Quibono> _uses trumpcase because there’s no K on the front_ |
17:25:41 | FromDiscord | <Quibono> We are the nights of Nim! |
17:26:00 | disruptek | i think that's a porno. |
17:26:02 | FromDiscord | <shadow.> didn't nim use to be called nimrod |
17:26:10 | disruptek | it's a secret. |
17:26:14 | FromDiscord | <shadow.> ahh right right |
17:26:18 | FromDiscord | <shadow.> lmao |
17:26:37 | FromDiscord | <shadow.> to be fair i wasnt even born then so i cant say i know from firsthand experience |
17:26:56 | disruptek | well, i didn't think you were that old. |
17:27:05 | disruptek | nimrod is old even by /my/ standards. |
17:27:14 | FromDiscord | <shadow.> i thought nimrod was released like 2004? |
17:27:38 | FromDiscord | <Quibono> Shadow you’re making me feel old |
17:27:48 | FromDiscord | <shadow.> rip |
17:28:02 | FromDiscord | <shadow.> to be fair im probably one of the youngest in the server so it might just be me |
17:28:19 | FromDiscord | <Quibono> _cries in mid 20s_ |
17:28:24 | FromDiscord | <shadow.> seems nim has a different audience then something such as python where it's just a clan of 12 year olds trying to code sneaker bots |
17:28:34 | FromDiscord | <haxscramper> https://play.nim-lang.org/#ix=2H2W |
17:28:39 | FromDiscord | <Quibono> Wait, does this mean shadow. Is the future? 😮 |
17:28:52 | disruptek | shhh, you'll make avatarfighter blush. |
17:29:23 | FromDiscord | <shadow.> lmfao |
17:29:44 | FromDiscord | <shadow.> well yes there's the . trick but that's no fun |
17:29:59 | * | hmmmmm quit (Quit: brb) |
17:30:39 | disruptek | i bet there actually are a ton of kids trying to deal in supreme. |
17:30:58 | disruptek | i just have a feeling it's a bigger market than you might think. |
17:31:12 | FromDiscord | <Quibono> I’ve got a brilliant idea, we should sponsor coding camps for kids in Nim, grow the audience from below |
17:31:29 | FromDiscord | <Quibono> Quick, what game are the youngins playing? |
17:31:29 | disruptek | i'm thinking about teaching at a local school. |
17:31:33 | FromDiscord | <Quibono> We must make mods |
17:31:53 | FromDiscord | <Quibono> Disruptek permission to take the piss? |
17:31:54 | FromDiscord | <shadow.> disruptek you do realize i could name at least 5 people i know that try to bot supreme |
17:31:55 | FromDiscord | <shadow.> it's quite sad |
17:32:04 | FromDiscord | <shadow.> they're like "ayo you know how to use that selenium shit bruh?" |
17:32:05 | FromDiscord | <shadow.> ... |
17:32:07 | FromDiscord | <shadow.> LMAO |
17:32:14 | disruptek | i mean, fighter wanted me to code on his bot. |
17:32:24 | FromDiscord | <shadow.> ah |
17:32:26 | disruptek | i was like, "no dough, no go." |
17:32:44 | FromDiscord | <Quibono> What is this supreme? |
17:32:47 | disruptek | yeah. |
17:32:51 | FromDiscord | <Esbeesy> https://play.nim-lang.org/#ix=2H2Y↵↵Improved readability a little |
17:32:58 | FromDiscord | <Esbeesy> 😂 |
17:33:09 | FromDiscord | <Quibono> Also disruptek I’m surprised they let you in schools irl. 😮 |
17:33:22 | disruptek | well, i will be changing my identity again. |
17:33:24 | FromDiscord | <Esbeesy> .. Fortnim? |
17:33:32 | disruptek | should be pretty clean this time. |
17:33:45 | FromDiscord | <Quibono> ... @Esbeesy I feel like if I get the joke it’s too old |
17:33:48 | disruptek | i've learned a lot since i starting this gig. |
17:34:13 | * | vicfred joined #nim |
17:34:30 | FromDiscord | <haxscramper> Need to repost this in telegram channel, they just recently had some go/nim discussion |
17:35:04 | disruptek | for i in a ..< b: ... |
17:35:38 | disruptek | you could at least use it in the iterator, yeesh. |
17:36:05 | FromDiscord | <Esbeesy> All in good spirits I hope, Go community is generally quite welcoming. Unlike a certain other community when you mention Go... _cough🦀cough_ |
17:36:17 | FromDiscord | <shadow.> lmfao |
17:36:26 | FromDiscord | <Quibono> I want to like Go so badly, I just can’t read the syntax. |
17:36:50 | disruptek | i like purposeful design of the language but i have no use for it anymore. |
17:36:57 | FromDiscord | <shadow.> fair enough |
17:37:01 | FromDiscord | <Esbeesy> That's interesting - It's designed exactly for that purpose 😂 |
17:37:03 | FromDiscord | <shadow.> yeah the syntax is kinda ugly and i dont see the use cases above nim |
17:38:06 | FromDiscord | <Quibono> Well I’m dyslexic af so that might be why, like I try to read C code and I’m just like wrf |
17:38:17 | FromDiscord | <Esbeesy> I like it because it stops my colleagues from being absolute 🔔 🔚 s |
17:38:20 | disruptek | i understand the argument against generics, for them, but i wonder how they are going about adding them. so to speak. |
17:38:41 | disruptek | like are generics a rewrite implementation or what? |
17:39:07 | disruptek | anyone know? |
17:39:24 | FromDiscord | <Esbeesy> What do you mean by rewrite implementation? |
17:39:44 | FromDiscord | <shadow.> c is...interestnig |
17:39:46 | disruptek | like do they just rewrite generics into existing code semantics. |
17:39:48 | FromDiscord | <shadow.> interesting |
17:40:15 | FromDiscord | <Esbeesy> Yeah the current draft is backwards compat + they're going to migrate the stdlib to it |
17:40:28 | disruptek | oh that's neat. |
17:40:46 | FromDiscord | <Esbeesy> Coming from C# I was dead against generics in Go but the design they're going with currently is actually just right. I implemented Erlang's set library using them and it was excellent |
17:41:01 | disruptek | i guess it's sorta like our <\\> operator. |
17:41:08 | FromDiscord | <Esbeesy> Wtf is that |
17:41:20 | disruptek | `owned` |
17:41:22 | FromDiscord | <Esbeesy> More god tier Nim shit that's going to solve all of my problems, no doubt |
17:41:57 | FromDiscord | <shadow.> idk i dont like the limits of the go stl |
17:42:04 | FromDiscord | <shadow.> it was quite small and kinda meh imo |
17:42:07 | FromDiscord | <shadow.> but still an interesting language |
17:42:19 | FromDiscord | <Quibono> I just want goroutines. |
17:42:25 | FromDiscord | <Esbeesy> THIS ^ |
17:42:32 | FromDiscord | <Esbeesy> The one thing I miss in Nim, is go routines |
17:42:41 | FromDiscord | <shadow.> lmao fair enough |
17:42:45 | disruptek | !repo cps |
17:42:46 | disbot | https://github.com/disruptek/cps -- 9cps: 11Continuation-Passing Style for Nim 🔗 15 40⭐ 2🍴 |
17:42:56 | disruptek | this is the basis for goroutines in nim. |
17:42:58 | FromDiscord | <Esbeesy> Isn't CPS the foundation of CSP |
17:43:00 | FromDiscord | <Esbeesy> YEah |
17:43:24 | FromDiscord | <Quibono> Lol so when will I have my nimroutines Dis? |
17:43:46 | disruptek | i dunno, i should probably be working on it right now, but i'm trying to find a job instead. |
17:43:56 | FromDiscord | <Quibono> Lol fair. |
17:44:02 | disruptek | it's pretty cold here and i'm hungry af. |
17:44:42 | FromDiscord | <InventorMatt> is there a less dumb way to do this https://play.nim-lang.org/#ix=2H36 ? |
17:45:17 | disruptek | that's actually pretty cute. |
17:45:35 | disruptek | i mean, it's like you're writing c here. |
17:45:53 | FromDiscord | <Quibono> Wait wait I think I know |
17:46:03 | disruptek | you can just use a template. |
17:46:05 | * | Vladar joined #nim |
17:46:56 | FromDiscord | <shadow.> true |
17:47:29 | FromDiscord | <Quibono> Couldn’t you just do for x in a..e? |
17:48:21 | FromDiscord | <shadow.> well they want addresses |
17:48:35 | FromDiscord | <InventorMatt> i don't think you can iterate through variables like that |
17:48:46 | FromDiscord | <shadow.> yeah no lmao |
17:48:53 | FromDiscord | <shadow.> that's only for slices |
17:48:57 | FromDiscord | <shadow.> won't work for variable names |
17:49:13 | FromDiscord | <shadow.> but yeah you could do like |
17:49:18 | FromDiscord | <shadow.> lemme whip something up |
17:50:47 | FromDiscord | <Quibono> Why not make a seq of vars then? |
17:50:57 | FromDiscord | <shadow.> well i think he wants to do dynamic variable names |
17:51:01 | FromDiscord | <shadow.> idk why you wouldn't just use a table |
17:51:40 | FromDiscord | <Quibono> Like make it a seq and then do map... |
17:51:41 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2H3c |
17:51:44 | FromDiscord | <shadow.> that can be used for dynamics if you want |
17:51:54 | FromDiscord | <shadow.> but i don't recommend it? |
17:52:14 | FromDiscord | <InventorMatt> i was transposing the code and when I got to the end they did something like that and I didn't want to have to redo all of that |
17:52:39 | FromDiscord | <shadow.> ahh |
17:52:40 | FromDiscord | <shadow.> i see |
17:53:28 | FromDiscord | <shadow.> i mean yeah you could do like |
17:54:05 | FromDiscord | <shadow.> soemthing like that |
17:54:06 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2H3d |
17:54:13 | FromDiscord | <shadow.> lmao |
17:54:24 | FromDiscord | <shadow.> again, wouldn't recommend it but that should work |
17:54:41 | FromDiscord | <shadow.> wait |
17:54:44 | FromDiscord | <shadow.> you need the addr thing one sec |
17:54:52 | FromDiscord | <shadow.> maybe? |
17:54:53 | FromDiscord | <shadow.> (edit) "https://play.nim-lang.org/#ix=2H3d" => "https://play.nim-lang.org/#ix=2H3e" |
17:54:57 | FromDiscord | <InventorMatt> the variables in the code I have are much more varied than 'a'..'b' that was just an example |
17:55:01 | FromDiscord | <shadow.> ohhh |
17:55:04 | FromDiscord | <shadow.> so then what do you need |
17:55:16 | FromDiscord | <shadow.> retrieving the value of a var by its name in a string? or |
17:55:19 | FromDiscord | <shadow.> a list of variables |
17:55:23 | FromDiscord | <shadow.> and incrementing them all |
17:55:24 | FromDiscord | <shadow.> by 5? |
17:55:26 | FromDiscord | <Quibono> So again why can’t you add the variables to a sequence when you use them? |
17:55:48 | disruptek | actually, keeping a const seq of the variables makes a lot of sense to me. |
17:56:05 | disruptek | or just an array, really. |
17:56:30 | FromDiscord | <Quibono> Wait something I said made some sense? |
17:56:35 | FromDiscord | <Quibono> Dafuq? |
17:56:41 | FromDiscord | <InventorMatt> I can It's just not worth it to redo the code as it is when this is just a stepping stone of code for a full rewrite I just wanted to test the translation to nim first |
17:56:44 | Zevv | disruptek is trying to make you feel good. he does that occasionaly |
17:57:23 | disruptek | well, think about how the template writes it. could it really be faster than a static array of the exact values you need, one after another in memory? |
17:57:30 | FromDiscord | <Quibono> Then why do I feel unclean? |
17:57:36 | FromDiscord | <shadow.> hmm |
17:57:37 | disruptek | it might all come out in the wash. |
17:57:51 | FromDiscord | <shadow.> because when disruptek gives a compliment it's kind of like a thief putting a gold bar in your hand |
17:57:53 | FromDiscord | <shadow.> can't be legitimate |
17:57:59 | FromDiscord | <ache of head> XDDDD |
17:58:00 | disruptek | lol |
17:58:30 | FromDiscord | <shadow.> well |
17:58:32 | FromDiscord | <shadow.> unless it's too himself |
17:58:37 | FromDiscord | <shadow.> then it is very much legitimate |
17:58:43 | FromDiscord | <shadow.> to |
17:58:45 | FromDiscord | <exelotl> I was hoping this would work: https://play.nim-lang.org/#ix=2H3g |
17:58:59 | FromDiscord | <shadow.> well |
17:58:59 | FromDiscord | <exelotl> not sure if it's supposed to or not |
17:58:59 | disruptek | i /do/ love my big penis. |
17:59:07 | FromDiscord | <shadow.> you're modifying the items in the array |
17:59:13 | FromDiscord | <shadow.> but since you're copying them into the array by value |
17:59:16 | FromDiscord | <shadow.> you're not modifying the variables |
17:59:22 | FromDiscord | <shadow.> since there's no pointers iirc |
18:00:00 | FromDiscord | <exelotl> it's an array of `var int` which as I understand should be hidden pointers to ints |
18:00:20 | FromDiscord | <shadow.> also use `arr.mitems` or disruptek's ufcs guide will bite you |
18:00:26 | FromDiscord | <shadow.> ohhh var int |
18:00:27 | FromDiscord | <shadow.> hmm |
18:00:49 | FromDiscord | <shadow.> not sure you can do that |
18:00:52 | disruptek | yeah, you don't want to run counter to disrupstyle. |
18:00:59 | FromDiscord | <shadow.> nope |
18:01:08 | * | thomasross joined #nim |
18:01:42 | FromDiscord | <exelotl> @shadow. here's the page on it, but it's still rather experimental https://nim-lang.github.io/Nim/manual_experimental.html#view-types |
18:02:00 | FromDiscord | <shadow.> lemme take a look |
18:02:08 | FromDiscord | <exelotl> so maybe it's supposed to work in the future but just doesn't right now |
18:02:14 | FromDiscord | <shadow.> oh i know what the `var T` tyep is |
18:02:22 | FromDiscord | <shadow.> i just think like |
18:02:48 | FromDiscord | <shadow.> maybe once you put them into the `[a, b, c, d, e]` they're copied by value and maybe those `var` refs are just references to the items in the array and not the actual vars? i've no idea tbh |
18:02:59 | FromDiscord | <shadow.> something's being lost in the array definition |
18:03:56 | FromDiscord | <treeform> In a macro, how does one know if current symbol refers to a global variable, or to a local variable? Is there a way to get symbols scope? |
18:04:10 | disruptek | declaredInScope() |
18:04:19 | FromDiscord | <shadow.> spicy |
18:04:50 | FromDiscord | <treeform> on its in system module |
18:04:50 | FromDiscord | <exelotl> @shadow. note: I'm not sure how you can take a mutable view to anything at the moment, even this simple example segfaults https://play.nim-lang.org/#ix=2H3k |
18:04:51 | disruptek | but you can't, like, query the scope and fetch it as a table or something. |
18:04:58 | FromDiscord | <exelotl> but I'm really hoping it will work in the future |
18:05:14 | disruptek | were you the one that asked about it yesterday? |
18:05:15 | FromDiscord | <shadow.> hmm |
18:05:23 | disruptek | oh, i think it was deech. |
18:05:23 | FromDiscord | <shadow.> i mean how does it work when you accept arg as `var T` in a proc? |
18:05:25 | FromDiscord | <shadow.> is it any different |
18:05:39 | disruptek | different than what? |
18:05:45 | FromDiscord | <shadow.> than by assignment |
18:05:47 | disruptek | i think the answer is, "no." |
18:05:54 | FromDiscord | <shadow.> then why does the assignment one fail? |
18:06:01 | disruptek | what do you mean? |
18:06:14 | FromDiscord | <shadow.> in exelotl's example |
18:06:21 | FromDiscord | <exelotl> `var T` in a function parameter is always passed as a hidden pointer - that feature has been in the language for a long time and it works great |
18:06:21 | disruptek | oh, i didn't read the code. |
18:06:28 | FromDiscord | <shadow.> ohh right |
18:06:32 | FromDiscord | <treeform> declaredInScope does not help me... always returns false |
18:06:42 | FromDiscord | <exelotl> but first-class `var T` is a new thing |
18:06:45 | FromDiscord | <shadow.> ohh |
18:06:49 | FromDiscord | <shadow.> hmm |
18:07:12 | FromDiscord | <shadow.> yeah i would assume if it doesn't raise an error when you specify type as mutable view then it's doing it correctly |
18:07:18 | FromDiscord | <shadow.> so idk why the nil read error is still happening then |
18:07:19 | FromDiscord | <treeform> i'll ask on the forums |
18:07:23 | disruptek | treeform: are you saying it doesn't do what it's supposed to? |
18:07:47 | disruptek | i don't know anything about views yet. |
18:07:52 | disruptek | i haven't messed with them. |
18:08:39 | FromDiscord | <shadow.> ah rip |
18:09:06 | disruptek | i should probably just deprecate support for earlier nims in all my stuff. |
18:09:22 | Zevv | I think so to |
18:09:23 | Zevv | o |
18:09:44 | Zevv | no one particulary cares for 1.0 in practice |
18:09:57 | disruptek | like, i'll put in a requirement for the nim version and then tag it and bag it. |
18:10:12 | disruptek | just live at head and anyone using old software... can use old software. |
18:10:28 | disruptek | makes a ton of sense. |
18:10:29 | Zevv | that's what I do. |
18:10:36 | Zevv | every now and then I get a complaint |
18:10:39 | Zevv | and then I fix it |
18:10:43 | Zevv | but I'm checkinf myself |
18:10:50 | disruptek | i'm a developer. i should just develop and leave tags as artifacts. |
18:10:57 | Zevv | if no one is complaining, no one is using my stuff with old versions |
18:11:01 | disruptek | people can always fork if they need to. |
18:11:16 | disruptek | oh, you do the testing yourself? |
18:11:28 | Zevv | hardly |
18:11:38 | disruptek | but that makes a lot of sense, too. |
18:12:07 | Zevv | the good thing is: I have zero bugs found or reported in NPeg up to now |
18:12:16 | FromDiscord | <shadow.> damn |
18:12:17 | disruptek | hmm, i think what i want is "tests pass if head passes; the rest are mearly advisory." |
18:12:26 | disruptek | merely, too. |
18:12:28 | FromDiscord | <shadow.> time to go find a bug in npeg |
18:12:38 | Zevv | I'm a one trick pony |
18:12:42 | disruptek | Zevv: zero bugs? wow. |
18:12:43 | Zevv | better make it a good trick |
18:13:09 | disruptek | you make me want to compete but i don't believe it's efficient to do so. |
18:13:15 | FromDiscord | <treeform> disruptek, I don't think I can use this one. It takes an unypted but I have NimNode. |
18:13:33 | disruptek | treeform: use it in the code you generate, no? |
18:13:35 | FromDiscord | <treeform> NimNode kind Symbol. |
18:14:55 | FromDiscord | <treeform> https://forum.nim-lang.org/t/7221#45607 |
18:16:10 | ForumUpdaterBot | New thread by Treeform: In macros, is there a way to know if a symbol as global?, see https://forum.nim-lang.org/t/7221 |
18:19:05 | disruptek | treeform: if you want to know if it's global, look at what declaredInScope does. .global is something you could check for. |
18:20:00 | FromDiscord | <treeform> DeclaredInScope is magic ... never can find how magic is done... |
18:20:19 | disruptek | mostly waving of hands and deep-throated utterance. |
18:20:48 | disruptek | i do this thing with my fingers that i've been told is quite magical. |
18:21:02 | Prestige | Is there interop with c++, or only c? |
18:21:07 | disruptek | yes. |
18:21:11 | FromDiscord | <treeform> yes c++ |
18:21:18 | Prestige | Cool, ty |
18:21:28 | FromDiscord | <treeform> https://github.com/nim-lang/Nim/search?q=DeclaredInScope&type=code how do I find magic implantation? |
18:21:44 | disruptek | we don't use that word. |
18:23:04 | disruptek | see ~line 1905 in semexprs.nim; semDeclared() |
18:24:03 | FromDiscord | <treeform> thanks, this looks like more of what I need |
18:24:06 | FromDiscord | <Vindaar> and in general look at the string in the source file and add a `m` to the front. Should give you something to grep for: https://github.com/nim-lang/Nim/blob/devel/compiler/semexprs.nim#L2208 |
18:24:37 | FromDiscord | <treeform> thanks I did not know about the m-trick. |
18:25:28 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2H3p |
18:25:32 | FromDiscord | <shadow.> this is for aoc day 2 |
18:25:43 | FromDiscord | <shadow.> nvm its gonna be hard to explain without sending my input ill figure it out lmao |
18:30:10 | * | luismanfroni joined #nim |
18:45:31 | Zevv | You match one single digit |
18:45:48 | Zevv | so numbers with more then one digit do not match |
18:45:50 | Zevv | Make that >+Digit |
18:45:51 | FromDiscord | <shadow.> oh shoot |
18:45:52 | FromDiscord | <shadow.> thanks |
18:46:00 | FromDiscord | <shadow.> i forgot there were digits over 10 in that one ll |
18:46:01 | Zevv | run with `-d:npegTrace` to see how it eats your data |
18:46:03 | FromDiscord | <shadow.> lol |
18:46:09 | FromDiscord | <shadow.> oh ty |
18:46:40 | Zevv | also, when posting on the playground, dump complete running programs |
18:46:41 | Zevv | that helps |
18:47:22 | FromDiscord | <shadow.> kk |
18:47:24 | FromDiscord | <shadow.> i will |
18:55:52 | FromDiscord | <Sendell> Hey guys, small question: how to get rid of a "locks: <unknown>" attached to a proc ? |
18:57:17 | FromDiscord | <Sendell> not doing anything special in that proc, but since it has "unknown" instead of "0" it's not considered the same type as other procs I want to it with |
18:58:49 | FromDiscord | <Sendell> is it safe to just force it with {. locks:0.} ? |
18:59:19 | disruptek | yes. |
19:02:53 | leorize[m]1 | it doesn't really matter 99% of the time |
19:05:12 | FromDiscord | <Avatarfighter> hacktoberfest outdid themselves this year |
19:05:16 | FromDiscord | <Avatarfighter> the shirts are actually comfy |
19:08:31 | FromDiscord | <shadow.> my friend said the same thing lol |
19:08:44 | FromDiscord | <Sendell> ok thx guys 🙂 |
19:09:17 | FromDiscord | <Idefau> i didnt even claim my hacktoberfest prize |
19:09:27 | FromDiscord | <Idefau> chaotic evil |
19:10:45 | FromDiscord | <Avatarfighter> chaotic neutral |
19:11:18 | FromDiscord | <Idefau> i wanted to claim it |
19:11:20 | FromDiscord | <Idefau> but i forgot |
19:11:23 | FromDiscord | <Idefau> until it was too late |
19:11:26 | FromDiscord | <Gibson> hi |
19:11:49 | FromDiscord | <Gibson> is there a way to pass a nim procedure as a function pointer to c code? |
19:15:38 | FromDiscord | <sealmove> probably stupid question but what if you have a `set` of an object type (it happens to be an object variant) |
19:15:41 | FromDiscord | <sealmove> how would it work? |
19:16:14 | FromDiscord | <sealmove> should I keep a set of the variant enum and the object separately? |
19:16:24 | FromDiscord | <sealmove> objects |
19:17:31 | FromDiscord | <Gibson> sent a code paste, see https://play.nim-lang.org/#ix=2H3J |
19:18:08 | * | luismanfroni quit (Remote host closed the connection) |
19:18:22 | FromDiscord | <shadow.> any reason you cant pass the actual object? |
19:18:24 | FromDiscord | <haxscramper> @Gibson you need to use `{.cdecl.}` calling convention for a functions that you will be passing to C code, |
19:18:25 | FromDiscord | <shadow.> nvm c function |
19:18:30 | FromDiscord | <shadow.> lol |
19:18:32 | * | luismanfroni joined #nim |
19:20:03 | FromDiscord | <haxscramper> And then your wrapped code should have something like `cProccWithCallback(callback: proc() {.cdecl.})` |
19:20:12 | * | hmmm joined #nim |
19:21:07 | * | habamax quit (Quit: leaving) |
19:22:28 | FromDiscord | <haxscramper> You want to use a set (multiple enum values) for single object branch? |
19:22:31 | FromDiscord | <Gibson> ah ok |
19:22:33 | FromDiscord | <haxscramper> Or something else |
19:22:38 | FromDiscord | <sealmove> oh, Nim doesn't even allow you to have a set of object, it must be an ordinal |
19:22:42 | FromDiscord | <Gibson> is that the right way to assign a function pointer? |
19:22:46 | FromGitter | <iffy> Trying to track down a bug in sdl2/opengl/x11 on Linux and I don't know where the problem is. Running `nim check` shows no problems on macOS and Windows but shows numerous errors with `--os:linux` (as shown): https://play.nim-lang.org/#ix=2H3K |
19:23:15 | disruptek | sealmove: use a hashset. |
19:23:22 | FromDiscord | <sealmove> I was going for something like this https://play.nim-lang.org/#ix=2H3O |
19:23:22 | FromDiscord | <Gibson> sent a code paste, see https://play.nim-lang.org/#ix=2H3P |
19:23:28 | FromDiscord | <sealmove> yeah hashset sounds right |
19:24:49 | FromGitter | <iffy> I'm happy to file a bug or even fix it... but I don't know where to start. Seems like maybe it's in the x11 lib? |
19:24:51 | * | haxscramper joined #nim |
19:25:18 | FromDiscord | <sealmove> wait, why does `HashSet` only take 1 type parameter? |
19:25:44 | * | sagax joined #nim |
19:26:36 | narimiran | what would be the other? |
19:26:50 | FromDiscord | <sealmove> one for key type and one for value type? |
19:27:35 | Araq | it's a *set* |
19:27:45 | Araq | not a *table* |
19:27:54 | Araq | we have these as well |
19:28:26 | FromDiscord | <sealmove> right, so how would it work with non-ordinal types? how does it know if it should replace or add new entry? |
19:28:59 | FromDiscord | <InventorMatt> the object you are using for the hashset should have a unique hash for it |
19:29:06 | FromDiscord | <InventorMatt> that decides that |
19:29:25 | disruptek | iffy: it looks like your version is not in sync with the wrapper. |
19:29:37 | FromDiscord | <Gibson> sent a code paste, see https://play.nim-lang.org/#ix=2H3T |
19:30:07 | FromGitter | <iffy> disruptek: version of X11? or opengl? |
19:30:12 | FromDiscord | <sealmove> @InventorMatt ok sounds good, in Java you would override some `hash` method for this, how do you do it in Nim? |
19:32:10 | FromDiscord | <shadow.> wdym |
19:32:17 | FromDiscord | <shadow.> most builtins work with hash sets |
19:32:20 | FromDiscord | <shadow.> if not you can use the hashes lib |
19:32:32 | FromDiscord | <sealmove> yeah I want it for custom object |
19:32:39 | FromGitter | <iffy> I've reduced it to this `nim check --os:linux`: ⏎ ⏎ ```import opengl ⏎ discard glSetAttribute(SDL_GL_SHARE_WITH_CURRENT_CONTEXT, 1)``` [https://gitter.im/nim-lang/Nim?at=5fce8357fb7f155587ae330a] |
19:32:44 | FromDiscord | <shadow.> try it and see if it compiles then |
19:32:59 | FromDiscord | <shadow.> if it doesn't use this https://nim-lang.org/docs/hashes.html |
19:33:08 | FromDiscord | <sealmove> thx |
19:33:32 | FromDiscord | <shadow.> np |
19:33:55 | FromDiscord | <Recruit_main707> @Gibson you can do it without ptr: https://play.nim-lang.org/#ix=2H3V |
19:34:11 | FromDiscord | <Vindaar> @sealmove an example for a variant object: https://github.com/Vindaar/ggplotnim/blob/master/src/ggplotnim/dataframe/value.nim#L508-L524 |
19:34:32 | FromDiscord | <sealmove> nice, that's exactly what I am trying to do |
19:35:58 | FromDiscord | <sealmove> wait, you just define the hash proc and Nim automatically knows to apply it to your HashSet? |
19:36:03 | FromDiscord | <Gibson> yeah, can't be passed to a c function that takes a `pointer` then though |
19:36:06 | FromDiscord | <sealmove> you don't have to pass the proc somewhere? |
19:36:34 | FromDiscord | <Vindaar> nope, as long as the `hash` proc is defined in the scope you want to use the `HashSet` or `Table` it's all that's needed |
19:36:43 | FromDiscord | <sealmove> wow that's magic |
19:38:56 | FromDiscord | <shadow.> well, it's a generic |
19:38:59 | FromDiscord | <shadow.> but close enough |
19:38:59 | FromDiscord | <shadow.> :) |
19:40:02 | FromDiscord | <shadow.> what language do you come from? i'd assume most high-level languages have something similar to this |
19:40:13 | FromDiscord | <shadow.> where a function uses an object's method in a generic |
19:40:27 | hmmm | dudes I'm trying to pack a png in my precious gui app exe, are we sure I need to use slurp() I get a bunch of garbled nonsense :| |
19:40:51 | FromDiscord | <shadow.> slurp() is a compile-time file read |
19:40:58 | FromDiscord | <shadow.> is that what you need? |
19:41:04 | FromDiscord | <shadow.> if not then no |
19:41:15 | hmmm | I don't know, I need to have my image inside the exe so I don't need to ship it around |
19:41:20 | FromDiscord | <shadow.> i mean |
19:41:29 | FromDiscord | <shadow.> im fairly certain slurp() returns a string |
19:41:32 | FromDiscord | <shadow.> how do you want the image stored |
19:41:36 | hmmm | I'm noticing :o |
19:41:39 | FromDiscord | <sealmove> @shadow. I've only done such things in Java |
19:41:39 | FromDiscord | <shadow.> seq[seq[uint24]]? |
19:41:42 | FromDiscord | <shadow.> ohh i see |
19:41:49 | FromDiscord | <shadow.> wait of all languages i'd assume java is fairly generic-heavy lmao |
19:42:00 | FromDiscord | <ElegantBeef> slurp returns a string, as that's a binary stream |
19:42:12 | FromDiscord | <shadow.> hmmm: what data type do you need the image as |
19:42:33 | hmmm | shadow it's a png and needs to stay like that, I just want it embedded in the exe :o |
19:42:41 | FromDiscord | <shadow.> "png" is not a nim data type |
19:42:44 | FromDiscord | <sealmove> Java has same feature but you need to override the hash method in your class, so it's obvious how it knows where to apply it. |
19:42:52 | FromDiscord | <ElegantBeef> So then load it as a const then convert it to a png on start |
19:42:54 | hmmm | oh |
19:42:58 | hmmm | hmm |
19:42:59 | FromDiscord | <shadow.> yup |
19:43:11 | FromDiscord | <shadow.> how is this png represented in your code |
19:43:15 | FromDiscord | <shadow.> can you send that code? |
19:43:19 | hmmm | I think bitmap |
19:43:28 | FromDiscord | <shadow.> so a matrix of uint32? |
19:43:38 | FromDiscord | <ElegantBeef> I mean typically you're going to have a `toImage` or `fromFile` which returns the png |
19:43:51 | FromDiscord | <ElegantBeef> (edit) "I mean typically you're going to have a `toImage` or `fromFile` which returns the ... png" added "parsed" |
19:44:04 | FromDiscord | <shadow.> hmmm: can you echo the type of the "png" variable when you don't slurp it? |
19:44:09 | FromDiscord | <shadow.> however you were doing it that was working before |
19:44:20 | FromDiscord | <shadow.> or rather how were you getting the png before |
19:44:32 | hmmm | hmm actually I don't know what happens behind the scenes I just feed my png to loadFromFile("gorilla.png") and it does some magick :o |
19:44:34 | FromDiscord | <ElegantBeef> Well just look at how you were doing it before, see which proc your used and see if it has any overrides for raw data |
19:44:40 | hmmm | in nigui |
19:44:41 | FromDiscord | <shadow.> there we go |
19:44:49 | FromDiscord | <shadow.> and that function doesn't work compile time im guessing |
19:45:01 | FromDiscord | <lqdev> seq[seq[T]] for storing images is a sin against humanity. |
19:45:02 | hmmm | :o |
19:45:06 | FromDiscord | <shadow.> @lqdev how dare you |
19:45:12 | FromDiscord | <shadow.> smh |
19:45:21 | FromDiscord | <lqdev> imagine cache efficiency |
19:45:22 | FromDiscord | <shadow.> in all seriousness, what would you prefer? |
19:45:26 | FromDiscord | <lqdev> now imagine using nested seqs |
19:45:28 | FromDiscord | <ElegantBeef> nigui seems to only have loadfromfile 😦 |
19:45:32 | FromDiscord | <sealmove> doesn't work as expected :/ https://play.nim-lang.org/#ix=2H40 |
19:45:34 | FromDiscord | <shadow.> weird |
19:45:38 | FromDiscord | <shadow.> well look at how nigui loads the data |
19:45:40 | FromDiscord | <shadow.> then make your own proc |
19:45:43 | FromDiscord | <shadow.> lmao |
19:45:56 | FromDiscord | <shadow.> im going to assume that loadFromFile() doesnt work compile-time? |
19:46:01 | FromDiscord | <lqdev> hmmm you can always write to a temp file and load from that if your lib doesn't let you load files from mem directly |
19:46:14 | FromDiscord | <ElegantBeef> I mean certainly not, it relies on gtk stuff |
19:46:18 | FromDiscord | <shadow.> ahh ok |
19:46:38 | FromDiscord | <shadow.> how big is that function hmmm |
19:46:40 | FromDiscord | <ElegantBeef> Yea do what lqdev says make a mmap file then use that to load the image |
19:46:46 | FromDiscord | <ElegantBeef> It's only like 10 lines |
19:46:56 | FromDiscord | <shadow.> hmm |
19:47:05 | FromDiscord | <ElegantBeef> But you need one for windows and one for gtk |
19:47:09 | FromDiscord | <ElegantBeef> https://github.com/trustable-code/NiGui/blob/e5c4ca054f4e285dd5f78babd14735624a8407f0/src/nigui/private/gtk3/platform_impl.nim#L712 |
19:47:10 | FromDiscord | <shadow.> ah |
19:47:28 | FromDiscord | <ElegantBeef> https://github.com/trustable-code/NiGui/blob/e5c4ca054f4e285dd5f78babd14735624a8407f0/src/nigui/private/windows/platform_impl.nim#L800 |
19:48:24 | FromDiscord | <ElegantBeef> The making a temp file is the easier option since you can make a mmap file in all of .2 seconds 😄 |
19:49:02 | FromDiscord | <Recruit_main707> @Gibson pretty sure proc is already considered a function pointer when its a type |
19:49:15 | hmmm | Beefy i'll try just that, never tried before so it will take some years, I'll be sure to report back :o |
19:52:04 | FromDiscord | <sealmove> hum why doesn't this work? https://play.nim-lang.org/#ix=2H40 |
19:53:03 | FromGitter | <iffy> Hmm... it seems to be a problem with running `nim check --os:linux` on macOS. When I run `nim check` or `nim c` on an actual Linux box, everything is fine. Is that a bug in `nim check`? |
19:53:52 | leorize[m]1 | what's the error? |
19:54:08 | FromGitter | <iffy> leorize: https://play.nim-lang.org/#ix=2H3K |
19:57:33 | FromDiscord | <Vindaar> @sealmove because you're allowed to have hash collisions iiuc. Define an equality operator in addition: https://play.nim-lang.org/#ix=2H46 Using the default equality operation these objects are different. I think that's why |
19:57:49 | * | Vladar quit (Quit: Leaving) |
19:58:22 | FromDiscord | <sealmove> oh great thx. so could it be that I don't `hash` at all? |
19:58:51 | FromDiscord | <Vindaar> well you certainly hash, otherwise you couldn't use the `HashSet` |
19:59:03 | FromDiscord | <Vindaar> but a hash is not a measure for equality |
19:59:33 | FromDiscord | <sealmove> hmm, i see, thanks again |
19:59:43 | FromDiscord | <Vindaar> no worries |
20:03:04 | leorize[m]1 | @iffy yea it looks like a bug but I don't have a mac here to test |
20:09:38 | * | luismanfroni quit (Remote host closed the connection) |
20:09:58 | * | luismanfroni joined #nim |
20:10:11 | FromDiscord | <sealmove> oh ok now I understand `hash`. `equal` only applies to object with same hash. |
20:10:22 | FromDiscord | <sealmove> objects |
20:13:55 | * | vsantana joined #nim |
20:14:18 | FromDiscord | <sealmove> so to be equal 2 objects must produce same hash _and_ `==` must return true. |
20:17:23 | * | siulManfroni joined #nim |
20:18:10 | * | luismanfroni quit (Remote host closed the connection) |
20:18:31 | ForumUpdaterBot | New thread by Stefan_Salewski: When (compiles do: import a): is very broken, see https://forum.nim-lang.org/t/7222 |
20:20:49 | hmmm | hmm interesting |
20:20:54 | * | xet7 quit (Ping timeout: 272 seconds) |
20:21:03 | hmmm | how does nim know I want the open from memfiles and not the normal open()? |
20:21:28 | * | xet7 joined #nim |
20:21:29 | * | spiderstew quit (Quit: Konversation terminated!) |
20:21:38 | hmmm | it must be some kind of magick I'm sure |
20:22:20 | * | spiderstew joined #nim |
20:22:47 | * | xet7 quit (Remote host closed the connection) |
20:23:10 | * | xet7 joined #nim |
20:24:17 | FromGitter | <bung87> you may want two programs share same memfiles |
20:25:33 | * | vsantana quit (Quit: Leaving.) |
20:26:37 | * | ^Q-Master^ quit (Ping timeout: 260 seconds) |
20:27:55 | FromDiscord | <Gibson> ahh, got it figured out |
20:28:03 | FromDiscord | <Gibson> i was allocating memory in the wrong way |
20:32:00 | FromGitter | <bung87> zevv how to detect capture length and get capture in group after `:` in npeg |
20:34:04 | * | narimiran quit (Ping timeout: 260 seconds) |
20:36:37 | FromDiscord | <shadow.> i mean if you're capturing into a group like $1 you can always do `($1).len` |
20:36:49 | FromDiscord | <shadow.> in the block below |
20:37:47 | FromGitter | <bung87> I wanna know captures.len |
20:38:35 | FromGitter | <bung87> I have a group that contains capture and that group is optional |
20:38:58 | FromDiscord | <shadow.> send your code |
20:40:42 | FromGitter | <bung87> https://play.nim-lang.org/#ix=2H4r |
20:41:09 | reversem3 | If I have a huge file of strings (1 per line) all numbers. I want to find the amount the total amount of strings in that file. I did a readAll then a for loop then a len(readAll) but got some weird length |
20:41:29 | FromDiscord | <shadow.> you wanna get the length of mime? |
20:41:38 | FromDiscord | <shadow.> im confused |
20:41:50 | FromGitter | <bung87> no , I wanna see if there is number |
20:42:12 | reversem3 | like how wc -l gets a length of how many lines there are |
20:42:29 | FromDiscord | <shadow.> ah i see |
20:42:32 | FromDiscord | <shadow.> i mean |
20:42:35 | FromGitter | <bung87> and that code currently only one capture, so I can't get number and check there there's number |
20:42:46 | FromDiscord | <shadow.> you can check if `$2` raises an NPegException |
20:43:50 | FromGitter | <bung87> hmm, that's a workaround, yeah should work |
20:44:46 | FromDiscord | <shadow.> ye |
20:45:08 | FromDiscord | <shadow.> i mean with what's given that's all i can think of |
20:46:56 | FromGitter | <bung87> I dont know whether npeg has some like captures.len can be use there. |
20:48:02 | FromGitter | <bung87> still a powerful tool, fews lines do work same as my 100 lines parser.. |
20:50:13 | FromDiscord | <shadow.> >"Because friends don't let friends write parsers by hand" |
20:50:18 | FromDiscord | <shadow.> (edit) ">"Because" => "> "Because" |
20:52:18 | FromGitter | <bung87> wait , after I do try catch there, .captures() all empty |
20:53:32 | * | Q-Master joined #nim |
20:54:51 | FromGitter | <bung87> nvm |
20:55:58 | * | spiderstew quit (Quit: Konversation terminated!) |
20:56:57 | * | spiderstew joined #nim |
21:08:14 | * | ehmry quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
21:10:20 | * | ehmry joined #nim |
21:10:26 | * | PMunch joined #nim |
21:16:45 | FromDiscord | <sealmove> `captures().len`? |
21:18:39 | FromDiscord | <sealmove> "When a grammar rule ends with a colon :, the next indented block in the grammar is interpreted as Nim code, which gets executed when the rule has been matched. Any string captures that were made inside the rule are available to the Nim code in the injected variable capture[] of type seq[Capture]: |
21:19:14 | FromDiscord | <sealmove> So `capture.len` I guess. |
21:20:28 | FromDiscord | <shadow.> yes |
21:20:30 | FromDiscord | <sealmove> @bung87 (in case you didn't find it yet) |
21:20:31 | FromDiscord | <shadow.> wait |
21:20:45 | FromDiscord | <shadow.> captures? |
21:20:50 | FromDiscord | <shadow.> lemme look at ur code |
21:20:54 | FromDiscord | <sealmove> `capture` not `captures` |
21:21:05 | FromDiscord | <shadow.> where is capture defined? |
21:21:10 | FromDiscord | <sealmove> in npeg |
21:21:12 | FromDiscord | <shadow.> oh wait |
21:21:13 | FromDiscord | <shadow.> are you saying |
21:21:14 | FromDiscord | <sealmove> it's injected automatically |
21:21:16 | FromDiscord | <shadow.> the match object? |
21:21:17 | FromDiscord | <shadow.> or |
21:21:18 | FromDiscord | <shadow.> oh |
21:21:23 | FromDiscord | <sealmove> $1 is syntax sugar for it |
21:21:28 | FromDiscord | <shadow.> ah yeah thats what i use |
21:25:54 | * | haxscramper quit (Remote host closed the connection) |
21:47:23 | * | tane joined #nim |
21:52:19 | * | VijayMarupudi[m] joined #nim |
22:02:43 | * | fowl quit (*.net *.split) |
22:02:43 | * | clemens3 quit (*.net *.split) |
22:04:01 | * | pbb quit (Ping timeout: 272 seconds) |
22:05:37 | * | luis1 quit (Quit: WeeChat 2.9) |
22:06:00 | * | pbb joined #nim |
22:11:02 | * | clemens3 joined #nim |
22:15:05 | * | mbomba joined #nim |
22:15:37 | FromDiscord | <shadow.> hola |
22:17:45 | FromDiscord | <shadow.> i know peg's aren't a nim-specific concept, but why are they less prevalent in other languages? |
22:17:53 | * | PMunch quit (Quit: leaving) |
22:17:54 | FromDiscord | <shadow.> is it because nim has macros so it's easier to implement ? |
22:29:11 | * | tane quit (Quit: Leaving) |
22:30:58 | * | fowl joined #nim |
22:36:40 | mipri | they're just new. |
22:37:00 | mipri | relatively speaking. D has a good library as well, and Rust has one that's probably good. |
22:37:16 | FromDiscord | <shadow.> ahh i see |
22:37:28 | FromDiscord | <shadow.> well i certainly think this is the cleanest way i've found to parse thus far lol |
22:37:39 | * | siulManfroni quit (Remote host closed the connection) |
22:37:42 | FromDiscord | <shadow.> i suppose i was always too lazy to learn anything other than regex and scanf |
22:38:21 | disruptek | nim is well-suited to dsls and dsls are well-suited to pegs libraries. |
22:39:59 | FromDiscord | <shadow.> fair enough |
23:14:35 | * | hmmm quit () |
23:31:35 | FromDiscord | <shadow.> does anyone know if this https://github.com/alehander92/comprehension package still works? |
23:31:43 | FromDiscord | <shadow.> doesn't seem to work for me |
23:35:59 | mipri | it passes its tests. |
23:36:07 | mipri | what are you doing that doesn't work? |
23:37:02 | FromDiscord | <shadow.> lemme write some example code one sec |
23:37:06 | mipri | every single example is a comprehension over a table, mind. not one seq[T] |
23:37:13 | FromDiscord | <shadow.> yeah seq comprehension |
23:37:28 | mipri | it says "seq comprehension" but it's used with a table. it produces a seq |
23:37:49 | FromDiscord | <shadow.> odd |
23:38:02 | FromDiscord | <shadow.> it can't be used with a seq as the iterable? |
23:38:18 | mipri | simple test fails for me, and again every single example and test is with a table |
23:38:46 | FromDiscord | <shadow.> https://media.discordapp.net/attachments/371759389889003532/785651543810637834/unknown.png |
23:38:46 | FromDiscord | <shadow.> yeah |
23:38:48 | FromDiscord | <shadow.> let me try with a table |
23:39:32 | FromDiscord | <shadow.> lmao it works when you're iterating over a table, but not a seq |
23:39:34 | FromDiscord | <shadow.> interesting |
23:40:37 | FromDiscord | <shadow.> i guess that's all it was made for i suppose |
23:40:44 | FromDiscord | <shadow.> fair enough ill make my own |
23:45:55 | FromDiscord | <dorei> how stable is nim? i mean, if start learning it, will the language change in a few months? |
23:46:05 | FromDiscord | <dorei> stable is not the right word i guess |
23:48:26 | FromDiscord | <shadow.> quite stable |
23:48:33 | FromDiscord | <shadow.> one sec |
23:48:45 | FromDiscord | <shadow.> > How stable is Nim?↵> ↵> The compiler and stdlib are actively under development and have a suite of test cases to ensure ongoing stability. Regular releases are posted every three to six months that can be used as a base for projects requiring a stable foundation. Breaking changes are rare but are documented in detail and can typically be managed with minimal effort. The compiler also highlights deprecated features to provide suffi |
23:48:55 | mipri | it has a 1.x version number and a compiler flag to emulate 1.0 exactly. |
23:49:45 | FromDiscord | <dorei> oh, i see, i think i'll give nim a try 🙂 |
23:51:02 | FromDiscord | <shadow.> sounds good |
23:51:39 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2H5A |
23:53:28 | * | lritter quit (Quit: Leaving) |
23:59:38 | FromDiscord | <shadow.> nvm |