00:01:57 | * | Guest56511 quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
00:13:08 | * | Matthias247 quit (Read error: Connection reset by peer) |
00:42:13 | * | Elronnd is now known as ArthurDent |
00:42:30 | * | ArthurDent is now known as Elronnd |
00:45:36 | * | yglukhov joined #nim |
00:50:16 | * | yglukhov quit (Ping timeout: 260 seconds) |
01:20:20 | * | v17d quit (Remote host closed the connection) |
01:21:03 | * | v17d joined #nim |
01:33:44 | * | chemist69_ quit (Ping timeout: 255 seconds) |
01:47:45 | * | chemist69 joined #nim |
01:58:48 | * | v17d quit (Remote host closed the connection) |
02:34:15 | FromGitter | <zacharycarter> o/ |
02:37:47 | * | pilne quit (Quit: Quitting!) |
02:53:43 | * | def-pri-pub joined #nim |
03:17:16 | FromGitter | <Varriount> Hey @zacharycarter! |
03:17:54 | FromGitter | <zacharycarter> Hi Varriount! |
03:17:59 | FromGitter | <zacharycarter> @Varriount sorry |
03:18:33 | FromGitter | <zacharycarter> how's it going bud? |
03:20:44 | FromGitter | <Varriount> Super busy. I've been taking longer than required on my game dev assignments, as I can't resist re-writing the (simple but messy) code. |
03:21:11 | FromGitter | <zacharycarter> :D |
03:21:16 | FromGitter | <zacharycarter> what language? |
03:22:19 | FromGitter | <Varriount> C++ |
03:22:38 | FromGitter | <zacharycarter> yuck |
03:22:42 | FromGitter | <Sud0nim> Hi guys, this is probably a silly question - but I am looking at the reddit daily programmer problem here: https://www.reddit.com/r/dailyprogrammer/comments/6l3hd8/20170703_challenge_322_easy_all_pairs_test/ and can't work out how to make a sequence of unknown size sequences. As an example one of the inputs for the questions is of the format @[['0', '1'], ['A', 'B', 'C'], ['D', 'E', 'F', 'G']] - but I can't work out |
03:22:42 | FromGitter | ... how to initialise it |
03:22:52 | FromGitter | <Varriount> I would do it in Nim, had I the option - the library we're using is Allegro, which could probably be very easily wrapped. |
03:23:08 | FromGitter | <zacharycarter> yeah allegro is a pretty old / but popular lib |
03:24:29 | FromGitter | <Varriount> @Sud0nim Well, you can either use `newSeqtype (size)` to create a sequence of that size with empty/null elements |
03:24:53 | FromGitter | <Varriount> Or you can create an empty sequence and use the 'add' procedure. |
03:27:16 | FromGitter | <Sud0nim> Thanks, I'll give the add proc a try |
03:31:54 | FromGitter | <Sud0nim> var inputs = newSeqWith(0, newSeqchar (3)) ⏎ ⏎ inputs.add(@['0', '1']) ⏎ inputs.add(@['A', 'B', 'C']) ⏎ inputs.add(@['D', 'E', 'F', 'G']) [https://gitter.im/nim-lang/Nim?at=595f00a93230e14f3a3359f7] |
03:32:00 | FromGitter | <Sud0nim> worked for me, cheers Varrimount |
03:32:48 | FromGitter | <Sud0nim> var inputs = newSeqWith(0, newSeqchar (3)) <- sorry it didn't copy some of the brackets across correctly |
03:35:39 | * | rauss joined #nim |
03:37:06 | FromGitter | <Sud0nim> Just out of curiosity, is there any way that the compiler can infer the sequence type /length by writing something like: |
03:37:15 | FromGitter | <Sud0nim> var inputs = @[['0', '1'], ['A', 'B', 'C'], ['D', 'E', 'F', 'G']] |
03:37:46 | FromGitter | <Sud0nim> or is it always required to do something like adding to the empty sequence? Thanks |
03:54:39 | FromGitter | <zacharycarter> strange |
03:54:44 | FromGitter | <zacharycarter> getting weird errors trying to initialize opengl now |
03:55:28 | FromGitter | <zacharycarter> oh I'm being stupid nevermind |
04:05:53 | * | def-pri-pub quit (Quit: Lost terminal) |
04:06:52 | shashlick | Varriount: can this issue be closed? https://github.com/nim-lang/Nim/issues/1818 |
04:13:52 | subsetpark | Sud0nim - you can absolutely declare seqs by instantiating them directly; that particular example would fail type checking because the seq is not homogeneous; arrays are typed by their length and so the elements of that example are of different types |
04:16:03 | * | rauss quit (Quit: WeeChat 1.9) |
04:36:29 | FromGitter | <Sud0nim> Ah, yes I see. Thanks for clarifying. I guess I will probably use the add method for now, as I don't want to put in some sort of dummy char like: var inputs = @[['0', '1', 'a', 'a'], ['A', 'B', 'C', 's'], ['D', 'E', 'F', 'G']] to get them to be the same length. Thanks for both of your help |
05:03:26 | * | Snircle quit (Ping timeout: 255 seconds) |
05:40:16 | FromGitter | <Araq> @Sud0nim I think you're looking for @[ @["nested", "seq", " of strings"], @["ab"] ] |
05:51:39 | shashlick | Is it possible to statically link pcre on Windows? |
06:01:34 | * | tankfeeder joined #nim |
06:06:26 | FromGitter | <mratsim> In the Nim manual, in the concept section, there is this example: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ Shouldn’t `s` be `var s` otherwise how can it be popped? [https://gitter.im/nim-lang/Nim?at=595f24e23230e14f3a33d98b] |
06:08:30 | FromGitter | <Araq> yeah, it should be 'v' instead of 's' here |
06:25:10 | * | abeaumont quit (Ping timeout: 276 seconds) |
06:28:08 | * | skrylar joined #nim |
06:38:29 | * | Kingsquee joined #nim |
06:39:46 | FromGitter | <Sud0nim> @Araq Perfect, I was sure I tried that but I must have missed an @ symbol on the first seq: let x = @[['0', '1'],... instead of let x = @[@['0', '1'],... I had a feeling Nim would have an easy way to do that |
06:47:56 | * | nsf joined #nim |
06:52:44 | * | Trioxin joined #nim |
06:53:33 | * | adeohluwa joined #nim |
06:53:35 | Trioxin | what would be the ideal method for monitoring for a volume being mounted? |
07:00:32 | skrylar | this is os specific behavior |
07:01:16 | skrylar | sometimes even distro dependent (on linux) given that gnome has a virtual filesystem thing that handles it, i think KDE has another |
07:02:12 | skrylar | On the nim side, probably just a signals and slots setup where you can be like "on_volume.mounted do (v: volume): ..." |
07:02:29 | skrylar | Or just a procvar if you don't need multiple subscribers |
07:02:32 | * | tankfeeder quit (Quit: Leaving) |
07:06:24 | * | rokups joined #nim |
07:10:49 | * | arnetheduck joined #nim |
07:12:02 | * | xet7 joined #nim |
07:17:18 | * | yglukhov joined #nim |
07:21:16 | * | yglukhov quit (Remote host closed the connection) |
07:22:37 | * | yglukhov joined #nim |
07:22:41 | * | yglukhov quit (Remote host closed the connection) |
07:22:57 | * | yglukhov joined #nim |
07:29:27 | * | yglukhov quit (Remote host closed the connection) |
07:42:41 | * | couven92 joined #nim |
07:44:58 | * | yglukhov joined #nim |
07:54:22 | * | Arrrr joined #nim |
07:57:22 | * | shashlick quit (Quit: Connection closed for inactivity) |
08:05:58 | * | gokr joined #nim |
08:07:29 | * | tankfeeder joined #nim |
08:25:35 | * | abeaumont joined #nim |
08:40:12 | * | skrylar quit (Quit: My iMac has gone to sleep. ZZZzzz…) |
08:52:30 | * | skrylar joined #nim |
08:52:30 | * | skrylar quit (Client Quit) |
09:07:38 | * | bjz joined #nim |
09:09:25 | * | Trustable joined #nim |
09:20:46 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
09:37:35 | * | gokr quit (Read error: Connection reset by peer) |
09:40:14 | * | bjz joined #nim |
09:48:10 | * | v17d joined #nim |
10:13:49 | * | Vi- joined #nim |
10:15:24 | * | arnetheduck quit (Ping timeout: 260 seconds) |
10:23:46 | * | krux02 quit (Remote host closed the connection) |
11:07:01 | * | salewski joined #nim |
11:07:40 | salewski | dom96, for https://forum.nim-lang.org/t/3031 |
11:08:32 | salewski | it seem that it only works with "nimble prepare" followed by "nimble install". |
11:09:06 | salewski | But does "nimble prepare" task work at all for remote packages? |
11:09:27 | salewski | That is not very clear from the github nimble readme. |
11:10:48 | salewski | I think for users it would be ok to type two commands -- when it works at all. But of course they may try only "nimble install" |
11:11:10 | salewski | when they do not read the docs. |
11:12:21 | salewski | When you think that "nimble prepare" will work for the remote reposity, than I think I can push it to github and publish it. |
11:12:26 | * | Matthias247 joined #nim |
11:12:52 | salewski | When not -- well then I have no idea currently... |
11:17:20 | * | Snircle joined #nim |
11:21:50 | Araq | salewski: I don't understand your "install-only dependencies" |
11:22:27 | Araq | can you explain a bit more? why is the low level gtk-3 wrapper from yours requires only for installation and not for building the software? |
11:23:27 | * | v17d quit (Ping timeout: 268 seconds) |
11:24:16 | * | Kingsquee quit (Quit: https://i.imgur.com/qicT3GK.gif) |
11:24:41 | * | Vi- quit (Ping timeout: 268 seconds) |
11:27:27 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
11:35:27 | salewski | Araq, my generator script is called gen.nim. To compile that, I need the low level ngtk3 3.20 bindings. |
11:36:17 | Araq | ok, so only the generator needs that? |
11:36:37 | salewski | When that it compiled, I do not need the ngtk bindings any more. Then I execute ./gen and that program reads the gobject inrospection data |
11:36:54 | salewski | and generates the true high level bindings. |
11:37:06 | Araq | hmm and the output of ./gen can't be put in the repo? |
11:37:13 | Araq | *into the repo |
11:38:17 | salewski | No, the output of gen depends on the local computer, it is different for 32 and 64 bit, different for installed GTK version, diffeent for windows... |
11:38:58 | salewski | All what we have i the low level bindings expressed with when clause do the gintrospection not offer. |
11:39:33 | salewski | It is specific for the current box. So we had to ship many different versions of the modules. |
11:40:18 | salewski | And as I told a few times, I myself can only provide files for Linux 64 bit. |
11:40:58 | salewski | I could provide versions for older GTK still. But not for 32 bit system, not for Windows, not for mac |
11:42:08 | salewski | And as I told already, later when we have many users, they may provide tested files for specific system, but that would be more a fallbacl. |
11:42:26 | Araq | yeah sure |
11:43:11 | salewski | It is similar as the nim compiler, we need some bootstrapping. Bootstrapping could later start with high level bindings, |
11:43:12 | Araq | how much of ngtk3 is required for gen.nim to work? |
11:43:33 | salewski | but still we need something to start from. Or ship binary executables. |
11:43:43 | Araq | you could copy the relevant sections from ngtk3 to gen.nim |
11:43:55 | Araq | if it's not too much stuff that you need from it |
11:44:24 | salewski | All the modules I specify, I have already removed the unnecessary gtksourceview. |
11:45:17 | salewski | Yes, I could try to select only the data types and procs from source code that are currently needed. |
11:45:41 | Araq | well I dunno, copying code is not great |
11:45:50 | salewski | Much work, and the work is not final yet, whenever I improve the genrator, I may need new procs. |
11:46:07 | Araq | yeah, let's wait for dom96's response |
11:46:17 | Araq | interesting problem. |
11:46:32 | salewski | I think all that is fine. |
11:47:03 | salewski | Problem is not bootstrapping, problem is executing generator program before installing. |
11:47:38 | salewski | Because I generate bindings from gobject-introspection before that modules are installed. |
11:48:32 | salewski | That is how gobject-introspection works, interpreted languages generate bindings even on the fly. |
11:49:16 | salewski | Bey, will read logs later... |
11:49:20 | Araq | bye |
11:49:27 | * | salewski quit (Quit: WeeChat 1.4) |
12:03:04 | * | krux02 joined #nim |
12:10:09 | FromGitter | <zacharycarter> o/ |
12:14:13 | * | salewski joined #nim |
12:15:25 | salewski | Araq, dom96: just a short note: |
12:15:25 | salewski | You may be rigth that for bootstrapping I do need less modules from low level ngtk3. |
12:15:48 | salewski | I need glib, gobject, gir of course, but maybe not all the others. |
12:16:47 | salewski | But that makes not really a difference, I have to bootstrap from ngtk3, and I have to execute the gen script before I can do nimble install. |
12:17:37 | salewski | It only saves some internet bandwith, I will see tonight which modules of ngtk3 are unneeded. |
12:18:36 | salewski | And generally nimble would already support it, the before kook exists, but from issue tracker it seems not to work properly. |
12:18:42 | salewski | Bye. |
12:18:53 | FromGitter | <zacharycarter> @gokr the atomic game engine community seems less than thrilled with the idea of a Nim wrapper around Atomic |
12:19:21 | FromGitter | <zacharycarter> @gokr but atomic also seems to be more feature-rich than Urho3d |
12:19:30 | FromGitter | <zacharycarter> either way it seems like a ton of work, which I'm not sure how to proceed with |
12:20:11 | FromGitter | <zacharycarter> I've never done any C++ interop with Nim before and I don't quite understand how it's done, I've only done C interop |
12:20:17 | * | salewski quit (Quit: WeeChat 1.4) |
12:20:35 | FromGitter | <zacharycarter> I don't see why we couldn't together (as a community) build something like raylib with Nim |
12:20:46 | FromGitter | <zacharycarter> which I think would serve as a great starting point for any 2d / 3d game project |
12:26:13 | * | Jesin quit (Ping timeout: 240 seconds) |
12:39:20 | * | Jesin joined #nim |
12:40:57 | Araq | anyone with experience with libCEF around? |
12:52:11 | * | Arrrr quit (Read error: Connection reset by peer) |
12:54:43 | * | FromGitter * zacharycarter is curious what you're doing with cef |
13:01:53 | Araq | porting karax to native code |
13:02:24 | Araq | but ugh, libCEF's DOM has no methods like a web's DOM |
13:06:59 | * | sdw left #nim (#nim) |
13:11:22 | FromGitter | <zacharycarter> oooo |
13:13:17 | * | adeohluwa quit (Quit: Connection closed for inactivity) |
14:00:27 | * | couven92 quit (Quit: Client disconnecting) |
14:02:52 | FromGitter | <Varriount> @zacharycarter Well, you could try making a C wrapper around Atomic, or wrap it directly |
14:04:17 | FromGitter | <Varriount> The problem with C++ is that C2Nim has a much harder time of parsing it (especially in template-heavy code bases). Nim's importcpp feature is fairly complete though. |
14:04:39 | * | Vi- joined #nim |
14:05:00 | Araq | IME C++ vs C makes no difference for c2nim. it works equally bad/well depending on project specific code style only. |
14:07:29 | Araq | both languages are equally impossible to parse without a symbol table. C++'s parsing complexity over C is a myth IMO. |
14:08:04 | FromGitter | <Varriount> Araq: I've found C2Nim's C++ mode to be much more difficult. I still haven't figured out how to get it to parse libtorrent's source code. It always chokes at "namespace libtorrent {" |
14:08:35 | Araq | lol, maybe I never implemented "namespace" ? |
14:10:10 | Araq | I stand by my words anyway. C's declaration syntax is a mind blowing clusterfuck and C++'s templates are tame in comparison |
14:12:51 | Araq | namespace Urho3D { |
14:12:59 | Araq | is part of the test suite |
14:13:03 | Araq | and works |
14:13:28 | * | tankfeeder quit (Quit: Leaving) |
14:13:40 | Araq | you need to use c2nim --cpp though, c2nim is stupid and doesn't do file ending based language detection |
14:15:50 | * | yglukhov quit (Remote host closed the connection) |
14:16:50 | * | yglukhov joined #nim |
14:20:44 | FromGitter | <Varriount> Oh yuck, libtorrent uses bitfields |
14:21:19 | FromGitter | <Varriount> How does one even wrap structus containing bitfields? |
14:26:28 | euantor | Varriount: https://github.com/euantorano/serialport.nim/blob/master/src/libserialport/private/serial_windows.nim#L9 |
14:26:39 | euantor | Like that :) |
14:27:00 | * | skrylar joined #nim |
14:37:42 | * | skrylar quit (Read error: Connection reset by peer) |
14:42:06 | * | skrylar joined #nim |
14:46:21 | Araq | c2nim can handle bitfields iirc |
14:47:36 | * | shashlick joined #nim |
14:48:32 | * | skrylar quit (Quit: My iMac has gone to sleep. ZZZzzz…) |
14:48:58 | * | skrylar joined #nim |
14:49:47 | * | couven92 joined #nim |
14:54:14 | FromGitter | <TiberiumN> can I create an alias for "echo"? |
14:54:21 | FromGitter | <TiberiumN> like ⏎ ⏎ ```let something = echo``` [https://gitter.im/nim-lang/Nim?at=595fa09d2723db8d5ee9cdb8] |
14:54:31 | FromGitter | <TiberiumN> and use something as echo |
14:58:49 | * | skrylar quit (Quit: My iMac has gone to sleep. ZZZzzz…) |
15:11:41 | FromGitter | <ephja> @TiberiumN try const instead |
15:13:07 | koppeh | Mhh.. I've redone my nim setup in hopes of fixing some strange errors compiling the std. |
15:13:31 | koppeh | So I got msys2 and set it up, then grabbed nim fresh. |
15:14:15 | koppeh | Currently it's showing the error "ld.exe: cannot find -l<library>" even though the libraries are in our project folder. |
15:15:00 | koppeh | --clib: "../lib/glew" and "/opengl32" |
15:15:31 | koppeh | glew32* |
15:19:24 | FromGitter | <ephja> the working directory is not part of the default path |
15:19:56 | koppeh | --clibdir seemed to have gotten rid of the first missing library..? Or it will complain later. |
15:21:40 | yglukhov | Araq: what do you think about supporting try: yield in closure iters? |
15:23:08 | yglukhov | apart from supporting closure iters in js ;) |
15:24:25 | FromGitter | <ephja> koppeh: --clibdir:.? |
15:26:38 | koppeh | I .. think I need to include wherever opengl is located in my nim cfg..? |
15:26:58 | koppeh | I'd imagine mingw includes those my default? Heck if I knew.. |
15:28:05 | FromGitter | <ephja> it should include the equivalent of /usr/bin |
15:28:21 | FromGitter | <ephja> *lib |
15:29:17 | koppeh | I suppose that'd be msys2/usr/lib ? |
15:29:39 | koppeh | Doesn't include opengl32.lib, I found it in the Windows SDKs..? |
15:29:45 | Vi- | I had to include them by hand with --clib (msvc) |
15:29:48 | koppeh | (I really have no idea what I'm doing, for the record.) |
15:29:53 | Vi- | So I have |
15:29:55 | Vi- | --clib: "../lib/glew32" |
15:29:55 | Vi- | --clib: "/opengl32" |
15:30:11 | Vi- | and that finds them somehow |
15:31:31 | koppeh | --clibdir: r"C:\Program Files (x86)\Windows Kits\10\Lib\10.0.15063.0\um\x64" |
15:31:32 | * | tankfeeder joined #nim |
15:31:42 | koppeh | This fixes the missing opengl thing. |
15:31:58 | koppeh | But the one in our project folder it can't find.. for some reason? |
15:32:27 | Vi- | well it doesnt find "/opengl32" then |
15:32:34 | Vi- | Which was really odd to begin with |
15:32:39 | koppeh | No, ../lib/glew32 is missing. |
15:32:52 | Vi- | but thats how I got around having to include that path |
15:36:01 | Vi- | Some other thing that happened to me was when I tried to pass linker options it ended up passing it to the compiler (which gently ignored the option) and then to the linker again |
15:42:52 | * | Guest68663 joined #nim |
15:44:39 | * | Guest68663 quit (Client Quit) |
15:47:52 | * | v17d joined #nim |
15:51:22 | * | salewski joined #nim |
15:52:36 | salewski | Araq, your where right, I need only the 3 modules glib, gobject and gir from legacy ngt3 repository for bootstrapping. |
15:53:17 | salewski | I have corrected that in my forum post, looks a bit cleaner now. |
15:54:04 | salewski | But tht changes NOTHING for all my mentioned problems, it only saves some internet bandwith for install process. |
15:55:02 | salewski | That I needed only 3 modules was a bit surprising for me, because when I use the main module gtk, then I also need all the others |
15:55:59 | salewski | but gtksourceview. But as the gen.nim program is not graphical at all, it is not surprising that we need not gtk module. |
16:07:26 | * | NimBot joined #nim |
16:07:44 | * | tankfeeder quit (Ping timeout: 268 seconds) |
16:09:27 | FromGitter | <zacharycarter> meh I still think Nim would be better served with a better version of something like FRAG / raylib |
16:09:42 | FromGitter | <zacharycarter> than spending months wrapping and keeping a wrapper up to date for atomic |
16:11:33 | FromGitter | <zacharycarter> I know Urho3d / atomic has features that raylib doesn't - like skeletal animation, PBR, etc |
16:11:50 | FromGitter | <zacharycarter> but those things can be added later, for instance raylib has a pbr module built on top of it |
16:16:09 | * | yglukhov quit (Remote host closed the connection) |
16:18:48 | * | yglukhov joined #nim |
16:21:52 | * | cspar joined #nim |
16:22:25 | FromGitter | <Varriount> But c2nim won't |
16:24:01 | * | cspar_ quit (Ping timeout: 248 seconds) |
16:24:13 | FromGitter | <zacharycarter> won't what? |
16:25:07 | * | yglukhov quit (Ping timeout: 276 seconds) |
16:34:03 | Vi- | I have a few functions which share the same signature, now I want to create a variable that points at one to them |
16:34:08 | Vi- | let foo: FunctionType = myFunction |
16:34:09 | Vi- | this works |
16:34:18 | Vi- | let foo: array[1, FunctionType] = [myFunction] this doesnt |
16:34:27 | Vi- | But this does: let foo: array[1, FunctionType] = [FunctionType(myFunction)] |
16:34:32 | Vi- | Is that intended behavior? |
16:36:45 | Vi- | FunctionType is a typedef ofc |
16:50:28 | FromGitter | <mratsim> Is there a way to have nim doc/doc2 follow includes ? |
17:03:42 | * | yglukhov joined #nim |
17:07:28 | * | Matthias247 quit (Read error: Connection reset by peer) |
17:08:05 | * | yglukhov quit (Ping timeout: 240 seconds) |
17:12:18 | koppeh | Vi- is using msvc and the same setup isn't working for her. |
17:12:40 | koppeh | --clibdir appears to be ignored and the --clib provided afterwards not found..? |
17:14:15 | * | nsf quit (Quit: WeeChat 1.7.1) |
17:14:27 | koppeh | This should be translated to the proper arguments (/LIBPATH?) and work, right? |
17:14:48 | koppeh | --clibdir: "../lib/" |
17:14:50 | koppeh | --clib: "/glew32" |
17:15:41 | Vi- | ye I need to do |
17:15:42 | Vi- | --clib: "../lib/glew32" |
17:15:46 | Vi- | and clibdir does nothing |
17:18:06 | subsetpark | Vi-: I can reproduce that... I'm not sure why that should be the case |
17:19:28 | Sentreen | mratsim: use the --project switch |
17:19:36 | * | cspar_ joined #nim |
17:21:24 | FromGitter | <mratsim> @Sentreen: It doesn’t work. I suppose it’s generating doc for import but not for include |
17:21:27 | * | yglukhov joined #nim |
17:21:51 | Vi- | subsetpark, seems like type inference doesnt work on generic types? At least not in that context |
17:21:52 | * | gmpreussner quit (Read error: Connection reset by peer) |
17:22:05 | * | cspar quit (Ping timeout: 240 seconds) |
17:22:11 | subsetpark | Yeah, but the proc I just tried it with was concrete |
17:22:24 | Vi- | mhm I tried that too I think |
17:22:38 | Vi- | I have a table |
17:22:48 | Vi- | It does compile but I cant specify the type |
17:23:08 | Vi- | I kinda wanted to do that to prevent adding random functions to it and erroring out that way but oh well |
17:23:27 | * | nhywyll joined #nim |
17:24:11 | Sentreen | Ah sorry, I thought you said import |
17:25:12 | * | gmpreussner joined #nim |
17:37:28 | * | Trustable quit (Remote host closed the connection) |
18:04:23 | Vi- | Got another error |
18:04:26 | Vi- | process_assets.nim(68, 1) Error: request to generate code for .compileTime proc: traverse |
18:04:36 | Vi- | traverse is definitely not .compileTime |
18:04:48 | FromGitter | <TiberiumN> what can I use to pass data like this: ⏎ ⏎ ```let data = {"a": "asdasd", "b": "bar"}``` ⏎ ⏎ to procedures? [https://gitter.im/nim-lang/Nim?at=595fcd4089aea4761d7661d4] |
18:05:36 | Vi- | afaik thats a set of tuples |
18:05:45 | Vi- | Id use tables |
18:05:59 | * | pilne joined #nim |
18:06:03 | Vi- | but yea |
18:06:05 | Vi- | https://github.com/Victorious3/CGMPT/blob/master/src/process_assets.nim#L50 |
18:06:07 | FromGitter | <TiberiumN> I want to somehow avoid using "toTable" everythere |
18:06:21 | Vi- | This doesnt have .compileTime at all |
18:07:05 | * | bit_lySLH2uSZHed joined #nim |
18:08:25 | * | bit_lySLH2uSZHed left #nim (#nim) |
18:10:22 | Araq | tierium: proc takeSuff(x: openArray[(string, string)]) = ... |
18:10:28 | Araq | takeSuff(data) |
18:11:41 | Araq | Vi-: it is compiletime |
18:11:47 | Vi- | Why? |
18:11:50 | Araq | Resource has ast: NimNode |
18:12:07 | Araq | with means everything dealing with Resource is implicitly .compileTime |
18:12:19 | Vi- | Well I wanted to use asts for some code generation |
18:12:27 | Vi- | this is a workaround because theres no compile time ffi |
18:12:50 | Vi- | I just want to generate some code with it not run anything at compile time |
18:12:58 | Araq | well code generation is compiletime |
18:13:06 | Vi- | source code |
18:13:07 | Vi- | text |
18:14:00 | Vi- | this is supposed to turn into a script that reads the asset folder and then generates a source file called "resources.nim" which has all the information about shaders, etc |
18:14:25 | Araq | the compiler is correct, you need to write this in some different way |
18:14:35 | Vi- | Yes, but how? |
18:14:36 | Araq | but I don't really understand what you're trying to do, sorry. |
18:14:44 | Vi- | Araq, well... |
18:15:01 | Araq | you can import the compiler as a library into your program, perhaps? |
18:15:02 | Vi- | shaders, I want to figure out the uniform names |
18:15:16 | Vi- | And the only way to do that is to run opengl |
18:15:28 | Vi- | and I obviously cant do that at compile time |
18:15:41 | Araq | yeah, but you can import the Nim compiler :-) |
18:15:49 | Vi- | And how does that help me? |
18:17:44 | FromGitter | <ephja> this seems complicated |
18:18:06 | * | Trustable joined #nim |
18:18:22 | Vi- | Well if it ends up working itd be super useful |
18:18:42 | Vi- | having code completion for shaders without having to do anything |
18:20:32 | Vi- | Araq, so I import the compiler, and then? |
18:20:55 | FromGitter | <ephja> but you would have to create a context at run time as well. are the locations deterministic? |
18:21:11 | Vi- | ephja, not the locations but the names |
18:21:31 | Vi- | I just need to run opengl to parse the shader file |
18:22:00 | Vi- | Involves a bit of hackery like spawning an invisible window, etc... but in theory... |
18:22:08 | Vi- | if I manage to get this sorted out that is |
18:22:15 | * | Trustable quit (Remote host closed the connection) |
18:24:58 | Araq | Vi-: use a helper Nim program to produce the names, write them out, read them in at compiletime in the real Nim program? |
18:25:09 | Vi- | thats what Im trying to do |
18:25:29 | Vi- | I wanted to use the ast to help me with the code generation |
18:25:40 | Vi- | with repr |
18:26:14 | Araq | wrap the proc calls into a 'static' block perhaps? |
18:26:22 | Vi- | I could create another one which only does the shaders and then somehow passes that information but it becomes increasingly crazy |
18:26:35 | Vi- | Araq, then I run into the same problem with not being able to call anything opengl |
18:28:16 | Vi- | I mean |
18:28:22 | Vi- | I could do a lot of string concat |
18:28:33 | Vi- | but that becomes ugly really fast |
18:29:20 | FromGitter | <ephja> in what context will you be querying this metadata? |
18:29:54 | Vi- | main program |
18:29:59 | Vi- | so that I can do things like... |
18:30:24 | Vi- | resources.shader.frag.core.myUniform = vec2(...) |
18:30:41 | Vi- | without having to specifiy anything anywhere, just reading from the folder structure |
18:30:42 | * | tankfeeder joined #nim |
18:31:02 | Vi- | because all the information is already present at compile time, I just have to use it... |
18:32:06 | * | tankfeeder_ joined #nim |
18:33:20 | Vi- | Wanted to do this since forever and was all excited about nims compile time code evaluation but then... no compile time ffi :/ |
18:33:42 | FromGitter | <ephja> I'm trying to figure out why the same level of convenience can't be achieved with runtime querying |
18:33:47 | Vi- | I could do some hackery to get around that I think but it doesnt seem right |
18:33:57 | Vi- | @ephja, code completion |
18:33:59 | Vi- | editor |
18:34:10 | Vi- | and having everything checked at compile time |
18:34:31 | Araq | I don't understand why you need to keep the NimNode in the resource and not the 'string' (= repr ast) |
18:34:43 | FromGitter | <ephja> right |
18:34:46 | Vi- | Araq, sure I can do that |
18:34:48 | Araq | you can parseExpr() the string back into an AST later |
18:34:51 | FromGitter | <ephja> that's one benefit of having a DSL |
18:34:56 | Vi- | but at some point I'll have to call a function that uses an ast |
18:35:11 | * | yglukhov quit (Remote host closed the connection) |
18:35:15 | Vi- | readProg <- is supposed to do that |
18:35:18 | * | chrisheller joined #nim |
18:39:09 | FromGitter | <ephja> well, or a shader API. I hope vulkan is more flexible in this regard. I assume it is |
18:39:32 | Vi- | I somehow assumed that using "macro" was the problem and didnt know that simply using a NimNode turns everything into compile time |
18:40:01 | Vi- | ephja, well, doesnt spare me from having to run C functions at compile time ^^" |
18:40:56 | Vi- | but then again, if it worked that way then I didnt have to use an external program... Duh. This is inconvenient |
18:40:58 | * | tankfeeder_ quit (Remote host closed the connection) |
18:41:15 | * | tankfeeder_ joined #nim |
18:41:18 | Vi- | Araq, there any specific reason why compile time ffi isnt allowed? |
18:41:21 | Vi- | Or is it just not implemented yet? |
18:42:49 | Araq | I implemented it twice |
18:43:04 | Araq | it's just not something I'll ever get stable |
18:43:36 | Vi- | I'm not sure about the details but whats required for it? |
18:43:51 | * | tankfeeder_ quit (Client Quit) |
18:44:18 | * | yglukhov joined #nim |
18:44:29 | Vi- | It sounds like something interesting to tackle |
18:45:32 | Vi- | but uh, either ways, I need to somehow create an ast at runtime and repr it |
18:47:08 | Vi- | Or I do something else like... creating an intermediate format and then using the main program to parse that again but its more work |
18:47:24 | Vi- | or string concatination for everything but neither sounds nice |
18:48:04 | Vi- | compile time ffi would fix it... |
18:49:49 | krux02 | Vi: the VM of nim works a bit different than you might think |
18:50:18 | krux02 | on the nimvm all types are reference types, but they try to emulate the same semantic as the flat C types |
18:50:19 | Vi- | I dont know how it works and I'm not making any guesses either |
18:50:38 | Vi- | having ffi at compile time does sound *possible* to me |
18:50:46 | krux02 | therefore you cannot pass pointers from nimvm types to a c function |
18:50:53 | krux02 | the memory layout is simply very different |
18:51:04 | Vi- | well then I only use c types? |
18:51:12 | krux02 | no not even then |
18:51:29 | Vi- | I have the dll |
18:51:34 | krux02 | when you execute a function at compile time it is compiled to bytecode |
18:51:45 | krux02 | and those types the nimvm uses are not C types |
18:51:46 | Vi- | I could hack my way into calling the functions manually |
18:51:53 | krux02 | they behave like them, but they are not |
18:52:36 | krux02 | well i am sure that a limited ffi would work, but general C wrappers of C libraries don't |
18:52:59 | Vi- | or I could use some other program thats not written in C to achieve the same and then feed the information to nim via that detour |
18:53:18 | krux02 | well you call call any program from nim |
18:53:20 | Vi- | s/not// |
18:53:22 | krux02 | that is not a problem |
18:53:29 | * | nsf joined #nim |
18:53:37 | Vi- | yes but its a terrible workaround |
18:53:58 | Vi- | One of the kind that makes me rip my hair out |
18:53:59 | krux02 | Well, nim is not jai |
18:54:13 | Vi- | I guess |
18:54:18 | krux02 | but hey much better than C++ ;) |
18:54:19 | Vi- | but why cant it do what jai does? |
18:54:25 | Vi- | since... |
18:54:37 | * | Trustable joined #nim |
18:54:38 | Vi- | this syntax with jais features would be the absolute killer language |
18:54:42 | Vi- | Id never have to use anything else |
18:54:54 | krux02 | well I did not design nim and I was very surprised when I saw how the nimvm was implemented |
18:55:03 | krux02 | it is something that I would have wanted to know earlier |
18:55:20 | krux02 | because it is also me who assumed and really wanted a c ffi at some point in time |
18:55:30 | Vi- | I came into it with the assumption that you could run any code at compile time you wanted |
18:55:40 | krux02 | I just got that things that I thought I needed done without the ffi |
18:55:43 | Vi- | since everything suggests that |
18:55:56 | shashlick | Araq: when do issues typically get marked as closed? After PR is pulled in or on next official release? |
18:56:01 | krux02 | yea it is not any code |
18:56:12 | Araq | shashlick: when it's fixed in devel |
18:56:13 | krux02 | it is a subset of the nim language |
18:56:16 | Vi- | Oh yea I could write a parser for glsl in... nim... but then I'm not done in the next year |
18:56:22 | Araq | Vi-: koch boot -d:release -d:useFFI |
18:56:36 | krux02 | Araq: interesting |
18:56:36 | Araq | the feature is still there |
18:56:42 | Vi- | What does that do? |
18:56:46 | Araq | you probably need to make it compile again |
18:56:48 | Vi- | And how do I use it? |
18:56:55 | Araq | Vi-: it enables FFI at compiletime |
18:56:59 | krux02 | Vi koch is the build tool for the compiler |
18:57:10 | krux02 | basically the build script for the compiler |
18:57:11 | shashlick | Araq: okay, then do I need to chase down someone to close it or just wait for one of the contributors to get around to it? |
18:57:14 | Vi- | So I need to compile the compiler with that switch? |
18:57:33 | Araq | shashlick: link? I can close it for you |
18:57:46 | Araq | Vi-: yes |
18:58:00 | Vi- | Like if I knew that compile time ffi was planned for the future then Id just postpone this whole asset thing until much later |
18:58:16 | krux02 | Vi-: what are you working on, you said something with glsl |
18:58:48 | Vi- | Was just an experiment but I feel like it could turn into something useful |
18:59:04 | Vi- | city generator, some rendering in opengl |
18:59:11 | krux02 | ah, ok |
18:59:20 | krux02 | any specific reason to use Nim? |
18:59:24 | koppeh | Essentially, pre-processing assets so you have auto-completion and error checking on stuff like shaders for example. |
18:59:36 | Vi- | krux02, because its awesome |
18:59:50 | koppeh | program.someuniform = foo |
19:00:13 | krux02 | well I have a project like that already written in Nim |
19:00:50 | Vi- | mh, afk for a while |
19:00:51 | * | arnetheduck joined #nim |
19:00:53 | krux02 | it doesn't work an a mac |
19:01:00 | Vi- | Araq, I'll try that for curiosity |
19:01:05 | krux02 | but it does that program.someuniform = foo think |
19:01:26 | Vi- | krux02, checking at runtime, then? |
19:01:41 | Vi- | mh, afk |
19:01:47 | krux02 | and when you do that it even generates the code in glsl so that you can use someuniform in the shader with the type of foo |
19:02:22 | krux02 | Vi, no I don't check at runtime, I do it the other way around, I use the types system from Nim and generate the glsl part |
19:02:35 | krux02 | turned out to be much nicer |
19:03:36 | krux02 | I even made a video describing it, but I hate my slow speaking: https://www.youtube.com/watch?v=JO0iqGDgFqA&t=862s |
19:03:53 | krux02 | my first time recording something for youtube |
19:04:15 | krux02 | at least youtube has a 1.5 times speed option and my video is a candidate for it |
19:05:13 | krux02 | here is the hello triangle code: https://github.com/krux02/opengl-sandbox/blob/master/examples/hello_triangle.nim |
19:06:56 | * | Vi- quit (Ping timeout: 260 seconds) |
19:08:16 | krux02 | koppeh: are you in the same project with Vi- |
19:08:18 | krux02 | ? |
19:08:24 | koppeh | Yeah. |
19:08:25 | shashlick | Araq: https://github.com/nim-lang/Nim/issues/5736, https://github.com/nim-lang/Nim/issues/6044 |
19:08:36 | * | dddddd joined #nim |
19:09:06 | krux02 | what you plan to do sounds very similar to what I wanted to do initially, too. But then it evolved ito what I currently have |
19:09:47 | krux02 | so I would really like to have some feedback on that project, and I would like to see what you are working on, of there is something like a github page |
19:11:04 | koppeh | The resources thing was more Vi's idea. |
19:11:54 | Araq | shashlick: "Manjaro doesn't work either." still an issue? |
19:11:57 | koppeh | I was kinda against it because we're supposed to be in prototyping stage. |
19:12:10 | koppeh | https://github.com/Victorious3/CGMPT |
19:12:25 | koppeh | I suppose it doesn't hurt to share but there's basically nothing. |
19:17:37 | krux02 | since you already wrap poll event you could provide an iterator interface for that |
19:18:49 | * | Matthias247 joined #nim |
19:19:09 | koppeh | True, lemme see the nim manual ^^ |
19:21:29 | krux02 | basically you but the polling in the iterator, and then when you use it you simply use a for loop |
19:23:43 | * | tankfeeder quit (Quit: Leaving) |
19:25:28 | shashlick | What's manjaro |
19:27:34 | koppeh | shashlick: A distro based on Arch (https://manjaro.org/) |
19:28:40 | shashlick | I haven't tried it, is there another issue for that |
19:29:57 | krux02 | is there an easy way to pass a seq as varargs? |
19:33:29 | koppeh | krux02: Can't you do that by default? |
19:34:09 | koppeh | Just.. pass the seq as the argument? |
19:43:24 | * | murych joined #nim |
19:43:49 | * | Vi- joined #nim |
19:44:35 | Vi- | krux02, yea then no autocomplete and you can pick the wrong type. Uh, should really configure my bouncer for this |
19:45:11 | Vi- | Im thinking I'll just generate the metadata with a script and put it into some simple file format and then parse that from main |
19:50:07 | krux02 | koppeh: yea I figured that out, I thought there was something fancy, because in Scala I remember to write some weird :_* stuff for that |
19:50:13 | krux02 | then I never used varargs |
19:51:50 | krux02 | Vi-: yes you can do that |
19:52:26 | Vi- | I assume I can read files at compile time? |
19:53:02 | krux02 | Vi-: you are right I don't have autocomplete in glsl because it is just a string in Nim, but that is not really a problem to me. |
19:53:07 | krux02 | yes you can |
19:53:10 | krux02 | slurp |
19:53:13 | Vi- | good, good |
19:53:21 | Vi- | krux02, well its second next best thing to it ^^ |
19:53:48 | krux02 | you call call a script and get the output as a string |
19:54:17 | Vi- | Give me a language like that and I'll try to break every rule possible :3 |
19:54:19 | krux02 | and that feature has some caching argument, so that the script is only executed when there is acutally a different cache argument |
19:54:24 | Vi- | what I did for glew wasnt exactly clean either |
19:54:47 | Vi- | newStrLitNode("__imp___GLEW_" & $extension) <- |
19:55:09 | Vi- | krux02, yup |
19:55:09 | krux02 | newLit("...") does also work |
19:55:47 | krux02 | any reason to use glew instead of the opengl binding? |
19:56:16 | Vi- | so that I dont have a hard dependency on all functions Im using |
19:56:37 | krux02 | sorry you use opengl |
19:56:37 | Vi- | With that macro I can do... if glewGetVar(KHR_debug): ... |
19:56:54 | Vi- | yea I use opengl just with glew behind it |
19:57:40 | krux02 | yea that is a problem in the opengl thing |
19:57:43 | Vi- | getting it to work that way was quite... challenging |
19:57:57 | krux02 | all function it finds in the program are required or it won't start |
19:58:18 | krux02 | would be nice, if you could contribute back somehow to the opengl package |
19:58:29 | Vi- | I fould -d: useGlew |
19:58:42 | Vi- | Its just that I have to call some of the glew functions directly to get it to work |
19:58:44 | krux02 | ah, ok |
19:58:45 | Vi- | *found |
19:59:34 | Vi- | maybe I could work on something that doesnt use glew but allows to have some optional stuff but I'm not sure how |
19:59:53 | Vi- | but yea I found a workaround |
20:05:30 | * | Trioxin quit (Quit: Konversation terminated!) |
20:16:49 | krux02 | ok I go offline now, bye |
20:17:24 | * | krux02 quit (Remote host closed the connection) |
20:24:16 | * | rokups quit (Quit: Connection closed for inactivity) |
20:26:30 | yglukhov | Araq: which command should i send to nimsuggest to get module path, when tocken in question is module name. |
20:26:58 | Araq | def? |
20:27:39 | yglukhov | doesn't work :( |
20:27:46 | yglukhov | but it should, right? |
20:29:08 | Araq | right |
20:35:51 | * | nhywyll quit (Quit: nhywyll) |
20:36:29 | yglukhov | Araq: does this look like a reason why it doesn't work? https://github.com/nim-lang/Nim/blob/devel/compiler/importer.nim#L188 |
20:36:51 | yglukhov | =) |
20:37:10 | Araq | yes |
20:38:20 | yglukhov | so. lets see.. why cant i uncomment this... oh right.. nim doesn't support cyclic imports :P |
20:43:36 | yglukhov | Araq: can your benign kungfu or smth help here? |
20:44:04 | Araq | just do it later in semstmts.nim then |
20:47:12 | Araq | good night |
20:58:54 | yglukhov | good night |
21:18:35 | * | rauss joined #nim |
21:18:36 | * | rauss quit (Client Quit) |
21:18:51 | * | user200112 joined #nim |
21:30:22 | * | krux02 joined #nim |
21:33:52 | * | xet7 quit (Quit: Leaving) |
21:37:16 | * | shashlick quit (Quit: Connection closed for inactivity) |
21:45:31 | * | Trustable quit (Remote host closed the connection) |
21:54:36 | * | salewski quit (Quit: WeeChat 1.4) |
22:31:48 | * | shashlick joined #nim |
22:34:53 | * | couven92 quit (Quit: Client Disconnecting) |
22:51:07 | * | user200112 quit (Quit: Leaving) |
22:56:10 | * | smt quit (Changing host) |
22:56:10 | * | smt joined #nim |
23:15:07 | * | nsf quit (Quit: WeeChat 1.7.1) |
23:43:42 | * | murych quit (Ping timeout: 240 seconds) |
23:45:13 | * | Nobabs27 joined #nim |
23:47:53 | * | Nobabs25 joined #nim |
23:49:29 | * | Nobabs227 joined #nim |
23:50:51 | * | Nobabs27 quit (Ping timeout: 268 seconds) |
23:52:42 | * | Nobabs25 quit (Ping timeout: 268 seconds) |
23:54:42 | * | Nobabs227 quit (Ping timeout: 240 seconds) |
23:54:57 | * | Nobabs227 joined #nim |