00:02:02 | termer | Is there a way to use pragmas like annotation on proc args? |
00:03:14 | termer | I'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:40 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4t1c |
00:04:24 | FromDiscord | <Elegantbeef> `template min(i: int){.pragma.}` in your case |
00:04:40 | termer | Is the playground slow for you? |
00:04:44 | termer | It's timing out for me |
00:04:52 | termer | 504 |
00:04:57 | FromDiscord | <Elegantbeef> It's probably dead and pmunch needs to kick it in the ass |
00:05:10 | termer | perhaps |
00:05:25 | termer | I can't see code pastes within IRC, it creates playground links for them |
00:05:28 | termer | so I can't see what you sent |
00:05:46 | FromDiscord | <Elegantbeef> Time to use matrix 😛 |
00:05:53 | termer | IRC or death |
00:05:58 | FromDiscord | <Elegantbeef> `template myPragma {.pragma.}` `proc doThing(a {.myPragma.}: int) = discard` |
00:06:04 | FromDiscord | <Elegantbeef> Time to grow up |
00:06:44 | FromDiscord | <Elegantbeef> you can grab the tail of a playground like and do `ix.io/4t1c` |
00:06:48 | FromDiscord | <Elegantbeef> link\ |
00:08:02 | termer | didn't know it used that |
00:08:13 | termer | lol I've written a bridge software just so I don't have to use matrix |
00:08:33 | termer | https://git.termer.net/termer/matrix-irc-bridge |
00:08:52 | termer | only one that I'm aware of that supports encrypted rooms and file uploads |
00:09:26 | termer | so now the question is, what would this template actually do |
00:09:30 | FromDiscord | <Elegantbeef> Well bridge to the Nim matrix instead of using the irc room |
00:09:31 | termer | how does that even work |
00:09:36 | FromDiscord | <Elegantbeef> It doesnt do anything |
00:09:42 | FromDiscord | <Elegantbeef> It just tags the type you need a macro to detect it |
00:09:52 | termer | ohhhh |
00:10:00 | termer | Right, that makes sense |
00:11:13 | termer | ElegantBeef, related to IRC, Nim's bridge is actually the best one I've ever interacted with |
00:11:46 | termer | it translates discord formatting, it turns code pastes into links, it turns long messages into links |
00:11:48 | termer | very very usable |
00:14:04 | FromDiscord | <Elegantbeef> Turning everything into links seems swell 😛 |
00:14:19 | termer | IRC is the most free and easiest chat thing for me to use |
00:14:41 | FromDiscord | <Elegantbeef> I do not know how it's any more free than matrix, but alas |
00:14:58 | termer | it's a simple protocol with loads of implementations |
00:15:19 | termer | there is only 1 fully usable matrix server |
00:15:40 | termer | IRC is so simple that I went from 0 knowledge of the protocol to a working server implementation in a weekend |
00:15:52 | termer | an implementation that's being used at this very moment |
00:16:05 | FromDiscord | <Elegantbeef> I'd say that it's not any more free it's just simpler |
00:19:44 | termer | it translates into more freedom since it's harder to control |
00:20:01 | termer | the major downside of that is that it's obviously very primitive |
00:20:19 | termer | things like chat history are supported through commonly understood protocol extensions, but most servers don't implement it for example |
00:42:33 | FromDiscord | <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:57 | FromDiscord | <Elegantbeef> You could make a matrix client |
00:43:09 | FromDiscord | <Dudugz> Hmm, that's cool |
00:43:29 | FromDiscord | <Elegantbeef> Like I linked yesterday there is no shortage of them |
00:43:35 | FromDiscord | <Dudugz> Like you said discord sucks on some things, code sharing is one of those things |
00:44:36 | FromDiscord | <Dudugz> Imagine a free client where you can modify freely to your liking and still have access to your favorite servers |
02:26:17 | FromDiscord | <xTrayambak> What happened to nimble.directory? It seems it's turned into a package badges site. |
02:26:44 | FromDiscord | <Elegantbeef> It got a redesign it's the same site |
03:14:26 | * | rockcavera joined #nim |
03:28:20 | FromDiscord | <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:04 | FromDiscord | <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:28 | FromDiscord | <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:58 | FromDiscord | <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:36 | FromDiscord | <Hourglass [She/Her]> I think the lsp shows doc comments, right? |
03:55:33 | FromDiscord | <Elegantbeef> It should |
03:55:37 | FromDiscord | <Elegantbeef> But the tooling barely works 😄 |
04:06:50 | FromDiscord | <user2m> Yeah I'm able to see docstrings on the code from the standard lib but not my own |
04:08:02 | FromDiscord | <sOkam!> Can this be used in stable, or only in devel?↵https://nim-lang.github.io/Nim/paths.html |
04:08:23 | FromDiscord | <Elegantbeef> `nim-lang.github.io` is devel docs |
04:08:54 | FromDiscord | <sOkam!> kk. and is there a way to use a devel package in stable? |
04:09:12 | FromDiscord | <Elegantbeef> No cause it's not a devel package it's the devel stdlib |
04:09:15 | FromDiscord | <Elegantbeef> So copy the code if you really want it |
04:10:01 | FromDiscord | <sOkam!> actually not a bad idea, while it gets into stable 🤔 |
04:10:39 | FromDiscord | <Elegantbeef> `when (NimMajorVersion, NimMinorVersion) <= (1.6): ...` |
04:10:42 | FromDiscord | <Elegantbeef> `1, 6` |
04:12:36 | FromDiscord | <Hourglass [She/Her]> In reply to @Elegantbeef "But the tooling barely": Yay /s |
04:14:00 | FromDiscord | <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:10 | FromDiscord | <Rika> Messy, not really complicated I believe |
04:16:14 | FromDiscord | <Rika> And manpower is low |
04:16:27 | FromDiscord | <Rika> No one is that willing to work on it |
04:16:36 | * | arkurious quit (Quit: Leaving) |
04:19:01 | FromDiscord | <Hourglass [She/Her]> Fair enough |
05:06:33 | * | redj joined #nim |
05:20:33 | FromDiscord | <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:35 | FromDiscord | <Hourglass [She/Her]> That's a shame |
05:32:47 | FromDiscord | <Elegantbeef> PR's welcome 😛 |
05:41:40 | FromDiscord | <Rika> “Well if you’re willing to complain you must be willing to fix it” |
05:49:52 | FromDiscord | <Hourglass [She/Her]> In reply to @Rika "“Well if you’re willing": Bullshit, I complain about my life all the time :giggle: |
05:50:07 | FromDiscord | <Rika> OOF |
05:50:35 | FromDiscord | <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:53 | FromDiscord | <Hourglass [She/Her]> In reply to @Rika "OOF": Indeed |
05:51:50 | FromDiscord | <Chronos [She/Her]> Name change go brr |
05:54:47 | FromDiscord | <user2m> sent a code paste, see https://play.nim-lang.org/#ix=4t1V |
06:22:12 | FromDiscord | <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:50 | FromDiscord | <Prestige> I have a working solution but it feels janky |
06:28:58 | FromDiscord | <demotomohiro> In reply to @user2m "when using parseFile for": You dont. You cannot close the file without file handler. |
06:33:07 | FromDiscord | <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:47 | FromDiscord | <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:57 | FromDiscord | <Prestige> Sorry if my wording was poor |
06:37:30 | FromDiscord | <demotomohiro> In that, you probably dont need to use `OrderedTable`. |
06:44:55 | FromDiscord | <Elegantbeef> Probably best to `myTable.toSeq.sorted` |
06:47:59 | FromDiscord | <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:25 | FromDiscord | <Phil> Where does nim look for dependencies link against? Does it just check $PATH? |
07:10:48 | FromDiscord | <Elegantbeef> Same as where C looks |
07:11:30 | FromDiscord | <Phil> You will not believe this beef |
07:11:39 | FromDiscord | <Phil> It will come to you as an impossible, astonishing thing |
07:11:47 | FromDiscord | <Phil> But I actually do not know where C looks either 😛 |
07:11:49 | FromDiscord | <Elegantbeef> You do not know where C looks |
07:12:01 | FromDiscord | <Elegantbeef> The point of me saying that was "Go look at how C does it goofer" |
07:13:22 | FromDiscord | <Mr Gandolfio> lol chad response |
07:14:45 | * | ltriant quit (Ping timeout: 255 seconds) |
07:32:20 | FromDiscord | <Phil> ... C appears to look at ... "LIBPATH" under windows, okay |
07:32:24 | FromDiscord | <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:06 | FromDiscord | <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:50 | FromDiscord | <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:33 | FromDiscord | <Elegantbeef> Bleh using imgui for desktop apps is horrid, nigui is probably better |
08:28:45 | FromDiscord | <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:51 | FromDiscord | <Elegantbeef> or contribute to fidgetty and make that bettterrer |
08:30:02 | FromDiscord | <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:28 | FromDiscord | <Elegantbeef> QT isnt an imgui |
08:31:04 | FromDiscord | <anddam> and reason that drew me to the latter |
08:31:50 | FromDiscord | <anddam> oh I read fidgetty is a fidget fork, that seemed extremely interesting when I went through it |
08:31:57 | FromDiscord | <anddam> layout from figma and native UIs |
08:32:05 | FromDiscord | <anddam> why did it need to be forked? |
08:32:52 | FromDiscord | <anddam> In reply to @Elegantbeef "Bleh using imgui for": the ecosystem of libraries is extremely rich, I have to say |
08:33:22 | FromDiscord | <anddam> but as often when user base is small projects seems to lose interest from their author (singular) , dry and die |
08:33:40 | FromDiscord | <anddam> In reply to @anddam "the ecosystem of libraries": that was apropos nigui |
08:34:16 | FromDiscord | <Elegantbeef> Well fidgetty is a widget API akin to native toolkits |
08:34:20 | FromDiscord | <Elegantbeef> Fidget is not |
08:34:53 | FromDiscord | <Elegantbeef> Fidgetty isnt just forked fidget it's forked and built on top of |
08:35:34 | FromDiscord | <Elegantbeef> But when it comes to UI the native stuff needs a ton of work |
08:36:16 | FromDiscord | <Elegantbeef> Another alternative to nigui is https://github.com/neroist/uing which is based off a libui fork |
08:37:57 | FromDiscord | <Elegantbeef> It statically links libui-ng and uses system gui so is relatively small |
08:41:30 | FromDiscord | <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:49 | FromDiscord | <Elegantbeef> This concludes my rambling into the void |
08:41:58 | FromDiscord | <Elegantbeef> Tune in next week when we talk about the Canadian housing market |
08:43:46 | * | nanxiao joined #nim |
08:45:13 | FromDiscord | <anddam> both topics dear to me |
08:45:30 | FromDiscord | <anddam> I both have been a Void linux user for several years AND I listen to Rational Reminder podcast |
08:46:00 | FromDiscord | <anddam> tl;dr you can still get a good deal in Vancouver area |
08:46:58 | FromDiscord | <anddam> have a nice Sunday/Easter/whatever is appropriate to you |
08:54:08 | FromDiscord | <Prestige> hm nim playground down |
08:59:17 | FromDiscord | <Prestige> xml parsing is kind of a pain eh |
09:01:26 | FromDiscord | <Elegantbeef> What's the problem |
09:02:38 | FromDiscord | <Prestige> Just trying to figure out how to use parsexml |
09:03:11 | FromDiscord | <firasuke> Do we have a gallery or a post your Nim project channel? |
09:03:40 | FromDiscord | <Elegantbeef> Closest there is "This month with Nim", other than that nope |
09:04:15 | FromDiscord | <Elegantbeef> Parse it then use `xmltree` to fetch what you need |
09:04:21 | FromDiscord | <Elegantbeef> `findAll` generally is what i go for |
09:05:21 | FromDiscord | <Elegantbeef> Also maim the person giving you xml |
09:06:21 | FromDiscord | <Prestige> it's parsing data from a website so meh |
09:06:55 | FromDiscord | <Elegantbeef> Right then what are you after? |
09:07:06 | FromDiscord | <Elegantbeef> Though generally some sites can cause the parser to act odd |
09:07:46 | FromDiscord | <Prestige> I'm trying to parse all the data into a usable data structure, from https://ultimateframedata.com/mario for example |
09:08:08 | FromDiscord | <Prestige> each move has corresponding data and a gif |
09:10:32 | FromDiscord | <Elegantbeef> Seems you need to iterate until you find a `class ="moves"` then iterate and parse those |
09:10:47 | FromDiscord | <Prestige> Yeah |
09:11:01 | FromDiscord | <Prestige> I know logically what I want to do, just trying to figure out how to get the code to do it |
09:11:17 | FromDiscord | <Elegantbeef> Probably easier to use some webdriver to load the page and use JS to output a better data type 😄 |
09:11:52 | FromDiscord | <Prestige> xml -> js would make it easier for sure |
09:19:08 | FromDiscord | <4zv4l> can I add a timeout on `getKey()` from `illwill` ?↵https://github.com/johnnovak/illwill |
09:59:50 | FromDiscord | <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:15 | FromDiscord | <albassort> Id probably make a database |
10:02:02 | FromDiscord | <Prestige> I just need to get the actual data loaded into a data structure, xml is just a pain to parse |
10:07:16 | FromDiscord | <albassort> HTML isn't a pain to parse you just need to know what you're doing |
10:07:19 | FromDiscord | <albassort> I'm sure it's very easy |
10:07:26 | FromDiscord | <albassort> Usually that is in a table already in the HTML |
10:07:30 | FromDiscord | <albassort> Also XML is not HTML they're different |
10:09:49 | FromDiscord | <firasuke> In reply to @Elegantbeef "Closest there is ": oh ok, thanks |
10:10:24 | FromDiscord | <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:23 | FromDiscord | <creative> any alternatives to nake? |
10:12:32 | * | nanxiao quit (Quit: Client closed) |
10:15:00 | FromDiscord | <creative> nevermind found https://nim-lang.org/docs/nims.html |
10:16:45 | FromDiscord | <albassort> In reply to @Avahe "knock yourself out, I": Passing HTML is a skill you need to develope |
10:17:03 | FromDiscord | <Prestige> It's not |
10:17:04 | FromDiscord | <albassort> There's specific tools which make it easier |
10:17:08 | FromDiscord | <albassort> I like to use CSS collectors |
10:17:30 | FromDiscord | <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:38 | FromDiscord | <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:22 | FromDiscord | <turbo> Is there a way I can set an env var in a nimble task (for that task)? |
11:47:34 | FromDiscord | <jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=4t2C |
11:47:47 | FromDiscord | <creative> is there anything like --passld? |
11:47:56 | * | kenran joined #nim |
11:48:38 | FromDiscord | <creative> theres --passc |
11:49:00 | FromDiscord | <jmgomez> you want to pass something to the linker you mean? |
11:49:25 | FromDiscord | <creative> In reply to @jmgomez "you want to pass": yes, currently `-T src/linker.ld` |
11:51:13 | FromDiscord | <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:11 | FromDiscord | <creative> thanks |
12:11:05 | FromDiscord | <michaelb.eth> In reply to @creative "theres --passc": in addition to `--passC` there’s `--passL` |
12:11:05 | FromDiscord | <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:29 | FromDiscord | <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:28 | FromDiscord | <jmgomez> Seems odd yeah. Dunno what's going on, I dont use chossenim anyways |
12:20:37 | FromDiscord | <jmgomez> Cant you build from sources? |
12:21:00 | FromDiscord | <jmgomez> (edit) "chossenim" => "choosenim" |
12:23:01 | FromDiscord | <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:26 | FromDiscord | <Marcus> turbo\: "fine" as in it crosscompiles to x86. that's not great |
12:24:00 | FromDiscord | <jmgomez> Is not the compiler itself arm then? What's the issue? |
12:25:23 | FromDiscord | <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:36 | FromDiscord | <Marcus> the issue is it's running nim in rosetta? |
12:26:40 | FromDiscord | <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:48 | FromDiscord | <jmgomez> I dont know how choosenim works but it shouldnt be compiling nim anyways |
12:27:56 | FromDiscord | <jmgomez> Doesnt it donwload the sources and do the bootstrapping for you? |
12:29:04 | FromDiscord | <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:15 | FromDiscord | <jmgomez> he is talking about the compiler itself |
12:30:01 | FromDiscord | <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:33 | FromDiscord | <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:25 | FromDiscord | <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:34 | FromDiscord | <Marcus> On arm64 linux I've installed nim through nixos, and it generates arm64 binaries |
12:33:52 | FromDiscord | <Rika> Well that’s through Nix and not choose Nim |
12:34:20 | FromDiscord | <Marcus> Right, because choosenim just goes 'arm64-linux isn't a supported target. |
12:34:50 | FromDiscord | <Marcus> My point was just that arm64-linux nim generates arm64-linux binaries by default |
12:34:57 | FromDiscord | <Rika> Dom has pretty much disassociated with Nim by now |
12:35:14 | FromDiscord | <Rika> I’d say anything he made is abandoned and should prolly be forked or replaced |
12:35:15 | FromDiscord | <turbo> macOS: https://gist.github.com/turbo/952376af01669711fcd3500872691e94 |
12:35:56 | FromDiscord | <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:02 | FromDiscord | <Marcus> Rika\: That's a bummer \:-/ |
12:37:01 | FromDiscord | <jmgomez> And that's why core projects should live under an organization rather than individuals |
12:37:37 | FromDiscord | <Marcus> jmgomez\: Yeah, I think choosenim should be forked to the nim-lang org |
12:38:01 | FromDiscord | <Marcus> (if it's going to continue to be the officially supported install method) |
12:39:01 | FromDiscord | <Nerve> Should? It seems beyond question |
12:39:41 | FromDiscord | <Rika> It is pretty much a must |
12:42:24 | FromDiscord | <Marcus> image.png https://media.discordapp.net/attachments/371759389889003532/1094603216982908968/image.png |
12:42:25 | FromDiscord | <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:33 | FromDiscord | <Marcus> ok, tested with a hello world, arm`nim c` on a m1 mac generates a arm binary |
13:55:35 | FromDiscord | <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:57 | FromDiscord | <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:19 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Marcus "currenty only nimlsp is": And does it work with Nim2? |
14:00:59 | FromDiscord | <System64 ~ Flandre Scarlet> https://www.youtube.com/watch?v=Mtgo-nP_r8Y↵I also used this tutorial to setup vim |
14:01:05 | FromDiscord | <System64 ~ Flandre Scarlet> (edit) "vim" => "nvim" |
14:05:44 | * | ismustachio quit (Ping timeout: 250 seconds) |
14:07:18 | * | ismustachio joined #nim |
14:10:14 | FromDiscord | <Marcus> I would think so as the fix was merged to devel↵(@System64 ~ Flandre Scarlet) |
14:17:27 | FromDiscord | <System64 ~ Flandre Scarlet> Oh alright, thanks |
14:21:40 | FromDiscord | <Chronos [She/Her]> My python code is screwing me over, is this a sign to port it to Nim? Lmao |
15:15:44 | FromDiscord | <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:29 | FromDiscord | <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:41 | FromDiscord | <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:00 | FromDiscord | <Ecorous> I'll do the PR now; then if it's rejected so be it |
15:32:59 | FromDiscord | <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:07 | FromDiscord | <Dudugz> In reply to @Hourglass, When the Hour Strikes "My python code is": Yes lol, screw python |
16:08:40 | FromDiscord | <Dudugz> (edit) "screw" => "forget" |
16:10:29 | * | lucasta joined #nim |
16:14:49 | FromDiscord | <Dudugz> sent a code paste, see https://play.nim-lang.org/#ix=4t3y |
16:15:21 | FromDiscord | <Dudugz> Obviously the function would be static, I think enums can only be generated at compile-time |
16:16:05 | FromDiscord | <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:39 | FromDiscord | <jmgomez> In reply to @Dudugz "Is there any macro": anything that Im aware of but sounds easy to implement |
16:16:51 | FromDiscord | <jmgomez> In reply to @aquova "Quick question, is there": type classes |
16:19:00 | FromDiscord | <jmgomez> https://nim-lang.org/docs/manual.html#generics-type-classes |
16:19:07 | FromDiscord | <Dudugz> In reply to @aquova "Quick question, is there": [T: unsgined]? |
16:19:17 | FromDiscord | <Dudugz> (edit) "unsgined]?" => "unsigned]?" |
16:19:25 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4t3A |
16:19:53 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=4t3A" => "https://play.nim-lang.org/#ix=4t3B" |
16:20:23 | FromDiscord | <aquova> interesting. I shall try that |
16:21:15 | FromDiscord | <Dudugz> sent a code paste, see https://play.nim-lang.org/#ix=4t3C |
16:22:27 | FromDiscord | <Dudugz> In reply to @Dudugz "Is there any macro": Beef may know smth about this, i'll ask later |
16:23:24 | FromDiscord | <Phil> Isn't that what's called a hole-y enum or sth? |
16:24:00 | FromDiscord | <aquova> They look like two different ways to accomplish the same thing |
16:24:10 | FromDiscord | <Dudugz> non-holy enum i think, idk why tho |
16:24:44 | FromDiscord | <Dudugz> But in my case I just want to generate an enum automatically without manually creating the values |
16:25:01 | FromDiscord | <Dudugz> Before 8196 it's easy but after... |
16:25:08 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4t3E |
16:25:15 | FromDiscord | <Dudugz> Yea just a macro to auto do this |
16:25:17 | FromDiscord | <jmgomez> holy enums are c-like enums |
16:25:47 | FromDiscord | <Phil> You want all enums automatically to start at 1 instead of 0? |
16:25:52 | FromDiscord | <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:33 | FromDiscord | <Dudugz> sent a code paste, see https://play.nim-lang.org/#ix=4t3F |
16:26:51 | FromDiscord | <Dudugz> In reply to @jmgomez "again, that's trivial to": Not much and I can't test it right now |
16:27:46 | FromDiscord | <Dudugz> (edit) "https://play.nim-lang.org/#ix=4t3F" => "https://play.nim-lang.org/#ix=4t3G" |
16:29:17 | FromDiscord | <Dudugz> sent a code paste, see https://play.nim-lang.org/#ix=4t3I |
16:29:28 | FromDiscord | <huantian> sent a code paste, see https://play.nim-lang.org/#ix=4t3J |
16:29:44 | FromDiscord | <huantian> Idk I’m not good at imitating beef |
16:29:57 | FromDiscord | <Dudugz> lol i'm not also, he's smart |
16:30:15 | FromDiscord | <Dudugz> I don't understand much about macros yet although I'm thinking of learning |
16:30:46 | FromDiscord | <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:37 | FromDiscord | <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:02 | FromDiscord | <huantian> Check if casting set of a normal enum (without the manual 2^ values) |
16:32:06 | FromDiscord | <Dudugz> Because enums by default do auto increment (N + 1) and in my case I wish I could change that logic. |
16:36:59 | FromDiscord | <Dudugz> sent a code paste, see https://play.nim-lang.org/#ix=4t3R |
16:37:17 | FromDiscord | <Dudugz> (edit) "https://play.nim-lang.org/#ix=4t3R" => "https://play.nim-lang.org/#ix=4t3S" |
16:37:25 | FromDiscord | <Dudugz> (edit) "https://play.nim-lang.org/#ix=4t3S" => "https://paste.rs/g1n" |
16:38:29 | FromDiscord | <Rika> are you trying to make an enum for setting options like in C |
16:38:33 | FromDiscord | <Rika> powers of two are suspicious |
16:39:03 | FromDiscord | <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:12 | FromDiscord | <Dudugz> Discord does this |
16:39:25 | FromDiscord | <Dudugz> All discord permissions are power of 2 |
16:39:34 | FromDiscord | <Rika> yes, but suspicious as in thats not how enums should be used in nim |
16:39:51 | FromDiscord | <djazz> set[MyEnum] |
16:40:02 | FromDiscord | <Dudugz> Hmm, maybe, but if you want an enum of permissions is the best way to have it in code |
16:40:13 | FromDiscord | <Rika> no, a set of that enum would be better |
16:40:24 | FromDiscord | <Dudugz> why? |
16:40:33 | FromDiscord | <Rika> because nim sets are bitsets |
16:40:46 | FromDiscord | <Dudugz> hmm, but what about autocomplete? |
16:40:57 | FromDiscord | <Rika> what about autocomplete? |
16:41:17 | FromDiscord | <Dudugz> Ok i don't get the idea of set of enum lol, can u show me an example? |
16:41:21 | FromDiscord | <jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=4t3U |
16:41:27 | FromDiscord | <Rika> jm, no |
16:41:57 | FromDiscord | <jmgomez> (edit) "https://play.nim-lang.org/#ix=4t3U" => "https://play.nim-lang.org/#ix=4t3W" |
16:42:31 | FromDiscord | <Rika> sent a code paste, see https://play.nim-lang.org/#ix=4t3X |
16:42:47 | FromDiscord | <jmgomez> Yeah, that's what one would normally do. He asked the above though |
16:42:50 | FromDiscord | <Dudugz> Hm |
16:43:05 | FromDiscord | <Rika> yes, and i'm showing that it is better to do this |
16:43:22 | FromDiscord | <Dudugz> In reply to @jmgomez "Yeah, that's what one": 🤷♂️ I had no idea how to do it right. |
16:43:43 | FromDiscord | <Dudugz> If in this case it's better to use set then I'll do it like this |
16:44:12 | FromDiscord | <jmgomez> Yeah, it is. It's a good example to grasp the power of macros too. So save it for later 😉 |
16:44:23 | FromDiscord | <Dudugz> Sure thx |
16:44:34 | FromDiscord | <Dudugz> I will definitely study macros later |
16:45:08 | FromDiscord | <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:35 | FromDiscord | <jmgomez> In reply to @Rika "i'm a bit rusty": what have been you using instead? |
16:45:50 | FromDiscord | <Rika> nothing, i havent programmed in maybe a month now |
16:45:51 | FromDiscord | <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:52 | FromDiscord | <Rika> i'm just tired |
16:45:58 | FromDiscord | <Rika> before that i was doing elixir |
16:46:45 | FromDiscord | <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:32 | FromDiscord | <Rika> i'm not tired of a language, i'm just tired |
16:47:45 | FromDiscord | <Dudugz> got it |
17:05:30 | FromDiscord | <dlesnoff> sent a code paste, see https://play.nim-lang.org/#ix=4t43 |
17:07:08 | FromDiscord | <djazz> sent a code paste, see https://play.nim-lang.org/#ix=4t44 |
17:07:29 | FromDiscord | <dlesnoff> sent a code paste, see https://play.nim-lang.org/#ix=4t45 |
17:07:52 | FromDiscord | <djazz> Try uint8 |
17:08:00 | FromDiscord | <dlesnoff> To avoid the use of cast, I would use a table |
17:08:00 | FromDiscord | <djazz> Or set enum size? Maybe |
17:08:00 | FromDiscord | <Rika> In reply to @djazz "Hmm is there a": well no unfortunately |
17:08:09 | FromDiscord | <Rika> sent a code paste, see https://play.nim-lang.org/#ix=4t46 |
17:08:10 | FromDiscord | <Rika> cast uint8 |
17:08:23 | FromDiscord | <Rika> In reply to @Jiezron "To avoid the use": it is wasteful though |
17:08:42 | FromDiscord | <dlesnoff> We could store each conversion value, since there is not that much settings value if I understand |
17:09:48 | FromDiscord | <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:31 | FromDiscord | <dlesnoff> Ok a uint8 is better |
17:26:07 | FromDiscord | <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:32 | FromDiscord | <Saint> In reply to @Rika "before that i was": How’s exilr? |
17:43:37 | FromDiscord | <Saint> Do you have a favorite lisp |
17:43:43 | FromDiscord | <Rika> it is a treat other than typing |
17:43:45 | FromDiscord | <Saint> Unrelated question |
17:43:47 | FromDiscord | <Rika> no i do not write lisps |
17:43:50 | FromDiscord | <Saint> In reply to @Rika "it is a treat": Nice |
17:44:03 | FromDiscord | <Saint> In reply to @Rika "no i do not": Gotcha |
17:44:05 | FromDiscord | <Rika> typing as in types not the act of typing |
17:44:30 | FromDiscord | <Rika> only needs (gradual) static typing and i'd prolly be completely content |
17:57:40 | FromDiscord | <Saint> Ah i see |
18:21:19 | FromDiscord | <Chronos [She/Her]> In reply to @Dudugz "No lol, i mean": Ah alright |
18:39:49 | FromDiscord | <Gumbercules> In reply to @Rika "only needs (gradual) static": There's always gleam. And Elixir does have gradual typing options |
18:40:20 | FromDiscord | <Rika> I do not like the syntactical changes Gleam makes |
18:40:57 | FromDiscord | <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:39 | FromDiscord | <Gumbercules> Well I don't think you're ever going to get a statically typed Elixir |
18:49:51 | FromDiscord | <willyboar> Gleam has maybe the best community in programming languages. |
18:50:50 | FromDiscord | <Gumbercules> Maybe someone will write a backend for Nim that compiles to Erlang |
18:51:59 | FromDiscord | <willyboar> Nah I don't think it will. |
18:54:38 | FromDiscord | <willyboar> But gleam take steps forward and there is plan (long term) to native compilation |
18:57:46 | FromDiscord | <Gumbercules> Yeah I'm excited about Gleam and I use Elixir at work already |
18:58:17 | FromDiscord | <Gumbercules> Also planning on using it for hobby work once I get back to hobby work |
18:58:26 | FromDiscord | <Gumbercules> Elixir I mean |
18:58:50 | FromDiscord | <willyboar> Me too. I spending a lot of time in the community. I hope to also find time for some hobby projects. |
18:59:42 | FromDiscord | <Gumbercules> I really want to write a shadowbane server in Elixir haha |
19:01:05 | FromDiscord | <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:27 | FromDiscord | <Gumbercules> Right now it just sounds like a lot of work |
19:04:07 | FromDiscord | <jmgomez> IMHO compiling Nim to Erlang will be a killer project. Love the idea. It's such a nice match |
19:04:51 | FromDiscord | <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:34 | Amun-Ra | I haven't switched from erlang to elixir, not a fan of rubish syntax |
19:09:24 | FromDiscord | <Gumbercules> And ^ is a God |
19:09:40 | FromDiscord | <willyboar> I never liked elixir syntax. |
19:10:17 | FromDiscord | <Gumbercules> Well Erlang syntax sucks donkey balls |
19:10:44 | FromDiscord | <Gumbercules> But I also get being turned off by Elixir, it is definitely heavily inspired by Ruby |
19:10:51 | FromDiscord | <willyboar> Yes I but I like gleam's a lot |
19:11:04 | FromDiscord | <Gumbercules> But it's also very well designed and I'd rather code in Elixir than Erlang any day of the week. |
19:11:48 | FromDiscord | <Gumbercules> But to each their own. There's room for all of us on the BEAM |
19:12:44 | FromDiscord | <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:04 | FromDiscord | <willyboar> I would like a nim flavor syntax in a BEAM language |
19:13:15 | FromDiscord | <jmgomez> In reply to @Gumbercules "Well you can already": I know, via FFI but that's defeat the purpose.. |
19:13:43 | FromDiscord | <jmgomez> (edit) "that's defeat" => "that defeats" |
19:13:54 | FromDiscord | <Gumbercules> In reply to @willyboar "I would like a": If only Nims compiler backend wasn't as complex as it is.... |
19:14:24 | FromDiscord | <Gumbercules> Maybe that mini Nim compiler project is a good starting point |
19:14:25 | FromDiscord | <willyboar> In reply to @Gumbercules "If only Nims compiler": I know. I mean a totally new language. |
19:14:57 | FromDiscord | <Gumbercules> Well it'd be better for Nim if it was still Nim |
19:15:15 | FromDiscord | <Gumbercules> But yeah, unless someone feels very ambitious, I don't see it happening |
19:15:43 | FromDiscord | <Gumbercules> Or unless someone offers up a whole bunch of $$$ |
19:15:59 | FromDiscord | <Gumbercules> If someone pays my salary for a year I'll quit and do it |
19:16:05 | FromDiscord | <willyboar> Maybe implementation of the language be in Nim 😜 |
19:16:08 | FromDiscord | <Gumbercules> Well, salary and benefits haha |
19:16:17 | FromDiscord | <Gumbercules> Got a kid after all... |
19:16:38 | FromDiscord | <willyboar> I know what you mean. I have 4 |
19:16:39 | FromDiscord | <jmgomez> Of what mini compiler are you talking about? |
19:16:52 | FromDiscord | <Gumbercules> In reply to @willyboar "Maybe implementation of the": Could certainly write a compiler in Nim |
19:17:00 | FromDiscord | <Gumbercules> In reply to @jmgomez "Of what mini compiler": Sec... |
19:17:31 | FromDiscord | <willyboar> In reply to @Gumbercules "Could certainly write a": Sure but still a lot of work |
19:17:35 | FromDiscord | <jmgomez> What does it takes though? Compile Nim to erlang +build the std + create a bindings mechanism? Am I missing something else? |
19:18:17 | FromDiscord | <Gumbercules> https://github.com/pmetras/nim0 |
19:18:21 | FromDiscord | <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:14 | FromDiscord | <Gumbercules> In reply to @jmgomez "the worst part would": Isn't gleam implemented in Scala or something? |
19:19:17 | FromDiscord | <jmgomez> ohh cool, I think I saw it in the past from the oberon book. Definitely great material to study from thanks! |
19:19:22 | FromDiscord | <Gumbercules> I can't remember wtf the author was using.... |
19:19:34 | FromDiscord | <willyboar> In reply to @Gumbercules "Isn't gleam implemented in": Rust |
19:20:21 | FromDiscord | <jmgomez> but wdym like writing it from scratch? Why just dont write a backend? |
19:21:49 | FromDiscord | <willyboar> Gleam already have IC and creator improves a lot LSP |
19:21:56 | FromDiscord | <Rika> Why does it seem like I’m the only one who doesn’t like Gleam’s syntax |
19:23:06 | FromDiscord | <willyboar> In reply to @Rika "Why does it seem": I believe there are more 🤣🤣 |
19:23:26 | FromDiscord | <Rika> Sure hope so |
19:24:39 | FromDiscord | <willyboar> In reply to @jmgomez "but wdym like writing": I am talking about Nim flavor syntax not support all Nim features. |
19:25:09 | FromDiscord | <Rika> I don’t know, I also really like Elixir’s syntax |
19:25:26 | FromDiscord | <willyboar> I don't 😜 |
19:26:01 | FromDiscord | <Rika> I can understand why but not see why |
19:26:09 | FromDiscord | <jmgomez> In reply to @willyboar "I am talking about": gotcha, alghout the cool features of Nim before interop are at comp time |
19:26:17 | FromDiscord | <jmgomez> (edit) "before" => "besides" |
19:27:16 | FromDiscord | <willyboar> Well both are interesting projects and both need a lot of work. |
19:29:42 | FromDiscord | <Gumbercules> I generally wouldn't use Nim for the same problems Id use Elixir to solve |
19:29:55 | FromDiscord | <Rika> And vice versa |
19:29:58 | FromDiscord | <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:16 | FromDiscord | <Rika> In reply to @willyboar "First prototypes was in": Makes sense |
19:30:17 | FromDiscord | <Gumbercules> Mostly because Nim doesn't have a good web story |
19:30:38 | FromDiscord | <Rika> In reply to @Gumbercules "Mostly because Nim doesn't": Oh man this is so painfully true lol |
19:30:40 | FromDiscord | <Gumbercules> And Elixir has an amazing one |
19:30:48 | FromDiscord | <Gumbercules> Well Erlang too |
19:31:11 | FromDiscord | <willyboar> Nim makes steps forward in web Dev but they are baby steps |
19:31:16 | FromDiscord | <Gumbercules> If I'm doing any non-realtime or near realtime server work, Id pick Elixir or Erlang |
19:31:32 | FromDiscord | <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:53 | FromDiscord | <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:53 | FromDiscord | <jmgomez> It isnt like Elixir is Idris or something like that.. |
19:32:04 | FromDiscord | <jmgomez> Like dynanism? |
19:32:06 | FromDiscord | <Gumbercules> It has very little to do with typing |
19:32:08 | FromDiscord | <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:20 | FromDiscord | <Gumbercules> No like be built around the actor model and have a very rosy concurrency picture |
19:32:43 | FromDiscord | <jmgomez> But that isnt a feature of the lang, that's part of infra. Isnt it? |
19:32:54 | FromDiscord | <Gumbercules> Well it's mostly OTP |
19:33:21 | FromDiscord | <Gumbercules> But the beam does have a lot to do with other nice features that language is running on it benefit from |
19:33:22 | FromDiscord | <jmgomez> Yeah, but what semantics required OTP that doesnt make nim suitable for the task? |
19:33:47 | FromDiscord | <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:51 | FromDiscord | <Gumbercules> Supervision hierarchies |
19:33:56 | FromDiscord | <Gumbercules> The actor model |
19:34:05 | FromDiscord | <Gumbercules> Being able to hot patch running processes |
19:34:15 | FromDiscord | <jmgomez> that seems to me orthogonal to the conversation |
19:34:24 | FromDiscord | <Gumbercules> I don't understand what the conversation is at this point |
19:34:37 | FromDiscord | <Gumbercules> You're asking why I would choose elixir or Erlang over NIM for certain tasks |
19:34:44 | FromDiscord | <jmgomez> just at the semantic level, what constructs has elixir that make it play nice with OTP/beam |
19:35:16 | FromDiscord | <jmgomez> No, that's easy to get.. |
19:35:24 | FromDiscord | <Gumbercules> I mean nothing over Erlang or other languages |
19:35:32 | FromDiscord | <Gumbercules> But I was never arguing that it did |
19:35:59 | FromDiscord | <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:14 | FromDiscord | <Gumbercules> (edit) "them" => "Nim" |
19:36:41 | FromDiscord | <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:50 | FromDiscord | <Gumbercules> Not that they can't be |
19:36:56 | FromDiscord | <Gumbercules> I got you |
19:37:29 | FromDiscord | <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:32 | FromDiscord | <Rika> I mean a spoon could probably fly into space had you morphed it into a rocket |
19:38:02 | FromDiscord | <Gumbercules> But there have been a couple attempts at writing statically typed languages on that virtual machine gleam being one of them |
19:38:08 | FromDiscord | <Gumbercules> The other being alpaca |
19:38:25 | FromDiscord | <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:40 | FromDiscord | <jmgomez> I played with Elixir and Phoenix like 7 years ago. I liked it but never used it in prod |
19:38:53 | FromDiscord | <jmgomez> wasnt alpaca ml based? |
19:39:07 | FromDiscord | <Gumbercules> Yeah we use both at work and it's a very productive combination |
19:39:18 | FromDiscord | <Gumbercules> And very enjoyable to work on |
19:39:29 | FromDiscord | <Rika> In reply to @jmgomez "I played with Elixir": 7 years do be a long time |
19:39:38 | FromDiscord | <Rika> Can you imagine Nim 7 years ago |
19:39:46 | FromDiscord | <Gumbercules> In reply to @jmgomez "wasnt alpaca ml based?": Yup |
19:39:51 | FromDiscord | <Gumbercules> In reply to @Rika "Can you imagine Nim": I can |
19:39:56 | FromDiscord | <Gumbercules> Because I was using it |
19:39:58 | FromDiscord | <Rika> In reply to @Gumbercules "I can": You don’t need to |
19:40:00 | FromDiscord | <Rika> You were there |
19:40:01 | FromDiscord | <willyboar> @jmgomez you can join gleam server. Author is very cool and will answer any question. |
19:40:01 | FromDiscord | <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:03 | FromDiscord | <Gumbercules> Yah |
19:40:18 | FromDiscord | <jmgomez> In reply to @willyboar "<@726017160115126333> you can join": thanks, I have enough in my plate with NUE though |
19:40:27 | FromDiscord | <Gumbercules> Yeah the Gleam author is quite a nice person |
19:40:44 | FromDiscord | <Gumbercules> Based on my interactions with them anyway |
19:41:32 | FromDiscord | <jmgomez> In reply to @Gumbercules "Because I was using": how old is it? you should be one of the first users |
19:41:56 | FromDiscord | <Rika> Nim was public at 2009 |
19:42:59 | FromDiscord | <ricky> Nim was god tier already in 2009 |
19:43:05 | FromDiscord | <ricky> now look at it.. |
19:43:09 | FromDiscord | <ricky> we are ascended |
19:43:29 | FromDiscord | <Gumbercules> It was called Nimrod back then |
19:43:32 | FromDiscord | <Gumbercules> In 2009 |
19:43:56 | FromDiscord | <Gumbercules> 2015 is when I first looked at it and 2016 is when I wrote frag with bgfx |
19:44:34 | FromDiscord | <Gumbercules> Actually I probably first saw Nim in like 2012 from talking to someone in the roguelike dev irc |
19:45:00 | FromDiscord | <Gumbercules> Probably tommy ettinger who does a lot of libgdx shit |
19:45:01 | FromDiscord | <willyboar> I found it a lot later. I think I saw it first time around 2018 |
19:45:30 | FromDiscord | <Gumbercules> Yeah it started getting a lot more users around that time |
19:46:17 | FromDiscord | <Gumbercules> Arc/Orc weren't even wet dreams for Nim at the point I started using it |
19:47:03 | FromDiscord | <Gumbercules> We had the thread local heap GC and Boehm and that was it |
19:47:41 | FromDiscord | <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:57 | FromDiscord | <willyboar> In reply to @Gumbercules "Yeah it started getting": Great times. I loved Nim community back then. |
19:52:32 | FromDiscord | <jmgomez> In reply to @Gumbercules "Originally Nims compiler was": really? lol |
19:55:57 | FromDiscord | <Gumbercules> In reply to @jmgomez "really? lol": Yup! |
19:56:39 | * | xet7 quit (Remote host closed the connection) |
19:56:42 | FromDiscord | <Gumbercules> https://news.ycombinator.com/item?id=25242926 |
19:57:06 | FromDiscord | <Gumbercules> https://github.com/nim-lang/Nim/issues/10937 |
19:57:10 | FromDiscord | <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:58 | FromDiscord | <jmgomez> intersting though |
19:58:02 | FromDiscord | <Gumbercules> Apparently people still wanted to in 2019 |
19:58:19 | FromDiscord | <jmgomez> so it doesnt seem like that big of a task to build a backend? I dont know what to think |
19:58:46 | FromDiscord | <Gumbercules> It's mostly the codegen |
19:59:15 | FromDiscord | <Gumbercules> But uhhh I'm also not a compiler developer |
19:59:19 | FromDiscord | <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:46 | FromDiscord | <jmgomez> (edit) "make sure" => "be certain" |
20:00:09 | FromDiscord | <Gumbercules> Because you want to have a repl? |
20:00:11 | FromDiscord | <Gumbercules> Or.... |
20:00:45 | FromDiscord | <Gumbercules> If you're compiling to Erlang and not bytecode you're also going to need to invoke the Erlang compiler |
20:01:53 | FromDiscord | <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:43 | FromDiscord | <willyboar> How close Nim is to IC ? I don't watch the progress |
20:07:12 | FromDiscord | <Gumbercules> I don't know how much faster IC is going to make anything either |
20:08:03 | FromDiscord | <Gumbercules> In reply to @willyboar "How close Nim is": I'm not sure there's a way to track atm |
20:08:08 | FromDiscord | <jmgomez> They say it's the next thing after 2.0 |
20:08:31 | FromDiscord | <jmgomez> https://github.com/nim-lang/RFCs/issues/503 |
20:08:55 | FromDiscord | <Elegantbeef> IC should make tooling a tinge better in theory atleast |
20:09:02 | FromDiscord | <jmgomez> In reply to @Gumbercules "I don't know how": My bet is that it will speed heavy macro code too |
20:09:04 | FromDiscord | <willyboar> I think there are a lot of things Nim core team has to solve. Tooling is one of them |
20:09:11 | FromDiscord | <jmgomez> (edit) "In reply to @Gumbercules "I don't know how": My bet is that it will speed ... heavy" added "up" |
20:09:51 | FromDiscord | <willyboar> Also there are some problems with Dom's libraries |
20:10:19 | FromDiscord | <Elegantbeef> If you're talking about jester's bugs methinks that's not Orc related 😄 |
20:10:49 | FromDiscord | <Elegantbeef> I mean it is orc related, but it probably comes down to some refc vs. orc differences |
20:10:53 | FromDiscord | <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:00 | FromDiscord | <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:27 | FromDiscord | <willyboar> In reply to @Elegantbeef "If you're talking about": No I don't care about jester. Choosenim is more crucial |
20:12:12 | FromDiscord | <willyboar> Jester can be forked or use an alternative. Same with httpbeast |
20:12:22 | FromDiscord | <Elegantbeef> gitnim exists 😛 |
20:12:45 | FromDiscord | <Gumbercules> https://alexandruburlacu.github.io/posts/2021-05-07-elixir-pattern-matching-magic |
20:14:01 | FromDiscord | <willyboar> In reply to @Elegantbeef "gitnim exists 😛": I don't think Nim will adopt a disruptek library 🤣 |
20:14:23 | FromDiscord | <Gumbercules> @jmgomez Elixir does have some pattern matching features which can make socket / network programming more pleasant |
20:14:39 | FromDiscord | <Gumbercules> That blog post goes over this toward the end |
20:15:56 | FromDiscord | <Gumbercules> This coupled with OTP provides a really solid footing for server side development |
20:17:32 | FromDiscord | <Elegantbeef> Choosenim doesnt fetch arm builds on mac yet does it? |
20:18:14 | FromDiscord | <jmgomez> nice, PM at this point is a mainstream feature though. Just happens that Nim sucks at it |
20:18:33 | FromDiscord | <willyboar> I don't know. I have an old Mac and also had some problems with it. |
20:19:13 | FromDiscord | <Elegantbeef> Really a rewrite needs to be done that uses libgit and system request libraries like puppy |
20:19:23 | FromDiscord | <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:06 | FromDiscord | <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:28 | FromDiscord | <Gumbercules> In reply to @jmgomez "nice, PM at this": No the binary pattern matching is the thing... |
20:25:17 | FromDiscord | <Gumbercules> Erlang and Elixir can match on binary data |
20:25:25 | * | lucasta quit (Quit: Leaving) |
20:26:09 | FromDiscord | <willyboar> In reply to @jmgomez "nice, PM at this": I thought you talk about package manager |
20:26:25 | FromDiscord | <willyboar> (edit) "In reply to @jmgomez "nice, PM at this": I thought you talk about package manager ... " added "🤣😜" |
20:26:52 | FromDiscord | <jmgomez> In reply to @willyboar "I thought you talk": can apply too haha |
20:28:10 | FromDiscord | <jmgomez> In reply to @Gumbercules "Erlang and Elixir can": ah missed that, do you mind showing an example? |
20:29:30 | FromDiscord | <jmgomez> okay, Im seeing it on the article, seems cool. But cant you create a macro for that? |
20:29:34 | FromDiscord | <Gumbercules> There is one toward the end of the article I linked |
20:30:23 | FromDiscord | <Gumbercules> In Erlang or Elixir? I'm not sure if it's implemented as a macro or not |
20:30:23 | FromDiscord | <AmjadHD> sent a code paste, see https://play.nim-lang.org/#ix=4t4y |
20:30:52 | FromDiscord | <jmgomez> In reply to @Gumbercules "In Erlang or Elixir?": I mean in Nim, to the point of our prev conversation |
20:31:40 | FromDiscord | <Gumbercules> Oh, well... Sure but that's not really the point |
20:32:27 | FromDiscord | <jmgomez> it was, we were exploring the idea of the limitation of using Nim compiling to Erlang |
20:32:42 | FromDiscord | <Gumbercules> These are just features that make writing netcode in Erlang or Elixir that much nicer. |
20:34:09 | FromDiscord | <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:39 | FromDiscord | <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:55 | FromDiscord | <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:04 | FromDiscord | <Gumbercules> Originally we were all just comparing gleam and elixir and erlang |
20:36:00 | FromDiscord | <jmgomez> (edit) "Gotcha, I thought you came with something ... with" added "new" |
20:36:17 | FromDiscord | <willyboar> There are lot of users working on web Dev related projects in gleam. |
20:36:19 | FromDiscord | <Gumbercules> A certain someone was doing an experiment with Nim related to this convo |
20:37:23 | FromDiscord | <Gumbercules> https://github.com/zevv/actors |
20:37:31 | FromDiscord | <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:23 | FromDiscord | <willyboar> In reply to @Gumbercules "https://github.com/zevv/actors": Zevv introduce gleam to me 😜 |
20:42:49 | FromDiscord | <Gumbercules> In reply to @jmgomez "so no one can": Hahaha no way... Too much work with too little upside |
20:46:44 | FromDiscord | <EchoPouet> In reply to @willyboar "Totally agree. Nim core": Fork it and call it NimUp |
20:46:58 | FromDiscord | <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:19 | FromDiscord | <Gumbercules> Just start over with Nimble and Choosenim imo |
20:47:30 | FromDiscord | <Gumbercules> And yeah don't call it Choosenim either |
20:47:39 | FromDiscord | <Gumbercules> Fight club was cool and all but... |
20:48:15 | FromDiscord | <willyboar> In reply to @PotAuFeu "Fork it and call": Not a chance! |
20:48:37 | FromDiscord | <Gumbercules> Call it cush |
20:48:49 | FromDiscord | <Gumbercules> Just go back to Biblical shit |
20:49:09 | FromDiscord | <Gumbercules> It's easy |
20:50:21 | FromDiscord | <willyboar> I don't plan to fork any project. Nim team must fork at least choosenim |
20:50:36 | FromDiscord | <Elegantbeef> Nah call it sinai |
20:51:04 | FromDiscord | <Gumbercules> Even better call it ham |
20:51:10 | FromDiscord | <willyboar> Cain is the best fit. The new one kill his brother choosenim |
20:51:16 | FromDiscord | <Gumbercules> Til Nimrod was the grandson of Ham |
20:51:48 | FromDiscord | <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:29 | FromDiscord | <ricky> had a fever dream I could link static SSL on Win x64-64 |
21:19:42 | FromDiscord | <ricky> :nimAngry: |
21:54:37 | FromDiscord | <Dudugz> Had an amazing dream where all the async errors made sense :v |
21:55:52 | FromDiscord | <Dudugz> sent a code paste, see https://play.nim-lang.org/#ix=4t4P |
21:55:52 | FromDiscord | <Elegantbeef> Nice my iterator chaining + closure is now faster than sequtils in my silly benchmark |
21:55:53 | FromDiscord | <Elegantbeef> Inline iterator is as fast as normal manual loop |
21:55:56 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4t4Q |
21:56:37 | FromDiscord | <Dudugz> >.> So should we drop sequtils and use your lib? |
21:57:35 | FromDiscord | <Dudugz> 😅 https://media.discordapp.net/attachments/371759389889003532/1094742933875474432/Screenshots_2023-04-09-18-57-13.png |
21:57:50 | FromDiscord | <Elegantbeef> It is, just use bearssl with chronos |
21:58:34 | FromDiscord | <Elegantbeef> I mean depends on how you use sequtils |
21:58:53 | FromDiscord | <Elegantbeef> If you use it in an iterator you shouldnt use sequtils anywho |
21:59:06 | FromDiscord | <Elegantbeef> If you use it to get a collection why and use only a single operation, why not |
21:59:43 | FromDiscord | <Elegantbeef> The itermacros module requires a very very recent devel compiler anywho |
22:00:29 | FromDiscord | <Dudugz> Got it |
22:00:50 | FromDiscord | <Dudugz> good but I'm not using sequtils much yet, just basic stuff like toSeq |
22:01:20 | FromDiscord | <Dudugz> I think i used .map and .join on bytearray |
22:01:53 | FromDiscord | <Elegantbeef> There is a common thing people do where they do like `for x in mySeq.map(...).filter(...).map(...)` |
22:02:20 | FromDiscord | <Elegantbeef> Each call allocates a new sequence so it's relatively slow |
22:03:32 | FromDiscord | <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:32 | FromDiscord | <Elegantbeef> Plus it's relatively pluggable |
22:03:45 | * | lumo_e joined #nim |
22:03:54 | FromDiscord | <Elegantbeef> It's quite simple to write an iterator operation https://github.com/beef331/slicerator/blob/itermacros/src/itermacros.nim#L86-L93 |
22:05:45 | FromDiscord | <Dudugz> That's pretty nice then |
22:06:36 | FromDiscord | <Dudugz> You said we can only use it in devel, right? |
22:06:59 | FromDiscord | <Dudugz> I'm waiting for nim v2, devel might not be as stable |
22:10:46 | FromDiscord | <Elegantbeef> I mean 2.0 is practically devel 😛 |
22:10:46 | FromDiscord | <Elegantbeef> But yea |
22:10:56 | FromDiscord | <Elegantbeef> It can only be used on a recent devel version |
22:11:05 | FromDiscord | <Elegantbeef> Hence why it's in a branch |
22:12:58 | FromDiscord | <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:26 | FromDiscord | <Elegantbeef> A change that allows iterators to be declared in the right hand of `for x in` |
22:15:51 | FromDiscord | <Elegantbeef> Each subsequent iterator operation call generates a new iterator that thunks the last practically |
22:17:48 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4t4S |
22:17:54 | FromDiscord | <Elegantbeef> Which then gets inlined to exactly what you write |
22:18:41 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4t4T |
22:21:16 | FromDiscord | <Elegantbeef> James is like "Well that's more than what I wanted to read" 😛 |
22:22:20 | FromDiscord | <j-james> oh haha |
22:22:26 | FromDiscord | <j-james> i went afk for a bit |
22:23:30 | FromDiscord | <j-james> wait, that's excellent! can that be directly applied to the `sequtils` package? |
22:23:48 | FromDiscord | <Elegantbeef> Nope cause sequtils returns a sequence |
22:23:57 | FromDiscord | <Elegantbeef> We could deprecate sequtils |
22:24:02 | FromDiscord | <Elegantbeef> then have iterutils |
22:24:15 | FromDiscord | <Elegantbeef> then if you want a collection you do `.collect` at the end |
22:24:33 | FromDiscord | <Elegantbeef> so like `var a = vals.items.mapIt(it 3).filterIt(it > 10).collect()` |
22:25:22 | FromDiscord | <j-james> ah rust-style i see |
22:28:11 | FromDiscord | <Elegantbeef> Though truthfully this is a bit hacky and `iterator` should do this internally for `iterable` |
22:32:38 | FromDiscord | <j-james> yeah i wonder if it's possible for iterators to add an implicit `collect` when they're no longer iterating |
22:32:55 | FromDiscord | <j-james> really gotta acquaint myself with the compiler over the summer |
22:33:12 | FromDiscord | <Elegantbeef> That's not what i meant |
22:33:39 | FromDiscord | <Elegantbeef> I mean that passing an `iterable` to an iterator should be treated like a static parameter and expand the parameter list |
22:37:01 | FromDiscord | <j-james> that would work? interesting |
22:39:53 | FromDiscord | <Elegantbeef> Yea that's practically what i'm doing |
22:40:04 | FromDiscord | <Elegantbeef> I sorta thunk the iterator then call it inside the iterator |
22:40:16 | FromDiscord | <Elegantbeef> This reduces the iterator size and allows it to be fully inlined |
22:45:52 | FromDiscord | <Dudugz> Is that syntax ok btw? https://media.discordapp.net/attachments/371759389889003532/1094755084606386236/image-4.png |
22:46:42 | FromDiscord | <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:21 | FromDiscord | <Dudugz> When I tried to actually expand there were try..except: blocks in the asyncmacro.nim |
22:48:21 | FromDiscord | <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:15 | FromDiscord | <Dudugz> The rest you may ignore lol, there's nothing interesting. |
22:58:25 | FromDiscord | <Elegantbeef> Does it compile? It's ok |
23:04:29 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4t54 |
23:06:01 | FromDiscord | <Elegantbeef> Of course they're pointer procs |
23:06:22 | FromDiscord | <Elegantbeef> And they have an environment |
23:09:12 | NimEventer | New thread by herdingSheep: NiGui: adding images to a layout container, see https://forum.nim-lang.org/t/10085 |
23:11:13 | FromDiscord | <beans> Do Nim binaries still get false flagged by AVs a lot or has that issue gone away? |
23:11:26 | FromDiscord | <Elegantbeef> It still effects Go so there is no go away |
23:11:47 | FromDiscord | <beans> dang sucks to hear |
23:14:37 | FromDiscord | <beans> I guess the proper way to deal with that is signing though anyways |
23:14:39 | FromDiscord | <beans> ¯\_(ツ)_/¯ |
23:15:24 | FromDiscord | <Dudugz> In reply to @Elegantbeef "Does it compile? It's": Yes lol |
23:21:40 | FromDiscord | <Dudugz> In reply to @Elegantbeef "Of course they're pointer": Is this bad for simple operations? what if it calls another function? |
23:22:43 | FromDiscord | <Elegantbeef> Well we were talking about closure iterators |
23:22:44 | FromDiscord | <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:57 | FromDiscord | <Dudugz> Oh, so it isn't related |
23:23:47 | FromDiscord | <Elegantbeef> Calling something slowly once is not as bad as calling something slowly thousands of times |
23:24:13 | FromDiscord | <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:16 | FromDiscord | <Elegantbeef> worth noting( |
23:25:49 | FromDiscord | <Elegantbeef> My benchmark is mainly just 'research' to see the performance costs of different things |
23:27:01 | FromDiscord | <Dudugz> Got it |
23:28:32 | FromDiscord | <Elegantbeef> It's not like you can use anything else than a closure anyway |
23:28:55 | FromDiscord | <Elegantbeef> If you need a closure you use a closure |