<< 01-01-2023 >>

00:39:42FromDiscord<Phil> In reply to @_ 🎄 "does Nim have pattern": You mean rust style pattern matching? Not in the default syntax, but may be in packages as amadan through in there
00:40:46FromDiscord<Phil> (edit) "through in there" => "stated"
00:43:25FromDiscord<newgreenshoot> what would be the best cross-platform way to check the available disk space at a given path? I need to download a large file, but if the user doesn't have enough space for it, I need to catch that beforehand so I can tell them how much free space is required. I can't find anything in the standard library for this, nor any Nimble packages.
01:07:40madpropsmerry christmas
01:18:42*xet7 quit (Quit: Leaving)
01:22:16NimEventerNew post on r/nim by abionic: [Feedback] My first Nim Project, and a Blog, see https://reddit.com/r/nim/comments/1008lqu/feedback_my_first_nim_project_and_a_blog/
01:28:19*arik_ joined #nim
01:35:22*nick1 quit (Quit: WeeChat 3.7.1)
02:47:03FromDiscord<Boston> In reply to @newgreenshoot "what would be the": Fileapi.h? Does winim implement that
03:32:38*arik_ quit (Quit: Konversation terminated!)
03:34:48FromDiscord<albassort> is there a nim formatter
03:34:50FromDiscord<albassort> in vscode
03:37:46*Batzy quit (Quit: No Ping reply in 180 seconds.)
03:39:06*Batzy joined #nim
03:52:45*Batzy quit (Ping timeout: 268 seconds)
04:12:55FromDiscord<arik> The one that exists is nimpretty, I don't think it's integrated in vscode
04:14:43FromDiscord<sOkam!> How would you approach parsing a string representation of objects into nim types?↵Is there a pre-existing configurable parser that's usable for different cases, or would I need to write the whole lexer-parser-ast from scratch?
04:17:22*xet7 joined #nim
04:32:35FromDiscord<beans> is there a way in nim to see if any files have open file handles, like with the linux command `lsof`?
05:01:54FromDiscord<Rika> You can always ad hoc it with parse utils module (combined lexer parser)
05:02:18FromDiscord<Rika> If you want you can skip the AST generation too and parse into the object
05:43:12FromDiscord<sOkam!> That's what i did for an early impl of the game levels format, yep. Was just wondering if there is some other more specific tool, since I know so little about lang parsing/etc
05:43:56FromDiscord<sOkam!> But I guess it makes sense, that it would be just using that module + customizing whatever behavior it needs to have
05:51:01FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4k5t
05:52:55FromDiscord<sOkam!> ah i see. if I remove the explicit numbers they work↵why do these not work? any ideas? https://media.discordapp.net/attachments/371759389889003532/1058986155820986468/image.png
06:00:24FromDiscord<Rika> In reply to @sOkam! "ah i see. if": A set of enums stores the enum like this: 1 << value of enum
06:00:37FromDiscord<Rika> So you store the bit shift count, not the or’ed value
06:00:57FromDiscord<Rika> So no steps should be 14 or something and not 0x2000
06:01:05FromDiscord<Rika> Non solid should be 15
06:01:09FromDiscord<Rika> And etcetera
06:02:21FromDiscord<Rika> Does that make sense? I don’t know lol
06:11:37FromDiscord<newgreenshoot> In reply to @Boston "Fileapi.h? Does winim implement": seems a little low-level, but either way, only accounts for Windows at best. Would be nice to have something like Python's shutil.disk_usage that provides a universal way of querying usage stats, since that seems fairly basic, but I haven't been able to find anything like that
06:19:57FromDiscord<newgreenshoot> I did find <https://github.com/johnscillieri/psutil-nim> which apparently has a disk_usage function but it seems like it's abandoned↵equally I found <https://nimble.directory/pkg/psutilim> which says it's an updated version, but the GH link is a 404
06:21:20FromDiscord<newgreenshoot> ah wait, I think they just changed their username without updating the Nimble package, so the link is now <https://github.com/Techno-Fox/psutil-nim>↵↵this might be just what I need
06:23:45*arkurious quit (Quit: Leaving)
06:39:41FromDiscord<that_dude> In reply to @newgreenshoot "seems a little low-level,": Well you you're interested in how python does it, there should be modules that provide good interop with python modules
06:40:50FromDiscord<that_dude> https://github.com/yglukhov/nimpy May be of interest. I'm not sure how non stdlib modules would work tho
07:56:50FromDiscord<ShalokShalom> In reply to @newgreenshoot "ah wait, I think": It explicitly says, it only works on Linux
08:15:59*rockcavera quit (Remote host closed the connection)
08:21:55*kenran joined #nim
08:22:24*kenran quit (Remote host closed the connection)
08:44:35FromDiscord<untoreh> sent a code paste, see https://play.nim-lang.org/#ix=4k5O
08:49:32FromDiscord<sOkam!> In reply to @Rika "Non solid should be": the values are preset from C↵I was trying to keep compatibility to avoid the middle step of translating one system to the other... but... f it. I'll usie nim syntax instead, and translate if required
08:50:17FromDiscord<sOkam!> (edit) "C↵I" => "C, all old maps come with the values compiled in them↵I" | "other..." => "other on loading..." | "if required" => "them. There are not that many anyway"
08:51:27FromDiscord<sOkam!> With Nim I've learn the insane power of not having to fight the syntax, so I'll stick to that
08:51:38FromDiscord<Rika> In reply to @sOkam! "the values are preset": You will keep compatibility if you use solely sets since they will have the correct value
08:51:59FromDiscord<sOkam!> you mean sets of const, instead of enums?
08:52:10FromDiscord<Rika> Sets of enums
08:52:25FromDiscord<sOkam!> i don't catch what you mean then
08:53:11FromDiscord<Bung> any thoughts on this ? https://github.com/nim-lang/website/pull/353
08:53:24FromDiscord<Rika> {NoSteps} where nosteps is value 14 will be valued 0x2000 when casted to an integer
08:53:42FromDiscord<Rika> Given the enum starts at 0x1, thoufh
08:53:46FromDiscord<Rika> (edit) "thoufh" => "though"
08:54:24FromDiscord<sOkam!> yeah, but what about the gaps? there must be some, i imagine
08:54:36FromDiscord<Rika> Gaps dont matter if your enum starts at 1
08:54:57FromDiscord<Rika> I dont understand otherwise what you mean by gaps
08:55:27FromDiscord<sOkam!> 1000001 is a gap, if i only mark the first and the last in the list of values for the enum
08:55:59FromDiscord<sOkam!> the enum would be 0000011, but I intended 1000001
08:56:46FromDiscord<Rika> If you have an enum a = 1 and b = 4 then the set {a, b} will be 0b1001
08:56:51FromDiscord<Rika> I think
08:57:01FromDiscord<Rika> Idk exactly the gap but there will be
08:57:12FromDiscord<sOkam!> right, but that's what I had and it was complaining about 2^16
08:57:12FromDiscord<Rika> This relies on the fact that the first entry is valued 1
08:57:42FromDiscord<Rika> Because you had the values as 1 << x and not just x
08:58:00FromDiscord<Rika> Because putting it into the set would result in 1 << (1 << x)
08:58:05FromDiscord<Rika> As a value
08:58:17FromDiscord<sOkam!> you mean because of the 0xNUMBER syntax?
08:58:20FromDiscord<Rika> Yes
08:58:23FromDiscord<sOkam!> ohhh
08:58:24FromDiscord<sOkam!> ic
08:59:00FromDiscord<sOkam!> didn't know that. i will make a note, in case it becomes important when i actually load the maps
09:01:27FromDiscord<ShalokShalom> Is << bitwise shift?
09:01:35FromDiscord<ShalokShalom> In Nim?
09:01:39FromDiscord<Rika> No
09:01:48FromDiscord<Rika> It’s just something that wouldn’t trigger my autocorrect on my phone
09:01:54FromDiscord<Rika> Hahah
09:01:56FromDiscord<ShalokShalom> So, then I am confused
09:02:00FromDiscord<ShalokShalom> Ah, haha
09:02:03FromDiscord<Rika> I would have used the right shl
09:02:11FromDiscord<Rika> But that’s a pain sorry hahaha
09:02:22FromDiscord<Rika> (edit) "right" => "correct"
09:07:58FromDiscord<ShalokShalom> I turn autocorrection off
09:08:06FromDiscord<ShalokShalom> Idk how anyone can live with that
09:08:22FromDiscord<ShalokShalom> I would rather not use electronical devices 😅
09:08:44FromDiscord<Rika> I don’t have too much issues with it until I speak code
09:22:11FromDiscord<haxscramper> In reply to @haxscramper "as you can see": lmao https://media.discordapp.net/attachments/371759389889003532/1059038822568046612/image.png
09:32:10FromDiscord<Rika> Lol
09:34:12FromDiscord<newgreenshoot> In reply to @ShalokShalom "It explicitly says, it": right, but with the previous suggestion of Winim, there's a workable solution for both Windows and Linux, if not a single cross-platform package
09:34:49FromDiscord<newgreenshoot> not great, not terrible
09:36:54FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4k5W
09:37:17FromDiscord<sOkam!> (edit) "https://play.nim-lang.org/#ix=4k5W" => "https://paste.rs/L51"
09:38:26FromDiscord<newgreenshoot> In reply to @newgreenshoot "right, but with the": though, there's a separate Windows section in the docs and supposedly that function should work on Windows, so I don't know why it only claims to work on Linux https://media.discordapp.net/attachments/371759389889003532/1059042906717032520/image.png
09:40:24FromDiscord<Phil> In reply to @Vindaar "as an aside: whenever": I think that one may be hard to implement. ↵I haven't looked at the documentation-generating code in general, but from what I see it basically just generates a static site.↵Enabling user generated content with such examples mean you must have a database somewhere and at that point things start getting ugly if you want to integrate that into the normal docs
09:41:34FromDiscord<Phil> Like, you can bodge a solution together (Throw up a second server for the dynamic content and redirect to it whenever a URL contains `/example` but that's kind of a gotcha long-term,
09:41:44FromDiscord<Phil> (edit) "Like, you can bodge a solution together (Throw up a second server for the dynamic content and redirect to it whenever a URL contains `/example` ... but" added ")"
09:46:03FromDiscord<Phil> And I'm not really seeing a good solution design-wise, I only see either:↵1) Keep the user-submitted example pages as an entirely separate project from the main docs↵2) Integrate them both, leading to a massive re-write that you'd only want to apply for the official docs, as otherwise you'd lose your ability to use github pages (at least AFAIK you can't do anything non-static on github pages)
10:00:07FromDiscord<untoreh> is it fine to cast a named/tuple to an array to do a membership test?
10:00:32FromDiscord<untoreh> assuming the tuple is all same types
10:21:50*derpydoo quit (Ping timeout: 252 seconds)
10:34:30*derpydoo joined #nim
10:41:09NimEventerNew Nimble package! p5nim - Nim bindings for p5.js., see https://github.com/pietroppeter/p5nim
11:09:36FromDiscord<Vindaar> @Phil Yes, implementing such a thing with the current docs would be difficult. I'm not saying we need to have that anyway, but it's useful to be aware of good ideas other places use. Also such a thing could of course be also a completely separate project that only reproduces all available procs in the stdlib. That way it could even be extended to include arbitrary nimble packages and people could provide examples etc in one single place t
11:10:14FromDiscord<Phil> I think I'd be up for that, sounds interesting
11:13:24FromDiscord<demotomohiro> In reply to @untoreh "is it fine to": I think casting from a tuple to an array is safe as long as all type of tuple members are same and length of the tuple and the array is same.↵But you would better to find another way to solve the problem without cast as cast is generally unsafe.
11:15:12FromDiscord<Phil> sent a long message, see https://paste.rs/KfL
11:15:38FromDiscord<Phil> We'd actually need to make sure none of the examples ever get executed since we can't know what code will be put in
11:17:58FromDiscord<Vindaar> All of it sounds reasonable to me
11:18:13FromDiscord<Vindaar> I guess one could have a way to approve examples and at that point they are added to some CI
11:18:46FromDiscord<Vindaar> I'm no web person, so I'm not going to attempt to build such a thing though 😅
11:38:33FromDiscord<willyboar> In reply to @haxscramper "lmao": Are you shocked? I am not. 😜
11:48:56FromDiscord<Bung> how is the new design nimble directory progress ? wanna see it in new year
12:00:38*derpydoo quit (Ping timeout: 246 seconds)
12:03:30*xet7 quit (Remote host closed the connection)
12:05:45*xxgg joined #nim
12:13:01FromDiscord<haxscramper> https://github.com/FedericoCeratto/nim-package-directory/pull/48
12:13:35FromDiscord<haxscramper> > This PR has been tested and ready to merge for four months. I do not understand what you are expecting to happen.↵> I believe we addressed all of your comments.
12:13:36FromDiscord<haxscramper> tl;dr
12:27:15FromDiscord<ShalokShalom> In reply to @newgreenshoot "ah wait, I think": I changed this https://github.com/nim-lang/packages/pull/2447/files
12:27:34FromDiscord<ShalokShalom> @newgreenshoot
12:36:08FromDiscord<Bung> so I guess it need seperated to serveral prs
12:38:34FromDiscord<vindaar> sigh↵(@haxscramper)
12:38:51FromDiscord<willyboar> In reply to @Bung "how is the new": Ask Federico I think is here
12:39:28FromDiscord<haxscramper> on irc `federico:` yes
12:40:31FromDiscord<ShalokShalom> My username/account got deleted or is inaccessible from the forums for the second time+
12:42:50FromDiscord<vindaar> what was it?
12:44:21FromDiscord<ShalokShalom> Sorry
12:44:28FromDiscord<ShalokShalom> It is case sensitive 😄
12:44:44FromDiscord<ShalokShalom> Opposite to the language 🤔
12:56:21FromDiscord<ShalokShalom> sent a long message, see http://ix.io/4k6z
12:56:27FromDiscord<ShalokShalom> https://media.discordapp.net/attachments/371759389889003532/1059092741000273940/function.png
12:56:46FromDiscord<ShalokShalom> You can try to use whatever term you might already know from other languages.
12:57:01FromDiscord<ShalokShalom> The Nim search seems to find nothing of that.
12:58:51FromDiscord<Bung> you can do google site search
13:01:10FromDiscord<Bung> doing that will require external service, whether by search engine or custom implementation, can't do that in pure static site.
13:03:55FromDiscord<ShalokShalom> In reply to @Bung "you can do google": you are joking
13:03:59FromDiscord<ShalokShalom> i hope so
13:04:12FromDiscord<demotomohiro> It seems search text box in Nim manual only search for procedure/constant/type names in stdlib.
13:04:46FromDiscord<ShalokShalom> In reply to @demotomohiro "It seems search text": there is no discoverability for basic features by Nim itself
13:04:49FromDiscord<Bung> In reply to @ShalokShalom "you are joking": so what's you expected?
13:04:57FromDiscord<ShalokShalom> search
13:05:01FromDiscord<ShalokShalom> feature
13:05:06FromDiscord<EchoPouet> I use devdocs.io to my dev documentation.
13:05:21FromDiscord<Bung> so how that implemented in your mind?
13:05:26FromDiscord<ShalokShalom> ok, we are having a serious issue here
13:05:33FromDiscord<demotomohiro> Open nim manual and use ctrl + f is only way to basic feature
13:05:45FromDiscord<ShalokShalom> if you think, this is not an absolute necessity
13:06:16FromDiscord<ShalokShalom> In reply to @demotomohiro "Open nim manual and": the point is, that a lot of things lack tags
13:06:19FromDiscord<ShalokShalom> As an example
13:06:27FromDiscord<ShalokShalom> proc is what many languages list as function
13:06:39FromDiscord<ShalokShalom> ctrl + f function wont find proc
13:06:40FromDiscord<ShalokShalom> and so on
13:07:47FromDiscord<Bung> weird idea, the way you think like there's AI bot behind the search box..
13:11:32FromDiscord<ShalokShalom> Intelligent search is common
13:11:38FromDiscord<ShalokShalom> For like two decades
13:11:42FromDiscord<ShalokShalom> Other than in Nim
13:13:12FromDiscord<Bung> I guess the simple solution is replace to google site search
13:13:53FromDiscord<Bung> but still search on procedure won
13:14:10FromDiscord<Bung> 't show function
13:33:58FromDiscord<cow> In reply to @Bung "I guess the simple": but why involve a third party in a simple search
13:34:11FromDiscord<cow> in the stdlib it usually works, if you know the name of a package or function
13:34:39FromDiscord<cow> you can also ctrl+f for words
13:35:44FromDiscord<cow> In reply to @ShalokShalom "proc is what many": there's also `func` which arguably should be preferred if you have a pure function and not a procedure with side effects
13:35:56FromDiscord<Bung> yeah, this solution cons part is google might be blocked in some area
13:36:26FromDiscord<Bung> the lack part of current implementation it does not contains manual words
13:37:29FromDiscord<cow> and there's a table of contents if you are looking for ideas
13:37:36FromDiscord<cow> there's a section for "procedures" for example
13:38:26FromDiscord<Bung> I know, just user may not always be patient
13:40:52FromDiscord<Bung> the alternative is encourage download offline book, so they can relys on book reader search.
13:41:33FromDiscord<cow> in the nim manual, wouldn't ctrl+f work equally
13:42:32FromDiscord<Bung> no, it requires people know it's the right page they do search on a word
13:43:26*neceve joined #nim
13:43:35FromDiscord<cow> i mean, a more intelligent search sounds nice, but I think many people would be upset if it involved a third party script, especially if it was google
13:44:55FromDiscord<Bung> yeah , someone may find the good solution for nim and do that, am not interested very much.
13:54:27*derpydoo joined #nim
14:03:24FromDiscord<haxscramper> In reply to @ShalokShalom "What I currently miss": learn the power of "ctrl + f" on `theindex.html`
14:03:48FromDiscord<haxscramper> > There is also https://nim-lang.org/docs/theindex.html, I do search for "server" and it points me to https://nim-lang.org/docs/asynchttpserver.html which contains:
14:06:52*xxgg quit (Quit: Ping timeout (120 seconds))
14:08:40FromDiscord<haxscramper> it also contains 55 other responses, I wonder if there is some magic omniscience thing that this Word Of God conveniently does not mention
14:11:53*neceve quit (Ping timeout: 268 seconds)
14:23:04FromDiscord<ShalokShalom> In reply to @haxscramper "learn the power of": No. There needs to be a proper search out of the box
14:23:17FromDiscord<ShalokShalom> Not some weird hack, that 99% of the people are not doing
14:23:23FromDiscord<ShalokShalom> That's weird as fuck
14:23:46FromDiscord<haxscramper> You are talking to a person who scraped the whole forum into sqlite db in order to be able to search for messages
14:23:50FromDiscord<haxscramper> tell me about weird hacks
14:24:16FromDiscord<ShalokShalom> In reply to @cow "i mean, a more": You could literally use one of the dozens services, that anonymously search on Google for you
14:24:28FromDiscord<ShalokShalom> @haxscramper well then!
14:24:34FromDiscord<ShalokShalom> Even more of an argument
14:24:35FromDiscord<haxscramper> IDK why I haven't though about that before, but maybe 80% of the features can be implemented using out of the box solution
14:24:44FromDiscord<ShalokShalom> That's just borderline unemphatic
14:24:45FromDiscord<haxscramper> is there something like discourse for documentation?
14:24:50FromDiscord<haxscramper> readthedocs.io for exaple
14:25:01FromDiscord<ShalokShalom> There is tons of stuff
14:25:08FromDiscord<ShalokShalom> Docusaurus
14:25:12FromDiscord<ShalokShalom> Lots of options.
14:25:58FromDiscord<ShalokShalom> In reply to @cow "there's also `func` which": And intelligent documentation would tell you exactly that
14:29:14FromDiscord<cow> In reply to @ShalokShalom "And intelligent documentation would": i'm not saying the documentation is perfect
14:29:39FromDiscord<cow> + for intelligent search
14:30:13FromDiscord<cow> but just adding google search onto the site is just forcing a third party down users' throat if they want search
14:32:29FromDiscord<haxscramper> I like cppreference search, they just throw you to duckduckgo with `site:cppreference.com`
14:33:07FromDiscord<Bung> many language official sites use search engine's site search.
14:38:48FromDiscord<haxscramper> this is the easiest solution
14:40:01*jmdaemon quit (Ping timeout: 252 seconds)
14:47:13*PMunch joined #nim
14:55:51FromDiscord<scruz> Question: does a compiled nim file (.exe) work properly with every other platform?
14:56:25FromDiscord<scruz> Because I can see things like 'Android' inside the binary file when I compiled the file on Termux
14:57:02FromDiscord<scruz> This is the command I ran: `nim c -d:release --opt:size main.nim`
14:57:57FromDiscord<Bung> short answer: no
14:58:49PMunch@scruz, an .exe file is a Windows thing, so it should run on most Windows machines. But it obviously won't run on e.g. Linux without something like Wine.
14:59:04FromDiscord<scruz> Ah I see
14:59:26FromDiscord<scruz> I don't have much experience with Linux, other than running some small scripts on my Android device using Termux
14:59:59FromDiscord<scruz> But I was however able to run the exe file on Termux like so: `./main`
15:01:23FromDiscord<scruz> Oh wait, nvm there's no .exe extension lmao
15:01:30FromDiscord<scruz> why am I hallucinating
15:10:33PMunchHaha
15:10:57FromDiscord<cow> In reply to @scruz "But I *was* however": but you probably compiled that main on termux
15:11:12PMunchI mean you could put a .exe extension on there, Linux doesn't determine what to do with files based on extensions
15:11:13FromDiscord<scruz> That's what I did
15:11:25FromDiscord<scruz> In reply to @PMunch "I mean you could": Hmm I see
15:12:32FromDiscord<scruz> Ok so is there a universal solution to share the executable file to someone and expect the program to work regardless of what OS they are using?
15:13:40FromDiscord<scruz> Otherwise the only solution is to ask them to: install Nim -> clone repo on GitHub -> compile locally
15:14:29PMunchWell there are certain things like Constantine
15:14:52PMunchBut most people would just create one Windows build, a Mac build, and a Linux build and distribute those
15:14:55FromDiscord<cow> In reply to @scruz "Ok so is there": the answer to that question is the same as is there an universal solution for C
15:15:14FromDiscord<scruz> In reply to @PMunch "But most people would": Ah, right
15:15:16FromDiscord<Rika> In reply to @PMunch "Well there are certain": Do you mean cosmopolitan
15:15:18FromDiscord<Rika> Or what
15:15:21FromDiscord<Rika> Did I miss something
15:15:24PMunchAh yes :P
15:15:24FromDiscord<cow> In reply to @PMunch "Well there are certain": it'd still not work for ARM then tho, right?
15:16:00FromDiscord<scruz> Maybe I'll just share the executable file for each OS separately
15:16:03FromDiscord<Rika> Cosmopolitan doesn’t cover GUI applications either by the way
15:16:04FromDiscord<cow> https://github.com/jart/cosmopolitan this right?
15:16:09FromDiscord<Rika> Yes
15:16:16PMunch@cow, cosmopolitan or multiple binaries?
15:16:24FromDiscord<cow> cosmo
15:16:32FromDiscord<cow> cosmo is also a waste of disk space, right?
15:16:41FromDiscord<Rika> Kind of
15:16:50FromDiscord<Rika> I don’t think it’s that much of a waste
15:16:52PMunchI mean you could probably do a cosmopolitan wrapper which unzipped the actual binary based on your OS and then ran that..
15:17:21FromDiscord<scruz> Is there a guide on publishing an executable file? (Specifically for an application written in Nim)
15:17:35FromDiscord<cow> In reply to @PMunch "I mean you could": wouldn't that trigger many AV heuristics
15:17:56FromDiscord<scruz> (edit) "file?" => "file for different OSs?"
15:17:59PMunchSure, but it would be a possible solution :P
15:18:03FromDiscord<Rika> Sure, Nim itself triggers AV heuristics as well anyway
15:18:16PMunch@scruz, compile with `-d:release`, host it somewhere
15:18:21PMunchThat's pretty much it
15:18:37FromDiscord<scruz> Alright thanks
15:19:02FromDiscord<cow> In reply to @PMunch "<@794527403580981248>, compile with `-d:release`,": does that work if C libs like SDL are used?
15:19:10FromDiscord<scruz> that's what I did rn so I thought compiling a program locally would only work on the machine it was compiled on
15:19:14FromDiscord<cow> I think on linux at least, you still need a system wide install of SDL if you use SDL
15:19:42PMunchAnd I'm not saying the cosmopolitan route is necessarily a good idea, just a possibility. Most people would distribute different binaries, and then use things in the browser to serve the correct link for the OS you're on
15:19:52PMunchTake Google Chrome for example: https://www.google.com/chrome/
15:20:25PMunchThat "Download Chrome" button for me asks which architecture I want my Linux build for. If you open that page on Windows it'd probably just download an installer
15:21:00PMunch@cow, I mean for Linux software you'd really want to create packages for the different package managers
15:21:04FromDiscord<cow> the problem with this is user agent spoofing
15:21:26FromDiscord<cow> which firefox does by default if privacy.resistFingerprinting is on
15:21:30FromDiscord<Rika> You can always provide all links
15:21:32PMunch@cow, that's a very small problem, and you can easily fix it by just having a "click here for more options" button
15:21:33FromDiscord<Rika> On the same page
15:21:36FromDiscord<ShalokShalom> In reply to @cow "the problem with this": I was just about to point this out
15:21:48FromDiscord<ShalokShalom> Mine even directs to Windows default
15:21:56FromDiscord<ShalokShalom> Despite being on Linux
15:22:00FromDiscord<cow> In reply to @Rika "You can always provide": yeah, I have seen sites that don't though
15:22:14FromDiscord<cow> yes it is a site problem
15:22:20FromDiscord<cow> (edit) "yes it is a site ... problemwith" added "problem, not a" | "problem, not aproblem ... " added "with the idea"
15:22:31FromDiscord<Rika> In reply to @cow "yes it is a": Pretty much
15:22:50PMunchBut yeah if you dynamically link to a library you'd need to tell the end users to install this library
15:23:47PMunchWhat you usually do on Windows is have a checkbox in the installer which asks if you want to install dependencies (potentially with auto-detection of found dependencies), on Linux you just mark it as a dependency it whichever packaging format you use
15:24:10FromDiscord<ShalokShalom> Or AppImage / whatever
15:25:40FromDiscord<scruz> In reply to @PMunch "<@794527403580981248>, compile with `-d:release`,": So I have to run this command on 2 different OS (i.e, Windows & Linux) and then host it somewhere, right?
15:26:10PMunchI mean you can cross-compile
15:26:20FromDiscord<scruz> how do I do that
15:26:29FromDiscord<cow> isn't it easier to create a linux vm nowadays
15:26:30PMunchI.e. compile a Linux build on a Windows machine or vice versa
15:26:47FromDiscord<cow> (edit) "nowadays" => "nowadays, or to use WSL"
15:26:48PMunchDunno, I've only done Linux -> Windows builds
15:27:27PMunchIt's not that hard, you basically install a cross-compilation capable compiler, set up a few flags and bobs your uncle
15:27:44PMunchhttps://nim-lang.org/docs/nimc.html#crossminuscompilation
15:28:49FromDiscord<scruz> Alright, I'll have a look. Thanks!
15:33:06FromDiscord<ShalokShalom> You can also cross compile with the Zig compiler
15:33:08FromDiscord<ShalokShalom> https://github.com/enthus1ast/zigcc
15:35:25FromDiscord<scruz> I'm making a simple CLI app, if anyone was curious: https://media.discordapp.net/attachments/371759389889003532/1059132744547979385/Record_2023-01-01-18-19-51_84d3000e3f4017145260f7618db1d683.mp4
15:35:35FromDiscord<scruz> this is me compiling it on Termux and running it
15:36:26FromDiscord<cow> seems useful!
15:37:13FromDiscord<scruz> :P
15:37:22FromDiscord<ShalokShalom> @scruz you are using micro?
15:37:33FromDiscord<scruz> wdym, I don't know what that is
15:37:34FromDiscord<ShalokShalom> That's what's working for me on Termux
15:37:42FromDiscord<ShalokShalom> In reply to @scruz "wdym, I don't know": A text editor
15:37:48FromDiscord<scruz> I'm using nvim
15:37:51FromDiscord<scruz> neovim
15:38:00FromDiscord<ShalokShalom> Ah, you dont develop on your phone
15:38:08FromDiscord<ShalokShalom> Or do you?
15:38:18*arkurious joined #nim
15:38:27FromDiscord<ShalokShalom> Does Nvim work with lsp on Termux?
15:39:01FromDiscord<scruz> I just write simple python scripts usually so no there's nothing fancy like LSP
15:39:11FromDiscord<scruz> (edit) "no" => "no,"
15:39:31FromDiscord<scruz> maybe I could set it up, but I don't think it's necessary
15:55:01FromDiscord<willm> Anyone have resources for how to make nim bindings to a JS library?
15:55:20FromDiscord<willm> I’d like to use two JS libs in my nim project and then compile to JS
16:01:08FromDiscord<Bung> https://nim-lang.org/docs/backends.html#introduction
16:07:44FromDiscord<willm> In reply to @Bung "https://nim-lang.org/docs/backends.html#introductio": Ty
16:08:34FromDiscord<Riku> In reply to @Riku "Hi there, I was": Hey there. It's been a bit, but I was wondering if anyone could help me with this? I think it would be awesome to call c++ stuff from within Nim
16:10:26*rockcavera joined #nim
16:11:04*rockcavera quit (Remote host closed the connection)
16:13:12FromDiscord<Bung> https://nim-lang.org/docs/manual.html#importcpp-pragma-importcpp-for-procs
16:13:32FromDiscord<Bung> https://nim-lang.org/docs/dynlib.html#examples-loading-a-simple-c-function
16:13:45*rockcavera joined #nim
16:14:55FromDiscord<Riku> Huh, I've never seen the dynlib module before. I wonder if it's portable?
16:15:05FromDiscord<Riku> I'll try it though,thanks
16:15:07FromDiscord<Riku> (edit) "though,thanks" => "though, thanks"
16:17:28FromDiscord<Vindaar> In reply to @Riku "Hey there. It's been": your problem has nothing to do with Nim, but how you compile your library / the fact that you get name mangling in your shared library from the C++ side. Annotate the `libTest` function with `extern "C"`. You can inspect the symbol names in the shared library e.g. with `nm -D`
16:22:32FromDiscord<Riku> Hmm is there a way to get g++ to compile without mangling names without `extern "C"`? I'm just thinking in my head how you would go about wrapping a c++ library that contains mangled names without modifying the source code
16:22:47Amun-Raiirc no
16:33:58PMunchHas @Rika gotten an imposter?
16:35:12FromDiscord<Rika> Hahaha
16:35:34FromDiscord<Rika> Wait until some mf called Riko chats
16:38:03FromDiscord<Riku> Steam deck be like:↵`bash: gcc: command not found`
16:38:59FromDiscord<Rika> Not often does one compile on a steam deck
16:39:21FromDiscord<Riku> True
16:39:34*DarrylTheFish joined #nim
16:45:37FromDiscord<alex.boisvert> In reply to @willm "Anyone have resources for": Some good JS interop resources on this page too:↵https://github.com/nim-lang/Nim/wiki/Nim-for-TypeScript-Programmers/#javascript-interoperability
16:47:27FromDiscord<Riku> Damn dynlib can't find mangled stuff either. Is there literally any library written in c++? I mean I even checked SDL2, and it has c++ code in there, but opening the library in a disassembler reveals that all of the names are not mangled. This is crazy lol
17:12:25FromDiscord<Yepoleb> Just compile the library as usual and add extern C shims for all the functions. You can call mangled c++ code inside extern blocks.↵(@Riku)
17:17:49FromDiscord<untoreh> sent a code paste, see https://play.nim-lang.org/#ix=4k7u
17:18:09FromDiscord<untoreh> (from a memory perspective)
17:39:54FromDiscord<sOkam!> What are the equivalents to memset and memmove for pointers in gc:none?
17:58:24FromDiscord<sOkam!> I found `moveMem` for `memmove`... but is there anything similar for `memset` replacement?
18:02:23FromDiscord<sOkam!> Found it! `zeroMem`
18:25:00FromDiscord<Riku> In reply to @Yepoleb "Just compile the library": How would you make those kinds of shims?
18:48:25NimEventerNew thread by tmsa04: What Nim version introduces "except CatchableError" ?, see https://forum.nim-lang.org/t/9787
18:58:31*xet7 joined #nim
19:15:36*xet7 quit (Quit: Leaving)
19:57:25*pro joined #nim
20:00:11*pro quit (Client Quit)
20:00:51FromDiscord<Guhnoo> quick question, if i'm casting a user inputted value from a string to int or float - where the value could be any number - should I use `int` & `float` or `int64` & `float64`?
20:04:02FromDiscord<cow> i think int and float should be fine for general use
20:04:54FromDiscord<Guhnoo> i'm assuming it'll infer its bit width?
20:05:02FromDiscord<cow> on most platforms int = int64 and float = float64
20:05:02FromDiscord<luteva> In reply to @jtv "<@954521401073754212> Occurs to me": Hi jtv! Sorry i couldn't answer, i had to leave the day before yesterday. Just want to say that i now read all of your posts. Thanks a lot for your help!!
20:05:50FromDiscord<Guhnoo> In reply to @cow "on most platforms int": gotchu. thanks
20:05:58FromDiscord<cow> https://media.discordapp.net/attachments/371759389889003532/1059200834266734632/image.png
20:06:03FromDiscord<cow> seems like float = float64 always?
20:06:32FromDiscord<Guhnoo> ahh
20:06:54FromDiscord<Guhnoo> i take it that's in the docs
20:06:58FromDiscord<cow> meanwhile, int depends on your processor https://media.discordapp.net/attachments/371759389889003532/1059201084826058823/image.png
20:07:03FromDiscord<cow> In reply to @Guhnoo "i take it that's": source code actually
20:07:12FromDiscord<cow> you can click `source` when browsing docs
20:07:29FromDiscord<cow> so on 64 bit processors, int = int64
20:07:38FromDiscord<jtv> In reply to @luteva "Hi jtv! Sorry i": Seems like the Nim playground might be down though. So let me know if you still need anything
20:08:49FromDiscord<Guhnoo> i'm unsure what `int`'s "always the same as a pointer" means
20:08:57FromDiscord<Guhnoo> i did see that in the docs
20:09:31FromDiscord<cow> In reply to @Guhnoo "i'm unsure what `int`'s": in practice im pretty sure it will just mean that 64 bit processors will have int = int64
20:09:37FromDiscord<cow> and 32 bit processors will have int = int32
20:10:33FromDiscord<Guhnoo> In reply to @cow "and 32 bit processors": so, if float is aliased to float64, what does that mean for float on non 64-bit systems?
20:11:31FromDiscord<cow> float64 is aliased to float
20:11:52FromDiscord<Guhnoo> oh... facepalm
20:12:02FromDiscord<cow> i don't get it either, don't ask
20:12:16FromDiscord<cow> if you have a 32 bit system you can check sizeof(float64)
20:12:22FromDiscord<cow> it'll tell you how many bytes it has
20:12:36FromDiscord<jtv> I think theoretically it's like C in that float's size depends on the natural float size of the machine. But I can't remember the last architecture in common use w/ 32 bit floats, so it's probably 64 bits everywhere nim runs
20:13:06FromDiscord<Guhnoo> In reply to @cow "if you have a": i doubt that issue will come up. at least i hope not
20:13:27FromDiscord<jtv> sizeof(float) not sizeof(float64) 🙂
20:13:29FromDiscord<cow> In reply to @Guhnoo "i doubt that issue": i think it's generally better to use sizeof than to hardcode byte sizes anyways
20:14:12FromDiscord<Guhnoo> good point. i'll make use it
20:14:18FromDiscord<Guhnoo> (edit) "good point. i'll make use ... it" added "of"
20:15:00FromDiscord<Guhnoo> there's only a handful of 32 bit systems that are in use where i am
20:15:06FromDiscord<Guhnoo> damn legacy software
20:18:14FromDiscord<cow> In reply to @jtv "sizeof(float) not sizeof(float64) 🙂": depends which one you use
20:18:22FromDiscord<cow> but yes, better to use float()
20:18:28FromDiscord<cow> (edit) "float()" => "`float`"
20:19:15FromDiscord<cow> In reply to @Guhnoo "oh... *facepalm*": in practice, float and float64 are probably just `double` and float32 is `float` in C
20:19:29FromDiscord<cow> maybe i can dig around in the compiler to find it 🤔
20:27:00FromDiscord<cow> https://media.discordapp.net/attachments/371759389889003532/1059206125960048680/image.png
20:27:00FromDiscord<cow> i found this
20:31:24FromDiscord<Guhnoo> does that mean the actual bit width can deviate from what the data type says?
20:32:24FromDiscord<demotomohiro> At least, 32bit x86 CPUs support 64bit float and int.
20:33:28FromDiscord<Guhnoo> maybe a nooby question, but what about a 32-bit os?
20:33:52FromDiscord<luteva> In reply to @jtv "Seems like the Nim": yeah i'll just try again in a while.
20:34:20FromDiscord<demotomohiro> Nim has https://nim-lang.org/docs/system.html#BiggestFloat↵andhttps://nim-lang.org/docs/system.html#BiggestInt
20:34:53FromDiscord<cow> In reply to @Guhnoo "does that mean the": i think you're fine in general, seems like `float`s are 64 bit pretty much everywhere
20:35:07FromDiscord<cow> even on many 32 bit processors
20:35:25FromDiscord<cow> In reply to @Guhnoo "maybe a nooby question,": why would you install a 32 bit os on a 64 bit processor
20:35:25FromDiscord<Guhnoo> yeah, i'm pretty sure it's a very extreme edge case i'm worrying about
20:35:34FromDiscord<cow> (edit) "os" => "OS"
20:35:54FromDiscord<Guhnoo> In reply to @cow "why would you install": trust me, it exists where i work
20:36:15FromDiscord<Guhnoo> some people need a piece of software that literally only works properly on 32-bit installs
20:36:30FromDiscord<cow> I think you'll have 64 bit floats there too, since x86 also seems to have 64 bit floats
20:37:16FromDiscord<cow> if everything I'm seeing makes sense, only 16 bit systems seem to have 32 bit `float64`s
20:37:39FromDiscord<jtv> The point I was making is sizeof(float64) will always be 8 🙂
20:37:56FromDiscord<Guhnoo> In reply to @cow "I think you'll have": good to know, thanks for the info
20:38:03FromDiscord<Guhnoo> much appreciated
20:38:38FromDiscord<jtv> Yeah, my recollection of x86-32 bits was they had 64-bit floats, which is why I said I can't remember the last time people were using something in the real world w/ only 32-bit floats
20:39:09FromDiscord<demotomohiro> iirc, pentium CPUs and newer have FPU with 80bit registers. They are converted to 64 or 32 bit floats when it is stored on memory.
20:39:26FromDiscord<jtv> Yup exactly
20:39:31FromDiscord<cow> In reply to @Guhnoo "good to know, thanks": but `int` will be 32 bit on 32 bit systems, while `int64` should be 64 bit there
20:39:36FromDiscord<jtv> Correct
20:40:10FromDiscord<demotomohiro> Do you need to care about non-x86 32bit CPU machines?
20:41:39FromDiscord<Guhnoo> In reply to @demotomohiro "Do you need to": i'd say no
20:41:54FromDiscord<Guhnoo> in fact, definitely no
20:42:22FromDiscord<ShalokShalom> @haxscramper Just see this documentation
20:42:22FromDiscord<ShalokShalom> https://rescript-lang.org/docs/manual/v8.0.0/overview
20:42:37FromDiscord<ShalokShalom> Type in something in that search function 😄
20:43:21FromDiscord<demotomohiro> @Guhnoo Then you should be able to use 64 floats on all 32 bit x86 CPU.
20:44:27FromDiscord<Guhnoo> is `BiggestInt` and `BiggestFloat` my best option?
20:44:29*derpydoo quit (Ping timeout: 260 seconds)
20:44:45FromDiscord<cow> are you doing bitwise operations?
20:44:54FromDiscord<cow> what is your use case
20:45:33FromDiscord<cow> (edit) "are you doing bitwise operations? ... " added "crypto?"
20:45:45FromDiscord<cow> I'd say just use `int` and `float`
20:45:54FromDiscord<cow> and change when you run into a problem
20:45:57FromDiscord<Guhnoo> i think i'm overthinking this
20:46:34FromDiscord<Guhnoo> it's really not that critical
20:46:52FromDiscord<Guhnoo> i just wanted to try and cover all bases
20:47:43FromDiscord<luteva> i just scanned through the posts of the last 2 days and i saw some discussion about Qt / QML. So maybe i am not up-to-date: Did someone manage to use Qt Widget from nim? Afaik there are only Qt/QML bindings, no bindings to Qt Widgets. So what is the current state?
20:47:49FromDiscord<cow> I would say then use `int` for integers that are guaranteed to not exceed the 32 bit int limit, and use `float` otherwise, unless you need precision
20:49:41FromDiscord<Phil> In reply to @Vindaar "All of it sounds": Out of curiosity, is there some kind of project policy regarding what tech to use in those scenarios?↵Particularly since most of what I've noticed in terms of web is done in karax which I have absolutely 0 experience with
20:50:04FromDiscord<Phil> Or if there is and you don't know, who would? I'm like 20% sure pinging Araq is not the way to go for that question
20:51:26FromDiscord<Phil> This is kind of a docs proposal... do I make a forum post for this? Do I talk to somebody first?
20:53:27FromDiscord<Phil> (I will be honest, when it comes to ideas, you and ringabout are pretty much my 2 go-to people at the moment)
20:53:57FromDiscord<Phil> (edit) "ideas," => "discussing ideas at large,"
20:55:42FromDiscord<Vindaar> I'm definitely not the right person to ask about this, yes haha. I mean if it's separate from the regular docs then essentially you can use whatever you want, as it wouldn't be an official tool after all. It might become one, sure. But just building something useful would be the start
20:56:24FromDiscord<Vindaar> Writing a forum post about it isn't necessarily a bad idea, but I worry it would either be ignored or gets all sorts of "do bla bla instead" "this is a bad idea because" responses 😅
20:58:21PMunch@Phil, what're you discussing?
20:58:49FromDiscord<Phil> Ages ago, as in something longer than 24h, we had a discussion about docs and what could be done to improve them
20:59:18FromDiscord<Phil> Vindaar shared an example on how you can have webpages with examples that users can up/down vote for relevance, so user-generated doc-examples essentially
20:59:55FromDiscord<Phil> I stared at it a bit and was like "That seems buildable. Couldn't be on github pages but if I can somehow integrate that with forum-auth or sth. that could work well enough"
21:00:08FromDiscord<Vindaar> (I was referring to the Clojure docs, which you might know PMunch)
21:00:33PMunchOh yes, I've been wanting to build something like Clojure docs for Nim ever since I started using it
21:01:12PMunchI've actually even done a bit of work towards it, by improving the jsondoc documentation generation
21:01:27FromDiscord<Phil> Seems interesting to me too. Imo the trickiest part could be possibly to get it to integrate into nims general ecosystem
21:01:32FromDiscord<Phil> Oh?
21:01:42PMunchMy idea was to use Nim to generate documentation in the JSON format, ingest that into a database, and then serve that data up as a website
21:01:47FromDiscord<Phil> Seems like you were thinking about this from a different avenue
21:02:10FromDiscord<Phil> Ahhh, and then allow an alternate client to make use of that JSON-data?
21:02:16PMunchAs for auth and such I haven't really looked much into it, but integrating with the forum would be great
21:02:20FromDiscord<Phil> Since that client could use the data to provide examples per symbol etc.
21:02:30PMunchExactly
21:02:43PMunchI've already used the jsondoc thing to generate the docs for Ratel
21:03:55PMunchIn my opinion we should have the compiler only spit out something like JSON, and then have the JSON -> HTML a separate tool. Of course Nim would then call this separate tool when you do `nim doc`
21:04:15PMunchThis would ensure that all the data used to generate the documentation was also available in the machine-readable output
21:05:04PMunchTraditionally people seem to have added things into the HTML doc-generation part, but forgotten or neglected to add it to the JSON part. Then I've come along and done some batch updates, so jsondoc should now be mostly up to par with the HTML generation
21:05:11FromDiscord<Phil> sent a long message, see http://ix.io/4k8g
21:05:26PMunchOf course with the JSON output in a database you could even generate docs per version of a package as well
21:05:40PMunchAnd show how things evolve from one version to the next
21:07:13PMunchIntegrating authentication with the forum should be a secondary goal, while cool it would require some politics for acceptance
21:07:45PMunchAs for how to technically build a website I've been toying around with type-based templates and HTMX for a while
21:08:01PMunchI'm currently testing it out for my home automation stuff, but it seems promising
21:08:01FromDiscord<Phil> Even if not, I'd still want to steal how it's done in the forum simply so that I don't have to wire that up myself.
21:08:21PMunchBasically all my routes just return types, then I use my autotemplates package to build HTML from those types.
21:09:09PMunchThe idea is to combine that with my deriveable package to build a pretty nifty pattern
21:09:14FromDiscord<Phil> It's something interesting to look into for me at least, given that I kinda gave up on my mock-idea as I just am lacking too much macro knowledge.
21:09:36FromDiscord<Phil> It was really cool to finally get the first grasp of how macros work though
21:09:54PMunchDefinitely one of the cooler Nim features
21:09:59PMunchBut it takes a while to get used to
21:10:28FromDiscord<Phil> Imo it particularly takes a fair bit of learning by heart before it start to become "nice" to deal with
21:10:38FromDiscord<Phil> And by that I mean the node-patterns that make up the various syntax constructs
21:10:59FromDiscord<Phil> Or I guess that's my current take with my limited understanding of macros after my first deeper dive into them
21:11:26FromDiscord<4zv4l> I was thinking, since Nim memory can be managed in lot of different ways, that the syntax is really clean↵it is as much as Rust a good candidate to be in the Linux Kernel right ?↵(I'm not saying that either of Nim or Rust should be in the kernel, just saying that is there any reason why Rust is more worth than Nim)
21:11:57PMunchOne thing I have on my eternally growing todo list is to write a long article or short book on how to think about and write macros
21:12:02FromDiscord<Phil> As far as my understanding goes the Rust ecosystem is just more mature - more packages, less bugs in the compiler etc.
21:12:39FromDiscord<Phil> It is because of that I'd be hesitant to put nim on the same level for kernel readiness.
21:16:08FromDiscord<4zv4l> any idea of what made Rust suddenly doing a boom and become super famous ? and if/what could happen for Nim to get the same ?↵I might be wrong about why most people go for Rust but I think Nim is really a great language, high performance, syntax really clean and mostly memory safe↵I get that people screams everywhere that "Rust is a safe language" but at what cost (dev time/complexity) and really that safe ?
21:16:54PMunchRust has money and PR, that certainly helps
21:16:58FromDiscord<Phil> I think that debate may best be had in offtopic
21:17:42FromDiscord<ShalokShalom> In reply to @luteva "i just scanned through": https://forum.nim-lang.org/t/9785
21:18:00FromDiscord<Rika> In reply to @4zv4l "any idea of what": It is pretty safe. It’s just really dev intensive
21:18:16FromDiscord<Rika> But kernel devs are willing to take that bump, safety is really critical to them
21:19:56FromDiscord<ShalokShalom> sent a long message, see http://ix.io/4k8k
21:20:15FromDiscord<matkuki> sent a code paste, see https://paste.rs/9Li
21:20:28FromDiscord<ShalokShalom> 3) Rust solved the issues, that C++ people had with their language.
21:20:34FromDiscord<matkuki> (edit) "https://play.nim-lang.org/#ix=4k8m" => "https://paste.rs/MzZ"
21:20:38FromDiscord<ShalokShalom> Nim does this as well, and fails to look like C++.
21:21:00FromDiscord<ShalokShalom> Bad mistake. The same people will tell you, syntax doesnt matter. 🙂
21:21:22FromDiscord<4zv4l> In reply to @ShalokShalom "Nim does this as": "fails" ? to me it's better not to look like it 🥺
21:21:25FromDiscord<ShalokShalom> There is one thing to say, about Nim not being explicit like Rust and having not the same degree of safety as Rust.
21:21:35FromDiscord<ShalokShalom> In reply to @4zv4l ""fails" ? to me": To me as well.
21:21:42FromDiscord<ShalokShalom> But in their eyes, it fails.
21:22:10FromDiscord<Rika> Mainly the issue of some features that are controversial to non users
21:22:39FromDiscord<ShalokShalom> Nim has lesser safety than Rust. And to me, that hardly doesnt matter. Most issues in C++ are categorically outsourced in Nim as well, so they dont have a specific advantage here.
21:22:51FromDiscord<ShalokShalom> In reply to @Rika "Mainly the issue of": How you mean, dear?
21:23:26FromDiscord<ShalokShalom> Once Nim gets adopted and officially developed by a huge company, you can bet for sure it will skyrocket.
21:23:32FromDiscord<ShalokShalom> Until then, its a "niche language"
21:23:41FromDiscord<Rika> In reply to @ShalokShalom "How you mean, dear?": Style insensitivity, etc
21:23:53FromDiscord<ShalokShalom> I assume, without the C/C++ ecosystem at its hand, 90% of the people here wouldnt here.
21:23:53FromDiscord<Rika> Additionally most people dislike indentation basis
21:24:05FromDiscord<ShalokShalom> Yes, as I said.
21:24:14FromDiscord<ShalokShalom> The syntax looks unfamiliar.
21:24:36FromDiscord<ShalokShalom> I think style insensitivity doesnt play a role, though.
21:24:39FromDiscord<Rika> It’s not just because it’s unfamiliar to C++ users, it’s unfamiliar to basically all users
21:24:45FromDiscord<ShalokShalom> Thats just a thing for Hackernews.
21:24:47FromDiscord<Rika> In reply to @ShalokShalom "I think style insensitivity": Haha I wish
21:25:03FromDiscord<ShalokShalom> Well, Python is the most prominent programming language
21:25:05FromDiscord<4zv4l> In reply to @Rika "It’s not just because": looks like Python doesn't it ?
21:25:05FromDiscord<ShalokShalom> Or at least one of
21:25:17FromDiscord<4zv4l> In reply to @matkuki "Question: what is the": I really don't know tbh
21:25:18FromDiscord<Rika> In reply to @4zv4l "looks like Python doesn't": Only in one way pretty much
21:25:26FromDiscord<ShalokShalom> The point is, as Python people regularly point out:
21:25:30FromDiscord<Rika> In reply to @matkuki "Question: what is the": Sure doesn’t seem normal to me
21:25:40FromDiscord<4zv4l> looks like Python with type informations
21:25:46FromDiscord<ShalokShalom> People are think indentation based is a problem, have not tried it.
21:25:53FromDiscord<ShalokShalom> Thats the case in nearly all the cases.
21:26:10FromDiscord<ShalokShalom> They came to make it a convention, to ask "did you try it?"
21:26:19FromDiscord<ShalokShalom> This would shut down such discussions almost always.
21:26:44FromDiscord<ShalokShalom> I dont think people would ditch a language because of that
21:26:53FromDiscord<4zv4l> I always thought I didn't like Python because of the syntax but after using Nim I definitely know that the syntax is not the issue at all
21:26:54FromDiscord<ShalokShalom> And its also not, what Python users complain about.
21:27:13FromDiscord<ShalokShalom> They complain about speed, types and crude implementations.
21:29:43FromDiscord<4zv4l> I had an interview with Accenture for a cyber sec internship and I told them about Nim and they seemed pretty interested, will see how it goes when I start in February
21:34:49FromDiscord<! Nilts> How would i turn an object into a ref?
21:36:34PMunchBy copying it onto the heap
21:38:47FromDiscord<Rika> (No you can’t avoid a copy)
21:39:56FromDiscord<cow> can't you cast its unsafeAddr into a ref type technically
21:41:57FromDiscord<demotomohiro> Casting from (pointer to object) to ref object is unsafe.
21:44:32FromDiscord<! Nilts> sent a code paste, see https://play.nim-lang.org/#ix=4k8q
21:45:29FromDiscord<cow> is aw a variable created with `let` or a proc argument
21:45:38FromDiscord<cow> In reply to @demotomohiro "Casting from (pointer to": definitely, hence `technically`
21:46:05FromDiscord<! Nilts> In reply to @cow "is aw a variable": proc arg
21:46:18FromDiscord<cow> change the parameter type to `var`
21:46:25FromDiscord<cow> or if you don't want to mutate the argument
21:46:31FromDiscord<cow> you need to create a copy
21:46:52NimEventerNew thread by matkuki: Assigning array to itself with different order, see https://forum.nim-lang.org/t/9788
21:46:53FromDiscord<cow> (edit) "or if you don't want to mutate the argument ... " added "directly (as in it will affect the caller's argument that they passed in)"
21:47:12FromDiscord<newgreenshoot> In reply to @ShalokShalom "I changed this https://github.com/nim-lang/packages": The repo was renamed too, so <https://github.com/Techno-Fox/psutilim> still 404s↵should instead be <https://github.com/Techno-Fox/psutil-nim>
21:47:52FromDiscord<! Nilts> sent a code paste, see https://play.nim-lang.org/#ix=4k8r
21:49:01FromDiscord<cow> the thread you have is not mutable
21:49:14FromDiscord<cow> it would be better if you sent the whole snippet
21:49:53FromDiscord<cow> (edit) "thread you have" => "proc type" | "not mutable" => "wrong?"
21:50:20FromDiscord<jtv> In reply to @matkuki "Question: what is the": [0xC2, 0xC2] is the correct output, because you are mutating the bytes array in-place, as it's a fixed-sized array. Generally, there will be an evaluation order for expressions, it's usually left-to-right. So you should expect your code to translate to: bytes[0] = bytes[1]; bytes[1] = bytes[0]
21:50:29FromDiscord<planetis> you can't use a var argument for the tp proc
21:50:34FromDiscord<! Nilts> sent a code paste, see https://play.nim-lang.org/#ix=4k8t
21:51:16FromDiscord<Rika> In reply to @cow "can't you cast its": It wouldn’t work.
21:51:18FromDiscord<Rika> At all
21:51:23FromDiscord<cow> oh good to know
21:51:24FromDiscord<jtv> In reply to @jtv "[0xC2, 0xC2] is the": Specifically, there's no temporary array constructed.
21:52:06FromDiscord<jtv> But it is unintuitive because of the fact that you used an array literal there
21:52:08*jmdaemon joined #nim
21:52:37FromDiscord<jtv> You might rightly expect you should get semantics as if there WERE a literal. The problem is, in this case, it REQUIRES it, or else some swap logic
21:52:38FromDiscord<cow> sent a code paste, see https://play.nim-lang.org/#ix=4k8u
21:52:50FromDiscord<cow> planetis is right
21:52:51FromDiscord<ShalokShalom> In reply to @newgreenshoot "The repo was renamed": Ah, yeah
21:52:52FromDiscord<ShalokShalom> True
21:52:58FromDiscord<ShalokShalom> Thanks for pointing it out
21:54:03FromDiscord<! Nilts> In reply to @cow "yeah you can't use": than what do i do, im back at the start
21:56:44FromDiscord<! Nilts> same `cannot be assigned to` error
21:58:51FromDiscord<planetis> The current std/threadtyped kind of sucks, but it might be reworked for v2. For example it would be better if it used raw pointers instead. There is an rfc that suggests it should be low-level, so stuff like std/tasks can build upon. You can just use a global thread and call it a day or wrap pthread yourself, should be hard actually. others have done it, so...
21:59:23FromDiscord<planetis> shouldn't be hard
22:02:02FromDiscord<! Nilts> whenever i have ever tried to use pointers i get an error saying core dumped
22:03:35FromDiscord<planetis> are you porting code?
22:04:45FromDiscord<planetis> are you sure it's supposed to work this way? Its thread safe to modify the t.status variable from the child thread.
22:04:56FromDiscord<planetis> (edit) "thread." => "thread?"
22:06:16FromDiscord<planetis> (edit) "Its" => "Is it" | "variable" => "field"
22:07:10FromDiscord<@thatrandomperson5-6310e3b26da03> > are you porting code?↵No, btw this is not logged in#4644’s gitter account
22:07:24*estiquelapice quit ()
22:08:36*estiquelapice joined #nim
22:10:32FromDiscord<planetis> well there is a segmentation fault that says otherwise. Anyway to help you out try running with -d:useMalloc -t:"-fsanitize=thread" -l:"-fsanitize=thread" -d:nosignalhandler
22:11:01FromDiscord<@thatrandomperson5-6310e3b26da03> > are you sure it's supposed to work this way? Its thread safe to modify the t.status variable from the child thread?↵I mean hopefully
22:12:50FromDiscord<planetis> if anyone else can help but if I remember correctly you can't return Thread like that.
22:14:18FromDiscord<@thatrandomperson5-6310e3b26da03> what do you mean?
22:14:52FromDiscord<.tochka> how could one chain iterator and some value at the end for the same block
22:15:32FromDiscord<.tochka> for macro facilitates making expanding block two times if im not missing anything
22:15:38FromDiscord<planetis> I think but I could be wrong that Thread[T] variable can only be global?
22:16:03FromDiscord<.tochka> In reply to @planetis "I think but I": dont think so
22:16:03FromDiscord<pouriya.jamshidi> who can help me with the Nim forum registration? I have been trying to register for a while now and after confirming my email address, I get an invalid identity hash error on the website.↵↵sorry if this is not the place but I am all outta luck :S
22:20:03FromDiscord<cow> In reply to @not logged in "whenever i have ever": do you allocate enough memory?
22:21:12FromDiscord<cow> or is this the same threads example
22:22:39FromDiscord<d4rckh> Is there any similar library to scapy (for python) for Nim?
22:22:48FromDiscord<planetis> well I have never seen any code doing it that way
22:25:16*PMunch quit (Quit: leaving)
22:26:27FromDiscord<ShalokShalom> @d4rckh You can use Scapy via https://github.com/yglukhov/nimpy
22:26:53FromDiscord<ShalokShalom> And idk if there is a package ported, but I consider it less likely
22:27:05FromDiscord<ShalokShalom> Considering that it appears to be quite niche.
22:27:51FromDiscord<planetis> tochka is right you can have a local thread variable just tested it.
22:29:11FromDiscord<@thatrandomperson5-6310e3b26da03> sent a code paste, see https://play.nim-lang.org/#ix=4k8y
22:30:50FromDiscord<@thatrandomperson5-6310e3b26da03> what does the error mean?
22:35:03FromDiscord<d4rckh> In reply to @ShalokShalom "<@648552095531663361> You can use": Not looking for a port or a bridge
22:38:05FromDiscord<hotdog> In reply to @pouriya.jamshidi "who can help me": Ping <@&371760044473319454>
22:45:01FromDiscord<@thatrandomperson5-6310e3b26da03> sent a code paste, see https://play.nim-lang.org/#ix=4k8D
22:54:56FromDiscord<federico3> whoa Genode is supporting Nim https://genode.org/documentation/release-notes/18.02
22:56:48FromDiscord<Vindaar> In reply to @pouriya.jamshidi "who can help me": if you tell me your forum account name I can activate the account. The mail feature is busted
22:59:20FromDiscord<@thatrandomperson5-6310e3b26da03> sent a code paste, see https://play.nim-lang.org/#ix=4k8G
23:01:11FromDiscord<@thatrandomperson5-6310e3b26da03> sent a code paste, see https://play.nim-lang.org/#ix=4k8I
23:28:05*om3ga quit (Ping timeout: 246 seconds)
23:31:04FromDiscord<@thatrandomperson5-6310e3b26da03> did the messages above get through?
23:32:19systemdsucksyes
23:32:50FromDiscord<Elegantbeef> Is `ActiveWorker` a ref object?
23:37:55*om3ga joined #nim
23:43:44FromDiscord<@thatrandomperson5-6310e3b26da03> No
23:44:32FromDiscord<@thatrandomperson5-6310e3b26da03> I get a diffrent error for ref object
23:45:16FromDiscord<@thatrandomperson5-6310e3b26da03> Actually, i think it is the same err, nvm
23:56:14FromDiscord<Yepoleb> what's the nicest way to get openArray[bytes] from a string?
23:56:35FromDiscord<Elegantbeef> `str.toOpenArrayByte(0, str.high)`
23:59:32FromDiscord<Yepoleb> i was hoping for to avoid the explicit slicing ☹️
23:59:41FromDiscord<Yepoleb> thanks beef