00:00:20 | * | tk quit (Quit: Well, this is unexpected.) |
00:00:44 | * | tk joined #nim |
00:13:11 | * | Pyautogui quit (Quit: Connection closed) |
00:22:13 | FromDiscord | <demotomohiro> If you write a config file that sets `--import` compiler option, you might be able to use modules specified by that option without writing import statement. |
00:22:54 | FromDiscord | <demotomohiro> https://nim-lang.org/docs/nimc.html |
00:32:05 | FromDiscord | <exelotl> sent a code paste, see https://play.nim-lang.org/#ix=3CK0 |
00:33:47 | FromDiscord | <impbox [ftsf]> tbh i always get annoyed when I have to go and add `import std/strformat` but ahh well |
01:08:40 | FromDiscord | <evoalg> "include prelude" <-- exactly what I was after for quick & dirty testing while I'm learning - thank you! |
01:12:13 | nrds | <Prestige99> On 1.4.8 I was able to this: https://play.nim-lang.org/#ix=3CKd but not on 1.6 - It's probably proper now, but is there a way I could get the same behavior without having to cast A to B? |
01:12:49 | FromDiscord | <Elegantbeef> You'll have to cast, since that was a bug it worked |
01:12:56 | nrds | <Prestige99> dang |
01:13:07 | FromDiscord | <Elegantbeef> One second have to see something |
01:16:36 | FromDiscord | <furyusss> sent a code paste, see https://play.nim-lang.org/#ix=3CKf |
01:17:09 | * | neurocyte0132889 quit (Ping timeout: 244 seconds) |
01:22:10 | * | vicecea joined #nim |
01:23:26 | FromDiscord | <KimJongUnstoppable> does anyone know an easy way to get OS version using either the standard library or a package for nim? the best solution I found so far is using wmic but that's both hacky and likely to look suspect lol and even with wmic I have to parse the output which is a PITA |
01:24:50 | FromDiscord | <Elegantbeef> Getting os version is platform specific |
01:25:01 | FromDiscord | <KimJongUnstoppable> I can limit scope to windows for now |
01:25:04 | FromDiscord | <KimJongUnstoppable> if that helps |
01:25:16 | FromDiscord | <KimJongUnstoppable> I don't plan on dealing with macos or linux anytime soon tbh |
01:26:09 | FromDiscord | <Elegantbeef> Well doesnt help me since i dont know how to get version on that OS |
01:26:20 | FromDiscord | <KimJongUnstoppable> LOL |
01:26:27 | FromDiscord | <KimJongUnstoppable> I finally found a question you can't answer |
01:26:38 | nrds | <Prestige99> is there nothing on https://nim-lang.org/docs/os.html about it? |
01:26:41 | FromDiscord | <Elegantbeef> Well i mean i can refer you to stackoverflow |
01:26:43 | FromDiscord | <KimJongUnstoppable> if I figure it out I'll report back and share |
01:27:04 | FromDiscord | <Elegantbeef> uname is the answer on posix 😛 |
01:27:18 | FromDiscord | <Elegantbeef> Sadly prestige i cannot get any of my onesize fit all solutions to work |
01:27:29 | nrds | <Prestige99> ah, all good |
01:27:42 | nrds | <Prestige99> was thinking maybe I could write a macro or something |
01:28:07 | FromDiscord | <Elegantbeef> I mean all you need to do is add one line https://play.nim-lang.org/#ix=3CKj |
01:28:14 | FromDiscord | <Elegantbeef> You can do it in a macro ofc |
01:32:51 | FromDiscord | <evoalg> sent a long message, see https://paste.rs/fwA |
01:33:31 | FromDiscord | <Elegantbeef> You cannot expect the name of a proc/macro to do anything without arguments or parenthesis |
01:33:50 | FromDiscord | <Elegantbeef> `echo` is just the symbol(unless it's a template, they have different semantics) |
01:34:21 | FromDiscord | <evoalg> makes sense, thank you |
01:39:29 | FromDiscord | <Elegantbeef> Prestige here's the macro solution https://play.nim-lang.org/#ix=3CKl |
01:39:47 | FromDiscord | <Elegantbeef> Not great since it injects a proc, but it's a solution |
01:44:33 | FromDiscord | <Professor Actual Factual> sent a code paste, see https://play.nim-lang.org/#ix=3CKp |
01:49:52 | nrds | <Prestige99> Thanks beef :) |
01:51:26 | * | arkurious quit (Quit: Leaving) |
01:52:09 | FromDiscord | <Elegantbeef> no problem |
01:55:57 | FromDiscord | <KimJongUnstoppable> is there a specific way to reference a space as a character constant? I tried '\s' which didn't work and ' ' is treated as void |
01:56:12 | FromDiscord | <impbox [ftsf]> `' '` |
01:56:58 | FromDiscord | <KimJongUnstoppable> sent a long message, see http://ix.io/3CKu |
01:57:08 | FromDiscord | <impbox [ftsf]> `" "` is not the same as `' '` |
01:57:27 | FromDiscord | <impbox [ftsf]> but that's no the reason for that error |
01:57:41 | FromDiscord | <KimJongUnstoppable> Got the same error with single quotes |
01:57:42 | FromDiscord | <impbox [ftsf]> removePrefix doesn't return a string |
01:58:02 | FromDiscord | <KimJongUnstoppable> OH. I need to call it and then echo the variable after |
01:58:03 | FromDiscord | <impbox [ftsf]> where does `removePrefix` come from? |
01:58:14 | FromDiscord | <KimJongUnstoppable> strutils. I just reread the example and I missed that the first time |
01:58:50 | FromDiscord | <impbox [ftsf]> yeah it takes a var string so it mutates the string you pass it but doesn't return a value |
01:58:57 | FromDiscord | <KimJongUnstoppable> sent a long message, see http://ix.io/3CKw |
01:59:25 | FromDiscord | <impbox [ftsf]> `"but expression 'removePrefix(winVersion, " ")' is of type: void"`↵means it doesn't return a value so you can't pass it as an argument |
02:22:40 | * | elph quit (Read error: Connection reset by peer) |
02:24:07 | * | elph joined #nim |
02:34:34 | FromDiscord | <evoalg> I'm just trying to see in what other ways removePrefix can be done (by something else) (so that I can learn) ... if there is only one space in front of the string, this seems to work:↵winVersion = winVersion.strip(trailing=false) |
02:36:26 | FromDiscord | <impbox [ftsf]> winVersion = winVersion[1..^1] |
02:36:40 | FromDiscord | <impbox [ftsf]> if you know the first character will be a space |
02:36:46 | FromDiscord | <Elegantbeef> If there is only one space, though that copies the collection |
02:38:23 | FromDiscord | <Elegantbeef> Which i guess is probably what you want 😀 |
02:38:58 | FromDiscord | <evoalg> In reply to @Elegantbeef "If there is only": Are you saying to if it's possible to do it in-place then it's better because it's faster? ... or more memory efficient? |
02:40:29 | FromDiscord | <evoalg> oh I think I was misunderstanding again |
02:40:57 | FromDiscord | <Elegantbeef> Well doing `[1..^1]` will make a new string, where `removePrefix` will move the the elements by the number of characters that procede the data |
02:41:19 | FromDiscord | <Elegantbeef> So the `removePrefix` doesnt have another allocation |
02:42:37 | * | rockcavera joined #nim |
02:42:37 | * | rockcavera quit (Changing host) |
02:42:37 | * | rockcavera joined #nim |
02:42:46 | FromDiscord | <evoalg> gotcha ok thanks |
02:46:44 | FromDiscord | <evoalg> import re; winVersion = winVersion.replace(re"^ ")↵.... so many ways |
02:48:41 | FromDiscord | <Elegantbeef> Regex is the worst |
02:48:49 | FromDiscord | <Elegantbeef> there is also `strscans` |
02:49:27 | FromDiscord | <evoalg> oh ok! ... re is the worst in terms of speed? readability? |
02:51:46 | FromDiscord | <Elegantbeef> I hate regex 😛 |
02:51:59 | FromDiscord | <Elegantbeef> Mostly just it's generally annoying to read/write and doesnt nicely capture anything |
02:53:39 | nrds | <Prestige99> ACTION loves regex |
02:54:02 | FromDiscord | <impbox [ftsf]> How often are you running this function? |
02:54:28 | FromDiscord | <impbox [ftsf]> If it's less than thousands/millions of times a second, probably don't worry |
02:54:55 | FromDiscord | <impbox [ftsf]> Use whatever's least confusing |
02:55:02 | FromDiscord | <Elegantbeef> Yea there isnt much reason to care, but i just though it'd mention that `[a..b]` is a copy operation, so in performance sensitive areas you'd want to use `toOpenArray` |
02:55:15 | FromDiscord | <Elegantbeef> I'm a terrible person so shun me to my shun corner |
03:02:38 | * | xet7 quit (Remote host closed the connection) |
03:03:50 | * | xet7 joined #nim |
03:54:20 | FromDiscord | <evoalg> sent a long message, see http://ix.io/3CL5 |
03:58:30 | FromDiscord | <Elegantbeef> It probably should error |
03:58:54 | FromDiscord | <Elegantbeef> But eh seems it works "properly" |
04:06:01 | * | supakeen quit (Quit: WeeChat 3.3) |
04:06:31 | * | supakeen joined #nim |
04:12:37 | FromDiscord | <evoalg> echo "foo"[^4] # leads to: Error: unhandled exception: index -1 not in 0 .. 2 [IndexDefect]↵(as expected) |
04:15:53 | FromDiscord | <evoalg> sent a long message, see http://ix.io/3CLb |
04:16:32 | FromDiscord | <Professor Actual Factual> Does anyone know if a library exists in Nim that provides circular static arrays? In other words Arrays (not seq) that kind of behave like deques (but we're not really allocating anything for popping or appending) |
04:17:22 | FromDiscord | <Elegantbeef> A ring buffer? |
04:17:27 | FromDiscord | <Professor Actual Factual> Yes thats the term lol |
04:17:46 | FromDiscord | <Elegantbeef> I think impbox has one for Nico |
04:18:16 | FromDiscord | <Elegantbeef> There is also this ancient impl https://github.com/megawac/RingBuffer.nim |
04:19:18 | FromDiscord | <Professor Actual Factual> Thank you for the help 🙂 |
04:19:51 | FromDiscord | <Elegantbeef> No problem |
04:30:07 | * | rockcavera quit (Remote host closed the connection) |
04:51:16 | NimEventer | New thread by V3ss0n: TechEmpower Benchmarks , see https://forum.nim-lang.org/t/8537 |
04:51:27 | FromDiscord | <Elegantbeef> @impbox [ftsf]\: @geekrelief well i felt good with the present stated of nimscripter(i documented it) so nimscripter 1.0.0! 😀 |
04:51:31 | FromDiscord | <impbox [ftsf]> yeah, i think i stole mine from that one and modified it |
04:51:41 | FromDiscord | <impbox [ftsf]> @ElegantBeef \o/ congrats! |
04:52:12 | FromDiscord | <Elegantbeef> Thanks i cant believe it myself, i could write 1.0.0, my first day of kindergarten paid off! |
04:53:28 | FromDiscord | <Elegantbeef> Though i still need to tend to `exportTo` with types/converters, but for now we'll pretend it doesnt work with them |
04:53:50 | FromDiscord | <geekrelief> @ElegantBeef Looking forward to checking it out tomorrow. |
04:55:19 | FromDiscord | <Elegantbeef> impbox you'll probably like the `safeLoadScriptWithState` as it only changes the interpreter if the code is parsed properly |
04:55:33 | FromDiscord | <impbox [ftsf]> rad! sounds handy |
04:56:12 | FromDiscord | <Elegantbeef> Though one thing i'm thinking about changing is making `nim -> nimscript` involve a hidden variable, to make it less user error prone |
04:56:43 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3CLm |
04:56:54 | FromDiscord | <Elegantbeef> Cause right now they can change that dt to a string and it'll crash and there is no good way of preventing it |
04:58:05 | FromDiscord | <Elegantbeef> It's probably a fine solution given the facts at hand, no clue how you guys feel about it |
04:58:30 | FromDiscord | <impbox [ftsf]> how does the hidden variable help? |
04:58:42 | FromDiscord | <Elegantbeef> It's typed and the users cannot change it |
04:58:58 | FromDiscord | <Elegantbeef> `var update: proc(dt: float32)` would be hidden from the programmer |
04:59:19 | FromDiscord | <Elegantbeef> So when you do `update = proc(dt: string) = discard` the vm doesnt run and you get an error |
04:59:37 | FromDiscord | <Elegantbeef> Right now the VM runs but the compiled code doesnt know it's going to send an invalid type |
05:00:17 | FromDiscord | <Elegantbeef> Cause in your case the compiled code is still sending a float32, but the VM treats it as a string |
05:00:25 | * | Ekho quit (*.net *.split) |
05:00:56 | FromDiscord | <Elegantbeef> So as soon as you use the value the VM crashes, and this is the least awful solution |
05:01:04 | FromDiscord | <impbox [ftsf]> nods i see |
05:01:06 | FromDiscord | <impbox [ftsf]> kinda |
05:01:44 | FromDiscord | <Elegantbeef> The best sounding but most awful to implement is to type check the proc the user is calling. Sounds simple until you remember the types we have are compiled types not compiled runtime types |
05:02:27 | FromDiscord | <Elegantbeef> So to check if a given type matches the type i have to traverse the VM's typedef, and the compiled codes typedef |
05:04:11 | FromDiscord | <Elegantbeef> It's just a side effect of having a static environment and one that can statically change |
05:04:47 | FromDiscord | <Elegantbeef> I also should have checked conversions to/from the VM for catchable errors, but presently do not since it's complicated 😀 |
05:05:24 | FromDiscord | <impbox [ftsf]> sounds like it's good enough to take for a spin, just not trust to life support systems |
05:05:31 | FromDiscord | <impbox [ftsf]> (edit) "sounds like it's good enough to take for a spin, just not ... trust" added "to" |
05:06:23 | FromDiscord | <Elegantbeef> Well if you dont right wrong code "it'll work" 😛 |
05:06:24 | FromDiscord | <Elegantbeef> Well if you dont write wrong code "it'll work" 😛 |
05:10:05 | FromDiscord | <impbox [ftsf]> I would never do such a thing |
05:10:47 | * | Ekho joined #nim |
05:11:01 | FromDiscord | <Elegantbeef> I think it's more like a mostly built ship without escape pods, it'll get you there but if you fuck up you're sincerely fucked |
05:12:59 | FromDiscord | <Elegantbeef> I'm now curious if it's possible to save the global states to a file and reload them after closing the program and reopening |
05:13:29 | FromDiscord | <impbox [ftsf]> assuming all the state is serializable i don't see why not |
05:13:40 | FromDiscord | <Elegantbeef> Well the state uses VM symbols |
05:14:00 | FromDiscord | <Elegantbeef> So it's reliant on the VM's script not changing the symbols around |
05:41:12 | FromDiscord | <unknownusername> Is de morgan law a meme to handle simple if-else statements? |
05:43:38 | FromDiscord | <Elegantbeef> What do you mean by that, briefly skimming it's a simple law |
05:45:22 | FromDiscord | <unknownusername> Yeah but some """"seniors"""" say that if you use else rather than de morgan law you are dumb, which actually I find it dumb |
05:46:52 | FromDiscord | <Elegantbeef> I dont get how `use else` and the laws coincide |
05:47:52 | FromDiscord | <Elegantbeef> Ideally you use the least amount of flow control whilst still having easily to maintain code, so that means using nested ifs when it makes sense |
05:48:51 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3CLA |
05:49:25 | FromDiscord | <xflywind> \ |
06:51:30 | * | PMunch joined #nim |
07:30:55 | * | PMunch quit (Remote host closed the connection) |
07:30:58 | * | mahlon quit (Quit: PotatoTech) |
07:31:17 | * | mahlon joined #nim |
07:37:06 | * | PMunch joined #nim |
07:49:11 | * | pro joined #nim |
08:20:55 | * | mal`` quit (Quit: Leaving) |
08:26:38 | * | mal`` joined #nim |
09:23:49 | * | Vladar joined #nim |
10:44:49 | NimEventer | New thread by Kobi: Code comments please, see https://forum.nim-lang.org/t/8538 |
11:13:50 | FromDiscord | <eyecon> Hello, I'm very new to Nim and I'm currently trying to write a proc that takes an iterator and gives the maximum value yielded by the iterator together with its index, without allocating memory for all return values (throwing away all non-maximum values at each step). I thought this could be an easy task for a template, but I seem to be running into beginner problems. Do we already have something like this I can learn from? |
11:16:17 | FromDiscord | <demotomohiro> An inline iterator is no a thing exists at runtime and you cannot pass it to a proc |
11:17:10 | FromDiscord | <eyecon> So I need a closure iterator, you mean? |
11:17:14 | FromDiscord | <haxscramper> There is no `maxIt` template in the stdlib, but you can check out implementation of the `mapIt` |
11:17:19 | FromDiscord | <demotomohiro> https://nim-lang.org/docs/manual.html#iterators-and-the-for-statement-firstminusclass-iterators↵Yes |
11:17:35 | FromDiscord | <haxscramper> Yes, closure iterator can be passed to procs |
11:17:44 | FromDiscord | <eyecon> In reply to @haxscramper "There is no `maxIt`": Thanks, will do |
11:20:10 | FromDiscord | <eyecon> sent a code paste, see https://play.nim-lang.org/#ix=3CNQ |
11:21:13 | FromDiscord | <haxscramper> `iter: iterator` -\> `iter: iterator(): int {.closure.}` |
11:21:15 | FromDiscord | <eyecon> sent a code paste, see https://play.nim-lang.org/#ix=3CNR |
11:21:17 | FromDiscord | <Rika> `proc maxiter[T](iter: iterator[T]): T =` |
11:21:22 | FromDiscord | <haxscramper> `iterator` is a typeclass |
11:21:23 | FromDiscord | <eyecon> proc will ideally be a template |
11:21:24 | FromDiscord | <Rika> oh yeah |
11:21:25 | FromDiscord | <Rika> iterable |
11:21:26 | FromDiscord | <Rika> not iterator |
11:21:27 | FromDiscord | <Rika> whoops |
11:21:28 | FromDiscord | <haxscramper> `iterator(): int {.closure.}` is a concrete class |
11:21:41 | FromDiscord | <Rika> read what hax said, not mine |
11:22:16 | FromDiscord | <haxscramper> also, `maxValue: int = 0` is a bug, what if max value ever found is -120? |
11:22:22 | FromDiscord | <haxscramper> `maxValue = low(int)` |
11:22:32 | FromDiscord | <haxscramper> or for generic procs `maxValue = low(T)` |
11:22:51 | FromDiscord | <eyecon> In reply to @haxscramper "also, `maxValue: int =": You are right, I oversimplified a bit, originally I tried to use a sentinel value but I can add it later |
11:23:03 | FromDiscord | <eyecon> Or I can use the low() |
11:24:16 | FromDiscord | <eyecon> In reply to @haxscramper "`iter: iterator` -\> `iter:": Which line is this change? Do you mean the `maxiter` definition? |
11:24:33 | FromDiscord | <Rika> yes |
11:25:01 | FromDiscord | <Rika> also remove the `[int]` part there |
11:26:16 | FromDiscord | <eyecon> sent a code paste, see https://play.nim-lang.org/#ix=3CNV |
11:26:35 | FromDiscord | <Rika> at the end you are returning (maxIndex, maxValue) |
11:26:42 | FromDiscord | <Rika> but only specify `): int =` |
11:26:52 | FromDiscord | <eyecon> Ah, right |
11:27:04 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3CNW |
11:27:31 | FromDiscord | <eyecon> Can I use `tuple[int, int]`? |
11:27:34 | FromDiscord | <Rika> yes |
11:27:37 | FromDiscord | <Rika> wait |
11:27:38 | FromDiscord | <Rika> no |
11:27:44 | FromDiscord | <Rika> `tuple[a: int, b: int]` |
11:28:13 | FromDiscord | <Rika> you can change a to index and b to value if you want |
11:28:49 | FromDiscord | <eyecon> sent a code paste, see https://play.nim-lang.org/#ix=3CNX |
11:28:59 | FromDiscord | <Rika> myit is not a closure |
11:29:22 | FromDiscord | <eyecon> In reply to @Rika "myit is not a": Yes |
11:29:24 | FromDiscord | <eyecon> That did it |
11:29:27 | FromDiscord | <eyecon> Thank you! |
11:29:35 | FromDiscord | <Rika> dont forget to read what hax said |
11:30:01 | FromDiscord | <eyecon> I will in a couple hours, I changed so much that I can't see basic errors anymore |
11:30:08 | FromDiscord | <eyecon> And will definitely come back |
11:30:13 | FromDiscord | <eyecon> Thank you both so much |
11:30:21 | FromDiscord | <eyecon> I have to take a break now 🙂 |
12:06:01 | * | supakeen quit (Quit: WeeChat 3.3) |
12:06:31 | * | supakeen joined #nim |
12:23:10 | NimEventer | New question by Jonas Byström: How to assign object to ref, see https://stackoverflow.com/questions/69707966/how-to-assign-object-to-ref |
12:51:18 | NimEventer | New thread by Kobi: Foray into android land with Kivy, and nimpy., see https://forum.nim-lang.org/t/8539 |
13:02:00 | * | kayabaNerve quit (Read error: Connection reset by peer) |
13:02:06 | * | kayabaNerve_ joined #nim |
13:05:20 | NimEventer | New thread by Miran: Nim receives $100k in Bitcoin donations, see https://forum.nim-lang.org/t/8540 |
13:13:52 | PMunch | Damn, that's quite the amount! |
13:17:42 | FromDiscord | <Recruit_main707> I read: nim will receive $150k by march 2022 |
13:18:34 | FromDiscord | <Rika> nim will receive 10k by april 2022 |
13:18:58 | FromDiscord | <Gumber> I don't even remember where I donated my $$$$ to Nim - it wasn't open collective |
13:19:02 | FromDiscord | <Gumber> it wasn't a bitcoin wallet |
13:19:10 | FromDiscord | <Gumber> it was some other donation website that seems to no longer be around / in use? |
13:19:13 | FromDiscord | <forlorn> $100k? Whoa |
13:19:29 | FromDiscord | <Gumber> I think I did like $150/mo for about 1.5 years? |
13:19:31 | FromDiscord | <forlorn> Haven't heard an opensource project getting donations of this scale |
13:19:41 | FromDiscord | <forlorn> (edit) "Haven't heard ... an" added "of" |
13:19:52 | FromDiscord | <Gumber> some open source projects have multimillion/billion dollar companies backing them |
13:19:59 | FromDiscord | <Gumber> (edit) "multimillion/billion" => "multi-million/billion" |
13:20:02 | FromDiscord | <Gumber> $100k is peanuts |
13:20:11 | FromDiscord | <forlorn> Nim doesn't have any of those does it? |
13:20:17 | FromDiscord | <Recruit_main707> Nop |
13:20:23 | FromDiscord | <Gumber> No - it's only received two sizable donations in its history |
13:20:26 | FromDiscord | <Gumber> the status.im grant |
13:20:29 | FromDiscord | <Gumber> and now this bitcoin one |
13:20:39 | FromDiscord | <Gumber> the status.im one was for like ~20k or so I think? |
13:20:46 | FromDiscord | <Rika> i guess it was nice to have delayed cashing out on this since they received it |
13:20:48 | FromDiscord | <forlorn> status.im? |
13:20:48 | FromDiscord | <Gumber> so this is by far the largest |
13:20:51 | FromDiscord | <Gumber> yes status.im |
13:21:05 | FromDiscord | <forlorn> Is that an app that uses Nim? |
13:21:11 | FromDiscord | <haxscramper> status pays 10k per month for nim core devs |
13:21:22 | FromDiscord | <Gumber> Ah okay - didn't realize they had made that official - sweet |
13:21:39 | FromDiscord | <Gumber> they implemented eth 2.0 in Nim I believe |
13:21:47 | FromDiscord | <Gumber> and they use Nim for one of their desktop apps as well |
13:21:57 | FromDiscord | <Gumber> for web apps / mobile apps I think they use clojurescript |
13:22:28 | * | arkurious joined #nim |
13:22:37 | FromDiscord | <Gumber> a few Nim core devs went to work for them |
13:22:57 | FromDiscord | <haxscramper> really?↵(@Gumber) |
13:23:03 | FromDiscord | <Gumber> Zahary |
13:23:09 | FromDiscord | <Gumber> Cheatfate - although he wasn't a core dev |
13:23:20 | FromDiscord | <Recruit_main707> Araq himself? |
13:23:29 | FromDiscord | <Gumber> Araq yeah I think he has done some work for them for sure |
13:23:42 | FromDiscord | <Recruit_main707> Thanks, thats what i thought |
13:23:44 | FromDiscord | <Gumber> there was one or two other people as well I believe |
13:24:00 | FromDiscord | <Gumber> I just can't remember off the top of my head - if you go check out their github org its easy enough to figure out 🙂 |
13:24:08 | FromDiscord | <Recruit_main707> I wanna say kurx but idk |
13:24:13 | FromDiscord | <Gumber> nah krux02 didn't |
13:24:15 | FromDiscord | <Gumber> but arne did |
13:24:30 | FromDiscord | <Gumber> he was one of the original hires though - and was the one that pushed Nim I think |
13:24:43 | FromDiscord | <Recruit_main707> I always say It wrong x) |
13:24:52 | FromDiscord | <Gumber> mratsim |
13:24:59 | FromDiscord | <Gumber> again not a core dev |
13:25:23 | NimEventer | New thread by Kiloneie: Looking for feedback on Nim for Beginners #27 Object Variants, see https://forum.nim-lang.org/t/8541 |
13:25:37 | FromDiscord | <Gumber> maybe it was only zah and araq but I could have sworn there were one or two others - I guess maybe just not core devs 😅 |
13:26:44 | FromDiscord | <forlorn> So what's the constrained type story in Nim?↵I know you can specify numeric ranges as types, which I found very impressive. What else can you do? |
13:26:57 | FromDiscord | <forlorn> Do you have literal types like you do in TypeScript? |
13:27:56 | FromDiscord | <Gumber> we have distinct types but not literal types |
13:28:14 | FromDiscord | <Gumber> and we have first class enums |
13:28:49 | FromDiscord | <Gumber> so you can do like `type myuint32 = distinct uint32` |
13:29:05 | FromDiscord | <forlorn> In reply to @Gumber "and we have first": Are you able to use a subset of existing enum as another type, maybe using any of Nim's static introspection features? |
13:29:17 | FromDiscord | <forlorn> (edit) "In reply to @Gumber "and we have first": Are you able to use a subset of ... existing" added "an" |
13:29:43 | FromDiscord | <haxscramper> Yes, `range[EnumStart .. EnumEnd]` |
13:30:09 | FromDiscord | <haxscramper> This is not a subset, but only a slice |
13:30:28 | FromDiscord | <forlorn> Do you have to use ranges? |
13:30:39 | FromDiscord | <forlorn> Can't you make a non-contiguous subset? |
13:30:53 | FromDiscord | <haxscramper> No, I can't make non-contiguous subset |
13:31:12 | FromDiscord | <forlorn> Aw that's unfortunate |
13:31:18 | FromDiscord | <haxscramper> You can get creative with `[T: static[set[Enum]]` or something like that |
13:31:48 | FromDiscord | <forlorn> So there are workarounds? |
13:32:27 | FromDiscord | <haxscramper> yes, you can implement anything given enough interest |
13:32:37 | FromDiscord | <haxscramper> https://github.com/alaviss/union |
13:32:42 | FromDiscord | <haxscramper> Example of "anything" |
13:32:56 | FromDiscord | <forlorn> Like, does Nim allow you to programmatically access members of an enum (like a list maybe) and return another enum list? |
13:33:02 | FromDiscord | <haxscramper> ts-like `A | B` |
13:33:39 | FromDiscord | <haxscramper> @forlorn) |
13:33:59 | FromDiscord | <haxscramper> you can do `for value in low(Enum) .. high(Enum)` |
13:34:14 | FromDiscord | <haxscramper> or you can `getType` and retrieve full type structure |
13:35:19 | FromDiscord | <haxscramper> what is the end goal here? You can write a macro that takes `enum A, B, C` and then creates you enum with `A, B` that is convertible to/from original one |
13:35:32 | FromDiscord | <haxscramper> Using automatically declared `converter` etc. |
13:35:39 | FromDiscord | <forlorn> In reply to @haxscramper "what is the end": Yes that was what I was looking for |
13:36:21 | FromDiscord | <haxscramper> https://github.com/nim-lang/Nim/blob/devel/lib/std/enumutils.nim#L76-L81 |
13:36:29 | FromDiscord | <haxscramper> get enum names from `typed` |
13:36:42 | FromDiscord | <forlorn> One last question, does Nim have pattern matching to go along with its tuples and distinct types? |
13:37:08 | FromDiscord | <haxscramper> tuples - yes, distinct types - no, but I also don't understand how this might work |
13:37:23 | FromDiscord | <haxscramper> so if latter one makes sense I might be able to implement this |
13:37:50 | FromDiscord | <haxscramper> https://nim-lang.org/blog/2021/03/10/fusion-and-pattern-matching.html |
13:38:00 | FromDiscord | <forlorn> From what I understand distinct types are opaque types/`newtype`'s right? |
13:38:08 | FromDiscord | <haxscramper> right |
13:38:13 | FromDiscord | <forlorn> How are you able to destructure/extract their underlying value? |
13:38:51 | FromDiscord | <haxscramper> for `type Distinct = disctinct Base` I need to do `Base(<Distinct value>)` |
13:38:56 | FromDiscord | <haxscramper> But this conversion is a compile-time |
13:39:06 | FromDiscord | <haxscramper> So I can't really pattern-match against it at runtime |
13:39:14 | FromDiscord | <forlorn> Oh, fair |
13:39:16 | FromDiscord | <haxscramper> Well, I could of course |
13:39:36 | FromDiscord | <haxscramper> But pattern matching checks current "runtime shape" of the object mostly |
13:40:10 | * | rockcavera joined #nim |
13:40:11 | * | rockcavera quit (Changing host) |
13:40:11 | * | rockcavera joined #nim |
13:42:55 | * | Gustavo6046 quit (Read error: Connection reset by peer) |
13:43:23 | FromDiscord | <forlorn> sent a code paste, see https://play.nim-lang.org/#ix=3COK |
13:44:15 | FromDiscord | <haxscramper> We don't do CFA right now |
13:44:18 | FromDiscord | <haxscramper> Control flow analysis |
13:44:41 | FromDiscord | <haxscramper> https://github.com/nim-lang/RFCs/issues/429 |
13:45:04 | FromDiscord | <haxscramper> I don't remember, I think it will compile but fail at runtime at the moment you pass function |
13:45:09 | FromDiscord | <forlorn> Oh alright, so how can you cast an `int` to `Foo`? |
13:45:39 | FromDiscord | <forlorn> In reply to @haxscramper "I don't remember, I": This does not produce a compile error? |
13:45:46 | FromDiscord | <haxscramper> First - this is called conversion, not casting. There is a `cast` and it is different |
13:46:06 | FromDiscord | <haxscramper> Second - `let a: range[1 .. 10] = 20` is a compilation error |
13:46:09 | FromDiscord | <Rika> no it does not, he just said control flow analysis isnt done |
13:46:16 | FromDiscord | <haxscramper> !eval let a\: range[1..30] = 123 |
13:46:18 | NimBot | Compile failed: /usercode/in.nim(1, 9) Error: ':' or '=' expected, but got 'range' |
13:46:31 | FromDiscord | <haxscramper> wath |
13:46:40 | FromDiscord | <haxscramper> killed by a bridge |
13:47:07 | FromDiscord | <Rika> its the discord bridge specifically |
13:47:20 | FromDiscord | <haxscramper> Yes, this does not produce compile-time error because `n`'s value is not known at compile-time, and additional heuristics is not deployed after you check for value ranges↵(@forlorn) |
13:48:21 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3COP |
13:48:28 | FromDiscord | <haxscramper> Points to the `discard f(n)` line |
13:51:56 | FromDiscord | <reilly> How can I get around `Error: illegal capture 's' because ':anonymous' has the calling convention: <cdecl>`? I'm passing a callback proc into an ImGui element, and the type definition requires `{.cdecl.}`. `s` is of type `cstring`. |
13:52:32 | FromDiscord | <haxscramper> you cannot capture external variables in the `{.cdecl.}` procs, so your only option is to declare it as `s {.global.}: ...` |
13:52:52 | FromDiscord | <haxscramper> Alternatively, does your cdecl callback support `void payload` maybe? |
13:53:52 | FromDiscord | <reilly> Just making `s` `{.global.}` does the job. Thanks. |
13:54:14 | FromDiscord | <forlorn> sent a code paste, see https://play.nim-lang.org/#ix=3COR |
13:54:21 | * | SebastianM joined #nim |
13:54:40 | FromDiscord | <Rika> nim needs manpower for the nicer features |
13:54:55 | FromDiscord | <haxscramper> nim needs singular aim for nicer features |
13:55:23 | FromDiscord | <haxscramper> and then people can start working on things, if there were some kind of shared/official vision |
13:55:41 | FromDiscord | <forlorn> There's no official roadmap of some sort? |
13:56:10 | FromDiscord | <haxscramper> I feel like a bad person at these moments |
13:56:12 | FromDiscord | <haxscramper> none that I know of |
13:56:55 | FromDiscord | <Rika> its fine hax |
13:57:12 | FromDiscord | <Rika> nim does need a more aimed vision |
13:57:32 | FromDiscord | <haxscramper> There is a lot of nice features currently in development |
13:57:42 | FromDiscord | <haxscramper> IC, view types, strict functions, somewhat better effect system |
13:57:46 | FromDiscord | <haxscramper> But the problem |
13:57:52 | FromDiscord | <haxscramper> there is a lot of them |
13:58:00 | FromDiscord | <haxscramper> too much for a current dev team IMO |
13:58:03 | FromDiscord | <dom96> In reply to @Gumber "Ah okay - didn't": that 10k per month figure was on the website at some point in the past IIRC |
13:58:29 | FromDiscord | <dom96> it's a pity it was removed |
13:58:35 | FromDiscord | <dom96> we should be more transparent not less |
13:58:49 | FromDiscord | <forlorn> we have an effect system? |
13:58:53 | FromDiscord | <Rika> yes |
13:59:02 | FromDiscord | <Rika> its not that good |
13:59:03 | FromDiscord | <haxscramper> probably not the one you used to though |
13:59:05 | FromDiscord | <Rika> but its there |
13:59:18 | FromDiscord | <haxscramper> it is good, just nobody really figure out what to do with it |
13:59:34 | FromDiscord | <haxscramper> Side effect tracking is good |
13:59:38 | FromDiscord | <Rika> eh isnt it a bit buggy |
13:59:48 | FromDiscord | <Rika> actually i guess everything in general is a bit buggy |
13:59:49 | * | SebastianM quit (Quit: Bye) |
14:00:12 | FromDiscord | <haxscramper> But general effect tagging is not so widely used, in a sense that nobody came up with actuall usage patterns |
14:00:46 | FromDiscord | <haxscramper> But with 1.6 side effect messages finally gotten better |
14:01:14 | FromDiscord | <haxscramper> if you declare code as `func` and have some unwanted side effects it will tell you exactly where are they |
14:01:41 | FromDiscord | <haxscramper> I guess |
14:01:42 | FromDiscord | <haxscramper> so you can have mostly imperative code but still achieve functional purity |
14:06:38 | FromDiscord | <eyecon> sent a code paste, see https://play.nim-lang.org/#ix=3COW |
14:06:53 | FromDiscord | <Rika> `maxValue: int = T.low` this is uhhhhhhh |
14:07:01 | FromDiscord | <haxscramper> low(T) |
14:07:01 | FromDiscord | <Rika> strange |
14:07:11 | FromDiscord | <eyecon> Ah, I forgot the int there |
14:07:16 | FromDiscord | <haxscramper> usually you do `low(T)`, `high(T)`, `default(T)` |
14:07:34 | FromDiscord | <Rika> hax i personally do T.low T.high default(T) |
14:07:38 | FromDiscord | <Rika> its preference |
14:07:45 | FromDiscord | <haxscramper> You can also define `func init(t: typedesc[MyType])` and do `init(MyType)` |
14:07:49 | FromDiscord | <Rika> the issue is more of dont `low` and `high` return T? |
14:07:55 | FromDiscord | <eyecon> But `int` is wrong at any rate, should have been `T` |
14:08:12 | FromDiscord | <Rika> yes pretty much |
14:09:52 | FromDiscord | <alehander42> In reply to @Gumber "he was one of": iirc zahary got arne in, they already had chosen nim before that. zahary and me were on of the first hires, i left quickly after that after deciding i don't want to work on crypto/blockhain |
14:09:58 | NimEventer | New post on r/nim by miran1: Nim receives $100k in Bitcoin donations, see https://reddit.com/r/nim/comments/qfhjrb/nim_receives_100k_in_bitcoin_donations/ |
14:10:03 | FromDiscord | <alehander42> (edit) "on" => "one" | "oneof the first ... hires," added "nim" |
14:10:22 | FromDiscord | <Gumber> In reply to @alehander42 "iirc zahary got arne": ah okay - I didn't realize you were working there too xD |
14:10:30 | FromDiscord | <alehander42> it started with a forum post by them in the nim forum |
14:10:54 | FromDiscord | <alehander42> maybe there was more before that, but that's what i personally know or remember |
14:10:59 | FromDiscord | <Rika> what's wrong with working on crypto? |
14:11:06 | FromDiscord | <haxscramper> oh, they do hire on nim forum sometimes |
14:11:09 | FromDiscord | <alehander42> i hate the blockchain industry |
14:11:36 | * | PMunch quit (Remote host closed the connection) |
14:11:51 | * | casionaut joined #nim |
14:14:27 | FromDiscord | <alehander42> however congrats on the big donation 😄 |
14:17:03 | FromDiscord | <dom96> lol |
14:21:19 | FromDiscord | <Gumber> All I know is that as soon as I hear the words distributed and crypto in the description of any product |
14:21:25 | FromDiscord | <Gumber> my brain immediately shuts off |
14:21:47 | FromDiscord | <Gumber> (edit) "All I know is that as soon as I hear the words distributed and crypto in the description of any product ... " added "/ project" |
14:22:08 | FromDiscord | <Gumber> the person talking to me turns into chef from muppet babies |
14:22:16 | FromDiscord | <Gumber> (edit) "the person talking to me turns into ... chef" added "the" |
14:25:10 | FromDiscord | <dom96> Personally I've always seen the crypto companies as risky, but now I think most crypto companies are likely to stick around for the foreseeable future (at the very least the well established ones, which I think Status is). |
14:25:21 | FromDiscord | <dom96> That said, it would still take a lot for me to work there |
14:25:37 | FromDiscord | <Gumber> I just have zero interest in the problem domain |
14:25:46 | FromDiscord | <Gumber> like negative interest actually |
14:26:49 | FromDiscord | <Gumber> but - it's probably why I'm not rich off crypto yet as well xD |
14:27:57 | FromDiscord | <IsaacPaul> Crypto isn't really sustainable imo. Monero is the only useful one (for illegal transactions). Everything else just burns electricity or some sort of resource. |
14:28:12 | FromDiscord | <IsaacPaul> (edit) "else" => "" |
14:29:23 | FromDiscord | <haxscramper> Need to make cryptocurrency that works on energy of people who hate cryptocurrency |
14:29:27 | FromDiscord | <haxscramper> infinite money |
14:29:36 | FromDiscord | <dom96> ETH is moving to PoS |
14:30:00 | FromDiscord | <dom96> (and I bet there are other cryptos that already do PoS) |
14:30:02 | FromDiscord | <IsaacPaul> I suppose eth is more viable but still a rocky foundation |
14:30:13 | FromDiscord | <Rika> tbh thats the only gripe most people have with crypto, the amount of stress it puts on the environment |
14:34:07 | NimEventer | New post on r/nim by padraig_oh: fusion/matching broken in nim 1.6?, see https://reddit.com/r/nim/comments/qfi1d0/fusionmatching_broken_in_nim_16/ |
14:36:25 | * | pro quit (Ping timeout: 244 seconds) |
14:37:25 | FromDiscord | <haxscramper> oh, fun stuff↵(<@709044657232936960_=4eim=45venter=5b=49=52=43=5d>) |
14:37:34 | FromDiscord | <haxscramper> I need to poke at fusion rotting corpse again |
14:37:36 | FromDiscord | <eyecon> sent a code paste, see https://play.nim-lang.org/#ix=3CP4 |
14:37:44 | FromDiscord | <haxscramper> I wonder who would finally come up and unclog the CI |
14:37:49 | FromDiscord | <eyecon> (edit) "https://play.nim-lang.org/#ix=3CP4" => "https://play.nim-lang.org/#ix=3CP5" |
14:37:53 | FromDiscord | <haxscramper> has been failing for months now on windows |
14:43:27 | FromDiscord | <haxscramper> was fixed for clybber, but because fusion tries but does not really follow semver now person has the wrong version installed↵(<@709044657232936960_=4eim=45venter=5b=49=52=43=5d>) |
14:44:20 | FromDiscord | <Gumber> I'm using `smartptrs` from fusion but I just copied / pasted the implementation into my project |
14:54:45 | FromDiscord | <haxscramper> This looks like a more sustainable solution at this point |
14:54:46 | FromDiscord | <haxscramper> I mean |
14:54:48 | FromDiscord | <haxscramper> july 9 |
14:55:12 | FromDiscord | <haxscramper> I have fixes from three months worth of things, and nobody even bothered to look at it |
14:55:14 | FromDiscord | <haxscramper> fusion can be considered dead |
14:55:28 | FromDiscord | <haxscramper> But hey, 15 new stdlib modules |
14:59:08 | FromDiscord | <Goel> Meanwhile arch official repository of nim still at version `1.4.8-1` 😫 And i don't want to compile from source again or i'll mess up my installation so i'll just wait. At least i flagged that as out of date, so hopefully they will push 1.6 tomorrow or `soon(Tm)` |
14:59:48 | FromDiscord | <enthus1ast> why not use choosenim? |
15:01:09 | FromDiscord | <Goel> Last time i used it i was on Windows and i had problems installing it with MingW, then it worked, then i went using Linux and since then i just rely on official packages from Arch and i never had a problem, just sometimes its a bit slow waiting |
15:02:17 | FromDiscord | <enthus1ast> for both os you just need to have a compiler and the nim bin directory on path |
15:02:55 | FromDiscord | <enthus1ast> when you can type in "gcc" in your shell you normally are good |
15:08:43 | * | casionaut quit (Remote host closed the connection) |
15:39:43 | NimEventer | New thread by Kiloneie: Metaprogramming in Nim #1 Introduction, see https://forum.nim-lang.org/t/8543 |
15:40:24 | NimEventer | New post on r/nim by Kiloneie: Metaprogramming in Nim #1 Introduction, see https://reddit.com/r/nim/comments/qfjg90/metaprogramming_in_nim_1_introduction/ |
15:40:35 | FromDiscord | <Kiloneie> Hey guys, check out my new video 🙂 |
15:45:55 | FromDiscord | <Kiloneie> Can someone retweet it on nim_lang pretty please 😛 ? |
15:50:44 | FromDiscord | <dom96> yay, we're on HN again 🙂 |
15:50:59 | FromDiscord | <dom96> Looks like we need not just Ethereum but also other crypto addresses https://news.ycombinator.com/item?id=28989089 |
15:53:37 | FromDiscord | <pietroppeter> we could set up crypto contributions in open collective (recent feature): it increases number of crypto currencies accepted and solves the problem of managing crypto currencies (you just don't, it translates directly do dollars): https://opencollective.com/opencollective/updates/support-open-source-software-using-crypto |
15:54:47 | nrds | <Prestige99> Wow that's a lot of $$ |
15:58:55 | FromDiscord | <haxscramper> > ↵> Nice, we’ve got $100k! I wonder what we’re going to spend our $88k on? Maybe we should use our $112k to hire somebody to work on the compiler full time? Would $85k be enough for them?↵> |
15:59:03 | FromDiscord | <haxscramper> haha funny |
15:59:55 | FromDiscord | <dom96> In reply to @pietroppeter "we could set up": Doesn't hurt to provide addresses, especially since we've invested in hardware wallets. Opencollective takes a cut afaik and their crypto support is still in beta. Also it's better to not centralise on just one donation platform. |
16:02:03 | FromDiscord | <haxscramper> use github donations as well |
16:02:10 | FromDiscord | <haxscramper> IIRC they are not set up for nim |
16:02:49 | FromDiscord | <pietroppeter> In reply to @dom96 "Doesn't hurt to provide": well, it is yet another option to receive donations and it seems easy enough to set up and forget about it |
16:02:57 | FromDiscord | <dom96> can github donations be set up for orgs or just individuals? |
16:03:07 | FromDiscord | <dom96> afaik github matches these so definitely would be good to set them up |
16:04:11 | FromDiscord | <haxscramper> https://github.blog/2020-05-12-github-sponsors-is-out-of-beta-for-sponsored-organizations/#join-github-sponsors-to-get-funded-as-an-organization |
16:04:19 | FromDiscord | <haxscramper> tldr can donate to org |
16:07:49 | * | neurocyte0132889 joined #nim |
16:07:49 | * | neurocyte0132889 quit (Changing host) |
16:07:49 | * | neurocyte0132889 joined #nim |
16:11:17 | FromDiscord | <dom96> why aren't we doing this lol |
16:13:36 | FromDiscord | <dom96> Here is a proposal: let's use the website repo for these kinds of "operational" tasks: https://github.com/nim-lang/website/issues/313 |
16:30:38 | * | tiorock joined #nim |
16:30:38 | * | tiorock quit (Changing host) |
16:30:38 | * | tiorock joined #nim |
16:30:38 | * | rockcavera quit (Killed (silver.libera.chat (Nickname regained by services))) |
16:30:38 | * | tiorock is now known as rockcavera |
16:40:43 | FromDiscord | <dom96> anddd a mod has killed the HN thread from front page |
16:42:47 | FromDiscord | <dom96> or at least that's what I assume happened |
16:47:27 | FromDiscord | <geekrelief> Besides bisecting, any tips on figuring out what's causing my slow compile times? The difference is an order of magnitude. |
16:48:54 | FromDiscord | <geekrelief> Sometimes I get compilations in a couple seconds and others 16s. I'm creating a C binding which is using generated code from nimterop, so I'm using includes to deal with type dependencies. I wonder if use of includes is causing it. |
17:11:26 | FromDiscord | <dom96> https://media.discordapp.net/attachments/371759389889003532/902242960568107048/Screen_Shot_2021-10-25_at_6.10.48_PM.png |
17:11:45 | nrds | <Prestige99> :o |
17:14:08 | FromDiscord | <Recruit_main707> "we are too smart to talk about your lang or the arguably more important invention since the steam engine" |
17:15:03 | FromDiscord | <Recruit_main707> idc if you think bitcoin is as important as i do, not the place to debate it, nor HN apparently :p |
17:15:57 | FromDiscord | <haxscramper> someone write bitcoin `<thing>` in rust |
17:16:32 | FromDiscord | <haxscramper> `#1` on HN front page, 490 comments all praising how this would help everyone everywhere |
17:19:39 | FromDiscord | <juan_carlos> Lets make a rust backend then 🤪 |
17:20:05 | FromDiscord | <Rika> > infinitely worse |
17:20:06 | FromDiscord | <Rika> LMFAO |
17:20:07 | FromDiscord | <Rika> true |
17:20:16 | FromDiscord | <juan_carlos> Thats actually a good one for april fools... 🤔 |
17:21:12 | FromDiscord | <Recruit_main707> In reply to @juan_carlos "Lets make a rust": smart, that way rust and nim would cancel out |
17:22:00 | FromDiscord | <juan_carlos> I mean eventually someone will do something that emits rust is just about time... |
17:22:24 | * | Gustavo6046 joined #nim |
17:23:57 | FromDiscord | <Recruit_main707> idk, rust's selling point is memory safety, which can be enforced by the nim compiler without emitting rust code |
17:25:00 | FromDiscord | <juan_carlos> It was jk |
17:25:07 | FromDiscord | <Rika> yes but with significant difficulty |
17:25:15 | FromDiscord | <Rika> just like nim could output direct asm |
17:25:31 | FromDiscord | <Recruit_main707> tbh the fact that is isnt needed doesnt mean someone wont do it xD |
17:25:45 | FromDiscord | <geekrelief> In reply to @geekrelief "Sometimes I get compilations": hmm actually it's linking that's taking a long time. |
17:25:53 | FromDiscord | <Rika> someone might do it sure but whats the chance it would become a popular/used backend? |
17:26:17 | FromDiscord | <Recruit_main707> In reply to @Rika "yes but with significant": more difficult than adding a new backend that used correct rust code? |
17:26:51 | FromDiscord | <Rika> i would argue yes |
17:27:37 | FromDiscord | <Rika> if you want the enforced safety over the optimisations nim offers instead... |
17:27:45 | FromDiscord | <Rika> lots of things need implementing |
17:27:50 | FromDiscord | <Rika> okay |
17:28:06 | FromDiscord | <Rika> i see what your point is, but i still think theyre at least equally difficult |
17:29:04 | FromDiscord | <Recruit_main707> lets leave it in a tie then, i have to study :) |
17:54:48 | * | casionaut joined #nim |
17:57:21 | * | vicecea quit (Remote host closed the connection) |
17:57:51 | * | vicecea joined #nim |
18:01:39 | * | boardwalk19 joined #nim |
18:08:16 | FromDiscord | <pietroppeter> In reply to @dom96 "": That’s actually a fair answer to me (the discussion in the thread was not going anywhere), impressed that you were able to get an answer! I was more pissed when the same happened to NimConf2021 post. And maybe they had a good reason for that, but without knowing why, it all seems arbitrary and annoying |
18:13:15 | NimEventer | New post on r/nim by shujidev: How to send a user defined callback to C with less parameters than it expects, see https://reddit.com/r/nim/comments/qfms0o/how_to_send_a_user_defined_callback_to_c_with/ |
18:15:47 | * | casionaut quit (Remote host closed the connection) |
18:19:14 | FromDiscord | <dom96> In reply to @pietroppeter "That’s actually a fair": They are pretty responsive. Next time just email [email protected] |
18:19:30 | FromDiscord | <dom96> They should really be more transparent about this |
18:20:21 | FromDiscord | <dom96> But at least they answer when asked. Could just ignore us completely |
18:31:04 | FromDiscord | <Goel> Why paying @haxscramper $87k a year when he can do it for free :nim1: |
18:36:06 | FromDiscord | <haxscramper> Complain about everything there is for free is my mission |
18:44:49 | FromDiscord | <Recruit_main707> if im wrapping a class, with a constructor that takes certain parameters, and is initialised like this, how am i supposed to replicate this in nim?↵`AClass myClass = new AClass(index, team, name);` |
18:44:59 | FromDiscord | <Recruit_main707> im sorry the question is not that clear |
18:46:16 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3CRc |
18:46:18 | FromDiscord | <Recruit_main707> ah, right, thanks hax |
18:46:33 | FromDiscord | <haxscramper> I think there was some magic to wrap `new` explicitly, but I prefer to just make procs for thsi |
18:46:47 | FromDiscord | <haxscramper> `cnew` because it is also possible to wrap constructor in a way that would construct `ref ACLass` |
18:46:59 | FromDiscord | <haxscramper> using placement new |
19:12:26 | * | Gustavo6046 quit (Quit: ZNC 1.8.2 - https://znc.in) |
19:23:26 | FromDiscord | <demotomohiro> If you need to write C++ code, I think using `new` operator is not safe because you have to call `delete` operator after you used the object.↵Just creating a object on stack like `AClass myClass(index, team, name);` or using smart pointer like `std::unique_ptr` or `std::shared_ptr` is safer. |
19:25:31 | FromDiscord | <haxscramper> best way to deal with this is to use nim memory management |
19:25:46 | FromDiscord | <haxscramper> placement new, etc. |
19:27:08 | FromDiscord | <haxscramper> https://github.com/sinkingsugar/nimline/blob/master/nimline.nim#L151 |
19:27:44 | FromDiscord | <haxscramper> Wrong line, I meant next one |
19:28:01 | Amun-Ra | the comment |
19:30:51 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3CRv |
19:32:33 | * | vicfred joined #nim |
19:38:17 | FromDiscord | <Gumber> sent a code paste, see https://play.nim-lang.org/#ix=3CRy |
19:39:18 | FromDiscord | <Gumber> guess I need to look at the C code... |
19:56:22 | FromDiscord | <Alea> In reply to @Recruit_main707 ""we are too smart": More important than the computers it runs on? 🤔 |
19:59:37 | FromDiscord | <Alea> Actually that's an interesting question↵Can a child invention be more important than its parent invention? |
20:03:12 | FromDiscord | <Recruit_main707> too late to get so phylosophical :P |
21:55:29 | * | icebattle joined #nim |
21:56:27 | NimEventer | New post on r/nim by lattakia: I want to create a nim library that wraps a C library., see https://reddit.com/r/nim/comments/qfrfok/i_want_to_create_a_nim_library_that_wraps_a_c/ |
22:09:06 | * | vicfred quit (Quit: Leaving) |
22:14:25 | FromDiscord | <pietroppeter> There is a 48 hour Nim donation matching drive on HN: https://news.ycombinator.com/item?id=28993476 |
22:17:03 | * | kayabaNerve_ is now known as kayabaNerve |
22:17:52 | * | arkurious quit (Quit: Leaving) |
22:49:37 | * | Vladar quit (Remote host closed the connection) |
22:58:36 | FromDiscord | <dom96> Yep! up to $500 matched (it can be donated anywhere afaik) |
23:03:08 | FromDiscord | <ajusa> Man it just hit me that Nim is somewhat known for being used in crypto and malware - usually not the greatest look |
23:05:07 | NimEventer | New thread by Dom96: Donation matching drive via HN, see https://forum.nim-lang.org/t/8545 |
23:22:42 | * | boardwalk19 left #nim (The Lounge - https://thelounge.chat) |
23:26:37 | FromDiscord | <dom96> In reply to @ajusa "Man it just hit": if that's Nim's niche, I'll take it |
23:28:18 | * | MightyJoe quit (Quit: No Ping reply in 180 seconds.) |
23:29:27 | * | cyraxjoe joined #nim |
23:30:13 | FromDiscord | <aHaquer> that's the spirit |
23:31:52 | FromDiscord | <dom96> I've definitely built some sus tools: https://github.com/dom96/deauther/ 😄 |
23:50:11 | nrds | <Prestige99> Is there a way to bundle assets into an executable or would I need to use something like https://github.com/xmonader/nimassets ? |
23:50:26 | FromDiscord | <Elegantbeef> `staticRead` |
23:51:15 | nrds | <Prestige99> neat, thanks |
23:52:21 | FromDiscord | <Elegantbeef> Use zippy to make a zip then use physfs for the most fun |
23:52:21 | FromDiscord | <Elegantbeef> Up to you ofc |
23:52:21 | FromDiscord | <Elegantbeef> Or use supersnappy |