00:10:16 | FromDiscord | <Patitotective> In reply to @dom96 "> wolfSSL supports industry": you should post it on the forum :p |
00:36:01 | FromDiscord | <Tuatarian> so it literally isn't generating a renderer_d directory |
00:36:03 | FromDiscord | <Tuatarian> not sure why |
00:36:27 | FromDiscord | <Elegantbeef> Your compile might be crashing before it gets to cgen |
00:36:40 | FromDiscord | <Elegantbeef> Building a debug compiler might help |
00:36:49 | FromDiscord | <Tuatarian> this seems to happen independent of nim version though |
00:37:13 | FromDiscord | <Elegantbeef> A debug compiler will give you something to work with |
00:37:59 | FromDiscord | <Tuatarian> before that I want to see if there's anything easierI could try |
00:38:26 | FromDiscord | <Elegantbeef> Building the compiler is really easy |
00:38:30 | FromDiscord | <Tuatarian> for example. nim is able to compile most files |
00:38:36 | FromDiscord | <Tuatarian> just not this particular one |
00:38:44 | FromDiscord | <Tuatarian> not sure why, and it seems independent of the file contents |
00:38:48 | FromDiscord | <Elegantbeef> Do you have a `config.nims` or `nim.cfg`? |
00:38:50 | FromDiscord | <Tuatarian> like no matter what I put in there it doesn't compile |
00:39:07 | FromDiscord | <Tuatarian> not in the foler no |
00:39:09 | FromDiscord | <Tuatarian> folder |
00:42:16 | FromDiscord | <retkid> hey beef |
00:42:18 | FromDiscord | <retkid> wanna see my code |
00:45:11 | FromDiscord | <NiChrosia> question about macros/templates: is there any way to pass an identifier to a template from a macro? |
00:45:36 | FromDiscord | <Elegantbeef> You just call the template and place the identifier where you want it |
00:45:50 | FromDiscord | <NiChrosia> wdym? |
00:46:06 | FromDiscord | <NiChrosia> I have a variable of type `nnkIdent` but passing it to the template simply passes the name |
00:46:16 | FromDiscord | <Elegantbeef> That's what an identifier is |
00:46:24 | FromDiscord | <Elegantbeef> You likely want a typed macro |
00:47:02 | FromDiscord | <NiChrosia> (clarification: name means the value of the identifier) |
00:47:28 | FromDiscord | <Elegantbeef> You either want a typed macro or a typed template |
00:47:31 | FromDiscord | <Elegantbeef> No clue without code |
00:48:34 | FromDiscord | <NiChrosia> sent a code paste, see https://play.nim-lang.org/#ix=49uY |
00:48:47 | FromDiscord | <NiChrosia> (edit) "https://play.nim-lang.org/#ix=49uY" => "https://play.nim-lang.org/#ix=49uZ" |
00:48:55 | FromDiscord | <NiChrosia> (edit) "https://play.nim-lang.org/#ix=49uZ" => "https://play.nim-lang.org/#ix=49v0" |
00:49:39 | FromDiscord | <NiChrosia> and what is a typed macro/template? |
00:49:54 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=49v1 |
00:50:03 | FromDiscord | <Elegantbeef> macros are just evaluated Nim so what you're doing in the above is calling the template inside the macro |
00:50:12 | FromDiscord | <Elegantbeef> You're not emitting a call to said template |
00:50:30 | FromDiscord | <NiChrosia> oh, I see, thank you |
00:50:45 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=49v2 |
02:12:59 | FromDiscord | <brookbtc> sent a long message, see http://ix.io/48uN |
02:13:37 | FromDiscord | <Patitotective> In reply to @brookbtc "If you have a": <@&371760044473319454> ❤️ |
02:20:43 | FromDiscord | <Nalmyth> I would like to check an object against some defaults |
02:21:02 | FromDiscord | <Nalmyth> sent a code paste, see https://play.nim-lang.org/#ix=49vg |
02:21:24 | FromDiscord | <Nalmyth> (edit) "https://play.nim-lang.org/#ix=49vg" => "https://play.nim-lang.org/#ix=49vh" |
02:21:42 | FromDiscord | <Nalmyth> Previously I was just creating a `const QueryText` and comparing values against that, or extending from that default |
02:22:02 | FromDiscord | <Nalmyth> sent a code paste, see https://play.nim-lang.org/#ix=49vi |
02:22:09 | FromDiscord | <Nalmyth> But since I'm using `ref object` it seems I can't create `consts`? |
02:22:19 | FromDiscord | <Nalmyth> `Error: invalid type: 'QueryTxt' for const` |
02:23:08 | FromDiscord | <Elegantbeef> It wouldnt cover nil but you could do `(typeOf(QueryText()[]))(someText: "DefaultText")` then do `myQueryText[] == defaultquery` |
02:23:18 | FromDiscord | <Elegantbeef> or you could make a `let defaultQuery = QueryText` |
02:25:53 | FromDiscord | <Nalmyth> Yea I guess escaping compile time at this point is probably the reason |
02:26:13 | FromDiscord | <Nalmyth> Thank you 👍 was considering moving to a JSON 😅 |
02:26:21 | FromDiscord | <Elegantbeef> Heap allocated types are odd constants |
02:26:50 | FromDiscord | <Nalmyth> (edit) "you 👍" => "you!" |
02:30:29 | * | arkurious quit (Quit: Leaving) |
02:52:27 | * | estiquelapice quit () |
02:53:48 | FromDiscord | <Nalmyth> sent a code paste, see https://play.nim-lang.org/#ix=49vm |
02:53:57 | FromDiscord | <Nalmyth> Do we have to enter into generics here? |
02:54:38 | FromDiscord | <Nalmyth> (edit) "https://play.nim-lang.org/#ix=49vm" => "https://play.nim-lang.org/#ix=49vn" |
02:54:42 | FromDiscord | <Elegantbeef> You want it to only work with B/C but not A? |
02:54:49 | FromDiscord | <Nalmyth> Also A would be fine |
02:54:52 | FromDiscord | <Nalmyth> I could write a default case |
02:55:00 | FromDiscord | <Elegantbeef> So then what's the issue? |
02:55:27 | FromDiscord | <Nalmyth> Oh, maybe I'm just going in circles a bit |
02:55:30 | FromDiscord | <Elegantbeef> Is this just a question of "How do i check the type something is"? |
02:56:23 | FromDiscord | <Nalmyth> I was having a compile error and I thought for a second that we were back in C land, where nim is treating it like a `void ` pointer that has to be cast |
02:56:46 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=49vo |
02:56:48 | FromDiscord | <Nalmyth> So I thought somehow that typing info was lost |
02:56:56 | FromDiscord | <Elegantbeef> Dont know if Nim works with `some.t of (B or C)` |
02:57:12 | FromDiscord | <Nalmyth> Oh cool, very useful |
02:57:34 | FromDiscord | <Elegantbeef> You then can safely do `C(some.t)` or `B(some.t)` |
02:57:55 | FromDiscord | <Elegantbeef> Depending what you're doing an object variant might be better |
02:57:58 | FromDiscord | <Elegantbeef> but YMMV |
02:58:12 | FromDiscord | <Nalmyth> I guess that escapes compile time checking at that point? |
02:58:47 | FromDiscord | <Elegantbeef> Inheritance does rely on dynamic type information so yes |
02:58:56 | FromDiscord | <Nalmyth> sent a code paste, see https://play.nim-lang.org/#ix=49vp |
02:59:04 | FromDiscord | <Nalmyth> Ah ok, yea it's the `ref` |
02:59:22 | FromDiscord | <Nalmyth> So only runtime |
02:59:23 | FromDiscord | <Nalmyth> (edit) "https://play.nim-lang.org/#ix=49vp" => "https://play.nim-lang.org/#ix=49vq" |
02:59:35 | FromDiscord | <Elegantbeef> It's not the ref as much as the `object of` 😄 |
02:59:48 | FromDiscord | <Elegantbeef> Inheritance means this can be any type |
03:00:07 | FromDiscord | <Elegantbeef> You also may want to look at methods |
03:00:22 | FromDiscord | <Nalmyth> Yea, currently using methods here & bases |
03:00:41 | FromDiscord | <Nalmyth> Need to dig a bit more |
03:00:55 | FromDiscord | <Nalmyth> So many options in Nim |
03:01:38 | FromDiscord | <Nalmyth> (edit) "Nim" => "Nim, quite easy to shoot oneself in the foot" |
03:03:43 | FromDiscord | <Nalmyth> Yea, everything now working thank you 🙏 |
03:05:31 | FromDiscord | <Elegantbeef> No problem |
03:08:37 | FromDiscord | <Nalmyth> Methods seems to be auto-routing↵So needed to reference a `{.base.}` method |
03:08:44 | FromDiscord | <Nalmyth> Then everything started lining up |
03:09:24 | FromDiscord | <Elegantbeef> Well yea they're dynamic dispatch |
03:20:53 | * | Jjp137 quit (Quit: Leaving) |
03:25:40 | * | Jjp137 joined #nim |
05:36:00 | NimEventer | New post on r/nim by No_Sprinkles2223: Correctness of this structure to manage thread-safe data, see https://reddit.com/r/nim/comments/x4mntg/correctness_of_this_structure_to_manage/ |
05:38:14 | FromDiscord | <retkid> so like |
05:38:37 | FromDiscord | <retkid> seq[byte] of len 10 ↵takes up 10 bytes in memory + the type dec |
05:39:33 | FromDiscord | <retkid> i wanna make a read only stream which deletes the memory as it goes but assigning a pointer to each byte is vastly inefficient |
05:39:42 | FromDiscord | <retkid> so maybe doing it in blocks would work better? |
06:14:14 | FromDiscord | <Rika> what? |
06:14:32 | FromDiscord | <Rika> well i would like to know the use case first |
06:20:52 | FromDiscord | <konradmb> How https://nim-lang.org/docs/segfaults.html works? By what magic it executes code when it is only imported? I've checked C sources and top-level statements indeed end up in module init. |
06:25:46 | FromDiscord | <Elegantbeef> Probably has compiler support |
06:26:24 | FromDiscord | <leorize> it registers a SIGSEGV handler on linux |
06:26:47 | FromDiscord | <leorize> I'd recommend not using that module at all |
06:27:14 | FromDiscord | <leorize> it does not do signal safety correctly and can put GC in inconsistent state |
06:27:28 | FromDiscord | <leorize> on Windows I believe it uses SEH, but its been awhile since I read the source |
06:28:05 | FromDiscord | <leorize> oh wait you're asking for how code is executed on import, mb \:p |
06:28:27 | FromDiscord | <konradmb> Yeah yeah, I know, but how does it do this, when it is only imported? I thought it would work this way only if it is included. |
06:28:38 | FromDiscord | <konradmb> Yes \:D |
06:28:49 | FromDiscord | <leorize> top-level statements are executed automatically on import before your main module |
06:29:10 | FromDiscord | <Rika> which is why there's the `when isMainModule:` thing, so if you dont want code to be run on import |
06:33:58 | FromDiscord | <konradmb> OMG, how did I miss this |
06:35:37 | FromDiscord | <Rika> i can see how many people could miss it |
06:35:58 | FromDiscord | <Rika> its kinda a thing only in python and similar languages with top level code, i guess |
06:39:11 | FromDiscord | <konradmb> i wonder how many other things i take as obvious but i'm wrong about 😅 |
06:39:30 | FromDiscord | <konradmb> Ok, so next question\: what do you recommend apart from wrapping everything in if else if else?↵https://nim-lang.org/docs/wrapnils.html is good enough? It says "experimental module". |
06:40:01 | FromDiscord | <Elegantbeef> I recommend only using references where needed which reduces the amount of dereferencing required 😄 |
06:40:32 | FromDiscord | <konradmb> I can't - wrapped C lib |
06:41:02 | FromDiscord | <konradmb> aka gintro |
06:41:11 | FromDiscord | <konradmb> aka gtk |
06:41:27 | FromDiscord | <Elegantbeef> Ah well then yea have fun with wrapnils, it will mostly work |
07:20:10 | FromDiscord | <retkid> In reply to @Rika "well i would like": what if you're writing a large file to something you want it out of memory as quick as possible |
07:52:12 | * | Vladar joined #nim |
08:07:32 | * | mahlon quit (Ping timeout: 255 seconds) |
08:11:17 | * | tiorock joined #nim |
08:11:17 | * | tiorock quit (Changing host) |
08:11:17 | * | tiorock joined #nim |
08:11:17 | * | rockcavera quit (Killed (tantalum.libera.chat (Nickname regained by services))) |
08:11:17 | * | tiorock is now known as rockcavera |
08:19:32 | * | derpydoo joined #nim |
08:22:57 | * | mahlon joined #nim |
08:24:50 | * | rockcavera quit (Remote host closed the connection) |
08:35:38 | FromDiscord | <Tuatarian> this doesn't compile and I don't really understand why |
08:35:45 | FromDiscord | <Tuatarian> sent a code paste, see https://play.nim-lang.org/#ix=49wu |
08:36:01 | FromDiscord | <Tuatarian> the issue is on line 1, saying openArray expects one type parameter |
08:36:01 | FromDiscord | <Elegantbeef> `array` not `openarray` |
08:36:06 | FromDiscord | <Tuatarian> oh |
08:36:08 | FromDiscord | <Tuatarian> of course |
08:36:09 | FromDiscord | <Tuatarian> thanks |
08:36:14 | FromDiscord | <Elegantbeef> openarray are homogenous collections to wrap over `array` and `seq` |
08:36:35 | FromDiscord | <Tuatarian> yeah, that was a mental typo |
08:36:48 | FromDiscord | <Tuatarian> + tiredness, just totally missed that |
08:42:49 | madprops | is there a way to nimble run without the output? |
08:42:52 | madprops | im testing piping to vim |
08:42:57 | madprops | and it pipes the compiler output |
08:43:08 | madprops | or some output |
08:44:01 | FromDiscord | <Elegantbeef> `nimble --silent ...` |
08:44:27 | madprops | that did it, thanks |
09:08:02 | * | Vladar quit (Quit: Leaving) |
09:18:57 | FromDiscord | <voidwalker> hey @flywind I tried your ipfshttpclient yesterday, to add a file. Worked, there is one problem though, it's not async, so very long blocks can happen. Why did you choose puppy instead of httpclient for this, since it doesn't support async ? Any idea if async will come soon to puppy ? |
09:19:26 | FromDiscord | <voidwalker> (edit) "hey @flywind I tried your ipfshttpclient yesterday, to add a file. Worked, there is one problem though, it's not async, so very long blocks can happen. Why did you choose puppy instead of httpclient for this, since it doesn't support async ? ... Any" added "(nice syntax/API maybe?)" |
09:20:13 | FromDiscord | <flywind> Because `httpclient` doesn't seem to work. |
09:22:48 | * | neceve joined #nim |
09:22:48 | FromDiscord | <voidwalker> huh, how can that be ? |
09:26:01 | * | jmdaemon quit (Ping timeout: 260 seconds) |
09:34:53 | FromDiscord | <aruZeta> sent a code paste, see https://play.nim-lang.org/#ix=49wH |
09:45:28 | madprops | help i entered nim console and don't know how to leave |
09:45:35 | madprops | don't know how it even opened |
09:45:55 | FromDiscord | <aruZeta> reminds me to "i can't exit vim" |
09:46:15 | FromDiscord | <aruZeta> have never used it but try using Ctrl D? |
09:46:19 | madprops | quit() worked |
09:46:25 | FromDiscord | <aruZeta> nice |
09:47:39 | FromDiscord | <baalajimaestro> Nim console isn't like vim console afterall↵(<@709044657232936960_madprops=5b=49=52=43=5d>) |
10:13:08 | FromDiscord | <Forest [She/Her]> Does Nim have a way for me to completely override what built-in functions (such as `=`) do within templates? |
10:13:45 | FromDiscord | <Forest [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=49wQ |
10:13:50 | FromDiscord | <Forest [She/Her]> But with `=` pointing to my own custom function |
10:18:04 | FromDiscord | <MegaIng> In reply to @Forest "Does Nim have a": You can certainly do that with macros, but probably not with just templates |
10:26:21 | FromDiscord | <dom96> yep, you need macros for that |
10:28:09 | FromDiscord | <retkid> yo have you guys heard of chapel lang |
10:30:09 | FromDiscord | <MegaIng> Is it documented anywhere that `` `a 0` `` and `` `a 00` `` are the same identifier? Nim is not just style insenstive, but also insensitive to leading zeros... |
10:40:19 | FromDiscord | <aruZeta> sent a code paste, see https://play.nim-lang.org/#ix=49wZ |
10:45:20 | FromDiscord | <Forest [She/Her]> In reply to @dom96 "yep, you need macros": Sad but fair enough |
10:54:37 | * | mahlon quit (Ping timeout: 252 seconds) |
11:04:34 | * | pro joined #nim |
11:06:36 | * | pro quit (Client Quit) |
11:07:21 | FromDiscord | <sealmove> @Forest you are not satisfied with `:=` |
11:07:24 | FromDiscord | <sealmove> ? |
11:07:46 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=49x6 |
11:07:51 | FromDiscord | <Forest [She/Her]> In reply to @รєคɭ๓๏שє "<@909883978717204561> you are not": What's that? |
11:08:01 | FromDiscord | <sealmove> You can define it |
11:08:18 | FromDiscord | <Forest [She/Her]> Also nope, my goal is to generate java code in the most Nim-like way (until i make the JVM backend) |
11:09:52 | FromDiscord | <sealmove> ok :( |
11:15:58 | FromDiscord | <4zv4l> what's the difference between using `template` and `proc {.inline.}` ? |
11:16:28 | FromDiscord | <sealmove> templates can be untyped |
11:16:53 | FromDiscord | <sealmove> and they are not "hinting" the compiler, they always do substitution, like `#define` in c |
11:17:41 | FromDiscord | <4zv4l> alright, thanks ! |
11:58:01 | FromDiscord | <Rika> In reply to @aruZeta "any fix?": EncodedQRCode/main as main2 |
11:58:17 | FromDiscord | <Rika> (edit) "EncodedQRCode/main" => "`EncodedQRCode/main" | "main2" => "main2`" |
11:58:31 | FromDiscord | <Rika> Add the as part to the end |
11:58:37 | FromDiscord | <Rika> (edit) "end" => "part I wrote" |
11:58:41 | * | mahlon joined #nim |
11:58:54 | FromDiscord | <Rika> In reply to @MegaIng "Is it documented anywhere": Sounds like a big |
11:58:58 | FromDiscord | <Rika> Bug |
12:04:31 | * | madprops quit (Quit: biourvgrt445) |
12:06:11 | * | madprops joined #nim |
12:06:11 | * | madprops quit (Changing host) |
12:06:11 | * | madprops joined #nim |
12:16:43 | * | Freneticks joined #nim |
12:17:01 | Freneticks | Is there a lib for making http reverse proxy easily ? |
12:41:30 | FromDiscord | <EyeCon> Do you really want to make a reverse proxy, or something that would run behind a reverse proxy? |
12:42:21 | FromDiscord | <auxym> In reply to @4zv4l "alright, thanks !": yeah inline just adds the `inline` annotation in the C code, then gcc is free to do with that as it wants. templates are expanded at the nim AST level |
12:42:56 | FromDiscord | <kimmartial> sent a long message, see http://ix.io/49xD |
12:43:10 | FromDiscord | <EyeCon> <@&371760044473319454> ^ |
12:44:44 | * | madprops quit (Quit: biourvgrt445) |
12:47:22 | * | madprops joined #nim |
12:47:23 | * | madprops quit (Changing host) |
12:47:23 | * | madprops joined #nim |
12:54:55 | * | arkurious joined #nim |
13:01:55 | FromDiscord | <Kwinn> Hi I discovered Nim (heard of earlier but wasn't interested until) yesterday and it sounds really cool and I don't quite understand why it's not more popular. Are there any known bigger projects which include Nim? And what do you guys personally use Nim for and what do you think Nim is good for and what is it not good for? |
13:04:04 | Freneticks | EyeCon a reverse proxy |
13:04:31 | Freneticks | i want to filter some urls with token inside redis |
13:04:40 | FromDiscord | <Forest [She/Her]> In reply to @Kwinn "Hi I discovered Nim": It's because it's not backed by a big company, really |
13:04:57 | FromDiscord | <Forest [She/Her]> It's been around for a while but the main reason languages get popular is because of big backers |
13:05:03 | FromDiscord | <Forest [She/Her]> Golang has Google, for example |
13:05:08 | FromDiscord | <Forest [She/Her]> Java has oracle |
13:08:39 | FromDiscord | <Kwinn> Rust has Mozilla |
13:09:01 | FromDiscord | <Kwinn> Makes sense I don't know a lot of languages that have no popular backer |
13:09:53 | FromDiscord | <exelotl> In reply to @Kwinn "Hi I discovered Nim": I'm using Nim to make a Game Boy Advance game: https://forum.nim-lang.org/t/8375↵With the right options (and restricting yourself to certain features) it is brilliant for targetting underpowered hardware |
13:11:37 | FromDiscord | <Forest [She/Her]> In reply to @Kwinn "Makes sense I don't": Yup fair |
13:12:58 | FromDiscord | <ShalokShalom> Does anyone use this?↵↵https://github.com/haltcase/cascade |
13:14:30 | FromDiscord | <ShalokShalom> In reply to @Kwinn "Hi I discovered Nim": Status is probably the poster child. ↵↵https://nim-lang.org/blog/2018/08/07/nim-partners-with-status.html |
13:16:01 | FromDiscord | <Harper_breey> https://t.me/Etxcapital1 |
13:16:21 | FromDiscord | <ShalokShalom> <@&371760044473319454> |
13:17:39 | FromDiscord | <Forest [She/Her]> What happened? |
13:18:42 | * | madprops quit (Quit: biourvgrt445) |
13:19:38 | FromDiscord | <ShalokShalom> There was a spam bot |
13:19:55 | FromDiscord | <ShalokShalom> Something with crypto trading |
13:19:57 | FromDiscord | <auxym> In reply to @ShalokShalom "Does anyone use this?": First time I see it but seems like a small macro that could be useful in some cases |
13:22:33 | FromDiscord | <Forest [She/Her]> Ah |
13:23:52 | FromDiscord | <auxym> In reply to @exelotl "I'm using Nim to": out of curiosity, do you use ARC? or mm:none and pointers only? |
13:28:30 | FromDiscord | <exelotl> ARC didn't exist when I started the project so I used --mm:none and --os:standalone. But eventually we did switch to ARC, but we only use it very sparingly, there are no closures or seqs and hardly any ref objects in the codebase |
13:59:17 | FromDiscord | <Forest [She/Her]> What's the bare minimum that needs to be supported/implemented in a compile target to get most of pure Nim code running? `system.nim`? |
14:00:49 | * | madprops joined #nim |
14:00:50 | * | madprops quit (Changing host) |
14:00:50 | * | madprops joined #nim |
14:02:50 | FromDiscord | <Forest [She/Her]> Everything in `system.nim` |
14:54:31 | FromDiscord | <aruZeta> sent a code paste, see https://play.nim-lang.org/#ix=49yg |
15:09:22 | FromDiscord | <Superstart033> Good moning, everyone! Had any of you try the exercism Nim exercises? |
15:10:52 | FromDiscord | <Superstart033> Why when I run this? Gives me an error https://media.discordapp.net/attachments/371759389889003532/1015640024773038230/unknown.png |
15:10:58 | FromDiscord | <Superstart033> But this, passed https://media.discordapp.net/attachments/371759389889003532/1015640050068881519/unknown.png |
15:11:13 | FromDiscord | <Superstart033> their test script https://media.discordapp.net/attachments/371759389889003532/1015640114472435792/unknown.png |
15:11:35 | FromDiscord | <aruZeta> `` exports the proc |
15:11:42 | FromDiscord | <SaAnd> in order for the test script to see your `hello`, you needed to export it |
15:11:57 | FromDiscord | <aruZeta> that's why the second works |
15:12:14 | FromDiscord | <aruZeta> look at the error it says that it could not find the proc, because it was not exported |
15:12:38 | FromDiscord | <Superstart033> I didnt know why tho, I havent read that far into Nim in Action |
15:12:55 | FromDiscord | <Superstart033> Thanks guys |
15:13:10 | FromDiscord | <SaAnd> You're welcome \:) |
15:14:14 | FromDiscord | <SaAnd> We are here to answer any other questions you have |
15:18:02 | FromDiscord | <Forest [She/Her]> I'm wondering if i should scrap what i have for 'bindings' to Java and just work on the JVM backend |
15:18:14 | FromDiscord | <Forest [She/Her]> College starts for me after tomorrow tho so :/ |
15:19:27 | FromDiscord | <Superstart033> What do you mean? |
15:19:35 | FromDiscord | <Superstart033> Like, using the JVM directly with Nim? |
15:20:15 | FromDiscord | <gibson> In reply to @ShalokShalom "Does anyone use this?": Neat, it's like `std/with` but supports `let` assignments. |
15:22:39 | FromDiscord | <ShalokShalom> It appeared in one of the "awesome" lists in the "functional programming" category for some reason |
15:24:27 | FromDiscord | <dain> https://nim-lang.org/docs/testament.html hey can someone explain what is actually going on here, i don't understand it at all |
15:24:37 | FromDiscord | <dain> what does the giant discarded string actually do |
15:25:04 | FromDiscord | <dain> sent a long message, see http://ix.io/49yF |
15:31:58 | FromDiscord | <dain> why does it have to be a giant string and not actual code |
15:34:00 | FromDiscord | <Forest [She/Her]> In reply to @Superstart033 "Like, using the JVM": To compile Nim to a JVM target |
15:38:49 | FromDiscord | <ShalokShalom> @dain I recommend you to open up an issue |
15:42:57 | FromDiscord | <Bung> In reply to @dain "https://nim-lang.org/docs/testament.html hey can so": internal it use a string parser decide what the test task to do |
15:43:03 | FromDiscord | <dain> to ask for the docs to be clarified? okei maybe |
15:45:11 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=49yN |
15:45:46 | FromDiscord | <voidwalker> I get a `Error: internal error: yield in expr not lowered` when I have ` data.add({"Abspath:": path})` there after the await |
15:46:59 | FromDiscord | <voidwalker> If I comment it out, or put it after the if, it compiles |
15:48:17 | FromDiscord | <dain> In reply to @Bung "internal it use a": why does it have to do this |
15:48:21 | FromDiscord | <voidwalker> (edit) "If I comment it out, or put it ... after" added "before the await, or" |
15:48:37 | FromDiscord | <dain> is it not possible for it to use the macro system? |
15:49:06 | FromDiscord | <Bung> maybe just simple and effective |
15:50:10 | FromDiscord | <Bung> can be done use nim macro, but not necessary |
15:50:54 | FromDiscord | <dain> well im not a fan of it, it means i get no syntax highlighting or editor support, it's hard to read |
15:52:51 | FromDiscord | <Bung> sure, but use macro implementation is harder than string , like a mini language |
15:54:03 | FromDiscord | <dain> i find that hard to believe |
16:00:46 | * | jmdaemon joined #nim |
16:13:47 | * | estiquelapice joined #nim |
16:20:29 | * | estiquelapice quit () |
16:21:23 | FromDiscord | <Superstart033> Im apparently not using "Whatever" correctly, what is wrong with this one? https://media.discordapp.net/attachments/371759389889003532/1015657768360874034/unknown.png |
16:21:44 | * | estiquelapice joined #nim |
16:21:49 | FromDiscord | <Superstart033> I try discarding it, but the same error happens again |
16:22:17 | FromDiscord | <Bung> result = “Whatever” |
16:22:25 | FromDiscord | <SaAnd> the `echo` line is part of the proc, so the whatever part is not the return value |
16:22:36 | FromDiscord | <SaAnd> unindent the echo |
16:23:33 | FromDiscord | <Superstart033> Omg |
16:23:55 | FromDiscord | <Superstart033> Thanks! |
16:24:01 | FromDiscord | <Superstart033> Bruh wow |
16:25:05 | FromDiscord | <SaAnd> welcome, these sorts of things happen to all of us |
16:26:50 | FromDiscord | <voidwalker> I'm trying to achieve the equivalent of `curl 'http://127.0.0.1:5001/api/v0/add?nocopy=true' -F 'file=@SOMEFILE;headers="Abspath: /home/magik6k/full/path/to/SOMEFILE"'` with httpClient. |
16:27:10 | FromDiscord | <voidwalker> I am confused about the `Abspath: /home...` part. What kind of headers are these supposed to be? |
16:31:21 | * | estiquelapice quit () |
16:31:26 | FromDiscord | <SaAnd> just today, i was angry that `value.string` wasn't converting to a string, when i just needed to do `$value` |
16:32:30 | * | estiquelapice joined #nim |
16:39:01 | * | kiwi joined #nim |
16:39:25 | * | kiwi is now known as Guest3066 |
16:44:09 | * | estiquelapice quit () |
16:45:14 | * | estiquelapice joined #nim |
16:46:41 | * | estiquelapice quit (Client Quit) |
16:48:35 | * | Guest3066 quit (Quit: Client closed) |
16:49:14 | FromDiscord | <dom96> In reply to @voidwalker "I get a `Error:": report it on github it's a nim bug |
16:49:32 | FromDiscord | <dom96> but you can likely workaround by assigning the `await ...` to a variable |
16:49:36 | FromDiscord | <dom96> and then just `echo yourVar` |
16:51:45 | * | estiquelapice joined #nim |
16:56:46 | FromDiscord | <voidwalker> yeah thanks @dom96 just saw it mentioned here, among others: https://github.com/nim-lang/Nim/issues/13583 |
16:57:40 | FromDiscord | <voidwalker> adding discard before `data.add({"Abspath:": path})` seems to fix it |
16:57:56 | FromDiscord | <voidwalker> i wasn't even aware it's returning something.. maybe I am using it wrong |
16:59:06 | FromDiscord | <voidwalker> Can you please take a look at this ? `curl 'http://127.0.0.1:5001/api/v0/add?nocopy=true' -F 'file=@SOMEFILE;headers="Abspath: /home/magik6k/full/path/to/SOMEFILE"'` |
16:59:21 | FromDiscord | <voidwalker> It appears to be `setting custom header values inside multi-part form fragments ` |
17:04:58 | * | estiquelapice quit () |
17:05:44 | FromDiscord | <voidwalker> There is some talk about it here: https://forum.nim-lang.org/t/3499 but I understood close to nothing from it |
17:14:53 | * | estiquelapice joined #nim |
17:16:43 | * | estiquelapice quit (Client Quit) |
17:17:47 | * | estiquelapice joined #nim |
17:20:46 | * | estiquelapice quit (Client Quit) |
17:22:09 | * | estiquelapice joined #nim |
17:28:03 | * | neceve quit (Ping timeout: 268 seconds) |
17:29:20 | * | pro joined #nim |
17:34:12 | FromDiscord | <jos> what's state of the art for rust-style enums |
17:34:18 | FromDiscord | <jos> i see patty https://github.com/andreaferretti/patty |
17:34:23 | FromDiscord | <jos> is this the go-to solution |
17:41:06 | FromDiscord | <ShalokShalom> https://github.com/nim-lang/Nim/wiki/Curated-Packages/de9cb0ecd52573f879ce294aee1b121aa6108362#language |
17:45:56 | FromDiscord | <leorize> shameless plug\: https://github.com/alaviss/union |
17:45:57 | FromDiscord | <leorize> not really rust-style but more typescript-inspired |
17:46:57 | FromDiscord | <ShalokShalom> sent a long message, see http://ix.io/49zj |
17:47:56 | FromDiscord | <ShalokShalom> @leorize#0000 A union is not really the same as pattern matching, is it? |
17:49:06 | * | neceve joined #nim |
17:50:08 | FromDiscord | <jos> thanks 🙂 i'll stick with patty since it's the most popular i guess |
17:50:16 | FromDiscord | <jos> that has never failed me before surely aha 🙂 |
17:50:37 | FromDiscord | <leorize> yea it's not pattern matching↵(@ShalokShalom) |
17:51:00 | FromDiscord | <leorize> it predates destructors↵(@ShalokShalom) |
17:51:13 | FromDiscord | <leorize> and the memory is fully managed on the C++ side of things |
17:59:26 | FromDiscord | <jos> oof the limitation of not being able to create two variants with the same field name |
17:59:29 | FromDiscord | <jos> kind of killing me for patty |
17:59:55 | FromDiscord | <jos> unions solve the same problem for my purposes |
17:59:59 | FromDiscord | <jos> maybe i check out that lib |
18:09:35 | * | estiquelapice quit () |
18:10:21 | * | pro quit (Quit: pro) |
18:22:20 | FromDiscord | <shoot_in_foot()> sent a code paste, see https://play.nim-lang.org/#ix=49zp |
18:22:35 | FromDiscord | <shoot_in_foot()> (edit) "https://play.nim-lang.org/#ix=49zp" => "https://play.nim-lang.org/#ix=49zq" |
18:22:42 | FromDiscord | <shoot_in_foot()> (edit) "https://play.nim-lang.org/#ix=49zq" => "https://play.nim-lang.org/#ix=49zr" |
18:23:07 | FromDiscord | <shoot_in_foot()> spot the difference |
18:24:37 | FromDiscord | <Superstart033> Anyone has an idea of how could I find if an entire string is in upper case? |
18:25:25 | FromDiscord | <ShalokShalom> In reply to @leorize "it predates destructors (<@208199869301522432>)": You mean that example has been done, before constructors had been introduced |
18:25:30 | FromDiscord | <Superstart033> This is what Im doing at the moment https://media.discordapp.net/attachments/371759389889003532/1015689007570616331/unknown.png |
18:25:35 | FromDiscord | <ShalokShalom> And its now possible otherwise? |
18:25:51 | FromDiscord | <ShalokShalom> (edit) "constructors" => "destructors" |
18:26:36 | FromDiscord | <leorize> yes, but it has to be done by the library |
18:26:49 | FromDiscord | <leorize> you can probably do an auto-destroying wrapper, but that'd get annoying quick |
18:27:39 | FromDiscord | <ShalokShalom> Thanks |
18:28:04 | FromDiscord | <leorize> I believe there's `isUpperAscii`↵(@Superstart033) |
18:28:25 | FromDiscord | <leorize> https://nim-lang.org/docs/strutils.html#toUpperAscii%2Cstring |
18:28:38 | FromDiscord | <leorize> oops, wrong function |
18:28:56 | FromDiscord | <Prestige> sent a code paste, see https://play.nim-lang.org/#ix=49zt |
18:29:06 | FromDiscord | <leorize> https://nim-lang.org/docs/strutils.html#isUpperAscii%2Cchar |
18:29:24 | FromDiscord | <leorize> system.closureScope is the way to go↵(@Prestige) |
18:30:00 | FromDiscord | <leorize> [https://nim-lang.org/docs/sugar.html#capture.m,varargs[typed],untyped](https://nim-lang.org/docs/sugar.html#capture.m,varargs%5Btyped%5D,untyped) \<- also this |
18:30:11 | FromDiscord | <Prestige> Thanks! |
18:30:27 | FromDiscord | <ShalokShalom> https://github.com/filcuc/nimqml/issues/46 |
18:33:06 | * | neceve quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
18:33:34 | * | neceve joined #nim |
18:38:57 | * | neceve quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
18:39:18 | * | neceve joined #nim |
18:43:58 | FromDiscord | <d4rckh> how can i convert into a string N number of chars starting at a pointer? |
18:44:02 | * | neceve quit (Client Quit) |
18:44:23 | * | neceve joined #nim |
18:46:51 | FromDiscord | <d4rckh> got it |
18:51:56 | * | neceve quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
18:52:20 | * | neceve joined #nim |
18:52:58 | FromDiscord | <jos> why does `import patty` not work when i use `nimble build` |
18:53:05 | FromDiscord | <jos> but vscode is fine |
18:53:15 | FromDiscord | <jos> the error is `/Users/jos/tfp/labs/crag/src/scanner.nim(2, 8) Error: cannot open file: patty` |
18:53:24 | FromDiscord | <jos> i used `nimble install patty` and the manifest looks fine |
18:53:32 | FromDiscord | <jos> uhhhhhhhh nevermind |
18:53:36 | FromDiscord | <jos> it's missing from the manifest now |
18:53:47 | FromDiscord | <jos> odd that vscode doesn't complain though |
18:54:20 | FromDiscord | <Generic> if you invoke the compiler manually it will also just pick up everything you've installed |
18:54:21 | FromDiscord | <Yardanico> In reply to @jos "odd that vscode doesn't": because it's not using nimble to build and check code |
18:54:30 | FromDiscord | <Yardanico> it uses nimsuggest and nim check |
18:54:49 | FromDiscord | <jos> well i guess it's pulling it from some global local repo that's updated with nimble install? |
18:54:55 | FromDiscord | <jos> how does it know which version to use without a requires statement |
18:55:03 | FromDiscord | <Yardanico> In reply to @jos "how does it know": it just uses the latest |
18:55:06 | FromDiscord | <Forest [She/Her]> Is `ModuleDescriptor$Builder` a valid import in Nim? |
18:55:10 | FromDiscord | <Yardanico> In reply to @Forest "Is `ModuleDescriptor$Builder` a valid": no |
18:55:14 | FromDiscord | <jos> fair enough |
18:55:18 | FromDiscord | <Forest [She/Her]> Alright so need to handle that |
18:56:43 | FromDiscord | <Forest [She/Her]> Nice, my code for using Java in a sane way is nearly done |
18:56:52 | FromDiscord | <Forest [She/Her]> Well, it'll never be sane |
18:56:53 | FromDiscord | <Forest [She/Her]> It's Java |
18:57:09 | FromDiscord | <Superstart033> In reply to @leorize "I believe there's `isUpperAscii`": Yeah, I try it but it only works for chars |
18:57:44 | FromDiscord | <Yardanico> In reply to @Superstart033 "Yeah, I try it": if you want unicode, use std/unicode |
18:57:44 | FromDiscord | <Forest [She/Her]> In reply to @Superstart033 "Yeah, I try it": Just iterate through the string with a variable, set it to false if there's a lowercase character |
18:58:08 | FromDiscord | <Yardanico> ah his question was about that |
18:58:17 | FromDiscord | <Superstart033> Yeah |
18:58:21 | FromDiscord | <Superstart033> In reply to @Forest "Just iterate through the": I’ll try |
18:58:23 | FromDiscord | <Superstart033> Thanks |
18:58:31 | FromDiscord | <Forest [She/Her]> Np! |
18:59:19 | FromDiscord | <jos> ooook need another lifeline here |
18:59:23 | FromDiscord | <jos> `/Users/jos/.choosenim/toolchains/nim-1.6.6/lib/system.nim(512, 24) Error: type mismatch: got 'HSlice[system.char, system.char]' for '(a: 48, b: 57)' but expected 'char'` |
18:59:52 | FromDiscord | <jos> even with --verbose i don't get much more, can't see if my code is invoking this somehow |
18:59:56 | FromDiscord | <jos> or if this is just part of the toolchain |
19:00:14 | FromDiscord | <jos> on an m1 mac if that helps |
19:00:18 | FromDiscord | <Yardanico> it should show above where that error came from your code |
19:00:30 | FromDiscord | <jos> https://media.discordapp.net/attachments/371759389889003532/1015697817110593606/unknown.png |
19:00:37 | FromDiscord | <jos> idk to me it looks like it's a dependency |
19:00:47 | FromDiscord | <Yardanico> try without nimble to see if it outputs more |
19:01:19 | FromDiscord | <jos> if i copy paste the func that nimble shows there it just shows the same |
19:04:59 | FromDiscord | <jos> well reading the source of system.nim |
19:05:01 | FromDiscord | <jos> i figured it was this |
19:05:03 | FromDiscord | <jos> https://media.discordapp.net/attachments/371759389889003532/1015698957046927410/unknown.png |
19:05:32 | FromDiscord | <jos> for some reason the range '0'..'9' isn't working-- i later use it like this `case scanner.next(): of numbers:` |
19:05:42 | FromDiscord | <jos> idk if that's not supported or something but i read in the docs that ranges should be valid there |
19:05:47 | FromDiscord | <jos> o maybe i got it backwards |
19:05:56 | FromDiscord | <jos> no wait i checked that, 0..9 is the right order |
19:11:45 | FromDiscord | <Patitotective> are you making a lexer jos? |
19:16:39 | FromDiscord | <jos> ye |
19:16:49 | FromDiscord | <jos> i want to build a language very similar to nim and rust |
19:17:08 | FromDiscord | <jos> i want ORC as default so i'm building it in nim so it's easy to bootstrap the compiler to my lang later |
19:17:41 | FromDiscord | <Patitotective> In reply to @jos "ye": i recently made a lexer too, if you wanted to check it out↵https://github.com/Patitotective/kdl-nim/blob/main/src/kdl/new_lexer.nim |
19:17:48 | FromDiscord | <Patitotective> (edit) "wanted" => "want" |
19:17:57 | FromDiscord | <jos> epic |
19:17:59 | FromDiscord | <jos> i will definitely look for inspo |
19:18:05 | FromDiscord | <jos> im looking at an old lox implementation in nim rn |
19:18:11 | FromDiscord | <jos> did you use crafting interpreters? |
19:18:35 | FromDiscord | <Patitotective> In reply to @jos "did you use crafting": what is that? |
19:19:06 | FromDiscord | <Patitotective> iirc there was an article about a lox implementation lexer, is that what you're talking about? |
19:19:10 | FromDiscord | <jos> book written by a pretty cool dev |
19:19:17 | FromDiscord | <jos> lox is the language you implement in crafting interpreters (book) |
19:19:28 | FromDiscord | <jos> https://craftinginterpreters.com/ |
19:19:31 | FromDiscord | <jos> there's a free ebook |
19:19:31 | FromDiscord | <Patitotective> In reply to @jos "did you use crafting": then, no :p |
19:19:52 | FromDiscord | <jos> i'm enjoying it a lot, it's really nice to learn from his mistakes |
19:20:07 | FromDiscord | <jos> iirc i think his most recent work is Google's auto formatter for dart |
19:20:25 | FromDiscord | <Patitotective> i think this book can help you a lot if you're going to make a lang https://pgrandinetti.github.io/compilers |
19:20:41 | FromDiscord | <jos> i'll def add that to my list |
19:21:02 | FromDiscord | <jos> i got a physical copy of crafting interpreters though so you could say it's kind of serious |
19:29:36 | FromDiscord | <Forest [She/Her]> Anyone know why this code gives me this error? Code is at https://github.com/Mythical-Forest-Collective/ShittyCodeWrapper↵↵My error is `/home/code/projects/Nim/ShittyCodeWrapping/wrapped/java/lang/Object.nim(2, 25) Error: cannot open file: wrapped/java/lang/Class` |
19:31:11 | FromDiscord | <Patitotective> In reply to @Forest "Anyone know why this": where are you calling it from?↵from `main.nim`? |
19:33:15 | FromDiscord | <Forest [She/Her]> In reply to @Patitotective "where are you calling": Yup |
19:33:51 | FromDiscord | <Patitotective> :/ |
19:37:21 | FromDiscord | <Patitotective> i guess imports are relative to that module↵so `Object` is trying to import `wrapped/java/lang/wrapped/java/lang/Class` |
19:39:20 | FromDiscord | <Forest [She/Her]> Aah okay |
19:42:12 | FromDiscord | <Forest [She/Her]> Hm, idk how to import it in a sane way then |
19:42:40 | FromDiscord | <Forest [She/Her]> Unless i just make Object do `import Class` and same for other classes |
19:42:44 | FromDiscord | <Forest [She/Her]> It's just a bit harder |
19:42:48 | FromDiscord | <Patitotective> main module should import submodules, submodules shouldnt import themselves and if you need that make a common module |
19:45:44 | FromDiscord | <4zv4l> if I have an array I access like this↵`arr[1-variable][2-variable]`↵can I make a mutable variable pointing to that case ?↵`var c = arr[1-variable][2-variable]` ? |
19:45:54 | FromDiscord | <Forest [She/Her]> In reply to @Patitotective "main module should import": Shouldn't import themselves as in? |
19:45:55 | FromDiscord | <4zv4l> because I tried but it doesn't modify the actual array |
19:46:24 | FromDiscord | <Patitotective> In reply to @4zv4l "if I have an": you can use pointers |
19:46:32 | FromDiscord | <4zv4l> ptr ? |
19:46:38 | FromDiscord | <Patitotective> addr |
19:47:15 | FromDiscord | <4zv4l> thanks !! |
19:58:04 | * | xigoi joined #nim |
20:00:00 | xigoi | I have a problem testing a Nimble package which includes C code. When I do `nimble test`, the compiler seems to be launched in a different directory than usual, which breaks the path in {.header.}. |
20:02:56 | xigoi | Or in general, is there a way to make {.header.} relative to the Nim file and not to the working directory? {.compile.} seems to already do this correctly. |
20:04:36 | FromDiscord | <Bung> use currentSourcePath |
20:04:55 | xigoi | How exactly? |
20:10:19 | FromDiscord | <ShalokShalom> Didnt Nim add official support for pattern matching? |
20:11:10 | FromDiscord | <ShalokShalom> Yep https://nim-lang.org/blog/2021/03/10/fusion-and-pattern-matching.html |
20:11:36 | FromDiscord | <ShalokShalom> @jos Did you see this? |
20:12:38 | xigoi | @ShalokShalom if it requires an experimental feature, is it really “official”? |
20:13:31 | FromDiscord | <Patitotective> In reply to @ShalokShalom "Yep https://nim-lang.org/blog/2021/03/10/fusion-and": 👀 |
20:14:28 | FromDiscord | <ShalokShalom> Ah, its not part of the official language |
20:14:53 | FromDiscord | <ShalokShalom> @xigoi yeah, I confused it, since it was part of the official blog post |
20:15:14 | FromDiscord | <ShalokShalom> I forgot, that practically everybody for practically every case can post there |
20:15:41 | FromDiscord | <Patitotective> In reply to @ShalokShalom "@xigoi[IRC]#0000 yeah, I confused": irc users dont have discord id :p |
20:17:02 | xigoi | @Patitotective The bridge bot has correctly transformed it into just “@xigoi” |
20:17:24 | FromDiscord | <Forest [She/Her]> Well, i think I'm gonna be struggling... A lot |
20:17:28 | FromDiscord | <Patitotective> In reply to @xigoi "@Patitotective The bridge bot": :o |
20:17:33 | FromDiscord | <Patitotective> In reply to @Forest "Well, i think I'm": 🤨 |
20:17:44 | FromDiscord | <Forest [She/Her]> Java does a lot of recursive module imports |
20:18:04 | FromDiscord | <Forest [She/Her]> And in Nim with the thing that maps it all out into Nim files, it uses that same structure |
20:18:22 | FromDiscord | <Patitotective> you can use include to try to avoid cyclic imports |
20:18:25 | FromDiscord | <Forest [She/Her]> I wonder if i could flatten the code into a single file for things from the same subpackage... |
20:18:33 | * | krux02 joined #nim |
20:19:00 | FromDiscord | <Forest [She/Her]> In reply to @Patitotective "you can use include": Don't wanna do include tbh, and there's many cases where two classes reference eachother so I'd need to do some weird stuff with forward declaration |
20:22:22 | FromDiscord | <ShalokShalom> Its a shot in the dark, but when somebody knows how to transform and interact with Java on that level, then maybe the Clojure guys |
20:22:27 | FromDiscord | <Forest [She/Her]> Oh and the fact that Java classes can and do reference themselves |
20:23:11 | FromDiscord | <ShalokShalom> While I think its a pretty ~~ludacris~~ ambitious goal to begin with |
20:23:42 | FromDiscord | <Forest [She/Her]> In reply to @ShalokShalom "Its a shot in": I don't think what I'm doing currently is related? What I'm doing is trying to just map out Java modules to follow a structure that Nim actually likes lmao |
20:23:55 | FromDiscord | <Forest [She/Her]> In reply to @ShalokShalom "While I think its": Oh this isn't a starting project, i drop and picked up Nim multiple times |
20:23:59 | FromDiscord | <Forest [She/Her]> It's just, a hell lmao |
20:26:56 | FromDiscord | <ShalokShalom> Who got the idea, `of of` is a nice syntax |
20:27:00 | FromDiscord | <ShalokShalom> https://nim-lang.github.io/fusion/src/fusion/matching.html#matching-different-things-ref-object-matching |
20:27:31 | FromDiscord | <Forest [She/Her]> Oh that's horrible- |
20:27:43 | FromDiscord | <ShalokShalom> In reply to @Forest "Oh this isn't a": Oh, you misunderstanding me. I mean, its a pretty ambitious goal, regardless the specific issues you encounter |
20:28:00 | FromDiscord | <Yardanico> yes |
20:28:01 | FromDiscord | <Forest [She/Her]> Aah lmao fair |
20:28:07 | FromDiscord | <Forest [She/Her]> It's definitely ambitious |
20:28:10 | FromDiscord | <Yardanico> @Forest are you sure you're not going to drop nim this time? :P |
20:28:19 | FromDiscord | <Yardanico> i've seen you try plenty of projects and then disappear 🤔 |
20:28:24 | FromDiscord | <Forest [She/Her]> In reply to @Yardanico "<@909883978717204561> are you sure": By drop i mean my energy in general dips too much- |
20:28:34 | FromDiscord | <Forest [She/Her]> In reply to @Yardanico "i've seen you try": That's #hyperfixations for ya |
20:28:44 | FromDiscord | <ShalokShalom> I am also guilty about that |
20:28:52 | FromDiscord | <Forest [She/Her]> I'm trying to focus on this, have college on monday so this may eventually get dropped rip |
20:28:57 | FromDiscord | <Forest [She/Her]> I really want to get it going tho |
20:28:59 | FromDiscord | <ShalokShalom> We come, go around, look for other languages, and then come back again |
20:29:10 | FromDiscord | <Forest [She/Her]> Eh, i stick to Python and Nim tbh |
20:29:23 | FromDiscord | <Forest [She/Her]> Nim is great, and flexible for a compiled language |
20:29:45 | FromDiscord | <Forest [She/Her]> I really just do not want to write a macro myself lmao, they seem like hell, and I'm gonna have to write an entire backend at one point- |
20:33:09 | FromDiscord | <Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=49zM |
20:33:20 | FromDiscord | <Forest [She/Her]> Lmao what |
20:33:32 | FromDiscord | <Forest [She/Her]> Making an interpreter? |
20:33:42 | FromDiscord | <Patitotective> KDL document language implementation |
20:33:45 | FromDiscord | <Patitotective> https://kdl.dev |
20:35:14 | FromDiscord | <Forest [She/Her]> h fair |
20:35:15 | FromDiscord | <Forest [She/Her]> Ah |
20:46:53 | FromDiscord | <jos> nim has been really nice so far |
20:47:24 | FromDiscord | <jos> the syntax is definitely the biggest turn off for most developers I think |
20:47:39 | FromDiscord | <jos> and then lack of incremental compilation is scary |
20:47:45 | FromDiscord | <jos> but so far so good |
20:48:18 | FromDiscord | <Forest [She/Her]> In reply to @jos "the syntax is definitely": Why? Syntax is super flexible and nice imo |
20:48:26 | FromDiscord | <Forest [She/Her]> There is an incremental compilation flag iirc |
20:49:02 | FromDiscord | <Forest [She/Her]> `--incremental:on` @jos |
20:49:10 | FromDiscord | <Forest [She/Her]> It's experimental but it's there |
20:49:21 | FromDiscord | <jos> nice |
20:49:32 | FromDiscord | <jos> In reply to @Forest "Why? Syntax is super": lots of very strange choices imo |
20:49:49 | FromDiscord | <jos> if I had to list |
20:50:01 | FromDiscord | <jos> for pub |
20:50:05 | FromDiscord | <Yardanico> In reply to @Forest "There is an incremental": don't mention it, it's broken really |
20:50:10 | FromDiscord | <Forest [She/Her]> Fair |
20:50:28 | FromDiscord | <jos> I don't have much exp with generics in nim yet but, none(T) instead of none |
20:50:34 | FromDiscord | <Forest [She/Her]> I mean, could zig cc be used for compiling? It includes incremental compilation of C source files at least |
20:50:38 | FromDiscord | <jos> i.e. no inference there is odd |
20:50:42 | FromDiscord | <Forest [She/Her]> Fair |
20:51:01 | FromDiscord | <jos> plus the specifying generic args w. parens |
20:51:09 | * | xigoi left #nim (#nim) |
20:51:16 | FromDiscord | <Yardanico> In reply to @Forest "I mean, could zig": nim already does incremental compilation for C files |
20:51:16 | FromDiscord | <jos> no brackets, although I have no issue, will scare away the intended audience (systems lang) |
20:51:21 | FromDiscord | <Yardanico> it checks if they changed from the previous compilation |
20:51:29 | FromDiscord | <Yardanico> but most of compile time with modern enough CPUs is spent in the Nim part itself |
20:51:34 | FromDiscord | <Forest [She/Her]> Oh then what's the issue |
20:51:36 | FromDiscord | <Forest [She/Her]> Aaaah okay |
21:09:10 | FromDiscord | <Forest [She/Her]> How would i make a file that exports all types from other modules in the folder? |
21:09:35 | FromDiscord | <Elegantbeef> To make it automated you need a macro |
21:11:14 | FromDiscord | <Forest [She/Her]> Oh I'm not using macros, I'm generating this all with string building in Java |
21:11:25 | FromDiscord | <Forest [She/Her]> Since i have to use Java reflection for creating everything |
21:11:38 | FromDiscord | <Elegantbeef> That doesnt change anything i said |
21:11:49 | FromDiscord | <Elegantbeef> To export all modules in a folder automatically you need a macro |
21:12:41 | FromDiscord | <Forest [She/Her]> I don't mean automatically, i mean like, how do I collect together objects and stuff from files so they can be used in eachother while avoiding cyclic imports, is that possible? |
21:13:14 | FromDiscord | <Elegantbeef> You design it as such or just put all the types in a single module |
21:18:18 | FromDiscord | <Forest [She/Her]> Is a file that collects all of the types from separate files, so it can be imported as a package, a way to prevent cyclic import errors? |
21:20:41 | FromDiscord | <Forest [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=49zU |
21:20:45 | FromDiscord | <Forest [She/Her]> Let me just run that rq |
21:21:04 | FromDiscord | <Elegantbeef> As long as they only export types sure |
21:21:05 | FromDiscord | <Elegantbeef> The way to avoid cyclical imports is to delay them and design your program to not have them |
21:21:34 | FromDiscord | <Elegantbeef> You just created a cyclical import |
21:21:49 | FromDiscord | <Elegantbeef> That's the definition of cyclical imports |
21:22:02 | FromDiscord | <Elegantbeef> b imports sub which imports b which imports sub.... |
21:22:56 | FromDiscord | <Forest [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=49zV |
21:23:16 | FromDiscord | <Forest [She/Her]> In reply to @Elegantbeef "As long as they": Issue is i can't avoid that in my project easily, since I'm just generating everything straight from Java |
21:23:39 | FromDiscord | <Forest [She/Her]> Unless i try to flatten it down with a ton of forward declarations |
21:23:43 | FromDiscord | <Forest [She/Her]> Yeah i may have to do that |
21:24:35 | FromDiscord | <Yardanico> i doubt that'll work for more complex Java applications |
21:24:46 | FromDiscord | <Forest [She/Her]> In reply to @Yardanico "i doubt that'll work": Flattening it down? Probably |
21:24:52 | FromDiscord | <Forest [She/Her]> But I don't really know what else i can do |
21:26:54 | FromDiscord | <Forest [She/Her]> Java is a shitshow |
21:27:01 | FromDiscord | <Elegantbeef> Nim modules are not complicated, you read from the top down and when you hit `import` any module imported from that graph cannot access symbols below the import statement |
21:27:17 | FromDiscord | <Yardanico> In reply to @Forest "Issue is i can't": also I don't get it |
21:27:22 | FromDiscord | <Yardanico> weren't you wanting to make a nim -> java backend? |
21:27:26 | FromDiscord | <Yardanico> how come you're making nim -> java now 🤔 |
21:27:30 | FromDiscord | <Yardanico> (edit) "how come you're making ... nim" added "java ->" | removed "-> java" |
21:28:09 | FromDiscord | <Forest [She/Her]> In reply to @Elegantbeef "Nim modules are not": But then adding the import statement at the bottom would also make anything above not able to use the code, right? |
21:28:37 | FromDiscord | <Forest [She/Her]> In reply to @Yardanico "weren't you wanting to": That's on hold since it's definitely something waaay bigger and currently I don't have time for that (college starts in two days) |
21:28:41 | FromDiscord | <Elegantbeef> No you can delay imports |
21:29:21 | FromDiscord | <Yardanico> In reply to @Forest "That's on hold since": eh, I think on the contrary java -> nim is a much bigger task than nim -> java |
21:29:31 | FromDiscord | <Elegantbeef> The above is valid |
21:29:33 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=49zX |
21:29:45 | FromDiscord | <Elegantbeef> Well if i exported `MyThing` |
21:30:04 | FromDiscord | <Forest [She/Her]> In reply to @Yardanico "how come you're making": This project is just so you can easily use code generation as if it's nearly native to Nim, it's just a ton of string building |
21:30:24 | FromDiscord | <Forest [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=49zZ |
21:30:28 | FromDiscord | <Forest [She/Her]> Thank you need 🙏 |
21:32:02 | FromDiscord | <Forest [She/Her]> Beef |
21:32:16 | FromDiscord | <Forest [She/Her]> Also it didn't work- |
21:32:26 | FromDiscord | <Forest [She/Her]> Hm I wonder if experimental code reordering can save me here :p |
21:32:45 | FromDiscord | <Elegantbeef> Wait i dont need praise?! |
21:32:56 | FromDiscord | <Elegantbeef> It does work |
21:33:21 | FromDiscord | <Forest [She/Her]> Not for my super big code |
21:33:45 | FromDiscord | <Forest [She/Her]> In reply to @Forest "Anyone know why this": It's over here in the `wrapped` folder |
21:35:19 | FromDiscord | <Yardanico> In reply to @Forest "Hm I wonder if": it only reorders code, so if you actually have cyclic stuff it won't help |
21:37:02 | FromDiscord | <ricky> does nim have alloca() |
21:37:15 | FromDiscord | <Forest [She/Her]> In reply to @Yardanico "it only reorders code,": Ah okay |
21:37:19 | FromDiscord | <Rainbow Asteroids> why do you want alloca |
21:37:21 | FromDiscord | <Forest [She/Her]> Well, I'm not having fun. |
21:37:26 | FromDiscord | <ricky> In reply to @Rainbow Asteroids "why do you want": 😎 |
21:37:43 | FromDiscord | <ricky> i have to make an ill-formed program |
21:37:46 | FromDiscord | <Yardanico> In reply to @Rictus "does nim have alloca()": yes |
21:38:02 | FromDiscord | <Yardanico> ah wait alloca |
21:38:12 | FromDiscord | <Yardanico> you can always just use the actual C function I guess |
21:38:19 | FromDiscord | <Yardanico> don't forget Nim compiles to C |
21:38:27 | FromDiscord | <ricky> gd idea |
21:38:28 | FromDiscord | <ricky> thx Yard |
21:42:20 | FromDiscord | <Forest [She/Her]> Yeah I'm stuck |
21:42:45 | FromDiscord | <Elegantbeef> The simplest way is to declare all types in a single file with procedures after |
21:43:57 | FromDiscord | <Elegantbeef> type definitions can be cyclical so it's pretty easy |
21:44:24 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=49A1 |
21:44:24 | FromDiscord | <Elegantbeef> I say cyclical but order doesnt matter |
21:45:32 | FromDiscord | <Forest [She/Her]> In reply to @Elegantbeef "The simplest way is": Hm alright, ig I'll do that then |
21:45:56 | FromDiscord | <Rainbow Asteroids> sent a code paste, see https://play.nim-lang.org/#ix=49A2 |
21:45:56 | FromDiscord | <Yardanico> yes |
21:46:04 | FromDiscord | <Forest [She/Her]> But how about when something from `java.lang` references `java.utils`? Adding everything into a single file makes it very bloated |
21:46:24 | FromDiscord | <Forest [She/Her]> It's not even the types that are recursive, it's the template that generates the fields |
21:46:55 | FromDiscord | <Forest [She/Her]> In reply to @Forest "But how about when": And decreases clarity a lot |
21:48:15 | FromDiscord | <Forest [She/Her]> Honestly, I'd be better off working on the JVM backend rn |
21:48:24 | FromDiscord | <Forest [She/Her]> I think I'm just gonna do that for now lmao |
21:48:29 | FromDiscord | <Forest [She/Her]> Time is a curse |
21:48:45 | FromDiscord | <Elegantbeef> You have two different languages with vastly different conventions and capabilities so you're not easily going from one to the other |
21:49:41 | FromDiscord | <Forest [She/Her]> Yeah i completely understand that rip |
22:24:39 | qwr | https://github.com/cretz/asmble |
22:25:08 | qwr | someone has written wasm-to-jvm bytecode compiler |
22:25:33 | qwr | and i guess you can compile nim-generated c into wasm |
22:26:17 | qwr | (but of course, it won't be any good for actually implementing java apis in nim) |
22:29:06 | FromDiscord | <Forest [She/Her]> In reply to @qwr "(but of course, it": Yeah |
22:29:29 | FromDiscord | <Forest [She/Her]> In reply to @qwr "https://github.com/cretz/asmble": Also, asmble is slow which is to be expected with something like that, but yeahhh |
22:57:46 | FromDiscord | <Bubblie> In reply to @vestel "const pointer or pointer": const pointer |
22:57:50 | FromDiscord | <Bubblie> sorry took me a while to respond |
23:00:42 | * | krux02 quit (Remote host closed the connection) |
23:35:00 | FromDiscord | <Shiba> here when i run the same command on terminal , its works |
23:35:50 | FromDiscord | <Shiba> but when i run it on the console inside my code editor its doesnt , and its gives me this error https://media.discordapp.net/attachments/371759389889003532/1015767103296524338/Screenshot_2022-09-03_22-45-25.png |
23:36:43 | FromDiscord | <Shiba> (edit) "command" => " compile the nim file" |
23:36:54 | FromDiscord | <Shiba> (edit) removed "run the same" |
23:37:22 | FromDiscord | <Shiba> (edit) "run" => "compile" | "on" => "in" |
23:37:45 | FromDiscord | <Elegantbeef> Does it say the configs used in both? |
23:38:51 | FromDiscord | <Shiba> only this https://media.discordapp.net/attachments/371759389889003532/1015767863447011328/Screenshot_2022-09-04_00-38-39.png |
23:41:22 | FromDiscord | <Elegantbeef> It's the same for both? |
23:43:44 | FromDiscord | <Shiba> no thats the only thing i get |
23:43:52 | FromDiscord | <Shiba> in the console |
23:44:05 | FromDiscord | <Elegantbeef> So your terminal loads different configs? |
23:46:43 | FromDiscord | <Shiba> https://media.discordapp.net/attachments/371759389889003532/1015769840335720608/Screenshot_2022-09-04_00-46-30.png |
23:47:34 | FromDiscord | <Elegantbeef> Well i'd wager that's the issue but i dont know |
23:47:58 | FromDiscord | <Elegantbeef> Do you have Nim installed through a package manage and through choosenim |
23:48:05 | FromDiscord | <Shiba> yea yea |
23:48:10 | FromDiscord | <Elegantbeef> Well stop that |
23:48:15 | FromDiscord | <Elegantbeef> Uninstall the one in the package manager |
23:50:37 | FromDiscord | <Shiba> i have nim installed using choosenim , but not throught a package manager |
23:50:58 | FromDiscord | <Shiba> i downloaded the tarball and followed the instructions |
23:52:30 | FromDiscord | <Elegantbeef> Well you have a version of nim that placed a config inside `/etc/nim/nim.cfg` |
23:53:14 | FromDiscord | <Shiba> nope but do u suggest i delete it |
23:53:21 | FromDiscord | <Shiba> (edit) "it" => "those config files" |
23:53:28 | FromDiscord | <Shiba> (edit) "nope" => "nope," |
23:53:48 | FromDiscord | <Shiba> i have nim 1.4.2 and 1.6.6 |
23:53:53 | FromDiscord | <Elegantbeef> I suggest you ensure you do not have another Nim installed through any othe means |
23:54:01 | FromDiscord | <Elegantbeef> choosenim does not place a config inside `/etc/nim` |
23:54:18 | FromDiscord | <Elegantbeef> the fact you have a config there means you have another Nim that's searching there for it's config |
23:54:39 | FromDiscord | <Shiba> sus |
23:54:47 | FromDiscord | <Shiba> okay wait let me check |
23:55:08 | FromDiscord | <Elegantbeef> Inside your editor write `static: echo (NimMajor, NimMinor)` before the error |
23:55:17 | FromDiscord | <Elegantbeef> Or actually `static: echo NimVersion` |
23:57:40 | FromDiscord | <Shiba> okay yes he was hiding there https://media.discordapp.net/attachments/371759389889003532/1015772596349968464/Screenshot_2022-09-04_00-55-46.png |
23:58:29 | FromDiscord | <Shiba> i typed ``sudo apt-get remove nim`` |
23:58:54 | FromDiscord | <Elegantbeef> Now restarting your editor and it should work fine |