00:01:09 | FromDiscord | <konsumlamm> when you deem it too big for one module |
00:12:41 | FromDiscord | <zetashift> In reply to @leorize "can you make a": I can, but knowing me I'm doing something wrong here 😛 |
00:19:39 | * | gmaggior quit (Quit: Leaving) |
00:21:34 | FromDiscord | <Yardanico> @krux02 you might want to search in the sqlite db I made (it's based on irclogs) https://drive.google.com/file/d/1njJpsBpFUf4MsaDkQokuIRjQqgOgT6/view |
00:21:43 | FromDiscord | <Yardanico> you can open it with something like sqlitebrowser |
00:22:02 | FromDiscord | <zetashift> Alright I might actually have found something weird, why does `fail` fail and the `foo` work? https://play.nim-lang.org/#ix=2PNj |
00:26:17 | FromDiscord | <バロザード> sup, are there any game engines or game related content made with Nim thats not Godot bindings? |
00:26:42 | FromDiscord | <ElegantBeef> I like the nico framework and have made a fairly fun game with it 😄 |
00:27:08 | * | Vladar quit (Quit: Leaving) |
00:27:08 | FromDiscord | <ElegantBeef> Raylib bindings are fairly common |
00:27:41 | krux02 | バロザード: I made OpenGlSandbox here: https://github.com/krux02/opengl-sandbox |
00:27:51 | FromDiscord | <バロザード> this? https://github.com/ftsf/nico |
00:27:58 | FromDiscord | <ElegantBeef> Yep |
00:28:10 | FromDiscord | <バロザード> i see |
00:28:25 | FromDiscord | <バロザード> does it come with colliders or will i have to code stuff like that themselves? |
00:28:54 | FromDiscord | <バロザード> My main interest in nim is that I want to make games, but i dont want to c++ and im not a huge fan of how rust people really are pushing for ECS in games |
00:28:56 | FromDiscord | <ElegantBeef> It is barebones but impbox(the creator) did at one point use chipmunk with it |
00:28:57 | krux02 | OpenGL sandbox is not a binding in any form. It is completely developed in Nim and it couldn't be implemented in another language that is less powerful like c++. |
00:29:23 | FromDiscord | <バロザード> whats chipmunk? |
00:29:30 | FromDiscord | <ElegantBeef> A 2D physics engine |
00:29:33 | FromDiscord | <バロザード> i see |
00:29:34 | krux02 | another engine |
00:29:55 | FromDiscord | <バロザード> well im interested in making a fighting game so my collider requirements are super specialized 😅 e |
00:30:09 | FromDiscord | <バロザード> ill probably have to use godot in the end, but im exploring other options |
00:30:18 | krux02 | バロザード: Do you look for bindings for something established, or are you looking for new solutions that embrace the possibilites of new programming languages? |
00:30:33 | FromDiscord | <バロザード> im looking for something thats fast and i dont have to build everything myself |
00:30:53 | krux02 | バロザード: please take a look at opengl sandbox and give me feedback about it. |
00:31:04 | krux02 | It is as fast as handwritten OpenGL can get. |
00:31:11 | * | spiderstew_ quit (Quit: ZNC 1.7.2+deb3 - https://znc.in) |
00:31:11 | krux02 | but it is also fast to develop in. |
00:31:20 | FromDiscord | <バロザード> hm, does it come with an animation manager or is that something i will have to build myself? |
00:31:25 | * | spiderstew joined #nim |
00:31:34 | krux02 | you would have to build that. |
00:31:55 | FromDiscord | <ElegantBeef> Checkout raylib bindings if you dont want godot, it might have stuff like that idk |
00:32:09 | FromDiscord | <バロザード> i see |
00:32:25 | krux02 | it mainly tries to solve the hassle with writing shaders in bare bone OpenGL without restricting the possibilites to some predefiend attributes and uniforms |
00:33:34 | FromDiscord | <バロザード> i guess i dont have much to lose lol ¯\_(ツ)_/¯ |
00:33:40 | krux02 | yea |
00:34:40 | krux02 | there is probably something wrong with OpenGL sandbox that causes that nobody provides me with feedback for it. |
00:35:20 | krux02 | So if you try it out, and you decide not to use it for whatever reason, please tell me why you would not want to use it. |
00:35:28 | krux02 | I need feedback like that. |
00:35:47 | FromDiscord | <ElegantBeef> I havent seen it before, similar goal to aglet it seems |
00:35:56 | krux02 | what is aglet? |
00:36:03 | FromDiscord | <ElegantBeef> https://github.com/liquidev/aglet |
00:36:10 | FromDiscord | <ElegantBeef> It's lqdev's opengl wrapper |
00:37:21 | krux02 | well, OpenGL sandbox is not an OpenGL wrapper in any form. |
00:37:27 | FromDiscord | <ElegantBeef> Ah |
00:37:33 | krux02 | You use bare bones OpenGL whereever suitable. |
00:37:44 | krux02 | The reason for that is, OpenGL is documented. |
00:38:06 | krux02 | I know it sucks, but at least its behavior is well specified and documented and used a lot. |
00:38:10 | krux02 | People know what to expect. |
00:38:26 | krux02 | I don't want to put yet another opinionated layer on top. |
00:38:33 | krux02 | Also it used SDL2 bare bones. |
00:38:41 | krux02 | I think SDL2 is quite nice to use. |
00:38:52 | krux02 | I don't want to put a layer on top of that either. |
00:39:14 | krux02 | The things that I fix are how shaders are compiled and uniforms and attributes are bound to shaders. |
00:39:37 | krux02 | that is by far the most annoying part of non-fixed-function-pipeline-opengl |
00:40:34 | krux02 | no query of uniform location, no messing up of uniform names in shader and code, no accidental invalid pointer passing to opengl. |
00:40:42 | krux02 | everything wrapped nice and smoothly. |
00:40:56 | FromDiscord | <ElegantBeef> I'm a numpty so at the very least i'm interested in something that abstracts it away so i can just load a model and then on render it draw where i need/want it. Anything lower than that and i'll be bored in a few seconds 😄 |
00:41:09 | krux02 | you just render like if you are in immediate mode, but wit full shader flexibility |
00:41:47 | krux02 | ElegantBeef: well there is an example where I render an IQM mesh. |
00:42:19 | krux02 | This library is for you if you like to render procedurally |
00:42:41 | krux02 | generate procedural worlds in no time |
00:43:18 | krux02 | The idea is not to implement a renderer for a specific data type, like the mesh that you want to render |
00:43:44 | krux02 | the idea is to be able to render any kind of data from memory as quickly as possible. |
00:44:01 | krux02 | if you have an array, you can put in on the gpu and use it somehow to render it. |
00:44:22 | FromDiscord | <ElegantBeef> Yea it seems to remove the opengl tedium that makes leave even quicker |
00:44:55 | krux02 | and it generates opengl code under the hood that is close to the optimum you can have |
00:45:15 | krux02 | but what is leave? |
00:45:42 | FromDiscord | <ElegantBeef> Though i'm not a graphics programmer one bit, just a pretend technical artist |
00:46:12 | krux02 | well yea, OpenGL sandbox is for learning the OpenGL pipeline. |
00:46:28 | krux02 | After all it doesn't solve things for you, it just does the tedious parts for you. |
00:46:38 | krux02 | In the end you still write the engine and renderer yourself. |
00:49:32 | FromDiscord | <ElegantBeef> If i ever actually try to implement my silly 3D framework idea i might give it a whirl |
00:55:28 | * | Tanger quit (Quit: Leaving) |
01:13:09 | * | njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
01:13:32 | * | njoseph joined #nim |
01:25:08 | FromDiscord | <ajusa> I'm trying to create a 2D array in Nim but I'm failing somehow...↵https://play.nim-lang.org/#ix=2PNz↵Could someone tell me what I'm doing wrong? I thought I followed the tutorial pretty closely for this |
01:26:14 | FromDiscord | <ElegantBeef> Nim doesnt support floats without a leading value |
01:26:21 | FromDiscord | <ElegantBeef> `0.25` is valid `.25` isnt |
01:26:29 | FromDiscord | <ElegantBeef> So it's parsing it as `[.` |
01:27:16 | FromDiscord | <ElegantBeef> Secondly the `0` started arrays will complain that they're integers you want to do `0f64` |
01:27:29 | FromDiscord | <ElegantBeef> thirdly your arrays have a length of 4 and you declare them saying they're length of 3 |
01:28:08 | FromDiscord | <ajusa> ah yes, I did notice the last one. |
01:28:09 | FromDiscord | <ElegantBeef> Finally you can just do this https://play.nim-lang.org/#ix=2PNB |
01:28:44 | FromDiscord | <ajusa> thanks! I forgot how float literals were handled in nim, I though the error message was related to the way I had declared the arrays |
01:29:48 | * | Tanger joined #nim |
01:29:54 | FromDiscord | <ElegantBeef> No problem, you gave me a problem that was easy to resolve 😛 |
01:30:32 | * | abm quit (Quit: Leaving) |
01:51:47 | FromDiscord | <バロザード> does nico have 3d support? |
01:52:15 | Prestige | nah |
01:52:30 | FromDiscord | <バロザード> ugh |
01:52:45 | FromDiscord | <バロザード> well if i do decide to use it i guess i could just do prerendered 3d sprites |
01:52:50 | Prestige | Not yet, anyway. It looks like it's planned in the readme |
01:53:45 | FromDiscord | <バロザード> oof and it doesnt have webrtc support yet |
01:53:57 | FromDiscord | <バロザード> welp, it sounds cool enough to do a game jam in or something |
01:54:19 | Prestige | Yeah - have you seen any of the games made with it? They are pretty cool |
01:57:47 | FromDiscord | <ElegantBeef> Impbox used webtrc for a project aswell |
01:58:27 | FromDiscord | <ElegantBeef> Or websockets, dont recall if that's apart of rtc |
01:59:05 | * | asdflkj_ quit (Ping timeout: 240 seconds) |
02:03:24 | * | Cthalupa quit (Ping timeout: 265 seconds) |
02:05:12 | * | Cthalupa joined #nim |
02:18:32 | FromDiscord | <exelotl> Is there a way to give an array a size but also have it be unchecked? |
02:21:29 | FromDiscord | <exelotl> I'm wrapping a 2D array from C which should either by accessed like arr[0..1][0..512] or arr[0][0..1023] |
02:22:32 | FromDiscord | <exelotl> Probably best to make 2 vars for it I guess |
02:27:53 | FromDiscord | <ElegantBeef> Just use a 1D array size of `1024` and have a `[]` and `[,]` operator? |
02:32:49 | * | krux02 quit (Remote host closed the connection) |
02:47:54 | FromDiscord | <exelotl> Hmm that's a neat idea, but I'd like to still be able to use arr[0] to refer to the entire block of 512 tiles |
02:48:16 | FromDiscord | <slymilano> New Nimlings up for `assignments` and `if conditionals`! https://github.com/sergiotapia/nimlings/blob/master/src/exercises/exercise_02_assignments.nim |
02:48:28 | FromDiscord | <exelotl> (edit) "Hmm that's a neat idea, but I'd like to still be able to use arr[0] ... toan" added "or 1" | "the" => "an" |
02:51:40 | FromDiscord | <ElegantBeef> Sly you should use the RST more so you can gen docs to go with this 😄 |
02:52:19 | FromDiscord | <ElegantBeef> Stuff like this from the `net` module https://github.com/nim-lang/Nim/blob/version-1-4/lib/pure/net.nim#L38 |
02:52:47 | FromDiscord | <slymilano> hol' up - so Nim has something like Elixir's exdocs called RST? Where's a link to find more? |
02:52:49 | FromDiscord | <ElegantBeef> Which generates https://nim-lang.org/docs/net.html#examples |
02:54:00 | FromDiscord | <exelotl> @slymilano its restructuredText, which is the same markup that Python uses for docs too |
02:54:24 | FromDiscord | <flywind> the docs https://nim-lang.github.io/Nim/rst.html |
02:54:52 | FromDiscord | <Anonymous Poet> sent a code paste, see https://play.nim-lang.org/#ix=2PNY |
02:54:52 | FromDiscord | <exelotl> Oh neat I didn't know we had docs for that |
02:55:27 | * | nickster1 joined #nim |
02:55:44 | FromDiscord | <slymilano> Awesome thanks for the suggestion this is helpful! |
02:55:45 | FromDiscord | <slymilano> https://nim-lang.github.io/Nim/docgen.html |
02:55:49 | FromDiscord | <ElegantBeef> poet i think this is a limitation of the current variants you cannot share names like that so you have to use wrappers for it |
02:55:54 | FromDiscord | <ElegantBeef> No problem, glad i can help 😛 |
02:56:29 | * | grobe0ba_ joined #nim |
02:56:54 | FromDiscord | <Anonymous Poet> is there a way to forward declare `kind`? so I can use it in multiple case statements? |
02:57:39 | FromDiscord | <exelotl> You could make a getter/setter proc which selects the correct field based on the current kind. But maybe there would be a performance hit there |
02:58:02 | FromDiscord | <ElegantBeef> Well if they're the same type you could use a template to make it 0-cost |
02:58:08 | FromDiscord | <ElegantBeef> Actually nvm |
02:58:12 | FromDiscord | <ElegantBeef> Runtime 😄 |
02:58:21 | FromDiscord | <Anonymous Poet> i just want nice case classes :/ |
02:58:35 | FromDiscord | <Anonymous Poet> performance in this case is less important |
02:59:05 | * | jxy_ joined #nim |
02:59:16 | * | astronavt___ joined #nim |
02:59:33 | * | nickster quit (Write error: Connection reset by peer) |
02:59:33 | * | grobe0ba quit (Ping timeout: 240 seconds) |
02:59:33 | * | jxy quit (Ping timeout: 240 seconds) |
02:59:34 | * | astronavt quit (Ping timeout: 240 seconds) |
02:59:34 | * | clemens3 quit (Ping timeout: 240 seconds) |
02:59:34 | * | kitech1 quit (Quit: ZNC 1.7.5 - https://znc.in) |
02:59:34 | * | nickster1 is now known as nickster |
02:59:34 | * | grobe0ba_ is now known as grobe0ba |
02:59:47 | * | kitech1 joined #nim |
03:00:36 | FromDiscord | <exelotl> Another option: Make foo exist for all cases, but don't export it. Export a getter which asserts that the kind is valid |
03:01:38 | FromDiscord | <Anonymous Poet> sent a code paste, see https://play.nim-lang.org/#ix=2PO4 |
03:01:55 | FromDiscord | <ElegantBeef> It should |
03:02:02 | FromDiscord | <Anonymous Poet> (edit) "https://play.nim-lang.org/#ix=2PO4" => "https://play.nim-lang.org/#ix=2PO5" |
03:02:13 | FromDiscord | <ElegantBeef> I believe you can have multiple discriminators |
03:02:43 | FromDiscord | <Anonymous Poet> hmm, that might also be more representative actually, let me play around with that a bit |
03:02:43 | FromDiscord | <Anonymous Poet> thanks |
03:04:17 | FromDiscord | <ElegantBeef> There is this rfc which is planned to be implemented, so impatiently wait for it https://github.com/nim-lang/RFCs/issues/19 |
03:10:55 | FromDiscord | <Anonymous Poet> haha, i love nim, but it definitely still needs a few more years to grow into its own |
03:11:17 | FromDiscord | <Anonymous Poet> btw, is it currently known that the compiler doesn't complain if you use a wrong property name in a case? |
03:13:00 | FromDiscord | <Anonymous Poet> sent a code paste, see https://play.nim-lang.org/#ix=2PO8 |
03:15:21 | FromDiscord | <ElegantBeef> Invalid field access on variants is a runtime error |
03:16:03 | FromDiscord | <ElegantBeef> Though static analysis should be able to stop compilation |
03:20:49 | FromDiscord | <Anonymous Poet> this seems like it should be verifiable at compile time :/ |
03:21:51 | FromDiscord | <ElegantBeef> Yea it's pretty much verifiable whenever the discriminator is checked |
03:24:11 | FromDiscord | <Anonymous Poet> 😦 |
03:26:09 | * | clemens3 joined #nim |
03:28:29 | FromDiscord | <ElegantBeef> Can always be come a compiler contributor and add add that checking 😛 |
03:28:45 | FromDiscord | <ElegantBeef> I've only briefly looked at the compiler and then quickly ran away |
03:35:35 | FromDiscord | <Seedofarson> Yoooo |
03:35:39 | FromDiscord | <Seedofarson> So |
03:35:43 | FromDiscord | <Seedofarson> I was sitting here |
03:35:47 | FromDiscord | <Seedofarson> Bored with python |
03:36:07 | FromDiscord | <Seedofarson> And that’s how I got here |
03:36:09 | FromDiscord | <Seedofarson> The end |
03:36:38 | FromDiscord | <ElegantBeef> Hello |
03:36:39 | FromDiscord | <Seedofarson> This seems like the love child of node.JS and python |
03:36:45 | FromDiscord | <ElegantBeef> Uhh |
03:38:27 | FromDiscord | <ElegantBeef> Why does it seem like a child of nodejs? |
03:44:16 | FromDiscord | <Seedofarson> Idk |
03:44:21 | FromDiscord | <Seedofarson> Some similar elements |
03:44:28 | FromDiscord | <Seedofarson> anyways |
03:44:30 | FromDiscord | <Seedofarson> I need help |
03:44:38 | FromDiscord | <Seedofarson> is there any good http client for nim yet? |
03:44:57 | FromDiscord | <Seedofarson> is there a curl to nim http client thing or do you have to manually define your request? |
03:45:01 | FromDiscord | <ElegantBeef> https://nim-lang.org/docs/httpclient.html |
03:45:41 | FromDiscord | <ElegantBeef> There is a download file procedure in there |
03:50:48 | FromDiscord | <Seedofarson> is there a curl to nim http client thing or do you have to manually define your request? |
03:57:49 | FromDiscord | <ElegantBeef> The link provided shows a httpclient which can make requests |
03:59:26 | * | Gustavo6046 quit (Ping timeout: 264 seconds) |
04:00:24 | FromDiscord | <Seedofarson> Uh |
04:00:24 | FromDiscord | <Seedofarson> Okay |
04:05:27 | FromDiscord | <Seedofarson> But |
04:05:35 | FromDiscord | <Seedofarson> Do I have to manually piece it together |
04:06:18 | FromDiscord | <Seedofarson> Or is there a way to copy a request from the networking tab on chrome(usually cURL) and have it transformed into Nim httpclient |
04:09:45 | FromDiscord | <hamidb80> hey everyone |
04:10:31 | FromDiscord | <hamidb80> i heard about NimScript but i don't know how to use it |
04:10:40 | FromDiscord | <ElegantBeef> What do you need it for? |
04:12:13 | FromDiscord | <hamidb80> In reply to @ElegantBeef "What do you need": i saw somewhere that it can run without compiling ( i think it's something like python since it can executed in VM |
04:12:19 | FromDiscord | <ElegantBeef> Yep |
04:12:38 | FromDiscord | <ElegantBeef> On linux you can just use a shebang and it'll run in nim |
04:12:54 | FromDiscord | <ElegantBeef> Otherwise you do `nim e ./your.nims` |
04:13:15 | FromDiscord | <ElegantBeef> Due to the compiler not being built with `libffi` it's somewhat limited atm |
04:14:41 | FromDiscord | <hamidb80> is there any information about how it works? |
04:15:02 | FromDiscord | <ElegantBeef> https://nim-lang.org/docs/nims.html |
04:15:08 | FromDiscord | <hamidb80> tnx |
04:17:27 | FromDiscord | <hamidb80> just imagine how cool it can be |
04:18:28 | FromDiscord | <apollo> how do i use nim in interpration mode again? |
04:18:29 | FromDiscord | <ElegantBeef> I did also work on something to rather easily interop with the VM |
04:18:35 | FromDiscord | <apollo> i rember setting an environment variable for it |
04:18:37 | FromDiscord | <apollo> but i lost it |
04:18:46 | FromDiscord | <apollo> (edit) "environment variable" => "alias" |
04:18:47 | FromDiscord | <ElegantBeef> `nim secret`? |
04:18:53 | FromDiscord | <apollo> yeah that |
04:18:55 | FromDiscord | <ElegantBeef> I suggest using inim for a repl |
04:19:23 | FromDiscord | <ElegantBeef> @hamidb80 if you want to use it in your binary checkout https://github.com/beef331/nimscripter |
04:22:15 | FromDiscord | <hamidb80> In reply to @ElegantBeef "<@!745944009918251010> if you want": thanks for video tutorial 😅 |
04:22:25 | FromDiscord | <ElegantBeef> It's somewhat outdated but the underlying logic is the same |
04:37:33 | * | spiderstew_ joined #nim |
04:40:07 | * | spiderstew quit (Ping timeout: 256 seconds) |
04:52:29 | * | kenran joined #nim |
05:13:16 | * | letto quit (Quit: Konversation terminated!) |
05:15:51 | * | letto joined #nim |
05:34:19 | * | haxscramper joined #nim |
05:38:58 | * | letto quit (Ping timeout: 265 seconds) |
05:39:40 | * | letto joined #nim |
05:40:03 | FromDiscord | <hamidb80> i want to interact with terminal in Nim but some words seems unfamiliar to me (e.g. buffer, flush, ...),↵what should i search for in order to get information about it? |
05:41:45 | FromDiscord | <ElegantBeef> Due to how stdout works that's overlap with how files work at low level. |
05:50:49 | * | njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
05:50:57 | * | njoseph joined #nim |
06:01:10 | * | vicfred quit (Quit: Leaving) |
06:21:07 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
06:41:19 | * | narimiran joined #nim |
07:13:55 | * | kenran quit (Quit: leaving) |
07:18:30 | * | filcuc_ joined #nim |
07:44:16 | FromDiscord | <Solitude> In reply to @Seedofarson "This seems like the": is this an insult? |
07:44:24 | * | Tlangir joined #nim |
07:44:36 | FromDiscord | <ElegantBeef> Considering nodejs is a js runtime i'm still confusued what that implies |
07:46:45 | * | Tanger quit (Ping timeout: 240 seconds) |
07:46:45 | * | Q-Master quit (Read error: Connection reset by peer) |
07:47:07 | * | Q-Master joined #nim |
07:49:28 | * | Tlanger joined #nim |
07:51:45 | * | Tlangir quit (Ping timeout: 240 seconds) |
07:58:44 | GreaseMonkey | honestly, to me, nim feels more like pascal, python and lisp decided to get together and have a baby |
07:59:49 | GreaseMonkey | ...and also double-downing on the type stuff because i think nim had generic types before python ended up with type annotations |
08:01:42 | FromDiscord | <ElegantBeef> Yea it's a very wirthy language |
08:02:27 | FromDiscord | <ElegantBeef> The type system is something, pmunch showed off the strength of generics in his fosdem talk 😄 |
08:03:40 | GreaseMonkey | if that's the latest FOSDEM then i think i saw the slides for that and honestly the main thing i remember was that it made use of staticLoad and also the generic `[]`/`[]=` methods for stuff stored in flash |
08:04:23 | FromDiscord | <ElegantBeef> Yea, he used `w, h` apart of the generic type but only to differentiate them |
08:05:04 | FromDiscord | <ElegantBeef> So you couldnt accidentally pass two differently sized sprites due to the type system saying "try again" at compile time |
08:12:58 | * | fosred joined #nim |
08:23:06 | * | PMunch joined #nim |
08:32:16 | PMunch | @Prestige, do you remember specifically what field it was this sent extra? https://github.com/neoclide/coc.nvim/issues/1766 |
08:35:17 | * | casaca quit (Ping timeout: 272 seconds) |
08:47:37 | * | Tlanger quit (Remote host closed the connection) |
08:48:59 | Oddmonger | can i do something like: var toto:ref Foo = ref foo # ? |
08:49:16 | Oddmonger | i know i can get a ptr with addr(foo) , but a ref ? |
08:49:37 | FromDiscord | <ElegantBeef> `new T` |
08:49:51 | Oddmonger | yes, for a new Foo |
08:49:58 | Oddmonger | but i want a ref on existing var |
08:50:07 | Oddmonger | ptr then ? |
08:52:17 | FromDiscord | <Rika> ref on existing var needs you to make a new ref and put the value inside |
08:52:23 | FromDiscord | <Rika> ptr is unsafe. |
08:52:45 | FromDiscord | <ElegantBeef> Or use the experimental view types, though if it's' read only `lent` is fine |
08:52:49 | Oddmonger | ok so using ref would be make a copy |
08:53:07 | Oddmonger | ah didn't knew lent |
08:53:13 | Oddmonger | thank for the pointers :) |
08:53:19 | FromDiscord | <Rika> everything is a copy, its just a matter of what is copied |
08:54:24 | FromDiscord | <ElegantBeef> Experimental like i said, but with arc/orc they're rather usable if you want safely borrow https://nim-lang.org/docs/manual_experimental.html#view-types |
08:58:49 | Oddmonger | i look |
09:00:07 | FromDiscord | <Rika> neuron activation |
09:00:11 | * | awici[m] quit (Quit: Idle for 30+ days) |
09:01:22 | Clonkk[m] | <Oddmonger "ok so using ref would be make a "> Obtaining a ref from a value without safety check would be dangerous code as you could pass a reference to a stack value that goes out of scope. That's why you need either to work with a ref from the beginning, copy the memory, or have syntax to safely borrow memory |
09:01:57 | FromDiscord | <ElegantBeef> Danglers are dangerous tools 😉 |
09:02:09 | * | krux02 joined #nim |
09:02:10 | * | krux02_ joined #nim |
09:02:24 | * | krux02_ quit (Remote host closed the connection) |
09:02:35 | FromDiscord | <Rika> lewd |
09:04:36 | Clonkk[m] | <FromDiscord "<ElegantBeef> Danglers are dange"> Yeah they have to be handled with care or risk exploding to your face. |
09:05:40 | FromDiscord | <ElegantBeef> Pst rika, say the line |
09:06:17 | * | casaca joined #nim |
09:09:50 | Oddmonger | i think my big mistake has been to believe « var shortcut = foo[0].data » was creating a ref on foo[0].data |
09:10:09 | Oddmonger | no wonder why i hog cpu |
09:10:10 | FromDiscord | <ElegantBeef> Oh there is also `{.byaddr.}` |
09:10:27 | Oddmonger | oh |
09:10:36 | Oddmonger | wunderbar :) |
09:14:19 | Oddmonger | maybe i have read a bit fast |
09:14:55 | Oddmonger | var data = addr(foo[0].data) <=?=> var data {.byaddr.} = foo[0].data |
09:16:04 | FromDiscord | <ElegantBeef> Well i think you can use byaddr on `foo[0]` but not the data value |
09:16:11 | FromDiscord | <ElegantBeef> though i'm uncertain |
09:17:11 | FromDiscord | <ElegantBeef> Actually nvm that should work i imagine |
09:23:55 | * | filcuc_ quit (Quit: KVIrc 5.0.0 Aria http://www.kvirc.net/) |
09:33:46 | FromDiscord | <Rika> In reply to @ElegantBeef "Pst rika, say the": what line xdddddddddd |
09:35:38 | FromDiscord | <ElegantBeef> Lewd! |
09:39:50 | FromDiscord | <mratsim> @Araq, I always though closure iterators worked on the JS backend. Is it the `{.goto.}` pragma that doesn't work on JS? |
09:40:38 | FromDiscord | <Clyybber> @ElegantBeef I think you need to rebase your PR to fix the js ci errors |
09:42:06 | PMunch | Hmm, is there a package that parses terminal input? Like special keys, Ctrl keys, and mouse clicks |
09:42:15 | FromDiscord | <ElegantBeef> Excuse me while i shout in a bag for about 20 minutes so i can say "Nope gotta sleep" 😛 |
09:42:33 | PMunch | Huh? |
09:42:56 | FromDiscord | <ElegantBeef> That was in response to clyybber telling me i need to rebase |
09:42:59 | FromDiscord | <Clyybber> lol |
09:43:19 | FromDiscord | <ElegantBeef> I mean i can only think of ncurses like stuff that does that, so illwill? |
09:44:07 | FromDiscord | <Clyybber> In reply to @PMunch "Hmm, is there a": illwill does, and my library ternim |
09:44:22 | PMunch | @Clyybber, illwill does a bit more though.. |
09:44:48 | FromDiscord | <Clyybber> can just copy the input handling code over |
09:44:48 | FromDiscord | <Clyybber> or only use the input handling code |
09:45:23 | * | NimBot joined #nim |
09:45:27 | FromDiscord | <Clyybber> hey, I just uploaded it so that I dont forget it ;D |
09:45:30 | FromDiscord | <ElegantBeef> https://github.com/Clyybber/ternim linky do |
09:46:01 | FromDiscord | <Clyybber> no docs |
09:46:01 | PMunch | Hmm, I guess I could use illwill without any of the drawing tuff |
09:46:03 | PMunch | stuff* |
09:46:26 | FromDiscord | <Clyybber> oh yeah as opposed to ternim illwill also handles mouse input |
09:46:37 | FromDiscord | <Clyybber> and works on windows I think |
09:46:51 | PMunch | Yeah it's cross-platform |
09:46:55 | FromDiscord | <ElegantBeef> Ternim is just a better abstraction over terminal for posix systems? |
09:47:09 | FromDiscord | <ElegantBeef> Do you have a `getCursorPos`? 😛 |
09:47:19 | FromDiscord | <Clyybber> nah |
09:48:11 | FromDiscord | <Clyybber> I should get to my pc so I can actually type without correcting 500 typos a minute |
09:51:23 | FromDiscord | <Clyybber> In reply to @ElegantBeef "Ternim is just a": it's tailored to games or fullscreen applications |
09:51:30 | FromDiscord | <Clyybber> and there is no concept of a cursor |
09:52:06 | FromDiscord | <ElegantBeef> encouraging ascii games, shame thought i liked you |
09:52:10 | FromDiscord | <Clyybber> :p |
09:52:15 | PMunch | Hmm, illwill doesn't give me mouse events for some reason (even after turning mouse=true) |
09:52:21 | PMunch | But apart from that it seems to work |
09:52:32 | FromDiscord | <Clyybber> PMunch: Are you calling illwillInit? |
09:52:46 | PMunch | Ye |
09:53:07 | FromDiscord | <Clyybber> hmm, maybe it only works in fullscreen mode? |
09:53:08 | PMunch | I'm just doing this: http://ix.io/2PPA |
09:53:38 | PMunch | Doesn't seem to work fullscreen either |
09:53:41 | FromDiscord | <Clyybber> smh, coding the playground and then not using it :p |
09:54:01 | FromDiscord | <Clyybber> huh, maybe your terminal doesn't send the sequences that illwill expects |
09:54:02 | PMunch | I have a keyboard shortcut for pasting to ix.io :P |
09:54:30 | PMunch | Besides, you can always just do play.nim-lang.org/#ix=2PPA |
09:55:04 | FromDiscord | <Clyybber> yeah :) |
09:56:43 | * | Vladar joined #nim |
10:01:46 | krux02 | PMunch, I do have that as well. |
10:01:55 | krux02 | that ix.io shortcut. |
10:02:20 | PMunch | It's pretty handy :) |
10:02:36 | krux02 | yes |
10:02:48 | krux02 | But generally I would prefer if I would not need it. |
10:03:30 | FromDiscord | <ElegantBeef> Just give this chat your ssh credientials so you dont need to anymore |
10:04:05 | krux02 | maybe I should use IRC within emacs as well, so that I can open ix.io links in a new buffer as well |
10:04:31 | krux02 | @ElegantBeef: what do you mean |
10:04:54 | krux02 | I am on IRC not on discord. |
10:04:58 | FromDiscord | <ElegantBeef> Well you said you preferred not needing the ix.io shortcut, so if we could ssh into your computer you wouldnt need it 😄 |
10:05:20 | krux02 | I don't see how that solves anything |
10:05:31 | krux02 | I use ix.io mostly for chat |
10:05:37 | krux02 | to send code listings |
10:05:40 | FromDiscord | <ElegantBeef> It lets me make a joke about sharing ssh access with thousands of people |
10:05:55 | krux02 | I would prefer if the chat programs support code listings on their own. |
10:06:26 | krux02 | Preferably behind a spoiler, but without indirciton. |
10:06:44 | krux02 | yea |
10:06:53 | krux02 | I don't expect everybody to have ssh. |
10:07:04 | krux02 | I don't expect everybody to have even just sh |
10:07:12 | krux02 | even though they should |
10:08:03 | PMunch | It would certainly be cool to have an IRC client that could read code-listing links automatically |
10:08:31 | krux02 | Well I have emacs. |
10:08:42 | PMunch | Sure, but then you need to use emacs |
10:08:43 | krux02 | I could teach emacs to do that |
10:08:48 | krux02 | yes |
10:08:53 | krux02 | I use it anyway. |
10:09:02 | PMunch | Ah, well in that case |
10:09:02 | krux02 | even thoguh I really don't like that it is so slow |
10:09:13 | PMunch | Slow? |
10:09:31 | krux02 | i managed to get it fast in Nim, but currently I use it for c++ and it is everything but responsive. |
10:09:55 | krux02 | When I type a character it should appear on screnn before I release the key |
10:10:28 | krux02 | if that does(.t happen I want to punch the author who wrote that software that made me wait |
10:11:09 | FromDiscord | <ElegantBeef> Ah make them as non-responsive as their code |
10:11:13 | PMunch | Oh wow, it's that slow |
10:11:21 | FromDiscord | <ElegantBeef> Probably as fast as me |
10:11:52 | FromDiscord | <ElegantBeef> Well i'm going so you guys get fewer shitty jokes, cheers |
10:16:58 | * | SebastianM joined #nim |
10:17:10 | FromDiscord | <Clyybber> cheers |
10:28:01 | * | SebastianM quit (Quit: -a- IRC for Android 2.1.59) |
10:28:55 | * | abm joined #nim |
10:34:10 | * | gmaggior joined #nim |
10:35:09 | * | gmaggior quit (Client Quit) |
10:36:37 | sekao[m] | Anyone using emscripten? nimgl supports it as of today :D https://github.com/nimgl/nimgl |
10:37:33 | sekao[m] | There may still be a lingering issue with ARC when using emscripten tho. I reported it here https://github.com/nim-lang/Nim/issues/17026 |
10:38:09 | * | krux02 quit (Ping timeout: 272 seconds) |
10:42:12 | FromDiscord | <hamidb80> https://media.discordapp.net/attachments/371759389889003532/811910429575217202/Screenshot_at_2021-02-18_14-10-20.png |
10:42:42 | FromDiscord | <hamidb80> why using global variable is not GC safe? |
10:44:24 | PMunch | Not with the default GC |
10:44:28 | PMunch | But gcsafe is mostly used for threading |
10:44:41 | FromDiscord | <hamidb80> In reply to @PMunch "Not with the default": what should i do? |
10:44:53 | PMunch | global variables aren't GC-safe because they are managed by the main thread of your program |
10:45:05 | PMunch | Remove you gcsafe pragma unless you actually need it? |
10:45:35 | FromDiscord | <hamidb80> In reply to @PMunch "Remove you gcsafe pragma": yes i need it because of async pragma |
10:46:11 | PMunch | Uhm, you do? |
10:48:10 | FromDiscord | <gollark> Is there something like strutils.replace but which takes a set of chars as an argument? I want to replace unsafe-in-filename characters in a string with underscores. |
10:48:21 | Oddmonger | Araq , can you tell me if {.byaddr.} is going to stay ? |
10:49:23 | Oddmonger | i find it so handy for references… far better than my previous var x:ptr z = addr(y) « references » |
10:49:45 | FromDiscord | <hamidb80> In reply to @PMunch "Uhm, you do?": if i remove `gcsafe` pragma https://media.discordapp.net/attachments/371759389889003532/811912328802074674/Screenshot_at_2021-02-18_14-18-27.png |
10:51:24 | * | NimBot joined #nim |
10:51:30 | PMunch | I guess you could use --gc:arc or --gc:orc |
10:52:20 | FromDiscord | <hamidb80> In reply to @PMunch "I guess you could": does it make problem if i ignore the `GC-unsafe2` warning? |
10:52:23 | FromDiscord | <hamidb80> (edit) "warning?" => "warnings?" |
10:53:46 | FromDiscord | <hamidb80> did you suggest any article about it? |
10:54:05 | FromDiscord | <hamidb80> (edit) "did" => "could" |
10:55:42 | PMunch | Hmm, I don't think so |
10:55:58 | PMunch | And I don't really have any articles on async. |
10:56:14 | PMunch | Do have one that is almost ready to publish though, but it doesn't mention this |
10:56:36 | FromDiscord | <hamidb80> tnx |
10:59:39 | FromDiscord | <hamidb80> @PMunch i heard you had a speech at FOSDEM, |
11:00:00 | PMunch | Indeed |
11:00:44 | PMunch | https://www.youtube.com/watch?v=j0fUqdYC71k |
11:01:29 | FromDiscord | <enimatek> is `ref object of RootObj` the same as just using `ref object` since not using the of doesnt seem to really have any impact and i see different uses in codebases |
11:02:36 | FromDiscord | <enimatek> (edit) "is `ref object of RootObj` the same as just using `ref object` ... since" added "?" |
11:06:00 | PMunch | @enimatek, `of RootObj` is only needed if you need inheritance |
11:06:42 | * | krux02 joined #nim |
11:06:43 | * | krux02_ joined #nim |
11:08:55 | FromDiscord | <enimatek> ah ok, so also the method keyword (over proc) and of RootObj are more related to using inheritance |
11:09:21 | * | krux02_ quit (Client Quit) |
11:09:35 | PMunch | Yes, exactly |
11:11:42 | krux02 | enimatek, it certainly needs some getting used to, but Nim is one of the few new languages that doesn't embrace OO design patterns. It implements them, you can use them if you want to use them. But it doesn't encourage you to do so. |
11:12:06 | FromDiscord | <enimatek> but for my understanding, in eg. Java or C# all classes are inheritable, you could abstract them or interface them, but in nim does this mean by default using of RootObj has an impact on the performance ? or to be 'safe' (eg. later on you suddenly want to extend one of your objects) you can just use it by default? |
11:12:54 | krux02 | if you want to use inheritance there is no problem to add `of RootObj` to your definition |
11:13:04 | krux02 | but you should not defensively put it everywhere |
11:13:15 | FromDiscord | <mratsim> In reply to @enimatek "but for my understanding,": classes require extra runtime type information which makes the object slightly bigger and require slightly more initialization. |
11:13:24 | FromDiscord | <mratsim> this is true in Java, C++ and Nim |
11:13:35 | PMunch | Well, don't think of it as adding RootObj impacts performance. Think of it as Nim being able to optimise further than languages that don't allow you to have non-inheritable objects. |
11:13:40 | FromDiscord | <mratsim> in practice unless you write very cache sensitive code it doesn't matter |
11:13:45 | krux02 | of RootObj adds an object header to your type, similar to the vtable pointer in c++ if you use virtual functions |
11:14:08 | FromDiscord | <mratsim> when I say slight, it's 8 bytes. |
11:14:18 | FromDiscord | <enimatek> ok thanks! makes it more clear, also its not that hard to add the 'of RootObj' later if needed |
11:14:29 | krux02 | yes |
11:14:57 | krux02 | and you only need 'of RootObj' if you want to use polymorphic inheritance |
11:15:31 | PMunch | By default objects in Nim are pretty much the same thing as a struct in C if you are familiar with those. It's just a collection of values. If you want to extend an object that doesn't have `of RootObj` on it you can also simply wrap that object within your object and have accessor templates to it. |
11:16:28 | krux02 | if you are used to Java or C#, not having to put functions into classes might make you feel releaved. Finally you can put your functions where you want them to be. |
11:18:35 | FromDiscord | <enimatek> hmja in java 'we' luckly have lombok that makes a more 'structs' like syntax, think java 15 or 16 will have this by default |
11:19:26 | FromDiscord | <enimatek> but my younger inner self still has nightmares of codebases that contain 90% getters and setters code |
11:21:09 | PMunch | I currently have to implement some stuff in C#, so much code that doesn't actually do anything |
11:21:22 | PMunch | Well, it does something, just not anything useful |
11:27:58 | krux02 | enimatek: it seems like java adopts more and more scala features one by one. |
11:28:51 | krux02 | scala has these case objects. They look like a struct. They feel like a struct. But they have the overhead of a full blown java object. |
11:31:47 | FromDiscord | <enimatek> yea also kotlin is a jvm language that you see doing this |
11:39:32 | FromDiscord | <konsumlamm> case objects aren't really supposed to be structs though, their main purpose is for ADTs to allow pattern matching and for "data classes" (classes with less boilerplate) |
11:55:31 | * | tane joined #nim |
12:11:27 | FromDiscord | <haxscramper> Pattern matching was added way after case objects, and I've always though of them as a way of conditionally hide fields rather than nim's ADT |
12:11:42 | FromDiscord | <haxscramper> Though they work for ADT as well |
12:11:49 | krux02 | ADT? |
12:12:12 | FromDiscord | <haxscramper> https://en.wikipedia.org/wiki/Algebraic_data_type |
12:12:15 | FromDiscord | <hamidb80> In reply to @krux02 "ADT?": krux, did you get unnbanned ? |
12:12:45 | krux02 | let me check |
12:14:14 | FromDiscord | <haxscramper> IIRC case objects in ALGOL have almost the same syntax as NIM |
12:14:26 | PMunch | Where you banned? |
12:14:51 | PMunch | Were* |
12:15:02 | krux02 | I am still banned on github.com/nim-lang |
12:16:00 | FromDiscord | <konsumlamm> In reply to @haxscramper "Pattern matching was added": i was talking about scalas case classes |
12:16:33 | * | JustASlacker joined #nim |
12:16:45 | JustASlacker | hello peoples of #nim |
12:16:53 | JustASlacker | is there some way to read/write ical files |
12:17:11 | PMunch | @haxscramper, I think @konsulam, was referring to case objects in Scala |
12:17:18 | PMunch | JustASlacker, yes |
12:17:23 | JustASlacker | \o/ |
12:18:46 | JustASlacker | PMunch: what would you suggest |
12:18:59 | PMunch | No idea :P |
12:19:11 | PMunch | But it's certainly possible to read them |
12:19:21 | PMunch | And write them |
12:19:27 | PMunch | What kind of format is iCal? |
12:19:59 | JustASlacker | https://en.wikipedia.org/wiki/ICalendar |
12:20:30 | JustASlacker | https://pypi.org/project/icalendar/ |
12:21:07 | krux02 | PMunch, here in https://github.com/nim-lang/RFCs/issues/338 issue I commented this |
12:21:09 | krux02 | http://ix.io/2OXN |
12:21:17 | krux02 | it was deleted and I got banned for it |
12:21:55 | FromGitter | <Araq> you bot banned for more than just this but you know it and you will simply repeat the lies |
12:22:37 | krux02 | I was away for severl months. Didn't post anything. |
12:22:46 | krux02 | I came back and you immediately banned me |
12:23:01 | JustASlacker | I guess I can cobble something together to ical all the things |
12:23:15 | JustASlacker | what if I want to make a package out of it so others can abuse it? |
12:23:22 | JustASlacker | Is there a doc for that |
12:23:27 | JustASlacker | writing packages I mean |
12:24:19 | FromDiscord | <Solitude> https://github.com/nim-lang/nimble#nimble-reference |
12:25:12 | PMunch | `nimble init` should give you mostly everything you need |
12:26:05 | PMunch | Is iCal a binary format? Or based on XML or something? |
12:26:29 | PMunch | krux02, ah that thing.. |
12:26:29 | krux02 | Two bans of People who contributed a lot to the Nim programming language in just two weeks. I think there is someone too sensitive. |
12:26:30 | JustASlacker | text based but not strict xml |
12:27:37 | PMunch | Hmm, so npeg might be able to help? |
12:28:29 | JustASlacker | https://termbin.com/eb06 |
12:28:36 | JustASlacker | looks like cobol ^_^ |
12:28:56 | JustASlacker | hrm, it might |
12:29:07 | JustASlacker | might be overkill |
12:29:09 | krux02 | I mean it is not too bad that I got banned on github. I mean you don't listen to what I say anyway, the ban just makes that part official. |
12:29:42 | PMunch | JustASlacker, nah that looks like a good match for npeg |
12:29:57 | PMunch | I mean you could also split on : it seems |
12:31:32 | ForumUpdaterBot | New thread by Halloleo: "Error: unable to set ODBC driver version." with db-odbc, see https://forum.nim-lang.org/t/7525 |
12:32:12 | JustASlacker | I'll take a look at npeg |
12:38:27 | * | abm quit (Ping timeout: 260 seconds) |
12:38:45 | * | abm joined #nim |
12:43:15 | * | NimBot joined #nim |
12:47:03 | JustASlacker | Is there a npeg for dummies article somewhere |
12:51:56 | PMunch | Apart from the documentation? https://github.com/zevv/npeg#quickstart |
12:53:36 | PMunch | You could also look through my AoC videos to see how I use it: https://www.youtube.com/watch?v=TrxyCNdI0bw&list=PL9Yd0XwsGAqzeDak6qtp6hQ4m7Qo_XA_4 |
12:53:42 | PMunch | I explain a bit in there about what I'm doing |
12:55:24 | * | lritter joined #nim |
13:07:32 | FromDiscord | <BlockListed> Hi guys does anyone know how to execute a command / program from a Nim program? I thought it would be in the os module documentation, but I couldn't find anything about it? |
13:07:59 | liblq-dev | https://nim-lang.org/docs/osproc.html |
13:08:24 | liblq-dev | @BlockListed more specifically, https://nim-lang.org/docs/osproc.html#execProcess%2Cstring%2Cstring%2CopenArray%5Bstring%5D%2CStringTableRef%2Cset%5BProcessOption%5D |
13:08:30 | liblq-dev | gosh these doc URLs suck |
13:08:37 | FromDiscord | <BlockListed> Thanks so much |
13:09:21 | krux02 | Oddmonger, I wasnt aware you can put byaddr tag on local variables. |
13:09:51 | krux02 | And I just realized I was way too far in the past the this comment is very out of context :P |
13:09:53 | krux02 | sorry |
13:13:27 | JustASlacker | PMunch: noice |
13:29:34 | * | abm quit (Quit: Leaving) |
13:33:02 | * | NimBot joined #nim |
13:40:11 | FromDiscord | <hamidb80> https://www.youtube.com/watch?v=DmYOPkI_LzU |
13:43:02 | FromDiscord | <zetashift> @treeform I need a library to draw some simple shapes, mostly lines from `(x1, y2)` to `(x2, y2)`, should I use `flippy` or `pixie`? |
13:43:49 | Oddmonger | krux02: i have read all the backlog since my question about {.byaddr.} , but i don't see why you are sorry ^^' |
13:44:03 | Oddmonger | did you replied to me and i've missed something ? |
13:44:30 | krux02 | yes I did reply to you |
13:44:35 | krux02 | but it is not really important |
13:45:12 | krux02 | if you don't rememeber it is probably not important |
14:08:53 | Prestige | PMunch: Nah I don't remember |
14:09:04 | PMunch | Hmm, damn it.. |
14:09:23 | Prestige | I mean PMunch you could disallow extra fields again and try I suppose |
14:09:28 | Prestige | would find out rather quickly |
14:09:47 | PMunch | I wanted to leave a comment on that saying they should fix their client. But I wanted to make sure that it hadn't been added to the spec |
14:10:19 | PMunch | It is disallowed again, because it was messing with other stuff |
14:10:42 | Prestige | hm shouldn't it be breaking my client then? |
14:11:54 | PMunch | Only if you've updated :P |
14:12:03 | Prestige | I have, so maybe they fixed the issue |
14:12:11 | PMunch | Hmm, could be |
14:12:17 | PMunch | When did you last update? |
14:12:27 | Prestige | like 2 weeks ago I think |
14:12:58 | Prestige | Also, is there any progress on not having to restart the langserver when I make changes across files? |
14:13:00 | PMunch | Oh that is definitely the new version |
14:13:14 | PMunch | I made the reversal on the 18th of November.. https://github.com/PMunch/nimlsp/commit/f6f29360874e3bbd5566589610b53daad2fdd83f |
14:13:58 | PMunch | Not really, pretty sure that is a Nimsuggest bug |
14:14:11 | * | planetis[m] left #nim ("User left") |
14:14:21 | Prestige | aw :/ |
14:15:24 | Prestige | It's a really annoying workflow |
14:16:30 | PMunch | I know :( |
14:17:28 | Prestige | I thought we found out before it was an nimlsp issue of not finding the project file? |
14:18:11 | PMunch | Oh, did we? |
14:18:14 | PMunch | Hmm, crap |
14:20:10 | Prestige | Pretty sure. Idr why but it couldn't locate the *.nimble file |
14:20:29 | PMunch | So we should update the project finding code.. |
14:20:40 | PMunch | I thought there was something built into nimble nowadays |
14:20:42 | Prestige | or at least make sure that's the prob |
14:21:09 | Prestige | I'll be back in ~20 |
14:21:41 | FromDiscord | <Rika> Is there an http server that can do ssl in Nim? |
14:23:57 | PMunch | I thought HttpClient did nowadays, and probably by extension Jester? |
14:24:42 | PMunch | Hmm, maybe not |
14:25:35 | PMunch | The best thing is to run your Nim server behind a reverse proxy, which you probably should do anyways |
14:25:49 | FromDiscord | <Rika> Not possible |
14:25:59 | PMunch | Why not? |
14:26:15 | FromDiscord | <Rika> Let’s just say it isn’t |
14:29:16 | FromDiscord | <Rika> It’s not a great look in Nim when you have to tell everyone who wants a secure http server to put it behind nginx or so |
14:29:24 | FromDiscord | <Rika> For Nim |
14:29:32 | PMunch | Well, that's best practice for lots of web stuff |
14:29:42 | PMunch | Nginx/Apache have been battle tested for ages |
14:31:24 | FromDiscord | <Rika> So what do I do if I cannot use nginx or Apache? |
14:31:47 | PMunch | I think you'd have to roll your own.. |
14:31:54 | FromDiscord | <Rika> Go has options for that, Java too, probably Elixir and Rust and every other large language nowadays |
14:40:33 | PMunch | Hmm, there really isn't much of anything HTTPS related in Nim.. |
14:40:38 | * | qwr would probably try to combine rust and nim into single binary or maybe just use ocaml depending on other constraints. though creating server with plain openssl isn't also too hard, if you're somewhat familiar with it |
14:42:19 | FromDiscord | <zetashift> Doesn't httpClient work with ssl: https://nim-lang.org/docs/httpclient.html#sslslashtls-support ? |
14:42:30 | Prestige | PMunch: anyway, back but I'm at work. If I can help investigate the issue lmk |
14:42:35 | FromDiscord | <zetashift> oh thats client |
14:42:38 | FromDiscord | <zetashift> nvm I'm dumb haha |
14:43:40 | PMunch | Prestige, I'm at work as well. So not really looking into it right now |
14:43:50 | Prestige | Kk |
14:53:14 | * | Lord_Nightmare quit (Ping timeout: 256 seconds) |
14:55:58 | * | PMunch quit (Quit: leaving) |
15:15:27 | FromDiscord | <LITeralLANGuage9> Can I use a Makefile to compile my nim projects? Not nake, but a regular GNU Makefile. |
15:16:33 | oz | Yes. |
15:17:18 | FromDiscord | <LITeralLANGuage9> Does nim know where to continue if compilation ends early because of an error? Or would I be forced to restart from the beginning? |
15:17:58 | FromDiscord | <haxscramper> Compilation starts from the start each time, |
15:18:39 | oz | ... but nim has a build cache. |
15:18:40 | FromDiscord | <LITeralLANGuage9> Even if I used a Makefile, which for C/C++ knows how to continue where it left off? |
15:19:28 | FromDiscord | <haxscramper> In reply to @LITeralLANGuage9 "Even if I used": Nim compiler takes care of module dependencies itself, while C/C++ does not have a notion of "project" and instead reparses all code for each header file, compiles to `.o` and only then links |
15:19:46 | FromDiscord | <haxscramper> We do have build cache and IC is being worked on |
15:20:09 | FromDiscord | <haxscramper> But nim makefile would be just `main: nim c project.nim` |
15:20:56 | FromDiscord | <haxscramper> There is nothing else to put in there basically, since `nim c` would do all search/C codegen/linking etc. by itself anyway |
15:21:12 | FromDiscord | <haxscramper> module/dependency search |
15:21:49 | FromDiscord | <LITeralLANGuage9> I can use a Makefile to do different types of compilations. That's pretty convenient. |
15:23:14 | FromDiscord | <LITeralLANGuage9> Compared to having to write a shell script for unix and batch file for windows. |
15:24:50 | FromDiscord | <LITeralLANGuage9> Just to make sure I'm clear. Lets say I've been compiling for an hour and stopped due to an error. Nim would know that the hour was already compiled thanks to build cache and I won't have to compile that hour again? |
15:26:20 | FromDiscord | <haxscramper> it depends on what that hour was spent on |
15:26:50 | FromDiscord | <haxscramper> If it was mostly spent on C code/linking etc. then yes |
15:27:05 | FromDiscord | <konsumlamm> why do you want to use a Makefile in the first place? |
15:27:19 | FromDiscord | <LITeralLANGuage9> I like Makefiles. I'm very used to them and it just feels weird not using it. |
15:27:30 | FromDiscord | <haxscramper> But if it was a nim code that took that long (though you would really need to try and find something like that) then you probably need to start from scratch |
15:27:58 | FromDiscord | <LITeralLANGuage9> Does nim have the ability to only compile changed files? |
15:29:09 | FromDiscord | <haxscramper> I can't comment on IC status, but this is main (?) target feature for the next release IIRC |
15:29:22 | FromDiscord | <haxscramper> So in short - not now |
15:29:29 | FromDiscord | <haxscramper> not sure what about now |
15:30:31 | FromDiscord | <haxscramper> Though I don't think you should worry about compilation speed to much TBH, we can't do 5_000_000 sloc/sec, but I hardly ever found this be a major issue that I need to design my workflow around |
15:31:36 | * | waleee-cl joined #nim |
15:33:25 | FromDiscord | <exelotl> Nim compilation speed is pretty good even without IC. The generated C files won't be recompiled if they didn't change between builds |
15:34:46 | FromDiscord | <exelotl> But yes proper IC is coming Soon™️ |
15:37:44 | FromDiscord | <BlockListed> `var notifs: array = [{"title": "Meeting: 16:00", "time": "1613662536"}.toTable, "title": "Meeting: 16:00", "time": int"1613662234"}.toTable]` |
15:38:32 | Prestige | Missing a { BlockListed? |
15:38:46 | FromDiscord | <BlockListed> Didnt finish my message |
15:38:51 | FromDiscord | <BlockListed> sry |
15:41:22 | * | Lord_Nightmare joined #nim |
15:41:44 | * | filcuc joined #nim |
15:41:53 | FromDiscord | <BlockListed> sent a long message, see http://ix.io/2PRB |
15:42:17 | FromDiscord | <BlockListed> wait |
15:42:23 | FromDiscord | <BlockListed> I do be stupid |
15:42:30 | FromDiscord | <BlockListed> forgot that int statement |
15:42:47 | FromDiscord | <BlockListed> that didn't fix it tho |
15:42:49 | FromDiscord | <mratsim> `, "title"` |
15:42:55 | FromDiscord | <mratsim> after the comma |
15:43:00 | FromDiscord | <BlockListed> thanks so much |
15:43:02 | FromDiscord | <mratsim> something is missing |
15:43:09 | FromDiscord | <BlockListed> for some reason I can't read |
15:43:25 | FromDiscord | <mratsim> put those in 2 or 4 lines |
15:43:56 | FromDiscord | <mratsim> sent a code paste, see https://play.nim-lang.org/#ix=2PRE |
15:44:25 | FromDiscord | <mratsim> (edit) "https://paste.rs/Jod" => "https://play.nim-lang.org/#ix=2PRF" |
15:50:07 | * | lkjasdf joined #nim |
15:50:42 | FromDiscord | <BlockListed> Thanks it's only for testing anyway, because the final program will get the data from a json file |
15:51:08 | FromDiscord | <BlockListed> Also how do I use ints in tables or convert ints to strings |
15:51:25 | FromDiscord | <kaletaa> $var |
15:51:29 | FromDiscord | <kaletaa> to convert it to a string |
15:51:46 | FromDiscord | <BlockListed> Thanks so much |
15:53:21 | * | vicfred joined #nim |
15:53:52 | * | vicfred quit (Remote host closed the connection) |
15:55:02 | * | vicfred joined #nim |
16:01:57 | FromDiscord | <BlockListed> How do I do something like the python time.sleep() command in nim? |
16:03:53 | FromDiscord | <zetashift> @BlockListed https://nim-lang.org/docs/os.html#sleep%2Cint `sleep()` |
16:04:13 | FromDiscord | <zetashift> (I think, my python isn't up to date) |
16:05:17 | FromDiscord | <BlockListed> Thats exactly what I was looking for TSM |
16:05:21 | FromDiscord | <BlockListed> (edit) "TSM" => "TYSM" |
16:06:03 | FromDiscord | <konsumlamm> btw, you can use the search bar in https://nim-lang.org/docs/lib.html to search for functions etc. |
16:09:41 | Oddmonger | is it true that {.discardable.} raises the execution time ? |
16:09:55 | * | teasea quit (Quit: teasea) |
16:10:02 | Oddmonger | see comment in first answer: https://stackoverflow.com/questions/56976426/nim-function-type-of-int-has-to-be-discarded |
16:11:11 | liblq-dev | it doesn't |
16:12:09 | ForumUpdaterBot | New thread by Mantielero: Nim.cfg - pragma, see https://forum.nim-lang.org/t/7526 |
16:12:21 | liblq-dev | jesus christ it's just like disruptek predicted |
16:12:32 | liblq-dev | "can't use this feature because slow" |
16:12:42 | * | teasea joined #nim |
16:12:44 | FromDiscord | <haxscramper> There is not enough data to give conclusive answer I think. If they removed `{.discardable.}` and return value then it might be due to lack of return value or something. Or maybe explicitly using `discard` enables some optimization |
16:13:12 | Oddmonger | liblq-dev: it's not that, but it's for a bench function |
16:13:23 | liblq-dev | when will people learn that using language features is fine. |
16:13:38 | FromDiscord | <haxscramper> I think "can't use this feature because slow" is just common whatever because nobody really cares about doing stuff |
16:13:39 | liblq-dev | discardable is discouraged for other reasons. |
16:14:04 | * | lkjasdf quit (Read error: Connection reset by peer) |
16:14:06 | FromDiscord | <haxscramper> Like actually implementing features and then fixing slow code when needed |
16:14:22 | * | lkjasdf joined #nim |
16:14:22 | Oddmonger | like this: http://ix.io/2PS2 |
16:15:47 | liblq-dev | let's go back to assembly language then. it can't possibly be slow, right? |
16:16:21 | liblq-dev | overly trying to squeeze every last bit of performance prematurely is not a good thing |
16:16:45 | Oddmonger | oh you are so like disruptek, i was missing him :') |
16:17:32 | Oddmonger | it's not a question of optimization, it's just for having a good measure of time elapsed, without parasites |
16:17:45 | Oddmonger | if the overhead is constant, that's ok for me |
16:19:12 | * | Vladar quit (Quit: Leaving) |
16:20:30 | * | maier joined #nim |
16:20:48 | * | Clonkk[m] sent a long message: < https://matrix.org/_matrix/media/r0/download/matrix.org/jWRDveWDjEbVJcwvcrFACmOl/message.txt > |
16:21:12 | FromDiscord | <zetashift> In reply to @liblq-dev "let's go back to": this is an sentiment I agree with about people premature optimizing stuff that in the end are neglible |
16:21:14 | FromDiscord | <BlockListed> How do I remove something from an Array simularly to the .pop() function in python? |
16:22:05 | FromDiscord | <Rika> `delete`? |
16:22:09 | FromDiscord | <BlockListed> Ok thanks |
16:29:20 | FromDiscord | <mratsim> In reply to @Oddmonger "is it true that": Oddmonger: discardable isn't slow unless somehow your code uses all 16 registers and the unused return value uses one that would be otherwise critical. And even in that case the perf boost would be by 1/16. |
16:30:22 | oz | ~~ |
16:40:08 | FromDiscord | <Solitude> In reply to @BlockListed "How do I remove": use sequence, arrays have constant size |
16:44:53 | * | Cthalupa quit (Ping timeout: 256 seconds) |
16:46:11 | * | Cthalupa joined #nim |
16:47:56 | * | maier quit (Quit: leaving) |
16:54:14 | ForumUpdaterBot | New thread by Clonk: Binding to C macros functions, see https://forum.nim-lang.org/t/7527 |
16:57:34 | FromDiscord | <pointystick> Are the Nim forum account emails working? I registered on the forum earlier today but haven't got an email yet. I remember there was some issue sending the emails in the past |
16:58:48 | * | letto quit (Quit: Konversation terminated!) |
16:59:26 | * | letto joined #nim |
17:03:54 | liblq-dev | @BlockListed `seq` also has a `pop()` proc |
17:04:44 | FromDiscord | <BlockListed> Thanks, but delete will work for me. |
17:08:28 | FromDiscord | <BlockListed> Btw is there a way to convert a list to a seq, because my data is coming from a json file and I don't know how to get a seq list from a json object. |
17:10:22 | FromDiscord | <haxscramper> `getElems()`? it returns `seq[JsonNode]` so not necessary to convert anything |
17:12:27 | FromDiscord | <BlockListed> Thanks |
17:13:44 | * | haxscram` joined #nim |
17:16:30 | FromDiscord | <BlockListed> Btw how do json dicts work if I import them like this? Will they just automagically turn into tables? |
17:16:36 | * | haxscramper quit (Ping timeout: 260 seconds) |
17:17:17 | * | letto quit (Read error: Connection reset by peer) |
17:18:19 | * | letto joined #nim |
17:19:12 | FromDiscord | <BlockListed> Wait sry It works fine |
17:22:17 | ForumUpdaterBot | New thread by Benob: Patching existing libraries with "include", see https://forum.nim-lang.org/t/7528 |
17:25:52 | FromDiscord | <Yardanico> spammer? https://media.discordapp.net/attachments/371759389889003532/812012017085972480/unknown.png |
17:25:55 | FromDiscord | <Yardanico> single post on the forum |
17:25:57 | FromDiscord | <Yardanico> necroposting |
17:26:03 | FromDiscord | <Yardanico> ah nvm he's already marked as such |
17:28:47 | FromDiscord | <konsumlamm> iot development is very important today |
17:30:42 | Oddmonger | ok, thank you @mratsim |
17:35:57 | * | JustASlacker quit (Ping timeout: 264 seconds) |
17:38:18 | ForumUpdaterBot | New thread by Mantielero: Windows - #include <dlfcn.h>, see https://forum.nim-lang.org/t/7529 |
17:39:32 | FromDiscord | <haxscramper> @Yardanico Do you track forum activity (posts per day/comments per hour etc)? |
17:39:38 | FromDiscord | <Yardanico> no |
17:47:57 | * | letto quit (Ping timeout: 264 seconds) |
17:48:18 | FromDiscord | <LITeralLANGuage9> What's the command to get nim to compile to a .so file rather than DLL? I'm a bit confused trying to read the documentation. |
17:48:53 | FromDiscord | <mratsim> In reply to @LITeralLANGuage9 "What's the command to": .so are to Unixes what DLLs are to Windows. |
17:49:09 | FromDiscord | <mratsim> it's the same thing except one is on Linux and one on Windows. |
17:49:50 | FromDiscord | <mratsim> usually you use --app:lib --header:mylib.h |
17:50:47 | FromDiscord | <LITeralLANGuage9> So I would use --app=DLL for windows and --app=lib for unix? |
17:52:05 | reversem3 | Does nim have anything similar to rust traits? |
17:52:34 | Prestige | What are rust traits? |
17:52:39 | FromDiscord | <mratsim> In reply to @LITeralLANGuage9 "So I would use": you use --app:lib for both and you name the output file .dll on Windows and .so on Linux and .dylib on Mac |
17:52:46 | reversem3 | I guess a collection of methods ? |
17:52:52 | reversem3 | https://doc.rust-lang.org/rust-by-example/trait.html |
17:53:10 | FromDiscord | <mratsim> In reply to @reversem3 "Does nim have anything": you can use concepts. However there is no Box+traits equivalent, you need to use inheritance. |
17:53:13 | FromDiscord | <LITeralLANGuage9> If I can use lib for both, why even use DLL to begin with? |
17:53:26 | FromDiscord | <mratsim> lib just means library |
17:53:36 | FromDiscord | <mratsim> a DLL is a library on windows and .so a library on Linux |
17:53:50 | reversem3 | ok so inheritance |
17:53:55 | FromDiscord | <mratsim> "why would you use Windows to begine with" is another question altogether |
17:54:01 | FromDiscord | <mratsim> (edit) "begine" => "begin" |
17:54:35 | reversem3 | Maybe thats what the person is comfortable with |
17:54:36 | FromDiscord | <konsumlamm> concepts are similar with the major difference being that you explicitly need to implement traits, while concepts are implicitly implemented |
17:54:58 | reversem3 | ok cool , I will look into concepts thanks |
17:55:07 | * | abm joined #nim |
17:55:22 | liblq-dev | achtung, achtung, danger zone: concepts are experimental. |
17:55:48 | FromDiscord | <mratsim> They work, the main issue is debugging why a concept doesn't match. |
17:56:04 | liblq-dev | this |
17:56:06 | FromDiscord | <mratsim> I use them in all my projects. |
17:56:23 | liblq-dev | also symbol duplication |
17:56:26 | FromDiscord | <mratsim> well I dropped them for cryptography but that was for another reason |
17:56:42 | liblq-dev | what was the reason? |
17:56:57 | FromDiscord | <mratsim> https://github.com/nim-lang/Nim/issues/16897 |
17:57:18 | FromDiscord | <mratsim> It's annoying when you use concepts with types that are 3000+ bits in size |
17:57:21 | liblq-dev | ah, so performance |
17:57:30 | liblq-dev | understandable |
17:57:45 | FromDiscord | <mratsim> code size as well: https://github.com/nim-lang/Nim/issues/13982 |
17:57:58 | liblq-dev | ah yes |
17:57:59 | liblq-dev | that one i know |
17:58:10 | FromDiscord | <mratsim> but that one can be solved by doing all concept instantiation in the same file. |
17:58:12 | * | letto joined #nim |
17:58:18 | FromDiscord | <mratsim> (edit) "instantiation" => "instantiations" |
17:58:37 | FromDiscord | <mratsim> here I had 2 files being corecursive. |
17:59:30 | * | filcuc quit (Ping timeout: 272 seconds) |
18:05:17 | FromDiscord | <treeform> In reply to @zetashift "<@107140179025735680> I need a": pixie is flippy v2, I would use pixie now. |
18:05:59 | FromDiscord | <treeform> we hope to have a 1.0 of pixie release soon |
18:06:10 | FromDiscord | <treeform> then we will deprecate flippy |
18:06:21 | ForumUpdaterBot | New thread by Benob: Conjunctions of sum type parameters, see https://forum.nim-lang.org/t/7530 |
18:06:45 | * | blackpawn quit (Ping timeout: 240 seconds) |
18:08:19 | FromDiscord | <hamidb80> In reply to @ForumUpdaterBot "New thread by Benob:": 😕 |
18:08:21 | FromDiscord | <zetashift> @treeform thanks! I played around with pixie today for a bit, I couldn't figure out how to get the equivalent of `image.line(vec2(11, 11), vec2(100, 100), rgba(0, 0, 0, 255))` in pixie. There is `lineTo` but that only gets 2 arguments and a path and what exactly is path? |
18:08:47 | FromDiscord | <zetashift> Cause a path can also contain a rect? |
18:08:55 | FromDiscord | <treeform> i'll add a line example |
18:09:30 | FromDiscord | <zetashift> oh thanks alot! 😄 |
18:11:38 | * | JustASlacker joined #nim |
18:15:40 | FromDiscord | <treeform> In reply to @zetashift "oh thanks alot! 😄": here you go: https://github.com/treeform/pixie#line |
18:16:20 | FromDiscord | <treeform> Pixie has similar API to other vector libraries, create path, stroke/fill the path. |
18:16:39 | FromDiscord | <treeform> You can wrap this with your "line" method for your use case. |
18:17:02 | FromDiscord | <treeform> Usually people want to connect the lines and its kind of hard. |
18:24:11 | FromDiscord | <zetashift> alright I'll look more into it, I have never played with vector libs before, thank you |
18:34:25 | * | lkjasdf quit (Ping timeout: 240 seconds) |
18:36:50 | * | lkjasdf joined #nim |
18:36:51 | * | lkjasdf quit (Read error: Connection reset by peer) |
18:37:15 | * | lkjasdf joined #nim |
18:53:38 | * | natrys joined #nim |
18:54:27 | * | Vladar joined #nim |
18:56:45 | * | JustASlacker quit (Ping timeout: 240 seconds) |
18:57:09 | * | vicfred quit (Quit: Leaving) |
18:58:21 | * | superbia joined #nim |
19:02:22 | reversem3 | serious question: "Why would you want to port C++ code to nim" ? |
19:02:42 | * | fosred quit (Quit: Leaving) |
19:05:18 | FromDiscord | <treeform> because its looks nicer, easier to work with, probably be shorter, possible less bugs, with ever rewrite code usually gets better (even C++ to C++ rewrite) etc... |
19:06:13 | FromDiscord | <~355/113 Man> better std lib too |
19:06:53 | FromDiscord | <zetashift> sent a code paste, see https://play.nim-lang.org/#ix=2PT0 |
19:06:56 | reversem3 | Ok very good thanks |
19:07:56 | FromDiscord | <treeform> In reply to @zetashift "<@107140179025735680> am I doing": can I see your line? |
19:07:59 | FromDiscord | <~355/113 Man> also random question, I think the answer is yes. does Nim have complex number in standard library? |
19:08:48 | FromDiscord | <treeform> In reply to @~355/113 Man "also random question, I": its like a web search away: https://nim-lang.org/docs/complex.html |
19:09:55 | FromDiscord | <treeform> In reply to @zetashift "<@107140179025735680> am I doing": are you using C++ mode? |
19:10:52 | * | JustASlacker joined #nim |
19:10:57 | FromDiscord | <zetashift> Erhm, I'm looping over a grid and drawing a line, as a wall, if it reaches the boundaries for example. My code kind of condensed is: https://play.nim-lang.org/#ix=2PT4, I am not using C++ mode |
19:11:17 | FromDiscord | <~355/113 Man> hmm, none of the exponential operations take a `k` |
19:13:08 | FromDiscord | <zetashift> I think I'm specifying the `w` and `h` wrong |
19:13:20 | FromDiscord | <treeform> In reply to @zetashift "Erhm, I'm looping over": Which OS are you on and what C compiler? It looks like a low level SIMD issue. What happens if you disable simd by passing `-d:pixieNoSimd` ? |
19:15:07 | * | kwilczynski quit (Remote host closed the connection) |
19:15:07 | * | sz0 quit (Remote host closed the connection) |
19:15:07 | * | fowl quit (Remote host closed the connection) |
19:15:07 | * | sirn quit (Remote host closed the connection) |
19:15:07 | * | robertmeta quit (Remote host closed the connection) |
19:15:12 | FromDiscord | <zetashift> I'm on Linux, Ubuntu 20.10, running gcc 10.2.0 and when I run `-d:pixieNoSimd` I get: `Error: attempting to call undeclared routine: 'roundedRect'` |
19:16:08 | FromDiscord | <treeform> ^ even more strange, we will look into this. |
19:16:19 | FromDiscord | <treeform> Do the simple examples in the readme work for you? |
19:16:36 | FromDiscord | <zetashift> oh yea lemme test some |
19:16:42 | FromDiscord | <zetashift> I might have jumped in too fast 😛 |
19:17:14 | FromDiscord | <treeform> are you on 64 bit or 32 bit, x86? |
19:17:27 | FromDiscord | <treeform> It appears to be some low level issue with SIMD |
19:17:51 | * | casaca quit (Ping timeout: 246 seconds) |
19:18:18 | FromDiscord | <zetashift> `example_square` errors out with the same error, I'm on 64bit x86, want me to make an issue about this? I didn't think this would be an issue |
19:19:03 | FromDiscord | <treeform> I did not think so too |
19:19:09 | FromDiscord | <treeform> could you maybe pull head? |
19:19:15 | FromDiscord | <zetashift> `-d:pixieNoSimd` works with example_square tho |
19:19:34 | FromDiscord | <treeform> git clone https://github.com/treeform |
19:19:37 | FromDiscord | <treeform> cd pixie |
19:19:43 | FromDiscord | <treeform> nimble develop |
19:21:23 | FromDiscord | <zetashift> oh yea then it works |
19:21:38 | FromDiscord | <zetashift> (well the example gotta test my code now) |
19:22:06 | FromDiscord | <guzba> kk great yeah last pixie release was 24 days ago which is a very long time considering the daily work being done |
19:23:05 | FromDiscord | <zetashift> yea my code works too with head |
19:23:35 | FromDiscord | <guzba> cool ok we'll get a release tagged too but glad thats fixed |
19:23:42 | * | vicfred joined #nim |
19:24:15 | * | Gustavo6046 joined #nim |
19:24:26 | FromDiscord | <zetashift> sorry for the false alarm 😛 |
19:25:07 | FromDiscord | <guzba> all good all good |
19:25:25 | FromDiscord | <guzba> we know to tag a new release out so thats nice |
19:25:32 | FromDiscord | <guzba> (edit) removed "out" |
19:26:34 | FromDiscord | <guzba> kk release is tagged if you prefer to just follow nimble instead of a clone'd repo |
19:28:06 | FromDiscord | <zetashift> I'm all set for now! |
19:35:14 | * | lkjasdf quit (Read error: Connection reset by peer) |
19:35:35 | * | lkjasdf joined #nim |
19:36:08 | * | JustASlacker quit (Ping timeout: 260 seconds) |
19:40:23 | * | blackpawn joined #nim |
19:40:44 | FromDiscord | <LITeralLANGuage9> Is it possible to write nim code that only works on 64 bit processors? |
19:41:12 | FromDiscord | <haxscramper> If you can do that with C you can just replicate solution in nim |
19:42:42 | FromDiscord | <haxscramper> There are also several consts like https://nim-lang.org/docs/system.html#cpuEndian and we also have https://nim-lang.org/docs/cpuinfo.html < this one is useless for the task, but I think there is something like that, but can't find proper link |
19:47:30 | FromDiscord | <mratsim> In reply to @LITeralLANGuage9 "Is it possible to": static: doAssert sizeof(int) == 8, "You shall not pass (on 32-bit)". |
19:47:40 | FromDiscord | <mratsim> (edit) "static:" => "`static:" | "32-bit)"." => "32-bit)"`." |
19:48:06 | * | robertmeta joined #nim |
19:48:25 | * | sirn joined #nim |
19:50:10 | * | JustASlacker joined #nim |
19:50:16 | FromDiscord | <mratsim> otherwise it depends on the architecture you target, x86 32 and 64 have a sufficiently different calling convention that you can break 32-bit with assembly |
19:50:21 | FromDiscord | <mratsim> (in fact I just did that) |
19:51:04 | FromDiscord | <haxscramper> Compiling `compiler/parser` to webassembly takes total of `399k` (for `.wasm` file) |
19:51:29 | FromDiscord | <haxscramper> with `ARC`, `danger`, `O2`, `release`, `stacktrace:off` etc. |
19:51:45 | FromDiscord | <mratsim> that seems large |
19:53:10 | FromDiscord | <Yardanico> @haxscramper with wasmrt? |
19:54:02 | FromDiscord | <haxscramper> No directly `emcc` |
19:54:08 | FromDiscord | <Yardanico> well that's not "directly" :P |
19:54:17 | FromDiscord | <Yardanico> emscripten is more "heavy" than compiling to pure wasm |
19:54:35 | FromDiscord | <Yardanico> but of course it abstracts a lot of wasm-specific stuff so you can compile programs with little to no modification |
19:55:18 | FromDiscord | <mratsim> @Araq you there? |
19:55:30 | FromDiscord | <haxscramper> More heavy than what? and should I try and use pure wasm or this is not worth it in the long run? |
19:55:40 | FromDiscord | <haxscramper> And "more heavy" by how much |
19:56:04 | FromDiscord | <Yardanico> well compiling to pure wasm will require you to do more porting work manually |
19:56:10 | * | sz0 joined #nim |
19:56:14 | FromDiscord | <haxscramper> I just went with `emcc` because that's what google knows most about, not that I know best |
19:56:18 | FromDiscord | <Yardanico> it's fine |
19:57:18 | * | fowl joined #nim |
19:58:37 | * | Cthalupa quit (Ping timeout: 256 seconds) |
19:59:21 | * | kwilczynski_ joined #nim |
20:05:30 | * | kwilczynski_ quit () |
20:06:10 | * | kwilczynski joined #nim |
20:08:44 | FromDiscord | <haxscramper> Link-time optimization and `-Oz` saved `~83k` in total I think it is fine-(ish) in the end. Current build script is - https://github.com/haxscramper/hack/blob/master/testing/c/wasm/niminterop/build.sh and yes it is ugly as sin because I couldn't find a way to use `--passC` with `emcc` so I had to generate header file from nim and then use it in C's `main` |
20:09:01 | * | Cthalupa joined #nim |
20:12:01 | * | casaca joined #nim |
20:13:25 | * | Cthalupa quit (Ping timeout: 240 seconds) |
20:17:42 | FromDiscord | <mratsim> In reply to @haxscramper "Link-time optimization and `-Oz`": Don't worry we won't hold that sin against you |
20:22:44 | * | Cthalupa joined #nim |
20:23:47 | FromDiscord | <haxscramper> meh |
20:24:14 | FromDiscord | <haxscramper> I just realized I want something like https://astexplorer.net/ |
20:24:45 | FromDiscord | <haxscramper> So maybe (if I finish it sometime) this will be a problem |
20:28:18 | * | Cthalupa quit (Ping timeout: 265 seconds) |
20:30:46 | * | Cthalupa joined #nim |
20:33:37 | * | haxscram` quit (Remote host closed the connection) |
20:34:00 | * | haxscramper joined #nim |
20:37:37 | * | haxscramper quit (Remote host closed the connection) |
20:42:32 | * | mfiano quit (Quit: WeeChat 2.9) |
20:42:46 | * | mfiano joined #nim |
20:56:50 | FromDiscord | <CodeHz> Is it possible to get custom pragma inside macro?↵the hasCustomPragma from macros is not work if the type is the argument of macro |
20:57:17 | FromDiscord | <CodeHz> (edit) "the" => "one of macro's" | removed "of macro" |
20:57:23 | FromDiscord | <CodeHz> (edit) "Is it possible to get custom pragma inside macro?↵the hasCustomPragma from macros is not work if the type is one of ... macro's" added "the" |
20:58:01 | FromDiscord | <CodeHz> (edit) "argument" => "argument↵https://play.nim-lang.org/#ix=2PTG" |
20:59:21 | * | filcuc joined #nim |
21:03:08 | FromDiscord | <CodeHz> oh, wait, I can just copy the customPragmaNode's code to achive it.. so why it is not exported |
21:05:53 | * | sirn quit (Remote host closed the connection) |
21:05:53 | * | fowl quit (Remote host closed the connection) |
21:05:53 | * | robertmeta quit (Remote host closed the connection) |
21:05:53 | * | kwilczynski quit (Remote host closed the connection) |
21:05:54 | * | sz0 quit (Remote host closed the connection) |
21:08:21 | * | kinkinkijkin quit (Ping timeout: 264 seconds) |
21:09:36 | * | kinkinkijkin joined #nim |
21:12:04 | * | robertmeta joined #nim |
21:12:25 | * | sirn joined #nim |
21:23:49 | * | sz0 joined #nim |
21:26:20 | * | fowl joined #nim |
21:28:51 | * | kwilczynski_ joined #nim |
21:41:22 | * | narimiran quit (Ping timeout: 272 seconds) |
22:21:06 | * | natrys quit (Quit: natrys) |
22:36:22 | * | superbia quit (Quit: WeeChat 3.0) |
22:42:25 | FromDiscord | <treeform> In reply to @LITeralLANGuage9 "Is it possible to": We do that kind of, we need a flag disable SIMD for 32bit for our stuff to work. |
22:46:47 | * | kwilczynski_ is now known as kwilczynski |
22:46:49 | * | kwilczynski quit () |
22:47:25 | * | kwilczynski joined #nim |
22:53:04 | * | filcuc_ joined #nim |
22:53:09 | * | filcuc quit (Ping timeout: 256 seconds) |
22:57:56 | * | tane quit (Quit: Leaving) |
23:01:08 | JustASlacker | So |
23:01:37 | JustASlacker | what would be a nice way to get a rest server running in nim |
23:01:50 | JustASlacker | like flask in python or somesuch |
23:02:49 | JustASlacker | also, is the python https://www.python.org/dev/peps/pep-0636/ related to https://github.com/zevv/npeg ? |
23:02:57 | JustASlacker | as in, same concept |
23:03:17 | lkjasdf | in theory you could convert flask to nim with py2nim (probably not the best option?) |
23:05:01 | FromDiscord | <Rika> Just use an http server like prologue or whatever and learn how to use that instead |
23:05:05 | FromDiscord | <Rika> Would be easier |
23:05:36 | JustASlacker | prologue looks nice |
23:06:05 | JustASlacker | Im looking for suggestions for something written in nim |
23:06:50 | JustASlacker | :thumbsup: |
23:12:59 | FromDiscord | <Rika> Prologue is in nim is it not |
23:13:46 | FromDiscord | <ElegantBeef> I think so, hard to tell https://media.discordapp.net/attachments/371759389889003532/812099566761541652/unknown.png |
23:29:48 | ForumUpdaterBot | New thread by Yjuq: GCC Compiler - New to Nim, see https://forum.nim-lang.org/t/7531 |
23:29:55 | * | filcuc_ quit (Quit: Konversation terminated!) |
23:37:48 | ForumUpdaterBot | New thread by Mantielero: Windows - msys2 - rdynamic, see https://forum.nim-lang.org/t/7532 |
23:52:00 | * | Lord_Nightmare quit (Quit: ZNC - http://znc.in) |
23:55:14 | * | Lord_Nightmare joined #nim |