<< 16-11-2022 >>

00:08:52*Zevv quit (Ping timeout: 248 seconds)
01:03:32FromDiscord<ringabout> Mostly likely
01:04:57FromDiscord<Elegantbeef> Yea i confirmed it did
01:05:10FromDiscord<Elegantbeef> It ruins `getImpl`(Did make a bug report for it)
01:05:47FromDiscord<ringabout> Yeah, I saw that.
02:39:34*dnh quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
02:47:27FromDiscord<voidwalker> is it possible to define a proc type that I can use to shorten the definition of procs of that type ? If so, what is the syntax
02:48:23*arkurious quit (Quit: Leaving)
02:48:34FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4g04
02:57:45FromDiscord<Elegantbeef> you can use the using statement
02:58:08FromDiscord<Elegantbeef> https://nim-lang.org/docs/manual.html#statements-and-expressions-using-statement
03:02:31FromDiscord<scarf> are there parametrized test for nim?↵for example stdlib test have hundreds of lines of `doAssert`
03:17:38FromDiscord<dizzyliam> @ElegantBeef here's the traceback from that AST issue I was having https://pastes.io/yixawkrmxg
03:26:20FromDiscord<ringabout> I have looked into https://github.com/nim-lang/Nim/issues/20856 and cannot think of a good solution. Though there is no guarantee regarding what's the first node of `nkObjConstr`. I can add a changelog.
03:34:56FromDiscord<Elegantbeef> Yea this breaks macros quite a bit, so the VM needs a change at the very least
03:41:35*derpydoo quit (Ping timeout: 260 seconds)
03:46:36FromDiscord<ringabout> I don't know whether node of `nkType` can be regarded as a symbol.
03:46:47FromDiscord<ringabout> (edit) "I don't know whether ... nodekind" added "a" | "anode of `nkType` ... can" added "kind"
03:46:57FromDiscord<Elegantbeef> `nktyp.typ.sym`
03:47:20FromDiscord<Elegantbeef> That falls apart for generics though
03:49:22FromDiscord<ringabout> I see
03:50:54FromDiscord<ringabout> sent a code paste, see https://play.nim-lang.org/#ix=4g09
03:50:57FromDiscord<ringabout> doesn't work for 1.6.8 either.
03:51:34FromDiscord<Elegantbeef> Right we there is no way of instantiating a generic in the present state
03:51:39FromDiscord<Elegantbeef> Forgot about that
03:54:55FromDiscord<ringabout> It is hard to make it work, I guess `getTypeInst` can be used a workaround for now.
05:10:48*Zevv joined #nim
06:35:37*kenran joined #nim
06:57:29*ltriant quit (Ping timeout: 260 seconds)
07:23:40NimEventerNew thread by HJarausch: Nimble on Termux uses invalid temp folder, see https://forum.nim-lang.org/t/9622
07:27:40NimEventerNew thread by HJarausch: Internal compiler error - how to debug? , see https://forum.nim-lang.org/t/9623
07:44:38*ltriant joined #nim
07:55:51*ltriant quit (Ping timeout: 268 seconds)
08:00:20*PMunch joined #nim
08:57:03*xet7 quit (Remote host closed the connection)
09:04:03PMunchAnyone else getting ready for christmas? https://uploads.peterme.net/nim-xmas.png
09:06:55FromDiscord<ChocolettePalette> I long for it because I'll finally be able to dedicate a couple of weeks to reinstalling my Gentoo
09:24:39*jjido joined #nim
09:52:07NimEventerNew thread by icedquinn: Metadesk parser, see https://forum.nim-lang.org/t/9624
09:56:03Amun-RaPMunch: that's not a tree, that's a tree https://play.nim-lang.org/#ix=4g1c
09:57:14FromDiscord<Elegantbeef> Make the tree 3 wide and life is easier
09:57:33FromDiscord<Elegantbeef> Atleast artistically easier
09:57:40FromDiscord<Elegantbeef> I want a point on the tree and a centred trunk!
09:57:46Amun-Ra:>
09:57:57Amun-Raand a star?
09:58:20FromDiscord<Elegantbeef> Why the entire tree is made from what one might call a star
09:58:31Amun-Ra:D
09:58:35Amun-Rafair point
10:02:04FromDiscord<luteva> is there a nim lib for autosuggestion in a terminal? (comparable to the autosuggestion in fish)
10:02:18FromDiscord<luteva> or something similar
10:03:16*alice quit (Remote host closed the connection)
10:06:20*alice joined #nim
10:13:55FromDiscord<HJarausch (HJarausch)> How to input a variable length seq[int]↵This is a FAQ, still I couldn't find a solution.↵I want to enter [1,2,3] at the input prompt.↵Do I have to parse the input string myself?
10:20:17FromDiscord<Bung> u can use terminal based editor which support nimlsp↵(@luteva)
10:20:52*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)
10:30:27*dnh joined #nim
10:33:12*PMunch quit (Remote host closed the connection)
10:33:18*PMunch_ joined #nim
10:45:47*jmdaemon quit (Ping timeout: 260 seconds)
11:10:26FromDiscord<hmmm> hmmm how do I make an int an int16?
11:10:43FromDiscord<hmmm> 6.int16 or something?
11:11:12FromDiscord<hmmm> hmm it seems like it
11:16:34FromDiscord<.tochka> yes
11:16:47FromDiscord<hmmm> so how would I go to get an intersection of a seq[set[int16]]?
11:18:36FromDiscord<Generic> intersection?
11:18:57FromDiscord<hmmm> I mean if I have 2 set[int16] I can AB and get an intersection
11:19:05FromDiscord<Generic> use a hashset
11:19:09FromDiscord<hmmm> if I have 10 sets in a seq how do I get the intersection
11:19:25FromDiscord<Generic> yeah, definitely use hashsets
11:19:38FromDiscord<hmmm> hmmmm
11:19:44FromDiscord<hmmm> make an example pls :3
11:20:05FromDiscord<Generic> ah no
11:20:07FromDiscord<Rika> Why use a hash table?
11:20:07FromDiscord<.tochka> i mean, set will work too
11:20:27FromDiscord<Generic> In reply to @Rika "Why use a hash": yeah I read seq[seq[int16]]
11:20:38FromDiscord<Generic> still set[int16] is rarely good
11:20:42FromDiscord<Rika> In reply to @hmmm "I mean if I": Prolly just use those fold procedures in sequtils
11:20:50FromDiscord<Generic> because it's 64 kb
11:21:07FromDiscord<hmmm> I'll look into it rika-sama 🥰
11:21:09FromDiscord<Generic> I mean this is just very basic programming
11:21:16*dnh quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
11:21:17FromDiscord<Rika> Do you need it to be a 16 bit integer by the way
11:21:24FromDiscord<Rika> Because it’s massive as generic said
11:21:38*dnh joined #nim
11:22:00FromDiscord<hmmm> well the numbers are not very big so I figured the builtin set int 16 would suffice
11:22:19FromDiscord<Rika> Use smaller like 8 if it fits
11:22:21FromDiscord<.tochka> 64kb of absolutely destroyed space 😔
11:22:31FromDiscord<hmmm> nu int8 is too smol
11:22:42FromDiscord<Rika> Then prolly a hash set would be better?
11:22:51FromDiscord<Rika> Are your sets sparse?
11:22:53FromDiscord<Generic> ah there's also intsets
11:22:55FromDiscord<Generic> in the stdlib
11:22:56FromDiscord<hmmm> what's the difference between set and hashset
11:23:15FromDiscord<Rika> In reply to @Generic "ah there's also intsets": Oh yeah
11:23:26FromDiscord<Generic> In reply to @hmmm "what's the difference between": set is a bitset, hashset, well a hashtable
11:23:31FromDiscord<Generic> (edit) "hashtable" => "hashset"
11:24:36FromDiscord<Generic> it's pretty basic computer science stuff, it's probably better if you read up on this
11:24:44FromDiscord<Generic> and if you still have questions, ask them here
11:25:11FromDiscord<hmmm> hmm I get all my basic cs info from rika and elegantbeef because they dumb it down to me 😃
11:25:21FromDiscord<Rika> The basic difference between a bit set and a hash set is similar to an array and a sequence
11:25:30FromDiscord<Rika> Whoops
11:25:42FromDiscord<Rika> Maybe I shouldn’t then 🤭
11:25:49FromDiscord<hmmm> 😑
11:25:53FromDiscord<Rika> Lol
11:27:31FromDiscord<Rika> But yeah a bit set would use a lot of space while a hash set needs a heap allocation
11:27:37FromDiscord<Rika> Similar idea
11:28:01FromDiscord<hmmm> ok let's say I make 10 hash sets and put them into a seq, now what? how do I get the intersection
11:28:08FromDiscord<Rika> Bit set identifies elements by the “index of the set bit”↵Hash set identifies elements by “if the hash of the element is in the internal sequence”
11:28:16*jjido joined #nim
11:28:17FromDiscord<Rika> Uh I don’t know read the docs lol
11:28:21FromDiscord<hmmm> haha
11:28:26FromDiscord<hmmm> rika 🥰
11:29:47FromDiscord<Generic> sent a code paste, see https://play.nim-lang.org/#ix=4g1A
11:29:50FromDiscord<Rika> In reply to @Rika "Uh I don’t know": Import both the int set and the seq utils modules and use the fold and intersection proc
11:29:55FromDiscord<Generic> (edit) "https://play.nim-lang.org/#ix=4g1A" => "https://play.nim-lang.org/#ix=4g1B"
11:29:56FromDiscord<Rika> Sure that works too
11:30:08FromDiscord<Rika> If you can’t tell I’m on mobile
11:30:15FromDiscord<Rika> And also am not a masochist
11:30:38FromDiscord<hmmm> or maybe I can make it in steps and intersect A with B and then B with C till 10, it should work just the same as doing it at the same time right?
11:31:02FromDiscord<Generic> yes
11:31:20FromDiscord<Rika> ✨make tests✨
11:31:27FromDiscord<Generic> In reply to @Rika "And also am not": I chose this approach for educational reasons
11:31:33FromDiscord<Generic> it has less magic
11:31:45FromDiscord<Rika> In reply to @Generic "I chose this approach": I mean I’m not a masochist to program on a phone
11:31:50FromDiscord<hmmm> perfect I think we got something workable here! I'll stuff some code and see if it blows up, thanks for all the beauties who help'd
11:31:50FromDiscord<Generic> ah
11:32:21FromDiscord<Generic> In reply to @Rika "✨make tests✨": tests only tell you if something is wrong, to tell if something is right you need to prove it
11:33:22FromDiscord<Rika> In reply to @Generic "tests only tell you": People don’t live long enough to prove everything
11:33:53FromDiscord<Generic> sure, I mean you don't need to formally prove everything
11:34:32FromDiscord<Generic> not that write proves for my programs
11:34:42FromDiscord<Generic> (edit) "that" => "like I"
11:34:48FromDiscord<Generic> (edit) "proves" => "proofs"
11:36:08FromDiscord<Bung> yeah, that happens sometime you want fix one then break another, so better put one good case and one bad case into one file.
11:41:00FromDiscord<Generic> but in this case it's very simple to reason about
11:41:15FromDiscord<Generic> set intersection is communative
11:44:31FromDiscord<HJarausch (HJarausch)> @HJarausch /quit
11:51:52*ltriant joined #nim
11:56:30*ltriant quit (Ping timeout: 240 seconds)
12:01:06FromDiscord<hmmm> sent a code paste, see https://play.nim-lang.org/#ix=4g1G
12:07:06FromDiscord<.tochka> nice python
12:18:38FromDiscord<hmmm> I firmly believe nim should write as closely as possible to python 🧐
12:19:30FromDiscord<hmmm> now I run away before some old crustacean tries to whack my head with a steel mace 🤡
12:20:43FromDiscord<scarf> to me it's typed hyperfast python
12:20:46FromDiscord<.tochka> remove types, done
12:21:17FromDiscord<scarf> tho i always type hint in python
12:29:39FromDiscord<ShalokShalom> In reply to @Rika "I mean I’m not": I actually like Termux with Micro↵Its not a full blown IDE, but for small parts, its quite decent. I think 🙂 https://media.discordapp.net/attachments/371759389889003532/1042416156163702788/Screenshot_20221116-132834.png
12:31:03FromDiscord<ShalokShalom> In reply to @Generic "tests only tell you": Isn't this in parts, what a type system does?↵🙄
12:31:58FromDiscord<enthus1ast> thank god its not↵(@hmmm)
12:32:35FromDiscord<enthus1ast> every time i must write python i hate it
12:34:45FromDiscord<fbpyr> I still enjoy python, but I am surely missing some nim properties there.. 🙂
12:35:22FromDiscord<enthus1ast> you enjoy that the application crashes on your customer instead on your dev machineß
12:35:24FromDiscord<enthus1ast> ?
12:35:47*xet7 joined #nim
12:36:13FromDiscord<hmmm> In reply to @enthus1ast "every time i must": that's because python wants us to join the cult of object and classes
12:36:30FromDiscord<hmmm> we want none of that we are free like nature so we write in nim
12:36:51FromDiscord<fbpyr> well python says it is pragmatic - that is the opposite of forced OOP
12:38:48FromDiscord<fbpyr> to be fair, that can happen with any language
12:39:33FromDiscord<enthus1ast> when you change something on a python application, you must test every code path, i bet only a fraction of python users do that
12:40:03FromDiscord<enthus1ast> on nim this is not needed, since its typed, and actually syntax checked before it executes ...
12:40:13FromDiscord<ShalokShalom> Well, its gradually typed and you can use Coconut/Expression,
12:40:19FromDiscord<ShalokShalom> (edit) "Coconut/Expression," => "Coconut/Expression."
12:40:20FromDiscord<luteva> if you have tests for each code path, there's no reason to not run the tests!
12:40:54FromDiscord<fbpyr> well a missing .so can still crash a nim app on the customer machine. typing is only one domain of potential errors.
12:41:23FromDiscord<enthus1ast> so far i have never seen any test written for a python code base (me as a code reviewer in an university context)
12:41:24FromDiscord<fbpyr> but I agree, that I enjoy having my nim app type checked by the compiler. 😌
12:44:14FromDiscord<ShalokShalom> In reply to @enthus1ast "so far i have": Its one of those things, the Ruby community is leaps and bounds ahead of Python
12:44:25FromDiscord<ShalokShalom> You won't find much Ruby code that's untested
12:44:33FromDiscord<ShalokShalom> They are really obsessed with it.
12:44:58*PMunch_ is now known as PMunch
12:48:06FromDiscord<enthus1ast> Well, dependency issues are WAY more annoying on python.↵So far so, that you cannot easily distribute a python application.
12:48:38FromDiscord<fbpyr> pyinstaller?
12:48:55FromDiscord<Rika> See word “easily”
12:48:55FromDiscord<ShalokShalom> In reply to @enthus1ast "Well, dependency issues are": Yeah, I feel that
12:48:55FromDiscord<fbpyr> it is a fat slow executable, but it is simple.
12:49:10FromDiscord<enthus1ast> why not docker?
12:49:19FromDiscord<ShalokShalom> I have not tried yet, but in theory, this could also do work fine via Graal
12:49:26FromDiscord<fbpyr> because you get docker as dependency?
12:49:35FromDiscord<ShalokShalom> Graal lets you compile into a single file with all deps 🙂
12:49:57FromDiscord<fbpyr> pyinstaller bundles its dependency but is always \> 8mb. 🙁
12:50:03FromDiscord<ShalokShalom> And its much faster than regular Python and can be mixed with other languages
12:50:03ZevvPMunch_: ping
12:50:07FromDiscord<enthus1ast> i was just mocking around
12:50:12FromDiscord<fbpyr> I prefer the slim nim executables
12:50:30FromDiscord<ShalokShalom> Yeah, sure
12:50:31FromDiscord<ShalokShalom> Me too
12:50:46FromDiscord<ShalokShalom> But if you need to work in Python
12:50:51FromDiscord<fbpyr> one thing I would like is if they also try to bundle dependencies like go.
12:50:58FromDiscord<ShalokShalom> Its also much less work to do via Nim.
12:51:02*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)
12:51:11FromDiscord<enthus1ast> Sure i know of stuff like pyinstaller, nuitka and others↵(@ShalokShalom)
12:51:31FromDiscord<ShalokShalom> Nuitka..
12:51:39FromDiscord<ShalokShalom> I looked at that ages ago
12:51:43FromDiscord<ShalokShalom> 😅
12:51:46FromDiscord<enthus1ast> it still works
12:51:50FromDiscord<ShalokShalom> Feels like I am so. Old
12:52:00FromDiscord<ShalokShalom> Never tried. Is it unmaintained?
12:52:14FromDiscord<enthus1ast> but the thing is for example\: pyinstaller can only bundle for the platform you're on
12:52:16FromDiscord<fbpyr> meaning nim executables would have an easy way to bundle static libs
12:52:55FromDiscord<fbpyr> so far I have seen the "doubled exe" a packer exe + app, or memlib
12:53:06FromDiscord<enthus1ast> i /think/ they're quite active, but i'm not an active python dev↵(@ShalokShalom)
12:53:11FromDiscord<ShalokShalom> I see
12:53:18FromDiscord<ShalokShalom> I like their Discord
12:53:31FromDiscord<ShalokShalom> Pretty absurb, how fast you get good answers
13:12:01FromDiscord<hmmm> is there a fast sugary way of parseint a seq like @["1","2","3"] into @[1,2,3]?
13:12:36FromDiscord<Rika> Seq utils, map
13:12:45FromDiscord<hmmm> ❤️ rika
13:12:48FromDiscord<Rika> Then pass parse int
13:17:10FromDiscord<Generic> In reply to @ShalokShalom "Isn't this in parts,": no, strict typing (for the most part) doesn't guarantee that your programs behaviour is logically correct
13:17:33FromDiscord<Generic> I guess there are a few exceptions, like range types
13:18:31FromDiscord<ShalokShalom> Well, if the behavior of my app is build on types
13:18:50FromDiscord<ShalokShalom> Like in domain modeling
13:19:13FromDiscord<Generic> yes, but the type system doesn't verify that say your implementation of a sorting algorithm actually always returns a sorted list
13:20:54FromDiscord<Generic> I guess you could have a really complex type system
13:21:17FromDiscord<Generic> where a sorted list would be a type or a kind of type tag
13:21:32FromDiscord<Generic> and you would say that your function returns a value of that type
13:22:18FromDiscord<Generic> and for everything to compile the compiler would need to prove that the list you're constructing in that function actually has that property
13:24:51FromDiscord<ChocolettePalette> Coq?
13:26:42FromDiscord<vindaar> that's why one uses Emacs. same experience, no matter the platform 😎 (and no, Emacs shortcuts are not a problem 😉)↵(@ShalokShalom)
13:26:51FromDiscord<ShalokShalom> @Generic How is a sorted list different from any other list?↵↵Isnt a listed sortes, so ordered by definition?
13:27:09FromDiscord<ShalokShalom> @vindaar#0000 I am too stupid for Emacs.
13:27:37FromDiscord<Generic> to my knowledge the elements of a list can have any order
13:27:43FromDiscord<ShalokShalom> A list in F# is an ordered, immutable series of elements of the same type.↵↵That is very much a type in F#
13:27:55FromDiscord<ShalokShalom> Like, one of the more common
13:27:56FromDiscord<Generic> ok I see the problem
13:28:01FromDiscord<ShalokShalom> Ok?
13:28:02FromDiscord<Generic> I mixed up ordered and sorted
13:28:16FromDiscord<ShalokShalom> Ah
13:28:21FromDiscord<ShalokShalom> Are they different?
13:29:49FromDiscord<Generic> well now that I'm thinking about it, you could sort by any arbitrary order
13:30:49FromDiscord<Generic> but in casual speak, sorted means that there is an order like descending or ascending
13:31:52FromDiscord<Rika> In reply to @vindaar "that's why one uses": I don’t see how that’s relevant
13:32:06FromDiscord<ShalokShalom> In reply to @Generic "but in casual speak,": Yes
13:32:22FromDiscord<ShalokShalom> https://learn.microsoft.com/en-us/dotnet/fsharp/language-reference/lists
13:32:49*derpydoo joined #nim
13:33:16FromDiscord<ShalokShalom> This is very much common in FSharp. They are not only their own type, I can populate product types in a list, and then its that type.
13:33:19NimEventerNew thread by tubbs: Seq too big I think Error: execution of an external program failed, see https://forum.nim-lang.org/t/9625
13:34:22FromDiscord<Generic> yes, lists are always ordered like in your F# example
13:34:34FromDiscord<Generic> but the particular order is not part of the type
13:34:47FromDiscord<ShalokShalom> Ah, that you mean.
13:34:55FromDiscord<Generic> yeah
13:36:03FromDiscord<ShalokShalom> Well, lists only contain elements of the same type.
13:36:15FromDiscord<ShalokShalom> How would the type system make out an order?
13:36:18FromDiscord<ShalokShalom> Based on what?
13:37:05FromDiscord<Generic> well I had imagined something like this
13:37:51FromDiscord<Generic> I wanted to write an example
13:38:04FromDiscord<Generic> but I noticed that what I was going for was pretty much just post conditions
13:38:18FromDiscord<Generic> except that they're somehow attached to the type of the return value
13:38:59FromDiscord<ShalokShalom> I am confused
13:39:13FromDiscord<ShalokShalom> What would you want to do, ultimately?
13:39:39FromDiscord<ShalokShalom> Have you worked with HM type systems?
13:40:23FromDiscord<Generic> no
13:41:05FromDiscord<Generic> it could be something like the direction I was going for
13:42:29FromDiscord<Generic> my standpoint is mostly Nim and C++ when I'm talking about practical type systems
13:43:52FromDiscord<ShalokShalom> Ah, I see.
13:44:01FromDiscord<ShalokShalom> So you think they are unpractical?
13:46:22FromDiscord<Generic> I'm actually not that familiar with functional programming concepts
13:46:30FromDiscord<Generic> well I do know the basics like higher order functions and things like that
13:48:54FromDiscord<Generic> but functional programming was always too far away from how computers actually work to be interesting for the things I like to do
13:51:26FromDiscord<ShalokShalom> Low level programming?
13:52:15FromDiscord<ShalokShalom> FPGAs allow us to overcome this, particularly with RISC-V
13:52:47FromDiscord<Rika> ?
13:52:50FromDiscord<ShalokShalom> And a HM type system is a functional principle, and you can use it in imperative languages as well.↵↵Rust is HM typed.
13:52:54FromDiscord<Rika> i got lost when you suddenly mentioned fpgas
13:53:09FromDiscord<ShalokShalom> In reply to @Rika "?": Do you know the Lisp machines?
13:53:26FromDiscord<Rika> not really
13:53:29FromDiscord<ShalokShalom> Casual CPUs are designed to suit imperative programming
13:53:32FromDiscord<Rika> i know but i dont really do
13:53:35FromDiscord<Rika> sure they are
13:53:41FromDiscord<ShalokShalom> Lisp machines were an early attempt to change this
13:54:36FromDiscord<ShalokShalom> With a FPGA, you can do this as well
13:54:53FromDiscord<ShalokShalom> Pick the instruction sets who fit functional programming
13:54:56FromDiscord<Generic> I guess you can accelerate FP a bit
13:55:19FromDiscord<Generic> but some things like linked lists are just problematic due to how RAM works
13:55:37FromDiscord<Rika> i dont think riscv is an fp-oriented arch though
13:55:43FromDiscord<Generic> that as well
13:55:52FromDiscord<ShalokShalom> https://github.com/tommythorn/Reduceron
13:56:03FromDiscord<ShalokShalom> In reply to @Rika "i dont think riscv": Risc V lets you choose
13:56:18FromDiscord<ShalokShalom> There is a default subset and you can pick and change
13:56:21FromDiscord<Generic> > complete with hardware garbage collection
13:56:25FromDiscord<Rika> i am aware yes
13:56:26FromDiscord<Generic> that's just a waste of silicon
13:56:39FromDiscord<ShalokShalom> Why would it.
13:56:42FromDiscord<Generic> like I guess you could acclerate FP
13:57:01FromDiscord<Generic> but you could add bigger caches, wider ALUs, etc.
13:57:22FromDiscord<ShalokShalom> This 1x 300mhz CPU beat 2x dual core 3.4 at the time
13:57:54FromDiscord<Rika> oh shit i have access to a DE2-115 board
13:57:59FromDiscord<Rika> fuck yeah am i gonna run this
13:58:04FromDiscord<Generic> what kind of dual core?
13:58:12FromDiscord<Generic> (edit) "core?" => "core 3.4 mhz?"
13:58:17FromDiscord<ShalokShalom> In reply to @Generic "but some things like": You do know how immutable data structures work?
13:58:17FromDiscord<Generic> (edit) "mhz?" => "ghz?"
13:58:27FromDiscord<Generic> yes, they're terrible
13:58:27FromDiscord<ShalokShalom> In reply to @Generic "what kind of dual": I think its part of the paper
13:58:47FromDiscord<ShalokShalom> In reply to @Rika "fuck yeah am i": Cool 🥳
13:58:59FromDiscord<Rika> i might not be able to tho
13:59:08FromDiscord<Rika> prolly not gonna be able to, i dont have access to it all the time
13:59:19FromDiscord<ShalokShalom> At university?
14:00:12FromDiscord<Rika> yes but i could take it home, its just cumbersome
14:00:26FromDiscord<ShalokShalom> I understand
14:00:34FromDiscord<Rika> shits fucking massive
14:00:39FromDiscord<Rika> big ass mf box
14:00:41FromDiscord<ShalokShalom> Maybe they got it for this case?
14:00:56FromDiscord<ShalokShalom> Seems to random otherwise
14:01:12FromDiscord<ShalokShalom> (edit) "to" => "a bit too"
14:01:19FromDiscord<Rika> wdym
14:01:25FromDiscord<Rika> no i mean i have an fpga course
14:01:35FromDiscord<ShalokShalom> Like your university
14:01:46FromDiscord<Rika> my university is a cs-oriented one
14:01:50FromDiscord<ShalokShalom> Might have gotten it for thia project specifically
14:01:55FromDiscord<Rika> no i dont think so
14:02:01FromDiscord<Generic> well I skimmed the paper and they compare FP programs
14:02:03FromDiscord<ShalokShalom> Particularly since it has cs background
14:02:13FromDiscord<Rika> there's a lot of fpga use cases and it would be crazy to assume that that's the specific reason
14:02:38FromDiscord<ShalokShalom> In reply to @Rika "no i mean i": How do you like it?
14:02:59FromDiscord<Generic> that dedicated even simpler dedicated hardware is at advantage is nothing new
14:02:59FromDiscord<ShalokShalom> In reply to @Rika "there's a lot of": Yeah. Idk how popular that specific board is.
14:03:01FromDiscord<Rika> it's fine aside from my classmates absolutely dying from the difficulty that i do not seem to notice
14:03:11FromDiscord<Rika> In reply to @ShalokShalom "Yeah. Idk how popular": its a common educational board
14:03:27FromDiscord<ShalokShalom> I see
14:03:41FromDiscord<Generic> we wouldn't have GPUs or in recent times neural net accelerators
14:03:48FromDiscord<Generic> if it wasn't for this
14:04:07FromDiscord<ShalokShalom> Would really love to see a RISC-V board for the framwork laptop
14:04:25FromDiscord<ShalokShalom> In reply to @Generic "that dedicated even simpler": Plays obviously a role
14:04:33FromDiscord<Generic> I also still don't see how RISC-V plays into this
14:05:04FromDiscord<Generic> as far as I looked into the RISC-V instruction set(s), they're just a run off the mill RISC instruction set
14:05:17FromDiscord<Generic> like ARM, PowerPC or MIPS
14:05:38FromDiscord<ShalokShalom> They are expandable
14:05:53FromDiscord<ShalokShalom> Like, you could add custom ones
14:06:31FromDiscord<ShalokShalom> And some instruction sets on today's CPUs are already accelerating functional computations
14:06:52FromDiscord<ShalokShalom> Like, not even since that a short while ago
14:06:54FromDiscord<Generic> 32-bit ARM used to have that too
14:07:01FromDiscord<ShalokShalom> Yep
14:07:38FromDiscord<Generic> the thing is that this is more meant for application specific low power things
14:07:48FromDiscord<Generic> with simpler processors that's possible
14:07:48FromDiscord<ShalokShalom> Multi core usage probably drives functional instruction sets forward too
14:07:53FromDiscord<ShalokShalom> I assume
14:08:17FromDiscord<ShalokShalom> In reply to @Generic "the thing is that": Yeah, largely. They also attack the smartphone market now.
14:08:29FromDiscord<ShalokShalom> Just released new CPUs a couple of days ago
14:08:36FromDiscord<ShalokShalom> Which they advertised this way
14:09:24FromDiscord<Generic> the thing is that with complex out of order cpus with really long pipelines you can't just stuff extra instructions in there
14:09:44FromDiscord<ShalokShalom> Well, I can drop old ones
14:10:30FromDiscord<ShalokShalom> And create new space
14:10:40FromDiscord<ShalokShalom> Even for more cache
14:10:44FromDiscord<Generic> no I'm talking about the capabilities of instructions, not the amount
14:10:50FromDiscord<ShalokShalom> Ah
14:11:23FromDiscord<ShalokShalom> I don't know enough about these specificd
14:11:29FromDiscord<ShalokShalom> (edit) "specificd" => "specifics"
14:11:59FromDiscord<Generic> like for example with aarch64 the maximum amount of registers a single instruction can read is iirc 3
14:12:12FromDiscord<Generic> and probably lots of other parts in the processor rely on that
14:13:34FromDiscord<Generic> like register renaming or the dispatching to the execution units
14:13:46*lumo_e joined #nim
14:14:40FromDiscord<Generic> well I actually don't know, I don't work for ARM, but I imagine there atleast some complex relations between different parts of the cpu
14:15:18FromDiscord<ShalokShalom> In reply to @Generic "> complete with hardware": A CPU that is natively designed towards GC might have a 65-bit data bus but 64-bit arithmetic.
14:15:26FromDiscord<ShalokShalom> From the internet
14:15:40FromDiscord<ShalokShalom> https://cs.stackexchange.com/a/112403
14:16:18FromDiscord<Generic> the N64 had 9 bit RAM, though only the GPU used the 9th bit
14:16:34FromDiscord<ShalokShalom> Cool
14:16:42FromDiscord<Generic> though I think most RAM nowdays is 8 bit
14:19:13FromDiscord<Generic> apparently you can still buy 9 bit dram
14:31:41ZevvPlanetis here?
14:36:30FromDiscord<Rika> planet is below, sir
14:41:38PMunch@Generic, you can buy 9-bit RAM?
14:41:55PMunchNot sure what I'd use t for. But now I kinda want some
14:43:13FromDiscord<Generic> there's a bunch of it on Digikey
14:43:22FromDiscord<Generic> https://www.digikey.de/de/products/filter/speicher/774?s=N4IgjCBcpgLATFUBjKAzAhgGwM4FMAaEAeygG1wwA2MeADhCLAE4B2ABmYGZGQBWVgLrte8QXy4iizPn2ZTwVPmDqtRsObAhFYXGYh0a62ylXjsTY2Ut4yzzXtT7mGReBplqmbOBAC6RAAOAC5QIADKwQBOAJYAdgDmIAC%2ByW7kIDiBeDHIABZ4USB%2ByUA
14:44:53FromDiscord<Generic> sorry for the german link
14:47:13ZevvI bet PMunch knows how to german
14:49:08PMunchHaha, I understand enough german to navigate a webpage :)
14:50:28Zevvbtw PMunch, you read the responses on the sharing-memory post? As far as I understand, it basically can not be done with 'bare' nim and arc.
14:51:09PMunchYeah I just read it (and commented)
14:51:10FromDiscord<ChocolettePalette> What about pointers?
14:51:24Zevvwhat about them?
14:51:42FromDiscord<ChocolettePalette> You can share memory using them
14:52:23PMunchIt seems to not be possible to ensure that the RC of something is 1, which I think is the only missing piece of the puzzle (at least then `send` could throw an error that it can't send memory that's referenced multiple times).
14:52:37PMunchI honestly thought this was what sink was for..
14:52:49Zevvoh sure you can share memory with pointers, that's not the problem
14:53:06Zevvmy point is that I always understood that arc was supposed to make it easy to share nim-managed memory over threads
14:53:09FromDiscord<Yepoleb> can someone link the post, i'm interested in reading it
14:53:28Zevvhttps://nim-lang.org/docs/mm.html states "The reference counting operations (= "RC ops") do not use atomic instructions and do not have to -- instead entire subgraphs are moved between threads"
14:53:39ZevvThe problem is that we seem to miss the machinere to actually do this
14:53:48PMunch@Yepoleb, https://forum.nim-lang.org/t/9617
14:55:24Zevvthe thread got distracted a bit with discussions about globals, which was not my intention
15:06:26FromDiscord<Yepoleb> i thought with orc becoming the default in nim 2 it would actually deliver on the promise of a shared heap
15:07:08Zevvthere is a shared heap.
15:07:46Zevvthe problem is that there does not seem to be an easy way to safely move arc-managed data from one thread to another
15:07:59*lumo_e quit (Quit: Quit)
15:08:20FromDiscord<Yepoleb> maybe i am misunderstanding the term then
15:08:59Zevvor maybe I am. I'm not sure how this is defined, "shared heap".
15:09:18Zevvas far as I understand, it is safe to allocate something in thread A, then magically transfer it to thread B, and later have B free the memory
15:09:27FromDiscord<Yardanico> yes
15:09:42Zevvlibc malloc() is also a shared heap
15:09:52Zevvso I don't think there is much special with that
15:10:00Zevvbut I might be misunderstanding things as well here
15:11:31FromDiscord<Yepoleb> i thought it would mean concurrent access to the same data
15:11:50FromDiscord<Yepoleb> because of the mention of atomics
15:11:52Zevvas long as you have your locks in order, you're free to do so
15:13:02FromDiscord<Yepoleb> well not with GCd objects
15:13:05FromDiscord<Yardanico> In reply to @Yepoleb "because of the mention": nim RC isn't atomic so you have to do locks, yes
15:13:10FromDiscord<Yardanico> In reply to @Yepoleb "well not with GCd": with GC'd objects
15:14:23FromDiscord<Yepoleb> oh, so you need another lock that is not part of the object before assigning a ref
15:15:28FromDiscord<Horizon [She/Her]> Does Nim have an easy way to break a loop within a loop?
15:16:10ZevvIn the end, Nim is just C, so you need to adhere to the C rules for shared memory. If you want to share data between threads, you need to first take a lock in thread A, then modify the data and release the lock. If B wants to read the data, it must first take the same lock, read the data, and release.
15:16:15FromDiscord<Yardanico> In reply to @Event Horizon "Does Nim have an": you mean nested loops?
15:16:15ZevvThat is the only rule.
15:16:24FromDiscord<Yardanico> if normal loops, then you literally just use `break`
15:16:35FromDiscord<Horizon [She/Her]> In reply to @Yardanico "you mean nested loops?": Mhm
15:16:38FromDiscord<Yardanico> if you want to break out of an outermost loop in nested loops, use block with a label
15:16:49ZevvNims arc reference counter does not use locking itself. So when sharing data between threads, things will break when you have the same arc object reachable in more then one thread
15:16:57FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=4g2H
15:16:59FromDiscord<Horizon [She/Her]> Ah thank you
15:17:06FromDiscord<Yardanico> but also you might want to rewrite your code so you don't need this
15:17:14FromDiscord<Yardanico> if it's feasible
15:17:30ZevvThe idea is that nim does not *need* locked or atomic RCs because you can move a ref, or tree of refs, between threads to make sure the same ref is never owned by more then one thread at a time
15:17:55FromDiscord<Horizon [She/Her]> In reply to @Yardanico "but also you might": Yeah that's fair, was just curious really
15:18:06FromDiscord<Horizon [She/Her]> Is there any reason to avoid using a block like this or?
15:18:31*PMunch quit (Quit: Leaving)
15:20:06FromDiscord<Yepoleb> if i want concurrent read access i can't move or use an exclusive lock
15:20:52Zevvfrom what I understand, if you want concurrent access, ie shared memory between two threads, you need to do this yourself using raw pointers
15:21:11Zevvarc managed memory is never to be accessed from more then one thread at a time
15:21:22Zevvnot even *reachable* from more then one thread at a time, even
15:21:54Zevvbut of course if you know waht you are doing, you can just create a arc managed seq in thread A, get the pointer to element 0 and share that with thread B
15:22:01FromDiscord<Yardanico> In reply to @Zevv "not even *reachable* from": it is actually reachable from multiple threads at the same time, but idk if it's safe
15:22:03FromDiscord<Yardanico> with locks I mean
15:22:03FromDiscord<Yepoleb> atomic RCs would solve that problem
15:22:22Zevvatomic RCs would solve all these problems, but there is a hefty price to pay
15:22:31Zevvthey are slow as hell, compared to plain RCs
15:23:20ZevvYardanico: no, because you can not properly protect arc's RC with a lock
15:23:26FromDiscord<Yepoleb> but still faster than copy and safer than pointers
15:24:11ZevvSure. Personally, I loathe shared memory and locks and threading in general. It is just error prone and unmaintanable
15:24:19ZevvI truly believe in the "share nothing" philosophy
15:24:28ZevvSo I would *love* to properly get these moves working
15:24:38FromDiscord<Yepoleb> what's your alternative?
15:24:41FromDiscord<Yardanico> In reply to @Zevv "I truly believe in": processes :DD
15:24:49ZevvMaking moves work
15:25:09FromDiscord<Yepoleb> but that still does not solve the problem of concurrent reads
15:25:18ZevvI do not want, nor need, concurrent reads
15:25:49ZevvI want to abstract that away over a channel-like primitive which lets me "send" data among processes, threads, or whatever you call them
15:26:04Zevvthis is implemented by moves and memory barriers under the hood
15:26:29Zevvbut the end result is that the same memory will never be owned or visible by more then one thread at the same time
15:26:54Zevvit's analogue to elixir/erlang messages or golang channels
15:27:23Zevvit's highly subjective, but I think that for me this is the only way to properly write concurrent scalable code without pain
15:29:40FromDiscord<Yepoleb> if you had to multithread a simulation of a grid, in the style of game of life, how would you do it?
15:29:53FromDiscord<Yepoleb> (edit) "grid," => "grid"
15:31:29FromDiscord<Yepoleb> that's kinda what i'm trying to do and i see no way to do it with moves or without a shitload of copies
15:31:58ZevvHow would you do it in a threaded shared memory setup? You can split the board in X areas but you will have a problem at the borders of these areas
15:32:56ZevvI would probably split the board in X areas. Then move these areas to different threads, they update their part of the board and move the result back
15:32:59Zevvjust sending messages
15:33:24Zevvthere are no copies
15:33:33Zevvit's just sending around pointers
15:34:15FromDiscord<dlesnoff> but there are still problems on border
15:34:28Zevvsure, but that's also with threads. Which threads are responsible for the border
15:34:59FromDiscord<dlesnoff> You want to update the cells on another grid.↵Maybe he can copy the lines on the border then.
15:35:11ZevvAnyway, my goal is to get moves properly working to allow a real actor model working. No more data races, deadlocks, no mutexes and semaphores in my code.
15:36:56FromDiscord<Yepoleb> a border square can neatly be assigned a thread. but it needs access to a 3x3 grid to be calculated, this works fine with concurrent reads, because a thread can access memory beyond its assigned area, but not with moves
15:37:39FromDiscord<dlesnoff> In reply to @Zevv "sure, but that's also": sorry, I just jumped in the chat and thought @Yepoleb had a question separated from your previous discussion.
15:39:02FromDiscord<Yepoleb> the cells are always updated on a copy of the grid, that's inevitable in all cases
15:41:06*arkurious joined #nim
15:43:06FromDiscord<dlesnoff> I have a simple question. Are generics usable in procedural types ?
15:43:35FromDiscord<dlesnoff> I want to test sorting algorithms with always the same pattern
15:44:42FromDiscord<dlesnoff> sent a code paste, see https://play.nim-lang.org/#ix=4g2S
15:45:20Zevvsure, what is your problem exactly?
15:45:45FromDiscord<dlesnoff> Sorry I have problem copy-pasting code from vim
15:46:21FromDiscord<dlesnoff> sent a code paste, see https://play.nim-lang.org/#ix=4g2U
15:47:32FromDiscord<dlesnoff> I want to pass this kind of prototype to my testSort function, but I get many errors
15:47:44Zevvthat should be just fine
15:48:58FromDiscord<dlesnoff> I get these:↵/home/lesnoff/Documents/dev/sortingAlgorithms/src/sortingAlgorithms.nim(236, 17) template/generic instantiation of `bubbleSort` from here↵/home/lesnoff/Documents/dev/sortingAlgorithms/src/sortingAlgorithms.nim(7, 17) Error: cannot instantiate: 'T'
15:50:22FromDiscord<dlesnoff> I don't understand why it can not automatically instantiate the generic
15:50:46ZevvYou need to be specific when instantiating
15:50:57Zevvwhen `T` is not a concrete type, the compiler does not know what to do there
15:51:58FromDiscord<dlesnoff> Let me do a MWE. I can instantiate when compiling, but it doesn't solve it.
15:54:55FromDiscord<dlesnoff> sent a code paste, see https://play.nim-lang.org/#ix=4g2Y
15:55:51FromDiscord<dlesnoff> (edit) "https://play.nim-lang.org/#ix=4g2Y" => "https://play.nim-lang.org/#ix=4g2Z"
15:57:46FromDiscord<dlesnoff> sent a code paste, see https://play.nim-lang.org/#ix=4g30
15:58:54FromDiscord<dlesnoff> I'll look more closely at the manual
16:02:06Zevvyou're missing a `var`
16:02:10FromDiscord<Bung> what's a proper error message for wrong order of case branches?
16:02:15Zevvproc testSort[T](mySort: proc (x: var openArray[T]), size: int): bool =
16:02:21Zevvbut the error message is super crappy indeed
16:02:44Zevv@bung: that was to dlensoff, although you also talekd about error messages :)
16:03:52Zevvwell, the error message is not even super crappy, it's actually right on point
16:04:05Zevvdlensoff: https://play.nim-lang.org/#ix=4g33 fixes
16:06:21FromDiscord<dlesnoff> Yes, Thank you very much !!! ↵I am glad there is no compiler issue, but I just wish errors were a little more explicit.
16:08:07Zevvit actually is explicit, albeit a bit noisy.
16:15:35NimEventerNew post on r/nim by yarn_install: This is disappointing to read coming from the Nim founder, see https://reddit.com/r/nim/comments/ywxsbz/this_is_disappointing_to_read_coming_from_the_nim/
16:21:47*wallabra quit (Ping timeout: 260 seconds)
16:24:02Amun-RaI only use they in plural; they in singular was typical for communists in my country during old times behind the curtain
16:29:37*kenran quit (Remote host closed the connection)
16:32:54*lumidify quit (Remote host closed the connection)
16:34:02FromDiscord<albassort> sent a code paste, see https://play.nim-lang.org/#ix=4g3f
16:34:10FromDiscord<Yardanico> template is just code substitution, so yes
16:34:12FromDiscord<Require Support> anyone have a problem with code compiling and running fine under debug but release build gets `SIGSEGV: Illegal storage access. (Attempt to read from nil?)` 😦
16:35:19FromDiscord<Require Support> on devel
16:35:39Amun-Racompiling or running?
16:35:45Amun-Raare you playing with pointers?
16:35:46FromDiscord<Require Support> running
16:35:51FromDiscord<Require Support> yes
16:36:09FromDiscord<Require Support> but i dont understand how debug version runs fine
16:36:15Amun-Racould you paste the code somewhere online?
16:36:19FromDiscord<Require Support> or how i go about debugging the release version
16:36:32Amun-RaI mean the part that results with segv
16:36:39FromDiscord<prestosilver> I normally use gdb to debug seg faults
16:36:53FromDiscord<prestosilver> Especially nil
16:37:01FromDiscord<prestosilver> (edit) "Especially nil ... " added "access"
16:37:13FromDiscord<Require Support> i guess ill use echo commands :/ im noob
16:37:14Amun-Rahmm, do you use -d=danger too?
16:37:23Amun-Raecho it the best for that ;>
16:37:24FromDiscord<Require Support> no just release
16:38:26FromDiscord<albassort> In reply to @Yardanico "template is just code": trying to find a cute way to branch over and over again
16:38:30Amun-Ratry to isolate where it fails, echo is quite fast for that
16:38:36FromDiscord<Yardanico> In reply to @albassort "trying to find a": can you show what you mean in pseudocode?
16:38:50FromDiscord<albassort> its easier to describe it
16:39:04FromDiscord<albassort> im writing like 20 functions for the same type, and they need to branch
16:39:37FromDiscord<albassort> I want to make it look nice and having IF X... ELIF ... ELIF ... ELSE in every function a bit ugly
16:39:43FromDiscord<albassort> and i dont think i can do case statements here
16:41:15FromDiscord<Yardanico> In reply to @albassort "its easier to describe": sorry I still don't understand, just please give a tiny bit of code you want to work
16:42:23Amun-RaI guess he's asking for some kind of function guards
16:44:01FromDiscord<albassort> they all have the same opening
16:44:01FromDiscord<albassort> sent a code paste, see https://play.nim-lang.org/#ix=4g3k
16:44:07FromDiscord<albassort> i want to reduce the boilerplate
16:46:20FromDiscord<ieltan> Hi, I want to use this library (https://github.com/bmegli/wifi-scan) functionality for my personal program, I tried looking for an equivalent in Nim far and wide but to no avail. I suppose I need to wrap it?
16:48:15NimEventerNew question by Joshua Fenner: Nim: How to wrap a c struct that contains bitfields?, see https://stackoverflow.com/questions/74463981/nim-how-to-wrap-a-c-struct-that-contains-bitfields
16:48:18FromDiscord<dlesnoff> In reply to @albassort "can i make a": I think you can do that with procs, funcs, methods, and converters
16:48:48FromDiscord<albassort> In reply to @ieltan "Hi, I want to": such a small library probably need to wrap it
16:50:46FromDiscord<albassort> In reply to @Jiezron "I think you can": realizing now i forgot about the method keyword and have never seen it in code
16:51:00FromDiscord<ieltan> In reply to @albassort "such a small library": Yes luckily it is pretty small but I wanted to be sure to not spend time wrapping something when it already exist in nim
16:51:35FromDiscord<ieltan> beside last time I did C was in high school for a project I'm not familiar with 100% of C syntax ☹️
16:54:33FromDiscord<ieltan> For more info my personal program isn't much its originally written in python all it does it check stuff like wifi Bluetooth status without relying on external shell programs I want to rewrite it in Nim but there is a lack of libraries
16:54:52NimEventerNew thread by RodSteward: Managed references to unmanaged references?, see https://forum.nim-lang.org/t/9626
16:56:01FromDiscord<Arouzing> sent a code paste, see https://play.nim-lang.org/#ix=4g3n
16:58:44FromDiscord<Bung> do it in proc not at type declaration
17:33:56NimEventerNew post on r/nim by orang-outan: How come nim is not a mess ?, see https://reddit.com/r/nim/comments/yx0508/how_come_nim_is_not_a_mess/
17:51:03*dnh quit (Quit: Textual IRC Client: www.textualapp.com)
18:07:31*pro joined #nim
18:13:22FromDiscord<@thatrandomperson5-6310e3b26da03> I have this!
18:14:50FromDiscord<@thatrandomperson5-6310e3b26da03> sent a code paste, see https://play.nim-lang.org/#ix=4g3S
18:16:33FromDiscord<@thatrandomperson5-6310e3b26da03> Ive been stuck on this for awhile
18:35:12*jjido joined #nim
18:37:32*jmdaemon joined #nim
19:08:59*kenran joined #nim
19:27:08FromDiscord<Elegantbeef> How do you attempt to use it?
19:27:44FromDiscord<Elegantbeef> `proc newLimitedSeq[T](lst: seq[T], limit: int): LimitedSeq[T]`
19:56:14*robertmeta quit (Ping timeout: 252 seconds)
19:59:36*robertmeta joined #nim
20:04:24*robertmeta quit (Ping timeout: 260 seconds)
20:05:22*robertmeta joined #nim
20:13:59*om3ga quit (Ping timeout: 256 seconds)
20:15:22*om3ga joined #nim
20:15:45*LuxuryMode joined #nim
20:25:53FromDiscord<Bleant> Hello, everyone! What editor/IDE do you use mostly for Nim? I'm using VSCode, and I'd like to do some string templating for HTML, but I don't see a plugin to have the editor understand the content of the fmt string as HTML, which I'd really like. Is there any way?
20:26:42*kenran quit (Remote host closed the connection)
20:36:36FromDiscord<Phil> Heyho Bleant. That is a really good question and sadly I do not have a great response.↵A suggestion I could make would be, that you could have the HTML be in a separate HTML file and read that in at compile-time.↵That file will be read into a string and put into a variable at compile-time then and be part of your binary, but the actual HTML will still be in its own file.
20:36:51FromDiscord<Elegantbeef> But there are other templating methods
20:37:58FromDiscord<Elegantbeef> Damn matrix bridge
20:38:08FromDiscord<Elegantbeef> I said it first! 😛
20:38:24FromDiscord<Phil> You did not, I have screenshot proof!
20:38:49FromDiscord<Array in a Matrix> no i do!
20:38:53FromDiscord<Phil> The technology you choose to deliver the answer is your responsibility and thus your loss if you're slower xP
20:39:08FromDiscord<Elegantbeef> Well i blame the bride
20:39:11FromDiscord<Elegantbeef> bridge even
20:39:23FromDiscord<Phil> First blaming a bride, then a random bridge
20:39:29FromDiscord<Bleant> In reply to @Isofruit "Heyho Bleant. That is": I see, that makes sense! Since you've been so kind as to answer, how may I get the path of the file to be read relative to the file I'm copying into?
20:39:29FromDiscord<Phil> No sense of responsibility
20:40:10FromDiscord<Bleant> In reply to @Elegantbeef "But there are other": You mean like ejs? If so, I'd prefer not to, just to keep things as raw as possible. If not, how could I achieve this?
20:40:16FromDiscord<Phil> In reply to @Bleant "I see, that makes": One sec, that last sentence takes me a bit to parse, I'm like 30% braindead at the moment from CS courses on top of QML learning
20:41:06FromDiscord<Phil> (edit) "courses" => "course"
20:41:18FromDiscord<Bleant> Hehehe, I undertand. CS course is a doozy, for sure. What's QML, though?
20:41:21FromDiscord<hugogranstrom> sent a code paste, see https://play.nim-lang.org/#ix=4g4w
20:41:24FromDiscord<Elegantbeef> https://nimble.directory/search?query=html+template
20:41:44FromDiscord<hmmm> sent a code paste, see https://play.nim-lang.org/#ix=4g4x
20:41:48FromDiscord<hmmm> nim seems angry with me
20:41:50FromDiscord<Elegantbeef> Internal compiler error nice
20:41:53FromDiscord<Phil> In reply to @Bleant "Hehehe, I undertand. CS": QML is a language of QT for declaring GUIs and having them be rendered by an engine in QT
20:42:08FromDiscord<Elegantbeef> you have a call somewhere passing in a nil
20:42:18FromDiscord<Phil> It's not that hard, particularly if you already know webdev, just a smidge different and I do it on the side during the workweek
20:42:52FromDiscord<hmmm> ye I called something that didn't exist apparently
20:43:58FromDiscord<hmmm> still why so obscure, beefy fix it for the greater good
20:44:12FromDiscord<hmmm> the line is nowhere near where this happened too
20:44:16FromDiscord<Phil> In reply to @Bleant "I see, that makes": Since it's a path you use at compiletime and never again once the binary is compiled you should be able to get away with a hard-coded path
20:44:43FromDiscord<Phil> The proc you're looking for is `staticRead` trying to figure out whether it used absolute or relative filepaths
20:44:55FromDiscord<Bleant> In reply to @Isofruit "It's not that hard,": Webdev, the inevitable path we all go to.
20:45:14FromDiscord<Elegantbeef> Webdev is da poopoo
20:46:13FromDiscord<Phil> I'd only partially disagree. Imo it can be quite nice... if you don't have to support 20 peoples different architectural ideas thrown all into one project.
20:46:24FromDiscord<Phil> but that's an issue with any software written by more than 2 people
20:47:36FromDiscord<Bleant> So, just wondering: if you were just starting out a project, would you use an SPA library, or server side templating with htmx?
20:48:11prodo we have a separate channel for advent of code?
20:48:16FromDiscord<Phil> In reply to @Bleant "I see, that makes": Okay,, figured it out, the path you give staticRead is realtive to the main file you're compiling.
20:48:46FromDiscord<Phil> Like, the one file you're passing to the compiler and that is the starting point of your whole project
20:48:53FromDiscord<Elegantbeef> There is a aoc discord channel so 'yes'
20:49:16FromDiscord<Phil> In reply to @Bleant "So, just wondering: if": Depends on the requirements, really
20:49:44FromDiscord<Bleant> Wish LeetCode had Nim 😦
20:49:50FromDiscord<Phil> Like, I have a wiki webpage in nim that uses an SPA, but the webpage itself doesn't really benefit all that much from the technology.
20:50:02FromDiscord<Bleant> Maybe it's possible to get away with compiling to JS first, then uploading the answer?
20:50:12FromDiscord<Phil> I have that as a vanity project because it allows me to make the number for HTTP requests to go lower
20:50:45FromDiscord<Phil> And I basically wanted to see to how fast I could squeeze down on the HTTP request times
20:50:55FromDiscord<Bleant> Using Karax?
20:51:40FromDiscord<Phil> Nah, Angular, I am not a massive fan of compiling to JS based on principle alone.↵I've got nothing in particular against Karax, just that I believe you can have a better time if you actually write your frontend with frontend tech
20:52:18FromDiscord<Phil> I've heard many folks have a great time with karax though, so if you're fine with it don't let my opinion discourage you
20:56:06FromDiscord<Bleant> sent a long message, see http://ix.io/4g4z
20:57:43FromDiscord<Phil> In reply to @Bleant "I get you. It's": Fully fair point and the initial set up of writing up all your services in the frontend to do AJAX calls to the right points in the backend is....tedious to say the least for the first bit
20:57:50FromDiscord<Phil> As is writing all the interfaces, my lord
20:57:55FromDiscord<Phil> (edit) "As is writing all the interfaces, my lord ... " added "that was braindead work"
20:58:35FromDiscord<Phil> However, there are benefits of having your tech-stack decoupled like that
20:59:25FromDiscord<Phil> ~~Also I use prologue out of principle~~
21:14:56FromDiscord<spoon> sent a code paste, see https://play.nim-lang.org/#ix=4g4I
21:15:41FromDiscord<spoon> it says some of them are immutable, which i'm guessing is the problem
21:22:12FromDiscord<Elegantbeef> `union`, `toSeq`, `sort` all generate garbage
21:22:36FromDiscord<Elegantbeef> you want `sorted` `sort` is for `var openarray[char]`
21:24:44FromDiscord<spoon> gotcha, worked
21:24:52FromDiscord<spoon> is it because they're all macros?
21:24:59FromDiscord<Elegantbeef> No
21:25:15FromDiscord<Elegantbeef> It's cause Nim isnt a FP language so doesnt do the optimisations they do
21:26:27FromDiscord<Elegantbeef> This is a real big waste for strings
21:28:05FromDiscord<Elegantbeef> I dont even know why it's named longest but returns a string of the containing characters
21:28:49FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=4g4O gives you the characters in order of highest integer value
21:29:37FromDiscord<spoon> In reply to @Elegantbeef "I dont even know": it's taken from an exercise so i couldnt tell you either
21:30:32FromDiscord<Elegantbeef> My example only heap allocates for the result string
21:36:36FromDiscord<yrashk> I wonder if there's a way to tell Nim NOT to use `-shared` when trying to build with `--app:lib`? I am on macOS and trying to pass the `-bundle -bundle_loader PATH` to the linker (via `passL`), as this is making cc fail with an error? Simply removing `-shared` from the invocation of clang solves the problem. Or am I out of luck here?
21:39:39FromDiscord<Elegantbeef> What's the error?
21:39:58FromDiscord<Elegantbeef> I mean i think you can technically modify your `nim.config` located in your nim directory, but that's not a very usable solution
21:43:26FromDiscord<yrashk> clang-15: error: invalid argument '-bundle' not allowed with '-dynamiclib'
21:44:04*pro quit (Quit: pro)
21:49:56FromDiscord<Elegantbeef> I wonder if older clang didnt error
21:50:28FromDiscord<hmmm> wot
21:50:48FromDiscord<yrashk> looks like -shared is defined here https://github.com/nim-lang/Nim/blob/92a0f191bf837287eec180288465d7b64d9bf47f/compiler/extccomp.nim
21:51:03FromDiscord<hmmm> sent a code paste, see https://play.nim-lang.org/#ix=4g4P
21:51:24FromDiscord<Elegantbeef> Cause that's `[](Test, "hello".parseEnum)`
21:51:31FromDiscord<Elegantbeef> you want `"hello".parseEnumt[: Test]`
21:51:50FromDiscord<hmmm> I'm confus
21:51:59FromDiscord<Elegantbeef> `: Test` tells the compiler "This is a generic proc call"
21:52:12FromDiscord<Elegantbeef> think about `myObject.array[100]`
21:52:19FromDiscord<hmmm> ok
21:52:25FromDiscord<Elegantbeef> how do you distinguish a generic proc invocation from a `[]` invocation
21:52:58FromDiscord<pear> im here for like 5 minutes nd im already learning new stuff i love this community
21:52:59FromDiscord<Elegantbeef> There is no way in knowing that you wanted `parseEnum[Test]("hello")` instead of `[](Test, "hello".parseEnum)`
21:53:58FromDiscord<Elegantbeef> As such the `:T` syntax was added to disambiguate
21:53:58FromDiscord<Elegantbeef> yrashk i'd suggest opening an isssue
21:53:58FromDiscord<Elegantbeef> issue even
21:53:59FromDiscord<Elegantbeef> Or look to see if one exists
22:02:26FromDiscord<hmmm> hey beefy what was the name of that proc that checks if a path is valid for a given os? I remember using it but can't find it anymore 🫥
22:06:47FromDiscord<Elegantbeef> I dont know i just attempt to open the file if it fails i handle the exception
22:07:38FromDiscord<hmmm> oh that's even better lol
22:08:10FromDiscord<hmmm> beefy one day your brain will explode out of your skull 🫣
22:11:14FromDiscord<albassort> the paragma when you define something are macros right
22:11:28FromDiscord<albassort> sent a code paste, see https://play.nim-lang.org/#ix=
22:13:42FromDiscord<albassort> ah i remember how nim works
22:39:06FromDiscord<albassort> according to UTF8 "っ" isn't in it?
22:40:11FromDiscord<albassort> https://media.discordapp.net/attachments/371759389889003532/1042569803497476106/image.png
22:40:13FromDiscord<albassort> sent a code paste, see https://play.nim-lang.org/#ix=4g4Y
23:05:57*oprypin quit (Ping timeout: 255 seconds)
23:12:50*oprypin joined #nim
23:49:52FromDiscord<morgan> just curious, is there a way to include binary data from some file at compile time without copying it in manually and not just opening the file when it runs?
23:50:58FromDiscord<albassort> yes
23:51:04FromDiscord<albassort> sent a code paste, see https://play.nim-lang.org/#ix=
23:51:22FromDiscord<albassort> sent a code paste, see https://play.nim-lang.org/#ix=4g55
23:51:30FromDiscord<albassort> on compile it'll link that data statically to the binary
23:51:40FromDiscord<morgan> cool thanks
23:51:51FromDiscord<albassort> your banner is sexy asf
23:52:06FromDiscord<albassort> adhdtrap
23:53:53FromDiscord<morgan> thanks
23:54:13FromDiscord<morgan> a lil bit of math i came up with a couple years ago and really like