01:28:47 | * | arkurious quit (Remote host closed the connection) |
01:41:23 | FromDiscord | <peterson21> Thank me later https://t.me/+kaz97seJgx9jNTNh |
01:43:45 | * | def- quit (Quit: -) |
01:43:52 | FromDiscord | <Patitotective> In reply to @peterson21 "Thank me later https://t.me/+kaz97seJgx9jNTNh": why not now? <@&371760044473319454> |
01:43:56 | * | def- joined #nim |
01:47:29 | FromDiscord | <ChocolettePalette> > Pavel (the founder of telegram) completed a course at the department of military training, specializing in “Propaganda and psychological warfare”.↵Sounds like I should be afraid to enter my phone number to register there, what could possibly go wrong? \:/ |
01:49:48 | qwr | who knows, but telegram has very original protocol, enough NIH crypto that it feels a bit uncomfortable security wise |
01:51:05 | NimEventer | New Nimble package! kdl - KDL document language Nim implementation, see https://github.com/Patitotective/kdl-nim |
01:52:06 | qwr | and for chatting here, old IRC can be used as well, works-for-me ;) |
01:52:17 | FromDiscord | <Elegantbeef> But but multimedia! 😛 |
01:56:49 | FromDiscord | <Patitotective> In reply to @NimEventer "New Nimble package! kdl": :] |
01:57:12 | FromDiscord | <Elegantbeef> Good that you put nim in it so when we search the nimble directory we know it's a nim package |
02:16:38 | FromDiscord | <Bung> how does it look ? "field access 'result.bar' conflicts with procedure call 'bar', rename the field or call as 'bar(result,...)'" |
02:22:12 | * | wallabra quit (Ping timeout: 260 seconds) |
02:35:21 | * | rockcavera quit (Remote host closed the connection) |
04:02:41 | FromDiscord | <!&luke> What’s a good nim orm |
04:02:47 | FromDiscord | <!&luke> Other than norm |
05:01:41 | FromDiscord | <evil> sent a code paste, see https://play.nim-lang.org/#ix=4blB |
05:02:11 | FromDiscord | <Elegantbeef> You have to use allocators |
05:04:44 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/BRk |
05:09:48 | FromDiscord | <Elegantbeef> To elaborate `string` is GC'd, and `cstring(myString)` does not copy it's practically `myString[0].addr` |
05:10:33 | FromDiscord | <Elegantbeef> So when you return that cstring the automatic memory management will free it basically instantly |
05:22:50 | FromDiscord | <evil> ok that makes sense, how would I cast an unchecked array when calling it through dynlib? since that type isn't available for var |
05:23:08 | FromDiscord | <Elegantbeef> It's a `ptr UncheckedArray` |
05:24:01 | FromDiscord | <Elegantbeef> If you do have a `seq[cstring]` you'd do `cast[ptr UncheckedArray](mySeq[0].addr)` |
06:00:58 | * | kenran joined #nim |
07:37:48 | FromDiscord | <xTrayambak> I fixed that bloody segfault! |
07:38:24 | FromDiscord | <xTrayambak> Turns out assigning a value `nil` isn't the best way to go around this. |
07:38:33 | FromDiscord | <xTrayambak> Especially with Python objects. |
07:38:44 | FromDiscord | <Bung> https://github.com/nim-lang/Nim/issues/10833 @ElegantBeef after my PR cause other generic test fails, I realize the problem int literal `1` should remain same , not just `system.int` , right ? |
07:40:27 | FromDiscord | <Elegantbeef> Yea static generic parameters need to be values |
07:42:34 | FromDiscord | <Bung> okay, think I'll fix it soon |
07:43:07 | FromDiscord | <Elegantbeef> And be sure to test with more complicated types like `seq[int]` `string` and custom objects |
07:43:59 | FromDiscord | <Bung> hmm, the issue example is custom type, if it works, I think others works so ? |
07:44:22 | FromDiscord | <Elegantbeef> no i mean a user defined type for the static parameter |
07:45:04 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4bm5 |
07:45:07 | FromDiscord | <Bung> oh, I see |
07:45:38 | FromDiscord | <Elegantbeef> Nim tests are sadly purpose built for issues most of the time and do not properly test that things actually work |
07:48:15 | FromDiscord | <xTrayambak> How can I store functions in a sequence? |
07:48:25 | FromDiscord | <Elegantbeef> You just do |
07:48:39 | FromDiscord | <Elegantbeef> `seq[proc()\` |
07:48:42 | FromDiscord | <Elegantbeef> `seq[proc()]` |
07:49:00 | FromDiscord | <xTrayambak> I meant an array, sorry. |
07:49:03 | FromDiscord | <xTrayambak> My bad. |
07:49:06 | FromDiscord | <Elegantbeef> Same thing |
07:49:12 | FromDiscord | <xTrayambak> Same thing? |
07:49:25 | FromDiscord | <Elegantbeef> Yep but array and length parameter |
07:50:58 | FromDiscord | <xTrayambak> sent a code paste, see https://play.nim-lang.org/#ix=4bm6 |
07:51:12 | FromDiscord | <Elegantbeef> No |
07:51:21 | FromDiscord | <Elegantbeef> Two `= seq[proc]` is incorrect |
07:51:21 | FromDiscord | <Elegantbeef> `let` is immutable for one |
07:51:36 | FromDiscord | <xTrayambak> Oh, yeah. `let` is immutable. |
07:51:37 | FromDiscord | <Elegantbeef> Three `proc` is a typeclass and not `proc()` |
07:51:48 | FromDiscord | <Elegantbeef> Four you do `.add` to add to a sequence not `[0] =` |
07:52:06 | FromDiscord | <xTrayambak> What if I want to store 256 `proc`(s) in a sequence? |
07:52:21 | FromDiscord | <xTrayambak> Does `seq.add` let me add infinite items? |
07:52:54 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4bm7 |
07:53:04 | FromDiscord | <xTrayambak> Oh, alright. |
07:53:44 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4bm8 |
07:53:48 | FromDiscord | <xTrayambak> Thanks. |
07:54:13 | FromDiscord | <xTrayambak> Does `seq.add` have no limit? |
07:54:28 | FromDiscord | <xTrayambak> I don't really need a 256 limit, I'm just adding it because that seems sane. |
07:54:44 | FromDiscord | <Elegantbeef> sequences are growable arrays |
07:54:58 | FromDiscord | <xTrayambak> So they aren't fixed in size at compile time? |
07:55:01 | FromDiscord | <Elegantbeef> Their limit is your memory |
07:56:03 | FromDiscord | <xTrayambak> What about `method`(s), btw? |
07:56:07 | FromDiscord | <xTrayambak> Those won't work, right? |
07:56:28 | FromDiscord | <Elegantbeef> They dont make any sense to store in a sequence, so I do not know |
07:56:41 | FromDiscord | <xTrayambak> Alright, thank you. |
07:57:41 | FromDiscord | <xTrayambak> In reply to @Elegantbeef "Their limit is your": The limit is your imagination™️ |
08:03:37 | FromDiscord | <Elegantbeef> well that and 2^64 / sizeof(yourType) |
08:08:45 | FromDiscord | <ravinder387> can i compile nim's httpclient in javascript |
08:08:56 | FromDiscord | <Elegantbeef> No |
08:10:27 | FromDiscord | <Mrcool> <https://github.com/juancarlospaco/nodejs/blob/5ec588ba00f1ff1d5763ed052c4076734598c00c/src/nodejs/jsutils.nim#L21> what is the trick here with imprtcpp? |
08:10:36 | FromDiscord | <Mrcool> https://media.discordapp.net/attachments/371759389889003532/1023506795320332308/unknown.png |
08:10:57 | FromDiscord | <Mrcool> it seems like its eqivalent to importjs: "#.encode(#)" |
08:11:03 | FromDiscord | <Mrcool> (edit) "importjs: "#.encode(#)"" => "`importjs: "#.encode(#)"`" |
08:11:11 | FromDiscord | <Mrcool> (edit) "eqivalent" => "equivalent" | "equivalentto `importjs: "#.encode(#)"` ... " added "?" |
08:11:13 | FromDiscord | <Elegantbeef> Yea that's it |
08:11:35 | FromDiscord | <Mrcool> is that inteded ? what does c ++ have to do with this xD |
08:11:38 | FromDiscord | <Mrcool> (edit) "inteded" => "intended" |
08:12:20 | FromDiscord | <Elegantbeef> They're just using the importcpp mechanics for this |
08:12:27 | FromDiscord | <Elegantbeef> No clue why |
08:18:06 | FromDiscord | <Mrcool> sent a code paste, see https://play.nim-lang.org/#ix=4bmf |
08:18:22 | FromDiscord | <Elegantbeef> That code runs in docgen |
08:19:35 | FromDiscord | <Mrcool> it creates the doc, but I don't see the echo https://media.discordapp.net/attachments/371759389889003532/1023509054452146186/unknown.png https://media.discordapp.net/attachments/371759389889003532/1023509054917718016/unknown.png |
08:20:05 | FromDiscord | <Elegantbeef> No clue if it redirects it |
08:20:23 | FromDiscord | <Mrcool> I tried also doAssert 4 == 5 and I see no error |
08:21:25 | FromDiscord | <Elegantbeef> Works here |
08:26:00 | FromDiscord | <Mrcool> works now someehow |
08:29:05 | FromDiscord | <Mrcool> so runnableExamples is like a keyword that gets detected by doc ?, is there something similar for tests? |
08:29:41 | FromDiscord | <Elegantbeef> There are test libraries. Testament, balls, unittest, .... |
08:30:51 | FromDiscord | <Mrcool> I just want inline test exactly like runnableExamples, ah I thought nim wold have a test subcommand |
08:32:07 | FromDiscord | <Elegantbeef> Tests generally are not written in source files |
08:32:12 | FromDiscord | <Mrcool> What I saw is things like <https://github.com/juancarlospaco/nodejs/blob/5ec588ba00f1ff1d5763ed052c4076734598c00c/src/nodejs/jsutils.nim#L199> seems to be the inline test utility that's being used but it still feels weird that it generates docs |
08:32:55 | FromDiscord | <Elegantbeef> I mean you can use docgen for that, but yea it's code to emit tested codeblocks in the docgen |
08:34:24 | FromDiscord | <Mrcool> Ok one more thing, currently the examples are being run with node but I want to run with deno, can I configure this? |
08:34:42 | FromDiscord | <Elegantbeef> I dont know |
08:34:43 | FromDiscord | <Elegantbeef> I dont use JS |
08:35:48 | FromDiscord | <pouriya.jamshidi> hi↵do `-mm` and `-gc` flags of `nim c` command serve different purposes? ↵I am using Nim 1.7.1 |
08:36:05 | FromDiscord | <Elegantbeef> gc is the new name for mm cause orc/arc arent technically GCs |
08:36:15 | FromDiscord | <Elegantbeef> i mean mm is the new name 😄 |
08:36:45 | FromDiscord | <pouriya.jamshidi> interesting. in Nim 1.7.1, if you pass the mm flag, it does not apply it |
08:36:58 | FromDiscord | <pouriya.jamshidi> I was doing some benchmarks and came across this |
08:36:59 | FromDiscord | <Elegantbeef> That's a bug then |
08:37:11 | FromDiscord | <pouriya.jamshidi> I will open an issue on GitHub |
08:37:18 | FromDiscord | <Elegantbeef> Make sure you update your devel |
08:37:28 | FromDiscord | <pouriya.jamshidi> it is updated. 1.7.1 |
08:37:43 | FromDiscord | <Elegantbeef> 1.6.1 means nothing |
08:37:45 | FromDiscord | <Elegantbeef> whoops |
08:37:48 | FromDiscord | <Elegantbeef> 1.7.1\ |
08:37:56 | FromDiscord | <Mrcool> do you know where does nim calls node in the codebase? https://media.discordapp.net/attachments/371759389889003532/1023513674041794620/unknown.png |
08:38:35 | FromDiscord | <pouriya.jamshidi> I am running choosenim update devel everyday. I think it should be updated enough? |
08:39:50 | FromDiscord | <Elegantbeef> Yea, i was just saying that saying it's 1.7.1 means nothing 😄 |
08:40:44 | FromDiscord | <pouriya.jamshidi> gotcha |
08:42:41 | FromDiscord | <flywind> In reply to @pouriya.jamshidi "interesting. in Nim 1.7.1,": Do you mean gc flags works? |
08:46:13 | FromDiscord | <flywind> Btw the devel branch has already defaulted to ORC. |
08:52:53 | FromDiscord | <flywind> In reply to @pouriya.jamshidi "hi do `-mm` and": You should pass `--mm` instead of `-mm` |
08:53:29 | FromDiscord | <flywind> `-m` somehow compiles |
08:59:44 | FromDiscord | <flywind> It does give you a warning: |
08:59:47 | FromDiscord | <flywind> `command line(1, 2) Warning: 'm' is deprecated, now a noop [Deprecated]↵command line(1, 2) Warning: 'm' is deprecated, now a noop [Deprecated]` |
09:03:36 | * | kenran quit (Quit: WeeChat info:version) |
09:04:34 | FromDiscord | <flywind> It seems that `-gc:orc` is interpreted as `-g:orc` and the parts between the first char and `:` are ignored. |
09:06:50 | FromDiscord | <pouriya.jamshidi> you are right. thanks! |
09:12:50 | FromDiscord | <Mrcool> In reply to @Mrcool "do you know where": its not currently configurable <https://github.com/nim-lang/Nim/blob/1e0165186bb8539cfd8aca1a7af8d01dc278bd46/compiler/nim.nim#L101> |
09:14:50 | FromDiscord | <flywind> Nim supports nodejs only for making testing JS code easier. |
09:17:16 | FromDiscord | <Mrcool> I think it can be made it configurable though, I have a module for deno backend and the hardcoding of node make it not testable easily |
09:17:30 | FromDiscord | <Mrcool> Also I imagine someelse might want to write bun backend |
09:17:41 | FromDiscord | <Mrcool> (edit) "backend" => "module" |
09:28:38 | FromDiscord | <Mrcool> It <https://nim-lang.org/docs/jsutils.html> not meant to depend on ? because its under private? |
09:43:38 | FromDiscord | <Mrcool> sent a code paste, see https://play.nim-lang.org/#ix=4bmt |
09:45:06 | FromDiscord | <hotdog> In reply to @Mrcool "<@472459996068839424> can I use": No that won’t work |
09:46:18 | FromDiscord | <hotdog> You could create an init proc that calls it though |
09:57:22 | FromDiscord | <Forest [She/Her]> In reply to @Mrcool "I think it can": Why not use the Node polyfills on Deno? |
09:58:22 | FromDiscord | <Mrcool> why would I do that when I can easily wrap deno apis |
10:03:21 | FromDiscord | <Forest [She/Her]> For things like `require` |
10:03:39 | FromDiscord | <Forest [She/Her]> Actually nvm i realised i was wrong lol |
10:18:35 | FromDiscord | <Mrcool> sent a code paste, see https://play.nim-lang.org/#ix=4bmy |
10:20:10 | * | arkurious joined #nim |
10:22:21 | FromDiscord | <Forest [She/Her]> Use the `static` block iirc |
10:22:45 | FromDiscord | <Forest [She/Her]> But some methods don't work at compile time, i think `echo` one of them? Can't remember |
10:23:27 | FromDiscord | <Mrcool> seems to work thanks |
10:23:34 | FromDiscord | <Forest [She/Her]> Np ^^ |
10:32:32 | FromDiscord | <Rika> In reply to @Event Horizon "But some methods don't": That does work |
10:32:43 | FromDiscord | <Forest [She/Her]> Ah |
10:34:17 | FromDiscord | <Mrcool> I have , but `get` actually returns `string | undefined` https://media.discordapp.net/attachments/371759389889003532/1023542954322837554/unknown.png |
10:36:09 | FromDiscord | <Mrcool> I can see this here <https://github.com/nim-lang/Nim/blob/338d69c15ad02e528e44b332f2e4893e26450696/lib/js/jsre.nim#L40> https://media.discordapp.net/attachments/371759389889003532/1023543424579805294/unknown.png |
10:36:57 | FromDiscord | <Mrcool> but it feels like a hack |
10:39:11 | FromDiscord | <hotdog> In reply to @Mrcool "but it feels like": Probably better than having possibly-undefined values floating around in your nim code I suppose |
10:39:20 | FromDiscord | <hotdog> But let me think of an alternative |
10:39:29 | FromDiscord | <PyryTheBurger> Bruh how do i install nim on linux? choosenim failed and on manu8al installation nimble couldn't find some random libraries |
10:40:15 | FromDiscord | <Rika> Why is it failing |
10:40:21 | FromDiscord | <Rika> The first one I mean |
10:40:32 | FromDiscord | <PyryTheBurger> wiat i will paste it |
10:40:54 | FromDiscord | <PyryTheBurger> this chmod: cannot access '/tmp/choosenim-0.8.4_linux_amd64': No such file or directory |
10:41:08 | FromDiscord | <hotdog> sent a code paste, see https://play.nim-lang.org/#ix=4bmC |
10:41:52 | FromDiscord | <hotdog> In reply to @PyryTheBurger "this chmod: cannot access": What's the output if you do `ls /tmp/choosenim` ? |
10:42:18 | FromDiscord | <PyryTheBurger> In reply to @hotdog "What's the output if": ls: cannot access '/tmp/choosenim': No such file or directory |
10:43:50 | FromDiscord | <hotdog> In reply to @PyryTheBurger "ls: cannot access '/tmp/choosenim*':": Were there any errors/warnings before the final error? |
10:43:59 | FromDiscord | <PyryTheBurger> no i dont think so |
10:44:00 | FromDiscord | <hotdog> When you run the installer I mean |
10:44:27 | FromDiscord | <PyryTheBurger> idid this command: curl https://nim-lang.org/choosenim/init.sh -sSf | sh |
10:45:28 | FromDiscord | <PyryTheBurger> sent a code paste, see https://play.nim-lang.org/#ix=4bmD |
10:50:59 | FromDiscord | <hotdog> In reply to @PyryTheBurger "the whole output is": Do you have curl and/or wget installed? |
10:51:15 | FromDiscord | <PyryTheBurger> i think curl |
10:51:55 | FromDiscord | <hotdog> Can you run `curl -v`? |
10:51:57 | FromDiscord | <PyryTheBurger> sent a code paste, see https://paste.rs/ccx |
10:52:03 | FromDiscord | <hotdog> Ok cool |
10:52:20 | FromDiscord | <hotdog> What's the output if you run `curl -sSfL https://nim-lang.org/choosenim/stable` |
10:52:36 | FromDiscord | <PyryTheBurger> nothing |
10:53:13 | FromDiscord | <PyryTheBurger> no wait |
10:53:21 | FromDiscord | <PyryTheBurger> i think it says 0.8.4 |
10:53:28 | FromDiscord | <hotdog> Ok that's good |
10:53:34 | FromDiscord | <hotdog> 1 sec |
10:56:15 | FromDiscord | <hotdog> What if you run `curl -sSfL "https://github.com/dom96/choosenim/releases/download/v0.8.4/choosenim-0.8.4_linux_amd64" -o "/tmp/choosenim-0.8.4_linux_amd64"` @PyryTheBurger |
10:56:42 | FromDiscord | <PyryTheBurger> no output |
10:58:32 | FromDiscord | <hotdog> Does it create the file in /tmp? |
10:59:16 | FromDiscord | <PyryTheBurger> what name file |
10:59:35 | FromDiscord | <PyryTheBurger> there are a bunch of files with random wierd names in here |
11:00:01 | FromDiscord | <hotdog> /tmp/choosenim-0.8.4_linux_amd64 |
11:00:11 | FromDiscord | <PyryTheBurger> no |
11:00:36 | FromDiscord | <hotdog> Ok |
11:00:57 | FromDiscord | <hotdog> Something is up |
11:01:59 | FromDiscord | <hotdog> There were no errors from the curl command? |
11:02:02 | FromDiscord | <hotdog> Can you run it again? |
11:02:06 | FromDiscord | <Forest [She/Her]> If i have a method that takes `curPos: var int`, and then do `var startPos = curPos`, would that make a copy of curPos? |
11:02:10 | FromDiscord | <PyryTheBurger> no output |
11:02:14 | FromDiscord | <PyryTheBurger> no errors no nothing |
11:02:17 | FromDiscord | <Forest [She/Her]> In reply to @PyryTheBurger "no": What OS are you on? Architecture? |
11:02:29 | FromDiscord | <PyryTheBurger> kubuntu 22.04.1 i think |
11:02:37 | FromDiscord | <Forest [She/Her]> Hm, amd64? |
11:02:46 | FromDiscord | <PyryTheBurger> 64 bit yeah |
11:02:52 | FromDiscord | <PyryTheBurger> nvidia |
11:02:53 | FromDiscord | <Forest [She/Her]> Hm that's really odd then |
11:03:07 | FromDiscord | <PyryTheBurger> and intelö prcessor |
11:03:10 | FromDiscord | <hotdog> Do you have room left on the disk? |
11:03:15 | FromDiscord | <hotdog> Run `df -h` |
11:03:16 | FromDiscord | <PyryTheBurger> 431gb |
11:03:31 | FromDiscord | <hotdog> In reply to @Event Horizon "If i have a": Yea |
11:03:59 | FromDiscord | <PyryTheBurger> sent a code paste, see https://play.nim-lang.org/#ix=4bmJ |
11:04:00 | FromDiscord | <hotdog> What if you run `echo "hello" > /tmp/test` |
11:04:05 | FromDiscord | <hotdog> Does the test file appear? |
11:04:20 | FromDiscord | <Forest [She/Her]> In reply to @hotdog "Yea": Okay good |
11:04:33 | FromDiscord | <PyryTheBurger> In reply to @hotdog "Does the test file": nope |
11:04:39 | FromDiscord | <Require Support> how to find memory leaks on nim binaries created for windows? If im too dumb to use windbg or IDA |
11:04:42 | FromDiscord | <PyryTheBurger> nvm yes it does |
11:06:11 | FromDiscord | <Require Support> (edit) "windbg or IDA" => "an actual debugger 🙂" |
11:07:24 | FromDiscord | <hotdog> @PyryTheBurger can you run `curl -L "https://github.com/dom96/choosenim/releases/download/v0.8.4/choosenim-0.8.4_linux_amd64" -o "/tmp/choosenim-0.8.4_linux_amd64"` |
11:16:11 | FromDiscord | <Mrcool> @hotdog I tried adding another method , but I get an error https://media.discordapp.net/attachments/371759389889003532/1023553497511243828/unknown.png https://media.discordapp.net/attachments/371759389889003532/1023553497934868620/unknown.png |
11:19:00 | FromDiscord | <hotdog> In reply to @Mrcool "<@472459996068839424> I tried adding": I didn't try running it my bad, try `T(o)` |
11:19:55 | FromDiscord | <hotdog> Also just my opinion but I wouldn't call it Option as that may lead to confusion with std/options, especially if they both end up used in the same module |
11:23:04 | * | jmdaemon quit (Ping timeout: 246 seconds) |
11:23:56 | FromDiscord | <Mrcool> whats the right way to write this ↵` raise newException(string, "error!")` |
11:24:03 | FromDiscord | <Mrcool> (edit) "↵` raise" => "↵`raise" |
11:24:39 | * | vicecea quit (Remote host closed the connection) |
11:24:39 | FromDiscord | <Mrcool> do I have to create a random type for it? |
11:25:07 | * | vicecea joined #nim |
11:25:36 | FromDiscord | <Mrcool> ah it seems I can use `Defect` |
11:29:30 | FromDiscord | <hotdog> In reply to @Mrcool "do I have to": Or use valueerror, ioerror etc |
11:30:35 | FromDiscord | <PyryTheBurger> sent a code paste, see https://play.nim-lang.org/#ix=4bmP |
11:30:53 | FromDiscord | <hotdog> In reply to @PyryTheBurger "i got this as": And it definitely doesn’t write out the file? |
11:31:11 | FromDiscord | <PyryTheBurger> yup it doesnt atleast in the tmp |
11:31:25 | FromDiscord | <hotdog> Try changing it to a different dir |
11:31:32 | FromDiscord | <hotdog> And try different urls |
11:31:48 | FromDiscord | <hotdog> There’s something odd going on there you need to figure out |
11:32:35 | FromDiscord | <hotdog> Or modify the init.sh script to just use wget, if wget works on your machine |
11:33:42 | FromDiscord | <PyryTheBurger> nah i give up |
12:22:19 | FromDiscord | <PyryTheBurger> i think the problem is it doesnt hve permission |
12:22:41 | FromDiscord | <PyryTheBurger> i tried creating the directory in my tmp flder then runnning the choosenim install and it said permission denied |
12:23:22 | FromDiscord | <hotdog> In reply to @PyryTheBurger "i think the problem": But the echo test worked |
12:23:29 | FromDiscord | <PyryTheBurger> yup |
12:23:46 | FromDiscord | <hotdog> And curl should throw an error if it doesn’t have write permission |
12:24:13 | FromDiscord | <PyryTheBurger> it only threw the error if i manually created the folder in there |
12:24:41 | FromDiscord | <hotdog> What’s the error and how did you create the folder |
12:25:28 | FromDiscord | <PyryTheBurger> just went to the tmp folder and created a new folder with the name /tmp/choosenim-0.8.4_linux_amd64 |
12:25:40 | FromDiscord | <PyryTheBurger> no with the name choosenim-0.8.4_linux_amd64 |
12:26:16 | FromDiscord | <hotdog> And what’s the curl error |
12:26:37 | FromDiscord | <hotdog> Because if curl is trying to write a file with the same name as that folder it’s not going to work |
12:26:38 | FromDiscord | <PyryTheBurger> the error is like this: sh: 77: /tmp/choosenim-0.8.4_linux_amd64: Permission denied |
12:27:14 | FromDiscord | <PyryTheBurger> but if i didn't create that folder it complains about the folder being missing |
12:27:26 | FromDiscord | <hotdog> In reply to @PyryTheBurger "but if i didn't": Where does it complain? |
12:27:46 | FromDiscord | <hotdog> Curl is downloading a file not a folder |
12:28:18 | FromDiscord | <PyryTheBurger> it just says after the 'installing choosenim' that tmp doesn't contain a folder with that name |
12:29:06 | FromDiscord | <hotdog> In reply to @PyryTheBurger "it just says after": Does it? Can you paste the message? |
12:29:47 | FromDiscord | <PyryTheBurger> sent a code paste, see https://play.nim-lang.org/#ix=4bn0 |
12:29:59 | FromDiscord | <hotdog> sent a code paste, see https://play.nim-lang.org/#ix=4bn1 |
12:30:06 | FromDiscord | <PyryTheBurger> oh |
12:30:06 | FromDiscord | <hotdog> It’s looking for the file curl was supposed to write out |
12:30:34 | FromDiscord | <hotdog> That’s just chmod saying “there’s nothing there” |
12:31:24 | FromDiscord | <PyryTheBurger> sent a code paste, see https://play.nim-lang.org/#ix=4bn2 |
12:31:59 | FromDiscord | <hotdog> How did you create the file |
12:32:20 | FromDiscord | <PyryTheBurger> just clicked create new text file and made its name choosenim-0.8.4_linux_amd64 |
12:32:40 | FromDiscord | <hotdog> Ok 😂 but that’s an empty file not the choosenim executable |
12:32:46 | FromDiscord | <PyryTheBurger> bruh |
12:32:54 | FromDiscord | <PyryTheBurger> where di u get the executable |
12:33:04 | FromDiscord | <hotdog> That’s what the curl command is doing |
12:33:14 | FromDiscord | <PyryTheBurger> wll its not doing it |
12:33:15 | FromDiscord | <hotdog> The one that’s supposed to write out that file |
12:33:18 | FromDiscord | <hotdog> Yes |
12:33:28 | FromDiscord | <hotdog> That is the problem that I said you need to figure out |
12:33:45 | FromDiscord | <hotdog> Or download it manually and follow the steps that the init.sh script does |
12:34:12 | FromDiscord | <PyryTheBurger> i tried to download it manualy and nim command worked but nimble command didnt |
12:34:40 | FromDiscord | <hotdog> In reply to @PyryTheBurger "i tried to download": What didn’t work with nimble? It’s probably a path error |
12:34:54 | FromDiscord | <hotdog> Check if the init.sh script does anything to set up the path |
12:35:04 | FromDiscord | <PyryTheBurger> i just tried nimble in the terminal and it spat out something about a missing .so file |
12:35:05 | FromDiscord | <hotdog> I’m on phone can’t check at the moment |
12:35:29 | FromDiscord | <hotdog> In reply to @PyryTheBurger "i just tried nimble": Maybe openssl? |
12:35:36 | FromDiscord | <PyryTheBurger> whta is that |
12:36:41 | FromDiscord | <hotdog> Something that nimble needs |
12:36:58 | FromDiscord | <hotdog> Was that what it was complaining about? |
12:39:32 | FromDiscord | <PyryTheBurger> lmao now it works |
12:39:42 | FromDiscord | <PyryTheBurger> its not complaining about nothing |
12:41:28 | FromDiscord | <PyryTheBurger> wiat |
12:41:54 | FromDiscord | <PyryTheBurger> when i restart my terminal the nim bin folder disappears from my path variable |
12:41:55 | FromDiscord | <PyryTheBurger> burh |
12:47:43 | FromDiscord | <hotdog> In reply to @PyryTheBurger "when i restart my": Put the modification in bashrc or similar |
12:49:46 | FromDiscord | <PyryTheBurger> /etc/bash.bashrc? |
12:50:31 | FromDiscord | <PyryTheBurger> or /home/pyryrin/.bashrc? |
12:52:13 | FromDiscord | <ChocolettePalette> Both are kinda ok but wrong, there should be a distro specific way to put more stuff into your path variable |
12:53:46 | FromDiscord | <PyryTheBurger> is that ok |
12:53:48 | FromDiscord | <PyryTheBurger> sent a code paste, see https://play.nim-lang.org/#ix=4bn6 |
12:54:10 | FromDiscord | <Forest [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4bn7 |
12:55:02 | FromDiscord | <ChocolettePalette> U sure about the quotes? I mean they could be single ticks ', you should check if yours are appropriate↵(@PyryTheBurger) |
12:55:02 | FromDiscord | <Forest [She/Her]> Since i want it to pass `a` as the first argument for `isEmptyOrWhitespace` |
12:55:04 | FromDiscord | <PyryTheBurger> In reply to @PyryTheBurger "so now my .bashrc": well, this at least seems to woek |
12:56:12 | FromDiscord | <PyryTheBurger> In reply to @ChocolettePalette "U sure about the": why not "" |
12:56:13 | FromDiscord | <Forest [She/Her]> In reply to @Event Horizon "How would i do": Maybe `case a with` would be a small macro i could make lmao |
12:57:33 | FromDiscord | <PyryTheBurger> wait but now anything else is not a pathj variable?? |
12:57:42 | FromDiscord | <PyryTheBurger> i cant even clear my bash terminal anymore |
12:58:05 | FromDiscord | <PyryTheBurger> now nim is my only path?? what?? |
12:59:14 | FromDiscord | <PyryTheBurger> if i add the nim path line in to my .bashrc, every other path disappers |
12:59:56 | FromDiscord | <Forest [She/Her]> That's an issue i had too |
13:00:01 | FromDiscord | <Forest [She/Her]> I just added my entire path |
13:00:08 | FromDiscord | <Forest [She/Her]> It's not Nim specific |
13:00:12 | FromDiscord | <Forest [She/Her]> Just weirdness |
13:00:25 | FromDiscord | <PyryTheBurger> how do i fixed that |
13:00:29 | FromDiscord | <PyryTheBurger> In reply to @Event Horizon "I just added my": oh |
13:00:58 | FromDiscord | <ChocolettePalette> Should be single quotes then↵(@PyryTheBurger) |
13:01:08 | FromDiscord | <PyryTheBurger> i did put in single quotes |
13:02:27 | FromDiscord | <PyryTheBurger> In reply to @ChocolettePalette "Should be single quotes": BRUH IT WORKED IF I PUT IN DOUBLE QUOTES |
13:02:29 | FromDiscord | <PyryTheBurger> liar |
13:02:50 | FromDiscord | <PyryTheBurger> heheh always dont trust in people |
13:03:11 | FromDiscord | <ChocolettePalette> Uhh then should be double quotes |
13:03:21 | FromDiscord | <PyryTheBurger> yeah |
13:07:32 | FromDiscord | <hotdog> Yeah it needs to be double quotes so the $PATH in the string is expanded |
13:07:38 | FromDiscord | <hotdog> All working now @PyryTheBurger |
13:07:40 | FromDiscord | <hotdog> ? |
13:16:42 | FromDiscord | <PyryTheBurger> yup |
13:55:57 | FromDiscord | <ache of head> In reply to @Event Horizon "How would i do": i realise this might not be your actual usecase, but wouldn't just using an if statement be simpler in this example? |
13:57:47 | FromDiscord | <ache of head> sent a code paste, see https://play.nim-lang.org/#ix=4bnm |
13:57:56 | FromDiscord | <ache of head> given you import `strutils` |
13:58:07 | FromDiscord | <ache of head> which contains the set `Whitespace` |
13:58:33 | FromDiscord | <Forest [She/Her]> In reply to @c1m5j "i realise this might": In this example yeah, but in my code i'm doing a lot of checks for many different values, but it's all good since now i'm just making it use an if statement |
13:58:38 | FromDiscord | <Forest [She/Her]> Thanks ^^ |
13:58:54 | FromDiscord | <Forest [She/Her]> The lexer for Stellar is actually going alright haha |
13:59:10 | FromDiscord | <ache of head> yeah in general if you want to test for some special behavior, not just equality, in a case-of statement then you can put in a wildcard and then add an if statement after that |
13:59:16 | FromDiscord | <ache of head> like `of x if <something boolean with x>` |
14:00:10 | FromDiscord | <ache of head> also can a char be empty? |
14:00:17 | FromDiscord | <ache of head> oh no wait that was a string |
14:00:18 | FromDiscord | <ache of head> whoops |
14:00:22 | FromDiscord | <ache of head> i thought it was a char |
14:00:46 | FromDiscord | <Forest [She/Her]> In reply to @c1m5j "yeah in general if": thanks! |
14:02:47 | FromDiscord | <Patitotective> In reply to @Elegantbeef "Good that you put": sorry? https://media.discordapp.net/attachments/371759389889003532/1023595425393037312/unknown.png |
14:03:06 | FromDiscord | <Patitotective> only the repo is called kdl-nim :p |
14:03:43 | FromDiscord | <ravinder387> proc hello(ctx: context.Context) {.async.} =↵ resp htmlResponse(createDom()) |
14:03:48 | FromDiscord | <ravinder387> it return future |
14:04:57 | FromDiscord | <ravinder387> I want to force Nim to execute this function ---> execute other function |
14:05:05 | FromDiscord | <ravinder387> how can i do it |
14:08:07 | FromDiscord | <Patitotective> In reply to @ravinder387 "proc hello*(ctx: context.Context) {.async.}": what is resp? |
14:08:18 | FromDiscord | <Patitotective> In reply to @ravinder387 "I want to force": from what i can see you're already doing it |
14:09:19 | FromDiscord | <ache of head> In reply to @ravinder387 "I want to force": wdym? |
14:10:34 | FromDiscord | <Forest [She/Her]> https://hastebin.com/ebigitemot.properties I think this enters an infinite loop but i'm not sure where? |
14:10:58 | FromDiscord | <ravinder387> sent a code paste, see https://play.nim-lang.org/#ix=4bnv |
14:11:12 | FromDiscord | <ravinder387> i want to run draw() function before response |
14:12:22 | FromDiscord | <ravinder387> i got blank img tag https://media.discordapp.net/attachments/371759389889003532/1023597835213619280/2022-09-25.png |
14:12:43 | FromDiscord | <Patitotective> In reply to @Event Horizon "https://hastebin.com/ebigitemot.properties I think ": there are three while loops (and one is `while true`), its not that hard :p |
14:12:45 | FromDiscord | <Forest [She/Her]> In reply to @Event Horizon "https://hastebin.com/ebigitemot.properties I think ": I've added some print statements but it seems to be printing nothing |
14:13:45 | FromDiscord | <Forest [She/Her]> In reply to @Patitotective "there are three while": Yeah i'm trying to look through it |
14:14:13 | FromDiscord | <Forest [She/Her]> Aaaah |
14:14:19 | FromDiscord | <Forest [She/Her]> Nvm ik where now |
14:14:29 | FromDiscord | <Forest [She/Her]> Weird that the else statement isn't getting triggered tho |
14:15:43 | FromDiscord | <Forest [She/Her]> It was my bad code lol |
14:15:49 | FromDiscord | <Forest [She/Her]> Forgot to increment the counter |
14:15:55 | FromDiscord | <Patitotective> In reply to @Event Horizon "https://hastebin.com/ebigitemot.properties I think ": i recently made a lexer for kdl so if you want to look through it https://github.com/Patitotective/kdl-nim/blob/main/src/kdl/lexer.nim |
14:16:14 | FromDiscord | <Forest [She/Her]> Oh neat |
14:17:02 | FromDiscord | <Forest [She/Her]> These are all the new lines? what? `["\c\l", "\r", "\n", "\u0085", "\f", "\u2028", "\u2029"]` |
14:17:19 | FromDiscord | <Patitotective> https://github.com/kdl-org/kdl/blob/main/SPEC.md#newline |
14:17:53 | FromDiscord | <Forest [She/Her]> also why do you do `{0x0009, 0x0020, 0x00A0, 0x1680, 0x2000..0x200A, 0x202F, 0x205F, 0x3000}` and just use `Whitespace` from strutils |
14:17:56 | FromDiscord | <Forest [She/Her]> Ah |
14:18:25 | FromDiscord | <Patitotective> the spec says specifically the unicode runes that should be treated as whitespaces or newlines |
14:18:38 | FromDiscord | <Forest [She/Her]> Ah aight then |
14:21:39 | FromDiscord | <!&luke> In reply to @ripluke "What’s a good nim": Anyone got any ideas |
14:30:42 | FromDiscord | <ChocolettePalette> I'm not implying anything, but every PHP programmer has their own ORM... |
14:35:03 | FromDiscord | <exelotl> norm is the only one I could make sense of |
14:36:17 | FromDiscord | <exelotl> if you have problems with norm then it would probably be better to get involved and improve it rather than make your own 😅 |
14:36:28 | FromDiscord | <Patitotective> https://github.com/moigagoo/norm/ |
14:38:36 | * | wallabra joined #nim |
14:56:52 | * | marderIII joined #nim |
15:10:35 | FromDiscord | <01> is it practically possible to use Nim to program arduinos? |
15:14:05 | FromDiscord | <exelotl> yes, you can use Nim anywhere you'd use C |
15:15:23 | FromDiscord | <01> if i just include a C header, is that it and i can use a C (header only) library? |
15:15:29 | FromDiscord | <01> or do i need extra steps |
15:15:36 | FromDiscord | <01> to call c functions |
15:20:30 | NimEventer | New thread by Oliver: Cross-Compiling gintro/GTK4, see https://forum.nim-lang.org/t/9492 |
15:20:35 | FromDiscord | <exelotl> sent a code paste, see https://play.nim-lang.org/#ix=4bo0 |
15:21:08 | FromDiscord | <01> so there is some additional step |
15:23:12 | FromDiscord | <exelotl> Yes, but there are tools you can use to help automate this process: `c2nim` is a command line tool that works pretty well for converting C headers to Nim.↵Also there's Futhark which does the whole conversion on the fly, which is apparently quite good but I haven't tried it myself: https://github.com/PMunch/futhark |
15:24:03 | FromDiscord | <exelotl> (edit) "Nim.↵Also" => "Nim: https://github.com/nim-lang/c2nim↵Also" |
15:26:16 | FromDiscord | <pmunch> Futhark is pretty good indeed |
15:27:41 | FromDiscord | <Forest [She/Her]> I wonder how difficult a Nim interpreter would be ngl |
15:27:48 | FromDiscord | <Forest [She/Her]> Without using any of the compiler library |
15:28:05 | FromDiscord | <Forest [She/Her]> Macros would probably break tho lol |
15:28:41 | FromDiscord | <Rainbow Asteroids> why would macros break in an interpreted nim? |
15:28:41 | FromDiscord | <huantian> In reply to @pmunch "Futhark is pretty good": I heard the person who made it is also cool |
15:28:47 | FromDiscord | <Patitotective> haha |
15:43:08 | * | wallabra_ joined #nim |
15:44:06 | * | wallabra quit (Ping timeout: 265 seconds) |
15:45:20 | * | wallabra_ is now known as wallabra |
15:46:40 | FromDiscord | <redstonekasi> Hey there! Is there any way to have a hybrid package that can be imported without the pkg suffix? I tried to just rename to directory but that gave me the warning in the bottom screenshot? https://media.discordapp.net/attachments/371759389889003532/1023621566615007352/unknown.png https://media.discordapp.net/attachments/371759389889003532/1023621566937960480/unknown.png |
15:46:43 | FromDiscord | <redstonekasi> (edit) "screenshot?" => "screenshot." |
15:46:47 | FromDiscord | <redstonekasi> Is it not possible? |
15:54:25 | FromDiscord | <Patitotective> In reply to @redstonekasi "Hey there! Is there": you just rename the `kelppkg` folder to whatever you want iirc |
15:55:11 | FromDiscord | <redstonekasi> Yes it works (see the bottom screenshot), but it also gives me a warning which I would like to avoid since it's going to be an error in the future. |
15:58:12 | FromDiscord | <Patitotective> dont really know https://github.com/nim-lang/nimble/issues/308 |
16:04:07 | * | wallabra quit (Ping timeout: 246 seconds) |
16:17:04 | FromDiscord | <Mrcool> how to slice seq? |
16:17:24 | FromDiscord | <Mrcool> a = @[1,2] ↵a[1:] ? |
16:17:33 | FromDiscord | <Mrcool> (edit) |
16:23:40 | FromDiscord | <ravinder387> when i click button it changes the data in server-side https://media.discordapp.net/attachments/371759389889003532/1023630874438271038/yy.mp4 |
16:24:08 | FromDiscord | <ravinder387> sent a long message, see http://ix.io/4bob |
16:29:04 | FromDiscord | <Patitotective> In reply to @Mrcool "how to slice seq?": `a[0..0]` it is inclusive |
16:34:14 | FromDiscord | <jos> inclusive ranges by default is pretty scuffed |
16:34:34 | FromDiscord | <jos> im fixing a bunch of bugs in my code because of it rn |
16:44:41 | FromDiscord | <Mrcool> does nim always have to recompile, can it not detect if a file has been changed? |
16:46:33 | FromDiscord | <hotdog> In reply to @Mrcool "does nim always have": You mean like a watch mode? |
16:46:51 | FromDiscord | <huantian> In reply to @jos "inclusive ranges by default": I don’t think it’s scuffed it’s just different |
16:47:36 | FromDiscord | <Mrcool> In reply to @hotdog "You mean like a": I mean If I compile a file, then don't make changes to it |
16:47:45 | FromDiscord | <Mrcool> nim c still compiles it again |
16:48:10 | FromDiscord | <hotdog> Incremental compilation is a WIP |
16:58:39 | * | wallabra joined #nim |
17:03:33 | FromDiscord | <jos> In reply to @huantian "I don’t think it’s": there's a pretty strong argument for exclusive ranges just composing better |
17:03:35 | FromDiscord | <jos> https://www.cs.utexas.edu/users/EWD/transcriptions/EWD08xx/EWD831.html |
17:03:51 | FromDiscord | <jos> among other pretty obvious reasons |
17:06:17 | FromDiscord | <Require Support> if i initialize for example an object like `AsyncHttpClient` should I do it with `let` or `var` if i will be changing object fields like `AsyncHttpClient.headers` |
17:11:52 | FromDiscord | <jos> why tf do test files need to start with a t |
17:12:06 | FromDiscord | <jos> this language is so good but also so strange |
17:12:46 | FromDiscord | <jos> ls |
17:13:41 | FromDiscord | <huantian> In reply to @jos "there's a pretty strong": Interesting |
17:14:33 | FromDiscord | <huantian> In reply to @jos "why tf do test": I think you can change that? Unless you mean the tests for the compiler↵I agree though it’s interesting |
17:14:41 | FromDiscord | <huantian> (edit) "interesting" => "a weird choice" |
17:15:34 | FromDiscord | <jos> i'm struggling to understand how to use testament in general |
17:15:51 | FromDiscord | <huantian> I personally skipped that step and just used balls |
17:16:02 | FromDiscord | <jos> balls |
17:16:25 | FromDiscord | <jos> is there any testing framework that's rust style? like allows you to just stick the tests in the same file as the impl |
17:16:29 | FromDiscord | <jos> i always really liked that |
17:16:47 | FromDiscord | <huantian> The best you can do is probably runnableExamples |
17:17:02 | FromDiscord | <jos> oh wow balls looks pretty cool |
17:17:09 | FromDiscord | <huantian> Though I feel like that kind of test should be possible as well |
17:17:32 | FromDiscord | <jos> mm it might |
17:17:44 | FromDiscord | <jos> i'll play around with balls |
17:17:48 | FromDiscord | <jos> :cheeseCarter: |
17:17:52 | FromDiscord | <huantian> 😏 |
17:18:02 | FromDiscord | <huantian> Iirc it used to be called testes |
17:18:04 | FromDiscord | <MolassesLover> What did I join in on ☹️ |
17:18:10 | * | marderIII quit (Quit: leaving) |
17:18:16 | FromDiscord | <MolassesLover> Concern |
17:24:46 | FromDiscord | <Forest [She/Her]> In reply to @Rainbow Asteroids "why would macros break": Different interpreter with different way of parsing and handling |
17:25:14 | FromDiscord | <Forest [She/Her]> Unless i design it in such a way where macros are explicitly supported |
17:27:17 | FromDiscord | <Forest [She/Her]> In reply to @MolassesLover "What did I join": No idea |
17:40:38 | FromDiscord | <Forest [She/Her]> Anyone know why https://hastebin.com/ziduxeveli.properties isn't working? It seems to skip over the `(` token in my code that I'm trying to lex and idk why? |
17:41:19 | FromDiscord | <Forest [She/Her]> Aaaaah nvm okay ik the issue |
17:44:40 | FromDiscord | <Le Toaster> Are there any reasons I should use methods instead of procs? |
17:45:30 | FromDiscord | <jos> nice i got inline tests working with balls 🙂 |
17:45:35 | FromDiscord | <jos> it's configured a little jank but whatever |
17:46:13 | FromDiscord | <Forest [She/Her]> In reply to @Event Horizon "Aaaaah nvm okay ik": Nvm now i have another issue, the issue is that it tries to access `index 35` in my string but idk how to fix that... Unless i take index errors as "we've finished lexing" |
17:46:33 | FromDiscord | <Forest [She/Her]> Actually that wouldn't work since incomplete tokens |
17:46:43 | FromDiscord | <Forest [She/Her]> In reply to @Le Toaster "Are there any reasons": Iirc, for dynamic dispatching |
17:50:49 | FromDiscord | <Forest [She/Her]> Fixed |
17:52:46 | FromDiscord | <planetis> In reply to @jos "https://www.cs.utexas.edu/users/EWD/transcriptions/": I have read that and I was not convinced, its a very subjective matter. But whatever. ..< looks better than ..= |
17:55:53 | FromDiscord | <planetis> and besides programmers, I don't think people count like that. |
17:57:00 | FromDiscord | <planetis> (edit) "and besides programmers, I don't think ... peoplethink" added "most" | "count" => "think" |
17:59:26 | * | pech is now known as disso_pch |
18:01:25 | FromDiscord | <Forest [She/Her]> Would `hello.world` be one token or two in a lexer? |
18:01:32 | FromDiscord | <Forest [She/Her]> For accessing keys of a dictionary for example |
18:01:35 | FromDiscord | <Forest [She/Her]> (Lua) |
18:02:15 | FromDiscord | <jos> In reply to @planetis "I have read that": I think Dijkstra's arguments there are not only greater than yours in quantity, but empirical examples and experience |
18:02:37 | FromDiscord | <jos> but to each their own.. ofc |
18:03:42 | FromDiscord | <planetis> oh wow such pompous response. sure he's a great scientist but this particular letter is subjective that's all I am saying. |
18:04:06 | FromDiscord | <planetis> I am not going to fight over the internet about a..b-1 |
18:04:22 | FromDiscord | <jos> it's not really, in a language with zero indexed collections, you'll have off by one errors by default |
18:04:33 | FromDiscord | <jos> it seems completely objective and sensible |
18:05:19 | FromDiscord | <jos> there's a ton of wisdom from the golden age of compiler design way back when that's lost nowadays |
18:06:42 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4boJ |
18:08:06 | FromDiscord | <sOkam!> (edit) "https://play.nim-lang.org/#ix=4boJ" => "https://play.nim-lang.org/#ix=4boK" |
18:08:50 | FromDiscord | <planetis> In reply to @jos "it's not really, in": so it's hard to use ..< instead of .. when converting code to Nim? |
18:09:17 | FromDiscord | <Generic> In reply to @Event Horizon "Would `hello.world` be one": it would be three |
18:09:34 | FromDiscord | <jos> in the eyes of someone thinking about language design, having the default/most terse syntax for ranges introduce an off-by-one error when iterating over a collection |
18:09:41 | FromDiscord | <jos> is just wrong |
18:09:53 | FromDiscord | <jos> it's not "hard" to use |
18:10:00 | FromDiscord | <jos> it's just not ideal |
18:10:23 | FromDiscord | <planetis> so Natural = range[0..high(int)] would be what with exclusive ranges? |
18:11:10 | FromDiscord | <jos> who cares |
18:11:26 | FromDiscord | <jos> is that the most common use case for ranges? no |
18:11:41 | FromDiscord | <planetis> so the default is off by one now... |
18:11:56 | FromDiscord | <jos> yeah, in a pretty rare case |
18:12:10 | FromDiscord | <jos> funnily enough Guido thinks the half open interval in python ranges was a mistake |
18:15:00 | FromDiscord | <jos> idk I mean I've been programming for like 15+ years and I've never had to write the line of code you wrote there |
18:15:16 | FromDiscord | <Forest [She/Her]> In reply to @Generic "it would be three": Ah yeah three not two |
18:15:16 | FromDiscord | <jos> so if I had to pick a way to introduce bugs for devs who never read the docs on ranges in my lang |
18:15:19 | FromDiscord | <Forest [She/Her]> Thanks! |
18:15:26 | FromDiscord | <jos> I would def pick half open intervals by default |
18:16:19 | FromDiscord | <!&luke> sent a code paste, see https://play.nim-lang.org/#ix=4boL |
18:17:41 | FromDiscord | <planetis> it's also common for arrays. I would like 1 based indexed lang better but that's not how computers work so whatever. |
18:19:21 | FromDiscord | <!&luke> sent a code paste, see https://play.nim-lang.org/#ix=4boO |
18:20:04 | * | pro joined #nim |
18:30:16 | FromDiscord | <!&luke> Tm is an object |
18:32:53 | FromDiscord | <Bung> you can't use variable out of scope |
18:53:53 | * | jmdaemon joined #nim |
18:57:56 | * | Guest7131 joined #nim |
18:58:08 | * | Guest7131 quit (Client Quit) |
18:59:16 | * | krux02 joined #nim |
19:10:15 | FromDiscord | <4zv4l> how can I compile my program for `macOS` from `Linux` ? |
19:10:52 | FromDiscord | <4zv4l> I never really needed and still don't need, just thought about it because in Go it's easy to do↵but I didn't find how to do in the Nim doc |
19:11:12 | qwr | that would be tricky, in theory it might be possible, but you would need C cross compiler and macosx libc at least |
19:12:38 | FromDiscord | <4zv4l> why isn't there a kind of `mingw` but for macOS ? |
19:13:09 | qwr | seems that there is - darling: https://stackoverflow.com/questions/39409082/cross-compiling-for-os-x-from-linux |
19:14:08 | FromDiscord | <4zv4l> lmao I thought you were calling me darling at first xD |
19:15:29 | FromDiscord | <redstonekasi> In reply to @redstonekasi "Hey there! Is there": Can anybody answer this question? Sorry if I'm being annoying by mentioning it again. |
19:17:57 | FromDiscord | <Varriount> Anyone know what the "O" in "ORC" stands for? Object? Optimized? Original? |
19:18:19 | qwr | pun for (freeing) circles |
19:18:46 | FromDiscord | <Varriount> In reply to @jos "funnily enough Guido thinks": Huh, I thought he wrote an article justifying half-open ranges. |
19:19:53 | qwr | arc (pure deferred reference counting) is unable to free cyclic data structures, orc adds cycle (O) detector |
19:20:10 | FromDiscord | <Varriount> In reply to @redstonekasi "Can anybody answer this": Why do you need a hybrid package? |
19:21:31 | FromDiscord | <redstonekasi> Because I want my program to also be usable as a library. |
19:24:16 | qwr | make a library and separate small program that uses it? |
19:25:05 | FromDiscord | <redstonekasi> Ah, I hadn't even thought of that, thanks. |
19:27:49 | FromDiscord | <Forest [She/Her]> Is there a Nim library for generating HTML and CSS? |
19:28:12 | FromDiscord | <Forest [She/Her]> I don't want to write either by hand because of how annoying it is haha, I've written them before but bleh |
19:30:33 | qwr | not sure about css, but for html there is https://nim-lang.org/docs/htmlgen.html |
19:33:42 | qwr | also searching web for nim html finds some other libraries |
19:45:55 | FromDiscord | <4zv4l> where is the doc for `httpx` ? |
19:45:57 | FromDiscord | <Forest [She/Her]> Thanks! |
19:46:07 | FromDiscord | <4zv4l> I don't find how to change the default port and ip to listen |
19:50:32 | FromDiscord | <redstonekasi> In reply to @4zv4l "I don't find how": I don't use httpx but I assume you just pass the Settings object as a parameter to `run` https://media.discordapp.net/attachments/371759389889003532/1023682941714448394/unknown.png |
19:50:44 | FromDiscord | <redstonekasi> https://media.discordapp.net/attachments/371759389889003532/1023682991534383144/unknown.png |
19:56:11 | * | pro quit (Quit: pro) |
19:56:35 | * | xaltsc joined #nim |
19:58:46 | FromDiscord | <4zv4l> I tried but maybe that's just me xD |
19:58:59 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4brd |
19:59:10 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4bre |
19:59:29 | FromDiscord | <4zv4l> oooh that's : and not = maybe |
19:59:45 | FromDiscord | <4zv4l> indeed |
19:59:47 | FromDiscord | <4zv4l> my bad sorry |
20:11:44 | * | nullsh quit (Quit: WeeChat 3.5) |
20:13:24 | FromDiscord | <jos> In reply to @Varriount "Huh, I thought he": i think ur right, I misread something or other |
20:23:15 | FromDiscord | <Mrcool> sent a long message, see http://ix.io/4brm |
20:24:39 | FromDiscord | <Mrcool> I finally ported a random deno script btw <https://github.com/sigmaSd/deno-nim/blob/master/examples/deno_show.nim> it only took so long |
20:27:19 | FromDiscord | <Forest [She/Her]> In reply to @Mrcool "My 2 days experience": Use the lsp btw, it works better for me tbh |
20:27:40 | FromDiscord | <Forest [She/Her]> The only backends that are going to be officially supported is the js backend the C family backends |
20:27:47 | FromDiscord | <sOkam!> the lsp is pretty decent, yep |
20:28:33 | FromDiscord | <Forest [She/Her]> And yeah error msgs are a bit rip |
20:28:33 | FromDiscord | <Mrcool> I'm using the lsp, but on some files it just stops working |
20:28:41 | FromDiscord | <Forest [She/Her]> Ah fair, I've had that issue too |
20:28:57 | FromDiscord | <Forest [She/Her]> I'm slowly working on a Java backend for Nim actually |
20:29:11 | FromDiscord | <Forest [She/Her]> I'm just taking a break from it rn because i can only do so much lmao |
20:29:44 | FromDiscord | <Mrcool> nimpretty makes my code not compile because it messes indentation up, hopefully it get some love as well |
20:30:59 | FromDiscord | <Mrcool> do you have the code for java backend somewhere, I want to see how do that looks like? (adding a new backend) |
20:31:59 | FromDiscord | <Mrcool> (edit) "like?" => "like" |
20:34:33 | FromDiscord | <planetis> Thats like everyones experience 🤣 tooling totally sucks |
20:40:24 | FromDiscord | <Forest [She/Her]> In reply to @Mrcool "nimpretty makes my code": Yeah I've had that issue too haha |
20:41:17 | * | LuxuryMode joined #nim |
20:41:26 | FromDiscord | <Forest [She/Her]> sent a long message, see http://ix.io/4brp |
20:41:35 | FromDiscord | <Forest [She/Her]> It shouldn't be too hard to port to Nim, compiler hasn't diverged that much yet |
20:41:41 | FromDiscord | <Forest [She/Her]> Also note the code is currently broken lmao |
20:42:35 | FromDiscord | <Mrcool> thanks |
20:43:38 | FromDiscord | <Mrcool> you have target lua xD I'm already trying to write my neovim config with nim using nim->js->typescript-to-lua transplier, it seems it can work |
20:44:52 | FromDiscord | <Forest [She/Her]> In reply to @Mrcool "thanks": No worries! |
20:45:11 | FromDiscord | <Forest [She/Her]> Haha yeah, i really think a Lua backend could work tbh |
20:45:42 | FromDiscord | <Forest [She/Her]> I'd need to do some cursed stuff to get around the lack of continue statements in Lua tho, if I want Lua 5.1 to be supported (mainly for ComputerCraft) |
20:46:45 | FromDiscord | <Forest [She/Her]> Hm, yeah thinking about it now, it's probably doable |
20:47:22 | FromDiscord | <Forest [She/Her]> The main issue is performance tbh, i could do a lot of string eval to get it so i make a 'pseudo-interpreter' |
20:47:45 | FromDiscord | <Mrcool> cool |
20:48:05 | FromDiscord | <Mrcool> is there a way I can make a variable name not mangled |
20:48:40 | FromDiscord | <Forest [She/Her]> Yeah, it should be `cdecl`? |
20:48:49 | FromDiscord | <Forest [She/Her]> for the pragma |
20:49:24 | FromDiscord | <Mrcool> it says invalid pragma https://media.discordapp.net/attachments/371759389889003532/1023697754444275762/unknown.png |
20:53:02 | FromDiscord | <Mrcool> {.exportc.} |
20:56:16 | FromDiscord | <Forest [She/Her]> Hm |
20:56:21 | FromDiscord | <Forest [She/Her]> Aah yeah exportc, sorry |
20:59:35 | FromDiscord | <Mrcool> np thanks anyway |
20:59:44 | FromDiscord | <Mrcool> next step is how to generate javascript export |
21:00:06 | FromDiscord | <Mrcool> as in `let setup =` becomes `export var setup =` |
21:01:36 | FromDiscord | <Forest [She/Her]> No worries haha |
21:01:49 | FromDiscord | <!&luke> In reply to @Bung "you can't use variable": Wym I have the file where that is defined included into the file with the jester server |
21:02:04 | FromDiscord | <Forest [She/Her]> Yeah Nim constants and `let`s just become JS vars |
21:02:46 | FromDiscord | <Forest [She/Her]> If you really wanted to, probably could make a macro for doing something like `jsLet` or `jsConst variableName = value` |
21:04:46 | FromDiscord | <Mrcool> I'll need help with that one xD |
21:05:58 | FromDiscord | <Mrcool> next problem , I want to pass an empty object, but it gets transpiled to an object with m_type https://media.discordapp.net/attachments/371759389889003532/1023701919593681017/unknown.png https://media.discordapp.net/attachments/371759389889003532/1023701919966965931/unknown.png |
21:06:20 | FromDiscord | <Mrcool> I'm using it like `call(a,b,VimOpts())` |
21:08:10 | FromDiscord | <Forest [She/Her]> In reply to @Mrcool "I'll need help with": Fair xD |
21:08:29 | FromDiscord | <Forest [She/Her]> In reply to @Mrcool "next problem , I": I don't understand? |
21:08:35 | FromDiscord | <Forest [She/Her]> m_type? |
21:08:49 | FromDiscord | <Forest [She/Her]> You could just emit JS code directly? |
21:09:56 | FromDiscord | <4zv4l> how can I get the parameters in `POST` with `httpx` ? |
21:10:01 | FromDiscord | <4zv4l> I really don't find any doc for that thing |
21:10:08 | FromDiscord | <Forest [She/Her]> `{.emit: """js code here""".}` |
21:10:10 | FromDiscord | <Mrcool> I want to emit an empty object {} but nim is adding that mtype thing |
21:10:25 | FromDiscord | <Mrcool> I even tried but its still htere https://media.discordapp.net/attachments/371759389889003532/1023703041716797601/unknown.png |
21:10:28 | FromDiscord | <Mrcool> (edit) "htere" => "there" |
21:10:34 | FromDiscord | <Forest [She/Her]> Would `{.emit: """{}""".}` not work? |
21:10:42 | FromDiscord | <Forest [She/Her]> In reply to @Mrcool "I even tried but": Ah |
21:11:01 | FromDiscord | <Forest [She/Her]> Hm idk, could be because it's an object of JsRoot, but no idea |
21:12:53 | FromDiscord | <Forest [She/Her]> In reply to @Mrcool "I even tried but": Does that raise an error or would it still work? |
21:13:36 | FromDiscord | <Mrcool> the type thing messes my nvim api expectation |
21:13:46 | FromDiscord | <Mrcool> found a workaround `var empty {.importjs: "{}"}: JsObject` |
21:15:06 | FromDiscord | <Mrcool> ok now the only missing part is adding `export` |
21:16:26 | FromDiscord | <Mrcool> close but far xD https://media.discordapp.net/attachments/371759389889003532/1023704554652577792/unknown.png https://media.discordapp.net/attachments/371759389889003532/1023704555529191474/unknown.png |
21:17:14 | FromDiscord | <Elegantbeef> `codegendecl` |
21:17:53 | FromDiscord | <Mrcool> nice |
21:18:14 | FromDiscord | <Mrcool> works thanks |
21:18:59 | FromDiscord | <Forest [She/Her]> In reply to @Mrcool "the type thing messes": Ah |
21:23:38 | FromDiscord | <Mrcool> why does this codgen into an array var h = [fn] instead of var h = fn https://media.discordapp.net/attachments/371759389889003532/1023706367523037356/unknown.png https://media.discordapp.net/attachments/371759389889003532/1023706367900520448/unknown.png |
21:23:52 | FromDiscord | <Mrcool> (edit) "var" => "`var" | "[fn]" => "[fn]`" | "var" => "`var" | "fn" => "fn`" |
21:24:17 | FromDiscord | <Elegantbeef> Pointer semantics |
21:24:28 | FromDiscord | <Elegantbeef> Nim has pointers JS doesnt so it emulates them |
21:24:43 | FromDiscord | <Elegantbeef> An pointer type is turned into an array |
21:24:46 | FromDiscord | <Elegantbeef> any\ |
21:25:05 | FromDiscord | <Elegantbeef> you can see this with `var hello = new int` |
21:26:05 | FromDiscord | <Mrcool> I see, is there a way to workarond this to make transpile to fn |
21:26:26 | FromDiscord | <Elegantbeef> Not that i know of |
21:26:35 | FromDiscord | <Elegantbeef> Other than using codegendecl |
21:26:36 | FromDiscord | <Elegantbeef> It's needed for Nim semantics |
21:27:43 | FromDiscord | <Mrcool> I found a workaround https://media.discordapp.net/attachments/371759389889003532/1023707394548707388/unknown.png |
21:28:42 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4brB |
21:29:17 | FromDiscord | <Elegantbeef> I mean you likely get a single error 😄 |
21:29:32 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4brC |
21:29:46 | FromDiscord | <4zv4l> and I don't know what's wrong |
21:29:51 | FromDiscord | <4zv4l> I took the example from the github |
21:30:43 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4brD |
21:30:47 | FromDiscord | <4zv4l> so valid json |
21:34:15 | FromDiscord | <Elegantbeef> I just tested and payload is empty |
21:34:36 | FromDiscord | <4zv4l> I don't even know how it works there is no doc |
21:34:47 | FromDiscord | <4zv4l> what is the diff between @payload and body ? |
21:36:06 | FromDiscord | <4zv4l> ooooh |
21:36:22 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4brF |
21:36:23 | FromDiscord | <4zv4l> this gives me a bit at least |
21:41:13 | FromDiscord | <4zv4l> this works ! |
21:41:17 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4brI |
21:42:05 | FromDiscord | <Mrcool> first hello world nvim plugin with nim works! https://media.discordapp.net/attachments/371759389889003532/1023711012110745702/unknown.png |
21:42:29 | FromDiscord | <Mrcool> https://media.discordapp.net/attachments/371759389889003532/1023711111792578662/unknown.png |
21:46:18 | FromDiscord | <Salir> Hi |
21:46:29 | FromDiscord | <Salir> Why i can't use tabs? |
21:46:48 | FromDiscord | <Elegantbeef> It was decided to use the least abrasive indentiation |
21:47:16 | FromDiscord | <Elegantbeef> Tabs are less supported and more tedious in many things to customise, as such they were not chosen and the only indentation allowed |
21:50:38 | FromDiscord | <Xenon> to be fair though, i dont really understand the tab-space argument |
21:50:58 | FromDiscord | <Xenon> just about any IDE or text editor nowadays has a setting to make tab insert spaces |
21:51:05 | FromDiscord | <Elegantbeef> Tabs are good as they give users customisabillity |
21:51:18 | FromDiscord | <Xenon> thing is, spaces do to |
21:51:30 | FromDiscord | <Elegantbeef> The downside is that people feel the need align code, which means when you customise indentation it is not readable |
21:51:33 | FromDiscord | <Elegantbeef> No spaces are not customisable |
21:51:42 | FromDiscord | <Elegantbeef> To change indentation size you have to edit the source file |
21:51:44 | FromDiscord | <Xenon> in VsCode for example, i have my tab size set to 2 spaces, with spaces auto-inserted |
21:51:55 | FromDiscord | <Salir> I can use #? replace("\t", " ") |
21:52:07 | FromDiscord | <Elegantbeef> spaces are equivalent to embedding the font in the source file, and having to change that to change the font rendered |
21:52:18 | FromDiscord | <Xenon> https://media.discordapp.net/attachments/371759389889003532/1023713582044684378/unknown.png |
21:52:21 | FromDiscord | <Elegantbeef> I mean you can use source code filters but it's just best to use spaces |
21:52:26 | FromDiscord | <Salir> In reply to @Salir "I can use #?": But why |
21:52:29 | FromDiscord | <Elegantbeef> I dislike spaces aswell but as a pragmatist it only makes sense |
21:52:43 | FromDiscord | <huantian> I'm indifferent as long as it's consistent |
21:52:43 | FromDiscord | <Xenon> i mean, the argument is kinda pointless |
21:52:45 | FromDiscord | <Xenon> spaces won |
21:52:49 | FromDiscord | <huantian> which enforcing spaces only works for me |
21:53:03 | FromDiscord | <huantian> (edit) "only" => "does, so it" |
21:53:28 | FromDiscord | <huantian> people that don't configure their editors properly and mix spaces and tabs anger me |
21:53:36 | FromDiscord | <Xenon> yeah lol |
21:54:00 | FromDiscord | <Salir> In reply to @huantian "people that don't configure": And? |
21:54:02 | FromDiscord | <Elegantbeef> The annoying part is really people who align code on non indents |
21:54:08 | FromDiscord | <Xenon> i have my editor set to 2 spaces for all files except python(in which PEP prefers 4-space) |
21:54:19 | FromDiscord | <Xenon> In reply to @Elegantbeef "The annoying part is": nah |
21:54:23 | FromDiscord | <Xenon> i do that all the time |
21:54:41 | FromDiscord | <Elegantbeef> "I use spaces to align code horizontally to make it tedious for anyone else" |
21:54:42 | FromDiscord | <Elegantbeef> Just align on an indent and carry on |
21:54:43 | FromDiscord | <Salir> It isn't nim creators problem |
21:55:24 | FromDiscord | <Elegantbeef> The tab vs space arguments have happened forever with Nim, just use spaces and carry on |
21:55:38 | FromDiscord | <Xenon> In reply to @Elegantbeef "The annoying part is": https://media.discordapp.net/attachments/371759389889003532/1023714422138609787/unknown.png |
21:56:02 | FromDiscord | <Xenon> lol |
21:56:09 | FromDiscord | <huantian> 😔 |
21:56:15 | FromDiscord | <huantian> that extra space ah |
21:56:19 | FromDiscord | <huantian> I don't like it lol |
21:57:11 | FromDiscord | <Salir> Why you're bot? |
21:57:19 | FromDiscord | <Xenon> but being real here, the only time i actually do that is variables |
21:57:21 | FromDiscord | <huantian> it's a really good ai |
21:57:47 | FromDiscord | <huantian> In reply to @Xenon "but being real here,": but you're going against NEP-1 checkmate 🤓 |
21:57:51 | FromDiscord | <Elegantbeef> The compiler chose a single significant white space character for good reason |
21:58:00 | FromDiscord | <Elegantbeef> Next indent align and carry on |
21:58:00 | FromDiscord | <Elegantbeef> That's what i do↵(@Xenon) |
21:58:30 | FromDiscord | <Xenon> In reply to @Elegantbeef "The compiler chose a": personally, i like to indent my code using 16 spaces\ |
21:58:51 | FromDiscord | <Xenon> like this |
21:58:52 | FromDiscord | <Xenon> a |
21:58:54 | FromDiscord | <Elegantbeef> I was looking at the left |
21:58:54 | FromDiscord | <Elegantbeef> Yea horizontally aligned code can die in a fire for all i care |
21:58:55 | FromDiscord | <Xenon> discord |
21:58:55 | FromDiscord | <Xenon> why |
21:59:02 | FromDiscord | <Xenon> why strip leading spaces |
21:59:39 | FromDiscord | <Elegantbeef> Cause my parents didnt love me |
22:00:10 | FromDiscord | <Xenon> in one of my .nimble files |
22:00:10 | FromDiscord | <Salir> You type so quickly |
22:00:12 | FromDiscord | <Xenon> https://media.discordapp.net/attachments/371759389889003532/1023715570996224070/unknown.png |
22:00:16 | FromDiscord | <Elegantbeef> You can be a chucklefuck all day long |
22:00:16 | FromDiscord | <Elegantbeef> This is why tabs are better |
22:00:23 | FromDiscord | <Elegantbeef> Chucklefuck protection |
22:01:05 | FromDiscord | <Elegantbeef> We get it xenon you hate others |
22:01:14 | FromDiscord | <Xenon> In reply to @Elegantbeef "We get it xenon": nah, just myself |
22:01:25 | FromDiscord | <Xenon> because i manually go in and edit .nimble files |
22:01:41 | FromDiscord | <Xenon> and set them to be exactly the correct number of spaces |
22:03:13 | FromDiscord | <Elegantbeef> I'm sorry for your loss |
22:07:23 | FromDiscord | <Le Toaster> Whenever I try to get a value from a table and assign it to a variable of the same type, I get an error saying that the received type `T` does not match the expected type. |
22:07:37 | FromDiscord | <Le Toaster> Does anyone know how I can fix this? |
22:07:43 | FromDiscord | <Elegantbeef> Code? |
22:07:51 | FromDiscord | <Elegantbeef> Or error? |
22:08:45 | FromDiscord | <Le Toaster> Error: `type mismatch: got 'T' for 'species["A"]' but expected 'Species = object'` |
22:10:04 | FromDiscord | <Elegantbeef> Ah that error isnt helping anyone, so code 😄 |
22:11:03 | * | attah quit (Ping timeout: 268 seconds) |
22:15:03 | FromDiscord | <Le Toaster> Oh never mind, I figured out the error. |
22:21:25 | * | wallabra quit (Ping timeout: 246 seconds) |
22:23:17 | * | wallabra joined #nim |
22:41:55 | * | attah joined #nim |
23:26:08 | * | krux02 quit (Remote host closed the connection) |
23:34:58 | * | arkurious quit (Remote host closed the connection) |