00:02:19 | FromDiscord | <! Nilts> Nim xml cannot find child body? Why? I think this is a parser error |
00:03:17 | FromDiscord | <! Nilts> wait, it's actually compiling. |
00:04:23 | FromDiscord | <! Nilts> nvm, it's still nil |
00:05:12 | FromDiscord | <! Nilts> I just realized i need html first |
00:06:33 | FromDiscord | <! Nilts> nvm |
00:06:41 | FromDiscord | <! Nilts> ignore these msgs |
00:07:16 | FromDiscord | <beans> sent a code paste, see https://play.nim-lang.org/#ix=4ab7 |
00:07:23 | FromDiscord | <beans> I'm on nim version 1.6.6 |
00:08:34 | NimEventer | New thread by treeform: Show Nim: TheArtButton.ai, a new web Stable Diffusion runner, see https://forum.nim-lang.org/t/9457 |
00:14:02 | FromDiscord | <Elegantbeef> You do have a linker and compiler for arm64, and set the config to use them?↵(@beans) |
00:17:39 | FromDiscord | <treeform> In reply to @NimEventer "New thread by treeform:": I am around to answer any questions about my Stable Diffusion nim site. |
00:29:08 | FromDiscord | <beans> In reply to @Elegantbeef "You do have a": I have a compiler and linker installed. I don't know what more I would need to do for it to compile to arm64. Interestingly compiling to `--cpu:arm` works as intended but not arm64 |
00:29:26 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/nimc.html#crossminuscompilation |
00:29:34 | FromDiscord | <Elegantbeef> Config the stuff at the bottom for arm64 |
00:29:52 | FromDiscord | <Elegantbeef> Either in a config file or on the command line |
00:31:26 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4ab8 |
00:31:56 | FromDiscord | <Elegantbeef> Obviously if yo uuse `clang` might make sense to do `--cc:clang` and `.clang.` instead of `.gcc.` |
00:32:39 | NimEventer | New thread by bung: Scorper now has efficient way parse http multipart, see https://forum.nim-lang.org/t/9458 |
00:36:50 | FromDiscord | <! Nilts> How do i delete a xml node in nim. I want to delete it via an object. like `mynode.delete()` |
00:37:40 | FromDiscord | <Bung> it's seq's delete |
00:38:43 | FromDiscord | <Bung> https://nim-lang.org/docs/system.html#delete%2Cseq%5BT%5D%2CNatural |
00:44:18 | FromDiscord | <! Nilts> That deletes itself? |
00:46:21 | FromDiscord | <! Nilts> because the docs don't really like |
00:48:11 | FromDiscord | <Bung> should point to its parent then find the element index |
00:51:00 | FromDiscord | <! Nilts> In reply to @Bung "should point to its": but how do i find the index |
00:52:21 | FromDiscord | <! Nilts> ? |
00:52:23 | FromDiscord | <Bung> the node store as ref NodeObj, can just compare use `==` , am not very sure |
00:57:55 | * | disso_peach joined #nim |
01:28:39 | * | jmdaemon quit (Quit: ZNC 1.8.2 - https://znc.in) |
01:54:23 | FromDiscord | <demotomohiro> I hope @dain is aware of `sizeof(Hash)` and https://en.m.wikipedia.org/wiki/Birthday_problem |
02:03:25 | * | jmdaemon joined #nim |
02:14:38 | FromDiscord | <Elegantbeef> Wasm3 is a breeze to use, really solving all my issues with other runtimes |
02:17:01 | FromDiscord | <Bung> how to know my pr merged into which version? |
02:17:11 | FromDiscord | <Elegantbeef> It's a much simpler C-API than the others and as such is much easier to pipe it around |
02:17:31 | FromDiscord | <Elegantbeef> Look at #version1-6 on github and if it's not there it's #devel only |
02:17:39 | FromDiscord | <Elegantbeef> If it didnt get backported it's devel only |
02:18:09 | * | jmdaemon quit (Ping timeout: 244 seconds) |
02:19:01 | FromDiscord | <Bung> by eye? I want to know the first occurred version |
02:19:29 | FromDiscord | <Elegantbeef> I mean look at your PR if it didnt get backported it's only in devel |
02:22:16 | FromDiscord | <Bung> oh, I goto that file and check commits , switch versions, it's in 1.6 |
02:30:34 | * | arkurious quit (Quit: Leaving) |
02:49:42 | * | jmdaemon joined #nim |
03:01:19 | * | jmdaemon quit (Quit: ZNC 1.8.2 - https://znc.in) |
03:04:17 | FromDiscord | <Elegantbeef> @Girvo\: well if you want an update wasm3 is a breeze, implemented a few tests using Nim compiled modules that use WASI and it just works. https://github.com/beef331/wasm3/blob/master/tests/test1.nim |
03:04:57 | FromDiscord | <Elegantbeef> Though in your embedded use case I assume `/` from std/os will error so need to do that properly |
03:12:15 | * | jmdaemon joined #nim |
03:16:48 | * | tiorock joined #nim |
03:16:49 | * | tiorock quit (Changing host) |
03:16:49 | * | tiorock joined #nim |
03:16:49 | * | rockcavera quit (Killed (molybdenum.libera.chat (Nickname regained by services))) |
03:16:49 | * | tiorock is now known as rockcavera |
03:48:10 | FromDiscord | <Prestige> Playground was never rebooted? Dang |
03:50:18 | FromDiscord | <Rika> you didnt scold pmunch enough |
03:50:35 | FromDiscord | <Elegantbeef> Someone get the playground down pitchfork |
03:50:36 | FromDiscord | <Prestige> sent a code paste, see https://paste.rs/zJv |
03:50:44 | FromDiscord | <Prestige> In reply to @Rika "you didnt scold pmunch": Gonna have to |
03:51:26 | FromDiscord | <Elegantbeef> > Use init proc or initOrderedSet proc before calling other procs on it. |
03:51:31 | FromDiscord | <Prestige> Error is just on the last line |
03:51:42 | FromDiscord | <Prestige> I used initOrderedSet with the same outcome |
03:52:40 | FromDiscord | <Prestige> hm only for f1 though, if I initOrderedSet for both it works 🤔 |
03:52:44 | FromDiscord | <Elegantbeef> Likely the hash proc then |
03:52:52 | FromDiscord | <Elegantbeef> https://github.com/nim-lang/Nim/blob/version-1-6/lib/pure/collections/sets.nim#L860 |
03:54:57 | FromDiscord | <Prestige> Yep that was it, the hash function was failing for some reason when I was using unsafeAddr |
03:54:58 | FromDiscord | <Prestige> scary |
04:00:01 | FromDiscord | <ElegantBeef> Matrix dieded |
04:00:14 | FromDiscord | <Prestige> Rip |
04:00:20 | FromDiscord | <ElegantBeef> https://media.discordapp.net/attachments/371759389889003532/1018370383558230170/unknown.png |
04:01:59 | FromDiscord | <Prestige> Thanks |
04:02:09 | FromDiscord | <Prestige> I was using unsafeAddr but that wasn't working for some reason |
04:02:24 | FromDiscord | <Elegantbeef> Odd |
04:02:29 | FromDiscord | <Prestige> so I added an `id: int` field that I just increment globally... eh |
04:02:32 | FromDiscord | <Prestige> not fun |
04:02:46 | FromDiscord | <Elegantbeef> What're you doing? |
04:03:06 | FromDiscord | <Prestige> this: https://github.com/avahe-kellenberger/safeset/commit/972e5de069a03db9989c78e7f47a9ebcda3bd77f |
04:03:15 | FromDiscord | <Prestige> contains function for SafeSet |
04:04:19 | FromDiscord | <Elegantbeef> Where were you using `unsafeaddr`? |
04:04:43 | FromDiscord | <Prestige> inside the hash function |
04:04:57 | FromDiscord | <Elegantbeef> Yea that's cause your type isnt `{.byref.}` so you were getting a stack pointer |
04:04:57 | FromDiscord | <Prestige> `hash(this.unsafeAddr)` |
04:05:01 | FromDiscord | <Prestige> ah |
04:05:17 | FromDiscord | <Elegantbeef> `sizeOf(Foo) < 3 sizeof(float)` means pass by copy |
04:05:31 | FromDiscord | <Prestige> I see, thanks |
04:06:14 | FromDiscord | <Elegantbeef> Does it still error with a `initOrderedSet` and no `id`? |
04:06:39 | FromDiscord | <Prestige> Yeah |
04:06:52 | FromDiscord | <Elegantbeef> Less hacky |
04:06:54 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4aby |
04:07:36 | FromDiscord | <Elegantbeef> Though i'd suggest you just make your own hash function and put a `{.warning: "Using this with an empty set results in 0".}` in it |
04:08:16 | FromDiscord | <Elegantbeef> That way you dont ever need to worry about this index error in the future |
04:08:23 | FromDiscord | <Elegantbeef> You just call `hash` and it works |
04:09:22 | FromDiscord | <Elegantbeef> Actually i'd `hash(0)` 😄 |
04:09:25 | FromDiscord | <Prestige> oh really? That's crazy |
04:09:40 | FromDiscord | <Elegantbeef> What? |
04:10:10 | FromDiscord | <Prestige> didn't know I could just hash the children like that |
04:10:31 | FromDiscord | <Elegantbeef> Well obviously it's better to have a hash for the type |
04:11:52 | FromDiscord | <Elegantbeef> A slight suggestion for your `pendingElements` is to check if it's above like 64 elements if so set it to a new table of 64 elements |
04:12:12 | FromDiscord | <Elegantbeef> Or any other size that you think makes sense, this way you dont hold onto a buttload of memory |
04:14:48 | FromDiscord | <Elegantbeef> \A dumb thing you could do is annotate `elements {.guarded: pendingClear.}` and a template that emits `{.lock: [mySet.pendingClear].}` to give you some compile time assurances that you do infact lock before accessing, but that might be a bit to anal |
04:15:39 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/manual_experimental.html#guards-and-the-locks-section-protecting-general-locations explains that |
04:16:21 | FromDiscord | <Elegantbeef> Now with those unasked for suggestions i'm going to shush 😛 |
04:19:11 | FromDiscord | <Prestige> heh thaks |
04:19:14 | FromDiscord | <Prestige> thanks |
05:48:47 | * | jmdaemon quit (Quit: ZNC 1.8.2 - https://znc.in) |
05:49:48 | * | vicecea quit (Remote host closed the connection) |
05:50:16 | * | vicecea joined #nim |
05:55:22 | FromDiscord | <ravinder387> `type↵ Person = Object↵ name: string↵ age: int` |
05:55:37 | FromDiscord | <ravinder387> compiler say invalid indentation |
05:55:39 | FromDiscord | <ravinder387> error |
05:55:57 | FromDiscord | <Rika> `Object` -> `object` |
05:55:58 | FromDiscord | <Elegantbeef> `object` not `Object` |
06:02:12 | FromDiscord | <ravinder387> let p = {name: "ravi", age: 28} and function manipulate(p){...} js code. when i try to call in nim it get error |
06:02:42 | FromDiscord | <ravinder387> sent a long message, see http://ix.io/4abS |
06:03:25 | FromDiscord | <ravinder387> sent a long message, see http://ix.io/4abT |
06:04:28 | FromDiscord | <ravinder387> sent a long message, see http://ix.io/4abU |
06:04:46 | FromDiscord | <Elegantbeef> use `cstring` and import it as mutating cstring |
06:04:52 | FromDiscord | <Elegantbeef> or import it mutating string and hope that works |
06:05:52 | FromDiscord | <Elegantbeef> Wait |
06:06:06 | FromDiscord | <Elegantbeef> Why are you importing this that operates on `obj.name` then passing it `obj.name` |
06:06:12 | FromDiscord | <Elegantbeef> Your js function also doesnt return anything |
06:11:18 | FromDiscord | <ravinder387> In reply to @Elegantbeef "Why are you importing": becoz the definition of manipulate_obj function written in js.. i just wanna call it. |
06:11:28 | FromDiscord | <ravinder387> jsffi use to call any js code |
06:13:32 | FromDiscord | <ravinder387> in js ` let obj = {name: "alex", age:60}` |
06:13:42 | FromDiscord | <ravinder387> how to map this data into nim |
06:16:39 | FromDiscord | <Elegantbeef> You did map it |
06:17:05 | FromDiscord | <Elegantbeef> you can do `proc manipulate_obj(a: Person): JsObject {.importc, nodecl.}` if you need |
06:20:30 | FromDiscord | <ravinder387> if i write sum function in js file `function sum(){}` |
06:21:01 | FromDiscord | <ravinder387> now I want to call this `sum(my_nim_data)` |
06:21:06 | FromDiscord | <ravinder387> how to wrap it |
06:21:18 | FromDiscord | <Elegantbeef> The same way you did |
06:21:32 | FromDiscord | <Elegantbeef> then convert your nim object to jsobject with the conversion proc |
06:21:58 | FromDiscord | <ravinder387> any proc to convert nim obj to jsobject |
06:22:50 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/jsffi.html#toJs%2CT |
06:47:18 | FromDiscord | <soda> Is there a recursive dir copy operation? os.copyDir() doesn't seem to do it |
06:48:06 | FromDiscord | <Elegantbeef> `moveDir`? |
06:48:21 | FromDiscord | <soda> I want to copy |
06:48:47 | FromDiscord | <Elegantbeef> I misread |
06:48:59 | FromDiscord | <Yardanico> In reply to @soda "Is there a ": huh, very weird, I'd assume it would |
06:49:05 | FromDiscord | <Yardanico> since directories inside a directory are a part of it |
06:49:07 | FromDiscord | <Elegantbeef> The source seems it does |
06:49:14 | FromDiscord | <Elegantbeef> https://github.com/nim-lang/Nim/blob/version-1-6/lib/pure/os.nim#L2584-L2590 |
06:49:21 | FromDiscord | <Yardanico> maybe the problem is with something else |
06:49:24 | FromDiscord | <soda> Yea but in effect, this is just creating the destination dir and leaving it empty |
06:49:42 | FromDiscord | <Yardanico> In reply to @soda "Yea but in effect,": can you show the relevant part of your code and the directory structure? |
06:49:47 | FromDiscord | <Yardanico> also maybe there are permissions issues, not sure |
06:50:56 | FromDiscord | <soda> oh hmm |
06:51:12 | FromDiscord | <soda> yeah it must be an issue with paths or permissions indeed |
06:52:25 | FromDiscord | <soda> i was getting paths from a file. it was a parsing error |
07:01:43 | FromDiscord | <Hapenia> Can we use something like `export xxx_module as Mod` ? |
07:02:14 | FromDiscord | <Elegantbeef> No you can only do `import x as Mod` |
07:03:17 | * | Guest9127 joined #nim |
07:05:50 | FromDiscord | <Hapenia> This feature is a great way to help organize the code structure... Through this, we can get something like `static class`, solving naming problems |
07:06:35 | FromDiscord | <Elegantbeef> You can just do `mymodule.proc` |
07:07:08 | * | Guest9127 quit (Client Quit) |
07:08:45 | FromDiscord | <Elegantbeef> Nim doesnt have "naming problems" really |
07:08:51 | FromDiscord | <Elegantbeef> In the case of ambiguity you just use the module name |
07:09:30 | FromDiscord | <Hapenia> The problem is, when I try to create a library, the entry should expose all of functionalities to lib users, these modules has inner structures but `export` will flat them out |
07:09:55 | FromDiscord | <Elegantbeef> That's exactly what Nim programmers want |
07:10:08 | FromDiscord | <Elegantbeef> Nim programmers do not want to have to go `somename.someProc(a, b)` |
07:10:16 | FromDiscord | <Elegantbeef> They want to be able to do `a.someProc(b)` |
07:10:32 | * | tiorock joined #nim |
07:10:33 | * | tiorock quit (Changing host) |
07:10:33 | * | tiorock joined #nim |
07:10:33 | * | rockcavera is now known as Guest9948 |
07:10:33 | * | tiorock is now known as rockcavera |
07:11:41 | FromDiscord | <Hapenia> this can be fix by simple `using somename a` |
07:12:06 | FromDiscord | <Hapenia> or even `from xxx import Somename as a` |
07:12:41 | FromDiscord | <Elegantbeef> There isnt a problem you're solving |
07:12:45 | FromDiscord | <Elegantbeef> But anywho |
07:13:10 | * | Guest9948 quit (Ping timeout: 244 seconds) |
07:13:51 | NimEventer | New thread by bather: Why compiler doesn't check the size of types with the `size` pragma?, see https://forum.nim-lang.org/t/9459 |
07:22:05 | FromDiscord | <Rika> In reply to @Hapenia "this can be fix": youre misunderstanding |
07:39:25 | FromDiscord | <PyryTheBurger> how do i loop over a table and in those iterations delete something from it |
07:40:21 | FromDiscord | <Phil> In reply to @Hapenia "This feature is a": static class? Well, for nim it'd be more `static object`. ↵I'm confused, types exist at compile-time either way, what would be the purpose? |
07:40:56 | FromDiscord | <Hapenia> Well, I mean, when we import a huge library (OpenGL) or something, code hints will be polluted by a whole bunch of unused methods, of course we can `import opengl as OG`, but we should do this each time we use it. Why dont we directly do this in `export`? |
07:41:38 | FromDiscord | <Hapenia> Further, we can use this method to divide a large library into many smaller blocks |
07:42:11 | FromDiscord | <Phil> But you can do that already, I'm not seeing the lack of feature |
07:43:09 | FromDiscord | <Rika> That really sounds more like a library design issue than a problem of the import system |
07:43:28 | FromDiscord | <Phil> Depending on what precisely you want, you can either split one massive module that belongs together into multiple smaller modules and have a "mainModule" file that uses `include` for the imports, or you do what is best practice for libs and have a "main" module whose sole purpose it is to import and export the modules defining the public API of the lib |
07:43:42 | FromDiscord | <Yardanico> In reply to @PyryTheBurger "how do i loop": copy it I guess? |
07:43:48 | FromDiscord | <Yardanico> or iterate, and record which keys you want to delete |
07:43:51 | FromDiscord | <PyryTheBurger> like how |
07:43:52 | FromDiscord | <Yardanico> and after the iteration delete them |
07:44:03 | FromDiscord | <PyryTheBurger> is thewre an example |
07:44:30 | FromDiscord | <Yardanico> In reply to @PyryTheBurger "is thewre an example": just create a seq, iterate over the table, add the keys you want to delete to the seq, after that iteration loop over values in the sequence and delete those keys |
07:45:05 | FromDiscord | <PyryTheBurger> i need to delete from the taböle |
07:45:15 | FromDiscord | <Yardanico> yes |
07:45:25 | FromDiscord | <PyryTheBurger> oh |
07:46:47 | FromDiscord | <soda> Wow os.CopyDir is slow... |
07:47:15 | FromDiscord | <Yardanico> I assume you compiled with -d:release ? and slower than what - copying directly in explorer? |
07:47:40 | FromDiscord | <soda> hmm no i didn't |
07:47:45 | FromDiscord | <soda> let me try that |
07:47:54 | FromDiscord | <Yardanico> well nim compiles to a full unoptimized debug build by default |
07:48:01 | FromDiscord | <Yardanico> it tells you that in caps in the compiler output |
07:48:14 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=4aca |
07:48:56 | FromDiscord | <soda> In reply to @Yardanico "it tells you that": No it doesn't tell me anything |
07:49:14 | FromDiscord | <Yardanico> did you disable hints or set verbosity to 0? |
07:49:15 | FromDiscord | <soda> ? |
07:49:20 | FromDiscord | <soda> sent a code paste, see https://play.nim-lang.org/#ix=4acb |
07:49:21 | FromDiscord | <Yardanico> no, just use `-d:release` |
07:49:36 | FromDiscord | <soda> In reply to @Yardanico "did you disable hints": no but i'm using ubuntu so the compiler might be outdated lol |
07:49:42 | FromDiscord | <Yardanico> `nim -v` ? |
07:49:53 | FromDiscord | <soda> also tbf, this is wsl so the speed might be affected by that |
07:50:03 | FromDiscord | <soda> oh wow yeah this is from 2020... |
07:50:11 | FromDiscord | <Yardanico> In reply to @soda "also tbf, this is": yes, WSL has slower IO |
07:50:15 | FromDiscord | <Yardanico> it's a known issue with it |
07:50:26 | FromDiscord | <Yardanico> than native Windows/Linux I mean |
07:50:34 | FromDiscord | <soda> well i can't test the speed fairly at this point |
07:50:51 | FromDiscord | <Yardanico> any reason you're not compiling on windows natively? |
07:50:55 | FromDiscord | <Yardanico> Nim supports Windows just fine |
07:51:06 | FromDiscord | <soda> some issue with mingw |
07:51:09 | FromDiscord | <Yardanico> huh |
07:51:14 | FromDiscord | <Phil> I recall windows having some fundamental design difference in how its filesystem and its io works compared to linux, maybe that translation-step is whats hurting |
07:51:36 | FromDiscord | <Phil> no guarantee for the above statement |
07:51:48 | FromDiscord | <PyryTheBurger> i am in windows, everything fine |
08:12:11 | FromDiscord | <soda> Is there a quick way to trim symbols from a string? |
08:12:15 | FromDiscord | <soda> sent a code paste, see https://play.nim-lang.org/#ix= |
08:12:25 | FromDiscord | <soda> This is an example of a string that was read straight from a file |
08:12:34 | FromDiscord | <soda> the \c symbol in the end is what i want to get rid of |
08:14:54 | FromDiscord | <PyryTheBurger> how do i get access to the user directory or the appdata directory |
08:15:30 | FromDiscord | <soda> os.getHomeDir |
08:15:34 | FromDiscord | <soda> os.getConfigDir |
08:15:40 | FromDiscord | <PyryTheBurger> okay |
08:38:09 | * | mahlon quit (Ping timeout: 252 seconds) |
08:38:36 | * | kenran joined #nim |
08:40:37 | * | kenran quit (Client Quit) |
08:42:16 | * | rockcavera quit (Remote host closed the connection) |
09:06:07 | NimEventer | New thread by NameUndefined: Include directory, see https://forum.nim-lang.org/t/9460 |
09:12:06 | * | mahlon joined #nim |
09:18:39 | FromDiscord | <ravinder387> In reply to @NimEventer "New thread by NameUndefined:": help me how to do string interop `this is $x` |
09:18:52 | FromDiscord | <ravinder387> `"this is $x"` |
09:19:04 | FromDiscord | <ravinder387> how to print value of variable inside string |
09:19:39 | FromDiscord | <aruZeta> you could use `fmt` from `std/strformat` |
09:19:54 | FromDiscord | <aruZeta> `fmt"this is {x}"` |
09:21:03 | FromDiscord | <beluwuga> is there any benefit outside readability to saying a func instead of proc |
09:21:52 | FromDiscord | <aruZeta> func's are a shortcut to making a noSideEffect proc |
09:22:47 | FromDiscord | <aruZeta> `func foo(a: Bar): Bar` and `proc foo(a: Bar): Bar {.noSideEffect.}` are the same |
09:27:46 | FromDiscord | <ravinder387> In reply to @aruZeta "`fmt"this is {x}"`": `var str1: cstring = "My car is "↵ var str2: cstring = "years old."↵ c.innerHTML = str1 & fmt("{age(myCar)}") & str2` |
09:27:54 | FromDiscord | <ravinder387> I 'm compiling to js not c |
09:28:05 | FromDiscord | <ravinder387> fmt is for compile c |
09:28:07 | FromDiscord | <ravinder387> not js |
09:28:31 | FromDiscord | <aruZeta> fmt does work in js |
09:28:46 | FromDiscord | <aruZeta> idk if it works with a cstring tho |
09:28:57 | FromDiscord | <aruZeta> it uses a `static string` |
09:29:27 | FromDiscord | <ravinder387> c.innerHTML = "My car is " & fmt("{age(myCar)}") & "years old." |
09:29:28 | FromDiscord | <Yardanico> In reply to @ravinder387 "`var str1: cstring =": that's not how you use fmt |
09:29:31 | FromDiscord | <aruZeta> and there you are passing an static string |
09:29:42 | FromDiscord | <Yardanico> why are you using fmt if you're still concatenating manually |
09:29:49 | FromDiscord | <aruZeta> yh |
09:30:15 | FromDiscord | <aruZeta> `fmt"My car is {age(myCar)} years old."` |
09:30:39 | FromDiscord | <Yardanico> @ravinder387 |
09:30:41 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=4acs |
09:31:09 | FromDiscord | <aruZeta> it sure works since my QR lib uses it and compiles perfectly to js |
09:31:17 | * | clemens3 joined #nim |
09:32:07 | FromDiscord | <ravinder387> warning cstring implicit depreceated in near future what should i do https://media.discordapp.net/attachments/371759389889003532/1018453876237684788/2022-09-11.png |
09:32:19 | FromDiscord | <Yardanico> what does `age` return? |
09:32:39 | FromDiscord | <Yardanico> ah I see what you mean |
09:32:54 | FromDiscord | <Yardanico> yeah in this case you should do `c.innerHTML = cstring fmt"My car is {years} years old."` |
09:32:58 | FromDiscord | <Yardanico> but again, that's a warning, not an error |
09:33:32 | FromDiscord | <aruZeta> it's just telling you to conver it to cstring explicitly |
09:33:41 | FromDiscord | <aruZeta> (edit) "conver" => "convert" |
09:33:50 | FromDiscord | <aruZeta> (edit) "it's ... just" added "a warning" |
09:37:20 | FromDiscord | <ravinder387> sent a long message, see http://ix.io/4acw |
09:37:24 | FromDiscord | <ravinder387> this is js code |
09:37:48 | FromDiscord | <ravinder387> return number in js |
09:41:15 | FromDiscord | <Yardanico> okay, so? |
09:41:44 | FromDiscord | <ravinder387> I just wanna wrap in nim.. that's i want |
09:42:30 | FromDiscord | <Yardanico> wrap exactly what? do you have a JS library in mind? |
09:42:49 | FromDiscord | <ravinder387> yes |
09:43:13 | FromDiscord | <Yardanico> take a look at https://nim-lang.org/docs/jsffi.html then |
09:49:55 | FromDiscord | <Phil> ... did recent versions of nimibook somehow break? ↵I'm trying to compile nbook.nim in norm with `(base) ~/dev/norm % nim c -d:release ./nbook.nim` ↵and I'm getting ↵`/home/philipp/.nimble/pkgs/stew-0.1.0/stew/ptrops.nim(39, 11) Error: invalid pragma: checks: off` |
09:50:30 | FromDiscord | <Yardanico> i doubt many people use nimibook, but the error is wrong indeed |
09:50:49 | FromDiscord | <Yardanico> i wonder why nimibook uses status' stew though |
09:51:02 | FromDiscord | <Yardanico> pointer operations |
09:51:04 | FromDiscord | <Phil> Is that something I can "fix" with a compiler flag or sth? |
09:51:17 | FromDiscord | <Phil> Wait, I'm on devel, maybe I need 1.6.6 |
09:51:35 | FromDiscord | <Yardanico> to replicate I just need to clone norm and run nbook or what? |
09:52:11 | FromDiscord | <Phil> That should be it, my clone is a couple weeks old and I have a few custom branches, but nothing that should affect nimibook since I didn't do anything in regards to it |
09:52:55 | FromDiscord | <Yardanico> also weird that nimibook uses tempfile nimble package, we have tempfile stuff in the stdlib nowadays |
09:53:08 | FromDiscord | <Yardanico> @Phil I get a different error `/mnt/d/Projects/NimExperiments/norm/nbook.nim(4, 12) Error: undeclared identifier: 'initBookWithToc'` |
09:53:11 | FromDiscord | <Yardanico> with nimibook freshly installed |
09:53:23 | FromDiscord | <Yardanico> ah head |
09:53:27 | FromDiscord | <Phil> In reply to @Yardanico "<@180601887916163073> I get a": Yeah, my error I only got while on devel, on 1.6.6 I also get that issue |
09:53:51 | FromDiscord | <Yardanico> yeah idk, it works here after I did `nimble install -y nimib@#head nimibook@#head` like in the norm nimble file |
09:54:47 | FromDiscord | <Phil> Huh, yeah that made it work |
09:55:34 | FromDiscord | <Yardanico> but I still wonder why nimibook depends on status' stuff |
09:56:08 | FromDiscord | <Yardanico> ah, toml_serialization from mustache |
09:56:18 | FromDiscord | <Yardanico> it brings the whole status dependency chain in result |
10:02:38 | FromDiscord | <Phil> > [nimibook.error] could not find 0 sources, and 1 build outputs↵Hmm... well, new error new round of google |
10:03:41 | FromDiscord | <Yardanico> google? |
10:03:47 | FromDiscord | <Yardanico> i doubt google will help you with nimibook :P |
10:08:51 | FromDiscord | <Phil> Sadly you are correct, what the heck is this bug |
10:22:50 | FromDiscord | <Bung> how to initialize custom Error with extro fields ? I use `result = newException(HttpError, msg)` got `Error: The HttpError type requires the following fields to be initialized: code` |
10:24:03 | FromDiscord | <Bung> previously I use new HttpError but get cant prove init |
10:32:07 | FromDiscord | <Phil> Somehow got my stuff fixed, no idea what the root cause was |
12:03:03 | madprops | "Which language deals with nulls best?" |
12:04:49 | FromDiscord | <Rika> I’d say for sure it isn’t Nim |
12:05:47 | madprops | :(((( |
12:05:59 | madprops | is it rust then? |
12:08:09 | FromDiscord | <Rika> No |
12:08:31 | FromDiscord | <Rika> They deal with it in a way that detriments other aspects so no |
12:08:53 | FromDiscord | <Rika> I mean “best” is ill defined anyway |
12:10:59 | FromDiscord | <Bung> language that has no null keyword |
12:11:09 | FromDiscord | <exelotl> I like how kotlin does it |
12:15:25 | * | krux02 quit (Remote host closed the connection) |
12:16:03 | madprops | isn't that similar to typescript? |
12:20:20 | FromDiscord | <exelotl> Not sure, but I think its basically how `not nil` in Nim should work if it were the default and you had to annotate nilable references explicitly instead: https://kotlinlang.org/docs/null-safety.html |
12:21:24 | FromDiscord | <exelotl> It's smart enough to implicitly convert a nilable reference to a not-nil one if it can see from the control flow that the variable couldn't possibly be nil |
12:24:09 | FromDiscord | <Rika> Flow typing, hm |
12:24:18 | FromDiscord | <Rika> Do you think Nim should have flow typing |
13:03:27 | * | arkurious joined #nim |
13:47:54 | * | neceve quit (Read error: Connection reset by peer) |
13:48:26 | * | neceve joined #nim |
14:06:58 | FromDiscord | <dlesnoff> I can not believe `toSet` (which has been superseded by `toHashSet`) in `std/sets` is still there from Nim v0.2 . It is confusing to ask for a conversion to a `set` and get a `HashSet` which is not the same thing as the built in `set` type. Do we really have to wait for the nim v2.0 to remove all functions with deprecated pragmas in stdlib ? |
14:29:10 | * | kenran joined #nim |
14:30:40 | * | derpydoo joined #nim |
14:39:42 | * | kenran quit (Quit: WeeChat info:version) |
15:10:05 | FromDiscord | <! Nilts> Parsehtml in nim turns `<!DOCTYPE html>` into a document tag? How do I remove the document tag and add `<!DOCTYPE html>` back to the top? |
15:14:17 | FromDiscord | <Bung> strip it out when as input , prepend it to result when output |
15:14:57 | FromDiscord | <Bung> sounds like same problem when I use httpparser and xml |
15:15:11 | FromDiscord | <Bung> (edit) "httpparser" => "htmlparser" |
15:15:37 | FromDiscord | <! Nilts> In reply to @Bung "strip it out when": sorry, i. |
15:15:43 | FromDiscord | <! Nilts> (edit) "i." => "i never use stripping" |
15:15:56 | FromDiscord | <! Nilts> How does it work? |
15:18:53 | FromDiscord | <Bung> just slice your input string |
15:21:44 | FromDiscord | <! Nilts> In reply to @Bung "just slice your input": i got it. |
15:37:55 | * | jmdaemon joined #nim |
15:49:10 | FromDiscord | <dain> sent a code paste, see https://play.nim-lang.org/#ix=4adY |
15:49:17 | FromDiscord | <dain> (edit) "https://play.nim-lang.org/#ix=4adY" => "https://play.nim-lang.org/#ix=4adZ" |
15:49:21 | FromDiscord | <dain> i.e. why can't i just use `map` on the values iterator |
15:51:58 | FromDiscord | <dain> i mean i know the useless answer, you have to cast to `seq` first by doing `mytable.values.to_seq.map(x => x > 10)` |
15:52:04 | FromDiscord | <dain> but that's not an answer .. why do i have to do that in the first place |
15:52:09 | * | droidrage joined #nim |
15:52:23 | FromDiscord | <dain> (edit) "useless" => "unenlightening" |
15:52:48 | FromDiscord | <Rika> because values is an iterator and map takes a seq |
15:53:02 | FromDiscord | <dain> that's not an answer, that's just a restatement of the problem |
15:53:14 | FromDiscord | <dain> why doesnt map just take an iterator |
15:53:23 | FromDiscord | <Bung> use toSeq |
15:53:37 | FromDiscord | <dain> yeah i know you have to use toseq, i'm asking why i have to do that |
15:54:31 | FromDiscord | <Rika> because it does not |
15:54:50 | FromDiscord | <Rika> values is an inline iterator, there is no runtime representation in data |
15:55:02 | FromDiscord | <Rika> for map to consume it, it would need to be a template |
15:55:09 | FromDiscord | <Rika> it isnt implemented therefore it cannot |
15:55:10 | FromDiscord | <dain> like .. if i have an iterator that's infinite, or is really big or something, and i want to do a bunch of filter and map and other stream operations, and then finally at the end i only have a few items, i don't want to cast to seq right at the beginning because that undermines the whole point of stream processing |
15:55:21 | FromDiscord | <dain> i only want to cast to seq at the end |
15:55:59 | FromDiscord | <Rika> it could be said that map is from sequtils and not iterutils as well |
15:56:04 | FromDiscord | <Bung> you can implement a map proc that takes iterater after iteration reset its state I guess? |
15:57:30 | FromDiscord | <dain> the problem i have is that there just isn't a unified "iterable" type or whatever that can be relied on to work as i expect. there are at least four different kinds that i have to keep track of. and they all have a non-overlapping set of procs you can use on them |
15:57:47 | FromDiscord | <Rika> theres only two |
15:57:51 | FromDiscord | <dain> no there are four |
15:57:59 | FromDiscord | <Rika> please list them, i might have forgotten |
15:58:07 | FromDiscord | <dain> inline iterators, closure iterators, seqs, and other non-seq container types |
15:58:19 | FromDiscord | <Rika> sequences boil down to either inline or closure |
15:58:21 | FromDiscord | <Rika> nonseq as well |
15:58:49 | FromDiscord | <dain> they're not the same in practice |
15:59:53 | FromDiscord | <dain> inline iterators: indefinite size, do not easily compose↵closure iterators: indefinite size, can compose sometimes?↵seqs: definite size, you can convert to these with no overhead from iterators↵non-seqs: definite size, you cannot convert to these from iterators unless you write your own template/proc to do it, you have to go through toseq first |
16:00:26 | FromDiscord | <dain> like if i have `someiterator` i can't do `someiterator.tohashset`. i have to do `someiterator.toseq.tohashset` |
16:00:31 | FromDiscord | <Rika> inline and closure are not indefinite, they are undetermined, either indefinite or definite |
16:00:50 | FromDiscord | <dain> and if `someiterator` has a bunch of repeated elements that would get discarded in set construction, that's just a waste to convert it to seq in the intermediate step |
16:01:07 | FromDiscord | <dain> In reply to @Rika "inline and closure are": this is hairsplitting |
16:01:16 | FromDiscord | <Rika> what do you want me to tell you |
16:02:12 | FromDiscord | <dain> im trying to figure out if there is an underlying tradeoff that makes it the way it is, that i haven't appreciated. or whether it's just a bunch of gaps |
16:04:06 | FromDiscord | <Rika> i am under the impression that this is only due to the organic expansion of nim |
16:04:20 | FromDiscord | <Rika> there are a good amount of 3rd party iterator helper libraries |
16:04:24 | FromDiscord | <dain> im sorry if im coming off as really hostile |
16:04:29 | FromDiscord | <Rika> no |
16:04:37 | FromDiscord | <Rika> its okay, i'm a bit stressed thats all |
16:04:46 | FromDiscord | <dain> its just like, whenever i try to do some kind of processing on iterables/iterators in nim, i step on some kind of inexplicable landmine |
16:04:56 | FromDiscord | <dain> i try to do some reasonable thing and the compiler is just like "lol. no." |
16:05:01 | FromDiscord | <Rika> yes i understand that much lmao it does get annoying |
16:05:29 | FromDiscord | <dain> and its not predictable ahead of time what will work and what won't, unless you commit the whole stdlib and manual to memory |
16:06:14 | FromDiscord | <Bung> maybe just because these libs api not fit your use case |
16:08:14 | FromDiscord | <dain> if i get some free time i might try to characterize the problem a little more clearly, maybe do a PR if i can figure it out. |
16:10:03 | FromDiscord | <Rika> In reply to @dain "and its not predictable": unfortunately i'm one of those who have already done that so i cant really give you a "sane" response most of the time |
16:10:12 | FromDiscord | <halc> sent a code paste, see https://play.nim-lang.org/#ix=4ae2 |
16:10:20 | FromDiscord | <Rika> collect i believe does avoid intermediates |
16:10:31 | FromDiscord | <Rika> collect can be found in module `sugar` |
16:10:54 | FromDiscord | <dain> yeah collect is one way of doing it. but it's verbose |
16:11:17 | FromDiscord | <dain> like .. one of the things i love so much about nim is the UFCS |
16:11:50 | FromDiscord | <Bung> In reply to @dain "if i get some": I think you can simplely change your code , like initHahsset then in map hs.incl it ? |
16:11:58 | FromDiscord | <dain> everything about the language syntax is begging me to do `some_iterable.map(blah).filter(blah).all(something)` etc. i think they call that an affordance or something, in ui/ux |
16:12:30 | FromDiscord | <Bung> there's already libs doing so like https://github.com/hamidb80/iterrr |
16:13:37 | FromDiscord | <halc> I reckon you want something like rust iterators? |
16:13:50 | FromDiscord | <dain> i haven't used rust |
16:14:41 | FromDiscord | <dain> my background is in python where you can just write generators that take arbitrary iterables like lists, sets, generators, ranges, etc and it all just works seamlessly |
16:15:34 | FromDiscord | <halc> ah yea, that's also a thing in python |
16:15:55 | FromDiscord | <dain> In reply to @Bung "there's already libs doing": this might work but i get wary of using a library for this .. it wants me to use some weird syntax like `|>`. and i have to learn the library author's way of extending it but i'd much rather it just be like, vanilla to the language. if that makes sense |
16:16:00 | FromDiscord | <dain> maybe an unreasonable ask idk |
16:16:19 | FromDiscord | <dain> i get wary around DSLs |
16:16:52 | FromDiscord | <Bung> check https://github.com/hamidb80/iterrr#inspirations |
16:17:10 | FromDiscord | <dain> like i tried to use zero-functional a while ago but i couldn't figure out how to write my own procs to extend it |
16:18:37 | FromDiscord | <halc> it's not unreasonable, I also sometimes wish I could chain nim iterators lol, though that might just be because I was used to python generators too |
16:18:52 | FromDiscord | <dain> one low hanging fruit i can see is to just extend the `toBlah` procs for all the stdlib `Blah` containers to take iterators instead of just seqs |
16:19:14 | FromDiscord | <dain> do you think that would be a good PR? ive not contributed to nim before but i can't see how it would be that hard to do |
16:20:54 | FromDiscord | <Rika> it really isnt unreasonable |
16:21:17 | FromDiscord | <Rika> its just an underdeveloped area for nim (in terms of frontend to the programmer), i'd say |
16:22:07 | FromDiscord | <Phil> Do PR's of stuff in the std lib get rolled out significantly slower than PR's on the compiler?↵Flywind fixed a bug in `std/strutils.parseEnum` before (https://github.com/nim-lang/Nim/issues/19463) and that was in Febuary, it appears to neither be in 1.6.6 nor in the RC for the upcoming 1.6.8 release and I'm slightly confused, that thing has been merged for half a year now and is one of the main reasons I'm compiling with devel nowadays |
16:23:05 | FromDiscord | <dain> In reply to @Rika "it really isnt unreasonable": k i might take a crack at it |
16:23:32 | FromDiscord | <Bung> maybe try make nimble package see how's going then create issue ask whether it's acceptable then create PR to nim repo |
16:24:03 | FromDiscord | <Rika> i tried composing iterators with iterators but its still subject to nim function depth ofc |
16:24:22 | FromDiscord | <Rika> then again, i was doing the iterator version of the sieve of eratosthenes so LMAOOOOOOO |
16:25:17 | FromDiscord | <Phil> I'm also slightly saddened that flywind's fix for #20149 didn't make it 😦 |
16:25:48 | FromDiscord | <Phil> (edit) "I'm also slightly saddened that flywind's fix for #20149 didn't make it 😦 ... " added "(made it possible to use the "warning as errors" flags again essentially)" |
16:28:56 | FromDiscord | <aruZeta> f |
16:29:40 | FromDiscord | <Prestige> I'm having a strange issue with caching - I've updated dependencies to my project, but running `nim r foo.nim` inside my project complains about not being able to find old dependencies that I've already updated. How can I "break" this cache? |
16:29:49 | FromDiscord | <flywind> In reply to @Isofruit "Do PR's of stuff": A PR won't be usually backported unless they are labelled as "[backported: 1.6]" in the PR title/commit message. The 1.6.x branch accepts bug fixes which are fit for it, otherwise the fix stays on the devel branch. You can request them to be backported if they are non-broken and simple fixes. |
16:30:33 | FromDiscord | <Phil> In reply to @flywind "A PR won't be": I'm fine with that, but since your fixes for these two issues are already in the devel branch of nim, when will they actually be in a release candidate? |
16:30:34 | FromDiscord | <Bung> In reply to @Avahe "I'm having a strange": why not nimble r ? |
16:31:43 | FromDiscord | <Prestige> Why nimble r? |
16:31:44 | FromDiscord | <flywind> In reply to @Isofruit "I'm fine with that,": The devel branch is for 2.0. A fix on the devel branch never gets into stable release unless it is specified. |
16:32:31 | FromDiscord | <flywind> In reply to @flywind "The devel branch is": Or 1.8.0 if there would be one. |
16:32:45 | FromDiscord | <Phil> Ohhhh |
16:32:46 | FromDiscord | <flywind> (edit) "In reply to @Isofruit "I'm fine with that,": The devel branch is for 2.0. A fix on the devel branch never gets into ... stable" added "a" |
16:33:09 | FromDiscord | <Bung> In reply to @Avahe "Why nimble r?": it will check dependecies |
16:33:29 | FromDiscord | <Phil> That's where my missunderstanding stemmed from, I assumed the RC's were generally generated from the devel branch |
16:33:48 | FromDiscord | <Prestige> I don't think nimble r is a thing |
16:34:09 | FromDiscord | <dain> woa wait a minute, there is a way to take an arbitrary iterable and convert it to a set. it's in setutils. i didnt even know that existed |
16:34:13 | FromDiscord | <dain> why is it a separate module |
16:34:24 | FromDiscord | <Prestige> but regardless, there should be a way to delete the nim cache |
16:34:42 | FromDiscord | <Prestige> I have an updated version of a framework installed, and the old version deleted |
16:34:48 | FromDiscord | <Prestige> And I get errors that it can't find the old version |
16:35:25 | FromDiscord | <Prestige> If I add a newLine to the file it will run successfully |
16:35:39 | FromDiscord | <Bung> nim c will use newer version |
16:36:02 | FromDiscord | <Prestige> Don't want to be creating a binary though |
16:36:55 | FromDiscord | <Bung> I mean use nim directly not nimble |
16:37:07 | FromDiscord | <Prestige> I am using nim directly |
16:37:58 | FromDiscord | <Prestige> Where is the nim cache by default? I guess I'll just delete it every time I update package dependencies |
16:38:24 | Amun-Ra | IIRC ~/.cache/nim |
16:38:47 | FromDiscord | <Prestige> Thanks, that worked |
16:39:22 | Amun-Ra | you can set your own cache dir |
16:39:48 | Amun-Ra | --nimcache=dir |
16:40:14 | FromDiscord | <Prestige> I just needed the old files deleted because I updated dependencies, and the old files were linking to deleted nimble files I guess |
16:40:22 | Amun-Ra | I see |
16:40:24 | FromDiscord | <Prestige> Kinda terrible |
16:57:45 | * | vicecea quit (Remote host closed the connection) |
16:58:16 | * | vicecea joined #nim |
16:59:40 | FromDiscord | <codic> I don't expect the compiler to but has anyone tried cross-compiling Nim code to windows 9x, or early NT, etc? |
17:00:47 | FromDiscord | <codic> also is/will gc:none be deprecated? because I want to write programs where i never free meomry |
17:00:56 | FromDiscord | <codic> (edit) "also is/will gc:none be deprecated? because I want to write ... programsmemory" added "short lived" | "meomry" => "memory" |
17:03:14 | FromDiscord | <codic> while still using stdlib |
17:11:39 | FromDiscord | <dain> sent a code paste, see https://play.nim-lang.org/#ix=4aej |
17:11:50 | FromDiscord | <dain> (edit) "https://play.nim-lang.org/#ix=4aej" => "https://play.nim-lang.org/#ix=4aek" |
17:12:50 | Amun-Ra | is gc=none be deprecated? I hope not |
17:13:39 | FromDiscord | <Rika> i cant think of issues other than for inline iterators |
17:13:42 | * | wallabra_ joined #nim |
17:14:00 | FromDiscord | <dain> what issues would arise with inline iterators |
17:14:04 | FromDiscord | <Rika> maybe not no |
17:14:11 | FromDiscord | <Rika> its okay |
17:14:13 | FromDiscord | <Rika> i think its okay |
17:14:29 | FromDiscord | <dain> :D okay i might make a pr for this for all the stdlib containers |
17:14:48 | FromDiscord | <Rika> you can probably make a template that generates to procs |
17:15:08 | * | wallabra quit (Ping timeout: 268 seconds) |
17:18:58 | * | wallabra joined #nim |
17:19:39 | * | wallabra_ quit (Ping timeout: 250 seconds) |
17:23:15 | FromDiscord | <Bung> barely use deques, it's more like end user code rather than in lib |
17:44:48 | * | wallabra quit (Ping timeout: 264 seconds) |
17:46:16 | * | wallabra joined #nim |
17:58:35 | FromDiscord | <! Nilts> What is the nim http client equivalent of `curl -X POST -s --data-urlencode "code=<script> alert( 1 ); </script>" https://htmlcompressor.com/compress’ |
17:58:44 | FromDiscord | <! Nilts> (edit) "https://htmlcompressor.com/compress’" => "https://htmlcompressor.com/compress`" |
18:05:09 | FromDiscord | <dain> sent a code paste, see https://play.nim-lang.org/#ix=4aet |
18:05:27 | FromDiscord | <dain> or is there a way to do tuple unpacking on the types |
18:05:57 | FromDiscord | <dain> maybe im not understanding how templates are meant to work |
18:21:04 | FromDiscord | <demotomohiro> You might find some hints by searching Nim repo for similar code:↵https://github.com/nim-lang/Nim/search?q=iterable&type= |
18:24:51 | * | rockcavera joined #nim |
18:24:51 | * | rockcavera quit (Changing host) |
18:24:51 | * | rockcavera joined #nim |
18:27:05 | * | derpydoo quit (Ping timeout: 268 seconds) |
18:35:51 | FromDiscord | <Bung> sent a code paste, see https://play.nim-lang.org/#ix=4aez |
18:42:50 | FromDiscord | <Bung> https://nim-lang.org/docs/typetraits.html#elementType.t%2Cuntyped or check here |
18:44:24 | * | Jjp137 quit (Ping timeout: 268 seconds) |
18:47:07 | * | Jjp137 joined #nim |
19:34:04 | FromDiscord | <dain> i have also thought for a while that the nim manual/docs are really poorly laid out and should be rewritten. very confusing to find things. with one exception: the stdlib search feature is excellent |
19:34:26 | FromDiscord | <dain> wish all languages had a snappy live search in their docs like that |
19:35:31 | * | Jjp137 quit (Ping timeout: 268 seconds) |
19:35:50 | * | Jjp137 joined #nim |
19:43:23 | FromDiscord | <dain> for example, the manual does not even link to the tutorials anywhere on the page. even though someone would usually be jumping between the tutorials and manuals a lot |
19:44:18 | FromDiscord | <dain> another example: the first sentence of the proc section in the manual is incorrect (it says you need an identifier for a proc, but that's not true because anonymous procs exist) |
20:01:27 | FromDiscord | <dlesnoff> I have a question about macros. I have read the tutorial on https://dev.to/beef331/demystification-of-macros-in-nim-13n8↵Is it possible to see the AST generated by quote do: block inside our macro ? |
20:03:11 | FromDiscord | <dlesnoff> sent a code paste, see https://play.nim-lang.org/#ix=4af1 |
20:03:37 | FromDiscord | <dlesnoff> (edit) "https://play.nim-lang.org/#ix=4af1" => "https://play.nim-lang.org/#ix=4af2" |
20:05:29 | FromDiscord | <dlesnoff> My final goal is from the definition of a type, to initialize a variable, and echo the size of both the type instance and its fields |
20:06:35 | FromDiscord | <Bung> sent a code paste, see https://play.nim-lang.org/#ix=4af3 |
20:06:35 | FromDiscord | <dlesnoff> I wish to improve http://zevv.nl/nim-memory/#_how_nim_stores_data_in_memory documentation |
20:08:18 | FromDiscord | <Bung> sent a code paste, see https://play.nim-lang.org/#ix=4af4 |
20:09:54 | FromDiscord | <dlesnoff> sent a code paste, see https://play.nim-lang.org/#ix=4af5 |
20:20:56 | * | monkeybusiness joined #nim |
20:23:10 | * | nyeaa4 quit (Quit: Ping timeout (120 seconds)) |
20:23:30 | * | nyeaa4 joined #nim |
20:31:56 | FromDiscord | <! Nilts> In reply to @not logged in "What is the nim": I can’t figure this out. Idk how to use multipart |
20:41:02 | FromDiscord | <dlesnoff> sent a code paste, see https://play.nim-lang.org/#ix=4af8 |
20:42:19 | FromDiscord | <Bung> In reply to @not logged in "I can’t figure this": var data = newMultipartData()↵data["code"] = "your code" |
20:43:06 | FromDiscord | <! Nilts> In reply to @Bung "var data = newMultipartData()": Yeah, i tried that, does not work |
20:43:58 | FromDiscord | <Bung> In reply to @Jiezron "Actually no, it returns": my bad, use compiler flag expandMacros ? I guess |
20:46:01 | FromDiscord | <Bung> In reply to @not logged in "Yeah, i tried that,": should use urlencode to your code |
20:46:44 | FromDiscord | <! Nilts> sent a code paste, see https://play.nim-lang.org/#ix=4afa |
20:52:50 | FromDiscord | <Bung> no , should not use multipart |
20:53:55 | FromDiscord | <Bung> it's header Content-type: application/x-www-form-urlencoded with body key=encodeUrlComponent(value) |
21:03:13 | FromDiscord | <! Nilts> In reply to @Bung "it's header Content-type: application/x-www-form-ur": ? So put it in he header? |
21:04:14 | FromDiscord | <Bung> look carefully |
21:04:47 | FromDiscord | <! Nilts> ok |
21:08:33 | FromDiscord | <! Nilts> In reply to @Bung "look carefully": I am so confused, i added the header and it did nothing |
21:10:40 | FromDiscord | <Bung> show the code |
21:11:48 | FromDiscord | <! Nilts> sent a code paste, see https://play.nim-lang.org/#ix=4afj |
21:12:08 | FromDiscord | <! Nilts> In reply to @Bung "show the code": Data is sent as the multipart |
21:12:22 | FromDiscord | <Bung> do not use multi part |
21:12:41 | FromDiscord | <! Nilts> How? It forces you to use it. |
21:12:42 | FromDiscord | <Bung> your content write as body directly |
21:13:21 | FromDiscord | <Bung> then u pick wrong api |
21:13:47 | FromDiscord | <! Nilts> In reply to @Bung "then u pick wrong": nim forces me to use it, not the api |
21:14:19 | FromDiscord | <! Nilts> httpclient has no option to post a custom body |
21:15:58 | FromDiscord | <Bung> https://nim-lang.org/docs/httpclient.html#using-http-post |
21:15:59 | FromDiscord | <! Nilts> or im stupid |
21:16:02 | FromDiscord | <! Nilts> nvm |
21:16:38 | FromDiscord | <Bung> no language std lib will lack of this kind of api |
21:16:55 | FromDiscord | <! Nilts> i forgor how args worked |
21:19:34 | FromDiscord | <! Nilts> ok last thing. What is the header equivalent of curl `--fail --compressed` |
21:20:20 | * | derpydoo joined #nim |
21:20:33 | * | dtomato joined #nim |
21:21:41 | FromDiscord | <Q-Master> Seems that compressed is Content-Encoding\: gzip↵(@not logged in) |
21:21:51 | FromDiscord | <Bung> what's fail ?I barely use curl , compress , I don't think it's supported |
21:22:16 | FromDiscord | <! Nilts> In reply to @Bung "what's fail ?I barely": Idk, i don’t either. The only examples the api gives are in curl |
21:22:41 | FromDiscord | <! Nilts> In reply to @Q-Master "Seems that compressed is": tried that |
21:23:37 | FromDiscord | <Bung> U'll need another tool compress your data |
21:23:49 | FromDiscord | <Q-Master> You might look here https://php.watch/articles/curl-php-accept-encoding-compression↵(@not logged in) |
21:25:56 | FromDiscord | <! Nilts> In reply to @Q-Master "You might look here": hmmmm, i think my file is to big |
21:26:42 | * | dtomato quit (Quit: The Lounge - https://thelounge.chat) |
21:27:05 | * | dtomato joined #nim |
21:27:28 | FromDiscord | <! Nilts> im trying a different approach, thanks for the help tho |
21:27:34 | FromDiscord | <Q-Master> And --fail just doesn't output server errors in curl and return with retcode.↵(@not logged in) |
21:29:02 | FromDiscord | <Bung> compress is client side send accept encoding |
21:29:41 | FromDiscord | <Bung> what u need is transfer encoding with encoded data |
21:29:42 | FromDiscord | <! Nilts> now im getting error `could not load libpcr.so` |
21:29:58 | FromDiscord | <! Nilts> In reply to @Bung "what u need is": im giving up on the api :) |
21:30:09 | FromDiscord | <! Nilts> (edit) "libpcr.so`" => "libpcre.so`" |
21:30:30 | FromDiscord | <Bung> sure , just send plain data |
21:46:18 | * | adium quit (Ping timeout: 240 seconds) |
22:00:02 | FromDiscord | <! Nilts> Does anyone know of a nim wrapper for https://www.html-tidy.org ? |
22:08:59 | FromDiscord | <!&luke> In reply to @not logged in "Does anyone know of": https://nimble.directory | https://github.com ↵If u don't find it there it probably doesn't exist |
22:11:34 | FromDiscord | <! Nilts> In reply to @ripluke "https://nimble.directory | https://github.com ": i can’t find anything |
22:11:44 | FromDiscord | <! Nilts> Uh oh. |
22:11:49 | FromDiscord | <!&luke> Is it a c lib? |
22:12:04 | FromDiscord | <!&luke> Something like futhark can automatically wrap it |
22:13:00 | FromDiscord | <! Nilts> In reply to @ripluke "Something like futhark can": how? |
22:13:05 | FromDiscord | <! Nilts> In reply to @ripluke "Is it a c": yes |
22:29:49 | FromDiscord | <Patitotective> In reply to @not logged in "how?": read https://github.com/PMunch/futhark |
22:46:47 | * | disso_peach quit (Ping timeout: 244 seconds) |
22:56:54 | * | disso_peach joined #nim |
23:23:59 | * | adium joined #nim |
23:53:52 | * | monkeybusiness quit (Quit: Leaving) |