00:01:20 | FromDiscord | <codic> leorize[IRC] ^ |
00:01:29 | FromDiscord | <Technisha Circuit> sent a code paste, see https://discordapp.com/channels/371759389889003530/371759389889003532/715716406796353567 |
00:01:58 | FromDiscord | <Technisha Circuit> Preferably using the do method like i did with the on ready event |
00:02:00 | FromDiscord | <codic> ```nim↵client.on "message", proc(msg) = ↵ if msg.content == "ping": msg.reply("pong!")↵``` |
00:02:09 | FromDiscord | <Technisha Circuit> Thanks :P |
00:02:49 | FromDiscord | <codic> or ↵```nim↵client.on "message", do(msg) = ↵ if msg.content == "ping": msg.reply("pong!")``` |
00:03:09 | FromDiscord | <Technisha Circuit> Thanks man |
00:03:14 | FromDiscord | <codic> (edit) '"message", do(msg) = ↵' => '"message" do(msg):↵' |
00:03:29 | FromDiscord | <codic> (edit) '↵```nim↵client.on "message"' => '↵```nim↵client.on("message")' |
00:06:33 | FromDiscord | <codic> I'm pretty sure my syntax is right, is it not? |
00:06:38 | FromDiscord | <codic> (Not talking abotut hed js thing) |
00:06:43 | FromDiscord | <codic> *about the js |
00:06:55 | leorize | codic: well you will know why it failed to parse if you got an editor with good syntax highlighting :P |
00:07:20 | FromDiscord | <codic> ? https://media.discordapp.net/attachments/371759389889003532/715717875553271838/unknown.png |
00:07:48 | FromDiscord | <Technisha Circuit> I need a type for it |
00:07:54 | leorize | notice how it stopped looking like a string? :P |
00:07:54 | FromDiscord | <Technisha Circuit> For the msg |
00:08:05 | FromDiscord | <codic> what did? |
00:08:11 | FromDiscord | <codic> the \n inside the {}? |
00:08:18 | leorize | yea |
00:08:19 | FromDiscord | <Technisha Circuit> > For the msg |
00:08:41 | FromDiscord | <codic> msg:string |
00:08:48 | FromDiscord | <Technisha Circuit> Thanks |
00:08:52 | FromDiscord | <codic> Np |
00:09:09 | FromDiscord | <Technisha Circuit> Don't work |
00:09:33 | leorize | codic: it's simple, the string ended at the first `"` :p |
00:09:38 | FromDiscord | <codic> What's the error? |
00:09:43 | FromDiscord | <codic> OHHHH I'M SO STUPID AAAAAAAAARGH |
00:10:01 | FromDiscord | <Technisha Circuit> https://media.discordapp.net/attachments/371759389889003532/715718552178655242/Screenshot_20200529_010954_com.termux.jpg |
00:10:03 | * | xet7 joined #nim |
00:10:03 | leorize | also styledWrite can take multiple parameters |
00:10:05 | FromDiscord | <Yardanico> @codic in your case it's because you didn't escape " |
00:10:15 | leorize | or just use triple-quoted literals |
00:10:20 | FromDiscord | <codic> So like this? |
00:10:21 | FromDiscord | <codic> `n{dep.split(", ").join(\"\n")} ` |
00:10:33 | FromDiscord | <Yardanico> For all " |
00:10:34 | FromDiscord | <codic> still fails, 'invalid indentation' |
00:10:35 | FromDiscord | <codic> Ah |
00:10:41 | FromDiscord | <Yardanico> Except the starting and ending |
00:10:42 | leorize | use triple quoted strings |
00:10:44 | leorize | much easier |
00:10:48 | FromDiscord | <Yardanico> Yeah |
00:11:03 | FromDiscord | <Yardanico> Or just make a separate variable |
00:11:08 | FromDiscord | <codic> Alright, got that. Now it's saying expression join is of type string and has to be discarded? |
00:11:25 | FromDiscord | <codic> But I'm using it in the string.. |
00:11:29 | * | ftsf joined #nim |
00:11:31 | FromDiscord | <Yardanico> Show full code |
00:12:00 | FromDiscord | <codic> sure |
00:12:02 | FromDiscord | <codic> https://play.nim-lang.org/#ix=2nEK |
00:12:35 | FromDiscord | <codic> (It's a tool to install debs on non deb) |
00:13:21 | leorize | well you didn't escape enough `"` lol |
00:13:27 | * | xet7 quit (Remote host closed the connection) |
00:13:32 | leorize | look at your code on the playground |
00:13:39 | FromDiscord | <codic> oh |
00:13:41 | FromDiscord | <codic> frick it |
00:13:52 | FromDiscord | <codic> will just use another variable |
00:14:20 | leorize | &"""string""" <- use that then you can have `"` inside the string |
00:14:38 | FromDiscord | <codic> I know, but a variable is useful for other stuff as well |
00:17:40 | FromDiscord | <codic> This is turning out well (and it works!) https://media.discordapp.net/attachments/371759389889003532/715720476634120252/unknown.png |
00:18:19 | FromDiscord | <Technisha Circuit> Anyone able to help? :P |
00:18:27 | FromDiscord | <Technisha Circuit> https://cdn.discordapp.com/attachments/371759389889003532/715718552178655242/Screenshot_20200529_010954_com.termux.jpg |
00:18:33 | FromDiscord | <Technisha Circuit> I need a type |
00:18:43 | FromDiscord | <Technisha Circuit> I tried using JsObject but that didn't work |
00:19:03 | FromDiscord | <Technisha Circuit> And Codic said to use a string |
00:19:06 | leorize | without looking at the code there isn't much that we can reason about :P |
00:20:03 | FromDiscord | <Technisha Circuit> sent a code paste, see http://ix.io/2nEL |
00:20:07 | FromDiscord | <Technisha Circuit> Wait, can you see it? |
00:30:04 | leorize[m] | the error doesn't seem to match that code |
00:32:15 | FromDiscord | <Technisha Circuit> I've edited |
00:32:30 | FromDiscord | <Technisha Circuit> Fixed |
00:32:31 | FromDiscord | <Technisha Circuit> (edit) 'http://ix.io/2nEL' => 'http://ix.io/2nEN' |
00:32:39 | FromDiscord | <Technisha Circuit> @leorize |
00:36:23 | leorize[m] | use a JsObject there? |
00:45:47 | * | bjorob_ quit (Ping timeout: 260 seconds) |
00:50:58 | * | lritter quit (Ping timeout: 272 seconds) |
00:51:07 | * | lritter_ joined #nim |
00:53:10 | * | casaca quit (Remote host closed the connection) |
00:53:48 | * | casaca joined #nim |
00:57:15 | * | Trustable quit (Remote host closed the connection) |
00:58:31 | FromDiscord | <codic> Pretty sure `c` types get translated into the js ones but idk |
00:59:23 | FromDiscord | <codic> But ya should try JsOject first, yea |
01:05:44 | * | casaca quit (Remote host closed the connection) |
01:06:29 | * | dadada quit (Ping timeout: 265 seconds) |
01:09:27 | * | theelous3 quit (Ping timeout: 246 seconds) |
01:12:15 | * | casaca joined #nim |
01:13:30 | FromDiscord | <Technisha Circuit> JsObject didn't work for some reason |
01:13:32 | * | theelous3 joined #nim |
01:14:00 | * | Tongir joined #nim |
01:14:01 | * | theelous3 quit (Read error: Connection reset by peer) |
01:15:30 | * | dadada joined #nim |
01:15:50 | * | dadada is now known as Guest81643 |
01:16:35 | * | Maxwell_Pound quit (Ping timeout: 260 seconds) |
01:19:15 | * | chemist69 quit (Ping timeout: 246 seconds) |
01:21:16 | * | chemist69 joined #nim |
01:23:05 | FromDiscord | <Zed> you actually did it @Technisha Circuit you are coding on your phone |
01:29:40 | FromDiscord | <Technisha Circuit> XD |
01:39:12 | * | Guest81643 quit (Ping timeout: 246 seconds) |
01:43:36 | skrylar[m] | i read that link from earlier about the caps bikeshed |
01:43:52 | skrylar[m] | kind of agree though with the guy who said the real problem is just a lack of apps |
01:45:23 | * | dadada__ joined #nim |
01:50:03 | * | opal quit (Ping timeout: 240 seconds) |
01:58:19 | FromDiscord | <Technisha Circuit> > you actually did it @Technisha Circuit you are coding on your phone↵@Zed I've done this for 3 years now sooooo |
01:58:39 | FromDiscord | <Technisha Circuit> @codic JsObject didn't work, and neither did cstring |
01:59:07 | FromDiscord | <Technisha Circuit> I need to be able to use `discord.message` as a type |
01:59:16 | FromDiscord | <Zed> you've been coding on your phone for 3 years?? that deserves a medal |
01:59:38 | FromDiscord | <codic> idk then |
01:59:42 | FromDiscord | <codic> JsString if that's a thing? |
01:59:54 | FromDiscord | <Technisha Circuit> Nvm |
01:59:58 | FromDiscord | <Technisha Circuit> Not a valid tyoe |
02:00:00 | FromDiscord | <Technisha Circuit> Type* |
02:00:03 | FromDiscord | <Technisha Circuit> And ok |
02:00:03 | FromDiscord | <codic> Oof |
02:00:10 | FromDiscord | <codic> What did you say nvm to? |
02:00:14 | FromDiscord | <Technisha Circuit> > you've been coding on your phone for 3 years?? that deserves a medal↵Haha |
02:00:33 | FromDiscord | <Technisha Circuit> > I need to be able to use `discord.message` as a type↵To this |
02:00:41 | FromDiscord | <Technisha Circuit> I said not a valid type |
02:01:00 | FromDiscord | <codic> does anyone know how to get the response signal code (eg 0 success, 1 standard failure, so on) AND command output (as execprocess does ootb)? preferably as a seq or something |
02:01:06 | FromDiscord | <codic> Oh, ok |
02:02:46 | FromDiscord | <Technisha Circuit> I need to use `discord.Message` as a type somehow :/ |
02:03:22 | FromDiscord | <codic> Idk |
02:03:30 | FromDiscord | <codic> `JsObject(discord.Message)`? |
02:03:34 | FromDiscord | <codic> There must be something like that |
02:04:20 | FromDiscord | <Technisha Circuit> Ok |
02:05:40 | FromDiscord | <Technisha Circuit> https://media.discordapp.net/attachments/371759389889003532/715747655778828308/Screenshot_20200529_030532_com.termux.jpg |
02:06:20 | * | opal joined #nim |
02:08:33 | bung | I got `Error: cannot open file: stdprivatesince` where is the slash? |
02:09:19 | * | dadada__ quit (Ping timeout: 265 seconds) |
02:09:45 | FromDiscord | <flywind> what's your nim version, it's in devel. |
02:10:17 | bung | I using 1.3.5 |
02:10:56 | bung | I meaning the error reported file path without slash |
02:11:33 | * | Tlanger joined #nim |
02:14:06 | FromDiscord | <flywind> have no problem in windows/ubuntu, maybe report it in github. |
02:14:18 | * | Tongir quit (Ping timeout: 260 seconds) |
02:15:01 | bung | ok |
02:15:20 | * | dadada joined #nim |
02:15:43 | FromGitter | <phdye> Error: expression ' {.emit: "(&_Py_NoneStruct)".}' has no type (or is ambiguous) ⏎ ⏎ Anyone have an idea how to give this a type ? I tried casting it but that givens the same error message. |
02:15:45 | * | dadada is now known as Guest81102 |
02:17:32 | * | endragor joined #nim |
02:22:49 | FromDiscord | <Technisha Circuit> We need to see the code @phdye |
02:27:30 | * | muffindrake quit (Ping timeout: 246 seconds) |
02:28:07 | FromGitter | <phdye> template Py_None*() = ⏎ castptr PyObject ({.emit: """(&_Py_NoneStruct)""".}) |
02:28:29 | FromGitter | <phdye> Weird it strips a bit of the code. |
02:28:54 | FromGitter | <phdye> Is there a code quoting feature ? |
02:30:00 | * | muffindrake joined #nim |
02:32:12 | FromGitter | <phdye> ```template Py_None*() = ⏎ cast[ptr PyObject]({.emit: """(&_Py_NoneStruct)""".})``` [https://gitter.im/nim-lang/Nim?at=5ed0742c7da67d06fadaf401] |
02:32:45 | leorize | @phdye: {.emit.} are type-less |
02:33:06 | leorize | @Technisha: why doesn't JsObject work? |
02:33:31 | FromGitter | <phdye> Hmm, what JsObject ? |
02:33:52 | leorize | that message wasn't meant for you :P |
02:34:28 | FromDiscord | <Technisha Circuit> No idea @leorize[IRC]#0000 |
02:34:31 | FromDiscord | <Technisha Circuit> ;-; |
02:34:45 | leorize | what I meant is: what's the error message? |
02:34:47 | leorize | lol |
02:34:50 | FromDiscord | <Technisha Circuit> Oh |
02:35:03 | * | opal quit (Ping timeout: 240 seconds) |
02:36:10 | FromDiscord | <Technisha Circuit> Getting the error rn |
02:36:46 | * | opal joined #nim |
02:37:12 | leorize | my guess is that the error will be that you can't `==` between a JsObject and a string |
02:37:13 | bung | you just need import from c using c global None variable |
02:37:19 | FromDiscord | <Technisha Circuit> sent a code paste, see https://discordapp.com/channels/371759389889003530/371759389889003532/715755618031632425 |
02:37:33 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
02:37:33 | leorize | sorry, it's a discord link now, I can't read it :P |
02:37:39 | FromDiscord | <Technisha Circuit> Oof okay |
02:37:47 | FromDiscord | <Technisha Circuit> ~~Why not make it hastebin?~~ |
02:37:58 | FromDiscord | <Technisha Circuit> https://media.discordapp.net/attachments/371759389889003532/715755782314131496/Screenshot_20200529_033751_com.cutthecord.base.jpg |
02:38:12 | leorize | Yardanico: we need something better than ix.io lol |
02:38:26 | leorize | @Technisha my guess was spot on :) |
02:38:40 | leorize | use `.to(cstring)` |
02:38:48 | FromDiscord | <Technisha Circuit> Oh okay :P |
02:38:52 | FromDiscord | <Technisha Circuit> On what exactly? |
02:39:01 | leorize | on `.content` |
02:39:03 | * | Guest81102 quit (Ping timeout: 246 seconds) |
02:39:06 | FromDiscord | <Technisha Circuit> Oki |
02:39:49 | FromDiscord | <Technisha Circuit> Eyyy, it works! |
02:39:52 | FromDiscord | <Technisha Circuit> Thanks! |
02:40:58 | leorize | I know a bit too much nim at this point :P |
02:41:32 | FromDiscord | <Technisha Circuit> Hahaha |
02:41:42 | FromDiscord | <Technisha Circuit> No such thing as too much nim |
02:41:55 | * | opal quit (Excess Flood) |
02:43:55 | * | opal joined #nim |
02:45:23 | * | dadada__ joined #nim |
02:47:53 | * | mono joined #nim |
02:48:30 | * | avatarfighter joined #nim |
02:49:02 | FromDiscord | <Technisha Circuit> Who else wants this? |
02:49:03 | FromDiscord | <Technisha Circuit> https://thepihut.com/products/raspberry-pi-4-model-b?variant=31994565689406 |
02:50:14 | * | monokrom quit (Ping timeout: 246 seconds) |
02:54:25 | FromDiscord | <Yardanico> @leorize any good recommendations? |
02:54:43 | * | opal quit (Ping timeout: 240 seconds) |
02:55:19 | FromDiscord | <Yardanico> hastebin is instantly no because of JS |
02:55:28 | leorize | 0x0.st |
02:55:40 | leorize | we can even self-host our own pastebin :P |
02:56:51 | FromDiscord | <Technisha Circuit> Why not make your own paste service then @Yardanico? |
02:56:59 | FromDiscord | <Technisha Circuit> Or port the JS to another lang |
02:57:14 | leorize | lol, that's not the prob |
02:57:23 | leorize | the prob was that to interact with hastebin you need js |
02:58:11 | FromDiscord | <Technisha Circuit> Oh? |
02:58:18 | FromDiscord | <Yardanico> Yes, that's really stupid in my opinion |
02:58:24 | FromDiscord | <Technisha Circuit> There's a client for it in Ruby though |
02:58:30 | FromDiscord | <Yardanico> Pastes are text first of all |
02:58:38 | FromDiscord | <Yardanico> @Technisha Circuit we mean the website |
02:58:41 | FromDiscord | <Yardanico> Not API |
02:58:43 | FromDiscord | <Technisha Circuit> Oh |
02:59:27 | FromDiscord | <Technisha Circuit> So what will you use? |
03:00:04 | leorize | I don't see why we can't just store everything on our servers :P |
03:00:07 | leorize | lack of space? |
03:00:08 | FromDiscord | <Yardanico> That's what I'm asking, there are good services, but it's better to not use a lot |
03:00:18 | FromDiscord | <Technisha Circuit> :p |
03:00:25 | FromDiscord | <Yardanico> @leorize it's possible, yes, but that's kinda out of scope :) |
03:00:33 | FromDiscord | <Yardanico> Even Nim playground uses ix.io |
03:00:33 | FromDiscord | <Technisha Circuit> Maybe make the bot send it as an image somehow? |
03:00:40 | FromDiscord | <Yardanico> No, that's even worse |
03:00:46 | FromDiscord | <Technisha Circuit> :p |
03:01:10 | FromDiscord | <Technisha Circuit> I was thinking of the bot processing it to look like a discord message |
03:01:14 | FromDiscord | <Technisha Circuit> Or something |
03:01:44 | leorize | discord has the weirdest architecture |
03:01:59 | leorize | you need to login to see messages, but you don't have to if you just wanna see the pics |
03:02:42 | FromDiscord | <codic> since they are just hosted on the cdn |
03:02:49 | FromDiscord | <codic> used to be cdn.discordapp.com |
03:02:51 | FromDiscord | <codic> now media.discord.com |
03:03:18 | FromDiscord | <codic> it'd be a big pain to have login require for simply accessing the cdn |
03:03:34 | FromDiscord | <codic> plus, it'd make viewing images in browser harder for people not logged in |
03:06:56 | * | rockcavera quit (Remote host closed the connection) |
03:07:49 | * | sagax quit (Remote host closed the connection) |
03:09:41 | * | dadada__ quit (Ping timeout: 272 seconds) |
03:14:03 | * | sagax joined #nim |
03:15:21 | * | dadada joined #nim |
03:15:47 | * | dadada is now known as Guest82240 |
03:18:33 | * | opal joined #nim |
03:18:36 | * | oneark joined #nim |
03:38:54 | * | Guest82240 quit (Ping timeout: 246 seconds) |
03:39:26 | FromDiscord | <Technisha Circuit> ~~JSGrant~~ |
03:39:49 | FromDiscord | <Technisha Circuit> I think we have a lurker- |
03:42:48 | * | endragor quit (Remote host closed the connection) |
03:45:01 | FromDiscord | <JSGrant> @Technisha Circuit I'd be a lot more interested in a RPi with 8gb of ram; If the "laptop kit" story was a LOT better. Unless maybe-maybe using it to host heavy web-apps I don't know what the use-case for it would be at this point over a regular tbh |
03:45:27 | * | dadada__ joined #nim |
03:45:31 | FromDiscord | <Technisha Circuit> You could totally use it as a Minecraft server |
03:45:34 | FromDiscord | <Technisha Circuit> :P |
03:46:05 | FromDiscord | <JSGrant> Like it's crazy how the pi-top is like 300usd for a case, keyboard, and screen when a Pinebook Pro is like 200usd total and "close enough" to a regular pi |
03:46:35 | FromDiscord | <Technisha Circuit> Oof |
03:46:55 | FromDiscord | <Technisha Circuit> I'd just use a PC monitor and DIY a case for the monitor and a keyboard area |
03:47:28 | FromDiscord | <JSGrant> @Technisha Circuit Eh, I guess; But like idk seems weird to dedicate a pi to that (minecraft server) when I could run it on my homeserver and have a bunch of room to spare still |
03:48:12 | FromDiscord | <Technisha Circuit> I don't have anything else i could use to host except for my 3b |
03:48:23 | FromDiscord | <Technisha Circuit> And it's definitely not powerful enough for a pi |
03:48:34 | FromDiscord | <JSGrant> Also, @Technisha Circuit let's move to #offtopic so we don't spam #main :^) |
03:48:41 | FromDiscord | <Technisha Circuit> Oki haha |
03:53:32 | * | endragor joined #nim |
03:55:51 | * | nsf joined #nim |
04:06:02 | * | supakeen quit (Quit: WeeChat 2.8) |
04:06:03 | * | Tlanger is now known as GG_Ping |
04:06:40 | * | supakeen joined #nim |
04:08:59 | * | dadada__ quit (Ping timeout: 246 seconds) |
04:15:25 | * | dadada joined #nim |
04:15:49 | * | dadada is now known as Guest62177 |
04:18:01 | skrylar[m] | yeh i don't know why arm chipsets always ship with so little memory |
04:18:53 | skrylar[m] | although i put kanboard on an rpi3 and its not very quick |
04:19:38 | skrylar[m] | would kind of expect it to be since its running alpine-arm with basically nothing else active, but maybe that's just how php works and it would be fine with a go/nim server |
04:26:35 | * | muffindrake quit (Quit: muffindrake) |
04:28:23 | FromDiscord | <Rika> @Technisha Circuit someone wants to do haxe to nim (replying to something a few hours ago) |
04:29:17 | FromDiscord | <Technisha Circuit> Oh no |
04:29:37 | leorize | !repo py2nim |
04:29:38 | disbot | https://github.com/metacraft-labs/py2nim -- 9py2nim: 11A Python-to-Nim transpiler 15 115⭐ 8🍴 7& 1 more... |
04:29:51 | leorize | the bot is back :) |
04:29:52 | FromDiscord | <Technisha Circuit> https://github.com/RapidFingers/Craxe↵RapidFingers/Craxe: Haxe to nim transpiler - GitHub |
04:30:19 | FromDiscord | <Technisha Circuit> Old |
04:30:32 | leorize | !repo languist |
04:30:33 | disbot | https://github.com/metacraft-labs/languist -- 9languist: 11a framework for automated translation of high level langs 15 32⭐ 1🍴 7& 1 more... |
04:31:50 | * | avatarfighter quit (Remote host closed the connection) |
04:32:05 | FromDiscord | <Technisha Circuit> Oo |
04:34:20 | * | avatarfighter joined #nim |
04:35:12 | * | muffindrake joined #nim |
04:38:45 | * | Guest62177 quit (Ping timeout: 246 seconds) |
04:45:22 | * | dadada__ joined #nim |
04:49:33 | * | Tongir joined #nim |
04:51:36 | skrylar[m] | well thats just.. weird. |
04:52:00 | skrylar[m] | what do you even gain by doing a haxe-to-nim? |
04:52:17 | FromDiscord | <Rika> its just a fun experiment |
04:52:20 | FromDiscord | <Rika> it doesnt have to be useful |
04:52:22 | * | GG_Ping quit (Ping timeout: 256 seconds) |
04:52:30 | FromDiscord | <Rika> i mean, it might not look useful to you |
04:52:42 | FromDiscord | <Rika> but someone might find it great for learning if you already know haxe |
04:53:03 | * | leorize quit (Ping timeout: 240 seconds) |
04:53:46 | avatarfighter | Haxe-to-nim sounds fun! |
04:53:53 | * | leorize joined #nim |
04:54:04 | * | xet7 joined #nim |
05:06:34 | * | Tlanger joined #nim |
05:08:56 | * | Tongir quit (Ping timeout: 246 seconds) |
05:09:07 | * | dadada__ quit (Ping timeout: 265 seconds) |
05:09:20 | avatarfighter | Which way is considered more correct for finding out if a string is empty? string.len == 0 vs. string == "" vs. bool(string.len) ? |
05:09:51 | avatarfighter | Second question based on that one, is string.len == 0 the same as bool(string.len) ? |
05:10:00 | * | Brandon__ quit (Ping timeout: 272 seconds) |
05:10:20 | FromDiscord | <Rika> Personally I use len == 0 |
05:14:04 | FromDiscord | <Technisha Circuit> I'd think so @avatarfighter[IRC]#0000 |
05:14:52 | FromDiscord | <Technisha Circuit> For your second question |
05:15:20 | * | dadada joined #nim |
05:15:33 | * | bbarker joined #nim |
05:15:46 | * | dadada is now known as Guest87417 |
05:19:23 | * | opal quit (Ping timeout: 240 seconds) |
05:22:27 | FromDiscord | <Elegant Beef> Depends on what im doing but i tend to do use isEmptyOrWhiteSpace |
05:23:04 | FromDiscord | <Rika> But what if whitespace is not equivalent to empty! |
05:28:58 | FromDiscord | <Yardanico> @avatarfighter 1) you can use any of the first two, I really never seen anyone use bool(str.len) in libraries |
05:29:41 | FromDiscord | <Yardanico> 2) it's the other way |
05:30:10 | FromDiscord | <Yardanico> str.len == 0 is same as "not bool(str.len)" |
05:30:13 | * | bbarker quit (Ping timeout: 264 seconds) |
05:30:25 | FromDiscord | <Yardanico> But as I said, I really don't think anyone uses it this way :) |
05:30:34 | avatarfighter | I totally forgot that 0 evaluates to false lmao |
05:34:02 | * | opal joined #nim |
05:39:05 | * | Guest87417 quit (Ping timeout: 265 seconds) |
05:42:06 | * | bbarker joined #nim |
05:45:16 | * | dadada__ joined #nim |
05:46:33 | * | SeanOMik joined #nim |
05:47:12 | SeanOMik | Hello, I'm new to nim and I wondering if I could create a table of a custom type? |
05:48:36 | FromDiscord | <Elegant Beef> Do you mean have a custom type of the key? |
05:48:40 | FromDiscord | <Elegant Beef> (edit) 'of' => 'as' |
05:49:08 | SeanOMik | Yeah |
05:49:11 | FromDiscord | <Yardanico> @SeanOMik yeah of course, you'll have to define a hash proc for your type first though |
05:49:24 | SeanOMik | Oh theres a discord? |
05:49:26 | FromDiscord | <Elegant Beef> https://nim-lang.org/docs/tables.html#basic-usage-hashing |
05:49:28 | FromDiscord | <Elegant Beef> Yes |
05:49:29 | SeanOMik | Let me switch to discord real fast |
05:49:32 | FromDiscord | <Yardanico> See https://nim-lang.org/docs/hashes.html |
05:49:35 | FromDiscord | <Elegant Beef> We're all bridged and a big happy family |
05:49:37 | * | SeanOMik quit (Remote host closed the connection) |
05:49:52 | FromDiscord | <SeanOMik> Oh, its hidden at the bottom of the page |
05:50:20 | FromDiscord | <SeanOMik> Okay so i have to use hashes then? |
05:50:24 | FromDiscord | <Elegant Beef> Yea |
05:50:36 | FromDiscord | <Elegant Beef> Isnt there a macro in a module that has a has macro? |
05:50:37 | FromDiscord | <Yardanico> @SeanOMik well it's not really are the bottom :) |
05:50:44 | FromDiscord | <Elegant Beef> (edit) 'a has macro?' => 'auto hases?' |
05:50:48 | FromDiscord | <SeanOMik> Just about |
05:50:56 | FromDiscord | <Yardanico> There's the documentation of all procs below the |
05:50:59 | FromDiscord | <Yardanico> *that |
05:51:36 | FromDiscord | <SeanOMik> Okay, I'll try this |
05:51:40 | FromDiscord | <SeanOMik> Thanks! |
05:51:45 | FromDiscord | <Elegant Beef> I mean i do feel like it should say something like↵> To use a Custom type as a key you need a custom has proc see here(Insert hyperlink) |
05:51:54 | FromDiscord | <Elegant Beef> hash* |
05:51:58 | FromDiscord | <Elegant Beef> Man i wish i could spell |
05:52:27 | FromDiscord | <SeanOMik> Yeah it should |
05:53:37 | FromDiscord | <Yardanico> Well it's just different phrasing, you can create a PR to fix that :) |
05:54:12 | FromDiscord | <Elegant Beef> It's not different phrasing as much as explictly stating within the first paragraph |
05:54:19 | FromDiscord | <Elegant Beef> of the tables module |
05:54:28 | FromDiscord | <SeanOMik> If I have an table with the key being a custom type, lets call the type `A`, could I add other custom types to it that inherit from type `A`? |
05:54:42 | FromDiscord | <SeanOMik> (edit) 'an' => 'a' |
05:54:52 | FromDiscord | <Elegant Beef> You'd have to convert to i'd believe |
05:55:04 | FromDiscord | <Rika> i think so but it would conform to the hashing proc of type A |
05:55:11 | FromDiscord | <SeanOMik> Hmmm |
05:55:12 | FromDiscord | <Rika> unless its a method |
05:55:26 | FromDiscord | <SeanOMik> Okay, thats a lot of hash procs then |
05:55:34 | FromDiscord | <Elegant Beef> This is where a macro is nice |
05:55:46 | FromDiscord | <Elegant Beef> Which i've been meaning to do for fun, but i know already exists somewhere |
05:56:25 | FromDiscord | <SeanOMik> A macro that would get all the members of the type and hash them? |
05:56:28 | FromDiscord | <Elegant Beef> Yea |
05:56:29 | FromDiscord | <SeanOMik> So I dont have to hash them |
05:56:30 | FromDiscord | <SeanOMik> Hm |
05:56:41 | FromDiscord | <SeanOMik> I'm pretty new but I could take a shot at it |
05:56:49 | FromDiscord | <Elegant Beef> I mean i've been meaning to |
05:56:49 | FromDiscord | <Elegant Beef> 😄 |
05:56:57 | FromDiscord | <SeanOMik> Yeah |
05:57:20 | FromDiscord | <Yardanico> @Elegant Beef you don't exactly need a macro for that |
05:57:37 | FromDiscord | <Yardanico> fieldPairs exists |
05:57:59 | FromDiscord | <Yardanico> You can check how % for object is defined in the json module for example |
05:58:05 | FromDiscord | <Elegant Beef> oh |
05:58:20 | FromDiscord | <Elegant Beef> Did not know that existed |
05:58:26 | FromDiscord | <Yardanico> https://github.com/nim-lang/Nim/blob/version-1-2/lib/pure/json.nim#L349 |
05:58:50 | FromDiscord | <Elegant Beef> yea i got that as soon as you said it |
05:59:08 | FromDiscord | <Elegant Beef> if it's a hashable type hash and add to the current running hash |
06:00:04 | * | Tongir joined #nim |
06:02:15 | FromGitter | <bung87> len is finr |
06:02:21 | FromGitter | <bung87> fine |
06:02:37 | FromDiscord | <SeanOMik> Well I made this: ```nim↵proc hashEvent[T: object](o: T): Hash =↵ for k, v in o.fieldPairs: v.hash``` |
06:02:43 | FromDiscord | <SeanOMik> From that json example |
06:02:46 | * | Tlanger quit (Ping timeout: 265 seconds) |
06:02:53 | FromDiscord | <SeanOMik> But I have no idea how I would use it |
06:04:51 | FromDiscord | <Rika> sent a code paste, see https://discordapp.com/channels/371759389889003530/371759389889003532/715807851309957140 |
06:05:53 | FromDiscord | <SeanOMik> Okay, but I still get the same issue with trying to create a table |
06:05:56 | FromDiscord | <SeanOMik> with my custom type |
06:06:03 | FromDiscord | <SeanOMik> I get a bunch of weird errors |
06:06:28 | FromDiscord | <SeanOMik> sent a code paste, see https://discordapp.com/channels/371759389889003530/371759389889003532/715808258694316064 |
06:06:53 | FromDiscord | <SeanOMik> Could I just rename it `hash` |
06:07:00 | FromDiscord | <SeanOMik> Or could that mess with standard lib? |
06:07:10 | FromDiscord | <SeanOMik> Renaming it hash seemed to work |
06:07:21 | FromDiscord | <SeanOMik> I dont want it to mess with standard lib though. |
06:07:32 | FromDiscord | <SeanOMik> (edit) 'hash' => '`hash`' |
06:07:35 | FromDiscord | <Yardanico> it won't really mess with the stdlib |
06:07:41 | FromDiscord | <SeanOMik> Okay cool |
06:07:59 | FromDiscord | <Elegant Beef> All objects will use that so really it just makes it better 😄 |
06:08:04 | FromDiscord | <Yardanico> It might mess with other modules if you export that hash proc though |
06:08:17 | FromDiscord | <Yardanico> @Elegant Beef and that's not really good |
06:08:21 | FromDiscord | <SeanOMik> Okay, I'll keep it "private" then |
06:08:33 | FromDiscord | <SeanOMik> Thanks for the help |
06:08:42 | * | dadada__ quit (Ping timeout: 246 seconds) |
06:08:54 | FromDiscord | <Elegant Beef> I mean it is if you want to use objects as keys, except if the object has it's own hash already |
06:09:47 | FromDiscord | <SeanOMik> Okay, back to my old question |
06:09:49 | FromDiscord | <SeanOMik> > If I have a table with the key being a custom type, lets call the type A, could I add other custom types to it that inherit from type A? |
06:10:00 | FromDiscord | <Yardanico> you don't always want to use all object fields in the hash @Elegant Beef |
06:10:03 | FromDiscord | <SeanOMik> Would I be able to do that with the new proc we just made? |
06:10:05 | FromDiscord | <Elegant Beef> Yea i know |
06:10:22 | FromDiscord | <Yardanico> @SeanOMik well you'll need to convert all objects to the type they inherit from |
06:10:22 | FromDiscord | <Elegant Beef> You'd have to convert it to the base type believe |
06:10:30 | FromDiscord | <Yardanico> Or use object variants :) |
06:10:32 | FromDiscord | <SeanOMik> Would I loose data? |
06:10:34 | FromDiscord | <Elegant Beef> No |
06:10:35 | FromDiscord | <Yardanico> No |
06:10:40 | FromDiscord | <SeanOMik> Ooo thats cool |
06:10:45 | FromDiscord | <Elegant Beef> It works like a C# conversion where it's reversible |
06:10:45 | FromDiscord | <Yardanico> You'll be able to convert it back later |
06:10:48 | FromDiscord | <SeanOMik> Coming from C++ I would loose data |
06:10:50 | * | tdc joined #nim |
06:10:59 | FromDiscord | <SeanOMik> Okay, then how could I convert to and from? |
06:11:03 | FromDiscord | <Elegant Beef> `T(val)` |
06:11:07 | FromDiscord | <SeanOMik> Oh |
06:11:09 | FromDiscord | <SeanOMik> Thats pretty simple |
06:11:11 | FromDiscord | <Elegant Beef> Yea |
06:11:24 | FromDiscord | <Elegant Beef> The raw bit conversion which you very rarely use is `cast[T](val)` |
06:11:33 | FromDiscord | <Elegant Beef> But that's bit per bit converted as the other type |
06:11:40 | FromDiscord | <Elegant Beef> Seldomly used |
06:12:00 | FromDiscord | <Elegant Beef> When working in nim only* |
06:12:12 | FromDiscord | <Yardanico> cast in Nim is like reinterpret_cast in C++ but yeah, you rarely need it |
06:12:36 | FromDiscord | <Yardanico> And mostly you only need it for FFI or lower level stuff |
06:15:26 | * | dadada joined #nim |
06:15:49 | * | dadada is now known as Guest1410 |
06:23:01 | * | gxt quit (Quit: WeeChat 2.8) |
06:39:08 | * | Guest1410 quit (Ping timeout: 246 seconds) |
06:45:18 | * | dadada__ joined #nim |
06:53:01 | * | PMunch joined #nim |
06:54:09 | avatarfighter | Is there a way of converting an iterator to a sequence ? I'm about to do a for loop and add the values to result but I'm curious to know if there is a better way |
06:54:42 | avatarfighter | seems that toSeq in sequtils might be what I'm looking for |
06:56:01 | PMunch | Yes, that is what you're looking for |
06:56:38 | avatarfighter | Indeed :D |
06:56:58 | avatarfighter | I had to take a double take with what you said I thought you quoted a jedi for a second there :P |
07:00:18 | PMunch | Hmm, I got this error in nimlsp today: http://ix.io/2nH7 |
07:02:03 | livcd | My wife's family got infected and 2 of them are in hospital on ICU :( |
07:02:32 | FromDiscord | <Technisha Circuit> Damn, i hope they get better soon livcd |
07:02:41 | FromDiscord | <Technisha Circuit> Must suck really bad |
07:02:46 | PMunch | livcd, oh shit, sorry to hear that.. |
07:03:37 | FromDiscord | <Technisha Circuit> I wish them well |
07:03:41 | livcd | sorry for the offtopic :/ |
07:03:46 | livcd | thx guys |
07:03:51 | FromDiscord | <Technisha Circuit> No worries |
07:04:15 | avatarfighter | livcd I wish them a swift recovery :L |
07:05:31 | livcd | Thanks I hope so as well...although 1 person is really old :/ |
07:07:01 | FromDiscord | <Technisha Circuit> Covid is just a nightmare come true |
07:07:14 | FromDiscord | <Technisha Circuit> And some people don't even believe in it :/ |
07:07:42 | livcd | I honestly still believe we cant really do much about it. |
07:07:50 | livcd | Basically everyone in the flat got infected. |
07:08:03 | livcd | I honestly believe most of the numbers of infected reported are wrong. |
07:08:08 | livcd | Or seriously underestimated. |
07:08:19 | PMunch | Probably, a lot of non-symptomatic people |
07:08:33 | PMunch | Making it of course very hard to detect.. |
07:08:42 | avatarfighter | yeah I bet a lot of people don't show symptoms |
07:09:42 | livcd | Well they are in one of the best countries to be when it comes to healthcare so I hope they will be fine. |
07:10:04 | PMunch | Where are you? |
07:10:32 | PMunch | Got it |
07:13:32 | * | Tlanger joined #nim |
07:15:54 | * | Tongir quit (Ping timeout: 246 seconds) |
07:17:11 | voltist | shashlick o/ |
07:17:26 | * | disruptek quit (Ping timeout: 256 seconds) |
07:18:35 | * | disbot quit (Ping timeout: 272 seconds) |
07:18:48 | skrylar[m] | A disease so horrifying the majority of people show no symptoms and fully recover. :sagenods: |
07:20:28 | * | disbot joined #nim |
07:21:15 | * | disruptek joined #nim |
07:23:14 | PMunch | skrylar[m], well the horrifying part about it is when you don't show symptoms and go to visit your grand-parents. Then they catch it and die, later you discover you had it. Now you have to live with having potentially killed someone you love for the rest of your life.. |
07:23:17 | PMunch | https://github.com/nim-lang/Nim/blob/version-1-2/lib/pure/collections/lists.nim#L113 |
07:23:24 | PMunch | What is this <//> thing? |
07:24:33 | * | Tongir joined #nim |
07:26:04 | livcd | skrylar[m]: the disease is horrifying because of its infection rates.It reaches people that are fragile and vulnerable to what it causes (pneumonia etc). |
07:26:06 | FromDiscord | <flywind> <//> is just for being compatible with old Nim version. |
07:26:41 | PMunch | flywind, how old? |
07:27:13 | * | Tlanger quit (Ping timeout: 264 seconds) |
07:27:31 | FromDiscord | <flywind> https://media.discordapp.net/attachments/371759389889003532/715828654617133136/unknown.png |
07:31:48 | FromDiscord | <Technisha Circuit> Anyone know a way to get a virtual credit card without ID verification? I need to link it to my paypal so i can start earning money |
07:32:08 | skrylar[m] | governments tend to crack down on payment accounts that aren't tied to names |
07:32:14 | skrylar[m] | something about money laundering and muh terrorism |
07:32:23 | avatarfighter | Have you tried privacy.com? |
07:32:37 | avatarfighter | I think they provide VCC |
07:32:53 | avatarfighter | also most banks allow you to generate a VCC iirc at least that is the case in the US |
07:32:59 | PMunch | flywind I see |
07:33:23 | * | disbot quit (Ping timeout: 246 seconds) |
07:33:37 | avatarfighter | so to make something async I can in theory just label what I want to be async with the {.async.} pragma |
07:33:38 | avatarfighter | ? |
07:33:43 | skrylar[m] | avatarfighter: ey doesn't want to have an ID attached to it. that's something entirely different. |
07:33:47 | * | disruptek quit (Ping timeout: 272 seconds) |
07:34:29 | FromDiscord | <Recruit_main707> cant you win money even though you dont have virtual credit card linked? |
07:35:30 | * | disruptek joined #nim |
07:36:01 | * | disbot joined #nim |
07:36:08 | PMunch | avatarfighter, well yes that would make it async |
07:36:23 | PMunch | But it wouldn't do anything particular async-y unless you have an await in there |
07:36:29 | avatarfighter | perfect time to make it all async muhaha |
07:36:49 | * | dadada__ quit (Ping timeout: 264 seconds) |
07:36:57 | skrylar[m] | Recruit_main707: you can have credit on accounts but they can't give you the fiat currency without knowing who you are (AML and KYC laws.) |
07:37:37 | * | clemens3 joined #nim |
07:38:34 | FromDiscord | <Recruit_main707> and what if i have a bank account (i dont know how it works, its some kind of special thing bc i am underaged, but its mine) |
07:39:01 | skrylar[m] | that's fine. the bank knows who you are. |
07:39:31 | PMunch | Hmm, this crashes the compiler without any error message: `import options; type Test = iterator (): Option[Test]` |
07:41:23 | skrylar[m] | you can typedef an iterator? |
07:45:25 | * | dadada joined #nim |
07:45:45 | PMunch | Can't you? |
07:45:48 | * | dadada is now known as Guest19852 |
07:47:45 | skrylar[m] | what would that even do? you cant store it anywhere, its not even a closure iterator |
07:49:02 | PMunch | The one I was actually trying to use was a closure iterator |
07:49:23 | PMunch | But {.closure.} wasn't required for the compiler to crash |
07:52:40 | PMunch | Hmm, the compiler really doesn't like what I'm trying to do here.. |
07:52:48 | PMunch | It keeps crashing |
07:53:54 | PMunch | This also crashes it: `type NewTestCB = proc (x: iterator (newcb: NewTestCB) {.closure.})` |
07:55:13 | * | Trustable joined #nim |
07:58:22 | FromDiscord | <Recruit_main707> sent a code paste, see http://ix.io/2nHo |
08:03:55 | voltist | Could someone remind me how to pass arguments to the C compiler through the nim compiler? |
08:04:38 | FromDiscord | <Recruit_main707> passC |
08:05:00 | voltist | Cool thanks |
08:05:13 | FromDiscord | <Recruit_main707> `--passC:` and it can be done with a pragma i think |
08:05:38 | FromDiscord | <Recruit_main707> (from within your code) |
08:06:45 | * | team\andinus left #nim (".") |
08:07:30 | skrylar[m] | PMunch: does that have anything t odo with it trying to reference itself in the typedef? |
08:09:24 | * | Guest19852 quit (Ping timeout: 265 seconds) |
08:13:12 | * | idf joined #nim |
08:13:34 | * | Tlanger joined #nim |
08:15:22 | * | dadada joined #nim |
08:15:45 | * | dadada is now known as Guest85459 |
08:15:54 | * | Tongir quit (Ping timeout: 258 seconds) |
08:16:48 | PMunch | skrylar[m], probably |
08:21:26 | * | disruptek quit (Ping timeout: 246 seconds) |
08:21:42 | * | disbot quit (Ping timeout: 256 seconds) |
08:23:53 | * | disbot joined #nim |
08:24:41 | * | disruptek joined #nim |
08:39:07 | * | Guest85459 quit (Ping timeout: 256 seconds) |
08:39:36 | * | neceve joined #nim |
08:45:24 | * | dadada__ joined #nim |
08:59:08 | * | dddddd quit (Ping timeout: 246 seconds) |
09:02:15 | * | Vladar joined #nim |
09:09:20 | * | dadada__ quit (Ping timeout: 265 seconds) |
09:11:36 | FromDiscord | <Rika> ngl i kinda wish nim had a package level access level but i understand why it doesnt |
09:12:22 | FromDiscord | <Rika> (like where would a package start and end? we cant rely on a nimble file being at top level can we?) |
09:15:30 | * | dadada joined #nim |
09:16:02 | * | dadada is now known as Guest30689 |
09:18:22 | PMunch | @Rika, what do you mean? |
09:18:52 | FromDiscord | <Rika> pmunch: a way to expose types or procs in the package level without needing to `export except` |
09:18:57 | FromDiscord | <Rika> for the non-package level |
09:19:24 | FromDiscord | <Recruit_main707> when iterating over a seq, eg:↵`for idx, val in aseq:`↵idx and val correspond to the index and the value? or value its yielded before index |
09:21:14 | * | dcmertens joined #nim |
09:21:23 | PMunch | Index and value |
09:21:37 | FromDiscord | <Recruit_main707> ok thanks |
09:21:57 | PMunch | Well, it's actually dependent on if it has a `pairs` iterator |
09:23:46 | PMunch | For example a table will have key/value pairs when you do that |
09:39:33 | Zevv | disbot: !last varriount |
09:41:53 | PMunch | Zevv, you don't have to ping him:P |
09:41:57 | PMunch | !last varriount |
09:41:57 | disbot | Varriount spoke in 12#nim 4 days ago |
09:42:46 | Zevv | "it" |
09:42:51 | Zevv | not "him". Don't go there |
09:42:53 | Zevv | it frightens me |
09:44:55 | * | NimBot joined #nim |
09:47:11 | PMunch | Haha, sorry |
09:48:35 | * | Guest30689 is now known as dadada |
10:03:17 | PMunch | Is there a way to undefine a variable? |
10:03:33 | * | lritter_ quit (Quit: Leaving) |
10:03:41 | PMunch | Like if there was an exported global variable in a library, could I somehow un-export that in my code? |
10:08:49 | FromGitter | <apahl> Isn' t there "import <module> except <thing>"? |
10:13:03 | * | opal quit (Ping timeout: 240 seconds) |
10:15:57 | PMunch | Yes, but that's not quite what I'm talking about |
10:16:39 | * | Demos[m] quit (Quit: Idle for 30+ days) |
10:17:49 | FromGitter | <apahl> Sorry, then I misunderstood. |
10:19:52 | * | abm joined #nim |
10:21:09 | * | nerdrat[m] quit (Quit: Idle for 30+ days) |
10:25:50 | * | tml[m] left #nim ("Kicked by @appservice-irc:matrix.org : Idle for 30+ days") |
10:28:10 | * | opal joined #nim |
10:29:01 | * | yassen[m] quit (Quit: Idle for 30+ days) |
10:29:01 | * | wiltzutm[m] quit (Quit: Idle for 30+ days) |
10:29:01 | * | polypoid[m] quit (Quit: Idle for 30+ days) |
10:33:55 | FromDiscord | <Recruit_main707> can you append an string inside anotehr string? |
10:34:34 | FromDiscord | <Recruit_main707> var a = "abce"↵var b = a.append(3, "d") |
10:34:36 | FromDiscord | <Recruit_main707> for example |
10:36:37 | dadada | is there a Table in nim that can sort string keys? |
10:36:57 | dadada | ie. aaa should come before aba, should come before aca ? |
10:37:12 | * | nphg joined #nim |
10:37:12 | * | nphg quit (Client Quit) |
10:37:44 | * | nphg joined #nim |
10:39:16 | PMunch | Recruit_main707, insert from strutils is what you're after |
10:39:28 | PMunch | append specifically means "add to the end of" |
10:40:02 | * | nphg quit (Read error: No route to host) |
10:40:17 | PMunch | dadada, not a table, but you can use algorithms.sort to sort a sequence of keys |
10:42:15 | * | nphg joined #nim |
10:43:06 | * | dcmertens quit (Ping timeout: 265 seconds) |
10:47:44 | * | letto_ joined #nim |
10:48:54 | * | letto quit (Ping timeout: 265 seconds) |
10:48:57 | * | avatarfighter quit (Ping timeout: 260 seconds) |
10:56:52 | PMunch | Hmm, could nimsuggest support giving a range instead of just a line/column? |
10:57:19 | PMunch | NimLSP struggles a bit with showing a nice range since it's trying to extrapolate it from the error message.. |
10:58:58 | * | theelous3 joined #nim |
11:04:49 | FromDiscord | <Recruit_main707> cant you have two enums with the same field names????? |
11:08:00 | PMunch | Not any more after pure got removed AFAIK |
11:08:42 | FromGitter | <rishavs> is "case of" compile time evaluated? |
11:09:13 | FromDiscord | <Recruit_main707> wtf, why |
11:09:39 | FromDiscord | <Recruit_main707> (about the enums, case of will be evaluated at compileTime if possible i guess) |
11:10:40 | FromDiscord | <Recruit_main707> {.pure.} does work though |
11:11:44 | PMunch | Oh it does? It might've just been the restriction that you had to use EnumName.EnumValue that got relaxed then |
11:11:59 | PMunch | rishavs, depends on what you put in it |
11:12:02 | * | dadada quit (Ping timeout: 256 seconds) |
11:12:19 | PMunch | If it's a const or a compile-time variable I believe it should be compile-time evaluated like when |
11:13:06 | FromGitter | <rishavs> thanks. its a variable which gets its value from a for loop. |
11:13:41 | * | dadada joined #nim |
11:14:05 | * | dadada is now known as Guest42915 |
11:14:26 | PMunch | Hmm, rudimentary test shows that it doesn't in fact get evaluated at compile-time |
11:15:10 | PMunch | Well, not by the Nim compiler anyways |
11:18:26 | PMunch | As you can see: http://ix.io/2nIq |
11:19:34 | PMunch | I manually checked the generated Nim file and the switch/case in C is there in both cases, but the optimisations enabled with -d:release removes it from the final binary. |
11:19:44 | PMunch | But yeah, Nim doesn't evaluate it |
11:19:55 | PMunch | From a for loop? |
11:21:07 | * | Kaivo quit (Quit: WeeChat 2.8) |
11:21:26 | * | Kaivo joined #nim |
11:22:22 | * | rockcavera joined #nim |
11:27:08 | voltist | I'm getting the very much unhelpful error message `/usr/lib/nim/core/macros.nim(1502, 16) Error: undeclared identifier: 'cn'`. Any ideas as to how I could track down the cause? |
11:28:38 | FromGitter | <bung87> poor way regex \bcn\b |
11:30:03 | voltist | This 'nc' |
11:30:13 | voltist | Could be coming from anywhere in the opencv codebase |
11:30:24 | voltist | So probably not very easy to find |
11:30:31 | voltist | 'cn'* |
11:31:46 | FromGitter | <bung87> it is idenrifier or string? |
11:32:01 | FromGitter | <bung87> sring must double quote |
11:33:13 | voltist | It seems to work if I put it in cSkipSymbol (I'm wrapping stuff with nimterop) |
11:33:20 | voltist | That might come back to bite me though |
11:34:40 | voltist | Great, now I'm getting an error on line 1775 of macros.nim, a 1687 line long file :/ |
11:34:58 | FromGitter | <bung87> the way is simple but takes long |
11:36:45 | FromGitter | <bung87> why affected to macros.nim |
11:45:11 | * | tane joined #nim |
11:49:31 | FromGitter | <apahl> (https://files.gitter.im/nim-lang/Nim/k7iy/image.png) |
11:49:31 | FromGitter | <apahl> (https://files.gitter.im/nim-lang/Nim/k7iy/image.png) |
11:51:16 | FromGitter | <apahl> Sorry about that. Mouse handling failure. |
11:55:53 | * | Tlanger quit (Ping timeout: 256 seconds) |
11:55:59 | * | endragor quit (Remote host closed the connection) |
11:56:06 | PMunch | voltist, are these error messages from the compiler? Or from an editor plug-in? |
11:56:48 | voltist | PMunch: Compiler. I've managed to work around them now though |
11:57:24 | PMunch | Ah, okay |
11:57:54 | alehander92 | guys |
11:58:04 | alehander92 | i am struggling for like good amount of time |
11:58:32 | FromDiscord | <Rika> At? |
11:58:40 | alehander92 | on how to find + and why + is US_EQUAL in monaco docs |
11:59:30 | alehander92 | and why would keyboards use that weird convention: += in american keybaord |
11:59:46 | alehander92 | i am like "probably there is a good historical reason but still weirrrrrd" |
11:59:54 | alehander92 | and finally i manage to *look* at my keyboard |
12:00:09 | alehander92 | and realize that all that time `=` is the actual key `+` is just a shift+the key |
12:00:16 | FromDiscord | <Rika> Lmao |
12:00:25 | alehander92 | and my ctrl++ is just ctrl+= realistically |
12:00:45 | alehander92 | always look for your own errors first people :D |
12:02:08 | PMunch | Haha, nice one |
12:02:16 | PMunch | For me + is actually it's own key |
12:02:24 | PMunch | With ? being it's shift option |
12:02:28 | * | nphg quit (Remote host closed the connection) |
12:02:31 | PMunch | And = being the shift option of 0 |
12:02:46 | * | nphg joined #nim |
12:03:21 | alehander92 | hm interesting |
12:03:32 | alehander92 | have to really keep that in mind |
12:03:39 | alehander92 | how do shortcut mappers do it? |
12:05:39 | PMunch | Do what? |
12:06:01 | * | supakeen quit (Quit: WeeChat 2.8) |
12:06:40 | * | supakeen joined #nim |
12:07:25 | alehander92 | well define the shortcuts |
12:07:41 | alehander92 | e.g. if you can just switch your keyboard layout suddenly |
12:07:47 | * | nphg quit (Ping timeout: 246 seconds) |
12:07:58 | alehander92 | and your ide is set to do ctrl+= |
12:08:06 | alehander92 | i guess that shortcut libs should deal with it somehow |
12:08:23 | PMunch | Well, what they should do is get the scancode of whatever = actually is |
12:08:35 | PMunch | Problem with that is if it's as shift option.. |
12:09:13 | PMunch | Well, I guess what it should do is have scancodes, and then show you whatever is on that key |
12:11:06 | PMunch | So instead of storing say "a" you should store keycode 38 and then use something like XLookupString to show "a". |
12:11:29 | PMunch | That way all the keycodes will be in the same place as you defined when creating the shortcuts |
12:13:40 | * | endragor joined #nim |
12:14:47 | * | vqrs quit (Ping timeout: 246 seconds) |
12:17:27 | * | vqrs joined #nim |
12:23:32 | PMunch | Hmm, given a PNode of a symbol or its value, how do I get the actual type? |
12:24:02 | PMunch | sym.typ.kind is just tyGenericInst, and I haven't been able to actually find the name of the type anywhere.. |
12:26:36 | FromGitter | <rishavs> Is this wrong? I am trying to create a unique set of points; ⏎ ` var unVisitedNodes: set[seq[int]]` ⏎ The compiler is complaining that `ordinal type expected` |
12:30:57 | FromDiscord | <Rika> Use hashset |
12:31:19 | FromDiscord | <Rika> Sets are bitsets |
12:33:04 | FromGitter | <rishavs> thansk |
12:38:35 | alehander92 | PMunch makes sense |
12:38:50 | alehander92 | but on the other hand does one expect that : to be in the same place as defined |
12:39:01 | alehander92 | maybe this would make it work e.g. on cyrillic |
12:39:20 | alehander92 | e.g. i am often there and i dont think i expect most of the shortcuts to work |
12:39:25 | alehander92 | but if i think about it i am not sure |
12:39:38 | alehander92 | yeah in firefox it seems it doesnt matter |
12:41:42 | PMunch | Well at least it would make sure that all the keyboard shortcuts are accessible |
12:42:01 | PMunch | And things like WASD, HJKL, and other positional shortcut will work |
12:42:33 | PMunch | Not so good for mnemonic shortcuts though, like U to undo, C to copy, P to paste, etc. |
12:42:47 | PMunch | Or, well, V to paste :P |
12:44:32 | * | sacredfrog joined #nim |
12:46:25 | * | dcmertens joined #nim |
12:47:01 | alehander92 | yeah :D well not a big deal right, but it is interesting to see different view angles! |
12:48:01 | PMunch | Having a very non-standard I've been forced to think about this quite a bit :P |
12:48:38 | alehander92 | probably ;) |
12:49:01 | alehander92 | i am implementing |
12:49:06 | alehander92 | zoom in / zoom out now |
12:49:25 | alehander92 | and fixing other editor features and thats why i wondered about those kinds of questions |
12:55:11 | PMunch | Ah yeah, for zoom in/out then a symbolic shortcut to + and - obviously makes the most sense |
12:55:29 | PMunch | But mixing mnemonic/symbolic and positional shortcuts across layouts can be tricky |
12:55:39 | * | FromGitter quit (Remote host closed the connection) |
12:55:39 | * | oprypin quit (Quit: Bye) |
12:55:56 | * | oprypin joined #nim |
12:56:08 | * | FromGitter joined #nim |
13:07:16 | * | konvertex joined #nim |
13:07:47 | * | nsf quit (Quit: WeeChat 2.8) |
13:12:45 | * | Vladar quit (Quit: Leaving) |
13:13:06 | FromDiscord | <Recruit_main707> whats worth my time, create a flatbuffers nim code generator (which basically creates types, getters setters, etc for a given .fbs file), or transpile about 6000 lines of code (with a lot of spacing, so lets say its only 2500 |
13:21:03 | dcmertens | I am working on interfacing with a C library. Is there a way to use the result of pkg-config for this library to set up compile-time parameters in nim? |
13:21:20 | dcmertens | I'm following along Nim in Action chapter 8 |
13:21:31 | dcmertens | but that assumes you know the explicit library, headers, etc |
13:23:51 | dcmertens | Note also that when I run pkg-config on my system, I get a *collection* of libraries that need to be linked |
13:24:30 | dcmertens | the library I care about is only one of them, and so would probably be the dynlib |
13:24:43 | dcmertens | but I need to dl_load the other libraries for the library I care about to function |
13:24:53 | dcmertens | so... how do we do that? |
13:30:22 | dcmertens | Oh, and while we're at it, how would I set an additional include path, i.e. -I... |
13:31:05 | dcmertens | Again, all of these bits of information are accessible from pkg-config, so if there is a generic way to execute pkg-config, that'd be great |
13:35:19 | dcmertens | Been reading this, still not sure about these things, though: https://nim-lang.org/docs/manual.html#foreign-function-interface |
13:38:50 | FromDiscord | <SeanOMik> Is there a way I could make a proc that took any type as long as it inherits from a certain custom type. I tried this: ```nim↵proc registerListener[T: object of CustomType]``` but that doesn't compile |
13:39:19 | FromDiscord | <SeanOMik> `implementation of 'event_handler.registerListener() expected` |
13:39:22 | FromDiscord | <SeanOMik> Thats the error ^ |
13:39:31 | FromDiscord | <SeanOMik> (edit) 'Thats the error ... ^' => 'Thats the errorfrom IntelliJ' |
13:39:39 | FromDiscord | <Rika> did you implement it |
13:39:53 | FromDiscord | <Recruit_main707> CustomType is enough iirc |
13:40:07 | FromDiscord | <Recruit_main707> `[T: CustomType]` |
13:40:20 | FromDiscord | <Rika> can you paste the whole proc though |
13:42:28 | FromDiscord | <SeanOMik> Oh sure |
13:43:09 | FromDiscord | <SeanOMik> `proc registerListener[T: CustomType]*(event: T, listener: proc())` |
13:43:18 | FromDiscord | <SeanOMik> Thats the whole definition |
13:43:28 | FromDiscord | <SeanOMik> I dont think you need the actual use of the proc |
13:43:36 | FromDiscord | <SeanOMik> (edit) 'use' => '"contents"' |
13:44:07 | FromDiscord | <SeanOMik> (edit) '`proc' => '```nim↵proc' | '```nim↵procregisterListener[T: ... CustomType]*(event:proc())```' => '```nim↵procregisterListener[T:object of' | 'proc())`' => 'proc())```' |
13:45:14 | FromDiscord | <SeanOMik> Oh |
13:45:19 | FromDiscord | <SeanOMik> I fixed it |
13:45:38 | FromDiscord | <SeanOMik> the `*` needs to be before the [`T: object of CustomType]` |
13:45:44 | FromDiscord | <Recruit_main707> try to not edit the messages, they get duplicated in irc |
13:45:45 | FromDiscord | <SeanOMik> (edit) '[`T:' => '`[T:' |
13:45:51 | FromDiscord | <SeanOMik> Oh oops |
13:47:05 | alehander92 | dcmertens you can pass `--passC` to c compiler and `--passL` to the linker |
13:47:10 | alehander92 | to pass options like include path |
13:47:21 | dcmertens | alehander92, great, thanks |
13:47:23 | alehander92 | also i think `--gcc.exe` for custom path to gcc |
13:47:34 | alehander92 | and something similar for custom path to linker |
13:47:39 | alehander92 | useful for e.g. crosscompiling |
13:49:43 | dcmertens | is that the sort of thing that goes in the nims file? |
13:50:23 | alehander92 | you can include it there yeah |
13:51:04 | * | narimiran joined #nim |
13:58:21 | * | fredrikhr joined #nim |
14:06:05 | * | Vladar joined #nim |
14:16:03 | * | a_b_m joined #nim |
14:16:58 | * | PMunch quit (Quit: leaving) |
14:18:11 | * | abm quit (Ping timeout: 265 seconds) |
14:21:23 | * | leorize quit (Ping timeout: 240 seconds) |
14:22:07 | * | solitudesf joined #nim |
14:25:38 | * | leorize joined #nim |
14:28:48 | * | a_b_m quit (Quit: Leaving) |
14:29:14 | * | Guest42915 quit (Ping timeout: 240 seconds) |
14:30:20 | * | dadada joined #nim |
14:30:44 | * | dadada is now known as Guest14602 |
14:31:25 | FromDiscord | <Recruit_main707> how can i set a field/variable that expects an string or a seq to `nil` |
14:32:31 | FromDiscord | <Recruit_main707> and as a side-note, why the hell is `null` highlighted with nim, have it in mind @Gary M, this also happens with the default plugin |
14:32:43 | FromDiscord | <Recruit_main707> (in vscode) |
14:43:39 | * | haxscramper joined #nim |
14:51:02 | * | waleee-cl joined #nim |
14:54:07 | * | Guest14602 quit (Ping timeout: 246 seconds) |
14:54:22 | Araq | nobody knows why things are highlighted the way they are |
14:54:50 | Araq | a string or seq simply cannot be 'nil', you can use Option[string] instead |
14:59:10 | FromGitter | <rishavs> How would I define a variable as a hash set? ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ doesnt works. [https://gitter.im/nim-lang/Nim?at=5ed1233e549761730b666b8a] |
15:00:19 | * | dadada__ joined #nim |
15:01:05 | * | FromDiscord quit (Remote host closed the connection) |
15:01:19 | * | FromDiscord joined #nim |
15:11:45 | * | oculuxe quit (Quit: blah) |
15:12:00 | * | oculux joined #nim |
15:12:07 | * | dddddd joined #nim |
15:13:57 | FromGitter | <kaushalmodi> How is Nimdoc defined internally? |
15:14:40 | FromGitter | <kaushalmodi> I am trying to understand this error when building docs on Travis: https://travis-ci.org/github/kaushalmodi/std_vector/builds/692596173#L1061 |
15:15:50 | FromGitter | <kaushalmodi> I don't see that error when running it locally |
15:25:56 | * | endragor quit (Remote host closed the connection) |
15:27:11 | * | drewr quit (Ping timeout: 252 seconds) |
15:31:45 | alehander92 | disruptek |
15:31:49 | alehander92 | how is rocket going |
15:38:42 | FromGitter | <kaushalmodi> @timotheecour Would you have an insight why this error is happening on Travis (related to generating dochack.js): https://travis-ci.org/github/kaushalmodi/std_vector/builds/692596173#L1061 ⏎ ⏎ But not locally? |
15:39:41 | FromGitter | <kaushalmodi> Interestingly the same doc generation (using nim devel) is working fine on Travis for a different project: https://travis-ci.org/github/kaushalmodi/version/jobs/692535704#L519 |
15:40:12 | FromDiscord | <Varriount> @Recruit_main707 The better question might be, why do you need the string/sequence to be nil? |
15:41:21 | FromDiscord | <Recruit_main707> i dont like checking for an empty string/seq as an uninitialised string/seq |
15:41:24 | FromDiscord | <Yardanico> @Recruit_main707 fake news, they don't get duplicated since at least a week |
15:41:52 | FromDiscord | <Yardanico> I mean edits are properly handled by ircord with edit diffing |
15:41:52 | FromDiscord | <Rika> use options then |
15:42:01 | FromDiscord | <Yardanico> ^^ |
15:42:12 | FromDiscord | <Rika> doesnt change that the messages get spammed yardanico |
15:42:27 | FromDiscord | <Yardanico> Well there's no real difference |
15:42:38 | alehander92 | yardanico i love the edit functionality, good work |
15:42:49 | FromDiscord | <Yardanico> If you send a new message in discord to correct something it's still a new message |
15:42:59 | FromDiscord | <Yardanico> So what's the difference in the end? |
15:43:12 | FromDiscord | <Recruit_main707> there is |
15:43:25 | FromDiscord | <Recruit_main707> (edit) 'is' => '*is*' |
15:43:28 | FromDiscord | <Yardanico> What difference? |
15:43:52 | FromDiscord | <Recruit_main707> it gets updated in place in discord |
15:43:57 | FromDiscord | <Yardanico> https://media.discordapp.net/attachments/371759389889003532/715953584386080828/Screenshot_20200529-184348.jpg |
15:44:08 | FromDiscord | <Yardanico> @Recruit_main707 well that can't be done for IRC anyway |
15:44:14 | FromDiscord | <Yardanico> So this is out of the question |
15:44:14 | FromDiscord | <Recruit_main707> i know |
15:44:21 | FromDiscord | <Yardanico> I meant there's no difference for irc |
15:44:37 | FromDiscord | <Yardanico> If a user sends a correction message or the bot handles an edit properly |
15:44:53 | FromDiscord | <Recruit_main707> your solution s the best one available |
15:59:27 | * | zacharycarter joined #nim |
15:59:48 | zacharycarter | I'm wondering if going down this path of porting dear imgui to Nim was a good idea |
16:00:12 | zacharycarter | I mean I'm a couple thousand loc into the port at this point - so I almost have something that does the basics |
16:00:33 | zacharycarter | so I guess I'll keep going - but I'm not sure it was wise |
16:02:28 | alehander92 | basically |
16:02:56 | alehander92 | if you want to maintain your own UI lib as a full blown open source project |
16:02:58 | alehander92 | it was wise |
16:03:38 | alehander92 | if it was fun/you learned stuff: probably ok too |
16:04:16 | zacharycarter | well I'm learning things as I go which is definitely a good thing |
16:04:26 | zacharycarter | I'm just not sure if I wanted to do the former haha |
16:04:58 | zacharycarter | but I mean - I guess if people find it useful it will give me incentive to do so |
16:05:09 | zacharycarter | once I get things drawing I think I'll have more motivation |
16:19:25 | FromDiscord | <Pixeye> @Zachary Carter dunno, I've just taken the lib from NIMGL for imgui. Works good: )↵https://i.gyazo.com/c1a92f164d34de02c19cf8517ebd59cf.mp4 |
16:19:32 | Amun_Ra | I'm writing my own retro image viewer just to learn nim, so far the adventure is quite nice |
16:20:37 | zacharycarter | well yeah Pixeye - he's just wrapping cimgui |
16:20:42 | zacharycarter | that's easy enough to do |
16:20:52 | FromDiscord | <Pixeye> ye, I've seen that |
16:20:55 | zacharycarter | and was the route I was going down |
16:20:56 | Amun_Ra | https://retro.rocks/varez/atstneo.png https://retro.rocks/varez/jetpac.mp4 etc. |
16:21:13 | FromDiscord | <Pixeye> I also thought about porting it myself but it's not pragmatic ) |
16:21:25 | zacharycarter | what's not pragmatic about it? |
16:22:36 | FromDiscord | <Pixeye> well, it's not an easy job. Moreover you will need to maintain it. And you have other parts of your engine/stuff to work on ↵+ games XDD |
16:22:59 | FromDiscord | <Pixeye> tons of work |
16:23:58 | zacharycarter | I don't think it's tons of work but yes there are other things I could work on other than this - what's more useful though and something that's deliverable? |
16:24:17 | zacharycarter | I stand a much better chance of delivering a immediate mode GUI library than a 3d game engine :P |
16:24:20 | FromDiscord | <mratsim> whats more useful is for Nim dev to not burn out 😉 |
16:24:50 | zacharycarter | true |
16:25:30 | FromDiscord | <Pixeye> why would you like to make a 3d engine?) |
16:25:43 | zacharycarter | what do you mean? |
16:25:56 | FromDiscord | <Pixeye> what is the purpose ? |
16:26:14 | zacharycarter | to make 3d games with? |
16:26:18 | FromDiscord | <Pixeye> btw I watched your previous attempts 🙂 learned a lot about nim from them 🙂 GG |
16:26:29 | zacharycarter | oh thanks - yeah me too haha |
16:26:39 | zacharycarter | I think only zengine was 3d |
16:26:47 | zacharycarter | but yeah it's a good demonstration of how to write bad Nim code :P |
16:27:19 | FromDiscord | <mratsim> as long as it's pretty when rendering :p |
16:27:19 | zacharycarter | I don't think you really need an engine or much beyond opengl to write 2d games with Nim |
16:27:27 | zacharycarter | haha |
16:32:07 | FromDiscord | <Pixeye> the thing is - would you make games with this engine?) sorry for that questions 🙂 ↵Its always good to "eat your own dog food" cause I've seen a lot engines that were made just to be made |
16:32:28 | zacharycarter | well I don't think there's anything wrong with making something just to make it |
16:32:36 | zacharycarter | as long as you learn something during the process |
16:32:42 | Amun_Ra | indeed |
16:32:56 | FromDiscord | <Pixeye> true |
16:32:57 | zacharycarter | I tend to try to make a game with every library / engine I make even if it's just something simple like space invaders or little demos of features |
16:34:00 | zacharycarter | but yes my intention is to make a game with the project I'm working on now - so I'll probably end up shelving the imgui port and re-focusing on the game development part |
16:34:06 | FromDiscord | <Generic> this is the original meaning behind write games not engines |
16:34:13 | FromDiscord | <Pixeye> : ))) |
16:34:16 | FromDiscord | <Pixeye> yes |
16:34:23 | zacharycarter | yeah and that advice IMO is bs |
16:34:35 | zacharycarter | it assumes everyone has the same goal |
16:34:38 | FromDiscord | <Generic> when people quote it they usually mean that you shouldn't make game engines |
16:34:47 | zacharycarter | I mean obviously |
16:34:53 | FromDiscord | <Generic> when the original context was, make game engines for games |
16:35:12 | FromDiscord | <willyboar> someone must |
16:35:13 | zacharycarter | well I think having a game idea in mind gives your project direction for sure |
16:35:40 | zacharycarter | I don't plan on building an editor for this project - because I don't need one |
16:35:41 | FromDiscord | <Generic> https://geometrian.com/programming/tutorials/write-games-not-engines/ |
16:35:48 | zacharycarter | most of the environments are going to be procedurally generated |
16:35:59 | FromDiscord | <Generic> " These “engines” tend to be little more than an inconsistent and messy amalgamation of random functionality that isn’t terribly practical, robust, or reusable. " |
16:36:19 | FromDiscord | <Generic> "The solution, even if you really want to make an engine, is to make a game instead" |
16:39:09 | zacharycarter | if you want to make a game just use UE4 or Unity or SDL2 |
16:39:14 | zacharycarter | or Godot |
16:39:21 | FromDiscord | <mratsim> and C++? |
16:39:24 | zacharycarter | sure |
16:39:40 | zacharycarter | I mean that's taking the blog post to its logical conclusion |
16:39:57 | zacharycarter | I just think the argument is flawed |
16:40:16 | zacharycarter | like yes - game engines are complex and require a lot of domain specific knowledge to be functional |
16:40:21 | zacharycarter | but you don't gain that knowledge by just writing games |
16:40:21 | FromDiscord | <mratsim> there is the same thing about cryptography, "don't roll your own crypto" then 20 years from now, no one knows how to write a crypto library |
16:40:28 | FromDiscord | <Pixeye> The thing is that many people who tries to write engine part ending trying to bit unity instead of focusing on the game |
16:40:30 | zacharycarter | yeah lol it's a dumb argument |
16:40:42 | zacharycarter | well maybe they're not trying to write games! |
16:40:51 | zacharycarter | maybe they want to learn how to write a game engine |
16:41:13 | FromDiscord | <Generic> yeah the argument is you should make a game, to better understand what an engine needs |
16:41:20 | FromDiscord | <Generic> the engine you write for that game |
16:41:31 | FromDiscord | <mratsim> I would be interested to write a game engine, they I think I would need to write 1 or 2 games before to understand what is in the engine scope and what is so heavily custom that it shoud be on the game side |
16:41:36 | zacharycarter | but he's saying don't write a game engine lol |
16:41:40 | FromDiscord | <mratsim> then* |
16:41:47 | FromDiscord | <Generic> no, he doesn't say that |
16:42:14 | zacharycarter | he says write games and then by the time you're done writing the games you'll have a set of reusable software components that have practical applications |
16:42:31 | zacharycarter | okay - so I've written games with Unity or UE4 or whatever and I don't have any of that |
16:42:44 | zacharycarter | I guess it's time to start writing an engine |
16:43:00 | FromDiscord | <Pixeye> well to be honest to write GOOD game in Unity you will have to write like a lot of extra stuff : ) |
16:43:00 | FromDiscord | <Generic> you should write the engine together with the game |
16:43:12 | * | thomasross_ joined #nim |
16:43:12 | * | thomasross quit (Killed (sinisalo.freenode.net (Nickname regained by services))) |
16:43:12 | * | thomasross_ is now known as thomasross |
16:43:30 | zacharycarter | yes and I agree with that assertion - it definitely helps to have a game project you're developing as you develop a game engine |
16:43:52 | konvertex | Plus, porting your own crappy engine to a console is hell. |
16:44:10 | bung | does js backend support `addr` ? I got `Error: internal error: genAddr` |
16:44:12 | konvertex | Btw. why isn't the sugar `=>` macro included in the prelude? |
16:44:28 | FromDiscord | <Generic> because it's sugar |
16:44:36 | konvertex | So? |
16:44:46 | konvertex | func was included as well. |
16:44:55 | FromDiscord | <Generic> it's meant to be extra |
16:45:11 | konvertex | Why? Are ther certain edge cases it can't handle? |
16:45:15 | bung | no func is differient |
16:45:32 | FromDiscord | <Clyybber> func isn't a macro |
16:45:33 | FromDiscord | <mratsim> @Bung there is no address on JS |
16:45:38 | FromDiscord | <Clyybber> but `=>` is |
16:46:53 | bung | @mratsim thanks, I check it from stream.nim it has ` when defined(js):var x = x;writeData(s, addr(x), x.len)` |
16:47:09 | FromDiscord | <mratsim> that's strange |
16:47:26 | FromDiscord | <mratsim> maybe that changed in the past 3 years? I almost never use the JS backend |
16:47:36 | FromDiscord | <Clyybber> AFAIK there is addr on js |
16:47:59 | bung | some one create a numbers of fix in single PR |
16:48:39 | bung | this month or last month I cant rember |
16:48:44 | * | Trustable quit (Remote host closed the connection) |
16:48:49 | * | tane quit (Quit: Leaving) |
16:49:15 | bung | @Clyybber do you have clue what cause `Error: internal error: genAddr` |
16:49:43 | FromDiscord | <zetashift> I feel like some people like working on engines more than working on games, and that's okay |
16:50:21 | zacharycarter | damn no disruptek stream for 2 days now |
16:50:23 | zacharycarter | is he dead? |
16:50:37 | konvertex | He's using perl6/raku now. |
16:50:39 | FromDiscord | <zetashift> I hope not, but the man moves in mysterious ways |
16:50:40 | FromDiscord | <Clyybber> bung: Hmm, it means there is some error in genAddr, so probably a request to generate addr, where the backend can't handle it yet |
16:50:50 | FromDiscord | <Clyybber> bung: Or is that error coming from the VM? |
16:51:16 | FromDiscord | <Clyybber> @timotheecour: Umm, did the doc fonts change somehow? |
16:51:19 | bung | `nim js src/nimpretty.nim ` this is full command I run |
16:51:53 | FromDiscord | <Clyybber> Hehe, trying to compile nimpretty with js ?:D |
16:52:30 | bung | yes, I seperate it to a new repo modified some code |
16:52:38 | FromDiscord | <Clyybber> ah, I see |
16:53:15 | FromDiscord | <Clyybber> you can try to use nim_temp js src/nimpretty.nim after doing ./koch temp |
16:53:24 | FromDiscord | <Clyybber> Then it will tell you where the error came from |
16:54:43 | * | opal quit (Ping timeout: 240 seconds) |
16:54:43 | bung | ok , so finally I need use koch |
16:55:03 | * | leorize quit (Ping timeout: 240 seconds) |
16:56:10 | * | leorize joined #nim |
16:56:57 | * | opal joined #nim |
17:00:07 | bung | I got `.../nim-#devel/lib/pure/terminal.nim(943, 3) Error: undeclared identifier: 'writeStyled'` |
17:00:25 | bung | `../Nim/koch temp js src/nimpretty.nim ` am doing right ? |
17:00:54 | Yardanico | why "js"? |
17:01:05 | Yardanico | i don't think nimpretty compiles with the js backend and you can clearly see that by the error message |
17:01:13 | Yardanico | it's telling that writeStyled is undeclared for the js backend |
17:01:30 | bung | yeah but I dont import terminal module |
17:01:40 | Yardanico | but nimpretty does |
17:02:27 | Yardanico | also nimpretty imports some compiler modules |
17:02:34 | Yardanico | so I don't think it's easy to compile it with the js backend |
17:03:00 | bung | so `import ./nimpretty/compiler / [idents,lineinfos, msgs, syntaxes, options, pathutils, layouter]` |
17:03:38 | bung | I import using related path, the compiler import from Nim's ? |
17:03:54 | Yardanico | bung: I don't understand what you mean |
17:04:06 | Yardanico | what do you want to do? compile nimpretty with js backend? as I said it's not that easy |
17:04:21 | bung | I mean I've fully seperate nimpretty |
17:04:30 | Yardanico | you can't fully separate it from the compiler |
17:04:36 | Yardanico | since nimpretty *depends* on some parts of the compiler |
17:05:24 | alehander92 | <3 |
17:05:26 | bung | I have all its imported from compiler dir in sub directory |
17:05:26 | alehander92 | oh bung |
17:05:27 | alehander92 | i get it |
17:05:32 | alehander92 | no you cant do that |
17:05:40 | alehander92 | if you want to use it to generate nim from your js tool |
17:05:46 | alehander92 | you need to somehow use c backend code |
17:06:16 | alehander92 | and renderer.nim iirc : not sure if nimpretty.nim is the newer renderer.nim (?) |
17:06:27 | bung | alehander92 then I need write node gyp , but I have no experience with it |
17:07:03 | alehander92 | you're right i never thought about gyp |
17:07:15 | alehander92 | you can always just invoke another binary compiled with c backend |
17:07:20 | * | ftsf quit (Ping timeout: 256 seconds) |
17:07:42 | bung | I modified almost all I need , then I checked my nim repo is old , that's so sad. |
17:07:45 | alehander92 | and using json |
17:07:56 | alehander92 | you can commit in a branch |
17:07:57 | alehander92 | and rebase |
17:08:10 | alehander92 | on the updated e.g. `devel` |
17:09:17 | bung | I just thought pretty is almost about string manipulation , so I trying to see if I can generate a js module |
17:10:38 | alehander92 | well, nope it seems it is very hardly connected to the other compiler modules |
17:10:53 | alehander92 | you need to use the c backend, sorry |
17:15:06 | bung | let me change all import path to related |
17:16:20 | dcmertens | dumb question about for loops. How do I fix `for i in 0 .. ^N:` ? |
17:18:38 | konvertex | Did you mean `for i in 0 ..< N:`? |
17:19:12 | * | chemist69 quit (Ping timeout: 260 seconds) |
17:19:25 | dcmertens | konvertex, yes! Thanks! |
17:20:13 | * | chemist69 joined #nim |
17:22:12 | disruptek | !last clyybber |
17:22:12 | disbot | clyybber spoke in 12#nim 28 minutes ago |
17:26:01 | FromDiscord | <Clyybber> disruptek: Sup! |
17:26:24 | dcmertens | I have constructed a cdouble array in nim and want to pass the "pointer to th array" in C parlance, to a C function that wants double* |
17:26:39 | dcmertens | data.addr doesn't do it |
17:27:02 | dcmertens | that gives an error: 'addr(data)' is of type: ptr array[0..100, cdouble] |
17:27:12 | disruptek | i'm working on this graph thing.. why don't we optimize any unique-node/unique-edge graph with ordinals into an array-based impl? |
17:27:52 | dcmertens | so, what's the most convenient way to build an array of C doubles and then hand them off to a C function that expects double * data? |
17:30:35 | dcmertens | hrm, do I need to do interesting type casting, as in this: https://nim-by-example.github.io/variables/type_casting_inference/ |
17:30:37 | Prestige | dcmertens: like this? https://play.nim-lang.org/#ix=2nKd maybe |
17:30:45 | * | dcmertens checks |
17:31:17 | dcmertens | yeah, Prestige, you agree with the thing I found |
17:31:24 | dcmertens | I'll try! |
17:33:51 | dcmertens | Prestige, I think so |
17:34:03 | dcmertens | I'll know for sure after I figure out my linking issue. :-P |
17:35:47 | bung | oh I got the error where it comming from it calls `unSafeAddr` |
17:37:50 | alehander92 | disruptek oh hi |
17:38:04 | disruptek | yeah, what do you think? |
17:38:31 | alehander92 | isn't array*array a common repr for graphs in competition programming |
17:39:08 | alehander92 | i wasn't good at all at that stuff but iirc "neighbour matrices" and stuff were popular |
17:39:09 | disruptek | i just dunno about the downsides. maybe it shouldn't be the default. |
17:39:21 | alehander92 | adjacency* |
17:39:54 | dcmertens | new question, I'm specifying --clib:ltdl but nim is translating that to a -l flag with an absolute path to my current working directory |
17:40:14 | dcmertens | so --clib:ltdl becomes -l/home/dcmertens/projects/2020/01-12-learning-nim/ltdl |
17:40:35 | dcmertens | but it should just be -lltdl |
17:41:31 | FromDiscord | <Technisha Circuit> If i needed to name a proc with a double underscore, how would i do it? |
17:43:42 | FromDiscord | <Rika> i assume you do not |
17:43:46 | FromDiscord | <InventorMatt> I don't think you can. but in python that was for hidden variables which isn't a problem in nim |
17:43:50 | FromDiscord | <Rika> maybe stropping will work |
17:46:49 | FromDiscord | <Technisha Circuit> What's stropping? |
17:48:02 | FromDiscord | <Rika> backticks |
17:50:42 | FromGitter | <kaushalmodi> ~stropping |
17:50:42 | disbot | no footnotes for `stropping`. 🙁 |
17:52:22 | FromDiscord | <Technisha Circuit> That didn't work when i tried it |
17:56:11 | FromDiscord | <Rika> then dont do it |
17:56:50 | FromDiscord | <willyboar> disruptek we have a conversation about docs in the nimconf channel |
17:57:10 | * | bung quit (Ping timeout: 246 seconds) |
17:59:48 | FromDiscord | <InventorMatt> @Technisha Circuit are you trying to create python magic methods syntax in nim? |
18:00:43 | * | avatarfighter joined #nim |
18:02:01 | FromDiscord | <Technisha Circuit> Maybe :p |
18:02:19 | FromDiscord | <Technisha Circuit> I don't want to transpile it though |
18:12:32 | FromDiscord | <queersorceress> hey so i'm tinkering with building a lua <--> nim bridge and i'm trying to figure out how to make a macro resolve a function pointer from the procdef nimnode, is that possible? |
18:14:12 | * | dadada__ quit (Ping timeout: 256 seconds) |
18:15:19 | * | dadada joined #nim |
18:15:42 | * | bjorob_ joined #nim |
18:15:42 | * | dadada is now known as Guest43919 |
18:18:37 | FromDiscord | <dom96> You likely want to generate an AST corresponding to the code that will resolve the function pointer |
18:20:44 | FromDiscord | <SeanOMik> sent a code paste, see http://ix.io/2nKv |
18:20:45 | FromDiscord | <Clyybber> @queersorceress FYI disruptek is also building a lua <--> nim bridge |
18:20:51 | * | avatarfighter left #nim ("Leaving") |
18:20:53 | * | Avatarfighter_ joined #nim |
18:21:20 | FromDiscord | <dom96> @SeanOMik top-level procs aren't closures, I think that's the problem |
18:21:29 | FromDiscord | <SeanOMik> closures? |
18:21:32 | FromDiscord | <SeanOMik> What are closures? |
18:22:12 | FromDiscord | <dom96> https://nim-lang.org/docs/manual.html#procedures-closures |
18:22:15 | Yardanico | function with an environment |
18:23:20 | FromDiscord | <SeanOMik> Hm |
18:23:21 | alehander92 | ooo |
18:23:24 | alehander92 | nimconf! |
18:23:27 | alehander92 | what are the talks |
18:24:08 | FromDiscord | <SeanOMik> So the only other way would be if I feed it "lambda" functions? |
18:24:34 | FromDiscord | <dom96> you can also mark your proc type with {.nimcall.} |
18:24:42 | FromDiscord | <dom96> (the one in the Table) |
18:25:05 | FromDiscord | <queersorceress> @Clyybber like, an actually bridge, not just wrapping the C header? |
18:25:14 | FromDiscord | <Clyybber> an actual bridge |
18:25:21 | FromDiscord | <SeanOMik> Awesome, its working now |
18:25:23 | FromDiscord | <SeanOMik> Thanks |
18:26:01 | FromDiscord | <Clyybber> @queersorceress Even had a macro that allowed you to write lua inline |
18:26:08 | FromDiscord | <Clyybber> Without quotes :p |
18:26:19 | * | bung joined #nim |
18:26:20 | FromDiscord | <Clyybber> obviously not completely possible since # is comment in nim |
18:26:51 | FromDiscord | <queersorceress> you have a link to it? |
18:27:28 | FromDiscord | <Clyybber> https://github.com/disruptek/lunacy |
18:27:54 | FromDiscord | <Clyybber> its WIP tho, but maybe you want to join forces |
18:28:19 | FromDiscord | <Clyybber> disruptek: ping :D |
18:28:55 | disruptek | sure, go nuts. |
18:29:13 | zacharycarter | no stream today disruptek? |
18:29:23 | disruptek | job hunting. |
18:29:27 | zacharycarter | oooo |
18:29:43 | Yardanico | disruptek: status.im :P |
18:29:49 | Yardanico | 50% /s |
18:30:09 | zacharycarter | someone pay disruptek to finish IC :P |
18:30:20 | disruptek | i need the kind of money that nim doesn't pay. |
18:30:27 | zacharycarter | I'll pitch in $100 |
18:30:36 | zacharycarter | oh that kind of money... |
18:30:51 | * | bung quit (Ping timeout: 256 seconds) |
18:30:59 | Yardanico | disruptek: then java? :P |
18:31:18 | disruptek | clojure if i can. |
18:31:22 | Yardanico | or just write in Nim and pretend it's your own C code |
18:31:25 | zacharycarter | Scala |
18:31:27 | Yardanico | problem solved |
18:34:25 | Avatarfighter_ | Lmao yardanico |
18:35:38 | FromDiscord | <dom96> Hrm, at this point the biggest memory hog on my server is prometheus |
18:35:42 | Yardanico | xd |
18:36:10 | FromDiscord | <SeanOMik> Is there a way I could feed a type into a proc, but not an actual variable of the type? |
18:36:11 | FromDiscord | <dom96> Anyone know how to limit its memory usage? |
18:36:21 | Yardanico | @SeanOMik typedesc[type] |
18:36:26 | Yardanico | or just typedesc |
18:36:59 | Yardanico | https://play.nim-lang.org/#ix=2nKG |
18:37:10 | Yardanico | when comparing you have to use "when" instead of "if" because typedesc doesn't exist at runtime |
18:37:33 | FromDiscord | <Clyybber> @dom96 You can limit how much chunks it keeps in memory |
18:37:43 | FromDiscord | <dom96> how? |
18:37:54 | Yardanico | @SeanOMik or even stuff like that https://play.nim-lang.org/#ix=2nKJ |
18:38:17 | FromDiscord | <Clyybber> @dom96 `-storage.local.memory-chunks=XXX` |
18:38:27 | FromDiscord | <Clyybber> But maybe theres a better way with v2 |
18:38:49 | * | Guest43919 quit (Ping timeout: 246 seconds) |
18:39:07 | * | abm joined #nim |
18:39:13 | FromDiscord | <Clyybber> AFAIR its about 2-3kiBs per chunk |
18:39:21 | Yardanico | @SeanOMik and for more info there's https://nim-lang.org/docs/manual.html#special-types-typedesc-t :) |
18:39:40 | * | Avatarfighter_ quit (Quit: ZNC 1.6.6+deb1ubuntu0.2 - http://znc.in) |
18:40:01 | FromDiscord | <dom96> Looks like `storage.local.target-heap-size` is the new hotness |
18:40:39 | FromDiscord | <Clyybber> I think thats gone in v2 |
18:41:33 | FromDiscord | <SeanOMik> If it doesn't exist at runtime then I dont think it will work in my case |
18:41:35 | FromDiscord | <dom96> ffs |
18:41:40 | Yardanico | @SeanOMik what do you want to do? |
18:41:51 | Yardanico | if you want heterogenous types you might try object variants |
18:41:52 | FromDiscord | <SeanOMik> I'm making an event system |
18:42:01 | Yardanico | object variants might work for your case :) |
18:42:08 | FromDiscord | <SeanOMik> Okay |
18:42:17 | * | Avatarfighter joined #nim |
18:42:31 | FromDiscord | <SeanOMik> But would that require a variable of the custom type? |
18:42:35 | Yardanico | yes |
18:42:39 | FromDiscord | <SeanOMik> Hm |
18:42:42 | Yardanico | if i understand you correctly |
18:42:52 | Yardanico | or you can use inheritance |
18:42:55 | Yardanico | with methods |
18:43:04 | Yardanico | but many people prefer object variants :P |
18:43:19 | FromDiscord | <SeanOMik> I wanted something like this (from C++) ```cpp↵registerEvent<CustomEvent>(lambda)``` |
18:43:21 | Yardanico | e.g. see how a json tree is represented with an object variant |
18:43:22 | Yardanico | https://nim-lang.org/docs/json.html#JsonNodeObj |
18:43:28 | FromDiscord | <dom96> https://stackoverflow.com/questions/58697585/prometheus-2-x-limit-memory-usage no answers 😦 |
18:43:46 | * | dadada joined #nim |
18:44:10 | * | dadada is now known as Guest75956 |
18:46:03 | * | bung joined #nim |
18:47:03 | Avatarfighter | Just curious to know but its not possible to make a proc where one parameter can be multiple types right? |
18:47:12 | Yardanico | Avatarfighter: you can have generics |
18:47:21 | Yardanico | but they're instantiated at compile-time of course |
18:47:25 | Avatarfighter | Yeah hm |
18:47:29 | Avatarfighter | ok thank you |
18:47:33 | Yardanico | https://nim-lang.org/docs/manual.html#generics |
18:47:57 | * | onionhammer joined #nim |
18:48:16 | Avatarfighter | Yeah I've used generics before I just didn't make my proc to work as a generic which is going to be fun to do :P |
18:50:28 | * | bung quit (Ping timeout: 256 seconds) |
18:53:41 | * | bung joined #nim |
18:53:44 | * | Vladar quit (Quit: Leaving) |
18:58:28 | * | bung quit (Ping timeout: 256 seconds) |
18:58:46 | * | bung joined #nim |
19:00:26 | * | aeverr joined #nim |
19:02:51 | * | leorize quit (Remote host closed the connection) |
19:03:17 | * | leorize joined #nim |
19:03:30 | * | bung quit (Ping timeout: 256 seconds) |
19:03:34 | * | Guest75956 is now known as dadada |
19:04:25 | dadada | when getting JsonNodes that are strings and wanting them to be just strings |
19:04:42 | dadada | you often get "string", so with quotes |
19:04:52 | dadada | is there some inbuilt easy quotes removal? |
19:04:58 | FromDiscord | <SoopaKhell> It seems that `os.setCurrentDir` is failing me (https://nim-lang.org/docs/os.html#setCurrentDir%2Cstring)↵I am rewriting my own version of `cd` in nim, but when i run `setCurrentDir(...)` on a directory it doesn't change the directory in my shell after the program execute (I am using zsh.)↵Any advice would be appreciated. |
19:05:04 | dadada | because I think I've rolled my own now multiple times and it is getting annoying now |
19:05:34 | FromDiscord | <SoopaKhell> (edit) 'execute' => 'executes' |
19:06:38 | Yardanico | I think setCurrentDir sets the cwd for the program itself |
19:06:40 | dadada | SoopaKhell: I wouldn't expect the directory in your shell to change, when the program has done its job. I don't believe there are any programs that can do that, it's also a security measure |
19:06:40 | Yardanico | not for the shell |
19:06:48 | Yardanico | dadada: "cd" :P |
19:06:58 | Yardanico | ah right it's builtin into shell |
19:06:59 | Yardanico | im stupid :D |
19:07:23 | Yardanico | there's a way you can do that though, but it's a bit hacky |
19:07:35 | Yardanico | run a shell command from your program :D |
19:07:35 | FromDiscord | <SeanOMik> yardanico, I dont want to create a variable for the custom type that I would have to feed into the method. |
19:07:42 | Yardanico | @SeanOMik ?? |
19:07:51 | FromDiscord | <SoopaKhell> Strange↵Is it possible to make a script that my program would invoke to change the dir |
19:08:00 | FromDiscord | <SeanOMik> We were talking about the event system I wanted to make |
19:08:01 | FromDiscord | <SeanOMik> Above |
19:08:02 | FromDiscord | <SoopaKhell> I also tried execShellCmd |
19:08:22 | FromDiscord | <SeanOMik> https://media.discordapp.net/attachments/371759389889003532/716005011225575434/unknown.png |
19:08:23 | FromDiscord | <SeanOMik> Not sure if irc can show images |
19:08:29 | Yardanico | it can |
19:08:30 | * | bung joined #nim |
19:08:30 | FromDiscord | <SeanOMik> But there's a screen shot |
19:08:33 | FromDiscord | <SeanOMik> Okay cool |
19:08:33 | dadada | SoopaKhell: you're creating a "subshell", that has no effect on the shell the program was executed from |
19:08:47 | FromDiscord | <SoopaKhell> Yeah, that seems to be the case |
19:09:04 | Yardanico | @SeanO well try inheritance then I guess? I really don't understand what you're trying to achieve (I mean how the code will look like) |
19:09:14 | FromDiscord | <SeanOMik> Uhhh |
19:09:17 | FromDiscord | <SeanOMik> I have it on github I think |
19:09:22 | FromDiscord | <Rika> dadada: use getStr instead of $ |
19:09:29 | FromDiscord | <Rika> if the node is a string literal |
19:09:46 | dadada | Rika: thanks, I knew it had to be simpler! |
19:10:04 | FromDiscord | <SeanOMik> Okay here: https://gist.github.com/SeanOMik/9934b22981e7201b201193c9a70b33f5 |
19:10:06 | FromDiscord | <Rika> $ gives the json representation of any json node 😛 |
19:10:13 | FromDiscord | <Rika> yeah its confusing |
19:10:38 | FromDiscord | <SeanOMik> I want to be able to register an event listener |
19:10:51 | FromDiscord | <SeanOMik> I want to feed it a event type |
19:10:57 | FromDiscord | <SeanOMik> Actually, that gist is out of date |
19:11:21 | FromDiscord | <SeanOMik> Okay I just updated the gist |
19:12:37 | Yardanico | for inheritance you need to have "ref object" |
19:12:47 | Yardanico | if you want to runtime dispatch I mean |
19:12:56 | * | bung quit (Ping timeout: 258 seconds) |
19:13:18 | FromDiscord | <SeanOMik> Okay |
19:14:05 | FromDiscord | <SeanOMik> Wait, change the type to `ref object`? |
19:14:10 | FromDiscord | <SeanOMik> Like: ```nim↵type↵ BaseEvent* = ref object of RootObj↵ name*: string``` |
19:14:16 | Yardanico | yeah, but you also need to do more stuff |
19:14:32 | Yardanico | I don't exactly think it would be easily possible to do what you want with a table of procs |
19:14:39 | Yardanico | procs aren't runtime dispatch |
19:14:50 | Yardanico | well there's a way around it I think |
19:14:57 | FromDiscord | <SeanOMik> runtime dispatch? |
19:15:13 | Yardanico | https://nim-lang.org/docs/manual.html#multiminusmethods |
19:16:22 | FromDiscord | <SeanOMik> So a table of methods instead of procs |
19:16:30 | Yardanico | I doubt that this is possible :D |
19:16:50 | Yardanico | did you check other examples? |
19:16:51 | Yardanico | like https://github.com/al-bimani/eventemitter |
19:17:19 | FromDiscord | <SeanOMik> Oh, I didn't see this example |
19:17:21 | Yardanico | or https://gitlab.com/xomachine/metaevents or https://github.com/tulayang/asyncevents |
19:17:52 | * | bung joined #nim |
19:19:59 | * | haxscram` joined #nim |
19:21:05 | * | haxscramper quit (Ping timeout: 246 seconds) |
19:22:12 | * | bung quit (Ping timeout: 256 seconds) |
19:22:53 | * | bung joined #nim |
19:24:14 | * | haxscram` quit (Ping timeout: 246 seconds) |
19:27:39 | * | bung quit (Ping timeout: 260 seconds) |
19:28:26 | * | bung joined #nim |
19:31:24 | Prestige | Is there a reason Nim doesn't have a do while? I know it is easy to implement, I'm just curious |
19:33:34 | Yardanico | does it make sense to have a lock if I know that only 1 thread will acquire that lock anyway? |
19:33:39 | FromDiscord | <Rika> because do is already a keyword 😛 |
19:33:45 | FromDiscord | <Rika> i kid. i do not know |
19:33:57 | Prestige | Yardanico: if you know for a fact then no |
19:34:03 | Yardanico | Prestige: yeah I guess so |
19:34:10 | Yardanico | because spinny used a lock to write the spinner in a thread |
19:34:19 | Yardanico | but since it's only 1 instance running at a time it doesn't make sense |
19:34:28 | Yardanico | (Unless I add ability to have multiple spinners at a time lol) |
19:34:37 | Yardanico | or maybe I should add spinners to https://github.com/de-odex/suru |
19:34:54 | Prestige | Yeah, plan for the future but no need to over engineer it |
19:35:00 | Yardanico | although spinny doesn't require you to update the spinner |
19:35:04 | FromDiscord | <Rika> :thonk: |
19:35:05 | Yardanico | since it starts the spinner in a separate thread |
19:35:10 | Yardanico | so you just do |
19:35:19 | Yardanico | spinner.start(); do work; spinner.success("all done!") |
19:35:28 | FromDiscord | <Rika> should i make suru also do that? |
19:35:45 | Yardanico | I mean you could if you use threads and channels I guess |
19:35:49 | FromDiscord | <Rika> also i kinda dont wanna touch it right now since i still have no solid idea on how to tackle formatting |
19:36:31 | Prestige | @Rika I'm probably just gonna go write a doWhile template that takes the condition up front, I was just surprised it didn't exist already |
19:36:37 | Prestige | Unless I just am not finding it lol |
19:36:43 | FromDiscord | <Rika> we dont have one lol |
19:37:01 | FromDiscord | <InventorMatt> is there an easy way with existing nim to generate new nim files. like converting templates into a new expanded nim file? |
19:37:05 | * | bung quit (Ping timeout: 258 seconds) |
19:37:06 | dom96 | it's an archaic construct that most of the time is not needed |
19:37:22 | Prestige | Yeah I very rarely need or want it |
19:37:51 | FromDiscord | <Rika> @InventorMatt i exploited macros' `repr` and file writing to do that lmao |
19:38:38 | FromDiscord | <Rika> basically generate the new code in a macro, then write the result of `result.repr` into a file. ez new nim file 😛 |
19:38:50 | FromDiscord | <Rika> just make sure you dont have generated symbols 😛 |
19:39:30 | * | bung joined #nim |
19:39:32 | FromDiscord | <InventorMatt> okay, thank I'll look into trying that |
19:42:00 | Yardanico | @Rika spinny is that |
19:42:00 | Yardanico | https://asciinema.org/a/RBw1S4LA5EzBzwU0YVwHZZbs6 |
19:42:18 | Yardanico | that's for https://gist.github.com/Yardanico/343154579666a62a82336385fd491737 |
19:42:29 | FromDiscord | <Rika> spinny is what? |
19:42:34 | Yardanico | link |
19:43:24 | FromDiscord | <Rika> yeah you;re demoing it |
19:43:26 | FromDiscord | <Rika> i can see |
19:43:31 | FromDiscord | <Rika> from tthe preview |
19:43:51 | Yardanico | it's 1000% inspired by https://github.com/sindresorhus/ora |
19:43:55 | * | bung quit (Ping timeout: 246 seconds) |
19:44:17 | FromDiscord | <Rika> oraoraoraoraoraora |
19:44:19 | Yardanico | I mean even spinners in spinny are from https://github.com/sindresorhus/cli-spinners |
19:44:33 | Yardanico | although I converted them into a native nim array from json in my fork |
19:44:45 | Yardanico | https://github.com/Yardanico/spinny/blob/master/src/spinny/spinners.nim |
19:46:11 | FromDiscord | <Rika> looking at cli spinners' gif made me a bit dizzy |
19:46:19 | Yardanico | lol |
19:46:31 | * | bung joined #nim |
19:50:50 | * | bung quit (Ping timeout: 246 seconds) |
19:50:58 | * | abm quit (Ping timeout: 272 seconds) |
19:50:58 | * | dcmertens quit (Ping timeout: 272 seconds) |
19:54:24 | * | bung joined #nim |
19:57:59 | FromDiscord | <Technisha Circuit> How would i use Nim with braces instead of indenting? |
19:58:42 | Yardanico | you can't |
19:58:49 | FromDiscord | <Technisha Circuit> Oof |
20:00:56 | FromDiscord | <Technisha Circuit> How hard would it be to make it so i can use braces instead of indentations in Nim? |
20:01:00 | FromDiscord | <Rika> you can if you can singlehandedly fix the syntax skin support |
20:01:05 | FromDiscord | <Pixeye> embrace yourself! : ) |
20:01:05 | Yardanico | maintain your own syntax @Technisha |
20:01:09 | FromDiscord | <Rika> it would probably extremely hard |
20:01:14 | FromDiscord | <Rika> be* extre... |
20:01:19 | Yardanico | syntax skins were removed but you can maintain it yourself if you're willing to |
20:01:23 | Yardanico | in your fork of Nim I suppose |
20:01:30 | Yardanico | or some nim braces -> nim indentation transpiler |
20:01:45 | FromDiscord | <Pixeye> to be honest I don't see any reason why u need braces |
20:01:50 | FromDiscord | <Pixeye> in nim |
20:01:53 | FromDiscord | <Rika> matter of preference |
20:02:06 | FromDiscord | <Pixeye> ok then I don't want braces in C# : ) |
20:06:57 | FromDiscord | <Gary M> Braces are fairly ugly |
20:09:12 | FromDiscord | <Rika> already said this but matter of preference |
20:09:19 | FromDiscord | <Pixeye> or language |
20:09:26 | disruptek | or sexual proclivity. |
20:09:51 | * | sschwarzer joined #nim |
20:10:15 | FromDiscord | <Technisha Circuit> Uh- |
20:10:19 | FromDiscord | <Technisha Circuit> Okay then- |
20:10:48 | FromDiscord | <Technisha Circuit> I think I am gonna be able to |
20:12:57 | FromDiscord | <Technisha Circuit> (edit) 'I think I am gonna be able to ... ' => 'I think I am gonna be able toimplement braces in Nim with enough effort' |
20:13:24 | bung | `ord` on string means what ? |
20:13:31 | Yardanico | @Tecnisha they already existed |
20:13:45 | Yardanico | bung: it doesn't exist for a string type |
20:14:09 | Yardanico | for "char" it returns the integer value of an ascii character |
20:14:15 | Yardanico | !eval echo ord('A') |
20:14:17 | NimBot | 65 |
20:14:28 | Yardanico | !eval echo chr(65) |
20:14:31 | NimBot | A |
20:15:08 | bung | I got editor hint it as ` range 0..286(TSpecialWord)` |
20:15:10 | FromGitter | <sheerluck> !eval echo chr(128572) |
20:15:12 | NimBot | Compile failed: /usercode/in.nim(1, 10) Error: cannot convert 128572 to range 0..255(int) |
20:15:19 | Yardanico | nim chars are ascii chars |
20:15:20 | Yardanico | not unicode |
20:15:25 | FromGitter | <sheerluck> :( |
20:15:39 | Yardanico | !eval import unicode; echo Rune(128572) |
20:15:42 | NimBot | 😼 |
20:15:53 | FromDiscord | <Rika> why. |
20:15:58 | Yardanico | why what |
20:16:04 | FromDiscord | <Rika> that emoji\ |
20:16:06 | Yardanico | ask sheerluck |
20:16:49 | Yardanico | ok figured out for spinny it would be better if I have each spinner as a different constant instead of an array of consts |
20:16:56 | dom96 | !eval import unicode; echo Rune(128081) |
20:16:59 | NimBot | 👑 |
20:17:01 | Yardanico | :P |
20:17:05 | Yardanico | this way dead code elimintation works in the nim compiler itself |
20:17:27 | sschwarzer | dom96 :-D |
20:21:19 | FromDiscord | <Elegant Beef> What is the nim version of stat? |
20:21:39 | Yardanico | getFileInfo ? |
20:21:43 | Yardanico | os |
20:21:50 | FromDiscord | <Elegant Beef> danke |
20:21:54 | Yardanico | you can also use "stat" directly from the posix module |
20:24:04 | * | narimiran quit (Ping timeout: 265 seconds) |
20:25:31 | bung | I might have to give up the idea compile nimpretty to js , always give error that not easy to figure out. |
20:25:34 | sschwarzer | Yardanico: Would that work on Windows? |
20:25:40 | Yardanico | sschwarzer: stat? no |
20:25:42 | Yardanico | getFileInfo? yes |
20:25:47 | Yardanico | windows is'nt exactly posix :P |
20:26:13 | sschwarzer | Yardanico: That's my point. I think if in doubt, a platform-neutral API should be preferred. :) |
20:26:25 | Yardanico | well I know, but maybe they needed some stat-specific stuff |
20:26:28 | * | smitop joined #nim |
20:27:30 | sschwarzer | Yardanico: By the way, I asked because some time ago I was surprised when someone told me that `mkstemp` in the `posix` module would also work on Windows. |
20:27:32 | Zevv | In case anyone is interested in my async/coroutine adventures: I have a clean tiny async implementation based on ucontext coroutines that is working, and I'm no doing some experiments to see if I can make a macro for continuation passing transformations, which would allow very lightweight coroutines without closures, features or any support from the OS: https://github.com/zevv/nimcsp. It hurts my brain, so if |
20:27:38 | Zevv | anyone wants to help think about this stuff, more then welcome! |
20:28:23 | FromDiscord | <Clyybber> typo in the reponame :p |
20:28:26 | Yardanico | sschwarzer: yes, windows implements that |
20:28:30 | Yardanico | @Clyybber nah |
20:28:37 | FromDiscord | <Clyybber> oh, I'm blind |
20:28:42 | FromDiscord | <Clyybber> haha |
20:28:44 | Yardanico | "Continuation style passing tests" :P |
20:29:03 | FromDiscord | <Clyybber> oh |
20:29:04 | Zevv | yeah, I just re-read that |
20:29:04 | FromDiscord | <Clyybber> but |
20:29:22 | FromDiscord | <Clyybber> Hmm, I more commonly heard CPS for Continuation-passing style |
20:29:27 | FromDiscord | <Clyybber> since you are passing the continuation |
20:29:32 | FromDiscord | <Clyybber> and not the style :p |
20:30:12 | Yardanico | btw is it a good thing to include license of https://github.com/sindresorhus/cli-spinners if I used https://github.com/sindresorhus/cli-spinners/blob/master/spinners.json from there? |
20:30:23 | Yardanico | Like include the license in the while where I have nim version of the same .json file |
20:30:27 | Yardanico | s/while/file |
20:30:28 | sschwarzer | Yardanico: But given it's in the `posix` module, I wouldn't have even looked there for a portable version. (Sorry for being nitpicky. :) ) |
20:30:31 | Zevv | title fix0red :) |
20:31:22 | bung | why it ends with tests? thought like test framework.. |
20:31:33 | Yardanico | bung: what exactly? |
20:31:46 | bung | I mean the csp repo |
20:31:55 | Yardanico | well it's testing this idea |
20:31:55 | bung | `Nim CPS (Continuation Passing Style) tests` |
20:31:59 | Yardanico | hence "tests" |
20:32:08 | * | tdc quit (Ping timeout: 256 seconds) |
20:32:08 | bung | ok |
20:33:35 | Zevv | cmon guys, stop making fun of me |
20:33:38 | Zevv | do that when I'm not here |
20:33:47 | bung | haha |
20:33:50 | Yardanico | Zevv: i worship npeg :P |
20:34:08 | Yardanico | e.g. https://github.com/Yardanico/nim-snippets/blob/master/pkgraph/parse.nim#L10 |
20:34:25 | Yardanico | simple parser to parse any type of .nimble (ini or nims) or .babel file for all require statements |
20:34:56 | Yardanico | also https://github.com/Yardanico/telenim/blob/master/src/telenim/types_gen.nim but it's uglier :P |
20:35:03 | Yardanico | https://github.com/Yardanico/telenim/blob/master/src/telenim/types_gen.nim#L78 |
20:35:05 | FromDiscord | <Rika> i recommend the word "experiment" instead of "test" |
20:35:26 | Zevv | Rika: done :) |
20:35:39 | Zevv | Yardanico: Yeah, I've seen you mention that some times over the last weeks |
20:36:00 | Zevv | Every time someone types 'npeg' on #nim my terminal goes *bip* and I get a yellow line in my logs |
20:36:08 | Yardanico | yeah, also ircord uses it for handling mentions/emojis/channels |
20:36:09 | Zevv | great to hear it's working well for you! |
20:36:26 | Yardanico | in ircord it's this https://github.com/Yardanico/ircord/blob/master/src/utils.nim#L22 |
20:36:28 | Zevv | And you never even filed a bug report |
20:36:34 | Yardanico | Zevv: because it worked :P |
20:36:40 | Yardanico | although sometimes I was confused for a few mins by error messages |
20:36:59 | Zevv | *please* let me know about these cases |
20:37:15 | Zevv | I'm trying pretty hard to make these reliable |
20:37:38 | Zevv | because there is no explicit control flow, it's pretty hard to debug a grammar for a user |
20:37:46 | Yardanico | I think mostly I had issues with "repeat argument matches empty subject" |
20:37:47 | Zevv | so helpful error messages are pretty useful here |
20:37:58 | Yardanico | maybe because I still don't fully understand PEGs :D |
20:38:45 | Zevv | Ah good point; let me see if I have something about that in the docs |
20:39:58 | Zevv | Nope, will add that. That error basically means that NPeg figured out in advance that your grammar would match something without consuming any input. If it's not consuming anyting, it will happily stall at the same place, successfulling matching the same thing forever |
20:40:06 | Zevv | call it "hanging", if you will |
20:40:11 | Yardanico | oh |
20:40:22 | Yardanico | endless loop, interesting :P |
20:41:19 | Zevv | If you make a grammar and tell it to "match a number, a string or zero whitespace", it will do that. But if there is no number or digit, it will then match zero whitespace and not advance through the subject |
20:41:57 | Zevv | This can happen in a lot of cases, but only a few are recognized by analysis beforehand. |
20:42:00 | * | abm joined #nim |
20:42:27 | FromDiscord | <SeanOMik> How would I use object variants and make sure that the object inherits from a certain custom type? |
20:44:08 | FromDiscord | <mratsim> the "kind" tag are set by yourself |
20:45:07 | FromDiscord | <SeanOMik> Well I guess i also need to find out how to use object variants |
20:46:19 | Zevv | This can happen in a lot of cases, but only a few are recognized by analysis beforehand. |
20:46:57 | FromDiscord | <Rika> zevv is lagging |
20:47:16 | Zevv | no, zevv is doing history-up-enter in the wrong terminal |
20:47:27 | Yardanico | :D |
20:51:35 | Avatarfighter | haha |
20:52:20 | * | sasamba joined #nim |
20:52:23 | Prestige | hm so I made a template for a do while construct, is there some way I could have `continue` return back to the condition? |
20:52:47 | Yardanico | Prestige: well if you map do/while to a while loop you have continue for free, no? |
20:53:37 | Prestige | maybe it's just nimsuggest, wonder if it would compile |
20:54:35 | Yardanico | Prestige: isn't do while just this? https://gist.github.com/Yardanico/c310d016b9ace4e446ba5ed544e9dcf2 |
20:54:48 | sasamba | Wtf, i can't just make timeout in AsyncHttpClient, but can in HttpClient. How to make it myself? |
20:54:53 | Yardanico | well there might be issues with scoping though |
20:54:59 | Yardanico | sasamba: you can use withTimeout from asyncdispatch |
20:55:08 | Yardanico | https://nim-lang.org/docs/asyncdispatch.html#withTimeout%2CFuture%5BT%5D%2Cint |
20:55:50 | sasamba | 🤔 |
20:55:51 | sasamba | Thx! |
20:55:56 | * | sasamba left #nim (#nim) |
20:56:05 | Prestige | Yardanico: see https://play.nim-lang.org/#ix=2nLj |
20:56:23 | Prestige | can't use continue |
20:56:52 | Yardanico | sacredfrog: something like https://gist.github.com/Yardanico/aa761852de6b32d8be623bc23b8171af |
20:56:59 | Yardanico | oh shiet he already left lol |
20:57:10 | Yardanico | sorry sacredfrog I didn't mean to ping you :P |
20:57:53 | Yardanico | Prestige: oh I see |
20:58:01 | Yardanico | I know how |
20:58:52 | Yardanico | Prestige: something like https://play.nim-lang.org/#ix=2nLk ? |
20:59:13 | Yardanico | although it's not reliable either :D |
20:59:41 | Prestige | can only continue once? |
20:59:45 | Yardanico | no? |
20:59:55 | Yardanico | it's just that your code will looop forever |
20:59:58 | Prestige | oh |
21:00:01 | Yardanico | since you just continue if x == 3 |
21:00:04 | Yardanico | and don't increase x |
21:00:07 | Yardanico | so you continue forever |
21:00:26 | Prestige | yeah |
21:01:32 | Prestige | was thinking of your example though, would that work as expected? |
21:03:16 | Prestige | huh I guess it does |
21:03:22 | Prestige | I thought it would break down at some point |
21:03:28 | Yardanico | Prestige: yeah i was surprised that it works too a bit :P |
21:03:56 | Prestige | oh I found a weird way to break it actually |
21:04:16 | Prestige | https://play.nim-lang.org/#ix=2nLn |
21:04:22 | Yardanico | oh wait |
21:04:29 | Yardanico | Prestige: what should it output? |
21:04:42 | Prestige | In that case I would want it to not output anything |
21:04:54 | Yardanico | Prestige: https://play.nim-lang.org/#ix=2nLo |
21:04:55 | Prestige | but the body is always executed twice |
21:05:01 | * | disbot quit (Ping timeout: 264 seconds) |
21:05:04 | * | disruptek quit (Ping timeout: 272 seconds) |
21:05:09 | Prestige | oh nice |
21:05:23 | Prestige | that's much better |
21:05:34 | Yardanico | I stole it from https://stackoverflow.com/questions/743164/emulate-a-do-while-loop-in-python :D |
21:05:41 | Prestige | hehe |
21:05:42 | Yardanico | first 4 lines of code in the first answer |
21:05:47 | Prestige | I like it |
21:05:57 | * | abm quit (Quit: Leaving) |
21:06:01 | * | disbot joined #nim |
21:07:01 | * | disruptek joined #nim |
21:07:40 | Yardanico | Prestige: to be a bit more safe you can even do template doWhile(condition: bool, body: untyped) |
21:07:46 | Yardanico | to check that the condition indeed returns a boolean |
21:08:01 | Yardanico | well it'll error at compile-time either way |
21:08:13 | Yardanico | but with that the error will be a bit better |
21:08:34 | Prestige | Thanks |
21:08:54 | Prestige | Maybe we should have this added to the tutorial section for while loops |
21:10:24 | Yardanico | https://forum.nim-lang.org/t/1970 |
21:11:25 | Yardanico | expr -> typed, stmt -> untyped btw |
21:11:27 | Yardanico | (mostly) |
21:11:37 | Prestige | interesting |
21:17:20 | * | bjorob_ quit (Quit: leaving) |
21:17:43 | * | bjornrob1rg joined #nim |
21:17:44 | FromDiscord | <dom96> @Yardanico hah, the amount of people that think you want to change syntax highlighting to yellow |
21:17:50 | Yardanico | XD |
21:18:05 | Yardanico | guess I need to find an orangish yellow |
21:19:37 | * | Jesin quit (Quit: Leaving) |
21:19:57 | FromDiscord | <a2> Is there a discord library in Nim? |
21:20:03 | Yardanico | https://github.com/krisppurg/dimscord |
21:20:23 | Yardanico | the bot which bridges IRC and Discord uses it |
21:20:29 | Yardanico | (FromIRC on discord) |
21:20:35 | FromDiscord | <a2> oo nice |
21:21:28 | FromDiscord | <a2> Is it finished though? |
21:21:41 | Yardanico | well, nothing is finished in our world, but it works pretty well (devel branch) |
21:21:44 | Yardanico | but no, it's not finished :P |
21:21:47 | Yardanico | ping @KrispPurg btw |
21:21:53 | * | Jesin joined #nim |
21:22:55 | FromDiscord | <a2> He seems offline. |
21:23:08 | Yardanico | @dom96 what do you think about #B8860B ? |
21:23:16 | Yardanico | it passes the proximity test |
21:23:27 | Yardanico | it's darkish yellowish orange :D |
21:23:33 | Yardanico | "Dark Goldenrod" |
21:23:45 | Yardanico | #DAA520 (Goldenrod) didn't pass the proximity test sadly :( |
21:24:03 | FromDiscord | <dom96> Send me what that looks like, too lazy to look it up 😛 |
21:24:14 | Yardanico | ah right one sec |
21:24:15 | FromDiscord | <dom96> would be nice if Discord detected these |
21:24:48 | * | solitudesf quit (Ping timeout: 258 seconds) |
21:25:40 | Yardanico | it looks similar to java though |
21:25:41 | Yardanico | https://i.imgur.com/OJADzJR.png |
21:26:39 | FromDiscord | <dom96> That's basically brown to me |
21:26:46 | FromDiscord | <dom96> Don't like it |
21:27:01 | FromDiscord | <Generic> I've said it the last time and I say it again |
21:27:13 | FromDiscord | <Generic> I don't see the point of changing something people are already familiar with |
21:27:45 | FromDiscord | <Generic> if there's no particular advantage of it |
21:27:56 | Yardanico | the advantage is branding |
21:28:29 | FromDiscord | <Generic> to color needs to be shifted around to be distinct anyway |
21:28:47 | Yardanico | well find a color which isn't already there :D |
21:28:47 | Yardanico | https://github.github.io/linguist/ |
21:29:13 | Yardanico | even some "DM" language is really similar to current nim color |
21:29:46 | FromDiscord | <Generic> yes, exactly it's not ideal how ever you put it |
21:29:59 | Yardanico | but that doesn't mean it should be kept the same |
21:29:59 | FromDiscord | <Generic> except the current situation has the advantage that it's established |
21:30:58 | FromDiscord | <Generic> also no language except maybe Go has a color consistent with their branding |
21:31:03 | Yardanico | JS does |
21:31:14 | FromDiscord | <Generic> ok, then JS too |
21:31:20 | Yardanico | and quite a lot of other langs too |
21:31:34 | FromDiscord | <willyboar> ruby |
21:31:38 | FromDiscord | <Generic> a lot of the major languages have completely different colors |
21:31:45 | Yardanico | Python |
21:31:47 | Yardanico | blue is the snake blue |
21:31:56 | Yardanico | https://www.python.org/ you can see it's mostly blue |
21:32:10 | FromDiscord | <willyboar> yeap |
21:32:24 | FromDiscord | <Recruit_main707> boolang also does |
21:32:33 | FromDiscord | <Recruit_main707> (despite being so unkown) |
21:32:39 | Yardanico | yeah it's a cool little language |
21:32:42 | Yardanico | sad that unity dropped it |
21:32:55 | FromDiscord | <Generic> ok, I have to admit it's mostly the language I'm active in (the uncool ones like C++ or Java) which have colors which don't match it's branding |
21:32:56 | Yardanico | ok lemme say this |
21:32:56 | FromDiscord | <willyboar> crystal too |
21:32:58 | FromDiscord | <a2> Zig has orange color just like the logo |
21:33:12 | Yardanico | V (sic!) has the consistent color with it's branding :P |
21:33:18 | FromDiscord | <Recruit_main707> i wouldnt have discovered nim if boo was actively supported though :D |
21:33:24 | FromDiscord | <a2> Language racist |
21:33:37 | Yardanico | @Generic I think Java color is pretty similar |
21:33:42 | Yardanico | check the logo https://www.oracle.com/java/ |
21:34:09 | Yardanico | it's a little more darkish on github though |
21:34:17 | Yardanico | C++ doesn't match, yes |
21:34:19 | FromDiscord | <Generic> it's similar but quite off, also I think the logo used to be more reddish |
21:34:46 | Yardanico | but you know that most people ignore the color on github anyway? :P |
21:35:01 | Yardanico | we just need to keep it separate from other languages most commonly used with nim together |
21:35:04 | Yardanico | which are C and C++ |
21:35:46 | FromDiscord | <willyboar> #fecc06 |
21:36:06 | Yardanico | too close to Parrot |
21:36:25 | * | opDispatch is now known as B4s1l3 |
21:36:27 | * | bjornrob1rg is now known as bjornroberg |
21:36:30 | FromDiscord | <willyboar> #feeb26 |
21:36:33 | * | B4s1l3 is now known as opDispatch |
21:36:43 | Yardanico | same |
21:36:50 | Yardanico | too close to #FFEC25 |
21:37:01 | Yardanico | (used by Dafny) |
21:37:02 | Yardanico | damn Dafny |
21:37:06 | Yardanico | if only they didn't submit their PR |
21:37:26 | FromDiscord | <willyboar> #fefba4 |
21:37:56 | FromDiscord | <a2> Should nim have a logo remake? |
21:38:01 | Yardanico | @willyboar too close to Rascal |
21:38:05 | Yardanico | @a2 nah the logo is fine |
21:38:15 | Yardanico | it represents the history of Nim |
21:38:35 | FromDiscord | <a2> I wonder why is it a crown? |
21:38:39 | FromDiscord | <a2> (edit) 'crown?' => 'crown' |
21:38:41 | Yardanico | because Nim was Nimrod |
21:38:45 | FromDiscord | <willyboar> because of nimrod |
21:38:48 | Yardanico | https://en.wikipedia.org/wiki/Nimrod |
21:38:56 | Yardanico | also Nimble was Babel (and yes it had that name before that JS babel) |
21:39:47 | FromDiscord | <a2> Wow js copycat |
21:40:30 | FromDiscord | <willyboar> lol how many greys |
21:40:37 | Yardanico | they're not greys |
21:40:40 | Yardanico | they're "no color" |
21:40:40 | FromDiscord | <willyboar> how all this pass the tests |
21:40:44 | Yardanico | Data languages don't have a color |
21:40:48 | Yardanico | like XML or JSON |
21:40:52 | FromDiscord | <willyboar> aaaaaa |
21:42:01 | FromDiscord | <willyboar> #c3b008 |
21:42:33 | FromDiscord | <willyboar> lex i suppose |
21:42:38 | Yardanico | worked fine :D |
21:42:45 | Yardanico | lol |
21:42:47 | FromDiscord | <willyboar> really? |
21:42:50 | Yardanico | yes |
21:42:58 | FromDiscord | <willyboar> it's cool color |
21:43:00 | Yardanico | Lex is #DBCA00 |
21:43:23 | FromDiscord | <willyboar> well i think is a nice color |
21:44:12 | Yardanico | @dom96 https://i.imgur.com/gbYkYBr.png |
21:44:16 | Yardanico | I also have a slightly cheating idea |
21:44:18 | * | neceve quit (Ping timeout: 265 seconds) |
21:44:26 | Yardanico | make a color bruteforcer in nim to automatically check against all other linguist colors :P |
21:44:34 | Yardanico | to find yellowish colors which pass the proximity test |
21:44:57 | FromDiscord | <willyboar> I like it |
21:45:03 | FromDiscord | <willyboar> is better than green |
21:47:02 | FromDiscord | <Generic> if the color has to be changed I like this color too over the ones you presented before |
21:47:10 | FromGitter | <kaushalmodi> there's a `withFile` in the manual and tut2; it would be nice to have it in the stdlib too |
21:47:16 | * | agnem joined #nim |
21:47:22 | Yardanico | we have a generic with |
21:47:30 | Yardanico | std/with |
21:47:35 | Yardanico | and it'll be improved with https://github.com/nim-lang/Nim/pull/14484 too |
21:47:36 | FromGitter | <kaushalmodi> yes, I saw that |
21:47:51 | FromGitter | <kaushalmodi> but `withFile` would do the auto open/close of the file handle |
21:48:13 | Yardanico | we won't need auto closing when everyone uses arc btw :P |
21:48:26 | Yardanico | afaik stdlib will be adapted to have `=destroy` for things like sockets or files |
21:48:38 | Yardanico | to automatically close them then the compiler is sure they're not needed anymore |
21:48:40 | Yardanico | when* |
21:49:47 | Yardanico | although destructors currently are not scope based |
21:55:46 | * | lritter joined #nim |
22:02:26 | * | fredrikhr quit (Read error: Connection reset by peer) |
22:03:00 | * | fredrikhr joined #nim |
22:08:57 | * | idf quit (Ping timeout: 265 seconds) |
22:10:54 | * | sschwarzer quit (Quit: leaving) |
22:20:41 | FromDiscord | <Technisha Circuit> You guys thought coding on a phone was bad... |
22:21:55 | FromDiscord | <a2> You code on mobile? |
22:22:02 | Yardanico | it's just not productive, unless you at least have an external keyboard |
22:22:10 | FromDiscord | <a2> That's insane. |
22:22:19 | FromDiscord | <Technisha Circuit> My cousin is learning how to code on ps4 |
22:22:35 | Yardanico | that's still better |
22:22:51 | FromDiscord | <Technisha Circuit> Without a keyboard |
22:22:51 | FromDiscord | <a2> Imagine coding on nokia phone 3310 |
22:22:53 | Yardanico | since you can install linux on ps4 |
22:23:10 | FromDiscord | <Technisha Circuit> He's not using a modded one |
22:23:24 | Yardanico | well then how he's programming? in some game? |
22:23:30 | FromDiscord | <Technisha Circuit> Repl.it |
22:23:35 | Yardanico | ok |
22:23:41 | Yardanico | @a2 reminded me of https://www.youtube.com/watch?v=Yuk46XbvwUY |
22:24:21 | Yardanico | or https://www.youtube.com/watch?v=6vDAN3mnGig |
22:24:24 | FromDiscord | <a2> I just watched a day ago lol |
22:36:21 | dadada | hey |
22:36:37 | dadada | what's up dudes and dudettes |
22:37:26 | FromDiscord | <Rika> good, uh, day? |
22:37:33 | dadada | could Nim some day be smart enough to figure out that a func, that has no side effects, and always returns the same values for the same inputs, could be completely precalculated at compile time for all possible inputs? |
22:37:40 | Yardanico | ~ > dateSat 30 May 2020 01:37:34 AM MSK |
22:37:46 | dadada | I know it could, so this is really a rhetorical question |
22:37:58 | dadada | what I really want to know is, has someone worked on this? |
22:38:16 | dadada | of course we can do it manually using a macro or some other way to precalculate at compile time... |
22:38:28 | Yardanico | you can have a macro maybeConst :D |
22:39:26 | dadada | but it would be awesome if Nim could just figure out that func someFunc(myEnum: AnEnum): string = ... with 20 possible values for myEnum could be precalculted/cached |
22:39:38 | Yardanico | well that'll be quite computation heavy I think |
22:39:39 | dadada | without me the developer needing to spend time on it |
22:40:45 | dadada | Yardanico: right, it will |
22:41:25 | dadada | Yardanico: this is something that you could enable for release builds for best performance |
22:41:31 | FromDiscord | <InventorMatt> couldn't you do a const with a for loop and create a table for that? |
22:41:39 | Yardanico | @InventorMatt it's not about that |
22:41:47 | zacharycarter | he wants the compiler to figure it out itself |
22:41:55 | Yardanico | it's about figuring out in a call like "let a = calculateStuff()" if calculateStuff can be computed at compiletime |
22:41:58 | Yardanico | and do that if it's possible |
22:42:06 | zacharycarter | I mean how long do you want your code to take to compile? |
22:42:26 | dadada | InventorMatt: obviously yes, and I hinted at that, but I'm really about reducing the repetitive work as much as possible, smarter compilers sound nice to me |
22:42:47 | bjornroberg | Like idris? |
22:43:02 | dadada | bjornroberg: idris? |
22:43:31 | bjornroberg | It's a language similar to haskell with quantitative types and whatnot |
22:43:46 | FromDiscord | <InventorMatt> a macro may be able to do that which would at least reduce some of the repetitive work |
22:44:10 | zacharycarter | is it really worth the effort is the question |
22:44:57 | zacharycarter | I think no |
22:45:41 | dadada | InventorMatt: I believe you're right, I'll probably write one like that, the question is just if it shouldn't be a compiler option for release builds --preCalculateFuncsNProcsThatHaveConstantResultsWhenTheyHaveReasonableRangeOfPossibleInputsLikeEnumsOrUInt8OrChar |
22:46:44 | Yardanico | dadada: https://play.nim-lang.org/#ix=2nLP :D |
22:48:16 | Yardanico | uh |
22:48:19 | dadada | Yardanico: cool, I'm just looking for something that's less "hey I'm a special special call!" in your face style :D |
22:48:20 | Yardanico | I don't think it works correctly though |
22:48:34 | dadada | all func/proc calls should just look as usual :D |
22:48:39 | Yardanico | dadada: well I think that might indeed be a nice feature, but a really low-priority one |
22:49:51 | dadada | Yardanico: completely understand :D I think I can do it in a macro/pragma, but before doing that I wanted to ensure that I don't do anything that already was done by someone else, so I asked here, and eventually (implies I don't hurry!) I think this would be a really cool optimization feature |
22:52:18 | * | abm joined #nim |
22:52:54 | dadada | currently I'm adding vscode theme support to moe :D |
22:53:18 | Yardanico | moe as in https://github.com/fox0430/moe ? |
22:53:24 | dadada | yes |
22:53:30 | Yardanico | are you fox0430 ? |
22:53:32 | dadada | no |
22:54:34 | FromDiscord | <willyboar> looks nice |
22:55:00 | Yardanico | there's also https://github.com/paranim/paravim |
22:55:19 | Yardanico | which is the base of https://github.com/oakes/vim_cubed/ :D |
22:57:03 | dadada | I want that moe becomes a great editor for Nim coding... this should be possible, because the bar is very low, I'm sorry, but most editors s uh c, I mean I like vim conceptual, but why do I need a to spend days learning about plugins before I can start to code, the same is true for emacs, and spacevim/spacemacs make it just worse by loading megabytes of plugins that randomly crash on you, and create bloat, my |
22:57:09 | dadada | hope is that you |
22:57:26 | dadada | 'll be able to just USE moe without needing to spend days on howtos/manpages/readmes/downloading/config files |
22:57:29 | Yardanico | dadada: nimlsp already made the situation much better |
22:57:32 | dadada | just install -> be productive |
22:59:35 | dadada | Yardanico: partially, also one reason for me not to really like vim is that I think VimScript is just an inferior choice, that was made out of tradition, which is bad reasoning, and the fact that it's written in C, which is in my opinion a maintenance nightmare and prevents people like me from ever even thinking about contributing |
23:00:17 | FromDiscord | <willyboar> I would give it a try tomorrow |
23:00:23 | Araq | dadada: revive NimEdit :-) |
23:00:26 | Araq | good night |
23:00:33 | Yardanico | good night! |
23:01:44 | dadada | Yardanico: it's not like I can't code in C, I have done that, I know enough about it, and that's exactly why I don't want to, it's making me frustrated to think that people still start new projects in C, ..., I know you CAN do everything in C, make some fine code, but I'm just like why would you torture yourself like that?! This is reason for me alone to develop moe a little as a hobby... fox0430 is very |
23:01:50 | dadada | responsive with the pull requests, so let's just see where this goes :D |
23:03:58 | FromDiscord | <willyboar> what moe means? |
23:04:04 | Yardanico | https://en.wikipedia.org/wiki/Moe_(slang) |
23:04:29 | Yardanico | usually something cute, nice, etc |
23:04:33 | Yardanico | mostly in anime culture :P |
23:04:39 | dadada | willyboar: it's alpha software now, your impressions of it won't be fantastic, but there's path to really nice usability that's not very far, I'd say give it a try in around a year at the current pace, and you might even use it daily |
23:05:35 | zacharycarter | I like C |
23:05:42 | zacharycarter | I don't think C development is tortorous |
23:05:49 | Yardanico | dadada: I think he asked about the name and not the editor itself :) |
23:05:59 | zacharycarter | torturous |
23:06:33 | zacharycarter | but I also enjoy writing Nim and I'm more productive in Nim |
23:07:36 | bjornroberg | moe looks promising! Thanks for mentioning it. |
23:08:18 | dadada | I like C for its history, but given the options that exist now, I think it starts to look like 80s cars look on the streets, yeah they have some cool designes sometimes, although most are bulky, and then you sit in the car and there's no servo for the steering, so when you leave the car again you feel exhausted |
23:09:59 | zacharycarter | I don't know - I interop with a lot of C and read a lot of C - maybe it's because I don't write much of it I don't mind it so much |
23:10:17 | FromDiscord | <dom96> I almost feel like I'm reading Araq's posts https://lkml.org/lkml/2020/5/29/1038 |
23:10:24 | Yardanico | lol :D |
23:11:07 | Yardanico | "People with restrictive hardware shouldn't make it more inconvenient |
23:11:07 | Yardanico | for people who have better resources." |
23:13:08 | dadada | surprising I think I read/heard something about the kernel being very strict on enforcing 80 columns, must have heard wrong |
23:13:22 | dadada | s/surprising/surprising for me |
23:15:54 | * | smitop quit (Quit: Connection closed for inactivity) |
23:16:33 | dadada | "And yes, we do line breaks at some point. But there really isn't any |
23:16:35 | dadada | reason to make that point be 80 columns any more." |
23:16:39 | dadada | - Linus Torvalds |
23:16:52 | dadada | so the question is, where is "some point" now for him? |
23:22:31 | * | abm quit (Remote host closed the connection) |
23:23:41 | * | abm joined #nim |
23:24:37 | * | abm quit (Client Quit) |
23:31:18 | * | NimBot joined #nim |
23:33:01 | FromDiscord | <willyboar> i really like moe |
23:33:59 | Prestige | I agree with Linus here |
23:42:04 | Yardanico | yeah, although you also have to take into the account the context he's talking about |
23:42:11 | Yardanico | it's not just any development, it's kernel development specifically |
23:49:10 | * | fredrikhr quit (Ping timeout: 256 seconds) |
23:52:30 | FromGitter | <Knaque> I'm sure I've asked this before, but I can't remember what the answer was for the life of me. How would I permanently set an environment variable via Nim? (Specifically PATH on Windows, but cross-platform would be ideal.) |
23:53:18 | Yardanico | for windows https://nim-lang.org/docs/winlean.html#setEnvironmentVariableW%2CWideCString%2CWideCString should work |
23:54:01 | Yardanico | ah wait |
23:54:06 | Yardanico | https://nim-lang.org/docs/os.html#putEnv%2Cstring%2Cstring |
23:54:18 | codic | `import os; putEnv("PATH", getEnv("PATH")&":newEntry(DoesWindowsUseColonForPath)")` |
23:54:19 | codic | Something like that probably |
23:54:23 | codic | I'm not sure if that's permanent? |
23:54:34 | Yardanico | ah it's not |
23:54:45 | codic | ah |
23:54:48 | codic | well |
23:55:08 | Yardanico | for windows you have to modify the registry |
23:55:11 | codic | in linux you can write to /etc/environment with root perms for all users or something similar (forgot path) for per user |
23:55:15 | codic | oof |
23:55:18 | codic | the pains |
23:55:26 | Yardanico | https://docs.microsoft.com/en-gb/windows/win32/procthread/environment-variables?redirectedfrom=MSDN |
23:55:31 | Yardanico | "To programmatically add or modify system environment variables, add them to the HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment registry key, then broadcast a WM_SETTINGCHANGE message with lParam set to the string "Environment". This allows applications, such as the shell, to pick up your updates." |
23:55:39 | codic | does nim let you access the reg? |
23:55:50 | Yardanico | https://nim-lang.org/docs/registry.html? :P |
23:56:22 | codic | o |
23:56:36 | Yardanico | also https://github.com/miere43/nim-registry seems to exist |
23:56:50 | codic | ;P |
23:57:02 | codic | why not use the stdlib version tho |
23:57:37 | Yardanico | codic: also, about linux - it's not that simple |
23:57:48 | Yardanico | if you want to set it for one user it's actually quite hard to set it for *all* apps |
23:57:57 | Yardanico | you can set it for the shell, sure, but not all stuff is started from the shell |
23:58:46 | codic | yeah, but /etc/environment is applied for everything on startup |
23:59:07 | codic | It's quite hard to set it per user for all apps, that, yes |
23:59:16 | Yardanico | codic: or /etc/profile on most distrods |
23:59:20 | Yardanico | I usually modify that |
23:59:26 | codic | for example, if i use dri_prime to change my gpu as i do in /etc/environment (DRI_PRIME=1), it's applied to all apps |
23:59:26 | codic | /etc/profile also does that? |
23:59:27 | codic | didnt know |
23:59:42 | codic | if it does ~/.profile should too |
23:59:50 | Yardanico | ~/.profile doesn't do it for all apps |
23:59:58 | Yardanico | only for the shell I think |