00:01:55 | FromDiscord | <Elegantbeef> How is it not a nonconst location? |
00:05:15 | FromDiscord | <codic> I have no idea, that's what the compiler says |
00:05:31 | FromDiscord | <codic> Or is it saying that the whole expression (post-cast) is invalid |
00:05:46 | FromDiscord | <Elegantbeef> it's saying that `addr numdesk` isnt a constant or string literal |
00:05:57 | FromDiscord | <Elegantbeef> So it's unsafe to be casting it to a cstring |
00:06:01 | FromDiscord | <codic> why is it unsafe |
00:06:26 | FromDiscord | <codic> also, it says so even for string literals, so that's wrong |
00:06:31 | FromDiscord | <Elegantbeef> Cause strings are Nim managed and depending what the C is doing they may attempt to access the data after free |
00:06:32 | FromDiscord | <codic> sent a code paste, see https://play.nim-lang.org/#ix=3EPk |
00:07:02 | FromDiscord | <codic> I know for a fact that it won't, so how can I work around the errors? |
00:07:44 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=3EPl |
00:08:03 | FromDiscord | <Elegantbeef> Explictly conver using `cstring(string)` |
00:08:16 | FromDiscord | <codic> cast[ptr char](cstring x)? |
00:08:23 | FromDiscord | <codic> btw this is not nessecarily a nim string |
00:08:25 | FromDiscord | <codic> it is a pointer to data |
00:08:42 | FromDiscord | <codic> (edit) "it is a pointer to ... datawhich" added "untyped" | "untypeddata ... " added "which is expressed as ptr char" |
00:08:43 | FromDiscord | <Elegantbeef> So then `cstring(cast[ptr char](yourAddr)` |
00:08:45 | FromDiscord | <codic> (this is before C had void) |
00:08:46 | FromDiscord | <Elegantbeef> I assume atleast |
00:09:09 | FromDiscord | <codic> yeah works thanks |
00:10:22 | FromDiscord | <codic> amazing https://media.discordapp.net/attachments/371759389889003532/908871375563923527/unknown.png |
00:10:48 | FromDiscord | <Elegantbeef> I do like that dom said "It'll be easy to make the macro" but meanwhile i'm fighting making it a non lazy macro 😀 |
00:14:35 | FromDiscord | <dom96> In reply to @Elegantbeef "So then `cstring(cast[ptr char](yourAddr)`": Would `cast[cstring](yourAddr)` also work? |
00:14:52 | FromDiscord | <Elegantbeef> Probably |
00:20:06 | FromDiscord | <retkid> how useful is ptr, why has nobody told me about it, and when should i use it? |
00:27:26 | FromDiscord | <Elegantbeef> It's a pointer so you use it when you need a pointer that you control |
00:32:41 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3EPs |
00:34:08 | FromDiscord | <dom96> nice |
00:52:12 | FromDiscord | <codic> In reply to @dom96 "Would `cast[cstring](yourAddr)` also work?": Yeah it does work |
00:52:23 | FromDiscord | <codic> Simpler indeed, thanks |
01:41:32 | * | Pyautogui joined #nim |
01:46:52 | Pyautogui | Question: Is there a print version of http://ssalewski.de/nimprogramming.html? I am finding the meta-programming bit very useful, and prefer reading dead-tree books. |
01:51:01 | FromDiscord | <retkid> so |
01:51:09 | FromDiscord | <retkid> sent a code paste, see https://play.nim-lang.org/#ix=3EPG |
01:51:12 | FromDiscord | <retkid> I kinda just wanna understand how this wo0rks |
01:51:35 | FromDiscord | <retkid> why do we need to do put the var in a specific place in order for it to be gcc safe? |
01:51:44 | FromDiscord | <retkid> why do we cast it? |
01:51:45 | FromDiscord | <willyboar> In reply to @Pyautogui "Question: Is there a": From what I know there isn't |
01:51:52 | Pyautogui | Thanks |
01:51:59 | FromDiscord | <retkid> the ptr part i get, its constantly changing |
01:52:21 | FromDiscord | <Elegantbeef> You keep saying `gcc` safe 😀 |
01:52:30 | FromDiscord | <willyboar> But it's not difficult to convert adoc to pdf and print any part you like |
01:52:40 | NimEventer | New thread by Ggibson: Byaddr tuple unpacking?, see https://forum.nim-lang.org/t/8616 |
01:52:42 | FromDiscord | <retkid> In reply to @Elegantbeef "You keep saying `gcc`": because it exists outside of gcc? |
01:52:51 | FromDiscord | <Elegantbeef> no cause `gcc` is a compiler |
01:52:56 | FromDiscord | <retkid> fidopfgjdf |
01:52:56 | FromDiscord | <Elegantbeef> `gc` is garbage collection |
01:52:58 | FromDiscord | <retkid> im tired |
01:53:10 | FromDiscord | <retkid> i dunno how i didn't catch that |
01:53:15 | FromDiscord | <retkid> i meant garbage collection, yes |
01:53:18 | FromDiscord | <Elegantbeef> Ok so `allocShared0` allocates on the thread shared heap and 0's the memory |
01:53:29 | FromDiscord | <retkid> AAAAAAAAAAAAAAAAAAAA |
01:53:29 | FromDiscord | <Elegantbeef> You're manually allocating it so you have control over it |
01:53:42 | FromDiscord | <retkid> So it puts it where all the threads can see it |
01:53:58 | FromDiscord | <Elegantbeef> Yes with `refc` threads have independent heaps |
01:54:10 | FromDiscord | <Elegantbeef> with `orc`/`arc` the heap is shared so it's not required afaik |
01:54:16 | FromDiscord | <retkid> what does 0's the memory mean? |
01:54:48 | FromDiscord | <Elegantbeef> When you request memory from the OS it's got random memory in it so a bunch of invalid values, zeroing writes `0` in it so it's a default "good" value |
01:54:58 | FromDiscord | <Elegantbeef> Depending on the type that 0-ing isnt "good" |
01:54:58 | FromDiscord | <retkid> AH |
01:55:27 | FromDiscord | <retkid> so no segfaults |
01:55:45 | FromDiscord | <retkid> is there any reason you'd use allocShared1 |
01:55:56 | FromDiscord | <retkid> to do the opposite and just assign it to be a mistake |
01:56:18 | FromDiscord | <Elegantbeef> allocShared1? |
01:56:33 | FromDiscord | <retkid> idk why it came up nvm |
01:56:44 | FromDiscord | <retkid> im super tired i dont wanna pollute this channel anymore |
01:56:46 | FromDiscord | <retkid> thank you ,3 |
01:56:48 | FromDiscord | <retkid> (edit) ",3" => "<3" |
01:56:56 | FromDiscord | <Elegantbeef> You'd use `allocShared` for when you dont want zeroed memory since you're writing to it anyway |
01:57:05 | FromDiscord | <Elegantbeef> It's slightly more performance centric |
02:01:06 | * | Pyautogui quit (Ping timeout: 260 seconds) |
02:01:26 | nrds | <Prestige99> I've been using parsetoml to read toml files, but is there a way to save? Or maybe I should switch to json... |
02:03:12 | FromDiscord | <Elegantbeef> parsetoml is that status'? |
02:03:34 | nrds | <Prestige99> https://github.com/NimParsers/parsetoml this |
02:03:51 | FromDiscord | <Elegantbeef> Ah yea i'd just use statu's toml if you want it |
02:03:55 | FromDiscord | <Elegantbeef> Though it doesnt have hooks |
02:04:02 | FromDiscord | <Elegantbeef> So it's pretty unfun |
02:04:09 | nrds | <Prestige99> hm |
02:04:42 | FromDiscord | <Elegantbeef> For my WM i have a whole bunch of config types since there are no hooks |
02:05:07 | FromDiscord | <Elegantbeef> Personally i'd suggest using a library with hooks, it makes life easier 😀 |
02:11:39 | FromDiscord | <evoalg> I can make a table var via `var t: Table[string, int]` or `var t = Table[string, int]()` or `var t = initTable[string, int]()` and they seem to do exactly the same thing ... is it just a matter of personal preference which one I use? |
02:12:01 | FromDiscord | <Elegantbeef> Yes they're all initialized by default to good values |
02:12:09 | FromDiscord | <evoalg> nice |
02:12:48 | FromDiscord | <evoalg> When would I use `let a = {'a': 5, 'b': 9}.newTable` vs `let a = {'a': 5, 'b': 9}.toTable` ? I'm tring to understand the difference between newTable and toTable |
02:13:17 | FromDiscord | <evoalg> (and I dunno if it matter that I used let instead of var with them here) |
02:13:25 | FromDiscord | <Elegantbeef> `newTable` is a reference table which means `var b = yourRefTable` isnt a copy of the values but now `b` and `yourRefTable` point at the same value |
02:13:52 | FromDiscord | <Elegantbeef> You use references for that many to one relation, you want to reference the same table from many places |
02:13:53 | FromDiscord | <evoalg> oh! |
02:14:05 | FromDiscord | <evoalg> thank you! |
02:14:11 | FromDiscord | <Elegantbeef> `new` implies either `ref` or heap allocations |
02:14:41 | FromDiscord | <evoalg> Thank you as alwasy Elegantbeef |
02:14:53 | FromDiscord | <evoalg> always |
02:14:54 | FromDiscord | <Varriount> Is it intentional that `let n = -1; echo uint32(n)` succeeds, even with range checks turned on? |
02:15:29 | FromDiscord | <Elegantbeef> That should very much error |
02:15:56 | FromDiscord | <Varriount> https://play.nim-lang.org/#ix=3EPP |
02:16:02 | FromDiscord | <evoalg> I thought uint's cycle? |
02:16:17 | FromDiscord | <Elegantbeef> They do but `int` -\> `uint` should error if it's out of range |
02:16:37 | FromDiscord | <Elegantbeef> Seems it works for all of them oddly |
02:16:50 | FromDiscord | <Elegantbeef> !eval let n = -127i8; echo uint8(n) |
02:16:54 | NimBot | 129 |
02:17:43 | FromDiscord | <Elegantbeef> Very much should error since those should be checked conversions, you should need to cast for this behaviour |
02:20:45 | FromDiscord | <evoalg> The Nim Tutorial (Part I) on the docs page says "Other programming languages may suggest the use of unsigned integers for natural numbers. This is often unwise: you don't want unsigned arithmetic (which wraps around) just because the numbers cannot be negative." <-- is it suggesting to avoid using uint's and that we should use ranged types instead? |
02:21:31 | FromDiscord | <Elegantbeef> Yea it suggests using signed integers as underflow is less likely |
02:23:47 | FromDiscord | <Elegantbeef> Should add the caveat that ranges are checked and nim's unsigneds are not |
02:25:54 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3EPS |
02:26:17 | FromDiscord | <Elegantbeef> And if it's not clear from that PLEASE DONT EVER DO THAT |
02:26:38 | FromDiscord | <exelotl> yeah only use uints if you explicitly _want_ the wrapping behaviour |
02:27:05 | FromDiscord | <Elegantbeef> using try except one defects is how you piss me off 😛 |
02:27:08 | FromDiscord | <Elegantbeef> on defects\ |
02:27:33 | FromDiscord | <Elegantbeef> Defects indicate flaws in code and should not use exception handling to get around |
02:27:59 | FromDiscord | <evoalg> Makes sense! |
02:35:25 | FromDiscord | <evoalg> If I really wanted to, I could make a type just for positive ints: `type PositiveInts = 0..int.high` right? |
02:35:57 | FromDiscord | <Elegantbeef> Yep but Nim defines that as `Natural` |
02:36:21 | * | stkrdknmibalz quit (Quit: WeeChat 3.0.1) |
02:55:35 | * | neurocyte0132889 quit (Ping timeout: 264 seconds) |
03:01:30 | FromDiscord | <evoalg> I thought I read someone not to use Natural for var's but only use it for in proc parameters or some such? |
03:02:46 | FromDiscord | <evoalg> (I tried to look but couldn't find where I read it sry) |
03:03:52 | FromDiscord | <exelotl> nah, there's no reason to only use Natural for params, afaik |
03:03:58 | FromDiscord | <Elegantbeef> Natural is just a range value so can be used anywhere they can be |
03:04:30 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/system.html#Natural |
03:04:49 | FromDiscord | <Elegantbeef> It's exactly declared as you said 😀 |
03:04:49 | FromDiscord | <evoalg> Thank you both of you |
03:04:59 | FromDiscord | <evoalg> oh nice! |
03:06:07 | FromDiscord | <Elegantbeef> if you keep thanking people you'll wear out your keyboard and never be able to write tom hanks a message |
03:06:57 | FromDiscord | <evoalg> hehe ok I'll limit them so they're more special 😉 |
03:08:32 | FromDiscord | <demotomohiro> !eval echo typepof(1.Natural + 2.Natural) |
03:08:34 | NimBot | Compile failed: /usercode/in.nim(1, 6) Error: undeclared identifier: 'typepof' |
03:09:16 | FromDiscord | <demotomohiro> !eval echo typeof(1.Natural + 2.Natural) |
03:09:19 | NimBot | int |
03:09:26 | * | arkurious quit (Quit: Leaving) |
03:11:48 | FromDiscord | <demotomohiro> So if you use Natural anywhere, you might needs to overload operators for Natural |
03:12:37 | FromDiscord | <Elegantbeef> Not really |
03:13:01 | FromDiscord | <Elegantbeef> !eval var a\: Natural = Natural(1) + Natural(2); echo a |
03:13:03 | NimBot | Compile failed: /usercode/in.nim(1, 9) Error: ':' or '=' expected, but got 'Natural' |
03:13:34 | FromDiscord | <Elegantbeef> It's subrange type it implictly converts to the value and back but it's a checked conversion |
03:14:47 | FromDiscord | <evoalg> so ranges are like assertions but everywhere? |
03:17:02 | FromDiscord | <Elegantbeef> They're checked unless you disable it |
03:17:18 | FromDiscord | <Elegantbeef> Both runtime/compile time checked |
03:17:22 | FromDiscord | <Elegantbeef> Though the compile time is quite dull |
03:18:09 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3EPZ |
03:18:35 | FromDiscord | <evoalg> ahh that's explains it well |
03:18:37 | FromDiscord | <Elegantbeef> It'd be nice if the compiler could go "Hey this is a constant that isnt touched so i know it's `-1` and apply that, but alas |
03:19:53 | FromDiscord | <evoalg> I'm glad, otherwise it'd confuse the hell out of me |
03:20:18 | FromDiscord | <Elegantbeef> Well `a = b` in the above would ideally be a compile time error imo, but yea |
03:20:40 | * | krux02 quit (Quit: Leaving) |
03:20:49 | FromDiscord | <evoalg> ohhhhh I see what you mean |
03:21:17 | FromDiscord | <evoalg> and I agree |
03:21:24 | FromDiscord | <Elegantbeef> Whenever you have something that's `val = literal | constant` or a comparison to a `literal | constant` it'd be nice for the compiler to say "Hey until this is mutated it's X" |
03:48:13 | FromDiscord | <leorize> we do have the tech for it in the compiler, just that no one wired it up for that \:p |
03:53:48 | FromDiscord | <Alea> is there anything important I'm missing by not updating nim 1.4.8? |
03:53:55 | FromDiscord | <Alea> (edit) "is there anything important I'm missing by not updating ... nim" added "from" |
03:54:28 | FromDiscord | <Elegantbeef> `[]` iterators, explicit + implicit generic dispatch, some distinct fixes |
03:54:44 | FromDiscord | <Elegantbeef> Though there arent any `[]` iterators implemented in stdlib |
03:56:48 | FromDiscord | <Alea> are people running into any particular issues while updating at this point, or is it safe? |
03:58:02 | FromDiscord | <Elegantbeef> No clue i've been using devel for a while at this point |
04:06:01 | * | supakeen quit (Quit: WeeChat 3.3) |
04:06:31 | * | supakeen joined #nim |
04:08:59 | FromDiscord | <evoalg> there might be a list of regressions (or whatever they're called) somewhere though? |
04:14:01 | FromDiscord | <Elegantbeef> The change log does have a list of changes yes |
04:26:43 | FromDiscord | <evoalg> I too am wishing there was `[1..]` ... https://play.nim-lang.org/#ix=3EQ9 |
04:28:45 | nrds | <Prestige99> hm that would be nice |
04:28:46 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=3EQa 😛 |
04:29:19 | FromDiscord | <evoalg> Elegantbeef to the rescue! |
04:33:05 | FromDiscord | <evoalg> I would have thought that `for i, line` would work without enumerate, but it doesn't |
04:33:28 | FromDiscord | <Elegantbeef> Nope `for x, y in z` calls `z.pairs` if it exists |
04:33:55 | FromDiscord | <Elegantbeef> You have given me an idea to add to slicerator though |
04:34:58 | FromDiscord | <evoalg> oh but ... but I can do `pairs(mystr.splitlines)` and it works! |
04:35:18 | FromDiscord | <Elegantbeef> That's using `mystr.splitlines` the proc not the iterator |
04:36:37 | FromDiscord | <evoalg> okay |
04:40:50 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3EQg |
05:07:01 | FromDiscord | <evoalg> is a nimble refresh the correct thing for me to do to when you add something new like that? |
05:11:15 | FromDiscord | <Elegantbeef> I think the proper thing is to reinstall it since i'm not properly versioning it |
05:11:37 | FromDiscord | <evoalg> (as there's not "update") ... ahhh ok yea I ended up installing it again, over-writing the previous |
05:11:45 | FromDiscord | <Elegantbeef> Not overly ergonomic, but i'm also not vendoring it properly |
05:12:16 | FromDiscord | <evoalg> I understand |
05:16:01 | FromDiscord | <evoalg> I'm still confused .. the `.splitLines` returns a seq, so why doesn't `for i, line in mystr.splitLines:` work? It works if I do `let myseq = mystr.splitLines; for i, line in myseq:` right? |
05:16:43 | FromDiscord | <Elegantbeef> there is a `splitlines` that is a procedure and one that is an iterator, given the context it chooses the iterator and goes "nope this isnt right" |
05:17:25 | FromDiscord | <Elegantbeef> when you do `pairs(myStr.splitLines)` it's not looking for an iterator so it matches with the proc and then pairs is called on the `seq[string]` |
05:19:09 | FromDiscord | <evoalg> oh right, now I understand 🙂 |
05:19:24 | FromDiscord | <Elegantbeef> And here i was going to quickly make an example |
05:19:43 | FromDiscord | <evoalg> maybe if you do I'd understand better |
05:21:34 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=3EQp |
05:25:27 | FromDiscord | <evoalg> whereas enumerate is an iterator right? |
05:25:58 | FromDiscord | <Elegantbeef> enumerate is a for loop macro so it doesnt expect anything in that slot |
05:27:31 | FromDiscord | <Elegantbeef> You can compile with `--expandMacro:enumerate` to see how it expands your code if you want to understand mroe |
05:29:17 | FromDiscord | <codic> In reply to @nrds "<Prestige> I've been using": For config btw nim's std/parsecfg is pretty epic format too |
05:32:03 | FromDiscord | <evoalg> now I know everything! 😉 |
06:08:07 | FromDiscord | <PatAPizza> heyy |
06:08:12 | FromDiscord | <PatAPizza> is nim production ready? |
06:09:37 | FromDiscord | <Elegantbeef> Some use it as such |
06:35:12 | FromDiscord | <codic> If it's not production ready it never will be! |
06:51:40 | FromDiscord | <Yardanico> (codic's answer is a joke btw) |
06:54:44 | FromDiscord | <reilly> IMO, the Nim language in and of itself is more than production ready. Whether or not Nim's tooling and ecosystem is production ready is debatable. |
08:23:03 | FromDiscord | <arnetheduck> In reply to @nrds "<Prestige> I've been using": https://github.com/status-im/nim-toml-serialization is what we use mostly |
08:50:27 | NimEventer | New thread by Puruneko: Generic type in generic type, see https://forum.nim-lang.org/t/8617 |
09:23:47 | * | notchris quit (Ping timeout: 264 seconds) |
09:27:22 | * | notchris joined #nim |
10:10:32 | * | Pyautogui joined #nim |
10:38:17 | FromDiscord | <enthus1ast> @arnetheduck\: i was looking into https://github.com/enthus1ast/nimSocks/issues/8 and i'm wondering how to make it proper (any suggestions here btw?). What do you mean with "some dialects of Nim" ? |
10:39:51 | FromDiscord | <enthus1ast> i would solve it now, by looping through the enum and check the value. |
10:40:08 | FromDiscord | <enthus1ast> but recent nim version seem to handle this fine |
10:44:52 | FromDiscord | <hogspeed> https://thegreatwhitebrotherhood.org/welcome/important-message-from-the-gwb/ |
10:46:26 | FromDiscord | <faix> Hello, I would like to communicate over an anonymous unix domain socket.↵There is a call connectUnix(path), but the connection doesn't work.↵I guess the root of the problem is the path. The path string doesn't start with "\\0". How to construct such a string? |
10:47:02 | FromDiscord | <haxscramper> `--panics:on` vs `--panics:off` creates two dialects of a language where `Defect` has different meaning |
10:47:28 | FromDiscord | <enthus1ast> ah i see thanks [haxscramper](https://matrix.to/#/@haxscramper:matrix.org) |
10:51:01 | * | Pyautogui quit (Quit: Connection closed) |
10:55:19 | FromDiscord | <enthus1ast> [faix](https://matrix.to/#/@faix:matrix.org)\: `echo "foo\0baa"` |
11:35:50 | FromDiscord | <faix> sock.connectUnix("\\0/var/run/jet.socket") but strace tell me\:↵setsockopt(3, SOL\_SOCKET, SO\_REUSEADDR, [1], 4) = 0↵connect(3, {sa\_family=AF\_UNIX, sun\_path=@"/var/run/jet.socket"}, 22) = -1 EAFNOSUPPORT (Address family not supported by protocol)↵epoll\_ctl(4, EPOLL\_CTL\_ADD, 3, {events=EPOLLIN\|EPOLLRDHUP, data={u32=3, u64=3}}) = 0 |
11:39:26 | FromDiscord | <faix> sent a long message, see http://ix.io/3ERJ |
11:40:18 | FromDiscord | <enthus1ast> you can use tripple \` for code formatting |
11:41:17 | NimEventer | New thread by Mantielero: Help needed - issue with a wrapped library, see https://forum.nim-lang.org/t/8618 |
11:42:46 | FromDiscord | <enthus1ast> have you created the socket correctly? `newSocket` |
11:51:16 | FromDiscord | <faix> var sock = newAsyncSocket()↵sock.setSockOpt(OptReuseAddr, true)↵sock.connectUnix("\\0/var/run/jet.socket") |
11:53:45 | FromDiscord | <enthus1ast> the domain must be AF\_UNIX |
11:55:21 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=3ERM |
11:55:56 | FromDiscord | <faix> strace tell me It's AF\_UNIX↵connect(3, {sa\_family=AF\_UNIX, sun\_path=@"/var/run/jet.socket"}, 22) = -1 |
11:56:11 | FromDiscord | <Rika> Try it nonetheless |
11:57:34 | FromDiscord | <enthus1ast> yeah could be, but `EAFNOSUPPORT` suggest that there is a invalid combination, or, that you os really does not support it. Maybe wsl? |
12:03:10 | FromDiscord | <faix> sent a long message, see http://ix.io/3ERR |
12:06:01 | * | supakeen quit (Quit: WeeChat 3.3) |
12:06:31 | * | supakeen joined #nim |
12:07:12 | FromDiscord | <faix> ok, thanks for the support guys, i keep digging |
12:13:39 | FromDiscord | <Benjamin> This post on the forum might be spam meant to create backlinks (see the two periods ". .")\: https://forum.nim-lang.org/t/7731#55773 |
12:14:07 | * | xet7 quit (Quit: Leaving) |
12:14:14 | FromDiscord | <zetashift> oh good one, looks like it! |
12:14:25 | FromDiscord | <enthus1ast> sneaky |
12:15:36 | FromDiscord | <Rika> What are back links |
12:15:55 | FromDiscord | <enthus1ast> links to a site to raise its value |
12:16:12 | FromDiscord | <enthus1ast> to raise its "page rank" |
12:17:27 | FromDiscord | <Benjamin> Could be the opposite for all I know, lowering a competitor's pagerank. SEO is weird. |
12:19:31 | FromDiscord | <qb> dlopen: `If file is a null pointer, dlopen() shall return a global symbol table handle for the currently running process image.` How could I realize that in Nim? nim's posix dlopen expects a mode flag |
12:24:38 | FromDiscord | <enthus1ast> does `dlopen(nil, theCint)` not work? |
12:27:39 | FromDiscord | <qb> I'm a bit confused. `echo repr(dlopen(nil, 1))` returns `0x7f2be318c220` but `pmap pid` returns `000055d7e2c28000 4K r---- testbin` |
12:27:50 | FromDiscord | <qb> I've expected that dlopen returns `000055d7e2c28000` aswell |
12:39:48 | * | krux02 joined #nim |
12:49:59 | FromDiscord | <enthus1ast> i can not really help, but is the 0x7f2be318c220 the pointer or the address the pointer points to? |
13:00:13 | * | terminalpusher joined #nim |
13:08:16 | FromDiscord | <qb> oh yea could be that it is the pointer. How would I dereference it? `[]` doesnt seems to work |
13:19:45 | FromDiscord | <Rika> you cant dereference `pointer`s, you need to make it a typed one (`ptr Type`) |
13:19:58 | FromDiscord | <Rika> `cast[ptr TheType](theRawPtr)` |
13:20:04 | FromDiscord | <Rika> then you can [] it |
13:29:47 | FromDiscord | <qb> Thanks `echo repr(cast[ptr pointer](dlopen(nil, 1))[])` works as expected |
13:30:25 | FromDiscord | <Rika> `ptr pointer` :galaxybrain: |
13:31:56 | FromDiscord | <qb> or `cast[ptr ByteAddress](dlopen(nil, 1))[].toHex()` 😛 |
13:35:41 | FromDiscord | <Kermithos> is it possible to get a string returned from a threaded proc and wait until all threads are finished? Something like this https://play.nim-lang.org/#ix=3ESg |
13:46:48 | FromDiscord | <enthus1ast> @Kermithos\: what i've done is to `inc` a var for each thread i spawned, then i `dec` the var for each channel message i got https://github.com/enthus1ast/countFasta/blob/8127028eee4c721fbc11308deac3c414ca16af31/fastalib.nim#L88 |
13:47:07 | FromDiscord | <enthus1ast> but i bet there are better options, but works good in this case |
14:26:46 | * | terminalpusher quit (Remote host closed the connection) |
14:53:12 | NimEventer | New Nimble package! exprgrad - An experimental deep learning framework, see https://github.com/can-lehmann/exprgrad |
14:54:58 | FromDiscord | <Hamid Bluri> sent a code paste, see https://play.nim-lang.org/#ix=3ESE |
14:58:51 | FromDiscord | <Rika> `nimble install bigints` is the wrong way to install it just an fyi |
15:00:41 | FromDiscord | <Hamid Bluri> whaaaat |
15:01:23 | FromDiscord | <Hamid Bluri> sent a code paste, see https://play.nim-lang.org/#ix=Ccf |
15:01:31 | FromDiscord | <exelotl> In reply to @Rika "`nimble install bigints` is": wait, what's the right way? |
15:01:40 | FromDiscord | <Rika> `nimble install https://github.com/nim-lang/bigints` |
15:01:47 | FromDiscord | <Rika> afaik since bigints is def-'s |
15:01:52 | FromDiscord | <exelotl> ohh |
15:01:55 | FromDiscord | <Rika> and this is a fork of def-'s |
15:02:15 | FromDiscord | <Rika> initBigInt is a generic, no idea if map works well with generics |
15:02:21 | FromDiscord | <konsumlamm> In reply to @Rika "`nimble install https://github.com/nim-lang/bigints": the link has already been updated |
15:02:29 | FromDiscord | <Rika> really? if so then okay |
15:02:34 | FromDiscord | <Hamid Bluri> sent a code paste, see https://play.nim-lang.org/#ix=3ESR |
15:02:39 | FromDiscord | <Hamid Bluri> In reply to @Rika "initBigInt is a generic,": that's not good 😕 |
15:02:43 | FromDiscord | <Hamid Bluri> (edit) "https://paste.rs/bRi" => "https://play.nim-lang.org/#ix=3ESQ" |
15:08:12 | FromDiscord | <whisperdev> Heya.I am trying to downloadFile over http. I have included the bearssl lib but it looks like it's still looking for the other libssl libs |
15:11:50 | FromDiscord | <enthus1ast> do we support other ssl libs than openssl yet? |
15:11:54 | FromDiscord | <enthus1ast> i don't think so |
15:24:21 | FromDiscord | <arnetheduck> sent a long message, see http://ix.io/3ET3 |
15:25:48 | FromDiscord | <arnetheduck> In reply to @enthus1ast "do we support other": in `chronos` we use `bearrssl` - this is nice because it's compiled together with the rest of the nim code, meaning no pesky dependencies (https://github.com/status-im/nim-bearssl) |
15:26:31 | FromDiscord | <enthus1ast> thank you @arnetheduck |
15:26:45 | FromDiscord | <enthus1ast> i've done it like this for now\: https://github.com/enthus1ast/nimSocks/blob/77f95b52083a448119c3c96d4fe7818363fdcaff/nimSocks/types.nim#L115 |
15:27:10 | FromDiscord | <enthus1ast> i've also found the "nim-style-guide" |
15:27:11 | FromDiscord | <arnetheduck> In reply to @whisperdev "Heya.I am trying to": https://forum.nim-lang.org/t/7964#52137 is how we do it |
15:27:14 | FromDiscord | <enthus1ast> interesting read |
15:29:45 | FromDiscord | <whisperdev> Thanks |
15:59:26 | FromDiscord | <Ricky Spanish> sent a code paste, see https://play.nim-lang.org/#ix=3ET7 |
16:01:38 | FromDiscord | <Ricky Spanish> never mind my mistake it seems i can just directly use - between now and interval |
16:06:52 | FromDiscord | <Zoom> Considering writing a basic message broker (http\<json\>ws). What would you recommend to use? Have almost no experience with web stuff. Performance is low priority. |
16:07:58 | FromDiscord | <Hamid Bluri> sent a code paste, see https://play.nim-lang.org/#ix=3ET9 |
16:24:29 | FromDiscord | <Rika> Then I have no idea why it doesn’t work |
16:24:55 | FromDiscord | <Rika> Zoom prolly just use standard library stuff |
16:26:43 | FromDiscord | <Zoom> I'm considering it, but I'm also interested in exploring chronos and its ecosystem a bit↵(@Rika) |
16:47:35 | * | Onionhammer quit (Quit: The Lounge - https://thelounge.chat) |
17:19:06 | * | rockcavera quit (Remote host closed the connection) |
17:23:57 | FromDiscord | <Bung> hey , do we have grpc implementation in nim ? |
17:25:28 | FromDiscord | <faix> [enthus1ast](https://matrix.to/#/@sn0re:matrix.code0.xyz) It works now for me\:↵sock = newAsyncSocket(domain = AF\_UNIX, sockType = SOCK\_STREAM, protocol=IPPROTO\_IP)↵sock.connectUnix( "\\0/var/run/jet.socket") |
17:25:42 | FromDiscord | <Recruit_main707> @Bung i dont think so, but maybe |
17:26:42 | FromDiscord | <Bung> I"ve searched , not found |
17:27:10 | FromDiscord | <Recruit_main707> i keep getting to protobuffers, but thats not what you are looking for is it? |
17:28:40 | FromDiscord | <dom96> @Zoom what's a "basic message broker"? 🙂 |
17:28:51 | FromDiscord | <Bung> In reply to @Zoom "Considering writing a basic": I think they are different , protobuffer is construct data , grpc has server and client. |
17:41:36 | * | Guest9 joined #nim |
17:41:57 | * | Guest9 Gintru |
17:42:08 | Guest9 | . o O HI / IN |
17:42:28 | Guest9 | nim seems very promising |
17:42:49 | Guest9 | I am the one who gave billion in bitcoin |
17:43:13 | Guest9 | I am the Musk step brother you know |
17:43:46 | Guest9 | but I wonder myself, what are other VIM plugins |
17:43:59 | Guest9 | apart the "Zah" one |
17:44:30 | Guest9 | [R] are you a language ? a bot ? |
17:44:43 | Guest9 | arkanoid and you a game ? |
17:45:24 | Guest9 | dom96 / you here it is a honor |
17:45:35 | * | Guest9 is now known as Gintru |
17:46:56 | Gintru | Okay I am not in a hurry, I can wait |
17:49:36 | Gintru | Anyone available for VIM plugin/addon |
17:51:50 | nrds | <Prestige99> Gintru what are you looking for? |
17:52:16 | nrds | <Prestige99> oh you changed your name |
17:52:20 | nrds | <Prestige99> There is also https://github.com/alaviss/nim.nvim |
17:52:49 | nrds | <Prestige99> and if you have LSP set up with vim, there is https://github.com/PMunch/nimlsp |
17:54:17 | Gintru | o ! |
17:54:36 | Gintru | Prestige gone ? |
17:54:40 | FromDiscord | <logo> https://github.com/zah/nim.vim |
17:54:48 | FromDiscord | <logo> I use this one |
17:54:51 | nrds | <Prestige99> gone? |
17:55:23 | Gintru | nothing (I used Tab to -not- get your nick) |
17:55:30 | Gintru | Nice to meet you |
17:55:40 | nrds | <Prestige99> You too - I'm relayed over IRC |
17:55:45 | Gintru | Thanks much for the answer |
17:56:02 | * | Gintru laughting |
17:56:18 | Gintru | nrds / true, I see it si nrds |
17:57:07 | Gintru | nrds Gintru is Turing anagram, funny it is close to Gintro |
17:58:21 | Gintru | nrds / Prestige / anyway to get a pragma like {disable all identation mandatory} |
17:59:14 | Gintru | logo / thank you, I already tried this one, syntax is so much better |
18:00:06 | Gintru | FromDiscord / logo / thank you, I already tried this one, syntax is so much better |
18:00:12 | nrds | <Prestige99> The indentation in mandatory to the languge, so I think that'd be hard to pull off |
18:00:21 | nrds | <Prestige99> is mandatory* |
18:01:14 | Gintru | nrds / Prestige I read the doc and saw in Nim Forum, and tried funny thing : |
18:02:04 | Gintru | nrds / Prestige / it is possible to use parenthesis and semicolon ( cmd ; other line ) |
18:03:01 | Gintru | nrds / Prestige / I tried «( all_my_code )» unsuccessfully |
18:03:08 | nrds | <Prestige99> Hm yes but it's probably a lot more trouble than it's worth |
18:03:28 | Gintru | nrds / Prestige / but I can do a lot more |
18:04:13 | Gintru | nrds / Prestige / "more trouble", yes, that's why I look for a pragma |
18:05:01 | * | Gintru thinking into himself, it can't be impossible |
18:05:36 | nrds | <Prestige99> I doubt it's impossible but it probably doesn't exist (yet), and would be a big pain to make |
18:06:07 | Gintru | nrds / Prestige / I won't bother you further, fanx a lot |
18:06:21 | nrds | <Prestige99> any time |
18:06:55 | Gintru | nrds / Prestige I will ask Musk to keep a moon ticket for you |
18:07:15 | Gintru | [or si it Bezos or Virgin |
18:07:44 | Gintru | Bye / OuT O o . |
18:09:57 | * | Gintru slaps /me around a bit with a large trout |
18:10:15 | Gintru | [I yeees I love that |
18:10:39 | * | Gintru quit (Quit: Gintru) |
18:22:28 | * | Onionhammer joined #nim |
18:27:59 | FromDiscord | <Rika> In reply to @Zoom "I'm considering it, but": Zoom chronos is a drop in for async dispatch so there isn’t much of a difference |
18:37:55 | FromDiscord | <enthus1ast> [faix](https://matrix.to/#/@faix:matrix.org)\: 👌 |
19:36:32 | NimEventer | New thread by JohnAD: (2021 November) Most common or active 2D game framework?, see https://forum.nim-lang.org/t/8619 |
19:48:25 | * | Guest22 joined #nim |
19:49:31 | * | Guest22 quit (Client Quit) |
20:40:59 | FromDiscord | <Zoom> Just a program that listens for messages in one protocol, translates them to some other and sends requests. "Basic" just describes the planned complexity level and requirements.↵(@dom96) |
20:44:59 | FromDiscord | <Zoom> I meant there may be some useful libs for the task, which already depend on it. `nim-json-rpc` for example↵(@Rika) |
21:05:55 | FromDiscord | <Rika> Is it a hard dependency |
21:08:03 | * | xet7 joined #nim |
22:16:54 | FromDiscord | <Ricky Spanish> sent a code paste, see https://play.nim-lang.org/#ix=3EUB |
22:31:26 | FromDiscord | <Ricky Spanish> nevermind nim-arg parse seems like the kind of thing i was looking for |
23:57:03 | * | xet7 quit (Quit: Leaving) |