00:01:08 | FromGitter | <alehander92> what are zombies? |
00:05:38 | FromDiscord | <dk> What exactly happens when a socket is disconnected before `asyncnet.recv` finishes? |
00:05:42 | FromDiscord | <dk> `FutureError`? |
00:06:45 | FromDiscord | <dk> I mean `asyncnet.send` |
00:12:53 | * | awe00__ quit (Ping timeout: 260 seconds) |
00:21:08 | * | a_chou joined #nim |
00:25:37 | FromGitter | <gogolxdong> How to deal with `/mnt/c/Users/asus/.nimble/pkgs/chronos-2.5.2/chronos/transports/common.nim(516, 4) Error: expression cannot be cast to ptr SeqHeader` |
00:26:02 | * | audiofile quit (Quit: Default Quit Message) |
00:26:55 | FromGitter | <gogolxdong> cast string to cast[ptr SeqHeader] where SeqHeader is an object with two int fields |
00:29:14 | donpdonp | from a couple hours ago when redis-0.3.0 couldnt find net.Socket, there is a local ./src/net.nim in my project and it was loading the local net, not the nim's net. |
00:29:38 | donpdonp | even though ./src/config.net does import redis, and has no problem finding the nim's net |
00:32:18 | * | donpdonp renames the local net.nim to nnet.nim |
00:32:58 | Yardanico | donpdonp: you don't need to |
00:33:05 | Yardanico | you can just use the "std" prefix for all stdlib module imports |
00:33:08 | Yardanico | import std/net |
00:33:32 | Yardanico | import std/[os, strutils, json] as an example for multi-module import syntax with std |
00:33:40 | donpdonp | id have to submit that edit to redis |
00:33:44 | Yardanico | what edit? |
00:33:52 | Yardanico | ah right |
00:33:56 | donpdonp | 'import net' -> 'import std/net' |
00:34:10 | donpdonp | thx though, i'll give thta a try and submit a PR |
00:34:16 | Yardanico | well you can just make a PR and in the meantime use your own fork |
00:34:21 | * | donpdonp nods |
00:34:22 | Yardanico | nimble supports specifying git urls for packages |
00:34:40 | * | donpdonp claps |
00:47:10 | donpdonp | and done. https://github.com/nim-lang/redis/pull/20 |
00:47:11 | disbot | ➥ import std/net to allow for local 'net' module |
00:58:52 | FromDiscord | <19> quick question: how can i create a set from a seq |
00:59:43 | FromDiscord | <19> in py you just: x = set(myList) |
01:02:04 | * | apahl_ quit (Ping timeout: 244 seconds) |
01:02:22 | Yardanico | what kind of set do you want? |
01:02:26 | Yardanico | a hash set or a bit set? |
01:02:42 | Yardanico | for hashsets - https://nim-lang.org/docs/sets.html |
01:02:46 | FromDiscord | <19> just the usual mathematical set |
01:02:53 | Yardanico | well, it depends on the type :) |
01:02:58 | Yardanico | but yeah, hash sets will work |
01:03:05 | FromDiscord | <19> set[in16] |
01:03:08 | FromDiscord | <19> whats this |
01:03:28 | * | apahl joined #nim |
01:03:42 | Yardanico | a built-in nim set |
01:03:51 | Yardanico | https://nim-lang.org/docs/manual.html#types-set-type |
01:03:57 | FromDiscord | <19> ohhh |
01:03:59 | Yardanico | they're bit vectors actually |
01:04:02 | Yardanico | so you might not want to use them |
01:04:07 | * | willp_001 joined #nim |
01:04:11 | Yardanico | they're more useful for stuff like chars or enum members |
01:04:13 | * | vicfred joined #nim |
01:04:25 | * | enthus1ast quit (Ping timeout: 240 seconds) |
01:04:52 | FromDiscord | <19> this is HashSet vs OrderedSet |
01:04:57 | Yardanico | no |
01:05:03 | Yardanico | nim's builtin set type is "set" |
01:05:09 | Yardanico | "sets" module provides both hashset and orderedset |
01:05:31 | FromDiscord | <19> the built in set type is the bitvector? |
01:05:34 | * | willp_001 quit (Client Quit) |
01:05:34 | Yardanico | yes |
01:05:48 | FromDiscord | <19> i see |
01:06:12 | FromDiscord | <19> what should i use instead? hashset? |
01:06:52 | FromDiscord | <19> i will explore all of these, thank you Yardanico |
01:13:44 | * | arecacea1 quit (Remote host closed the connection) |
01:14:08 | * | arecacea1 joined #nim |
01:23:33 | FromDiscord | <Avatarfighter> there is a redis client for nim? |
01:23:47 | disruptek | !repo redis |
01:23:48 | disbot | https://github.com/nim-lang/redis -- 9redis: 11Official redis wrapper for Nim. 15 70⭐ 21🍴 7& 10 more... |
01:23:52 | FromDiscord | <Avatarfighter> just read a snippet of an above conversation, just wanted to see if anyone has actually seen |
01:23:53 | FromDiscord | <Avatarfighter> oh |
01:23:55 | FromDiscord | <Avatarfighter> I like |
01:24:04 | FromDiscord | <Avatarfighter> thanks disruptek |
01:24:12 | disruptek | YOU ARE WELCOME |
01:25:07 | disruptek | .msg disbot kill Avatarfigter |
01:33:27 | * | apahl quit (Ping timeout: 272 seconds) |
01:34:40 | * | apahl joined #nim |
01:40:11 | FromGitter | <gogolxdong> Who is Lee Ting Ting, is she here? |
01:43:07 | FromGitter | <gogolxdong> She wrote Nim-libp2p Tutorial. |
01:57:26 | * | abm quit (Read error: Connection reset by peer) |
02:17:07 | * | muffindrake quit (Ping timeout: 260 seconds) |
02:19:03 | * | muffindrake joined #nim |
03:06:39 | * | vicfred quit (Quit: Leaving) |
03:44:14 | * | enthus1ast joined #nim |
03:56:24 | * | rockcavera quit (Remote host closed the connection) |
04:06:02 | * | supakeen quit (Quit: WeeChat 2.9) |
04:06:38 | * | supakeen joined #nim |
04:17:14 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
04:18:16 | * | vicfred joined #nim |
04:19:23 | * | vicfred quit (Max SendQ exceeded) |
04:19:51 | * | vicfred joined #nim |
04:21:04 | * | vicfred quit (Max SendQ exceeded) |
04:21:31 | * | vicfred joined #nim |
04:41:23 | * | arecacea1 quit (Remote host closed the connection) |
04:41:41 | * | arecacea1 joined #nim |
04:49:25 | * | vicfred quit (Quit: Leaving) |
04:52:26 | * | solitudesf joined #nim |
05:05:55 | FromDiscord | <Clyybber> disruptek why do you have to lift to toplevel? |
05:07:26 | disruptek | i dunno, because methods are dumb? |
05:07:37 | disruptek | ~python is https://github.com/nim-lang/Nim/wiki/Nim-for-Python-Programmers |
05:07:38 | disbot | python: 11https://github.com/nim-lang/Nim/wiki/Nim-for-Python-Programmers |
05:07:52 | disruptek | this is really, like, one of the best tutorials for nim i've ever seen. |
05:08:00 | disruptek | jc is off the fuckin' chain. |
05:08:37 | FromDiscord | <Clyybber> why use methods? |
05:09:06 | disruptek | it seemed like a good idea at the time. |
05:09:47 | FromDiscord | <Clyybber> instead of lifting to top |
05:10:00 | FromDiscord | <Clyybber> can we not use methods? |
05:10:11 | disruptek | we aren't using methods. |
05:10:16 | FromDiscord | <Clyybber> or are you talking user methods annotated with cps |
05:10:21 | FromDiscord | <Clyybber> oh okay |
05:10:25 | disruptek | because we cannot lift them to top. 😉 |
05:10:47 | FromDiscord | <Clyybber> wait |
05:10:58 | FromDiscord | <Clyybber> user methods? |
05:11:02 | disruptek | no. |
05:11:20 | FromDiscord | <Clyybber> why would we use methods |
05:11:21 | FromDiscord | <Clyybber> what for? |
05:13:17 | disruptek | van morrison can kiss my ass. |
05:14:48 | disruptek | because as we move continuations around we don't want to replace the result(). |
05:15:38 | disruptek | we want result() to yield the last valid result for the continuation type regardless of how it had to accrete new variables. |
05:15:56 | FromDiscord | <Clyybber> listen kid my vattery is running out and i need answers |
05:16:19 | FromDiscord | <Clyybber> also my mesaages are taking years to arrive and probably outoforder |
05:16:28 | disruptek | yeah, i'm crashing, myself. |
05:16:59 | disruptek | i'm overloading int() right now. that's my "solution." |
05:17:09 | FromDiscord | <Clyybber> lol |
05:17:23 | disruptek | or whateverthefuck the return type is. |
05:17:50 | FromDiscord | <Clyybber> can we do without methods? |
05:17:56 | disruptek | WE ARE. |
05:18:04 | disruptek | damnit i just felt a twinge. |
05:18:06 | FromDiscord | <Clyybber> well thats good isnt it |
05:18:12 | disruptek | no. |
05:18:15 | disruptek | it means |
05:18:16 | FromDiscord | <Clyybber> lets not use methods |
05:18:17 | disruptek | ah fuck |
05:18:34 | disruptek | the balls, the balls they are a'throbbin' |
05:18:41 | disruptek | damnit clyybber. |
05:18:44 | FromDiscord | <Clyybber> lmao |
05:19:08 | FromDiscord | <Clyybber> quick quick my vattery |
05:19:08 | disruptek | ah jesus |
05:19:41 | disruptek | what do you want damnit |
05:20:02 | FromDiscord | <Elegant Beef> The fuck are you guys |
05:20:29 | disruptek | i think the ahhh |
05:21:00 | disruptek | i think the code |
05:21:20 | disruptek | i think the code has sufficient comments. |
05:21:21 | disruptek | fuck |
05:21:41 | disruptek | https://github.com/disruptek/cps/blob/typed/cps.nim#L355 |
05:28:52 | disruptek | the vattery gottem |
05:33:22 | FromDiscord | <Clyybber> hold on; a battery pack just flew by, I might just catch it |
05:35:23 | FromDiscord | <Clyybber> got it |
05:35:23 | disruptek | even if resym worked the compiler will choke on it like an underage hooker. |
05:35:41 | disruptek | so there's no rush. |
05:35:51 | * | narimiran joined #nim |
05:37:24 | disruptek | anything with a period is bad news, ya feel? |
05:37:51 | disruptek | man i need some snacks. |
05:39:45 | disruptek | i can't even remember what you wanted me to do to skiplists. |
05:46:22 | * | maier joined #nim |
06:03:37 | * | tane_ joined #nim |
06:27:43 | * | PMunch joined #nim |
06:48:21 | * | gmaggior quit (Quit: Leaving) |
06:50:41 | * | Oddmonger quit (Changing host) |
06:50:41 | * | Oddmonger joined #nim |
07:05:39 | Araq | ping narimiran |
07:13:41 | FromDiscord | <Clyybber> Araq: Morning, regarding the asynce thing, how do we do it currently? |
07:14:33 | Araq | we don't, effect tracking is pessimistic for async |
07:14:39 | FromDiscord | <Clyybber> disruptek: Use multiple sequences instead of building a literal tree |
07:14:49 | Araq | it's always .raises: [Exception], tags: [RootEffect] |
07:14:57 | FromDiscord | <Clyybber> Araq: Ah, I see. And asynce would discard all effects instead of the ones specified? |
07:15:08 | FromDiscord | <Clyybber> (edit) 'instead' => 'except' |
07:24:43 | FromGitter | <alehander92> what would happen to the event loop' internal effects |
07:25:16 | * | hnOsmium0001 quit (Quit: Connection closed for inactivity) |
07:26:10 | Araq | no, the problem is that we don't expose the computed .raises information |
07:26:21 | Araq | so instead I ask the programmer to write it down again |
07:26:38 | Araq | and then we emit code to check the redundant info is correct |
07:26:58 | Araq | and we have the raises information available and can propagate it |
07:30:32 | * | tane_ quit (Quit: Leaving) |
07:33:46 | FromDiscord | <Clyybber> Why don't we automate it? |
07:34:12 | Araq | how so? that's the question |
07:34:38 | FromDiscord | <Clyybber> getImpl? |
07:35:08 | FromDiscord | <Clyybber> eh, getType |
07:35:27 | FromDiscord | <Clyybber> or getTypeImpl; whatever works |
07:35:52 | FromDiscord | <Clyybber> we look at the effects of the proc we are calling and propagate it upwards |
07:37:51 | * | a_chou quit (Quit: a_chou) |
07:41:20 | Araq | getTypeImpl currently doesn't expose it |
07:44:29 | FromDiscord | <Clyybber> oh, do we not attach the Effects to the type? |
07:49:44 | FromDiscord | <Clyybber> oh not in sempass1 I see |
07:54:53 | Zevv | s |
07:55:48 | FromDiscord | <Clyybber> Zevv: agreed |
07:56:23 | PMunch | Well this is fun, between v1.0 and v1.2 strutils.wordWrap changed named to std.wordWrap.wrapWords.. |
07:57:04 | PMunch | So if you want to support v1.0 and future versions you need a little when case around an import and a small template.. |
07:58:03 | PMunch | Hmm, what is this flag for? https://nim-lang.org/docs/system.html#nimCoroutines |
08:00:01 | PMunch | https://play.nim-lang.org/#ix=2w0P |
08:00:27 | Araq | PMunch, doesn't v1 have std.wordwrap.wrapWords already? |
08:01:37 | PMunch | Ah, indeed it does |
08:01:50 | PMunch | It's only <0.20 that doesn't have it |
08:01:53 | * | Vladar joined #nim |
08:05:05 | FromDiscord | <iWonderAboutTuatara> I'm still having some major issues with macros |
08:05:14 | FromDiscord | <iWonderAboutTuatara> I think the main issue is that the errors are very unhelpful |
08:05:16 | * | pietroppeter joined #nim |
08:05:34 | FromDiscord | <iWonderAboutTuatara> If the errors helped out a little bit more this might be easier |
08:05:53 | FromDiscord | <iWonderAboutTuatara> But I'm kind of taking shots in the dark and hoping I solve the problem nowadays |
08:06:23 | Araq | by the time we improved the error messages you've learned how to write macros, so only other newcomers will benefit from your complaints ;-) |
08:06:32 | Zevv | dude |
08:06:41 | Araq | I'm not really serious |
08:06:46 | Zevv | I know :; |
08:06:55 | Araq | so give us a gist to work with |
08:07:06 | Zevv | iWonderAboutTuatara: share your code and your error messages |
08:07:24 | FromDiscord | <iWonderAboutTuatara> Lmaoo |
08:07:34 | FromDiscord | <iWonderAboutTuatara> Nah my computer is off |
08:07:47 | FromDiscord | <iWonderAboutTuatara> But half the time it gives me the error as the name of the macro |
08:08:00 | FromDiscord | <iWonderAboutTuatara> Which is pretty hilarious but also very unhelpful |
08:08:27 | FromDiscord | <iWonderAboutTuatara> I also don't really understand how to pass a block of code to a macro |
08:08:44 | FromDiscord | <iWonderAboutTuatara> I don't think I've been doing it right though |
08:09:38 | FromDiscord | <iWonderAboutTuatara> Similarly, calling vars in `quote do` without the `\`` is not a very clear error message |
08:09:44 | FromDiscord | <iWonderAboutTuatara> (edit) '`\``' => '```' |
08:09:55 | FromDiscord | <iWonderAboutTuatara> (edit) '```' => '`\`' |
08:10:03 | FromDiscord | <iWonderAboutTuatara> (edit) '`\`' => '`''`' |
08:10:22 | FromDiscord | <iWonderAboutTuatara> Trying to think of others |
08:10:39 | FromDiscord | <iWonderAboutTuatara> Not an error message issue, but this is probably the most confusing concept I've learned in a while |
08:12:31 | FromGitter | <alehander92> well passing a block |
08:13:17 | FromDiscord | <iWonderAboutTuatara> I know thats the goal yeah |
08:13:47 | FromDiscord | <iWonderAboutTuatara> Don't know how to get from "I want to pass in a block" to "I've passed in a block" yet |
08:14:02 | FromGitter | <alehander92> is just having `macroName: <newline> block` |
08:14:23 | FromGitter | <alehander92> and block is just an argument |
08:15:13 | PMunch | Hmm, maybe I should write more about writing macros.. |
08:15:15 | FromDiscord | <iWonderAboutTuatara> You can do that? |
08:15:19 | FromDiscord | <iWonderAboutTuatara> Please |
08:15:25 | FromDiscord | <iWonderAboutTuatara> There are no good beginner tutorials |
08:15:30 | FromGitter | <alehander92> we really need |
08:15:33 | FromDiscord | <Elegant Beef> Pmunch i agree we should 😛 |
08:15:36 | FromDiscord | <iWonderAboutTuatara> They all assume you already know a fair bit about writing macros |
08:15:37 | FromGitter | <alehander92> well commented examples |
08:15:39 | FromGitter | <alehander92> i think |
08:15:40 | FromDiscord | <iWonderAboutTuatara> Which is kind of pointless |
08:15:42 | FromDiscord | <iWonderAboutTuatara> Not even that |
08:15:44 | FromGitter | <alehander92> that's what helps me most usually |
08:15:51 | FromDiscord | <iWonderAboutTuatara> There are literally no good beginner tutorials |
08:15:52 | PMunch | @iWonder this might be helpful: https://peterme.net/metaprogramming-and-read-and-maintainability-in-nim.html |
08:16:05 | narimiran | in the mean time: https://nim-lang.github.io/Nim/tut3.html |
08:16:09 | FromDiscord | <iWonderAboutTuatara> I'll save that link |
08:16:11 | PMunch | Even though it's not that friendly as a complete beginner tutorial I think |
08:16:16 | FromDiscord | <iWonderAboutTuatara> I read the tut 3 like 10 times |
08:16:26 | FromDiscord | <iWonderAboutTuatara> Am almost as lost as the first time |
08:16:33 | narimiran | PMunch: maybe you can improve tut3? :/ |
08:16:42 | FromGitter | <alehander92> awesome exactly like this blog |
08:18:06 | PMunch | Hmm, just scrolling through tut3 it looks pretty good. But I guess it might be a bit too technical and not have enough examples |
08:18:35 | PMunch | The article I wrote on it was more to show my process in designing a macro and how I go about implementing it |
08:19:11 | FromDiscord | <iWonderAboutTuatara> Templates are actually not too bad |
08:19:28 | FromDiscord | <Clyybber> @iWonderAboutTuatara are you using vscode? |
08:19:29 | FromDiscord | <iWonderAboutTuatara> They're pretty possible to get your head around with a little bit of time and dedication |
08:19:32 | FromDiscord | <iWonderAboutTuatara> Yeah |
08:19:46 | FromDiscord | <iWonderAboutTuatara> Even running it gives the weird error which is just the name of the macro and nothing else though |
08:19:59 | PMunch | Hmm, that does sound weird |
08:19:59 | FromDiscord | <Elegant Beef> Macros really arent too bad really, once you grasp they're just developing AST using nim code 😄 |
08:20:28 | FromDiscord | <Elegant Beef> I always compare the AST from the macro to written code |
08:20:36 | FromDiscord | <Elegant Beef> When it breaks |
08:20:39 | FromDiscord | <iWonderAboutTuatara> I used a symbol thing, eg `macro `!$+&`()` |
08:20:42 | PMunch | @Elegant, true, but they are a bit confusing sometimes |
08:20:49 | FromDiscord | <iWonderAboutTuatara> (edit) '`macro `!$+&`()`' => '/`macro /`!$+&`()`' |
08:21:16 | PMunch | And yeah, `echo result.repr` or `echo result.treeRepr` goes a long way to debug stuff |
08:21:26 | FromDiscord | <iWonderAboutTuatara> Should try that |
08:21:32 | FromDiscord | <iWonderAboutTuatara> I never set result to anything though |
08:21:46 | PMunch | Wait, what are you doing then? |
08:21:52 | FromDiscord | <iWonderAboutTuatara> I think it's supposed to be easier to use quote do |
08:22:01 | FromDiscord | <iWonderAboutTuatara> Or so I've been told by tutorial 3 |
08:22:13 | PMunch | Yeah, typically you would do `result = quote do: <whatever>` |
08:22:20 | PMunch | Or something similar |
08:22:24 | FromDiscord | <iWonderAboutTuatara> Wait, you can do that? |
08:22:29 | Araq | I never use 'quote do' :-) |
08:22:36 | PMunch | Do what? |
08:22:41 | FromDiscord | <iWonderAboutTuatara> Lol |
08:22:46 | Araq | too old for this new stuff, I use helper templates and getAst |
08:22:49 | PMunch | Araq, I use `superQuote do` :D |
08:23:25 | FromDiscord | <iWonderAboutTuatara> 50/50 on that being a joke |
08:23:35 | PMunch | That's pretty much what quote does though, just without the extra work |
08:23:35 | FromDiscord | <iWonderAboutTuatara> It's either fake or part of your macros package I think |
08:23:52 | PMunch | @iWonder, not a joke, it's part of my macroutils package :P |
08:23:52 | FromDiscord | <iWonderAboutTuatara> What's superquote do? |
08:24:01 | FromDiscord | <iWonderAboutTuatara> 1/2 chance lol |
08:24:09 | Araq | it's a fixed quote |
08:24:21 | Araq | quote without the many quirks |
08:24:28 | FromDiscord | <iWonderAboutTuatara> Sure |
08:24:45 | PMunch | Well, with a different set of quirks :P |
08:24:47 | PMunch | https://nimble.directory/pkg/macroutils |
08:24:59 | FromDiscord | <iWonderAboutTuatara> I don't have any idea what that means lol, but I don't think it matters too much at my level |
08:25:47 | PMunch | It basically allows you do to things like "result = superQuote do: echo `$input[0].name`" where `input` is a sequence of things with a name property that can be stringified |
08:26:11 | * | krux02 joined #nim |
08:26:23 | FromDiscord | <iWonderAboutTuatara> Interesting |
08:26:46 | FromDiscord | <iWonderAboutTuatara> 95% of this is miles over my head lol |
08:27:08 | PMunch | https://play.nim-lang.org/#ix=2w0W |
08:28:03 | FromDiscord | <iWonderAboutTuatara> Wait it let's you $ things in a quote do? |
08:28:05 | FromDiscord | <iWonderAboutTuatara> That's useful |
08:28:51 | PMunch | Yeah, it basically pulls the content of `` pieces out into something like `let x = <content>` and spits out a do with the content replaced with `x` |
08:29:35 | FromDiscord | <iWonderAboutTuatara> I think I kind of understand that |
08:30:00 | PMunch | Haha, don't worry about it, you'll hit the limitations of quote at some point, then you can have a look at superQuote |
08:32:10 | FromDiscord | <iWonderAboutTuatara> I think I need to understand what it's doing before I worry about limitations :p |
08:32:18 | FromDiscord | <iWonderAboutTuatara> I'll get there eventually |
08:32:29 | FromDiscord | <iWonderAboutTuatara> Sooner feather than later, hopefully |
08:32:55 | FromDiscord | <iWonderAboutTuatara> Dom96's book is actually really good, it's a shame I can't afford at the moment |
08:33:04 | FromDiscord | <iWonderAboutTuatara> I've been using the free online version |
08:33:52 | PMunch | Yeah, it's a pretty good book :) |
08:34:42 | FromDiscord | <iWonderAboutTuatara> It's very simple and eelll thought through |
08:35:07 | FromDiscord | <iWonderAboutTuatara> It's the 2nd best source I've found for macros, first being this discord/irc/gitter |
08:35:19 | PMunch | Anyone wants to get GeSHi syntax highlighting for Nim up and running so Rosetta Code can highlight stuff for us? https://rosettacode.org/wiki/Rosetta_Code:Village_Pump/Syntax_highlighting#Relationship_Between_Rosetta_Code_and_GeSHi |
08:36:43 | FromGitter | <alehander92> just look at macros |
08:36:45 | FromGitter | <alehander92> as functions imho |
08:36:56 | FromGitter | <alehander92> which take nodes and return a node |
08:37:16 | FromGitter | <alehander92> not as in something very advanced |
08:37:48 | FromDiscord | <Elegant Beef> I mean i showed them how easy it is to make a go walrus operator using macros, so they know it can be rather simple 😄 |
08:38:23 | FromGitter | <alehander92> quote is just similar as well: it takes some stuff and returns a node corresponding to it |
08:38:43 | FromGitter | <alehander92> don't look at it as something complicated |
08:39:34 | FromDiscord | <Elegant Beef> Yea in nim it's very much just code replacement using code |
08:41:02 | FromDiscord | <Elegant Beef> I also didnt expect to be able to use macros as operators, that was wild |
08:44:38 | krux02 | Elegant Beef: One of the unique features in Nim is, that macros also have type information of their arguments. In many other programming languages, macros are limited to work on the text (C, afaik D), or the raw ast without type information (lisp, afaik rust) |
08:49:31 | * | awe00__ joined #nim |
08:58:57 | FromDiscord | <iWonderAboutTuatara> @Elegant Beef yeah that was some shoes clean code |
08:59:05 | FromDiscord | <iWonderAboutTuatara> I think the issue comes when scaling up |
08:59:34 | FromDiscord | <iWonderAboutTuatara> It's easy to juggle a small AST in my head, much harder to keep it straight and fix the errors when the possibility space is so much larger :) |
08:59:52 | FromDiscord | <iWonderAboutTuatara> (edit) 'shoes' => 'very' |
08:59:57 | FromDiscord | <Elegant Beef> What are you currently trying to do? |
09:00:05 | FromDiscord | <iWonderAboutTuatara> I've honestly forgotten |
09:00:11 | FromDiscord | <iWonderAboutTuatara> I'm not at my computer right now |
09:00:26 | Araq | it scales just like ordinary programming does, use helper procs working on NimNode |
09:00:58 | FromDiscord | <Elegant Beef> Yea, you can use a bunch of the constructor Nodes + nim nodes to generate macros relatively easy |
09:02:02 | FromDiscord | <Elegant Beef> For instance this macro |
09:02:03 | FromDiscord | <Elegant Beef> https://forum.nim-lang.org/t/6759#41996 |
09:02:26 | FromDiscord | <Elegant Beef> *Not a very smart implementation, but it "works"* |
09:04:33 | FromDiscord | <Elegant Beef> Do have to say I've seen "Macros cant change the syntax, which sucks", but after playing around with these macros for specific behaviour it's relatively easy to generate "new syntax" |
09:09:36 | Zevv | I disagree |
09:10:11 | FromDiscord | <Elegant Beef> With which part? |
09:10:11 | Zevv | I'm not saying that it sucks, it's just the way it is |
09:10:30 | Zevv | but the available syntax choices are limited, it's still the Nim parser that has to agree |
09:14:09 | Araq | after all these years I still think the current design works best |
09:14:49 | Araq | if you depart too much from the existing Nim syntax, you need to use triple quotes and parse it at compile-time and the syntax highlighters are not confused then |
09:15:48 | Araq | it's a sweet spot in language design. |
09:16:01 | Zevv | I agree |
09:17:10 | FromGitter | <alehander92> i .. almost agree |
09:17:29 | Araq | different topic: I'm pausing on https://github.com/nim-lang/Nim/pull/15251 |
09:17:30 | disbot | ➥ new-style concepts implemetion, WIP |
09:17:33 | FromGitter | <alehander92> but php and html already have tags which are very popular and which ide-s learn to recognize |
09:17:41 | FromGitter | <alehander92> and apply different highlighting there |
09:17:45 | FromGitter | <alehander92> so it's technically possible |
09:18:00 | FromGitter | <alehander92> still it's cool that the syntax looks consistent so this point is probably important |
09:18:33 | Araq | php doesn't have a macro system so I fail to see the connection |
09:18:45 | FromGitter | <alehander92> it's about tooling |
09:19:02 | FromGitter | <alehander92> editors can show different syntaxes based on some pattern in the code already |
09:19:26 | Araq | yeah so better have these detectable patterns in your code then |
09:19:37 | FromGitter | <alehander92> so one can imagine that a convention like `dsl[lang]: token macro` in nim on theory |
09:19:45 | FromGitter | <alehander92> which would be highlightable correctly |
09:20:07 | FromGitter | <alehander92> not different than ```<lang>``` in github markdown |
09:20:18 | FromGitter | <alehander92> or script tags in html |
09:20:20 | Araq | silly non-sense, the '[lang]' part is poorly specified for custom macros |
09:20:50 | FromGitter | <alehander92> eh i am talking for when e.g. C / asm code is emitted |
09:21:19 | Araq | what is the '[nim-sugar-dup]' lang and how many of these illdefined micro-languages do you want to add to your editor? |
09:21:22 | FromGitter | <alehander92> if it's just custom dsl, then yeah, no benefit except if the person writes a custom config file for it |
09:21:50 | FromGitter | <alehander92> wait i am talking about stuff like hypothetical c/asm emitting or reader macros |
09:23:42 | Araq | yeah I have no idea what you're talking about |
09:25:00 | FromGitter | <alehander92> offtopic anyway :D |
09:32:53 | * | krux02 quit (Read error: Connection reset by peer) |
09:33:59 | * | krux02 joined #nim |
09:35:04 | FromDiscord | <Varriount> Oh, hey Araq |
09:35:12 | FromDiscord | <Varriount> How are things going? |
09:36:02 | Araq | well, 1.4 is just around the corner |
09:36:37 | FromDiscord | <Varriount> Gasp! |
09:36:51 | * | abm joined #nim |
09:37:31 | Araq | and I might write an RFC about typeParam[T] |
09:37:47 | Araq | which is typedesc[T] without its bugs :D |
09:38:13 | Araq | and then bugfixes don't break anybody's code |
09:38:30 | FromDiscord | <Varriount> The problem with those RFCs is that I feel incapable of making any substantial comments |
09:39:16 | FromDiscord | <Varriount> It always feels like Mratsim and Zahary have the best insights |
09:39:31 | FromDiscord | <Varriount> Though, I can certainly ask questions. |
09:42:14 | FromDiscord | <lqdev> hold up |
09:42:24 | FromDiscord | <lqdev> wasn't 1.4 supposed to have IC? |
09:42:57 | FromDiscord | <lqdev> or is that postponed until 1.6 |
09:43:12 | Araq | 1.4 adds --gc:orc |
09:43:40 | Araq | we planned to have it --gc:orc as the default but we decided we won't make it the default until 1.6 |
09:43:45 | * | tane_ joined #nim |
09:44:00 | FromDiscord | <dom96> hah, that would be pretty aggressive |
09:44:03 | FromDiscord | <lqdev> so incremental is postponed indefinitely? |
09:44:50 | Araq | lqdev: IC is hoped to arrive by end of October |
09:45:01 | FromDiscord | <lqdev> righty-o |
09:45:38 | FromDiscord | <dom96> for the 1.4 release notes you should ask people to test --gc:orc |
09:45:47 | FromDiscord | <dom96> and mention that the plan is to make it default in 1.6 |
09:46:00 | Araq | Yardanico and narimiran did plenty of testing |
09:46:09 | Araq | based on our "important packages" |
09:46:18 | Araq | but yeah |
09:46:20 | Araq | I agree |
09:46:36 | FromDiscord | <dom96> Yes, that doesn't affect what I said |
09:55:33 | FromDiscord | <Rika> i found jester+httpbeast murdered my ram using orc but not with default, not sure if its just my code or an issue with httpbeast |
09:55:40 | FromDiscord | <Rika> let me test again with a newer devel |
09:56:27 | Araq | it's a reported bug, not sure if it's jester or httpbeast |
09:56:48 | Araq | some smaller program that reproduces the problem would help, as usual |
09:56:56 | FromDiscord | <dom96> you can check easily: -d:useStdlib IIRC |
09:57:36 | * | arecacea1 quit (Remote host closed the connection) |
09:57:59 | * | arecacea1 joined #nim |
10:04:21 | FromDiscord | <Rika> it seems to not happen anymore, odd |
10:05:26 | Araq | probably because of my cursor inference fixes. Fun fact: "strict" funcs and cursor inference use the same algorithm and "borrow checking for openarray" will use it too |
10:05:54 | Araq | buy one, get two for free. |
10:06:37 | FromDiscord | <dom96> Nim's new business model is the same as most supermarkets now |
10:07:43 | Araq | lol, well also have the "get bought by Yahoo!" business model |
10:10:47 | * | agent0x00 joined #nim |
10:14:33 | FromGitter | <alehander92> IC <3 |
10:14:39 | FromGitter | <alehander92> dom96 haha |
10:32:22 | Araq | https://github.com/nim-lang/RFCs/issues/248 feedback appreciated |
10:32:25 | disbot | ➥ Unquoted indentation-based string literals ; snippet at 12https://play.nim-lang.org/#ix=2w1m |
10:32:43 | Araq | note that this isn't my RFC |
10:36:18 | FromDiscord | <dom96> My main question is why do we need this? |
10:36:28 | FromDiscord | <dom96> Why are triple quoted string literals not enough? |
10:38:09 | Araq | my main question is why my VSCode cannot highlight Nim code properly |
10:38:22 | FromDiscord | <Rika> probably wants `strutils.unindent` to be automated |
10:38:27 | Araq | it doesn't understand Nim's string literals |
10:38:52 | FromDiscord | <dom96> because the VS Code extension hasn't been written by the core team |
10:39:03 | FromDiscord | <dom96> It may be about time to create an official extension |
10:42:28 | * | nc-x joined #nim |
10:42:44 | nc-x | D also has separate literals for the syntax highlighting reason |
10:42:45 | federico3 | any new idea for https://github.com/nim-lang/Nim/pull/6481 ? |
10:42:45 | disbot | ➥ Add support for the blockdiag suite in docgen |
10:43:06 | nc-x | otherwise there is no way for the compiler to detect that a string contains code |
10:45:12 | FromDiscord | <dom96> there is in nim: `cpp"""int x = 0;"""` |
10:52:20 | Araq | federico3, I used 'markdeep', how does it compare to 'blockdiag'? |
10:53:21 | nc-x | isn't markdeep simply a kind of markdown alternative? |
10:53:48 | Araq | no. |
10:54:01 | nc-x | oh. it also supports diagrams/ |
10:55:54 | federico3 | markdeep is similar to asciidoc: an entire markup language instead of just the diagram generation. Also it requires you to actually draw the diagram in ascii instead of simply writing e.g. "client -> dispatcher -> worker1, workerDots, workerN;" |
10:58:53 | Araq | "simply writing", well how simple does it remain when I decribe a graph? |
11:01:19 | Araq | lol I can run gedit via WSL |
11:01:29 | Araq | feels like magic |
11:09:29 | * | lritter joined #nim |
11:09:33 | Araq | bootstrapping works, valgrind works, everything works, should have done that earlier |
11:12:25 | * | zama quit (Ping timeout: 240 seconds) |
11:12:34 | federico3 | Araq: "A -> B -> C \n B -> D \n B-> A" and so on. The point of graphviz & co is to generate simple diagrams automatically |
11:13:16 | * | zama joined #nim |
11:19:02 | * | awe00 joined #nim |
11:21:58 | * | awe00__ quit (Ping timeout: 260 seconds) |
11:22:29 | * | nc-x quit (Remote host closed the connection) |
11:31:23 | FromDiscord | <Varriount> Hm. Anyone have input on the herestring RFC? I can't seem to think of a reason _not_ to add it other than "we already have 3 other string literal types" |
11:32:43 | FromDiscord | <Rika> i think its redundant |
11:33:13 | FromDiscord | <Varriount> (though to be fair, if I had to choose between triple quoted strings and herestrings, I would pick the latter) |
11:35:12 | FromDiscord | <Rika> it sounds more complicated for a regex syntax highlighter to parse, i think |
11:35:45 | * | agent0x00 quit (Ping timeout: 240 seconds) |
11:35:59 | FromDiscord | <Varriount> I never liked the magical "eat leading whitespace" behavior that triple quoted strings have. Even though it's helpful, I find it unintuitive, since the other string literals don't have that kind of behavior. |
11:41:24 | Araq | "we already have 3 other string literal types" is pretty compelling |
11:41:34 | * | MyMind quit (Read error: Connection reset by peer) |
11:42:04 | * | awe00 quit (Ping timeout: 256 seconds) |
11:43:47 | * | awe00 joined #nim |
11:43:52 | FromDiscord | <Varriount> Araq: I'm sure we can boost that to a good half-dozen |
11:44:35 | FromDiscord | <Rika> lol |
11:49:06 | planetis[m] | clyybber: I tried an example and needs addr everywhere: https://gist.github.com/planetis-m/e39abac03c90cb37066ffb96b7b552b1 |
11:59:15 | FromDiscord | <Hearthstone> Is there any alternatives to dynlib? |
11:59:33 | FromDiscord | <Hearthstone> The nim module- |
11:59:43 | FromDiscord | <Hearthstone> I'm asking because I'm curious |
12:04:44 | * | rockcavera joined #nim |
12:05:54 | FromDiscord | <haxscramper> I'm writing longer response on github, but just to make sure: `strutils.unindent` "removes **all** indentation composed of whitespace from each line in s". Which means the tring you get is not unindented but rather 'stripped on leading whitespaces', which is not the same thing. Or I'm missing something? |
12:06:02 | * | supakeen quit (Quit: WeeChat 2.9) |
12:06:37 | * | supakeen joined #nim |
12:09:34 | FromDiscord | <Rika> @haxscramper https://play.nim-lang.org/#ix=2w1I but in short it only removes however many whitespaces you put in the arg |
12:10:11 | FromDiscord | <Rika> unless you use the other unindent, which sounds like its doing something wrong imo |
12:11:38 | FromDiscord | <haxscramper> When I say unindent I mean "strip equal number of prefix whitespaces from each line". With stdlib unindent you don't get the same string you wrote in the code. |
12:12:12 | FromDiscord | <Rika> `Unindents each line in s by count amount of padding. Sometimes called dedent` |
12:12:14 | FromDiscord | <Rika> as ive said |
12:12:19 | FromDiscord | <Rika> the other unindent is prolly wrong |
12:12:24 | FromDiscord | <Rika> but the one i demoed is correct |
12:34:30 | narimiran | hohoho, i just got `Error: 'BiggestUint' should be: 'BiggestUInt'`. goddammit, why nim can't be case-insensitve?!? :P |
12:37:08 | FromDiscord | <dom96> wat |
12:38:01 | FromDiscord | <Rika> wat |
12:38:13 | narimiran | it's time to reverse-complain about case (in)sensitivity! :D |
12:38:34 | federico3 | ?? |
12:38:40 | narimiran | for the uninitiated: you cannot be sloppy anymore when it comes to stdlib code |
12:39:34 | narimiran | (it has been like that for quite some time, but today it was the first time i made a typo and hit that error) |
12:39:51 | FromDiscord | <dom96> wow, can we get the same for all code? 😛 |
12:40:22 | federico3 | hint: nimfmt |
12:40:41 | narimiran | @dom96: `--styleCheck:error` |
12:41:32 | narimiran | checkmate, HN comments! |
12:41:51 | FromDiscord | <dom96> nice nice, now can we make it default for all code 😛 |
12:42:29 | narimiran | so we get hate from both sides? :D |
12:43:02 | FromDiscord | <dom96> In all seriousness, it would be interesting to do some research |
12:43:38 | narimiran | there is `--styleCheck:hint` as a first step |
12:43:40 | FromDiscord | <dom96> to determine how much code actually makes use of style insensitivity |
12:43:40 | * | CcxWrk quit (Ping timeout: 246 seconds) |
12:44:15 | FromDiscord | <dom96> if it's less than 1% then that may be a good excuse to get rid of this once and for all |
12:44:28 | FromDiscord | <dom96> then we just need to figure out qualified imports by default and HN will love us 😛 |
12:45:47 | narimiran | FTW!! :D |
12:47:08 | FromDiscord | <exelotl> Style insensitivity is nice because is keeps out intolerant dinguses :p |
12:47:34 | FromDiscord | <exelotl> (edit) 'is' => 'it' |
12:48:19 | FromDiscord | <Rika> just redirect the intolerant to zig |
12:48:37 | federico3 | dom96: that's what nimfmt is for |
12:48:42 | * | CcxWrk joined #nim |
12:51:11 | FromDiscord | <haxscramper> > to determine how much code actually makes use of style insensitivity↵@dom96 I checked arraymancer with this script - https://gist.github.com/haxscramper/2dd304e8b103b956892702fb1fef9b0d - out of `50083` identifiers detected only `7900` used snake case. It is an open question how things like `alllowercasenounderscores` should be categorized, though. But without some kind of NLP for string splitting it is really hard to tell. |
12:52:35 | FromDiscord | <dom96> haxscramper: that's worrying and not what we should be counting IMO. |
12:52:48 | FromDiscord | <dom96> You need to determine the style for a library |
12:53:05 | FromDiscord | <dom96> then check how many times it uses that style when it calls into a proc that has a different style |
12:53:12 | FromDiscord | <dom96> since that is the purpose of this feature |
12:53:54 | federico3 | haxscramper: https://github.com/FedericoCeratto/nimfmt#nim-code-formatter--style-checker |
12:54:58 | * | pietroppeter quit (Quit: Connection closed for inactivity) |
12:57:46 | FromDiscord | <exelotl> I found case insensitivity in the wild on the forums just a couple of days ago. `nimlua` exposes all functions in lowercase but the author of the post was (perfectly correctly imo) writing `doFile` instead of `dofile` |
12:59:10 | FromDiscord | <exelotl> Guess that's just anecdotal but it seems that people like this feature and are using it as intended |
13:01:58 | FromDiscord | <dom96> I think doing this research and writing up something on the results would actually do well to explain why Nim has this feature |
13:02:12 | FromDiscord | <dom96> and hopefully make people feel less uneasy about it |
13:03:43 | FromDiscord | <haxscramper> This script just scans everything in `/tmp/nimrepos` I can just clone some meaningful number of packages and check it. |
13:03:44 | * | agent0x00 joined #nim |
13:04:06 | FromDiscord | <haxscramper> Or `cat | jq | xargs git clone` nimble package list |
13:06:40 | * | Trustable joined #nim |
13:17:23 | * | solitudesf quit (Remote host closed the connection) |
13:18:24 | * | solitudesf joined #nim |
13:19:08 | FromGitter | <alehander92> Araq I like the heredoc thing |
13:25:45 | * | CcxWrk quit (Ping timeout: 240 seconds) |
13:31:53 | * | CcxWrk joined #nim |
13:40:23 | * | rockcavera quit (Remote host closed the connection) |
13:46:24 | disruptek | clyybber: you remember why we're using linked lists instead of sequences, right? |
13:47:12 | * | vivus joined #nim |
13:54:05 | * | awe00_ joined #nim |
13:56:52 | * | awe00 quit (Ping timeout: 265 seconds) |
14:07:49 | * | waleee-cl joined #nim |
14:08:24 | * | audiofile joined #nim |
14:09:23 | * | PMunch quit (Quit: Leaving) |
14:14:32 | FromDiscord | <Varriount> @haxscramper I <3 jq |
14:14:52 | * | agent0x00 quit (Quit: WeeChat 1.9.1) |
14:15:53 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2w24 |
14:16:19 | FromDiscord | <haxscramper> When I watched output of the script I saw a lot of filenames that were certainly auto-generated |
14:16:33 | FromDiscord | <haxscramper> But there is ~8.5 million lines of nim code total |
14:16:37 | FromDiscord | <Rika> nice |
14:16:41 | FromDiscord | <dom96> again, you need to do a more sophisticated analysis like I described above |
14:17:08 | FromDiscord | <dom96> although it depends on your goals |
14:17:21 | FromDiscord | <dom96> a snake vs camel case is interesting itself |
14:17:38 | FromDiscord | <haxscramper> My goal is to waste 40 minutes on this while I should be doing important things |
14:17:44 | FromDiscord | <haxscramper> I succeded |
14:18:29 | FromDiscord | <haxscramper> And I highly suspect a lot of snake case comes from auto-generated C wrappers |
14:19:06 | * | pietroppeter joined #nim |
14:19:28 | * | vivus quit (Quit: Leaving) |
14:46:55 | * | awe00_ quit (Read error: Connection reset by peer) |
14:47:58 | * | awe00_ joined #nim |
14:49:52 | FromGitter | <alehander92> wait what's this analysis for |
14:52:19 | FromDiscord | <Rika> for more concrete evidence that style insensitivity is usefu |
14:52:21 | FromDiscord | <Rika> (edit) 'usefu' => 'useful' |
14:59:57 | * | vicfred joined #nim |
15:00:35 | * | hnOsmium0001 joined #nim |
15:01:06 | disruptek | there's only 8.5 million lines of nim? |
15:02:11 | FromDiscord | <haxscramper> According to some commenters it is more like evidence that style-insensetivity won't destroy the world and it is quite possible to write millions of lines in it without fear of brain damage. |
15:04:46 | FromDiscord | <Rika> some fucker can just declare all of us who write nim as brain damaged tho |
15:07:41 | FromDiscord | <lqdev> talkin' 'bout HN? |
15:08:11 | Zevv | we should make it typo insensitive as well, so you can just type "usefu" ant it will work |
15:08:42 | FromDiscord | <lqdev> make it use gcc's typo detection |
15:10:27 | * | arecacea1 quit (Remote host closed the connection) |
15:11:16 | * | arecacea1 joined #nim |
15:26:37 | * | narimiran quit (Ping timeout: 264 seconds) |
15:28:02 | disruptek | seems like mangling works everywhere but jsonutils and earlier versions of nim. |
15:33:05 | * | maier quit (Ping timeout: 240 seconds) |
15:44:29 | disruptek | i mean, how important is it that nim-1.0 can build the compiler? honestly... |
15:53:52 | * | rockcavera joined #nim |
16:03:32 | * | a_chou joined #nim |
16:06:34 | * | arecacea1 quit (Remote host closed the connection) |
16:07:07 | * | arecacea1 joined #nim |
16:10:46 | disruptek | i guess mine is the first use of concepts in the compiler, and sure enough, they don't work. |
16:11:26 | FromDiscord | <mratsim> I doubt it would break as much as "not nil" when it was revamped a year ago |
16:11:55 | FromDiscord | <mratsim> for 4 days if you found a commit that could compile/bootstrap you had to make sure you saved it |
16:12:05 | disruptek | lol |
16:12:22 | disruptek | that's pretty awesome. |
16:12:29 | FromDiscord | <haxscramper> How do I defile graph type in gram? If I understand correctly `F` parameter must be a static value for a set of graph flags, like `{Directed}` for example. But when I try to use `Graph[string, bool, {Directed, ValueIndex}]` I get `cannot instantiate Graph got: <type string, type bool, static[set[GraphFlag]]({Directed, ValueIndex})>` |
16:12:36 | FromDiscord | <mratsim> defile a graph? |
16:12:42 | FromDiscord | <haxscramper> define* |
16:12:43 | FromDiscord | <mratsim> wrong community 😉 |
16:12:52 | disruptek | no, he's in the right place. |
16:13:01 | disruptek | there's a newGraph template that sets it up for you. |
16:13:22 | disruptek | it casts the set to an int, basically. |
16:13:32 | disruptek | you can copy that if you want to hack at it. |
16:13:48 | FromDiscord | <mratsim> I'm not sure static sets work |
16:13:49 | disruptek | if you can come up with a better way to do that, i'll happily switch. |
16:14:07 | FromDiscord | <haxscramper> I need to have this as a field in another object, not just create graph value |
16:14:11 | FromDiscord | <mratsim> static enum and integers are fine, but static objects are all kind of broken so static set might also be |
16:14:24 | disruptek | they've been working for me. |
16:14:56 | disruptek | haxscramper: there are supporting procs that let you play with the flags. toInt, toFlags, flags, etc. |
16:15:06 | disruptek | they are all exported on the same line in the source. |
16:24:16 | FromDiscord | <Kiloneie> is "ref" only used for defining ref objects ? Is there a way to make traced/safe references to variables(not ptr) ? |
16:24:43 | disruptek | no, it's not; so, yes, there is. |
16:25:22 | FromDiscord | <Kiloneie> Explain ? |
16:25:32 | FromDiscord | <lqdev> `ref` can be applied to any type |
16:25:34 | FromDiscord | <lqdev> eg. `ref int` |
16:25:44 | disruptek | ~manual |
16:25:45 | disbot | manual: 11the Nim Manual is https://nim-lang.org/docs/manual.html -- disruptek |
16:26:27 | * | NimBot joined #nim |
16:28:17 | FromDiscord | <Kiloneie> Man i form bad questions... il be back later xD |
16:29:08 | disruptek | you form questions that are typical for those that are unfamiliar with the language and need more experience working with it. |
16:29:23 | disruptek | maybe try some small projects to get some practice. |
16:29:40 | disruptek | or, y'know, just jump right into teaching others. that could work, too. |
16:29:54 | disruptek | it's 2020, after all. |
16:29:57 | * | abm quit (Quit: Leaving) |
16:32:06 | FromDiscord | <Kiloneie> thing is i know ref is used for defining types on the heap, was actually asking how to get a traced pointer of a variable, but idk what my brains spit out xD... |
16:32:29 | * | arecacea1 quit (Remote host closed the connection) |
16:32:36 | FromDiscord | <Kiloneie> you only get a safe pointer if the type you used for declaring is a ref/heap type... |
16:32:43 | FromDiscord | <Rika> you can make any type a ref type |
16:32:46 | FromDiscord | <Rika> primitive or not |
16:32:51 | FromDiscord | <Kiloneie> i know |
16:33:02 | * | arecacea1 joined #nim |
16:35:17 | disruptek | i think what you're asking is if you can get a ref to a value type that's on the heap. |
16:35:27 | disruptek | this doesn't really make sense. |
16:36:06 | FromDiscord | <Kiloneie> no, i think i need to go eat something, lack of energy D:... |
16:36:27 | disruptek | a ref is a contract between you and the language. it's an agreement that you each will share some responsibility for memory management. |
16:37:27 | FromDiscord | <Kiloneie> Yeah, since stack values are automatically freed by scope. |
16:38:10 | disruptek | values can exist on the heap and of course they can have addresses, but if they aren't refs, they don't share the same semantic contract. |
16:42:54 | FromDiscord | <Kiloneie> I think what i wanted to ask was if i make a variable "a" and several other variables that take "a.addr" a's memory address, which you have to free, if there was a way to make GC do it for you. I wrote it horribly. |
16:46:09 | FromDiscord | <haxscramper> Like `var a: ref T = <something>` and `let b = addr a`, `let c = addr a`? |
16:46:42 | Yardanico | then you'll have a pointer to a GC'd reference, no? |
16:46:47 | disruptek | either `a` is on the stack, in which case you don't have to free it or any other variables that hold pointers to it as produced by `a.addr`, or `a` is a ref, in which case the GC will free it for you regardless of how many pointers you record to it. |
16:47:51 | FromDiscord | <Kiloneie> Oh... okay, i didn't catch that from the manual |
16:49:44 | disruptek | pointers don't change when the memory they point to changes, just like if you remove the contents of an envelope, the mailing address doesn't spontaneously change. |
16:49:56 | disruptek | you get that, right? |
16:50:20 | FromDiscord | <Kiloneie> Yes |
16:50:28 | disruptek | okay. 👍 |
16:51:22 | FromDiscord | <Kiloneie> Sometimes i jump to stupid conclusions, D:. Goes over my head. |
16:52:05 | disruptek | indirection can be confusing at every level. |
16:56:37 | FromDiscord | <Kiloneie> Yeah. At least i can ask just about anything here(unlike how i started with Game Maker when i was 13, asked a question and either it took days for a reply which may or man not have been helpful at all) |
16:59:24 | * | superbia1 joined #nim |
16:59:58 | Yardanico | well it always depends on size of the community and where you're asking |
17:00:34 | FromDiscord | <dom96> depends on how passionate the community is too 🙂 |
17:00:46 | FromDiscord | <Kiloneie> That community was 99% as experienced as i was |
17:01:07 | FromDiscord | <Kiloneie> I wished for someone to help me. |
17:01:39 | FromDiscord | <Kiloneie> That with my english not being at the level required was a pain. |
17:02:01 | * | superbia quit (Ping timeout: 264 seconds) |
17:06:41 | * | solitudesf quit (Remote host closed the connection) |
17:29:39 | * | maier joined #nim |
17:32:41 | FromDiscord | <Avatarfighter> What's good party people |
17:34:52 | * | maier quit (Ping timeout: 246 seconds) |
17:37:48 | leorize[m] | disruptek, @lqdev, Zevv, narimiran: so I'm gonna resume work on nim.nvim, any requests? |
17:38:40 | disruptek | i'm mostly in the compiler and you know how it is. |
17:40:01 | leorize[m] | @Clyybber is interested in fixing that nimsuggest bug, so maybe nudge him a bit? :p |
17:40:24 | Zevv | no no no |
17:40:47 | Zevv | we need him for the Clybber Patch Service |
17:42:51 | disruptek | Clyybber Patch Service mostly works in the compiler, too. 😉 |
17:43:09 | leorize[m] | I'll work on a feature to automatically capture nimsuggest crashes |
17:43:22 | leorize[m] | and if he still haven't fix that bug by then I'll look into it |
17:43:41 | Zevv | We should start paying him |
17:46:34 | FromDiscord | <Avatarfighter> wow that convo died |
17:46:40 | disruptek | capturing crashes is probably more important. |
17:48:15 | FromDiscord | <Clyybber> ayy |
17:48:34 | FromDiscord | <Clyybber> unindent should probably be fixed, I don't think its that useful in its current state |
17:48:53 | FromDiscord | <lqdev> leorize: error checking please |
17:49:00 | disruptek | unindent? |
17:49:08 | FromDiscord | <lqdev> you mean <ing? |
17:49:10 | FromDiscord | <Clyybber> https://play.nim-lang.org/#ix=2w1I |
17:49:36 | FromDiscord | <Clyybber> IMO it should only strip the whitespace that all lines share |
17:49:37 | * | donpdonp left #nim ("WeeChat 2.6") |
17:49:53 | disruptek | i think i've used a deindent in the past or something. |
17:49:55 | leorize[m] | strutils.unindent |
17:50:19 | disruptek | hard to tell if it doesn't anything on the playground. |
17:50:51 | leorize[m] | it's the equivalent of running trim() on every line of your string by default |
17:51:08 | disruptek | i could go for some trim right about now. |
17:51:20 | FromDiscord | <Clyybber> Hmm, maybe we should introduce another proc instead, otherwise its a bit of a breaking change I suppose |
17:52:40 | FromDiscord | <haxscramper> I can PR this into stdlib - https://play.nim-lang.org/#ix=2w2V |
17:52:52 | FromDiscord | <Clyybber> Oh |
17:53:00 | FromDiscord | <Clyybber> Yeah, I was about to replace unindent by that |
17:53:01 | FromDiscord | <haxscramper> Not sure about exception though |
17:53:07 | leorize[m] | @lqdev noted |
17:53:26 | FromDiscord | <haxscramper> Is it better to silently cut off incorrect lines or blow up? |
17:53:27 | FromDiscord | <Clyybber> @haxscramper I'm gonna go with a easier approach |
17:53:42 | FromDiscord | <Clyybber> I first find the lowest common shared leading space count |
17:53:45 | FromDiscord | <Clyybber> and then cut that off |
17:53:59 | FromDiscord | <Clyybber> no exceptions and thats how I would expect it to work |
17:54:23 | disruptek | that's not how the compiler calculates indent, though. |
17:54:32 | FromDiscord | <Clyybber> ? |
17:54:36 | FromDiscord | <Clyybber> thats not the point |
17:54:46 | FromDiscord | <Clyybber> its not related |
17:55:35 | disruptek | maybe it would be useful to determine how many columns were removed, or to make that a separate proc or a var param. |
17:56:06 | FromDiscord | <Clyybber> I think it should be simple |
17:56:22 | FromDiscord | <Clyybber> if you want to determine the shared indentation a different proc should be used |
17:56:28 | FromDiscord | <Clyybber> and piped into the other unindent overload |
17:56:42 | FromDiscord | <Clyybber> wtf |
17:56:46 | leorize[m] | just do it like python |
17:56:50 | FromDiscord | <Clyybber> the current unindent is just unindent(1000) |
17:56:53 | disruptek | well, please expose your counting proc. |
17:57:15 | disruptek | i'd like to be able to reproduce your behavior, you see. |
17:57:20 | disruptek | otherwise, i really don't care. |
17:58:21 | FromDiscord | <Clyybber> whats the reason we are using extern and rtl on all strutils procs again? |
17:58:22 | FromDiscord | <Clyybber> I forgot |
17:58:30 | FromDiscord | <haxscramper> Like this? https://play.nim-lang.org/#ix=2w2Z |
17:58:31 | Yardanico | nimrtl ? |
17:58:51 | FromDiscord | <haxscramper> Not it's `n log n`, but that doesn't really matter tbh |
17:58:58 | FromDiscord | <Clyybber> @haxscramper oh nice |
17:59:07 | leorize[m] | yea it's for nimrtl |
17:59:08 | FromDiscord | <Clyybber> why is it n log n? |
17:59:12 | FromDiscord | <Clyybber> Shouldn't it be n |
17:59:30 | FromDiscord | <haxscramper> I sort lines to find common prefix. I can iterate over each one and increment indentation .. |
17:59:43 | leorize[m] | the rtl thing should be made into a template/macro |
17:59:47 | FromDiscord | <haxscramper> Oh, yeah, should've done that. I just copied my common prefix implementation |
18:00:26 | FromDiscord | <Clyybber> Hmm, I don't see why you would need to sort them |
18:00:48 | FromDiscord | <Clyybber> we have to go over each one anyways |
18:01:09 | disruptek | agree, evaluating for the purposes of sort is equivalent. |
18:01:18 | FromDiscord | <Clyybber> oh, eh, maybe I'm misunderstanding |
18:01:18 | disruptek | at best. |
18:01:28 | FromDiscord | <Clyybber> do you mean n log n with respect to the amount of lines? |
18:02:57 | FromDiscord | <haxscramper> https://play.nim-lang.org/#ix=2w31 |
18:04:31 | disruptek | or just make a static one. |
18:05:34 | FromDiscord | <haxscramper> I wrote my `commonPrefix` when I needed to have something quickly and haven't touched it since then |
18:07:11 | FromDiscord | <haxscramper> > do you mean n log n with respect to the amount of lines?↵@Clyybber Now it's linear in respect to number of lines |
18:07:11 | FromDiscord | <Hearthstone> !repo dynlib |
18:07:13 | disbot | https://github.com/aerosoul94/dynlib -- 9dynlib: 11IDA Pro plugin to aid PS4 user mode ELF reverse engineering. 15 44⭐ 12🍴 7& 29 more... |
18:07:28 | FromDiscord | <Hearthstone> Oof- |
18:07:39 | FromDiscord | <Hearthstone> Dynlib is apart of the stdlib |
18:07:41 | FromDiscord | <Hearthstone> Right? |
18:08:30 | FromDiscord | <Rika> yes |
18:08:34 | FromDiscord | <Hearthstone> That explains it- |
18:10:01 | FromDiscord | <Hearthstone> Hm |
18:10:06 | FromDiscord | <Hearthstone> !docs dynlib |
18:10:12 | FromDiscord | <Hearthstone> Oof |
18:10:19 | FromDiscord | <Hearthstone> ~dynlib |
18:10:20 | disbot | dynlib: 11shared library creation; documented at https://nim-lang.org/docs/dynlib.html |
18:10:25 | FromDiscord | <Hearthstone> There- |
18:10:41 | FromDiscord | <exelotl> sent a code paste, see https://play.nim-lang.org/#ix=2w34 |
18:11:33 | FromDiscord | <haxscramper> * sad RFC noises * |
18:11:40 | FromDiscord | <Rika> lol |
18:11:44 | FromDiscord | <Clyybber> @haxscramper then its also linear in respect to the number of chars |
18:13:32 | FromDiscord | <haxscramper> Well, yes, technically it is `O(lines * prefix-len)` which is potentially `O(lines^2)`. Getting indentation by first one is `O(lines)` and sorting is `O(lines * log(lines))` if I'm not mistaken |
18:13:35 | * | a_chou quit (Quit: a_chou) |
18:14:05 | disruptek | i have to get out of this country. |
18:14:30 | FromDiscord | <Clyybber> @haxscramper no its O(n) to get the common indentation |
18:14:35 | FromDiscord | <Clyybber> and O(n) to strip it |
18:15:01 | FromDiscord | <Clyybber> since in the worst case you go over each char, count it as indentation and strip it later |
18:15:17 | FromDiscord | <Clyybber> right? |
18:15:48 | FromDiscord | <haxscramper> > I don't think we need a whole new special string syntax for it, we can do so much with the available constructs already↵@exelotl Well, it is pretty clear that new syntax is not going to be added anyway - majority voted against, I don't feel so strongly about it anyway. Most of the arguments are "it just looks better" which is like *super* subjective. |
18:19:02 | FromDiscord | <haxscramper> > right?↵@Clyybber "case you go over each char" - that's when `prefix-len` factor comes from. You go over each char in each line *until* you find non-whitespace. Oh, yeah, it is actually `O(lines * min-lines-len)`, not `^2`. And this is unlikely scenario anyway unless you have string literal with `79` leading whitespaces and single column on the right `|` |
18:19:51 | FromDiscord | <Clyybber> Yeah, but see this "until you find non-whitespace" is at worst the \n for the next line |
18:19:58 | FromDiscord | <Clyybber> or the \0 |
18:20:08 | FromDiscord | <Clyybber> so at worst you go over each char once |
18:20:14 | FromDiscord | <Clyybber> which is O(n) |
18:20:38 | FromDiscord | <Clyybber> but yeah, what you said makes sense |
18:22:43 | FromDiscord | <haxscramper> Anyway, real-world input is unlikely to have anything above 4-12 leading whitespaces. If current one is ok in terms in naming I might PR it right now |
18:24:13 | FromDiscord | <Clyybber> I think my version looks a bit simpler |
18:24:49 | FromDiscord | <Clyybber> But if you want to make a PR go ahead? |
18:24:55 | FromDiscord | <Clyybber> (edit) 'ahead?' => 'ahead' |
18:25:12 | FromDiscord | <Clyybber> I'm making one too |
18:25:13 | FromDiscord | <Clyybber> :D |
18:25:42 | FromDiscord | <Clyybber> I'll send my version in in just a bit |
18:25:55 | FromDiscord | <Clyybber> maybe you find a spot where it could be better |
18:29:04 | FromDiscord | <dom96> This makes me think that we should teach people to use `import std/` everywhere |
18:29:06 | FromDiscord | <dom96> https://github.com/nim-lang/redis/pull/20 |
18:29:07 | disbot | ➥ import std/net to allow for local 'net' module |
18:31:56 | Zevv | I really wonder if people complaining about Nim error messages have ever even touched or have been near c++ |
18:36:38 | FromDiscord | <lqdev> @dom96 i do it already :) |
18:36:47 | FromDiscord | <lqdev> for clarity tho |
18:37:28 | disruptek | yeah, i've been using std/ for months. it's not 100% correct afaik, though |
18:37:46 | FromDiscord | <Clyybber> ? wdym not correct? |
18:39:05 | FromGitter | <alehander92> well why compare with c++ |
18:39:11 | FromGitter | <alehander92> if we can compare to other langs |
18:39:20 | FromGitter | <alehander92> at a certain X |
18:39:35 | disruptek | whether i should be preventing a monkeypatch, or even capable of doing so, is worth debate. also, i use std/ habitually; it amounts to FUD. |
18:39:40 | Zevv | because comparing to C++ makes us look _sooo_ good and sexy |
18:41:10 | FromDiscord | <Recruit_main707> iterators have a result variable also or not? |
18:41:19 | FromDiscord | <Clyybber> afaik no |
18:41:37 | FromDiscord | <Clyybber> it wouldn't make sense |
18:41:51 | disruptek | no. |
18:42:05 | * | gmaggior joined #nim |
18:42:16 | FromDiscord | <Recruit_main707> youd need to yield it manually, but you woudnt initialise it, i guess not having to do it has made me lazy :P |
18:42:46 | disruptek | clyybber: one bizarre change i had to make in mangling codegen was to s/Result/result/. |
18:43:21 | FromDiscord | <Clyybber> huuuuuuuuuh |
18:43:25 | FromDiscord | <lqdev> why? |
18:43:33 | disruptek | i have no idea. |
18:43:41 | FromDiscord | <Clyybber> investigation |
18:43:59 | disruptek | who cares. |
18:44:31 | disruptek | see fillResult() |
18:44:57 | FromGitter | <alehander92> oii |
18:45:30 | disruptek | sup sasha |
18:45:30 | FromGitter | <alehander92> zevv yes if we talk speed and platforms etc |
18:45:34 | FromGitter | <alehander92> not if we talk errors |
18:45:56 | FromGitter | <alehander92> hey i have to catch up with my previous nilability stuff disruptek |
18:46:11 | disruptek | oh yeah? |
18:46:19 | disruptek | you got a talking-to from araq, too, huh. |
18:46:23 | FromGitter | <alehander92> and also read a bit about frama c this days |
18:46:28 | FromGitter | <alehander92> oh ok you did as well |
18:46:32 | FromGitter | <alehander92> cool so you get me |
18:47:07 | FromDiscord | <haxscramper> C++ **template**/linker errors look like text volcano eruption. But in terms of missing `;`, type mismatches and incorrect spelling `clang` is pretty good. |
18:48:01 | disruptek | .global forvars. how is this a thing. |
18:48:14 | FromDiscord | <Clyybber> global forloop |
18:48:16 | FromDiscord | <Clyybber> thats how |
18:48:33 | disruptek | yeah but no but just no. |
18:48:35 | FromDiscord | <Clyybber> arguably a bit stupid |
18:48:38 | alehander92 | disruptek so you're ic-ing |
18:52:12 | * | wiml joined #nim |
18:52:19 | disruptek | on the proverbial cake, baby. |
18:53:01 | disruptek | however, this ic is gonna be based on frosty and not sqlite. |
18:54:04 | alehander92 | i actually asked araq if i can help with your or the other milestones if i happen to finish my one on time |
18:54:31 | disruptek | masochist, huh. |
18:54:33 | alehander92 | but looking at my cps lack of input i think i'll just keep spamming you motivational letters |
18:54:38 | alehander92 | about having it |
18:54:58 | disruptek | cps lack of input? |
18:55:20 | alehander92 | i mean that i barely managed to help with cps |
18:55:31 | alehander92 | so i have to talk less |
18:55:38 | disruptek | i'm still waiting for you to help with cps. |
18:55:44 | disruptek | where's my pr? |
18:55:44 | alehander92 | well |
18:56:08 | alehander92 | not planning on it. |
18:56:08 | disruptek | smells like i need a shower but i just had one in july. |
18:56:14 | alehander92 | oh dude |
18:56:18 | alehander92 | it's my cousin's day |
18:56:23 | alehander92 | i keep forgetting |
18:56:27 | disruptek | oh yeah? |
18:56:31 | FromDiscord | <Clyybber> yeah, put him in the shower |
18:56:32 | disruptek | get out the hose. |
18:56:39 | alehander92 | he is 44 |
18:56:40 | alehander92 | dude |
18:56:46 | disruptek | it puts the lotion on its skin or it gets the hose. |
18:56:48 | alehander92 | he can kick my butt |
18:56:49 | disruptek | you know the drill. |
18:57:00 | alehander92 | i haven't been to the army |
18:57:06 | alehander92 | i don't know many drills |
18:57:16 | alehander92 | wow he is so old that he actually has |
18:57:23 | alehander92 | when we still had a draft |
18:59:06 | disruptek | my cousin has a sheep with a pretty mouth. |
18:59:44 | disruptek | i mean, do we /really/ need macros? |
19:00:03 | * | Vladar quit (Quit: Leaving) |
19:00:13 | Zevv | you still haven't told me what the alternative would be |
19:01:46 | disruptek | just nim all the way down. |
19:03:40 | FromDiscord | <Rebel> sent a long message, see http://ix.io/2w3r |
19:04:39 | disruptek | i just don't understand why i need to download text like this from ix. |
19:05:37 | disruptek | rebel: doesn't matter. |
19:05:46 | disruptek | use whatever is easiest. |
19:05:49 | disruptek | !repo asynctools |
19:05:50 | disbot | https://github.com/cheatfate/asynctools -- 9asynctools: 11Various asynchronous tools for Nim language 15 61⭐ 20🍴 |
19:06:53 | disruptek | if you need to change things later, it won't be difficult. |
19:08:02 | wiml | dumb question: I'm trying out the nim snap on ubuntu, running into problem similar to this: https://github.com/sirredbeard/nim_lang_snap/issues/11 is this PEBCAK or ? |
19:08:04 | disbot | ➥ Can't import any stdlib ; snippet at 12https://play.nim-lang.org/#ix=2w3s |
19:09:21 | disruptek | pass --lib=/some/where/nim/lib to your compilation and then figure out what the fuck happened to snap. |
19:09:59 | disruptek | nothing in the repo appears to be working, so i wouldn't bother with it. |
19:10:02 | disruptek | ~gitnim |
19:10:02 | disbot | gitnim: 11https://gitnim.com/ -- choosenim for choosey nimions -- disruptek |
19:10:08 | disruptek | this is what i use and it is reliable. |
19:16:10 | wiml | yeah, not super fond of snap, but checking for something a little less ... err ... curl|sh than choosenim. I'll look at gitnim |
19:16:48 | wiml | or just go back to building from source |
19:17:27 | FromDiscord | <Rebel> interesting so it won't matter if I mix asyncio + threading whether it be by manually creating threads or using spawn? Wanted to see how threadpool works under the hood but it just had the magic pragma so that wasn't very helpful. |
19:18:04 | disruptek | i use source builds but for reproducing builds, gitnim makes the most sense, since it uses binaries built from nim's ci/cd process. |
19:18:57 | disruptek | rebel: i doubt it will matter for your application. |
19:19:26 | FromDiscord | <Rebel> awesome I will just use spawn then seems to be the easiest approach at least the way I am going about it then having to deal with manually creating threads and passing around the lock |
19:23:09 | * | pangey quit (Ping timeout: 272 seconds) |
19:24:05 | * | pangey joined #nim |
19:27:11 | disruptek | what lock? |
19:28:03 | Zevv | disruptek: what is the status of the typed branch then, I see you are doing stuff? |
19:28:25 | disruptek | well, i did most of the shim last night. |
19:28:30 | Zevv | what's the shim |
19:28:41 | disruptek | there's a bug that's probably mine and there are one or two compiler bugs. |
19:28:57 | disruptek | there's a drawing in the commit. |
19:29:51 | disruptek | https://github.com/disruptek/cps/blob/typed/cps.nim#L355 |
19:30:13 | Zevv | that's not a drawing |
19:30:14 | Zevv | that's prose |
19:30:30 | disruptek | but clyybber made my nuts hurt so bad i had to get into bed with a heating pad and massage them until i passed out. |
19:31:09 | Zevv | so, how did you make this up |
19:31:11 | Zevv | what does it solve |
19:31:22 | disruptek | let x = someCpsCall(somevar) |
19:31:22 | * | maier joined #nim |
19:31:51 | disruptek | i had to impl some other rewriting and return-value handling, too, so there's that also. |
19:32:40 | FromDiscord | <Rebel> Nim Locks |
19:33:00 | disruptek | nim locks make my teeth sweat. |
19:34:17 | Zevv | I don't see it - what does the shim bring |
19:34:28 | disruptek | damnit. |
19:34:43 | disruptek | https://github.com/disruptek/cps/issues/36 |
19:34:44 | disbot | ➥ need a shim for continuation results as rvalues |
19:35:06 | disruptek | let x = someCpsCall(somevar) # currently puts a continuation into x. |
19:35:17 | Zevv | oh dang right |
19:35:19 | FromDiscord | <Rebel> why do nim locks make you sweat lol |
19:35:21 | Zevv | sorry I'm blind |
19:36:05 | Zevv | I didn't realize the pre- and post- echo were the same |
19:36:17 | Zevv | this is pretty smooth dude |
19:36:17 | disruptek | bbiab, dog needs beating. |
19:36:33 | disruptek | no, it doesn't work. |
19:36:38 | * | maier quit (Ping timeout: 260 seconds) |
19:42:27 | gmaggior | what is '?' in Nim? |
19:42:44 | FromDiscord | <Elegant Beef> Fairly certain by default an unused operator |
19:43:53 | FromDiscord | <lqdev> it's unused yeah |
19:45:18 | * | solitudesf joined #nim |
19:45:30 | gmaggior | thx (it is because I tried defining proc odd? just to check if it is possible. Not) |
19:45:32 | Zevv | well, I wouldn't say it's unused. It's just an operator you can use however you want. |
19:45:48 | FromDiscord | <lqdev> gmaggior: nim is not ruby :p |
19:45:50 | FromDiscord | <Elegant Beef> did you use backticks to declare the proc? |
19:45:54 | FromDiscord | <lqdev> we use `isOdd` here |
19:46:02 | FromDiscord | <lqdev> also you can't use a proc with a suffix like that |
19:46:04 | FromDiscord | <lqdev> it's a syntax error |
19:46:21 | FromDiscord | <Elegant Beef> Thought we could cheese operators with the name, or is that only assignment? |
19:46:31 | FromDiscord | <lqdev> nope |
19:46:33 | gmaggior | :) fine |
19:46:43 | FromDiscord | <lqdev> ruby allows you to add `?` or `!` to the end of a method name |
19:46:52 | FromDiscord | <lqdev> so you can do stuff like `if 3.odd?` |
19:47:03 | FromDiscord | <Elegant Beef> we can put `=` at the end though for properties |
19:47:45 | FromDiscord | <lqdev> yup |
19:48:09 | FromDiscord | <Elegant Beef> You said no |
19:48:36 | FromDiscord | <Elegant Beef> "or is that only assignment" 😛 |
19:52:41 | FromDiscord | <lqdev> my bad |
19:52:49 | FromDiscord | <lqdev> didn't understand your question fully :p |
19:54:39 | FromDiscord | <haxscramper> How do I get node from immutable gram graph? There is a `[]` but it only accepts mutable graph |
19:56:19 | FromDiscord | <Clyybber> @haxscramper Oh, I see you made a PR too :D Mine hits a compiler bug though I think |
19:56:54 | FromDiscord | <dk> is this stupid https://media.discordapp.net/attachments/371759389889003532/751168861952278618/unknown.png |
19:59:18 | FromDiscord | <Clyybber> how can I expand the processing dots again? |
20:01:08 | FromDiscord | <haxscramper> One of the big advantages for nim & the fact it recompiles whole program from scratch each time is that I can just open currently opened packages and do some quick-fix that I'm hitting in particular edge case. Bad practice in the long run though |
20:01:25 | * | drewr quit (Ping timeout: 240 seconds) |
20:01:27 | disruptek | haxscramper: nah, that's good. |
20:01:38 | disruptek | makes developing many deps at the same time really nice. |
20:01:46 | * | lritter quit (Ping timeout: 258 seconds) |
20:02:06 | FromDiscord | <haxscramper> Really similar how emacs/other lisp systems are intended to be used |
20:02:17 | disruptek | yeah, i mean, it makes sense. |
20:02:21 | * | lritter joined #nim |
20:03:19 | disruptek | [] requires a var because nim's [] usually yields a var, so... |
20:03:29 | disruptek | in gram, i mean. we can change that if it's dumb. |
20:04:21 | * | drewr joined #nim |
20:04:24 | disruptek | Zevv: so you see the problem. |
20:04:28 | FromDiscord | <Rebel> Do you need the .thread pragma for a proc that calls spawn? Doesn't seem to play well with the .async. pragma? |
20:04:31 | Zevv | sure |
20:04:48 | Zevv | it just seems that I am able to forget most of all this in three weeks |
20:05:08 | FromDiscord | <haxscramper> Oh, so it's not me being blind again. Good to know this |
20:05:18 | Zevv | it |
20:05:20 | disruptek | no, this is a very new library. |
20:05:30 | Zevv | it's jus that I didn't connect this to the term "shim" |
20:06:02 | disruptek | yeah, i don't really know how to works yet because there are a few ways to do it. |
20:06:07 | disruptek | so i just call it "shim." |
20:06:14 | FromDiscord | <haxscramper> By the way, is there any plans to add basic graph algorithms: topological sorting etc.? |
20:06:22 | disruptek | sure. |
20:06:49 | Zevv | did you decide in the end if we really need to rewrite all env vars or do we get away with the trippy templates |
20:07:07 | Zevv | because shims will maybe complicate a bit with stuff like tuple assignments etc |
20:07:11 | disruptek | i was going to just wrap another library but i couldn't find anything that seemed like a good candidate. |
20:07:14 | alehander92 | hm |
20:07:31 | voidpi | what is the meaning of &= |
20:07:33 | voidpi | ? |
20:07:36 | disruptek | Zevv: tuples should be fine. |
20:07:45 | disruptek | voidpi: concat-and-set-value-of |
20:07:57 | FromDiscord | <Clyybber> basically add |
20:08:03 | FromDiscord | <Clyybber> not basically, literally |
20:08:04 | voidpi | disruptek: thanks |
20:08:35 | voidpi | sorry, new to nim |
20:08:46 | FromDiscord | <haxscramper> I asked it before, but is there any way to write proc for both mutable and immutable parameters if I use `mitems` or `mpairs`? |
20:08:46 | Zevv | "Appends in place to a string" |
20:08:48 | FromDiscord | <Clyybber> don't be sorry |
20:09:09 | FromDiscord | <haxscramper> Or the only whay is to use some kind of `when compiles(mitems(...))` |
20:09:20 | disruptek | concepts |
20:09:33 | Zevv | disruptek's got a new hammer |
20:09:38 | Zevv | now everything looks like a concept |
20:09:45 | disruptek | most stuff is. |
20:09:57 | disruptek | but i'm not writing concepts anymore. |
20:10:09 | * | disruptek crys into his hands. |
20:10:12 | FromDiscord | <Clyybber> haxscramper: You could define your own smartitems that is mitems or items depending on the mutability of its argument |
20:10:13 | disruptek | cries, too. |
20:10:15 | voidpi | Clybber: but also happy, now I know |
20:10:39 | FromDiscord | <Clyybber> :) |
20:11:01 | FromDiscord | <haxscramper> I just want to do quick-fix on `[]` in gram - I could just copy-paste immutable version and change `mitems` to `items`, but there should be something better. But without writing macro |
20:11:10 | disruptek | haxscramper: you're seeing var refs because they allow dispatch, though it obviously isn't exactly sensical. |
20:11:21 | FromDiscord | <Clyybber> haxscramper: Extract the impl to a template |
20:11:30 | FromDiscord | <Clyybber> and pass in mitems or items |
20:11:35 | FromDiscord | <Clyybber> depending on which you want |
20:11:44 | FromDiscord | <haxscramper> Oh yes |
20:11:44 | disruptek | just change it if you think it makes sense. i don't care. |
20:12:01 | disruptek | i publish this shit so other people can enhance it. |
20:12:16 | disruptek | Zevv: are you telling me that tuples don't work in typed? |
20:13:18 | disruptek | oh shoot, they are denied. |
20:23:56 | * | narimiran joined #nim |
20:27:09 | * | literal_ is now known as literal |
20:27:56 | rayman22201 | disruptek, you say crazy shit and I have to come out of lurking to because I have so many questions: "this ic is gonna be based on frosty and not sqlite." WTH is frosty? |
20:27:56 | rayman22201 | "i mean, do we /really/ need macros?" - how would you do async or cps without macros? |
20:28:14 | disruptek | !repo frosty |
20:28:15 | disbot | https://github.com/disruptek/frosty -- 9frosty: 11Serialize native Nim objects via Streams and Sockets ⛄ 15 11⭐ 0🍴 |
20:28:30 | disruptek | macros are dumb. |
20:28:40 | FromDiscord | <lqdev> macros are half-baked. |
20:28:51 | * | vsantana joined #nim |
20:29:02 | rayman22201 | a very well thought out and reasoned argument I see. So much is explained now, thank you :-P |
20:29:17 | Yardanico | disruptek: yeah we all should instead duplicate stuff everywhere and who needs DRY :) |
20:29:31 | Yardanico | it's better when users pay a runtime cost on every launch |
20:30:11 | rayman22201 | No seriously, what's the discussion. I literally have no context here? |
20:30:39 | FromDiscord | <Clyybber> macros aren't half baked and not dumb either |
20:30:40 | disruptek | gimme a sec to finish this commit. |
20:30:57 | FromDiscord | <lqdev> @Clyybber have you ever tried doing type introspection with macros? |
20:31:07 | Yardanico | rayman22201: disruptek is mostly trolling like always |
20:31:11 | rayman22201 | lol. np. do real work, it's fine. I'll get in line to take a shower I guess :-P |
20:31:14 | FromDiscord | <Clyybber> @lqdev yeah. |
20:31:18 | Yardanico | you should never believe what he says by default :) |
20:31:26 | FromDiscord | <Elegant Beef> Yard dont say that you might make his balls throb |
20:31:32 | FromDiscord | <Clyybber> half baked is a bit of an overstatement |
20:31:39 | Yardanico | exactly |
20:31:40 | disruptek | yard is mostly full of shit like always. |
20:31:44 | FromDiscord | <Recruit_main707> its not half baked, it lacks some sugar |
20:31:59 | Yardanico | disruptek: i wonder if you will stop trolling some time in the future :P |
20:32:04 | Yardanico | especially when newbies join this chat |
20:32:23 | Yardanico | maybe they heard about macros and stuff, and here you are "macros are dumb" :D |
20:32:26 | FromDiscord | <lqdev> think i'm gonna write an rfc about improving the current sym introspection situation. |
20:32:29 | FromDiscord | <Rika> I don't see that happening in the future |
20:32:30 | FromDiscord | <Elegant Beef> Someone was asking how to convert types and he was just saying "RTFM div operator" |
20:32:37 | disruptek | lqdev: i would work on that problem with you. |
20:32:51 | FromDiscord | <Clyybber> @lqdev can you elaborate on the problems |
20:33:05 | FromDiscord | <Clyybber> I'm working on something thats about syms and types |
20:33:07 | FromDiscord | <Clyybber> and macros |
20:33:07 | FromDiscord | <Rika> I think macros right now are pretty clunky but eh it's fine for me |
20:33:09 | FromDiscord | <lqdev> most notably: resolving an ident is a PITA |
20:33:16 | FromDiscord | <Clyybber> heh |
20:33:18 | FromDiscord | <Clyybber> guess |
20:33:19 | FromDiscord | <Clyybber> what |
20:33:22 | FromDiscord | <Clyybber> I'm working on :D |
20:33:29 | FromDiscord | <lqdev> cool! |
20:33:32 | FromDiscord | <lqdev> can't wait |
20:33:39 | FromDiscord | <Clyybber> https://github.com/nim-lang/Nim/pull/15252 |
20:33:40 | disbot | ➥ Turn proc params into syms |
20:33:44 | rayman22201 | disruptek's trolls are usually based in some kernel of something interesting. I just have to put on my bullshit boots first. |
20:34:11 | FromDiscord | <lqdev> but what i need more is something like bindSym but it binds syms from the callsite |
20:34:14 | FromDiscord | <haxscramper> How do I revert `nimble develop` |
20:34:22 | disruptek | rm -rf |
20:34:32 | FromDiscord | <Clyybber> /* |
20:34:36 | FromDiscord | <lqdev> don't |
20:34:38 | Yardanico | doas |
20:34:42 | FromDiscord | <haxscramper> `--no-preserve-root` |
20:34:46 | Yardanico | nah that's old |
20:34:51 | Yardanico | /* is better |
20:35:14 | Yardanico | doas<spc>rm<spc>-rf<spc>/* |
20:35:18 | Yardanico | doas is better |
20:35:29 | FromDiscord | <Clyybber> why the <spc>? |
20:35:38 | Yardanico | well i doubt a lot of people have doas anyway |
20:35:38 | FromDiscord | <Clyybber> is your space key broken :p |
20:35:42 | Yardanico | but so just no one pastes it |
20:35:45 | Yardanico | and blames me for it |
20:35:50 | FromDiscord | <Clyybber> heh |
20:35:53 | FromDiscord | <lqdev> what's doas for |
20:35:55 | FromDiscord | <Clyybber> sudo |
20:35:59 | FromDiscord | <Clyybber> but generalized |
20:36:00 | Yardanico | lightweight alternative of sudo |
20:36:14 | disruptek | Zevv: this tuple code works but i really don't understand how. |
20:36:17 | FromDiscord | <haxscramper> Will try this when I finally move to docker for development instead of just collecting everything in the `~/workspace/git-sandbox` |
20:36:24 | Yardanico | for 99% of sudo users all of their usage can be replaced with doas |
20:36:45 | disruptek | haxscramper: just use nimph. you'll like it. |
20:36:49 | FromDiscord | <Clyybber> but only for 50% of doas users all of their usage can be replaced by sudo |
20:37:32 | FromDiscord | <haxscramper> Back to my question: I did `nimble develop` and I want to undo it. How can I do this? |
20:37:48 | disruptek | rm any nimble-link files |
20:37:49 | Yardanico | just install |
20:37:50 | disruptek | rm .git |
20:37:53 | Yardanico | the package or something |
20:38:07 | FromDiscord | <Clyybber> nimble uninstall to remove the link probably |
20:38:10 | disruptek | or, like i said, rm -rf |
20:38:23 | Yardanico | disruptek: that defeats the purpose of the pkg manager |
20:38:24 | FromDiscord | <Clyybber> I'm about to rm -rf you |
20:38:28 | shashlick | nimble uninstall packagename |
20:38:31 | Yardanico | do you rm -rf when you remove packages in your distro? |
20:38:38 | Yardanico | sounds very smart |
20:38:43 | FromDiscord | <Clyybber> hell yeah |
20:39:24 | FromDiscord | <Clyybber> especially on distros where you can't verify your pm managed integrity |
20:39:44 | * | awe00 joined #nim |
20:39:46 | * | awe00 quit (Client Quit) |
20:39:48 | disruptek | Yardanico: what can i say? |
20:39:55 | disruptek | there's no purpose to nimble. |
20:40:07 | disruptek | rayman22201: i'm just tired of writing in two languages when i really just want to write in one. |
20:40:14 | FromDiscord | <Clyybber> Yardanico: can pacman do what xbps-pkgdb -a does? |
20:40:17 | Yardanico | disruptek: well I know that you're always very critical |
20:40:25 | disruptek | it's my super-power. |
20:40:52 | Yardanico | @clyybber not sure |
20:41:06 | FromDiscord | <Clyybber> rayman22201: Nothing interesting behind it today, disrupteks crying about nnkNodeKind vs nkNodeKind |
20:41:17 | rayman22201 | lol. I see |
20:41:38 | disruptek | macros, great, it's nim, but with more limitations. |
20:41:42 | disruptek | why do i want this? |
20:41:43 | disruptek | i don't. |
20:41:55 | Yardanico | then write in common lisp :) |
20:42:15 | disruptek | i probably will end up impl a proper lisp in nim. |
20:42:17 | FromDiscord | <Clyybber> disruptek: Hey, your mumble is *still* online |
20:42:25 | disruptek | oh yeah? |
20:42:26 | FromDiscord | <Clyybber> did you pay in advance for a lifetime or what? |
20:42:32 | Yardanico | it's hosted by his friend afaik |
20:42:33 | * | awe00_ quit (Ping timeout: 260 seconds) |
20:42:39 | Yardanico | so I guess it's "eternal" |
20:42:40 | FromDiscord | <Clyybber> oh cool |
20:42:51 | rayman22201 | I was daydreaming about the idea for a structural editor for Nim. It already exposes the AST pretty directly, why not make an editor that just spits out Nim AST instead of text. |
20:42:54 | disruptek | nah, i pay for it, but it's like $20 for 3 years or something. |
20:43:01 | Yardanico | oh you do |
20:43:02 | rayman22201 | but that's the kind of weird shit I think about |
20:43:58 | disruptek | clyybber: i was on there yesterday talking to araq. |
20:44:10 | FromDiscord | <Clyybber> oh cool |
20:44:16 | FromDiscord | <haxscramper> Nimph installs packages using git, correct? |
20:44:21 | FromDiscord | <haxscramper> i.e as submodules |
20:44:34 | disruptek | version 1 doesn't use submodules, really. |
20:44:44 | disruptek | you can use 'em but it's not smart about it. |
20:44:51 | disruptek | it's smart about git. |
20:44:55 | rayman22201 | seems like many of the restrictions of macro code keep getting smaller. People like Clyybber keep fixing it. |
20:44:57 | disruptek | version 2 will be smart about submodules. |
20:45:05 | FromDiscord | <lqdev> @Clyybber proc params being syms is cool and all, but what about resolving symbols from callsite? |
20:45:51 | disruptek | https://github.com/disruptek/nimph/pull/140 |
20:45:52 | disbot | ➥ nimph 2.0 |
20:46:03 | disruptek | lqdev: do you do any callsite macros? |
20:46:09 | FromDiscord | <haxscramper> I'm mostly interested in doing quick-fix of my local package installation and then PR'ind it, instead of cloning package again and repeating all edits |
20:46:20 | disruptek | that's what nimph is for. |
20:46:33 | * | lritter quit (Quit: Leaving) |
20:46:46 | FromDiscord | <haxscramper> Will switch to nimph tomorrow |
20:46:57 | disruptek | nimph fork gram; cd (nimph path gram); vi gram.nim; git commit -m fixup gram.nim; git push |
20:47:00 | FromDiscord | <Rika> I'm also pretty interested in nimph |
20:47:22 | disruptek | this is literally what you can type to fix gram. |
20:48:19 | disruptek | rayman22201: frosty is a hack motivated by araq joyously celebrating parsing 2mb of C in 0.6s. |
20:48:30 | FromDiscord | <haxscramper> No, I mean I'm using already using gram in other code and I don't want to clone it separately. I want to edit user-installed package source code |
20:49:00 | FromDiscord | <Rika> You can do that with nimble too though |
20:49:12 | disruptek | so echo '--path="../gram/"' > nim.cfg and proceed. |
20:49:15 | FromDiscord | <Clyybber> @lqdev wdym? |
20:49:29 | FromDiscord | <Clyybber> do you mean binding idents from an untyped ast? |
20:49:36 | disruptek | you can also clone using nimph from a local repository, if you want. |
20:49:51 | FromDiscord | <lqdev> @Clyybber right now you have to generate a call to a macro which accepts a typed param to turn an ident to a sym |
20:50:03 | FromDiscord | <lqdev> and no, bindSym isn't the thing i'm looking for |
20:50:22 | FromDiscord | <lqdev> basically there's eg. a proc `myProc` at the callsite |
20:50:26 | rayman22201 | parsing 2mb of C in 0.6s is a cool thing to celebrate. Frosty reminds me of Python pickle. binary object storage basically. Good foundational lib to have. |
20:50:27 | FromDiscord | <lqdev> and i get it in ident form (from a DSL) |
20:50:45 | FromDiscord | <Clyybber> yeah, I think I know what you want |
20:50:46 | disruptek | rayman22201: i used to mention pickle in the readme but it wasn't very accurate. |
20:51:14 | disruptek | rayman22201: pickle is more of a binary marshal. this is even more low-level. platform-specific types and whatnot, no safety per se. |
20:51:26 | FromDiscord | <Clyybber> don't quote me on that, but I don't think something like this will be implemented |
20:51:29 | FromDiscord | <Clyybber> or even possible generally |
20:51:31 | rayman22201 | pickle without the safety rails lol |
20:51:53 | disruptek | yes, but sometimes "i don't care." as he says. |
20:51:54 | FromDiscord | <lqdev> sad |
20:51:57 | disruptek | yes, but sometimes "i don't care." as He says. |
20:52:10 | FromDiscord | <lqdev> maybe my upcoming introspection package will help with that |
20:52:24 | rayman22201 | little endian or big endian, who cares, not like I'm sending this binary blob over the network to a SPARC machine :-P |
20:52:26 | FromDiscord | <Clyybber> See, attaching scopes to indents would be a bad idea IMO |
20:52:37 | disruptek | rayman22201: or, if i am, i'll deal with it. |
20:52:54 | FromDiscord | <Clyybber> And wouldn't solve the problem since you wouldn't have anything in the scope from the AST that you passed to the macro |
20:53:08 | FromDiscord | <Clyybber> so you could bindSym to all semmed stuff from the callsite |
20:53:17 | rayman22201 | I'm poking fun at you, but I actually think it's pretty cool. I like it. |
20:53:23 | FromDiscord | <Clyybber> but bindSymming to an actual symbol that was already defined in the arg ast itself wont work |
20:53:32 | FromDiscord | <Clyybber> because it hasn't been semmed yet |
20:54:03 | disruptek | rayman22201: yeah, i did some lmdb stuff and it was quick, but this is the right tool for the job simply because it's so simple. native nim and <100 lines iirc. |
20:54:07 | FromDiscord | <Clyybber> so the current way where you manually splice up the AST and pass it on to submacros that take typed params is IMO the best way |
20:54:28 | disruptek | how do you figure? |
20:54:39 | disruptek | it's a pita no matter who you ask or where you see it. |
20:54:47 | disruptek | who wants to write code this way? |
20:55:15 | FromDiscord | <Clyybber> But maybe we should have a "applyMacro" template |
20:55:29 | FromDiscord | <Clyybber> or magic? |
20:55:37 | disruptek | i think cps is proof that the context switch isn't even necessarily control-flow based. |
20:56:00 | disruptek | cps wants a callsite pragma. |
20:56:21 | disruptek | this animal exists in concepts as foo() {.explain.} |
20:56:28 | disruptek | i want the same thing. |
20:57:01 | FromDiscord | <Clyybber> @lqdev Don't you think its possible to write a helper for the submacro pattern? |
20:57:02 | disruptek | sounds like lqdev is making the case for something similar as well. |
20:57:11 | FromDiscord | <lqdev> yeah, that's my current idea |
20:57:42 | FromDiscord | <Clyybber> maybe a "typeThis" magic could be sound? |
20:58:51 | * | pietroppeter quit (Quit: Connection closed for inactivity) |
20:59:01 | * | noonien quit (Quit: Connection closed for inactivity) |
21:01:18 | * | solitudesf quit (Ping timeout: 256 seconds) |
21:01:32 | FromDiscord | <haxscramper> skiplists 0.2.2 fail to compile with error `Error: undeclared identifier: 'Less'` which can be fixed by using `cmp.Less` instead of simply `Less`. Question: there is a problem with a liibrary or did I just completely mess something up on my side |
21:01:47 | * | a_chou joined #nim |
21:01:47 | FromDiscord | <haxscramper> `cmp` is pure enum |
21:01:57 | FromDiscord | <Clyybber> disruptek: Oh btw, what is it that keeps them from being seq based? |
21:03:00 | FromDiscord | <Clyybber> haxscramper: I think disruptek often has some paths of his lib in his --paths, so its probably not something on your side |
21:03:26 | FromDiscord | <Clyybber> oh, wait I misread, sorry |
21:03:44 | disruptek | no, that's just nim being dumb. |
21:03:49 | * | narimiran quit (Ping timeout: 246 seconds) |
21:04:31 | disruptek | the point of skiplists is that they enable consistent performance of mutation |
21:05:01 | disruptek | think insertion or deletion. |
21:05:32 | FromDiscord | <Clyybber> eh |
21:05:42 | FromDiscord | <Clyybber> seqs provide consisten performance of mutation |
21:05:48 | FromDiscord | <Clyybber> armortised |
21:06:07 | * | krux02 quit (Read error: Connection reset by peer) |
21:06:32 | disruptek | wut |
21:06:43 | disruptek | do you know what that word means? |
21:06:50 | disruptek | or maybe it's a translation issue. |
21:07:24 | * | krux02 joined #nim |
21:08:43 | FromDiscord | <Rebel> Is there a way to await a future from threadpool's spawn on an async proc? I thought something like async ^retValue would work but getting an error (```Error: unhandled exception: No handles or timers registered in dispatcher. [ValueError]```) 😦 and doing await spawn asyncProc does not work. nor does spawn await asyncProc. |
21:08:50 | disruptek | if you're satisfied with seq performance, don't use linked-lists. 🤷 |
21:10:06 | disruptek | haxscramper: which version of gram were you using successfully? 0.0.9? |
21:11:09 | * | sagax quit (Ping timeout: 258 seconds) |
21:12:20 | FromDiscord | <Clyybber> disruptek: Yeah, I guess. What I'm thinking of probably doesn't count as skiplist anymore, guess I overfitted to the requirements when I implemented it |
21:12:58 | FromDiscord | <Clyybber> disruptek: What I was thinking of was using seqs for the high layers because those rarely get insertions anyways |
21:13:01 | disruptek | i think there could be a different skiplist that uses seqs to represent to depth of the list. |
21:13:09 | FromDiscord | <Clyybber> ah right |
21:13:32 | FromDiscord | <Clyybber> that was probably what I was thinking of last time I shit on your skiplists |
21:13:34 | disruptek | but, like, i'd need to see the type you have in mind to figure out how it works. |
21:13:44 | FromDiscord | <Clyybber> I got it now |
21:13:47 | FromDiscord | <Clyybber> basically |
21:13:54 | FromDiscord | <Clyybber> if you know the depth |
21:14:09 | FromDiscord | <Clyybber> of the skiplist |
21:14:43 | FromDiscord | <Clyybber> just use a seq, where each element corresponds to the link to the next element in the respective layer |
21:14:58 | FromDiscord | <Clyybber> thanks for recollecting my memory buddy, I was struggling hard |
21:15:24 | * | FromDiscord quit (Remote host closed the connection) |
21:15:31 | disruptek | yeah, i'm not sure i really get it yet. |
21:15:39 | * | FromDiscord joined #nim |
21:15:49 | disruptek | so the longest list holds seqs of varied length according to depth? |
21:16:32 | disruptek | they could maybe just be sequences, depending... |
21:17:08 | FromDiscord | <Clyybber> yeah |
21:17:41 | disruptek | you'd have to cheat but eh.. no one is watching. |
21:17:42 | FromDiscord | <Clyybber> so that you only have an element once |
21:17:56 | FromDiscord | <Clyybber> and the pointer chasing gets turned into a inc i |
21:18:12 | disruptek | well, a dec |
21:18:45 | FromDiscord | <Clyybber> yeah, doesn't matter |
21:19:02 | shashlick | https://www.reddit.com/r/programming/comments/im29cv/benchmarking_exercise_for_rust_nim_and_go_against/ |
21:19:12 | FromDiscord | <Clyybber> but yeah, representing the lowest level with 0 is the best idea |
21:20:00 | disruptek | sieve of eratosthenes is one of the first algos i ever implemented in c. |
21:20:35 | disruptek | 30 years ago. |
21:25:07 | disruptek | haxscramper: you need to import skiplists where you import gram, i guess. silly, but i guess we can just force an export of cmp until nim is fixed. |
21:27:06 | FromDiscord | <Recruit_main707> `sieve(primes: ref seq[uint32])` 🥴 |
21:32:12 | * | maier joined #nim |
21:33:33 | * | tane_ quit (Quit: Leaving) |
21:34:36 | FromDiscord | <lqdev> ref seq jesus christ |
21:34:57 | FromDiscord | <lqdev> somebody doesn't know the language and is benchmarking it~ 🎵 |
21:35:10 | Yardanico | check the comments though :) |
21:35:55 | FromDiscord | <Rika> Why do they need ref semantics here |
21:36:03 | Yardanico | well they actually needed to use "var seq" |
21:36:37 | FromDiscord | <lqdev> ^ |
21:36:42 | Yardanico | anyway the speed is the same with both versions |
21:36:54 | Yardanico | need to try with arc |
21:37:23 | * | maier quit (Ping timeout: 260 seconds) |
21:37:39 | * | Trustable quit (Remote host closed the connection) |
21:37:41 | Yardanico | seems like it's mostly the same, maybe slightly faster |
21:37:44 | Yardanico | well, that's to be expected really |
21:38:13 | FromDiscord | <Recruit_main707> what about using an array? |
21:38:44 | FromDiscord | <Rika> That changes the code too much |
21:39:31 | FromDiscord | <Recruit_main707> id say it doesnt really |
21:39:42 | FromDiscord | <Recruit_main707> and it would make more sense to have a ref |
21:39:55 | FromDiscord | <Recruit_main707> a few less lines |
21:44:18 | FromDiscord | <lqdev> it makes less sense |
21:44:34 | FromDiscord | <lqdev> it actually needs more lines |
21:44:38 | FromDiscord | <lqdev> and allocates on the heap |
21:44:49 | FromDiscord | <lqdev> that's a pointless double pointer deref |
21:45:03 | FromDiscord | <lqdev> as the seq's content is already on the heap |
21:45:13 | FromDiscord | <Recruit_main707> arent we agreeing then? |
21:45:43 | Yardanico | well "var seq" is still required because seqs have value semantics |
21:45:50 | FromDiscord | <lqdev> you said "and it would make more sense to have a ref" |
21:46:28 | FromDiscord | <Recruit_main707> if he used an array |
21:46:35 | FromDiscord | <lqdev> ah |
21:46:36 | FromDiscord | <dom96> @Rebel the only thing you can do right now is: https://github.com/dom96/nim-in-action-code/blob/master/Chapter3/ChatApp/src/client.nim#L42 |
21:47:57 | FromDiscord | <Rebel> I'm not following, I am getting a return value it's just that it's Future[string] I would like to await it |
21:48:18 | FromDiscord | <Rebel> worse comes to worse I guess I can make that proc synchronous instead of dealing with a headache |
21:50:15 | * | FromDiscord quit (Remote host closed the connection) |
21:50:32 | * | FromDiscord joined #nim |
22:08:11 | * | wiml quit (Ping timeout: 240 seconds) |
22:15:43 | * | agent0x00 joined #nim |
22:23:36 | * | audiofile quit (Ping timeout: 258 seconds) |
22:24:14 | disruptek | DO IT |
22:32:29 | * | wiml joined #nim |
22:43:42 | * | a_chou quit (Ping timeout: 265 seconds) |
22:50:24 | disruptek | ticking away, the moments that make up the dull day. |
22:50:40 | disruptek | waiting for something or someone to show you the way. |
22:50:44 | disruptek | AM I RIGHT? |
22:52:05 | * | vsantana quit (Quit: leaving) |
23:08:45 | * | krux02 quit (Remote host closed the connection) |
23:13:26 | * | a_chou joined #nim |
23:14:09 | disruptek | not a fan of jsonutils. |
23:14:22 | disruptek | this basically ignores all the discussion about nulls, etc. |
23:15:08 | * | a_chou quit (Remote host closed the connection) |
23:16:57 | disruptek | poor style. |
23:17:01 | disruptek | not a fan. |
23:17:03 | disruptek | don't like it. |
23:19:33 | disruptek | why even introduce code with bugs? |
23:20:30 | * | arecacea1 quit (Remote host closed the connection) |
23:20:55 | * | arecacea1 joined #nim |
23:22:09 | disruptek | terrible. |
23:23:09 | * | agent0x00 quit (Quit: WeeChat 1.9.1) |
23:31:50 | * | wiml quit (Quit: Leaving) |
23:33:05 | * | maier joined #nim |
23:38:10 | * | maier quit (Ping timeout: 246 seconds) |
23:44:59 | * | gmaggior quit (Quit: Leaving) |
23:58:16 | * | audiofile joined #nim |