00:07:01 | * | jess quit (Quit: K-Lined) |
00:07:34 | * | j joined #nim |
00:08:24 | * | fredrikhr quit (Quit: Client Disconnecting) |
00:09:43 | FromDiscord | <martinium> whats the nim equivalent to python's os.listdir()? |
00:11:10 | * | j is now known as jess |
00:12:33 | FromDiscord | <Yardanico> https://nim-lang.org/docs/os.html#walkDir.i%2Cstring |
00:21:07 | FromDiscord | <martinium> thanks |
00:30:54 | FromDiscord | <Yardanico> Question about toOpenArray - does it create a view into the data without a copy? |
00:37:46 | FromDiscord | <martinium> can openAsync be used with parsecsv? |
00:38:41 | FromDiscord | <ElegantBeef> @Yardanico yes it's a viewSlice |
00:39:07 | FromDiscord | <ElegantBeef> It's just a `ptr elem[start]` and a `len` |
00:39:41 | FromDiscord | <ElegantBeef> I believe i use it for most of the logic in strviewutils |
00:39:50 | FromDiscord | <ElegantBeef> Yep i do |
00:41:11 | FromDiscord | <ElegantBeef> I do believe not using the newRuntime causes issues with it, or it just might be arc/orc that's required |
00:56:32 | FromDiscord | <Livingstone> I'm importing sugar but I get an error saying undeclared identifier |
00:56:56 | FromDiscord | <Livingstone> I also imported it as std/sugar |
00:58:33 | FromDiscord | <Yardanico> In reply to @Livingstone "I'm importing sugar but": What Nim version are you on? |
00:58:56 | FromDiscord | <Yardanico> And can you show more code? What's the error message? |
00:59:09 | FromDiscord | <Livingstone> 1.4.4 |
00:59:23 | FromDiscord | <Livingstone> rror: undeclared identifier: 'collect' |
00:59:39 | FromDiscord | <Livingstone> (edit) "rror:" => "Error:" |
01:00:10 | FromDiscord | <Yardanico> can you show how are you using it? |
01:00:58 | FromDiscord | <Livingstone> var actual = collect(newSeq):↵ for row in fold:↵ row[^1] |
01:01:19 | FromDiscord | <Yardanico> To start off, indentation is wrong |
01:01:29 | FromDiscord | <Yardanico> And please show the error from the compiler |
01:01:44 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2SZP |
01:01:53 | FromDiscord | <Yardanico> Are you sure you have the import at top level in your Nim file? |
01:02:59 | FromDiscord | <Livingstone> import math, std/random, std/sugar, std/sequtils, std/sets, std/tables↵from std/math import sqrt |
01:03:11 | FromDiscord | <Livingstone> is this ok it's how I saw imports written on the nim tutorial site |
01:03:26 | FromDiscord | <Yardanico> Yes that's okay but it can be written in a shorter form |
01:03:34 | FromDiscord | <Yardanico> Can you show the output of the compiler itself? |
01:03:37 | FromDiscord | <Yardanico> Full |
01:03:47 | FromDiscord | <Yardanico> When it shows that error |
01:04:29 | FromDiscord | <Livingstone> /home/livingstone/Desktop/Linearregression.nim(81, 29) Error: undeclared identifier: 'collect' |
01:04:44 | * | nekits071 joined #nim |
01:04:58 | FromDiscord | <Livingstone> that's all it gives me |
01:05:11 | * | Tanger joined #nim |
01:05:20 | * | def-- joined #nim |
01:05:36 | * | sepples_ joined #nim |
01:05:36 | * | mal`` joined #nim |
01:05:40 | FromDiscord | <Yardanico> Do you mind uploading the whole file somewhere? Or just pasting it to e.g. https://play.nim-lang.org |
01:06:05 | * | letto_ joined #nim |
01:06:06 | ForumUpdaterBot | New thread by Elcritch: New Nesper release: v0.6.0 includes Nimble build tasks for ESP32 projects! , see https://forum.nim-lang.org/t/7636 |
01:06:08 | FromDiscord | <Livingstone> how do I share it? |
01:06:52 | FromDiscord | <ElegantBeef> Share button bottom left |
01:06:56 | FromDiscord | <ElegantBeef> Then copy the url |
01:07:11 | FromDiscord | <Livingstone> https://play.nim-lang.org/#ix=2SZQ |
01:07:13 | FromDiscord | <Livingstone> I got it |
01:07:38 | FromDiscord | <Livingstone> the whole file doesnt fit though |
01:07:49 | * | pauwel_k1ak joined #nim |
01:07:53 | * | dgb_ joined #nim |
01:07:54 | FromDiscord | <Livingstone> I'm stupid |
01:09:01 | FromDiscord | <ElegantBeef> Is that error from the compiler or from the editor? |
01:09:15 | FromDiscord | <ElegantBeef> If the latter, compile the code and it points directly do a different error |
01:09:18 | * | giaco__ joined #nim |
01:09:21 | FromDiscord | <ElegantBeef> (edit) "do" => "to" |
01:09:43 | FromDiscord | <ElegantBeef> Line 90 in that example has ` for i in 0..(row.len - 1):` and row is an int |
01:09:58 | FromDiscord | <ElegantBeef> also worth noting you can do `a ..< b` which will do `a..(b-1)` |
01:09:59 | FromDiscord | <Livingstone> compiler |
01:11:05 | FromDiscord | <ElegantBeef> This compiles https://play.nim-lang.org/#ix=2SZS |
01:11:15 | FromDiscord | <ElegantBeef> There was not a sugar issue |
01:11:54 | FromDiscord | <Livingstone> huh weird |
01:12:37 | * | pauwel_kwak quit (*.net *.split) |
01:12:37 | * | letto quit (*.net *.split) |
01:12:37 | * | Jesin quit (*.net *.split) |
01:12:48 | * | def- quit (*.net *.split) |
01:12:48 | * | giaco_ quit (*.net *.split) |
01:12:48 | * | dgb quit (*.net *.split) |
01:12:48 | * | sepples quit (*.net *.split) |
01:12:48 | * | mal``` quit (*.net *.split) |
01:12:48 | * | nekits07 quit (*.net *.split) |
01:12:48 | * | def-- is now known as def- |
01:12:55 | * | nekits071 is now known as nekits07 |
01:26:16 | * | Vladar quit (Quit: Leaving) |
01:30:13 | * | njoseph_ quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
01:30:31 | * | njoseph joined #nim |
01:31:48 | FromDiscord | <Livingstone> any idea that may be giving me this problem or should I reinstall nim |
01:35:03 | * | sagax quit (Ping timeout: 245 seconds) |
01:35:19 | FromDiscord | <Yardanico> The only reason I can think of is that you have multiple Nim installations |
01:35:43 | FromDiscord | <Yardanico> One latest normal and another one installed through the system's package manager |
01:35:59 | FromDiscord | <ElegantBeef> Well `nim -v` should say what ever version is running |
01:36:01 | FromDiscord | <Yardanico> With a much older version |
01:36:36 | FromDiscord | <Yardanico> In reply to @ElegantBeef "Well `nim -v` should": Well stdlib can still resolve to the older version |
01:36:42 | FromDiscord | <ElegantBeef> I suppose |
01:36:53 | FromDiscord | <Yardanico> In reply to @ElegantBeef "Well `nim -v` should": But it's worth a try @Livingstone |
01:41:19 | FromDiscord | <Livingstone> is this right Nim Compiler Version 1.0.6 [Linux: amd64]? |
01:42:13 | FromDiscord | <ElegantBeef> nim stable is 1.4.4 |
01:42:56 | FromDiscord | <Livingstone> I don't understand |
01:43:01 | FromDiscord | <Livingstone> I downloaded 1.4.4 |
01:43:09 | FromDiscord | <Yardanico> as I said |
01:43:25 | FromDiscord | <Yardanico> You probably have it installed through your system's package manager at well |
01:43:51 | FromDiscord | <Yardanico> sudo apt remove nim↵if you're on a debian/ubuntu based distro |
01:45:00 | FromDiscord | <ElegantBeef> Installing languages through the package manager is just a bad time imo |
01:54:19 | FromDiscord | <Livingstone> I'm redoing it now |
01:54:22 | FromDiscord | <Livingstone> thanks guys |
02:10:25 | * | vicfred joined #nim |
02:15:20 | * | abm quit (Read error: Connection reset by peer) |
02:36:20 | * | wasted_youth2 quit (Quit: Leaving) |
02:51:52 | * | vicfred quit (Quit: Leaving) |
02:54:12 | * | gpanders_ quit (Ping timeout: 268 seconds) |
03:15:03 | * | Jesin joined #nim |
03:19:17 | * | lritter joined #nim |
03:24:52 | FromDiscord | <martinium> I am trying to evaluate a regex pattern and if it matches to ignore. |
03:25:01 | FromDiscord | <martinium> sent a code paste, see https://play.nim-lang.org/#ix=2T0h |
03:25:01 | FromDiscord | <martinium> got an error |
03:25:16 | FromDiscord | <martinium> type mismatch regex, bool |
03:33:14 | * | rockcavera quit (Remote host closed the connection) |
03:33:24 | FromDiscord | <ElegantBeef> Well `re` is a constructor for a regex pattern |
03:33:27 | FromGitter | <timotheecour> anyone experiencing unusual CI errors today in the “Install dependencies” stage of several pipelines (linux 32, 64, and OSX) ⏎ (refs https://github.com/timotheecour/Nim/issues/653, https://github.com/timotheecour/Nim/issues/652) |
03:33:51 | FromGitter | <timotheecour> and https://github.com/timotheecour/Nim/issues/652) |
03:34:26 | ForumUpdaterBot | New thread by Lotzz: Question about Macros and AST Documentation, see https://forum.nim-lang.org/t/7637 |
03:35:48 | FromDiscord | <ElegantBeef> Timothee wonder if it's related with bintray apparently getting closed soon |
03:36:03 | FromDiscord | <ElegantBeef> Atleast this was linked on the bintray website https://jfrog.com/blog/into-the-sunset-bintray-jcenter-gocenter-and-chartcenter/ |
03:39:14 | FromGitter | <timotheecour> hmm, that’d be ahead of schedule though |
03:40:44 | FromGitter | <timotheecour> there are 3 independent failures unrelated to nim affecting nim CI really badly since a few days |
03:45:53 | FromDiscord | <ElegantBeef> Yea my experience with CI is forgetting to include the "dont CI" part of the commit message 😄 |
03:57:09 | FromDiscord | <ajusa> Might be a weird question but is it possible to have more than 256 threads in a thread pool? I feel like I tried this earlier and ran into an issue with creating more threads |
03:58:30 | FromDiscord | <treeform> not sure about thread pools, but if you need that many threads you probably want to just manage them directly? I had 50,000 threads running on this computer as a test. |
04:08:25 | FromDiscord | <ajusa> Hm, my thought was that the overhead of a thread in a thread pool is smaller? Might not be correct, but I feel like I read that somewhere |
04:08:37 | FromDiscord | <ajusa> I'll try using normal threads for now though |
04:11:54 | * | spiderstew joined #nim |
04:13:27 | FromGitter | <timotheecour> ah it could be caused by bintray outage, it affects both osx and linux (https://status.bintray.com/) |
04:13:48 | FromDiscord | <ElegantBeef> Ah so i was close! 😄 |
04:14:28 | * | spiderstew_ quit (Ping timeout: 260 seconds) |
04:14:32 | FromDiscord | <martinium> fixed the regex |
04:14:59 | FromDiscord | <martinium> sent a code paste, see https://play.nim-lang.org/#ix=2T0r |
04:15:23 | FromDiscord | <martinium> it keeps checking a .exe file in the directory even with that conditional |
04:16:14 | FromDiscord | <martinium> (edit) "https://play.nim-lang.org/#ix=2T0r" => "https://play.nim-lang.org/#ix=2T0t" |
04:16:16 | FromDiscord | <ElegantBeef> can we see the name? |
04:16:30 | FromDiscord | <ElegantBeef> also `if path.endsWith(".csv"):` |
04:16:36 | FromDiscord | <martinium> name of the nim file |
04:17:56 | FromDiscord | <martinium> hmm may have found the issue |
04:19:58 | FromDiscord | <ElegantBeef> @treeform if you want to bench higher throw a `{.push inline.}` got me almost 20ms increase |
04:20:17 | FromDiscord | <martinium> fixed |
04:20:20 | FromDiscord | <ElegantBeef> In response to that forum post |
04:20:27 | FromDiscord | <martinium> had a non-conformant file in folder.... |
04:20:42 | FromDiscord | <ElegantBeef> `name.cvs.ext`? |
04:35:59 | * | vicfred joined #nim |
04:45:54 | FromDiscord | <treeform> In reply to @ElegantBeef "<@!107140179025735680> if you want": you pushed it on all functions? I tried inline where it made sense, no real change? |
04:46:10 | FromDiscord | <ElegantBeef> I pushed it to everything with the base example and got 10-20ms increase |
04:47:31 | FromDiscord | <treeform> thats strange when I do that I get it to 1554.227 ms which is really slow? |
04:47:39 | FromDiscord | <treeform> where exactly did you put it? |
04:47:44 | FromDiscord | <ElegantBeef> After type defs |
04:48:38 | FromDiscord | <ElegantBeef> Did you run without release or danger? |
04:48:48 | FromDiscord | <treeform> my bad I ran totally wrong thing |
04:48:58 | FromDiscord | <treeform> yeah its 76.718 ms now amazing |
04:49:40 | FromDiscord | <ElegantBeef> Yea since we're just concerned about speed inlining everything doesnt matter much |
04:52:57 | FromDiscord | <treeform> In my prev experiments in my code base inclining to much makes this slower, probably due to always running cold code... |
04:56:15 | FromDiscord | <treeform> In reply to @ElegantBeef "Yea since we're just": Yeah that worked great: https://github.com/treeform/raytracer/commit/2899ea610d3f65c2b4a64aad0a913d4b5cd2a6b9 |
04:59:45 | FromDiscord | <ElegantBeef> Jeez man you really liked typing! 😛 |
05:00:22 | FromDiscord | <treeform> it was tactical ctrl-v |
05:01:34 | FromDiscord | <treeform> ok now we win on speed but what about lines of code? |
05:01:48 | FromDiscord | <treeform> python is the shortest one because it use PIL and does not have to do the image saving? |
05:02:12 | FromDiscord | <treeform> if you can use PIL in python could I use pixie and vmath? |
05:02:22 | FromDiscord | <treeform> that would make nim code shorter then python? |
05:02:49 | FromDiscord | <treeform> because you would get the basic stuff for free/ |
05:02:51 | FromDiscord | <treeform> (edit) "free/" => "free?" |
05:02:56 | FromDiscord | <ElegantBeef> Maybe? |
05:03:09 | FromDiscord | <ElegantBeef> Also if you notice they multiline a bunch of the constructors |
05:04:37 | FromDiscord | <ElegantBeef> If me make a vector/color constructor we'd save a bunch of lines idiomatically |
05:09:13 | FromDiscord | <Livingstone> So I'm parsing a csv file and I'm getting this error unexpected type CSVparser does anyone know what I need to do to correct for this |
05:09:13 | FromDiscord | <treeform> sent a code paste, see https://play.nim-lang.org/#ix=2T0I |
05:09:14 | FromDiscord | <treeform> is that allowed? |
05:11:13 | FromDiscord | <ElegantBeef> Giving us code helps |
05:30:40 | * | Tanger quit (Quit: Leaving) |
06:09:13 | * | narimiran joined #nim |
06:15:48 | * | icebattle quit (Ping timeout: 260 seconds) |
06:16:47 | FromDiscord | <Livingstone> sent a code paste, see https://play.nim-lang.org/#ix=2T0T |
06:17:22 | FromDiscord | <Livingstone> (edit) "https://play.nim-lang.org/#ix=2T0T" => "https://play.nim-lang.org/#ix=2T0U" |
06:17:23 | * | icebattle joined #nim |
06:17:28 | FromDiscord | <ElegantBeef> train is a `seq[float]` you do `train[0]` which returns the first element, then call `.len` |
06:17:30 | FromDiscord | <ElegantBeef> (edit) "train is a `seq[float]` you do `train[0]` which returns the first element, then call `.len` ... " added "on it" |
06:17:52 | FromDiscord | <ElegantBeef> floats do not have a procedure or field entitled `len` |
06:18:03 | FromDiscord | <Livingstone> oh ok |
06:19:26 | FromDiscord | <ElegantBeef> secondly `coef` will not exist in the second loop due to being scoped to the first for loop |
06:20:06 | FromDiscord | <ElegantBeef> Thirdly you declare `coef` as a float then index it, which will cause issues after fixing the second issue |
06:29:01 | ForumUpdaterBot | New thread by Halloleo: Retrieve content from a URL under the JS backend, see https://forum.nim-lang.org/t/7638 |
06:31:40 | ForumUpdaterBot | New Nimble package! zws - A command line interface for shortening URLs with ZWS instances, see https://github.com/zws-im/cli/blob/main/README.md#zws-imcli |
06:33:40 | * | Tanger joined #nim |
06:39:02 | ForumUpdaterBot | New thread by Halloleo: INim is supercalifragilisticexpialidocious!, see https://forum.nim-lang.org/t/7639 |
06:41:40 | FromDiscord | <Livingstone> sent a code paste, see https://play.nim-lang.org/#ix=2T0Z |
06:43:20 | FromDiscord | <Livingstone> (edit) "https://play.nim-lang.org/#ix=2T0Z" => "https://play.nim-lang.org/#ix=2T10" |
06:43:38 | FromDiscord | <ElegantBeef> What is `train`? |
06:44:24 | FromDiscord | <ElegantBeef> Seems to be a `seq[seq[T]]` |
06:44:27 | FromDiscord | <Livingstone> it's a part of a data set with which the algorithm uses to determine a line of regression |
06:44:55 | FromDiscord | <ElegantBeef> Use dumber words i'm not too smart |
06:45:19 | FromDiscord | <Livingstone> basically I'm teaching the program to think by giving it some numbers |
06:45:27 | FromDiscord | <Livingstone> train is the dataset of those numbers |
06:45:34 | FromDiscord | <ElegantBeef> Sure, but what's train's type? |
06:45:43 | FromDiscord | <Livingstone> in python it's a list |
06:45:47 | FromDiscord | <ElegantBeef> Of what |
06:45:52 | FromDiscord | <Livingstone> of floats |
06:45:53 | FromDiscord | <ElegantBeef> Seems a list of lists |
06:46:03 | FromDiscord | <Livingstone> a list of list of floats |
06:46:04 | FromDiscord | <Livingstone> yes |
06:46:06 | FromDiscord | <ElegantBeef> Ok |
06:46:27 | FromDiscord | <Livingstone> so the correct thing would be seq[seq[float]]? |
06:46:39 | FromDiscord | <ElegantBeef> Yes |
06:47:11 | FromDiscord | <ElegantBeef> So that list comprehension just emits a 0.0 `len(train[0])` times? |
06:49:28 | FromDiscord | <ElegantBeef> https://play.nim-lang.org/#ix=2T12 |
06:49:49 | FromDiscord | <ElegantBeef> Atleast this is my understanding based off how i think list comprehension works in python |
06:53:50 | FromDiscord | <ElegantBeef> So uhhh is that right? 😄 |
06:58:26 | FromDiscord | <Livingstone> yeah that's right |
06:58:32 | FromDiscord | <Livingstone> sorry I was just double checking |
07:04:24 | * | krux02 joined #nim |
07:10:30 | FromDiscord | <Livingstone> In reply to @ElegantBeef "Yes": does newsequence create an empty sequence with which stuff is filled and also what if I wanted to make a list of something what would I do for that? |
07:10:35 | * | krux02 quit (Quit: Leaving) |
07:11:30 | FromDiscord | <ElegantBeef> `newSeqWith` takes an integer and a default value |
07:11:55 | FromDiscord | <ElegantBeef> Well it's actually a template so it can take any body of code for the right hand |
07:12:08 | FromDiscord | <ElegantBeef> What do you mean by "something" |
07:12:27 | FromDiscord | <Livingstone> let me just consult my code for a second lol |
07:15:18 | FromDiscord | <Livingstone> ok when I mean something say folds is a list can I make I say newlist = newseqwith(folds) |
07:15:30 | FromDiscord | <Livingstone> and when I say list I mean sequence |
07:15:41 | FromDiscord | <ElegantBeef> Well yea like i said the right hand can be anything |
07:15:47 | FromDiscord | <ElegantBeef> Aslong as it's a value |
07:15:55 | FromDiscord | <Livingstone> ok cool |
07:17:30 | FromDiscord | <ElegantBeef> Like for instance this is completely valid https://play.nim-lang.org/#ix=2T19 |
07:18:24 | FromDiscord | <ElegantBeef> to note you can use `:` to pass the last parameter to calls |
07:18:40 | Prestige | I hadn't seen newSeqWith, that's pretty neat |
07:19:02 | FromDiscord | <ElegantBeef> I mean the real cool stuff is that `:` thing |
07:19:14 | FromDiscord | <ElegantBeef> Being able to turn statements into block statements, just super smart |
07:19:22 | Prestige | Hell yeah |
07:19:29 | Prestige | I love this language |
07:19:45 | FromDiscord | <ElegantBeef> No you dont it doesnt have MI |
07:19:45 | FromDiscord | <ElegantBeef> 😛 |
07:19:54 | Prestige | Haha well I love it anyway |
07:20:02 | Prestige | MI would be great for game dev though |
07:20:09 | FromDiscord | <ElegantBeef> Meh |
07:20:14 | FromDiscord | <ElegantBeef> I've never wanted MI |
07:20:23 | FromDiscord | <ElegantBeef> Give me runtime interfaces and i'm happy |
07:20:51 | Prestige | That would be a good step in the right direction too |
07:21:01 | FromDiscord | <ElegantBeef> Well we got ifaced now |
07:21:22 | Prestige | ifaced? |
07:21:24 | FromDiscord | <ElegantBeef> Plus my janky stuff abusing new concepts |
07:21:31 | FromDiscord | <ElegantBeef> iface |
07:21:34 | FromDiscord | <ElegantBeef> https://github.com/yglukhov/iface |
07:22:24 | Prestige | Hm that's interesting |
07:22:52 | narimiran | if you want your list to be initialized with 0.0 values, no need for `newSeqWith`, 0.0 is the default for `seq[float]` |
07:23:11 | narimiran | @Livingstone, @ElegantBeef ^ |
07:23:11 | FromDiscord | <ElegantBeef> ^ |
07:23:15 | FromDiscord | <ElegantBeef> I was going to mention that |
07:24:06 | FromDiscord | <Livingstone> well I need to do other lists anyway so good to know either way |
07:24:27 | FromDiscord | <ElegantBeef> Yea that's the main reason i mentioned it since i figured it'd come in handy |
07:24:34 | FromDiscord | <ElegantBeef> The entire `setutils` module has useful tools |
07:24:39 | FromDiscord | <ElegantBeef> (edit) "`setutils`" => "`sequtils`" |
07:25:52 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
07:31:03 | * | lritter quit (Ping timeout: 246 seconds) |
07:32:05 | FromDiscord | <Livingstone> Here is what my program is looking like so far if you're interested in machine learning and yeah I know no comments shame on me but if you read the proc names you should get a general idea |
07:32:09 | FromDiscord | <Livingstone> https://play.nim-lang.org/#ix=2T1b |
07:33:18 | narimiran | that is not a valid version |
07:33:36 | narimiran | several errors spotted in `cross_validation_split` |
07:35:14 | ldlework | Nim has enforced exception handling right? |
07:35:21 | FromDiscord | <Livingstone> I know it's not it's just where I am at |
07:37:04 | FromDiscord | <Yardanico> In reply to @Livingstone "Here is what my": Are you sure that you want to parse a .xls (Excel) file with parsecsv? That's not gonna work |
07:37:30 | FromDiscord | <Yardanico> .xls but the question stands |
07:37:35 | FromDiscord | <Livingstone> it wasn't my intention but it's just what ended up happening |
07:37:48 | FromDiscord | <Yardanico> But you wouldn't be able to |
07:38:53 | FromDiscord | <Rika> In reply to @ldlework "Nim has enforced exception": Yes, with the raises pragma I think is what it’s called |
07:39:09 | narimiran | @Livingstone i went through the first 50 lines, here are some comments: Livingstone |
07:39:15 | narimiran | here: https://play.nim-lang.org/#ix=2T1d |
07:39:41 | FromDiscord | <Livingstone> In reply to @narimiran "<@263060627793248278> i went through": thanks |
07:40:05 | FromDiscord | <Yardanico> Lines 54 59 61 are also wrong |
07:40:35 | narimiran | @Yardanico yeah, i did 1-50, you do 51-end :D |
07:40:48 | FromDiscord | <Yardanico> Also it's sequtils not sequitils |
07:41:06 | narimiran | ok, i did lines 19-50, you got me there :D |
07:41:48 | FromDiscord | <Yardanico> I know that not all have the same approach but @Livingstone have you thought of gradually building up a working program and testing that it works at compiles at all times instead of trying to write the whole program and then fix errors? |
07:42:28 | * | lritter joined #nim |
07:42:54 | FromDiscord | <ElegantBeef> Oh yard you're here now |
07:43:02 | FromDiscord | <ElegantBeef> Left a response to your comment 😄 |
07:45:52 | FromDiscord | <Livingstone> In reply to @Yardanico "I know that not": That's how I did it at the start and as this is more of a translation than starting from scratch I didn't feel like I needed to I just commented out sections and worked on the individual procedures |
07:46:25 | FromDiscord | <ElegantBeef> Also yard... that example apparently works |
07:46:25 | FromDiscord | <Yardanico> Fair enough, but you should still check for errors from time to time via the compiler |
07:46:34 | FromDiscord | <ElegantBeef> https://play.nim-lang.org/#ix=2T1g |
07:46:38 | FromDiscord | <Livingstone> I do constantly |
07:46:39 | FromDiscord | <ElegantBeef> It seems to work |
07:47:43 | FromDiscord | <Yardanico> In reply to @ElegantBeef "It seems to work": Well it was reported that it doesn't work with --experimental:strictFuncs which I now think is actually right? |
07:48:24 | FromDiscord | <ElegantBeef> They might've had something else wrong |
07:49:02 | FromDiscord | <Yardanico> No |
07:49:10 | FromDiscord | <Yardanico> With that CLI switch it doesn't work |
07:49:22 | FromDiscord | <Yardanico> But AFAIK we want our stdlib to work with that switch or something |
07:49:37 | FromDiscord | <ElegantBeef> Ok so this is an issue |
07:49:50 | FromDiscord | <ElegantBeef> The CLI switch behaves differently to the pragma |
07:50:06 | FromDiscord | <Yardanico> Yeah, see e.g. the |
07:50:07 | FromDiscord | <Yardanico> https://github.com/nim-lang/Nim/issues/16873 |
07:50:25 | FromDiscord | <ElegantBeef> Oh yea |
07:50:35 | FromDiscord | <ElegantBeef> The issue is that when enabling it in the pragma it happens after the json |
07:50:39 | FromDiscord | <Yardanico> @ElegantBeef the pragma only applies it to user code I think, but the CLI switch to all of the stdlib as well |
07:50:44 | FromDiscord | <ElegantBeef> So it works as is intended but we just have to selectively turn it on/off |
07:50:45 | FromDiscord | <Yardanico> Yeah exactly |
07:51:22 | FromDiscord | <Yardanico> In reply to @ElegantBeef "So it works as": Wouldn't say "as intended", as from this issue I linked it's preferred to be able to use the CLI switch as well |
07:51:46 | FromDiscord | <ElegantBeef> I meant the pragma didnt work differently |
07:51:52 | FromDiscord | <ElegantBeef> Just that i used it after the import json |
07:52:20 | FromDiscord | <Yardanico> It doesn't matter |
07:52:21 | FromDiscord | <ElegantBeef> i can only say introduce a new flag `--strictFuncStdlib` which overrides the strict funcs in the stdlib |
07:52:24 | FromDiscord | <Yardanico> Even if you use it before json |
07:52:40 | FromDiscord | <Yardanico> as the pragma in your code it won't behave the same as the CLI switch |
07:52:49 | FromDiscord | <Yardanico> you can check it yourself |
07:52:54 | FromDiscord | <ElegantBeef> Oh i did put it before |
07:52:55 | saem | @Yardanico: thanks for the PR! 😄 |
07:53:09 | FromDiscord | <Yardanico> np :) |
07:53:47 | FromDiscord | <ElegantBeef> So we've figured out the actual issue now just need some elegant solution, where is clyybber to give yet another solution 😛 |
07:54:19 | FromDiscord | <ElegantBeef> Although i think this is desired |
07:55:00 | FromDiscord | <Yardanico> we need to annotate the [] proc in JSON with noSideEffect (I mean inside the proc) |
07:55:09 | FromDiscord | <Yardanico> Because it doesn't mutate the argument on its own |
07:55:25 | FromDiscord | <Yardanico> https://github.com/nim-lang/Nim/commit/48f29972210612b41cb6d98122672b1713edc907 like here |
07:55:30 | FromDiscord | <ElegantBeef> as i've said strict func isnt just about "does it mutate" |
07:55:43 | FromDiscord | <ElegantBeef> It's does it get a mutable view into the object that was passed as an immutable |
07:56:04 | FromDiscord | <Yardanico> but the actual code doesn't get a mutable view |
07:56:18 | FromDiscord | <Yardanico> so we need to annotate [] in JSON with noSideEffect inside then |
07:57:03 | FromDiscord | <ElegantBeef> Well you can call procedures from funcs no problem |
07:57:11 | FromDiscord | <Yardanico> It's not that |
07:58:33 | FromDiscord | <Yardanico> Here comes the nesper notification |
07:59:18 | * | PMunch joined #nim |
07:59:27 | FromDiscord | <ElegantBeef> Doesnt nim automatically create noSideEffect procedures from those that dont mutate global state, atleast i though that's what Araq said after strict funcs were released |
07:59:37 | FromDiscord | <Yardanico> In reply to @ElegantBeef "Doesnt nim automatically create": Yes, but check that commit again |
07:59:40 | FromDiscord | <Yardanico> To see what I'm talking about |
08:00:46 | FromDiscord | <Yardanico> Or https://github.com/nim-lang/Nim/issues/15851 for another example |
08:01:19 | FromDiscord | <ElegantBeef> Ah it's like the disabling of thread analysis |
08:01:48 | ForumUpdaterBot | New Nimble package! nesper - Nim wrappers for ESP-IDF (ESP32), see https://github.com/elcritch/nesper |
08:02:02 | FromDiscord | <Yardanico> @IDF |
08:02:11 | FromDiscord | <Yardanico> @idf35 |
08:03:25 | idf | wow i have been packaged |
08:03:55 | FromDiscord | <ElegantBeef> Wow |
08:04:30 | FromDiscord | <ElegantBeef> Are we going to have 2 embedded repos in TMWN 😛 |
08:05:56 | FromDiscord | <Yardanico> Oh right I forgot about it |
08:06:04 | FromDiscord | <Yardanico> I'll also probably add https://github.com/Yardanico/cosmonim |
08:06:40 | FromDiscord | <ElegantBeef> Yard maybe add stdlib label to that issue now that we know it's not related to strict funcs other than that they're too strict 😛 |
08:07:32 | FromDiscord | <ElegantBeef> Cosmopolitan was made for nim their logo is a honey badger |
08:07:47 | saem | Tried to grok the strict func issue the subtlety is still escaping me. |
08:08:26 | FromDiscord | <ElegantBeef> The issue is mainly just that strict funcs is too strict so some things in the stdlib are considered impure and cause a compiler error |
08:08:35 | PMunch | Hmm, would cosmopolitan with Nim be the perfect malware combination? |
08:08:46 | FromDiscord | <ElegantBeef> Things that are known to be non mutating can be annotated with `{.noSideEffect.}` |
08:08:50 | FromDiscord | <ElegantBeef> Hello pmunch |
08:08:56 | PMunch | Hi |
08:09:10 | FromDiscord | <Rika> No it won’t |
08:09:11 | FromDiscord | <ElegantBeef> Have you seen my Pico stuff, it's all your fault, showing off your keyboard stuff 😛 |
08:09:23 | PMunch | Ooh, no I haven't |
08:09:29 | FromDiscord | <Rika> Cosmo only allows for POSIX api even on windows I believe... |
08:09:30 | saem | I wonder if the effect analysis is incorrect? |
08:09:38 | FromDiscord | <Yardanico> @PMunch not really, the binaries are much more unusual and it's harder to use OS specific API |
08:09:48 | FromDiscord | <Yardanico> @Rika you can use OS APIs |
08:09:50 | FromDiscord | <ElegantBeef> https://github.com/beef331/picotemplate |
08:09:52 | PMunch | I'm redoing my bathroom, so most of my attention is on that at the moment.. |
08:09:56 | FromDiscord | <Yardanico> E.g win32 |
08:10:09 | FromDiscord | <ElegantBeef> Ah explains why you've been non existent here |
08:10:35 | FromDiscord | <ElegantBeef> Examples exist in that repo, and i've got the stdlib over here https://github.com/beef331/picostdlib |
08:10:51 | FromDiscord | <ElegantBeef> Though i havent got tiny usb to compile yet |
08:10:51 | saem | I was wondering were PMunch was, as well. |
08:10:56 | PMunch | @Yardanico, unusual binaries might not be a bad thing for malware. But I guess unless you really want to target the small percentage of Linux/Mac users then it would be better to just write Windows specific stuff |
08:10:59 | FromDiscord | <whisperdev> What is the fastest regex engine for Nim? |
08:11:01 | FromDiscord | <ElegantBeef> Nor do i know if resus works 😄 |
08:11:09 | * | gpanders joined #nim |
08:11:14 | FromDiscord | <Yardanico> @whisperdev the default one I guess - re? |
08:11:19 | FromDiscord | <Yardanico> PCRE is quite fast |
08:11:24 | PMunch | @ElegantBeef, I mean I was logged on for like 8 hours yesterday, so not exactly gone :P |
08:11:27 | FromDiscord | <Yardanico> There's nim-regex that's pure Nim but it's slower |
08:11:33 | PMunch | Just not as much in the afternoon |
08:11:39 | FromDiscord | <ElegantBeef> You logged in during my sleep time then |
08:11:44 | FromDiscord | <ElegantBeef> So that's like gone |
08:11:45 | PMunch | But its good to know that you miss me when I'm gone :) |
08:11:48 | FromDiscord | <whisperdev> I have decided to use nim-regex because it's easier to ship my program |
08:11:58 | FromDiscord | <Yardanico> yeah that's the main thing with it |
08:12:05 | FromDiscord | <Yardanico> It's much nicer to have a pure Nim package |
08:12:10 | PMunch | I should really get a Pico |
08:12:25 | FromDiscord | <ElegantBeef> Certainly since i need someone else to help debug this shite 😄 |
08:12:27 | FromDiscord | <Yardanico> So if the majority of your runtime isn't related to regexes then nim-regex will do fine |
08:12:34 | Prestige | PMunch: pi pico? |
08:12:35 | FromDiscord | <Yardanico> For some things you can also use npeg |
08:12:42 | FromDiscord | <ElegantBeef> Yes |
08:12:46 | PMunch | @Prestige, yeah |
08:12:57 | FromDiscord | <ElegantBeef> Prestige is apparently disregarding my links |
08:12:59 | PMunch | That's the thing @Elegant has wrapped :) |
08:13:06 | Prestige | I just glanced at chat :P |
08:13:08 | FromDiscord | <Yardanico> Does anyone know if zevv abandoned Nim? |
08:13:19 | PMunch | More or less |
08:13:24 | PMunch | He's doing Elixir now |
08:13:34 | PMunch | With disruptek |
08:13:41 | FromDiscord | <Yardanico> That's sad |
08:13:43 | PMunch | I don't think he's entirely gone though |
08:13:47 | FromDiscord | <Yardanico> npeg :) |
08:13:57 | * | fredrikhr joined #nim |
08:14:18 | PMunch | Yeah npeg is too good to go, if anything I'll take over maintaining it myself! |
08:14:52 | FromDiscord | <ElegantBeef> Honestly though i'm surprised how little work it took to get the pico to run nim |
08:15:08 | FromDiscord | <Yardanico> that's what you get with the C backend :) |
08:15:21 | FromDiscord | <ElegantBeef> Yep something that doesnt even know it's digesting Nim |
08:15:25 | PMunch | But I don't think he's completely gone, but the recent conflicts have unfortunately driven quite a few of the old-school Nim people off :( |
08:16:13 | PMunch | @ElegantBeef, yeah it's pretty neat. The teensy and arduino stuff I've been doing has been surprisingly easy once you've got the basics set up. |
08:16:46 | PMunch | And once you have it set up it's pretty much the same as just writing normal Nim, which is really cool |
08:16:59 | FromDiscord | <ElegantBeef> The most annoying part is the use of preprocessors and trying to process what it actually is |
08:17:15 | PMunch | What do you mean? |
08:17:26 | FromDiscord | <ElegantBeef> One second |
08:17:38 | FromDiscord | <whisperdev> How do I get all the captures with nre? |
08:17:46 | FromDiscord | <ElegantBeef> https://github.com/raspberrypi/tinyusb/blob/e0aa405d19e35dbf58cf502b8106455c1a3c2a5c/src/class/hid/hid_device.h#L170-L258 |
08:17:53 | FromDiscord | <whisperdev> Say I have a multiline output and I want to get all the matches from that. |
08:17:57 | PMunch | Oh by the way, we should really set up some kind of list of nim.cfg files for different platforms |
08:18:00 | FromDiscord | <ElegantBeef> I was trying to get tiny usb to work, seen that and went "Nope" |
08:18:24 | FromDiscord | <ElegantBeef> What do you mean? |
08:18:44 | saem | I too am interested in knowing that |
08:18:45 | PMunch | Oh wow, those are terrible |
08:19:00 | PMunch | Would be much nicer as a Nim template ;) |
08:19:09 | PMunch | What I meant by the nim.cfg thing? |
08:19:14 | FromDiscord | <ElegantBeef> Yea |
08:19:14 | saem | Yeah |
08:19:30 | FromDiscord | <ElegantBeef> i'm just using `--os:standalone --cpu:arm` |
08:19:45 | FromDiscord | <ElegantBeef> Still using cmake here |
08:19:52 | FromDiscord | <Yardanico> not even os:any + arc?! |
08:19:54 | PMunch | Ah, I guess it's more of an issue with AVR and uch |
08:19:55 | FromDiscord | <Yardanico> Blasphemy |
08:20:00 | FromDiscord | <Yardanico> Burn at stake |
08:20:06 | PMunch | This is what I use for the Teensy 2.0: http://ix.io/2T1m |
08:20:10 | FromDiscord | <ElegantBeef> I couldnt get `os:any` to compile iirc |
08:20:20 | saem | Am with Yardanico on this one. |
08:20:29 | PMunch | Yeah I also had some trouble with os:any |
08:20:30 | FromDiscord | <ElegantBeef> I'm using arc |
08:20:41 | FromDiscord | <Yardanico> In reply to @ElegantBeef "I couldnt get `os:any`": What was the error? |
08:20:53 | FromDiscord | <ElegantBeef> Let me get it for you |
08:21:06 | FromDiscord | <ElegantBeef> I take it back it didnt error |
08:21:29 | FromDiscord | <ElegantBeef> Though i do have to use malloc |
08:21:41 | FromDiscord | <Yardanico> -d:useMalloc |
08:21:59 | FromDiscord | <ElegantBeef> How else would i know i needed to? |
08:22:00 | FromDiscord | <ElegantBeef> 😄 |
08:22:02 | PMunch | Hmm, now I switched to os:any and it works just fine.. |
08:22:08 | FromDiscord | <Yardanico> Xd |
08:22:21 | FromDiscord | <ElegantBeef> Yea must've just been early step issues i conflated to os:any |
08:22:30 | PMunch | Ah, I have also added -d:useMalloc it seems |
08:22:49 | FromDiscord | <ElegantBeef> Without malloc you get told to port the memory manage |
08:22:50 | FromDiscord | <ElegantBeef> (edit) "manage" => "manager" |
08:23:07 | FromDiscord | <ElegantBeef> So that's probably the reason i swapped to standalone since it got further without malloc |
08:23:08 | PMunch | What's the difference between standalone or any by the way? |
08:23:21 | FromDiscord | <ElegantBeef> But then i hit the ram limit with standalone + nim's allocator |
08:23:56 | FromDiscord | <ElegantBeef> Also pmunch i am using templates to ensure people cannot fuck up proc definitions for these weakly bounded functions they have |
08:24:03 | PMunch | I get this error with standalone and no useMalloc: error: size of array 'tyArray__2k7c2ydq7o33Y9aVO5jv8Xw' is too large |
08:24:05 | FromDiscord | <Yardanico> @PMunch any is less limited |
08:24:21 | FromDiscord | <ElegantBeef> Might resolve some of my issues i had then |
08:24:25 | PMunch | @ElegantBeef, what do you mean? |
08:24:38 | saem | BTW, anyone tackle having multiple versions of the same module in one project especially for various transitive dependencies? |
08:24:44 | FromDiscord | <ElegantBeef> So the tinyusb implementation uses weakly binded functions for callbacks |
08:24:54 | FromDiscord | <ElegantBeef> https://github.com/beef331/picostdlib/blob/master/src/picostdlib/tusb.nim#L169 |
08:25:07 | FromDiscord | <ElegantBeef> I've got these templates to ensure users do not have to spell the C name properly one bit |
08:25:57 | FromDiscord | <ElegantBeef> I probably have to add `noConv` or similar to be super safe here |
08:26:20 | FromDiscord | <ElegantBeef> But yea `attribute ((weak))` is weird |
08:26:24 | FromDiscord | <Yardanico> For callbacks you usually cdecl no? |
08:26:30 | FromDiscord | <Yardanico> C callbacks |
08:26:31 | PMunch | Oooh, so you just have to name them something specific? |
08:26:35 | FromDiscord | <ElegantBeef> Yep |
08:27:03 | PMunch | Your way is much better |
08:27:30 | PMunch | But maybe a pragma macro would be better? |
08:27:46 | FromDiscord | <ElegantBeef> Idk, this was quicker |
08:27:53 | PMunch | Oh for sure |
08:28:16 | FromDiscord | <ElegantBeef> I was just after "Can i get it to actually become a usb device, and the answer was a resounding "Fuck no you dont know C" |
08:28:37 | PMunch | Haha :P |
08:28:55 | PMunch | That's why I use the tiny USB library thing for my keyboard at the moment |
08:29:05 | PMunch | I want to change that at some point though |
08:29:42 | FromDiscord | <ElegantBeef> Get a pico and swap to it for your driver so we can push Nim onto it 😛 |
08:30:19 | FromDiscord | <ElegantBeef> It's dual core dude, that means you can emulate a commedore 64 and have a keyboard all in a single small board |
08:30:38 | saem | Life goals |
08:31:45 | PMunch | Haha |
08:33:11 | FromDiscord | <ElegantBeef> Also are you wrapping libraries like me? Grab an example implement all the functions it calls, run the example and hope it shares the same output? |
08:33:31 | PMunch | I mean my goal is to have my keyboard only running over i2c, so I can swap out the controller willy-nilly |
08:34:00 | PMunch | Yeah that sound about right for what I do |
08:34:02 | FromDiscord | <ElegantBeef> It's even worse when something like `hello_resus` it's supposed to print to the usb debugger, but i dont see anything on the C example nor my Nim one |
08:34:22 | PMunch | Then you haven't connected your USB debugger correctly :P |
08:34:23 | FromDiscord | <ElegantBeef> I dont know if it works with usb debugging or i messed up |
08:34:32 | FromDiscord | <ElegantBeef> It's how i'm powering it |
08:35:13 | PMunch | Huh, kinda weird that it is MicroUSB and not USBC |
08:36:00 | PMunch | Ugh, shipping is more expensive than the chip.. |
08:36:46 | FromDiscord | <whisperdev> Say I have a multiline output and I want to get all the matches from that.How do I do that? |
08:38:35 | FromDiscord | <Solitude> https://nim-lang.org/docs/nre.html#findAll%2Cstring%2CRegex%2Cint |
08:38:40 | PMunch | I mean an article like "How to get more out of your Pi Pico with Nim" could be great for publicity |
08:39:14 | PMunch | Comparing Nim to MicroPython and showing how you can do things just as easily with a much smaller footprint |
08:39:26 | FromDiscord | <ElegantBeef> And static typing |
08:39:37 | FromDiscord | <ElegantBeef> And faster |
08:39:43 | PMunch | Yeah |
08:40:43 | PMunch | Cheapest I can find the Pico with shipping and import taxes is 11.5 CAD |
08:41:23 | FromDiscord | <ElegantBeef> Yea my order was like 24CAD and half of that was shipping |
08:41:39 | PMunch | For one Pico? |
08:41:41 | FromDiscord | <ElegantBeef> Got a bread board, headers and the pico |
08:41:46 | PMunch | Ah right |
08:41:53 | Prestige | Idk what I'd do with one of those tbh |
08:42:05 | FromDiscord | <ElegantBeef> Help me port the stdlib 😉 |
08:42:51 | FromDiscord | <ElegantBeef> The big thing for me is that can be a usb device |
08:43:11 | FromDiscord | <ElegantBeef> The cheapest before that i knew of was the teensy and those are like 4/5 times the price |
08:43:48 | PMunch | Yeah, that alone makes it super interesting for keyboard dev |
08:43:58 | PMunch | I mean it's way overpowered for it, but still |
08:46:37 | FromDiscord | <ElegantBeef> The one annoying thing i've found is that they're trolly with the pin layouts |
08:46:59 | FromDiscord | <ElegantBeef> 2 gpio, 1 ground, 4 gpio, 1 ground, 4 gpio, |
08:47:36 | FromDiscord | <ElegantBeef> So you have fun finding the square solder points |
08:48:53 | PMunch | Haha, yeah for some reason they tend to do that.. |
08:49:23 | PMunch | The best is stuff like the Teensy where the labels don't correspond to the names they have given them in Arduino |
08:49:50 | PMunch | Not a big issue when connecting directly as I do with Nim, but still |
08:50:11 | FromDiscord | <ElegantBeef> Yea for me i just throw an image on my screen of the bottom of the board which has silk screen on it |
08:50:39 | FromDiscord | <ElegantBeef> yes due to how this board is flashed, you have a top side which you need to see |
08:51:14 | FromDiscord | <ElegantBeef> plug it in whilst holding the bootsel button to enter flash mode which then the mass storage device appears and you can drop the uf2 onto |
08:51:44 | PMunch | Oh right, it had that weird system |
08:51:58 | FromDiscord | <ElegantBeef> One detractor is yea you have to hit a button to flash it |
08:52:29 | PMunch | That's the same with the Teensy |
08:52:38 | PMunch | But I think there is a way to trigger it |
08:53:20 | FromDiscord | <ElegantBeef> They also seem very suggestive that you should use a second pico to debug it over serial uart |
08:56:48 | FromDiscord | <Yardanico> and you should get the 3rd one in case one of the first two breaks :) |
09:00:59 | * | Tanger quit (Remote host closed the connection) |
09:12:14 | * | Lord_Nightmare quit (Quit: ZNC - http://znc.in) |
09:12:28 | FromDiscord | <KnorrFG> i remember reading that there were certain groups of types, ie number, which contains all ints and floats, etc, that u could use to restrict generic params, but i dont remember the name any more, what was it? |
09:12:39 | FromDiscord | <ElegantBeef> `SomeNumber` |
09:12:58 | FromDiscord | <KnorrFG> and what was the name of that concept, so i can look up the other groups? |
09:12:59 | FromDiscord | <ElegantBeef> The generic groups start here https://nim-lang.org/docs/system.html#SomeSignedInt |
09:13:06 | FromDiscord | <KnorrFG> ah, ty |
09:13:10 | FromDiscord | <ElegantBeef> They're just typeclasses |
09:13:57 | PMunch | Damn {.push inline.}, aggressive move there @Elegant: https://github.com/treeform/raytracer/blob/master/nim/story.md |
09:14:55 | FromDiscord | <ElegantBeef> Why we're after speed |
09:15:22 | FromDiscord | <ElegantBeef> Procedure calls take time, if you remove all of them you've got a massive binary but speeed |
09:15:30 | PMunch | I like how he went from "faster than C. Great! Job done." at 164ms average and then just threw in a couple more simple things and dropped down to 80ms average :P |
09:15:43 | PMunch | Faster than C? Eh, lets just say twice as fast! |
09:15:58 | FromDiscord | <ElegantBeef> To be fair the C version doesnt agressively inline |
09:15:59 | PMunch | I mean yeah.. |
09:16:11 | * | Lord_Nightmare joined #nim |
09:16:20 | PMunch | Would be interesting to see the binary sizes |
09:16:23 | FromDiscord | <ElegantBeef> But we went from being super slow to being respectable |
09:16:38 | PMunch | I mean it went 10x from just -d:release.. |
09:16:43 | FromDiscord | <ElegantBeef> A lot of that was just not making something heavily iterative in danger |
09:16:47 | FromDiscord | <ElegantBeef> (edit) "danger" => "debug" |
09:18:02 | PMunch | I'm leaning towards adding a compilation hint that says "This is a debug version, for speed and benchmarking, please enable -d:release or -d:danger" |
09:18:24 | FromDiscord | <ElegantBeef> Well the one file had the release |
09:18:29 | FromDiscord | <ElegantBeef> it was just the .bat that didnt |
09:20:39 | FromDiscord | <ElegantBeef> But that was a fun repo and treeform got a nice story |
09:21:02 | * | xet7 joined #nim |
09:24:52 | PMunch | Hmm, did you even try {.noinit.} on the ObjectIntersect? |
09:25:51 | FromDiscord | <ElegantBeef> I didnt try much |
09:26:37 | FromDiscord | <ElegantBeef> I looked at it went "Eh this is too much for me to analyze, through inline on it and called it a day" |
09:26:43 | FromDiscord | <ElegantBeef> (edit) "through" => "threw" |
09:27:44 | FromDiscord | <ElegantBeef> I'm terrible with quotes tonight |
09:29:26 | FromDiscord | <enthus1ast> Do you know if there's is a matrix chat protocol sdk/client for nim? I've started to work on o e and was looking for a wrapped Libolm and there is one. So I wonder if I missed the nim matrix library. |
09:29:46 | PMunch | Damn just tried --gc:arc without changing the code (and adding -d:danger), dropped from 157ms to 100ms |
09:30:17 | * | Nuc1eoN joined #nim |
09:30:59 | PMunch | Eh, noinit didn't seem to do much. I guess mratsim fixed the bug where it wouldn't properly detect if it was needed or not |
09:32:15 | Oddmonger | is there a gui lib working with bare sdl2 ? I mean, nothing to install , except sdl2 (i use Vladar version) and the gui lib |
09:32:23 | FromDiscord | <ElegantBeef> Oh i think i just found easy perf increase |
09:32:39 | FromDiscord | <Goel> sent a code paste, see https://play.nim-lang.org/#ix=2T1H |
09:35:12 | * | vicfred quit (Quit: Leaving) |
09:37:15 | FromDiscord | <ElegantBeef> Ah nvm i'm dumb |
09:37:33 | FromDiscord | <ElegantBeef> I dont think Nim really has an equivalent |
09:37:38 | PMunch | Huh, with {.push inline.} it only grew from 36K to 39K |
09:38:00 | PMunch | But only dropped from 88 to 80ms for me |
09:38:08 | euantorano | Another case of showing how great the Nim stdlib is: https://benhoyt.com/writings/count-words/#performance-results-and-learnings :) In simple tasks like this, Nim makes life too easy |
09:38:14 | FromDiscord | <ElegantBeef> Look at me with my super fancy schmancy cpu! |
09:38:30 | PMunch | Huh? |
09:38:40 | FromDiscord | <ElegantBeef> I get 94ms |
09:39:15 | PMunch | Not sure if my i7-4770k is considered fancy nowadays |
09:39:25 | PMunch | It's not even overclocked :P |
09:39:25 | FromDiscord | <ElegantBeef> Ah shit we're in the same punching class |
09:39:46 | FromDiscord | <ElegantBeef> I have a xeon1231v3 which is basically your cpu without an igpu and slightly underclocked |
09:40:42 | FromDiscord | <ElegantBeef> Yea i really like having a stdlib full of usefull stuff |
09:41:03 | FromDiscord | <ElegantBeef> If you dont scroll through the stdlib every so often and go "Oh cool this exists" are you really a nim programmer? |
09:41:23 | FromDiscord | <ElegantBeef> ~~Especially with 1.6 when enum/setutils get stable~~ |
09:41:32 | FromDiscord | <Rika> In reply to @euantorano "Another case of showing": Nothing in the conclusion about Nim though |
09:41:36 | PMunch | You don't know the stdlib by heart? |
09:41:47 | FromDiscord | <ElegantBeef> I havent been here as long as you sorry |
09:41:51 | FromDiscord | <ElegantBeef> I'll try harder next time |
09:42:02 | PMunch | Haha, just kidding :P |
09:42:11 | PMunch | I know the parts I use often pretty well though |
09:42:25 | euantorano | Rika: Yeah, the post was written before we contributed a Nim version and seems they only update the list of versions and table of results |
09:42:30 | PMunch | And wait, what's changing in enum/setutils? |
09:42:37 | FromDiscord | <ElegantBeef> We're getting them 😄 |
09:43:17 | FromDiscord | <Rika> What’s in it |
09:43:29 | FromDiscord | <ElegantBeef> Setutils having `yourSet[value] = true` and `yourSet.complement` which inverts the set(even holey enum ones) |
09:44:09 | FromDiscord | <ElegantBeef> https://nim-lang.github.io/Nim/setutils.html |
09:44:19 | FromDiscord | <ElegantBeef> Oh also toSet |
09:44:28 | FromDiscord | <ElegantBeef> Forgot that was the intial starter |
09:45:26 | FromDiscord | <Yardanico> https://github.com/nim-lang/Nim/pull/16067 |
09:45:28 | FromDiscord | <ElegantBeef> Fullset is a holey enum safe version of `{A..Z}` where it only includes actual values |
09:45:33 | FromDiscord | <Yardanico> https://media.discordapp.net/attachments/371759389889003532/821318253082443786/unknown.png |
09:46:12 | FromDiscord | <Yardanico> works with nim check too |
09:46:16 | FromDiscord | <ElegantBeef> Nice |
09:46:40 | FromDiscord | <ElegantBeef> But 1.6 is having a bunch of goodies or atleast prospect of goodies |
09:46:58 | FromDiscord | <ElegantBeef> Might finally get that `iteratable[T]` so we dont need to do `toSeq(table.values)` |
09:48:23 | saem | I have some misgivings a about that one, maybe I should take type witnesses or at least give trying to understand them another go. |
09:48:47 | FromDiscord | <ElegantBeef> Not a clue |
09:48:58 | FromDiscord | <ElegantBeef> I like the premise of it since it makes less ergonomic issues |
09:49:23 | FromDiscord | <ElegantBeef> Looking at the forum posts about "Why does thing.iterator.toSeq fail to compile" |
09:49:49 | saem | The goal is a good one, but the way it's achieved, I'm less certain. |
09:50:09 | saem | I read it |
09:50:34 | PMunch | Looks like an interesting release indeed |
09:50:58 | FromDiscord | <ElegantBeef> Yea, i'm going to bed now |
09:51:02 | FromDiscord | <ElegantBeef> Buh bye |
09:51:09 | saem | There is another couple posts that end in someone (can't recall the name) describing how the initial attempt was very close. |
09:51:19 | saem | I should give sleeping another go too |
09:53:04 | FromDiscord | <Rika> In reply to @ElegantBeef "Might finally get that": Iterable? |
09:55:11 | * | sz0 quit (Quit: Connection closed for inactivity) |
09:57:21 | FromDiscord | <Yardanico> @Rika https://github.com/nim-lang/Nim/pull/17196 |
09:59:15 | FromDiscord | <Rika> Why lowercase |
09:59:29 | FromDiscord | <Rika> Other type classes aren’t lowercase |
09:59:53 | FromDiscord | <Rika> Eh okay |
10:02:49 | FromDiscord | <Yardanico> @Rika don't ask me :P |
10:03:02 | * | Jjp137 quit (Ping timeout: 264 seconds) |
10:03:59 | * | tane joined #nim |
10:15:38 | FromDiscord | <Yardanico> would it make sense to add "assert a.len > 0" to `sample` procs in random? |
10:15:53 | FromDiscord | <Yardanico> like https://github.com/nim-lang/Nim/pull/17031 but for `sample` so that the assert comes from the sample proc and not from rand |
10:16:53 | FromDiscord | <Yardanico> right now it's Error: unhandled exception: /home/dian/Things/Nim/lib/pure/random.nim(312, 10) `x.a <= x.b` [AssertionDefect] |
10:31:32 | ForumUpdaterBot | New thread by Drkameleon: Compiling Nim project for arm/arm64, see https://forum.nim-lang.org/t/7641 |
10:42:49 | FromDiscord | <XxDiCaprioxX> Hi, can someone recommend me a package for opening a file dialog? |
10:42:51 | FromDiscord | <clyybber> @Yardanico hmm, I think this way is better for now, because it's not immediately clear that 1..0 should have a negative len |
10:43:26 | FromDiscord | <Yardanico> @clyybber well I meant that if an empty array/seq is passed to `sample` an nicer assert would be shown |
10:43:52 | FromDiscord | <clyybber> ah, yeah |
10:44:10 | FromDiscord | <clyybber> sure, makes sense |
10:44:29 | FromDiscord | <clyybber> oh haha @Yardanico my bad, I misread |
10:46:18 | m4r35n357 | Hi Guys, trying to define a function variable, I am using "var u_p: proc(p: Parameters, cd: float) = update_p_auto" where update_p_auto is a concrete function, but got error: Error: type mismatch: got 'proc (p: var Parameters, d: float){.noSideEffect, gcsafe, locks: 0.}' for 'update_p_auto' but expected 'proc (p: Parameters, cd: float){.closure.}'. What am I doing wrong? |
10:47:16 | FromDiscord | <clyybber> your update_p_auto has a var param |
10:49:13 | m4r35n357 | clyybber great catch! |
10:49:46 | m4r35n357 | I always get sidetracked by the curly braces and miss the obvious stuff! |
10:49:52 | FromDiscord | <clyybber> hehe :D |
10:52:50 | FromDiscord | <Araq> offtopic, but too interesting: https://www.electronicdesign.com/markets/automotive/article/21121197/ada-and-riscv-secure-nvidias-future |
11:00:49 | * | idf quit (Ping timeout: 276 seconds) |
11:08:22 | FromDiscord | <clyybber> neat! |
11:08:54 | Clonkk[m] | Is it possible to specialize generic proc ? ``proc x[I: static[int]]() = echo "generic"; proc x[I: static[0]]() = echo "specialized" `` |
11:09:29 | liblq-dev | no, but you can use a when statement inside of the proc |
11:09:35 | * | Vladar joined #nim |
11:10:00 | * | liblq-dev < https://matrix.org/_matrix/media/r0/download/matrix.org/RFGqkWZWIVBINuVCweglRxpE/message.txt > |
11:10:35 | FromDiscord | <mario2> Is it possible to highly optimize nim for embedded programming? Like have nim make C or C++ code that uses as little memory as possible? |
11:10:43 | liblq-dev | @mario2 yes |
11:10:58 | liblq-dev | you can disable the GC completely, or better yet, use ARC |
11:11:00 | FromDiscord | <mario2> How then? |
11:11:06 | FromDiscord | <mario2> Thanks |
11:11:17 | FromDiscord | <mario2> Anything else to squeeze out performance? |
11:11:30 | liblq-dev | well not really |
11:11:36 | liblq-dev | other than this nim is as fast as C |
11:11:48 | FromDiscord | <mario2> What about using nim style pointers? |
11:11:56 | liblq-dev | you can also avoid seqs, strings, refs |
11:11:59 | Clonkk[m] | <liblq-dev "no, but you can use a when state"> Yes, but then you can't adapt a potential protoype. What I had in mind was something like this : |
11:12:13 | Clonkk[m] | Probably not possible then :) |
11:12:23 | liblq-dev | Clonkk: yeah that's not possible |
11:12:39 | liblq-dev | or maybe 🤔 |
11:12:56 | FromDiscord | <mario2> What about using nim style pointers? Would that be able to further optimize nim to use less memory and less computing power? |
11:13:07 | Clonkk[m] | <FromDiscord "<mario2> What about using nim st"> Nim pointers are identical to C pointers |
11:13:10 | liblq-dev | wdym nim style pointers? |
11:13:41 | Clonkk[m] | <liblq-dev "or maybe 🤔"> Don't give me hope ^^ |
11:13:51 | FromDiscord | <mario2> According to rosetta code: "There are two types of pointers in Nim. Safe, garbage-collected references and unsafe pointers. " |
11:13:52 | Clonkk[m] | I'll spend my day on it if there's a possibility :D |
11:14:14 | FromDiscord | <Rika> You mean “ref” versus “ptr” |
11:14:15 | Clonkk[m] | <FromDiscord "<mario2> According to rosetta co"> pointers are pointers. reference are garbage collected heap allocated value. |
11:14:16 | FromDiscord | <Rika> ? |
11:14:17 | FromDiscord | <clyybber> In reply to @Clonkk "<liblq-dev "no, but you": @Yardanico huh, it seems to have ate this |
11:14:30 | FromDiscord | <Yardanico> no |
11:14:32 | FromDiscord | <mario2> So don't use refs? |
11:14:32 | FromDiscord | <Yardanico> thats matrix |
11:14:48 | FromDiscord | <Yardanico> @clyybber https://media.discordapp.net/attachments/371759389889003532/821340716994527282/unknown.png |
11:14:53 | FromDiscord | <Yardanico> it's the same as discord->irc replies work |
11:14:59 | FromDiscord | <Yardanico> i don't embed the full context, so does the matrix bridge |
11:15:05 | Clonkk[m] | <FromDiscord "<clyybber> In reply to @Clonkk ""> Multiline message do not get handled too well from Matrix to discord from what I gather |
11:15:29 | FromDiscord | <clyybber> Ah ok |
11:15:40 | FromDiscord | <clyybber> thought we handled matrix -> discord directly |
11:15:46 | * | haxscramper joined #nim |
11:15:47 | FromDiscord | <Yardanico> we do on two channels with t2bot.io |
11:15:53 | FromDiscord | <mario2> Is there any time I should be using unsafe pointers? |
11:15:57 | FromDiscord | <Yardanico> FFI |
11:15:59 | liblq-dev | Clonkk: nah that doesn't seem possible after all |
11:16:04 | FromDiscord | <Yardanico> low-level OS APIs |
11:16:08 | liblq-dev | i was hoping you could create a compileTime proc that returns a type |
11:16:11 | liblq-dev | but nada |
11:16:16 | FromDiscord | <Yardanico> fuck me |
11:16:18 | Clonkk[m] | Sad |
11:16:21 | FromDiscord | <Yardanico> "hoping you" |
11:16:22 | FromDiscord | <Yardanico> ho PING |
11:16:23 | Clonkk[m] | Thanks anyway |
11:16:24 | FromDiscord | <Yardanico> AAAAAAAAAAAAAAAAAAAAAAAAAA |
11:16:59 | liblq-dev | ho @Yardanico |
11:17:08 | liblq-dev | hahahaha comedy |
11:17:15 | FromDiscord | <Yardanico> https://media.discordapp.net/attachments/371759389889003532/821341333783969812/unknown.png |
11:17:18 | FromDiscord | <Yardanico> this is what I'm talking about |
11:17:22 | liblq-dev | lmaooooooo |
11:17:33 | liblq-dev | that's effective suicide |
11:17:40 | liblq-dev | calling yourself "you" |
11:17:45 | liblq-dev | pinged them again, noice |
11:17:47 | FromDiscord | <Rika> Guess you don’t check if there’s a space before ping |
11:17:51 | FromDiscord | <mario2> Let me ask you. If I'm making a large program and want to use as little memory as possible, can I still compile it for an embedded program even though it's on a modern system? |
11:17:51 | FromDiscord | <Rika> You didn’t |
11:17:52 | FromDiscord | <Yardanico> @liblq-dev no you didn't |
11:17:56 | FromDiscord | <Yardanico> it's the "hoping" |
11:18:00 | FromDiscord | <Yardanico> I have a match for "ping X" |
11:18:02 | liblq-dev | frick |
11:18:03 | FromDiscord | <Yardanico> "hoping X" matches that |
11:18:05 | liblq-dev | XDDD |
11:18:09 | PMunch | @mario2, there are a couple ways Nim can outperform C on embedded devices. Or rather outperform the C that you would typically write. And this is meta-programming. You can create patterns that look nice but boil down to super optimised things, or write procedures to pre-calculate values and such. So your Nim code would be nice and readable, but end up as very optimised C code. |
11:18:50 | PMunch | @mario2, that last question didn't make much sense |
11:19:11 | PMunch | You won't use less memory emulating an embedded device on a modern system than running your program natively.. |
11:19:16 | FromDiscord | <mario2> I just want to make games and not end up with games that require 8+ GB of memory and thought I could optimize things further by compiling as if I was on an embedded system. |
11:19:44 | FromDiscord | <Rika> It doesn’t work that way |
11:19:55 | liblq-dev | re: can I still compile it for an embedded program even though it's on a modern system? |
11:19:55 | liblq-dev | that's not really how embedded development is done. you'd have to impede your PC version's functionality a lot as things like dynamic allocation are a big no-no for embedded |
11:20:09 | Clonkk[m] | <PMunch "@mario2, there are a couple ways"> Doesn't generating code and calculating values at compile time increase binary size ? |
11:20:16 | PMunch | Embedded uses less resources because the programmers that program against embedded knows that they don't have all that many resources. |
11:20:17 | liblq-dev | also: RAM is there to use it |
11:20:23 | liblq-dev | not as poorly as electron apps of course |
11:20:29 | liblq-dev | but if you need it - take it |
11:20:39 | PMunch | @Clonkk[m], depends on the code you generate and the values you pre-compute |
11:20:42 | FromDiscord | <Rika> In reply to @Clonkk "<PMunch "<@819365433332727828>, there are": Yes, but if the runtime cost is higher you’d rather the binary size cost |
11:20:46 | PMunch | You can end up saving space |
11:21:07 | FromDiscord | <mario2> I just want the final processor requirements and system requirements to be as low as possible for my games. |
11:21:25 | FromDiscord | <mario2> So I thought I could compact it by disabling GC. |
11:21:29 | FromDiscord | <Yardanico> no |
11:21:32 | FromDiscord | <Rika> Then code efficiently, no way around it I guess |
11:21:42 | FromDiscord | <Rika> Disabling GC will increase RAM usage |
11:21:48 | FromDiscord | <Yardanico> you can use ARC and then you don't really have a "GC" |
11:21:48 | liblq-dev | @mario2 i thought the same when i was just starting out and i'll just say that you'll end up hitting brick walls every two steps if you do that |
11:22:18 | PMunch | Imagine calculating points on a circle in order to draw it with straight lines for example. If you pre-compute this into a couple of integers you have saved yourself from importing a floating point emulation library and the code to calculate those points. Not only is it faster on runtime, but also saves you a couple kilobytes of memory for not having to import floating point support. |
11:22:18 | liblq-dev | computers are not as slow as you think they are |
11:22:25 | FromDiscord | <Yardanico> guess I should use `--spellsuggest:3` instead of the default https://media.discordapp.net/attachments/371759389889003532/821342637197099018/unknown.png |
11:23:05 | FromDiscord | <Rika> What is that? |
11:23:11 | PMunch | @mario2, have you actually written a game in Nim that uses 8Gb of memory? |
11:23:20 | Clonkk[m] | <PMunch "Imagine calculating points on a "> I remember having issue with ROM size when doing embedded GUI with littlevgl. Embedding raw bmp image is faster but take more space than png (but you need to decode it) |
11:23:31 | FromDiscord | <Yardanico> @Rika --spellsuggest |
11:23:32 | FromDiscord | <mario2> I only said 8GB of memory because lots of games these days are requiring that much. |
11:23:36 | FromDiscord | <Rika> Which does? |
11:23:40 | liblq-dev | when you're doing a game, don't try to make it the fastest thing ever - most modern games are written in C# and similar high-level, GC-heavy languages, and computers don't even break a sweat while running them |
11:23:46 | FromDiscord | <Yardanico> @Rika https://github.com/nim-lang/Nim/pull/16067 |
11:23:48 | liblq-dev | modern indie games* |
11:23:57 | FromDiscord | <Rika> In reply to @liblq-dev "when you're doing a": RimWorld would beg to differ |
11:24:06 | Clonkk[m] | <FromDiscord "<mario2> I just want the final p"> First make something that works, then if it uses too much ressources optimize it. Don't start worrying about ressources if you haven't coded it yet |
11:24:07 | PMunch | @Clonkk[m], oh for sure, it very much depends on the specific use case. |
11:24:07 | liblq-dev | @Rika alright not most of them |
11:24:10 | liblq-dev | but a lot of them |
11:24:29 | FromDiscord | <Rika> In reply to @Yardanico "<@!259277943275126785> https://github.com/nim-lang/": Will look |
11:24:30 | FromDiscord | <Goel> Factorio is so well optimized that it can be run on a potato |
11:24:41 | FromDiscord | <mario2> @Goel I want my games to run on a potato. |
11:25:00 | PMunch | Then write them in Nim and don't do stupid costly mistakes |
11:25:06 | liblq-dev | well what kind of game are you making |
11:25:06 | FromDiscord | <Rika> Factorio can run with a billion mods yet RimWorld struggles to run with a few tens of them... |
11:25:25 | PMunch | Example of a stupid costly mistake: https://nee.lv/2021/02/28/How-I-cut-GTA-Online-loading-times-by-70/ |
11:25:31 | FromDiscord | <mario2> I don't know what kind of game I'm making. Not yet. I'm not expecting GTA V like games to be able to run on a toaster, but I don't want to overly bloat it either. |
11:25:35 | FromDiscord | <Rika> In reply to @mario2 "<@!312201286567198720> I want my": Make the game first, then optimise. Do you know about the premature optimisation quote? |
11:26:05 | liblq-dev | if it's just a platformer don't worry about overly optimizing it |
11:26:11 | liblq-dev | unless you have millions of objects on the screen at once |
11:26:12 | Clonkk[m] | <FromDiscord "<mario2> I don't know what kind "> Never optimize something that does not exists |
11:26:39 | FromDiscord | <mario2> If I was to optimize, should I be optimizing via compile flags or via how I program it? |
11:26:45 | FromDiscord | <Yardanico> both? |
11:26:47 | liblq-dev | the latter |
11:26:53 | FromDiscord | <Rika> Both |
11:26:58 | liblq-dev | ideally your game should run at 60 fps in debug mode |
11:27:05 | FromDiscord | <Yardanico> with --opt:speed |
11:27:12 | FromDiscord | <Yardanico> (that'd still be debug mode) |
11:27:18 | FromDiscord | <Rika> What is default opt? |
11:27:21 | FromDiscord | <Yardanico> @Rika none |
11:27:22 | FromDiscord | <Rika> Size? |
11:27:24 | liblq-dev | i don't like --opt:speed because it slows down compilation times significantly |
11:27:26 | FromDiscord | <Rika> Huh there’s a none |
11:27:28 | FromDiscord | <mario2> You said disabling garbage collection is a bad thing? |
11:27:30 | FromDiscord | <Yardanico> @liblq-dev not for me |
11:27:33 | FromDiscord | <Rika> Always thought it was one or the other |
11:27:33 | liblq-dev | until we have IC i ain't touching it for development |
11:27:44 | liblq-dev | s/until/unless |
11:27:53 | FromDiscord | <Yardanico> bad sed |
11:27:57 | FromDiscord | <Rika> Well technically until works |
11:28:34 | liblq-dev | i mean you can apply compiler flags to make your code faster but why do that if it'll impede prototyping speed |
11:28:51 | FromDiscord | <Rika> Depends on how much you value your time |
11:29:04 | liblq-dev | i don't even know why but my darn game takes ~7s to compile |
11:29:15 | liblq-dev | i have a hunch that codegen takes most of that time |
11:29:46 | liblq-dev | because my code is quite concept-heavy and concept caching is non-existent |
11:30:01 | FromDiscord | <mario2> Is it a bad idea to disable garbage collection if I care about performance speed? I don't really mind increasing the size of the game as long as it doesn't expand the size by x10 times or something like that. |
11:30:01 | PMunch | Yeah concepts slow the compiler right down |
11:30:19 | FromDiscord | <Yardanico> @mario2 yes it is |
11:30:20 | PMunch | @mario2, yes, enable ARC, don't disable the gc.. |
11:30:24 | FromDiscord | <Yardanico> without a GC you'd have to manage all memory by yourself |
11:30:30 | FromDiscord | <Yardanico> and won't be able to use stdlib |
11:30:36 | FromDiscord | <Yardanico> (well technically you could, but it'll leak memory) |
11:30:44 | FromDiscord | <Rika> Well you will, you’ll just die of memory usage |
11:31:23 | liblq-dev | don't worry about the GC |
11:31:25 | liblq-dev | it's fast |
11:31:28 | PMunch | If you disable the GC you will 90% sure leak memory and memory consumption would be massive. With the GC you don't have to think about it, just make sure to reset any big global variables if you're not using them. |
11:31:48 | * | FromDiscord quit (Remote host closed the connection) |
11:31:51 | * | rockcavera joined #nim |
11:32:05 | * | FromDiscord joined #nim |
11:32:16 | PMunch | And even if you didn't leak memory you would spend 50x the dev-time and be in for a lot of pain for absolutely zero gain. |
11:32:18 | liblq-dev | my sister's shitty laptop can run my game with an old version of the current default GC just fine |
11:32:29 | FromDiscord | <Rika> You have bigger bottlenecks to deal with over the GC |
11:32:31 | FromDiscord | <mario2> As long as I'm not poorly optimizing like source 1 is I'm good. TF2 used to be able to run on a toaster and now it can't because of years of code buildup. |
11:32:33 | FromDiscord | <clyybber> @Yardanico I guess we could disable pings without `@` for names with a length <= 3 ? |
11:32:37 | FromDiscord | <konsumlamm> ~~eith ARC it's easy to leak memory too~~ |
11:32:53 | FromDiscord | <Yardanico> @konsumlamm cycles are not that frequent |
11:32:54 | PMunch | If you find out later that you have something that could be optimised by not running it under the GC you can manually manage the memory for that section while leaving the GC on for the rest of your program. |
11:32:55 | FromDiscord | <Rika> In reply to @mario2 "As long as I'm": That depends on your programming |
11:32:58 | FromDiscord | <Rika> Not the GC |
11:33:09 | FromDiscord | <Yardanico> stdlib has almost no cycles and in in your code you should care about that ofc |
11:33:13 | FromDiscord | <clyybber> In reply to @Clyybber "<@!177365113899057152> I guess we": I'll make a PR |
11:33:28 | FromDiscord | <Yardanico> @clyybber I mean we actually had something like that before |
11:33:31 | FromDiscord | <Yardanico> but another thing is |
11:33:46 | FromDiscord | <Yardanico> make it so that "ping" matches only if it's at the start of the string or has a space before it |
11:33:51 | FromDiscord | <Yardanico> hm, or a comma I guess |
11:34:07 | FromDiscord | <clyybber> but we also wan't to support suffix pings right? |
11:34:12 | FromDiscord | <clyybber> I guess that's unrelated |
11:34:41 | * | xet7 quit (Remote host closed the connection) |
11:35:55 | FromDiscord | <Yardanico> we support "@name", "ping name", "Name: message" at the start of the message, "Name, message" at the start of the message |
11:36:46 | FromDiscord | <clyybber> I think we should just check if there's a non-alphanumeric char before `mention` |
11:37:25 | FromDiscord | <clyybber> because you wouldn't want to ping someone called "emailserver" if someone goes "someone@emailserver" |
11:38:21 | FromDiscord | <Yardanico> also, do the string slicing with [] and substr have same performance? |
11:39:36 | FromDiscord | <clyybber> should be the same roughly |
11:39:45 | FromDiscord | <clyybber> (edit) removed "roughly" |
11:39:54 | FromDiscord | <Yardanico> asking because of https://github.com/soasme/nim-markdown/commit/0061c5fdfde0627eb7d51d88c1aa0aaa5d8b30c1 |
11:40:03 | FromDiscord | <Yardanico> "By replacing [] to substr, the performance is improved. It seems to me they're not of the same efficiency." |
11:40:10 | FromDiscord | <clyybber> huh |
11:40:22 | FromDiscord | <clyybber> @Yardanico what's the reason we are returning `mention` instead of `nick`? |
11:40:34 | FromDiscord | <clyybber> (edit) "`mention`" => "`mentions`" |
11:40:52 | FromDiscord | <Yardanico> @clyybber wdym? |
11:40:54 | FromDiscord | <Yardanico> we capture the nick |
11:41:00 | FromDiscord | <Yardanico> ` >nick <- +(Alnum | '_' | utf8.alpha)` |
11:41:02 | FromDiscord | <clyybber> oh nevermind, yeah I got confused by the peg naming |
11:41:11 | FromDiscord | <clyybber> because it goes `peg mentions:` |
11:41:22 | FromDiscord | <Yardanico> oh yeah that's the root expression |
11:41:45 | FromDiscord | <clyybber> yeah |
11:52:35 | * | FromDiscord quit (Remote host closed the connection) |
11:52:42 | * | kitech1 quit (Quit: ZNC 1.7.5 - https://znc.in) |
11:52:57 | * | FromDiscord joined #nim |
11:52:58 | * | kitech1 joined #nim |
11:53:14 | Yardanico | hoping you |
11:53:17 | Yardanico | @you |
11:53:21 | Yardanico | @Yardanico hi |
11:53:38 | Yardanico | good enuf |
11:54:07 | * | clyybber joined #nim |
11:57:17 | * | clyybber quit (Client Quit) |
11:57:25 | m4r35n357 | OK we are getting into minor details here, but in the following (working) code I have used seqs to set up arrays of different sizes within a case statement. I have not been able to make it work using bare arrays owing to the need to specify size up front. In c I have used "compound literals" to do this, is tthere a way in Nim? |
11:57:29 | m4r35n357 | https://pastebin.com/E27fq9NB |
11:58:06 | FromDiscord | <Yardanico> yeah you can't use arrays here |
11:58:22 | m4r35n357 | OK quick answer, cheers ;) |
11:58:27 | FromDiscord | <Yardanico> because order is a runtime variable |
11:58:34 | FromDiscord | <Yardanico> and you decide seq length based on it |
11:58:42 | FromDiscord | <Yardanico> but array size should be known at compile time |
11:59:14 | m4r35n357 | yeah in c I can just initialize a compound literal of [0] at the "top", and overwrite it in the switch |
11:59:17 | FromDiscord | <Araq> ` 0.5 h (z1 + z0) y0 x1, h z0 y0 x1, 0.5 h (z0 + z1) y0 x1, h z1 y0 x1,` screams for a template |
12:01:16 | m4r35n357 | hmm, haven't looked at templates yet, such an overloaded term ;) BTW. c example is at the bottom of https://github.com/m4r35n357/ODE-Playground/blob/blackhole/dual.c |
12:01:45 | m4r35n357 | but seqs are fine here I think |
12:02:18 | FromDiscord | <Araq> Nim's `template` is a well defined entity which you can read about in our manual. |
12:02:28 | FromDiscord | <Yardanico> you can definitely shave off a lot of repetition here https://media.discordapp.net/attachments/371759389889003532/821352712687583242/unknown.png |
12:03:12 | m4r35n357 | Araq, just been reading about them, not sure how or where they can help . . . |
12:03:46 | FromDiscord | <Araq> also, instead of magic numbers like -6, https://github.com/m4r35n357/ODE-Playground/blob/blackhole/dual.c#L171, use an enum |
12:05:54 | PMunch | I mean those blocks could just be assigned to a let and computed once before the creation of the sequence (not that it would matter for performance, GCC or the Nim compiler will probably do exactly that for you). But the cases where just one variable changes from place to place can definitely be optimised with a template |
12:06:00 | PMunch | Optimised for readability that is |
12:06:19 | PMunch | Without losing performance |
12:06:34 | m4r35n357 | Araq, I take your point about enums, but I don't think templates will help in the example you gave, there is simply no significance to that sequence, even if it is "repeated"; the formatting is arbitrary |
12:06:53 | FromDiscord | <mario2> Would it be redundant or pointless to make a language that compiles to nim? Or should I make one that just compiles to C instead? I'm thinking about making my own language, but not sure if compiling to nim is pointless. |
12:07:03 | m4r35n357 | PMunch, they are only computed once in any case, so it doesn't matter I don't think |
12:07:04 | * | ryanhowe quit (Quit: ZNC 1.8.2 - https://znc.in) |
12:07:16 | m4r35n357 | I could just provide the values! |
12:07:43 | * | sacredfrog joined #nim |
12:07:58 | PMunch | @mario2, you will likely get what you think you need from making your own language by simply creating Nim macros. |
12:08:15 | FromDiscord | <mario2> Even if the syntax is different? |
12:08:40 | FromDiscord | <InventorMatt> that would depend on how different you want the syntax to be |
12:08:49 | FromDiscord | <Araq> @mario2 if you compile to C you would need to reimplement memory management and error handling and closures... but if your language lacks all these things it doesn't matter |
12:09:45 | PMunch | I feel like this is another mis-guided attempt at getting performance |
12:10:14 | FromDiscord | <mario2> In reply to @PMunch "I feel like this": No. No. This has nothing to do with performance. I like computers and always wanted to make my own language. |
12:10:28 | PMunch | Ah right, well in that case feel free :) |
12:10:50 | PMunch | Making your own language can be fun, but it will definitely be painful |
12:10:53 | FromDiscord | <InventorMatt> alot of people make interpreters in nim that could get you the same result |
12:11:56 | FromDiscord | <haxscramper> In reply to @mario2 "Would it be redundant": nim macros are basically your own language that compiles to nim |
12:12:01 | FromDiscord | <haxscramper> In some sense at least |
12:12:05 | FromDiscord | <Rika> Syntax rules apply though |
12:12:43 | FromDiscord | <mario2> Let me explain the syntax a bit. I want something COBOL like because I'm currently fascinated with how it writes like plain english. Can that be pulled off with macros? Or should I write a new compiler instead? |
12:13:12 | FromDiscord | <InventorMatt> that could probably be done in macros |
12:13:26 | FromDiscord | <Rika> Should be fine in macros |
12:13:30 | * | FromDiscord quit (Remote host closed the connection) |
12:13:45 | * | FromDiscord joined #nim |
12:13:50 | * | FromDiscord quit (Remote host closed the connection) |
12:14:03 | * | FromDiscord joined #nim |
12:14:16 | FromDiscord | <haxscramper> @mario2 if you are talking about SQL/COBOL-style styntax with `take string repeat 10 times store` or `select cat from table` then you'd probably have a bit of trouble making nim syntax fit into that, but that's not impossibly |
12:14:18 | FromDiscord | <haxscramper> Thouggh I would say you can just write well-named functions |
12:14:26 | FromDiscord | <haxscramper> And get almost the same result, with a little of sugar |
12:14:29 | FromDiscord | <haxscramper> if you want |
12:14:34 | FromDiscord | <haxscramper> But don't use macros for sugar, use for DSL |
12:14:40 | FromDiscord | <Araq> cobol"""↵ any syntax you want here↵""" |
12:14:53 | FromDiscord | <haxscramper> ^ and of course that would work too |
12:14:57 | FromDiscord | <Araq> still pretty simple, you need a compile-time parser for your language, that's all |
12:14:58 | FromDiscord | <InventorMatt> @mario2 here is an example use of a macro i designed for creating fuzzy logic rules in plain english using nim https://github.com/mhessler97/NimFuzzy/blob/master/tests/SimpleMacroTest.nim |
12:15:47 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2T2t |
12:15:55 | FromDiscord | <mario2> @InventorMatt Oh that is very COBOL like. I'll make a bunch of macros to turn Nim to NIMBOL. Or something like that. |
12:17:04 | PMunch | @m4r35n357, tried to apply some templates to your code, but it's still pretty messy. I expect these things might follow a pattern though? |
12:17:24 | FromDiscord | <mario2> Thanks guys. I don't need to make a new language after all. Templates and Macros is all I need. |
12:17:52 | FromDiscord | <Rika> I’m thinking of making a front end for z3, is anyone working on that in secret? |
12:18:19 | FromDiscord | <Araq> DrNim uses z3 |
12:18:41 | FromDiscord | <Rika> I have forgotten about that |
12:18:47 | FromDiscord | <Rika> How is progress by the way? |
12:18:55 | m4r35n357 | PMunch, the pattern is there but not obvious, creating that sequence is firmly rooted in the problem domain, it is not a general computing thing |
12:19:49 | m4r35n357 | PMunch, if you look at the c code link you can see echoes of the "pattern", but it is still not very clear. |
12:20:18 | * | vsantana joined #nim |
12:20:47 | FromDiscord | <Araq> exactly, the pattern is obfuscated because of the copy&paste |
12:21:02 | * | FromDiscord quit (Remote host closed the connection) |
12:21:20 | m4r35n357 | Araq, I put it all into one line because it was no clearer befoerhand ;) |
12:21:22 | * | FromDiscord joined #nim |
12:21:34 | FromDiscord | <Araq> but PRs are welcome and the tests are green |
12:21:36 | FromDiscord | <Rika> I see |
12:22:25 | PMunch | m4r35n357, well if there is any kind of pattern you can code instead of copy/paste then it might be a good idea to do that.. |
12:23:44 | PMunch | Or even just some kind of sequence initialise macro to remove the repeats |
12:23:49 | PMunch | Is there a DSL for that? |
12:24:34 | * | Nuc1eoN left #nim ("The Lounge - https://thelounge.chat") |
12:24:38 | m4r35n357 | PMunch, one of us is not understanding the other ;) The sequence of numbers is messy and that is the best that I know how to do |
12:25:10 | PMunch | I mean you have a lot of repetition, would be easy to write a tiny dsl that got rid of that |
12:26:09 | m4r35n357 | PMunch, ifyou really want to know where the numbers come from, see here: https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.1048.973&rep=rep1&type=pdf |
12:26:30 | FromDiscord | <haxscramper> I just formatted it using clang-format, and I see that `h z1 y1 x1` are repeated very often (as well as ` 0.5L h (z0 + z1) y1 x1`) |
12:26:55 | FromDiscord | <haxscramper> If you absolutely need array literals it is possible to repeat arrays at compile-time, so no allocations, nothingg |
12:27:04 | FromDiscord | <haxscramper> There was a forum thread with code, let me find it |
12:27:09 | * | FromDiscord quit (Remote host closed the connection) |
12:27:27 | * | FromDiscord joined #nim |
12:28:00 | FromDiscord | <haxscramper> So you could just do `([z1 y1 x1] 10) & [<some-other>] <repeat-times>` and compile-time constant |
12:29:30 | FromDiscord | <haxscramper> https://forum.nim-lang.org/t/7480#47429 |
12:32:07 | FromDiscord | <haxscramper> Or if indices follow some pattern you can just generate macro that unrolls into array literal like that `repeatArray({(h z1 y1 x1) : [1,2,3,4], (0.5L h (z0 + z1) y1 x1) : [5,6,7], <expression> : <indices> ...})` |
12:32:21 | m4r35n357 | haxscramper, this code is copied & pasted from working code I wrote several years ago. I am _still_ not foolhardy enough to revisit its derivation, or to code it up ;) |
12:32:34 | m4r35n357 | It just isn't worth it - it works |
12:32:52 | m4r35n357 | and very nicely too |
12:33:25 | FromDiscord | <Araq> how do you know it works very nicely? good test coverage? if so, refactoring it is not a big deal 😉 |
12:33:46 | m4r35n357 | haxscramper, but I will offer any assitance that you might need if you want to attempt it ;) |
12:34:46 | m4r35n357 | Araq, I have very good numerical error reporting & display, it is _really_ obvious if something is wrong |
12:35:32 | FromDiscord | <Araq> you shouldn't fear to touch this code then but ok, who am I to tell you want to do |
12:35:43 | m4r35n357 | Araq, not a big deal, but it gains me nothing. If it helps, look at it as a big crypto key or some data like that |
12:35:46 | FromDiscord | <Araq> (edit) "you shouldn't fear to touch this code then but ok, who am I to tell ... you" added "what" |
12:36:09 | FromDiscord | <Araq> I don't look at it, I run away screaming |
12:36:12 | m4r35n357 | Araq, I have no fear as I said, I know immediately if something is wrong |
12:38:07 | m4r35n357 | Araq, also I have previous implementations in Vala, Python, Fortran & c to compare with. |
12:38:23 | m4r35n357 | It is not code that is _ever_ changed |
12:38:39 | m4r35n357 | on pain of death! |
12:40:43 | FromDiscord | <Araq> alright, alright |
12:40:50 | m4r35n357 | Araq, if the crypto key analogy doesn't work for you, think of doing a big symbolic calculation in (e.g.) maxima, then pasting the result into a program & reformatting by hand. |
12:40:54 | PMunch | Why does this generate an error? https://play.nim-lang.org/#ix=2T2B |
12:40:55 | FromDiscord | <mario2> sent a code paste, see https://play.nim-lang.org/#ix=2T2C |
12:41:41 | PMunch | You'd need a macro |
12:41:49 | FromDiscord | <Araq> @mario2 you should go with the `dsl""" ... """` idea |
12:42:19 | FromDiscord | <Araq> where `dsl` must be a macro |
12:42:36 | FromDiscord | <mario2> So in other words: Metaprogramming? |
12:43:40 | FromDiscord | <arnetheduck> @Araq just to verify, `deepCopy` is not thread safe, right? |
12:43:58 | FromGitter | <HJarausch_gitlab> I must be blind - please help. ⏎ ⏎ ```echo quickSelect(A)``` ⏎ ⏎ What did I overlook? ... [https://gitter.im/nim-lang/Nim?at=6050a80eb5131f4f281bddca] |
12:46:13 | FromDiscord | <Araq> @arnetheduck you have to ensure that the thread that belongs to `source` doesn't continue until the deepcopy is over |
12:46:51 | FromDiscord | <arnetheduck> In reply to @Araq "<@449019668296892420> you have to": yeah, that's what I imagined - just checking that there isn't some hidden magic that I missed |
12:46:51 | * | Gustavo6046 quit (Ping timeout: 272 seconds) |
12:48:31 | FromDiscord | <Araq> the black magic is inside `spawn` |
12:49:43 | FromDiscord | <Araq> where the pool worker thread announces that it is ready to take a task and then there is a single deep copy of this task from the submitting thread to the worker |
12:50:16 | PMunch | Can anyone tell what the issue in my code is? typeof says seq[int], len works fine, but I can't echo it.. |
12:50:22 | PMunch | I can echo y[0] though |
12:50:48 | * | FromDiscord quit (Remote host closed the connection) |
12:51:02 | * | FromDiscord joined #nim |
12:51:34 | FromDiscord | <Araq> so that in effect you get one copy and not two. but it's a terrible idea, and I will never write it like this again |
12:56:08 | PMunch | I mean the for loop here works fine, but not the echo: http://ix.io/2T2H |
12:59:18 | FromDiscord | <Araq> @PMunch report it on github please, most interesting bug |
12:59:45 | * | FromDiscord quit (Remote host closed the connection) |
12:59:59 | * | FromDiscord joined #nim |
13:00:28 | * | FromDiscord quit (Remote host closed the connection) |
13:00:44 | * | FromDiscord joined #nim |
13:01:16 | PMunch | Oh hmm |
13:01:18 | FromDiscord | <Seedofarson> Nimmmmmmmm |
13:01:19 | FromDiscord | <Seedofarson> go brrrrrrrrrrrrrrrr |
13:01:26 | PMunch | It seems to be caused by macroutils.. |
13:01:34 | PMunch | Damn it, guess it's my own fault then somehow |
13:02:21 | PMunch | Although the output from echo result.treeRepr is exactly the same for both versions |
13:04:30 | FromDiscord | <arnetheduck> In reply to @Araq "so that in effect": well, from what I can tell, there's nothing in the language that stops deepcopy from copying from a source that's in another thread which is.. odd.. I mean, gcsafe is a bit about that |
13:04:57 | FromDiscord | <arnetheduck> at that point, it's basically an unchecked memory unsafety issue |
13:05:56 | FromDiscord | <arnetheduck> but then again, maybe I'm missing something in the code I'm looking at |
13:06:03 | * | FromDiscord quit (Remote host closed the connection) |
13:06:19 | * | FromDiscord joined #nim |
13:07:51 | * | Gustavo6046 joined #nim |
13:08:42 | FromDiscord | <Araq> I don't see how the deepcopy alone can cause memory unsafety. |
13:09:47 | FromDiscord | <Araq> if dest and source are on different threads you can only access source via an unsafe means and then that's where the unsafety comes from |
13:10:58 | FromDiscord | <arnetheduck> might be, I haven't read _all_ code yet, just found a dubious bit 🙂 |
13:11:06 | FromDiscord | <Araq> for example, `deepCopy(dest, someGlobal)` triggers the "GC safety" problem as you access `someGlobal` |
13:11:33 | FromDiscord | <Araq> and when you do `{.gcsafe.}: deepCopy(dest, someGlobal)` it remains wrong but you made the compiler shut up about it |
13:13:59 | PMunch | Hmm, just importing macroutils makes it fail.. |
13:13:59 | FromDiscord | <arnetheduck> ok, yeah, found it - there's a `gcsafe` indeed, but far away from the deepCopy |
13:14:05 | FromDiscord | <arnetheduck> thanks |
13:14:09 | PMunch | Even `import macroutils except Lit` |
13:15:05 | PMunch | `from macroutils import Prefix, Bracket, Ident` works though |
13:15:16 | PMunch | So it's definitely something in macroutils that is messing things up |
13:16:16 | PMunch | `from macroutils import Lit` triggers the error though |
13:16:33 | PMunch | So it seems like `import macroutils except Lit` doesn't do what it's supposed to.. |
13:22:54 | m4r35n357 | OK I'mm getting near to "finishing" this little project, and it has developed into a virtual rewrite of an old project, but in an expressive language. I am really pleased with it; don't let my questions here give you the impression that I have been struggling, I've enjoyed it! The current version of my code is mixed in with lots of other stuff here: https://github.com/m4r35n357/ODE-Playground/tree/blackhole |
13:24:05 | m4r35n357 | I don't know how many prople use Nim for numeric stuff, but here is proof that it is possible (128 bit floats would be nice though!) |
13:24:29 | m4r35n357 | So thanks agin for all your help, in case I decide to disappear suddenly ;) |
13:26:48 | FromDiscord | <InventorMatt> we do have a bit of a science community and we even have a science nim channel as well. it's always good to see more scientific programming in nim |
13:27:42 | * | FromDiscord quit (Remote host closed the connection) |
13:27:59 | * | FromDiscord joined #nim |
13:28:15 | * | narimiran quit (Ping timeout: 265 seconds) |
13:28:37 | FromDiscord | <Yardanico> on irc it's #nim-science btw @m4r35n357 |
13:29:05 | PMunch | m4r35n357, no worries, from the questions you asked it seemed like you had a pretty good grip about what you were doing so it seemed like you were getting along well with the language :) |
13:29:08 | m4r35n357 | InventorMatt well that project covers high order Taylor Series Integrators, & high order symplectic integrators as well as black holes, ODEs etc |
13:31:50 | m4r35n357 | PMunch, ys I've ploughed this furrow many times, but this is the smallest & clearest expression off the problem yet (ignoring distractions re. weighting data!). The two features that have made the difference are operator overloading, and bind many generics (in that order) |
13:31:58 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2T2V |
13:32:54 | PMunch | Yeah, being able to manipulate the language to the point that Nim allows really makes it possible to write expressive code no matter the domain |
13:39:02 | FromDiscord | <Seedofarson> uh |
13:39:51 | FromDiscord | <Seedofarson> sent a code paste, see https://play.nim-lang.org/#ix=2T2Z |
13:39:54 | FromDiscord | <Seedofarson> I get a syntax error |
13:39:56 | * | FromDiscord quit (Remote host closed the connection) |
13:40:12 | * | FromDiscord joined #nim |
13:40:24 | FromDiscord | <Rika> well what did it say |
13:40:26 | FromDiscord | <Seedofarson> oop |
13:40:26 | FromDiscord | <Seedofarson> my nad |
13:40:28 | FromDiscord | <Seedofarson> (edit) "nad" => "bad" |
13:40:28 | FromDiscord | <Seedofarson> sent a code paste, see https://play.nim-lang.org/#ix=2T30 |
13:40:31 | FromDiscord | <Rika> haha |
13:40:31 | Prestige | Why does the bridge keep dying |
13:40:56 | FromDiscord | <Seedofarson> sent a code paste, see https://play.nim-lang.org/#ix=2T32 |
13:41:02 | * | FromDiscord quit (Remote host closed the connection) |
13:41:17 | * | FromDiscord joined #nim |
13:41:33 | FromDiscord | <haxscramper> `delay: int) = ...` |
13:41:45 | FromDiscord | <Seedofarson> oh |
13:41:46 | FromDiscord | <Seedofarson> lmaoo |
13:41:47 | FromDiscord | <Seedofarson> my bad |
13:41:48 | * | FromDiscord quit (Remote host closed the connection) |
13:42:04 | * | FromDiscord joined #nim |
13:42:16 | FromDiscord | <Seedofarson> getting used to new syntax |
13:42:20 | FromDiscord | <Seedofarson> tysm |
13:43:34 | PMunch | Prestige, I'm not sure if it's dying, I think Yardanico might be working on it |
13:43:42 | Yardanico | nah, it's crashing |
13:43:53 | Yardanico | I don't develop the bridge on the main instance, y'know :) |
13:43:59 | Yardanico | I only test it in #nim-test when developing |
13:44:20 | Yardanico | these are crashes because of display name stuff |
13:44:22 | Prestige | o |
13:44:32 | * | FromDiscord quit (Remote host closed the connection) |
13:44:45 | * | FromDiscord joined #nim |
13:44:49 | Yardanico | it's optional in discord and I didn't have enough isSome checks I guess |
13:44:53 | * | FromDiscord quit (Remote host closed the connection) |
13:45:07 | Yardanico | i reverted it back for now |
13:45:11 | PMunch | Aha |
13:45:14 | * | FromDiscord joined #nim |
13:45:27 | PMunch | I mean I wouldn't be surprised if you were developing it on the live version :P |
13:45:35 | FromDiscord | <Seedofarson> thats correct |
13:45:38 | FromDiscord | <Seedofarson> sent a code paste, see https://play.nim-lang.org/#ix=2T37 |
13:45:39 | FromDiscord | <Seedofarson> right? |
13:45:42 | FromDiscord | <Seedofarson> just making sure haha |
13:46:19 | FromDiscord | <Seedofarson> (edit) |
13:46:23 | FromDiscord | <Rika> yes |
13:46:24 | * | clyybber joined #nim |
13:46:57 | * | clyybber quit (Client Quit) |
13:47:26 | FromDiscord | <Yardanico> @Seedofarson you can ask the compiler, it'll certainly let you know whether it's correct or not |
13:47:38 | FromDiscord | <Seedofarson> rip |
13:47:41 | FromDiscord | <Seedofarson> sent a code paste, see https://play.nim-lang.org/#ix=2T3b |
13:47:53 | FromDiscord | <Seedofarson> In reply to @Yardanico "<@!798398880584171530> you can ask": I am getting another error so I was wondering if it was the same thing! haha |
13:47:55 | FromDiscord | <Seedofarson> ty |
13:48:07 | FromDiscord | <Yardanico> @Seedofarson you can't have an empty else. |
13:48:12 | FromDiscord | <Seedofarson> oh shit |
13:48:15 | FromDiscord | <Seedofarson> (edit) removed "shit" |
13:48:30 | FromDiscord | <Seedofarson> sorry if I am being annoying |
13:48:31 | FromDiscord | <Yardanico> and it's pointless to delete messages since they're already been logged |
13:48:39 | FromDiscord | <Seedofarson> im on my merry way now |
13:48:39 | FromDiscord | <Yardanico> (edit) "they're" => "they've" |
13:48:48 | FromDiscord | <Seedofarson> ? |
13:48:49 | FromDiscord | <Rika> annoying is something you are not |
13:57:06 | Yardanico | PMunch: time to use your optionsutils :) |
13:57:13 | Yardanico | optionutils* |
13:57:32 | * | fredrikhr quit (Read error: Connection reset by peer) |
13:57:56 | * | fredrikhr joined #nim |
14:01:43 | Yardanico | let name = either(m.member?.nick, m.author.username) |
14:02:24 | Yardanico | actually just m.member?.nick.get(m.author.username) |
14:07:46 | PMunch | Hooray :) |
14:07:56 | PMunch | Someone using my stuff is always fun |
14:09:16 | Yardanico | well I already use your parsetoml in ircord for configuration :) |
14:10:37 | PMunch | Well that's not really mine as such. I just rewrote large parts of it to support newer versions of the spec |
14:19:42 | * | NimBot joined #nim |
14:19:53 | * | gpanders quit (Quit: ZNC - https://znc.in) |
14:20:11 | Yardanico | ~restarting the bridge~ |
14:20:14 | * | FromDiscord quit (Remote host closed the connection) |
14:20:38 | * | FromDiscord joined #nim |
14:21:02 | * | lritter quit (Quit: Leaving) |
14:21:29 | * | gpanders joined #nim |
14:27:44 | PMunch | OOM'd? Do you have a leak? |
14:28:14 | Yardanico | not me, NimBot |
14:28:40 | Yardanico | !eval 1+1 |
14:28:42 | NimBot | Compile failed: /usercode/in.nim(1, 2) Error: expression '2' is of type 'int literal(2)' and has to be used (or discarded) |
14:31:26 | Prestige | What does NimBot does aside from eval? |
14:31:58 | Prestige | what does nimbot do* man I'm tired |
14:32:27 | Prestige | !help |
14:32:30 | Prestige | oh well. |
14:34:43 | Yardanico | Prestige: main feature is irc logging |
14:35:43 | Yardanico | and the src is open anywya |
14:35:51 | Yardanico | https://github.com/nim-lang/nimbot |
14:37:21 | Yardanico | Prestige: |
14:37:22 | Yardanico | !ping |
14:37:22 | NimBot | pong |
14:38:10 | Yardanico | !lag |
14:38:10 | NimBot | 10ms between me and the server. |
14:48:48 | * | sepples_ quit (Ping timeout: 245 seconds) |
14:49:29 | * | clyybber joined #nim |
14:52:19 | FromDiscord | <whisperdev> Does anyone know what kind of regex repl I can use for this? https://nitely.github.io/nim-regex/regex.html |
14:53:26 | FromDiscord | <Yardanico> normal one will work |
14:53:28 | FromDiscord | <Yardanico> pcre |
14:53:37 | FromDiscord | <Yardanico> "The syntax is similar to PCRE" |
14:53:40 | FromDiscord | <Yardanico> at the top of the page :) |
14:53:58 | FromDiscord | <Yardanico> and for that there's the classical https://regex101.com/ |
14:55:20 | FromDiscord | <whisperdev> I cant make it work though.Does the nim playground support importing this package? |
14:56:43 | FromDiscord | <Yardanico> @whisperdev wdym? |
14:56:53 | FromDiscord | <Yardanico> about "can't make it work" |
14:57:01 | FromDiscord | <Yardanico> and yes, playground has it |
14:59:01 | FromDiscord | <whisperdev> Yes that's what I am going to illustrate on playground 🙂 |
14:59:34 | FromDiscord | <Livingstone> sent a code paste, see https://play.nim-lang.org/#ix=2T3F |
14:59:45 | FromDiscord | <Livingstone> I'm getting the error generic min |
14:59:58 | FromDiscord | <Livingstone> can someone tell me what that means? |
15:00:05 | FromDiscord | <Yardanico> there's no `min` for seq[seq[float]] |
15:00:08 | FromDiscord | <Yardanico> how would you expect it to work? |
15:00:36 | FromDiscord | <Livingstone> to take the two numbers in a list within a list and compare them? |
15:00:43 | FromDiscord | <Yardanico> @Livingstone but you have a sequence of sequences of floats |
15:00:45 | FromDiscord | <Yardanico> not just a sequence of floats |
15:00:57 | FromDiscord | <InventorMatt> You'll need to iterate through each seq in the seq and call that on it |
15:00:59 | FromDiscord | <Yardanico> you'll need a loop or use sequtils if you really want the min and max values from the whole dataset |
15:01:11 | FromDiscord | <Rika> min -> seq[T], T needs <, how do you compare two seq[float]s? |
15:01:28 | FromDiscord | <Rika> `@[0.0] < @[1.0, 2.0]` doesnt make sense |
15:05:35 | * | teasea quit (Quit: teasea) |
15:07:10 | FromDiscord | <InventorMatt> sent a code paste, see https://play.nim-lang.org/#ix=2T3S |
15:07:32 | * | teasea joined #nim |
15:07:50 | FromDiscord | <Livingstone> that could probably work because my python code looks like this |
15:08:00 | FromDiscord | <Livingstone> sent a code paste, see https://play.nim-lang.org/#ix=2T3T |
15:08:36 | FromDiscord | <InventorMatt> so you want a list of the min_max values as your output? |
15:08:46 | FromDiscord | <Livingstone> yes |
15:10:32 | FromDiscord | <Yardanico> range(len)) pls no |
15:10:46 | FromDiscord | <Yardanico> jk :P |
15:10:50 | FromDiscord | <Livingstone> lol |
15:12:24 | FromDiscord | <InventorMatt> sent a code paste, see https://play.nim-lang.org/#ix=2T3V |
15:12:58 | FromDiscord | <InventorMatt> it'll give a seq with the tuple pair of the minimum and maximum in each subseq |
15:14:44 | FromDiscord | <Livingstone> could work I will give a try |
15:14:57 | FromDiscord | <Livingstone> thanks |
15:26:12 | FromDiscord | <InventorMatt> sent a code paste, see https://play.nim-lang.org/#ix=2T3Z |
15:33:49 | * | rockcavera is now known as Guest42956 |
15:33:50 | * | Guest42956 quit (Killed (card.freenode.net (Nickname regained by services))) |
15:33:50 | * | rockcavera joined #nim |
15:35:09 | FromDiscord | <InventorMatt> sent a code paste, see https://play.nim-lang.org/#ix=2T41 |
15:42:34 | FromDiscord | <hotdog> Anyone else had trouble with vscode freezing a lot recently? |
15:51:27 | FromDiscord | <martinium> nope |
15:56:05 | FromDiscord | <xophidia> sent a long message, see http://ix.io/2T49 |
16:08:05 | FromDiscord | <Seedofarson> how do be threads work \:( |
16:08:12 | FromDiscord | <Seedofarson> there isnt to much documentation on the webiste |
16:11:06 | FromDiscord | <txtincome> What's the difference between nim and nimscript? Can I compile nim code if executed from a shell script? |
16:12:11 | ForumUpdaterBot | New thread by Able: IndexError: list index out of range, see https://forum.nim-lang.org/t/7642 |
16:12:38 | FromDiscord | <hotdog> @Seedofarson what are you trying to do? There's a lot of options here |
16:13:10 | FromDiscord | <Recruit_main707> you have to compile with `--threads:on` to use them |
16:14:17 | FromDiscord | <hotdog> @txtincome https://nim-lang.org/docs/nims.html |
16:14:31 | FromDiscord | <hotdog> Nimscript is interpreted |
16:15:05 | FromDiscord | <hotdog> Not sure I understand the second question, can you explain a bit more what you are trying to do? |
16:15:39 | FromDiscord | <txtincome> I want to call nim from shebang and then treat the file as if it was a shell script. |
16:16:25 | FromDiscord | <hotdog> Have a look at this: https://github.com/PMunch/nimcr |
16:16:32 | FromDiscord | <Yardanico> Yeah this is the way |
16:16:51 | FromDiscord | <txtincome> You're a genius hotdog. Thanks |
16:19:57 | FromDiscord | <txtincome> And even better, it's a very small program so if something breaks in the future it should be easy to fix. |
16:24:58 | * | zopsi joined #nim |
16:31:52 | FromDiscord | <KnorrFG> is it possible in an untyped macro to lookup a dotExpression, and get the type of the object that should be behind said dotExpression? And by type I actually mean I have a type with template args, and I want a description of the type without the template args. |
16:32:15 | FromDiscord | <KnorrFG> (edit) "template args," => "genericargs," |
16:32:21 | FromDiscord | <KnorrFG> (edit) "genericargs," => "generic args," |
16:32:30 | FromDiscord | <KnorrFG> (edit) removed "template" |
16:33:50 | FromDiscord | <txtincome> o noes https://thehackernews.com/2021/03/researchers-spotted-malware-written-in.html |
16:34:48 | FromDiscord | <exelotl> notta disu shitto agen |
16:38:12 | reversem3 | I know enough C to be dangerous but thats about it , would learning more about C give me more insight into Nim ? |
16:38:45 | * | Jjp137 joined #nim |
16:39:06 | FromDiscord | <txtincome> Nim has a python like syntax and the C code isn't really meant to be human edited because of how it transpiled. You technically could read it, but it won't be pretty. |
16:39:41 | FromDiscord | <Yardanico> In reply to @txtincome "o noes https://thehackernews.com/2021/03/researcher": This has been posted here like 10 times already :) |
16:39:55 | FromDiscord | <txtincome> Sorry. I didnt' know |
16:40:09 | FromDiscord | <Yardanico> It's okay, also deleting is quite useless |
16:40:19 | FromDiscord | <Yardanico> Since we have people from IRC and this channel is logged |
16:40:59 | FromDiscord | <txtincome> @Yardanico To answer reversem3's question, is the C code meant to be human edited that was transpiled from nim code? |
16:41:24 | FromDiscord | <Yardanico> In reply to @txtincome "Nim has a python": He didn't really ask about C code compiled by Nim, it was about C in general |
16:41:36 | FromDiscord | <txtincome> Oh. I thought he meant something else |
16:41:42 | FromDiscord | <Yardanico> In reply to @txtincome "<@!177365113899057152> To answer reversem3's": No, C is merely used as a backend |
16:41:54 | FromDiscord | <Yardanico> It's not meant to be edited nor read |
16:42:06 | FromDiscord | <txtincome> Right. That's what I thought the C code was supposed to be. |
16:42:18 | * | Gustavo6046 quit (Remote host closed the connection) |
16:43:04 | FromDiscord | <txtincome> Is it possible to have nim tell GCC to stop at creating the assembly file or to have it stop after the object creation stage? |
16:43:22 | * | Gustavo6046 joined #nim |
16:43:49 | FromDiscord | <Yardanico> --noLinking to not link the binary but there are more options |
16:44:02 | FromDiscord | <Yardanico> See https://nim-lang.org/docs/nimc.htmlb |
16:44:04 | FromDiscord | <Yardanico> https://nim-lang.org/docs/nimc.html |
16:53:10 | FromDiscord | <Kiloneie> New video is up |
16:53:11 | FromDiscord | <Kiloneie> https://youtu.be/_FIHe1q0QYE |
16:56:18 | ForumUpdaterBot | New thread by Kiloneie: Nim SDL2 Game Development for Beginners #2 Adding walls and explaining image depth, see https://forum.nim-lang.org/t/7643 |
16:56:48 | ForumUpdaterBot | New post on r/nim by Kiloneie: Nim SDL2 Game Development for Beginners #2 Adding walls and explaining image depth, see https://reddit.com/r/nim/comments/m6dmlf/nim_sdl2_game_development_for_beginners_2_adding/ |
16:59:49 | * | xet7 joined #nim |
17:03:23 | * | icebattle quit (Ping timeout: 245 seconds) |
17:04:24 | * | narimiran joined #nim |
17:05:59 | * | kuon quit (Quit: Leaving) |
17:19:34 | * | icebattle joined #nim |
17:23:24 | FromGitter | <HJarausch_gitlab> Nim creates invalid C-code - WHY ⏎ See https://play.nim-lang.org/#ix=2T4J |
17:25:27 | FromGitter | <HJarausch_gitlab> Nim Compiler Version 1.5.1 [Linux: amd64] ⏎ Compiled at 2021-03-16 ⏎ Copyright (c) 2006-2021 by Andreas Rumpf ⏎ ⏎ git hash: 48eab5370a5e731059a7337f702b2bc42a3c4b79 ... [https://gitter.im/nim-lang/Nim?at=6050ea07457d6b4a94cdc6eb] |
17:52:08 | * | gpanders quit (Quit: ZNC - https://znc.in) |
17:52:25 | PMunch | txtincome, as you can see nimcr hasn't been updated in ages. It so simple it just doesn't break :P I think I have multiple little scripts written with it and so far no issues |
17:52:30 | * | PMunch quit (Quit: leaving) |
17:56:28 | * | clyybber quit (Quit: WeeChat 3.1) |
17:57:42 | FromDiscord | <haxscramper> Wasm |
17:57:50 | FromDiscord | <haxscramper> Wasn't it made absolete by `nim r`? |
17:58:01 | * | Gustavo6046 quit (Remote host closed the connection) |
17:58:46 | * | Gustavo6046 joined #nim |
18:02:16 | * | Gustavo6046 quit (Remote host closed the connection) |
18:02:48 | * | Gustavo6046 joined #nim |
18:11:58 | FromDiscord | <Goel> Is there a way to compile all .nim files into a folder? like `nim c -r --all`? |
18:12:06 | * | Gustavo6046 quit (Remote host closed the connection) |
18:12:21 | * | Gustavo6046 joined #nim |
18:13:53 | * | nisstyre quit (Ping timeout: 260 seconds) |
18:14:17 | FromDiscord | <Kiloneie> Hopefully nim_lang on twitter retweets my video. That's the big one for getting traffic i believe. |
18:14:37 | narimiran | @Kiloneie you can count on it ;) |
18:14:50 | FromDiscord | <Kiloneie> Yay 😛 |
18:15:02 | * | blitzworks quit (Ping timeout: 260 seconds) |
18:15:50 | FromDiscord | <haxscramper> In reply to @Goel "Is there a way": You need to compile multiple binaries at once, or something else? |
18:16:02 | * | nisstyre joined #nim |
18:16:06 | FromDiscord | <Solitude> In reply to @Goel "Is there a way": no, use your shell for-loops/xargs |
18:16:17 | FromDiscord | <haxscramper> Because nim does not work like C where you have to compile everything to `.o` and then link, it just happens automatically |
18:16:47 | FromDiscord | <Goel> binaries, a folder of examples, and i don't want to use nim c -r on every single .nim file. If thats possible |
18:16:49 | FromGitter | <timotheecour> > *<FromDiscord>* <haxscramper> Wasn't it made absolete by `nim r`? ⏎ ⏎ => followup https://github.com/PMunch/nimcr/issues/14 |
18:23:00 | narimiran | @Kiloneie did you mention @nim_lang in your tweet? if not, please do, otherwise i cannot find your tweet easily.... |
18:23:15 | FromDiscord | <Kiloneie> oh okay, second |
18:25:33 | FromDiscord | <Kiloneie> Done |
18:29:11 | * | waleee-cl joined #nim |
18:33:20 | * | wasted_youth2 joined #nim |
18:34:53 | * | couven92 joined #nim |
18:35:02 | * | fredrikhr quit (Disconnected by services) |
18:35:08 | * | couven92 is now known as fredrikhr |
18:35:35 | * | fredrikhr quit (Client Quit) |
18:39:24 | * | gpanders joined #nim |
18:45:27 | * | icebattle quit (Quit: leaving) |
18:46:06 | FromDiscord | <Rika> In reply to @Goel "binaries, a folder of": just use the shell's functions? and should help |
18:47:56 | * | icebattle joined #nim |
18:49:20 | * | gpanders quit (Quit: ZNC - https://znc.in) |
18:49:36 | FromDiscord | <txtincome> Which is faster: Compiling nim code to C or compiling the C code? |
18:50:53 | * | superbia joined #nim |
18:51:20 | FromDiscord | <zetashift> the compiling C code |
18:51:43 | FromDiscord | <txtincome> It really is faster to compile the C code rather than taking the nim code and making it into C? |
18:51:53 | FromDiscord | <Rika> pretty sure yeah |
19:16:07 | FromDiscord | <zetashift> From https://github.com/nim-lang/RFCs/issues/46 : `Currently in larger Nim projects, the Nim compiler is the bottleneck, not the C/C++ compiler. This is caused by the fact that the Nim compiler always recompiles the full program including all used libraries. ` |
19:20:18 | FromDiscord | <Rika> well, its being worked on anyway |
19:22:11 | FromDiscord | <Goel> Empy window made with GLFW in Rust, binary size 55mb, in nim 2,8mb↵What the... |
19:22:44 | FromDiscord | <Rika> think rust is static |
19:22:52 | FromDiscord | <Rika> check with ldd |
19:23:03 | FromDiscord | <txtincome> Rust is huge |
19:23:05 | FromDiscord | <txtincome> C is tiny |
19:23:22 | FromDiscord | <Rika> rust isnt always huge, its just huge by default |
19:23:32 | FromDiscord | <Goel> I haven't used any flag or optimizations, still thats a HUGE difference in binary size for just an empy window made in the same mode |
19:23:46 | FromDiscord | <Goel> (edit) "mode" => "way" |
19:31:41 | * | leorize joined #nim |
19:36:49 | * | wasted_youth2 quit (Read error: Connection reset by peer) |
19:37:15 | * | wasted_youth2 joined #nim |
19:42:48 | FromDiscord | <konsumlamm> LTO makes a big difference |
19:53:45 | * | abm joined #nim |
19:55:14 | * | vicfred joined #nim |
20:13:48 | * | letto_ quit (Quit: Konversation terminated!) |
20:14:49 | * | haxscramper quit (Remote host closed the connection) |
20:15:16 | * | haxscramper joined #nim |
20:16:07 | * | letto joined #nim |
20:17:22 | FromDiscord | <txtincome> Are static analyzers like lint needed if I use nim? Would it be exploding with false positives because of how nim compiled the code? |
20:17:47 | FromDiscord | <Yardanico> if you use them on the C code, then probably yes |
20:18:03 | FromDiscord | <Yardanico> Also Nim compiled with -d:release has a lot of runtime checks enabled |
20:18:10 | FromDiscord | <Yardanico> Which help in reducing bugs |
20:19:08 | FromDiscord | <txtincome> Probably yes as in it would explode with false positives? |
20:20:51 | * | haxscramper quit (Remote host closed the connection) |
20:21:07 | * | arecaceae quit (Remote host closed the connection) |
20:21:26 | * | arecaceae joined #nim |
20:26:40 | FromDiscord | <treeform> In reply to @Kiloneie "New video is up": Wow nice! We need more vids. You are doing a good job keep it up. |
20:30:04 | FromDiscord | <Kiloneie> Thank you 🙂 |
20:30:47 | FromDiscord | <Kiloneie> I gotta figure out a better program to draw with though, i used Window's 3D paint thingy in this one and it's horrible D: |
20:31:03 | FromDiscord | <Kiloneie> i launched Krita just before that but ended up not using it D: |
20:38:23 | * | narimiran quit (Ping timeout: 245 seconds) |
20:38:59 | * | Guest94576 joined #nim |
20:49:07 | FromDiscord | <zetashift> @Kiloneie why do you do `ImageObj = object of RootObj` & then `Image = ref ImageObj` ? |
20:50:09 | FromDiscord | <zetashift> Can't one do `Image = ref object of RootObj` ? Maybe you have explained it in the previous video, but sadly I haven't watched that one fully 😛 |
20:51:25 | * | superbia quit (Quit: WeeChat 3.1) |
20:54:31 | FromDiscord | <Yardanico> @zetashift yes zetashift you can do that and usually it's used like this for inheritance |
20:55:02 | FromDiscord | <Kiloneie> That inheritance part honestly shouldn't be there |
20:55:13 | FromDiscord | <Kiloneie> i left in there and forgot about it D: |
20:55:36 | FromDiscord | <Kiloneie> if i were to edit that out... i did that once in a video, and nope... im not doing that again... |
20:56:04 | FromDiscord | <zetashift> In reply to @Yardanico "<@77574388035100672> yes zetashift you": "used like this for inheritance" -> with this you mean the way Kiloneie does or the the `Image = ref object of RootObj`? |
20:56:16 | FromDiscord | <Yardanico> the latter |
20:56:21 | FromDiscord | <zetashift> ah yea |
20:56:47 | FromDiscord | <Yardanico> that's how you usually write types for inheritance and dynamic dispatch |
20:56:52 | FromDiscord | <zetashift> In reply to @Kiloneie "if i were to": It's fine for a beginner video I wouldn't sweat it, maybe you could add a note in the description, but I was just curious |
20:56:55 | FromDiscord | <Kiloneie> I am curious though if anyone is reading trough the documentation/offline tutorial i have provided with these last 2 videos... i no longer use OneNote to do video script, i can now much easily transition to Linux, though gaming is still a bummer. |
20:57:31 | FromDiscord | <Yardanico> gaming as in what games? |
20:57:35 | FromDiscord | <Kiloneie> Honestly just leaving it in is fine, nobody will run into any problems |
20:57:49 | FromDiscord | <Kiloneie> well most games i tried with proton didn't work... |
20:57:56 | FromDiscord | <Yardanico> That's extremely weird |
20:58:15 | FromDiscord | <zetashift> In reply to @Yardanico "that's how you usually": Ah alright, I see inheritance used from time to time in Nim game engines but whenever I write code I try to avoid it |
20:58:25 | FromDiscord | <zetashift> Is there any reason you opted in for inheritance for images and walls? |
20:58:27 | FromDiscord | <Kiloneie> even Heroes of the storm which says GOLD, will never ever stop lagging like hell and keeping really low fps on my freaking 1070 ti which is overkill for that game. |
20:58:48 | ForumUpdaterBot | New thread by DavidKunz: Missing Symmetry: varargs vs. all, see https://forum.nim-lang.org/t/7644 |
20:59:19 | FromDiscord | <Kiloneie> i was experimenting with inheritance when doing the video, but eventually it just stayed there for no good reason. |
20:59:45 | FromDiscord | <Kiloneie> the restructuring part of #2 that made it into the video because it was very unorganized before and sloppy |
20:59:53 | FromDiscord | <zetashift> Alright I get that, I like the video tho 😄 |
21:00:29 | FromDiscord | <Kiloneie> I should be doing more drawing/animation for my videos though, this one is the first with any kind of drawing |
21:00:57 | FromDiscord | <Kiloneie> im not sure how that guy who explains physics and science of movies and games does it |
21:01:05 | FromDiscord | <Kiloneie> i think he has some kind of drawing board but... |
21:01:31 | FromDiscord | <Kiloneie> Let me find the dude |
21:01:49 | FromDiscord | <Kiloneie> Because Science |
21:02:49 | ForumUpdaterBot | New thread by Akavel: Weird error between sequtils and nim-result, see https://forum.nim-lang.org/t/7645 |
21:09:22 | FromDiscord | <Kiloneie> Also fun fact, when i was trying to explain the horizontal wall placement in this last #2 video, forgot a variable change like several times in a row, resulting in 30 min spent of re recording D: |
21:09:42 | FromDiscord | <Kiloneie> All was fine till SDL shown me a white window xD |
21:25:36 | * | Guest94576 quit (Quit: Guest94576) |
21:30:34 | * | vicfred quit (Quit: Leaving) |
21:45:08 | * | Vladar quit (Quit: Leaving) |
21:50:23 | * | xet7 quit (Quit: Leaving) |
21:51:34 | * | xet7 joined #nim |
22:10:17 | FromDiscord | <Kiloneie> I saw a post about esp32 on forum, is that a microntroller i should make a video about? Idk which to get. |
22:10:31 | FromDiscord | <ElegantBeef> Yea that's a micro controller |
22:12:58 | FromDiscord | <Kiloneie> Now where to buy one xD... |
22:13:41 | FromDiscord | <Kiloneie> the DEV kit one ? https://www.arissi.eu/esp32/ |
22:14:23 | FromDiscord | <Kiloneie> Wait one has a screen on it D: |
22:15:53 | FromDiscord | <ElegantBeef> Could also get a pico, though i've just started making bindings for it |
22:17:02 | FromDiscord | <Kiloneie> The things imma do with one is probably, take pictures, wifi messaging/bluetooth, games 😛 |
22:17:59 | FromDiscord | <ElegantBeef> Yea and the pico is capable of all that(I really just want more people to test my setup as i develop it) 😛 |
22:18:19 | FromDiscord | <Kiloneie> Hah, maybe i will get one of those |
22:18:32 | FromDiscord | <Kiloneie> Idk gotta ask dom some more one of these days |
22:18:54 | FromDiscord | <Kiloneie> Cause i have no clue in microcontrollers past some foggy memory of arduino from highschool |
22:19:12 | FromDiscord | <Kiloneie> Maybe i can make something useful for myself. |
22:19:25 | FromDiscord | <Kiloneie> A mouse clicker would be dope xD |
22:19:38 | FromDiscord | <Valor> pico as in nico? |
22:19:48 | FromDiscord | <ElegantBeef> Well the pico can be a usb host device, so can be speakers, or mouse or keyboard |
22:19:53 | FromDiscord | <ElegantBeef> Nah raspberry pi pico |
22:25:51 | * | a_b_m joined #nim |
22:35:02 | FromDiscord | <dom96> I've recently learned that it's best to avoid `seq` when serializing/deserialising data on the ESP32 🙂 |
22:35:25 | * | abm quit (*.net *.split) |
22:35:26 | * | tane quit (*.net *.split) |
22:35:27 | FromDiscord | <dom96> and my plan to play small GIFs seems needs a rethought |
22:35:38 | * | zopsi quit (Max SendQ exceeded) |
22:36:01 | * | zopsi joined #nim |
22:42:26 | FromDiscord | <ElegantBeef> Are these gives stored in memory? |
22:42:30 | FromDiscord | <ElegantBeef> (edit) "gives" => "gifs" |
22:42:59 | * | tane joined #nim |
22:43:54 | FromDiscord | <ElegantBeef> (edit) "memory?" => "memory at compile time?" |
22:49:20 | * | tane quit (Quit: Leaving) |
23:09:08 | FromDiscord | <dom96> @ElegantBeef nope, they're serve via HTTP. The ESP connects to a server and requests what it should display. |
23:09:12 | FromDiscord | <dom96> (edit) "serve" => "served" |
23:09:15 | FromDiscord | <ElegantBeef> Ah |
23:21:52 | FromDiscord | <mario2> In reply to @txtincome "Are static analyzers like": I want to expand what this guy asked. Would something like lint even be needed if working with nim? |
23:23:20 | FromDiscord | <ElegantBeef> nimcheck is what is typically used at edit time to see the validity of the code |
23:25:38 | FromDiscord | <mario2> I can't find nimcheck in the documentation. |
23:25:43 | FromDiscord | <ElegantBeef> sorry it's `nim check` |
23:25:50 | FromDiscord | <ElegantBeef> https://nim-lang.org/docs/nimc.html |
23:26:09 | FromDiscord | <ElegantBeef> A compiler option that semantically checks the nim code reporting any error(s) |
23:26:27 | FromDiscord | <mario2> What about the C or C++ code? |
23:30:29 | FromDiscord | <ElegantBeef> Well with the json file you should be able to tell an editor what files are being compiled and then link it all |
23:31:26 | FromDiscord | <ElegantBeef> I've not ever needed to look at the C code aside from porting the pico sdk, though this is the only time i've done C interop |
23:33:27 | FromDiscord | <Livingstone> sent a code paste, see https://play.nim-lang.org/#ix=2T70 |
23:33:46 | FromDiscord | <Livingstone> what do you guys think about this turning a csvparser into a datatset |
23:36:29 | FromDiscord | <mario2> Is there a way I can write #include <name> and have nim know I want to import a package with that name? |
23:37:25 | FromDiscord | <ElegantBeef> https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-header-pragma |
23:37:46 | FromDiscord | <ElegantBeef> @Livingstone cmon use `s.isNil` 😛 |
23:38:18 | FromGitter | <ynfle> Nim comes top other than unix tools for the unoptimized version here! https://benhoyt.com/writings/count-words/#performance-results-and-learnings |
23:39:00 | FromDiscord | <mario2> @ElegantBeef Can I rewrite that example as similar to other languages? |
23:39:10 | FromDiscord | <ElegantBeef> @Livingstone Here you go https://play.nim-lang.org/#ix=2T74 |
23:39:15 | FromDiscord | <ElegantBeef> What do you mean mario? |
23:39:48 | FromDiscord | <ElegantBeef> Remember Nim uses a C backend so can include that C code directly |
23:40:04 | FromDiscord | <ElegantBeef> If you want to use dynamic loaded libraries checkout the `dynlib` module |
23:41:35 | FromDiscord | <mario2> I was thinking of importing packages with another shebang. Like #!/location/of/package or #! <package name>. Around the lines of that. Just place it at the top of the file to import said package. |
23:42:13 | FromDiscord | <ElegantBeef> Oh if you just want to import a file and dont want to interop with it you can just do↵`{.emit: """#include "yourHeaderFile.h"""".}` |
23:42:55 | FromDiscord | <ElegantBeef> emit will as the name implies emit the string into the source code of the backend |
23:43:12 | FromDiscord | <ElegantBeef> So you can use it for writting C/C++ or even JS code inside your nim files |
23:43:40 | FromDiscord | <mario2> What if I want to define a different means of importing a package. |
23:43:54 | FromDiscord | <ElegantBeef> What do you mean? |
23:44:18 | FromDiscord | <mario2> I said this morning I want to make a language on top of nim. I just want to make a means of important not header files. |
23:44:28 | FromDiscord | <ElegantBeef> If you dont want that emit but want `#! "yourheaderfile.h"`? |
23:44:38 | FromDiscord | <mario2> So emit is the way? |
23:44:49 | FromDiscord | <ElegantBeef> Well emit outputs code into the C file |
23:45:13 | FromDiscord | <ElegantBeef> So you can write any C code there and it'll be compiled along side your project |
23:45:24 | FromDiscord | <mario2> I don't think I'm clear. I want a means of important a different file other than header files or .nim files into my projects. |
23:45:38 | FromDiscord | <ElegantBeef> Ok so you want to include different source files |
23:45:48 | FromDiscord | <ElegantBeef> `staticRead` will let you load files into memory |
23:46:09 | FromDiscord | <ElegantBeef> Useful for embedding assets and the like into programs |
23:46:25 | FromDiscord | <mario2> Can I use type or template or macro to define how staticRead imports the file? |
23:46:44 | FromDiscord | <ElegantBeef> Well it'll read the file and return a string, so then you can process that at CTE |
23:46:47 | FromDiscord | <ElegantBeef> (edit) "CTE" => "CT" |
23:47:28 | FromDiscord | <ElegantBeef> Like for instance i use that for loading levels/tutorials in my game https://media.discordapp.net/attachments/371759389889003532/821530136498798633/unknown.png |
23:47:34 | FromDiscord | <ElegantBeef> I still dont know if this is what you mean |
23:47:49 | FromDiscord | <mario2> Let me give you an example. Give me a second. |
23:49:14 | FromDiscord | <mario2> sent a code paste, see https://play.nim-lang.org/#ix=2T76 |
23:49:35 | FromDiscord | <ElegantBeef> And what would those files do? |
23:49:57 | FromDiscord | <mario2> They would contain my source code. I said I was building a language on top of nim. |
23:50:34 | FromDiscord | <ElegantBeef> So these would be statically loaded files that would be expanded into nim code by the `#! macro`? |
23:51:09 | FromDiscord | <ElegantBeef> if that's the goal then yea a macro should be able to run over the file given a path, and expand it into nim code to be compiled |
23:51:44 | FromDiscord | <mario2> Then how do I say "HEY NIM! IMPORT THIS PACKAGE!" when I type #! at the top? |
23:51:51 | FromDiscord | <ElegantBeef> A macro |
23:51:52 | FromDiscord | <mario2> Or rather how do I get nim to understand it? |
23:51:56 | FromDiscord | <mario2> Thank you. |
23:52:24 | FromDiscord | <ElegantBeef> The macro would read the file and parse it into the equivlent nim code, that then emits it out to be compiled |
23:53:19 | FromDiscord | <ElegantBeef> To see this in action you could use `readFile` inside the macro and then `parseStmt` on that string which would let you atleast use Nim code in a seperate non .nim file |
23:54:37 | FromDiscord | <mario2> This can work. The language on top of nim would transpile my source code to be made into nim code to be compiled. |