<< 09-04-2023 >>

00:02:02termerIs there a way to use pragmas like annotation on proc args?
00:03:14termerI'm trying to build a validation library that can automatically generate a validator based on proc args, and I'd like to be able to do things like: proc createPerson(name {.min(1), max(64).}: string, age {.min(1), max(99).}: int) = ##
00:03:40FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4t1c
00:04:24FromDiscord<Elegantbeef> `template min(i: int){.pragma.}` in your case
00:04:40termerIs the playground slow for you?
00:04:44termerIt's timing out for me
00:04:52termer504
00:04:57FromDiscord<Elegantbeef> It's probably dead and pmunch needs to kick it in the ass
00:05:10termerperhaps
00:05:25termerI can't see code pastes within IRC, it creates playground links for them
00:05:28termerso I can't see what you sent
00:05:46FromDiscord<Elegantbeef> Time to use matrix 😛
00:05:53termerIRC or death
00:05:58FromDiscord<Elegantbeef> `template myPragma {.pragma.}` `proc doThing(a {.myPragma.}: int) = discard`
00:06:04FromDiscord<Elegantbeef> Time to grow up
00:06:44FromDiscord<Elegantbeef> you can grab the tail of a playground like and do `ix.io/4t1c`
00:06:48FromDiscord<Elegantbeef> link\
00:08:02termerdidn't know it used that
00:08:13termerlol I've written a bridge software just so I don't have to use matrix
00:08:33termerhttps://git.termer.net/termer/matrix-irc-bridge
00:08:52termeronly one that I'm aware of that supports encrypted rooms and file uploads
00:09:26termerso now the question is, what would this template actually do
00:09:30FromDiscord<Elegantbeef> Well bridge to the Nim matrix instead of using the irc room
00:09:31termerhow does that even work
00:09:36FromDiscord<Elegantbeef> It doesnt do anything
00:09:42FromDiscord<Elegantbeef> It just tags the type you need a macro to detect it
00:09:52termerohhhh
00:10:00termerRight, that makes sense
00:11:13termerElegantBeef, related to IRC, Nim's bridge is actually the best one I've ever interacted with
00:11:46termerit translates discord formatting, it turns code pastes into links, it turns long messages into links
00:11:48termervery very usable
00:14:04FromDiscord<Elegantbeef> Turning everything into links seems swell 😛
00:14:19termerIRC is the most free and easiest chat thing for me to use
00:14:41FromDiscord<Elegantbeef> I do not know how it's any more free than matrix, but alas
00:14:58termerit's a simple protocol with loads of implementations
00:15:19termerthere is only 1 fully usable matrix server
00:15:40termerIRC is so simple that I went from 0 knowledge of the protocol to a working server implementation in a weekend
00:15:52termeran implementation that's being used at this very moment
00:16:05FromDiscord<Elegantbeef> I'd say that it's not any more free it's just simpler
00:19:44termerit translates into more freedom since it's harder to control
00:20:01termerthe major downside of that is that it's obviously very primitive
00:20:19termerthings like chat history are supported through commonly understood protocol extensions, but most servers don't implement it for example
00:42:33FromDiscord<Dudugz> If I wanted to build a chat app without hosting a server of my own could I use matrix instead and allow bridges?
00:42:57FromDiscord<Elegantbeef> You could make a matrix client
00:43:09FromDiscord<Dudugz> Hmm, that's cool
00:43:29FromDiscord<Elegantbeef> Like I linked yesterday there is no shortage of them
00:43:35FromDiscord<Dudugz> Like you said discord sucks on some things, code sharing is one of those things
00:44:36FromDiscord<Dudugz> Imagine a free client where you can modify freely to your liking and still have access to your favorite servers
02:26:17FromDiscord<xTrayambak> What happened to nimble.directory? It seems it's turned into a package badges site.
02:26:44FromDiscord<Elegantbeef> It got a redesign it's the same site
03:14:26*rockcavera joined #nim
03:28:20FromDiscord<Hourglass [She/Her]> In reply to @Dudugz "If I wanted to": So you'd make a client?
03:28:31*lucasta quit (Remote host closed the connection)
03:29:04FromDiscord<Hourglass [She/Her]> In reply to @Dudugz "Imagine a free client": Ah yes, I too love breaking ToS (custom clients are against ToS even if it isn't enforced)
03:30:28FromDiscord<Hourglass [She/Her]> But on a more serious(?) note, I'm working on a chat app, spent nearly two weeks on the code that serves accounts (currently in Python, since it was quick to prototype and unlike Nim, has decent editor support and has great support everywhere)
03:44:58FromDiscord<user2m> is it possible to get python style docstrings to show up on vscode for nim ? https://media.discordapp.net/attachments/371759389889003532/1094467970555707392/image.png
03:54:36FromDiscord<Hourglass [She/Her]> I think the lsp shows doc comments, right?
03:55:33FromDiscord<Elegantbeef> It should
03:55:37FromDiscord<Elegantbeef> But the tooling barely works 😄
04:06:50FromDiscord<user2m> Yeah I'm able to see docstrings on the code from the standard lib but not my own
04:08:02FromDiscord<sOkam!> Can this be used in stable, or only in devel?↵https://nim-lang.github.io/Nim/paths.html
04:08:23FromDiscord<Elegantbeef> `nim-lang.github.io` is devel docs
04:08:54FromDiscord<sOkam!> kk. and is there a way to use a devel package in stable?
04:09:12FromDiscord<Elegantbeef> No cause it's not a devel package it's the devel stdlib
04:09:15FromDiscord<Elegantbeef> So copy the code if you really want it
04:10:01FromDiscord<sOkam!> actually not a bad idea, while it gets into stable 🤔
04:10:39FromDiscord<Elegantbeef> `when (NimMajorVersion, NimMinorVersion) <= (1.6): ...`
04:10:42FromDiscord<Elegantbeef> `1, 6`
04:12:36FromDiscord<Hourglass [She/Her]> In reply to @Elegantbeef "But the tooling barely": Yay /s
04:14:00FromDiscord<Hourglass [She/Her]> What I don't really get is why the tools suck so bad, is it because the core of Nim is too messy and complicated to create something that works well? (Nimsuggest being what I'm mostly talking about)
04:16:10FromDiscord<Rika> Messy, not really complicated I believe
04:16:14FromDiscord<Rika> And manpower is low
04:16:27FromDiscord<Rika> No one is that willing to work on it
04:16:36*arkurious quit (Quit: Leaving)
04:19:01FromDiscord<Hourglass [She/Her]> Fair enough
05:06:33*redj joined #nim
05:20:33FromDiscord<GalacticColourisation> tooling is the part that most language ecosystems want to work on the least
05:21:25*redj quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
05:22:22*redj joined #nim
05:32:35FromDiscord<Hourglass [She/Her]> That's a shame
05:32:47FromDiscord<Elegantbeef> PR's welcome 😛
05:41:40FromDiscord<Rika> “Well if you’re willing to complain you must be willing to fix it”
05:49:52FromDiscord<Hourglass [She/Her]> In reply to @Rika "“Well if you’re willing": Bullshit, I complain about my life all the time :giggle:
05:50:07FromDiscord<Rika> OOF
05:50:35FromDiscord<Hourglass [She/Her]> But I may work on it after the chat platform, I'm trying to fix my issue of jumping from project to project :p
05:50:53FromDiscord<Hourglass [She/Her]> In reply to @Rika "OOF": Indeed
05:51:50FromDiscord<Chronos [She/Her]> Name change go brr
05:54:47FromDiscord<user2m> sent a code paste, see https://play.nim-lang.org/#ix=4t1V
06:22:12FromDiscord<Prestige> I have a `Table[float, string]`, I want to make a function return the values of this table based on the sorted values of the key (Descending). Is there a simple way to go about this?
06:27:50FromDiscord<Prestige> I have a working solution but it feels janky
06:28:58FromDiscord<demotomohiro> In reply to @user2m "when using parseFile for": You dont. You cannot close the file without file handler.
06:33:07FromDiscord<demotomohiro> In reply to @Avahe "I have a `Table[float,": `Table` doesn't have order. You would need to use `OrderedTable`: https://nim-lang.org/docs/tables.html#OrderedTable
06:33:47FromDiscord<Prestige> Isn't that just for insertion order? I just mean a way to return like, a `seq[string]` that's sorted based on the `float` values
06:33:57FromDiscord<Prestige> Sorry if my wording was poor
06:37:30FromDiscord<demotomohiro> In that, you probably dont need to use `OrderedTable`.
06:44:55FromDiscord<Elegantbeef> Probably best to `myTable.toSeq.sorted`
06:47:59FromDiscord<Prestige> yeah that's what I'm doing atm
06:56:44*azimut quit (Ping timeout: 255 seconds)
07:03:50*ltriant joined #nim
07:10:25FromDiscord<Phil> Where does nim look for dependencies link against? Does it just check $PATH?
07:10:48FromDiscord<Elegantbeef> Same as where C looks
07:11:30FromDiscord<Phil> You will not believe this beef
07:11:39FromDiscord<Phil> It will come to you as an impossible, astonishing thing
07:11:47FromDiscord<Phil> But I actually do not know where C looks either 😛
07:11:49FromDiscord<Elegantbeef> You do not know where C looks
07:12:01FromDiscord<Elegantbeef> The point of me saying that was "Go look at how C does it goofer"
07:13:22FromDiscord<Mr Gandolfio> lol chad response
07:14:45*ltriant quit (Ping timeout: 255 seconds)
07:32:20FromDiscord<Phil> ... C appears to look at ... "LIBPATH" under windows, okay
07:32:24FromDiscord<Phil> mysterious stuff
07:35:46*tiorock joined #nim
07:35:47*tiorock quit (Changing host)
07:35:47*tiorock joined #nim
07:35:47*rockcavera is now known as Guest6593
07:35:47*tiorock is now known as rockcavera
07:38:55*Guest6593 quit (Ping timeout: 268 seconds)
08:27:06FromDiscord<anddam> @ElegantBeef to pile on my answer about what I want to do with the nimgl/SDL/whateverL: on one side I'd like to "play with graphics", on the other —and reason why I picked imgui— I meant to write simple desktop app with UI to be shipped self-contained
08:27:50FromDiscord<anddam> @ElegantBeef so I figure I better split the contexts and use Nico for the former, imgui in its actual branch on the other until it gets updated (by me poking people or on its own)
08:28:33FromDiscord<Elegantbeef> Bleh using imgui for desktop apps is horrid, nigui is probably better
08:28:45FromDiscord<anddam> another approach would maybe use c2nim to wrap cimgui rather than current nimgl/imgui, the problem with the latter is that it made assumption I am not clear about, and I am not familiar enough with nim yet
08:28:51FromDiscord<Elegantbeef> or contribute to fidgetty and make that bettterrer
08:30:02FromDiscord<anddam> In reply to @Elegantbeef "Bleh using imgui for": I beg to disagree, I have used Qt to deploy a multi platform app at work
08:30:28FromDiscord<Elegantbeef> QT isnt an imgui
08:31:04FromDiscord<anddam> and reason that drew me to the latter
08:31:50FromDiscord<anddam> oh I read fidgetty is a fidget fork, that seemed extremely interesting when I went through it
08:31:57FromDiscord<anddam> layout from figma and native UIs
08:32:05FromDiscord<anddam> why did it need to be forked?
08:32:52FromDiscord<anddam> In reply to @Elegantbeef "Bleh using imgui for": the ecosystem of libraries is extremely rich, I have to say
08:33:22FromDiscord<anddam> but as often when user base is small projects seems to lose interest from their author (singular) , dry and die
08:33:40FromDiscord<anddam> In reply to @anddam "the ecosystem of libraries": that was apropos nigui
08:34:16FromDiscord<Elegantbeef> Well fidgetty is a widget API akin to native toolkits
08:34:20FromDiscord<Elegantbeef> Fidget is not
08:34:53FromDiscord<Elegantbeef> Fidgetty isnt just forked fidget it's forked and built on top of
08:35:34FromDiscord<Elegantbeef> But when it comes to UI the native stuff needs a ton of work
08:36:16FromDiscord<Elegantbeef> Another alternative to nigui is https://github.com/neroist/uing which is based off a libui fork
08:37:57FromDiscord<Elegantbeef> It statically links libui-ng and uses system gui so is relatively small
08:41:30FromDiscord<Elegantbeef> As nice as dearimgui is it's really not meant for desktop apps, people use it for it of course, but it's less than ideal
08:41:49FromDiscord<Elegantbeef> This concludes my rambling into the void
08:41:58FromDiscord<Elegantbeef> Tune in next week when we talk about the Canadian housing market
08:43:46*nanxiao joined #nim
08:45:13FromDiscord<anddam> both topics dear to me
08:45:30FromDiscord<anddam> I both have been a Void linux user for several years AND I listen to Rational Reminder podcast
08:46:00FromDiscord<anddam> tl;dr you can still get a good deal in Vancouver area
08:46:58FromDiscord<anddam> have a nice Sunday/Easter/whatever is appropriate to you
08:54:08FromDiscord<Prestige> hm nim playground down
08:59:17FromDiscord<Prestige> xml parsing is kind of a pain eh
09:01:26FromDiscord<Elegantbeef> What's the problem
09:02:38FromDiscord<Prestige> Just trying to figure out how to use parsexml
09:03:11FromDiscord<firasuke> Do we have a gallery or a post your Nim project channel?
09:03:40FromDiscord<Elegantbeef> Closest there is "This month with Nim", other than that nope
09:04:15FromDiscord<Elegantbeef> Parse it then use `xmltree` to fetch what you need
09:04:21FromDiscord<Elegantbeef> `findAll` generally is what i go for
09:05:21FromDiscord<Elegantbeef> Also maim the person giving you xml
09:06:21FromDiscord<Prestige> it's parsing data from a website so meh
09:06:55FromDiscord<Elegantbeef> Right then what are you after?
09:07:06FromDiscord<Elegantbeef> Though generally some sites can cause the parser to act odd
09:07:46FromDiscord<Prestige> I'm trying to parse all the data into a usable data structure, from https://ultimateframedata.com/mario for example
09:08:08FromDiscord<Prestige> each move has corresponding data and a gif
09:10:32FromDiscord<Elegantbeef> Seems you need to iterate until you find a `class ="moves"` then iterate and parse those
09:10:47FromDiscord<Prestige> Yeah
09:11:01FromDiscord<Prestige> I know logically what I want to do, just trying to figure out how to get the code to do it
09:11:17FromDiscord<Elegantbeef> Probably easier to use some webdriver to load the page and use JS to output a better data type 😄
09:11:52FromDiscord<Prestige> xml -> js would make it easier for sure
09:19:08FromDiscord<4zv4l> can I add a timeout on `getKey()` from `illwill` ?↵https://github.com/johnnovak/illwill
09:59:50FromDiscord<albassort> In reply to @Avahe "xml -> js would": Maybe you don't want too much help, but, you would probably scrape the pages and assemble an output. Then archive that and load it into Nim
10:00:15FromDiscord<albassort> Id probably make a database
10:02:02FromDiscord<Prestige> I just need to get the actual data loaded into a data structure, xml is just a pain to parse
10:07:16FromDiscord<albassort> HTML isn't a pain to parse you just need to know what you're doing
10:07:19FromDiscord<albassort> I'm sure it's very easy
10:07:26FromDiscord<albassort> Usually that is in a table already in the HTML
10:07:30FromDiscord<albassort> Also XML is not HTML they're different
10:09:49FromDiscord<firasuke> In reply to @Elegantbeef "Closest there is ": oh ok, thanks
10:10:24FromDiscord<Prestige> In reply to @albassort "I'm sure it's very": knock yourself out, I think it's a pain to parse xml
10:12:23FromDiscord<creative> any alternatives to nake?
10:12:32*nanxiao quit (Quit: Client closed)
10:15:00FromDiscord<creative> nevermind found https://nim-lang.org/docs/nims.html
10:16:45FromDiscord<albassort> In reply to @Avahe "knock yourself out, I": Passing HTML is a skill you need to develope
10:17:03FromDiscord<Prestige> It's not
10:17:04FromDiscord<albassort> There's specific tools which make it easier
10:17:08FromDiscord<albassort> I like to use CSS collectors
10:17:30FromDiscord<albassort> There's a library in Nim called q which you can use to parse HTML using CSS selectors which you can mostly get from your browser quite easily
10:17:38FromDiscord<albassort> That makes a lot of the process easier
10:22:48*kenran joined #nim
10:39:50*xet7 joined #nim
10:45:14*Notxor joined #nim
11:43:26*kenran quit (Remote host closed the connection)
11:44:12*ltriant joined #nim
11:44:22FromDiscord<turbo> Is there a way I can set an env var in a nimble task (for that task)?
11:47:34FromDiscord<jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=4t2C
11:47:47FromDiscord<creative> is there anything like --passld?
11:47:56*kenran joined #nim
11:48:38FromDiscord<creative> theres --passc
11:49:00FromDiscord<jmgomez> you want to pass something to the linker you mean?
11:49:25FromDiscord<creative> In reply to @jmgomez "you want to pass": yes, currently `-T src/linker.ld`
11:51:13FromDiscord<jmgomez> https://nim-lang.org/docs/nimc.html↵you can use `-l` to by pass nim and passs commands directly to the linker that you are using
11:52:11FromDiscord<creative> thanks
12:11:05FromDiscord<michaelb.eth> In reply to @creative "theres --passc": in addition to `--passC` there’s `--passL`
12:11:05FromDiscord<Marcus> Can't believe https://github.com/dom96/choosenim/pull/301 still hasn't been merged. Is choosenim abandoned?
12:14:30*jmdaemon quit (Ping timeout: 252 seconds)
12:16:29FromDiscord<Marcus> Given it's the default installation option on nim-lang.org it's a bit incomprehensible that it doesn't support arm macs (or arm linux for that matter)
12:20:28FromDiscord<jmgomez> Seems odd yeah. Dunno what's going on, I dont use chossenim anyways
12:20:37FromDiscord<jmgomez> Cant you build from sources?
12:21:00FromDiscord<jmgomez> (edit) "chossenim" => "choosenim"
12:23:01FromDiscord<turbo> choosenim doesn't need to be ARM (yet) to support M1 macs, it works just fine on those. In a year or so when amd64 is fully deprecated, that'll be an issue
12:23:26FromDiscord<Marcus> turbo\: "fine" as in it crosscompiles to x86. that's not great
12:24:00FromDiscord<jmgomez> Is not the compiler itself arm then? What's the issue?
12:25:23FromDiscord<turbo> I've been using the normal choosenim with Nim built from source (https://summarity.com/nim-2-m1) to also build universal binaries.
12:25:36FromDiscord<Marcus> the issue is it's running nim in rosetta?
12:26:40FromDiscord<turbo> (edit) "I've been using the normal choosenim with Nim built from source (https://summarity.com/nim-2-m1) to also build universal binaries. ... " added "BTW even if you have an `arm64` Nim, it will still need the proper `-target` flags to build arm binaries"
12:26:48FromDiscord<jmgomez> I dont know how choosenim works but it shouldnt be compiling nim anyways
12:27:56FromDiscord<jmgomez> Doesnt it donwload the sources and do the bootstrapping for you?
12:29:04FromDiscord<jmgomez> In reply to @turbo "I've been using the": but that's due to underlaying c compiler, isnt it? The one that builds your binaries
12:29:15FromDiscord<jmgomez> he is talking about the compiler itself
12:30:01FromDiscord<turbo> In reply to @jmgomez "but that's due to": Yes what I'm saying is: even if you have an arm64 choosenim and arm64 Nim, it still needs to know that it should produce arm64 binaries - or your final binary will be amd64/rosetta
12:31:33FromDiscord<jmgomez> In reply to @turbo "Yes what I'm saying": what's the default compiler in mac, isnt it clang? IIRC clang by default compiles to ARM or whatever you are running your shell on
12:32:25FromDiscord<turbo> In reply to @jmgomez "what's the default compiler": No, currently, you need to indicate the architecture, see: https://developer.apple.com/documentation/apple-silicon/building-a-universal-macos-binary#Update-the-Architecture-List-of-Custom-Makefiles
12:33:34FromDiscord<Marcus> On arm64 linux I've installed nim through nixos, and it generates arm64 binaries
12:33:52FromDiscord<Rika> Well that’s through Nix and not choose Nim
12:34:20FromDiscord<Marcus> Right, because choosenim just goes 'arm64-linux isn't a supported target.
12:34:50FromDiscord<Marcus> My point was just that arm64-linux nim generates arm64-linux binaries by default
12:34:57FromDiscord<Rika> Dom has pretty much disassociated with Nim by now
12:35:14FromDiscord<Rika> I’d say anything he made is abandoned and should prolly be forked or replaced
12:35:15FromDiscord<turbo> macOS: https://gist.github.com/turbo/952376af01669711fcd3500872691e94
12:35:56FromDiscord<jmgomez> In reply to @turbo "No, currently, you need": I need to double check it (Im on win now) but it does for me though. I created some aliases that allows you to switch between archs, and it compiles based on that arch. Telling you because when using sutff like PCH they need to be compiled with the same compiler. Not just for producing a binary (which may be a bit of a different process)
12:36:02FromDiscord<Marcus> Rika\: That's a bummer \:-/
12:37:01FromDiscord<jmgomez> And that's why core projects should live under an organization rather than individuals
12:37:37FromDiscord<Marcus> jmgomez\: Yeah, I think choosenim should be forked to the nim-lang org
12:38:01FromDiscord<Marcus> (if it's going to continue to be the officially supported install method)
12:39:01FromDiscord<Nerve> Should? It seems beyond question
12:39:41FromDiscord<Rika> It is pretty much a must
12:42:24FromDiscord<Marcus> image.png https://media.discordapp.net/attachments/371759389889003532/1094603216982908968/image.png
12:42:25FromDiscord<Marcus> I tried using nix based arm64 nim to see if it generates arm64 binaries by default, but unfortunately it didn't go that great. \:)
12:43:33FromDiscord<Marcus> ok, tested with a hello world, arm`nim c` on a m1 mac generates a arm binary
13:55:35FromDiscord<System64 ~ Flandre Scarlet> Is there a good Nim LSP for vim/nvim?
13:56:15*ismustachio joined #nim
13:57:54*azimut joined #nim
13:58:57FromDiscord<Marcus> currenty only nimlsp is supported by nvim-lspconfig, and it's broken in Nim 1.6.12. \:-/ (due to a bug in nimsuggest)↵(@System64 ~ Flandre Scarlet)
13:59:19FromDiscord<System64 ~ Flandre Scarlet> In reply to @Marcus "currenty only nimlsp is": And does it work with Nim2?
14:00:59FromDiscord<System64 ~ Flandre Scarlet> https://www.youtube.com/watch?v=Mtgo-nP_r8Y↵I also used this tutorial to setup vim
14:01:05FromDiscord<System64 ~ Flandre Scarlet> (edit) "vim" => "nvim"
14:05:44*ismustachio quit (Ping timeout: 250 seconds)
14:07:18*ismustachio joined #nim
14:10:14FromDiscord<Marcus> I would think so as the fix was merged to devel↵(@System64 ~ Flandre Scarlet)
14:17:27FromDiscord<System64 ~ Flandre Scarlet> Oh alright, thanks
14:21:40FromDiscord<Chronos [She/Her]> My python code is screwing me over, is this a sign to port it to Nim? Lmao
15:15:44FromDiscord<Dudugz> In reply to @Hourglass, When the Hour Strikes "Ah yes, I too": No lol, i mean developing your own client, not a discord mod. For matrix this doesn't seem to be against tos
15:16:29FromDiscord<Ecorous> May I ask why I'm not included in this? <https://github.com/nim-lang/Nim/graphs/contributors?from=2008-08-17&to=2023-04-09> I contributed to `lib/std/private/osappdirs.nim`
15:19:41FromDiscord<Ecorous> Also, should the code I added (`getDataDir()`) be added to `lib/std/appdirs.nim`? I can throw another PR in to do so if it's wanted
15:21:00FromDiscord<Ecorous> I'll do the PR now; then if it's rejected so be it
15:32:59FromDiscord<jmgomez> Likely because you have less than the required commits to be listed in the first 100
15:39:28*luis_ joined #nim
16:08:07FromDiscord<Dudugz> In reply to @Hourglass, When the Hour Strikes "My python code is": Yes lol, screw python
16:08:40FromDiscord<Dudugz> (edit) "screw" => "forget"
16:10:29*lucasta joined #nim
16:14:49FromDiscord<Dudugz> sent a code paste, see https://play.nim-lang.org/#ix=4t3y
16:15:21FromDiscord<Dudugz> Obviously the function would be static, I think enums can only be generated at compile-time
16:16:05FromDiscord<aquova> Quick question, is there a way to limit generics to have a specific subset of types? For example, I want a generic function that only applies to unsigned values, not signed?
16:16:39FromDiscord<jmgomez> In reply to @Dudugz "Is there any macro": anything that Im aware of but sounds easy to implement
16:16:51FromDiscord<jmgomez> In reply to @aquova "Quick question, is there": type classes
16:19:00FromDiscord<jmgomez> https://nim-lang.org/docs/manual.html#generics-type-classes
16:19:07FromDiscord<Dudugz> In reply to @aquova "Quick question, is there": [T: unsgined]?
16:19:17FromDiscord<Dudugz> (edit) "unsgined]?" => "unsigned]?"
16:19:25FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4t3A
16:19:53FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=4t3A" => "https://play.nim-lang.org/#ix=4t3B"
16:20:23FromDiscord<aquova> interesting. I shall try that
16:21:15FromDiscord<Dudugz> sent a code paste, see https://play.nim-lang.org/#ix=4t3C
16:22:27FromDiscord<Dudugz> In reply to @Dudugz "Is there any macro": Beef may know smth about this, i'll ask later
16:23:24FromDiscord<Phil> Isn't that what's called a hole-y enum or sth?
16:24:00FromDiscord<aquova> They look like two different ways to accomplish the same thing
16:24:10FromDiscord<Dudugz> non-holy enum i think, idk why tho
16:24:44FromDiscord<Dudugz> But in my case I just want to generate an enum automatically without manually creating the values
16:25:01FromDiscord<Dudugz> Before 8196 it's easy but after...
16:25:08FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4t3E
16:25:15FromDiscord<Dudugz> Yea just a macro to auto do this
16:25:17FromDiscord<jmgomez> holy enums are c-like enums
16:25:47FromDiscord<Phil> You want all enums automatically to start at 1 instead of 0?
16:25:52FromDiscord<jmgomez> In reply to @Dudugz "Yea just a macro": again, that's trivial to implement. Are you familiar with macros?
16:26:32*arkurious joined #nim
16:26:33FromDiscord<Dudugz> sent a code paste, see https://play.nim-lang.org/#ix=4t3F
16:26:51FromDiscord<Dudugz> In reply to @jmgomez "again, that's trivial to": Not much and I can't test it right now
16:27:46FromDiscord<Dudugz> (edit) "https://play.nim-lang.org/#ix=4t3F" => "https://play.nim-lang.org/#ix=4t3G"
16:29:17FromDiscord<Dudugz> sent a code paste, see https://play.nim-lang.org/#ix=4t3I
16:29:28FromDiscord<huantian> sent a code paste, see https://play.nim-lang.org/#ix=4t3J
16:29:44FromDiscord<huantian> Idk I’m not good at imitating beef
16:29:57FromDiscord<Dudugz> lol i'm not also, he's smart
16:30:15FromDiscord<Dudugz> I don't understand much about macros yet although I'm thinking of learning
16:30:46FromDiscord<Phil> TBH to me this looks like a mapping of enum to a specific value and thus a compile-time table that associates that enum with that int
16:31:37FromDiscord<Dudugz> Hmm, yea, I would describe it as: Ability to create an enum where auto-incrementer is replaced by a developer defined custom incrementer
16:32:02FromDiscord<huantian> Check if casting set of a normal enum (without the manual 2^ values)
16:32:06FromDiscord<Dudugz> Because enums by default do auto increment (N + 1) and in my case I wish I could change that logic.
16:36:59FromDiscord<Dudugz> sent a code paste, see https://play.nim-lang.org/#ix=4t3R
16:37:17FromDiscord<Dudugz> (edit) "https://play.nim-lang.org/#ix=4t3R" => "https://play.nim-lang.org/#ix=4t3S"
16:37:25FromDiscord<Dudugz> (edit) "https://play.nim-lang.org/#ix=4t3S" => "https://paste.rs/g1n"
16:38:29FromDiscord<Rika> are you trying to make an enum for setting options like in C
16:38:33FromDiscord<Rika> powers of two are suspicious
16:39:03FromDiscord<Dudugz> lol, maybe, I don't think it's suspicious tho lol if you're doing a permissions system using bitwise it's completely normal
16:39:12FromDiscord<Dudugz> Discord does this
16:39:25FromDiscord<Dudugz> All discord permissions are power of 2
16:39:34FromDiscord<Rika> yes, but suspicious as in thats not how enums should be used in nim
16:39:51FromDiscord<djazz> set[MyEnum]
16:40:02FromDiscord<Dudugz> Hmm, maybe, but if you want an enum of permissions is the best way to have it in code
16:40:13FromDiscord<Rika> no, a set of that enum would be better
16:40:24FromDiscord<Dudugz> why?
16:40:33FromDiscord<Rika> because nim sets are bitsets
16:40:46FromDiscord<Dudugz> hmm, but what about autocomplete?
16:40:57FromDiscord<Rika> what about autocomplete?
16:41:17FromDiscord<Dudugz> Ok i don't get the idea of set of enum lol, can u show me an example?
16:41:21FromDiscord<jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=4t3U
16:41:27FromDiscord<Rika> jm, no
16:41:57FromDiscord<jmgomez> (edit) "https://play.nim-lang.org/#ix=4t3U" => "https://play.nim-lang.org/#ix=4t3W"
16:42:31FromDiscord<Rika> sent a code paste, see https://play.nim-lang.org/#ix=4t3X
16:42:47FromDiscord<jmgomez> Yeah, that's what one would normally do. He asked the above though
16:42:50FromDiscord<Dudugz> Hm
16:43:05FromDiscord<Rika> yes, and i'm showing that it is better to do this
16:43:22FromDiscord<Dudugz> In reply to @jmgomez "Yeah, that's what one": 🤷‍♂️ I had no idea how to do it right.
16:43:43FromDiscord<Dudugz> If in this case it's better to use set then I'll do it like this
16:44:12FromDiscord<jmgomez> Yeah, it is. It's a good example to grasp the power of macros too. So save it for later 😉
16:44:23FromDiscord<Dudugz> Sure thx
16:44:34FromDiscord<Dudugz> I will definitely study macros later
16:45:08FromDiscord<Rika> i'm a bit rusty with nim so i dont 100% know if what i wrote is syntactically correct anymore but oh well, i'm confident to 97%
16:45:35FromDiscord<jmgomez> In reply to @Rika "i'm a bit rusty": what have been you using instead?
16:45:50FromDiscord<Rika> nothing, i havent programmed in maybe a month now
16:45:51FromDiscord<Dudugz> Sure thx, at least now I have a path to follow lol, I thought it was better than researching and ending up doing it wrong to have to refactor
16:45:52FromDiscord<Rika> i'm just tired
16:45:58FromDiscord<Rika> before that i was doing elixir
16:46:45FromDiscord<Dudugz> I'm working on a project in Nim, I can't stand still with regard to programming 😅 if I get tired of a language I go to another but honestly Nim captivated me.
16:47:32FromDiscord<Rika> i'm not tired of a language, i'm just tired
16:47:45FromDiscord<Dudugz> got it
17:05:30FromDiscord<dlesnoff> sent a code paste, see https://play.nim-lang.org/#ix=4t43
17:07:08FromDiscord<djazz> sent a code paste, see https://play.nim-lang.org/#ix=4t44
17:07:29FromDiscord<dlesnoff> sent a code paste, see https://play.nim-lang.org/#ix=4t45
17:07:52FromDiscord<djazz> Try uint8
17:08:00FromDiscord<dlesnoff> To avoid the use of cast, I would use a table
17:08:00FromDiscord<djazz> Or set enum size? Maybe
17:08:00FromDiscord<Rika> In reply to @djazz "Hmm is there a": well no unfortunately
17:08:09FromDiscord<Rika> sent a code paste, see https://play.nim-lang.org/#ix=4t46
17:08:10FromDiscord<Rika> cast uint8
17:08:23FromDiscord<Rika> In reply to @Jiezron "To avoid the use": it is wasteful though
17:08:42FromDiscord<dlesnoff> We could store each conversion value, since there is not that much settings value if I understand
17:09:48FromDiscord<dlesnoff> We only store 256 values at max. A tab index array is sure more costful than a simple cast, but we can do bounds checking if I am not mistaken.
17:23:31FromDiscord<dlesnoff> Ok a uint8 is better
17:26:07FromDiscord<HitBlast> While compiling with `asyncdispatch` imported as a dependency, I get this error. Any thoughts? I've also received a fair share of bare-except warnings from the very same module as well. https://media.discordapp.net/attachments/371759389889003532/1094674616657649684/Screenshot_2023-04-09_at_11.24.56_PM.png
17:43:32FromDiscord<Saint> In reply to @Rika "before that i was": How’s exilr?
17:43:37FromDiscord<Saint> Do you have a favorite lisp
17:43:43FromDiscord<Rika> it is a treat other than typing
17:43:45FromDiscord<Saint> Unrelated question
17:43:47FromDiscord<Rika> no i do not write lisps
17:43:50FromDiscord<Saint> In reply to @Rika "it is a treat": Nice
17:44:03FromDiscord<Saint> In reply to @Rika "no i do not": Gotcha
17:44:05FromDiscord<Rika> typing as in types not the act of typing
17:44:30FromDiscord<Rika> only needs (gradual) static typing and i'd prolly be completely content
17:57:40FromDiscord<Saint> Ah i see
18:21:19FromDiscord<Chronos [She/Her]> In reply to @Dudugz "No lol, i mean": Ah alright
18:39:49FromDiscord<Gumbercules> In reply to @Rika "only needs (gradual) static": There's always gleam. And Elixir does have gradual typing options
18:40:20FromDiscord<Rika> I do not like the syntactical changes Gleam makes
18:40:57FromDiscord<Rika> I know about the type check package but it is a little buggy and slow, and there is extra overhead when using types not defined with the macro it provides
18:48:39FromDiscord<Gumbercules> Well I don't think you're ever going to get a statically typed Elixir
18:49:51FromDiscord<willyboar> Gleam has maybe the best community in programming languages.
18:50:50FromDiscord<Gumbercules> Maybe someone will write a backend for Nim that compiles to Erlang
18:51:59FromDiscord<willyboar> Nah I don't think it will.
18:54:38FromDiscord<willyboar> But gleam take steps forward and there is plan (long term) to native compilation
18:57:46FromDiscord<Gumbercules> Yeah I'm excited about Gleam and I use Elixir at work already
18:58:17FromDiscord<Gumbercules> Also planning on using it for hobby work once I get back to hobby work
18:58:26FromDiscord<Gumbercules> Elixir I mean
18:58:50FromDiscord<willyboar> Me too. I spending a lot of time in the community. I hope to also find time for some hobby projects.
18:59:42FromDiscord<Gumbercules> I really want to write a shadowbane server in Elixir haha
19:01:05FromDiscord<Gumbercules> But that whole time thing... Might be a fun way to create the backend for a future MMO project though. My love for Shadowbane needs to re manifest itself however
19:01:27FromDiscord<Gumbercules> Right now it just sounds like a lot of work
19:04:07FromDiscord<jmgomez> IMHO compiling Nim to Erlang will be a killer project. Love the idea. It's such a nice match
19:04:51FromDiscord<jmgomez> like if you have to do heavy computations you can do regular Nim otherwise you can live the Erlang VM and share code across all three (including js)
19:08:34Amun-RaI haven't switched from erlang to elixir, not a fan of rubish syntax
19:09:24FromDiscord<Gumbercules> And ^ is a God
19:09:40FromDiscord<willyboar> I never liked elixir syntax.
19:10:17FromDiscord<Gumbercules> Well Erlang syntax sucks donkey balls
19:10:44FromDiscord<Gumbercules> But I also get being turned off by Elixir, it is definitely heavily inspired by Ruby
19:10:51FromDiscord<willyboar> Yes I but I like gleam's a lot
19:11:04FromDiscord<Gumbercules> But it's also very well designed and I'd rather code in Elixir than Erlang any day of the week.
19:11:48FromDiscord<Gumbercules> But to each their own. There's room for all of us on the BEAM
19:12:44FromDiscord<Gumbercules> In reply to @jmgomez "like if you have": Well you can already use Nim with Erlang but the whole sharing code thing, not so much
19:13:04FromDiscord<willyboar> I would like a nim flavor syntax in a BEAM language
19:13:15FromDiscord<jmgomez> In reply to @Gumbercules "Well you can already": I know, via FFI but that's defeat the purpose..
19:13:43FromDiscord<jmgomez> (edit) "that's defeat" => "that defeats"
19:13:54FromDiscord<Gumbercules> In reply to @willyboar "I would like a": If only Nims compiler backend wasn't as complex as it is....
19:14:24FromDiscord<Gumbercules> Maybe that mini Nim compiler project is a good starting point
19:14:25FromDiscord<willyboar> In reply to @Gumbercules "If only Nims compiler": I know. I mean a totally new language.
19:14:57FromDiscord<Gumbercules> Well it'd be better for Nim if it was still Nim
19:15:15FromDiscord<Gumbercules> But yeah, unless someone feels very ambitious, I don't see it happening
19:15:43FromDiscord<Gumbercules> Or unless someone offers up a whole bunch of $$$
19:15:59FromDiscord<Gumbercules> If someone pays my salary for a year I'll quit and do it
19:16:05FromDiscord<willyboar> Maybe implementation of the language be in Nim 😜
19:16:08FromDiscord<Gumbercules> Well, salary and benefits haha
19:16:17FromDiscord<Gumbercules> Got a kid after all...
19:16:38FromDiscord<willyboar> I know what you mean. I have 4
19:16:39FromDiscord<jmgomez> Of what mini compiler are you talking about?
19:16:52FromDiscord<Gumbercules> In reply to @willyboar "Maybe implementation of the": Could certainly write a compiler in Nim
19:17:00FromDiscord<Gumbercules> In reply to @jmgomez "Of what mini compiler": Sec...
19:17:31FromDiscord<willyboar> In reply to @Gumbercules "Could certainly write a": Sure but still a lot of work
19:17:35FromDiscord<jmgomez> What does it takes though? Compile Nim to erlang +build the std + create a bindings mechanism? Am I missing something else?
19:18:17FromDiscord<Gumbercules> https://github.com/pmetras/nim0
19:18:21FromDiscord<jmgomez> the worst part would be to do all that and see that Nim compile tiems itself is too slow because the lacking of IC 😛
19:19:14FromDiscord<Gumbercules> In reply to @jmgomez "the worst part would": Isn't gleam implemented in Scala or something?
19:19:17FromDiscord<jmgomez> ohh cool, I think I saw it in the past from the oberon book. Definitely great material to study from thanks!
19:19:22FromDiscord<Gumbercules> I can't remember wtf the author was using....
19:19:34FromDiscord<willyboar> In reply to @Gumbercules "Isn't gleam implemented in": Rust
19:20:21FromDiscord<jmgomez> but wdym like writing it from scratch? Why just dont write a backend?
19:21:49FromDiscord<willyboar> Gleam already have IC and creator improves a lot LSP
19:21:56FromDiscord<Rika> Why does it seem like I’m the only one who doesn’t like Gleam’s syntax
19:23:06FromDiscord<willyboar> In reply to @Rika "Why does it seem": I believe there are more 🤣🤣
19:23:26FromDiscord<Rika> Sure hope so
19:24:39FromDiscord<willyboar> In reply to @jmgomez "but wdym like writing": I am talking about Nim flavor syntax not support all Nim features.
19:25:09FromDiscord<Rika> I don’t know, I also really like Elixir’s syntax
19:25:26FromDiscord<willyboar> I don't 😜
19:26:01FromDiscord<Rika> I can understand why but not see why
19:26:09FromDiscord<jmgomez> In reply to @willyboar "I am talking about": gotcha, alghout the cool features of Nim before interop are at comp time
19:26:17FromDiscord<jmgomez> (edit) "before" => "besides"
19:27:16FromDiscord<willyboar> Well both are interesting projects and both need a lot of work.
19:29:42FromDiscord<Gumbercules> I generally wouldn't use Nim for the same problems Id use Elixir to solve
19:29:55FromDiscord<Rika> And vice versa
19:29:58FromDiscord<willyboar> In reply to @Gumbercules "Isn't gleam implemented in": First prototypes was in Erlang but then switched to rust iirc because of distribution
19:30:16FromDiscord<Rika> In reply to @willyboar "First prototypes was in": Makes sense
19:30:17FromDiscord<Gumbercules> Mostly because Nim doesn't have a good web story
19:30:38FromDiscord<Rika> In reply to @Gumbercules "Mostly because Nim doesn't": Oh man this is so painfully true lol
19:30:40FromDiscord<Gumbercules> And Elixir has an amazing one
19:30:48FromDiscord<Gumbercules> Well Erlang too
19:31:11FromDiscord<willyboar> Nim makes steps forward in web Dev but they are baby steps
19:31:16FromDiscord<Gumbercules> If I'm doing any non-realtime or near realtime server work, Id pick Elixir or Erlang
19:31:32FromDiscord<jmgomez> In reply to @Gumbercules "I generally wouldn't use": can you elaborate, semantically speaking what can do Elixir that Nim cant?
19:31:38*kenran quit (Remote host closed the connection)
19:31:53FromDiscord<Gumbercules> It's not that name can't do them it's that it's much easier to do them in Erlang or Elixir
19:31:53FromDiscord<jmgomez> It isnt like Elixir is Idris or something like that..
19:32:04FromDiscord<jmgomez> Like dynanism?
19:32:06FromDiscord<Gumbercules> It has very little to do with typing
19:32:08FromDiscord<Rika> In reply to @jmgomez "can you elaborate, semantically": It’s not that Nim can’t do it, it just can’t do some things well
19:32:20FromDiscord<Gumbercules> No like be built around the actor model and have a very rosy concurrency picture
19:32:43FromDiscord<jmgomez> But that isnt a feature of the lang, that's part of infra. Isnt it?
19:32:54FromDiscord<Gumbercules> Well it's mostly OTP
19:33:21FromDiscord<Gumbercules> But the beam does have a lot to do with other nice features that language is running on it benefit from
19:33:22FromDiscord<jmgomez> Yeah, but what semantics required OTP that doesnt make nim suitable for the task?
19:33:47FromDiscord<Gumbercules> Well these are the things that make elixir in Erlang attractive in the first place and what makes anyone choose them over another language
19:33:51FromDiscord<Gumbercules> Supervision hierarchies
19:33:56FromDiscord<Gumbercules> The actor model
19:34:05FromDiscord<Gumbercules> Being able to hot patch running processes
19:34:15FromDiscord<jmgomez> that seems to me orthogonal to the conversation
19:34:24FromDiscord<Gumbercules> I don't understand what the conversation is at this point
19:34:37FromDiscord<Gumbercules> You're asking why I would choose elixir or Erlang over NIM for certain tasks
19:34:44FromDiscord<jmgomez> just at the semantic level, what constructs has elixir that make it play nice with OTP/beam
19:35:16FromDiscord<jmgomez> No, that's easy to get..
19:35:24FromDiscord<Gumbercules> I mean nothing over Erlang or other languages
19:35:32FromDiscord<Gumbercules> But I was never arguing that it did
19:35:59FromDiscord<Gumbercules> I was just saying I wouldn't use Nim for certain problems and I wouldn't use elixir or Erlang for other problems and in general the problems I want to solve with them aren't the problems I want to solve with elixir and vice versa
19:36:14FromDiscord<Gumbercules> (edit) "them" => "Nim"
19:36:41FromDiscord<jmgomez> yeah, yeah, I agree with that. I was just trying to understand if there is something intrinsic to the lang that cant be replicated in Nim (in case you ported it to beam)
19:36:50FromDiscord<Gumbercules> Not that they can't be
19:36:56FromDiscord<Gumbercules> I got you
19:37:29FromDiscord<Gumbercules> No I think besides being a well-designed language and being very expressive you could replace elixir with whatever language on the beam and have as much success
19:37:32FromDiscord<Rika> I mean a spoon could probably fly into space had you morphed it into a rocket
19:38:02FromDiscord<Gumbercules> But there have been a couple attempts at writing statically typed languages on that virtual machine gleam being one of them
19:38:08FromDiscord<Gumbercules> The other being alpaca
19:38:25FromDiscord<Gumbercules> From my understanding it's a difficult prospect for a number of reasons but I couldn't list them you'd be better off asking the author of gleam
19:38:40FromDiscord<jmgomez> I played with Elixir and Phoenix like 7 years ago. I liked it but never used it in prod
19:38:53FromDiscord<jmgomez> wasnt alpaca ml based?
19:39:07FromDiscord<Gumbercules> Yeah we use both at work and it's a very productive combination
19:39:18FromDiscord<Gumbercules> And very enjoyable to work on
19:39:29FromDiscord<Rika> In reply to @jmgomez "I played with Elixir": 7 years do be a long time
19:39:38FromDiscord<Rika> Can you imagine Nim 7 years ago
19:39:46FromDiscord<Gumbercules> In reply to @jmgomez "wasnt alpaca ml based?": Yup
19:39:51FromDiscord<Gumbercules> In reply to @Rika "Can you imagine Nim": I can
19:39:56FromDiscord<Gumbercules> Because I was using it
19:39:58FromDiscord<Rika> In reply to @Gumbercules "I can": You don’t need to
19:40:00FromDiscord<Rika> You were there
19:40:01FromDiscord<willyboar> @jmgomez you can join gleam server. Author is very cool and will answer any question.
19:40:01FromDiscord<jmgomez> In reply to @Rika "7 years do be": yeah even wrote a post http://jmgomez.me/one-flew-over-the-phoenixs-nest/ 😛
19:40:03FromDiscord<Gumbercules> Yah
19:40:18FromDiscord<jmgomez> In reply to @willyboar "<@726017160115126333> you can join": thanks, I have enough in my plate with NUE though
19:40:27FromDiscord<Gumbercules> Yeah the Gleam author is quite a nice person
19:40:44FromDiscord<Gumbercules> Based on my interactions with them anyway
19:41:32FromDiscord<jmgomez> In reply to @Gumbercules "Because I was using": how old is it? you should be one of the first users
19:41:56FromDiscord<Rika> Nim was public at 2009
19:42:59FromDiscord<ricky> Nim was god tier already in 2009
19:43:05FromDiscord<ricky> now look at it..
19:43:09FromDiscord<ricky> we are ascended
19:43:29FromDiscord<Gumbercules> It was called Nimrod back then
19:43:32FromDiscord<Gumbercules> In 2009
19:43:56FromDiscord<Gumbercules> 2015 is when I first looked at it and 2016 is when I wrote frag with bgfx
19:44:34FromDiscord<Gumbercules> Actually I probably first saw Nim in like 2012 from talking to someone in the roguelike dev irc
19:45:00FromDiscord<Gumbercules> Probably tommy ettinger who does a lot of libgdx shit
19:45:01FromDiscord<willyboar> I found it a lot later. I think I saw it first time around 2018
19:45:30FromDiscord<Gumbercules> Yeah it started getting a lot more users around that time
19:46:17FromDiscord<Gumbercules> Arc/Orc weren't even wet dreams for Nim at the point I started using it
19:47:03FromDiscord<Gumbercules> We had the thread local heap GC and Boehm and that was it
19:47:41FromDiscord<Gumbercules> Originally Nims compiler was written in Pascal I think and it also had a PHP backend
19:47:54*kenran joined #nim
19:47:57FromDiscord<willyboar> In reply to @Gumbercules "Yeah it started getting": Great times. I loved Nim community back then.
19:52:32FromDiscord<jmgomez> In reply to @Gumbercules "Originally Nims compiler was": really? lol
19:55:57FromDiscord<Gumbercules> In reply to @jmgomez "really? lol": Yup!
19:56:39*xet7 quit (Remote host closed the connection)
19:56:42FromDiscord<Gumbercules> https://news.ycombinator.com/item?id=25242926
19:57:06FromDiscord<Gumbercules> https://github.com/nim-lang/Nim/issues/10937
19:57:10FromDiscord<jmgomez> the Pascal bit I can understand, IIRC that oberon paper was using it. But why you would want to compile to PHP
19:57:58FromDiscord<jmgomez> intersting though
19:58:02FromDiscord<Gumbercules> Apparently people still wanted to in 2019
19:58:19FromDiscord<jmgomez> so it doesnt seem like that big of a task to build a backend? I dont know what to think
19:58:46FromDiscord<Gumbercules> It's mostly the codegen
19:59:15FromDiscord<Gumbercules> But uhhh I'm also not a compiler developer
19:59:19FromDiscord<jmgomez> the thing is to adventure to something like that you need to make sure that nim can compiler a lot of stuff really fast
19:59:46FromDiscord<jmgomez> (edit) "make sure" => "be certain"
20:00:09FromDiscord<Gumbercules> Because you want to have a repl?
20:00:11FromDiscord<Gumbercules> Or....
20:00:45FromDiscord<Gumbercules> If you're compiling to Erlang and not bytecode you're also going to need to invoke the Erlang compiler
20:01:53FromDiscord<jmgomez> yeah, you need to match the host tooling if you want to make it better. A bit related, I wanted to explore to autogenerate nim code to do interop with a dotNet dll. But didnt attempt to it because I want to do it at macro time and without IC it will take a while per dll
20:06:43FromDiscord<willyboar> How close Nim is to IC ? I don't watch the progress
20:07:12FromDiscord<Gumbercules> I don't know how much faster IC is going to make anything either
20:08:03FromDiscord<Gumbercules> In reply to @willyboar "How close Nim is": I'm not sure there's a way to track atm
20:08:08FromDiscord<jmgomez> They say it's the next thing after 2.0
20:08:31FromDiscord<jmgomez> https://github.com/nim-lang/RFCs/issues/503
20:08:55FromDiscord<Elegantbeef> IC should make tooling a tinge better in theory atleast
20:09:02FromDiscord<jmgomez> In reply to @Gumbercules "I don't know how": My bet is that it will speed heavy macro code too
20:09:04FromDiscord<willyboar> I think there are a lot of things Nim core team has to solve. Tooling is one of them
20:09:11FromDiscord<jmgomez> (edit) "In reply to @Gumbercules "I don't know how": My bet is that it will speed ... heavy" added "up"
20:09:51FromDiscord<willyboar> Also there are some problems with Dom's libraries
20:10:19FromDiscord<Elegantbeef> If you're talking about jester's bugs methinks that's not Orc related 😄
20:10:49FromDiscord<Elegantbeef> I mean it is orc related, but it probably comes down to some refc vs. orc differences
20:10:53FromDiscord<jmgomez> sup beef, FYI you were right yesterday. The test was failing for good reason, was just too late. Fixed it and seems to be fine now. Not sure if there will be any other edge case, let me know if you can think of any
20:11:00FromDiscord<Elegantbeef> I havent actually looked into it other than ringabout's mim repro
20:11:26*kenran quit (Remote host closed the connection)
20:11:27FromDiscord<willyboar> In reply to @Elegantbeef "If you're talking about": No I don't care about jester. Choosenim is more crucial
20:12:12FromDiscord<willyboar> Jester can be forked or use an alternative. Same with httpbeast
20:12:22FromDiscord<Elegantbeef> gitnim exists 😛
20:12:45FromDiscord<Gumbercules> https://alexandruburlacu.github.io/posts/2021-05-07-elixir-pattern-matching-magic
20:14:01FromDiscord<willyboar> In reply to @Elegantbeef "gitnim exists 😛": I don't think Nim will adopt a disruptek library 🤣
20:14:23FromDiscord<Gumbercules> @jmgomez Elixir does have some pattern matching features which can make socket / network programming more pleasant
20:14:39FromDiscord<Gumbercules> That blog post goes over this toward the end
20:15:56FromDiscord<Gumbercules> This coupled with OTP provides a really solid footing for server side development
20:17:32FromDiscord<Elegantbeef> Choosenim doesnt fetch arm builds on mac yet does it?
20:18:14FromDiscord<jmgomez> nice, PM at this point is a mainstream feature though. Just happens that Nim sucks at it
20:18:33FromDiscord<willyboar> I don't know. I have an old Mac and also had some problems with it.
20:19:13FromDiscord<Elegantbeef> Really a rewrite needs to be done that uses libgit and system request libraries like puppy
20:19:23FromDiscord<jmgomez> In reply to @Elegantbeef "Choosenim doesnt fetch arm": the point is that it's odd that a core app of the lang is listed under a repo of an individual that doesnt even belong to the community
20:24:06FromDiscord<willyboar> In reply to @jmgomez "the point is that": Totally agree. Nim core team must communicate with dom to transfer choosenim to the official org. Second option is to fork it.
20:24:28FromDiscord<Gumbercules> In reply to @jmgomez "nice, PM at this": No the binary pattern matching is the thing...
20:25:17FromDiscord<Gumbercules> Erlang and Elixir can match on binary data
20:25:25*lucasta quit (Quit: Leaving)
20:26:09FromDiscord<willyboar> In reply to @jmgomez "nice, PM at this": I thought you talk about package manager
20:26:25FromDiscord<willyboar> (edit) "In reply to @jmgomez "nice, PM at this": I thought you talk about package manager ... " added "🤣😜"
20:26:52FromDiscord<jmgomez> In reply to @willyboar "I thought you talk": can apply too haha
20:28:10FromDiscord<jmgomez> In reply to @Gumbercules "Erlang and Elixir can": ah missed that, do you mind showing an example?
20:29:30FromDiscord<jmgomez> okay, Im seeing it on the article, seems cool. But cant you create a macro for that?
20:29:34FromDiscord<Gumbercules> There is one toward the end of the article I linked
20:30:23FromDiscord<Gumbercules> In Erlang or Elixir? I'm not sure if it's implemented as a macro or not
20:30:23FromDiscord<AmjadHD> sent a code paste, see https://play.nim-lang.org/#ix=4t4y
20:30:52FromDiscord<jmgomez> In reply to @Gumbercules "In Erlang or Elixir?": I mean in Nim, to the point of our prev conversation
20:31:40FromDiscord<Gumbercules> Oh, well... Sure but that's not really the point
20:32:27FromDiscord<jmgomez> it was, we were exploring the idea of the limitation of using Nim compiling to Erlang
20:32:42FromDiscord<Gumbercules> These are just features that make writing netcode in Erlang or Elixir that much nicer.
20:34:09FromDiscord<Gumbercules> Well that was one thread of conversation but when I linked you the article I was just attempting to point out features of Elixir that make it better suited for certain types of work. I already explained that I don't think Elixir does anything semantically that Nim couldn't.
20:34:39FromDiscord<Gumbercules> But Nim is not on the BEAM and might not ever be so there's not much point in conjecture beyond that I think
20:34:55FromDiscord<jmgomez> Gotcha, I thought you came with something with it. But yeah, I know Elixir/Erlang is built around networking and will excel at it
20:35:04FromDiscord<Gumbercules> Originally we were all just comparing gleam and elixir and erlang
20:36:00FromDiscord<jmgomez> (edit) "Gotcha, I thought you came with something ... with" added "new"
20:36:17FromDiscord<willyboar> There are lot of users working on web Dev related projects in gleam.
20:36:19FromDiscord<Gumbercules> A certain someone was doing an experiment with Nim related to this convo
20:37:23FromDiscord<Gumbercules> https://github.com/zevv/actors
20:37:31FromDiscord<jmgomez> In reply to @Gumbercules "But Nim is not": so no one can convince you to start the project? 😛 It will be cool to share the code for the backend of your engine
20:38:23FromDiscord<willyboar> In reply to @Gumbercules "https://github.com/zevv/actors": Zevv introduce gleam to me 😜
20:42:49FromDiscord<Gumbercules> In reply to @jmgomez "so no one can": Hahaha no way... Too much work with too little upside
20:46:44FromDiscord<EchoPouet> In reply to @willyboar "Totally agree. Nim core": Fork it and call it NimUp
20:46:58FromDiscord<Gumbercules> I barely have time to figure out why my Jolt physics bindings aren't working - in fact I don't have time because I still haven't figured it out yet... Maybe tonight, as I say every afternoon lately
20:47:19FromDiscord<Gumbercules> Just start over with Nimble and Choosenim imo
20:47:30FromDiscord<Gumbercules> And yeah don't call it Choosenim either
20:47:39FromDiscord<Gumbercules> Fight club was cool and all but...
20:48:15FromDiscord<willyboar> In reply to @PotAuFeu "Fork it and call": Not a chance!
20:48:37FromDiscord<Gumbercules> Call it cush
20:48:49FromDiscord<Gumbercules> Just go back to Biblical shit
20:49:09FromDiscord<Gumbercules> It's easy
20:50:21FromDiscord<willyboar> I don't plan to fork any project. Nim team must fork at least choosenim
20:50:36FromDiscord<Elegantbeef> Nah call it sinai
20:51:04FromDiscord<Gumbercules> Even better call it ham
20:51:10FromDiscord<willyboar> Cain is the best fit. The new one kill his brother choosenim
20:51:16FromDiscord<Gumbercules> Til Nimrod was the grandson of Ham
20:51:48FromDiscord<Gumbercules> https://media.discordapp.net/attachments/371759389889003532/1094726377518927893/Screenshot_20230409-155137_Chrome.jpg
21:01:44*jmdaemon joined #nim
21:02:31*Notxor quit (Remote host closed the connection)
21:19:29FromDiscord<ricky> had a fever dream I could link static SSL on Win x64-64
21:19:42FromDiscord<ricky> :nimAngry:
21:54:37FromDiscord<Dudugz> Had an amazing dream where all the async errors made sense :v
21:55:52FromDiscord<Dudugz> sent a code paste, see https://play.nim-lang.org/#ix=4t4P
21:55:52FromDiscord<Elegantbeef> Nice my iterator chaining + closure is now faster than sequtils in my silly benchmark
21:55:53FromDiscord<Elegantbeef> Inline iterator is as fast as normal manual loop
21:55:56FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4t4Q
21:56:37FromDiscord<Dudugz> >.> So should we drop sequtils and use your lib?
21:57:35FromDiscord<Dudugz> 😅 https://media.discordapp.net/attachments/371759389889003532/1094742933875474432/Screenshots_2023-04-09-18-57-13.png
21:57:50FromDiscord<Elegantbeef> It is, just use bearssl with chronos
21:58:34FromDiscord<Elegantbeef> I mean depends on how you use sequtils
21:58:53FromDiscord<Elegantbeef> If you use it in an iterator you shouldnt use sequtils anywho
21:59:06FromDiscord<Elegantbeef> If you use it to get a collection why and use only a single operation, why not
21:59:43FromDiscord<Elegantbeef> The itermacros module requires a very very recent devel compiler anywho
22:00:29FromDiscord<Dudugz> Got it
22:00:50FromDiscord<Dudugz> good but I'm not using sequtils much yet, just basic stuff like toSeq
22:01:20FromDiscord<Dudugz> I think i used .map and .join on bytearray
22:01:53FromDiscord<Elegantbeef> There is a common thing people do where they do like `for x in mySeq.map(...).filter(...).map(...)`
22:02:20FromDiscord<Elegantbeef> Each call allocates a new sequence so it's relatively slow
22:03:32FromDiscord<Elegantbeef> Using the itermacros module i have you can do the same thing, but without any extra allocations and it's the same as if you manually did it internally
22:03:32FromDiscord<Elegantbeef> Plus it's relatively pluggable
22:03:45*lumo_e joined #nim
22:03:54FromDiscord<Elegantbeef> It's quite simple to write an iterator operation https://github.com/beef331/slicerator/blob/itermacros/src/itermacros.nim#L86-L93
22:05:45FromDiscord<Dudugz> That's pretty nice then
22:06:36FromDiscord<Dudugz> You said we can only use it in devel, right?
22:06:59FromDiscord<Dudugz> I'm waiting for nim v2, devel might not be as stable
22:10:46FromDiscord<Elegantbeef> I mean 2.0 is practically devel 😛
22:10:46FromDiscord<Elegantbeef> But yea
22:10:56FromDiscord<Elegantbeef> It can only be used on a recent devel version
22:11:05FromDiscord<Elegantbeef> Hence why it's in a branch
22:12:58FromDiscord<j-james> In reply to @Elegantbeef "The itermacros module requires": oh huh what's it use?
22:13:00*lumo_e quit (Quit: Quit)
22:13:26FromDiscord<Elegantbeef> A change that allows iterators to be declared in the right hand of `for x in`
22:15:51FromDiscord<Elegantbeef> Each subsequent iterator operation call generates a new iterator that thunks the last practically
22:17:48FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4t4S
22:17:54FromDiscord<Elegantbeef> Which then gets inlined to exactly what you write
22:18:41FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4t4T
22:21:16FromDiscord<Elegantbeef> James is like "Well that's more than what I wanted to read" 😛
22:22:20FromDiscord<j-james> oh haha
22:22:26FromDiscord<j-james> i went afk for a bit
22:23:30FromDiscord<j-james> wait, that's excellent! can that be directly applied to the `sequtils` package?
22:23:48FromDiscord<Elegantbeef> Nope cause sequtils returns a sequence
22:23:57FromDiscord<Elegantbeef> We could deprecate sequtils
22:24:02FromDiscord<Elegantbeef> then have iterutils
22:24:15FromDiscord<Elegantbeef> then if you want a collection you do `.collect` at the end
22:24:33FromDiscord<Elegantbeef> so like `var a = vals.items.mapIt(it 3).filterIt(it > 10).collect()`
22:25:22FromDiscord<j-james> ah rust-style i see
22:28:11FromDiscord<Elegantbeef> Though truthfully this is a bit hacky and `iterator` should do this internally for `iterable`
22:32:38FromDiscord<j-james> yeah i wonder if it's possible for iterators to add an implicit `collect` when they're no longer iterating
22:32:55FromDiscord<j-james> really gotta acquaint myself with the compiler over the summer
22:33:12FromDiscord<Elegantbeef> That's not what i meant
22:33:39FromDiscord<Elegantbeef> I mean that passing an `iterable` to an iterator should be treated like a static parameter and expand the parameter list
22:37:01FromDiscord<j-james> that would work? interesting
22:39:53FromDiscord<Elegantbeef> Yea that's practically what i'm doing
22:40:04FromDiscord<Elegantbeef> I sorta thunk the iterator then call it inside the iterator
22:40:16FromDiscord<Elegantbeef> This reduces the iterator size and allows it to be fully inlined
22:45:52FromDiscord<Dudugz> Is that syntax ok btw? https://media.discordapp.net/attachments/371759389889003532/1094755084606386236/image-4.png
22:46:42FromDiscord<Dudugz> PS: I ignored BareExcept because the warnings that were being raised were all in asyncmacro.nim and not in my files so I think it's a problem with nim 1.6.16 and not my code.
22:47:21FromDiscord<Dudugz> When I tried to actually expand there were try..except: blocks in the asyncmacro.nim
22:48:21FromDiscord<Dudugz> Timer is just a replica of setTimeout in JS in a more OOP form that you can cancel and check if it was executed or cancelled.
22:49:15FromDiscord<Dudugz> The rest you may ignore lol, there's nothing interesting.
22:58:25FromDiscord<Elegantbeef> Does it compile? It's ok
23:04:29FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4t54
23:06:01FromDiscord<Elegantbeef> Of course they're pointer procs
23:06:22FromDiscord<Elegantbeef> And they have an environment
23:09:12NimEventerNew thread by herdingSheep: NiGui: adding images to a layout container, see https://forum.nim-lang.org/t/10085
23:11:13FromDiscord<beans> Do Nim binaries still get false flagged by AVs a lot or has that issue gone away?
23:11:26FromDiscord<Elegantbeef> It still effects Go so there is no go away
23:11:47FromDiscord<beans> dang sucks to hear
23:14:37FromDiscord<beans> I guess the proper way to deal with that is signing though anyways
23:14:39FromDiscord<beans> ¯\_(ツ)_/¯
23:15:24FromDiscord<Dudugz> In reply to @Elegantbeef "Does it compile? It's": Yes lol
23:21:40FromDiscord<Dudugz> In reply to @Elegantbeef "Of course they're pointer": Is this bad for simple operations? what if it calls another function?
23:22:43FromDiscord<Elegantbeef> Well we were talking about closure iterators
23:22:44FromDiscord<Dudugz> My Timer I made to restart the round of a little game when the time expires, it just calls the newRound function
23:22:57FromDiscord<Dudugz> Oh, so it isn't related
23:23:47FromDiscord<Elegantbeef> Calling something slowly once is not as bad as calling something slowly thousands of times
23:24:13FromDiscord<Elegantbeef> Worth nothing though a simple closure iterator in my example is only twice as slow as an inline iterator so it's not tremendously bad but it's still pretty bad
23:24:16FromDiscord<Elegantbeef> worth noting(
23:25:49FromDiscord<Elegantbeef> My benchmark is mainly just 'research' to see the performance costs of different things
23:27:01FromDiscord<Dudugz> Got it
23:28:32FromDiscord<Elegantbeef> It's not like you can use anything else than a closure anyway
23:28:55FromDiscord<Elegantbeef> If you need a closure you use a closure