00:02:55 | FromDiscord | <sOkam!> If you have a proc that reads something like `proc doThing(val1:string, val2:bool):string`↵What's the syntax for calling it without brackets?↵I thought it was possible to do `let newThing = doThing "one", true`, but its complaining of wrong indentation at the `,` 🤔 |
00:03:32 | FromDiscord | <Elegantbeef> That is the syntax so i can only reason you're doing something mildly off |
00:03:48 | FromDiscord | <Elegantbeef> You dont have chained command syntax do you? |
00:04:51 | FromDiscord | <sOkam!> dunno what chained command means. does `/` operand from `os` count as another command? https://media.discordapp.net/attachments/371759389889003532/972650248403058688/unknown.png |
00:05:50 | FromDiscord | <Elegantbeef> i dont recall how that's going to bind but yea do md(rlsDir / modVers, true)\` |
00:28:19 | FromDiscord | <ajusa> oh hey beef could nimscripter be used to provide something like hot reloading? |
00:28:52 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=3Xgd |
00:29:01 | FromDiscord | <sOkam!> (edit) "https://play.nim-lang.org/#ix=3Xgd" => "https://play.nim-lang.org/#ix=3Xge" |
00:29:46 | FromDiscord | <sOkam!> (edit) "https://play.nim-lang.org/#ix=3Xge" => "https://play.nim-lang.org/#ix=3Xgf" |
00:30:32 | FromDiscord | <Yardanico> @sOkam! you didn't export it |
00:30:33 | FromDiscord | <Yardanico> 🤷 |
00:30:53 | FromDiscord | <sOkam!> F, how many times do I have to read that to remember it 🙈 |
00:30:59 | FromDiscord | <sOkam!> my god men 😄 |
00:56:24 | FromDiscord | <Elegantbeef> @ajusa\: it could of course 😄 |
00:56:32 | FromDiscord | <Elegantbeef> Have you not seen my snake example? |
00:56:39 | FromDiscord | <ajusa> nope, is it on github? |
00:57:00 | FromDiscord | <Elegantbeef> It's not i've been meaning of making an example on github |
00:57:17 | FromDiscord | <Elegantbeef> https://www.jasonbeetham.com/snake/nicoscripter.html is where it's at if curious |
00:57:37 | FromDiscord | <Elegantbeef> I'm personally investigating using wasm for gameplay scripting of my next project |
00:58:48 | FromDiscord | <Elegantbeef> The benefit of wasm is it allows you a plugin system that is language agnostic and sandboxed |
00:59:29 | FromDiscord | <Elegantbeef> So you can write your code in any wasm compilable language and distribute it safely with user generated content |
01:00:57 | FromDiscord | <Elegantbeef> Ajusa regrets asking |
01:01:24 | * | duuuuuude quit (Ping timeout: 248 seconds) |
01:02:50 | FromDiscord | <ajusa> well uh |
01:03:02 | FromDiscord | <creikey> In reply to @Elegantbeef "The benefit of wasm": kinda curious what does the abi of wasm look like |
01:03:09 | FromDiscord | <creikey> like is there a standard way to "call a function" in wasm |
01:03:33 | FromDiscord | <ajusa> what I was looking to use it for was (slightly) better hot reloading for something like nimja, but I'm not sure if nimscripter would be a good fit for that |
01:03:37 | FromDiscord | <Elegantbeef> `i32, f32 i64, f64, v128, externRef, funcRef, tableRef, memoryRef` |
01:03:46 | FromDiscord | <Elegantbeef> That's all that WASM has |
01:04:12 | FromDiscord | <Elegantbeef> the `ref`s are safe integers that just give you a sort of key to do things on the native side |
01:04:18 | FromDiscord | <Elegantbeef> Atleast as i understand it |
01:04:25 | FromDiscord | <ajusa> (edit) "nimja," => "nimja templates," |
01:04:55 | FromDiscord | <Elegantbeef> Ajusa have you looked at this example? https://github.com/beef331/nimscripter/tree/master/examples/macrorepl |
01:05:12 | FromDiscord | <Elegantbeef> This is it in use https://streamable.com/c6farb |
01:06:52 | FromDiscord | <Elegantbeef> Creikey the way it works from host -\> runtime is you grab the function by name and pass the arguements and get an array of return values back |
01:07:16 | FromDiscord | <Elegantbeef> Runtime -\> Host, the host makes a module adds it to the vm context and then the runtime code just imports it afaik |
01:07:27 | FromDiscord | <Elegantbeef> I'm using wasmedge which is where this happens |
01:07:41 | NimEventer | New Nimble package! tmpnim - Create and remove ramdisks easily, see https://github.com/ment1na/tmpnim |
01:07:59 | FromDiscord | <Elegantbeef> I'm very very chuffed with how simple it is to make primtive modules to run inside wasmedge https://github.com/beef331/wasmedge_playground/blob/master/wasmsources/maths.nim this is all that's required |
01:08:37 | FromDiscord | <Elegantbeef> there is also a config.nims and it requires emcc but i mean that's just nothing |
01:08:48 | FromDiscord | <Elegantbeef> I can put a file in that folder and compile it and get a .wasm out |
01:09:57 | FromDiscord | <Andreas> sent a code paste, see https://play.nim-lang.org/#ix=3Xgk |
01:10:02 | FromDiscord | <Elegantbeef> Dont know if i answered your question crieikey i dont really know much about it as i havent toyed with it much |
01:10:07 | FromDiscord | <Yardanico> In reply to @Andreas "Is it possible to": nope, not possible |
01:10:24 | FromDiscord | <Andreas> In reply to @Yardanico "nope, not possible": thx, |
01:10:32 | FromDiscord | <Yardanico> Andreas asking Nim questions :DD |
01:10:46 | FromDiscord | <Yardanico> glitch in the matrix |
01:10:48 | FromDiscord | <Elegantbeef> You do `Node` and if you want to be certain put a `assert Node.kind == leaf` at the end |
01:11:01 | FromDiscord | <Elegantbeef> Yea the irony hit me aswell 😄 |
01:11:46 | FromDiscord | <Andreas> In reply to @Elegantbeef "You do `Node` and": hey, you macro/template-tigers - what about some magic here > |
01:12:07 | FromDiscord | <Andreas> (edit) ">" => "?" |
01:12:12 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/D5Z |
01:12:28 | FromDiscord | <Yardanico> @Beef i think they want other code to know that this proc returns a specific branch |
01:12:36 | FromDiscord | <Yardanico> @Andreas there's no type narrowing for object variants generally in Nim |
01:12:46 | FromDiscord | <Yardanico> even if you switch through object variant kinds with `case` |
01:12:57 | FromDiscord | <Elegantbeef> I mean you can make macro that is `{.ensureKind: Leaf.}` and annotate the proc, but yea it's just complexity for no reward |
01:13:06 | FromDiscord | <Andreas> @Yardanico you read my mind,, it want to save the pattern-check in the receivinf-proc |
01:13:18 | FromDiscord | <Andreas> (edit) "receivinf-proc" => "receiving-proc" |
01:13:36 | FromDiscord | <Elegantbeef> You could fusion/matching for some pattern matching |
01:13:48 | FromDiscord | <Elegantbeef> There are also ADT-esque macro packages |
01:14:00 | FromDiscord | <Yardanico> In reply to @Elegantbeef "You could fusion/matching for": the updated version is in hmisc |
01:14:01 | FromDiscord | <Yardanico> https://haxscramper.github.io/hmisc/hmisc/macros/matching.html |
01:14:05 | FromDiscord | <Yardanico> since fusion is abandoned |
01:14:37 | FromDiscord | <Andreas> great, i'll stay with the std-lib for now... ty again.. |
01:14:40 | FromDiscord | <Elegantbeef> Nim compatibility is not a concern there |
01:17:33 | FromDiscord | <Yardanico> In reply to @Andreas "great, i'll stay with": btw, just to let you know about the joke above (or for others who might be reading) - Nim's creator is named Andreas Rumpf, so it's a bit ironic to see Andreas asking Nim questions :) |
01:17:50 | FromDiscord | <Elegantbeef> It's as ironic as me not using beef-lang |
01:20:00 | FromDiscord | <Andreas> In reply to @Yardanico "btw, just to let": yeah, but i'm no the teacher here - just to get this straight 😉 If my google-results are correct the Arak is a working-teacher, isn't he ? |
01:20:09 | FromDiscord | <Yardanico> huh, no? |
01:20:19 | FromDiscord | <Yardanico> he works on Nim, "Araq" is just his nickname |
01:20:29 | FromDiscord | <Andreas> (edit) "Arak" => "Araq-Andreas" |
01:20:47 | FromDiscord | <Yardanico> a reference to StarCraft's lore |
01:20:55 | FromDiscord | <Yardanico> (so is "karax" by the way) |
01:21:05 | FromDiscord | <Elegantbeef> Fucking protos |
01:21:24 | FromDiscord | <Yardanico> In reply to @Elegantbeef "Fucking protos": zerg all the way |
01:21:38 | FromDiscord | <Elegantbeef> I only play coop and only really play Mensk/Zeratul |
01:22:11 | FromDiscord | <Elegantbeef> The starcraft and BSG references, but no SG-1 he's literally satan |
01:22:34 | FromDiscord | <Andreas> ic, theres a admirable guy here in germany who is the Dean of a school and works exclusivly with Sandras, Stefanies there - he's the only male at school - and his name is Andreas Rumpf |
01:22:41 | FromDiscord | <Yardanico> heh |
01:22:50 | FromDiscord | <Yardanico> a lot of Andreas Rumpfs in Germany :P |
01:23:06 | FromDiscord | <Andreas> (edit) "Rumpf" => "Rumpf.↵But that might be another guy.." |
01:23:21 | FromDiscord | <Elegantbeef> John Smith is a unique name trust me |
01:23:41 | FromDiscord | <Andreas> Andreas is/was a common name in germany during the 70'ties. Thesedays not so much.. |
01:23:44 | FromDiscord | <Yardanico> sadly araq doesn't have a wikipedia article about him, but at least there's a wikidata entry |
01:23:47 | FromDiscord | <Yardanico> https://www.wikidata.org/wiki/Q60678874 |
01:23:55 | FromDiscord | <Yardanico> "instance of human" lies |
01:24:34 | FromDiscord | <Andreas> yeah, the german Wikipedia has no entry on Nim - the englich has.. strange |
01:24:43 | FromDiscord | <Yardanico> no, I mean about Andreas himself :) |
01:24:49 | FromDiscord | <Andreas> (edit) "englich" => "english" |
01:25:09 | FromDiscord | <Elegantbeef> Software is only written in english |
01:25:19 | FromDiscord | <Elegantbeef> Everything else is a poor substitute of english |
01:27:20 | FromDiscord | <Andreas> you know, evrbd. is so crazy about germany lagging behind in tech-stuff - and there you have a pretty competitive language, i'd say way ahead of zig, more mature than Go, and thats great that it's not from SF thistime.. |
01:27:41 | FromDiscord | <Andreas> (edit) "thistime.." => "this time.." |
01:27:43 | FromDiscord | <Elegantbeef> Except it has the adoption of oberon |
01:27:48 | FromDiscord | <Alea> In reply to @Elegantbeef "Software is only written": So everything is written in prolog :hmm: |
01:28:19 | FromDiscord | <Alea> I might be mixing that up |
01:28:28 | FromDiscord | <Alea> Whatever lang has 'is' keywords |
01:28:35 | FromDiscord | <Elegantbeef> Nim |
01:28:36 | FromDiscord | <Andreas> i'd call it a 'sleeping giant', just be patient |
01:28:53 | FromDiscord | <Yardanico> interesting, contributing to wikidata is really easy |
01:29:12 | FromDiscord | <Yardanico> I made it so that Nim entry is also an instance of "free software" (it weren't for some reason) |
01:29:29 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "Everything else is a": yea https://github.com/UltiRequiem/rustico |
01:53:13 | FromDiscord | <konsumlamm> In reply to @Andreas "you know, evrbd. is": "more mature than Go" is a huge overstatement imo |
01:56:33 | FromDiscord | <Andreas> In reply to @konsumlamm ""more mature than Go"": ok, how about more elegant :] |
01:57:01 | FromDiscord | <Andreas> (edit) "In reply to @konsumlamm ""more mature than Go"": ok, how about more elegant :] ... " added ", but less hip" |
01:58:11 | FromDiscord | <konsumlamm> sure |
01:58:34 | FromDiscord | <Elegantbeef> I'd also argue it's better designed but the bar is low in mo 😄 |
01:58:46 | FromDiscord | <konsumlamm> but maturity and elegance are completely unrelated |
01:58:50 | FromDiscord | <Elegantbeef> "in my opinion" is probably more sany to write brain 😄 |
02:03:08 | FromDiscord | <Andreas> there are 'advanced-concepts', e.g. did u guys know that CoffeeScript had hygienic-macros in a earlier version ? And then there are 'well done advanced concepts'=mature & reliable. The hygienic-macros did not make it, cos the CS-creator did not like it.. Looking at Scala, hmm very advanced-stuff and well-done, too. But these days they'll reduce features, subtract them from the language, because, hmm. too complicated for the users ? maybe, |
02:04:14 | FromDiscord | <Andreas> (edit) "there are 'advanced-concepts', e.g. did u guys know that CoffeeScript had hygienic-macros in a earlier version ? And then there are 'well done advanced concepts'=mature & reliable. The hygienic-macros did not make it, cos the ... CS-creator" added "Jeremy," |
02:18:22 | FromDiscord | <Bubblie> sent a code paste, see https://play.nim-lang.org/#ix=3Xgt |
02:18:35 | FromDiscord | <Elegantbeef> you can use a foraward declaration |
02:18:37 | FromDiscord | <Yardanico> you need to forward declare a procedure |
02:18:57 | FromDiscord | <Yardanico> sent a code paste, see https://paste.rs/eFV |
02:19:15 | FromDiscord | <Yardanico> a forward declaration should basically be just the signature of the proc without the body |
02:19:26 | FromDiscord | <Yardanico> with all the types/export symbol/etc being the same as the actual implementation that is defined later |
02:19:31 | FromDiscord | <Bubblie> oh, that is a bit odd this is the first time ive seen something like this |
02:19:48 | FromDiscord | <Elegantbeef> Well top to bottom compiler issue 😄 |
02:19:58 | FromDiscord | <Bubblie> ah, I see |
02:20:41 | FromDiscord | <Elegantbeef> Order independent compilation is a goal eventually |
02:20:58 | FromDiscord | <Bubblie> is it planned for the big nim update thats happening, forgot the number |
02:21:17 | FromDiscord | <Elegantbeef> v2 |
02:21:31 | FromDiscord | <Bubblie> yeah |
02:21:44 | FromDiscord | <Elegantbeef> I think it's a desire but dont think it's a hard goal |
02:22:55 | FromDiscord | <Bubblie> ah okay, I hope it does happen at some point then |
02:23:22 | FromDiscord | <Elegantbeef> That and cyclical dependancies are both desired |
02:33:42 | * | Gustavo6046 quit (Quit: ZNC 1.8.2 - https://znc.in) |
02:45:02 | * | Gustavo6046 joined #nim |
02:53:43 | * | arkurious quit (Quit: Leaving) |
03:23:15 | FromDiscord | <Elegantbeef> Araq is zerg leader |
03:23:33 | FromDiscord | <Mike> Oh thank god |
03:23:42 | FromDiscord | <Yardanico> In reply to @Elegantbeef "Araq is zerg leader": one of |
03:23:57 | FromDiscord | <Yardanico> "Araq was the cerebrate of the Jormungand Brood.[1]" |
03:23:58 | FromDiscord | <Elegantbeef> or 'a' 😄 |
03:24:20 | FromDiscord | <Mike> My SC1 lore is fuzzy. I just play PvP SC2 all the time |
03:24:36 | FromDiscord | <Yardanico> i added even more stuff to the nim wikidata entry for no reason :P |
03:24:52 | FromDiscord | <Yardanico> i think it's quite complete now, more complete than most other proglangs (if we exclude all the different DB IDs) |
03:25:19 | FromDiscord | <Elegantbeef> Yard you have the weirdest hobby 😄 |
03:25:27 | FromDiscord | <Elegantbeef> "Oh here is a random thing to toy around with for a few hours" |
03:25:30 | FromDiscord | <Yardanico> yes |
03:25:35 | FromDiscord | <Yardanico> is that weird? i think it's normal |
03:26:58 | FromDiscord | <Yardanico> i'm just preparing for the future where skynet takes over the world - they'll use wikidata as their source of truth, so I'm just making sure Nim is properly represented |
03:35:12 | * | noeontheend quit (Ping timeout: 276 seconds) |
03:47:14 | FromDiscord | <Bubblie> sent a code paste, see https://paste.rs/Hgu |
03:47:56 | FromDiscord | <Yardanico> In reply to @Bubblie "okay so for glfwExtensions": you do `getRequiredInstanceExtensions(addr glfwExtensionCount)` |
03:48:02 | FromDiscord | <Bubblie> thanks! |
03:49:39 | FromDiscord | <Bubblie> huh it's still not working wtf |
03:49:53 | FromDiscord | <Elegantbeef> If compilers could speak they'd say the issue |
03:50:52 | FromDiscord | <Bubblie> got it nvm it was me being an absolute idiot |
04:22:08 | * | slowButPresent quit (Quit: leaving) |
04:25:03 | * | Gustavo6046 quit (Quit: ZNC 1.8.2 - https://znc.in - Stopping for maintenance... Leave messages at my XMPP ([email protected]), or my Discord (Gustavo6046#9009), or possibly my Mastodon [email protected]), or email ([email protected]).) |
04:31:12 | FromDiscord | <Bubblie> how do I use a null pointer in nim like null pointers in c |
04:33:25 | * | Gustavo6046 joined #nim |
04:35:57 | FromDiscord | <Bubblie> what does nim have instead for this |
04:39:04 | FromDiscord | <Yardanico> `nil` |
04:43:12 | FromDiscord | <Bubblie> oh its just nil? god I feel like an idiot |
06:18:49 | * | duuuuuude joined #nim |
06:49:15 | * | jmdaemon quit (Ping timeout: 260 seconds) |
06:55:48 | * | kenran joined #nim |
07:41:19 | * | Zectbumo joined #nim |
08:35:35 | * | jjido joined #nim |
08:38:45 | om3ga | Hello! Error: invalid command line option: '--gcc' - --gcc.exe:musl-gcc..... - static compilation no longer works? |
08:45:28 | FromDiscord | <Elegantbeef> om3ga are you sure you have a modern Nim version? |
08:45:51 | FromDiscord | <Elegantbeef> And are you properly calling the compiler |
08:46:11 | om3ga | Elegantbeef: Nim Compiler Version 1.6.2 |
08:46:19 | om3ga | not too old I think |
08:46:56 | om3ga | I used nim.cfg for specifying options. Previously it worked as I remember |
08:51:06 | FromDiscord | <Elegantbeef> Based off the shipped `nim.cfg` i dont know if you can just do `gcc.exe =` |
08:54:18 | om3ga | Elegantbeef, the same error I get by executing using command line: nim --gcc.exe:"musl-gcc" --gcc.linkerexe:"musl-gcc" --passL:-static -d:release c ...... |
08:54:41 | om3ga | with quotes or not, it throws the same err |
08:55:03 | FromDiscord | <Elegantbeef> Yea the issue is that you cannot do `gcc.exe` it's not specific enough i think |
08:55:45 | FromDiscord | <Elegantbeef> you have to do `amd64.linux.gcc.exe` or `arm.linux.gcc.exe` i think |
08:56:10 | om3ga | but that is for cross compilation if I not mistaken |
08:56:29 | om3ga | by providing full path to the compiler I get that: Error: unknown C compiler: 'musl'. Available options are: gcc, switch_gcc, llvm_gcc, clang, bcc, vcc, tcc, env, icl, icc, clang_cl |
08:57:08 | FromDiscord | <Elegantbeef> Looks like i'm wrong |
08:57:52 | FromDiscord | <Elegantbeef> inside a `config.nims` `--gcc.exe:musl-gcc` works |
08:58:13 | om3ga | yeah, I remember it worked before |
08:58:24 | om3ga | strange... |
08:59:53 | FromDiscord | <Elegantbeef> All i can say is i get a successful compile with `--gcc.exe:"musl-gcc"` inside a `config.nims` so i suggest using that instead |
09:00:31 | FromDiscord | <Elegantbeef> Actually i dont know if it's properly using musl 😄 |
09:00:53 | om3ga | hmm, let me try.. just a moment... |
09:03:16 | FromDiscord | <Elegantbeef> Ah yes it works |
09:03:21 | om3ga | Elegantbeef, thanks! it works |
09:03:37 | om3ga | is that new thing? should I avoid using nim.cfg? |
09:03:38 | FromDiscord | <Elegantbeef> Lol i make good time apparently 😄 |
09:03:54 | FromDiscord | <Elegantbeef> It's not that new but yea nimscript is preferred |
09:04:15 | om3ga | awesome, without your help I would spend a lot time by finding that |
09:04:19 | om3ga | thanks a lot! |
09:04:41 | FromDiscord | <Elegantbeef> That's what i do, say 1000 wrong things before 1 right one |
09:05:34 | om3ga | we all do that :) |
09:10:11 | * | lumo_e joined #nim |
09:26:06 | * | Zectbumo quit (Remote host closed the connection) |
09:38:11 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
10:08:59 | * | smvg joined #nim |
10:28:49 | * | smvg quit (Changing host) |
10:28:49 | * | smvg joined #nim |
10:30:28 | * | xet7 quit (Ping timeout: 248 seconds) |
10:44:09 | * | jjido joined #nim |
10:45:07 | FromDiscord | <deadmeme77> In reply to @deadmeme77 "someone already reported it": if anyone is interested, I managed to solve this issue (same issue occured with r-studio) by doing this:↵`wget http://nz2.archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1l-1ubuntu1.3_amd64.deb↵↵sudo dpkg -i libssl1.1_1.1.1l-1ubuntu1.3_amd64.deb` |
11:05:12 | * | pch quit (Quit: Leaving) |
11:16:17 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
11:17:11 | * | vicecea quit (Remote host closed the connection) |
11:17:42 | * | vicecea joined #nim |
11:18:02 | * | smvg quit (Quit: smvg) |
11:19:00 | * | smvg joined #nim |
11:59:15 | * | PMunch joined #nim |
12:01:00 | * | slowButPresent joined #nim |
12:03:27 | FromDiscord | <d4rckh> is there any quick and easy way of converting a sequence of tuples to a json node using std/json? |
12:03:34 | FromDiscord | <d4rckh> (edit) "is there any quick and easy way of converting a sequence of tuples to a json node ... using" added "array" |
12:04:13 | FromDiscord | <enthus1ast> does %\ work? |
12:04:27 | FromDiscord | <enthus1ast> var myJs = %\ yourSeq |
12:04:30 | FromDiscord | <d4rckh> nope |
12:04:42 | FromDiscord | <d4rckh> thats what i tried |
12:05:05 | FromDiscord | <enthus1ast> what does it say? |
12:05:49 | FromDiscord | <d4rckh> https://www.toptal.com/developers/hastebin/ihuxovirov.go |
12:07:28 | FromDiscord | <d4rckh> (put in a hastebin so i dont spam the chat) |
12:13:31 | FromDiscord | <Yardanico> In reply to @d4rckh "is there any quick": don't think so, however you can easily do it with a loop |
12:14:07 | FromDiscord | <Rika> Why not? I feel like it should have worked normally |
12:14:16 | FromDiscord | <Yardanico> In reply to @Rika "Why not? I feel": because it's just not there? |
12:14:17 | FromDiscord | <amadan> Seems it's a known issue https://github.com/nim-lang/Nim/issues/12290↵Using `toJson` from `std/jsonutils` would also work |
12:14:41 | FromDiscord | <Yardanico> In reply to @amadan "Seems it's a known": oh yeah i wanted to try jsonutils, nice that it works there |
12:14:55 | FromDiscord | <d4rckh> yup, did it thanks |
12:14:56 | FromDiscord | <Yardanico> sent a code paste, see https://paste.rs/R3j |
12:15:12 | FromDiscord | <Yardanico> and btw, you generally don't have to post the long part of that error message where it just lists all possible proc overloads |
12:15:29 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3XhJ |
12:15:38 | FromDiscord | <d4rckh> good to know |
12:20:31 | * | smvg quit (Quit: smvg) |
12:57:46 | * | smvg joined #nim |
13:40:53 | * | smvg quit (Quit: smvg) |
14:17:23 | * | arkurious joined #nim |
15:34:00 | * | jjido joined #nim |
15:44:40 | * | lumo_e quit (Remote host closed the connection) |
15:53:27 | FromDiscord | <d4rckh> why does here markAsComplete run before the case finished? https://media.discordapp.net/attachments/371759389889003532/972888974139994122/unknown.png |
15:53:52 | FromDiscord | <d4rckh> markAsComplete just completes a future |
15:53:52 | FromDiscord | <Yardanico> how do you know that "before teh case finished"? |
15:54:00 | FromDiscord | <d4rckh> good question |
15:54:02 | FromDiscord | <d4rckh> well |
15:54:04 | FromDiscord | <Yardanico> (edit) "teh" => "the" |
15:54:20 | FromDiscord | <Yardanico> this really can't be true, try adding more `echo`s around to see what's actually going on |
15:54:28 | FromDiscord | <d4rckh> i think i found the problem |
15:54:32 | FromDiscord | <Rika> congrats |
16:00:08 | FromDiscord | <d4rckh> i cant write `"\t"` using styledWrite? |
16:00:11 | FromDiscord | <d4rckh> (edit) "write" => "print" |
16:01:11 | FromDiscord | <d4rckh> ah, nvm |
16:04:18 | FromDiscord | <sOkam!> Total newb Q: ↵How does one convert a seq to a string containing a comma separated list of each element of the seq?↵So, going from `@["one", "two", "three"]` to `"one, two, three` |
16:04:40 | FromDiscord | <d4rckh> mySeq.join(", ") |
16:04:42 | FromDiscord | <Rika> join in strutils |
16:05:03 | FromDiscord | <sOkam!> oh join can take a separator input, tyty |
16:05:14 | FromDiscord | <sOkam!> does join include a whitespace between values by default? |
16:05:19 | FromDiscord | <Yardanico> no |
16:05:22 | FromDiscord | <Yardanico> you just add a space to the string |
16:08:34 | FromDiscord | <!Patitotective> is elegant the surname or beef? 🤔 |
16:09:32 | FromDiscord | <Rika> what? |
16:10:41 | FromDiscord | <!Patitotective> what surname do you want? rika https://media.discordapp.net/attachments/371759389889003532/972893309326487602/unknown.png |
16:10:50 | * | lumo_e joined #nim |
16:12:30 | FromDiscord | <Rika> idk nanakusa? |
16:17:32 | FromDiscord | <hmmm> its rika-sama |
16:19:05 | FromDiscord | <Rika> ok |
16:21:52 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=3XiS |
16:23:32 | FromDiscord | <Yardanico> In reply to @sOkam! "How would you filter": `in` checks if `a` is in b |
16:23:41 | FromDiscord | <Yardanico> you're checking if your filename is in the ".so" string, you need to do the reverse |
16:23:44 | FromDiscord | <Yardanico> `".so" in it` |
16:24:36 | FromDiscord | <sOkam!> 👌 |
16:27:28 | * | smvg joined #nim |
16:34:07 | * | duuuuuude quit (Ping timeout: 246 seconds) |
16:47:11 | * | duuuuuude joined #nim |
16:51:04 | FromDiscord | <huantian> I would probably use str.endsWith() personally |
16:51:04 | FromDiscord | <d4rckh> id actually only check if the last 3 characters are equal to ".20" |
16:51:05 | FromDiscord | <d4rckh> (edit) "".20"" => "".so"" |
16:51:13 | FromDiscord | <d4rckh> or endsWith |
16:54:01 | FromDiscord | <huantian> Though with .so there could be version numbers after the .so part |
17:14:23 | Amun-Ra | there should be .so symlink in that case somewhere |
17:17:22 | FromDiscord | <huantian> That’s true, ig it just depends on what they’re trying to do with this |
17:23:00 | FromDiscord | <Rika> usually there are symlinks that "reduce a level of its version" |
17:23:20 | FromDiscord | <Rika> that is, 5.5.5.so -> 5.5.so -> 5.so -> .so if its the latest ver |
17:23:42 | FromDiscord | <Rika> though actually omit the 5.so if semantic ver. |
17:39:32 | FromDiscord | <d4rckh> is there any way to make running programs using execCmdEx not block the program? (without using threads) |
17:39:56 | FromDiscord | <huantian> I think it’s startProcess? |
17:40:17 | FromDiscord | <d4rckh> yes `execCmdEx` uses startProcess |
17:40:19 | FromDiscord | <sOkam!> In this case, its just three files that are known to end in .so, with a preset name that is always output the same way. No variance, or potential `filething.solarium.exe` kind of stuff happening |
17:46:17 | NimEventer | New post on r/nim by CanMyPro: Redirect input/output using startProcess, see https://reddit.com/r/nim/comments/ul7117/redirect_inputoutput_using_startprocess/ |
17:51:43 | FromDiscord | <sOkam!> Is there an alternative way to mark procs as "don't use this externally", other than using `_theProc`? |
17:52:31 | FromDiscord | <sOkam!> I know procs that are not exported are not known externally, its more as a note to future self reading it |
17:56:06 | FromDiscord | <Rika> put internal in the name? |
17:56:26 | FromDiscord | <Rika> make a dummy pragma `{.pragma internal.}` then annotate the procs with it |
17:56:57 | FromDiscord | <Rika> sorry, `{.pragma: internal.}` |
17:57:22 | FromDiscord | <sOkam!> does that prevent procs with the same name to be considered equal and raise an error? |
17:57:31 | FromDiscord | <Rika> no |
17:57:34 | FromDiscord | <Rika> wait |
17:57:44 | FromDiscord | <Rika> what do you meant |
17:57:45 | FromDiscord | <Rika> (edit) "meant" => "mean" |
17:57:50 | FromDiscord | <Rika> im not sure |
17:58:39 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=3Xj9 |
17:58:47 | * | duuuuuude quit (Ping timeout: 240 seconds) |
17:59:02 | FromDiscord | <sOkam!> (edit) "https://play.nim-lang.org/#ix=3Xj9" => "https://play.nim-lang.org/#ix=3Xja" |
17:59:07 | FromDiscord | <Rika> no, names must be different |
17:59:19 | FromDiscord | <Rika> btw leading/trailing underscores are disallowed |
17:59:31 | FromDiscord | <Rika> consecutive underscores as well |
17:59:56 | FromDiscord | <sOkam!> oh 😦 |
18:00:42 | FromDiscord | <Rika> if you really want to avoid renaming, separate them by module i believe would work? i dont recall too well |
18:01:03 | FromDiscord | <sOkam!> i guess ill stick with renaming |
18:07:31 | * | duuuuuude joined #nim |
18:08:29 | FromDiscord | <sOkam!> How would you safely split a string, that contains a space separated list of files, into a sequence containing each file? |
18:09:11 | FromDiscord | <sOkam!> Worried about folders or filenames with spaces getting in the way, else I would just use `split(" ")`... but dunno if there is a better way |
18:12:09 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
18:12:38 | FromDiscord | <Yardanico> In reply to @sOkam! "Worried about folders or": but then how do you distinguish between a file with a space or a new entry? |
18:12:46 | FromDiscord | <Yardanico> then you should quote file paths or something |
18:13:00 | FromDiscord | <Yardanico> In reply to @sOkam! "How would you filter": and if you get it from here, then you can just add that quoting right there |
18:13:48 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3Xjd |
18:13:50 | FromDiscord | <sOkam!> ah no, this is something difference |
18:13:59 | FromDiscord | <sOkam!> (edit) "difference" => "different" |
18:14:22 | FromDiscord | <sOkam!> this is tied to the zip command, that takes a space separated list of files |
18:15:13 | FromDiscord | <sOkam!> basically trying to create a replacement for the usual bash scripting stuff that I was using, so that I can stop using bash at all where possible (which is gonna be like 99% of my usecases) |
18:17:48 | FromDiscord | <sOkam!> In reply to @Yardanico "but then how do": how would you separate the files into a sequence, when they are using quotes? just doing `split("" "")`? or how do you signal a double quote inside a string? |
18:18:16 | FromDiscord | <Yardanico> well it really depends, what if the file also has " in the name? |
18:18:29 | FromDiscord | <Yardanico> where do you get this string anyway? |
18:18:49 | FromDiscord | <sOkam!> can they? i thought quotes were not allowed in filenames |
18:19:56 | FromDiscord | <Yardanico> In reply to @sOkam! "can they? i thought": they are |
18:20:10 | FromDiscord | <Yardanico> not on windows, but on linux |
18:20:23 | FromDiscord | <sOkam!> i see |
18:21:03 | FromDiscord | <sOkam!> I think I will stick to spaces, and disallow space separated filenames. I never use them anyway, so should be good for this |
18:21:38 | FromDiscord | <sOkam!> (edit) "space separated filenames." => "filenames containing spaces." |
18:22:35 | FromDiscord | <Rika> quoting and escaping rules are more complex to implement so yeah |
18:31:47 | * | jjido joined #nim |
18:32:27 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=3Xjh |
18:39:41 | FromDiscord | <Zectbumo> I think you are looking for the index |
18:40:40 | FromDiscord | <sOkam!> Is that like a property that you can call in any seq? If yes, I don't know how to call for it |
18:41:28 | FromDiscord | <sOkam!> seq1[it] maybe? do they work as arrays too, or is there another way? |
18:42:41 | FromDiscord | <sOkam!> (edit) "way?" => "way?↵_just found it on a g-search, that seems to work_" |
18:47:16 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=3Xjn |
18:48:30 | FromDiscord | <Zectbumo> sent a code paste, see https://play.nim-lang.org/#ix=3Xjo |
18:49:07 | FromDiscord | <sOkam!> what do the separated iterators mean? |
18:49:21 | FromDiscord | <Zectbumo> i is the index |
18:50:16 | * | duuuuuude quit (Ping timeout: 246 seconds) |
18:50:16 | FromDiscord | <sOkam!> so seq1 is split into `index, value` when doing an iteration like that? |
18:50:22 | FromDiscord | <Zectbumo> Yes |
18:50:50 | FromDiscord | <sOkam!> kk. Need to read about iterators, it seems ✍️ |
18:51:23 | FromDiscord | <huantian> You can also probably use mitems |
18:54:39 | FromDiscord | <Zectbumo> Hmm, i don't actually see it mentioned in the manual in the for statement section |
18:54:45 | FromDiscord | <theangryepicbanana> is there a way to declare a type as `not nil` like `type Foo = ref object not nil ...`? |
18:55:06 | FromDiscord | <huantian> Look at experimental flag strictNotNil |
18:55:09 | FromDiscord | <theangryepicbanana> I did |
18:55:56 | FromDiscord | <theangryepicbanana> I'm fully aware that it's not documented nor directly useable like my example |
18:56:13 | FromDiscord | <Elegantbeef> It's not usable that way you need to use it on an alias |
18:56:14 | FromDiscord | <theangryepicbanana> I'm just wondering if there's some other way to do it without declaring 2 types |
18:56:34 | FromDiscord | <sOkam!> In reply to @huantian "You can also probably": its forcing me to declare a new variable to store the input of the function, since its considered a let |
18:56:46 | FromDiscord | <sOkam!> (edit) "variable" => "var" |
18:57:08 | FromDiscord | <sOkam!> looks handy though, will try to remember its existence |
18:57:39 | FromDiscord | <theangryepicbanana> In reply to @Elegantbeef "It's not usable that": how hard would it be to add this to the language grammar? it seems pretty straightforward to me |
18:58:09 | FromDiscord | <Elegantbeef> I'm not a real compiler dev but you're proobably right |
18:58:38 | FromDiscord | <Elegantbeef> remove the `not` infix, make the left hand the actual type and add `sfNotNil` to the symbol |
18:59:17 | FromDiscord | <theangryepicbanana> example? `not nil` is the notation used to describe a non-null type |
18:59:27 | FromDiscord | <theangryepicbanana> ideally it would still be used |
19:00:22 | FromDiscord | <theangryepicbanana> since `nil` as a modifier does the opposite |
19:01:13 | FromDiscord | <huantian> sent a code paste, see https://play.nim-lang.org/#ix=3Xjt |
19:09:16 | FromDiscord | <sOkam!> Genious, hahaha 😄↵Am I using the wrong proc or something? https://media.discordapp.net/attachments/371759389889003532/972938250329149460/unknown.png https://media.discordapp.net/attachments/371759389889003532/972938250715017276/unknown.png |
19:13:03 | FromDiscord | <sOkam!> I'm calling it from a `withDir theFolder:` block, in case this changes things https://media.discordapp.net/attachments/371759389889003532/972939204168392704/unknown.png |
19:13:06 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
19:13:33 | FromDiscord | <huantian> Or just use applyIt https://nim-lang.org/docs/sequtils.html#applyIt.t,untyped,untyped |
19:13:47 | FromDiscord | <huantian> Wups my wife dird |
19:14:15 | FromDiscord | <huantian> Are you converting a seq of absolute paths to relative paths ? |
19:14:22 | FromDiscord | <huantian> (edit) "wife dird" => "wifi died" |
19:15:07 | FromDiscord | <sOkam!> yep |
19:16:53 | FromDiscord | <huantian> Try using relativePath, then normalizePath |
19:17:03 | * | duuuuuude joined #nim |
19:17:07 | FromDiscord | <huantian> Maybe?? |
19:17:13 | FromDiscord | <huantian> No that’ll just make it absolute again |
19:17:52 | FromDiscord | <huantian> Actually no it should work |
19:18:33 | FromDiscord | <sOkam!> shouldn't `relativePath` actually output the expected relative path, without all the silliness? |
19:18:49 | FromDiscord | <sOkam!> Maybe I'm not understanding what the proc is meant to do? |
19:20:46 | FromDiscord | <huantian> I haven’t used that proc before tbh |
19:21:20 | FromDiscord | <sOkam!> ohhh waaait https://media.discordapp.net/attachments/371759389889003532/972941289127575652/unknown.png |
19:21:40 | FromDiscord | <sOkam!> what's that `/` doing there? that's implied, I didn't add it |
19:22:12 | FromDiscord | <sOkam!> (edit) "waaait" => "waaait↵what's that `/` doing there? that's implied, I didn't add it↵I guess I'll reread the manual, might have missed something" |
19:23:16 | FromDiscord | <huantian> You want normalizedPath for the not in place version |
19:25:38 | FromDiscord | <sOkam!> In reply to @huantian "You want normalizedPath for": wdym by "not in place"? |
19:28:27 | FromDiscord | <huantian> look at the examples for each proc |
19:31:03 | FromDiscord | <sOkam!> didn't seem to work https://media.discordapp.net/attachments/371759389889003532/972943732469022750/unknown.png https://media.discordapp.net/attachments/371759389889003532/972943732687134720/unknown.png |
19:48:17 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=3XjI |
19:54:41 | PMunch | Hmm, so Nim doesn't have do-while loops. What's the most efficient way to do those? |
19:55:20 | PMunch | A simple template with `body; while condition: body` seems fine, but it essentially duplicates the size of the code |
20:01:44 | FromDiscord | <Yardanico> In reply to @PMunch "Hmm, so Nim doesn't": Maybe something like |
20:01:52 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3XjN |
20:02:32 | FromDiscord | <Yardanico> oh wait wrong i think |
20:03:09 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3XjO |
20:03:09 | FromDiscord | <Yardanico> yeah, condition should be updated after the body |
20:03:11 | PMunch | I did a `while true: body; if not condition: break` |
20:03:21 | PMunch | Saves me from using a variable |
20:03:40 | FromDiscord | <Yardanico> well, there will be a variable in the compiled C code anyway, so no difference :) |
20:04:13 | PMunch | Would it? |
20:04:17 | FromDiscord | <Yardanico> yes |
20:04:31 | PMunch | I think that's just a goto |
20:06:56 | FromDiscord | <Yardanico> oh yeah |
20:07:06 | FromDiscord | <Yardanico> but at least for x86_64 for this code C compilers make the exact same assembly |
20:07:14 | FromDiscord | <Yardanico> not sure about embedded targets |
20:12:50 | FromDiscord | <Yardanico> also a bit funny that C compilers actually optimize "body; while cond: body" into the same construct as mine and your ways |
20:13:02 | FromDiscord | <Yardanico> ah no, they don't, sorryu |
20:13:03 | FromDiscord | <Yardanico> (edit) "sorryu" => "sorry" |
20:13:14 | FromDiscord | <Yardanico> hmm they actually do 🤔 |
20:13:29 | FromDiscord | <Yardanico> https://media.discordapp.net/attachments/371759389889003532/972954412114919424/unknown.png |
20:13:34 | FromDiscord | <Yardanico> just the order in main3 is a bit different |
20:14:30 | PMunch | Yardanico, well this is AVR :P |
20:15:24 | FromDiscord | <Yardanico> too bad nim on godbolt only has access to GCC :( |
20:15:29 | FromDiscord | <Yardanico> the x86_64 gcc |
20:15:44 | FromDiscord | <Yardanico> i mean, 32-bit works too, but I don't think others would |
20:24:58 | FromDiscord | <planetis> godbolt output is scrambled and useless |
20:26:03 | FromDiscord | <Yardanico> In reply to @planetis "godbolt output is scrambled": not useless, it's okay |
20:26:12 | FromDiscord | <Yardanico> i know for nim it only shows the main module, but that's enough in some cases |
20:29:23 | FromDiscord | <planetis> honestly you make more sense of it, if you use objdump with source code |
20:39:34 | FromDiscord | <Elegantbeef> I was more saying what the compiler would need to do↵(@theangryepicbanana) |
20:42:00 | FromDiscord | <theangryepicbanana> In reply to @Elegantbeef "I was more saying": ah gotcha |
20:45:02 | * | jjido joined #nim |
20:48:03 | * | duuuuuude quit (Ping timeout: 276 seconds) |
20:48:23 | * | PMunch quit (Quit: leaving) |
20:53:57 | * | jmdaemon joined #nim |
21:09:26 | * | kenran quit (Quit: WeeChat info:version) |
21:16:41 | * | noeontheend joined #nim |
21:37:03 | * | duuuuuude joined #nim |
21:42:53 | * | smvg quit (Quit: smvg) |
22:02:55 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
22:12:32 | FromDiscord | <theangryepicbanana> I'm getting this error when trying to install nim via choosenim on windows https://media.discordapp.net/attachments/371759389889003532/972984369503416400/unknown.png |
22:13:25 | FromDiscord | <Elegantbeef> Oh noes we might learn your name! ;D |
22:13:30 | FromDiscord | <theangryepicbanana> according to 7zip, the zip isn't corrupted |
22:13:40 | FromDiscord | <Elegantbeef> Jokes aside uhh choosenim -v? |
22:14:01 | FromDiscord | <theangryepicbanana> choosenim isn't installed so that errors |
22:14:43 | FromDiscord | <theangryepicbanana> ahhh it's not in my path |
22:14:46 | FromDiscord | <Elegantbeef> What version of windows? |
22:14:48 | FromDiscord | <theangryepicbanana> though it's weird that it wouldn't do that first |
22:14:53 | FromDiscord | <theangryepicbanana> 10 |
22:15:16 | FromDiscord | <theangryepicbanana> sent a code paste, see https://play.nim-lang.org/#ix=3Xki |
22:16:27 | FromDiscord | <theangryepicbanana> I'll probably just copy the zip contents myself |
22:18:44 | FromDiscord | <theangryepicbanana> ok so it seems to be an issue with whatever choosenim uses to extract zip files |
22:20:26 | FromDiscord | <dom96> @theangryepicbanana see https://forum.nim-lang.org/t/9144#59753 |
22:23:36 | FromDiscord | <theangryepicbanana> OHHH does nim actually need gcc? |
22:23:42 | FromDiscord | <theangryepicbanana> I assumed I could use msvc |
22:34:00 | * | duuuuuude quit (Ping timeout: 276 seconds) |
22:38:29 | FromDiscord | <!Patitotective> In reply to @Rika "ok": ok |
22:48:13 | FromDiscord | <!Patitotective> do you want to be here? @hmmm https://media.discordapp.net/attachments/371759389889003532/972993353664847872/Captura_de_pantalla_de_2022-05-08_17-47-10.png |
23:01:45 | FromDiscord | <theangryepicbanana> well I got it installed but I'm stuck on the 32-bit build because cygwin's website is down and the installation doesn't work on msys2 64bit |
23:05:42 | FromDiscord | <theangryepicbanana> ah at least devel worked for some reason |
23:09:49 | FromDiscord | <!Patitotective> In reply to @Patitotective "do you want to": h. mmm |
23:18:54 | * | Zectbumo joined #nim |
23:25:56 | FromDiscord | <theangryepicbanana> sent a code paste, see https://play.nim-lang.org/#ix=3Xky |
23:26:13 | FromDiscord | <Elegantbeef> Not parsable |
23:26:16 | FromDiscord | <theangryepicbanana> how? |
23:26:33 | FromDiscord | <theangryepicbanana> `type` shares the same indentation level as `foo:`, no? |
23:26:36 | FromDiscord | <Elegantbeef> type defs have a specific AST that needs to exist |
23:26:43 | FromDiscord | <Elegantbeef> Atleast i think |
23:27:04 | FromDiscord | <theangryepicbanana> likewise, apparently type defs cannot be passed as regular arguments, so the `:` is required |
23:48:27 | * | Zectbumo_ joined #nim |
23:49:08 | * | Zectbumo quit (Ping timeout: 260 seconds) |
23:57:47 | FromDiscord | <hmmm> In reply to @Patitotective "do you want to": yes pls, uncle hmm for me 😄 👍 😛 |