00:03:13 | * | pech is now known as disso_peach |
00:06:41 | FromDiscord | <huantian> always like the commit message overflowing |
00:06:53 | FromDiscord | <Elegantbeef> Same |
00:10:16 | * | laintree is now known as lain |
00:17:27 | FromDiscord | <tomByrer> In reply to @dom96 "doubt you'll see more": Why don't you think I'll see performance increase (at least over JS, if not GoLang)? I'll be taking 1000s of screenshots of an element that is changing.↵↵`WebDriver` oh I forgot the name of that spec; cheers. |
00:47:31 | * | wallabra quit (Ping timeout: 268 seconds) |
01:02:01 | FromDiscord | <flywind> sent a code paste, see https://play.nim-lang.org/#ix=473o |
01:02:13 | FromDiscord | <flywind> (edit) "https://play.nim-lang.org/#ix=473o" => "https://play.nim-lang.org/#ix=473p" |
01:02:19 | FromDiscord | <flywind> This should work. |
01:02:44 | FromDiscord | <Elegantbeef> Uhh |
01:03:35 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=473q |
01:08:11 | FromDiscord | <!Patitotective> what does auto does there? does it create a generic? |
01:08:17 | FromDiscord | <Elegantbeef> Yes |
01:09:55 | FromDiscord | <j-james> beat me to saying it on that style insensitivity thread beef, lol |
01:10:53 | FromDiscord | <Elegantbeef> I noticed |
01:11:10 | FromDiscord | <Elegantbeef> I left the message and instantly got an updoot |
01:20:31 | FromDiscord | <Elegantbeef> for parameters patito `auto` is the same as `proc name[T](a: T)` |
01:21:23 | FromDiscord | <!Patitotective> i get it :] |
01:44:54 | * | cctor joined #nim |
01:48:12 | FromDiscord | <voidwalker> how do you pack two uint32s into an array/seq of byte? |
01:48:49 | FromDiscord | <Elegantbeef> grow the sequence then `copyMem` |
01:50:14 | * | cctor left #nim (ERC 5.4 (IRC client for GNU Emacs 28.1)) |
01:52:09 | FromDiscord | <voidwalker> like this ? |
01:52:12 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=473w |
01:52:30 | FromDiscord | <Elegantbeef> yep |
01:53:13 | FromDiscord | <voidwalker> `Error: type mismatch: got <(ptr byte, ptr uint32, int)>↵but expected one of:↵proc copyMem(dest, source: pointer; size: Natural)` |
01:53:22 | FromDiscord | <voidwalker> Ptrs must be of the same type ? |
01:53:35 | FromDiscord | <Forest> Does Nim have a way for me to include a snipped of code at any point in the file? |
01:53:41 | FromDiscord | <Forest> Not at the start, but right at the middle |
01:54:01 | FromDiscord | <Forest> Ik it's probably not very idiomatic but it'd be way more convenient for me lmao |
01:54:07 | FromDiscord | <!Patitotective> `include` |
01:54:16 | FromDiscord | <!Patitotective> (edit) "`include`" => "`include module`" |
01:54:25 | FromDiscord | <Forest> Does that work at any point of the file? |
01:54:33 | FromDiscord | <!Patitotective> yep, just like import |
01:54:38 | FromDiscord | <Forest> And I'm assuming it'll preserve the indent? |
01:54:57 | FromDiscord | <!Patitotective> 🤨 |
01:55:24 | FromDiscord | <Forest> I'm doing this literally in a block of code lmao, i need to include it in that block of code |
01:55:58 | FromDiscord | <!Patitotective> well, ill think it is included in that scope like normal identifieres |
01:56:00 | FromDiscord | <!Patitotective> (edit) "identifieres" => "identifiers" |
01:56:09 | FromDiscord | <Forest> Ah so the indent isn't needed? |
01:56:13 | FromDiscord | <!Patitotective> (edit) "ill" => "i" | "it is" => "itill be" |
01:56:15 | FromDiscord | <Forest> In the included file |
01:56:24 | FromDiscord | <!Patitotective> no |
01:56:36 | FromDiscord | <!Patitotective> why not import tho |
01:56:41 | FromDiscord | <Forest> Oh |
01:57:12 | FromDiscord | <Forest> In reply to @Patitotective "why not import tho": Pretty sure it's compile time and I don't think futhark would work with an import |
01:58:06 | FromDiscord | <Forest> Okay yeah include doesn't work in that block that's not fun- |
01:58:29 | FromDiscord | <Forest> Welp, 500 lines into that the bindings generator file it is |
01:59:20 | FromDiscord | <!Patitotective> In reply to @Forest "Okay yeah include doesn't": example? |
02:00:26 | FromDiscord | <Forest> sent a code paste, see https://play.nim-lang.org/#ix=473y |
02:04:20 | FromDiscord | <Forest> Futhark is doing it's own thing to the names at the same time, that's annoying |
02:05:00 | FromDiscord | <voidwalker> ``nim |
02:05:03 | FromDiscord | <Forest> It removes the casing |
02:05:16 | FromDiscord | <Forest> In reply to @voidwalker "``nim": Nim doesn't have any syntax highlighting in Discord? |
02:05:18 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=473z |
02:05:21 | FromDiscord | <Forest> Not on mobile at least |
02:05:43 | FromDiscord | <voidwalker> (edit) "https://play.nim-lang.org/#ix=473z" => "https://play.nim-lang.org/#ix=473A" |
02:05:53 | FromDiscord | <voidwalker> I get different values ;-s means it's not copier properly |
02:05:59 | FromDiscord | <voidwalker> (edit) "copier" => "copied" |
02:08:45 | FromDiscord | <!Patitotective> In reply to @Forest "Nim doesn't have any": it does |
02:08:53 | FromDiscord | <Rainbow Asteroids> In reply to @Forest "Nim doesn't have any": It does, but I'm pretty sure there is no syntax highlighting on mobile |
02:09:56 | FromDiscord | <Rainbow Asteroids> nvm there is syntax highlighting on mobile, it's just wonky |
02:10:38 | FromDiscord | <Forest> Ah alright |
02:13:30 | FromDiscord | <Forest> How can i rename the functions in futhark with my own casing? It seems like futhark disregards my casing no matter what |
02:15:49 | FromDiscord | <!Patitotective> doesnt this solve that? https://github.com/PMunch/futhark#hard-names-and-overrides |
02:17:25 | * | wallabra joined #nim |
02:22:10 | FromDiscord | <Forest> No, futhark seems to disregard my casing even after renaming |
02:27:40 | FromDiscord | <Forest> My renaming should of made `wgpuTextureViewDrop` become `TextureViewDrop`, but Futhark just set it to `Textureviewdrop` anyway |
02:46:19 | * | arkurious quit (Quit: Leaving) |
02:48:58 | FromDiscord | <j-james> i mean `Textureviewdrop == TextureViewDrop` |
02:49:16 | FromDiscord | <j-james> it's only ugly in the wrapper, not your code |
02:56:43 | * | wallabra_ joined #nim |
02:57:21 | * | oprypin joined #nim |
02:57:22 | * | wallabra quit (Remote host closed the connection) |
02:58:30 | * | def-- joined #nim |
02:58:40 | * | xaltsc_ joined #nim |
02:58:53 | * | wallabra_ is now known as wallabra |
02:59:02 | FromDiscord | <Forest> Wait is Nim case insensitive? |
02:59:09 | FromDiscord | <Forest> When calling stuff |
02:59:28 | FromDiscord | <Elegantbeef> Yes |
02:59:39 | FromDiscord | <Elegantbeef> Nim is style insensitive for all identifiers |
02:59:43 | FromDiscord | <Elegantbeef> Only the first character matters |
03:00:00 | FromDiscord | <Forest> I've been stressing over this for a bit.... Sigh I'm dumb, thanks haha |
03:03:04 | * | oprypin_ quit (*.net *.split) |
03:03:05 | * | def- quit (*.net *.split) |
03:03:05 | * | xaltsc quit (*.net *.split) |
03:03:06 | * | estiquelapice quit (*.net *.split) |
03:03:07 | * | cornfeedhobo quit (*.net *.split) |
03:03:07 | * | def-- is now known as def- |
03:07:36 | * | cornfeedhobo joined #nim |
03:13:43 | * | estiquelapice joined #nim |
03:37:38 | FromDiscord | <Forest> sent a code paste, see https://play.nim-lang.org/#ix=473N |
03:39:05 | FromDiscord | <Forest> (edit) "https://play.nim-lang.org/#ix=473N" => "https://play.nim-lang.org/#ix=473O" |
03:39:22 | FromDiscord | <Rainbow Asteroids> well, it has a `return` and `arguments` field. |
03:40:04 | FromDiscord | <Forest> Ah okay |
03:40:07 | FromDiscord | <Forest> sent a code paste, see https://play.nim-lang.org/#ix=473P |
03:40:16 | FromDiscord | <Forest> Should be ez then |
03:40:19 | FromDiscord | <Forest> Hopefully |
03:43:29 | FromDiscord | <Forest> Oh, does Futhark have a way to only enable exports for the aliases to sane names? (Without numbers) |
03:56:13 | FromDiscord | <j-james> `Can't fold empty sequences [AssertionDefect]` come on 😒 |
03:57:37 | FromDiscord | <j-james> so strange that the actual line number where the foldl happened was not anywhere in the stack track |
03:57:39 | FromDiscord | <Forest> https://github.com/PMunch/futhark/issues/43 made an issue |
04:13:42 | * | xcodz-dot joined #nim |
04:15:59 | xcodz-dot | I am working with binary data, Is there anyway for me to define a struct/type so that I can directly cast that binary data into it. I know the binary structure of that data. |
04:16:51 | xcodz-dot | If that is also possible, I am pretty sure that nim is a powerful system's language. |
04:18:57 | xcodz-dot | Hello? |
04:30:24 | FromDiscord | <Rika> What’s the layout of the data |
04:33:43 | FromDiscord | <Elegantbeef> `copyMem` is pretty much you want |
04:42:56 | FromDiscord | <Phil> In reply to @flywind "Yeah, I was wrong.": I had no idea you could just negate types like that, that is pretty cool. Thanks! |
04:43:00 | FromDiscord | <Rika> Yes but it depends on if the binary data fits the data structures Nim has, without needing any sort of conversion |
04:43:41 | FromDiscord | <Elegantbeef> Yea nim's typeclasses support unions and intersections 😄 |
04:44:42 | FromDiscord | <Elegantbeef> We'll see when xcodz replies whether that works |
04:54:26 | FromDiscord | <Bubblie> sent a code paste, see https://play.nim-lang.org/#ix=473Y |
04:54:44 | FromDiscord | <Elegantbeef> What happens if you use it |
04:54:50 | FromDiscord | <Elegantbeef> "cant" isnt very descriptive |
04:55:35 | FromDiscord | <Bubblie> so when I use it nim says it doesn't exist |
04:55:49 | FromDiscord | <Elegantbeef> and you're on a windows machine? |
04:55:55 | FromDiscord | <Bubblie> yes |
04:56:16 | FromDiscord | <Elegantbeef> Are you sure you have that module imported? |
04:56:32 | FromDiscord | <Bubblie> how do I check? because I did do import staticglfw |
04:56:37 | FromDiscord | <Bubblie> do I have to import more things? |
04:57:03 | FromDiscord | <Elegantbeef> No clue what module is that defined in? |
04:58:28 | FromDiscord | <Bubblie> well its in staticglfw.nim |
04:58:34 | FromDiscord | <Bubblie> in the bindings |
04:58:38 | FromDiscord | <Elegantbeef> then it should work |
04:59:16 | FromDiscord | <Bubblie> yeah... maybe when I imported staticglfw its not using the right version? it seems to be using the latest though... |
04:59:23 | FromDiscord | <Bubblie> how do I check the module ive installed on my end |
04:59:34 | FromDiscord | <Bubblie> like its code |
04:59:46 | FromDiscord | <Elegantbeef> `.nimble/pkgs/pkg-version/` |
04:59:51 | FromDiscord | <Bubblie> thanks! |
04:59:58 | FromDiscord | <Rika> Are you using nimble to run your code |
05:00:10 | FromDiscord | <Rika> Have you put the module in either↵Your code base ↵Or another packages |
05:00:13 | FromDiscord | <Rika> (edit) "packages" => "package" |
05:03:19 | FromDiscord | <Bubblie> well I used nimble to install the module with git if that's what you mean? |
05:09:32 | FromDiscord | <Bubblie> Found the issue! |
05:09:33 | FromDiscord | <Rika> No |
05:09:37 | FromDiscord | <Rika> How do you compile your code |
05:09:59 | FromDiscord | <Bubblie> oh I just do nim compile --run |
05:10:05 | FromDiscord | <Rika> What was the issue |
05:10:19 | FromDiscord | <Bubblie> so it turns out when I installed staticglfw it is not using an updated version |
05:10:34 | FromDiscord | <Bubblie> its missing getWin32NativeWindow |
05:10:43 | FromDiscord | <Bubblie> and cocoaWindow |
05:10:57 | FromDiscord | <Bubblie> do you know how to use nimble to install the absolute latest from a git repo? |
05:11:25 | FromDiscord | <Rika> Absolute latest depends on the branch |
05:11:37 | FromDiscord | <Bubblie> naster then |
05:11:50 | FromDiscord | <Rika> Find the branch you want and add “@#” then that to the end of the link |
05:11:58 | FromDiscord | <Bubblie> okay! |
05:12:19 | FromDiscord | <Rika> Maybe that won’t work, in which case write “HEAD” instead of the branch name? |
05:13:47 | FromDiscord | <Bubblie> Okay I installed with head |
05:14:53 | FromDiscord | <Bubblie> do I have to change my import to anything or can I leave it as staticglfw |
05:15:09 | FromDiscord | <Bubblie> sent a code paste, see https://play.nim-lang.org/#ix=4741 |
05:15:42 | FromDiscord | <Rika> No difference |
05:16:33 | FromDiscord | <Bubblie> it works! :D |
05:16:36 | FromDiscord | <Bubblie> thank you so much for helping me |
05:16:45 | FromDiscord | <Bubblie> sorry im still trying to get use to nim 😅 |
05:40:08 | FromDiscord | <Phil> sent a code paste, see https://paste.rs/uXz |
05:40:23 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=4746" => "https://play.nim-lang.org/#ix=4745" |
05:40:36 | FromDiscord | <Elegantbeef> when statements my guy |
05:40:59 | FromDiscord | <Phil> Been there, tried that, got a compiler error. One sec, I'll see which one it was |
05:41:54 | FromDiscord | <Elegantbeef> Or a template |
05:42:27 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4747 |
05:42:42 | FromDiscord | <Phil> The lower one does work |
05:42:48 | FromDiscord | <Elegantbeef> Of course not |
05:43:01 | FromDiscord | <Elegantbeef> `fieldPairs` is an unrolled iterator |
05:43:05 | FromDiscord | <Phil> The upper one I'll take as a demonstration that you can't store iterators like that |
05:43:11 | FromDiscord | <Phil> Check |
05:43:15 | FromDiscord | <Elegantbeef> Yes they're inlined |
05:44:25 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4748 |
05:47:15 | FromDiscord | <Elegantbeef> You can store closure iterators like that, and closure iterators are fantastic |
05:47:31 | FromDiscord | <Phil> I think the template approach is the better one, because it doesn't lead to copies for value type objects |
05:48:01 | FromDiscord | <Elegantbeef> You can define the template in your procedure if you dont want it to be used anywhere else of course |
05:48:26 | xcodz-dot | Sorry, forgot about this |
05:48:33 | xcodz-dot | I will leave for now |
05:48:36 | * | xcodz-dot quit (Quit: Leaving) |
05:48:38 | FromDiscord | <Elegantbeef> How dare you |
05:48:47 | FromDiscord | <Elegantbeef> Buh bye |
05:49:18 | FromDiscord | <Elegantbeef> I'm glad matrix has a "who read" indicator cause i know leorize is now back and reading my inanity |
06:14:56 | NimEventer | New thread by Treeform: Show Nim: New Pixie 5.0 release with significant performance improvements, see https://forum.nim-lang.org/t/9356 |
06:17:29 | FromDiscord | <treeform> ^ look we did a thing 🙂 |
06:17:48 | FromDiscord | <treeform> check out our video: https://www.youtube.com/watch?v=Did21OYIrGI |
06:19:08 | FromDiscord | <Phil> You make me want to write code with pixie treeform, and I don't even have a usecase for it on my webapp |
06:19:28 | FromDiscord | <Rainbow Asteroids> make a profile pic generator |
06:19:28 | FromDiscord | <Elegantbeef> Good for you since it doesnt work on the web |
06:19:35 | FromDiscord | <Rainbow Asteroids> :( |
06:19:50 | FromDiscord | <Phil> In reply to @Elegantbeef "Good for you since": Why wouldn't it? |
06:20:01 | FromDiscord | <Elegantbeef> Cause pixie uses native code |
06:20:10 | FromDiscord | <Phil> Send request to backend, backend generate pic, pic stored on disk somewhere, done |
06:20:15 | FromDiscord | <Rainbow Asteroids> Like the SIMD stuff? |
06:20:30 | FromDiscord | <Rainbow Asteroids> does pixie work on arm? |
06:20:38 | FromDiscord | <Elegantbeef> Hey i dont do web stuf, when i hear webapp i think someone taking js and ruining my day |
06:20:39 | FromDiscord | <guzba> In reply to @Rainbow Asteroids "does pixie work on": yes, including neon simd now |
06:20:40 | FromDiscord | <Elegantbeef> Yes |
06:21:08 | FromDiscord | <treeform> In reply to @Isofruit "You make me want": here is how to make a profile pic tutorial: https://github.com/treeform/pixiebook/blob/master/tutorial.md#for-websites |
06:21:09 | FromDiscord | <Phil> In reply to @Elegantbeef "Hey i dont do": Fair point, I included the backend in my definition of webapp, that might be overly inclusive |
06:21:09 | FromDiscord | <guzba> pixie is not intended for js use, however wasm should work though we haven't tested it in a logn time |
06:21:14 | FromDiscord | <Elegantbeef> on matrix i responded before him, dont hate me! |
06:22:10 | FromDiscord | <treeform> In reply to @guzba "pixie is not intended": wasm is 32bit, we have not tested 32 bit in a long time... |
06:22:38 | FromDiscord | <Rainbow Asteroids> In reply to @Elegantbeef "Hey i dont do": what matrix frontend do you use? |
06:22:55 | FromDiscord | <Phil> In reply to @treeform "here is how to": I could add PFPs I guess, and start storing a list of folks who wrote/edited an article and then show their pfp's somewhere |
06:23:25 | FromDiscord | <treeform> In reply to @Rainbow Asteroids "does pixie work on": It has worked on arm before, but now it works on arm very fast 🙂 |
06:23:33 | FromDiscord | <Phil> hmmm, but page loading times at 100ms |
06:23:49 | FromDiscord | <treeform> pixie could get you a pic in like 1ms |
06:24:32 | FromDiscord | <Phil> Pixie would be mostly a 1-off cost. The delay would come mostly from me doing additional queries to fetch article authors and the links to their pfp's |
06:24:33 | FromDiscord | <Rainbow Asteroids> In reply to @Isofruit "hmmm, but page loading": just have all your clients use satellite internet. they won't be able to see the 100ms delay then |
06:24:53 | FromDiscord | <Phil> Since I currently don't do that |
06:25:05 | FromDiscord | <Elegantbeef> Statically generate the page 😛 |
06:25:11 | FromDiscord | <Phil> In fact I don't even store that. |
06:25:38 | FromDiscord | <Phil> In reply to @Elegantbeef "Statically generate the page": And send HTML over the internet? Blasphemy! |
06:26:03 | FromDiscord | <Phil> Send json and burn through your client's cpu to figure out what HTML that should be! |
06:26:14 | FromDiscord | <Elegantbeef> Statically generate the page then cache the N number of recent pages, problem solved 😄 |
06:27:56 | FromDiscord | <Rainbow Asteroids> fools. write an web renderer that uses the canvas API, and send HTML to the custom renderer. |
06:27:58 | FromDiscord | <treeform> naa you should just create a full screen video and stream your pages as H.264 |
06:28:15 | FromDiscord | <Rainbow Asteroids> no as gifs |
06:29:43 | FromDiscord | <Phil> 4k video I say |
06:29:52 | FromDiscord | <treeform> In reply to @Rainbow Asteroids "no as gifs": pixie does animated gifs now |
06:30:22 | FromDiscord | <treeform> https://github.com/treeform/boxy/blob/master/examples/animated_gif.nim |
06:31:28 | FromDiscord | <Rainbow Asteroids> freeform rewrites ffmpeg in nim when |
06:31:38 | FromDiscord | <Rainbow Asteroids> (edit) "freeform" => "treeform" |
06:31:46 | FromDiscord | <Rainbow Asteroids> I hate mobile keyboards |
06:31:51 | FromDiscord | <ajusa> In reply to @treeform "check out our video:": just finished watching, fantastic work you guys! |
06:31:57 | FromDiscord | <treeform> thanks! |
06:32:03 | FromDiscord | <guzba> In reply to @ajusa "just finished watching, fantastic": thanks for watching! |
06:32:48 | FromDiscord | <treeform> In reply to @Rainbow Asteroids "treeform rewrites ffmpeg in": I was thinking of a lossless video codec optimized for computer generated stuff like screen sharing |
06:33:10 | FromDiscord | <guzba> In reply to @treeform "I was thinking of": streamy when? |
06:33:25 | FromDiscord | <ajusa> In reply to @Rainbow Asteroids "treeform rewrites ffmpeg in": I hope they tackle audio format playback |
06:33:31 | FromDiscord | <ajusa> (edit) "In reply to @Rainbow Asteroids "treeform rewrites ffmpeg in": I hope they tackle audio format playback ... " added "someday" |
06:33:51 | FromDiscord | <treeform> https://github.com/treeform/slappy ? |
06:33:56 | FromDiscord | <ajusa> but I think beef's got a miniaudio wrapper going, which should be sufficient for my needs |
06:34:12 | FromDiscord | <ajusa> In reply to @treeform "https://github.com/treeform/slappy ?": I meant in pure Nim |
06:34:18 | FromDiscord | <ajusa> which is what I love about pixie |
06:34:34 | FromDiscord | <ajusa> that's why it was easyish to get it running on 3DS/obscure targets |
06:34:43 | FromDiscord | <ajusa> (edit) "that's why it was easyish to get it running on ... 3DS/obscure" added "Nintendo" |
06:34:50 | FromDiscord | <treeform> sound is harder |
06:35:03 | FromDiscord | <treeform> so sanative to thread preemption |
06:35:13 | FromDiscord | <treeform> (edit) "sanative" => "sensitive" |
07:17:53 | FromDiscord | <Pure Hyperborean Stuka Flieger> Hey everyone!! |
07:18:21 | FromDiscord | <xzntrc> oops should probably change my name back |
07:19:32 | FromDiscord | <Prestige> Hello |
07:19:49 | FromDiscord | <ShalokShalom> How would you write a transpiler that creates readable output, the simplest way possible? |
07:20:14 | FromDiscord | <ShalokShalom> Like, I heard pattern matching is good for this, just lack the idea of how this would actually look |
07:20:20 | FromDiscord | <Elegantbeef> Make it so it only transpiles a single thing extremely well |
07:20:33 | FromDiscord | <ShalokShalom> A single thing, as in? |
07:20:43 | FromDiscord | <ShalokShalom> Single component of the target language? |
07:20:56 | FromDiscord | <Elegantbeef> `echo "Hello World"` -\> `prinf("Hello World")` boom doneski |
07:20:58 | FromDiscord | <Elegantbeef> Shit my joke failed as i cannot type and forgot `;` |
07:21:21 | FromDiscord | <ShalokShalom> https://develop.kde.org/docs/extend/plasma/scripting/#advanced-example-adding-a-widget-to-the-system-tray |
07:21:24 | FromDiscord | <Elegantbeef> The way to do it is parse the language into AST then reason off that AST what you need to do in the coresponding language |
07:21:42 | FromDiscord | <ShalokShalom> Oh, no 1:1 conversation? |
07:21:59 | FromDiscord | <ShalokShalom> Most of the lang is already transpiled (Javascript) |
07:22:15 | FromDiscord | <ShalokShalom> I am just trying to translate examples like that |
07:22:41 | FromDiscord | <ShalokShalom> So, how would you do Nim --> Javascript in this example above |
07:22:54 | FromDiscord | <Elegantbeef> Ok so you're not looking into designing a transpiler |
07:22:58 | FromDiscord | <ShalokShalom> Ok |
07:23:01 | FromDiscord | <xzntrc> Ok I had an idea for my shell to make it fast (hopefully); instead of reading through each file in /bin/ or whatever, it keeps the location of each binary saved in a local file. So instead of looking through eachtime, it saves it. |
07:23:17 | FromDiscord | <Elegantbeef> Import all the procedures you need then write the equivalent code in Nim |
07:23:23 | FromDiscord | <ShalokShalom> Reminds me of the Smalltalk VM |
07:23:31 | FromDiscord | <ShalokShalom> That is also only saved |
07:23:40 | FromDiscord | <ShalokShalom> Including the whole IDE |
07:24:10 | FromDiscord | <ShalokShalom> In reply to @Elegantbeef "Import all the procedures": That's a little bit too abstract for me |
07:24:21 | FromDiscord | <ShalokShalom> Wouldn't you just map it via pattern matching? |
07:24:28 | FromDiscord | <Elegantbeef> Map what? |
07:24:41 | FromDiscord | <ShalokShalom> I dont even need much granularity, it would be enough to map to the shown code |
07:24:54 | FromDiscord | <Elegantbeef> You want to write the code you have there in Nim and export JS? |
07:25:00 | FromDiscord | <ShalokShalom> My goal is to extend the JavaScript compiler and make it work with these libraries |
07:25:11 | FromDiscord | <ShalokShalom> To the explicit JS code shown |
07:25:19 | FromDiscord | <Elegantbeef> How doesnt it already work though? |
07:25:24 | FromDiscord | <ShalokShalom> To much less to arbitrary code, or unexpected one |
07:25:39 | FromDiscord | <ShalokShalom> Since Nim doesnt know about this specific library? |
07:25:52 | FromDiscord | <Elegantbeef> So import the library |
07:25:58 | FromDiscord | <ShalokShalom> I want to write in Nim a few lines and get that output in JS |
07:26:07 | FromDiscord | <ShalokShalom> But how would that look like? |
07:26:10 | FromDiscord | <ShalokShalom> I have no idea |
07:26:38 | FromDiscord | <Elegantbeef> you'd use nim's FFI to import the JS types/procedures |
07:26:45 | FromDiscord | <Elegantbeef> https://github.com/nim-lang/Nim/blob/version-1-6/lib/std/jsfetch.nim is a reference for that |
07:28:25 | FromDiscord | <ShalokShalom> Thanks |
07:28:28 | FromDiscord | <ShalokShalom> https://github.com/ShalokShalom/plasma-applet-lib/blob/6b936b43c52409d17c32e06ef4bc5b7cf8221ac2/package/contents/ui/lib/AppletVersion.qml |
07:28:37 | FromDiscord | <ShalokShalom> That would be another example 🙂 |
07:29:20 | FromDiscord | <Elegantbeef> It's It's mostly all the same use `importjs`/ `emit` to create the corresponding JS |
07:29:41 | FromDiscord | <xzntrc> if I want to write a config for my program, what file format should be used for the config? |
07:29:54 | FromDiscord | <Elegantbeef> Though QML is going to be a pain to work with probably as Nim writes large large JS files |
07:29:56 | FromDiscord | <Elegantbeef> TOML is what i suggest for that |
07:30:20 | FromDiscord | <xzntrc> is there a package for TOML? |
07:30:27 | FromDiscord | <xzntrc> or do I read it just like a text file |
07:30:30 | FromDiscord | <Elegantbeef> There are multiple |
07:30:49 | FromDiscord | <ShalokShalom> So that jsfetch.nim integrates the Javascript library into Nim |
07:30:56 | FromDiscord | <ShalokShalom> And I can use it then from Nim |
07:31:03 | FromDiscord | <Elegantbeef> Yep |
07:31:14 | FromDiscord | <Elegantbeef> https://github.com/status-im/nim-toml-serialization may work for you |
07:31:22 | FromDiscord | <xzntrc> ty beef |
07:31:27 | FromDiscord | <ShalokShalom> In reply to @Elegantbeef "Though QML is going": I wouldn't actually use Nim for that |
07:31:43 | FromDiscord | <ShalokShalom> I just currently try to figure out, how it would be to implement something |
07:31:48 | FromDiscord | <ShalokShalom> In the different languages |
07:31:52 | FromDiscord | <enthus1ast> for config often parsecfg is good enough |
07:32:14 | FromDiscord | <vindaar> there's also `parsetoml`, which I use a lot |
07:32:14 | FromDiscord | <flywind> What's this error "Unable to locate package libsfml-dev:i386" when switching from 16.04 to 18.04? Did it get removed? |
07:32:22 | FromDiscord | <Elegantbeef> clearly just use environmental variables and have a shell script to load it 😄 |
07:32:24 | FromDiscord | <flywind> (edit) "What's this error "Unable to locate package libsfml-dev:i386" when switching from ... 16.04" added "ubuntu" |
07:32:42 | FromDiscord | <Elegantbeef> It's here on debian so no clue about ubuntu |
07:32:43 | FromDiscord | <ShalokShalom> In reply to @Elegantbeef "Though QML is going": I dont know, how TOML could replace QML↵↵They are totally different languages |
07:32:49 | FromDiscord | <Elegantbeef> It cannot |
07:32:55 | FromDiscord | <vindaar> https://github.com/NimParsers/parsetoml |
07:32:58 | FromDiscord | <Elegantbeef> I was talking to the one asking about config languages |
07:33:01 | FromDiscord | <Elegantbeef> Eh parsetoml is manual parsing |
07:33:03 | FromDiscord | <ShalokShalom> Ah, confused two things |
07:33:15 | FromDiscord | <Elegantbeef> Atleast i dont see a `.toX` |
07:33:20 | FromDiscord | <xzntrc> In reply to @Elegantbeef "I was talking to": sorry if I interupted anything |
07:33:22 | FromDiscord | <Elegantbeef> `.to(X)` rather |
07:33:23 | FromDiscord | <ShalokShalom> In reply to @xzntrc "if I want to": Do you know dhall? |
07:33:37 | FromDiscord | <ShalokShalom> https://dhall-lang.org/ |
07:33:37 | FromDiscord | <Elegantbeef> Dont apologise you're not the one lacking context 😛 |
07:33:51 | FromDiscord | <ShalokShalom> It can export to JSON, TOML and others |
07:33:58 | FromDiscord | <xzntrc> huh that seems cool |
07:34:12 | FromDiscord | <xzntrc> oh yeah, is there anyway to stop my program from being stopped with ctrl c? |
07:34:18 | FromDiscord | <xzntrc> im assuming it's apart of terminal? |
07:34:23 | FromDiscord | <xzntrc> i couldn't find anything tho. |
07:34:26 | FromDiscord | <vindaar> huh, compared to what? |
07:34:37 | FromDiscord | <Elegantbeef> stuff like the stdlib json library |
07:34:49 | FromDiscord | <Elegantbeef> where you can just do `myData.to(MyType)` |
07:34:57 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/system.html#setControlCHook%2Cproc%29 |
07:35:37 | FromDiscord | <vindaar> oh, the status one supports that? neat |
07:35:45 | FromDiscord | <Elegantbeef> Yea but they dont have callbacks iirc |
07:36:01 | FromDiscord | <Elegantbeef> Frosty is what people really should use for all their formats |
07:36:10 | FromDiscord | <ShalokShalom> There used to be a Nim implementation of dhall as well, but it stopped in development |
07:36:23 | FromDiscord | <ShalokShalom> But you dont need that, so long as you can export to usual formats |
07:36:44 | FromDiscord | <ShalokShalom> Just some very fancy features are missing, like function calls or something |
07:37:35 | FromDiscord | <ShalokShalom> @Elegantbeef#0000 Nim seems to have imports figured out quite well↵↵This looks more confusing in Fable/F€ |
07:37:38 | FromDiscord | <Elegantbeef> Frosty is fantastic, it just needs someone to add different formats |
07:37:44 | FromDiscord | <ShalokShalom> (edit) "Fable/F€" => "Fable/F#" |
07:37:56 | FromDiscord | <Elegantbeef> Nim's FFI for JS is quite easy |
07:38:14 | FromDiscord | <Elegantbeef> You can leave it weakly typed or make it statically typed if you wish |
07:40:08 | FromDiscord | <ShalokShalom> Yeah, I see |
07:40:57 | FromDiscord | <flywind> ubuntu 20.04 doesn't seem to support i386 I suppose https://superuser.com/questions/1686108/ubuntu-20-04-on-i386-computer |
07:41:00 | FromDiscord | <ShalokShalom> While weakly and statically are not really opposites |
07:41:06 | FromDiscord | <Elegantbeef> It does but you need to enable it |
07:41:21 | FromDiscord | <ShalokShalom> Its more weakly/strongly and statically/dynamic 😜 |
07:42:06 | FromDiscord | <Elegantbeef> Sure, except in this case it's weakly and dynamically typed |
07:42:13 | FromDiscord | <ShalokShalom> Yeah |
07:42:35 | FromDiscord | <Elegantbeef> `JsObject` is weakly typed in Nim and dynamically typed by the runtime |
07:44:31 | FromDiscord | <Elegantbeef> And vindaar you scare me with that parseToml comment, you manually parse your toml files? |
07:44:36 | FromDiscord | <xzntrc> sent a code paste, see https://play.nim-lang.org/#ix=474r |
07:44:38 | FromDiscord | <Elegantbeef> `testProc` |
07:44:52 | FromDiscord | <Elegantbeef> You arent calling it you want the pointer procedure of it |
07:45:55 | FromDiscord | <ShalokShalom> Thanks a lot |
07:45:59 | FromDiscord | <vindaar> what's manual about accessing a toml file like a nim table? seems perfectly fine for me. if you have super complicated config files, fine something automatic is neat, but for the stuff I need it for? |
07:46:16 | FromDiscord | <vindaar> it's not like I need to write a toml parser 😜 |
07:46:26 | FromDiscord | <Elegantbeef> Lol |
07:46:45 | FromDiscord | <xzntrc> In reply to @Elegantbeef "You arent calling it": forgot the `{.noconv.}` on the proc too |
07:48:11 | FromDiscord | <Elegantbeef> To be fair vindaar due to the fact status' doesnt to my knowledge support user defined hooks i've manually parsed a lot with it |
07:49:16 | FromDiscord | <flywind> It seems that we can drop linux 32 bit CI support since few linux distributions support 32 bit processor and Azure CI is going to remove ubuntu 18.04. |
07:49:32 | FromDiscord | <flywind> (edit) "It seems that we can drop linux 32 bit CI support since few linux distributions ... support" added "still" |
07:50:08 | FromDiscord | <Elegantbeef> All 3 people interested in Nim on 32bit are deeply saddened by this |
07:50:21 | FromDiscord | <xzntrc> wait |
07:50:25 | FromDiscord | <xzntrc> how the fuck do i end this now |
07:50:36 | FromDiscord | <xzntrc> https://media.discordapp.net/attachments/371759389889003532/1006469531989975120/unknown.png |
07:50:36 | madprops | i wanna know to |
07:50:48 | madprops | /s/to/2 |
07:50:48 | FromDiscord | <Elegantbeef> You ask it nicely |
07:52:42 | FromDiscord | <flywind> In reply to @Elegantbeef "All 3 people interested": We have no other simple choice since azure pipelines only provide ubuntu image and ubuntu 20.04 doesn't support i386 processor. |
07:52:51 | FromDiscord | <flywind> https://media.discordapp.net/attachments/371759389889003532/1006470097281503242/unknown.png |
07:53:21 | * | gsalazar joined #nim |
07:59:10 | FromDiscord | <flywind> Is there anyone willing to review my PR? => https://github.com/nim-lang/Nim/pull/20176 |
08:09:57 | FromDiscord | <Phil> In reply to @Elegantbeef "All 3 people interested": Isn't 32bit possibly of interest for embedded? |
08:10:59 | FromDiscord | <Elegantbeef> The CI isnt testing 32bit embedded |
08:11:26 | FromDiscord | <Elegantbeef> So i guess like yea it's a larger subset that might be interested in the CI but anywho |
08:11:31 | FromDiscord | <Bung> `proc GetDisplayModeList1(this:ptr IID;EnumFormat: DXGI_FORMAT; Flags: uint32; pNumModes: ptr uint32; pDesc: ptr DXGI_MODE_DESC1): HRESULT {.stdcall, dynlib:"dxgi",importc.}↵` could not import: GetDisplayModeList1 , what's wrong here ? |
08:12:12 | FromDiscord | <Phil> Is testing for 32bit embedded significantly different from 32bit... whatever that was before? |
08:13:06 | FromDiscord | <Elegantbeef> I mean a lot of it will overlap but a lot of the stdlib is useless there |
08:15:26 | FromDiscord | <Phil> I think PMunch as our resident embedded person might have a better opinion on this, from what I'm seeing it just looks like that embedded might be losing their test-safety |
08:16:02 | FromDiscord | <Elegantbeef> Wow way to undermine elcritch/girvo |
08:16:17 | FromDiscord | <Phil> I have never heard or read of them I don't think |
08:16:31 | FromDiscord | <Elegantbeef> Head to #embedded 😛 |
08:18:21 | FromDiscord | <Bung> oh , I found that file extension is .lib not dll |
08:18:51 | FromDiscord | <Phil> Infiltrating a channel you don't belong in, a secret spy mission even, one might say |
08:19:09 | FromDiscord | <Phil> Mission impossible music flaring up in the background |
08:19:12 | FromDiscord | <Elegantbeef> Hey i dont belong there and i get to insult girvo's code it's a easy choice |
08:19:45 | FromDiscord | <Phil> But yeah, in that case also girvo and elcritch would have a better opinion on this |
08:21:52 | FromDiscord | <Rika> 32 bit ARM has many dialects so there is some contribution from desktop to embedded but it’s not a replacement environment for testing |
08:21:59 | FromDiscord | <Rika> You still have to independently test both |
08:22:52 | FromDiscord | <xzntrc> is there an easier way to do this? |
08:23:00 | FromDiscord | <xzntrc> sent a code paste, see https://play.nim-lang.org/#ix=474z |
08:23:07 | FromDiscord | <xzntrc> a way where each proc need not be stated |
08:23:08 | FromDiscord | <Rika> Beef going to hit them with case statement |
08:23:13 | FromDiscord | <xzntrc> kek |
08:23:24 | FromDiscord | <Rika> Waiting for his message |
08:23:27 | FromDiscord | <Rika> Any second now |
08:23:45 | FromDiscord | <Elegantbeef> Time! |
08:23:46 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=474A |
08:23:55 | FromDiscord | <Rika> Fuck I didn’t time you shit |
08:24:02 | FromDiscord | <Elegantbeef> Shit |
08:24:02 | FromDiscord | <xzntrc> LOL |
08:24:14 | FromDiscord | <xzntrc> is it possible to do something where i dont have to state them all? |
08:24:34 | FromDiscord | <xzntrc> sent a code paste, see https://play.nim-lang.org/#ix=474B |
08:24:38 | FromDiscord | <Rika> No not really |
08:24:43 | FromDiscord | <Rika> I mean yes with a macro |
08:25:02 | FromDiscord | <Elegantbeef> You could use a table of procs |
08:25:06 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=474C |
08:25:09 | FromDiscord | <xzntrc> case works |
08:25:11 | FromDiscord | <Phil> If the procs all share signature you could.... dangit beef! |
08:25:22 | FromDiscord | <Elegantbeef> They dont even need to share signatures |
08:25:24 | FromDiscord | <xzntrc> signature? |
08:25:27 | FromDiscord | <Elegantbeef> Object variants exist |
08:25:36 | FromDiscord | <Elegantbeef> Yes if the procs are all the same type |
08:25:44 | FromDiscord | <Phil> But that becomes so painful to deal with for large amounts of variations |
08:25:47 | FromDiscord | <Rika> In reply to @xzntrc "signature?": If the types of the arguments and return is the same |
08:25:52 | FromDiscord | <Rika> Then the signature is the same |
08:25:54 | FromDiscord | <xzntrc> right |
08:25:55 | FromDiscord | <xzntrc> thats cool |
08:33:33 | FromDiscord | <ShalokShalom> @Elegantbeef#0000 What does the after the names mean? ↵↵https://github.com/nim-lang/Nim/blob/version-1-6/lib/std/jsfetch.nim#L11 |
08:33:41 | * | def- quit (Quit: -) |
08:33:43 | FromDiscord | <Elegantbeef> Exported |
08:33:45 | FromDiscord | <ShalokShalom> Is this some kind of wildcard? |
08:34:00 | FromDiscord | <ShalokShalom> Ah, thanks |
08:34:07 | FromDiscord | <Elegantbeef> No it's nim's export marker to indicate "importing modules can access this symbol" |
08:34:34 | FromDiscord | <ShalokShalom> So more like importing markers? |
08:34:56 | FromDiscord | <flywind> It is from oberon programming language => https://en.wikipedia.org/wiki/Oberon_(programming_language)#:~:text=Oberon%20is%20a%20general%2Dpurpose,%2C%20and%20Modula%2D2). |
08:34:56 | FromDiscord | <Elegantbeef> no |
08:34:59 | FromDiscord | <ShalokShalom> Like, "I allow this to be used by imports" |
08:35:03 | FromDiscord | <ShalokShalom> Thanks |
08:35:23 | FromDiscord | <Elegantbeef> Fly mentioning oberon just reminds me how Go does this |
08:35:36 | FromDiscord | <Rika> I’ll be honest this was an odd choice |
08:35:46 | FromDiscord | <Elegantbeef> Not as odd as Go |
08:35:57 | FromDiscord | <Elegantbeef> "It's a capital letter, it must mean you want to export it" |
08:36:13 | FromDiscord | <ShalokShalom> I saw a very nice interview with Wirth |
08:36:27 | FromDiscord | <ShalokShalom> Nice dude |
08:36:44 | FromDiscord | <ShalokShalom> He even designed his own chip, own OS and own language |
08:36:49 | FromDiscord | <ShalokShalom> All on the same platform |
08:37:16 | FromDiscord | <Rika> In reply to @Elegantbeef "Not as odd as": Don’t remind me |
08:37:21 | FromDiscord | <Rika> I wish I never knew |
08:37:26 | FromDiscord | <Elegantbeef> Lol |
08:37:43 | FromDiscord | <Elegantbeef> It could be worse rika they could use an arbitrary timestamp to format dates |
08:37:52 | FromDiscord | <Elegantbeef> Which only makes sense if you're Merican |
08:38:17 | FromDiscord | <Elegantbeef> Wait i wrote "they could" |
08:38:56 | * | def- joined #nim |
08:41:44 | FromDiscord | <flywind> there are lots of semRecord or xxxRecord which confuses me first, later I know they mean objects. |
08:41:50 | FromDiscord | <flywind> (edit) "confuses" => "confused" | "confusedme ... first," added "at" |
08:41:53 | FromDiscord | <flywind> (edit) "know" => "knew" |
08:42:29 | FromDiscord | <Elegantbeef> The odd thing is just how explicit pointer types are in Oberon |
08:42:50 | FromDiscord | <Elegantbeef> Wirth went from `^MyType` to `POINTER TO MyType` |
08:43:14 | FromDiscord | <Elegantbeef> Maybe his ageing got to him and he couldnt see the `^` anymore |
08:43:16 | FromDiscord | <Rika> It’s better but not by much |
08:45:47 | FromDiscord | <Elegantbeef> Shit oberon-07 allows using case for "type extension tests" |
08:45:53 | FromDiscord | <Rika> Is Wirth doing good I do wonder |
08:46:29 | FromDiscord | <Elegantbeef> He's almost 90 and didnt work on Go he's doing fine! |
08:46:51 | FromDiscord | <Elegantbeef> Yes that's a shot at Ken Thompson |
09:04:23 | FromDiscord | <xzntrc> does nim have a var[:3] equavilent |
09:04:34 | FromDiscord | <xzntrc> I'd like to get everything after the first 3 characters in a string |
09:04:37 | FromDiscord | <Elegantbeef> Is that slicing? |
09:04:46 | FromDiscord | <Elegantbeef> `s[3..^1]` |
09:04:48 | FromDiscord | <xzntrc> Is that what it's called? |
09:05:01 | FromDiscord | <xzntrc> my brain has become so adjust to python |
09:05:04 | FromDiscord | <xzntrc> I'm a python cuck |
09:05:21 | FromDiscord | <Elegantbeef> Python's a snake right? |
09:05:39 | FromDiscord | <xzntrc> lol |
09:05:47 | FromDiscord | <xzntrc> correct |
09:06:04 | madprops | i watched a john cleese interview recently |
09:06:20 | madprops | he's 82 right now |
09:06:22 | FromDiscord | <Elegantbeef> Aw shit one of the beetles?! |
09:06:26 | FromDiscord | <Rika> In reply to @Elegantbeef "Python's a snake right?": Yeah it’s strangling the poor lad from the neck |
09:06:38 | madprops | monty python guy |
09:06:52 | FromDiscord | <Elegantbeef> Why did i think pythons were not constrictors |
09:07:00 | FromDiscord | <Elegantbeef> madprops i know |
09:07:11 | madprops | wasn't sure |
09:07:29 | madprops | now i have to finish that john carmack interview |
09:07:34 | FromDiscord | <Elegantbeef> The assumption that i dont know the pythons with my grand comedy, tsk tsk |
09:08:22 | madprops | carmack's interview is 5 hours long |
09:08:35 | madprops | 1 hour to go |
09:08:36 | FromDiscord | <xzntrc> In reply to @Elegantbeef "`s[3..^1]`": can that be performed directly on a string? |
09:09:54 | FromDiscord | <Elegantbeef> Why would someone suggest something that wouldnt work |
09:10:19 | madprops | "asdf"[1..2] |
09:10:21 | madprops | that works |
09:11:42 | FromDiscord | <xzntrc> In reply to @Elegantbeef "Why would someone suggest": just because it told me "constant expression expected" |
09:12:05 | FromDiscord | <xzntrc> oh wait fuck |
09:12:08 | FromDiscord | <xzntrc> ignore me |
09:12:11 | FromDiscord | <Elegantbeef> Compiler errors are wonderful |
09:12:32 | FromDiscord | <Phil> In reply to @xzntrc "just because it told": Keep in mind that in nim, slicing like this is inclusive, in python it was... I think the last index was not included or sth? |
09:12:45 | FromDiscord | <xzntrc> correct |
09:13:03 | FromDiscord | <Phil> So python:↵someString[:3]↵nim:↵someString[0..2] |
09:13:22 | FromDiscord | <xzntrc> https://media.discordapp.net/attachments/371759389889003532/1006490363919347713/unknown.png |
09:13:24 | FromDiscord | <ShalokShalom> @Elegantbeef#0000 is that shadowing going on, or why is this proc fetch defined twice?↵↵https://github.com/nim-lang/Nim/blob/version-1-6/lib/std/jsfetch.nim#L107 |
09:13:32 | FromDiscord | <xzntrc> https://media.discordapp.net/attachments/371759389889003532/1006490405870772245/unknown.png |
09:13:37 | FromDiscord | <Elegantbeef> Overloading |
09:13:43 | FromDiscord | <ShalokShalom> Or does the type signature make it something unique |
09:14:15 | FromDiscord | <that_dude> sent a code paste, see https://play.nim-lang.org/#ix=474R |
09:14:32 | FromDiscord | <Elegantbeef> `"cd "[3..^1]` the hell are you doing |
09:14:42 | FromDiscord | <that_dude> (edit) "https://play.nim-lang.org/#ix=474R" => "https://play.nim-lang.org/#ix=474S" |
09:14:45 | FromDiscord | <Elegantbeef> `"cd "[3..^1]` is "" |
09:15:21 | FromDiscord | <xzntrc> Yeah i just realized |
09:15:25 | FromDiscord | <Phil> `"cd "[3..^1]` gets compile time evaluated (all comparison-values in a case-statements are) |
09:15:28 | FromDiscord | <xzntrc> i meant to get before the first three |
09:15:31 | FromDiscord | <Phil> So yeah, that's "" |
09:15:42 | FromDiscord | <xzntrc> Yeah i fucked up |
09:15:49 | FromDiscord | <xzntrc> in |
09:15:53 | FromDiscord | <xzntrc> i need to use |
09:16:04 | FromDiscord | <xzntrc> sent a code paste, see https://paste.rs/hkp |
09:16:17 | FromDiscord | <xzntrc> I think that works |
09:16:18 | FromDiscord | <xzntrc> sent a code paste, see https://play.nim-lang.org/#ix=474U |
09:16:27 | FromDiscord | <Phil> does it? |
09:16:30 | FromDiscord | <Elegantbeef> Why are you slicing \`"cd" |
09:16:42 | FromDiscord | <Phil> You can just type in the string directly |
09:16:49 | FromDiscord | <Phil> It's all compile-time anyway |
09:16:50 | FromDiscord | <xzntrc> In reply to @Elegantbeef "Why are you slicing": because if user inputs `cd blah blah blah`, it assumes it's all one comnmand |
09:17:00 | FromDiscord | <Elegantbeef> you cannot slice like that |
09:17:08 | FromDiscord | <xzntrc> Really? |
09:17:12 | FromDiscord | <Elegantbeef> Case statements are compile time |
09:17:22 | FromDiscord | <Elegantbeef> case statements of branches are compile time constants\ |
09:17:32 | FromDiscord | <Phil> You are currently at compile time, which means before your program has even started to run |
09:17:45 | FromDiscord | <xzntrc> how do I ensure that it atleast contains "cd" |
09:17:50 | FromDiscord | <Elegantbeef> you want to capture the first word which means you should look at `std/parseutils` |
09:18:17 | FromDiscord | <Phil> `std/strutils` might have some "startsWith" proc or the like |
09:18:34 | FromDiscord | <xzntrc> perfect |
09:18:36 | FromDiscord | <xzntrc> thanks |
09:18:36 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=474V |
09:18:38 | FromDiscord | <Elegantbeef> Then you can do `case myCommand.getCommand` |
09:18:53 | FromDiscord | <xzntrc> thanks dud |
09:19:11 | FromDiscord | <Elegantbeef> Phil really out here trying to make you use an if statement |
09:32:29 | madprops | xzntrc I recommend this: |
09:32:31 | madprops | s.split(" ").filterIt(it != "") |
09:32:42 | madprops | the filter makes sure that if you have multiple spacing between words, it's ignored |
09:32:58 | madprops | so you get a list of every word every time |
09:35:09 | FromDiscord | <ShalokShalom> In reply to @Elegantbeef "Overloading": I don't find anything about proc overloading in the docs. ↵↵There are just a couple of Reddit posts of people who are also confused about it. |
09:35:24 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/manual.html#overload-resolution |
09:35:51 | FromDiscord | <that_dude> Doesn't nim also have something like `"cmd" in @[strings]`? |
09:35:57 | FromDiscord | <that_dude> so you can combine the two |
09:36:01 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/tut1.html#procedures-overloaded-procedures |
09:36:03 | FromDiscord | <that_dude> (edit) "so you can combine the two ... " added "into a one liner" |
09:37:19 | FromDiscord | <Rika> In reply to @madprops "s.split(" ").filterIt(it != "")": You’re gonna run into difficulty once you want to include strings into the shell |
09:37:27 | FromDiscord | <Rika> In which case you need to go to big boy parsing |
09:38:08 | madprops | ah right, strings could have multiple spaces, validly |
09:38:41 | FromDiscord | <Elegantbeef> Best just to get used to parseutils as it's going to make you happy |
09:38:55 | FromDiscord | <Gabben> sent a code paste, see https://play.nim-lang.org/#ix=4752 |
09:39:06 | FromDiscord | <Rika> Because the generic is not satisfied, I assume |
09:39:19 | FromDiscord | <Elegantbeef> `Obj` isnt an instantiated object so it's not `object` it's a typeclass of all possible `Obj` |
09:42:09 | FromDiscord | <ShalokShalom> In reply to @Elegantbeef "https://nim-lang.org/docs/manual.html#overload-reso": Thanks a lot. Don't you think it would make more sense, to actually name it 'proc overloading' |
09:42:14 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4753 |
09:42:22 | FromDiscord | <ShalokShalom> So that we can find it, when we look for it in the documentation? |
09:43:23 | FromDiscord | <ShalokShalom> Ah, there is a tutorial about it |
09:43:25 | FromDiscord | <Gabben> In reply to @Elegantbeef "It's equivlent to expecting": Thanks, I got it |
09:43:30 | FromDiscord | <ShalokShalom> Thx |
09:45:13 | FromDiscord | <ShalokShalom> So in the above example, proc fetch gets called according to its type signature? |
09:45:48 | FromDiscord | <ShalokShalom> https://github.com/nim-lang/Nim/blob/version-1-6/lib/std/jsfetch.nim#L107 |
09:46:13 | FromDiscord | <ShalokShalom> Or how does the caller figure out which fetch is meant? |
09:46:31 | FromDiscord | <Elegantbeef> The type of the parameters change what is called |
09:47:02 | FromDiscord | <Elegantbeef> If you dont past options the first is called otherwise the latter |
09:47:16 | FromDiscord | <Elegantbeef> Anyway i'm outta here so someone else get the helping 😄 |
09:48:14 | FromDiscord | <ShalokShalom> Ah, I see. |
09:48:17 | FromDiscord | <ShalokShalom> Thanks a lot |
10:16:42 | * | jmdaemon quit (Ping timeout: 268 seconds) |
10:16:46 | FromDiscord | <Phil> In reply to @Elegantbeef "Phil really out here": I am? |
10:16:59 | FromDiscord | <Phil> Ah, because of startsWith |
10:17:00 | FromDiscord | <Phil> Eh |
10:17:03 | FromDiscord | <Phil> It's an option |
10:20:03 | * | genpaku quit (Remote host closed the connection) |
10:20:44 | * | genpaku joined #nim |
10:37:51 | FromDiscord | <srozb> sent a code paste, see https://play.nim-lang.org/#ix=475b |
10:42:14 | * | gsalazar quit (Remote host closed the connection) |
10:42:32 | * | gsalazar joined #nim |
10:54:55 | * | guggy_warle joined #nim |
10:55:09 | guggy_warle | why does this compile? https://play.nim-lang.org/#ix=475e |
11:12:15 | FromDiscord | <Rika> Tags I don’t think are considered in side effects, they’re different systems I believe |
11:17:27 | guggy_warle | how do you designate side effects then? |
11:19:08 | guggy_warle | oh, I needed to use tags: [] instead of noSideEffect, sorry |
11:19:28 | * | guggy_warle quit (Quit: Client closed) |
11:27:46 | FromDiscord | <Bung> have problem when static link dxgi.lib , https://github.com/bung87/gamode/blob/main/src/gamode/dxgi.nim any hint? |
11:31:45 | FromDiscord | <Forest> Futhark is using macros to generate the code right? It should be possible for me to remove the code that exports the numbered functions... |
11:33:18 | * | xcodz-dot joined #nim |
11:34:21 | xcodz-dot | I was looking through logs to see what I missed and it seems Pixie 5.0 is near release. Could anyone please tell how I am suppose to load images in pixie without premultiplied alpha |
11:39:05 | FromDiscord | <Forest> Why is futhark so complicated- |
11:54:21 | FromDiscord | <voidwalker> why do I read futhark every time I look at main chat for a few days ? : P |
11:54:35 | FromDiscord | <voidwalker> (edit) "?" => "now?" |
11:59:46 | FromDiscord | <Forest> Probably because many people are using it for bindings lmao |
12:06:25 | * | gsalazar quit (Ping timeout: 252 seconds) |
12:06:35 | * | gsalazar joined #nim |
12:11:54 | * | xcodz-dot quit (Ping timeout: 244 seconds) |
12:18:30 | FromDiscord | <Phil> In reply to @Forest "*Why is futhark so": A question only Pmunch can answer |
12:26:28 | FromDiscord | <demotomohiro> I guess it is because C lang and their tools are complex because it must run as fast as possible. |
12:58:15 | FromDiscord | <Forest> Fair |
12:59:03 | FromDiscord | <Forest> @PMunch, is there a way to disable exporting the numbered identifiers? |
12:59:12 | FromDiscord | <Forest> It really messes with autocomplete |
13:04:53 | * | xaltsc_ is now known as xaltsc |
13:09:13 | * | xcodz-dot joined #nim |
13:10:58 | * | xcodz-dot quit (Client Quit) |
13:27:08 | NimEventer | New thread by Chaemon: Getting compile command in compile time. , see https://forum.nim-lang.org/t/9357 |
13:38:00 | * | arkurious joined #nim |
14:19:27 | FromDiscord | <Forest> I realised the small shitty generator i made here https://github.com/Mythical-Forest-Collective/ngpu-bindings can be applied to most things that don't have Nim bindings |
14:24:32 | FromDiscord | <mratsim> In reply to @srozb "Hey, I've been struggling": you need ptr UncheckedArray[char] or cstring |
14:26:51 | FromDiscord | <mratsim> In reply to @Forest "I realised the small": _writing shitty generator to create bindings to Nim_ |
14:27:01 | FromDiscord | <mratsim> (edit) "_writing" => "_/me writing" |
14:27:07 | FromDiscord | <mratsim> (edit) "In reply to @Forest "I realised the small": _/me writing ... shitty" added "a" |
14:27:13 | FromDiscord | <Forest> That's what i did :) |
14:27:17 | FromDiscord | <Forest> It just uses Luthark |
14:27:32 | FromDiscord | <Forest> Oh yeah need a license |
14:27:48 | FromDiscord | <mratsim> In reply to @Forest "That's what i did": I mean, from Nim code, generate C bindings: https://github.com/mratsim/constantine/blob/master/bindings/generated/constantine_pasta.h |
14:28:59 | FromDiscord | <Forest> Wait |
14:29:13 | FromDiscord | <Forest> So you mean so you can use a Nim library in C? |
14:29:24 | FromDiscord | <Forest> Iirc there should be a library that makes a header for that... |
14:29:28 | FromDiscord | <Forest> What was it |
14:29:38 | FromDiscord | <mratsim> In reply to @Forest "Iirc there should be": Genny |
14:30:00 | FromDiscord | <Forest> Ah yeah that's it, does it not work for your case? |
14:30:03 | FromDiscord | <mratsim> Tried, but it doesn't support generics or the shenanigans I use. |
14:30:15 | FromDiscord | <mratsim> https://github.com/mratsim/constantine/pull/195 |
14:30:26 | FromDiscord | <mratsim> I raised 4 bugs, as usually when I try something 😛 |
14:30:54 | FromDiscord | <Forest> Ah fair lmao |
14:31:06 | FromDiscord | <mratsim> - Add support for generics↵- Add support for type aliases↵- Add support for generic fields↵- Add support for distinct base types |
14:31:19 | FromDiscord | <mratsim> my shitty generator works for me ™️ |
14:31:30 | FromDiscord | <Forest> Lmao |
14:33:21 | FromDiscord | <mratsim> In reply to @Forest "Lmao": 39 lines: https://github.com/mratsim/constantine/blob/master/bindings/gen_header.nim#L153-L192↵↵and you put what you export there - https://github.com/mratsim/constantine/blob/master/bindings/gen_bindings.nim#L20-L40 |
14:34:00 | FromDiscord | <Forest> This makes zero sense to me because I'm chronically dumb :) |
14:34:42 | FromDiscord | <mratsim> In reply to @Forest "This makes zero sense": gimme 2 weeks and it won't make sense to me anymore |
14:39:10 | FromDiscord | <Forest> Pfff fair enough |
14:58:58 | FromDiscord | <treeform> In reply to @srozb "Hey, I've been struggling": you can make it `functions: ptr UncheckedArray[pe_exported_function_t]` then just `for i in 0 ..< s.functions_count: s.functions[i]` |
15:00:00 | FromDiscord | <treeform> In reply to @mratsim "_/me writing a shitty": Are you going to just do C or many other languages? |
15:01:16 | FromDiscord | <treeform> Nim has a ton of features to make work |
15:11:53 | FromDiscord | <Forest> Question, how would i generate code that i can just output into a file? |
15:12:10 | FromDiscord | <Forest> Like, programmatically in Nim |
15:12:22 | FromDiscord | <Forest> To generate custom bindings |
15:17:13 | FromDiscord | <auxym> you mean like, writing strings to a file? |
15:25:49 | FromDiscord | <Bubblie> What would be the equivalent of GetModuleHandle in nim? |
15:25:54 | FromDiscord | <Bubblie> I know its used in C |
15:34:58 | FromDiscord | <Forest> In reply to @auxym "you mean like, writing": Kind of? I want to generate automatic bindings to a library after i parse it, but I don't know how I'd write it to the file in a way not involving me to do string manipulation (because there's chance for all sorts of wacky things like that) |
15:42:47 | FromDiscord | <srozb> In reply to @treeform "you can make it": Thank You!!! |
15:50:11 | FromDiscord | <leorize> the windows function? you should find it in winim↵(@Bubblie) |
15:54:56 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=476z |
15:55:49 | FromDiscord | <Phil> That error is pretty cryptic, so I'm not quite sure what's broken. Syntactically and Logically this looks perfectly fine to me. |
15:56:16 | FromDiscord | <Phil> 5 is implicitly int. So this should evaluate to "int is (object of ref object)", which is valid syntax and is false |
15:56:32 | FromDiscord | <domosokrat> I think the error tries to tell you that you are calling a compiletime function at runtim |
15:56:32 | FromDiscord | <auxym> In reply to @Forest "Kind of? I want": You want to generate nim code? I don't see many other options other than string manipulation (or macros but I don't think that's what you want). That's what I do in svd2nim: parse an xml file to an internal structured representation, then just generate a bunch of strings (nim code) from that. |
15:57:07 | FromDiscord | <Phil> In reply to @domosokrat "I think the error": Oh shoot me, that one gets me way too often, I knew this sucker was familiar |
15:57:15 | FromDiscord | <Forest> Ah okay then, thanks! |
15:57:25 | FromDiscord | <domosokrat> you need `static: echo isObject(5)` or remove the compiletime pragma |
15:57:43 | FromDiscord | <Phil> compiletime was the point, just wanted to check if it does what I thought it does |
16:00:12 | FromDiscord | <Rainbow Asteroids> https://nim-lang.org/docs/manual.html#pragmas-compiletime-pragma↵> The compileTime pragma is used to mark a proc or variable to be used only during compile-time execution. No code will be generated for it. Compile-time procs are useful as helpers for macros. |
16:00:56 | FromDiscord | <domosokrat> I just tried it with the static and it said that 5 is not an object |
16:01:35 | FromDiscord | <Phil> In reply to @Rainbow Asteroids "https://nim-lang.org/docs/manual.html#pragmas-compi": Aye, I'm mostly using that one for a couple when statements in a loop over an object with the fieldpairs iterator |
16:01:58 | FromDiscord | <flywind> I guess a clear message will be more helpful. |
16:02:43 | FromDiscord | <Bubblie> In reply to @leorize "the windows function? you": Thanks! |
16:05:12 | * | xcodz-dot joined #nim |
16:10:26 | FromDiscord | <tbrekalo> what's the difference between std/re and std/nre? which one should I use? |
16:11:17 | FromDiscord | <leorize> different APIs, they're both libpcre-based implementations otherwise |
16:11:49 | FromDiscord | <leorize> I'd recommend either `re` or `nim-regex` as those are more maintained |
16:12:24 | FromDiscord | <tbrekalo> ty 😄 |
16:18:22 | xcodz-dot | Could someone please explain what is `dll`, `lib`, `so`, `dynlib`, `a` files. Or probabbly link me a resource to understand this. |
16:21:13 | FromDiscord | <tbrekalo> https://www.jwhitham.org/2017/10/dll.html#:~:text=dynamically%20linked%20libraries%20(.-,dll)%20and%20shared%20objects%20(.,for%20executable%20code%20and%20data. |
16:21:15 | FromDiscord | <tbrekalo> seems fine |
16:22:06 | FromDiscord | <tbrekalo> https://stackoverflow.com/questions/2649334/difference-between-static-and-shared-libraries |
16:25:20 | xcodz-dot | thanks |
16:25:53 | * | xcodz-dot quit (Quit: Leaving) |
16:28:14 | FromDiscord | <tbrekalo> sent a long message, see http://ix.io/476G |
16:59:18 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=476N |
17:11:41 | FromDiscord | <leorize> it's a template/iterator bug from what I can tell |
17:12:26 | FromDiscord | <leorize> iterator matching is only activated in certain context and the template kinda mess it up |
17:12:59 | FromDiscord | <flywind> Can I import `stdout` or `stderr` from `msvcrt.dll` by dynlib? |
17:14:12 | FromDiscord | <leorize> yes but don't |
17:14:35 | FromDiscord | <leorize> https://devblogs.microsoft.com/oldnewthing/20140411-00/?p=1273 |
17:15:29 | FromDiscord | <flywind> Reaaly, but the `symAddr` cannot find `stdout` in `msvcrt.dll` |
17:15:34 | FromDiscord | <flywind> (edit) "Reaaly," => "Really," |
17:16:00 | FromDiscord | <leorize> you can peek into their header to see what the real symbol is |
17:16:24 | FromDiscord | <leorize> iirc the symbol is `something` and `stdout` is a C macro |
17:16:47 | FromDiscord | <leorize> I'd not recommend using dynlib at all tbh |
17:18:00 | FromDiscord | <flywind> But I would like to make libffi work with Nim on windows. |
17:18:41 | FromDiscord | <leorize> why would you need dynlib for that? we are already using msvcrt stdout (if you compile with msvc), no? |
17:18:48 | FromDiscord | <Phil> In reply to @leorize "iterator matching is only": So a bug that gets me to be shit out of luck when I want to resolve what the template is supposed to do at compile time, dangit |
17:19:44 | FromDiscord | <leorize> and if you use mingw, you're out of luck for using it with any msvc-compiled libraries, so you'd need mingw-libffi |
17:20:33 | FromDiscord | <leorize> welcome to nim \:P interactions like this happens a lot↵(@Phil) |
17:20:46 | FromDiscord | <leorize> your best bet is to file an issue and look for an alternative |
17:20:58 | FromDiscord | <leorize> I think it is possible to write a for-loop macro to workaround this |
17:27:02 | * | kenran joined #nim |
17:33:16 | FromDiscord | <Phil> In reply to @leorize "welcome to nim \:P": It's honestly the first time I'm pretty much stuck there. Macro would be the way around this I guess, but I kinda don't wanna get into that at the moment |
17:36:27 | FromDiscord | <jseb> sent a code paste, see https://play.nim-lang.org/#ix=4773 |
17:38:12 | FromDiscord | <jseb> (edit) "https://play.nim-lang.org/#ix=4773" => "https://play.nim-lang.org/#ix=4775" |
17:39:58 | * | kenran quit (Ping timeout: 268 seconds) |
17:42:07 | FromDiscord | <jseb> as the book didn't mention specifics flags for compiling, i suppose it's straightforward |
17:43:47 | FromDiscord | <!&luke> does nim have a static site generatore |
17:43:48 | FromDiscord | <!&luke> (edit) "generatore" => "generator" |
17:44:32 | * | kenran joined #nim |
17:45:33 | FromDiscord | <jseb> @!&luke did you tried jester ? |
17:45:56 | FromDiscord | <!&luke> That’s not static |
17:46:04 | FromDiscord | <!&luke> Nor is it a generator |
17:46:08 | FromDiscord | <InventorMatt> @!&luke https://hastysite.h3rald.com this may be what you are looking for |
17:46:35 | * | kenran quit (Client Quit) |
17:47:14 | FromDiscord | <Prestige> In reply to @jseb "i've tried the first": Do you have sdl installed on your system? |
17:47:14 | FromDiscord | <!&luke> Oh |
17:47:28 | FromDiscord | <Prestige> Not the nim package but the actual library |
17:47:59 | FromDiscord | <jseb> @Prestige: yes (2.0.22) |
17:48:59 | FromDiscord | <!&luke> In reply to @InventorMatt "<@704106773660827690> https://hastysite.h3rald.com ": I’m probably just gonna go with gatsby |
17:49:07 | FromDiscord | <!&luke> It seems more polished |
17:49:20 | FromDiscord | <exelotl> In reply to @jseb "i've tried the first": hmm, it works for me https://media.discordapp.net/attachments/371759389889003532/1006620207411904645/Screenshot_from_2022-08-09_18-49-39.png |
17:49:46 | FromDiscord | <leorize> you can use karax to generate a site, it has limited server-side generation support↵(@!&luke) |
17:50:17 | FromDiscord | <pruno> Is it possible to not use dynlib on windows so that it does not import kernel32.dll or msvcrt.dll by default when compiling for windows ? |
17:51:03 | FromDiscord | <exelotl> the other week I wasn't able to find a Nim static site generator I liked, so I ended up going with Pelican |
17:51:12 | FromDiscord | <jseb> sent a code paste, see https://play.nim-lang.org/#ix=477c |
17:51:57 | FromDiscord | <!&luke> In reply to @leorize "you can use karax": It gets compiled to js so all the speed of c gets thrown out the window |
17:52:07 | FromDiscord | <domosokrat> do you have the sdl2-dev package installed?↵(@jseb) |
17:52:21 | FromDiscord | <exelotl> @jseb what does `nimble list -i` give you? |
17:52:34 | FromDiscord | <!&luke> In reply to @ripluke "It gets compiled to": At that point why just not use raw js, saves you the nim -> js step |
17:52:47 | FromDiscord | <domosokrat> And does `nimble path sdl2` show the correct path? |
17:53:00 | FromDiscord | <jseb> only sdl2_nim, no other packages |
17:54:01 | FromDiscord | <jseb> (edit) "only sdl2_nim, no other packages" => "sent a code paste, see https://play.nim-lang.org/#ix=477d" |
17:54:08 | FromDiscord | <Prestige> In reply to @ripluke "At that point why": I'm not sure what it uses but maybe check out nimja |
17:54:21 | FromDiscord | <domosokrat> I meant the deb package (or what your distribution uses) |
17:55:57 | FromDiscord | <jseb> of course, path to sdl2_nim is ok |
17:56:19 | FromDiscord | <jseb> so must be a missing sdl2 flavour |
17:56:30 | FromDiscord | <!&luke> In reply to @Avahe "I'm not sure what": I am was using it, but it isn’t very static as you need something like jester to serve it |
17:56:33 | FromDiscord | <leorize> karax ssg is meant to be natively compiled↵(@!&luke) |
17:56:40 | FromDiscord | <!&luke> (edit) removed "am" |
17:57:40 | FromDiscord | <leorize> see\: https://github.com/karaxnim/karax/blob/master/tests/nativehtmlgen.nim |
17:57:44 | FromDiscord | <domosokrat> @jseb\: Could try again with sdl2? With sdl2\_nim I also get the same error |
17:58:14 | FromDiscord | <jseb> ok i have reinstalled sdl2, and it's ok now |
17:58:25 | FromDiscord | <!&luke> In reply to @leorize "see\: https://github.com/karaxnim/karax/blob/master": Ok |
17:58:29 | FromDiscord | <jseb> thank you domosokrat |
17:58:36 | FromDiscord | <Prestige> In reply to @ripluke "I was using it,": Does it not just create html? I believe that's what most static site generators do |
17:59:06 | FromDiscord | <jseb> but isn't sdl2 installed as a dep of pixels package ? |
17:59:22 | * | mahlon_ is now known as mahlon |
17:59:30 | * | neceve joined #nim |
17:59:30 | FromDiscord | <!&luke> In reply to @Avahe "Does it not just": Hmm |
17:59:37 | FromDiscord | <Forest> We're able to use Øpir without Futhark, right? Since the license is MIT |
18:00:01 | FromDiscord | <Prestige> Then you serve the site yourself with like, nginx or similar |
18:00:29 | FromDiscord | <leorize> nope, you do need them to an extent to access Windows syscalls (maybe not msvcrt, though)↵(@pruno) |
18:00:30 | FromDiscord | <domosokrat> @jseb\: It is for me |
18:00:32 | FromDiscord | <Prestige> Or for local dev you can use nimhttpd |
18:00:33 | FromDiscord | <!&luke> Hmm id probably need to write a script to compile it, but after that it should work |
18:01:28 | FromDiscord | <leorize> you /can/ substitute it with import libraries given the correct flags, but the effect is pretty much the same |
18:01:45 | FromDiscord | <hotdog> In reply to @ripluke "I was using it,": Nimja is a templating engine, so you can write out static files if you want to |
18:01:55 | FromDiscord | <hotdog> I’ve used it this way |
18:02:19 | FromDiscord | <pruno> In reply to @leorize "you /can/ substitute it": I see, thanks |
18:02:37 | FromDiscord | <!&luke> In reply to @hotdog "Nimja is a templating": Yea I’ll probably get rid of jester |
18:10:40 | FromDiscord | <Forest> Do C structs map to Nim types? |
18:11:00 | FromDiscord | <leorize> yesn't |
18:11:06 | FromDiscord | <pruno> In reply to @leorize "you /can/ substitute it": What if i have my own implmentation of getprocaddress & loadlibrary ? |
18:11:19 | FromDiscord | <Forest> In reply to @leorize "yesn't": Yesn't? |
18:11:35 | FromDiscord | <Forest> (ik what yesn't is) |
18:11:56 | FromDiscord | <Forest> Do you mean in the way that with importc, it's close enough? |
18:12:20 | FromDiscord | <leorize> use `--dynlibOverrideAll` and `--passL` around to link with the right import libraries. That would make the compiler link with the actual symbol instead of loading them manually↵(@pruno) |
18:12:38 | FromDiscord | <leorize> then you can probably just link with whatever library that you want to override those specific symbols |
18:12:48 | FromDiscord | <pruno> I see, i'll try that |
18:13:54 | FromDiscord | <leorize> objects are compatible with C struct only because the optimizations for them are not implemented, officially their compatibility is undefined↵(@Forest) |
18:14:11 | FromDiscord | <leorize> `importc` doesn't do much on an object not specified by `header` directive btw |
18:15:21 | FromDiscord | <leorize> and you'd need to tag all wrapped objects with `bycopy` to keep C semantics (this could be undesirable) |
18:16:07 | FromDiscord | <Forest> In reply to @leorize "objects are compatible with": Ah okay, thanks! |
18:16:12 | FromDiscord | <Forest> In reply to @leorize "and you'd need to": Ah |
18:20:22 | FromDiscord | <leorize> a note on why `bycopy` might be undesirable\: so Nim have this optimization where it will pass an object via pointers if it deemed that doing so would improve performance (since you don't have to copy the object to the new stack frame). ofc, C doesn't have this so `{.bycopy.}` is used to turn that off. But, that'd also affect all Nim functions that take the struct, and most C libraries do this manually for their API by requesting pointers |
18:20:55 | FromDiscord | <Phil> I now understand why norm uses ref types for models. Properly writing parsing for value-type-objects is a pain in the keister |
18:21:07 | FromDiscord | <Phil> (edit) "for" => "from row to" |
18:21:34 | FromDiscord | <Forest> In reply to @leorize "a note on why": Aaah okay, thanks Leorize! |
18:22:41 | FromDiscord | <noiryuh> if i have a string of a typename↵how could i know if it's `ref object`? |
18:23:13 | FromDiscord | <leorize> yea, you can only do that cheaply and easily if you know the db type at compile time, see https://github.com/araq/ormin for something that does that↵(@Phil) |
18:23:54 | FromDiscord | <Phil> In reply to @leorize "yea, you can only": Wait, there's a performance reason? I'm only seeing a code complexity reason, that being I keep effing up where the value-type object needs to do a copy |
18:23:57 | FromDiscord | <leorize> you can't, what are you trying to do?↵(@noiryuh) |
18:24:20 | FromDiscord | <noiryuh> sent a code paste, see https://paste.rs/41L |
18:24:30 | FromDiscord | <Phil> (edit) "copy" => "copy, so that I retain all my previously parsed values instead of just default initialization values" |
18:25:21 | FromDiscord | <noiryuh> In reply to @leorize "you can't, what are": i'm contributing to genny↵so ref object could present as opaque type which is an pointer |
18:25:46 | FromDiscord | <leorize> you can detect a ref type at compile time with `T is ref` |
18:25:50 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=477m |
18:26:01 | FromDiscord | <leorize> the name won't cut it, you need the symbol |
18:26:32 | FromDiscord | <Phil> `proc isRefObject[T](s: typedesc[T]): bool = T is ref` is off the table? |
18:26:40 | FromDiscord | <noiryuh> yeah, but in genny, it receives a string |
18:26:49 | FromDiscord | <Phil> oof |
18:27:03 | FromDiscord | <Phil> Can you scan a namespace for symbols ? |
18:27:07 | FromDiscord | <noiryuh> sent a code paste, see https://play.nim-lang.org/#ix=477n |
18:27:11 | FromDiscord | <Phil> Is that a possible thing? |
18:27:26 | FromDiscord | <noiryuh> In reply to @Isofruit "Can you scan a": i have been looking for that too |
18:27:27 | FromDiscord | <leorize> you can't, but you can inline code to the target namespace that does that |
18:27:31 | FromDiscord | <leorize> either way it's a pita |
18:28:26 | FromDiscord | <demotomohiro> Maybe macros.parsestmt can do that: https://nim-lang.org/docs/macros.html#parseStmt%2Cstring |
18:29:02 | FromDiscord | <leorize> parseStmt works in the namespace of the caller, unfortunately |
18:30:33 | FromDiscord | <noiryuh> what about NimNode? |
18:30:47 | FromDiscord | <leorize> oh, a model you mean, I'm not too well versed in that aspect of norm, but I can imagine it has to do with how inheritance is used for them↵(@Phil) |
18:31:07 | FromDiscord | <noiryuh> i see the caller parsing NimNode to get a list of procParams |
18:31:30 | FromDiscord | <noiryuh> maybe i could change it to accept a bool to determine if it's object or not |
18:32:41 | FromDiscord | <leorize> it's hard to recommend without knowing too much on the input that you're handling |
18:33:47 | FromDiscord | <leorize> my quick skim of genny shows that it work completely in macro land without passing strings around for exporting |
18:33:53 | FromDiscord | <leorize> in that case you have all the information you need |
18:34:04 | FromDiscord | <noiryuh> sent a code paste, see https://play.nim-lang.org/#ix=477p |
18:34:32 | FromDiscord | <noiryuh> i'm interested in `procParams` |
18:35:30 | FromDiscord | <leorize> you want to know which of those are `ref T` or something? |
18:35:39 | FromDiscord | <noiryuh> yeah |
18:35:53 | FromDiscord | <noiryuh> i'm reading str/macros |
18:36:16 | FromDiscord | <leorize> if you use `typeKind` you should be able to get `ntyRef` from the symbols |
18:36:28 | FromDiscord | <leorize> ofc, there's also `ntyAlias` to handle as well |
18:37:39 | FromDiscord | <noiryuh> ? |
18:37:42 | FromDiscord | <noiryuh> sent a code paste, see https://play.nim-lang.org/#ix=477q |
18:37:42 | FromDiscord | <leorize> yep |
18:38:27 | FromDiscord | <noiryuh> thank you |
18:38:28 | FromDiscord | <leorize> I guess a good start would be to see how the C backend handles them? |
18:38:40 | FromDiscord | <noiryuh> he uses `long long` |
18:39:35 | FromDiscord | <noiryuh> i'm not C expert, but i could feel something wrong when using `long long` for pointer |
18:39:50 | FromDiscord | <leorize> that's just a cheap cop-out \:P |
18:40:02 | FromDiscord | <leorize> yea, you'd want to export the type properly |
18:40:27 | FromDiscord | <noiryuh> sent a code paste, see https://play.nim-lang.org/#ix=477r |
18:40:59 | FromDiscord | <noiryuh> In reply to @leorize "that's just a cheap": he went with the easy path↵but it's easy to somehow modify the value |
18:41:23 | FromDiscord | <noiryuh> unsafe, i guess |
18:42:18 | FromDiscord | <Forest> sent a code paste, see https://play.nim-lang.org/#ix=477s |
18:42:18 | FromDiscord | <Forest> But uh, looks janky as hell |
18:42:27 | FromDiscord | <leorize> well, handling Nim type AST is certainly a pain, so I can understand why they wouldn't want to work with that |
18:42:29 | FromDiscord | <Phil> We don't have a convenience proc to get a number of fields in a type right? I do have to use fieldpairs, correct? |
18:42:33 | FromDiscord | <Forest> Is there a better way to write it to be more idiomatic? |
18:42:55 | FromDiscord | <Phil> Or any other iterator |
18:43:22 | FromDiscord | <leorize> yea, you can probably get away with `getType` and take it's length from a macro, ymmv a lot↵(@Phil) |
18:45:02 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=477t |
18:47:11 | * | neceve quit (Ping timeout: 268 seconds) |
18:52:39 | FromDiscord | <leorize> funny how we have tupleLen but no objectLen |
18:54:51 | FromDiscord | <noiryuh> if i have 2 proc with same name |
18:55:08 | FromDiscord | <noiryuh> how `typeof` could know which it should use |
18:58:01 | FromDiscord | <leorize> it doesn't, there will be an ambiguous error |
18:58:22 | FromDiscord | <leorize> a way to "select" is to manually convert the function type, but it's unreliable |
19:03:50 | FromDiscord | <noiryuh> 🤔 |
19:13:14 | FromDiscord | <ShalokShalom> https://nim-lang.org/docs/tut2.html |
19:14:09 | FromDiscord | <ShalokShalom> How does Nim composition?↵↵This tutorials mentions TWO TIMES how composition is preferable over inheritance and does also show how to do inheritance |
19:14:33 | FromDiscord | <ShalokShalom> And it does NOT show how to do composition xD |
19:14:51 | FromDiscord | <leorize> c |
19:15:10 | FromDiscord | <exelotl> composition is just objects with objects in them |
19:15:12 | FromDiscord | <leorize> composition requires a different design paradigm so that it doesn't turn into "inheritance but I don't say inherit" |
19:15:30 | FromDiscord | <ShalokShalom> I mean code examples |
19:15:36 | FromDiscord | <leorize> it's definitely a bad match for cases crafted to demonstrate inheritance |
19:15:42 | FromDiscord | <ShalokShalom> Explenations |
19:16:00 | FromDiscord | <exelotl> sent a code paste, see https://play.nim-lang.org/#ix=477B |
19:16:18 | FromDiscord | <ShalokShalom> How can you say x is better than y, and then dont show how x works |
19:16:27 | FromDiscord | <ShalokShalom> And do show how to use y |
19:16:45 | FromDiscord | <ShalokShalom> It doesn't take a 5 year old to detect that |
19:16:51 | FromDiscord | <exelotl> why not make a PR to improve it then? |
19:17:18 | FromDiscord | <leorize> I think that particular tutorial is flawed from the start \:P |
19:17:21 | FromDiscord | <ShalokShalom> I am asking how composition works |
19:18:02 | FromDiscord | <ShalokShalom> In reply to @leorize "I think that particular": I have never seen any documentation so high in volume and low on quality |
19:18:25 | FromDiscord | <ShalokShalom> Like, there is basically every described, its just borderline hard to find it |
19:18:50 | FromDiscord | <ShalokShalom> Or it's not there in there first place, and that counts for the really fundamental stuff |
19:18:56 | FromDiscord | <leorize> ikr |
19:18:59 | FromDiscord | <exelotl> it used to be worse |
19:19:07 | FromDiscord | <ShalokShalom> I would also like to know, if there is any composition operator |
19:19:33 | FromDiscord | <ShalokShalom> Like, in FSharp, Haskell and even Ruby can I compose functions with an operator |
19:19:45 | FromDiscord | <ShalokShalom> Googling this brought me to that tutorial |
19:20:27 | FromDiscord | <ShalokShalom> Since obviously even Google thought mentioning it twice in a favorable sense might indicate some description |
19:20:37 | FromDiscord | <exelotl> composition in functional language is not the same as composition for modelling object types |
19:20:48 | FromDiscord | <ShalokShalom> Yeah, I know |
19:21:09 | FromDiscord | <Forest> Would it be better to implement a new 'backend' to another language the way Nim does it for C, JS, etc, or is just using the AST tree from Nim okay? |
19:21:44 | FromDiscord | <ShalokShalom> The guys from Nimskull mean its pretty broken |
19:21:49 | FromDiscord | <ShalokShalom> The current backends |
19:22:43 | FromDiscord | <ShalokShalom> There is nlvm https://github.com/arnetheduck/nlvm |
19:23:09 | FromDiscord | <ShalokShalom> This is a pure Nim -> LLVM compiler, so free from old baggage |
19:23:41 | FromDiscord | <ShalokShalom> Despite from the type of baggage, that counts like a feature ;) |
19:24:08 | FromDiscord | <Forest> In reply to @ShalokShalom "The guys from Nimskull": Wdym? |
19:24:46 | FromDiscord | <Forest> In reply to @ShalokShalom "This is a pure": Yeah I've seen that but not what i really want or need |
19:25:04 | FromDiscord | <Forest> I wanna be able to make Nim generate pure Python or Lua code |
19:26:22 | FromDiscord | <leorize> I'd recommend implementing a new backend in the compiler, the macro life is painful and thankless |
19:27:00 | FromDiscord | <leorize> also, you need transformations like `for` -\> `while`, `expr` -\> temporaries, and only the compiler provides facility for those |
19:32:51 | * | jmdaemon joined #nim |
19:49:15 | FromDiscord | <Forest> Ah okay, thanks ^^ |
19:49:22 | FromDiscord | <Forest> God it just looks so complicated lmao |
19:50:24 | FromDiscord | <Aiz> sent a code paste, see https://play.nim-lang.org/#ix=477G |
19:50:39 | FromDiscord | <Bubblie> what does a C struct look like in nim? |
19:51:07 | FromDiscord | <leorize> any `object` would do |
19:51:19 | FromDiscord | <Aiz> sent a code paste, see https://play.nim-lang.org/#ix=477I |
19:52:06 | FromDiscord | <Aiz> sent a code paste, see https://play.nim-lang.org/#ix=477J |
19:52:13 | FromDiscord | <Bubblie> In reply to @leorize "any `object` would do": thanks :) |
19:52:18 | FromDiscord | <leorize> you don't need to index, the type AST is kinda stupid |
19:53:17 | FromDiscord | <Aiz> but `sym.getTypeInst` is `typeDesc[Bar]`↵so i have to access `[1]` to get typeKind of `Bar` |
19:54:25 | FromDiscord | <Aiz> if i use it directly by `sym.typeKind` then it will be `ntyTypeDesc` |
19:55:09 | * | Guest2776 quit (Excess Flood) |
19:55:22 | * | Guest2776 joined #nim |
19:56:14 | FromDiscord | <Aiz> oh, i have logined the wrong account |
19:56:42 | FromDiscord | <noiryuh> lol |
19:57:14 | FromDiscord | <noiryuh> multiple accounts problem |
19:59:55 | * | Guest2776 quit (Ping timeout: 268 seconds) |
20:00:02 | FromDiscord | <leorize> only access `[1]` if the container is `ntyTypeDesc` |
20:00:56 | FromDiscord | <leorize> yea this is why I hate nim's type ast |
20:01:45 | FromDiscord | <leorize> https://github.com/alaviss/union/blob/main/union/typeutils.nim#L21-L34 \<- I have tools for this stuff |
20:03:59 | FromDiscord | <Aiz> In reply to @leorize "you don't need to": that's true |
20:04:20 | FromDiscord | <Aiz> i used `sys.typeKind` directly and it somehow worked |
20:04:54 | FromDiscord | <Aiz> (edit) "`sys.typeKind`" => "`sym.typeKind`" |
20:08:38 | FromDiscord | <mratsim> In reply to @leorize "yea this is why": PTSD from 5 years ago |
20:08:46 | FromDiscord | <mratsim> I raised so many type issues |
20:31:22 | FromDiscord | <Forest> sent a code paste, see https://play.nim-lang.org/#ix=477T |
20:31:39 | FromDiscord | <Forest> Both me and a friend has tried taking a crack at it but we really don't get it (and the docs don't help) |
20:32:21 | FromDiscord | <leorize> hmm I never knew that you can do it like that, kinda risky, though |
20:33:43 | FromDiscord | <Forest> That's just the C code lmao |
20:34:06 | FromDiscord | <Forest> Need the Nim equivalent but just, can't port it? It's hard as hell |
20:34:20 | FromDiscord | <Bubblie> I understand the C code but when I try to convert it to nim code I just absolutely :reducedtoatoms: |
20:36:00 | FromDiscord | <!Patitotective> i dont understand the code, is it calling a `wgpuAdapterRequestDevice` function with `adatapter` and some struct? |
20:36:21 | FromDiscord | <leorize> there you go |
20:36:23 | FromDiscord | <leorize> sent a code paste, see https://play.nim-lang.org/#ix=477W |
20:37:14 | FromDiscord | <Forest> Thank you, you don't understand how much of a lifesaver you are- |
20:38:03 | FromDiscord | <Bubblie> YOU REALLY HELPED US SO MUCH |
20:38:04 | FromDiscord | <Bubblie> THANK YOU! |
20:38:58 | FromDiscord | <leorize> so some tips for handling this\: `(type) {}` is struct construction (I guess this is GNU C syntax?) and `&` is the address taking operator |
20:39:25 | FromDiscord | <Forest> Yup we understand that, it was just, wow |
20:40:52 | FromDiscord | <Bubblie> yeah it is just a matter of actually applying these concepts to nim, because as much as I love this language im use to languages like C/C++ so im still somewhat inexperienced with nim itself |
20:41:28 | FromDiscord | <leorize> this code is plenty unsafe so make sure you encapsulate it in a function or something |
20:43:18 | FromDiscord | <Bubblie> yeah, we are putting it all into a procedure so it is all handled there |
20:49:53 | * | krux02 quit (Remote host closed the connection) |
20:50:46 | * | krux02 joined #nim |
21:11:39 | FromDiscord | <Bubblie> sent a code paste, see https://play.nim-lang.org/#ix=4785 |
21:12:09 | FromDiscord | <Bubblie> (edit) "https://play.nim-lang.org/#ix=4785" => "https://play.nim-lang.org/#ix=4786" |
21:14:31 | FromDiscord | <Bubblie> I am pretty sure i cannot cast a ptr Chainedstruct to Surfacedescriptorfromwindowshwnd but im not sure exactly how to cast it like C does |
21:18:25 | FromDiscord | <Bubblie> if anyone has anything please let me know :) |
21:43:08 | FromDiscord | <Bubblie> sent a code paste, see https://play.nim-lang.org/#ix= |
21:43:10 | FromDiscord | <Bubblie> specifically this |
21:43:17 | FromDiscord | <Bubblie> how do I write something like this in nim? |
21:43:21 | FromDiscord | <Forest> Oh, nim has a cast function iirc |
21:43:26 | FromDiscord | <Forest> Uh lemme see |
21:43:33 | FromDiscord | <Bubblie> yeah but how would this cast work :thonk: |
21:43:50 | FromDiscord | <Forest> https://nim-by-example.github.io/variables/type_casting_inference/ |
21:44:05 | FromDiscord | <Forest> There ^^ |
21:45:02 | FromDiscord | <Forest> @Bubblie read- |
21:45:49 | FromDiscord | <Bubblie> sent a code paste, see https://play.nim-lang.org/#ix= |
21:48:44 | FromDiscord | <Bubblie> WAIT |
21:48:53 | FromDiscord | <Bubblie> I may have got it im gonna try running it now |
21:49:22 | FromDiscord | <Forest> Eyy! |
21:52:30 | FromDiscord | <Bubblie> nope |
21:52:32 | FromDiscord | <Bubblie> LMFAO |
21:52:58 | FromDiscord | <Forest> Oof- |
21:53:02 | FromDiscord | <Forest> What's the issue now? |
21:54:22 | FromDiscord | <Bubblie> I don't really know |
21:57:18 | FromDiscord | <Forest> Sadge |
21:58:17 | FromDiscord | <Bubblie> hmmm |
21:58:46 | FromDiscord | <Bubblie> sent a code paste, see https://play.nim-lang.org/#ix=478p |
22:03:10 | FromDiscord | <leorize> looks correct with that modification, though not sure what's up with those names |
22:03:45 | FromDiscord | <leorize> btw HInstance is a pointer on its own |
22:03:50 | FromDiscord | <leorize> you don't need to ptr it |
22:06:15 | FromDiscord | <Bubblie> oh okay |
22:06:27 | FromDiscord | <Bubblie> yeah im trying to figure this out 😅 |
22:06:31 | FromDiscord | <!Patitotective> you dont have to do `: type`↵nim can infer it |
22:07:42 | FromDiscord | <Bubblie> the names need to be fixed |
22:07:48 | FromDiscord | <Bubblie> we are just fixing them as we go |
22:08:00 | FromDiscord | <leorize> sent a code paste, see https://play.nim-lang.org/#ix=478t |
22:08:33 | FromDiscord | <leorize> that one should have all type issues handled |
22:08:54 | FromDiscord | <leorize> except for the nextInChain, I might have used the wrong type but it's easy fix |
22:11:08 | FromDiscord | <Bubblie> sent a code paste, see https://play.nim-lang.org/#ix=478v |
22:11:19 | FromDiscord | <Bubblie> god :reducedtoatoms: |
22:11:25 | FromDiscord | <leorize> you can cast it to pointer |
22:11:37 | FromDiscord | <leorize> HInstance should be a pointer, probably a distinct type |
22:12:04 | FromDiscord | <leorize> or worse, some one wrapped it as `int`, not wrong, but that's C for you |
22:12:17 | FromDiscord | <Bubblie> C is the bane of my existence |
22:12:50 | FromDiscord | <Bubblie> should I check Winim to see if it was wrapped as an int? |
22:13:12 | FromDiscord | <leorize> winim is auto generated from mingw iirc, and some types are marked as int there... |
22:13:22 | FromDiscord | <Bubblie> oh |
22:13:29 | FromDiscord | <leorize> sent a code paste, see https://play.nim-lang.org/#ix=478w |
22:14:08 | FromDiscord | <leorize> iirc winim wraps HANDLE and its derivatives as `int` since they're not really pointers, just pointer-sized |
22:15:41 | FromDiscord | <Bubblie> I see |
22:16:21 | FromDiscord | <Forest> In reply to @leorize "or worse, some one": I can use futhark to retype it but idk the expected type |
22:16:42 | FromDiscord | <Bubblie> sent a code paste, see https://play.nim-lang.org/#ix=478x |
22:16:52 | FromDiscord | <leorize> same type |
22:17:21 | FromDiscord | <Forest> So just retype it to int? Or cuint? |
22:17:22 | FromDiscord | <leorize> all `H` types are different names of `HANDLE` specialized for a particular purpose |
22:17:22 | FromDiscord | <Bubblie> oh okay |
22:17:50 | FromDiscord | <leorize> C doesn't have `distinct` like Nim so people use whatever they can think of at the time |
22:18:29 | FromDiscord | <Bubblie> C truly is one of kind 😭 |
22:19:18 | FromDiscord | <Elegantbeef> Hey C has distinct, you just make a new struct with a field named `data` that's the type you want then tediously handle everything related to that 😄 |
22:19:19 | FromDiscord | <leorize> better yet you retype it to `winim.HINSTANCE` \:P↵(@Forest) |
22:19:54 | FromDiscord | <Elegantbeef> Sadly it's not cause we have C++, Carbon, C--, .... |
22:21:22 | FromDiscord | <Bubblie> Carbon is um... interesting |
22:21:26 | FromDiscord | <Bubblie> I can't say I like it or dislike it |
22:21:32 | FromDiscord | <Bubblie> I feel like it just, exists |
22:23:21 | FromDiscord | <Forest> In reply to @leorize "better yet you retype": I mean i could do that |
22:23:55 | FromDiscord | <Forest> However uh, that should only be done when Nim is running on windows |
22:24:07 | FromDiscord | <Forest> Let me see... Futhark lets ya redefine functions so- |
22:24:45 | FromDiscord | <Forest> In reply to @Bubblie "yeah for some reason": Bub, exact code giving that error? The line? |
22:24:52 | FromDiscord | <leorize> I mean, aside from the winim flaw that it could only be installed on Windows, it's fine to retype it like that |
22:24:56 | FromDiscord | <Forest> Where is HINSTANCE from? |
22:25:08 | FromDiscord | <leorize> remember that Nim is a cross-compiler at heart |
22:25:23 | FromDiscord | <Bubblie> In reply to @Forest "Where is HINSTANCE from?": winim |
22:25:27 | FromDiscord | <Forest> In reply to @leorize "I mean, aside from": Oh so it'll just keep it as int otherwise? |
22:25:39 | FromDiscord | <Forest> So what do i need to retype exactly- brain is ded |
22:26:22 | FromDiscord | <Bubblie> definitely um |
22:26:24 | FromDiscord | <Bubblie> doing something wrong |
22:26:25 | FromDiscord | <Bubblie> sent a code paste, see https://play.nim-lang.org/#ix=478y |
22:26:36 | FromDiscord | <leorize> retype your hInstance field to use the actual HINSTANCE type |
22:26:41 | FromDiscord | <Bubblie> sent a code paste, see https://play.nim-lang.org/#ix=478z |
22:26:42 | FromDiscord | <Forest> Yeah i think it's due to a binding error (I'm using to fix) |
22:26:47 | FromDiscord | <Forest> In reply to @leorize "retype your hInstance field": Alright! |
22:28:26 | FromDiscord | <leorize> at least that's what I can infer from the snippets you've sent |
22:28:26 | FromDiscord | <leorize> `Requestadaptercallback` -\@Bubblie) |
22:29:22 | FromDiscord | <leorize> the one with capital `R` is probably the type of the one with lower case `r` |
22:30:24 | FromDiscord | <Bubblie> it seems to not be 💀 |
22:30:34 | FromDiscord | <leorize> you got the C code then? |
22:30:37 | FromDiscord | <Bubblie> yea |
22:31:04 | FromDiscord | <Bubblie> sent a code paste, see https://play.nim-lang.org/#ix=478C |
22:31:05 | FromDiscord | <Bubblie> (edit) "https://play.nim-lang.org/#ix=478C" => "https://paste.rs/vuf" |
22:31:05 | FromDiscord | <Bubblie> btw I just wanted to say thank you so much for helping me out with this |
22:31:29 | FromDiscord | <Bubblie> do you want the github link of the entire native example? |
22:31:39 | FromDiscord | <Bubblie> https://github.com/gfx-rs/wgpu-native/blob/master/examples/triangle/main.c feel like it would be easier to view |
22:31:44 | FromDiscord | <leorize> since it's a callback, I think you have to write one yourself |
22:32:11 | FromDiscord | <leorize> yea you need to write your own, the example imports this one\: https://github.com/gfx-rs/wgpu-native/blob/master/examples/framework.c#L32 |
22:32:11 | FromDiscord | <Bubblie> ? |
22:32:18 | FromDiscord | <Bubblie> oh |
22:32:24 | FromDiscord | <Bubblie> 😭 thank you for pointing that out |
22:32:46 | FromDiscord | <Bubblie> okay that begs the question what the hell is that binding even used for what... |
22:32:55 | FromDiscord | <Bubblie> not gonna question it |
22:38:30 | FromDiscord | <Bubblie> wait how is C calling request_adapter_callback without filling in the parameters wtf it is just blank |
22:38:46 | FromDiscord | <Elegantbeef> pointer procedure |
22:38:51 | FromDiscord | <leorize> it's a function pointer |
22:39:46 | FromDiscord | <Bubblie> oh |
22:39:49 | FromDiscord | <Bubblie> god I suck at C |
22:40:54 | FromDiscord | <Bubblie> so what does a pointer procedure look like in nim in that case |
22:41:07 | FromDiscord | <Elegantbeef> the name of the procedure |
22:41:48 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=478D |
22:42:08 | FromDiscord | <Bubblie> ah okay |
22:45:52 | FromDiscord | <Bubblie> so in my case I have parameters and it isn't void so, would I use a lambda or something? |
22:46:01 | FromDiscord | <Bubblie> sorry |
22:46:17 | FromDiscord | <Elegantbeef> You could use a anonymous procedure if you want |
22:47:01 | FromDiscord | <Bubblie> ? |
22:47:24 | FromDiscord | <Elegantbeef> Pointer procedures work the same regardless of the procedure's type |
22:47:49 | FromDiscord | <Elegantbeef> you can take the address of `proc doThing(a: int): string` just the same as a void proc |
22:48:38 | FromDiscord | <Bubblie> is there a code example of an anonymous procedure in nim? |
22:48:51 | FromDiscord | <Elegantbeef> `var a = proc() = echo "Hello"` |
22:49:08 | FromDiscord | <Bubblie> oh I see |
22:53:05 | FromDiscord | <Bubblie> sent a code paste, see https://play.nim-lang.org/#ix=478H |
22:53:17 | FromDiscord | <Elegantbeef> `userData: pointer` |
22:53:43 | FromDiscord | <Bubblie> ah |
22:59:48 | FromDiscord | <Bubblie> okay so I think I need to have the proc return the Requestadaptercallback binding that exists, based on the procedure callback I just made and its parameters? |
23:00:34 | FromDiscord | <Bubblie> because InstanceRequestAdapter seems to be only taking in Requestadaptercallback (not proper casing I know this was generated) |
23:03:24 | FromDiscord | <leorize> no, that type is the type of the proc itself |
23:03:30 | FromDiscord | <Bubblie> oh |
23:03:38 | FromDiscord | <leorize> also, mark your proc with `{.cdecl.}` |
23:03:39 | FromDiscord | <Bubblie> oh shit yeah you are right 😓 |
23:03:52 | FromDiscord | <Bubblie> In reply to @leorize "also, mark your proc": the anonymous proc right |
23:05:39 | FromDiscord | <Bubblie> okay I marked it |
23:05:59 | FromDiscord | <Forest> Issue, I can't import winim on Termux to compile it |
23:06:12 | FromDiscord | <Forest> (I generate the bindings on Termux and use the outputted file in the cache) |
23:07:24 | FromDiscord | <Bubblie> sent a code paste, see https://play.nim-lang.org/#ix=478L |
23:08:40 | FromDiscord | <!Patitotective> what's this channel if not to ask |
23:09:09 | FromDiscord | <!Patitotective> what is `Requestadaptercallback_436208375`¡ |
23:09:10 | FromDiscord | <!Patitotective> (edit) "`Requestadaptercallback_436208375`¡" => "`Requestadaptercallback_436208375`?" |
23:11:30 | FromDiscord | <Forest> Futhark lmao |
23:12:49 | FromDiscord | <Forest> In reply to @Forest "(I generate the bindings": But ye this is my issue.... Wait is there a way to make a generic type that'll do different things on windows and other distros? |
23:12:51 | FromDiscord | <Forest> Or |
23:12:57 | FromDiscord | <Bubblie> so the numbers are because of futhark, but Requestadaptercallback is a callback that is part of wgpu, and it was generated from the header file. It is supposed to be a type of the callback which is technically a proc but yeah |
23:13:05 | FromDiscord | <Forest> Because it still needs to compile on Termux |
23:13:17 | FromDiscord | <Forest> (Aarch64 linux environment) |
23:14:22 | FromDiscord | <leorize> complain to nimble to disable building the winim generator binary \:P then you can use winim like, anywhere |
23:14:33 | FromDiscord | <leorize> alternatively just don't retype it at all |
23:15:28 | FromDiscord | <Forest> Wdym? |
23:15:57 | FromDiscord | <Forest> In reply to @leorize "alternatively just don't retype": You suggested retyping it :p |
23:16:38 | FromDiscord | <Bubblie> sent a code paste, see https://play.nim-lang.org/#ix=478N |
23:16:45 | FromDiscord | <Forest> I mean, i could make two separate bindings but uh, not really what i wanna do |
23:16:45 | FromDiscord | <leorize> what I meant is, if you can't retype it, don't |
23:17:00 | FromDiscord | <Forest> Oooh okay |
23:17:43 | FromDiscord | <leorize> the only way is to read up on what that weird type is↵(@Bubblie) |
23:18:13 | FromDiscord | <Bubblie> alright |
23:18:49 | FromDiscord | <leorize> ah, I found it, `message` is cstring |
23:19:03 | FromDiscord | <leorize> your message is cuchar |
23:19:12 | FromDiscord | <leorize> (yea, I wish that the error for this one is better too) |
23:19:23 | FromDiscord | <Bubblie> thank you 😭 |
23:21:30 | FromDiscord | <Forest> Wonder if i can provide a stub type thing- |
23:21:48 | FromDiscord | <Forest> Not important now anyway |
23:22:03 | FromDiscord | <Bubblie> what the hell is this type :thonk: |
23:22:36 | FromDiscord | <Forest> Wdym? |
23:22:54 | FromDiscord | <Bubblie> the type of the proc Requestadaptercallback |
23:23:49 | FromDiscord | <Bubblie> In reply to @leorize "the only way is": should I dig through the bindings for this |
23:25:14 | FromDiscord | <Bubblie> the proc is well, void if that counts? |
23:26:15 | FromDiscord | <Forest> In reply to @Bubblie "the type of the": The proc itself is `requestadaptercallback` afaik |
23:27:35 | FromDiscord | <Bubblie> sent a code paste, see https://play.nim-lang.org/#ix= |
23:27:43 | FromDiscord | <Bubblie> in the generated bindings |
23:27:58 | FromDiscord | <Bubblie> @Forest |
23:28:02 | FromDiscord | <Bubblie> sent a code paste, see https://play.nim-lang.org/#ix=478P |
23:28:18 | FromDiscord | <Forest> Huh |
23:28:24 | FromDiscord | <Forest> Did you do git pull? |
23:28:31 | FromDiscord | <Forest> Procs should be lowercase |
23:28:52 | FromDiscord | <Bubblie> lemme pull |
23:29:21 | FromDiscord | <Forest> Aight |
23:29:49 | FromDiscord | <Bubblie> it uh |
23:29:50 | FromDiscord | <Bubblie> didn't change |
23:30:03 | FromDiscord | <Bubblie> did you push? |
23:31:00 | FromDiscord | <Bubblie> @Forest |
23:31:40 | FromDiscord | <Forest> I definitely did |
23:32:58 | FromDiscord | <Bubblie> why hasnt it changed then wtf |
23:34:15 | FromDiscord | <Bubblie> im on the github |
23:34:20 | FromDiscord | <Bubblie> yeah none of the procs changed |
23:44:05 | FromDiscord | <Forest> No idea |
23:44:08 | FromDiscord | <Forest> Huh that's... Odd |
23:44:17 | FromDiscord | <Forest> Regenerating them now anyway (with improved casing) |
23:48:07 | FromDiscord | <Bubblie> Why was making the triangle for nim vulkan easier than this 😭 |
23:48:44 | FromDiscord | <gaopow> hey all, new to nim and cross-compiling (coming from a data science background). I currently have a script that i've written on an m1 mac and am trying to cross-compile for ubuntu x86_64. Can't seem to get it to work (missing things like `read.c` and `nimbase.h`). I've tried looking online, but I think it's a bit over my head. Where would be the best place to discuss this issue? Happy to redirect to a more appropriate location |
23:50:07 | FromDiscord | <leorize> cross compiling is just hard, don't worry |
23:50:23 | FromDiscord | <leorize> you'll need a C cross-compiler for linux first |
23:51:08 | FromDiscord | <gaopow> something like musl? |
23:51:47 | FromDiscord | <gaopow> was also looking into docker cross-compilers |
23:51:51 | FromDiscord | <leorize> not really, you need an actual, real, C cross-compiler to Linux, in this case for Ubuntu, you're targeting glibc |
23:52:01 | FromDiscord | <leorize> looks like this stuff is just non-existent for OSX |
23:52:07 | FromDiscord | <leorize> your other solution is to run a VM then |
23:53:02 | FromDiscord | <leorize> yea, if you can run linux docker images, that'd be a very easy way to get this working |
23:53:39 | FromDiscord | <!Patitotective> In reply to @gaopow "hey all, new to": just use github actions |
23:55:42 | FromDiscord | <gaopow> so in either case, i would find something with an ubuntu x86 base, install nim and any dependencies I need, and then just compile it in that environment? |
23:56:26 | FromDiscord | <!Patitotective> github actions has runners, ubuntu, windows and macos↵https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners |
23:56:44 | FromDiscord | <!Patitotective> heres an example https://github.com/Patitotective/ImTemplate/actions/workflows/build.yml |
23:59:04 | FromDiscord | <gaopow> Thanks -- I'll try that |
23:59:19 | FromDiscord | <Forest> Can futhark rename fields? |