00:00:07 | FromDiscord | <Yardanico> but proc is simpler (less powerful feature) than a template |
00:01:50 | giaco | no real aliasing? |
00:02:20 | giaco | I have a proc and I want to rename it to something else, not really create a wrap like with proc or template |
00:02:46 | FromDiscord | <ElegantBeef> Well timothee has a PR which would allow aliasing procedures, but nothing is in the language afaik |
00:03:08 | FromDiscord | <ElegantBeef> a template would be a fine alias |
00:03:16 | FromDiscord | <Yardanico> @giaco are you importing it from some other module? |
00:03:33 | giaco | Yardanico, yes |
00:04:23 | FromDiscord | <ElegantBeef> Also yard when i seen this early today i had a chuckle https://media.discordapp.net/attachments/371759389889003532/816098574566817852/unknown.png |
00:04:33 | FromDiscord | <Yardanico> 🥴 |
00:04:39 | FromDiscord | <Yardanico> it started at ~6 btw |
00:04:48 | FromDiscord | <Yardanico> I just don't want to make those PRs too big |
00:04:48 | FromDiscord | <ElegantBeef> I had seen |
00:04:57 | FromDiscord | <Yardanico> like the 5th part is just times.nim |
00:05:00 | FromDiscord | <Yardanico> which has a ton of backticks |
00:07:38 | FromDiscord | <dom96> It's great work btw 🙂 |
00:07:46 | FromDiscord | <Yardanico> two vscode regexes :P |
00:07:48 | FromDiscord | <Yardanico> (mostly) |
00:07:52 | FromDiscord | <dom96> fixing these style things should generally be done like this |
00:07:58 | FromDiscord | <Yardanico> had to reformat the table manually though |
00:11:12 | * | Vladar quit (Quit: Leaving) |
00:15:08 | * | kitech1- joined #nim |
00:15:56 | * | kitech1 quit (Ping timeout: 240 seconds) |
00:44:17 | giaco | how to to use this? https://nim-lang.org/docs/with.html if I do "import with", nim says "cannot open file: with" |
00:44:59 | FromDiscord | <ElegantBeef> `import std/with` |
00:45:23 | FromDiscord | <ElegantBeef> soon the docgen will show the import path |
00:48:34 | giaco | thanks! |
00:49:17 | giaco | damn, it doesn't work with generics. I tried to use it to run "del" multiple times on a CountTable |
00:56:44 | FromDiscord | <バロザード> is there an api for pixecs somewhere? |
00:56:46 | FromDiscord | <バロザード> im a bit lost lol |
00:59:21 | giaco | nevermind, it works. I was using let instead of var to store CountTable |
01:03:27 | * | rockcavera quit (Read error: Connection reset by peer) |
01:03:52 | * | rockcavera joined #nim |
01:11:53 | FromDiscord | <MapleSyrup|TagMeIfReply> is there any sort of repo where I can add a library I've written in nim? |
01:12:32 | FromDiscord | <InventorMatt> That would be on nimble |
01:12:45 | FromDiscord | <MapleSyrup|TagMeIfReply> oh ok I'll google for that |
01:12:52 | FromDiscord | <MapleSyrup|TagMeIfReply> is that the package manager |
01:13:06 | FromDiscord | <InventorMatt> Yes it is |
01:24:00 | * | njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
01:24:21 | * | njoseph joined #nim |
01:25:03 | * | grobe0ba quit (Quit: ZNC 1.7.5 - https://znc.in) |
01:25:15 | * | grobe0ba joined #nim |
01:31:19 | ForumUpdaterBot | New thread by Shirleyquirk: Comments and criticism,please: Nimplementation of Church Numerals, see https://forum.nim-lang.org/t/7570 |
01:33:47 | FromDiscord | <Rika> oh my lord nimplementation |
01:37:58 | giaco | I already have a working solution using tables, but I though I could speed things up using enums, but I can't find what's the right input for the mapIt here: https://play.nim-lang.org/#ix=2RmM |
01:38:38 | FromDiscord | <Yardanico> what do you want to do? |
01:38:46 | FromDiscord | <Yardanico> convert string into a sequence of enum values? |
01:40:15 | giaco | Yardanico: convert string like "ACGTGGTCTTAA" to "UGCACCAGAAUU" in the fastest way possible. I do know the link I've posted lacks the seq[char] to string conversion, but what puzzles me is how to get the enum value from a mapIt |
01:41:04 | giaco | I though enum based mapping would be faster than tables one, right? |
01:41:22 | FromDiscord | <Yardanico> did you see https://nim-lang.org/docs/strutils.html#multiReplace%2Cstring%2Cvarargs%5B%5D ? |
01:41:46 | FromDiscord | <shirleyquirk> In reply to @Rika "oh my lord nimplementation": sorry |
01:41:47 | giaco | oh! no, didnt know that |
01:42:27 | giaco | thanks! But do don't waste this chance to learn something new, how could I complete my enum experiment? |
01:42:42 | FromDiscord | <Yardanico> well there's parseEnum in strutils defined for strings |
01:44:28 | giaco | Yardanico: parseEnum goes to the other way (value->key), I just need key->value replacement in mapIt where "it" is the key |
01:47:07 | FromDiscord | <MapleSyrup|TagMeIfReply> how do I like get my pkg on nimble |
01:47:26 | FromDiscord | <Yardanico> `nimble publish` |
01:47:56 | FromDiscord | <Yardanico> @giaco I can't think of anything which would make sense to do here, with your enum I just don't think it's a good idea to use enums with mapIt here :P |
01:48:35 | FromDiscord | <Yardanico> it can be much easier if you make "ACGU" the enum members instead |
01:50:16 | giaco | Yardanico: but parseEnum would be more expensive than a table based solution, I think |
01:50:20 | giaco | but not sure |
01:50:29 | FromDiscord | <Yardanico> it generates a case statement |
01:52:10 | FromDiscord | <Yardanico> for chars like that you can just have an array, but it's not a very good solution either |
01:53:35 | giaco | if parseenum is a compile-time thing, it must be fast! I'm quite curious now, let's try it |
01:53:50 | FromDiscord | <Yardanico> it generates a case statement at compile time |
01:53:53 | FromDiscord | <Yardanico> you can check which code it makes |
01:56:09 | FromDiscord | <Yardanico> gn |
02:06:21 | * | rockcavera quit (Remote host closed the connection) |
02:18:08 | * | rockcavera joined #nim |
02:55:30 | * | abm quit (Read error: Connection reset by peer) |
03:18:15 | * | asdflkj quit (Ping timeout: 240 seconds) |
03:21:18 | * | Gustavo6046 quit (Quit: ZNC 1.8.2 - https://znc.in) |
03:26:43 | * | muffindrake quit (Ping timeout: 272 seconds) |
03:28:07 | * | muffindrake joined #nim |
03:34:14 | * | teasea quit (Ping timeout: 260 seconds) |
03:42:44 | * | rockcavera quit (Remote host closed the connection) |
03:46:57 | * | teasea joined #nim |
03:48:22 | FromDiscord | <phpOstrich> Whats some good free resources for learning how to make a compiler? |
03:50:24 | FromDiscord | <flywind> https://gist.github.com/haxscramper/3562fa8fee4726d7a30a013a37977df6 |
03:50:31 | FromDiscord | <flywind> ^ |
03:56:54 | FromDiscord | <phpOstrich> thank you |
03:57:18 | FromDiscord | <flywind> no problem |
04:04:27 | * | gpanders quit (Ping timeout: 268 seconds) |
04:16:17 | * | gpanders joined #nim |
04:23:43 | giaco | I'm solving the trivial problem of DNA->RNA string replacement, but I'm experimenting different ways to achieve in the fastest way possible in nim. So I came up with 3 possible solutions that are all correct according to the same testset, but benchmark shows large gaps between the solutions. I'd like to ask you some comments about why it is fast, and why it is slow: https://play.nim-lang.org/#ix=2Rnm |
04:27:42 | FromDiscord | <ElegantBeef> method 3 has a ton of string allocations |
04:28:47 | giaco | ElegantBeef, I tried to solve it without, but I failed to turn the advantage of enums into profit |
04:29:06 | FromDiscord | <ElegantBeef> You're also using tables |
04:30:11 | giaco | table hash access should be ~ O(n*logn) correct? |
04:30:24 | FromDiscord | <ElegantBeef> Well it's slower regardless than a direct array index |
04:30:30 | FromDiscord | <ElegantBeef> I'm going to write an impl |
04:30:31 | giaco | sure |
04:31:01 | FromDiscord | <Rika> Can’t you use in place writing or will that not work |
04:32:38 | giaco | ElegantBeef, I actually didn't write the trivial for loop with switch case inside that builds a string |
04:36:59 | FromDiscord | <dponyatov> In reply to @phpOstrich "Whats some good free": Is Nim suitable for writing compilers? For my taste, the language for compiler writing must have rich pattern matching over data structures, is Nim has this power? |
04:37:40 | FromDiscord | <ElegantBeef> giaco we're vastly faster now 😛 https://play.nim-lang.org/#ix=2Rnp |
04:38:36 | FromDiscord | <dponyatov> Elixir has a very interesting thing -- polymorphic functions which use not arguments but patterns. It will be great to have such a thing in next Nim but its implementation looks scary hard. |
04:39:22 | FromDiscord | <ElegantBeef> https://nim-lang.github.io/fusion/src/fusion/matching.html think this is the most elaborate pattern matcher in Nim |
04:41:15 | giaco | ElegantBeef, yeah in the meantime I write a quite similar function but I used newStringOfCap + result.add instead of your result[i] loop. Which one is faster? Let me compare |
04:41:37 | FromDiscord | <ElegantBeef> They're be realtively similar, since it just has to increment the length every add |
04:41:55 | FromDiscord | <ElegantBeef> (edit) "They're" => "They'll" |
04:42:40 | FromDiscord | <ElegantBeef> So a quick break down, first one is slow since you're doing a loop to convert it to the rna side, then another loop over it to join elements |
04:43:11 | FromDiscord | <ElegantBeef> second is pretty fast cause it's mostly inline replacing |
04:46:32 | FromDiscord | <ElegantBeef> Also for future benchmarking might be worth while to check benchy out, or atleast use monotimes 😛 |
04:46:34 | giaco | ElengantBeef, thanks for the comments, I think I see now where the time waste is within std calls. Here's a final version with all 5 implementations and benchmark results: https://play.nim-lang.org/#ix=2Rnq |
04:48:06 | FromDiscord | <ElegantBeef> Yea like i though 4/5 arent overly different |
04:48:10 | giaco | I wonder if your "result[i] = case ..." is faster than "case c: ... result[i] = ... " |
04:48:23 | giaco | let me test that too |
04:48:40 | FromDiscord | <ElegantBeef> Isnt 5 exactly that? |
04:49:00 | FromDiscord | <ElegantBeef> It's almost certainly not going to change much since 4/5 are in spitting distance |
04:49:31 | FromDiscord | <ElegantBeef> Also worth noting this is all in debug atleast, so with `-d:release` and `--gc:arc` the string methods are probably not nearly this slow |
04:51:11 | giaco | Yeah no difference between 5 and 6: https://play.nim-lang.org/#ix=2Rnr |
04:51:19 | giaco | let me test with release + arc |
04:52:39 | giaco | what a change!! |
04:52:41 | giaco | :D |
04:52:47 | FromDiscord | <ElegantBeef> Results? |
04:53:41 | giaco | ElegantBeef: http://ix.io/2Rnt |
04:54:05 | FromDiscord | <ElegantBeef> Yea the nim optimize pipeline is surpisingly effective |
04:54:14 | giaco | heap operations are waaaay faster |
04:54:57 | giaco | I wonder if where the magic lives the most: is it relese, or is it arc? let's see |
04:54:59 | FromDiscord | <ElegantBeef> Yea most of that is just `release` and it telling it to turn the optimizer on |
04:55:23 | FromDiscord | <ElegantBeef> Arc helps, but here it only knocks 30ms off the 3rd method |
04:57:28 | giaco | release but not arc: http://ix.io/2Rnw, arc but not release: http://ix.io/2Rnx |
04:58:00 | FromDiscord | <ElegantBeef> I do highly suggest benchy though for this stuff, since it lets you easily run different number of benchmarks and even gives avg/std deviation https://github.com/treeform/benchy |
04:59:39 | giaco | I'm quite confused why -d:release and --gc:arc seems to result in equal optimization |
04:59:42 | Prestige | So I think https://nim-lang.org/docs/selectors.html#select%2CSelector%5BT%5D%2Cint "Specifying a timeout of -1 causes the function to block indefinitely" was a lie |
05:01:39 | Prestige | okay nevermind, why am I getting one event for no reason |
05:01:58 | giaco | I'm rerunning all the versions with benchy, thanks! |
05:12:50 | giaco | ElegantBeef: thats interesting. --gc:arc without -d:release has the worst speed in every case (even slower than just default "c"), except for "toRNA3" |
05:13:51 | FromDiscord | <ElegantBeef> Well arc is mostly lower latency, but can give a ton of speed up depending on the library |
05:14:49 | giaco | but --gc:arc with -d:release has the best speed in every case |
05:15:51 | giaco | -d:release without --gc:arc lives somewhere in the middle, but near the -d:release only scenario |
05:16:49 | giaco | considering what arc is doing, and what are the benefits of it, I'd say that a piece of art considering these numbers |
05:16:53 | FromDiscord | <ElegantBeef> Yea you can use the other GC's but we're mostly just fighting allocating/deallocating |
05:17:19 | FromDiscord | <ElegantBeef> This isnt a long lived program so not overly getting many benefits of arc vs gc here |
05:18:03 | giaco | absolutely, the original comparison was on the algorithm level, I just pushed in testing gc just out of curiosity |
05:44:36 | * | haxscramper joined #nim |
05:49:00 | FromDiscord | <haxscramper> In reply to @dponyatov "Is Nim suitable for": Yes, I think nim is suitable for compiler development, and we do have pattern matching https://nim-lang.github.io/fusion/src/fusion/matching.html. Also see https://gist.github.com/haxscramper/3562fa8fee4726d7a30a013a37977df6 for list of language development-related links. Nim compiler is fully written in nim too. |
05:56:24 | FromDiscord | <haxscramper> In reply to @dponyatov "Elixir has a very": sent a code paste, see https://play.nim-lang.org/#ix=2RnJ |
06:24:44 | * | narimiran joined #nim |
06:30:48 | FromDiscord | <haxscramper> In reply to @dponyatov "Elixir has a very": https://play.nim-lang.org/#ix=2RnU - can be done using macros in less then 100 lines. Implementation is a hack really, but should give general idea on how to implement something more robust |
06:31:15 | FromDiscord | <haxscramper> Should work for any AST-like structures that have `kind` field |
06:32:30 | FromDiscord | <haxscramper> In theory should even work with pattern-matching runtime-polymorphic objects hierarchies (derived objects) |
06:34:36 | FromDiscord | <ElegantBeef> Hax help me avoid the include in my concept derived interfaces 😛 |
06:35:22 | FromDiscord | <ElegantBeef> I joke but having this here to get all the symbols implemented just makes me annoyed since this file has to be included to be used https://github.com/beef331/constructor/blob/master/src/constructor/implements.nim#L16 |
06:52:10 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
07:06:00 | * | krux02 joined #nim |
08:17:43 | * | stefantalpalaru quit (Ping timeout: 260 seconds) |
08:18:04 | * | stefantalpalaru joined #nim |
08:48:41 | * | PMunch joined #nim |
08:50:23 | ForumUpdaterBot | New thread by Drkameleon: Advice on using linenoise?, see https://forum.nim-lang.org/t/7571 |
08:51:14 | * | kenran joined #nim |
09:00:10 | * | oswin[m] quit (Quit: Idle for 30+ days) |
09:00:10 | * | ee7[m] quit (Quit: Idle for 30+ days) |
09:23:24 | PMunch | Shouldn't this line simply be `CompletionCallback` and not `ptr CompletionCallback`? https://github.com/nim-lang/Nim/blob/v1.4.4/lib/wrappers/linenoise/linenoise.nim#L19 |
09:33:05 | haxscramper | If original C function accepts `(*)` then yes, `{.cdecl.}` proc maps to C function pointer |
09:33:19 | haxscramper | And it should be just `CompletionCallback` |
09:42:15 | * | evilkhaoskat joined #nim |
09:48:06 | * | evilkhaoskat quit () |
09:49:36 | * | krux02_ joined #nim |
09:51:03 | * | krux02 quit (Ping timeout: 260 seconds) |
09:51:46 | * | krux02_ is now known as krux02 |
09:52:22 | * | kenran quit (Quit: leaving) |
10:15:21 | FromDiscord | <gogolxdong> sent a code paste, see https://play.nim-lang.org/#ix=2RoS |
10:16:23 | FromDiscord | <gogolxdong> It seems a bug of orc. |
10:53:28 | * | teasea quit (Quit: teasea) |
10:55:34 | * | teasea joined #nim |
11:00:37 | * | teasea quit (Quit: teasea) |
11:01:00 | * | teasea joined #nim |
11:44:16 | * | narimiran quit (Ping timeout: 240 seconds) |
12:10:02 | * | rockcavera joined #nim |
12:21:44 | * | romes[m] joined #nim |
12:24:39 | * | stefantalpalaru quit (Changing host) |
12:24:40 | * | stefantalpalaru joined #nim |
12:27:06 | * | xet7 quit (Remote host closed the connection) |
12:30:47 | * | xet7 joined #nim |
12:43:46 | * | kenran joined #nim |
13:04:46 | * | tane joined #nim |
13:08:55 | FromDiscord | <IndianGoldSmith> Hi all, is there any visual studio extension for Nim ? |
13:18:10 | PMunch | Visual Studio, or VSCode? |
13:18:37 | FromDiscord | <IndianGoldSmith> @PMunch , Visual Studio. |
13:18:49 | PMunch | Not sure really |
13:18:58 | PMunch | I mean you can probably use LSP |
13:19:11 | PMunch | But you'll need something else for highlighting |
13:19:12 | FromDiscord | <IndianGoldSmith> LSP ? |
13:19:18 | PMunch | Language Server Protocol |
13:19:23 | FromDiscord | <IndianGoldSmith> Oh isee |
13:36:07 | FromDiscord | <gogolxdong> Is there any link of Nim Ethereum client? |
13:38:45 | FromDiscord | <x19> @IndianGoldSmith are u using Nim inside VS? |
13:39:44 | FromDiscord | <IndianGoldSmith> @x19 , not yet, but i want to use it. Only if there is an extension to support syntax highlighting and building. |
13:39:50 | FromDiscord | <mratsim> In reply to @gogolxdong "Is there any link": Eth1? https://github.com/status-im/nimbus-eth1 |
13:40:19 | FromDiscord | <mratsim> but maybe you only need web3? https://github.com/status-im/nim-web3 |
13:41:21 | FromDiscord | <mratsim> We received a grant to make Nimbus a first class Eth1 client this year and hired 2 people in the past month to make that a reality so it still needs some revamping. |
13:46:56 | * | antranigv quit (Max SendQ exceeded) |
13:49:44 | * | antranigv joined #nim |
13:52:33 | FromGitter | <gogolxdong> what's the difference between https://github.com/status-im/nimbus-eth2 and eth1 |
13:53:40 | FromGitter | <gogolxdong> I'm seeking a solution of crossing blockchain protocol like Polkadot. |
13:54:07 | FromGitter | <gogolxdong> discord is unstable here. |
13:56:48 | FromGitter | <gogolxdong> cross blockchain protocol and blockchain interoperability |
13:59:08 | * | superbia joined #nim |
14:00:02 | FromDiscord | <mratsim> nimbus-eth1 is for an Ethereum 1 client, nimbus-eth2 for an Ethereum 2 client |
14:00:33 | FromDiscord | <mratsim> There are no Nim solutions to cross blockchain protocols (Polkadot, Cosmos, Avalanche, ....) |
14:19:28 | FromGitter | <gogolxdong> Is it going to have one? |
14:20:03 | FromDiscord | <mratsim> Not from us. |
14:21:16 | FromDiscord | <mratsim> We're committed to Ethereum. But you can very well use our libraries to build clients for other blockchain |
14:21:31 | FromDiscord | <mratsim> though likely the easiest is to run one of their official client and use their RPC API |
14:21:38 | FromDiscord | <mratsim> (edit) "client" => "clients" |
14:22:59 | FromGitter | <gogolxdong> that's the spirit |
14:26:31 | FromGitter | <gogolxdong> https://github.com/snej/nimdbx doesn't play well with Windows. I was going to use it as memory mapping database. |
14:30:01 | * | narimiran joined #nim |
14:36:45 | * | asdflkj joined #nim |
14:49:30 | * | Gustavo6046 joined #nim |
15:05:00 | * | abm joined #nim |
15:06:02 | FromDiscord | <Cark> Is there a place with the orc/arc dictionary of functions and operators ? |
15:07:52 | FromDiscord | <Yardanico> https://nim-lang.org/docs/destructors.html |
15:08:05 | FromDiscord | <Cark> ah thanks let me check that |
15:08:27 | FromDiscord | <Cark> yes that's it, thanks |
15:08:52 | FromDiscord | <Yardanico> and if you want for devel - https://nim-lang.github.io/Nim/destructors |
15:09:24 | FromDiscord | <mratsim> The most important functions are axe and bash. |
15:09:46 | FromDiscord | <Cark> :) |
15:13:51 | FromGitter | <gogolxdong> Anyone familiar with Synchronization Graph? |
15:22:59 | FromDiscord | <alex.boisvert> I saw somewhere a syntax that allows creating an object and assigning it to a ref in one expression recently but I forgot what it was ... it was something like `let apple = (new Apple)(Apple(color: Red))` (obviously that's not it but just trying to give you a sense of what I remember). Anybody knows? |
15:23:22 | FromDiscord | <MapleSyrup|TagMeIfReply> anyone know why this is wrong? `proc getstuff(obj: var Class): array = return somearray↵` |
15:23:24 | FromGitter | <gogolxdong> https://github.com/Conflux-Chain it's been said this is from the best university of China.It uses a tree-graph data structure to achieve 3000+TPS , which is 428 times performance than BTC, and 75 times performance than ETH. |
15:24:29 | FromDiscord | <konsumlamm> In reply to @alex.boisvert "I saw somewhere a": if `Apple` already is a `ref object`, youcan just do `Apple(color: Red)`, if that's what you mean, otherwise, you usually define a function `proc newApple(color: Color): ref Apple` |
15:25:37 | FromDiscord | <Yardanico> There's a way to do it inline |
15:25:49 | FromDiscord | <alex.boisvert> yeah, i'm familiar with that pattern, I'm looking for an easier way to call the object constructor + new operator and then assign the object's value to the heap-allocated ref |
15:26:19 | FromDiscord | <konsumlamm> In reply to @MapleSyrup|TagMeIfReply "anyone know why this": probably because you need to specify the generic parameters for `array`: `array[N, T]` where `N` is the number (or range) of elements and `T` is the element type |
15:26:37 | FromDiscord | <Yardanico> https://play.nim-lang.org/#ix=2Rqt |
15:26:42 | FromGitter | <gogolxdong> Turing Award winner as it's chief scientist. |
15:26:48 | FromDiscord | <Yardanico> @alex.boisvert |
15:27:17 | FromDiscord | <konsumlamm> lol that works? TIL |
15:27:25 | FromDiscord | <alex.boisvert> @Yardanico thanks! that's it |
15:28:37 | FromDiscord | <alex.boisvert> i get it now, it triggers a conversion from Apple (object) to ref Apple |
15:29:11 | FromDiscord | <MapleSyrup|TagMeIfReply> @konsumlamm thanks am I doing this right? still get a similar error: `proc getstuff(obj: var Class): array[N, string] = return somearray↵` |
15:29:29 | FromDiscord | <MapleSyrup|TagMeIfReply> type mismatch: got <array[0..24, string]> but expected 'array[Error Type, string]' |
15:29:44 | FromDiscord | <konsumlamm> you didn't specify what `N` is |
15:29:52 | FromDiscord | <MapleSyrup|TagMeIfReply> can it not be anything? |
15:30:02 | FromDiscord | <MapleSyrup|TagMeIfReply> or how do I define that |
15:30:09 | FromDiscord | <Solitude> In reply to @MapleSyrup|TagMeIfReply "<@!312654963694108674> thanks am I": array size has to be known at compile time |
15:30:14 | FromDiscord | <konsumlamm> you can make it generic, but then you need to add `[N: static int]` |
15:30:20 | FromDiscord | <konsumlamm> apparently you want it to be 25 here though |
15:30:25 | FromDiscord | <konsumlamm> (or 0..24) |
15:30:38 | FromDiscord | <konsumlamm> assuming the size of the array you return is always the same |
15:30:53 | FromDiscord | <konsumlamm> otherwise, use a `seq[T]` |
15:30:57 | * | kenran quit (Quit: leaving) |
15:30:59 | FromDiscord | <MapleSyrup|TagMeIfReply> I do know the size of the array so can I just do `proc getstuff(obj: var Class): array[myarray.len(), string] = return somearray` ? |
15:31:08 | FromDiscord | <alex.boisvert> ... or used an `UncheckedArray`↵http://nim-lang.github.io/Nim/manual.html#types-unchecked-arrays |
15:31:27 | FromDiscord | <MapleSyrup|TagMeIfReply> oh! interesting |
15:31:47 | FromDiscord | <Solitude> In reply to @MapleSyrup|TagMeIfReply "I do know the": you can if myarray is visible there |
15:32:07 | FromDiscord | <konsumlamm> eh, i'm no friend of recommending unsafe stuff to beginners |
15:32:35 | FromDiscord | <konsumlamm> though ehre you can use normal `array` anyway |
15:33:02 | FromDiscord | <MapleSyrup|TagMeIfReply> gotcha, that worked |
15:33:24 | FromDiscord | <Yardanico> @MapleSyrup|TagMeIfReply use a sequence if length is unknown at compile time |
15:33:42 | FromDiscord | <MapleSyrup|TagMeIfReply> is there any way to declare a const variable in an object typedef? |
15:33:42 | FromDiscord | <Yardanico> They're not as bad as some think :P |
15:33:52 | FromDiscord | <MapleSyrup|TagMeIfReply> ohh ok, yeah I'lll keep that in mind |
15:34:03 | FromDiscord | <konsumlamm> In reply to @MapleSyrup|TagMeIfReply "is there any way": you mean like an associated constant? |
15:34:18 | FromDiscord | <MapleSyrup|TagMeIfReply> I have no idea what that is but it sounds like what I need |
15:34:30 | FromDiscord | <MapleSyrup|TagMeIfReply> I can paste code to show |
15:34:52 | FromDiscord | <alex.boisvert> if your object itself is a `const`, then whatever you put in it would also be `const` |
15:35:18 | FromDiscord | <MapleSyrup|TagMeIfReply> http://vpaste.net/IMiWM?bg=dark&nu |
15:35:33 | FromDiscord | <MapleSyrup|TagMeIfReply> hmm no it is not const, I'm looking to make one of the variables inside a const |
15:35:52 | FromDiscord | <haxscramper> There are not immutable fields, immutability in nim is a property of variable |
15:35:58 | FromDiscord | <haxscramper> Like `let` or `const` |
15:36:31 | FromDiscord | <MapleSyrup|TagMeIfReply> ohh bummer |
15:36:33 | FromDiscord | <haxscramper> `const varname = YourObject()` will create fully immutable variable |
15:36:39 | FromDiscord | <Yardanico> by the way @alex.boisvert you can do the opposite, although it's uglier :P (maybe there's an easier way, I don't remember)↵↵https://tio.run/##Ncw7DoAgEEXRnlW8xAYWYGNi4TqMBeIQ0VGITuPq8d/fe9aw5CxHIjQpMaHGRh6xn8iJAnyFsIpSBXaxboZljs4KDX/CJLDfqW8nev1I2rSdMfoCSqPIjfHNcj4B |
15:36:42 | FromDiscord | <MapleSyrup|TagMeIfReply> yeah, but that's a tad much |
15:37:04 | FromDiscord | <MapleSyrup|TagMeIfReply> I was hoping to createa a class and have some const variables in there. what's the best way to handle this -- make them global? |
15:37:54 | FromDiscord | <haxscramper> You can also declare `proc field(obj: YourObj): auto -= obj.actualField` and ``proc `field=`(obj: YourObj, val: ...): {.error: "Cannot assign to immutable.}`` |
15:37:58 | FromDiscord | <Yardanico> Nim doesn't really have a notion of "classes" as in traditional OOP languages |
15:38:17 | FromDiscord | <haxscramper> In reply to @haxscramper "You can also declare": Basically make it private, declare getter but not setter |
15:38:19 | FromDiscord | <konsumlamm> In reply to @haxscramper "There are not immutable": btw, what's the reasoning for this? the only other language i know of that does this is Rust |
15:38:22 | FromDiscord | <alex.boisvert> In reply to @Yardanico "by the way <@660984379023163402>": What's the difference here with straight up `Apple(f: 5)` ? |
15:38:36 | FromDiscord | <MapleSyrup|TagMeIfReply> +1 im also curious |
15:38:43 | FromDiscord | <haxscramper> In reply to @konsumlamm "btw, what's the reasoning": no idea. I would personally prefer to have immutability as a part of a type |
15:38:45 | FromDiscord | <Yardanico> @alex.boisvert Apple is ref object, but we are making "object" |
15:39:09 | FromDiscord | <alex.boisvert> oh i see, i didn't catch that you changed it to a ref. gotcha. |
15:39:31 | FromDiscord | <haxscramper> In reply to @haxscramper "no idea. I would": `strictFuncs` for example approximates pointer to immutable object, but this could be avoided by just using `ref const T` ... I think |
15:39:40 | FromDiscord | <MapleSyrup|TagMeIfReply> im still unclear on the whole when to use `ref` vs `object` business |
15:40:07 | FromDiscord | <Solitude> In reply to @MapleSyrup|TagMeIfReply "im still unclear on": if its unclear - object |
15:40:40 | FromDiscord | <alex.boisvert> In reply to @alex.boisvert "oh i see, i": it's a bit of a weird contorsion just to get the object type of a ref. |
15:40:59 | FromDiscord | <MapleSyrup|TagMeIfReply> ok i'll take that as a ruule of thumb |
15:41:02 | FromDiscord | <MapleSyrup|TagMeIfReply> 👍 |
15:41:34 | FromDiscord | <Yardanico> If you want convenience or shared ownership (multiple variables refer to the same object) - ref object, if you're not afraid to insert some "var" annotations in arguments - object, but there's more to it of course |
15:41:47 | FromDiscord | <haxscramper> In reply to @haxscramper "no idea. I would": Actually I'm now really interested. @Yardanico maybe you know the reasoning/relevant discussions about that. |
15:41:50 | FromDiscord | <haxscramper> (edit) "that." => "that?" |
15:42:27 | FromDiscord | <Yardanico> honestly I don't recall any discussions about this |
15:42:46 | FromDiscord | <MapleSyrup|TagMeIfReply> there was a reddit post by dom |
15:42:50 | FromDiscord | <MapleSyrup|TagMeIfReply> comment rather |
15:42:52 | FromDiscord | <exelotl> Araq talks about it in this post: https://nim-lang.org/araq/writetracking_2.html |
15:42:52 | FromDiscord | <Yardanico> The best bet is to ask 4raq :D |
15:43:07 | FromDiscord | <alex.boisvert> for the case of a `let` assignment, i wonder if `let apple = Apple(f: 5)[]` would be equivalent in terms of generated code. it's a bit more straightforward |
15:43:49 | * | superbia quit (Ping timeout: 276 seconds) |
15:44:14 | FromDiscord | <Yardanico> @alex.boisvert hmm, I think it'll allocate on the heap but dereference straight away, let me check |
15:45:03 | FromDiscord | <MapleSyrup|TagMeIfReply> is it possible to sort imports using nimpretty? |
15:45:08 | FromDiscord | <MapleSyrup|TagMeIfReply> or any other tool for that |
15:46:02 | FromDiscord | <haxscramper> no. nimpretty works for basic syntax formatting only |
15:46:45 | FromDiscord | <Clyybber> @MapleSyrup|TagMeIfReply https://github.com/treeform/morepretty |
15:53:39 | FromDiscord | <Clyybber> In reply to @Yardanico "<@660984379023163402> hmm, I think": `var a = old Apple` ;p |
15:53:50 | FromDiscord | <Yardanico> Bad apple |
15:53:57 | FromDiscord | <Yardanico> :nimRawr: |
15:54:22 | FromDiscord | <alex.boisvert> In reply to @Yardanico "Bad apple": I've confirmed (looked at the generated C) that it still allocated on the heap, even with `-d:danger` |
15:54:40 | FromDiscord | <Yardanico> yeah, that's expected |
15:56:19 | FromDiscord | <mratsim> use `(typeof Apple()[])(f: 5)` |
15:56:44 | FromDiscord | <mratsim> Or change the type definition so that you split the base object from the ref type |
15:57:20 | FromDiscord | <Yardanico> that's the same as I shown :P |
15:57:30 | FromDiscord | <Yardanico> Although you didn't use parenthesis for typeof |
15:57:53 | FromDiscord | <MapleSyrup|TagMeIfReply> I can't find `morepretty` on nimble...it does have a .nimble file tho |
15:58:11 | FromDiscord | <haxscramper> you can install using github URL |
15:58:24 | FromDiscord | <haxscramper> `nimble install "https://github.com/treeform/morepretty"` I think |
15:58:29 | FromDiscord | <MapleSyrup|TagMeIfReply> oh! thanks |
15:58:58 | FromDiscord | <Clyybber> I think you can do `(Apple[])(f: 5)` too |
15:59:09 | FromDiscord | <Yardanico> illformed AST :( |
15:59:12 | FromDiscord | <Yardanico> I already tried |
15:59:17 | FromDiscord | <Clyybber> oh :D |
16:00:09 | FromDiscord | <Yardanico> ah wait actually in this case it's not illformed ast |
16:00:30 | FromDiscord | <Yardanico> It tries to call [] on a typedesc |
16:01:25 | FromDiscord | <Clyybber> yep |
16:01:40 | FromDiscord | <MapleSyrup|TagMeIfReply> who is treeform and why do they have so many packages for nim |
16:01:46 | saem | More parenthesis? |
16:01:50 | FromDiscord | <Yardanico> they are a human (maybe) |
16:01:51 | * | rauss quit (Quit: WeeChat 3.0) |
16:01:57 | FromDiscord | <MapleSyrup|TagMeIfReply> but why |
16:02:00 | FromDiscord | <Yardanico> why not? |
16:02:01 | saem | I'm treeform |
16:02:06 | saem | I'm even |
16:02:06 | FromDiscord | <MapleSyrup|TagMeIfReply> lies |
16:02:08 | FromDiscord | <Yardanico> everyone is treeform |
16:02:09 | saem | In |
16:02:15 | saem | Crap |
16:02:24 | FromDiscord | <MapleSyrup|TagMeIfReply> you're in crap? |
16:04:30 | FromDiscord | <hotdog> Treeform does have a crazy amount of packages. Very impressive |
16:06:48 | FromDiscord | <mratsim> Trees colonize Earth |
16:11:49 | FromDiscord | <Yardanico> treeform is a tree confirmed? |
16:13:37 | FromDiscord | <MapleSyrup|TagMeIfReply> treeluminati confirmed!11!!1 |
16:18:23 | FromDiscord | <MapleSyrup|TagMeIfReply> would anyone be interested in a nim package for reading/pasting to clipboard on windows |
16:19:24 | FromDiscord | <Yardanico> wasn't there something like that already? hm |
16:19:38 | FromDiscord | <mratsim> would anyone be interested in ~~a nim package for reading/pasting to clipboard on~~ windows |
16:19:49 | FromDiscord | <Yardanico> https://github.com/Guevara-chan/Cliptomania found this |
16:20:21 | FromDiscord | <Yardanico> but yeah, a generic cross-platform clipboard might be useful |
16:20:52 | FromDiscord | <Yardanico> ohh I found https://github.com/levovix0/siwin/blob/master/src/siwin/clipboard.nim |
16:21:35 | FromDiscord | <MapleSyrup|TagMeIfReply> oh boy |
16:21:42 | FromDiscord | <MapleSyrup|TagMeIfReply> is there any package left to write for a beginner?? |
16:22:03 | FromDiscord | <Yardanico> just write what you feel like writing :) |
16:22:43 | FromDiscord | <MapleSyrup|TagMeIfReply> fair enough but I'd still like some suggestions |
16:22:52 | FromDiscord | <MapleSyrup|TagMeIfReply> iirc there was a repo with requested libraries somwhere |
16:22:55 | FromDiscord | <MapleSyrup|TagMeIfReply> for nim^ |
16:22:58 | FromDiscord | <Yardanico> https://github.com/nim-lang/needed-libraries/issues |
16:23:12 | FromDiscord | <Yardanico> its a bit outdated though |
16:23:32 | FromDiscord | <MapleSyrup|TagMeIfReply> outdated as in some of those open issues have libraries now? |
16:23:36 | FromDiscord | <MapleSyrup|TagMeIfReply> thhanksfor link btw |
16:23:41 | FromDiscord | <InventorMatt> there are tons of c++ libraries that it would be awesome if there were wrappers in nim for them |
16:24:12 | FromDiscord | <InventorMatt> that you could do |
16:25:00 | FromDiscord | <MapleSyrup|TagMeIfReply> oh you're right! I highly doubt there is a dearth of that |
16:25:05 | FromDiscord | <MapleSyrup|TagMeIfReply> I'll look into writing wrappers, ty |
16:25:21 | FromDiscord | <haxscramper> Wrapping C++ is a black hole for happines |
16:26:04 | FromDiscord | <MapleSyrup|TagMeIfReply> I am dead inside so I'm perfect for this! |
16:26:57 | FromDiscord | <MapleSyrup|TagMeIfReply> https://blog.johnnovak.net/2018/07/07/creating-a-nim-wrapper-for-the-fmod/ I suppose this is as good a look at how to go about doing this? |
16:27:13 | FromDiscord | <Yardanico> it's for C though |
16:27:18 | FromDiscord | <Yardanico> C++ can be much more complicated :P |
16:27:58 | FromDiscord | <MapleSyrup|TagMeIfReply> welp let's just say I've narrowed down my prospects to C libraries |
16:28:02 | FromDiscord | <Yardanico> heh |
16:29:13 | FromDiscord | <mratsim> it's not like C has been used by millions of devs since the 70s |
16:30:45 | FromDiscord | <MapleSyrup|TagMeIfReply> https://nim-lang.org/docs/manual.html#statements-and-expressions-using-statement this is so cool! |
16:30:54 | FromDiscord | <exelotl> wrapping C libraries is generally preferable since that's the default Nim backend |
16:31:10 | FromDiscord | <exelotl> (edit) "wrapping C libraries is generally preferable ... since" added "to C++" |
16:31:42 | FromDiscord | <MapleSyrup|TagMeIfReply> and it's easier, from what I hear |
16:32:06 | FromDiscord | <exelotl> yep for sure x) |
16:33:10 | * | vicfred joined #nim |
16:38:24 | * | a_b_m joined #nim |
16:39:00 | * | a__b__m joined #nim |
16:41:44 | * | abm quit (Ping timeout: 260 seconds) |
16:43:09 | * | a_b_m quit (Ping timeout: 264 seconds) |
16:59:32 | ForumUpdaterBot | New thread by RainbowAsteroids: How to detect a hard link in Nim?, see https://forum.nim-lang.org/t/7573 |
17:02:19 | FromDiscord | <Zachary Carter> I have an enum defined in some C header file and I've defined this as a distinct int in my Nim wrapper instead of using as Nim enum |
17:02:54 | FromDiscord | <Zachary Carter> I'm compiling with the C++ backend and the compiler wants me to cast values from this enum into the enum type using `static_cast` |
17:03:24 | FromDiscord | <Zachary Carter> I tried using an `enum` instead of a `distinct int` but the problem persists |
17:03:27 | FromDiscord | <Zachary Carter> has anyone encountered this before? |
17:06:43 | FromDiscord | <mratsim> I think so |
17:08:50 | FromDiscord | <mratsim> if you have a small repro file (you can use emit:"""/ TYPESECTION / """ to embed the typedef). I can have a look |
17:10:32 | FromDiscord | <mratsim> (edit) "emit:"""/" => "`emit:"""/" | """"" => """"`" |
17:11:47 | FromDiscord | <Zachary Carter> I can try creating a small reproducible example |
17:14:25 | FromDiscord | <Zachary Carter> @mratsim If I just use a nim enum and `importcpp` instead the problem resolves itself |
17:15:03 | FromDiscord | <mratsim> Unfortunately that doesn't spark a magic solution in my head :/ |
17:18:22 | FromGitter | <iffy> Is there a nice way to expose private object attrs in a test module but not in normal use? |
17:18:40 | FromDiscord | <Zachary Carter> I think Nim does something when importcpping enums that it doesn't when using importc |
17:18:52 | FromGitter | <iffy> I can make wrapper procs that only exist in testmode, but looking for a single-line thing if possible |
17:19:46 | FromDiscord | <Yardanico> @iffy iirc this was discussed a lot a while ago |
17:20:04 | * | rockcavera quit (Remote host closed the connection) |
17:20:09 | FromDiscord | <Yardanico> i might be wrong but was the agreed solution to use include? |
17:20:12 | FromDiscord | <Yardanico> maybe mratsim remembers :P |
17:21:16 | giaco | the "newString[OfCap]" puzzles me. What is a string really, a reference type or a value type here? |
17:21:40 | giaco | isn't by convention new* -> ref, init* -> value? |
17:22:43 | FromDiscord | <Yardanico> string contains a pointer to the data |
17:22:47 | FromDiscord | <Yardanico> but has value semantics |
17:22:54 | FromDiscord | <Yardanico> the pointer thing is an implementation detail :P |
17:24:28 | * | rockcavera joined #nim |
17:24:37 | * | a__b__m quit (Quit: Leaving) |
17:24:44 | giaco | should I always consider strings a value type, while doing software design? is "ref string" a thing? |
17:25:17 | FromDiscord | <Yardanico> of course, nim doesn't limit you in that recard |
17:25:19 | FromDiscord | <Yardanico> (edit) "recard" => "regard" |
17:25:27 | FromDiscord | <Yardanico> you can have a "ref ref ref ref string" if you really wanted to |
17:29:11 | FromDiscord | <mratsim> In reply to @Yardanico "maybe mratsim remembers :P": The agreed solution is to complain until import {.private.} or something is delivered |
17:29:51 | FromDiscord | <mratsim> include doesn't detect problems with generics or certain ambiguous identifiers |
17:32:00 | * | superbia joined #nim |
17:37:08 | * | vegai quit (Remote host closed the connection) |
17:43:56 | FromDiscord | <pietroppeter> the accepted solution was this one: https://github.com/nim-lang/RFCs/issues/299 Araq mentioned in the related PR that it will have to wait to first merge stuff for Incremental Compilation: https://github.com/nim-lang/Nim/pull/11865#issuecomment-739474911 |
17:48:17 | FromDiscord | <spoon> sent a code paste, see https://play.nim-lang.org/#ix=2Rrc |
17:48:18 | FromDiscord | <spoon> that work but |
17:48:25 | giaco | Yardanico: thanks |
17:48:28 | FromDiscord | <spoon> this dooesn't |
17:48:30 | FromDiscord | <spoon> sent a code paste, see https://play.nim-lang.org/#ix=2Rrd |
17:48:32 | FromDiscord | <spoon> (edit) "dooesn't" => "doesn't" |
17:48:35 | FromDiscord | <Yardanico> because you can't just use any symbols as operators |
17:48:44 | FromDiscord | <Yardanico> see https://nim-lang.org/docs/manual.html#lexical-analysis-operators |
17:48:52 | FromDiscord | <spoon> alright, thanks |
17:48:57 | * | drdee joined #nim |
17:48:59 | * | drdee quit (Remote host closed the connection) |
17:51:50 | FromDiscord | <Yardanico> does anyone know what :tok: is supposed to mean in nim's rst? |
17:51:58 | FromDiscord | <Yardanico> it's used in manual but seems like it's broken |
17:52:08 | FromDiscord | <Yardanico> https://media.discordapp.net/attachments/371759389889003532/816367280052109362/unknown.png |
17:52:12 | FromDiscord | <Yardanico> https://media.discordapp.net/attachments/371759389889003532/816367299207626842/unknown.png |
17:53:52 | FromDiscord | <Yardanico> actually seems like ":tok:" is _only_ used in the manual |
17:56:32 | * | liblq-dev uploaded an image: image.png (14KiB) < https://matrix.org/_matrix/media/r0/download/gacko.pl/nRcUQZvyxNfDkJODTTYQkmNp/image.png > |
17:56:32 | liblq-dev | @Yardanico |
17:56:48 | FromDiscord | <Yardanico> yeah, so it's a css bug |
17:56:56 | FromDiscord | <Yardanico> nim doc's css bug |
17:57:47 | FromDiscord | <Yardanico> I can't find a version where it worked correctly though, seems to be broken even in 0.18.0 |
17:58:20 | FromDiscord | <Yardanico> even in 0.12.0 |
18:04:44 | FromDiscord | <Yardanico> oh timo already noticed it https://github.com/nim-lang/Nim/issues/16858 |
18:26:06 | FromDiscord | <Solitude> we got him https://github.com/nim-lang/Nim/commit/fb93cee95de2300f863057efdf163e2413177c3d#diff-3de2c381dbe54ad832c39db5e6a64b371cb3c75e3285f2dd3d584fca52f7c659L167 |
18:27:00 | FromDiscord | <Yardanico> officer, this commit right here |
18:27:30 | FromDiscord | <Yardanico> so anyways, time to add nim blog and nim packages to the updater bot |
18:28:22 | * | xet7 quit (Remote host closed the connection) |
18:34:25 | FromDiscord | <haxscramper> > nim packages↵You mean new packages added to nimble? |
18:34:42 | FromDiscord | <haxscramper> Like "new package has been added to nimble ..." |
18:38:43 | * | aenesidemus joined #nim |
18:39:53 | FromDiscord | <Yardanico> yes |
18:39:57 | FromDiscord | <Yardanico> there's https://nimble.directory/packages.xml |
18:40:06 | FromDiscord | <Yardanico> so I don't have to parse GitHub PRs myself |
18:40:10 | * | abm joined #nim |
18:40:44 | FromDiscord | <Yardanico> (I could also do JSON diffing, but packages.xml exists so no need for that) |
18:58:12 | * | xet7 joined #nim |
19:06:32 | FromDiscord | <Yardanico> a question asked by someone else to me - would it be possible for nim streams to be implemented with generics instead of proc pointers? |
19:09:28 | FromGitter | <HJarausch_gitlab> Please help to shed some light on this error ⏎ ``spawn term(k), nimCreateFlowVar' but expected 'seq[float]`` ⏎ in https://play.nim-lang.org/#ix=2RrH |
19:09:30 | * | WilhelmVonWeiner joined #nim |
19:10:41 | FromDiscord | <Yardanico> you can fix the error by doing ^(spawn term(k)) but it will not do what you want |
19:11:15 | FromDiscord | <Yardanico> basically you need to store all flowvars somewhere, and after they complete read them with ^ |
19:11:24 | FromDiscord | <Yardanico> with the way you're doing it now it's gonna be sequential |
19:12:03 | FromDiscord | <Yardanico> ah you're using "parallel" |
19:13:08 | FromDiscord | <dk> https://play.nim-lang.org/#ix=2RrP |
19:13:16 | FromDiscord | <dk> compiles and doesn't crash for me |
19:13:36 | FromDiscord | <Yardanico> yeah I was about to say |
19:13:38 | FromDiscord | <dk> but I know nothing about threading |
19:17:02 | FromGitter | <HJarausch_gitlab> I have just copied the example from the *experimental features* documentation and replaced a single float variable with an object which contains a variable since this comes closer to my application. Are there any more detailed documents on what is accept in a parallel *for* loop? |
19:18:01 | FromGitter | <HJarausch_gitlab> I am going to ask in the Forum to get a broader audience. Thanks! |
19:18:13 | FromDiscord | <Yardanico> have you seen https://github.com/mratsim/weave ? |
19:18:46 | FromGitter | <HJarausch_gitlab> Yes, but I have feared its complexity a bit. |
19:25:51 | ForumUpdaterBot | New thread by HJarausch: Restrictions in a parallel for loop?, see https://forum.nim-lang.org/t/7574 |
19:27:07 | * | Vladar joined #nim |
19:50:23 | * | garFF joined #nim |
20:04:03 | FromDiscord | <mratsim> Weave is really simple though: https://github.com/mratsim/weave/blob/master/benchmarks/matrix_transposition/weave_transposes.nim#L76-L83 |
20:04:27 | * | aenesidemus quit (Quit: Leaving) |
20:09:21 | * | haxscram` joined #nim |
20:09:30 | * | haxscram` left #nim (#nim) |
20:11:17 | FromDiscord | <Yardanico> i wanted to rewrite the current way for persistence in my nimeventer to something "better" https://media.discordapp.net/attachments/371759389889003532/816402294878502962/unknown.png |
20:11:20 | FromDiscord | <Yardanico> this is so stupid but it works |
20:11:55 | FromDiscord | <Yardanico> I need to store around 5-6 keys (last activity timestamps) |
20:11:57 | * | haxscramper quit (Ping timeout: 264 seconds) |
20:12:02 | FromDiscord | <Yardanico> overhead of serializing is too low for that |
20:12:42 | FromDiscord | <Yardanico> and using sqlite seems like an overkill |
20:12:44 | FromDiscord | <haxscramper> I have documentation comments - simple multiline string, no specific formatting at all, and assign it to `.comment` field of `PNode`, and it get |
20:13:02 | FromDiscord | <haxscramper> turned into 30-line abomination with 1-2 words per line |
20:13:29 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2Rse |
20:13:48 | FromDiscord | <haxscramper> When comment contains C formatting `/` and `` this does not happen |
20:14:08 | FromDiscord | <haxscramper> I render `PNode` via `compiler/renderer.$` |
20:14:33 | FromDiscord | <Clyybber> In reply to @Yardanico "this is so stupid": it's not stupid if it's simple and it works :p |
20:14:41 | * | PMunch quit (Quit: leaving) |
20:15:58 | FromDiscord | <haxscramper> Is it realted to anything, or just a weird bug? Or I'm assigning to wrong field (right now I'm working with `.comment` for `nnkTypeDef` on enum |
20:17:51 | FromDiscord | <Clyybber> not sure, whats your original code? |
20:18:19 | FromDiscord | <Clyybber> sent a code paste, see https://play.nim-lang.org/#ix=2Rsh |
20:18:50 | FromDiscord | <haxscramper> No original code, I generate enum declaration and edit `.comment` after it is generated |
20:19:22 | FromDiscord | <Clyybber> oh, and the renderer turns it into this? |
20:19:27 | FromDiscord | <haxscramper> yes |
20:19:38 | FromDiscord | <Clyybber> hmm, maybe it's related to the line limit? |
20:19:40 | * | abm quit (Read error: Connection reset by peer) |
20:19:41 | FromDiscord | <haxscramper> but only with certain comments |
20:19:42 | FromDiscord | <Clyybber> (edit) "hmm, maybe it's related to the line ... limit?" added "length" |
20:20:22 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2Rsj |
20:20:31 | FromDiscord | <Clyybber> huh, that's funny |
20:20:35 | FromDiscord | <haxscramper> Not the best-looking overall, but at least it occupies single line |
20:21:14 | FromDiscord | <Clyybber> yeah, most definitely a render bug |
20:21:30 | FromDiscord | <Clyybber> but can you check without the importc stuff? |
20:21:37 | * | abm joined #nim |
20:21:51 | FromDiscord | <Clyybber> (edit) removed "but" |
20:22:48 | FromGitter | <iffy> I'm very confused by this type mismatch error https://gist.github.com/iffy/529b24c32b158b88b8c77a48e223305d and when I try to reduce the code to a simpler example, the error goes away. What can I do to debug why this is happening? |
20:27:13 | FromGitter | <iffy> It's using ndb and this has a type mismatch, too: `let row = db.getRow(sql("SELECT 1, ?, ?"), dbValue("a"))` Am I going crazy? |
20:30:28 | FromDiscord | <haxscramper> In reply to @Clyybber "can you check without": Minized test does not break anything, but it seems to be related to trailing newline in `.comment`. After I added `strip()` everything returned to normal |
20:31:04 | FromDiscord | <Clyybber> iffy: Does manually wrappign the dbValue into an array to pass to varargs work? |
20:31:10 | FromDiscord | <Clyybber> In reply to @haxscramper "Minized test does not": huh |
20:31:55 | FromDiscord | <Clyybber> the relevant logic is in renderer.nim:305 if you want to take a stab at it |
20:33:43 | FromGitter | <iffy> Clyybber: yep, it does (weird... I thought I had tried that) |
20:34:19 | FromDiscord | <Clyybber> iffy; cool, definitely looks like a bug tho |
20:35:08 | * | garFF quit (Quit: Leaving) |
20:35:15 | * | krux02 quit (Quit: Leaving) |
20:51:28 | FromDiscord | <Solitude> is there an issue about `T` in `typedesc[T]` being treated as value and not type in templates? |
20:54:19 | * | narimiran quit (Ping timeout: 260 seconds) |
21:04:07 | * | lritter joined #nim |
21:07:24 | FromDiscord | <carpal> I'm sorry, any lib to handle keyboard input in nim? |
21:08:15 | FromDiscord | <Solitude> In reply to @carpal "I'm sorry, any lib": in what context? |
21:08:21 | FromDiscord | <carpal> gui |
21:08:25 | FromDiscord | <carpal> opengl |
21:08:35 | FromDiscord | <ElegantBeef> Glfw and sdl2 have keyboard event handlers |
21:08:44 | FromDiscord | <carpal> I mean check if a key on the keyboard is pressed |
21:08:48 | FromDiscord | <ElegantBeef> Like i said |
21:09:04 | FromDiscord | <carpal> I searched on google but found not too much stuff |
21:09:04 | FromDiscord | <Solitude> sdl2 is tried and tested and works everywhere |
21:10:19 | FromDiscord | <carpal> ok thanks, let me try |
21:22:01 | * | muffindrake quit (Quit: muffindrake) |
21:29:54 | FromDiscord | <carpal> wrote this, but does not work https://media.discordapp.net/attachments/371759389889003532/816422084162879498/unknown.png |
21:30:03 | FromDiscord | <carpal> what I mistook |
21:32:04 | FromDiscord | <konsumlamm> wdym with "does not work"? |
21:34:23 | * | muffindrake joined #nim |
21:34:58 | * | superbia quit (Quit: WeeChat 3.0) |
21:36:42 | FromDiscord | <carpal> I don't mean that is it broken or something like that obviously |
21:36:58 | FromDiscord | <carpal> I mean that as I'm doig It's not working |
21:37:21 | FromDiscord | <carpal> also replacing if with while |
21:56:23 | * | jess is now known as J |
21:57:25 | * | quantimnot joined #nim |
22:08:03 | * | lkjasdf joined #nim |
22:29:43 | * | ForumUpdaterBot quit (Remote host closed the connection) |
22:30:36 | FromDiscord | <Yardanico> so I updated my updater bot and it'll double post latest updates it posted before, or something worse could happen (but I will shut it down if that happens) |
22:33:57 | FromDiscord | <Yardanico> here we go |
22:34:10 | * | ForumUpdaterBot joined #nim |
22:34:15 | ForumUpdaterBot | New question by Michael Hecht: Nim-Lang compiler error with leading @ character, see https://stackoverflow.com/questions/66426124/nim-lang-compiler-error-with-leading-character |
22:34:15 | ForumUpdaterBot | New post on r/nim by Karyo_Ten: Multithreading flavors: Choosing the right scheduler for the right job, see https://reddit.com/r/nim/comments/lug1jk/multithreading_flavors_choosing_the_right/ |
22:34:44 | * | ForumUpdaterBot quit (Remote host closed the connection) |
22:34:48 | FromDiscord | <Yardanico> ok mostly fine |
22:40:35 | * | waleee-cl joined #nim |
22:41:54 | FromDiscord | <Yardanico> Someone made a program to geolocate MAC addresses - https://drygdryg.github.io/geomac-webpage/index.html |
22:42:00 | FromDiscord | <Yardanico> it's in nim but proprietary :P |
22:43:05 | FromDiscord | <dom96> proprietary? Looking at it it seems like a simple HTTP client front end lol |
22:43:47 | FromDiscord | <Yardanico> "The program implements an original solution that has not been presented anywhere in the public domain. As the author of this program, I respect the owners of the services that the program uses, and I do not want to publish information that they do not publish. I may publish the source code in the future." |
22:44:23 | FromDiscord | <Yardanico> but yeah, I actually didn't know that they were developing this tool and was surprised to see myself in acknowledgements :D |
22:50:22 | FromDiscord | <Yardanico> lets try running nimeventer again, hope it will work (more) correctly this time |
22:50:55 | * | ForumUpdaterBot joined #nim |
22:52:04 | FromDiscord | <Yardanico> yep seems to work better |
22:52:14 | * | ForumUpdaterBot quit (Remote host closed the connection) |
22:53:18 | * | ForumUpdaterBot joined #nim |
22:55:27 | FromDiscord | <Yardanico> now just need for someone to merge a PR to nimble packages repo to check if it works ;P |
23:05:28 | * | tane quit (Quit: Leaving) |
23:14:12 | * | filpAM joined #nim |
23:14:19 | * | filpAM left #nim (#nim) |
23:19:00 | * | lkjasdf quit (Quit: WeeChat 3.0.1) |
23:34:10 | * | xet7 quit (Remote host closed the connection) |
23:35:21 | * | cornfeedhobo quit (Quit: ZNC - https://znc.in) |
23:37:00 | * | J is now known as jess |
23:37:03 | * | Vladar quit (Remote host closed the connection) |
23:38:00 | giaco | I'm training with some excercises I've found online. I've completed one, but I'm failing to turn a chain of "if bla: result =" into a more idiomatic if expression, I keep getting errors even I follow the example on the manual. Would you help me fixing the "hey" function? https://play.nim-lang.org/#ix=2Rty |
23:39:15 | FromDiscord | <Yardanico> for example https://play.nim-lang.org/#ix=2RtA |
23:39:25 | FromDiscord | <Yardanico> you can actually omit "result" here |
23:39:42 | FromDiscord | <Yardanico> https://play.nim-lang.org/#ix=2RtC |
23:40:10 | FromDiscord | <Yardanico> If "return" or "result" haven't been used in a proc, last expression is considered to be the return value |
23:40:16 | FromDiscord | <ElegantBeef> oh i helped someone with this exact one recently |
23:40:20 | FromDiscord | <Yardanico> its from exercism |
23:41:33 | giaco | Yeah, playing with exercism. I like the unittest based approach |
23:42:26 | giaco | thanks Yardanico! I think I got fooled by vscode error highligthing, as I thing I've tried both approaches before starting randomly playing with the syntax |
23:42:37 | FromDiscord | <ElegantBeef> https://play.nim-lang.org/#ix=2QKp this was based off their solution so not overly clean 😄 |
23:42:48 | * | lkjasdf joined #nim |
23:43:28 | giaco | mine looks better! not sure if faster, I am doing some string copy |
23:43:46 | FromDiscord | <ElegantBeef> You're doing a lot of iteration 😄 |
23:44:39 | giaco | yeah :( |
23:45:10 | FromDiscord | <ElegantBeef> If you're after speed it's generally good to avoid the easy stdlib choices 😄 |
23:46:22 | giaco | ElegantBeef, sure, but I think is also good to learn what I can find within stdlib before adventuring reinventing the wheel |
23:46:34 | FromDiscord | <ElegantBeef> Well yea |
23:46:55 | FromDiscord | <ElegantBeef> I was just saying since you seemed somewhat concerned about speed |
23:47:53 | FromDiscord | <ElegantBeef> Like in your case `isSilence` isnt needed |
23:48:17 | FromDiscord | <ElegantBeef> Are you using devel? |
23:49:16 | giaco | no, 1.4.2, but I've not been following upgrades for a while. Is it worth staying on devel while learning? |
23:49:48 | FromDiscord | <ElegantBeef> Well i've added `setutils` which would let you do `isAllCaps` easier |
23:51:39 | * | blackbeard420 quit (Excess Flood) |
23:52:49 | giaco | you're right, I've skipped one loop by stripping first and then just checking for len and [^?] |
23:52:51 | * | blackbeard420 joined #nim |
23:54:36 | FromDiscord | <ElegantBeef> See setutils is magical! 😛 https://media.discordapp.net/attachments/371759389889003532/816458497944322048/unknown.png |
23:54:43 | giaco | where can I follow what are the upcoming modules/upgrades in next release? As I find myself zapping through std docs quite often, I propably should integrate with devel one to spot next choices |
23:54:53 | * | cornfeedhobo joined #nim |
23:57:37 | FromDiscord | <ElegantBeef> https://github.com/nim-lang/Nim/blob/devel/changelog.md |
23:58:03 | FromDiscord | <Yardanico> https://www.mail-archive.com/[email protected]/ is this run officially? |
23:58:08 | FromDiscord | <Yardanico> i mean the forum mailing list |
23:58:12 | FromDiscord | <Yardanico> ah yeah the domain :D |