<< 02-03-2021 >>

00:00:07FromDiscord<Yardanico> but proc is simpler (less powerful feature) than a template
00:01:50giacono real aliasing?
00:02:20giacoI have a proc and I want to rename it to something else, not really create a wrap like with proc or template
00:02:46FromDiscord<ElegantBeef> Well timothee has a PR which would allow aliasing procedures, but nothing is in the language afaik
00:03:08FromDiscord<ElegantBeef> a template would be a fine alias
00:03:16FromDiscord<Yardanico> @giaco are you importing it from some other module?
00:03:33giacoYardanico, yes
00:04:23FromDiscord<ElegantBeef> Also yard when i seen this early today i had a chuckle https://media.discordapp.net/attachments/371759389889003532/816098574566817852/unknown.png
00:04:33FromDiscord<Yardanico> 🥴
00:04:39FromDiscord<Yardanico> it started at ~6 btw
00:04:48FromDiscord<Yardanico> I just don't want to make those PRs too big
00:04:48FromDiscord<ElegantBeef> I had seen
00:04:57FromDiscord<Yardanico> like the 5th part is just times.nim
00:05:00FromDiscord<Yardanico> which has a ton of backticks
00:07:38FromDiscord<dom96> It's great work btw 🙂
00:07:46FromDiscord<Yardanico> two vscode regexes :P
00:07:48FromDiscord<Yardanico> (mostly)
00:07:52FromDiscord<dom96> fixing these style things should generally be done like this
00:07:58FromDiscord<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:17giacohow to to use this? https://nim-lang.org/docs/with.html if I do "import with", nim says "cannot open file: with"
00:44:59FromDiscord<ElegantBeef> `import std/with`
00:45:23FromDiscord<ElegantBeef> soon the docgen will show the import path
00:48:34giacothanks!
00:49:17giacodamn, it doesn't work with generics. I tried to use it to run "del" multiple times on a CountTable
00:56:44FromDiscord<バロザード> is there an api for pixecs somewhere?
00:56:46FromDiscord<バロザード> im a bit lost lol
00:59:21giaconevermind, 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:53FromDiscord<MapleSyrup|TagMeIfReply> is there any sort of repo where I can add a library I've written in nim?
01:12:32FromDiscord<InventorMatt> That would be on nimble
01:12:45FromDiscord<MapleSyrup|TagMeIfReply> oh ok I'll google for that
01:12:52FromDiscord<MapleSyrup|TagMeIfReply> is that the package manager
01:13:06FromDiscord<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:19ForumUpdaterBotNew thread by Shirleyquirk: Comments and criticism,please: Nimplementation of Church Numerals, see https://forum.nim-lang.org/t/7570
01:33:47FromDiscord<Rika> oh my lord nimplementation
01:37:58giacoI 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:38FromDiscord<Yardanico> what do you want to do?
01:38:46FromDiscord<Yardanico> convert string into a sequence of enum values?
01:40:15giacoYardanico: 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:04giacoI though enum based mapping would be faster than tables one, right?
01:41:22FromDiscord<Yardanico> did you see https://nim-lang.org/docs/strutils.html#multiReplace%2Cstring%2Cvarargs%5B%5D ?
01:41:46FromDiscord<shirleyquirk> In reply to @Rika "oh my lord nimplementation": sorry
01:41:47giacooh! no, didnt know that
01:42:27giacothanks! But do don't waste this chance to learn something new, how could I complete my enum experiment?
01:42:42FromDiscord<Yardanico> well there's parseEnum in strutils defined for strings
01:44:28giacoYardanico: parseEnum goes to the other way (value->key), I just need key->value replacement in mapIt where "it" is the key
01:47:07FromDiscord<MapleSyrup|TagMeIfReply> how do I like get my pkg on nimble
01:47:26FromDiscord<Yardanico> `nimble publish`
01:47:56FromDiscord<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:35FromDiscord<Yardanico> it can be much easier if you make "ACGU" the enum members instead
01:50:16giacoYardanico: but parseEnum would be more expensive than a table based solution, I think
01:50:20giacobut not sure
01:50:29FromDiscord<Yardanico> it generates a case statement
01:52:10FromDiscord<Yardanico> for chars like that you can just have an array, but it's not a very good solution either
01:53:35giacoif parseenum is a compile-time thing, it must be fast! I'm quite curious now, let's try it
01:53:50FromDiscord<Yardanico> it generates a case statement at compile time
01:53:53FromDiscord<Yardanico> you can check which code it makes
01:56:09FromDiscord<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:22FromDiscord<phpOstrich> Whats some good free resources for learning how to make a compiler?
03:50:24FromDiscord<flywind> https://gist.github.com/haxscramper/3562fa8fee4726d7a30a013a37977df6
03:50:31FromDiscord<flywind> ^
03:56:54FromDiscord<phpOstrich> thank you
03:57:18FromDiscord<flywind> no problem
04:04:27*gpanders quit (Ping timeout: 268 seconds)
04:16:17*gpanders joined #nim
04:23:43giacoI'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:42FromDiscord<ElegantBeef> method 3 has a ton of string allocations
04:28:47giacoElegantBeef, I tried to solve it without, but I failed to turn the advantage of enums into profit
04:29:06FromDiscord<ElegantBeef> You're also using tables
04:30:11giacotable hash access should be ~ O(n*logn) correct?
04:30:24FromDiscord<ElegantBeef> Well it's slower regardless than a direct array index
04:30:30FromDiscord<ElegantBeef> I'm going to write an impl
04:30:31giacosure
04:31:01FromDiscord<Rika> Can’t you use in place writing or will that not work
04:32:38giacoElegantBeef, I actually didn't write the trivial for loop with switch case inside that builds a string
04:36:59FromDiscord<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:40FromDiscord<ElegantBeef> giaco we're vastly faster now 😛 https://play.nim-lang.org/#ix=2Rnp
04:38:36FromDiscord<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:22FromDiscord<ElegantBeef> https://nim-lang.github.io/fusion/src/fusion/matching.html think this is the most elaborate pattern matcher in Nim
04:41:15giacoElegantBeef, 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:37FromDiscord<ElegantBeef> They're be realtively similar, since it just has to increment the length every add
04:41:55FromDiscord<ElegantBeef> (edit) "They're" => "They'll"
04:42:40FromDiscord<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:11FromDiscord<ElegantBeef> second is pretty fast cause it's mostly inline replacing
04:46:32FromDiscord<ElegantBeef> Also for future benchmarking might be worth while to check benchy out, or atleast use monotimes 😛
04:46:34giacoElengantBeef, 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:06FromDiscord<ElegantBeef> Yea like i though 4/5 arent overly different
04:48:10giacoI wonder if your "result[i] = case ..." is faster than "case c: ... result[i] = ... "
04:48:23giacolet me test that too
04:48:40FromDiscord<ElegantBeef> Isnt 5 exactly that?
04:49:00FromDiscord<ElegantBeef> It's almost certainly not going to change much since 4/5 are in spitting distance
04:49:31FromDiscord<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:11giacoYeah no difference between 5 and 6: https://play.nim-lang.org/#ix=2Rnr
04:51:19giacolet me test with release + arc
04:52:39giacowhat a change!!
04:52:41giaco:D
04:52:47FromDiscord<ElegantBeef> Results?
04:53:41giacoElegantBeef: http://ix.io/2Rnt
04:54:05FromDiscord<ElegantBeef> Yea the nim optimize pipeline is surpisingly effective
04:54:14giacoheap operations are waaaay faster
04:54:57giacoI wonder if where the magic lives the most: is it relese, or is it arc? let's see
04:54:59FromDiscord<ElegantBeef> Yea most of that is just `release` and it telling it to turn the optimizer on
04:55:23FromDiscord<ElegantBeef> Arc helps, but here it only knocks 30ms off the 3rd method
04:57:28giacorelease but not arc: http://ix.io/2Rnw, arc but not release: http://ix.io/2Rnx
04:58:00FromDiscord<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:39giacoI'm quite confused why -d:release and --gc:arc seems to result in equal optimization
04:59:42PrestigeSo 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:39Prestigeokay nevermind, why am I getting one event for no reason
05:01:58giacoI'm rerunning all the versions with benchy, thanks!
05:12:50giacoElegantBeef: 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:51FromDiscord<ElegantBeef> Well arc is mostly lower latency, but can give a ton of speed up depending on the library
05:14:49giacobut --gc:arc with -d:release has the best speed in every case
05:15:51giaco-d:release without --gc:arc lives somewhere in the middle, but near the -d:release only scenario
05:16:49giacoconsidering what arc is doing, and what are the benefits of it, I'd say that a piece of art considering these numbers
05:16:53FromDiscord<ElegantBeef> Yea you can use the other GC's but we're mostly just fighting allocating/deallocating
05:17:19FromDiscord<ElegantBeef> This isnt a long lived program so not overly getting many benefits of arc vs gc here
05:18:03giacoabsolutely, 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:00FromDiscord<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:24FromDiscord<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:48FromDiscord<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:15FromDiscord<haxscramper> Should work for any AST-like structures that have `kind` field
06:32:30FromDiscord<haxscramper> In theory should even work with pattern-matching runtime-polymorphic objects hierarchies (derived objects)
06:34:36FromDiscord<ElegantBeef> Hax help me avoid the include in my concept derived interfaces 😛
06:35:22FromDiscord<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:23ForumUpdaterBotNew 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:24PMunchShouldn'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:05haxscramperIf original C function accepts `(*)` then yes, `{.cdecl.}` proc maps to C function pointer
09:33:19haxscramperAnd 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:21FromDiscord<gogolxdong> sent a code paste, see https://play.nim-lang.org/#ix=2RoS
10:16:23FromDiscord<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:55FromDiscord<IndianGoldSmith> Hi all, is there any visual studio extension for Nim ?
13:18:10PMunchVisual Studio, or VSCode?
13:18:37FromDiscord<IndianGoldSmith> @PMunch , Visual Studio.
13:18:49PMunchNot sure really
13:18:58PMunchI mean you can probably use LSP
13:19:11PMunchBut you'll need something else for highlighting
13:19:12FromDiscord<IndianGoldSmith> LSP ?
13:19:18PMunchLanguage Server Protocol
13:19:23FromDiscord<IndianGoldSmith> Oh isee
13:36:07FromDiscord<gogolxdong> Is there any link of Nim Ethereum client?
13:38:45FromDiscord<x19> @IndianGoldSmith are u using Nim inside VS?
13:39:44FromDiscord<IndianGoldSmith> @x19 , not yet, but i want to use it. Only if there is an extension to support syntax highlighting and building.
13:39:50FromDiscord<mratsim> In reply to @gogolxdong "Is there any link": Eth1? https://github.com/status-im/nimbus-eth1
13:40:19FromDiscord<mratsim> but maybe you only need web3? https://github.com/status-im/nim-web3
13:41:21FromDiscord<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:33FromGitter<gogolxdong> what's the difference between https://github.com/status-im/nimbus-eth2 and eth1
13:53:40FromGitter<gogolxdong> I'm seeking a solution of crossing blockchain protocol like Polkadot.
13:54:07FromGitter<gogolxdong> discord is unstable here.
13:56:48FromGitter<gogolxdong> cross blockchain protocol and blockchain interoperability
13:59:08*superbia joined #nim
14:00:02FromDiscord<mratsim> nimbus-eth1 is for an Ethereum 1 client, nimbus-eth2 for an Ethereum 2 client
14:00:33FromDiscord<mratsim> There are no Nim solutions to cross blockchain protocols (Polkadot, Cosmos, Avalanche, ....)
14:19:28FromGitter<gogolxdong> Is it going to have one?
14:20:03FromDiscord<mratsim> Not from us.
14:21:16FromDiscord<mratsim> We're committed to Ethereum. But you can very well use our libraries to build clients for other blockchain
14:21:31FromDiscord<mratsim> though likely the easiest is to run one of their official client and use their RPC API
14:21:38FromDiscord<mratsim> (edit) "client" => "clients"
14:22:59FromGitter<gogolxdong> that's the spirit
14:26:31FromGitter<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:02FromDiscord<Cark> Is there a place with the orc/arc dictionary of functions and operators ?
15:07:52FromDiscord<Yardanico> https://nim-lang.org/docs/destructors.html
15:08:05FromDiscord<Cark> ah thanks let me check that
15:08:27FromDiscord<Cark> yes that's it, thanks
15:08:52FromDiscord<Yardanico> and if you want for devel - https://nim-lang.github.io/Nim/destructors
15:09:24FromDiscord<mratsim> The most important functions are axe and bash.
15:09:46FromDiscord<Cark> :)
15:13:51FromGitter<gogolxdong> Anyone familiar with Synchronization Graph?
15:22:59FromDiscord<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:22FromDiscord<MapleSyrup|TagMeIfReply> anyone know why this is wrong? `proc getstuff(obj: var Class): array = return somearray↵`
15:23:24FromGitter<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:29FromDiscord<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:37FromDiscord<Yardanico> There's a way to do it inline
15:25:49FromDiscord<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:19FromDiscord<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:37FromDiscord<Yardanico> https://play.nim-lang.org/#ix=2Rqt
15:26:42FromGitter<gogolxdong> Turing Award winner as it's chief scientist.
15:26:48FromDiscord<Yardanico> @alex.boisvert
15:27:17FromDiscord<konsumlamm> lol that works? TIL
15:27:25FromDiscord<alex.boisvert> @Yardanico thanks! that's it
15:28:37FromDiscord<alex.boisvert> i get it now, it triggers a conversion from Apple (object) to ref Apple
15:29:11FromDiscord<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:29FromDiscord<MapleSyrup|TagMeIfReply> type mismatch: got <array[0..24, string]> but expected 'array[Error Type, string]'
15:29:44FromDiscord<konsumlamm> you didn't specify what `N` is
15:29:52FromDiscord<MapleSyrup|TagMeIfReply> can it not be anything?
15:30:02FromDiscord<MapleSyrup|TagMeIfReply> or how do I define that
15:30:09FromDiscord<Solitude> In reply to @MapleSyrup|TagMeIfReply "<@!312654963694108674> thanks am I": array size has to be known at compile time
15:30:14FromDiscord<konsumlamm> you can make it generic, but then you need to add `[N: static int]`
15:30:20FromDiscord<konsumlamm> apparently you want it to be 25 here though
15:30:25FromDiscord<konsumlamm> (or 0..24)
15:30:38FromDiscord<konsumlamm> assuming the size of the array you return is always the same
15:30:53FromDiscord<konsumlamm> otherwise, use a `seq[T]`
15:30:57*kenran quit (Quit: leaving)
15:30:59FromDiscord<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:08FromDiscord<alex.boisvert> ... or used an `UncheckedArray`↵http://nim-lang.github.io/Nim/manual.html#types-unchecked-arrays
15:31:27FromDiscord<MapleSyrup|TagMeIfReply> oh! interesting
15:31:47FromDiscord<Solitude> In reply to @MapleSyrup|TagMeIfReply "I do know the": you can if myarray is visible there
15:32:07FromDiscord<konsumlamm> eh, i'm no friend of recommending unsafe stuff to beginners
15:32:35FromDiscord<konsumlamm> though ehre you can use normal `array` anyway
15:33:02FromDiscord<MapleSyrup|TagMeIfReply> gotcha, that worked
15:33:24FromDiscord<Yardanico> @MapleSyrup|TagMeIfReply use a sequence if length is unknown at compile time
15:33:42FromDiscord<MapleSyrup|TagMeIfReply> is there any way to declare a const variable in an object typedef?
15:33:42FromDiscord<Yardanico> They're not as bad as some think :P
15:33:52FromDiscord<MapleSyrup|TagMeIfReply> ohh ok, yeah I'lll keep that in mind
15:34:03FromDiscord<konsumlamm> In reply to @MapleSyrup|TagMeIfReply "is there any way": you mean like an associated constant?
15:34:18FromDiscord<MapleSyrup|TagMeIfReply> I have no idea what that is but it sounds like what I need
15:34:30FromDiscord<MapleSyrup|TagMeIfReply> I can paste code to show
15:34:52FromDiscord<alex.boisvert> if your object itself is a `const`, then whatever you put in it would also be `const`
15:35:18FromDiscord<MapleSyrup|TagMeIfReply> http://vpaste.net/IMiWM?bg=dark&nu
15:35:33FromDiscord<MapleSyrup|TagMeIfReply> hmm no it is not const, I'm looking to make one of the variables inside a const
15:35:52FromDiscord<haxscramper> There are not immutable fields, immutability in nim is a property of variable
15:35:58FromDiscord<haxscramper> Like `let` or `const`
15:36:31FromDiscord<MapleSyrup|TagMeIfReply> ohh bummer
15:36:33FromDiscord<haxscramper> `const varname = YourObject()` will create fully immutable variable
15:36:39FromDiscord<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:42FromDiscord<MapleSyrup|TagMeIfReply> yeah, but that's a tad much
15:37:04FromDiscord<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:54FromDiscord<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:58FromDiscord<Yardanico> Nim doesn't really have a notion of "classes" as in traditional OOP languages
15:38:17FromDiscord<haxscramper> In reply to @haxscramper "You can also declare": Basically make it private, declare getter but not setter
15:38:19FromDiscord<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:22FromDiscord<alex.boisvert> In reply to @Yardanico "by the way <@660984379023163402>": What's the difference here with straight up `Apple(f: 5)` ?
15:38:36FromDiscord<MapleSyrup|TagMeIfReply> +1 im also curious
15:38:43FromDiscord<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:45FromDiscord<Yardanico> @alex.boisvert Apple is ref object, but we are making "object"
15:39:09FromDiscord<alex.boisvert> oh i see, i didn't catch that you changed it to a ref. gotcha.
15:39:31FromDiscord<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:40FromDiscord<MapleSyrup|TagMeIfReply> im still unclear on the whole when to use `ref` vs `object` business
15:40:07FromDiscord<Solitude> In reply to @MapleSyrup|TagMeIfReply "im still unclear on": if its unclear - object
15:40:40FromDiscord<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:59FromDiscord<MapleSyrup|TagMeIfReply> ok i'll take that as a ruule of thumb
15:41:02FromDiscord<MapleSyrup|TagMeIfReply> 👍
15:41:34FromDiscord<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:47FromDiscord<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:50FromDiscord<haxscramper> (edit) "that." => "that?"
15:42:27FromDiscord<Yardanico> honestly I don't recall any discussions about this
15:42:46FromDiscord<MapleSyrup|TagMeIfReply> there was a reddit post by dom
15:42:50FromDiscord<MapleSyrup|TagMeIfReply> comment rather
15:42:52FromDiscord<exelotl> Araq talks about it in this post: https://nim-lang.org/araq/writetracking_2.html
15:42:52FromDiscord<Yardanico> The best bet is to ask 4raq :D
15:43:07FromDiscord<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:14FromDiscord<Yardanico> @alex.boisvert hmm, I think it'll allocate on the heap but dereference straight away, let me check
15:45:03FromDiscord<MapleSyrup|TagMeIfReply> is it possible to sort imports using nimpretty?
15:45:08FromDiscord<MapleSyrup|TagMeIfReply> or any other tool for that
15:46:02FromDiscord<haxscramper> no. nimpretty works for basic syntax formatting only
15:46:45FromDiscord<Clyybber> @MapleSyrup|TagMeIfReply https://github.com/treeform/morepretty
15:53:39FromDiscord<Clyybber> In reply to @Yardanico "<@660984379023163402> hmm, I think": `var a = old Apple` ;p
15:53:50FromDiscord<Yardanico> Bad apple
15:53:57FromDiscord<Yardanico> :nimRawr:
15:54:22FromDiscord<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:40FromDiscord<Yardanico> yeah, that's expected
15:56:19FromDiscord<mratsim> use `(typeof Apple()[])(f: 5)`
15:56:44FromDiscord<mratsim> Or change the type definition so that you split the base object from the ref type
15:57:20FromDiscord<Yardanico> that's the same as I shown :P
15:57:30FromDiscord<Yardanico> Although you didn't use parenthesis for typeof
15:57:53FromDiscord<MapleSyrup|TagMeIfReply> I can't find `morepretty` on nimble...it does have a .nimble file tho
15:58:11FromDiscord<haxscramper> you can install using github URL
15:58:24FromDiscord<haxscramper> `nimble install "https://github.com/treeform/morepretty"` I think
15:58:29FromDiscord<MapleSyrup|TagMeIfReply> oh! thanks
15:58:58FromDiscord<Clyybber> I think you can do `(Apple[])(f: 5)` too
15:59:09FromDiscord<Yardanico> illformed AST :(
15:59:12FromDiscord<Yardanico> I already tried
15:59:17FromDiscord<Clyybber> oh :D
16:00:09FromDiscord<Yardanico> ah wait actually in this case it's not illformed ast
16:00:30FromDiscord<Yardanico> It tries to call [] on a typedesc
16:01:25FromDiscord<Clyybber> yep
16:01:40FromDiscord<MapleSyrup|TagMeIfReply> who is treeform and why do they have so many packages for nim
16:01:46saemMore parenthesis?
16:01:50FromDiscord<Yardanico> they are a human (maybe)
16:01:51*rauss quit (Quit: WeeChat 3.0)
16:01:57FromDiscord<MapleSyrup|TagMeIfReply> but why
16:02:00FromDiscord<Yardanico> why not?
16:02:01saemI'm treeform
16:02:06saemI'm even
16:02:06FromDiscord<MapleSyrup|TagMeIfReply> lies
16:02:08FromDiscord<Yardanico> everyone is treeform
16:02:09saemIn
16:02:15saemCrap
16:02:24FromDiscord<MapleSyrup|TagMeIfReply> you're in crap?
16:04:30FromDiscord<hotdog> Treeform does have a crazy amount of packages. Very impressive
16:06:48FromDiscord<mratsim> Trees colonize Earth
16:11:49FromDiscord<Yardanico> treeform is a tree confirmed?
16:13:37FromDiscord<MapleSyrup|TagMeIfReply> treeluminati confirmed!11!!1
16:18:23FromDiscord<MapleSyrup|TagMeIfReply> would anyone be interested in a nim package for reading/pasting to clipboard on windows
16:19:24FromDiscord<Yardanico> wasn't there something like that already? hm
16:19:38FromDiscord<mratsim> would anyone be interested in ~~a nim package for reading/pasting to clipboard on~~ windows
16:19:49FromDiscord<Yardanico> https://github.com/Guevara-chan/Cliptomania found this
16:20:21FromDiscord<Yardanico> but yeah, a generic cross-platform clipboard might be useful
16:20:52FromDiscord<Yardanico> ohh I found https://github.com/levovix0/siwin/blob/master/src/siwin/clipboard.nim
16:21:35FromDiscord<MapleSyrup|TagMeIfReply> oh boy
16:21:42FromDiscord<MapleSyrup|TagMeIfReply> is there any package left to write for a beginner??
16:22:03FromDiscord<Yardanico> just write what you feel like writing :)
16:22:43FromDiscord<MapleSyrup|TagMeIfReply> fair enough but I'd still like some suggestions
16:22:52FromDiscord<MapleSyrup|TagMeIfReply> iirc there was a repo with requested libraries somwhere
16:22:55FromDiscord<MapleSyrup|TagMeIfReply> for nim^
16:22:58FromDiscord<Yardanico> https://github.com/nim-lang/needed-libraries/issues
16:23:12FromDiscord<Yardanico> its a bit outdated though
16:23:32FromDiscord<MapleSyrup|TagMeIfReply> outdated as in some of those open issues have libraries now?
16:23:36FromDiscord<MapleSyrup|TagMeIfReply> thhanksfor link btw
16:23:41FromDiscord<InventorMatt> there are tons of c++ libraries that it would be awesome if there were wrappers in nim for them
16:24:12FromDiscord<InventorMatt> that you could do
16:25:00FromDiscord<MapleSyrup|TagMeIfReply> oh you're right! I highly doubt there is a dearth of that
16:25:05FromDiscord<MapleSyrup|TagMeIfReply> I'll look into writing wrappers, ty
16:25:21FromDiscord<haxscramper> Wrapping C++ is a black hole for happines
16:26:04FromDiscord<MapleSyrup|TagMeIfReply> I am dead inside so I'm perfect for this!
16:26:57FromDiscord<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:13FromDiscord<Yardanico> it's for C though
16:27:18FromDiscord<Yardanico> C++ can be much more complicated :P
16:27:58FromDiscord<MapleSyrup|TagMeIfReply> welp let's just say I've narrowed down my prospects to C libraries
16:28:02FromDiscord<Yardanico> heh
16:29:13FromDiscord<mratsim> it's not like C has been used by millions of devs since the 70s
16:30:45FromDiscord<MapleSyrup|TagMeIfReply> https://nim-lang.org/docs/manual.html#statements-and-expressions-using-statement this is so cool!
16:30:54FromDiscord<exelotl> wrapping C libraries is generally preferable since that's the default Nim backend
16:31:10FromDiscord<exelotl> (edit) "wrapping C libraries is generally preferable ... since" added "to C++"
16:31:42FromDiscord<MapleSyrup|TagMeIfReply> and it's easier, from what I hear
16:32:06FromDiscord<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:32ForumUpdaterBotNew thread by RainbowAsteroids: How to detect a hard link in Nim?, see https://forum.nim-lang.org/t/7573
17:02:19FromDiscord<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:54FromDiscord<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:24FromDiscord<Zachary Carter> I tried using an `enum` instead of a `distinct int` but the problem persists
17:03:27FromDiscord<Zachary Carter> has anyone encountered this before?
17:06:43FromDiscord<mratsim> I think so
17:08:50FromDiscord<mratsim> if you have a small repro file (you can use emit:"""/ TYPESECTION / """ to embed the typedef). I can have a look
17:10:32FromDiscord<mratsim> (edit) "emit:"""/" => "`emit:"""/" | """"" => """"`"
17:11:47FromDiscord<Zachary Carter> I can try creating a small reproducible example
17:14:25FromDiscord<Zachary Carter> @mratsim If I just use a nim enum and `importcpp` instead the problem resolves itself
17:15:03FromDiscord<mratsim> Unfortunately that doesn't spark a magic solution in my head :/
17:18:22FromGitter<iffy> Is there a nice way to expose private object attrs in a test module but not in normal use?
17:18:40FromDiscord<Zachary Carter> I think Nim does something when importcpping enums that it doesn't when using importc
17:18:52FromGitter<iffy> I can make wrapper procs that only exist in testmode, but looking for a single-line thing if possible
17:19:46FromDiscord<Yardanico> @iffy iirc this was discussed a lot a while ago
17:20:04*rockcavera quit (Remote host closed the connection)
17:20:09FromDiscord<Yardanico> i might be wrong but was the agreed solution to use include?
17:20:12FromDiscord<Yardanico> maybe mratsim remembers :P
17:21:16giacothe "newString[OfCap]" puzzles me. What is a string really, a reference type or a value type here?
17:21:40giacoisn't by convention new* -> ref, init* -> value?
17:22:43FromDiscord<Yardanico> string contains a pointer to the data
17:22:47FromDiscord<Yardanico> but has value semantics
17:22:54FromDiscord<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:44giacoshould I always consider strings a value type, while doing software design? is "ref string" a thing?
17:25:17FromDiscord<Yardanico> of course, nim doesn't limit you in that recard
17:25:19FromDiscord<Yardanico> (edit) "recard" => "regard"
17:25:27FromDiscord<Yardanico> you can have a "ref ref ref ref string" if you really wanted to
17:29:11FromDiscord<mratsim> In reply to @Yardanico "maybe mratsim remembers :P": The agreed solution is to complain until import {.private.} or something is delivered
17:29:51FromDiscord<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:56FromDiscord<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:17FromDiscord<spoon> sent a code paste, see https://play.nim-lang.org/#ix=2Rrc
17:48:18FromDiscord<spoon> that work but
17:48:25giacoYardanico: thanks
17:48:28FromDiscord<spoon> this dooesn't
17:48:30FromDiscord<spoon> sent a code paste, see https://play.nim-lang.org/#ix=2Rrd
17:48:32FromDiscord<spoon> (edit) "dooesn't" => "doesn't"
17:48:35FromDiscord<Yardanico> because you can't just use any symbols as operators
17:48:44FromDiscord<Yardanico> see https://nim-lang.org/docs/manual.html#lexical-analysis-operators
17:48:52FromDiscord<spoon> alright, thanks
17:48:57*drdee joined #nim
17:48:59*drdee quit (Remote host closed the connection)
17:51:50FromDiscord<Yardanico> does anyone know what :tok: is supposed to mean in nim's rst?
17:51:58FromDiscord<Yardanico> it's used in manual but seems like it's broken
17:52:08FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/816367280052109362/unknown.png
17:52:12FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/816367299207626842/unknown.png
17:53:52FromDiscord<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:32liblq-dev@Yardanico
17:56:48FromDiscord<Yardanico> yeah, so it's a css bug
17:56:56FromDiscord<Yardanico> nim doc's css bug
17:57:47FromDiscord<Yardanico> I can't find a version where it worked correctly though, seems to be broken even in 0.18.0
17:58:20FromDiscord<Yardanico> even in 0.12.0
18:04:44FromDiscord<Yardanico> oh timo already noticed it https://github.com/nim-lang/Nim/issues/16858
18:26:06FromDiscord<Solitude> we got him https://github.com/nim-lang/Nim/commit/fb93cee95de2300f863057efdf163e2413177c3d#diff-3de2c381dbe54ad832c39db5e6a64b371cb3c75e3285f2dd3d584fca52f7c659L167
18:27:00FromDiscord<Yardanico> officer, this commit right here
18:27:30FromDiscord<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:25FromDiscord<haxscramper> > nim packages↵You mean new packages added to nimble?
18:34:42FromDiscord<haxscramper> Like "new package has been added to nimble ..."
18:38:43*aenesidemus joined #nim
18:39:53FromDiscord<Yardanico> yes
18:39:57FromDiscord<Yardanico> there's https://nimble.directory/packages.xml
18:40:06FromDiscord<Yardanico> so I don't have to parse GitHub PRs myself
18:40:10*abm joined #nim
18:40:44FromDiscord<Yardanico> (I could also do JSON diffing, but packages.xml exists so no need for that)
18:58:12*xet7 joined #nim
19:06:32FromDiscord<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:28FromGitter<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:41FromDiscord<Yardanico> you can fix the error by doing ^(spawn term(k)) but it will not do what you want
19:11:15FromDiscord<Yardanico> basically you need to store all flowvars somewhere, and after they complete read them with ^
19:11:24FromDiscord<Yardanico> with the way you're doing it now it's gonna be sequential
19:12:03FromDiscord<Yardanico> ah you're using "parallel"
19:13:08FromDiscord<dk> https://play.nim-lang.org/#ix=2RrP
19:13:16FromDiscord<dk> compiles and doesn't crash for me
19:13:36FromDiscord<Yardanico> yeah I was about to say
19:13:38FromDiscord<dk> but I know nothing about threading
19:17:02FromGitter<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:01FromGitter<HJarausch_gitlab> I am going to ask in the Forum to get a broader audience. Thanks!
19:18:13FromDiscord<Yardanico> have you seen https://github.com/mratsim/weave ?
19:18:46FromGitter<HJarausch_gitlab> Yes, but I have feared its complexity a bit.
19:25:51ForumUpdaterBotNew 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:03FromDiscord<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:17FromDiscord<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:20FromDiscord<Yardanico> this is so stupid but it works
20:11:55FromDiscord<Yardanico> I need to store around 5-6 keys (last activity timestamps)
20:11:57*haxscramper quit (Ping timeout: 264 seconds)
20:12:02FromDiscord<Yardanico> overhead of serializing is too low for that
20:12:42FromDiscord<Yardanico> and using sqlite seems like an overkill
20:12:44FromDiscord<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:02FromDiscord<haxscramper> turned into 30-line abomination with 1-2 words per line
20:13:29FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2Rse
20:13:48FromDiscord<haxscramper> When comment contains C formatting `/` and `` this does not happen
20:14:08FromDiscord<haxscramper> I render `PNode` via `compiler/renderer.$`
20:14:33FromDiscord<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:58FromDiscord<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:51FromDiscord<Clyybber> not sure, whats your original code?
20:18:19FromDiscord<Clyybber> sent a code paste, see https://play.nim-lang.org/#ix=2Rsh
20:18:50FromDiscord<haxscramper> No original code, I generate enum declaration and edit `.comment` after it is generated
20:19:22FromDiscord<Clyybber> oh, and the renderer turns it into this?
20:19:27FromDiscord<haxscramper> yes
20:19:38FromDiscord<Clyybber> hmm, maybe it's related to the line limit?
20:19:40*abm quit (Read error: Connection reset by peer)
20:19:41FromDiscord<haxscramper> but only with certain comments
20:19:42FromDiscord<Clyybber> (edit) "hmm, maybe it's related to the line ... limit?" added "length"
20:20:22FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2Rsj
20:20:31FromDiscord<Clyybber> huh, that's funny
20:20:35FromDiscord<haxscramper> Not the best-looking overall, but at least it occupies single line
20:21:14FromDiscord<Clyybber> yeah, most definitely a render bug
20:21:30FromDiscord<Clyybber> but can you check without the importc stuff?
20:21:37*abm joined #nim
20:21:51FromDiscord<Clyybber> (edit) removed "but"
20:22:48FromGitter<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:13FromGitter<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:28FromDiscord<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:04FromDiscord<Clyybber> iffy: Does manually wrappign the dbValue into an array to pass to varargs work?
20:31:10FromDiscord<Clyybber> In reply to @haxscramper "Minized test does not": huh
20:31:55FromDiscord<Clyybber> the relevant logic is in renderer.nim:305 if you want to take a stab at it
20:33:43FromGitter<iffy> Clyybber: yep, it does (weird... I thought I had tried that)
20:34:19FromDiscord<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:28FromDiscord<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:24FromDiscord<carpal> I'm sorry, any lib to handle keyboard input in nim?
21:08:15FromDiscord<Solitude> In reply to @carpal "I'm sorry, any lib": in what context?
21:08:21FromDiscord<carpal> gui
21:08:25FromDiscord<carpal> opengl
21:08:35FromDiscord<ElegantBeef> Glfw and sdl2 have keyboard event handlers
21:08:44FromDiscord<carpal> I mean check if a key on the keyboard is pressed
21:08:48FromDiscord<ElegantBeef> Like i said
21:09:04FromDiscord<carpal> I searched on google but found not too much stuff
21:09:04FromDiscord<Solitude> sdl2 is tried and tested and works everywhere
21:10:19FromDiscord<carpal> ok thanks, let me try
21:22:01*muffindrake quit (Quit: muffindrake)
21:29:54FromDiscord<carpal> wrote this, but does not work https://media.discordapp.net/attachments/371759389889003532/816422084162879498/unknown.png
21:30:03FromDiscord<carpal> what I mistook
21:32:04FromDiscord<konsumlamm> wdym with "does not work"?
21:34:23*muffindrake joined #nim
21:34:58*superbia quit (Quit: WeeChat 3.0)
21:36:42FromDiscord<carpal> I don't mean that is it broken or something like that obviously
21:36:58FromDiscord<carpal> I mean that as I'm doig It's not working
21:37:21FromDiscord<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:36FromDiscord<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:57FromDiscord<Yardanico> here we go
22:34:10*ForumUpdaterBot joined #nim
22:34:15ForumUpdaterBotNew 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:15ForumUpdaterBotNew 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:48FromDiscord<Yardanico> ok mostly fine
22:40:35*waleee-cl joined #nim
22:41:54FromDiscord<Yardanico> Someone made a program to geolocate MAC addresses - https://drygdryg.github.io/geomac-webpage/index.html
22:42:00FromDiscord<Yardanico> it's in nim but proprietary :P
22:43:05FromDiscord<dom96> proprietary? Looking at it it seems like a simple HTTP client front end lol
22:43:47FromDiscord<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:23FromDiscord<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:22FromDiscord<Yardanico> lets try running nimeventer again, hope it will work (more) correctly this time
22:50:55*ForumUpdaterBot joined #nim
22:52:04FromDiscord<Yardanico> yep seems to work better
22:52:14*ForumUpdaterBot quit (Remote host closed the connection)
22:53:18*ForumUpdaterBot joined #nim
22:55:27FromDiscord<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:00giacoI'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:15FromDiscord<Yardanico> for example https://play.nim-lang.org/#ix=2RtA
23:39:25FromDiscord<Yardanico> you can actually omit "result" here
23:39:42FromDiscord<Yardanico> https://play.nim-lang.org/#ix=2RtC
23:40:10FromDiscord<Yardanico> If "return" or "result" haven't been used in a proc, last expression is considered to be the return value
23:40:16FromDiscord<ElegantBeef> oh i helped someone with this exact one recently
23:40:20FromDiscord<Yardanico> its from exercism
23:41:33giacoYeah, playing with exercism. I like the unittest based approach
23:42:26giacothanks 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:37FromDiscord<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:28giacomine looks better! not sure if faster, I am doing some string copy
23:43:46FromDiscord<ElegantBeef> You're doing a lot of iteration 😄
23:44:39giacoyeah :(
23:45:10FromDiscord<ElegantBeef> If you're after speed it's generally good to avoid the easy stdlib choices 😄
23:46:22giacoElegantBeef, sure, but I think is also good to learn what I can find within stdlib before adventuring reinventing the wheel
23:46:34FromDiscord<ElegantBeef> Well yea
23:46:55FromDiscord<ElegantBeef> I was just saying since you seemed somewhat concerned about speed
23:47:53FromDiscord<ElegantBeef> Like in your case `isSilence` isnt needed
23:48:17FromDiscord<ElegantBeef> Are you using devel?
23:49:16giacono, 1.4.2, but I've not been following upgrades for a while. Is it worth staying on devel while learning?
23:49:48FromDiscord<ElegantBeef> Well i've added `setutils` which would let you do `isAllCaps` easier
23:51:39*blackbeard420 quit (Excess Flood)
23:52:49giacoyou'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:36FromDiscord<ElegantBeef> See setutils is magical! 😛 https://media.discordapp.net/attachments/371759389889003532/816458497944322048/unknown.png
23:54:43giacowhere 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:37FromDiscord<ElegantBeef> https://github.com/nim-lang/Nim/blob/devel/changelog.md
23:58:03FromDiscord<Yardanico> https://www.mail-archive.com/[email protected]/ is this run officially?
23:58:08FromDiscord<Yardanico> i mean the forum mailing list
23:58:12FromDiscord<Yardanico> ah yeah the domain :D