<< 03-09-2022 >>

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