00:00:48 | FromGitter | <sealmove> nim is super awesome for transforming json to code =O i am really happy |
00:01:48 | * | rockcavera quit (Remote host closed the connection) |
00:06:35 | leorize | shouldn't you be very well aware of this given your involvement with generating nim code for kaitai struct? :P |
00:07:38 | FromGitter | <ynfle> Is there a repo to interact with the GitHub API? |
00:07:45 | leorize | !repo github |
00:07:48 | disbot | https://github.com/disruptek/github -- 9github: 11github api v3 for nim 15 7⭐ 0🍴 7& 29 more... |
00:07:59 | leorize | it's really... uh plain |
00:08:07 | leorize | but it works if you want something quick 'n dirty |
00:09:32 | FromDiscord | <Varriount> Hm, how feasible would it be to make a machine-learning based SQL formatter? |
00:09:51 | leorize | why would you want it to be ML-based? |
00:10:00 | leorize | well @mratsim can probably tell you :P |
00:10:17 | FromDiscord | <Varriount> Because my formatting preferences for SQL tend not to follow a strict set of rules. |
00:10:42 | * | lritter quit (Quit: Leaving) |
00:10:52 | * | rockcavera joined #nim |
00:11:00 | FromDiscord | <Varriount> The number of formatting "exceptions" when I write SQL is much higher than when I write other languages/data formats. |
00:11:02 | leorize | you can certainly make a lax formatter like nimpretty for that |
00:11:25 | leorize | alternatively you can stop writing sql :P |
00:12:02 | leorize | write a Nim DSL that writes SQL instead XD |
00:16:04 | FromDiscord | <Varriount> leorize: If only. 😔 |
00:16:43 | * | endragor joined #nim |
00:16:53 | disruptek | plain ol' github |
00:27:16 | * | oddp_ quit (Ping timeout: 246 seconds) |
00:34:54 | * | endragor quit (Ping timeout: 240 seconds) |
00:38:32 | * | leorize quit (Remote host closed the connection) |
00:38:35 | * | tinandi quit (Remote host closed the connection) |
00:38:58 | * | leorize joined #nim |
00:41:44 | * | fredrikhr quit (Read error: Connection reset by peer) |
00:42:10 | * | fredrikhr joined #nim |
00:43:28 | FromDiscord | <Anuke> @treeform I'm trying out your typography library, and it doesn't seem to be loading the TTF files I have around - the characters are 1x1 when rendered to an image, and the size is 0. It loads and renders the same fonts converted to SVG fonts correctly.↵Code: https://play.nim-lang.org/#ix=2rJM↵Am I doing something wrong, or is something wrong with these fonts? |
00:43:47 | FromDiscord | <Anuke> the font file tested https://media.discordapp.net/attachments/371759389889003532/733121666804219964/font.ttf |
00:47:50 | FromGitter | <ynfle> What does `Error: unhandled exception: unable to find a supported scheme [IOError]` mean for @distruptek's `github` pkg |
00:47:52 | FromGitter | <ynfle> ? |
00:51:48 | * | krux02 joined #nim |
00:53:23 | * | krux02 quit (Remote host closed the connection) |
00:53:58 | disruptek | ynfle: you probably need to build with ssl. |
00:59:13 | FromDiscord | <treeform> @Anuke you are not setting font size, svg might have a default font size I load at. `font.size = 14` |
01:00:41 | FromGitter | <ynfle> > *<disruptek>* @ynfle: you probably need to build with ssl. ⏎ ⏎ Thx |
01:00:54 | disruptek | np |
01:01:06 | FromDiscord | <treeform> @Anuke see this test: https://github.com/treeform/typography/blob/master/tests/test.nim#L197 |
01:01:28 | FromDiscord | <Anuke> That fixed it, thanks. I didn't see an explicit size setting in the README during loading, so I assumed it had a default |
01:01:39 | FromDiscord | <treeform> Yeah I should make that better. |
01:11:20 | * | fredrikhr quit (Ping timeout: 272 seconds) |
01:18:00 | * | Tlanger joined #nim |
01:20:48 | * | Tongir quit (Ping timeout: 256 seconds) |
01:30:12 | * | apahl quit (Ping timeout: 260 seconds) |
01:32:06 | * | apahl joined #nim |
01:37:01 | * | vicfred quit (Quit: Leaving) |
01:38:59 | FromDiscord | <Shucks> 4 hours of vim. Feels like I learned 1000 new commands... also feels like I just learned a fraction of all that features 😋 |
01:39:16 | disruptek | i only use 3 things. |
01:39:43 | * | audiophile_ joined #nim |
01:40:06 | FromDiscord | <Shucks> The best last one was `:Sex` |
01:40:11 | FromDiscord | <Elegant Beef> Same↵esc esc :!code |
01:40:14 | FromDiscord | <Elegant Beef> 😄 |
01:40:46 | FromDiscord | <Shucks> also [c]hange [i]n " was awesome ;D |
01:40:50 | FromDiscord | <Rika> you can just use :Se btw |
01:41:26 | FromDiscord | <Shucks> indeed |
01:41:53 | FromDiscord | <Shucks> But I'll prob won't forget :Sex |
01:44:52 | disruptek | cps local lifting is done but it doesn't work. |
01:45:15 | FromDiscord | <Rika> i use Vex more |
01:48:49 | skrylar[m] | almost done with this tlsf clone. wew |
02:02:08 | FromDiscord | <Varriount> disruptek: Howso? |
02:02:59 | FromDiscord | <Varriount> Shucks: Perhaps someday I'll learn Vim... but even then, I'll use something like VSCode. Multiple cursors are useful in many situations. |
02:09:31 | FromDiscord | <Rika> vim has multiple cursors though |
02:10:04 | disruptek | varrount: "done" is too strong a word, but it compiles. |
02:10:12 | disruptek | varriount, too. |
02:14:22 | FromDiscord | <Avatarfighter> how is everyone doing today 😄 |
02:15:13 | disruptek | getting nervous about my monthly shower tomorrow. |
02:15:21 | FromDiscord | <Avatarfighter> LMAO |
02:15:22 | FromDiscord | <Elegant Beef> Thought it was annual |
02:15:29 | FromDiscord | <Elegant Beef> Cmon disruptek, be honest |
02:15:39 | FromDiscord | <Avatarfighter> imagine not taking showers every other decade |
02:15:43 | disruptek | the rules are a little tougher up here close to canuckistan. |
02:16:19 | FromDiscord | <Elegant Beef> You best be turning around and not head any more north |
02:18:28 | * | endragor joined #nim |
02:20:34 | * | muffindrake quit (Ping timeout: 256 seconds) |
02:22:35 | * | muffindrake joined #nim |
02:26:27 | * | cyraxjoe quit (Quit: I'm out!) |
02:28:58 | * | cyraxjoe joined #nim |
02:42:18 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
02:51:07 | * | audiophile joined #nim |
02:54:16 | * | audiophile_ quit (Ping timeout: 258 seconds) |
02:54:18 | * | audiophile is now known as audiophile_ |
03:18:50 | FromDiscord | <Technisha Circuit (LGBTQIAP+)> Anuken uses Nim?- |
03:19:07 | FromDiscord | <Technisha Circuit (LGBTQIAP+)> Nice- |
03:22:02 | FromDiscord | <Technisha Circuit (LGBTQIAP+)> If i compile my program with Nimpy, but doesn't use any of the Nimpy features/procs, does the system running the binary need Python installed? |
03:22:54 | leorize | no |
03:23:24 | leorize | unless nimpy initializes the python runtime at load you should be fine |
03:23:52 | FromDiscord | <Technisha Circuit (LGBTQIAP+)> Thanks! |
04:06:02 | * | supakeen quit (Quit: WeeChat 2.8) |
04:06:16 | * | vicfred joined #nim |
04:06:40 | * | supakeen joined #nim |
04:07:58 | * | icyphox joined #nim |
04:08:08 | FromDiscord | <SirJosh> sent a code paste, see https://play.nim-lang.org/#ix=2rKa |
04:08:23 | FromDiscord | <Elegant Beef> sequences are imutable |
04:08:27 | FromDiscord | <Elegant Beef> (edit) 'sequences are imutable ... ' => 'sequences are imutableif declared with let' |
04:08:31 | FromDiscord | <SirJosh> oh |
04:08:31 | FromDiscord | <Elegant Beef> (edit) 'imutable' => 'immutable' |
04:08:37 | FromDiscord | <SirJosh> ah so nim has proper immutability |
04:08:40 | FromDiscord | <SirJosh> that's good to hear |
04:08:44 | FromDiscord | <Elegant Beef> Yep |
04:09:00 | FromDiscord | <Elegant Beef> `var` is mutable `let` is immutable and `const` is a compile time constant |
04:09:41 | leorize | change `let` -> `var` and the sequence will be mutable |
04:10:00 | FromDiscord | <Rika> Beef just explained that :P |
04:12:04 | FromDiscord | <Elegant Beef> I didi? |
04:12:06 | FromDiscord | <Elegant Beef> (edit) 'didi?' => 'did?' |
04:25:59 | icyphox | any reason why the Nim forum needs Google Analytics? it's non-free and doesn't belong in a FOSS project, i feel. |
04:27:48 | leorize | for analytics purposes |
04:28:04 | leorize | fun fact: I don't think we've ever looked at the resulting analytics |
04:29:32 | * | audiophile joined #nim |
04:29:53 | leorize | google analytics is a simple and effective way to gather engagement data, which we can use to optimize the website experience |
04:31:05 | leorize | there are foss alternatives but I think no one bothered to set it up |
04:32:30 | * | audiophile_ quit (Ping timeout: 256 seconds) |
04:32:34 | * | audiophile is now known as audiophile_ |
04:35:57 | FromDiscord | <Varriount> SirJosh: Though, it doesn't have quite the... complexity that C++ supports. |
04:38:11 | FromDiscord | <Varriount> For example, `let x = AReferenceType ; x.field = value` is legal. |
04:38:33 | FromDiscord | <Varriount> Because `let` only makes the reference itself constant, not the data it points to. |
04:39:16 | FromDiscord | <Elegant Beef> Which is also why our `func`s arent pure |
04:40:25 | FromDiscord | <Varriount> Eh, I like the level of mutability control Nim offers. I never quite saw why C++ code had to use `const`'s so much. |
04:40:53 | FromDiscord | <Elegant Beef> Yea but for a pure function that side effect cant be allowed |
04:41:12 | leorize | our definition of side effect does allow that kind of thing though |
04:41:27 | FromDiscord | <Varriount> Yeah, but a "pure" function is quite hard to actually prove. |
04:41:40 | FromDiscord | <Elegant Beef> Yea i'm mostly just pointing towards↵https://github.com/nim-lang/RFCs/issues/234 |
04:41:41 | disbot | ➥ Add write-tracking to Nim's func ; snippet at 12https://play.nim-lang.org/#ix=2pg3 |
04:41:52 | FromDiscord | <Varriount> Unless you remove pointers and external functions |
04:44:16 | * | bung joined #nim |
04:48:21 | * | opDispatch quit (Quit: Konversation terminated!) |
04:55:37 | * | audiophile_ quit (Quit: Default Quit Message) |
04:55:40 | FromDiscord | <Varriount> Hm, how would one implement a mock library in Nim? |
04:59:48 | FromDiscord | <Elegant Beef> What do you mean by "mock library" |
05:00:12 | FromDiscord | <Varriount> https://docs.python.org/3/library/unittest.mock.html |
05:00:39 | FromDiscord | <Varriount> Something that lets you check that appropriate actions were taken on a given value |
05:03:03 | FromDiscord | <Elegant Beef> Testing code is foriegn to me, so i'll defer to running away |
05:08:27 | * | narimiran joined #nim |
05:17:31 | skrylar[m] | they are usually tools that like, they intercept using an API and allow you to queue up fake responses |
05:17:46 | skrylar[m] | so you can say 'for this test, assume ohno() always returns true' or 'ohno() will first return true, then false' |
05:18:39 | skrylar[m] | also nice for stuff that relies on webshit because you can have it mock the replies from the external service |
05:19:43 | bung | there's https://github.com/jiro4989/faker |
05:21:03 | FromDiscord | <Rika> that's something different afaik |
05:22:11 | FromDiscord | <Rika> mocks are basically "fake APIs" or "fake libraries" that simulate the real thing |
05:22:47 | FromDiscord | <Rika> ...i think |
05:28:59 | FromDiscord | <impbox> they're very handy for testing, though I'd imagine it'd be difficult in a non dynamic language, it often relies on introspection and modifying stuff |
05:29:09 | FromDiscord | <impbox> but maybe you could do similar compiletime hacks |
05:39:01 | FromDiscord | <Varriount> @impbox You might be able to abuse term-rewriting macros |
05:39:17 | * | maier joined #nim |
05:44:17 | * | opal quit (Remote host closed the connection) |
05:44:58 | * | vicfred quit (Remote host closed the connection) |
05:45:21 | * | vicfred joined #nim |
05:45:29 | * | opal joined #nim |
05:51:24 | * | tane_ joined #nim |
06:31:48 | * | Mister_Magister quit (Quit: bye) |
06:35:33 | * | rockcavera quit (Remote host closed the connection) |
06:43:46 | * | solitudesf joined #nim |
07:08:44 | * | marnix joined #nim |
07:14:59 | * | marnix quit (Ping timeout: 240 seconds) |
07:15:21 | FromGitter | <alehander92> you can generate |
07:15:24 | FromGitter | <alehander92> introspection code |
07:15:29 | FromGitter | <alehander92> with macros iirc |
07:33:03 | * | vicfred quit (Remote host closed the connection) |
07:33:23 | * | vicfred joined #nim |
07:39:51 | icyphox | has anyone built Nim from source on OpenBSD? |
07:40:11 | icyphox | i'm getting a bunch of linker errors |
07:40:16 | icyphox | ld: error: undefined symbol: __builtin_bswap32 |
07:48:33 | lbart | icyphox: at least me and euantor (if i'm not wrong with the nick) |
07:48:58 | icyphox | ah ok i think i have it running |
07:49:07 | euantor | Yeah, I have |
07:49:09 | icyphox | i looked at the ports/lang/nim Makefile |
07:49:34 | euantor | Check out the .builds/openbsd.yml file for steps you can run from a shell to build from source |
07:49:44 | icyphox | oh |
07:49:46 | icyphox | neat |
07:49:48 | leorize[m] | icyphox: are you using clang? |
07:50:12 | euantor | And make sure to use devel as it sets clang as the compiler - gcc as shipped in base is too old a version |
07:50:30 | icyphox | leorize[m]: no i set it to use egcc |
07:50:40 | leorize | euantor: does the config not default to clang when you're on bsd? |
07:51:05 | leorize | if it doesn't then you should make it do so similar to osx |
07:51:07 | icyphox | i basically did 'CC=egcc sh build.sh' |
07:51:20 | leorize | icyphox: yea you need either a new gcc or clang |
07:51:45 | icyphox | works now. i'm koch'ing. :^) |
07:56:18 | euantor | leorize: it does in devel, yeah. Older versions don’t as the change wasn’t backported |
08:10:54 | FromDiscord | <Zed> hey prestige, you ever get around to using that nim_braces thins? |
08:10:58 | FromDiscord | <Zed> *thing |
08:11:12 | FromDiscord | <Zed> i tried using it but couldn't get used to it lol |
08:20:50 | lbart | icyphox: do you try to update the OpenBSD's port? |
08:21:21 | icyphox | lbart: it's at 1.2 right? |
08:21:31 | icyphox | besides, i wanted the other tools like nimpretty |
08:21:35 | * | marnix joined #nim |
08:21:37 | icyphox | which don't ship in the ports |
08:22:32 | lbart | icyphox: 1.2.0 yep |
08:23:11 | lbart | maybe you can add the tools in the port too |
08:23:13 | icyphox | btw, is nimpretty just a linter or does it format code like python's black? |
08:23:21 | icyphox | lbart: good idea. i'll submit a patch. |
08:24:40 | lbart | icyphox: you can take a look at what we do on FreeBSD (it's very close) |
08:26:15 | FromDiscord | <Varriount> @icyphox What compiler are you using, and what version? |
08:26:40 | icyphox | (e)gcc v8.3.0 |
08:29:14 | leorize[m] | icyphox: nimpretty respects your choices, so not like python's black |
08:29:30 | icyphox | ah ok |
08:29:46 | icyphox | but does it affect the code, or just show you hints? |
08:29:56 | icyphox | (i ran it, didn't see any change) |
08:31:44 | leorize | it does affect the code |
08:31:58 | leorize | but if your code is reasonably sane then it won't do anything |
08:32:42 | icyphox | ah cool |
08:33:07 | * | oddp_ joined #nim |
08:42:22 | icyphox | ok now, has anyone tried cross-compiling for Linux x86_64 on OpenBSD? |
08:53:18 | Araq | "This post is archived and can no longer be edited" hmm |
08:53:57 | leorize[m] | it's a nim forum feature apparently |
08:54:53 | Araq | a new one. it's great but now I need to write a new post |
08:57:01 | leorize[m] | is this about arc? |
08:57:30 | Araq | yeah |
08:57:43 | leorize[m] | nice |
09:03:28 | * | Tongir joined #nim |
09:04:13 | icyphox | hmm, ok so i think i have the cross-compile working ish. except i get a "nimbase.h" missing error. |
09:06:06 | * | Tlanger quit (Ping timeout: 258 seconds) |
09:06:32 | * | nikita` joined #nim |
09:06:32 | Araq | icyphox, copy nimbase.h over to where you need it, it's platform independent |
09:06:35 | * | nikita` quit (Changing host) |
09:06:35 | * | nikita` joined #nim |
09:08:05 | icyphox | wow! that worked |
09:08:08 | icyphox | thanks |
09:13:20 | leorize[m] | !repo nim-vcl |
09:13:20 | disbot | https://github.com/ying32/nim-vcl -- 9nim-vcl: 11nim GUI test 15 1⭐ 0🍴 |
09:15:21 | leorize[m] | the author of vcl->go decided to make a nim version (for testing). it appears that they're evaluating nim vs rust, but I don't know the language used here so :p |
09:28:10 | * | fredrikhr joined #nim |
09:39:57 | FromDiscord | <mratsim> chinese |
09:40:55 | * | Trustable joined #nim |
09:41:01 | * | livcd quit (Ping timeout: 264 seconds) |
09:48:21 | * | abm joined #nim |
09:50:47 | FromDiscord | <Yardanico> Good morning |
10:06:22 | * | arecaceae quit (Remote host closed the connection) |
10:08:34 | * | arecaceae joined #nim |
10:12:00 | FromDiscord | <krisppurg> quick question if I were to make frequent changes to master and installing the git repo from nimble would install latest release tag `v.0.9.0`, then afterwards I release other tag `v1.0.0`, then I install again would it just install the latest then? |
10:22:58 | * | sagax quit (Ping timeout: 272 seconds) |
10:23:38 | FromDiscord | <Yardanico> I think so, yes |
10:26:25 | bung | oh chinese nim developer, I'll follow them |
10:26:25 | * | ForumUpdaterBot quit (Remote host closed the connection) |
10:26:33 | * | ForumUpdaterBot joined #nim |
10:28:27 | ForumUpdaterBot | New thread by Araq: Update on --gc:arc, see https://forum.nim-lang.org/t/6549 |
10:45:54 | FromDiscord | <dom96> 3 different websocket implementations now, who's going to create a 4th? 😄 |
10:47:23 | * | sagax joined #nim |
10:59:33 | * | theelous3 quit (Read error: Connection reset by peer) |
11:00:46 | * | dannyhpy quit (Remote host closed the connection) |
11:04:36 | bung | ws works pretty well |
11:08:19 | * | NimBot joined #nim |
11:11:38 | * | vsantana joined #nim |
11:26:24 | bung | https://github.com/nim-lang/Nim/issues/14891 this should close, their PR is merged. |
11:26:26 | disbot | ➥ nimpretty multiple file support |
11:26:39 | narimiran | indeed. closing |
11:30:04 | * | fredrikhr quit (Read error: Connection reset by peer) |
11:30:31 | * | fredrikhr joined #nim |
11:30:39 | * | opal quit (Write error: Broken pipe) |
11:30:39 | * | leorize quit (Remote host closed the connection) |
11:32:03 | * | leorize joined #nim |
11:32:20 | * | opal joined #nim |
11:35:30 | FromDiscord | <Clyybber> Araq: In the doc example for cursor inference the v doesn't actually get cursorified, which I think is expected, considering that it will get moved into v normally |
11:35:49 | FromDiscord | <Clyybber> To get cursorified table.`[]` would have to return lent right? |
11:35:59 | FromDiscord | <Clyybber> Or does cursorification not take that into account yet? |
11:42:05 | * | synshroud joined #nim |
11:49:48 | * | Tongir quit (Ping timeout: 256 seconds) |
11:56:48 | * | rockcavera joined #nim |
12:06:02 | * | supakeen quit (Quit: WeeChat 2.8) |
12:06:45 | * | supakeen joined #nim |
12:10:43 | * | sacredfrog quit (Quit: ZNC 1.8.1 - https://znc.in) |
12:15:03 | * | leorize quit (Remote host closed the connection) |
12:15:26 | * | leorize joined #nim |
12:18:10 | * | marnix_ joined #nim |
12:18:35 | * | marnix quit (Ping timeout: 240 seconds) |
12:18:57 | * | marnix_ is now known as marnix |
12:20:43 | * | sacredfrog joined #nim |
12:21:25 | Prestige | @Zed nah cuz nimpretty would complain |
12:29:39 | * | marnix_ joined #nim |
12:31:26 | * | apahl quit (Ping timeout: 256 seconds) |
12:32:23 | * | apahl joined #nim |
12:32:52 | * | marnix quit (Ping timeout: 256 seconds) |
12:33:30 | * | marnix joined #nim |
12:34:22 | * | marnix_ quit (Ping timeout: 260 seconds) |
12:36:08 | * | marnix quit (Client Quit) |
12:36:23 | * | marnix joined #nim |
12:38:21 | * | marnix_ joined #nim |
12:39:11 | * | haxscramper joined #nim |
12:41:01 | * | marnix quit (Ping timeout: 264 seconds) |
12:42:35 | * | marnix_ is now known as marnix |
12:43:05 | * | marnix quit (Client Quit) |
12:43:22 | * | marnix joined #nim |
12:47:36 | * | marnix quit (Ping timeout: 256 seconds) |
12:51:12 | * | hyiltiz quit (Ping timeout: 260 seconds) |
12:51:16 | * | hyiltiz_ joined #nim |
12:57:30 | FromDiscord | <Yardanico> There's a way to make it work though |
12:57:35 | FromDiscord | <Yardanico> Even with nimpretty |
12:59:20 | FromDiscord | <flywind> Hi, how can I wrap C++ dlls? I want to use opencv in Nim. |
12:59:49 | FromDiscord | <Yardanico> I think OpenCV would expose a C API, no? |
12:59:55 | FromDiscord | <Yardanico> as a shared library |
13:00:54 | FromDiscord | <flywind> C API seems to be deprecated. |
13:02:29 | FromDiscord | <Clyybber> Araq: Hmm, is there any reason you went for an intset to mark the cursors instead of adding the sfCursor flag to them? |
13:02:51 | ForumUpdaterBot | New thread by Levlan: Beginner - Is there a Nim's similar to a Python dictionary?, see https://forum.nim-lang.org/t/6550 |
13:03:17 | FromGitter | <gogolxdong> Table? |
13:13:15 | FromDiscord | <jasonfi> you can wrap C++ in C |
13:13:20 | FromDiscord | <jasonfi> if it comes to that |
13:48:28 | * | rockcavera quit (Remote host closed the connection) |
13:57:38 | icyphox | so i'm writing this program with a bunch of sockets open simultaneosly |
13:57:50 | icyphox | is there an elegant way to close all of them on exit |
13:58:06 | icyphox | note, they're not all accessible from a single place in the code |
13:59:20 | Yardanico | damn leorize[m] neovim with your plugin is magic |
14:00:06 | icyphox | what plugin |
14:00:20 | icyphox | i need all nim plugins for vim |
14:00:26 | Yardanico | https://github.com/alaviss/nim.nvim |
14:00:27 | Yardanico | neovim |
14:00:39 | Yardanico | autocompletion, semantic syntax highlighting, go to definition, etc |
14:00:43 | Yardanico | for nim :P |
14:00:46 | icyphox | oh how did i not know this |
14:01:00 | icyphox | i don't need zah/nim.vim then |
14:01:02 | icyphox | epic |
14:01:28 | Oddmonger | i'm using zah too |
14:01:49 | * | waleee-cl joined #nim |
14:02:43 | FromDiscord | <Varriount> icyphox: https://nim-lang.org/docs/system.html#addQuitProc%2Cproc%29 |
14:02:57 | Yardanico | or try defer :DDDDDDDDDD |
14:03:19 | FromDiscord | <Varriount> Yardanico: will that work? |
14:03:23 | * | audiophile_ joined #nim |
14:03:24 | Yardanico | why not? |
14:03:28 | icyphox | what does defer do |
14:03:29 | Yardanico | it'll close the socket at the end of the scope |
14:03:43 | icyphox | man i really need to rtfm |
14:03:49 | Yardanico | icyphox: poor man's try: finally |
14:03:50 | icyphox | it's been so long since i wrote any nim lol |
14:03:55 | Yardanico | https://nim-lang.org/docs/manual.html#exception-handling-defer-statement |
14:04:37 | icyphox | amazing |
14:04:42 | icyphox | thank you |
14:05:07 | Yardanico | can't you just call socket.close() at the end of your procedures ? |
14:06:56 | icyphox | hmm |
14:07:30 | * | audiophile_ quit (Read error: Connection reset by peer) |
14:07:33 | icyphox | that'll close it when it goes out of scope right |
14:07:35 | icyphox | hmmmm |
14:07:38 | Yardanico | yes |
14:07:43 | Yardanico | otherwise can't you just like |
14:07:48 | Yardanico | create a seq and add all sockets there |
14:07:56 | icyphox | yeah good idea |
14:07:57 | Yardanico | and at the end of the program iterate over the seq and close all sockets |
14:08:11 | FromDiscord | <juan_carlos> quitProc Deprecated. |
14:08:40 | Yardanico | on devel |
14:08:42 | Yardanico | not on stable |
14:08:50 | FromDiscord | <juan_carlos> Ye |
14:08:52 | Yardanico | exitprocs doesn't exist on stable |
14:09:08 | FromDiscord | <juan_carlos> Ne |
14:09:17 | icyphox | ok weird. even after closing the socket, running it again gives me 'Address already in use' |
14:09:30 | icyphox | netstat shows the port in use |
14:09:37 | Yardanico | leorize[m]: a question about your plugin (or neovim, I'm really new to vim) |
14:09:56 | Yardanico | https://i.imgur.com/i3aMFAb.png if here I press enter nothing happens :D |
14:09:59 | Yardanico | it still shows the suggestion |
14:11:23 | icyphox | leorize[m]: how can i disable folding? in nim.nvim |
14:11:42 | Yardanico | g:nim_fold |
14:11:50 | Yardanico | or something |
14:11:51 | icyphox | oh |
14:11:54 | icyphox | danke |
14:11:57 | Yardanico | https://github.com/alaviss/nim.nvim/commit/e8c173af9ee46065c80a4aa93759c3d3ef8d893e |
14:12:07 | Yardanico | ah wait it was removed :P |
14:12:12 | Yardanico | need to toggle foldenable |
14:12:28 | Yardanico | can't you just make it in your vim config so it's toggled off for nim files? I will probably do the same |
14:12:28 | FromDiscord | <Varriount> icyphox: Hm, that problem sounds familiar |
14:12:49 | * | lritter joined #nim |
14:13:05 | icyphox | Varriount: the socket still being around problem? |
14:14:19 | FromDiscord | <Varriount> Yes |
14:14:20 | FromDiscord | <Recruit_main707> Cpp’s vectors have the same functionality as our sequences? |
14:14:53 | FromDiscord | <Varriount> icyphox: Though I can't find an issue describing it. |
14:14:59 | * | audiophile_ joined #nim |
14:15:42 | FromDiscord | <Varriount> icyphox: What's odd is that the OS should clean up sockets when the program exits |
14:15:43 | FromDiscord | <lqdev> icyphos: also, there's :set nofoldenable |
14:15:51 | FromDiscord | <lqdev> if you don't want folding at all |
14:16:40 | FromDiscord | <Varriount> icyphox: Closing sockets is more of a courtesy for the client, so they get a "connection closed" rather than an eventual timeout |
14:17:18 | icyphox | right yeah |
14:17:57 | FromDiscord | <Varriount> Unless Linux does something different? I use Windows mostly, so sometimes Linux-specific behaviors trip me up. |
14:17:59 | icyphox | lqdev: thank you, that'll work |
14:18:13 | icyphox | Varriount: i'm on OpenBSD... shouldn't be far too different i'd assume |
14:19:28 | bung | what's dollar proc called in jsgen ? |
14:19:41 | FromDiscord | <Varriount> Icyphox: Hm, do you have any way of tracing the close() calls made (using something like dtrace, bpf, etc)? |
14:19:57 | * | nikita` quit (Read error: Connection reset by peer) |
14:20:26 | * | nikita` joined #nim |
14:20:39 | icyphox | hmm |
14:20:41 | icyphox | i'll have to see |
14:20:52 | icyphox | they close after a while though |
14:20:58 | icyphox | it's just annoying |
14:29:51 | icyphox | yo leorize[m], mate your plugin is great but wow does it cause some input lag |
14:30:02 | Yardanico | does it? |
14:30:03 | icyphox | it's like a good 2s before anything i type registers on the screen |
14:30:04 | icyphox | yeah |
14:30:05 | Yardanico | it's all async |
14:30:07 | icyphox | no idea why |
14:30:11 | Yardanico | for me it's instant lol |
14:30:16 | icyphox | wew |
14:30:30 | Yardanico | wdym by "registers"? |
14:30:33 | Yardanico | shows on screen as in the letter? |
14:30:37 | icyphox | yeah |
14:30:39 | icyphox | that |
14:30:49 | icyphox | each character i type takes 2s or more to show up |
14:30:58 | Yardanico | I don't think that's a nim.nvim issue, or you configured it wrong :D |
14:31:12 | icyphox | bruh |
14:31:28 | icyphox | ok lemme see if i have to configure anything |
14:33:45 | icyphox | ok idk |
14:33:55 | icyphox | sorry m8 zah it is for now |
14:33:57 | icyphox | lol |
14:34:06 | FromDiscord | <Varriount> It might be nimsuggest |
14:34:14 | * | maier quit (Ping timeout: 240 seconds) |
14:34:15 | icyphox | yeah i was wondering |
14:34:51 | FromDiscord | <Clyybber> is it only happening with the current file? |
14:35:11 | icyphox | i tried it with just one file |
14:38:20 | FromDiscord | <--HA--> I want to write out a sequence of a custom type to a json file. To convert a type into JsonNodes I have to write my own proc that iterates and creates the nodes as appropriate or is there a shortcut? |
14:39:31 | FromDiscord | <--HA--> There is no reverse `to` is there? |
14:46:10 | Yardanico | %* |
14:46:13 | Yardanico | or just % |
14:46:25 | Yardanico | https://nim-lang.org/docs/json.html#creating-json |
14:49:27 | icyphox | ok on further inspection, it appears to be in the TIME_WAIT state |
14:49:49 | icyphox | even after having closed the socket... |
14:49:52 | icyphox | mighty odd |
14:55:50 | FromDiscord | <kaletaa> https://static.skaip.org/img/emoticons/180x180/f6fcff/dance.gif |
14:55:56 | * | synshroud quit (*.net *.split) |
14:55:57 | * | Kaivo quit (*.net *.split) |
14:55:58 | * | FromDiscord quit (*.net *.split) |
14:56:06 | * | def- quit (*.net *.split) |
14:57:11 | icyphox | rip |
14:57:28 | * | synshroud joined #nim |
14:57:28 | * | Kaivo joined #nim |
14:57:28 | * | FromDiscord joined #nim |
14:57:28 | * | def- joined #nim |
14:57:43 | FromDiscord | <Vindaar> on anything for which `to` works for sure I think |
14:58:44 | * | FromDiscord quit (Remote host closed the connection) |
14:59:01 | * | FromDiscord joined #nim |
15:09:09 | * | marnix joined #nim |
15:11:21 | * | theelous3 joined #nim |
15:18:05 | FromGitter | <ynfle> How would I write the equivalent of `debugEcho` that writes to `stderr` but has no sideEffects? |
15:18:17 | FromDiscord | <--HA--> @Vindaar works perfectly thanks. I thought I might be missing something. Glad I didn't start to build that myself. I saw the % examples but did not understand that it works on types. |
15:18:42 | * | abm quit (Read error: Connection reset by peer) |
15:22:11 | FromDiscord | <Clyybber> Araq: https://github.com/nim-lang/Nim/pull/15002 |
15:22:13 | disbot | ➥ Show if a variable is cursor in --expandArc |
15:22:28 | Yardanico | we also need to fix cursor optimizer so it shows proper hints :P |
15:22:32 | Yardanico | when it made a cursor |
15:22:37 | Yardanico | possibly under same Performance hint? |
15:22:42 | FromDiscord | <Clyybber> oh wdym? |
15:22:44 | FromDiscord | <Clyybber> it now shows it |
15:22:47 | FromDiscord | <Clyybber> in --expandArc |
15:22:51 | Yardanico | nonono |
15:22:54 | FromDiscord | <Clyybber> with the PR I mean |
15:22:57 | Yardanico | lemme show what I mean |
15:23:14 | Yardanico | https://github.com/nim-lang/Nim/blob/devel/compiler/cursor_inference.nim#L102 |
15:23:25 | Yardanico | ah wait it's when false |
15:23:33 | Yardanico | ahh |
15:23:40 | Yardanico | 4raq disabled it when he merged the PR |
15:23:42 | Yardanico | sorry I was a bit confused |
15:25:24 | FromDiscord | <Clyybber> yeah |
15:25:38 | FromDiscord | <Clyybber> and I think its better to include that information in the --expandArc output |
15:25:40 | Yardanico | then yeah, your PR would be good |
15:25:40 | Yardanico | yes |
15:25:57 | Yardanico | would it be possible to also allow expandArc for the whole module? |
15:26:13 | Yardanico | sometimes there's a lot of templates and stuff so finding the resulting name of the proc can be hard |
15:26:16 | * | marnix quit (Ping timeout: 256 seconds) |
15:27:27 | FromDiscord | <Clyybber> hmm |
15:27:38 | FromDiscord | <Clyybber> you can show it for the module by putting in the modules name |
15:27:49 | FromDiscord | <Clyybber> but it won't show all the modules transformed procs |
15:27:58 | FromDiscord | <Clyybber> since injectdestructors is done on a per proc basis |
15:28:07 | Yardanico | oh hm |
15:28:25 | Yardanico | well, it would show procs which were not removed by the DCE right? |
15:28:47 | FromDiscord | <Clyybber> no, it wouldn't show those who were transformed |
15:28:50 | FromDiscord | <Vindaar> @Yardanico have you ever tried cligen with arc? just noticed that in a small program I'm writing right now it causes an internal compiler error |
15:28:51 | FromDiscord | <Clyybber> like declarations |
15:28:57 | Yardanico | @Vindaar huh |
15:28:58 | Yardanico | strange |
15:29:00 | Yardanico | latest devel? |
15:29:17 | FromDiscord | <Vindaar> eh, one sec |
15:30:02 | FromDiscord | <Vindaar> about a week old. YEARS in nim land, I tell you. let me test with devel |
15:30:15 | Yardanico | ah you're right |
15:30:19 | Yardanico | I got an ICE with one of the examples |
15:30:26 | Yardanico | @Clyybber it's nkParForStmt agian :D |
15:30:26 | FromDiscord | <Clyybber> huh, lemme see |
15:30:31 | FromDiscord | <Clyybber> dammit |
15:30:40 | Yardanico | from the || loop |
15:30:47 | Yardanico | "Error: internal error: cannot inject destructors to node kind: nkParForStmt" |
15:31:46 | Yardanico | just for x in `||`(1, 5): echo x |
15:31:49 | Yardanico | will trigger the error |
15:32:11 | FromDiscord | <Clyybber> Araq: What to to do about nkParForStmt? |
15:32:57 | FromDiscord | <Vindaar> ah, works on devel indeed! |
15:33:02 | Yardanico | nice :) |
15:33:05 | FromDiscord | <Clyybber> nice |
15:33:15 | Yardanico | that ICE is just if you use some parallel flag in cligen |
15:33:41 | Yardanico | cligen source code seems to be a little bit condensed :D |
15:33:52 | FromDiscord | <Clyybber> heh |
15:33:58 | Yardanico | https://github.com/c-blake/cligen/blob/master/examples/dups.nim#L96 |
15:33:59 | FromDiscord | <Vindaar> ok, possible |
15:38:32 | narimiran | Yardanico: i've seen that error ("cannot inject destructors to node kind: nkParForStmt") in several nimble packages when testing them with arc |
15:38:45 | Yardanico | yeah that just means they use || openmp iterator |
15:39:08 | narimiran | probably.... it was arraymancer and nim-chronicles |
15:39:19 | Yardanico | well arraymancer is an entirely different thing :P |
15:39:21 | narimiran | ...and chronos |
15:43:59 | * | superbia joined #nim |
15:46:00 | * | superbia left #nim ("WeeChat 2.4") |
16:02:54 | * | audiophile_ quit (Ping timeout: 240 seconds) |
16:05:16 | * | couven92 joined #nim |
16:05:31 | * | fredrikhr quit (Disconnected by services) |
16:05:36 | * | couven92 is now known as fredrikhr |
16:08:06 | * | oculux quit (Ping timeout: 260 seconds) |
16:08:43 | * | endragor quit (Remote host closed the connection) |
16:09:23 | * | endragor joined #nim |
16:14:01 | * | endragor quit (Ping timeout: 264 seconds) |
16:26:39 | bung | how to compile nim for js backend ? |
16:27:15 | FromGitter | <ynfle> `nim js file.nim` |
16:27:21 | bung | `./koch temp js ~/test13602.nim ` seems not right, give me type mismatch: got <AbsoluteDir> but expected 'AbsoluteDir = distinct string' |
16:28:06 | bung | sorry, I mean nim compiler its self |
16:28:07 | narimiran | maybe the problem is tilde? |
16:28:31 | FromGitter | <ynfle> Why do you want the compiler in js? |
16:29:09 | narimiran | bung: try it without `~` to see if it triggers the same error |
16:30:02 | bung | yeah, same error, dont know why it call docgen.nim |
16:30:39 | bung | I know docgen not avaiable for js backend |
16:33:10 | narimiran | but wait, does `nim_temp` even work with js backend? IIRC, it doesn't |
16:33:53 | Yardanico | bung: you can't |
16:34:05 | Yardanico | well, at least not without modifying the compiler |
16:34:23 | Yardanico | to not use any unsafe features (IIRC it doesn't use a lot of them) and to not use filesystem (idk how you would go about that though) |
16:34:37 | Yardanico | IMO it's easier to instead make nim compiler work with emscripten |
16:35:50 | bung | ah, so I misused , I meat to build nim to test my modified jsgen |
16:36:02 | Yardanico | well, then you just build nim compiler normally |
16:37:14 | bung | nim c compiler/nim.nim ? |
16:37:21 | Yardanico | ./koch temp would be better |
16:37:27 | Yardanico | to just test |
16:37:34 | Yardanico | ./koch temp js yournimfile.nim |
16:37:42 | Yardanico | it'll compile your modified compiler and run "nim js yournimfile.nim" |
16:38:21 | bung | but I got `Error: compiler wasn't built with JS code generator` |
16:38:35 | Yardanico | well then nim c compiler/nim.nim will work too :P |
16:38:42 | Yardanico | koch temp builds with -d:leanCompiler |
16:38:50 | Yardanico | which excludes js backend, doc backend |
16:39:01 | narimiran | my `nim_temp` tells me "Error: compiler wasn't built with JS code generator" |
16:39:28 | narimiran | don't know if calling it directly with `koch temp js` changes something.... i built it with just `koch temp` |
16:39:39 | Yardanico | well yeah as I said :P |
16:39:46 | bung | nim c compiler/nim.nim I got `Error: type mismatch: got <AbsoluteDir> but expected 'AbsoluteDir = distinct string'` |
16:39:46 | narimiran | yeah, i'm lagging, sorry |
16:39:52 | Yardanico | bung: oh that one.. |
16:40:25 | Yardanico | it happens when you compile nim compiler in other directory than your stdlib path |
16:40:30 | Yardanico | I feel like it should be fixed but idk how :D |
16:40:51 | Yardanico | basically if you have nim installed somewhere, and try to compile nim compiler from other folder with "nim c" it'll fail because it uses stdlib from the original installation |
16:41:30 | bung | am trying `./compiler/nim c compiler/nim.nim` |
16:43:27 | bung | oh this works |
16:47:59 | disruptek | there's an option to specify the stdlib, but yeah, we talked about fixing koch. |
16:48:07 | disruptek | actually, i think i even submitted a pr. |
16:49:39 | bung | how you debug the compiler ? |
16:50:05 | disruptek | i'm better at adding bugs than removing bugs. |
16:50:08 | bung | the js code gen results very differients |
16:50:11 | FromGitter | <iffy> Is there a way to define a Python-style *call* proc for an object? |
16:50:18 | Yardanico | well, yes |
16:50:34 | Yardanico | https://nim-lang.org/docs/manual_experimental.html#special-operators-operator-dot |
16:51:00 | Yardanico | actually not sure if it will work for an object itself |
16:51:05 | Yardanico | ah you don't need experimental for that |
16:51:26 | Yardanico | ah you do :D |
16:51:51 | Yardanico | https://play.nim-lang.org/#ix=2rNe |
16:53:09 | FromGitter | <iffy> Thanks, Yardanico! |
16:53:13 | bung | {.emit:"# `it.len`".} how to emit the node len |
16:53:29 | Yardanico | ?? |
16:53:56 | bung | proc genIf(p: PProc, n: PNode, r: var TCompRes) = |
16:54:39 | bung | i want emit the variable len to result js code |
16:55:53 | bung | or I just echo it during compile ? |
16:56:07 | Yardanico | you can just echo, yes |
16:56:20 | Yardanico | also see https://nim-lang.org/docs/intern.html#debugging-the-compiler |
16:57:56 | FromGitter | <alehander92> bung think differently about it |
16:58:07 | FromGitter | <alehander92> the compiler is just a nim program |
16:58:28 | FromGitter | <alehander92> which generates in its runtime code strings/ropes which it saves in files finally |
16:58:36 | FromGitter | <alehander92> there is nothing magical like emit etc |
16:58:40 | FromGitter | <alehander92> so study a bit jsgen |
16:58:56 | FromGitter | <alehander92> to see how other hardcode strings are added to the code |
16:59:49 | FromGitter | <alehander92> `lineF` |
17:00:04 | bung | oh, I dont need echo from compiler ,--debuginfo --lineDir:on seems good |
17:00:13 | FromGitter | <alehander92> (probably line formatted) seems to be a good option: it seems you need to pass a proc context etc |
17:00:20 | FromGitter | <alehander92> ah ok if you just want to debug then you can echo |
17:00:34 | FromGitter | <alehander92> sorry, i thought you want to tweak generatiom of code |
17:01:46 | bung | I see a issue of js gen , so I want figure out what cause that |
17:06:38 | bung | I dont see lineF output in else branch |
17:07:27 | FromGitter | <alehander92> no no lineF is a thing |
17:07:30 | FromGitter | <alehander92> inside jsgen.nim |
17:07:44 | FromGitter | <alehander92> what is the issue |
17:08:53 | bung | https://github.com/nim-lang/Nim/issues/13602 |
17:08:56 | disbot | ➥ [JS] String is undefined ; snippet at 12https://play.nim-lang.org/#ix=2rNk |
17:09:39 | bung | hmm, the comment is I dig so far, debuging js gen very new to me. |
17:10:03 | Yardanico | first thing you should try is simplify the code to reproduce the issue |
17:11:55 | bung | oh,yes, I try remove for loop, same |
17:18:09 | bung | it will call `reprEnum` in result js code when success. |
17:18:41 | * | synshroud_ joined #nim |
17:19:46 | leorize | icyphox: input lag? how big was the file? |
17:19:51 | leorize | and what OS are you on? |
17:20:50 | leorize | Yardanico: uh for suggestions you use `Ctrl-N` & `Ctrl-P` to select them |
17:20:58 | * | synshroud quit (Ping timeout: 272 seconds) |
17:21:29 | bung | alehander92 you can tell me something about this issue ? |
17:23:21 | * | audiophile_ joined #nim |
17:23:24 | FromGitter | <alehander92> sorry, a bit busy now :( |
17:23:27 | FromGitter | <alehander92> can't think of something |
17:25:06 | bung | ok, I need read more compiler source |
17:25:44 | icyphox | leorize: like 70 lines |
17:25:50 | icyphox | on OpenBSD |
17:26:00 | FromGitter | <alehander92> bung yeah it's kinda not too hard to reason about |
17:26:22 | FromGitter | <alehander92> code generation is mostly visiting trees and constructing strings |
17:26:25 | leorize | icyphox: you're using the terminal client? |
17:26:30 | icyphox | yes |
17:26:35 | FromGitter | <alehander92> if we simplify it a bit |
17:26:52 | icyphox | nearly 3-4s of input lag |
17:27:20 | leorize | my guess is that the redraws triggered by semantic highlighting is insanely slow on openbsd for whatever reason |
17:27:33 | leorize | what terminal emulator are you using? |
17:27:44 | bung | can I easier find where the compiler generate the block of code ? |
17:27:44 | icyphox | st |
17:27:49 | icyphox | suckless terminal |
17:27:52 | leorize | though it should really not surprise me if stuff running on openbsd is slow :P |
17:27:53 | Yardanico | well openbsd itself is a bit slower than most other OSes, but it shouldn't make that much of a difference |
17:27:58 | icyphox | lol |
17:27:58 | * | audiophile_ quit (Quit: Default Quit Message) |
17:28:00 | icyphox | but yeah |
17:28:02 | icyphox | really shouldn't |
17:28:17 | Yardanico | try with other terminal emulator? |
17:28:21 | Yardanico | just to see if you still have the issue |
17:28:26 | leorize | this would be a neovim bug I suppose |
17:28:46 | icyphox | i'm heading to bed rn it's 11:00pm here lol |
17:28:54 | icyphox | i'll do it tmrw and ping you |
17:28:56 | leorize | wait... is your /tmp on tmpfs? |
17:29:00 | icyphox | yep |
17:29:14 | leorize | then I've no idea why it's slow :P |
17:29:39 | icyphox | lol |
17:29:43 | leorize | I can give you instructions on how to run some profiling later, maybe there's something about openbsd that I should be wary of |
17:29:59 | icyphox | leorize: ok wait |
17:30:02 | icyphox | no it's not tmpfs |
17:30:04 | icyphox | my bad |
17:30:19 | icyphox | tmpfs support was dropped on OpenBSD |
17:30:32 | leorize | is /tmp on spinning rust? |
17:30:37 | leorize | (aka hdd) |
17:30:42 | icyphox | SSD here, but sure |
17:30:44 | icyphox | yeah |
17:31:50 | leorize | a potential slowdown can be caused by the writes to /tmp so the data can be passed to nimsuggest |
17:32:08 | FromDiscord | <Clyybber> icyphox: Are you not in germany? |
17:32:12 | leorize | I configured it to not use fsync but maybe that's not supported on openbsd |
17:33:06 | icyphox | Clyybber, no |
17:33:08 | icyphox | India |
17:33:22 | FromDiscord | <Clyybber> oh, nice |
17:33:29 | icyphox | not really but ok |
17:33:31 | icyphox | lol |
17:33:33 | FromDiscord | <Clyybber> I thought you were german because of "danke" :p |
17:33:38 | icyphox | ahhh lol |
17:33:42 | icyphox | i've been watching too much Dark |
17:33:49 | FromDiscord | <Clyybber> haha, same |
17:33:58 | icyphox | danke feels so nice to say |
17:37:04 | * | krux02 joined #nim |
17:39:44 | FromDiscord | <Clyybber> Araq: ping |
17:41:00 | FromGitter | <alehander92> bitte schon |
17:41:15 | FromGitter | <alehander92> mutimesc |
17:41:37 | narimiran | icyphox: the only thing i remember by heart from 'dark' is "zukunft" (or something like that) |
17:41:39 | FromDiscord | <Vindaar> ok, now I managed to get an internal compiler error regardless of arc 🙂 |
17:41:41 | FromGitter | <alehander92> i can surround clybber with my language basic words |
17:42:07 | FromGitter | <alehander92> zukunft is future |
17:42:10 | narimiran | and "die ende ist anfang" :D |
17:42:14 | * | fredrikhr quit (Ping timeout: 246 seconds) |
17:42:20 | icyphox | oh lol |
17:42:21 | FromGitter | <alehander92> this is advanced german now |
17:42:22 | icyphox | the end is the begenning |
17:42:24 | icyphox | or smth |
17:42:29 | narimiran | yep |
17:42:33 | FromDiscord | <Shucks> Is PMunch here? |
17:42:36 | icyphox | 'es tu mir leid' |
17:42:38 | icyphox | i think |
17:42:41 | narimiran | hahaha |
17:42:48 | narimiran | es tut mir leid |
17:42:51 | FromGitter | <alehander92> i saw a great llvm-related ad in norway |
17:42:52 | icyphox | ah yes |
17:42:54 | icyphox | es tut mir leid |
17:42:56 | icyphox | i'm sorry |
17:43:04 | FromGitter | <alehander92> PMunch it's about a new processor arch and haskell llvm |
17:43:05 | narimiran | yeah, they repeated that one 100x too |
17:43:08 | icyphox | lol |
17:43:09 | FromGitter | <alehander92> if you're intereste |
17:43:39 | FromDiscord | <Vindaar> anyone have the time to rip out all non essentials here and report it as a bug? https://github.com/Vindaar/AnsysDiscoveryToLisConvert/commit/cb64ed71a8a9519e22f74637a5d4c2cded2d4143 |
17:44:25 | narimiran | (now i checked, it is "das ende", not "die ende"; german genders are hard!) |
17:44:45 | icyphox | ah |
17:44:53 | icyphox | i know literally 0 german |
17:45:23 | narimiran | i've learned it for 5 years in elementary school, but that was 20+ years ago, and i forgot almost everything |
17:45:31 | icyphox | i know french so i guess that satisfies my quota of EU languages |
17:45:33 | icyphox | lol |
17:46:26 | narimiran | ahem, english |
17:46:52 | icyphox | i mean, is that specifically EU |
17:46:53 | icyphox | heh |
17:46:56 | narimiran | hehehe |
17:46:57 | FromGitter | <alehander92> ireland!! |
17:46:59 | FromGitter | <alehander92> malta |
17:47:06 | FromGitter | <alehander92> english is still active |
17:47:48 | bung | what's `$` called in jsgen ? |
17:48:22 | FromGitter | <alehander92> probably a magic |
17:48:30 | FromGitter | <alehander92> look for lib/sys/jssys |
17:48:36 | FromGitter | <alehander92> or something like jssys somewhere |
17:48:38 | FromDiscord | <Vindaar> (just found the stupid cause for that bug up there... passing a template as a proc is a bad thing to do..) |
17:49:10 | * | debased joined #nim |
17:49:18 | leorize[m] | shouldn't `$` still be called `dollar`? |
17:49:21 | leorize[m] | in jsgen |
17:49:44 | * | debased quit (Client Quit) |
17:49:47 | FromGitter | <alehander92> i am not sure |
17:49:50 | FromGitter | <alehander92> how its implemented |
17:49:59 | FromGitter | <alehander92> but it might be a function that emits |
17:50:07 | * | debased joined #nim |
17:50:35 | bung | looks like all call from reprjs.nim ? |
17:52:57 | bung | `genRepr` in jsgen.nim |
17:57:56 | FromDiscord | <SirJosh> and a side question - i was reading that apparently i must explicitly do `new [T]()` in order to allocate it on the heap? do i even need to worry about the above situation? |
17:57:57 | FromDiscord | <SirJosh> sent a code paste, see https://play.nim-lang.org/#ix=2rNE |
17:59:01 | FromDiscord | <SirJosh> (edit) 'https://play.nim-lang.org/#ix=2rNE' => 'https://play.nim-lang.org/#ix=2rNF' |
17:59:05 | leorize[m] | when you use inheritance & dynamic dispatching, ref is pretty much a requirement |
17:59:07 | FromDiscord | <SirJosh> (edit) 'https://play.nim-lang.org/#ix=2rNF' => 'https://play.nim-lang.org/#ix=2rNG' |
18:01:07 | leorize[m] | it seems to me that the way you're trying to implement this is pretty much excessive |
18:01:14 | FromDiscord | <SirJosh> if i use `ref object` though that means everything goes on the heap unfortunately, right? |
18:01:21 | FromDiscord | <Recruit_main707> yes |
18:01:23 | leorize[m] | yep |
18:01:31 | FromDiscord | <SirJosh> dang |
18:01:34 | * | marnix joined #nim |
18:01:41 | FromDiscord | <Recruit_main707> could generics do? |
18:01:55 | leorize[m] | can you describe your problem? maybe there's a better way to solve this without the need of inheritance and dynamic dispatching |
18:02:00 | FromDiscord | <SirJosh> if generics can behave similarly, absolutely |
18:02:07 | FromDiscord | <SirJosh> sure i'll try to explain a little bit |
18:02:26 | FromDiscord | <SirJosh> so basically for nim practice i wanna write a little scripting thing or something, idk |
18:02:30 | FromDiscord | <SirJosh> so i've got numbers and objects |
18:02:50 | FromDiscord | <SirJosh> i want numbers to just be a float and not on the heap if you use 'em |
18:02:54 | FromDiscord | <SirJosh> and objects can go on the heap |
18:03:12 | FromDiscord | <SirJosh> and then i wanna have methods that can deal with both kinds of number/object without code duplication |
18:03:31 | leorize[m] | sounds like a case for generics and/or object variant |
18:03:48 | leorize[m] | without some code describing I can't point you to the exact direction though :P |
18:03:58 | FromDiscord | <SirJosh> problem is i'd need dynamic dispatch because i thikn there'll be scenarios where i can't know for sure if i have something that is a number or an object |
18:04:02 | disruptek | doesn't even sound like you need variants. |
18:04:09 | disruptek | the compiler knows. |
18:04:36 | leorize | yea, the types sound like they would be resolved at compile time |
18:04:42 | FromDiscord | <SirJosh> but it may not know |
18:04:51 | leorize | without code I can't tell :P |
18:04:54 | FromDiscord | <SirJosh> like if i have a list of numbers or objects |
18:05:09 | leorize | if your list only have one type then it should still work |
18:05:10 | FromDiscord | <SirJosh> ill try to type up something |
18:06:09 | disruptek | toys are only useful when they sharpen the thinking about the problem. don't try to invent something you will fail to represent in nim just to "learn nim." |
18:07:43 | Yardanico | @SirJosh object variants can still be used with "runtime dispatch" |
18:07:45 | bung | without for loop it even generate no code for a pramerter of seq[enum] |
18:07:50 | Yardanico | since you can branch code based on their kind |
18:07:53 | Yardanico | on runtime |
18:08:08 | FromDiscord | <Shucks> ``` Building Nim 1.2.4↵ Compiler: Already built↵ Tools: Already built``` |
18:08:22 | FromDiscord | <Shucks> Could I force choosenim to rebuild everything? Or how could I understand this |
18:08:36 | FromDiscord | <SirJosh> sent a code paste, see https://play.nim-lang.org/#ix=2rNK |
18:08:49 | Yardanico | @SirJosh yes this is entirely possible with object variants |
18:08:53 | FromDiscord | <SirJosh> ooo |
18:09:01 | leorize | Araq: can arc/orc do pointer sharing across thread now or do we still have to move them? |
18:09:31 | shashlick | @Shucks - what's the concern with the prebuilt tools |
18:09:41 | leorize | @SirJosh in fact JsonNode probably already have what you want :P |
18:10:02 | leorize | well except that JsonNodes are ref type :P |
18:10:09 | * | bung quit (Quit: Lost terminal) |
18:10:16 | FromGitter | <machineko> Are there any arm docker builds for nim? |
18:10:21 | FromDiscord | <Shucks> Ohhh. It downloads the prebuilt package. Just thought it is using some old stuff which it found on my machine. |
18:10:45 | leorize | @machineko no, but there are nightlies binary build that you can use |
18:10:45 | FromDiscord | <SirJosh> object variants looks good, i'll go experiment with 'em :D |
18:10:49 | FromDiscord | <SirJosh> tyty |
18:11:17 | FromDiscord | <SirJosh> wait one question about variants |
18:11:39 | FromDiscord | <SirJosh> <https://nim-lang.org/docs/tut2.html#object-oriented-programming-object-variants>↵here Node is a `ref object` and i'm trying to have some of the objects not be ref objects to prevent allocating them on the heap |
18:11:41 | leorize[m] | @machineko these nightlies should run as long as the os/architecture is compatible: https://github.com/alaviss/nightlies/releases |
18:11:52 | FromGitter | <machineko> Thanks i |
18:11:55 | Yardanico | @SirJosh yeah it doesn't really have to be a ref object unless you have direct recursion |
18:11:57 | FromGitter | <machineko> ill get nightlies |
18:12:06 | FromDiscord | <SirJosh> ah |
18:12:19 | FromDiscord | <SirJosh> would having a Table[string, BaseThing] count as direct recursion? |
18:12:20 | leorize[m] | remind me to upstream new nightlies this weekend :P |
18:12:28 | FromDiscord | <SirJosh> nvm i'll try it and see |
18:12:31 | FromDiscord | <SirJosh> ty |
18:12:34 | Yardanico | no, it won't |
18:12:37 | Yardanico | since Table uses sequences |
18:12:48 | Yardanico | internally for storing data |
18:12:51 | leorize[m] | @SirJosh direct recursion is when you want to store the type within the type itself |
18:13:17 | FromDiscord | <SirJosh> i was thinking that the table contains references to the type itself but if seqs are heap allocated then it shouldn't be a problem |
18:13:21 | Yardanico | yes |
18:13:40 | Yardanico | https://play.nim-lang.org/#ix=2rNM |
18:14:14 | Yardanico | in fact Nim's own compiler uses object variants for the AST |
18:14:40 | leorize | NimNodes use reference semantics though :P |
18:15:26 | Yardanico | @SirJosh check the link for your adapted to object variants example :P |
18:15:40 | FromDiscord | <SirJosh> yee i saw |
18:15:44 | FromDiscord | <SirJosh> ty i'll go have fun with these now :D |
18:16:12 | Yardanico | did anyone make a macro for object variants to separately define implementations for different kinds? |
18:16:19 | Yardanico | e.g. to split the $ procedure in my example |
18:16:30 | Yardanico | I mean it's totally possible, just asking if someone already did this |
18:16:46 | FromDiscord | <Clyybber> nope, but its the first step for library OOP |
18:16:50 | FromDiscord | <Clyybber> do it :D |
18:17:32 | FromGitter | <bung87> use dot operator can do that |
18:17:40 | Yardanico | for what exactly? |
18:18:09 | FromGitter | <bung87> did anyone make a macro for object variants to separately define implementations for different kinds? |
18:18:20 | Yardanico | yes, dot operator isn't for that |
18:18:24 | Yardanico | I don't see how it would help here really |
18:18:39 | Yardanico | only to avoid the "different object kinds - different field names" issue maybe |
18:19:17 | * | synshroud joined #nim |
18:19:42 | * | synshroud_ quit (Ping timeout: 260 seconds) |
18:21:31 | FromGitter | <bung87> I use it combine with converter to basic type and check differient methods compiled |
18:22:30 | leorize[m] | !repo patty |
18:22:31 | disbot | https://github.com/andreaferretti/patty -- 9patty: 11A pattern matching library for Nim 15 185⭐ 9🍴 |
18:22:36 | Yardanico | well yes, but it's different |
18:23:12 | Yardanico | MWAHAHHA |
18:23:18 | leorize | the only part of patty that's interesting is the ability to construct object variants in Haskell-style |
18:23:34 | FromGitter | <bung87> ok I prepare to sleep |
18:23:40 | Yardanico | https://play.nim-lang.org/#ix=2rNR |
18:23:47 | Yardanico | I think I can even reuse the proc syntax |
18:23:55 | Yardanico | see how I have MyBaseType(Number) |
18:24:07 | Yardanico | it's correct nim syntax so the macro can happily accept it :D |
18:24:27 | leorize | `{}` also works |
18:24:39 | Yardanico | well that's arleady used for AST overloading :) |
18:24:55 | leorize | ? |
18:24:58 | Yardanico | https://nim-lang.org/docs/manual_experimental.html#ast-based-overloading |
18:25:54 | leorize[m] | ah yea |
18:26:26 | leorize[m] | it's also used for nimnode overloading :P |
18:26:31 | Yardanico | i know |
18:26:33 | Yardanico | https://play.nim-lang.org/#ix=2rNT |
18:27:00 | leorize | perfect reason to abuse it :P |
18:27:25 | Yardanico | same for macros |
18:27:26 | * | Sembei quit (Quit: WeeChat 2.8) |
18:27:27 | Yardanico | see https://github.com/Yardanico/nim-strenc/blob/master/src/strenc.nim |
18:27:43 | Yardanico | although sadly it doesn't work for bigger projects |
18:27:49 | leorize | yep, that kind of usage is deprecated though |
18:28:02 | leorize | cligen use that scheme too (or maybe not anymore) |
18:29:58 | leorize | anyone want to try making a enum-style object variant macro? |
18:30:08 | Yardanico | like what? |
18:30:18 | leorize | like patty.variant but make use of typesection macros |
18:32:59 | FromDiscord | <Recruit_main707> maybe `discard` works, its similar to python's `pass` |
18:33:05 | Yardanico | for what? |
18:33:15 | FromDiscord | <KingDarBoja> discard |
18:33:19 | FromDiscord | <SirJosh> oh yeah discard seems to work that's cool |
18:33:30 | FromDiscord | <KingDarBoja> Yesss |
18:33:37 | FromDiscord | <KingDarBoja> Join Object Variants Team |
18:33:39 | Yardanico | idk why @SirJosh's message from discord wasn't sent by the bridge |
18:33:40 | Yardanico | weird |
18:33:47 | FromDiscord | <SirJosh> rip |
18:33:58 | FromDiscord | <KingDarBoja> _this message was sponsored by the OV gang_ |
18:35:39 | leorize | alehander92/gara#5 <- I'm interested in seeing how this can be done with the kind of macros we have nowadays :P |
18:36:05 | Yardanico | !repo gara |
18:36:06 | disbot | https://github.com/alehander92/gara -- 9gara: 11 15 71⭐ 7🍴 |
18:36:35 | leorize | !search macro to gnerate variant objects |
18:36:36 | disbot | no results 😢 |
18:36:39 | leorize | !search macro to generate variant objects |
18:36:41 | disbot | https://github.com/alehander92/gara/issues/5 -- 3Macro to generate variant objects 7& 15 more... |
18:39:46 | FromDiscord | <Zachary Carter> shader hot reloading https://media.discordapp.net/attachments/371759389889003532/733392446305730600/anim.gif |
18:40:26 | Yardanico | what editor is that? |
18:40:29 | Yardanico | vim or emacs? |
18:40:32 | disruptek | kak |
18:40:39 | Yardanico | huh |
18:40:44 | Yardanico | kakoune? |
18:40:49 | disruptek | yeah |
18:47:43 | FromDiscord | <Clyybber> best editor :D |
18:48:58 | Yardanico | you use it @Clyybber ? |
18:48:59 | Yardanico | for nim? |
18:49:37 | FromDiscord | <Clyybber> yeah |
18:49:49 | Yardanico | nice, with nimlsp or how? for nim syntax highlighting and other stuff |
18:50:02 | FromDiscord | <Clyybber> nothing :p |
18:50:05 | Yardanico | wat |
18:50:10 | FromDiscord | <Clyybber> I actually wanted to try nimlsp today |
18:50:19 | FromDiscord | <Clyybber> but didn't get to it |
18:51:00 | FromDiscord | <Recruit_main707> cant judge considering i made myself a shitty syntax highlighter for visual studio and use it :P |
18:51:03 | FromDiscord | <Clyybber> oh, mind you theres still syntax highlighting because kakoune has a nim highlighter |
18:51:16 | Yardanico | seems like kakoune has an lsp client |
18:51:20 | FromDiscord | <Clyybber> yeah |
18:51:27 | FromDiscord | <Clyybber> thats what I wanted to try |
18:51:38 | FromDiscord | <Clyybber> @Zachary Carter are you using kak-lsp? |
18:53:02 | Yardanico | wow |
18:53:07 | Yardanico | it's really nice |
18:53:11 | Yardanico | shows help for commands you input |
18:53:25 | Yardanico | I mean kakoune |
18:53:33 | FromDiscord | <Clyybber> yeah kakoune is great |
18:53:34 | FromDiscord | <Zachary Carter> I am - but it's not working for me atm |
18:53:39 | Yardanico | ill try |
18:53:40 | FromDiscord | <Clyybber> oh ok |
18:53:44 | FromDiscord | <Zachary Carter> I know @Solitude has it working |
18:53:47 | FromDiscord | <Clyybber> I wish leorize would be using kakoune |
18:53:51 | FromDiscord | <Clyybber> @Zachary Carter yeah |
18:56:05 | FromDiscord | <sealmove> If I have a Nim expression as a NimNode, is it possible to obtain its type? The one that Nim would infer if you would do `let x = thatExpression`. |
18:56:29 | FromDiscord | <Clyybber> is the nimnode untyped? |
18:56:48 | FromDiscord | <Clyybber> then you should be able to generate an untyped ast that looks like your example and generate a macro call on that |
18:56:53 | FromDiscord | <Clyybber> which would have typed input |
18:57:04 | FromDiscord | <Clyybber> in which you could then see the type |
18:57:21 | leorize | Clyybber: I used to use kakoune, but it's too limited for my taste |
18:57:38 | leorize | maybe it's expanded now and worth another try |
18:58:05 | FromDiscord | <Clyybber> its pretty barebones unconfigured |
18:58:39 | FromDiscord | <Clyybber> but there are a bunch of nice plugins |
19:00:53 | FromGitter | <sealmove> Clyybber: I don't want to just "see" the type, I need to obtain it as a string to use in some other code generation |
19:00:53 | Yardanico | kak-lsp seems to just work for me lol |
19:00:54 | Yardanico | with nim |
19:01:18 | leorize | it couldn't do semantics highlighting :p |
19:01:50 | leorize | and doesn't have sockets integration, so I dropped it in favor of neovim for writing nim.nvim |
19:01:50 | Yardanico | but nvim doesn't have that nice help when typing commands :P |
19:02:31 | * | audiophile_ joined #nim |
19:02:42 | leorize[m] | I got bored: https://play.nim-lang.org/#ix=2rO7 |
19:02:47 | FromDiscord | <Clyybber> cool I'm gonna setup kak-lsp then |
19:03:01 | Yardanico | leorize[m]: lol |
19:03:06 | Yardanico | well actually can be useful |
19:03:06 | FromDiscord | <Clyybber> @Yardanico https://github.com/occivink/kakoune-roguelight |
19:03:07 | FromDiscord | <Clyybber> :D |
19:03:10 | Yardanico | if your types export tons of stuff |
19:03:36 | FromDiscord | <Clyybber> leorize: lol why :D |
19:04:15 | leorize | I'm pretty sure 4raq would like something like this for the compiler, given how many fields it exports :P |
19:05:31 | FromDiscord | <Clyybber> leorize: Now make it a term rewriting macro |
19:05:43 | Yardanico | hahah |
19:05:53 | Yardanico | wait that can work? |
19:06:12 | leorize | maybe, but those stuff can be turned off so :P |
19:06:27 | Yardanico | leorize: any personal recommendations for good nvim plugins to "replicate" default vscode layout? |
19:06:39 | FromDiscord | <Clyybber> and then make a small shscript that puts --include payload.nim in you global nim.cfg |
19:06:39 | Yardanico | e.g. file/dir tree on the right, terminal bottom, and main window |
19:06:57 | Yardanico | terminal to be togglable of course |
19:07:15 | FromDiscord | <SirJosh> sent a code paste, see https://play.nim-lang.org/#ix=2rO9 |
19:07:18 | leorize | nope, I use barebones nvim :P |
19:07:28 | Yardanico | @SirJosh have them in the same type block |
19:07:30 | leorize | not too hard to setup something like that |
19:07:39 | leorize | narimiran probably have a setup |
19:07:42 | Yardanico | or try to use package-level types, although I don't know if anyone uses them |
19:08:07 | FromDiscord | <SirJosh> ah having them in the same type works, cool |
19:08:08 | FromDiscord | <SirJosh> ty |
19:08:23 | * | endragor joined #nim |
19:08:26 | FromDiscord | <Recruit_main707> coudnt code reordering just get all types into the same type↵... block and work? 🤔 |
19:08:36 | narimiran | sory, don't have a vscode-like setup |
19:08:44 | leorize | back when I was into the flashy ide style ctrl-p and nerdtree was popular |
19:08:47 | Yardanico | can you show a screenshot? :P narimiran |
19:08:54 | narimiran | of my nvim? |
19:08:54 | FromDiscord | <Clyybber> @Yardanico leorize: https://github.com/alexherbo2/kakoune.vim |
19:09:01 | Yardanico | narimiran: yes |
19:09:07 | narimiran | ok, give me a sec |
19:09:33 | leorize | @Clyybber lol |
19:10:53 | FromDiscord | <--HA--> Can I import a type and give it a different name? |
19:11:10 | leorize | sorta? :P |
19:11:15 | narimiran | Yardanico: here you go: https://imgur.com/t3FChKq |
19:11:23 | leorize | type NewName = OldName |
19:11:27 | leorize | jsut alias it over :P |
19:11:34 | * | vsantana quit (Quit: leaving) |
19:11:34 | Yardanico | narimiran: well yes that's something like I would want |
19:11:41 | Yardanico | and optional toggable file tree :D |
19:11:50 | Yardanico | what do you use for the terminal? |
19:11:58 | leorize | damn fancy 4k :) |
19:12:02 | narimiran | i just press `-` for the in-built file tree |
19:12:08 | narimiran | leorize: nope, 1440p |
19:12:18 | narimiran | terminal is also built-in |
19:12:30 | narimiran | 3440x1440 |
19:12:31 | leorize | still fancy, just not as fancy as disruptek 4k then :P |
19:12:31 | Yardanico | - ? |
19:12:39 | leorize | Yardanico: :h terminal |
19:13:18 | FromDiscord | <--HA--> leorize, how would that look like, an alias? I'm still new. |
19:13:19 | narimiran | yeah, `-` (minus, or dash) brings the built-in netrw |
19:13:25 | FromDiscord | <Clyybber> disruptek has 4k so that he can stresstest his font rendering at high scales :p |
19:14:10 | narimiran | Yardanico: if you want to get more fancy, there are plugins that give you directory tree on the left. it looks nice |
19:14:43 | narimiran | Yardanico: see http://vimcasts.org/ for some tips'n'tricks for (n)vim: http://vimcasts.org/ |
19:15:22 | * | endragor quit (Ping timeout: 256 seconds) |
19:15:41 | leorize | @--HA-- `import something; type NewName = something.TypeHere` |
19:17:24 | FromDiscord | <--HA--> leorize: cool, thanks! |
19:21:03 | leorize[m] | yw :) |
19:25:28 | * | marnix quit (Ping timeout: 246 seconds) |
19:31:51 | FromGitter | <alehander92> leorize the patty lib |
19:31:53 | FromGitter | <alehander92> has such a macro |
19:31:59 | FromGitter | <alehander92> i think it can be related |
19:32:02 | FromGitter | <alehander92> to a pragma today |
19:32:08 | * | marnix joined #nim |
19:32:12 | FromGitter | <alehander92> with type section macros |
19:37:40 | * | FromDiscord quit (Remote host closed the connection) |
19:37:42 | * | FromDiscord joined #nim |
19:40:13 | * | rockcavera joined #nim |
19:43:47 | * | marnix quit (Ping timeout: 240 seconds) |
19:48:54 | * | synshroud_ joined #nim |
19:50:17 | FromDiscord | <kodkuce> is prologe a thing now or still alpha 0.0001 |
19:51:13 | * | synshroud quit (Ping timeout: 264 seconds) |
19:58:11 | FromDiscord | <kodkuce> and is treeform/pg best async postgres atm? |
19:58:14 | * | oriba joined #nim |
19:59:24 | leorize | @alehander92 I know, just not sure if it's good enough |
19:59:58 | leorize | type section macros have pretty severe limitations |
20:00:06 | FromDiscord | <Shucks> Since vim is a topic atm. Im using async complete. Does anybody know how I could force it to let the suggestion open till im done with the line? The issue I got is that I forget everytime what arguments my called function takes. https://prnt.sc/tj6e8z |
20:10:24 | FromDiscord | <Clyybber> leorize: Do you have ideas on how to improve typesection macros? |
20:20:07 | * | vesper11 quit (Ping timeout: 260 seconds) |
20:21:15 | * | vesper11 joined #nim |
20:22:35 | FromGitter | <ynfle> How can I implement something similar `debugEcho` that can be used in a `func` that writes to `stderr` |
20:22:48 | * | marnix joined #nim |
20:23:21 | FromGitter | <alehander92> can you try to just write a func |
20:23:31 | FromGitter | <alehander92> and use `{.effects: [].}: code` |
20:23:32 | FromGitter | <alehander92> inside |
20:26:51 | FromGitter | <ynfle> Doesn't work |
20:27:08 | FromDiscord | <Clyybber> ynfile: You have to put the code that isn't actually sideeffect free inside a {.noSideeffects.}: block |
20:28:20 | FromGitter | <alehander92> ahh sorry^ |
20:29:14 | * | marnix quit (Ping timeout: 240 seconds) |
20:29:36 | FromGitter | <matrixbot> `lessneek` om nom nom nom |
20:33:28 | FromGitter | <ynfle> It's {.noSideeffect.} (no "s" at the end) |
20:35:00 | FromDiscord | <Clyybber> ah right :D |
20:38:05 | FromGitter | <ynfle> Thanks!! |
20:39:22 | * | hyiltiz_ quit (Ping timeout: 260 seconds) |
20:46:54 | FromGitter | <iffy> In a macro, holding a NimNode, how do I get a string version of the source code for that NimNode? Not the *Repr procs, but something that spits out Nim |
20:48:05 | FromGitter | <sealmove> there is a proc |
20:48:29 | FromGitter | <sealmove> toStrLit |
20:49:45 | FromGitter | <sealmove> If you do `myNode.repr` you get the concrete code as string. `toStrLit` just wraps that in a node. |
20:51:30 | FromGitter | <iffy> Perfect, thank you! |
20:54:25 | * | haxscramper quit (Remote host closed the connection) |
21:01:34 | leorize[m] | @Clyybber timothee already outlined some valid points in his issue |
21:02:58 | FromGitter | <iffy> If I remove the second macro definition (the one not used), there's no error: https://play.nim-lang.org/#ix=2rOJ Any ideas what I'm doing wrong? |
21:08:07 | FromDiscord | <Varriount> leorize: Do you have a link to that issue? |
21:08:46 | leorize[m] | !issue type macro |
21:08:47 | * | hyiltiz joined #nim |
21:08:47 | * | hyiltiz quit (Changing host) |
21:08:47 | * | hyiltiz joined #nim |
21:08:47 | disbot | https://github.com/nim-lang/Nim/issues/14923 -- 3varargs[typed] isn't passed properly through template 7& 29 more... |
21:09:48 | leorize[m] | #13830 |
21:09:50 | disbot | https://github.com/nim-lang/Nim/issues/13830 -- 3`macro pragmas` in type section should apply to `TypeSection`, not `TypeDef` ; snippet at 12https://play.nim-lang.org/#ix=2rOP |
21:17:10 | * | Jesin quit (Quit: Leaving) |
21:18:06 | FromDiscord | <Clyybber> I feel like they shouldn't apply to typeSection either |
21:18:44 | FromDiscord | <Clyybber> If you want that just pass a typesection to it |
21:19:04 | * | synshroud joined #nim |
21:19:13 | * | narimiran quit (Ping timeout: 246 seconds) |
21:20:37 | * | synshroud_ quit (Ping timeout: 264 seconds) |
21:23:27 | leorize | @Clyybber: it's about seamless integration |
21:23:51 | leorize | there's too little that you can do within a typesection context |
21:24:10 | FromGitter | <ynfle> @iffy, the second macro needs to accept a string type as the first agrument |
21:26:33 | FromDiscord | <Rika> how do i force uninstall a package in nimble even if it's being depended on? |
21:26:54 | leorize | just uninstall everything it depends on? |
21:27:00 | FromDiscord | <Rika> without that |
21:27:09 | FromDiscord | <Rika> i'm trying to replace the version |
21:27:22 | leorize | go to the nimble package folder and just rm -rf it out of the world |
21:27:30 | leorize | nimble doesn't use any database other than the fs layout |
21:27:30 | FromDiscord | <Clyybber> leorize: I think allowing consts in typesections would be a better option |
21:27:41 | FromDiscord | <Rika> ah okay thats nice to know |
21:27:52 | leorize | @Clyybber that sounds kinda stupid |
21:28:16 | leorize | also we would want to generate functions too, and the typesection context doesn't do us any favor here |
21:28:18 | FromDiscord | <Clyybber> why? |
21:28:26 | FromDiscord | <Clyybber> ah |
21:28:53 | FromDiscord | <Clyybber> fair point |
21:28:57 | * | nikita` quit (Quit: leaving) |
21:29:22 | FromDiscord | <Clyybber> but having each type macro be able to split the typesections and add proc declarations and all that jazz sounds really bad to me |
21:29:51 | FromDiscord | <Clyybber> it would also break type forward declaration |
21:29:58 | leorize | for nim-final for example, you can enforce the use of the setter/getter by generating the field symbol as a genSym then generate the normal setter/getter |
21:30:28 | leorize | that obviously doesn't work if you can't generate procs :P |
21:30:52 | FromDiscord | <Clyybber> yeah |
21:30:57 | leorize | @Clyybber I think we just gotta fix type forward decl :P |
21:31:25 | FromDiscord | <Clyybber> fair enough. I've been thinking of doing an actual topological sort |
21:31:33 | FromDiscord | <Clyybber> instead of the 3pass approach we do rn |
21:31:39 | FromDiscord | <Clyybber> since it would allow us to get rid of tyAlias |
21:32:16 | leorize | simpler is better :P |
21:32:36 | FromDiscord | <Clyybber> for sure |
21:32:53 | FromDiscord | <dom96> > nimble doesn't use any database other than the fs layout↵@leorize[IRC]#0000 that's not true. It unfortunately does 🙂 |
21:33:01 | FromDiscord | <dom96> There is a JSON file storing the reverse deps |
21:33:13 | FromDiscord | <Clyybber> maybe theres a way to get rid of tyAlias without topological sorting, but I don't know how (yet?) |
21:33:25 | leorize | @Clyybber also that sounds like it'd help with recursive modules if we ever got them in the future |
21:33:34 | * | tane_ quit (Quit: Leaving) |
21:34:17 | leorize | @dom96 ah I stand corrected then :P |
21:35:30 | FromDiscord | <Clyybber> leorize: Yeah, possibly |
21:39:42 | FromDiscord | <Technisha Circuit (LGBTQIAP+)> Making an interpreted lang in Nim is definitely doable, but is it practical? |
21:40:02 | * | hyiltiz quit (Ping timeout: 260 seconds) |
21:40:09 | Yardanico | why not? |
21:40:17 | FromDiscord | <Technisha Circuit (LGBTQIAP+)> Just wondering :P |
21:40:39 | FromDiscord | <Technisha Circuit (LGBTQIAP+)> ~~If you wanted to know, the interpreted lang will have braces-~~ |
21:40:53 | Yardanico | some of them don't |
21:40:56 | Yardanico | a lot of them don't |
21:41:03 | Yardanico | https://min-lang.org/ http://sprylang.se/ |
21:41:04 | Yardanico | just examples |
21:41:12 | Yardanico | but really the language of implementation doesn't matter *that* much |
21:41:25 | FromDiscord | <Technisha Circuit (LGBTQIAP+)> Oo |
21:41:34 | Yardanico | although it depends on the purpose of your language |
21:41:51 | Yardanico | do you want it for games, for scripting, for some numerical calculations, etc? |
21:42:25 | leorize | note that Nim can be interpreted too |
21:42:37 | FromDiscord | <Technisha Circuit (LGBTQIAP+)> I know |
21:42:41 | Yardanico | and it's written in nim |
21:42:45 | Yardanico | and it works |
21:42:51 | FromDiscord | <Technisha Circuit (LGBTQIAP+)> Yeah |
21:42:54 | FromDiscord | <Technisha Circuit (LGBTQIAP+)> It's NimScript |
21:42:55 | FromDiscord | <Technisha Circuit (LGBTQIAP+)> Right? |
21:43:04 | Yardanico | well technically yes |
21:43:06 | FromDiscord | <Technisha Circuit (LGBTQIAP+)> The VM for Nim |
21:43:12 | FromDiscord | <Technisha Circuit (LGBTQIAP+)> Is the actual interpreter |
21:43:15 | FromDiscord | <Technisha Circuit (LGBTQIAP+)> Right? |
21:43:19 | leorize | yep |
21:43:23 | FromDiscord | <Technisha Circuit (LGBTQIAP+)> Coolio |
21:43:23 | Yardanico | I don't think the VM itself is called "nimscript" though |
21:43:30 | FromDiscord | <Technisha Circuit (LGBTQIAP+)> Yeah |
21:47:13 | Yardanico | i also did some of http://www.craftinginterpreters.com/ implementation but it's a bit abandoned right now |
21:47:46 | Yardanico | I almost finished (except the inheritance and after that) chapter for Java (in Nim), and after that I did the second part of the book in Nim too, but it's just the barebones |
21:47:52 | Yardanico | need to finish it |
21:47:55 | FromDiscord | <Technisha Circuit (LGBTQIAP+)> Oh? |
21:48:02 | FromDiscord | <Technisha Circuit (LGBTQIAP+)> Nice |
21:48:08 | Yardanico | https://github.com/Yardanico/nim-lox there's an old branch |
21:48:25 | Yardanico | it's not that nice because I translated java code to nim most of the time basically |
21:48:33 | Yardanico | well, not literally, of course I did something a bit differently |
21:48:48 | FromDiscord | <Technisha Circuit (LGBTQIAP+)> Oh |
21:48:54 | FromDiscord | <Technisha Circuit (LGBTQIAP+)> What's Lox? |
21:48:58 | Yardanico | a language in http://www.craftinginterpreters.com/ |
21:49:09 | Yardanico | did you read that page at least? :P |
21:49:49 | FromDiscord | <Technisha Circuit (LGBTQIAP+)> Wait |
21:49:51 | FromDiscord | <Technisha Circuit (LGBTQIAP+)> Oof- |
21:50:40 | FromDiscord | <Technisha Circuit (LGBTQIAP+)> Nothing about Lox there though |
21:50:51 | Yardanico | http://www.craftinginterpreters.com/the-lox-language.html |
21:51:13 | FromDiscord | <Technisha Circuit (LGBTQIAP+)> Oh okay |
21:52:42 | FromDiscord | <Technisha Circuit (LGBTQIAP+)> Looks good |
21:59:36 | * | oriba quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
22:19:37 | * | hyiltiz joined #nim |
22:19:37 | * | hyiltiz quit (Changing host) |
22:19:37 | * | hyiltiz joined #nim |
22:22:03 | * | solitudesf quit (Ping timeout: 265 seconds) |
22:23:23 | FromDiscord | <Shucks> Could I check which part makes my binary that big? I feel like its way to heavy for what im doing. |
22:23:28 | FromDiscord | <Shucks> size* |
22:24:40 | FromDiscord | <Rika> use strip and upx if you want to make it smaller w/o changing anything |
22:25:06 | FromGitter | <alehander92> binary profiling |
22:25:14 | FromGitter | <alehander92> huh .. why don't we do this |
22:25:33 | FromDiscord | <Rika> because most of the time it doesnt matter 😛 |
22:25:38 | FromDiscord | <Technisha Circuit (LGBTQIAP+)> If you're on linux a tip is to do `strip theFile` |
22:25:38 | FromGitter | <alehander92> https://github.com/google/bloaty |
22:25:41 | FromDiscord | <Rika> and most of the time strip + upx does the job |
22:25:42 | FromGitter | <alehander92> ok it exists |
22:25:47 | FromDiscord | <Technisha Circuit (LGBTQIAP+)> What's upx? |
22:25:49 | FromGitter | <alehander92> i see |
22:25:51 | FromDiscord | <Rika> https://github.com/upx/upx |
22:26:08 | FromDiscord | <Technisha Circuit (LGBTQIAP+)> Oo |
22:26:11 | FromDiscord | <Technisha Circuit (LGBTQIAP+)> Thanks! |
22:26:11 | FromDiscord | <Rika> it compresses further than strip does |
22:26:16 | FromGitter | <alehander92> but noo |
22:26:22 | FromGitter | <alehander92> the problem is to *see* what bloats it |
22:26:23 | FromDiscord | <Rika> last time i used it i got half size of just strip |
22:26:35 | FromGitter | <alehander92> that's why profiling might be useful |
22:27:14 | FromDiscord | <Rika> if you run strip then you know whether whatever strip removes is bloating your exec or not |
22:27:48 | FromGitter | <alehander92> no |
22:27:52 | FromGitter | <alehander92> i think a profiler can do more |
22:27:59 | FromGitter | <alehander92> e.g. show you which of your generic functions |
22:28:04 | FromGitter | <alehander92> has many copies etc |
22:28:12 | FromGitter | <alehander92> so you can do some source changes |
22:28:28 | FromGitter | <alehander92> its a bit like optimziers vs profiling |
22:28:35 | FromGitter | <alehander92> optimizers can remove just what they can prove |
22:28:41 | FromGitter | <alehander92> or maybe assume |
22:28:43 | FromDiscord | <Shucks> Well yea I could pack it up. It's not like I even care about the size. Im just wondering why it's that big. |
22:31:04 | FromDiscord | <Shucks> most antivirus' don't like upx btw |
22:31:13 | FromDiscord | <Shucks> or atleast some of them |
22:31:24 | * | hyiltiz quit (Quit: hyiltiz) |
22:31:45 | FromDiscord | <Rika> yeah upx also degrades performance sometimes |
22:33:16 | FromDiscord | <Shucks> well strip actually halved the size ^.^ |
22:34:01 | FromDiscord | <Rika> anyway yeah bloaty |
22:36:58 | * | hyiltiz joined #nim |
22:36:58 | * | hyiltiz quit (Changing host) |
22:36:58 | * | hyiltiz joined #nim |
22:43:15 | Prestige | How would I go about having a table's key being a type? I.e. I declare a type Foo, then myTable[Foo] = bar |
22:43:50 | FromDiscord | <lqdev> not possible afaik |
22:43:50 | FromDiscord | <Rika> that should be fine |
22:43:52 | FromDiscord | <Rika> provided |
22:43:55 | FromDiscord | <Rika> you have a hash proc |
22:43:59 | FromDiscord | <lqdev> ah yeah |
22:44:07 | FromDiscord | <lqdev> you can make a hash proc for types with some macro magic |
22:44:13 | FromDiscord | <Rika> `proc hash*(t: Type): Hash`, import `hashes` |
22:44:24 | FromDiscord | <Rika> you dont need macro magic if you want to implement it manually |
22:44:27 | Yardanico | you can't store a type |
22:44:29 | FromDiscord | <lqdev> see https://nim-lang.org/docs/macros.html#signatureHash%2CNimNode |
22:44:30 | Yardanico | Prestige: you don't need a table for that |
22:44:32 | FromDiscord | <Rika> ah |
22:44:32 | Yardanico | you can just use an enum |
22:44:33 | FromDiscord | <Rika> a type |
22:44:39 | Yardanico | if you want type -> something |
22:44:48 | FromDiscord | <Rika> not a type sorry, i thought you meant an instance of a type |
22:44:50 | FromDiscord | <Shucks> I'm looking for a queue like array type which takes n items and discards the last one once its full and gets a new item. Any idea? |
22:44:53 | Yardanico | I mean you can make an enum with types you want or something |
22:45:29 | Prestige | Idk how I'd do it with an enum - it's supposed to support any type |
22:45:56 | Yardanico | but why a table? |
22:46:00 | Yardanico | what do you REALLY want?:) |
22:46:07 | Yardanico | seems a bit like an xy problem :P |
22:46:12 | Prestige | maybe I could hash a typedesc.. |
22:46:15 | Yardanico | no |
22:46:19 | Yardanico | they don't exist at runtime |
22:46:34 | FromDiscord | <Rika> im thinking you can make a macro `[]` that takes in a typedesc key and changes it to something else; of course this woild be compiletime only |
22:46:46 | Yardanico | yeah of course you can do that |
22:46:52 | Yardanico | e.g. use strings or something |
22:46:59 | Prestige | That should be fine I think |
22:47:03 | Yardanico | but I really think that this wouldn't be the right solution |
22:47:06 | FromDiscord | <Rika> it would be the best option if you really need the typedesc thing |
22:47:08 | Yardanico | just tell us what you're trying to do :D |
22:47:54 | Prestige | Have a mapping from any type to something, I'm experimenting with ecs |
22:48:17 | FromGitter | <alehander92> yeah you can use the name probably |
22:48:25 | FromGitter | <alehander92> but what is something |
22:48:28 | Prestige | Want to make a table[C, seq[components]] |
22:48:45 | FromGitter | <alehander92> is C inheriting from Base |
22:48:55 | FromGitter | <alehander92> can't you just have a method |
22:49:07 | Prestige | C is the component type |
22:49:30 | FromGitter | <alehander92> so you can have a generic function! |
22:49:46 | FromGitter | <alehander92> proc components*C (c: C): seq[C] = @[] |
22:49:58 | FromGitter | <alehander92> `proc components*[C](c: C): seq[C] = @[]` * |
22:50:23 | Prestige | I need to be able to look up the component seq by its type essentially |
22:50:40 | Yardanico | are you reimplementing runtime dispatch or wat? :D |
22:50:48 | FromGitter | <alehander92> yes, and you can do that with generic function and specialization |
22:50:52 | FromGitter | <alehander92> / overloading maybe |
22:51:12 | Prestige | Found this, looks interesting: https://github.com/yglukhov/variant/blob/master/variant.nim#L123 |
22:51:20 | FromGitter | <alehander92> that's the point of generics, think about it |
22:51:38 | FromGitter | <alehander92> to have type-level functions/lookup |
22:51:42 | FromGitter | <alehander92> i think |
22:51:59 | FromGitter | <alehander92> i think this is overengineering |
22:52:07 | FromGitter | <alehander92> for this particular usecase |
22:52:19 | FromGitter | <alehander92> (otherwise good idea) |
22:53:20 | Prestige | ah he has a lookup table for the Ids, interesting.. |
22:56:19 | FromDiscord | <Varriount> Hm, although I love Nim's focus on compile-time mechanisms, it's lack of standardized run-time mechanisms (like Go's interfaces) is something of a deficiency. |
22:56:38 | FromDiscord | <Rika> dynamic dispatch? |
22:57:10 | FromDiscord | <Varriount> Hm, true |
22:58:24 | FromDiscord | <Varriount> But without type embedding or multiple inheritance, it's limited. |
22:58:29 | Prestige | I might just need to use this lib lol |
23:01:38 | FromDiscord | <Varriount> @Rika I wonder how well the streams module would work if it used methods instead of a manual vtable |
23:10:30 | leorize[m] | probably not fast |
23:10:58 | Yardanico | especially not on arc :P |
23:15:02 | FromDiscord | <Shucks> do we got ringbuffers in the stdlib? |
23:15:17 | FromDiscord | <Shucks> well nvm |
23:15:23 | leorize | we don't have ring buffers |
23:15:55 | leorize | please contribute one to fusion if you ever write any :) |
23:16:09 | FromDiscord | <Shucks> https://github.com/megawac/RingBuffer.nim |
23:16:10 | FromDiscord | <Shucks> done ;p |
23:16:17 | * | Kaivo quit (*.net *.split) |
23:16:18 | * | def- quit (*.net *.split) |
23:16:44 | FromGitter | <alehander92> i think |
23:16:48 | FromGitter | <alehander92> i understood monads |
23:17:25 | FromGitter | <alehander92> it did click, thank Lord |
23:17:34 | FromGitter | <alehander92> it clicked |
23:17:59 | FromGitter | <alehander92> let me try |
23:19:16 | * | krux02_ joined #nim |
23:21:58 | * | krux02 quit (Ping timeout: 256 seconds) |
23:23:01 | * | Kaivo joined #nim |
23:23:01 | * | def- joined #nim |
23:24:23 | * | endragor joined #nim |
23:28:54 | * | endragor quit (Ping timeout: 240 seconds) |
23:32:30 | FromDiscord | <Shucks> Does `nimble install RingBuffer` work for anyone? |
23:32:36 | FromDiscord | <Shucks> guess the url is wrong |
23:34:21 | FromDiscord | <Rika> @Shucks try no caps |
23:35:10 | FromDiscord | <Shucks> didnt worked. Im pretty sure that can't work: `Downloading [email protected]:megawac/RingBuffer.nim.git using git` |
23:35:12 | * | hyiltiz quit (Ping timeout: 260 seconds) |
23:35:46 | FromDiscord | <Shucks> sent a code paste, see https://play.nim-lang.org/#ix=2rPi |
23:36:30 | FromDiscord | <Rika> ah ssh url |
23:37:42 | FromGitter | <deech> Is there an existing function that can add all the members of a sparse enum into a seq? `reprEnum` has the logic I need but I thought I'd ask in case I was missing something. |
23:38:30 | FromDiscord | <Shucks> https://github.com/megawac/RingBuffer.nim/blob/master/RingBuffer.nim#L15 |
23:38:33 | FromDiscord | <Shucks> guess that will also fail |
23:38:36 | FromDiscord | <Shucks> damn.. >.< |
23:38:48 | FromDiscord | <Rika> i mean its 5 years old |
23:38:48 | Yardanico | just use typed/untyped |
23:38:52 | FromDiscord | <Rika> you can probably yeah |
23:38:54 | FromDiscord | <Rika> fix it with that |
23:38:55 | Yardanico | instead of expr try typed |
23:38:58 | Yardanico | stmt = untyped |
23:39:03 | Yardanico | if won't work, make both untyped |
23:40:12 | FromDiscord | <Shucks> Some of you pro nim guys should code a proper one right now ;p |
23:40:18 | FromDiscord | <Shucks> but thanks. Gonna try to fix it up |
23:43:10 | * | krux02_ quit (Remote host closed the connection) |
23:44:01 | * | Trustable quit (Remote host closed the connection) |
23:51:30 | OMGOMG | https://forum.nim-lang.org/t/5349 is this still true, no documentation for testament? |
23:51:46 | FromDiscord | <Rika> ish |
23:51:56 | FromDiscord | <Rika> but testament isnt made for general library testing |
23:52:05 | FromDiscord | <Rika> afaik its specially made for testing the compiler |
23:52:56 | OMGOMG | https://nim-lang.org/docs/unittest.html literally the first sentence here suggests using testament instead |
23:53:10 | FromDiscord | <Rika> `The unittest module is not deprecated, at least not anytime soon. The amount of projects using it is huge, and there aren't many reasons to remove it afaik.` |
23:53:28 | FromDiscord | <Rika> it says consider, not switch to |
23:53:32 | FromDiscord | <Rika> you dont have to |
23:53:39 | FromDiscord | <Rika> and if you cant, it is fine |
23:53:46 | FromDiscord | <Rika> but if you can figure it out, then good |
23:54:57 | FromDiscord | <Technisha Circuit (LGBTQIAP+)> Is there a way to make a C function in Nim? |
23:55:08 | Yardanico | nim procedures *are* c functions |
23:55:19 | Yardanico | if you want to make a "c function" as in with default c types, etc |
23:55:25 | Yardanico | use {.exportc, cdecl.} for proc pragmas |
23:55:30 | OMGOMG | Rika: that's a pretty clear depreciation notice in my mind. but i'll give unittest a try, if that's what you recommend |
23:55:32 | Yardanico | and only use C types in arguments and in the return type |
23:55:37 | Yardanico | OMGOMG: it's not deprecated at all |
23:55:39 | FromDiscord | <Rika> OMGOMG: it is not |
23:55:49 | Yardanico | that sentence should be removed from unittest docs really |
23:55:52 | FromDiscord | <Rika> the line really needs to be reworded |
23:56:06 | FromDiscord | <Rika> time to git blame to see who wrote it 😉 |