<< 16-07-2020 >>

00:00:48FromGitter<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:35leorizeshouldn't you be very well aware of this given your involvement with generating nim code for kaitai struct? :P
00:07:38FromGitter<ynfle> Is there a repo to interact with the GitHub API?
00:07:45leorize!repo github
00:07:48disbothttps://github.com/disruptek/github -- 9github: 11github api v3 for nim 15 7⭐ 0🍴 7& 29 more...
00:07:59leorizeit's really... uh plain
00:08:07leorizebut it works if you want something quick 'n dirty
00:09:32FromDiscord<Varriount> Hm, how feasible would it be to make a machine-learning based SQL formatter?
00:09:51leorizewhy would you want it to be ML-based?
00:10:00leorizewell @mratsim can probably tell you :P
00:10:17FromDiscord<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:00FromDiscord<Varriount> The number of formatting "exceptions" when I write SQL is much higher than when I write other languages/data formats.
00:11:02leorizeyou can certainly make a lax formatter like nimpretty for that
00:11:25leorizealternatively you can stop writing sql :P
00:12:02leorizewrite a Nim DSL that writes SQL instead XD
00:16:04FromDiscord<Varriount> leorize: If only. 😔
00:16:43*endragor joined #nim
00:16:53disruptekplain 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:28FromDiscord<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:47FromDiscord<Anuke> the font file tested https://media.discordapp.net/attachments/371759389889003532/733121666804219964/font.ttf
00:47:50FromGitter<ynfle> What does `Error: unhandled exception: unable to find a supported scheme [IOError]` mean for @distruptek's `github` pkg
00:47:52FromGitter<ynfle> ?
00:51:48*krux02 joined #nim
00:53:23*krux02 quit (Remote host closed the connection)
00:53:58disruptekynfle: you probably need to build with ssl.
00:59:13FromDiscord<treeform> @Anuke you are not setting font size, svg might have a default font size I load at. `font.size = 14`
01:00:41FromGitter<ynfle> > *<disruptek>* @ynfle: you probably need to build with ssl. ⏎ ⏎ Thx
01:00:54disrupteknp
01:01:06FromDiscord<treeform> @Anuke see this test: https://github.com/treeform/typography/blob/master/tests/test.nim#L197
01:01:28FromDiscord<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:39FromDiscord<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:59FromDiscord<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:16disrupteki only use 3 things.
01:39:43*audiophile_ joined #nim
01:40:06FromDiscord<Shucks> The best last one was `:Sex`
01:40:11FromDiscord<Elegant Beef> Same↵esc esc :!code
01:40:14FromDiscord<Elegant Beef> 😄
01:40:46FromDiscord<Shucks> also [c]hange [i]n " was awesome ;D
01:40:50FromDiscord<Rika> you can just use :Se btw
01:41:26FromDiscord<Shucks> indeed
01:41:53FromDiscord<Shucks> But I'll prob won't forget :Sex
01:44:52disruptekcps local lifting is done but it doesn't work.
01:45:15FromDiscord<Rika> i use Vex more
01:48:49skrylar[m]almost done with this tlsf clone. wew
02:02:08FromDiscord<Varriount> disruptek: Howso?
02:02:59FromDiscord<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:31FromDiscord<Rika> vim has multiple cursors though
02:10:04disruptekvarrount: "done" is too strong a word, but it compiles.
02:10:12disruptekvarriount, too.
02:14:22FromDiscord<Avatarfighter> how is everyone doing today 😄
02:15:13disruptekgetting nervous about my monthly shower tomorrow.
02:15:21FromDiscord<Avatarfighter> LMAO
02:15:22FromDiscord<Elegant Beef> Thought it was annual
02:15:29FromDiscord<Elegant Beef> Cmon disruptek, be honest
02:15:39FromDiscord<Avatarfighter> imagine not taking showers every other decade
02:15:43disruptekthe rules are a little tougher up here close to canuckistan.
02:16:19FromDiscord<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:50FromDiscord<Technisha Circuit (LGBTQIAP+)> Anuken uses Nim?-
03:19:07FromDiscord<Technisha Circuit (LGBTQIAP+)> Nice-
03:22:02FromDiscord<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:54leorizeno
03:23:24leorizeunless nimpy initializes the python runtime at load you should be fine
03:23:52FromDiscord<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:08FromDiscord<SirJosh> sent a code paste, see https://play.nim-lang.org/#ix=2rKa
04:08:23FromDiscord<Elegant Beef> sequences are imutable
04:08:27FromDiscord<Elegant Beef> (edit) 'sequences are imutable ... ' => 'sequences are imutableif declared with let'
04:08:31FromDiscord<SirJosh> oh
04:08:31FromDiscord<Elegant Beef> (edit) 'imutable' => 'immutable'
04:08:37FromDiscord<SirJosh> ah so nim has proper immutability
04:08:40FromDiscord<SirJosh> that's good to hear
04:08:44FromDiscord<Elegant Beef> Yep
04:09:00FromDiscord<Elegant Beef> `var` is mutable `let` is immutable and `const` is a compile time constant
04:09:41leorizechange `let` -> `var` and the sequence will be mutable
04:10:00FromDiscord<Rika> Beef just explained that :P
04:12:04FromDiscord<Elegant Beef> I didi?
04:12:06FromDiscord<Elegant Beef> (edit) 'didi?' => 'did?'
04:25:59icyphoxany reason why the Nim forum needs Google Analytics? it's non-free and doesn't belong in a FOSS project, i feel.
04:27:48leorizefor analytics purposes
04:28:04leorizefun fact: I don't think we've ever looked at the resulting analytics
04:29:32*audiophile joined #nim
04:29:53leorizegoogle analytics is a simple and effective way to gather engagement data, which we can use to optimize the website experience
04:31:05leorizethere 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:57FromDiscord<Varriount> SirJosh: Though, it doesn't have quite the... complexity that C++ supports.
04:38:11FromDiscord<Varriount> For example, `let x = AReferenceType ; x.field = value` is legal.
04:38:33FromDiscord<Varriount> Because `let` only makes the reference itself constant, not the data it points to.
04:39:16FromDiscord<Elegant Beef> Which is also why our `func`s arent pure
04:40:25FromDiscord<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:53FromDiscord<Elegant Beef> Yea but for a pure function that side effect cant be allowed
04:41:12leorizeour definition of side effect does allow that kind of thing though
04:41:27FromDiscord<Varriount> Yeah, but a "pure" function is quite hard to actually prove.
04:41:40FromDiscord<Elegant Beef> Yea i'm mostly just pointing towards↵https://github.com/nim-lang/RFCs/issues/234
04:41:41disbotAdd write-tracking to Nim's func ; snippet at 12https://play.nim-lang.org/#ix=2pg3
04:41:52FromDiscord<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:40FromDiscord<Varriount> Hm, how would one implement a mock library in Nim?
04:59:48FromDiscord<Elegant Beef> What do you mean by "mock library"
05:00:12FromDiscord<Varriount> https://docs.python.org/3/library/unittest.mock.html
05:00:39FromDiscord<Varriount> Something that lets you check that appropriate actions were taken on a given value
05:03:03FromDiscord<Elegant Beef> Testing code is foriegn to me, so i'll defer to running away
05:08:27*narimiran joined #nim
05:17:31skrylar[m]they are usually tools that like, they intercept using an API and allow you to queue up fake responses
05:17:46skrylar[m]so you can say 'for this test, assume ohno() always returns true' or 'ohno() will first return true, then false'
05:18:39skrylar[m]also nice for stuff that relies on webshit because you can have it mock the replies from the external service
05:19:43bungthere's https://github.com/jiro4989/faker
05:21:03FromDiscord<Rika> that's something different afaik
05:22:11FromDiscord<Rika> mocks are basically "fake APIs" or "fake libraries" that simulate the real thing
05:22:47FromDiscord<Rika> ...i think
05:28:59FromDiscord<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:09FromDiscord<impbox> but maybe you could do similar compiletime hacks
05:39:01FromDiscord<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:21FromGitter<alehander92> you can generate
07:15:24FromGitter<alehander92> introspection code
07:15:29FromGitter<alehander92> with macros iirc
07:33:03*vicfred quit (Remote host closed the connection)
07:33:23*vicfred joined #nim
07:39:51icyphoxhas anyone built Nim from source on OpenBSD?
07:40:11icyphoxi'm getting a bunch of linker errors
07:40:16icyphoxld: error: undefined symbol: __builtin_bswap32
07:48:33lbarticyphox: at least me and euantor (if i'm not wrong with the nick)
07:48:58icyphoxah ok i think i have it running
07:49:07euantorYeah, I have
07:49:09icyphoxi looked at the ports/lang/nim Makefile
07:49:34euantorCheck out the .builds/openbsd.yml file for steps you can run from a shell to build from source
07:49:44icyphoxoh
07:49:46icyphoxneat
07:49:48leorize[m]icyphox: are you using clang?
07:50:12euantorAnd make sure to use devel as it sets clang as the compiler - gcc as shipped in base is too old a version
07:50:30icyphoxleorize[m]: no i set it to use egcc
07:50:40leorizeeuantor: does the config not default to clang when you're on bsd?
07:51:05leorizeif it doesn't then you should make it do so similar to osx
07:51:07icyphoxi basically did 'CC=egcc sh build.sh'
07:51:20leorizeicyphox: yea you need either a new gcc or clang
07:51:45icyphoxworks now. i'm koch'ing. :^)
07:56:18euantorleorize: it does in devel, yeah. Older versions don’t as the change wasn’t backported
08:10:54FromDiscord<Zed> hey prestige, you ever get around to using that nim_braces thins?
08:10:58FromDiscord<Zed> *thing
08:11:12FromDiscord<Zed> i tried using it but couldn't get used to it lol
08:20:50lbarticyphox: do you try to update the OpenBSD's port?
08:21:21icyphoxlbart: it's at 1.2 right?
08:21:31icyphoxbesides, i wanted the other tools like nimpretty
08:21:35*marnix joined #nim
08:21:37icyphoxwhich don't ship in the ports
08:22:32lbarticyphox: 1.2.0 yep
08:23:11lbartmaybe you can add the tools in the port too
08:23:13icyphoxbtw, is nimpretty just a linter or does it format code like python's black?
08:23:21icyphoxlbart: good idea. i'll submit a patch.
08:24:40lbarticyphox: you can take a look at what we do on FreeBSD (it's very close)
08:26:15FromDiscord<Varriount> @icyphox What compiler are you using, and what version?
08:26:40icyphox(e)gcc v8.3.0
08:29:14leorize[m]icyphox: nimpretty respects your choices, so not like python's black
08:29:30icyphoxah ok
08:29:46icyphoxbut does it affect the code, or just show you hints?
08:29:56icyphox(i ran it, didn't see any change)
08:31:44leorizeit does affect the code
08:31:58leorizebut if your code is reasonably sane then it won't do anything
08:32:42icyphoxah cool
08:33:07*oddp_ joined #nim
08:42:22icyphoxok now, has anyone tried cross-compiling for Linux x86_64 on OpenBSD?
08:53:18Araq"This post is archived and can no longer be edited" hmm
08:53:57leorize[m]it's a nim forum feature apparently
08:54:53Araqa new one. it's great but now I need to write a new post
08:57:01leorize[m]is this about arc?
08:57:30Araqyeah
08:57:43leorize[m]nice
09:03:28*Tongir joined #nim
09:04:13icyphoxhmm, 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:32Araqicyphox, 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:05icyphoxwow! that worked
09:08:08icyphoxthanks
09:13:20leorize[m]!repo nim-vcl
09:13:20disbothttps://github.com/ying32/nim-vcl -- 9nim-vcl: 11nim GUI test 15 1⭐ 0🍴
09:15:21leorize[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:57FromDiscord<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:47FromDiscord<Yardanico> Good morning
10:06:22*arecaceae quit (Remote host closed the connection)
10:08:34*arecaceae joined #nim
10:12:00FromDiscord<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:38FromDiscord<Yardanico> I think so, yes
10:26:25bungoh 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:27ForumUpdaterBotNew thread by Araq: Update on --gc:arc, see https://forum.nim-lang.org/t/6549
10:45:54FromDiscord<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:36bungws works pretty well
11:08:19*NimBot joined #nim
11:11:38*vsantana joined #nim
11:26:24bunghttps://github.com/nim-lang/Nim/issues/14891 this should close, their PR is merged.
11:26:26disbotnimpretty multiple file support
11:26:39narimiranindeed. 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:30FromDiscord<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:49FromDiscord<Clyybber> To get cursorified table.`[]` would have to return lent right?
11:35:59FromDiscord<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:25Prestige@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:30FromDiscord<Yardanico> There's a way to make it work though
12:57:35FromDiscord<Yardanico> Even with nimpretty
12:59:20FromDiscord<flywind> Hi, how can I wrap C++ dlls? I want to use opencv in Nim.
12:59:49FromDiscord<Yardanico> I think OpenCV would expose a C API, no?
12:59:55FromDiscord<Yardanico> as a shared library
13:00:54FromDiscord<flywind> C API seems to be deprecated.
13:02:29FromDiscord<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:51ForumUpdaterBotNew thread by Levlan: Beginner - Is there a Nim's similar to a Python dictionary?, see https://forum.nim-lang.org/t/6550
13:03:17FromGitter<gogolxdong> Table?
13:13:15FromDiscord<jasonfi> you can wrap C++ in C
13:13:20FromDiscord<jasonfi> if it comes to that
13:48:28*rockcavera quit (Remote host closed the connection)
13:57:38icyphoxso i'm writing this program with a bunch of sockets open simultaneosly
13:57:50icyphoxis there an elegant way to close all of them on exit
13:58:06icyphoxnote, they're not all accessible from a single place in the code
13:59:20Yardanicodamn leorize[m] neovim with your plugin is magic
14:00:06icyphoxwhat plugin
14:00:20icyphoxi need all nim plugins for vim
14:00:26Yardanicohttps://github.com/alaviss/nim.nvim
14:00:27Yardaniconeovim
14:00:39Yardanicoautocompletion, semantic syntax highlighting, go to definition, etc
14:00:43Yardanicofor nim :P
14:00:46icyphoxoh how did i not know this
14:01:00icyphoxi don't need zah/nim.vim then
14:01:02icyphoxepic
14:01:28Oddmongeri'm using zah too
14:01:49*waleee-cl joined #nim
14:02:43FromDiscord<Varriount> icyphox: https://nim-lang.org/docs/system.html#addQuitProc%2Cproc%29
14:02:57Yardanicoor try defer :DDDDDDDDDD
14:03:19FromDiscord<Varriount> Yardanico: will that work?
14:03:23*audiophile_ joined #nim
14:03:24Yardanicowhy not?
14:03:28icyphoxwhat does defer do
14:03:29Yardanicoit'll close the socket at the end of the scope
14:03:43icyphoxman i really need to rtfm
14:03:49Yardanicoicyphox: poor man's try: finally
14:03:50icyphoxit's been so long since i wrote any nim lol
14:03:55Yardanicohttps://nim-lang.org/docs/manual.html#exception-handling-defer-statement
14:04:37icyphoxamazing
14:04:42icyphoxthank you
14:05:07Yardanicocan't you just call socket.close() at the end of your procedures ?
14:06:56icyphoxhmm
14:07:30*audiophile_ quit (Read error: Connection reset by peer)
14:07:33icyphoxthat'll close it when it goes out of scope right
14:07:35icyphoxhmmmm
14:07:38Yardanicoyes
14:07:43Yardanicootherwise can't you just like
14:07:48Yardanicocreate a seq and add all sockets there
14:07:56icyphoxyeah good idea
14:07:57Yardanicoand at the end of the program iterate over the seq and close all sockets
14:08:11FromDiscord<juan_carlos> quitProc Deprecated.
14:08:40Yardanicoon devel
14:08:42Yardaniconot on stable
14:08:50FromDiscord<juan_carlos> Ye
14:08:52Yardanicoexitprocs doesn't exist on stable
14:09:08FromDiscord<juan_carlos> Ne
14:09:17icyphoxok weird. even after closing the socket, running it again gives me 'Address already in use'
14:09:30icyphoxnetstat shows the port in use
14:09:37Yardanicoleorize[m]: a question about your plugin (or neovim, I'm really new to vim)
14:09:56Yardanicohttps://i.imgur.com/i3aMFAb.png if here I press enter nothing happens :D
14:09:59Yardanicoit still shows the suggestion
14:11:23icyphoxleorize[m]: how can i disable folding? in nim.nvim
14:11:42Yardanicog:nim_fold
14:11:50Yardanicoor something
14:11:51icyphoxoh
14:11:54icyphoxdanke
14:11:57Yardanicohttps://github.com/alaviss/nim.nvim/commit/e8c173af9ee46065c80a4aa93759c3d3ef8d893e
14:12:07Yardanicoah wait it was removed :P
14:12:12Yardaniconeed to toggle foldenable
14:12:28Yardanicocan'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:28FromDiscord<Varriount> icyphox: Hm, that problem sounds familiar
14:12:49*lritter joined #nim
14:13:05icyphoxVarriount: the socket still being around problem?
14:14:19FromDiscord<Varriount> Yes
14:14:20FromDiscord<Recruit_main707> Cpp’s vectors have the same functionality as our sequences?
14:14:53FromDiscord<Varriount> icyphox: Though I can't find an issue describing it.
14:14:59*audiophile_ joined #nim
14:15:42FromDiscord<Varriount> icyphox: What's odd is that the OS should clean up sockets when the program exits
14:15:43FromDiscord<lqdev> icyphos: also, there's :set nofoldenable
14:15:51FromDiscord<lqdev> if you don't want folding at all
14:16:40FromDiscord<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:18icyphoxright yeah
14:17:57FromDiscord<Varriount> Unless Linux does something different? I use Windows mostly, so sometimes Linux-specific behaviors trip me up.
14:17:59icyphoxlqdev: thank you, that'll work
14:18:13icyphoxVarriount: i'm on OpenBSD... shouldn't be far too different i'd assume
14:19:28bungwhat's dollar proc called in jsgen ?
14:19:41FromDiscord<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:39icyphoxhmm
14:20:41icyphoxi'll have to see
14:20:52icyphoxthey close after a while though
14:20:58icyphoxit's just annoying
14:29:51icyphoxyo leorize[m], mate your plugin is great but wow does it cause some input lag
14:30:02Yardanicodoes it?
14:30:03icyphoxit's like a good 2s before anything i type registers on the screen
14:30:04icyphoxyeah
14:30:05Yardanicoit's all async
14:30:07icyphoxno idea why
14:30:11Yardanicofor me it's instant lol
14:30:16icyphoxwew
14:30:30Yardanicowdym by "registers"?
14:30:33Yardanicoshows on screen as in the letter?
14:30:37icyphoxyeah
14:30:39icyphoxthat
14:30:49icyphoxeach character i type takes 2s or more to show up
14:30:58YardanicoI don't think that's a nim.nvim issue, or you configured it wrong :D
14:31:12icyphoxbruh
14:31:28icyphoxok lemme see if i have to configure anything
14:33:45icyphoxok idk
14:33:55icyphoxsorry m8 zah it is for now
14:33:57icyphoxlol
14:34:06FromDiscord<Varriount> It might be nimsuggest
14:34:14*maier quit (Ping timeout: 240 seconds)
14:34:15icyphoxyeah i was wondering
14:34:51FromDiscord<Clyybber> is it only happening with the current file?
14:35:11icyphoxi tried it with just one file
14:38:20FromDiscord<--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:31FromDiscord<--HA--> There is no reverse `to` is there?
14:46:10Yardanico%*
14:46:13Yardanicoor just %
14:46:25Yardanicohttps://nim-lang.org/docs/json.html#creating-json
14:49:27icyphoxok on further inspection, it appears to be in the TIME_WAIT state
14:49:49icyphoxeven after having closed the socket...
14:49:52icyphoxmighty odd
14:55:50FromDiscord<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:11icyphoxrip
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:43FromDiscord<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:05FromGitter<ynfle> How would I write the equivalent of `debugEcho` that writes to `stderr` but has no sideEffects?
15:18:17FromDiscord<--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:11FromDiscord<Clyybber> Araq: https://github.com/nim-lang/Nim/pull/15002
15:22:13disbotShow if a variable is cursor in --expandArc
15:22:28Yardanicowe also need to fix cursor optimizer so it shows proper hints :P
15:22:32Yardanicowhen it made a cursor
15:22:37Yardanicopossibly under same Performance hint?
15:22:42FromDiscord<Clyybber> oh wdym?
15:22:44FromDiscord<Clyybber> it now shows it
15:22:47FromDiscord<Clyybber> in --expandArc
15:22:51Yardanicononono
15:22:54FromDiscord<Clyybber> with the PR I mean
15:22:57Yardanicolemme show what I mean
15:23:14Yardanicohttps://github.com/nim-lang/Nim/blob/devel/compiler/cursor_inference.nim#L102
15:23:25Yardanicoah wait it's when false
15:23:33Yardanicoahh
15:23:40Yardanico4raq disabled it when he merged the PR
15:23:42Yardanicosorry I was a bit confused
15:25:24FromDiscord<Clyybber> yeah
15:25:38FromDiscord<Clyybber> and I think its better to include that information in the --expandArc output
15:25:40Yardanicothen yeah, your PR would be good
15:25:40Yardanicoyes
15:25:57Yardanicowould it be possible to also allow expandArc for the whole module?
15:26:13Yardanicosometimes 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:27FromDiscord<Clyybber> hmm
15:27:38FromDiscord<Clyybber> you can show it for the module by putting in the modules name
15:27:49FromDiscord<Clyybber> but it won't show all the modules transformed procs
15:27:58FromDiscord<Clyybber> since injectdestructors is done on a per proc basis
15:28:07Yardanicooh hm
15:28:25Yardanicowell, it would show procs which were not removed by the DCE right?
15:28:47FromDiscord<Clyybber> no, it wouldn't show those who were transformed
15:28:50FromDiscord<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:51FromDiscord<Clyybber> like declarations
15:28:57Yardanico@Vindaar huh
15:28:58Yardanicostrange
15:29:00Yardanicolatest devel?
15:29:17FromDiscord<Vindaar> eh, one sec
15:30:02FromDiscord<Vindaar> about a week old. YEARS in nim land, I tell you. let me test with devel
15:30:15Yardanicoah you're right
15:30:19YardanicoI got an ICE with one of the examples
15:30:26Yardanico@Clyybber it's nkParForStmt agian :D
15:30:26FromDiscord<Clyybber> huh, lemme see
15:30:31FromDiscord<Clyybber> dammit
15:30:40Yardanicofrom the || loop
15:30:47Yardanico"Error: internal error: cannot inject destructors to node kind: nkParForStmt"
15:31:46Yardanicojust for x in `||`(1, 5): echo x
15:31:49Yardanicowill trigger the error
15:32:11FromDiscord<Clyybber> Araq: What to to do about nkParForStmt?
15:32:57FromDiscord<Vindaar> ah, works on devel indeed!
15:33:02Yardaniconice :)
15:33:05FromDiscord<Clyybber> nice
15:33:15Yardanicothat ICE is just if you use some parallel flag in cligen
15:33:41Yardanicocligen source code seems to be a little bit condensed :D
15:33:52FromDiscord<Clyybber> heh
15:33:58Yardanicohttps://github.com/c-blake/cligen/blob/master/examples/dups.nim#L96
15:33:59FromDiscord<Vindaar> ok, possible
15:38:32narimiranYardanico: i've seen that error ("cannot inject destructors to node kind: nkParForStmt") in several nimble packages when testing them with arc
15:38:45Yardanicoyeah that just means they use || openmp iterator
15:39:08narimiranprobably.... it was arraymancer and nim-chronicles
15:39:19Yardanicowell arraymancer is an entirely different thing :P
15:39:21narimiran...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:39bunghow to compile nim for js backend ?
16:27:15FromGitter<ynfle> `nim js file.nim`
16:27:21bung`./koch temp js ~/test13602.nim ` seems not right, give me type mismatch: got <AbsoluteDir> but expected 'AbsoluteDir = distinct string'
16:28:06bungsorry, I mean nim compiler its self
16:28:07narimiranmaybe the problem is tilde?
16:28:31FromGitter<ynfle> Why do you want the compiler in js?
16:29:09narimiranbung: try it without `~` to see if it triggers the same error
16:30:02bungyeah, same error, dont know why it call docgen.nim
16:30:39bungI know docgen not avaiable for js backend
16:33:10narimiranbut wait, does `nim_temp` even work with js backend? IIRC, it doesn't
16:33:53Yardanicobung: you can't
16:34:05Yardanicowell, at least not without modifying the compiler
16:34:23Yardanicoto 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:37YardanicoIMO it's easier to instead make nim compiler work with emscripten
16:35:50bungah, so I misused , I meat to build nim to test my modified jsgen
16:36:02Yardanicowell, then you just build nim compiler normally
16:37:14bungnim c compiler/nim.nim ?
16:37:21Yardanico./koch temp would be better
16:37:27Yardanicoto just test
16:37:34Yardanico./koch temp js yournimfile.nim
16:37:42Yardanicoit'll compile your modified compiler and run "nim js yournimfile.nim"
16:38:21bungbut I got `Error: compiler wasn't built with JS code generator`
16:38:35Yardanicowell then nim c compiler/nim.nim will work too :P
16:38:42Yardanicokoch temp builds with -d:leanCompiler
16:38:50Yardanicowhich excludes js backend, doc backend
16:39:01narimiranmy `nim_temp` tells me "Error: compiler wasn't built with JS code generator"
16:39:28narimirandon't know if calling it directly with `koch temp js` changes something.... i built it with just `koch temp`
16:39:39Yardanicowell yeah as I said :P
16:39:46bungnim c compiler/nim.nim I got `Error: type mismatch: got <AbsoluteDir> but expected 'AbsoluteDir = distinct string'`
16:39:46narimiranyeah, i'm lagging, sorry
16:39:52Yardanicobung: oh that one..
16:40:25Yardanicoit happens when you compile nim compiler in other directory than your stdlib path
16:40:30YardanicoI feel like it should be fixed but idk how :D
16:40:51Yardanicobasically 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:30bungam trying `./compiler/nim c compiler/nim.nim`
16:43:27bungoh this works
16:47:59disruptekthere's an option to specify the stdlib, but yeah, we talked about fixing koch.
16:48:07disruptekactually, i think i even submitted a pr.
16:49:39bunghow you debug the compiler ?
16:50:05disrupteki'm better at adding bugs than removing bugs.
16:50:08bungthe js code gen results very differients
16:50:11FromGitter<iffy> Is there a way to define a Python-style *call* proc for an object?
16:50:18Yardanicowell, yes
16:50:34Yardanicohttps://nim-lang.org/docs/manual_experimental.html#special-operators-operator-dot
16:51:00Yardanicoactually not sure if it will work for an object itself
16:51:05Yardanicoah you don't need experimental for that
16:51:26Yardanicoah you do :D
16:51:51Yardanicohttps://play.nim-lang.org/#ix=2rNe
16:53:09FromGitter<iffy> Thanks, Yardanico!
16:53:13bung{.emit:"# `it.len`".} how to emit the node len
16:53:29Yardanico??
16:53:56bungproc genIf(p: PProc, n: PNode, r: var TCompRes) =
16:54:39bungi want emit the variable len to result js code
16:55:53bungor I just echo it during compile ?
16:56:07Yardanicoyou can just echo, yes
16:56:20Yardanicoalso see https://nim-lang.org/docs/intern.html#debugging-the-compiler
16:57:56FromGitter<alehander92> bung think differently about it
16:58:07FromGitter<alehander92> the compiler is just a nim program
16:58:28FromGitter<alehander92> which generates in its runtime code strings/ropes which it saves in files finally
16:58:36FromGitter<alehander92> there is nothing magical like emit etc
16:58:40FromGitter<alehander92> so study a bit jsgen
16:58:56FromGitter<alehander92> to see how other hardcode strings are added to the code
16:59:49FromGitter<alehander92> `lineF`
17:00:04bungoh, I dont need echo from compiler ,--debuginfo --lineDir:on seems good
17:00:13FromGitter<alehander92> (probably line formatted) seems to be a good option: it seems you need to pass a proc context etc
17:00:20FromGitter<alehander92> ah ok if you just want to debug then you can echo
17:00:34FromGitter<alehander92> sorry, i thought you want to tweak generatiom of code
17:01:46bungI see a issue of js gen , so I want figure out what cause that
17:06:38bungI dont see lineF output in else branch
17:07:27FromGitter<alehander92> no no lineF is a thing
17:07:30FromGitter<alehander92> inside jsgen.nim
17:07:44FromGitter<alehander92> what is the issue
17:08:53bunghttps://github.com/nim-lang/Nim/issues/13602
17:08:56disbot[JS] String is undefined ; snippet at 12https://play.nim-lang.org/#ix=2rNk
17:09:39bunghmm, the comment is I dig so far, debuging js gen very new to me.
17:10:03Yardanicofirst thing you should try is simplify the code to reproduce the issue
17:11:55bungoh,yes, I try remove for loop, same
17:18:09bungit will call `reprEnum` in result js code when success.
17:18:41*synshroud_ joined #nim
17:19:46leorizeicyphox: input lag? how big was the file?
17:19:51leorizeand what OS are you on?
17:20:50leorizeYardanico: uh for suggestions you use `Ctrl-N` & `Ctrl-P` to select them
17:20:58*synshroud quit (Ping timeout: 272 seconds)
17:21:29bungalehander92 you can tell me something about this issue ?
17:23:21*audiophile_ joined #nim
17:23:24FromGitter<alehander92> sorry, a bit busy now :(
17:23:27FromGitter<alehander92> can't think of something
17:25:06bungok, I need read more compiler source
17:25:44icyphoxleorize: like 70 lines
17:25:50icyphoxon OpenBSD
17:26:00FromGitter<alehander92> bung yeah it's kinda not too hard to reason about
17:26:22FromGitter<alehander92> code generation is mostly visiting trees and constructing strings
17:26:25leorizeicyphox: you're using the terminal client?
17:26:30icyphoxyes
17:26:35FromGitter<alehander92> if we simplify it a bit
17:26:52icyphoxnearly 3-4s of input lag
17:27:20leorizemy guess is that the redraws triggered by semantic highlighting is insanely slow on openbsd for whatever reason
17:27:33leorizewhat terminal emulator are you using?
17:27:44bungcan I easier find where the compiler generate the block of code ?
17:27:44icyphoxst
17:27:49icyphoxsuckless terminal
17:27:52leorizethough it should really not surprise me if stuff running on openbsd is slow :P
17:27:53Yardanicowell openbsd itself is a bit slower than most other OSes, but it shouldn't make that much of a difference
17:27:58icyphoxlol
17:27:58*audiophile_ quit (Quit: Default Quit Message)
17:28:00icyphoxbut yeah
17:28:02icyphoxreally shouldn't
17:28:17Yardanicotry with other terminal emulator?
17:28:21Yardanicojust to see if you still have the issue
17:28:26leorizethis would be a neovim bug I suppose
17:28:46icyphoxi'm heading to bed rn it's 11:00pm here lol
17:28:54icyphoxi'll do it tmrw and ping you
17:28:56leorizewait... is your /tmp on tmpfs?
17:29:00icyphoxyep
17:29:14leorizethen I've no idea why it's slow :P
17:29:39icyphoxlol
17:29:43leorizeI 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:59icyphoxleorize: ok wait
17:30:02icyphoxno it's not tmpfs
17:30:04icyphoxmy bad
17:30:19icyphoxtmpfs support was dropped on OpenBSD
17:30:32leorizeis /tmp on spinning rust?
17:30:37leorize(aka hdd)
17:30:42icyphoxSSD here, but sure
17:30:44icyphoxyeah
17:31:50leorizea potential slowdown can be caused by the writes to /tmp so the data can be passed to nimsuggest
17:32:08FromDiscord<Clyybber> icyphox: Are you not in germany?
17:32:12leorizeI configured it to not use fsync but maybe that's not supported on openbsd
17:33:06icyphoxClyybber, no
17:33:08icyphoxIndia
17:33:22FromDiscord<Clyybber> oh, nice
17:33:29icyphoxnot really but ok
17:33:31icyphoxlol
17:33:33FromDiscord<Clyybber> I thought you were german because of "danke" :p
17:33:38icyphoxahhh lol
17:33:42icyphoxi've been watching too much Dark
17:33:49FromDiscord<Clyybber> haha, same
17:33:58icyphoxdanke feels so nice to say
17:37:04*krux02 joined #nim
17:39:44FromDiscord<Clyybber> Araq: ping
17:41:00FromGitter<alehander92> bitte schon
17:41:15FromGitter<alehander92> mutimesc
17:41:37narimiranicyphox: the only thing i remember by heart from 'dark' is "zukunft" (or something like that)
17:41:39FromDiscord<Vindaar> ok, now I managed to get an internal compiler error regardless of arc 🙂
17:41:41FromGitter<alehander92> i can surround clybber with my language basic words
17:42:07FromGitter<alehander92> zukunft is future
17:42:10narimiranand "die ende ist anfang" :D
17:42:14*fredrikhr quit (Ping timeout: 246 seconds)
17:42:20icyphoxoh lol
17:42:21FromGitter<alehander92> this is advanced german now
17:42:22icyphoxthe end is the begenning
17:42:24icyphoxor smth
17:42:29narimiranyep
17:42:33FromDiscord<Shucks> Is PMunch here?
17:42:36icyphox'es tu mir leid'
17:42:38icyphoxi think
17:42:41narimiranhahaha
17:42:48narimiranes tut mir leid
17:42:51FromGitter<alehander92> i saw a great llvm-related ad in norway
17:42:52icyphoxah yes
17:42:54icyphoxes tut mir leid
17:42:56icyphoxi'm sorry
17:43:04FromGitter<alehander92> PMunch it's about a new processor arch and haskell llvm
17:43:05narimiranyeah, they repeated that one 100x too
17:43:08icyphoxlol
17:43:09FromGitter<alehander92> if you're intereste
17:43:39FromDiscord<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:25narimiran(now i checked, it is "das ende", not "die ende"; german genders are hard!)
17:44:45icyphoxah
17:44:53icyphoxi know literally 0 german
17:45:23narimirani've learned it for 5 years in elementary school, but that was 20+ years ago, and i forgot almost everything
17:45:31icyphoxi know french so i guess that satisfies my quota of EU languages
17:45:33icyphoxlol
17:46:26narimiranahem, english
17:46:52icyphoxi mean, is that specifically EU
17:46:53icyphoxheh
17:46:56narimiranhehehe
17:46:57FromGitter<alehander92> ireland!!
17:46:59FromGitter<alehander92> malta
17:47:06FromGitter<alehander92> english is still active
17:47:48bungwhat's `$` called in jsgen ?
17:48:22FromGitter<alehander92> probably a magic
17:48:30FromGitter<alehander92> look for lib/sys/jssys
17:48:36FromGitter<alehander92> or something like jssys somewhere
17:48:38FromDiscord<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:18leorize[m]shouldn't `$` still be called `dollar`?
17:49:21leorize[m]in jsgen
17:49:44*debased quit (Client Quit)
17:49:47FromGitter<alehander92> i am not sure
17:49:50FromGitter<alehander92> how its implemented
17:49:59FromGitter<alehander92> but it might be a function that emits
17:50:07*debased joined #nim
17:50:35bunglooks like all call from reprjs.nim ?
17:52:57bung`genRepr` in jsgen.nim
17:57:56FromDiscord<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:57FromDiscord<SirJosh> sent a code paste, see https://play.nim-lang.org/#ix=2rNE
17:59:01FromDiscord<SirJosh> (edit) 'https://play.nim-lang.org/#ix=2rNE' => 'https://play.nim-lang.org/#ix=2rNF'
17:59:05leorize[m]when you use inheritance & dynamic dispatching, ref is pretty much a requirement
17:59:07FromDiscord<SirJosh> (edit) 'https://play.nim-lang.org/#ix=2rNF' => 'https://play.nim-lang.org/#ix=2rNG'
18:01:07leorize[m]it seems to me that the way you're trying to implement this is pretty much excessive
18:01:14FromDiscord<SirJosh> if i use `ref object` though that means everything goes on the heap unfortunately, right?
18:01:21FromDiscord<Recruit_main707> yes
18:01:23leorize[m]yep
18:01:31FromDiscord<SirJosh> dang
18:01:34*marnix joined #nim
18:01:41FromDiscord<Recruit_main707> could generics do?
18:01:55leorize[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:00FromDiscord<SirJosh> if generics can behave similarly, absolutely
18:02:07FromDiscord<SirJosh> sure i'll try to explain a little bit
18:02:26FromDiscord<SirJosh> so basically for nim practice i wanna write a little scripting thing or something, idk
18:02:30FromDiscord<SirJosh> so i've got numbers and objects
18:02:50FromDiscord<SirJosh> i want numbers to just be a float and not on the heap if you use 'em
18:02:54FromDiscord<SirJosh> and objects can go on the heap
18:03:12FromDiscord<SirJosh> and then i wanna have methods that can deal with both kinds of number/object without code duplication
18:03:31leorize[m]sounds like a case for generics and/or object variant
18:03:48leorize[m]without some code describing I can't point you to the exact direction though :P
18:03:58FromDiscord<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:02disruptekdoesn't even sound like you need variants.
18:04:09disruptekthe compiler knows.
18:04:36leorizeyea, the types sound like they would be resolved at compile time
18:04:42FromDiscord<SirJosh> but it may not know
18:04:51leorizewithout code I can't tell :P
18:04:54FromDiscord<SirJosh> like if i have a list of numbers or objects
18:05:09leorizeif your list only have one type then it should still work
18:05:10FromDiscord<SirJosh> ill try to type up something
18:06:09disruptektoys 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:43Yardanico@SirJosh object variants can still be used with "runtime dispatch"
18:07:45bungwithout for loop it even generate no code for a pramerter of seq[enum]
18:07:50Yardanicosince you can branch code based on their kind
18:07:53Yardanicoon runtime
18:08:08FromDiscord<Shucks> ``` Building Nim 1.2.4↵ Compiler: Already built↵ Tools: Already built```
18:08:22FromDiscord<Shucks> Could I force choosenim to rebuild everything? Or how could I understand this
18:08:36FromDiscord<SirJosh> sent a code paste, see https://play.nim-lang.org/#ix=2rNK
18:08:49Yardanico@SirJosh yes this is entirely possible with object variants
18:08:53FromDiscord<SirJosh> ooo
18:09:01leorizeAraq: can arc/orc do pointer sharing across thread now or do we still have to move them?
18:09:31shashlick@Shucks - what's the concern with the prebuilt tools
18:09:41leorize@SirJosh in fact JsonNode probably already have what you want :P
18:10:02leorizewell except that JsonNodes are ref type :P
18:10:09*bung quit (Quit: Lost terminal)
18:10:16FromGitter<machineko> Are there any arm docker builds for nim?
18:10:21FromDiscord<Shucks> Ohhh. It downloads the prebuilt package. Just thought it is using some old stuff which it found on my machine.
18:10:45leorize@machineko no, but there are nightlies binary build that you can use
18:10:45FromDiscord<SirJosh> object variants looks good, i'll go experiment with 'em :D
18:10:49FromDiscord<SirJosh> tyty
18:11:17FromDiscord<SirJosh> wait one question about variants
18:11:39FromDiscord<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:41leorize[m]@machineko these nightlies should run as long as the os/architecture is compatible: https://github.com/alaviss/nightlies/releases
18:11:52FromGitter<machineko> Thanks i
18:11:55Yardanico@SirJosh yeah it doesn't really have to be a ref object unless you have direct recursion
18:11:57FromGitter<machineko> ill get nightlies
18:12:06FromDiscord<SirJosh> ah
18:12:19FromDiscord<SirJosh> would having a Table[string, BaseThing] count as direct recursion?
18:12:20leorize[m]remind me to upstream new nightlies this weekend :P
18:12:28FromDiscord<SirJosh> nvm i'll try it and see
18:12:31FromDiscord<SirJosh> ty
18:12:34Yardanicono, it won't
18:12:37Yardanicosince Table uses sequences
18:12:48Yardanicointernally for storing data
18:12:51leorize[m]@SirJosh direct recursion is when you want to store the type within the type itself
18:13:17FromDiscord<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:21Yardanicoyes
18:13:40Yardanicohttps://play.nim-lang.org/#ix=2rNM
18:14:14Yardanicoin fact Nim's own compiler uses object variants for the AST
18:14:40leorizeNimNodes use reference semantics though :P
18:15:26Yardanico@SirJosh check the link for your adapted to object variants example :P
18:15:40FromDiscord<SirJosh> yee i saw
18:15:44FromDiscord<SirJosh> ty i'll go have fun with these now :D
18:16:12Yardanicodid anyone make a macro for object variants to separately define implementations for different kinds?
18:16:19Yardanicoe.g. to split the $ procedure in my example
18:16:30YardanicoI mean it's totally possible, just asking if someone already did this
18:16:46FromDiscord<Clyybber> nope, but its the first step for library OOP
18:16:50FromDiscord<Clyybber> do it :D
18:17:32FromGitter<bung87> use dot operator can do that
18:17:40Yardanicofor what exactly?
18:18:09FromGitter<bung87> did anyone make a macro for object variants to separately define implementations for different kinds?
18:18:20Yardanicoyes, dot operator isn't for that
18:18:24YardanicoI don't see how it would help here really
18:18:39Yardanicoonly 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:31FromGitter<bung87> I use it combine with converter to basic type and check differient methods compiled
18:22:30leorize[m]!repo patty
18:22:31disbothttps://github.com/andreaferretti/patty -- 9patty: 11A pattern matching library for Nim 15 185⭐ 9🍴
18:22:36Yardanicowell yes, but it's different
18:23:12YardanicoMWAHAHHA
18:23:18leorizethe only part of patty that's interesting is the ability to construct object variants in Haskell-style
18:23:34FromGitter<bung87> ok I prepare to sleep
18:23:40Yardanicohttps://play.nim-lang.org/#ix=2rNR
18:23:47YardanicoI think I can even reuse the proc syntax
18:23:55Yardanicosee how I have MyBaseType(Number)
18:24:07Yardanicoit's correct nim syntax so the macro can happily accept it :D
18:24:27leorize`{}` also works
18:24:39Yardanicowell that's arleady used for AST overloading :)
18:24:55leorize?
18:24:58Yardanicohttps://nim-lang.org/docs/manual_experimental.html#ast-based-overloading
18:25:54leorize[m]ah yea
18:26:26leorize[m]it's also used for nimnode overloading :P
18:26:31Yardanicoi know
18:26:33Yardanicohttps://play.nim-lang.org/#ix=2rNT
18:27:00leorizeperfect reason to abuse it :P
18:27:25Yardanicosame for macros
18:27:26*Sembei quit (Quit: WeeChat 2.8)
18:27:27Yardanicosee https://github.com/Yardanico/nim-strenc/blob/master/src/strenc.nim
18:27:43Yardanicoalthough sadly it doesn't work for bigger projects
18:27:49leorizeyep, that kind of usage is deprecated though
18:28:02leorizecligen use that scheme too (or maybe not anymore)
18:29:58leorizeanyone want to try making a enum-style object variant macro?
18:30:08Yardanicolike what?
18:30:18leorizelike patty.variant but make use of typesection macros
18:32:59FromDiscord<Recruit_main707> maybe `discard` works, its similar to python's `pass`
18:33:05Yardanicofor what?
18:33:15FromDiscord<KingDarBoja> discard
18:33:19FromDiscord<SirJosh> oh yeah discard seems to work that's cool
18:33:30FromDiscord<KingDarBoja> Yesss
18:33:37FromDiscord<KingDarBoja> Join Object Variants Team
18:33:39Yardanicoidk why @SirJosh's message from discord wasn't sent by the bridge
18:33:40Yardanicoweird
18:33:47FromDiscord<SirJosh> rip
18:33:58FromDiscord<KingDarBoja> _this message was sponsored by the OV gang_
18:35:39leorizealehander92/gara#5 <- I'm interested in seeing how this can be done with the kind of macros we have nowadays :P
18:36:05Yardanico!repo gara
18:36:06disbothttps://github.com/alehander92/gara -- 9gara: 11 15 71⭐ 7🍴
18:36:35leorize!search macro to gnerate variant objects
18:36:36disbotno results 😢
18:36:39leorize!search macro to generate variant objects
18:36:41disbothttps://github.com/alehander92/gara/issues/5 -- 3Macro to generate variant objects 7& 15 more...
18:39:46FromDiscord<Zachary Carter> shader hot reloading https://media.discordapp.net/attachments/371759389889003532/733392446305730600/anim.gif
18:40:26Yardanicowhat editor is that?
18:40:29Yardanicovim or emacs?
18:40:32disruptekkak
18:40:39Yardanicohuh
18:40:44Yardanicokakoune?
18:40:49disruptekyeah
18:47:43FromDiscord<Clyybber> best editor :D
18:48:58Yardanicoyou use it @Clyybber ?
18:48:59Yardanicofor nim?
18:49:37FromDiscord<Clyybber> yeah
18:49:49Yardaniconice, with nimlsp or how? for nim syntax highlighting and other stuff
18:50:02FromDiscord<Clyybber> nothing :p
18:50:05Yardanicowat
18:50:10FromDiscord<Clyybber> I actually wanted to try nimlsp today
18:50:19FromDiscord<Clyybber> but didn't get to it
18:51:00FromDiscord<Recruit_main707> cant judge considering i made myself a shitty syntax highlighter for visual studio and use it :P
18:51:03FromDiscord<Clyybber> oh, mind you theres still syntax highlighting because kakoune has a nim highlighter
18:51:16Yardanicoseems like kakoune has an lsp client
18:51:20FromDiscord<Clyybber> yeah
18:51:27FromDiscord<Clyybber> thats what I wanted to try
18:51:38FromDiscord<Clyybber> @Zachary Carter are you using kak-lsp?
18:53:02Yardanicowow
18:53:07Yardanicoit's really nice
18:53:11Yardanicoshows help for commands you input
18:53:25YardanicoI mean kakoune
18:53:33FromDiscord<Clyybber> yeah kakoune is great
18:53:34FromDiscord<Zachary Carter> I am - but it's not working for me atm
18:53:39Yardanicoill try
18:53:40FromDiscord<Clyybber> oh ok
18:53:44FromDiscord<Zachary Carter> I know @Solitude has it working
18:53:47FromDiscord<Clyybber> I wish leorize would be using kakoune
18:53:51FromDiscord<Clyybber> @Zachary Carter yeah
18:56:05FromDiscord<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:29FromDiscord<Clyybber> is the nimnode untyped?
18:56:48FromDiscord<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:53FromDiscord<Clyybber> which would have typed input
18:57:04FromDiscord<Clyybber> in which you could then see the type
18:57:21leorizeClyybber: I used to use kakoune, but it's too limited for my taste
18:57:38leorizemaybe it's expanded now and worth another try
18:58:05FromDiscord<Clyybber> its pretty barebones unconfigured
18:58:39FromDiscord<Clyybber> but there are a bunch of nice plugins
19:00:53FromGitter<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:53Yardanicokak-lsp seems to just work for me lol
19:00:54Yardanicowith nim
19:01:18leorizeit couldn't do semantics highlighting :p
19:01:50leorizeand doesn't have sockets integration, so I dropped it in favor of neovim for writing nim.nvim
19:01:50Yardanicobut nvim doesn't have that nice help when typing commands :P
19:02:31*audiophile_ joined #nim
19:02:42leorize[m]I got bored: https://play.nim-lang.org/#ix=2rO7
19:02:47FromDiscord<Clyybber> cool I'm gonna setup kak-lsp then
19:03:01Yardanicoleorize[m]: lol
19:03:06Yardanicowell actually can be useful
19:03:06FromDiscord<Clyybber> @Yardanico https://github.com/occivink/kakoune-roguelight
19:03:07FromDiscord<Clyybber> :D
19:03:10Yardanicoif your types export tons of stuff
19:03:36FromDiscord<Clyybber> leorize: lol why :D
19:04:15leorizeI'm pretty sure 4raq would like something like this for the compiler, given how many fields it exports :P
19:05:31FromDiscord<Clyybber> leorize: Now make it a term rewriting macro
19:05:43Yardanicohahah
19:05:53Yardanicowait that can work?
19:06:12leorizemaybe, but those stuff can be turned off so :P
19:06:27Yardanicoleorize: any personal recommendations for good nvim plugins to "replicate" default vscode layout?
19:06:39FromDiscord<Clyybber> and then make a small shscript that puts --include payload.nim in you global nim.cfg
19:06:39Yardanicoe.g. file/dir tree on the right, terminal bottom, and main window
19:06:57Yardanicoterminal to be togglable of course
19:07:15FromDiscord<SirJosh> sent a code paste, see https://play.nim-lang.org/#ix=2rO9
19:07:18leorizenope, I use barebones nvim :P
19:07:28Yardanico@SirJosh have them in the same type block
19:07:30leorizenot too hard to setup something like that
19:07:39leorizenarimiran probably have a setup
19:07:42Yardanicoor try to use package-level types, although I don't know if anyone uses them
19:08:07FromDiscord<SirJosh> ah having them in the same type works, cool
19:08:08FromDiscord<SirJosh> ty
19:08:23*endragor joined #nim
19:08:26FromDiscord<Recruit_main707> coudnt code reordering just get all types into the same type↵... block and work? 🤔
19:08:36narimiransory, don't have a vscode-like setup
19:08:44leorizeback when I was into the flashy ide style ctrl-p and nerdtree was popular
19:08:47Yardanicocan you show a screenshot? :P narimiran
19:08:54narimiranof my nvim?
19:08:54FromDiscord<Clyybber> @Yardanico leorize: https://github.com/alexherbo2/kakoune.vim
19:09:01Yardaniconarimiran: yes
19:09:07narimiranok, give me a sec
19:09:33leorize@Clyybber lol
19:10:53FromDiscord<--HA--> Can I import a type and give it a different name?
19:11:10leorizesorta? :P
19:11:15narimiranYardanico: here you go: https://imgur.com/t3FChKq
19:11:23leorizetype NewName = OldName
19:11:27leorizejsut alias it over :P
19:11:34*vsantana quit (Quit: leaving)
19:11:34Yardaniconarimiran: well yes that's something like I would want
19:11:41Yardanicoand optional toggable file tree :D
19:11:50Yardanicowhat do you use for the terminal?
19:11:58leorizedamn fancy 4k :)
19:12:02narimirani just press `-` for the in-built file tree
19:12:08narimiranleorize: nope, 1440p
19:12:18narimiranterminal is also built-in
19:12:30narimiran3440x1440
19:12:31leorizestill fancy, just not as fancy as disruptek 4k then :P
19:12:31Yardanico- ?
19:12:39leorizeYardanico: :h terminal
19:13:18FromDiscord<--HA--> leorize, how would that look like, an alias? I'm still new.
19:13:19narimiranyeah, `-` (minus, or dash) brings the built-in netrw
19:13:25FromDiscord<Clyybber> disruptek has 4k so that he can stresstest his font rendering at high scales :p
19:14:10narimiranYardanico: if you want to get more fancy, there are plugins that give you directory tree on the left. it looks nice
19:14:43narimiranYardanico: 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:41leorize@--HA-- `import something; type NewName = something.TypeHere`
19:17:24FromDiscord<--HA--> leorize: cool, thanks!
19:21:03leorize[m]yw :)
19:25:28*marnix quit (Ping timeout: 246 seconds)
19:31:51FromGitter<alehander92> leorize the patty lib
19:31:53FromGitter<alehander92> has such a macro
19:31:59FromGitter<alehander92> i think it can be related
19:32:02FromGitter<alehander92> to a pragma today
19:32:08*marnix joined #nim
19:32:12FromGitter<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:17FromDiscord<kodkuce> is prologe a thing now or still alpha 0.0001
19:51:13*synshroud quit (Ping timeout: 264 seconds)
19:58:11FromDiscord<kodkuce> and is treeform/pg best async postgres atm?
19:58:14*oriba joined #nim
19:59:24leorize@alehander92 I know, just not sure if it's good enough
19:59:58leorizetype section macros have pretty severe limitations
20:00:06FromDiscord<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:24FromDiscord<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:35FromGitter<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:21FromGitter<alehander92> can you try to just write a func
20:23:31FromGitter<alehander92> and use `{.effects: [].}: code`
20:23:32FromGitter<alehander92> inside
20:26:51FromGitter<ynfle> Doesn't work
20:27:08FromDiscord<Clyybber> ynfile: You have to put the code that isn't actually sideeffect free inside a {.noSideeffects.}: block
20:28:20FromGitter<alehander92> ahh sorry^
20:29:14*marnix quit (Ping timeout: 240 seconds)
20:29:36FromGitter<matrixbot> `lessneek` om nom nom nom
20:33:28FromGitter<ynfle> It's {.noSideeffect.} (no "s" at the end)
20:35:00FromDiscord<Clyybber> ah right :D
20:38:05FromGitter<ynfle> Thanks!!
20:39:22*hyiltiz_ quit (Ping timeout: 260 seconds)
20:46:54FromGitter<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:05FromGitter<sealmove> there is a proc
20:48:29FromGitter<sealmove> toStrLit
20:49:45FromGitter<sealmove> If you do `myNode.repr` you get the concrete code as string. `toStrLit` just wraps that in a node.
20:51:30FromGitter<iffy> Perfect, thank you!
20:54:25*haxscramper quit (Remote host closed the connection)
21:01:34leorize[m]@Clyybber timothee already outlined some valid points in his issue
21:02:58FromGitter<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:07FromDiscord<Varriount> leorize: Do you have a link to that issue?
21:08:46leorize[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:47disbothttps://github.com/nim-lang/Nim/issues/14923 -- 3varargs[typed] isn't passed properly through template 7& 29 more...
21:09:48leorize[m]#13830
21:09:50disbothttps://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:06FromDiscord<Clyybber> I feel like they shouldn't apply to typeSection either
21:18:44FromDiscord<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:27leorize@Clyybber: it's about seamless integration
21:23:51leorizethere's too little that you can do within a typesection context
21:24:10FromGitter<ynfle> @iffy, the second macro needs to accept a string type as the first agrument
21:26:33FromDiscord<Rika> how do i force uninstall a package in nimble even if it's being depended on?
21:26:54leorizejust uninstall everything it depends on?
21:27:00FromDiscord<Rika> without that
21:27:09FromDiscord<Rika> i'm trying to replace the version
21:27:22leorizego to the nimble package folder and just rm -rf it out of the world
21:27:30leorizenimble doesn't use any database other than the fs layout
21:27:30FromDiscord<Clyybber> leorize: I think allowing consts in typesections would be a better option
21:27:41FromDiscord<Rika> ah okay thats nice to know
21:27:52leorize@Clyybber that sounds kinda stupid
21:28:16leorizealso we would want to generate functions too, and the typesection context doesn't do us any favor here
21:28:18FromDiscord<Clyybber> why?
21:28:26FromDiscord<Clyybber> ah
21:28:53FromDiscord<Clyybber> fair point
21:28:57*nikita` quit (Quit: leaving)
21:29:22FromDiscord<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:51FromDiscord<Clyybber> it would also break type forward declaration
21:29:58leorizefor 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:28leorizethat obviously doesn't work if you can't generate procs :P
21:30:52FromDiscord<Clyybber> yeah
21:30:57leorize@Clyybber I think we just gotta fix type forward decl :P
21:31:25FromDiscord<Clyybber> fair enough. I've been thinking of doing an actual topological sort
21:31:33FromDiscord<Clyybber> instead of the 3pass approach we do rn
21:31:39FromDiscord<Clyybber> since it would allow us to get rid of tyAlias
21:32:16leorizesimpler is better :P
21:32:36FromDiscord<Clyybber> for sure
21:32:53FromDiscord<dom96> > nimble doesn't use any database other than the fs layout↵@leorize[IRC]#0000 that's not true. It unfortunately does 🙂
21:33:01FromDiscord<dom96> There is a JSON file storing the reverse deps
21:33:13FromDiscord<Clyybber> maybe theres a way to get rid of tyAlias without topological sorting, but I don't know how (yet?)
21:33:25leorize@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:17leorize@dom96 ah I stand corrected then :P
21:35:30FromDiscord<Clyybber> leorize: Yeah, possibly
21:39:42FromDiscord<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:09Yardanicowhy not?
21:40:17FromDiscord<Technisha Circuit (LGBTQIAP+)> Just wondering :P
21:40:39FromDiscord<Technisha Circuit (LGBTQIAP+)> ~~If you wanted to know, the interpreted lang will have braces-~~
21:40:53Yardanicosome of them don't
21:40:56Yardanicoa lot of them don't
21:41:03Yardanicohttps://min-lang.org/ http://sprylang.se/
21:41:04Yardanicojust examples
21:41:12Yardanicobut really the language of implementation doesn't matter *that* much
21:41:25FromDiscord<Technisha Circuit (LGBTQIAP+)> Oo
21:41:34Yardanicoalthough it depends on the purpose of your language
21:41:51Yardanicodo you want it for games, for scripting, for some numerical calculations, etc?
21:42:25leorizenote that Nim can be interpreted too
21:42:37FromDiscord<Technisha Circuit (LGBTQIAP+)> I know
21:42:41Yardanicoand it's written in nim
21:42:45Yardanicoand it works
21:42:51FromDiscord<Technisha Circuit (LGBTQIAP+)> Yeah
21:42:54FromDiscord<Technisha Circuit (LGBTQIAP+)> It's NimScript
21:42:55FromDiscord<Technisha Circuit (LGBTQIAP+)> Right?
21:43:04Yardanicowell technically yes
21:43:06FromDiscord<Technisha Circuit (LGBTQIAP+)> The VM for Nim
21:43:12FromDiscord<Technisha Circuit (LGBTQIAP+)> Is the actual interpreter
21:43:15FromDiscord<Technisha Circuit (LGBTQIAP+)> Right?
21:43:19leorizeyep
21:43:23FromDiscord<Technisha Circuit (LGBTQIAP+)> Coolio
21:43:23YardanicoI don't think the VM itself is called "nimscript" though
21:43:30FromDiscord<Technisha Circuit (LGBTQIAP+)> Yeah
21:47:13Yardanicoi also did some of http://www.craftinginterpreters.com/ implementation but it's a bit abandoned right now
21:47:46YardanicoI 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:52Yardaniconeed to finish it
21:47:55FromDiscord<Technisha Circuit (LGBTQIAP+)> Oh?
21:48:02FromDiscord<Technisha Circuit (LGBTQIAP+)> Nice
21:48:08Yardanicohttps://github.com/Yardanico/nim-lox there's an old branch
21:48:25Yardanicoit's not that nice because I translated java code to nim most of the time basically
21:48:33Yardanicowell, not literally, of course I did something a bit differently
21:48:48FromDiscord<Technisha Circuit (LGBTQIAP+)> Oh
21:48:54FromDiscord<Technisha Circuit (LGBTQIAP+)> What's Lox?
21:48:58Yardanicoa language in http://www.craftinginterpreters.com/
21:49:09Yardanicodid you read that page at least? :P
21:49:49FromDiscord<Technisha Circuit (LGBTQIAP+)> Wait
21:49:51FromDiscord<Technisha Circuit (LGBTQIAP+)> Oof-
21:50:40FromDiscord<Technisha Circuit (LGBTQIAP+)> Nothing about Lox there though
21:50:51Yardanicohttp://www.craftinginterpreters.com/the-lox-language.html
21:51:13FromDiscord<Technisha Circuit (LGBTQIAP+)> Oh okay
21:52:42FromDiscord<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:23FromDiscord<Shucks> Could I check which part makes my binary that big? I feel like its way to heavy for what im doing.
22:23:28FromDiscord<Shucks> size*
22:24:40FromDiscord<Rika> use strip and upx if you want to make it smaller w/o changing anything
22:25:06FromGitter<alehander92> binary profiling
22:25:14FromGitter<alehander92> huh .. why don't we do this
22:25:33FromDiscord<Rika> because most of the time it doesnt matter 😛
22:25:38FromDiscord<Technisha Circuit (LGBTQIAP+)> If you're on linux a tip is to do `strip theFile`
22:25:38FromGitter<alehander92> https://github.com/google/bloaty
22:25:41FromDiscord<Rika> and most of the time strip + upx does the job
22:25:42FromGitter<alehander92> ok it exists
22:25:47FromDiscord<Technisha Circuit (LGBTQIAP+)> What's upx?
22:25:49FromGitter<alehander92> i see
22:25:51FromDiscord<Rika> https://github.com/upx/upx
22:26:08FromDiscord<Technisha Circuit (LGBTQIAP+)> Oo
22:26:11FromDiscord<Technisha Circuit (LGBTQIAP+)> Thanks!
22:26:11FromDiscord<Rika> it compresses further than strip does
22:26:16FromGitter<alehander92> but noo
22:26:22FromGitter<alehander92> the problem is to *see* what bloats it
22:26:23FromDiscord<Rika> last time i used it i got half size of just strip
22:26:35FromGitter<alehander92> that's why profiling might be useful
22:27:14FromDiscord<Rika> if you run strip then you know whether whatever strip removes is bloating your exec or not
22:27:48FromGitter<alehander92> no
22:27:52FromGitter<alehander92> i think a profiler can do more
22:27:59FromGitter<alehander92> e.g. show you which of your generic functions
22:28:04FromGitter<alehander92> has many copies etc
22:28:12FromGitter<alehander92> so you can do some source changes
22:28:28FromGitter<alehander92> its a bit like optimziers vs profiling
22:28:35FromGitter<alehander92> optimizers can remove just what they can prove
22:28:41FromGitter<alehander92> or maybe assume
22:28:43FromDiscord<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:04FromDiscord<Shucks> most antivirus' don't like upx btw
22:31:13FromDiscord<Shucks> or atleast some of them
22:31:24*hyiltiz quit (Quit: hyiltiz)
22:31:45FromDiscord<Rika> yeah upx also degrades performance sometimes
22:33:16FromDiscord<Shucks> well strip actually halved the size ^.^
22:34:01FromDiscord<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:15PrestigeHow 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:50FromDiscord<lqdev> not possible afaik
22:43:50FromDiscord<Rika> that should be fine
22:43:52FromDiscord<Rika> provided
22:43:55FromDiscord<Rika> you have a hash proc
22:43:59FromDiscord<lqdev> ah yeah
22:44:07FromDiscord<lqdev> you can make a hash proc for types with some macro magic
22:44:13FromDiscord<Rika> `proc hash*(t: Type): Hash`, import `hashes`
22:44:24FromDiscord<Rika> you dont need macro magic if you want to implement it manually
22:44:27Yardanicoyou can't store a type
22:44:29FromDiscord<lqdev> see https://nim-lang.org/docs/macros.html#signatureHash%2CNimNode
22:44:30YardanicoPrestige: you don't need a table for that
22:44:32FromDiscord<Rika> ah
22:44:32Yardanicoyou can just use an enum
22:44:33FromDiscord<Rika> a type
22:44:39Yardanicoif you want type -> something
22:44:48FromDiscord<Rika> not a type sorry, i thought you meant an instance of a type
22:44:50FromDiscord<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:53YardanicoI mean you can make an enum with types you want or something
22:45:29PrestigeIdk how I'd do it with an enum - it's supposed to support any type
22:45:56Yardanicobut why a table?
22:46:00Yardanicowhat do you REALLY want?:)
22:46:07Yardanicoseems a bit like an xy problem :P
22:46:12Prestigemaybe I could hash a typedesc..
22:46:15Yardanicono
22:46:19Yardanicothey don't exist at runtime
22:46:34FromDiscord<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:46Yardanicoyeah of course you can do that
22:46:52Yardanicoe.g. use strings or something
22:46:59PrestigeThat should be fine I think
22:47:03Yardanicobut I really think that this wouldn't be the right solution
22:47:06FromDiscord<Rika> it would be the best option if you really need the typedesc thing
22:47:08Yardanicojust tell us what you're trying to do :D
22:47:54PrestigeHave a mapping from any type to something, I'm experimenting with ecs
22:48:17FromGitter<alehander92> yeah you can use the name probably
22:48:25FromGitter<alehander92> but what is something
22:48:28PrestigeWant to make a table[C, seq[components]]
22:48:45FromGitter<alehander92> is C inheriting from Base
22:48:55FromGitter<alehander92> can't you just have a method
22:49:07PrestigeC is the component type
22:49:30FromGitter<alehander92> so you can have a generic function!
22:49:46FromGitter<alehander92> proc components*C (c: C): seq[C] = @[]
22:49:58FromGitter<alehander92> `proc components*[C](c: C): seq[C] = @[]` *
22:50:23PrestigeI need to be able to look up the component seq by its type essentially
22:50:40Yardanicoare you reimplementing runtime dispatch or wat? :D
22:50:48FromGitter<alehander92> yes, and you can do that with generic function and specialization
22:50:52FromGitter<alehander92> / overloading maybe
22:51:12PrestigeFound this, looks interesting: https://github.com/yglukhov/variant/blob/master/variant.nim#L123
22:51:20FromGitter<alehander92> that's the point of generics, think about it
22:51:38FromGitter<alehander92> to have type-level functions/lookup
22:51:42FromGitter<alehander92> i think
22:51:59FromGitter<alehander92> i think this is overengineering
22:52:07FromGitter<alehander92> for this particular usecase
22:52:19FromGitter<alehander92> (otherwise good idea)
22:53:20Prestigeah he has a lookup table for the Ids, interesting..
22:56:19FromDiscord<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:38FromDiscord<Rika> dynamic dispatch?
22:57:10FromDiscord<Varriount> Hm, true
22:58:24FromDiscord<Varriount> But without type embedding or multiple inheritance, it's limited.
22:58:29PrestigeI might just need to use this lib lol
23:01:38FromDiscord<Varriount> @Rika I wonder how well the streams module would work if it used methods instead of a manual vtable
23:10:30leorize[m]probably not fast
23:10:58Yardanicoespecially not on arc :P
23:15:02FromDiscord<Shucks> do we got ringbuffers in the stdlib?
23:15:17FromDiscord<Shucks> well nvm
23:15:23leorizewe don't have ring buffers
23:15:55leorizeplease contribute one to fusion if you ever write any :)
23:16:09FromDiscord<Shucks> https://github.com/megawac/RingBuffer.nim
23:16:10FromDiscord<Shucks> done ;p
23:16:17*Kaivo quit (*.net *.split)
23:16:18*def- quit (*.net *.split)
23:16:44FromGitter<alehander92> i think
23:16:48FromGitter<alehander92> i understood monads
23:17:25FromGitter<alehander92> it did click, thank Lord
23:17:34FromGitter<alehander92> it clicked
23:17:59FromGitter<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:30FromDiscord<Shucks> Does `nimble install RingBuffer` work for anyone?
23:32:36FromDiscord<Shucks> guess the url is wrong
23:34:21FromDiscord<Rika> @Shucks try no caps
23:35:10FromDiscord<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:46FromDiscord<Shucks> sent a code paste, see https://play.nim-lang.org/#ix=2rPi
23:36:30FromDiscord<Rika> ah ssh url
23:37:42FromGitter<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:30FromDiscord<Shucks> https://github.com/megawac/RingBuffer.nim/blob/master/RingBuffer.nim#L15
23:38:33FromDiscord<Shucks> guess that will also fail
23:38:36FromDiscord<Shucks> damn.. >.<
23:38:48FromDiscord<Rika> i mean its 5 years old
23:38:48Yardanicojust use typed/untyped
23:38:52FromDiscord<Rika> you can probably yeah
23:38:54FromDiscord<Rika> fix it with that
23:38:55Yardanicoinstead of expr try typed
23:38:58Yardanicostmt = untyped
23:39:03Yardanicoif won't work, make both untyped
23:40:12FromDiscord<Shucks> Some of you pro nim guys should code a proper one right now ;p
23:40:18FromDiscord<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:30OMGOMGhttps://forum.nim-lang.org/t/5349 is this still true, no documentation for testament?
23:51:46FromDiscord<Rika> ish
23:51:56FromDiscord<Rika> but testament isnt made for general library testing
23:52:05FromDiscord<Rika> afaik its specially made for testing the compiler
23:52:56OMGOMGhttps://nim-lang.org/docs/unittest.html literally the first sentence here suggests using testament instead
23:53:10FromDiscord<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:28FromDiscord<Rika> it says consider, not switch to
23:53:32FromDiscord<Rika> you dont have to
23:53:39FromDiscord<Rika> and if you cant, it is fine
23:53:46FromDiscord<Rika> but if you can figure it out, then good
23:54:57FromDiscord<Technisha Circuit (LGBTQIAP+)> Is there a way to make a C function in Nim?
23:55:08Yardaniconim procedures *are* c functions
23:55:19Yardanicoif you want to make a "c function" as in with default c types, etc
23:55:25Yardanicouse {.exportc, cdecl.} for proc pragmas
23:55:30OMGOMGRika: 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:32Yardanicoand only use C types in arguments and in the return type
23:55:37YardanicoOMGOMG: it's not deprecated at all
23:55:39FromDiscord<Rika> OMGOMG: it is not
23:55:49Yardanicothat sentence should be removed from unittest docs really
23:55:52FromDiscord<Rika> the line really needs to be reworded
23:56:06FromDiscord<Rika> time to git blame to see who wrote it 😉