00:07:52 | * | luis_ quit (Ping timeout: 252 seconds) |
00:25:31 | FromDiscord | <SandwichBop> silly question, project idea suggestions for nim? idk the ideas that first come to mind are all gamedev related but at that point I should be using Unreal engine and that defeats the spirit of using nim :nim1: |
00:25:58 | FromDiscord | <SandwichBop> (edit) "silly question, ... project" added "for fun" |
00:26:03 | FromDiscord | <Elegantbeef> Seems like an odd take |
00:26:27 | FromDiscord | <SandwichBop> please enligthen me, I'm trying to brainstorm ways to jumpstart my nim learning |
00:26:34 | FromDiscord | <Elegantbeef> Make a game in Nim if you want to, join the club, it's not very exclusive |
00:27:04 | FromDiscord | <Elegantbeef> A good place to start is https://github.com/ftsf/nico |
00:27:06 | nrds | <R2D299> itHub: 7"a Game Framework in Nim inspired by Pico-8." |
00:27:31 | FromDiscord | <SandwichBop> lol I've made games before with Pico8, it's really cozy but idk it feels like I should be using Lua |
00:27:43 | FromDiscord | <SandwichBop> I don't know better, maybe nim really is much better for gamedev lol |
00:27:47 | FromDiscord | <Elegantbeef> That's not pico |
00:27:51 | FromDiscord | <SandwichBop> O |
00:27:56 | FromDiscord | <SandwichBop> I was misread, sorry lol |
00:28:12 | FromDiscord | <Elegantbeef> My main focus with Nim is gamedev, it's a fantastic language for it imo |
00:28:42 | FromDiscord | <SandwichBop> I think so too, but I was a bit discouraged when I saw that the Unreal Engine Nim Wrappers weren't being maintained |
00:28:56 | FromDiscord | <SandwichBop> I love how Nim can compile to C/C++, would be perfect for working with most if not all game engines |
00:29:02 | FromDiscord | <SandwichBop> (edit) "I love how Nim can compile to C/C++, would be perfect for working with most if not all ... game" added "major" |
00:29:31 | FromDiscord | <Elegantbeef> Yea, rolling your own is also a viable path |
00:30:58 | FromDiscord | <impbox [ftsf]> things don't tend to get maintained if they don't get used, so use and maintain them if you like. i maintain nico because i use it for my own games. otherwise maintaining a library that you're not using isn't much fun |
00:31:07 | FromDiscord | <impbox [ftsf]> but yeah, nim is great for gamedev |
00:31:25 | FromDiscord | <impbox [ftsf]> though takes some getting used to if you're from a more OOPy world |
00:32:31 | FromDiscord | <RattleyCooper> In reply to @SandwichBop "silly question, for fun": I've been thinking about trying to make something like google's python fire but am holding off until I'm a bit better with nim and know the stdlib better |
00:32:33 | FromDiscord | <SandwichBop> In reply to @impbox "things don't tend to": O I didn't really think about that, that's a great idea |
00:32:41 | FromDiscord | <SandwichBop> maybe I should maintain the Unreal engine wrappers myself for Nim |
00:33:07 | FromDiscord | <SandwichBop> but I don't think I understand how wrappers are supposed to be maintained, anyone know of reading material? maybe some book for such a task lol |
00:33:13 | FromDiscord | <SandwichBop> (edit) "understand" => ""understand:" |
00:33:16 | FromDiscord | <SandwichBop> (edit) ""understand:" => ""understand"" |
00:33:18 | FromDiscord | <RattleyCooper> make nim-fire so I don't have to 😛 |
00:33:36 | FromDiscord | <SandwichBop> In reply to @RattleyCooper "I've been thinking about": same i don't know the nim or stdlib enough to tackle the bigger projects |
00:33:41 | FromDiscord | <SandwichBop> but no reason not try lol |
00:33:44 | FromDiscord | <impbox [ftsf]> but i'd recommend making games instead of libraries/wrappers |
00:33:44 | FromDiscord | <SandwichBop> (edit) "lol" => "lol, lots to learn" |
00:33:57 | FromDiscord | <impbox [ftsf]> make a game and you get the library for free when you're done |
00:34:04 | FromDiscord | <SandwichBop> smart 🧠 |
00:34:17 | FromDiscord | <SandwichBop> guess I'll play around with SDL2, seems to play well with nim |
00:34:35 | FromDiscord | <impbox [ftsf]> yea, i recommend the sdl2_nim library over sdl2 |
00:34:58 | FromDiscord | <impbox [ftsf]> there are two competing sdl2 wrappers for nim |
00:35:07 | FromDiscord | <Elegantbeef> impbox did you manage to take a look at the gpl/png issue i had? |
00:35:14 | FromDiscord | <impbox [ftsf]> not yet, it's on my list for today |
00:35:22 | FromDiscord | <impbox [ftsf]> after piano practice |
00:35:58 | FromDiscord | <SandwichBop> In reply to @impbox "yea, i recommend the": is this the one? o:↵https://github.com/Vladar4/sdl2_nim |
00:36:01 | nrds | <R2D299> itHub: 7"Wrapper of the SDL 2 library for the Nim language." |
00:36:05 | FromDiscord | <impbox [ftsf]> yup |
00:36:11 | FromDiscord | <SandwichBop> ayyy thank you, I'll try it out 🙏 |
00:36:20 | FromDiscord | <SandwichBop> gonna try and make some N64 tier game |
00:43:50 | FromDiscord | <Elegantbeef> You could also use godot and it's bindings those are maintained 😀 |
00:45:13 | FromDiscord | <SandwichBop> O I never knew, guess I'll get a 2 in 1, learn Nim and Godot lol |
00:45:25 | FromDiscord | <SandwichBop> wonder if the Godot devs will ever consider using Nim for their engine lol |
00:45:38 | FromDiscord | <Elegantbeef> Nope |
00:45:43 | FromDiscord | <SandwichBop> rip, how come? |
00:45:43 | FromDiscord | <Elegantbeef> Gdnim is probably the best way to use nim in godot |
00:46:25 | FromDiscord | <Elegantbeef> It's written in C++ and what's the benefit to using Nim built in for them, they already have a similar Gdscript |
00:46:27 | FromDiscord | <Elegantbeef> https://github.com/geekrelief/gdnim is what i was talking about |
00:46:30 | nrds | <R2D299> itHub: 7"godot-nim based bootstrapping framework supporting hot reloading" |
00:47:30 | * | jkl quit (Quit: Gone.) |
00:48:15 | FromDiscord | <SandwichBop> o looks neat, tho maybe a bit too experimental for me to try out without knowing better lol |
00:48:52 | * | jkl joined #nim |
00:49:38 | FromDiscord | <Elegantbeef> I'd say Nico is a good place to start, easy to use and setup |
00:51:41 | FromDiscord | <SandwichBop> will try it out, thanks Elegantbeef :nim1: |
00:59:27 | * | krux02 quit (Remote host closed the connection) |
01:05:45 | FromDiscord | <Elegantbeef> @impbox [ftsf]\: well i have a PR for the GPL parsing issue, this makes it more intelligent, capable of handing any seperator between the 3 colours |
01:06:04 | FromDiscord | <Elegantbeef> Did look at the colour and have 0 idea why it's failing |
01:06:11 | FromDiscord | <Elegantbeef> at the png\ |
01:06:26 | FromDiscord | <Elegantbeef> Think it's cause it's' trying to parse it as a paletted image? |
01:16:36 | * | neurocyte6 joined #nim |
01:16:36 | * | neurocyte6 quit (Changing host) |
01:16:36 | * | neurocyte6 joined #nim |
01:18:49 | * | neurocyte quit (Ping timeout: 252 seconds) |
01:18:49 | * | neurocyte6 is now known as neurocyte |
01:47:40 | FromDiscord | <impbox [ftsf]> mm loadPaletteFromImage is broken if it's a paletted image |
01:47:47 | FromDiscord | <impbox [ftsf]> easy enough to fix |
02:06:44 | FromDiscord | <Elegantbeef> \anyone else have something for "This month with nim" |
02:06:45 | FromDiscord | <Elegantbeef> anyone else have something for "This month with nim" |
02:10:17 | FromDiscord | <Yardanico> Maybe goodboy galaxy? But you'll have to ask exelotl |
02:10:29 | FromDiscord | <Elegantbeef> Already got that |
02:10:33 | FromDiscord | <Yardanico> heh |
02:11:12 | FromDiscord | <Elegantbeef> Seems it's a dead landscape of nothing cool 😀 |
02:21:08 | FromDiscord | <retkid> In reply to @SandwichBop "I love how Nim": problem is you gotta shadow the libraries |
02:21:19 | FromDiscord | <retkid> or figure out some way to accsess them |
02:21:21 | FromDiscord | <retkid> (edit) "accsess" => "access" |
02:21:51 | FromDiscord | <Elegantbeef> "shadow"? |
02:21:56 | FromDiscord | <Elegantbeef> You mean bind them |
02:22:23 | FromDiscord | <SandwichBop> what do u mean by shadow? like Unreal engine has their entire source on github so u can make a wrapper for it, hard part would be having someone actually maintaining it as it chages |
02:22:25 | FromDiscord | <SandwichBop> (edit) "chages" => "changes" |
02:22:28 | FromDiscord | <impbox [ftsf]> in the darkness bind them |
02:22:33 | FromDiscord | <SandwichBop> 👻 |
02:22:38 | FromDiscord | <impbox [ftsf]> (edit) "in the darkness bind them ... " added "= shadow them" |
02:22:54 | FromDiscord | <impbox [ftsf]> sounds cooler |
02:23:19 | FromDiscord | <Elegantbeef> Impbox what happens in your sex dungeon is between you and the consenting adults |
02:23:20 | FromDiscord | <retkid> In reply to @Elegantbeef ""shadow"?": sorry brains on java mode |
02:23:53 | FromDiscord | <retkid> https://media.discordapp.net/attachments/371759389889003532/882450658068938812/unknown.png |
02:24:20 | FromDiscord | <retkid> this means that nim is getting interpreted when writing this? |
02:24:24 | FromDiscord | <retkid> (edit) "interpreted" => "interprupted" |
02:24:27 | FromDiscord | <retkid> (edit) "interprupted" => "interrupted" |
02:26:15 | * | auxym_ quit (Ping timeout: 244 seconds) |
02:37:43 | madprops | is it possible to check echo output in an integration test? |
02:37:45 | * | flynn quit (Read error: Connection reset by peer) |
02:38:52 | * | flynn joined #nim |
02:39:34 | madprops | I have a proc that prints something every x seconds |
02:39:36 | madprops | not sure I can test it |
02:52:08 | * | rockcavera quit (Remote host closed the connection) |
02:56:03 | * | rockcavera joined #nim |
02:56:03 | * | rockcavera quit (Changing host) |
02:56:03 | * | rockcavera joined #nim |
03:21:44 | * | Gustavo6046 quit (Quit: ZNC 1.8.2 - https://znc.in) |
03:22:05 | * | Gustavo6046 joined #nim |
03:27:00 | FromDiscord | <impbox [ftsf]> @ElegantBeef palette loading should be fixed now, used a smaller change than your commit sorry |
03:27:21 | FromDiscord | <impbox [ftsf]> fixes both GPL and from image and adds tests for that palette you had issues with |
03:28:01 | FromDiscord | <Elegantbeef> Nice |
03:30:38 | madprops | would be nice to have an echo alias. because echo is often used for debugging, so i try to remove those |
03:30:51 | madprops | i mean afte debugging, i ctrl+f and remove the echo's |
03:30:54 | madprops | but some echos are legit |
03:31:08 | madprops | i guess i could import some module with an alias |
03:31:26 | FromDiscord | <impbox [ftsf]> you can make a debugEcho template that is not compiled in unless compiled with -d:debug or something |
03:31:30 | FromDiscord | <Elegantbeef> You could just make a template that has a `when defined(debug)` |
03:31:38 | FromDiscord | <Elegantbeef> Damn you win this round |
03:32:13 | madprops | i mean i dont' |
03:32:17 | madprops | i don't want to leave the echos there |
03:32:21 | madprops | i removed them after the tests |
03:33:33 | FromDiscord | <impbox [ftsf]> make a tmpEcho template |
03:34:17 | FromDiscord | <impbox [ftsf]> wonder if you can make a template that removes itself after a certain date somehow... |
03:34:38 | madprops | like edit the file? |
03:34:59 | madprops | or become disabled |
03:37:18 | madprops | but what i was trying to say |
03:37:29 | madprops | it would be nice if apart from echo there was dbg or some simple alias built in |
03:37:57 | madprops | but probably redundant |
03:38:03 | FromDiscord | <Elegantbeef> clearly just do `echo(10)` for your debug ones and `echo 10` for your keepers 😛 |
03:38:36 | madprops | that could work if i ctrl+f "echo(" yeah |
03:43:08 | madprops | i should learn to use a debugger more though |
03:43:15 | madprops | i think i rely too much on printing stuff |
03:49:48 | FromDiscord | <retkid> whats the name of "abc'[1 .. 2] |
03:50:39 | FromDiscord | <retkid> ^ |
03:50:47 | FromDiscord | <retkid> (edit) "^" => ".^" |
03:50:51 | FromDiscord | <retkid> (edit) ".^" => "...................................................^" |
03:50:53 | FromDiscord | <retkid> that |
03:51:10 | FromDiscord | <retkid> (edit) "...................................................^" => ".........................................^" |
03:51:20 | FromDiscord | <retkid> (edit) ".........................................^" => "...........................................^" |
03:51:25 | FromDiscord | <retkid> (edit) "...........................................^" => ".............................................^" |
03:52:55 | FromDiscord | <Rika> slice? |
03:53:15 | FromDiscord | <Rika> sent a code paste, see https://play.nim-lang.org/#ix=3xB5 |
03:54:24 | FromDiscord | <retkid> the [] |
03:54:32 | FromDiscord | <retkid> i wanna look at the docs |
03:54:35 | FromDiscord | <retkid> because i dont know the rules |
03:54:45 | FromDiscord | <retkid> but dunno what to loop up |
03:59:14 | FromDiscord | <Rika> the proc name is [] |
03:59:37 | FromDiscord | <Rika> https://nim-lang.org/docs/system.html#%5B%5D%2Cstring%2CHSlice%5BT%2CU%5D |
04:01:08 | FromDiscord | <Rika> @retkid |
04:04:15 | * | rockcavera quit (Remote host closed the connection) |
04:06:02 | * | supakeen quit (Quit: WeeChat 3.2) |
04:06:31 | * | supakeen joined #nim |
04:15:17 | * | NeoCron joined #nim |
04:28:09 | * | NeoCron quit (Remote host closed the connection) |
05:46:58 | FromDiscord | <impbox [ftsf]> @Rika did the android thing work for you? |
05:47:24 | FromDiscord | <Rika> i had forgotten, because i programmed something else xd |
05:47:27 | FromDiscord | <Rika> ill try now |
06:19:23 | * | max22- joined #nim |
06:49:14 | * | watzon quit (Ping timeout: 244 seconds) |
07:08:20 | arkanoid | Just out of curiosity, how deep nested metaprogramming can go? I mean like call macro that generates and calls a template that generates and call another macro and so on |
07:21:04 | FromDiscord | <Elegantbeef> If you can write the code macros can generate it |
07:21:22 | FromDiscord | <impbox [ftsf]> maybe the compiler will run out of memory if you go too deep? |
07:21:56 | FromDiscord | <Elegantbeef> Probably |
07:22:18 | FromDiscord | <impbox [ftsf]> presumably an infinitely recursive macro won't work |
07:38:00 | FromDiscord | <gogolxdong (liuxiaodong)> Is there any recommended pointer arithmatic library? |
07:39:51 | FromDiscord | <Elegantbeef> https://github.com/kaushalmodi/ptr_math is only one i know of |
07:39:54 | nrds | <R2D299> itHub: 7"Pointer arithmetic in Nim" |
07:41:00 | FromDiscord | <xflywind> In reply to @gogolxdong (liuxiaodong) "Is there any recommended": copy timotheecour's solution and give him a upvote |
07:41:01 | FromDiscord | <xflywind> https://github.com/nim-lang/fusion/pull/21 |
07:42:53 | FromDiscord | <xflywind> (edit) "a" => "an" |
07:46:26 | FromDiscord | <gogolxdong (liuxiaodong)> That would be great! |
08:01:10 | * | PMunch joined #nim |
09:13:07 | madprops | is there a shortcut to echo two things separated by a whitespace? |
09:14:17 | FromDiscord | <Elegantbeef> `echo a, " ", b` is too much? |
09:16:07 | FromDiscord | <haxscramper> ``proc eecho(a: varargs[string, `$`]) = echo a.join(" ")`` |
09:17:29 | FromDiscord | <xflywind> https://forum.nim-lang.org/t/7819 |
09:19:46 | FromDiscord | <haxscramper> Were some posts deleted from this tread? I think there was some discussion yesterday as well |
09:22:47 | FromDiscord | <impbox [ftsf]> `echo &"{foo} {bar}"` |
09:23:00 | FromDiscord | <joshgoebel> are there any docs on inter-op of data structures between C and Nim... like if I'd like a Nim function to export a data-structure and I know the exact structure on the C side...? |
09:24:03 | PMunch | Well for interop with C you'd need to make sure that none of the types are garbage collected (or handled correctly), what you're left with is mostly types that map 1:1 to C |
09:24:41 | PMunch | But you could use cint, clong, cfloat, cchar, etc. to ensure that they will be the same as int, long, float, char in C |
09:24:55 | FromDiscord | <joshgoebel> it's just const char, pointers, structs, arrays, simple stuff |
09:25:28 | PMunch | const *char is a bit trickier. Nim doesn't seem to like const :P |
09:25:43 | PMunch | But yeah, most of that stuff is straight forward |
09:25:49 | FromDiscord | <joshgoebel> https://github.com/joshgoebel/wren-console/blob/main/src/cli/binary_libs.h#L60 i'm wanting to know if I could write a registryGiverFunc all in Nim code and have it exported properly in a dynamic library? |
09:26:19 | PMunch | You can always check out the generated C files in .cache/nim/ to see what the structures look like as well |
09:27:13 | PMunch | Sure, that should be possible |
09:27:37 | PMunch | I work with a dynamic library written in Nim and loaded by a C program at work |
09:28:13 | PMunch | Even working on auto-wrapping .h files into Nim definitions right now, so that you can do it automatically |
09:29:56 | FromDiscord | <joshgoebel> yeah, I'm trying to see how easy it is to use Nim to build libraries for Wren |
09:30:07 | FromDiscord | <joshgoebel> (edit) "yeah, I'm trying to see how easy it is to use Nim to build libraries for Wren ... " added "(which has a C runtime)" |
09:34:10 | PMunch | Should be simple enough |
09:34:16 | * | neurocyte quit (Quit: The Lounge - https://thelounge.chat) |
09:34:30 | PMunch | @haxscramper, I've found some issues with the namegen module.. |
09:35:12 | PMunch | This name, when passed through newName, will produce the exact same name: __pthread_unwind_buf_t |
09:35:21 | PMunch | Despite not being a valid Nim identifier |
09:37:54 | * | neurocyte joined #nim |
09:37:54 | * | neurocyte quit (Changing host) |
09:37:54 | * | neurocyte joined #nim |
09:40:57 | * | krux02 joined #nim |
09:41:06 | * | flynn quit (Read error: Connection reset by peer) |
09:42:13 | * | flynn joined #nim |
10:02:41 | madprops | <Elegantbeef> `echo a, " ", b` is too much? |
10:02:42 | madprops | kinda |
10:03:29 | FromDiscord | <impbox [ftsf]> i do find it a bit of a pain having to do that |
10:15:01 | FromDiscord | <haxscramper> In reply to @PMunch "This name, when passed": I fixed it now, will push new version later today |
10:15:48 | PMunch | @haxscramper, did you also fix that this is going to replace the first character with a "_" in that case? https://github.com/haxscramper/hmisc/blob/master/src/hmisc/algo/namegen.nim#L42 |
10:16:08 | PMunch | And could you push it to a different branch so I can test it out until then? |
10:16:57 | FromDiscord | <haxscramper> Okay, I will add more tests now and then push new version |
10:21:54 | arkanoid | how to pass a NimNode as argument to a macro? |
10:22:37 | FromDiscord | <rb3.nim> sent a code paste, see https://play.nim-lang.org/#ix=3xCx |
10:22:45 | arkanoid | if I pass a nnkProcDef as argument to a macro it becomes a nnkSym |
10:24:12 | arkanoid | and static[NimNode] wont work even if the macro is called from a static: block |
10:25:17 | FromDiscord | <haxscramper> Macro accepts either `typed` or `untyped` |
10:25:21 | FromDiscord | <haxscramper> AST |
10:25:31 | FromDiscord | <Rika> Use a proc if you are passing a node I believe |
10:25:36 | FromDiscord | <Rika> Instead of a macro |
10:25:44 | FromDiscord | <haxscramper> If you need to pass proc decl you can do it like `myMacro(procName)`, but it will still be a `nkSym` |
10:26:01 | FromDiscord | <haxscramper> Because you are passing AST with proc name that gets converted to a symbol |
10:26:21 | FromDiscord | <tandy> is there a way to convert unixtime to a datetime? |
10:26:38 | FromDiscord | <tandy> ` fromUnix` just creates a `time` object |
10:26:42 | FromDiscord | <tandy> which cant be formatted in a nice way |
10:30:16 | FromDiscord | <haxscramper> In reply to @haxscramper "Okay, I will add": Done |
10:30:27 | FromDiscord | <tandy> oh you can format `time`objects with a format string |
10:31:53 | FromDiscord | <Rika> https://nim-lang.org/docs/times.html#inZone%2CTime%2CTimezone |
10:47:38 | FromDiscord | <kaushalmodi> sent a long message, see http://ix.io/3xCG |
10:52:35 | FromDiscord | <Rika> Can you change the stream into a string? |
10:55:28 | FromDiscord | <kaushalmodi> In reply to @Rika "Can you change the": I think I tried doing that but it didn't work. I'll try sending `$streamvar` in some time once I get back to the PC. ↵↵Also thinking, would it be possible to send/recv protobuf in binary format without converting it in and out of string? Because I can imagine that that conversion would be very inefficient. |
10:55:50 | FromDiscord | <Rika> Strings in Nim are not necessarily text |
10:55:57 | FromDiscord | <Rika> They can be binary data |
10:56:17 | FromDiscord | <Rika> I don’t think the module has stream support so no you need to make it a string |
10:56:27 | FromDiscord | <Rika> Conversion would be inefficient indeed |
10:57:25 | arkanoid | I'm trying to build a proc in a "quote do" block like "proc `newName`*(arg1: ptr T1; `inputIdent`) = ...", but it doesn't like `inputIdent` even if it is an IdentDefs node extracted from another proc |
10:59:02 | arkanoid | error is: Error: identifier expected, but found 'tasGetServiceCapabilities: ptr TtasGetServiceCapabilities' |
10:59:13 | arkanoid | that's exactly what inputIdent is |
10:59:19 | FromDiscord | <haxscramper> arkanoid `dumpTree` on the generated code |
10:59:27 | FromDiscord | <kaushalmodi> In reply to @Rika "I don’t think the": Thanks! I'll get back once I try it out. |
10:59:34 | FromDiscord | <haxscramper> And compare it with what you would write manually |
10:59:49 | FromDiscord | <haxscramper> I need `treeDiffRepr` for `hnimast` ... |
11:00:52 | arkanoid | thanks. I already have to grok all the tooling required for more-than-trivial macros |
11:01:03 | arkanoid | s/already/still |
11:04:27 | arkanoid | oh, it drops an IdentDefs into an IdentDefs |
11:04:40 | * | Vladar joined #nim |
11:06:05 | arkanoid | this is surprising, how can I overcome this |
11:07:12 | arkanoid | basically it assumes that the argument is an IdentDefs and if I pass an IdentDefs it results in an IdentDefs into an IdentDefs |
11:08:37 | FromDiscord | <haxscramper> With regular quote do this can't be done, you need to construct tree manually |
11:09:55 | arkanoid | :( |
11:10:40 | FromDiscord | <haxscramper> You can just construct a tree and assugn `resut.params[0] = ???` |
11:11:37 | arkanoid | yes, I was on that path yesterday, then I though "let's rewrite in quote do style!" |
11:12:38 | PMunch | @haxscramper, __kernel_time_t still gets returned like that.. |
11:12:49 | FromDiscord | <haxscramper> dfasd |
11:13:16 | PMunch | You set result = str on line 69 |
11:13:26 | PMunch | So simply just setting it to the input string |
11:14:34 | FromDiscord | <haxscramper> you need to use `fixIdentName`, not `newName` |
11:15:28 | FromDiscord | <haxscramper> see tests for example |
11:16:48 | FromDiscord | <haxscramper> I'm not sure what I was doing with this API exactly |
11:16:51 | PMunch | Aha.. |
11:19:05 | FromDiscord | <haxscramper> Ideally `fixIdentName` should be a single entry point that implements different name resolution schemes, but it somehow never got merged into one. `fixIdentName` adds prefix until new ident is consired "actually new", and `newName()` appends number |
11:22:26 | PMunch | Hmm yeah |
11:22:50 | PMunch | Is there no way to get all the declared names in Nim? |
11:23:13 | * | auxym_ joined #nim |
11:23:50 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=3xCM |
11:23:54 | PMunch | Since I want to be able to call this from a macro it would be nice to have it not try to overwrite existing identifiers |
11:24:41 | PMunch | I know I can call "declared", but that is at compile-time, and I need to run this as an external program since it uses libclang |
11:25:28 | PMunch | It would be nice to write out all the declared identifiers, then staticExec an external helper program which gets fed the declared identifiers and spits out a file that is then included in the Nim program |
11:25:31 | FromDiscord | <haxscramper> You can try to get access to the IdentCache of the compiler if you write external tool |
11:25:58 | FromDiscord | <haxscramper> Or ModuleGraph might have something as well |
11:27:25 | PMunch | Hmm, but that means reparsing the entire thing.. |
11:28:12 | PMunch | I guess I could wrap all my definitions in a `when not declared(X)` kind of thing |
11:28:30 | PMunch | But that means I need to break up my type block and therefore handle circular types myself.. |
11:29:11 | FromDiscord | <haxscramper> yep, that's how I do it |
11:29:36 | FromDiscord | <haxscramper> parse everything, build explicit graph, infer cycles, merge them to clusters, write separate files, import them |
11:29:44 | FromDiscord | <haxscramper> `hmisc/hgraph` |
11:29:53 | PMunch | That sounds painful.. |
11:29:59 | FromDiscord | <haxscramper> `hmisc/other/hgraph`. Probably slow as ass, but right now I'm concerned with API |
11:31:01 | FromDiscord | <haxscramper> https://github.com/haxscramper/hcparse/blob/master/src/hcparse/hc_parsefront.nim#L564 |
11:33:22 | * | auxym_ quit (Ping timeout: 245 seconds) |
11:38:25 | * | luis_ joined #nim |
11:48:23 | PMunch | I guess I could also have my helper tool export a file of formatted "suggestions" that could then be read in by the macro and parsed with declared to spit out the actual code |
11:48:51 | PMunch | Not as pretty as spitting out a file to be included, but it should work.. |
11:53:28 | FromDiscord | <demotomohiro> !eval echo typeof(Natural(1));echo typeof(Natural(1) + Natural(2)) |
11:53:31 | NimBot | Natural↵int |
11:53:50 | FromDiscord | <demotomohiro> It should be Natural, isn't it? |
11:58:51 | FromDiscord | <xflywind> The signature of matched procs |
11:58:52 | FromDiscord | <xflywind> proc `+`(x, y: int): int {.magic: "AddI", noSideEffect.} |
11:59:42 | FromDiscord | <xflywind> There is no specific `+` proc for Natural types. |
11:59:58 | * | max22- quit (Ping timeout: 256 seconds) |
12:00:11 | FromDiscord | <demotomohiro> So, Natural(1) + Natural(2) calls that proc and return type is int. |
12:00:26 | FromDiscord | <xflywind> yeah |
12:03:14 | PMunch | Hmm, this is a bit annoying. It's doing such a good job of wrapping things that it goes all the way down to grabbing the definitions of uint8_t for example. But these are already wrapped in Nim so it would be annoying if my wrapping created a new type for it |
12:03:52 | FromDiscord | <enthus1ast> hey @xflywind i'm again fighting with prologue on windows, i suspect the staticFile caching is not working correctly |
12:05:10 | * | luis_ quit (Ping timeout: 240 seconds) |
12:06:02 | * | supakeen quit (Quit: WeeChat 3.2) |
12:06:31 | * | supakeen joined #nim |
12:08:26 | FromDiscord | <demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=3xD1 |
12:11:41 | FromDiscord | <haxscramper> That is expected. Natural is a positive range, and with overflowCheck enabled it raises |
12:11:48 | FromDiscord | <xflywind> In reply to @enthus1ast "hey <@658563905425244160> i'm again": hi, what's wrong with it? |
12:12:30 | FromDiscord | <xflywind> maybe you can open an issue |
12:13:05 | FromDiscord | <enthus1ast> site does not load (sometimes), sometimes images are not delivered, i'll play with it (have removed etag stuff already) and currently i'm building devel to try it on devel |
12:13:14 | FromDiscord | <enthus1ast> i'm not sure what the issue is |
12:13:27 | FromDiscord | <xflywind> thanks |
12:16:12 | FromDiscord | <demotomohiro> In reply to @haxscramper "That is expected. Natural": But I'm not expecting `a = Natural(1) + Natural(2)` become `int` type instead of `Natural`. |
12:16:40 | FromDiscord | <haxscramper> Buy you have explicit : Natural |
12:16:50 | FromDiscord | <haxscramper> (edit) "Buy" => "But" |
12:17:38 | FromDiscord | <kaushalmodi> @Rika Yep, `$` is not defined for streams. Also, I am wondering if the effort to define a `$` is worth it.. because then on the receiving side I would need to do string -> stream -> protobuf conversion, and I am not sure how the conversion from string to stream will work |
12:18:51 | FromDiscord | <demotomohiro> !eval let a = Natural(1); let b = Natural(1) + Natural(2); echo typeof(a), ", ", typeof(b) |
12:18:53 | NimBot | Natural, int |
12:19:33 | FromDiscord | <demotomohiro> I think both `a` and `b` should become Natural. |
12:21:25 | FromDiscord | <haxscramper> Write an overload |
12:21:43 | FromDiscord | <haxscramper> Locally defined overloads have precedence over imported |
12:22:24 | FromDiscord | <joshgoebel> is there same way to get nimgen to pull from main vs master? |
12:22:29 | FromDiscord | <joshgoebel> (edit) "same" => "some" |
12:26:15 | FromDiscord | <demotomohiro> In reply to @haxscramper "Locally defined overloads have": Yes, overloading `+`, `-`, ``, `div` for Natural can fix it.↵But I think these overloaded should be exists in stdlib. |
12:27:21 | FromDiscord | <haxscramper> - for natural makes no sense |
12:27:35 | FromDiscord | <haxscramper> 4 - 2 is not a natural, it is an int |
12:28:54 | PMunch | Hmm, the more I think about it I think having an intermediary file format with symbols and their information is a good idea |
12:31:01 | PMunch | Basically something that has the file it was declared in, the nimified name, the kind, and the declaration information. Then the macro will read in this file and grab all the symbols it is interested in, fix their names, and generate the Nim code to define them |
12:33:25 | FromDiscord | <haxscramper> Yes, I've came to the same conclusion |
12:33:46 | FromDiscord | <haxscramper> `hcparse/hc_types.Save<Object/Enum/Alias/Proc>` |
12:34:24 | FromDiscord | <haxscramper> Also allows having multiple frontends for C source parsing, from libclang to literally manual annotations |
12:35:17 | PMunch | That is true |
12:35:53 | PMunch | Now the question becomes, what is the easiest kind of format to parse on Nim compile-time |
12:36:13 | FromDiscord | <haxscramper> json |
12:36:17 | FromDiscord | <haxscramper> jsony works at compile-time |
12:39:08 | * | arkurious joined #nim |
12:41:10 | PMunch | The built-in json module also works on compile-time |
12:41:34 | PMunch | But I don't really need anything as "fancy" as Json.. |
12:41:38 | FromDiscord | <kaushalmodi> sent a code paste, see https://play.nim-lang.org/#ix=3xD8 |
12:41:41 | PMunch | Eh, it's easy |
12:42:19 | FromDiscord | <kaushalmodi> sent a code paste, see https://play.nim-lang.org/#ix=3xD9 |
12:42:25 | FromDiscord | <haxscramper> How json is "fancy"? it is just `ir.toJson()` or `fromJson(IR)` |
12:43:07 | PMunch | @kaushalmodi, it looks like your recvInto is overflowing |
12:43:17 | PMunch | What is ExampleMessage |
12:43:50 | PMunch | @haxscramper, it's fancy as in creates a whole tree structure and supports a bunch of stuff I don't really need |
12:44:01 | PMunch | I could just use a binary format |
12:44:09 | FromDiscord | <kaushalmodi> sent a code paste, see https://play.nim-lang.org/#ix=3xDa |
12:44:11 | FromDiscord | <kaushalmodi> I got that number of 19 from `msg.len` |
12:44:29 | FromDiscord | <kaushalmodi> I learned that the `len` proc is not exported so for now I have hard-coded that value 19 in the server |
12:44:42 | FromDiscord | <enthus1ast> @xflywind\: the issue is asyncfile |
12:44:58 | FromDiscord | <enthus1ast> i've patched it to normal (sync) file io and it works |
12:45:52 | PMunch | msg.len from your example returns 15 |
12:46:12 | PMunch | Basically msg.len is the size in bytes required to store the message in the protobuf format |
12:46:33 | PMunch | That means that the variable length ints and strings will make the message larger or smaller |
12:46:59 | FromDiscord | <xflywind> In reply to @enthus1ast "i've patched it to": cool, maybe I should remove `asyncfile`. is there something wrong in `asyncfile` or I misuse it? |
12:47:33 | FromDiscord | <kaushalmodi> PMunch: Thanks! I try the value of 15.. but the msg is unmodified so not sure how that changed.↵↵Also, is there a way to export the protobuf `len`? I found `exportMessage` macro, but cannot figure out how to export the `len` proc |
12:47:52 | PMunch | https://play.nim-lang.org/#ix=3xDd |
12:48:05 | FromDiscord | <kaushalmodi> crashes with value of 15 as well |
12:48:26 | PMunch | My point is that you shouldn't use a hard-coded message length |
12:48:35 | PMunch | Because it will vary depending on the content of your data |
12:48:53 | FromDiscord | <kaushalmodi> yes, I agree with that. For now, the data is constant, not a variable |
12:49:18 | FromDiscord | <kaushalmodi> Once I get the constant data going through asyncnet, I need to learn how to get msg.len work on server side |
12:49:56 | PMunch | Try using the readExampleMessage procedure instead |
12:49:58 | PMunch | That should help |
12:51:36 | FromDiscord | <kaushalmodi> That would require to first convert the protobuf to stream. I am trying to send a protobuf var across sockets |
12:53:06 | PMunch | Or you could read it out from the bodyStream of the response |
12:54:11 | PMunch | Hmm, I guess that would only work for non-async though.. Because I don't think protobuf creates readExampleMessageAsync.. |
12:54:54 | * | max22- joined #nim |
12:55:27 | FromDiscord | <kaushalmodi> here's my minimal example: It's expanded over the ChapApp example from dom's book: https://gist.github.com/kaushalmodi/e75bd98468e75b6efdd7e2268bc68596 |
12:56:52 | PMunch | You can't read the ExampleMessage like that by the way |
12:57:01 | PMunch | You need to use the stream reader/writer interface |
12:57:23 | PMunch | The ExampleMessage type is just a normal Nim type |
12:57:53 | FromDiscord | <kaushalmodi> oops, sorry, first time fiddling with protobuf |
12:58:28 | FromDiscord | <kaushalmodi> I got the part about using write and readExampleMessage to convert between stream and ExampleMessage. But the roadblock is on how to send that stream through socket |
12:58:36 | PMunch | Basically the way it works is that it parses the protobuf spec you give it and generate a regular Nim type describing the same object and reader/writer procedures that can create and read this type |
12:59:16 | PMunch | That is the tricky part, if you use a non-async socket it's trivial, simply grab the socket from the request/response and use that |
12:59:30 | FromDiscord | <Rika> How do I get started with GPU programming with Nim |
12:59:43 | FromDiscord | <Rika> Or in general |
12:59:57 | PMunch | But async sockets have a FutureStream instead, which the current protobuf implementation doesn't generate reader/writers for |
13:00:29 | PMunch | This means that to use an async socket you probably need to first write it into a string stream, then write that string stream into the socket stream |
13:00:49 | FromDiscord | <kaushalmodi> PMunch: I will need to use async.. I am working on a proof of concept that hooks up SystemVerilog with a C++ model of the hardware via sockets |
13:01:04 | FromDiscord | <Rika> In reply to @Rika "How do I get": Actually never mind, I don’t think what I plan to do can apply |
13:02:06 | FromDiscord | <kaushalmodi> PMunch:↵↵> first write it into a string stream↵That's what `stream.write msg` will do, right? So, "socket stream" is the next unknown for me |
13:02:51 | PMunch | `stream.writeExampleMessage(myMessage)` should do that I believe |
13:02:56 | PMunch | If I remember correctly |
13:03:14 | FromDiscord | <kaushalmodi> you have a `write` proc for all protobuf message types |
13:03:16 | PMunch | You can find info about the socket stream in the httpclient documentation |
13:03:23 | PMunch | Ah right |
13:03:25 | PMunch | That makes sense |
13:03:51 | FromDiscord | <enthus1ast> @xflywind\: i really do not know, maybe the issue is now shadowed because it blocks on file read. |
13:04:06 | FromDiscord | <enthus1ast> do you usually test on windows? |
13:04:30 | FromDiscord | <xflywind> I mainly use windows |
13:04:33 | FromDiscord | <xflywind> https://github.com/dom96/jester/blob/a03b5be0b72f1a686b6ca594c145cee665e6db7b/jester.nim#L187 |
13:04:53 | FromDiscord | <xflywind> jester uses blocking file read too |
13:05:56 | FromDiscord | <enthus1ast> mh ok, i can imagine that while developing it does not really matter, later when it runs in production nginx/apache should serve static files. |
13:06:30 | FromDiscord | <xflywind> yeah |
13:06:54 | FromDiscord | <xflywind> nginx should be used to serve static files |
13:07:26 | FromDiscord | <enthus1ast> should i open a pr? or do you wan't to do it yourself? |
13:07:39 | FromDiscord | <enthus1ast> i will push to my branch, though |
13:07:50 | FromDiscord | <xflywind> PR is welcome, |
13:08:27 | FromDiscord | <xflywind> after you know the problem better than me |
13:08:32 | FromDiscord | <xflywind> (edit) "after ... you" added "all" |
13:08:39 | FromDiscord | <enthus1ast> at least it bites me \:) |
13:09:49 | FromDiscord | <enthus1ast> but it would be nice to know if asyncfile is bugged, but my understanding of how async works is very minimal to be honest |
13:11:08 | FromDiscord | <enthus1ast> jester also uses asyncFile https://github.com/dom96/jester/blob/a03b5be0b72f1a686b6ca594c145cee665e6db7b/jester.nim#L208 |
13:12:34 | FromDiscord | <xflywind> your file is small than 20 MB, right? |
13:12:42 | FromDiscord | <enthus1ast> yes |
13:13:27 | FromDiscord | <xflywind> I see |
13:15:24 | * | flynn quit (Read error: Connection reset by peer) |
13:15:54 | * | rockcavera joined #nim |
13:15:54 | * | rockcavera quit (Changing host) |
13:15:54 | * | rockcavera joined #nim |
13:16:31 | * | flynn joined #nim |
13:16:48 | arkanoid | what does "Error: expression has no address" means? |
13:17:16 | FromDiscord | <Rika> Exactly as it says. You can’t get the address of the expression |
13:17:24 | FromDiscord | <Rika> Usually because it’s a literal or a constant |
13:17:32 | FromDiscord | <Rika> Or a return value |
13:19:18 | * | max22- quit (Ping timeout: 256 seconds) |
13:20:24 | FromDiscord | <joshgoebel> is there a way to install nimble packages locally such as to do development on this while using them, etc? |
13:20:35 | FromDiscord | <enthus1ast> yes |
13:20:38 | FromDiscord | <enthus1ast> nimble develop |
13:21:59 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=3xDw |
13:34:40 | * | federico3 quit (Ping timeout: 252 seconds) |
13:39:05 | arkanoid | Rika, thanks! |
13:39:21 | FromDiscord | <Rika> Did you solve it? Nice |
13:39:22 | arkanoid | "quote do" is the best invention ever after cold beer |
13:39:28 | FromDiscord | <Rika> Lol |
13:42:02 | FromDiscord | <gogolxdong (liuxiaodong)> I didn't find any example of initialization of generic object sequence |
13:42:14 | * | max22- joined #nim |
13:45:11 | FromDiscord | <gogolxdong (liuxiaodong)> sent a code paste, see https://play.nim-lang.org/#ix=3xDI |
13:52:53 | FromDiscord | <MrOkram> Hi, when i try to install Nim on a newly installed Ubuntu 18.04 using Choosenim i get Segmentation fault during the install. Any clues as to why ? https://media.discordapp.net/attachments/371759389889003532/882624048746598480/unknown.png |
13:56:04 | FromDiscord | <MrOkram> Here's the output of the debug version: https://media.discordapp.net/attachments/371759389889003532/882624850521374820/unknown.png |
14:00:39 | * | PMunch quit (Quit: Leaving) |
14:17:13 | * | rockcavera quit (Remote host closed the connection) |
14:21:34 | FromDiscord | <gogolxdong (liuxiaodong)> Does cps support generics? |
14:28:12 | NimEventer | New thread by Enthus1ast: Concepts, undeclared field., see https://forum.nim-lang.org/t/8386 |
14:48:14 | NimEventer | New thread by Miran: This Month with Nim: August 2021, see https://forum.nim-lang.org/t/8387 |
15:15:03 | FromDiscord | <marceneiro> sent a code paste, see https://play.nim-lang.org/#ix=3xEr |
15:17:25 | FromDiscord | <haxscramper> Use `startProcess` instead of an `execProcess` |
15:18:08 | FromDiscord | <leorize> not at the moment |
15:26:06 | FromDiscord | <marceneiro> In reply to @haxscramper "Use `startProcess` instead of": Thanks, that worked |
15:45:54 | * | beshr quit (Read error: Connection reset by peer) |
15:52:45 | * | beshr joined #nim |
16:22:07 | arkanoid | I really need to pass an argument of type NimNode to a macro, is it really impossible? It would require a bad pattern otherwise |
16:22:51 | arkanoid | I need this as I'm reading a nim file via parseStmt, then I'm filtering some ProcDefs and I need to pass them macro to generate a wrapper |
16:23:21 | arkanoid | the only solution I've found so far is to put the parsing loop inside the macro |
16:24:02 | arkanoid | an alternative solution would require to get all existing procs inside a module at compile time |
16:25:55 | FromDiscord | <haxscramper> Best approach would be to just put all logic inside of a macro, including `parseStmt` etc. |
16:26:18 | FromDiscord | <haxscramper> Why do you want to split `parseStmt` from macro in the first place? |
16:29:05 | arkanoid | as each piece of wrapping logic runs on single ProcDefs independently, I wanted to loop over then and apply a proc or something like that |
16:29:38 | arkanoid | but I'm doing "quote do" inside the wrapping logic so I need it to be template or macro |
16:29:49 | arkanoid | it works inside a singlie big indented macro too |
16:38:08 | FromDiscord | <haxscramper> Honestly, I don't quite understand your setup to begin with. If the code size is a problem, you can split macro logic in procs that accept and return `NimNode` |
16:38:47 | FromDiscord | <haxscramper> "macro accepting NimNode" usually means that you are trying to make a macro that calls other macro that does part of the job for it |
16:39:24 | FromDiscord | <haxscramper> At least most of the time that's the XY problem for managing large macro implementation |
16:41:15 | FromDiscord | <dom96> In reply to @MrOkram "Here's the output of": Very weird. Please report on GitHub |
16:48:10 | arkanoid | yeah, my only aim is to split large macro loop into smaller unit of logic |
16:49:16 | FromDiscord | <haxscramper> Then you should do `proc logicPart(node: NimNode): NimNode` |
16:49:42 | FromDiscord | <haxscramper> If you want to look how \~2.5k SLOC macro is implemented you can check out pattern matching from fusion |
16:56:16 | * | flynn quit (Read error: Connection reset by peer) |
16:57:24 | * | flynn joined #nim |
17:21:49 | * | PMunch joined #nim |
17:23:04 | FromDiscord | <MrOkram> In reply to @dom96 "Very weird. Please report": I'll maybe do that tomorrow, as i think this time the VM itself could be at fault. Aka, it wasn't properly configured \:( |
17:24:19 | FromDiscord | <fae> Is there a particular strategy for using c2nim? I’ve successfully used it on smaller header files. But on larger files it just hangs. The most recent one in this example being chipmunk2d main header file. So I just started commenting stuff out until it compiled, but I’m not sure why that got it working. |
17:24:50 | FromDiscord | <fae> (edit) "compiled," => "transpiled," |
17:26:03 | FromDiscord | <fae> Like since it’s just hanging instead of giving some parse error or something I’m not sure how to properly figure out what’s going on |
17:31:33 | FromDiscord | <exelotl> I've never had it hang before, that sounds rough :( |
17:32:33 | FromDiscord | <fae> I had to comment out these two blocks to get it working https://github.com/slembcke/Chipmunk2D/blob/master/include/chipmunk/chipmunk.h#L48-L58 https://github.com/slembcke/Chipmunk2D/blob/master/include/chipmunk/chipmunk.h#L177-L179 |
17:34:25 | FromDiscord | <haxscramper> Particular strategy of using c2nim is to tweak input header until c2nim is satisfied |
17:34:25 | FromDiscord | <haxscramper> If it it literally hangs then I suppose it is a bug |
17:35:00 | FromDiscord | <fae> So it sounds like I wasn't too far off with just commenting stuff out to satisfy it |
17:37:23 | FromDiscord | <fae> This was another header file that just hangs when trying to transpile https://github.com/brackeen/glfm/blob/master/include/glfm.h |
17:37:39 | FromDiscord | <fae> Honestly thought I was doing something wrong since the first two semi-large header files I tried to transpile it hangs on |
17:38:34 | FromDiscord | <haxscramper> yes |
17:38:35 | FromDiscord | <haxscramper> Though this part itself does not hand c2nim for me |
17:38:36 | FromDiscord | <haxscramper> And full file errors out at `chipmunk.h(48, 25) Error: token expected: ;` |
17:39:06 | FromDiscord | <fae> thats strange, something about my environment perhaps? |
17:40:09 | FromDiscord | <haxscramper> Does it hang on clear, unmodified file? |
17:40:19 | FromDiscord | <haxscramper> For me it just fails |
17:40:27 | FromDiscord | <haxscramper> But does not hang in any way |
17:40:43 | FromDiscord | <haxscramper> Nim version 1.4.8 |
17:41:17 | FromDiscord | <fae> https://media.discordapp.net/attachments/371759389889003532/882681530500145222/Screen_Shot_2021-09-01_at_10.40.23_AM.png |
17:41:27 | FromDiscord | <fae> first run is with that stuff commented out, second run is with it still in there |
17:41:47 | FromDiscord | <fae> i get a warning and it hangs, but then it says syntax error at the end of the line, which is what gave me the hint to comment that out in the first place |
17:42:35 | arkanoid | I'm experiencing a strange quote do behaviour. I have "quote do: myObj.subObj.`nameIdent`(myObj.endpoint, nil, `inputNameIdent`.unsafeAddr, result.unsafeAddr)" that is rendered as "myObj.subObj.funcName(endpoint, nil, arg1.unsafeAddr, result.unsafeAddr)". myObj before endpoint disappears |
17:42:52 | FromDiscord | <fae> this is also with 1.4.8 |
17:45:29 | * | stkrdknmibalz joined #nim |
17:46:02 | arkanoid | treeRepr turns it into a 'Sym "endpoint"' for no apparent reason |
17:46:09 | FromDiscord | <fae> `touch test.h && c2nim test.h` does not hang, it properly errors out |
17:48:16 | arkanoid | should really be a DotExpr node kind afaik |
18:01:38 | FromDiscord | <fae> the hanging also causes memory usage to keep climbing, letting it run for a few sec left the process at like 10gb memory 😓 |
18:01:45 | arkanoid | nevermind, found the culprit |
18:03:48 | * | rockcavera joined #nim |
18:03:48 | * | rockcavera quit (Changing host) |
18:03:48 | * | rockcavera joined #nim |
18:09:32 | * | idf quit (Remote host closed the connection) |
18:12:32 | * | max22- quit (Ping timeout: 245 seconds) |
18:22:59 | * | SebastianM joined #nim |
18:30:15 | * | SebastianM quit (Quit: Bye) |
18:37:53 | * | max22- joined #nim |
18:40:42 | * | PMunch quit (Remote host closed the connection) |
19:28:11 | FromDiscord | <deech> How I force compilation of all my library modules? So if I'm using `clang` I have modules, `A` and `B` and a program `C` that only uses `A` any codegen errors lurking in `B` don't get caught by `clang` . |
19:28:40 | FromDiscord | <deech> (edit) "How I force compilation of all my library modules? So if I'm using `clang` ... I" added "as the backend compiler and" |
19:28:44 | * | flynn quit (Ping timeout: 244 seconds) |
19:30:16 | FromDiscord | <deech> Specifically using `const` functions in a non-`const` way, `nim`'s doesn't catch it, neither does `g++` but `clang` does. |
19:30:39 | * | Vladar quit (Quit: Leaving) |
19:30:44 | * | flynn joined #nim |
19:33:14 | FromDiscord | <deech> I've imported all my library modules into a single otherwise empty module and tried compiling it with `--app:staticlib` in the hopes that it would codegen all of them and but that doesn't work. |
19:41:48 | * | PMunch joined #nim |
19:49:17 | FromDiscord | <AdawareDev> hi guys |
19:49:40 | FromDiscord | <AdawareDev> can someone help me pls https://media.discordapp.net/attachments/371759389889003532/882713837369958491/unknown.png |
20:16:24 | FromDiscord | <retkid> why is print called echo in nim |
20:16:32 | PMunch | Why not? |
20:16:34 | FromDiscord | <retkid> when the only other language i've encountered that does that is bash |
20:16:39 | PMunch | Same as bash |
20:16:57 | PMunch | I mean it's not printing anything on a printer *shrugs* |
20:17:00 | FromDiscord | <retkid> but Nim is not really inspired by bash or related to it at all for that matter |
20:17:22 | FromDiscord | <retkid> most of its source languages have write and print |
20:17:35 | FromDiscord | <retkid> im not complaining, just curious |
20:18:05 | PMunch | I don't really know to be honest |
20:18:32 | FromDiscord | <retkid> (edit) "print" => "print, and put" |
20:20:11 | PMunch | @AdawareDev, you seem to have a messed up compiler.. |
20:23:00 | FromDiscord | <retkid> yea so i checked every souce lang |
20:23:03 | FromDiscord | <retkid> (edit) "souce" => "source" |
20:23:07 | FromDiscord | <retkid> none use echo |
20:23:16 | FromDiscord | <retkid> maybe they just thought it looked cool |
20:23:49 | FromDiscord | <AdawareDev> In reply to @PMunch "<@849539131955740732>, you seem to": oh ok |
20:24:05 | FromDiscord | <AdawareDev> @AdawareDev, you seem to have a messed up compiler.. |
20:24:09 | FromDiscord | <AdawareDev> (edit) "@AdawareDev, you seem to have a messed up compiler.." => "how could i fix it?" |
20:25:45 | PMunch | Which compiler do you use? |
20:26:43 | * | flynn quit (Read error: Connection reset by peer) |
20:27:51 | * | flynn joined #nim |
20:28:37 | FromDiscord | <AdawareDev> gcc |
20:29:02 | PMunch | Could you do gcc -v? |
20:29:08 | PMunch | And how did you install it? |
20:29:27 | * | supakeen quit (Remote host closed the connection) |
20:29:51 | * | supakeen joined #nim |
20:33:24 | FromDiscord | <AdawareDev> choco |
20:33:37 | FromDiscord | <AdawareDev> https://media.discordapp.net/attachments/371759389889003532/882724900815667240/unknown.png |
20:34:08 | FromDiscord | <AdawareDev> I can only compile inside C:/Users/Adaware/ |
20:34:35 | PMunch | That sounds weird |
20:34:40 | PMunch | But then again Windows.. |
20:35:23 | FromDiscord | <brainproxy> why is there no `[]` proc for OrderedSet? |
20:54:02 | * | dmu quit (Quit: leaving) |
21:11:43 | * | PMunch quit (Quit: leaving) |
21:30:33 | * | max22- quit (Quit: Leaving) |
21:40:50 | * | Gustavo6046_ joined #nim |
21:41:58 | * | Gustavo6046 quit (Ping timeout: 252 seconds) |
21:42:17 | FromDiscord | <haxscramper> In reply to @retkid "why is print called": It was made this way so people could implement their own 'print' proc with spaces |
21:43:16 | * | Gustavo6046_ is now known as Gustavo6046 |
21:44:03 | * | mjsir911 quit (Remote host closed the connection) |
21:44:23 | * | mjsir911 joined #nim |
21:45:52 | FromDiscord | <fae> I must be missing something subtle about generic constraints, because it's interesting that this works https://play.nim-lang.org/#ix=3xGe |
21:46:16 | FromDiscord | <fae> but this doesnt https://play.nim-lang.org/#ix=3xGf |
21:50:22 | FromDiscord | <Elegantbeef> `[T, S: enum]` is just like `a, b: int` |
21:50:29 | FromDiscord | <Elegantbeef> They have to be the same enum type |
21:50:43 | * | Gustavo6046 quit (Remote host closed the connection) |
21:51:08 | * | Gustavo6046 joined #nim |
21:51:21 | FromDiscord | <fae> ah okay, I thought it just meant any enum |
21:51:48 | FromDiscord | <Elegantbeef> Well it does mean any enum, but it only the resolved type applies to both on the left hand of `:` |
21:52:17 | FromDiscord | <fae> I figured that declaring two type parameters would imply that you have two different types |
21:52:38 | FromDiscord | <fae> Two different types that are both enums |
21:52:44 | FromDiscord | <fae> at least thats the way i was reading it |
21:53:03 | FromDiscord | <Yardanico> In reply to @fae "at least thats the": just read them the same as normal arguments |
21:53:18 | FromDiscord | <Elegantbeef> They're bounded to the same resolved type |
21:53:21 | FromDiscord | <Yardanico> "a, b: int" is not always the same as "a: int; b: int" |
21:53:28 | FromDiscord | <Yardanico> i mean not int specifically, but this notation of arguments |
21:53:34 | FromDiscord | <Elegantbeef> So it might be useless but it's how it works |
21:53:45 | FromDiscord | <Elegantbeef> Better example would've been `a, b: SomeInteger` |
21:54:03 | FromDiscord | <Yardanico> yas |
21:54:22 | FromDiscord | <Elegantbeef> This behaviour allows you to easily say multiple parameters are bound to the exact same typeclass, which is more useful 😀 |
21:54:52 | FromDiscord | <fae> true, i suppose you are more often operating on same types with operators and such |
21:54:55 | FromDiscord | <fae> thanks for the explanation |
22:21:18 | * | Gustavo6046 quit (Ping timeout: 244 seconds) |
22:21:38 | * | Gustavo6046 joined #nim |
22:46:42 | * | watzon joined #nim |
23:10:33 | * | auxym_ joined #nim |
23:10:36 | * | asd quit (Ping timeout: 276 seconds) |
23:21:45 | * | asd joined #nim |
23:38:17 | FromDiscord | <retkid> In reply to @haxscramper "It was made this": It’s a learning tool? |
23:38:38 | FromDiscord | <Yardanico> In reply to @retkid "why is print called": why is echo called print in python? |
23:38:42 | FromDiscord | <Yardanico> pretty weird imo |
23:39:13 | FromDiscord | <retkid> Because Lisp used print |
23:39:29 | FromDiscord | <retkid> Most likely |
23:39:51 | FromDiscord | <Yardanico> no, not at all |
23:40:17 | FromDiscord | <retkid> Well, Lisp I’d a influential Lang with print |
23:40:28 | FromDiscord | <retkid> And I think Haskell uses prints |
23:40:34 | FromDiscord | <Yardanico> but what's the problem with `echo`? |
23:40:39 | FromDiscord | <retkid> None |
23:40:44 | FromDiscord | <retkid> I’m just curious |
23:41:02 | FromDiscord | <retkid> Why echo specifically when so few Lang’s use that |
23:41:32 | FromDiscord | <retkid> Why not puts, write, or print or Sdrout |
23:41:45 | FromDiscord | <Yardanico> stdout is an entirely different thing |
23:41:52 | FromDiscord | <Yardanico> it's a file descriptor, and Nim does have it |
23:41:59 | FromDiscord | <Yardanico> as well as `write` which is used to write to a file descriptor |
23:42:47 | * | watzon quit (Quit: WeeChat 3.2) |
23:43:03 | FromDiscord | <retkid> Dunno, I think Haxs was right |
23:43:19 | FromDiscord | <retkid> So you can make your own print for your purposes |
23:43:37 | FromDiscord | <Yardanico> just ask araq if you really want to |
23:45:35 | FromDiscord | <Yardanico> i don't think it's the "make your own print" at all |
23:45:45 | * | flynn quit (Read error: Connection reset by peer) |
23:45:46 | FromDiscord | <Yardanico> but that's just my guess, ask araq directly if you want to know the real answer :) |
23:46:12 | FromDiscord | <retkid> Feel like I’m gonna get “lol dunno just cuz” like any question you ask someone importantly |
23:46:26 | FromDiscord | <retkid> (edit) "importantly" => "important" |
23:46:52 | * | flynn joined #nim |
23:59:00 | * | watzon joined #nim |
23:59:57 | * | krux02 quit (Remote host closed the connection) |