00:04:29 | * | krux02 quit (Remote host closed the connection) |
00:07:47 | FromDiscord | <Elegantbeef> I keep getting reminded i should make tests for my game 😄 |
00:08:44 | * | sagax quit (Ping timeout: 255 seconds) |
00:20:44 | * | vicfred joined #nim |
00:20:57 | FromDiscord | <huantian> I thought the users just test it for you |
00:21:11 | FromDiscord | <Elegantbeef> Only works if you're AAA |
00:30:32 | FromDiscord | <Luckayla> How easy would you folks consider it for someone to get into contributing to the language directly, i.e assisting with gh issues to fix bugs/improve Nim as a language? |
00:30:58 | FromDiscord | <Elegantbeef> Given i've done it and i'm a fucking idiot, easy if you have time |
00:54:05 | FromDiscord | <Not Saucx> question |
00:54:09 | FromDiscord | <Not Saucx> What is "proc"? |
00:54:26 | FromDiscord | <Not Saucx> im assuming it defines the functions or something? |
00:56:23 | FromDiscord | <!Patitotective> procedures↵because functions dont have side effects but procedures can |
01:09:00 | FromDiscord | <huantian> yeah it's the same as `def` in python or `fn` in rust |
01:31:19 | FromDiscord | <sOkam!> sent a long message, see http://ix.io/3ZSW |
01:31:24 | * | xaltsc quit (Quit: WeeChat 3.5) |
01:33:16 | FromDiscord | <Generic> I think this is only there because originally quake would run with x87 floating point where division by zero generates an exception |
01:33:34 | FromDiscord | <Generic> or can generate an exception |
01:36:23 | * | kayabaNerve quit (Ping timeout: 244 seconds) |
01:36:29 | FromDiscord | <Generic> ok sse seems to be eable to generate exceptions too |
01:36:59 | FromDiscord | <Generic> though I think they're pretty much always disabled |
01:40:24 | FromDiscord | <sOkam!> In reply to @Generic "I think this is": i see, makes sense. tyty |
01:44:34 | FromDiscord | <konsumlamm> (to be clear, division by zero generates a CPU exception, which is different from an exception on the programming language level) |
01:45:12 | FromDiscord | <sOkam!> How can I get which operating system its running the compiler or code? |
01:47:01 | FromDiscord | <sOkam!> (edit) "How can I get which operating system its running the compiler or code?" => "sent a code paste, see https://play.nim-lang.org/#ix=3ZSZ" |
01:48:40 | FromDiscord | <Elegantbeef> `const isLinux = defined(linux)` |
01:49:18 | FromDiscord | <sOkam!> how about the other systems? how can I know what other values are predefined like that one? |
01:49:34 | FromDiscord | <sOkam!> i was looking for it in the manual, but I can't seem to find it |
01:49:42 | FromDiscord | <konsumlamm> i was about to suggest `when defined(linux): true else: false`, thank god you were first beef |
01:50:08 | FromDiscord | <konsumlamm> there doesn't seems to be generic mechanism to detect the OS |
01:50:11 | FromDiscord | <Elegantbeef> They're defines they're not set anything |
01:50:42 | FromDiscord | <sOkam!> what does that mean? |
01:50:50 | FromDiscord | <konsumlamm> `std/distros` provides `detectOs(someCandidate)`, but you'd still have to test every possibility |
01:51:28 | FromDiscord | <konsumlamm> what's your use case though? ideally you'd just do the same on every platform |
01:51:56 | FromDiscord | <sOkam!> porting a preexisting app that has a crap ton of system checks 😔 |
01:52:17 | FromDiscord | <sOkam!> but that's a good point, though |
01:53:22 | * | kayabaNerve joined #nim |
01:54:14 | FromDiscord | <sOkam!> so, if I put some code behind a define, and I don't pass that in the compiler command as an argument, the code would not exist? |
01:55:09 | FromDiscord | <sOkam!> basically trying to understand what `defined(val)` does, and how it's expected to be used |
01:56:05 | FromDiscord | <konsumlamm> `defined(val)` gives you a compile-time value that's `true` if `val` is defined and `false` if it isn't defined |
01:56:30 | FromDiscord | <konsumlamm> if you have a `when defined(val):` block, the code is only compiled when `val` is defiend |
01:56:34 | FromDiscord | <konsumlamm> (edit) "defiend" => "defined" |
01:57:04 | FromDiscord | <sOkam!> ye, but how is the value defined?↵is it possible to use standard variables, or are they expected to be passed as arguments to the compiler? |
01:57:16 | FromDiscord | <Elegantbeef> They're defined in a config |
01:58:59 | FromDiscord | <konsumlamm> that or via the command line (`--define:foo`) |
02:01:38 | * | kayabaNerve quit (Remote host closed the connection) |
02:02:03 | * | kayabaNerve joined #nim |
02:02:38 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
02:09:50 | * | kayabaNerve quit (Ping timeout: 240 seconds) |
02:13:02 | * | kayabaNerve joined #nim |
02:21:10 | * | kayabaNerve quit (Ping timeout: 240 seconds) |
02:22:17 | * | kayabaNerve joined #nim |
02:22:30 | * | kayabaNerve quit (Remote host closed the connection) |
02:47:34 | FromDiscord | <nwilburn> apologies for my confusion here, but shouldn't I be able to pass in a `seq[byte]` to a proc with a signature of `openArray[byte]`? |
02:48:13 | FromDiscord | <huantian> you should |
02:49:02 | FromDiscord | <Elegantbeef> Likely you either are missing a mutable sequence |
02:50:00 | FromDiscord | <nwilburn> am I misreading this? https://media.discordapp.net/attachments/371759389889003532/985012999951622194/unknown.png |
02:50:19 | FromDiscord | <Elegantbeef> Nope you've ran into a "bug" |
02:50:33 | FromDiscord | <Elegantbeef> It's not technically a bug but I consider it one |
02:50:51 | FromDiscord | <Elegantbeef> you can do `mySeq.toOpenArray(0, mySeq.high)` |
02:51:37 | FromDiscord | <nwilburn> yea thats what I've been doing as a workaround but it seemed a bit dirty. What is causing this? |
02:51:45 | FromDiscord | <Elegantbeef> the generic `add` |
02:52:50 | FromDiscord | <Elegantbeef> Nim doesnt convert to generics implicitly so `openArray[byte] | string` doesnt it should be written `proc add[T: byte or char](sha: Sha1, oa: openarray[T]` |
02:54:30 | FromDiscord | <nwilburn> ah interesting. thanks for the info! |
02:55:21 | FromDiscord | <Zectbumo> In reply to @Luckayla "How easy would you": very easy. I just started learning nim weeks ago and I already contributed |
02:55:33 | FromDiscord | <sOkam!> How can I safely convert a nim string into a cstring? |
02:56:00 | FromDiscord | <Zectbumo> is that assuming there an unsafe way? |
02:56:29 | FromDiscord | <huantian> `"string".csting` |
02:56:31 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix= |
02:56:46 | FromDiscord | <huantian> or any other UCFed way |
02:57:55 | FromDiscord | <Zectbumo> sent a code paste, see https://play.nim-lang.org/#ix=3ZT9 |
02:58:39 | * | arkurious quit (Quit: Leaving) |
03:05:29 | FromDiscord | <sOkam!> kk 👌 |
03:14:33 | FromDiscord | <Luckayla> In reply to @Zectbumo "very easy. I just": awesome to hear... I think I will try getting into contribution once I get more familiar with the language. |
03:17:43 | FromDiscord | <Elegantbeef> Both are unsafe 😄↵(@Zectbumo) |
03:19:52 | FromDiscord | <Zectbumo> I think we need to define "unsafe". I took @sOkam! asking about the conversion process. Converting it is safe. Then there is the unsafe handling of this data. |
03:20:19 | FromDiscord | <Zectbumo> or am I wrong in thinking this |
03:20:34 | FromDiscord | <Elegantbeef> Well the unsafe part isnt the conversion |
03:20:39 | FromDiscord | <Elegantbeef> Taking a pointer is always "safe" |
03:31:36 | FromDiscord | <Zectbumo> In reply to @Luckayla "awesome to hear... I": do you want an easy fix? |
03:32:17 | FromDiscord | <Luckayla> At the moment no |
03:32:26 | FromDiscord | <Luckayla> thanks though^^ |
03:33:13 | FromDiscord | <Zectbumo> 😄 okay. I'll fix it but for fun I'm going to throw it out there.↵Find the missing `$`↵https://github.com/nim-lang/Nim/blob/devel/bin/nim-gdb |
03:35:07 | FromDiscord | <Zectbumo> only 25 line file (mostly comments and whitespace) |
03:35:45 | FromDiscord | <Luckayla> line 10 after the OR operator the second uname -s block |
03:35:51 | FromDiscord | <Luckayla> that's not gonna execute :^) |
03:47:24 | FromDiscord | <proton> sent a code paste, see https://paste.rs/q6G |
03:49:08 | FromDiscord | <huantian> don't compile with `-d:release`? |
03:49:42 | FromDiscord | <huantian> you can also do `--stackTrace:on` |
03:53:57 | FromDiscord | <proton> ok, thanks |
03:56:55 | FromDiscord | <sOkam!> Does futhark not support variable resolution inside `importc:` blocks? 🤔 |
03:58:59 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=3ZTf |
04:00:53 | FromDiscord | <sOkam!> (edit) "https://play.nim-lang.org/#ix=3ZTi" => "https://paste.rs/ChE" |
04:09:48 | * | wallabra_ joined #nim |
04:10:42 | * | wallabra quit (Ping timeout: 260 seconds) |
04:10:47 | * | wallabra_ is now known as wallabra |
04:24:33 | FromDiscord | <sOkam!> Also, is there a way to setup search paths for global futhark include folders?↵Its not being able to find many of the `<std.h>` headers _(stddef.h is one of them)_ |
04:29:39 | * | vicecea quit (Remote host closed the connection) |
04:30:10 | * | vicecea joined #nim |
04:30:22 | FromDiscord | <huantian> isn't that what sysPatha nd path are for? |
04:30:35 | FromDiscord | <Elegantbeef> yea syspath is like `-I` |
04:30:50 | FromDiscord | <sOkam!> sent a code paste, see https://paste.rs/Qx2 |
04:31:08 | FromDiscord | <Elegantbeef> You use `sysPath` |
04:32:10 | FromDiscord | <sOkam!> ah. the documentation inside the file is outdated :pepehands: |
04:38:21 | FromDiscord | <sOkam!> `sysPath` wroked. zenks 👌↵↵Having to maintain the syspath folder for each version of the gcc libs sounds kinda silly though, when it could be resolved to the latest version on compile↵Do you know anything about the variable resolution issue inside importc: blocks? |
04:47:22 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=3ZTk |
04:56:55 | FromDiscord | <Luckayla> is it idiomatic in nim to run a short application entirely in a `when isMainModule` block or still use a `proc main` to execute inside of isMainModule? |
04:57:08 | FromDiscord | <Elegantbeef> That's between you and your god |
05:04:23 | FromDiscord | <sOkam!> sent a code paste, see https://paste.rs/8JF |
05:05:14 | FromDiscord | <Elegantbeef> `one, three` |
05:16:19 | FromDiscord | <sOkam!> How does one access the value contained in a `nnkIdent` node?↵Seems like `strVal` is getting the identifier name itself, instead of the content |
05:16:43 | FromDiscord | <Elegantbeef> Idents dont have values |
05:20:13 | FromDiscord | <sOkam!> how do you access the value an identifier points to? |
05:20:46 | FromDiscord | <Elegantbeef> Idents dont point to values |
05:20:54 | FromDiscord | <Elegantbeef> Idents are not semantically checked names |
05:22:12 | FromDiscord | <sOkam!> ok, how do you access the value stored in a variable when that variable is passed to a macro? |
05:22:24 | FromDiscord | <Elegantbeef> take in a `typed` macro |
05:22:35 | FromDiscord | <Elegantbeef> or `static T` |
05:22:35 | FromDiscord | <sOkam!> ? |
05:23:01 | FromDiscord | <Elegantbeef> macros that type untyped AST cannot access anything that AST will point to |
05:23:08 | FromDiscord | <Elegantbeef> Untyped ast is not compiled |
05:23:55 | FromDiscord | <sOkam!> would it be possible to write a macro that resolves into the correct string literals that futhark wants for its importc macro? |
05:24:17 | FromDiscord | <Elegantbeef> It can take strings |
05:24:27 | FromDiscord | <sOkam!> but not variables!! |
05:24:41 | FromDiscord | <sOkam!> i want it to take variables that contain strings, not string literals themselves |
05:24:42 | FromDiscord | <Elegantbeef> Yea it can |
05:24:47 | FromDiscord | <sOkam!> it doesn't |
05:24:56 | FromDiscord | <Elegantbeef> https://github.com/beef331/wasmedge_playground/blob/master/src/wasmedge.nim#L35 |
05:25:01 | FromDiscord | <Elegantbeef> It does too |
05:25:49 | FromDiscord | <sOkam!> In reply to @Elegantbeef "https://github.com/beef331/wasmedge_playground/blob": https://github.com/beef331/wasmedge_playground/blob/df4131603ff69c0371785fe25f85da10c0b83ea5/src/wasmedge.nim#L37 thats a literal |
05:25:59 | FromDiscord | <sOkam!> if i put a variable there, it errors |
05:26:01 | FromDiscord | <Elegantbeef> That's not a literal |
05:26:28 | FromDiscord | <sOkam!> how is l37 not a literal? |
05:26:34 | FromDiscord | <Elegantbeef> Oh your import files, those should be the C import file so yea idk |
05:27:35 | FromDiscord | <sOkam!> is it possible to write a macro that resolves into another macro? |
05:27:45 | FromDiscord | <Elegantbeef> No |
05:28:40 | FromDiscord | <Rika> Kinda but it’s fucky so effectively no |
05:28:47 | FromDiscord | <sOkam!> then back to square1. how do you access the value of a variable that contains a string literal, from within a macro, when passed the variable instead? |
05:29:06 | FromDiscord | <Rika> You cannot if the macro is untyped |
05:29:08 | FromDiscord | <sOkam!> (edit) "instead?" => "instead of the value?" |
05:29:09 | FromDiscord | <Elegantbeef> You cant inside an untype AST |
05:29:48 | FromDiscord | <sOkam!> 😔 |
05:33:38 | * | rockcavera quit (Remote host closed the connection) |
05:34:02 | * | vicfred quit (Quit: Leaving) |
06:14:10 | FromDiscord | <sOkam!> sent a code paste, see https://paste.rs/OWa |
06:15:29 | FromDiscord | <Elegantbeef> `$c` |
06:15:51 | FromDiscord | <sOkam!> so simple 😦 |
06:17:04 | * | kayabaNerve joined #nim |
06:18:23 | FromDiscord | <Elegantbeef> Or you could just do `key.len > 0 and key[0] == c` |
06:18:58 | FromDiscord | <Elegantbeef> Though dont think you can get empty strings |
06:29:25 | * | pro joined #nim |
06:37:43 | * | kenran joined #nim |
06:51:17 | NimEventer | New thread by Cmc: Idea: Marketing Nim to Organizations, see https://forum.nim-lang.org/t/9223 |
07:08:43 | * | pro quit (Ping timeout: 246 seconds) |
07:22:54 | FromDiscord | <ripluke> How can I use regex to check strings in nim? Is there a package |
07:23:35 | FromDiscord | <Yardanico> In reply to @ripluke "How can I use": std/re if you don't mind having to depend on PCRE, or `regex` in Nimble if you need pure-nim |
07:23:36 | * | wallabra quit (Quit: ZNC 1.8.2 - https://znc.in) |
07:23:39 | FromDiscord | <Elegantbeef> there are `nre` and `re` in the stdlib which use pcre and a pure nim version on nimble |
07:23:45 | FromDiscord | <Yardanico> also, in quite a lot of cases you can do stuff without regex |
07:24:03 | FromDiscord | <ripluke> In reply to @Yardanico "std/re if you don't": Ok I'll check it out |
07:24:23 | FromDiscord | <ripluke> In reply to @Yardanico "also, in quite a": That's the way my code is rn, it works but it's needlessly verbose |
07:24:54 | FromDiscord | <Elegantbeef> What's the code? |
07:24:58 | FromDiscord | <Elegantbeef> Regex is the devil imo |
07:25:33 | FromDiscord | <Elegantbeef> Unless you're searching for strings you're using it wrong, is what i generally think |
07:26:37 | FromDiscord | <ripluke> In reply to @Elegantbeef "Unless you're searching for": So basically when I was learning Nim I made a really bad password validator, which im trying to improve with regex |
07:26:54 | FromDiscord | <Yardanico> I think it's much easier to validate with normal Nim code, and it'll be much easier to understand as well |
07:27:02 | FromDiscord | <Elegantbeef> That's exactly what you dont us regex for |
07:27:17 | FromDiscord | <Yardanico> @ripluke do you know what nim sets are? |
07:27:19 | FromDiscord | <Yardanico> the built-in ones |
07:27:25 | FromDiscord | <ripluke> In reply to @Yardanico "<@704106773660827690> do you know": Yea |
07:27:26 | FromDiscord | <Yardanico> and that strutils has a lot of helper procs so you can use them on strings |
07:27:41 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/kdh |
07:28:29 | FromDiscord | <ripluke> sent a code paste, see https://paste.rs/BlI |
07:28:30 | * | kayabaNerve quit (Ping timeout: 276 seconds) |
07:28:46 | FromDiscord | <ripluke> And it also works with numbers? |
07:28:52 | FromDiscord | <Yardanico> numbers are chars |
07:28:54 | FromDiscord | <Yardanico> so of course |
07:29:08 | FromDiscord | <Yardanico> it doesn't work with Unicode chars though, as Nim chars are ASCII ones |
07:29:28 | FromDiscord | <Elegantbeef> its not unicode aware but passwords generally arent |
07:29:55 | FromDiscord | <ripluke> In reply to @Yardanico "it doesn't work with": Yea |
07:30:27 | * | ltriant quit (Ping timeout: 276 seconds) |
07:33:28 | * | kenran quit (Quit: WeeChat info:version) |
08:11:44 | FromDiscord | <demotomohiro> Why random unicode charactors cannot be used for passwords? |
08:12:06 | FromDiscord | <Elegantbeef> Cause unicode is a myth |
08:12:30 | FromDiscord | <Elegantbeef> Joke aside people just want hackable passwords apparently |
08:13:37 | FromDiscord | <Elegantbeef> Some places put some weird restrictions on passwords so it's like they want people to be hacked |
08:14:16 | FromDiscord | <demotomohiro> Is it something like SQL injection? |
08:14:51 | FromDiscord | <Elegantbeef> No remember passwords never should travel in the air as raw text |
08:14:52 | * | noeontheend joined #nim |
08:15:10 | FromDiscord | <Elegantbeef> So whether a password has unicode should not change it's validity that i know of |
08:18:13 | FromDiscord | <Rika> personally i wouldnt validate passwords by "whether it has these characters or not" |
08:18:18 | FromDiscord | <Rika> but by length and dictionary testing |
08:18:51 | FromDiscord | <Elegantbeef> Yea that's the way |
08:19:06 | FromDiscord | <Elegantbeef> Ensure it's not a common password and ensure it's a safe length |
08:19:15 | FromDiscord | <Rika> but also personally if i could i'd enforce webauthn lmao |
08:20:09 | FromDiscord | <Elegantbeef> Yea that's a way |
08:20:35 | FromDiscord | <demotomohiro> That makes sense |
08:21:36 | FromDiscord | <Elegantbeef> I think the reason that passwords are checked for specific characters is to ensure it's capable of being typed on a NA keyboard, but it's just a fucking joke purposely making them less secure |
08:22:15 | FromDiscord | <Elegantbeef> It's much like email in that you dont check if an email is valid with regex 😄 |
08:24:17 | FromDiscord | <Rika> i mean yeah i think unicode on passwords is kinda fucked (what if you're on a different language pc?) but there are other ways to ensure that ig |
08:24:21 | FromDiscord | <Elegantbeef> Hell the only reason length limits make sense is to reduce hash collision |
08:24:43 | FromDiscord | <Elegantbeef> Sure but i mean rika if the user wants it to be their password what's the reason to prevent it 😄 |
08:25:07 | FromDiscord | <Rika> well theres gotta be some minimum level of dumbass protection |
08:25:17 | FromDiscord | <Rika> otherwise you'd be locked out of your account, beef |
08:25:43 | FromDiscord | <Elegantbeef> "We've detected you're about to use characters which may be difficult to type, are you sure you want that password?!" |
08:25:51 | FromDiscord | <Rika> thats a good way |
08:26:02 | FromDiscord | <Elegantbeef> I mean how do you accidently type unicode passwords twice |
08:26:28 | FromDiscord | <Rika> well i mean dumbasses that want a unicode password, not dumbasses that accidentally use unicode |
08:26:36 | FromDiscord | <Rika> <-- im one of them :baqua: |
08:27:12 | FromDiscord | <demotomohiro> People using password manager dont need to care whether charactors in password can be typed. |
08:27:25 | FromDiscord | <Elegantbeef> Tell me about it |
08:27:44 | FromDiscord | <Elegantbeef> I dont even know my passwords |
08:27:56 | FromDiscord | <Elegantbeef> Life is good |
08:28:02 | FromDiscord | <Rika> In reply to @Elegantbeef "I dont even know": me |
08:28:40 | FromDiscord | <Rika> i remember having 72 char extended ascii passwords, i think ive decommissioned them all nowadays |
08:29:53 | FromDiscord | <Elegantbeef> I tend to live by "You can try to make an idiot proof system, but then the universe just makes a smarter idiot" |
08:30:58 | * | jmdaemon quit (Ping timeout: 246 seconds) |
08:35:26 | * | mahlon quit (Ping timeout: 255 seconds) |
08:59:20 | * | ltriant joined #nim |
09:17:45 | * | noeontheend quit (Ping timeout: 256 seconds) |
09:19:27 | * | jjido joined #nim |
10:03:45 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
10:08:30 | FromDiscord | <Phil> If I wanted to bake my software into a docker container... is the correct way to compiled binary into the container or to compile the binary in the container? |
10:08:37 | FromDiscord | <Phil> (edit) "If I wanted to bake my software into a docker container... is the correct way to ... compiled" added "copy the" |
10:11:02 | FromDiscord | <Phil> So far I found the answer to be "yeah compile in container, but have a second image that takes the binary that was compiled to build a second container with all the same dependencies, but now without the source-code to keep it light |
10:11:21 | FromDiscord | <Phil> Mostly wanted to ask what the opinion on here was since I have little experience in setting stuff like this up |
10:11:38 | FromDiscord | <Rika> #offtopic ? |
10:11:47 | FromDiscord | <Rika> is this offtopic |
10:11:49 | FromDiscord | <Rika> i dont know |
10:11:53 | FromDiscord | <Rika> half half? |
10:12:05 | FromDiscord | <Phil> I wasn't sure if that counts since it's about how to handle nim code and its distribution |
10:12:24 | FromDiscord | <Phil> I guess it's not questions about nim specifically though |
10:13:00 | * | krux02 joined #nim |
10:20:18 | * | jjido joined #nim |
10:35:15 | * | def- quit (Quit: -) |
10:35:27 | * | def- joined #nim |
11:18:08 | * | pro joined #nim |
11:23:01 | FromDiscord | <amadan> @Phil think you're looking for this https://docs.docker.com/develop/develop-images/multistage-build/ ?↵Basically you have a build step to build the nim binary which then gets copied into the final image.↵Seems like good idea imo since means both build and running is containerised (Though I've never done this in practice so take my opinion with a grain of salt) |
11:48:46 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
12:03:11 | * | PMunch joined #nim |
12:21:05 | * | krux02 quit (Remote host closed the connection) |
12:30:32 | dv^_^ | is there anything like python's black for nim? |
12:36:18 | FromDiscord | <Yardanico> maybe you can describe what that is? |
12:36:39 | FromDiscord | <Rika> formatter |
12:36:39 | FromDiscord | <Yardanico> ah, code formatter, no, the closest we have is nimpretty, but it's not very stable or finished |
13:02:10 | FromDiscord | <capocasa> sent a code paste, see https://play.nim-lang.org/#ix=3ZU7 |
13:03:43 | FromDiscord | <capocasa> (edit) "https://play.nim-lang.org/#ix=3ZU7" => "https://paste.rs/gvA" |
13:04:01 | FromDiscord | <capocasa> (edit) "https://play.nim-lang.org/#ix=3ZU9" => "https://paste.rs/PRc" |
13:09:19 | * | xaltsc joined #nim |
13:18:24 | * | arkurious joined #nim |
13:21:19 | * | TakinOver joined #nim |
13:25:21 | FromDiscord | <Phil> In reply to @amadan "<@180601887916163073> think you're looking": hmmm nice |
13:35:06 | * | pro quit (Ping timeout: 276 seconds) |
13:35:30 | * | pro joined #nim |
14:07:13 | * | jjido joined #nim |
14:15:25 | FromDiscord | <Yardanico> In reply to @capocasa "Is there any way": You have to use refs instead |
14:15:33 | FromDiscord | <Yardanico> Or FutureVar but I haven't used that myself |
14:16:02 | FromDiscord | <capocasa> In reply to @Yardanico "You have to use": Just found it- thanks! |
14:16:37 | FromDiscord | <capocasa> In reply to @Yardanico "Or FutureVar but I": Cool I'll look into that |
14:19:57 | * | wallabra joined #nim |
14:22:36 | FromDiscord | <capocasa> In reply to @capocasa "Cool I'll look into": Looks like FutureVar lacks the sugar Future has like `await` and `proc {.async.}`. I used it on its own before as a timer, works as expected. So refs it is. |
14:24:04 | * | rockcavera joined #nim |
14:24:05 | * | rockcavera quit (Changing host) |
14:24:05 | * | rockcavera joined #nim |
14:29:06 | * | wallabra quit (Quit: ZNC 1.8.2 - https://znc.in) |
14:29:15 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
14:29:22 | * | wallabra joined #nim |
14:33:59 | * | pro quit (Quit: pro) |
14:49:02 | * | noxnivi joined #nim |
15:01:57 | * | wallabra quit (Quit: ZNC 1.8.2 - https://znc.in) |
15:03:25 | * | wallabra joined #nim |
15:36:55 | NimEventer | New thread by Morturo: Could not load: lua(|5.1|5.0).dll, see https://forum.nim-lang.org/t/9224 |
15:44:39 | * | ehmry quit (Quit: No Ping reply in 180 seconds.) |
15:45:24 | * | ehmry joined #nim |
15:53:45 | * | jjido joined #nim |
15:57:07 | * | lumidify quit (Quit: leaving) |
16:07:51 | * | pro joined #nim |
16:13:48 | * | pro quit (Quit: pro) |
16:14:49 | * | vicecea quit (Remote host closed the connection) |
16:15:20 | * | vicecea joined #nim |
16:23:31 | * | lumidify joined #nim |
16:44:24 | * | noxnivi quit (Quit: Leaving) |
16:52:57 | FromDiscord | <Max [codingreaction]> sent a code paste, see https://play.nim-lang.org/#ix=3ZV4 |
16:53:52 | FromDiscord | <Yardanico> no, templates are just code substitution, you need to use macros for what you want to do |
16:54:03 | FromDiscord | <Yardanico> with macros doing the thing you want is easy, yes |
16:57:18 | FromDiscord | <Max [codingreaction]> In reply to @Yardanico "no, templates are just": roger, thanks Yardanico you saved me a lot of investigation time 🙂 |
17:11:54 | * | pro joined #nim |
17:12:05 | * | pro quit (Client Quit) |
17:17:58 | * | kayabaNerve joined #nim |
17:23:22 | * | kayabaNerve quit (Ping timeout: 250 seconds) |
17:27:29 | * | pro joined #nim |
17:28:04 | * | pro quit (Client Quit) |
17:31:06 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
17:31:20 | FromDiscord | <retkid> https://media.discordapp.net/attachments/371759389889003532/985234791278460938/unknown.png |
17:31:24 | FromDiscord | <retkid> why are we so cursed |
17:31:59 | FromDiscord | <Yardanico> ? |
17:32:26 | FromDiscord | <Yardanico> the author wanted to name his repo this way and he did, I don't see what you mean |
17:32:55 | FromDiscord | <hyperreal> Is there a solution to the openssl problem? i.e. nim using openssl1 instead of 3. I can't run binaries on my Fedora system unless I install openssl1.1-devel, which is suboptimal. Is it possible to get Nim to use the latest openssl? |
17:34:04 | FromDiscord | <Yardanico> In reply to @hyperreal "Is there a solution": there is an open PR |
17:34:12 | FromDiscord | <Yardanico> you can apply it locally, it won't require rebuilding the compiler |
17:35:21 | PMunch | Well this looks like a bug http://ix.io/3ZVg |
17:36:30 | * | pro joined #nim |
17:37:44 | FromDiscord | <hyperreal> In reply to @Yardanico "you can apply it": how do I apply locally? |
17:38:04 | FromDiscord | <Yardanico> the easiest is to just literally edit the code to be the same as in the PR |
17:38:15 | FromDiscord | <Yardanico> https://github.com/nim-lang/Nim/pull/19814 |
17:38:30 | FromDiscord | <Yardanico> you can also try `git apply` with https://patch-diff.githubusercontent.com/raw/nim-lang/Nim/pull/19814.diff |
17:38:35 | FromDiscord | <hyperreal> Ah, thanks! |
17:38:35 | PMunch | treeform, you around? |
17:41:37 | * | jjido joined #nim |
17:47:41 | FromDiscord | <treeform> In reply to @PMunch "<@107140179025735680>, you around?": In spirit |
17:48:14 | PMunch | I was just wondering if you'd want something like this in Chroma: http://ix.io/3ZVj |
17:48:23 | PMunch | Turns a colour temperature into a colour |
17:49:33 | FromDiscord | <treeform> I get error from that page |
17:51:11 | FromDiscord | <treeform> Can temperature be color? I thought every atom had its own spectral lines? |
17:51:40 | FromDiscord | <treeform> Color of iron or hydrogen at some k? |
17:53:36 | FromDiscord | <treeform> Or is it color temperature from photography? |
17:53:55 | FromDiscord | <treeform> I got the page to load |
17:54:02 | PMunch | @treeform, https://en.wikipedia.org/wiki/Color_temperature |
17:54:13 | PMunch | It's the emission colour of a black-body |
17:54:40 | PMunch | It's commonly used for describing warm and cold lightbulbs |
17:55:17 | PMunch | I needed this function (and went to Chroma to find it) because I needed to get a colour temperature as XY coordinates to send to some IKEA smart bulbs to set their temperature |
17:56:39 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
17:56:40 | FromDiscord | <treeform> Sure let's add that into Chroma |
17:57:04 | FromDiscord | <treeform> Just not sure what the api should be |
17:58:09 | PMunch | Well it's basically just temperature -> color |
17:58:31 | FromDiscord | <treeform> Can you do color to temperature? |
17:58:47 | PMunch | Not really |
17:59:07 | FromDiscord | <treeform> Ok |
17:59:13 | PMunch | As you can see from the Wikipedia article I sent you get a line through the XY colour spectrum |
17:59:22 | PMunch | So if the colour lies on that line, sure |
17:59:29 | FromDiscord | <treeform> Make a PR I'll approve |
18:00:01 | PMunch | I guess it would also be possible to calculate a tangent to the line and map colours to that, but notsure how useful that would be |
18:01:24 | PMunch | Where do you want me to put it? |
18:52:47 | * | Guest2637 joined #nim |
18:53:14 | * | Guest2637 left #nim (#nim) |
18:54:48 | FromDiscord | <Max [codingreaction]> In reply to @hyperreal "Is there a solution": omg i'd the same problem on ubuntu yesterday, it was paintfull as fuck but managed to resolve it with a link provided by the OP of the issue in the nimble github project plus some random jump around on stack overflow. Hope you have better luck my pal U_U |
18:55:56 | FromDiscord | <Max [codingreaction]> QUESTION: is StmtList an acronym for "Statements List"? (related to nim macros) |
19:06:21 | FromDiscord | <Phil> Sadly I know too little about macros to be of help here |
19:08:17 | FromDiscord | <Max [codingreaction]> In reply to @Isofruit "Sadly I know too": thanks, np Phil. |
19:10:25 | FromDiscord | <Max [codingreaction]> probably at certain point i may need to check to source code of the dumpTree macro to understand more about the representation that prints, because when you dump a function there are some "Empty" lines that aren't parameters, probably something reserved for generic types or varargs |
19:10:43 | FromDiscord | <Max [codingreaction]> but dunno 🤷 |
19:11:30 | FromDiscord | <Max [codingreaction]> https://media.discordapp.net/attachments/371759389889003532/985260002539347988/unknown.png |
19:12:06 | FromDiscord | <Max [codingreaction]> 🤦♂️ the answer of my first question one page bellow haha, damn anxiety |
19:22:15 | * | pro quit (Quit: pro) |
19:22:35 | * | pro joined #nim |
19:23:25 | * | pro quit (Client Quit) |
19:30:13 | FromDiscord | <hyperreal> In reply to @Yardanico "you can also try": Tried this but some reason I still get SSL error |
19:30:26 | FromDiscord | <Yardanico> when doing what? |
19:30:30 | FromDiscord | <planetis> there are more information in https://nim-lang.github.io/Nim/macros.html#the-ast-in-nim |
19:30:37 | FromDiscord | <Yardanico> if you try to launch nimble, it'll fail, because you have to rebuild it |
19:30:49 | FromDiscord | <Yardanico> because nimble uses nim's standard library SSL stuff |
19:30:58 | FromDiscord | <hyperreal> I cloned the Nim repo, applied the patch, then ran build_all.sh |
19:31:23 | FromDiscord | <Yardanico> yes |
19:31:24 | FromDiscord | <hyperreal> and the nim binary in bin/ still gives the error |
19:31:33 | FromDiscord | <Yardanico> do you mean nimble? |
19:31:40 | FromDiscord | <Yardanico> you still have to specify the older ssl versions to build with it with that PR |
19:31:43 | FromDiscord | <Yardanico> (edit) "versions" => "version" |
19:31:45 | FromDiscord | <Yardanico> via a compile time flag |
19:32:08 | FromDiscord | <Yardanico> `-d:sslVersion=3` |
19:32:08 | * | pro joined #nim |
19:32:09 | FromDiscord | <hyperreal> no, just nim. I want to be able to compile nim programs that use openssl 3 |
19:32:18 | FromDiscord | <Yardanico> nim doesn't matter |
19:32:24 | FromDiscord | <Yardanico> `nim` the compiler doesn't use SSL at all |
19:32:36 | FromDiscord | <Yardanico> do you mean your programs still error? then you need to compile them with `-d:sslVersion=3` flag |
19:32:45 | FromDiscord | <hyperreal> ohh I see, okay thanks |
19:38:46 | FromDiscord | <hyperreal> it still doesn't work for some reason |
19:39:09 | FromDiscord | <hyperreal> I compile my program with `nim c -d:ssl -d:sslVersion=3` |
19:50:14 | FromDiscord | <hyperreal> @Yardanico I'm a bit confused now :/ |
19:50:29 | FromDiscord | <Yardanico> are you sure that `nim` is the Nim you manually compiled? |
19:50:37 | FromDiscord | <Yardanico> and not the one you installed before? |
19:50:43 | FromDiscord | <hyperreal> yes |
19:54:17 | FromDiscord | <hyperreal> sent a long message, see http://ix.io/3ZVI |
19:55:07 | FromDiscord | <Yardanico> hmm, but it's probably still using your normal nim's stdlib distribution? |
19:55:11 | FromDiscord | <Yardanico> not the cloned one |
19:55:19 | FromDiscord | <Yardanico> since you copied the binaries |
19:55:21 | FromDiscord | <Yardanico> only |
19:56:16 | FromDiscord | <hyperreal> oh, no I also copied the lib/ directory to ~/.local/lib |
19:56:36 | * | PMunch quit (Quit: leaving) |
19:58:09 | FromDiscord | <hyperreal> how do I fully install it manually, there doesn't seem to be a makefile or anything. |
19:58:12 | FromDiscord | <hyperreal> ? |
20:02:37 | FromDiscord | <hyperreal> @Yardanico |
20:02:52 | FromDiscord | <Yardanico> sorry, I don't know then |
20:02:57 | * | mahlon joined #nim |
20:06:01 | FromDiscord | <hyperreal> okay, thanks for trying |
20:07:37 | * | noeontheend joined #nim |
20:19:10 | * | noeontheend quit (Ping timeout: 240 seconds) |
20:25:46 | pro | I'm sending some data over raw UDP, I'd like to symetrically encrypt my payload, how should I do it ? |
20:26:29 | pro | regarding serializing my json/payload/encrypting it |
20:28:08 | * | jjido joined #nim |
20:30:03 | FromDiscord | <dom96> @hyperreal you might want to try modifying the files you've patched with something that will definitely cause an error to make sure you are definitely running the right Nim install |
20:35:40 | FromDiscord | <geekrelief> has anyone had any luck with --genscript and vcc? I'm running the .bat file but getting an error like this: `cl : Command line error D8022 : cannot open 'mnimforue@sunreal@snimforue@snimforuebindings.nim.cpp'` for each cpp file. In the nimcache each of the cpp files start with `@`, but cl doesn't pick it up. I tried putting quotes around the file names but that didn't work. |
20:36:03 | FromDiscord | <geekrelief> (edit) "has anyone had any luck with --genscript and vcc? I'm running the .bat file but getting an error like this: `cl : Command line error D8022 : cannot open 'mnimforue@sunreal@snimforue@snimforuebindings.nim.cpp'` for each cpp file. In the nimcache each of the cpp files start with `@`, but cl doesn't pick it up. I tried putting ... quotes" added "double" |
20:38:58 | * | kayabaNerve joined #nim |
20:49:28 | * | noeontheend joined #nim |
20:49:45 | NimEventer | New thread by Cnerd: Karax VNode.add question, see https://forum.nim-lang.org/t/9225 |
21:11:05 | FromDiscord | <hyperreal> In reply to @dom96 "<@263927928595808257> you might want": yeah I mean, I'm sure it's something on my end. Using Fedora's openssl1.1-devel package is fine for now tho |
21:15:46 | FromDiscord | <Ayy Lmao> Does `typeof(foo)` evaluate foo at runtime or compiletime? |
21:16:29 | FromDiscord | <geekrelief> compiletime you can do `var a:typeof(1)` |
21:16:51 | FromDiscord | <Ayy Lmao> In reply to @geekrelief "compiletime you can do": Sweet, thanks! |
21:17:55 | * | pro quit (Quit: pro) |
21:19:25 | FromDiscord | <Rika> Types can’t actually change on run time |
21:19:36 | FromDiscord | <ambient> Nim project was recently on HN, kinda neat. What are some good projects you would recommend for reading and learning good Nim codebase? |
21:19:59 | FromDiscord | <ambient> something a bit more self contained preferable compared to stdlib |
21:25:21 | FromDiscord | <Ayy Lmao> In reply to @ambient "Nim project was recently": Treeform has some good projects. For example https://github.com/treeform/vmath |
21:30:09 | FromDiscord | <guzba> In reply to @Ayy Lmao "Treeform has some good": vmath is a heavy generics lib which might make it have a slight learning curve but there is a talk that can help: https://fosdem.org/2022/schedule/event/nim_metaprogramming/ |
22:08:56 | * | rockcavera quit (Remote host closed the connection) |
22:13:00 | * | rockcavera joined #nim |
22:13:01 | * | rockcavera quit (Changing host) |
22:13:01 | * | rockcavera joined #nim |
22:53:57 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
23:06:55 | FromDiscord | <Zoom> Are there any code samples using `selectors.registerProcess`? I think I'm using it wrong. Getting `Resource temporarily unavailable (code: 11)` on `select()` |
23:14:27 | * | droidrage quit (Ping timeout: 240 seconds) |
23:19:32 | FromDiscord | <Elegantbeef> I've seen pretty much no one use selectors, so how are you using it Zoom? |
23:21:45 | FromDiscord | <Zoom> Just launch a bunch of processes, register them and query `select(-1)` in a loop. I tried to follow disruptek/golden/invoke.nim |
23:22:13 | FromDiscord | <Elegantbeef> Are you sure the processes havent exited by the time you attempt to select on them? |
23:23:25 | FromDiscord | <Elegantbeef> I've never used select really myself just guessing |
23:24:04 | FromDiscord | <Zoom> I'm not, but I'm launching a dummy which sleeps for at least 250ms |
23:33:37 | * | ltriant quit (Ping timeout: 246 seconds) |
23:42:07 | FromDiscord | <dom96> what is your high level goal Zoom? |
23:42:21 | FromDiscord | <dom96> maybe this would be helpful https://github.com/cheatfate/asynctools/blob/master/asynctools/asyncproc.nim |
23:44:10 | FromDiscord | <Zoom> Thanks for the link, but you could probably say one of the high level goals is not using asyncdispatch \:P |
23:44:45 | FromDiscord | <Zoom> Just trying to be minimalistic and understand how selectors work |
23:45:16 | FromDiscord | <dom96> asyncproc should be a good reference then |
23:47:32 | FromDiscord | <dom96> if you don't care about Windows and want more performance then using only selectors is a good strategy, it's how httpbeast does it |
23:49:47 | FromDiscord | <Zoom> BTW, if processes are unsupported on Win, why doesn't doc for registerProcess have the same note as registerSignal?↵(@dom96) |
23:50:33 | FromDiscord | <dom96> dunno |
23:52:11 | ehmry | anyone done real time audio synthesis is Nim? do we have anything for that? |
23:52:48 | * | ltriant joined #nim |
23:55:58 | * | noeontheend quit (Ping timeout: 250 seconds) |