00:00:02 | * | junland quit (Quit: %ZNC Disconnected%) |
00:00:44 | FromDiscord | <impbox> hmm the bitops module says it's compatible with JS backend, however when I try to use it on the js backend I get the following error: `\lib\pure\bitops.nim(70, 39) Error: cannot evaluate 'sizeof' because its type is not defined completely`, works fine on c backend |
00:01:43 | * | junland joined #nim |
00:02:02 | * | couven92 joined #nim |
00:02:20 | FromDiscord | <Recruit_main707> (About nimue): its pretty clean ngl, and considering it’s basically OOP I guess it’s not that bad it looks like OOP |
00:03:20 | FromDiscord | <Elegant Beef> Also recruit did you see what my end result was for storing/recovering types from a stream was? |
00:03:54 | FromDiscord | <Recruit_main707> I think I didn’t |
00:03:56 | FromDiscord | <Elegant Beef> Basically any type that's a non pointer can be written to a string stream, with the `write` prock |
00:03:59 | * | couven92 quit (Remote host closed the connection) |
00:04:04 | FromDiscord | <Elegant Beef> Or if it includes a pointer it cant |
00:04:22 | FromDiscord | <Elegant Beef> so you can make any type that relies only on primitives, and you can parse to/from a byte stream using a string stream |
00:04:31 | FromDiscord | <Elegant Beef> So strings are out of the question |
00:04:42 | * | couven92 joined #nim |
00:05:04 | FromDiscord | <Recruit_main707> That’s nice, have you considered doing some benchmarks against Jasón and msgpack? |
00:05:22 | FromDiscord | <Recruit_main707> json* |
00:05:30 | FromDiscord | <Elegant Beef> If you use `stringStream.write` it writes all the primitive data and then the pointer to the data |
00:05:32 | * | Shucks quit (Quit: Leaving) |
00:05:54 | FromDiscord | <Elegant Beef> So if we can figure out how to get the data instead of the pointer we can either update the stream.write proc for generics or make our own |
00:06:08 | FromDiscord | <Elegant Beef> Well it's going to be faster than Json but idk by how much |
00:07:34 | FromDiscord | <Recruit_main707> I might try it out of curiosity with msgpack tomorrow |
00:07:36 | FromDiscord | <Elegant Beef> It's a binary file after all |
00:11:14 | * | couven92 quit (Remote host closed the connection) |
00:11:44 | * | couven92 joined #nim |
00:13:16 | * | couven92 quit (Remote host closed the connection) |
00:13:44 | * | couven92 joined #nim |
00:19:47 | skrylar[m] | bleh. should get around to finishing the gtk3 module |
00:19:51 | skrylar[m] | it was almost done iirc |
00:20:28 | * | endragor joined #nim |
00:25:25 | * | endragor quit (Ping timeout: 264 seconds) |
00:26:25 | FromDiscord | <Elegant Beef> How would one get the underlying type of a sequence |
00:26:33 | FromDiscord | <Elegant Beef> or any generic for that matter 😄 |
00:26:48 | FromDiscord | <impbox> T? |
00:27:01 | FromDiscord | <Elegant Beef> yea i mean `@[10]` i want to get int somehow from that |
00:27:36 | FromDiscord | <Elegant Beef> well more accurately `var a:seq[int]` |
00:28:01 | FromDiscord | <impbox> https://play.nim-lang.org/#ix=2rqe |
00:28:27 | FromDiscord | <Elegant Beef> Thanks |
00:28:45 | FromDiscord | <impbox> there may be other easier ways but that's what came to mind |
00:29:03 | FromDiscord | <exelotl> oh lol, that's good |
00:29:10 | FromDiscord | <exelotl> I was about to delve into macros xD |
00:29:31 | FromDiscord | <Elegant Beef> Lol im daft |
00:29:52 | FromDiscord | <Elegant Beef> Yes im daft |
00:30:19 | FromDiscord | <exelotl> [backing vocals] *he's daft* |
00:30:24 | FromDiscord | <impbox> `echo $typeof(a[0])` |
00:30:36 | FromDiscord | <Elegant Beef> Yea doesnt work when the seq is empty impbox |
00:30:43 | FromDiscord | <impbox> it does =) |
00:30:50 | FromDiscord | <Elegant Beef> No the latest |
00:30:54 | FromDiscord | <impbox> i wasn't sure it would |
00:31:09 | FromDiscord | <Elegant Beef> `a[0]` should error if emptied |
00:31:14 | FromDiscord | <impbox> https://play.nim-lang.org/#ix=2rqh |
00:31:15 | FromDiscord | <impbox> try it |
00:31:30 | FromDiscord | <Elegant Beef> The fuck D: |
00:31:46 | FromDiscord | <impbox> typeof isn't actually accessing the sequence contents |
00:32:06 | FromDiscord | <impbox> you could do a[1000] it's the same |
00:32:59 | FromDiscord | <impbox> ok, back to gamedev |
00:45:32 | FromDiscord | <Rika> does anyone use nim-serialization (making formats, not just using json_serialization) |
00:47:27 | FromDiscord | <Rika> i'd like to know your opinion on it |
00:47:43 | FromDiscord | <Rika> is it hard to use, better than implementing your own api, etc |
00:56:27 | * | endragor joined #nim |
01:00:34 | * | endragor quit (Ping timeout: 240 seconds) |
01:24:03 | FromDiscord | <Elegant Beef> @Recruit_main707 silly progress↵https://play.nim-lang.org/#ix=2rqp |
01:24:43 | FromDiscord | <Elegant Beef> using 4 null characters is clearly dumb for seperating elements |
01:24:57 | FromDiscord | <Elegant Beef> clearly should just use 4 bytes to indicate the count of them |
01:25:30 | FromDiscord | <Rika> or the charlen of them |
01:25:47 | FromDiscord | <Elegant Beef> Yea i mean both are the same |
01:26:53 | FromDiscord | <Elegant Beef> idk isnt 2^16 enough elements? 😄 |
01:28:32 | FromDiscord | <Elegant Beef> But hey i got around the dumb pointer issue |
01:28:46 | FromDiscord | <Rika> congrats |
01:28:49 | * | endragor joined #nim |
01:28:51 | FromDiscord | <Rika> the code is now 5x larger |
01:28:56 | FromDiscord | <Elegant Beef> But i know atm recursive collection is dumb |
01:28:58 | FromDiscord | <Elegant Beef> Lol |
01:29:11 | FromDiscord | <Elegant Beef> it will shrink when i store count instead |
01:30:25 | FromDiscord | <Elegant Beef> Well a tad bit |
01:33:25 | * | endragor quit (Ping timeout: 258 seconds) |
01:35:04 | * | chemist69 quit (Ping timeout: 256 seconds) |
01:37:02 | * | chemist69 joined #nim |
01:40:28 | * | couven92 quit (Ping timeout: 256 seconds) |
01:45:42 | FromDiscord | <Elegant Beef> Now with nested objects↵https://play.nim-lang.org/#ix=2rqv |
01:46:45 | disruptek | if you can do better than frosty, please do so. the trick is in writing variant objects. |
01:48:56 | * | arecaceae quit (Remote host closed the connection) |
01:49:21 | * | arecaceae joined #nim |
01:51:42 | shashlick | Disruptek - testing nimgit2 with prebuilt binaries upto 1.0.1 |
01:52:46 | shashlick | Made a bunch of custom builds with jbb - https://bintray.com/genotrance/binaries/LibGit2 |
01:55:15 | disruptek | does it work? |
01:56:13 | shashlick | Testing in progress |
02:00:26 | * | laqq3 joined #nim |
02:01:31 | * | endragor joined #nim |
02:05:47 | shashlick | disruptek: for some reason, gittyup is failing - makes no sense - https://travis-ci.org/github/genotrance/travister/jobs/707258741#L11004 |
02:06:22 | shashlick | here's the test script - https://github.com/genotrance/travister/blob/master/test.sh |
02:09:03 | shashlick | i don't see why nimterop and nimgit2 get installed again after they are already installed earlier |
02:10:51 | shashlick | anyway, shouldn't gate the release - i think the problem is that nimterop is nimble develop mode so it is treated as #head so since you have nimterop < 1.0.0, it might be excluding head and installing v0.6.2 as well |
02:11:35 | disruptek | https://vale.dev/ |
02:14:46 | disruptek | shashlick: i cannot load the raw log for that job. |
02:17:48 | * | endragor quit (Ping timeout: 256 seconds) |
02:21:20 | FromDiscord | <Elegant Beef> Ok object variants are going to be hard to save |
02:24:35 | disruptek | i think timmy solved it recently, but also there's json.to for inspiration. |
02:24:55 | * | muffindrake quit (Ping timeout: 272 seconds) |
02:26:25 | * | muffindrake joined #nim |
02:29:26 | bung | does karax deep diff Component's fields ? |
02:35:49 | shashlick | Never mind |
02:44:20 | FromDiscord | <Yardanico> guess what that is guys? 😄 https://media.discordapp.net/attachments/371759389889003532/731702453795553340/unknown.png |
02:44:36 | FromDiscord | <Yardanico> apparently some person updated Sciter bindings for Nim a bit (although for win only), and with a couple of fixes I launched it on linux |
02:44:36 | FromDiscord | <Yardanico> https://github.com/citrusn/nsciter |
02:44:44 | FromDiscord | <Yardanico> (Sciter as in https://sciter.com/) |
02:45:19 | FromDiscord | <Elegant Beef> So it's a webview |
02:45:23 | disruptek | but those window decorations... |
02:45:35 | FromDiscord | <Yardanico> @Elegant Beef not exactly |
02:45:47 | FromDiscord | <Yardanico> Sciter implements custom html/css/scripting engines from ground up |
02:45:59 | FromDiscord | <Yardanico> even though the HTML is fully compatible with normal HTML |
02:46:02 | FromDiscord | <Yardanico> the library itself is 5-8mb |
02:46:10 | FromDiscord | <Yardanico> @disruptek it's from my current DE, not the framework |
02:46:17 | FromDiscord | <Elegant Beef> I'd hope 😄 |
02:46:17 | disruptek | i know, it's horribad. |
02:46:26 | FromDiscord | <Yardanico> and yes, sciter is not about native GUI and the source is closed (unless you pay) |
02:46:29 | FromDiscord | <Yardanico> well this is just a temporary DE |
02:46:31 | FromDiscord | <Elegant Beef> what is that XFCE ugly 😄 |
02:48:18 | FromDiscord | <Yardanico> also apparently the bindings work because the sciter API was completely unchanged even since the old commit which was made 4 years ago in the repo |
02:48:23 | FromDiscord | <Yardanico> even after one major version increase |
02:48:28 | FromDiscord | <Elegant Beef> Damn |
02:48:35 | FromDiscord | <Yardanico> well, the C API that is |
02:48:46 | FromDiscord | <Yardanico> HTML/CSS/scripting engines of course received fixes, also new features and stuff |
02:48:49 | FromDiscord | <Yardanico> but it still fits with the same API |
02:49:03 | FromDiscord | <Elegant Beef> is the scripting js or a proprietary language? |
02:49:10 | disruptek | proprietary. |
02:49:22 | FromDiscord | <Yardanico> it's similar to JavaScript in some ways, but it's not JS |
02:49:36 | FromDiscord | <Yardanico> also sciter's creator was a part of W3C HTML5 development group btw |
02:49:44 | FromDiscord | <Yardanico> since Sciter had a lot of features modern HTML5/CSS have years before |
02:50:02 | FromDiscord | <Yardanico> @Elegant Beef https://sciter.com/developers/for-web-programmers/tiscript-vs-javascript/ |
02:50:19 | FromDiscord | <Yardanico> if you want you can not use any of this scripint language aAT ALL |
02:50:22 | FromDiscord | <Yardanico> (edit) 'aAT' => 'AT' |
02:50:24 | FromDiscord | <Yardanico> and only native APIs |
02:50:28 | FromDiscord | <Yardanico> but sometimes it's more convenient |
02:50:28 | FromDiscord | <Elegant Beef> Ah |
02:50:34 | FromDiscord | <Elegant Beef> But i mean this is a JIT language |
02:50:38 | FromDiscord | <Yardanico> no? |
02:50:43 | FromDiscord | <Yardanico> it's a VM'd language |
02:50:49 | FromDiscord | <Elegant Beef> > compiler that produces byte code |
02:50:52 | FromDiscord | <Elegant Beef> Sounded like JIT |
02:50:56 | FromDiscord | <Yardanico> that's not JIT |
02:51:08 | FromDiscord | <Yardanico> JIT is what makes native machine code on-the-fly from the bytecode |
02:51:16 | FromDiscord | <Elegant Beef> C#/JVM both take bytecode into their VMs |
02:51:20 | FromDiscord | <Yardanico> yes |
02:51:25 | FromDiscord | <Yardanico> but they *also* have JIT |
02:51:28 | FromDiscord | <Elegant Beef> Ah |
02:51:31 | FromDiscord | <Yardanico> you don't need JIT if you have a VM |
02:51:43 | FromDiscord | <Yardanico> I mean it's not required |
02:51:50 | FromDiscord | <Elegant Beef> Thought the VM used said byte code |
02:52:11 | FromDiscord | <Yardanico> well byte code literally means "bytecode" |
02:52:13 | FromDiscord | <Yardanico> not machine code |
02:52:14 | FromDiscord | <Yardanico> 😛 |
02:52:16 | FromDiscord | <Elegant Beef> Yea |
02:52:20 | FromDiscord | <Elegant Beef> Isnt that where the JIT happens |
02:52:23 | FromDiscord | <Elegant Beef> at the VM |
02:52:26 | FromDiscord | <Yardanico> no, later |
02:52:42 | FromDiscord | <Yardanico> because compiling all byte-code to JIT can be costly or even make the program less efficient |
02:52:52 | FromDiscord | <Yardanico> so JITs usually only compile the most executed parts of the running code |
02:54:18 | * | endragor joined #nim |
02:54:49 | * | pangey quit (Ping timeout: 264 seconds) |
02:55:31 | FromDiscord | <Elegant Beef> Ah i see, a VM is just an intepreter 😄 |
02:55:47 | FromDiscord | <Elegant Beef> And unlike python they convert to bytecode for their intepreter |
02:55:59 | FromDiscord | <Yardanico> well bytecode is useful for mainly one reason |
02:56:09 | FromDiscord | <Yardanico> the fact that after you parse source into bytecode, you don't need to parse byte-code again |
02:56:12 | FromDiscord | <Yardanico> less time to start the execution |
02:56:17 | FromDiscord | <Elegant Beef> Yea i got that |
02:56:21 | FromDiscord | <Yardanico> that's why most distros precompile .py files into .pyc |
02:56:26 | FromDiscord | <Yardanico> so they don't get parsed each time |
02:57:02 | * | pangey joined #nim |
02:59:49 | FromDiscord | <Yardanico> anyway even if sciter is proprietary, they're pretty cool about licensing |
03:00:06 | FromDiscord | <Yardanico> basically "use any files you find in sciter-sdk, just include a reference to us" |
03:00:46 | FromDiscord | <Yardanico> they provide binaries (sciter as a dynamic library or as a standalone app for small html/css/tiscript only projects) for windows/linux (arm32 and amd64)/macos |
03:00:56 | FromDiscord | <Rika> python uses bytecode |
03:01:19 | disruptek | rika: watch yourself. |
03:02:01 | shashlick | Do you need nimterop bindings |
03:02:18 | shashlick | Seems like there's a need for up to date bindings for these gui libs |
03:02:29 | FromDiscord | <Yardanico> for sciter? maybe I should do, but these bindings work already, although they're a bit of a mess |
03:02:34 | FromDiscord | <Yardanico> basically the API itself didn't change at all |
03:02:43 | FromDiscord | <Yardanico> so these bindigs (from a fork I'm using) mostly work |
03:02:50 | FromDiscord | <Yardanico> I'm not sure if nimterop will work with scinter's headers |
03:03:09 | shashlick | It looked like simple c |
03:03:09 | disruptek | that sounds like a challenge. |
03:03:21 | shashlick | I'm too old for those |
03:03:25 | FromDiscord | <Rika> $ watch ./rika |
03:03:34 | FromDiscord | <Yardanico> @shashlick one sec |
03:03:49 | FromDiscord | <Yardanico> they're in here https://github.com/c-smile/sciter-sdk/tree/master/include |
03:03:54 | FromDiscord | <Yardanico> we only need .h files obviously 🙂 |
03:04:10 | FromDiscord | <Yardanico> it's just that it has a lot of defines |
03:04:15 | FromDiscord | <Yardanico> and checking them |
03:04:38 | FromDiscord | <Yardanico> well I guess nimterop will just solve them before generating the binding and I'll get bindings for linux only |
03:06:52 | * | endragor quit (Ping timeout: 256 seconds) |
03:07:38 | shashlick | cloning - why is it such a fat repo |
03:07:58 | FromDiscord | <Yardanico> because it has binaries : ) |
03:08:08 | FromDiscord | <Yardanico> all publicly available versions of sciter |
03:08:15 | FromDiscord | <Yardanico> and of course they're all in history |
03:08:19 | FromDiscord | <Yardanico> so you better do a shallow clone 😄 |
03:09:13 | shashlick | okay depth = 1 |
03:09:36 | FromDiscord | <Rika> mmmm binaries in a git repo |
03:09:59 | FromDiscord | <Yardanico> well why not, in that case it's actually a bit useful 😛 |
03:10:04 | FromDiscord | <Yardanico> since you have the whole history in case you want to rollback |
03:10:06 | FromDiscord | <Yardanico> and free CDN |
03:10:43 | shashlick | gitnim |
03:10:49 | shashlick | gtk2 or 3 |
03:10:53 | FromDiscord | <Yardanico> gtk3 |
03:10:57 | FromDiscord | <Yardanico> x64 only |
03:11:03 | FromDiscord | <Yardanico> well, also arm32 |
03:11:11 | shashlick | great - it will pull in all of gtk in the wrapper |
03:11:25 | FromDiscord | <Yardanico> well but why? |
03:11:40 | FromDiscord | <Yardanico> you can't statically link with it anyway, they only provide public api for their dynamic library |
03:11:55 | FromDiscord | <Yardanico> static linking is only if you buy a license (then you'll get source code) |
03:12:11 | FromDiscord | <Yardanico> well I mean it still can be useful, but they use native APIs on windows for example |
03:12:13 | FromDiscord | <Yardanico> and on macos |
03:12:24 | FromDiscord | <Yardanico> They use GTK on Linux because that's arguably the most "native" gui toolkit on it |
03:13:41 | shashlick | well, nimterop recurses into #include files so need to turn that off |
03:13:46 | shashlick | and do each header specifically |
03:14:35 | FromDiscord | <Yardanico> yeah, the "bindings" seem to have used c2nim |
03:14:49 | FromDiscord | <Yardanico> official ones* |
03:17:11 | shashlick | this is like a gtk wrapper action replay |
03:17:16 | shashlick | did that a week ago so should be quick |
03:18:12 | FromDiscord | <Yardanico> i hope so, then it'll be much easier to create higher-level scinter bindings 😛 |
03:18:39 | FromDiscord | <Yardanico> although scinter itself isn't "popular", it seems to be successfully used in commercial apps |
03:18:48 | FromDiscord | <Yardanico> a lot of antiviruses specifically use it for their UI |
03:19:25 | shashlick | that's not a great advertisement |
03:19:32 | FromDiscord | <Yardanico> 😄 |
03:19:49 | FromDiscord | <Yardanico> well they have a list of their customers on the website |
03:20:04 | FromDiscord | <Yardanico> also War Thunder's launcher uses sciter too apparently |
03:20:13 | FromDiscord | <Yardanico> (it's a game) |
03:20:23 | shashlick | we need all the .h files covered right? |
03:20:46 | FromDiscord | <Yardanico> well I'm not sure if 100% all |
03:20:54 | FromDiscord | <Yardanico> I think sciter-x-***.h ones for sure |
03:21:46 | FromDiscord | <Yardanico> oh wait maybe I'm really wrong |
03:22:25 | FromDiscord | <Yardanico> well the x-api.h yes for sure |
03:23:10 | FromDiscord | <Yardanico> same for sciter-[x-behavior, x-def, x-dom, x-graphics, x-request,x-types,x-value] |
03:23:42 | FromDiscord | <Yardanico> basically you can see here which ones it includes for all, and which ones only for C++ - https://github.com/c-smile/sciter-sdk/blob/master/include/sciter-x.h#L24 |
03:26:35 | * | laqq3 quit (Ping timeout: 256 seconds) |
03:27:25 | * | NimBot joined #nim |
03:27:38 | FromDiscord | <Yardanico> so in the end you'll have a huge ISciterAPI type |
03:27:53 | FromDiscord | <Zachary Carter> How can I deal with - ```span<const int16_t>``` with importcpp? |
03:28:07 | FromDiscord | <Zachary Carter> I tried span[int16] but I get an error |
03:28:22 | FromDiscord | <Zachary Carter> `no viable conversion from 'span<const int16_t>' to 'span<NI16>'` |
03:29:52 | FromDiscord | <Zachary Carter> oh I can just importcpp `const int16_t` as a type cool |
03:41:57 | FromDiscord | <Yardanico> well even sciter's low-level binding is "easy" when you don't have to interface with your native app at all 😄 https://media.discordapp.net/attachments/371759389889003532/731716953621790770/unknown.png |
03:44:15 | FromDiscord | <Zachary Carter> nice |
03:44:15 | * | endragor joined #nim |
03:48:11 | FromDiscord | <Yardanico> @shashlick also - you don't really need to provide it as "dynlib" for the whole thing |
03:48:48 | FromDiscord | <Yardanico> the current binding basically loads the DLL and _only_ gets a single proc called SciterAPI which returns an instance of that interface (which contains pointers to all functions of the API) |
03:49:49 | FromDiscord | <Yardanico> very interesting solution 😛 |
03:50:44 | * | endragor quit (Remote host closed the connection) |
03:50:58 | * | endragor joined #nim |
03:51:06 | FromDiscord | <Yardanico> (I mean that's how the library works) |
03:58:32 | FromDiscord | <Zed> has anyone tried julia out for ml? |
04:04:17 | * | njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
04:04:23 | * | njoseph joined #nim |
04:04:24 | shashlick | what specific portions do you need |
04:06:02 | * | supakeen quit (Quit: WeeChat 2.8) |
04:06:41 | * | supakeen joined #nim |
04:06:57 | FromDiscord | <Elegant Beef> I feel dirty calling this recursively↵https://play.nim-lang.org/#ix=2rqO |
04:07:19 | FromDiscord | <Elegant Beef> lol at line 38..41 |
04:09:18 | shashlick | Yardanico - c++ mixed up with C |
04:17:40 | FromDiscord | <Yardanico> @shashlick we only need the pure C part 🙂 |
04:17:48 | FromDiscord | <Yardanico> they mix C++ in to provide some convenience wrappers for it |
04:20:58 | * | hoijui joined #nim |
04:21:13 | FromDiscord | <Yardanico> idk if it's easy to do with nimterop, I also never tried with c2nim myself, just used someone else's bindings |
04:22:09 | shashlick | there was one portion which is incorrectly c++ |
04:23:00 | shashlick | was trying to use the cfg file method but i need some cOverrides |
05:02:14 | bung | https://github.com/bung87/nimvideo/blob/master/src/nimvideo/header.nim#L19 why it does not redraw the view? |
05:03:43 | * | arecaceae quit (Remote host closed the connection) |
05:04:27 | * | arecaceae joined #nim |
05:08:10 | ForumUpdaterBot | New thread by Bung: Karax not redraw when seq data changed, I called autoRef.markDirty() and redraw(), see https://forum.nim-lang.org/t/6537 |
05:11:22 | shashlick | @Yardanico - here's what i have so far - http://ix.io/2rqU - still some missing types that need to be imported from gtk, etc. |
05:11:38 | FromDiscord | <Yardanico> oh nice |
05:11:57 | FromDiscord | <Yardanico> how do you import locally like that? |
05:16:04 | FromDiscord | <Yardanico> also would it be possible to make it cross-platform later? for cross-compilation and such |
05:16:28 | FromDiscord | <Yardanico> but yeah, I'll try it 😛 |
05:22:01 | FromDiscord | <Yardanico> I'm getting some errors though, one from missing hb.h (added harfbuzz cIncludeDir) |
05:22:02 | * | Tongir quit (Remote host closed the connection) |
05:22:20 | FromDiscord | <Yardanico> and now "ERROR: cstring: No such file or directory", I'm on Artix (Arch fork) |
05:22:25 | * | Tongir joined #nim |
05:22:31 | FromDiscord | <Yardanico> "cstring" seems to come from C++ stdlib |
05:23:53 | FromDiscord | <Yardanico> ah well I solved it I think |
05:23:58 | FromDiscord | <Yardanico> " Error: undeclared identifier: 'LPRECT'" 😛 |
05:24:04 | FromDiscord | <Yardanico> but it is as you say now |
05:24:58 | FromDiscord | <Yardanico> LPRECT can be redefined in Nim side, I'll try |
05:25:16 | FromDiscord | <Yardanico> with cOverride |
05:28:26 | FromDiscord | <Yardanico> @shashlick I think nimterop is parsing sciter-x-graphics (SciterGraphicsApi struct) incorrectly |
05:29:38 | FromDiscord | <Yardanico> ISciterAPI too |
05:30:04 | FromDiscord | <Yardanico> it names all fields with "SCFN" |
05:30:10 | FromDiscord | <Yardanico> and assumes argument type to be the proc name |
05:30:19 | FromDiscord | <Yardanico> (yeah these includes use some macros and stuff) |
05:31:16 | FromDiscord | <Yardanico> seems to be same for SciterRequestAPI |
05:38:28 | FromDiscord | <Yardanico> my src is https://play.nim-lang.org/#ix=2rqX |
05:38:45 | shashlick | Gotta bed but will take a look tomorrow |
05:38:55 | FromDiscord | <Yardanico> it's okay, I'm going to sleep soon to, thanks for all the work 🙂 |
05:39:29 | shashlick | Ya you need to comment out cstring in that one file om.h |
05:39:45 | FromDiscord | <Yardanico> yeah I made it empty 😛 |
05:39:57 | shashlick | Gotta define some gtk imports in cOverride |
05:40:16 | FromDiscord | <Yardanico> I mean it won't work properly because main interface structs are getting parsed incorrectly |
05:40:36 | FromDiscord | <Yardanico> check ISciterAPI for example in the generated .nim file |
05:41:48 | shashlick | Will check tomorrow |
05:42:10 | shashlick | For now you can cOverride any bugs and we can fix in nimterop |
05:42:27 | * | debased joined #nim |
05:44:59 | shashlick | Can you snippet the bad portion |
05:46:13 | FromDiscord | <Yardanico> Sorry, I'm already away from the PC, but it's basically from this C code - e.g https://github.com/c-smile/sciter-sdk/blob/master/include/sciter-x-api.h#L54 |
05:46:31 | FromDiscord | <Yardanico> It's supposed to call a SCFN macro but nimterop makes a field named SCFN |
05:46:43 | FromDiscord | <Yardanico> And first argument being the actual function name |
05:47:31 | FromDiscord | <Yardanico> SCFN is defined in https://github.com/c-smile/sciter-sdk/blob/master/include/sciter-x-types.h#L231 |
05:50:47 | FromDiscord | <Yardanico> Nimterop makes something like (for the field of the object) SCFN*: proc (a1: SciterClassName) |
05:51:33 | FromDiscord | <Yardanico> but it should make SciterClassName: proc() instead (I omitted the pragmas) |
05:51:46 | FromDiscord | <Yardanico> Also missed export marker :p |
05:53:02 | * | solitudesf joined #nim |
05:54:35 | shashlick | Looks like it wasn't preprocessed |
05:55:39 | shashlick | Anyway, will check tomorrow, later |
05:55:59 | * | vicfred_ quit (Quit: Leaving) |
06:08:52 | * | hoijui quit (Ping timeout: 260 seconds) |
06:19:32 | * | endragor quit (Remote host closed the connection) |
06:20:24 | * | endragor joined #nim |
06:25:05 | * | endragor quit (Ping timeout: 256 seconds) |
06:44:30 | * | hoijui joined #nim |
06:45:54 | * | Cthalupa quit (Ping timeout: 240 seconds) |
06:46:25 | * | endragor joined #nim |
06:48:56 | * | Cthalupa joined #nim |
07:01:35 | * | letto quit (Quit: Konversation terminated!) |
07:03:21 | * | letto joined #nim |
07:21:33 | * | Tongir quit (Remote host closed the connection) |
07:21:57 | * | Tongir joined #nim |
07:36:59 | * | debased quit (Quit: WeeChat 2.8) |
07:41:44 | * | sagax joined #nim |
07:57:13 | * | bung_ joined #nim |
08:00:49 | * | bung quit (Ping timeout: 264 seconds) |
08:17:44 | * | oddp joined #nim |
08:25:46 | * | Shucks joined #nim |
08:43:20 | * | nsf joined #nim |
08:44:26 | ForumUpdaterBot | New thread by Hugogranstrom: Question about move semantics for objects and seqs, see https://forum.nim-lang.org/t/6538 |
08:50:48 | * | Vladar joined #nim |
09:04:27 | * | drewr quit (Ping timeout: 260 seconds) |
09:06:06 | * | drewr joined #nim |
09:07:31 | * | Vladar quit (Quit: Leaving) |
09:29:09 | FromDiscord | <Clyybber> planetis[m]: Is your memory leak with your repo also fixed? |
09:36:16 | planetis[m] | yes |
10:06:17 | * | couven92 joined #nim |
10:07:48 | FromDiscord | <Clyybber> oh, nice! |
10:41:00 | * | Shucks quit (Ping timeout: 256 seconds) |
10:57:46 | * | hoijui quit (Ping timeout: 256 seconds) |
11:11:59 | * | couven92 is now known as fredrikhr |
11:14:01 | * | Vladar joined #nim |
11:14:12 | * | beatmox- quit (Ping timeout: 244 seconds) |
11:15:01 | * | qwertfisch quit (Quit: ZNC - http://znc.in) |
11:15:05 | * | beatmox joined #nim |
11:15:38 | * | qwertfisch joined #nim |
11:32:04 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
12:06:01 | * | supakeen quit (Quit: WeeChat 2.8) |
12:06:26 | * | pbb quit (Read error: Connection reset by peer) |
12:06:37 | * | supakeen joined #nim |
12:06:55 | * | pbb joined #nim |
12:19:42 | bung_ | hmm I got `Cannot read property 'id' of null at same_11135072 (app.js:2034)` at two lines |
12:20:08 | bung_ | while developing karax project, any clue? |
12:32:14 | FromDiscord | <Clyybber> Araq: I replied to your review comment |
12:33:35 | Araq | well you removed code and fixed bugs |
12:33:43 | Araq | what's this magic? |
12:33:57 | Araq | how does it work? |
12:34:25 | FromDiscord | <Clyybber> :D |
12:36:01 | FromDiscord | <Clyybber> Basically this: When we encounter an expression like stmtListExpr we must insert its destructors and decls into the parent scope, because the result will escape. |
12:36:36 | FromDiscord | <Clyybber> (edit) 'stmtListExpr' => 'nkBlockExpr' |
12:37:20 | FromDiscord | <Clyybber> and since the result expr may be something like Obj(s: someVarInsideTheBlockExpr) its not correct to destroy s before that |
12:43:58 | Araq | debatable |
12:45:14 | FromDiscord | <Clyybber> well, otherwise it will crash :p |
12:45:43 | Araq | there is no reason to delay f()'s destruction in (var tmp = g(f()); tmp) |
12:46:06 | FromDiscord | <Clyybber> Yeah, this will be optimized by the eager destructor injection mode I envision |
12:46:27 | Araq | well the code before your PR already does that |
12:46:57 | FromDiscord | <Clyybber> Which will inject `=destroy` calls as far "up" as possible, retaining order |
12:47:20 | FromDiscord | <Clyybber> Araq: Yeah, but its the wrong aproach IMO |
12:47:38 | FromDiscord | <Clyybber> Its easier to just move the destroy calls as far up as possible |
12:48:03 | Araq | the concept of an "escaping expression" is a good one and not the wrong approach |
12:48:09 | * | liblq-dev joined #nim |
12:48:19 | * | liblq-dev quit (Client Quit) |
12:48:21 | FromDiscord | <Clyybber> Yeah, but the escaping expression depends on its scope |
12:48:50 | FromDiscord | <lqdev> shashlick: where do I start if I want to generate a standalone wrapper with nimterop? |
12:48:52 | FromDiscord | <Clyybber> This is what my PR does, it takes the whole scope with the escaping expression |
12:53:44 | ForumUpdaterBot | New thread by Xflywind: An issue regarding `emit`, see https://forum.nim-lang.org/t/6539 |
12:55:03 | FromDiscord | <Clyybber> Araq: We could also build a dependency net of expressions that are required for the last expression, but the order in which destructors are added to scope.final is basically that, as in "later vars depend on earlier ones" |
12:56:14 | FromDiscord | <Clyybber> And a smarter =destroy injection could simply iterate over the scope.final destroys and insert them as close as possible to their lastRead/Write, retaining the order |
13:05:27 | FromDiscord | <Clyybber> Araq: Hmm, actually devel doesn't destroy f() early either |
13:05:53 | FromDiscord | <Clyybber> sent a code paste, see https://play.nim-lang.org/#ix=2rrR |
13:08:34 | FromDiscord | <Clyybber> Ah, but it does so when a block: is involved |
13:56:10 | * | dadada quit (Ping timeout: 246 seconds) |
13:58:01 | * | dadada joined #nim |
13:58:24 | * | dadada is now known as Guest44090 |
14:10:11 | Oddmonger | what ?! nim> [1,99,2] |
14:10:13 | Oddmonger | [1, 99, 2] == type array[0..2, int] |
14:10:47 | FromDiscord | <lqdev> ? |
14:13:21 | Oddmonger | shouldn't it be : type array[1,2,99, int] ? |
14:13:42 | Araq | Clyybber: I'd appreciate if you fixed the bugs with my code rather than removing it |
14:14:13 | Araq | your version has no explicit 'escapingExpr' concept anymore and that seems harmful. |
14:14:34 | Araq | it's too subtle if it just "happens to work because our algorithm is super smart" |
14:17:10 | Oddmonger | ah i've understood the notation, 0..2 is the number of entries, not the entries themselves |
14:19:18 | * | Shucks joined #nim |
14:25:47 | FromDiscord | <Yardanico> @Oddmonger if it's easier to you, you can use array[3, int] |
14:25:54 | FromDiscord | <Yardanico> which is the same as array[0..2, int] |
14:29:07 | FromDiscord | <Clyybber> Araq: But it *has* escapingExpr, its just a boolean now |
14:29:12 | FromDiscord | <Clyybber> What is gone is escapingSyms |
14:29:28 | Oddmonger | Yardanico: yes, i was perturbated by the sliced notation, but that's ok |
14:29:42 | FromDiscord | <Clyybber> Because my approach pessimistically considers all of them to be potentially escaping since they might be used in the escapingExpr |
14:29:44 | Araq | Clyybber: hmm |
14:29:51 | Oddmonger | i'm still try to understand differences between arrays and seqs (amongts other things) |
14:30:03 | Araq | well maybe it'll grow on me |
14:30:24 | Araq | but I don't like the "pessimistically considers" and then we optimize it away again |
14:30:51 | Araq | writing these optimization passes is not exactly trivial, see my "optimizer.nim" in my branch |
14:32:23 | Araq | btw we should add knowledge about 'ref' to injectdestructors.nim, so that instead of 'wasMoved(tmp); =(tmp, x)' we produce 'if x != nil: incRef(x)' directly |
14:33:21 | Araq | we know how =copy for refs works, we can do it without offering =copy for custom types |
14:33:54 | FromDiscord | <Clyybber> hmm, do you want =/=copy to be gone? |
14:35:41 | Araq | I'm talking about |
14:36:51 | Araq | adding a special case to 'passCopyToSink' |
14:37:08 | FromDiscord | <Clyybber> Ah, I see |
14:37:20 | Araq | for n.typ.kind == tyRef |
14:37:57 | FromDiscord | <Clyybber> So instead of copying it into a tmp to increase the refcount we would increase it directly and pass it directly instead of the temp? |
14:38:28 | Araq | you can keep the temp but there is no need to 'wasMoved' it |
14:38:46 | FromDiscord | <Clyybber> I see. Why would we wasMoved it anyways? |
14:38:51 | FromDiscord | <Clyybber> Oh, nevermind |
14:38:54 | Araq | :P |
14:39:33 | FromDiscord | <Clyybber> Araq: I thought about introducing a `=weak` (or some better name) that would be the `=` hook but without destroying the LHS |
14:39:44 | FromDiscord | <Clyybber> Then we could get rid of the wasMoved(tmp) |
14:39:55 | Araq | yeah well, I call it =copy |
14:39:57 | FromDiscord | <Clyybber> And we could also apply firstWrite optimization to assigns then |
14:40:57 | Araq | we need to be very careful though, already we have '=', '=sink', '=destroy' and undocumented '=dispose' and '=trace' |
14:41:54 | FromDiscord | <Clyybber> Yeah |
14:42:05 | * | lritter joined #nim |
14:42:08 | Araq | we could remove =sink though and have =copy instead of '=' |
14:42:38 | FromDiscord | <Clyybber> renamning = to =copy is a good idea IMO |
14:42:45 | Araq | it's not a rename! |
14:42:58 | FromDiscord | <Clyybber> oh, right, =copy would be = without the LHS destroy? |
14:43:03 | Araq | yes |
14:43:14 | Araq | just like a C++ copy constructor |
14:43:14 | FromDiscord | <Clyybber> So would we remove `=` then? |
14:44:02 | FromDiscord | <Clyybber> I was thinking about it too, wether there is a benefit to have the undestroyed LHS available in `=` |
14:44:08 | Araq | yeah but it has downsides |
14:44:34 | Araq | 1. you cannot do atomic assignments then anymore |
14:45:07 | Araq | 2. you cannot optimize inside your '=' and keep the allocated buffer around |
14:45:26 | FromDiscord | <Clyybber> Hmm, right. Thats a big one |
14:46:34 | * | Trustable joined #nim |
14:46:36 | FromDiscord | <Clyybber> I guess the best way is to have both the current `=` and `=copy`, If we only have `=copy` we can generate `=` from that. If we only have `=` we simply don't do the firstWrite optimization for assigns |
14:46:52 | Araq | and self-assignments become more problematic too |
14:47:52 | Araq | btw even your recent =destroy optimization has downsides |
14:48:36 | * | hoijui joined #nim |
14:48:40 | Araq | because previously we would do 'x.p = nil' but wasMoved(x) might do 'x.len = 0; x.p = nil' |
14:49:08 | FromDiscord | <Clyybber> Ideally wasMoved(x) would be overridable |
14:49:14 | FromDiscord | <Clyybber> So we could specialize it |
14:49:15 | Araq | yeah... |
14:50:06 | Araq | speaking of which, was your =destroy optimization based on real data? looked at some asm code? |
14:51:25 | FromDiscord | <Clyybber> The idea no, the idea was yours I think :D But I looked at the asm code afterwards |
14:51:29 | * | endragor quit (Remote host closed the connection) |
14:51:41 | FromDiscord | <Clyybber> And it got considerably smaller in some of the testcases |
14:52:01 | FromDiscord | <Clyybber> Especially after you removed most of the wasMoved calls |
14:52:02 | Araq | you looked at it after optimizations, right? |
14:52:09 | * | endragor joined #nim |
14:52:10 | FromDiscord | <Clyybber> yeah |
14:56:47 | * | endragor quit (Ping timeout: 256 seconds) |
14:57:10 | FromDiscord | <Clyybber> seems like C compilers are already relatively eager on inlining `=destroy` |
14:59:07 | FromDiscord | <Clyybber> Araq: Regarding the pessimistic approach; do we want to guarantee the order of unrelated destroy calls? |
15:00:23 | Araq | nah |
15:04:35 | FromDiscord | <Clyybber> hmm, I wonder now when do we actually want to guarantee the order? |
15:05:09 | * | endragor joined #nim |
15:08:15 | Araq | well ideally we always want to guarantee the order |
15:08:45 | shashlick | @lqdev see how the scintilla wrapper works on feud |
15:09:37 | shashlick | Basically you need to set nimFile on cImport |
15:09:57 | FromDiscord | <Clyybber> Araq: Yeah, it seems like the most predictable approach. OTOH without aliasing there shouldn't be any "related" destroy calls right? |
15:10:31 | FromDiscord | <lqdev> shashlick: and my wrapper will be written to that file? |
15:10:39 | shashlick | Yes |
15:10:43 | FromDiscord | <lqdev> also, are the wrappers 100% independent? |
15:10:50 | FromDiscord | <lqdev> apart from the stdlib ofc |
15:11:10 | shashlick | Of course cCompile and getHeader don't get forwarded |
15:11:17 | FromDiscord | <lqdev> yeah that's fine |
15:11:21 | shashlick | Yep |
15:11:28 | FromDiscord | <lqdev> ok thanks |
15:11:35 | shashlick | If you find bugs, please let me know |
15:12:44 | FromDiscord | <lqdev> ok |
15:15:16 | shashlick | And note that standalone doesn't mean platform independent |
15:16:08 | shashlick | You can write to an os specific file and check into source control if you want assuming you will use the same compiler |
15:18:24 | * | waleee-cl joined #nim |
15:20:02 | FromDiscord | <Clyybber> shashlick: I was thinking, couldn't you use a sledgehammer approach to making the wrappers platform "independent" by just running them through the C preprocessor with different ifdefs? |
15:20:14 | FromDiscord | <Clyybber> (edit) 'ifdefs?' => 'defines?' |
15:24:04 | FromDiscord | <Clyybber> and then putting the output in the respective `when blocks` |
15:28:49 | shashlick | Yes that's possible |
15:29:36 | shashlick | But we need to know both the compiler specific defines as well as the platform specific defines |
15:30:25 | shashlick | And then I'm not sure if you can tell the preprocessor to ignore its own internal defines and use some other ones |
15:31:04 | shashlick | Like `__GNU__` or other weird stuff like that |
15:32:08 | shashlick | It will be easier to do something like binary builder and use cross compilers to generate the wrappers for many targets |
15:32:46 | shashlick | But I'm yet to see nimterop being used to that level to invest that time |
15:33:47 | FromDiscord | <lqdev> for some reason I can't call cImport with nimFile |
15:34:03 | FromDiscord | <lqdev> I installed latest nimterop |
15:34:21 | FromDiscord | <lqdev> oh wait |
15:34:23 | FromDiscord | <lqdev> not latest |
15:36:47 | FromDiscord | <lqdev> seems like nimterop doesn't like my header |
15:37:31 | FromDiscord | <lqdev> shashlick: http://ix.io/2rsn |
15:39:25 | shashlick | Add flags with -d |
15:39:32 | shashlick | Should tell you what failed |
15:39:38 | shashlick | Might be a bug |
15:40:10 | FromDiscord | <lqdev> doesn't change anything |
15:40:18 | shashlick | Can then skip or override it while it gets fixed |
15:40:34 | FromDiscord | <lqdev> this is my wrapper http://ix.io/2rso/nim |
15:40:36 | shashlick | Doesn't it tell you which symbol is failing? |
15:40:58 | FromDiscord | <lqdev> nope |
15:41:13 | shashlick | Is anything written to the nimFile |
15:41:20 | FromDiscord | <lqdev> no |
15:41:59 | shashlick | Ok remove nimFile and see |
15:42:18 | shashlick | I need to debug this - it should write to output or debugging becomes hard |
15:42:39 | FromDiscord | <lqdev> got this: # Unsupported node type "call_expression" for node "(FT_UInt32)(0)" |
15:43:51 | * | nsf quit (Quit: WeeChat 2.8) |
15:46:05 | * | krux02 joined #nim |
15:50:12 | shashlick | Ok just skip that specific symbol, will have to fix that issue |
15:51:43 | FromDiscord | <lqdev> I can't tell what the symbol is |
15:52:01 | shashlick | Should tell you in the debug output |
15:52:43 | FromDiscord | <lqdev> problem is: it doesn't |
15:53:38 | FromDiscord | <lqdev> this is some more output http://ix.io/2rss |
15:53:45 | FromDiscord | <lqdev> but above that is some lisp representation |
15:53:53 | FromDiscord | <lqdev> which is quite long |
15:58:11 | shashlick | Ya scroll up, there will be the actual c code printed as well |
15:58:27 | shashlick | Along with the tree sitter ast in lisp style |
15:59:05 | FromDiscord | <lqdev> allright |
15:59:13 | FromDiscord | <lqdev> seems like it's FT_Encoding |
16:03:21 | FromDiscord | <lqdev> yeah I may as well create a small wrapper manually |
16:03:30 | FromDiscord | <lqdev> as I only use a few functions |
16:03:38 | FromDiscord | <lqdev> pulling everything in is likely gonna slow down compile time |
16:04:13 | * | Cthalupa quit (Ping timeout: 256 seconds) |
16:05:17 | shashlick | You only need to do it once but ya it needs to work |
16:05:29 | * | Cthalupa joined #nim |
16:05:54 | shashlick | Don't import the nimterop wrapper on your main app, import nimFile |
16:12:50 | * | bung_ quit (Quit: Lost terminal) |
16:19:27 | FromDiscord | <kodkuce> anyone using gitlab i tryed to turn on CI CD but i get this 😦 , ERROR: Job failed: Error response from daemon: pull access denied for nim, repository does not exist or may require 'docker login' (docker.go:119:0s) |
16:20:43 | FromDiscord | <kodkuce> .gitlab-ci.yml i put image: "nim:latest" |
16:27:35 | * | tane joined #nim |
16:39:29 | FromDiscord | <kodkuce> ok got it fix little it was nimlang/nim |
16:40:04 | disruptek | neat, bump actually started passing CI in devel. |
16:40:09 | shashlick | disruptek - libgit2 v1.0.1 should be supported now by nimgit2 |
16:40:20 | shashlick | just pass -d:git2JBB and -d:git2SetVer=1.0.1 |
16:40:27 | shashlick | should work cross OS |
16:40:28 | disruptek | woohoo! |
16:40:44 | disruptek | great job, dude. so no nimterop dep? |
16:41:56 | shashlick | still need it to pull it |
16:42:03 | disruptek | ah, okay. |
16:42:24 | disruptek | does it need toast built? |
16:42:48 | shashlick | yep that's what generates the nim wrapper |
16:43:01 | shashlick | this is just the part of pulling precompiled binaries with getHeader |
16:43:10 | shashlick | once that is done, still need to generate the wrapper |
16:43:31 | disruptek | okay, so you still need the source, too, then? |
16:43:47 | disruptek | or do you use the provided includes, etc. instead of git? |
16:44:51 | shashlick | the package that gets downloaded includes the headers and precompiled libs |
16:45:06 | shashlick | so from your perspective, just import nimgit2 and change your flags to -d:git2JBB |
16:45:08 | disruptek | nice. |
16:54:22 | FromDiscord | <kodkuce> can i cross copile to arm64 ? |
16:59:51 | FromDiscord | <lqdev> @kodkuce https://nim-lang.org/docs/nimc.html#cross-compilation |
17:02:10 | FromDiscord | <kodkuce> ty, now need to find where arm-linux-gnueabihf-gcc where lives 🙂 |
17:04:16 | * | endragor quit (Read error: Connection reset by peer) |
17:04:54 | FromDiscord | <kodkuce> so raspbery pi 4 uses Cortex-A72 (ARM v8) 64-bit |
17:08:28 | FromDiscord | <Clyybber> Araq: WDYT about this simple transformation: `echo (block: var inner = ...; Obj(field: inner))` -> `echo (block: var inner = ...; let tmp = Obj(field: inner); =destroy(inner); tmp)` ? |
17:09:24 | FromDiscord | <Clyybber> tmp will then be the only thing getting destroyed in the outer scope |
17:09:45 | Araq | don't we do that? object constructors are sink-polymorphic |
17:10:17 | FromDiscord | <Clyybber> We don't do that in my branch anymore. But I think its a better way to solve this then what I do currently |
17:10:36 | Araq | wait what? |
17:10:49 | FromDiscord | <Clyybber> let me actually check, before I bramble :D |
17:10:49 | Araq | in your branch you removed this logic too? |
17:11:27 | FromDiscord | <Clyybber> Hmm, no. |
17:11:44 | FromDiscord | <Clyybber> But its the logic that will save us from escapingSyms and stuff |
17:12:20 | FromDiscord | <kodkuce> kmeee :(↵/usr/lib/gcc/arm-linux-gnueabihf/9.3.0/../../../../arm-linux-gnueabihf/bin/ld: cannot find /lib/libc.so.6 inside /usr/arm-linux-gnueabihf↵/usr/lib/gcc/arm-linux-gnueabihf/9.3.0/../../../../arm-linux-gnueabihf/bin/ld: cannot find /lib/ld-linux-armhf.so.3 inside /usr/arm-linux-gnueabihf↵collect2: error: ld returned 1 exit status |
17:14:46 | * | endragor joined #nim |
17:19:36 | * | endragor quit (Ping timeout: 256 seconds) |
17:20:27 | FromDiscord | <Clyybber> Araq: Well, its not gone as in the Obj won't get destroyed anymore, but its gone as in the =destroy for inner is inserted at the outer scope |
17:20:38 | FromDiscord | <Clyybber> But I'll fix that. This seems like the best way to solve all this |
17:21:21 | Araq | don't forget to mention it in your book, "Nim - the C++ish parts" |
17:22:23 | * | OMGOMG joined #nim |
17:24:06 | FromDiscord | <Clyybber> lol |
17:26:03 | FromDiscord | <Clyybber> Araq: Hmm, in a way escapingExpr are similar to sink params as they will be "sinked" to the outer scope |
17:26:57 | disruptek | do they get destroyed only at close of outer scope or at some point before? |
17:27:06 | FromDiscord | <Clyybber> At outer scope |
17:28:11 | FromDiscord | <Clyybber> But in general we may want an optimization pass that injects/moves the destructors as early as possible |
17:38:42 | FromDiscord | <exelotl> "gnueabihf" looks like someone just smooshed their face against the keyboard |
17:39:08 | Araq | exelotl: at least it contains vowels so don't complain |
17:40:41 | Araq | Clyybber: this "optimization pass" is really dangerous and please be aware that to this day C++ cannot model 'tables.getOrDefault' very well because of its overly aggressive destructor injections |
17:41:12 | disruptek | but we might need it for memory consumption reasons. |
17:42:55 | Araq | you can always call 'reset(x)' explicitly to shorten the lifetime further but you cannot easily extend a lifetime |
17:43:22 | Araq | IMO scope based destruction is just the right tradeoff |
17:44:20 | disruptek | i guess it's always safe to wrap the scope. |
17:45:40 | Araq | well you can use 'block' to get a fresh scope |
17:46:01 | disruptek | that's what i'm saying. it's ugly and heavy-handed, but i guess it's a solution. |
17:46:16 | Araq | 'reset' is another one |
17:46:40 | disruptek | but you won't have the symbol in scope, right? |
17:47:02 | Araq | var x = f() |
17:47:06 | shashlick | Araq: you motivated to debug my arc segfault on the plugins package? it's not quite minimal but less than 800 lines 😄 |
17:47:13 | Araq | use(x) |
17:47:24 | Araq | reset(x) # want to end x's lifetime here |
17:47:32 | Araq | manyMoreLinesOfCode() |
17:47:38 | Araq | # block end |
17:47:48 | Araq | ^ disruptek, is what I mean |
17:47:58 | Araq | though probably you're better off with 'block' |
17:48:00 | disruptek | i get that. |
17:48:14 | disruptek | i think you don't want people putting their dirty hands on mm thusly. |
17:48:27 | Araq | shashlick: sorry, I'm still writing my optimizer. maybe later |
17:48:48 | shashlick | okay cool |
17:51:57 | FromDiscord | <Clyybber> Araq: WDYM, with respect to getOrDefault? |
17:52:49 | Araq | const T& getOrDefault(Key k, const &T default); // cannot return 'const T&' here if default is returned |
17:53:11 | FromDiscord | <Clyybber> Ah |
17:53:22 | FromDiscord | <Clyybber> The optimization I'm talking about is not related afaict |
17:53:23 | Araq | because if the default is a temporary it'll be destroyed too early |
17:53:49 | FromDiscord | <Clyybber> Its about putting the =destroy calls for variables as close as possible to their last use |
17:54:09 | Araq | no, it is not directly related, but you should have respect |
17:54:31 | Araq | with non-owning views you never really know the "last use" |
17:54:57 | disruptek | respect! |
17:55:35 | FromDiscord | <Clyybber> Araq: lets say, last use when we *can* determine it |
17:55:46 | FromDiscord | <Clyybber> but I am aware that it could get kinda complex |
17:56:27 | FromDiscord | <Clyybber> especially since mapping from the lastUse as found in the DFA to an actual node where we can insert the destructor call in the AST is tricky |
17:57:04 | Araq | that seems a rather simple DFA problem |
17:57:06 | disruptek | shashlick: dude, this means we have ssh support on windows, now? |
17:57:57 | Araq | clyybber: the DFA can introduce nkLastUse wrapper nodes or a nfLastUse node flag |
17:58:21 | Araq | would make other things simpler too, I think |
17:58:40 | * | endragor joined #nim |
17:59:17 | shashlick | disruptek: I believe so |
17:59:34 | shashlick | cause it gets downloaded as a dependency |
17:59:36 | FromDiscord | <Clyybber> Araq: Ah, I was overthinking it. Its probably not that har |
17:59:37 | disruptek | yep. |
18:00:47 | disruptek | nimph builds in like ⅓ the time, too. |
18:01:22 | FromDiscord | <Clyybber> Araq: Hmm, actually maybe it is a *bit* hard. Since in f(a) where a is the lastUse, we'd want `f(a); =destroy(a)` as the result |
18:01:53 | FromDiscord | <Clyybber> So we would have to find the closest parent node in which we can insert our destroy |
18:02:26 | FromDiscord | <Clyybber> which is not tricky per se, but searching the AST for each =destroy doesn't sound too efficient |
18:03:07 | disruptek | shashlick: you want SetVer:"1.0.1" but gittyup expects "v1.0.1" ... it works, but i'm not sure how. |
18:03:33 | disruptek | clyybber: it's more efficient than manual mm. |
18:03:49 | * | endragor quit (Ping timeout: 264 seconds) |
18:03:51 | FromDiscord | <Clyybber> disruptek: I'm talking efficient as in compile speed |
18:03:56 | disruptek | i know. |
18:11:04 | FromDiscord | <Clyybber> Araq: Btw, how do {.global.}s work normally? Should we destroy them normally? |
18:11:35 | FromDiscord | <Clyybber> Currently theres a weird special case where we check if it has a parent scope, and if not then we add the destructor call to the globalDestructors |
18:11:35 | Araq | yeah but .globals are bad, don't use them :P |
18:11:41 | shashlick | disruptek: are you setting `-d:git2JBB`? |
18:11:49 | FromDiscord | <Clyybber> Araq: What are they useful for? |
18:11:54 | disruptek | shashlick: yeah. |
18:12:18 | Araq | setting up prepared sql statements for example |
18:12:27 | shashlick | then it expects =1.0.1, no v |
18:12:38 | disruptek | i know, but take a look at the top of gittyup.nim. |
18:12:41 | Araq | every .global is inited before other non-.global globals |
18:12:43 | shashlick | v is only for git2Git |
18:13:28 | shashlick | disruptek: https://github.com/disruptek/gittyup/blob/master/gittyup.nim.cfg#L2 |
18:13:45 | shashlick | gotta replace that |
18:13:59 | disruptek | that doesn't get read during a nimph compilation. |
18:14:23 | FromDiscord | <Clyybber> Araq: Is the RHS in var a {.global.} = ... supposed to be only evaluated once durning the programs lifetime? |
18:14:55 | Araq | I think so |
18:15:29 | shashlick | disruptek: this takes precedence - https://github.com/disruptek/nimph/blob/master/src/nimph.nim.cfg#L16 |
18:15:49 | disruptek | obviously, so again, look at the top of gittyup.nim. |
18:16:27 | FromDiscord | <Clyybber> Araq: Heh, arc handle that currently |
18:16:46 | shashlick | disruptek: I don't think nimgit2 sees that const you create |
18:16:56 | shashlick | it only sees the value that comes as a -d |
18:17:04 | shashlick | or if you use setDefines |
18:17:20 | FromDiscord | <Clyybber> *doesn't |
18:17:37 | disruptek | it's there so that you can `nim c ...` for testing. |
18:17:42 | FromDiscord | <Clyybber> Araq: Should it be deprecated perhaps? |
18:17:58 | disruptek | point is, i'm looking for v* and otherwise i should issue a warning. but i don't. |
18:18:35 | shashlick | you need v1.0.1 for git cause that's how they create version tags |
18:18:39 | disruptek | i don't see the libgit2 version hint, either. |
18:18:59 | shashlick | but for URLs, conan, jbb, etc, it uses the version as is, without a v |
18:19:14 | disruptek | i know. that's why i'm asking "why does it work?" |
18:20:15 | shashlick | no idea, for whatever reason, nimgit2 uses jbb and version without v cause that's what nimph.cfg has in it |
18:20:28 | shashlick | but in your code, the git2SetVer isn't getting overridden |
18:21:10 | shashlick | what's the value in gittyup.nim - can you static: echo git2SetVer just for kicks? |
18:21:53 | disruptek | 1.0.1 of course. |
18:22:16 | disruptek | it's curious, right? |
18:24:04 | disruptek | i'm really tired of people asking me what my desired salary is. |
18:24:13 | * | Cthalupa quit (Ping timeout: 264 seconds) |
18:24:32 | disruptek | it's incredibly obnoxious and insulting. |
18:24:47 | disruptek | do you really think i'm going to counter myself before we even talk about the job? |
18:25:14 | disruptek | how about you tell me the most you're willing to pay? |
18:25:17 | disruptek | does that sound fair? |
18:25:30 | shashlick | they don't want to waste time interviewing someone outside their budget |
18:25:39 | * | Cthalupa joined #nim |
18:25:55 | shashlick | and you don't want to waste your time interviewing for someone who cannot pay the right salary |
18:26:00 | disruptek | great, i should value their interview time more than my salary? |
18:26:05 | disruptek | i don't think so. |
18:26:16 | disruptek | forgive me for prioritizing my well-being over theirs. |
18:26:36 | shashlick | you need to know what your services are worth |
18:26:50 | shashlick | if they want to undercut, you don't want to work there |
18:26:54 | disruptek | my services are worth whatever someone else is willing to pay. |
18:26:58 | disruptek | that's how the market works. |
18:28:04 | shashlick | yes and employers routinely screw people by asking that question and taking advantage of people who don't know their market worth |
18:28:22 | disruptek | of course. i've done it myself. |
18:28:32 | disruptek | but that doesn't mean i'm going to fall into the same trap. |
18:28:34 | shashlick | and frankly, no individual really knows their market worth - the power lies with the employers |
18:29:35 | shashlick | indeed - i'm not saying it isn't obnoxious but we need to know what we are realistically worth |
18:30:20 | disruptek | the only way to do that is to get offers and share them with others. |
18:39:39 | shashlick | disruptek: so does the new nimgit2 work for you? |
18:39:56 | disruptek | seems to; nimph HEAD is using it. |
18:40:12 | * | hyiltiz quit (Ping timeout: 260 seconds) |
18:40:17 | * | hyiltiz_ joined #nim |
18:40:28 | shashlick | cool - should be a bit faster now |
18:40:36 | disruptek | why is that? |
18:40:39 | shashlick | but it is still shared libs - don't have static libs yet |
18:40:44 | shashlick | cause no compiling anymore right |
18:40:55 | disruptek | right; it's about 3x faster. |
18:51:43 | * | maier joined #nim |
18:56:59 | * | Sembei joined #nim |
19:01:14 | * | Cthalupa quit (Ping timeout: 240 seconds) |
19:02:10 | * | Cthalupa joined #nim |
19:02:23 | * | nikita` joined #nim |
19:08:40 | shashlick | Good, lots of deps to download |
19:09:16 | shashlick | If we could use msvc .lib files, would be nice |
19:09:48 | shashlick | But Conan also doesn't have new releases |
19:15:40 | * | fredrikhr quit (Read error: Connection reset by peer) |
19:16:04 | * | fredrikhr joined #nim |
19:24:51 | * | hoijui quit (Quit: Leaving) |
19:27:18 | FromDiscord | <Clyybber> Araq: The scope of cond in `if cond: ...` is a very curious one :D |
19:28:45 | FromDiscord | <Clyybber> I think its best to treat it as if didn't introduce the new scope |
19:28:53 | FromDiscord | <Clyybber> but `...` did instead |
19:30:04 | FromDiscord | <Clyybber> As we can't transform it intoy `if (var a; destroy(a); cond): ...` as `...` might use `a` |
19:30:28 | FromDiscord | <Clyybber> But we can't put the destroy(a) into the `...` either, as it might not get executed |
19:30:54 | FromDiscord | <Clyybber> So we have to put it into the parent's scope |
19:31:52 | FromDiscord | <impbox> phew, finished my GMTK game jam game ~__~ |
19:32:02 | FromDiscord | <impbox> 5AM deadline is hard |
19:32:56 | FromDiscord | <Elegant Beef> Good job |
19:33:00 | FromDiscord | <Elegant Beef> how many levels? |
19:33:13 | FromDiscord | <impbox> 15 puzzle levels + one story/tutorial |
19:33:24 | FromDiscord | <impbox> the levels needed a lot more work, but ahh well |
19:33:30 | FromDiscord | <impbox> can only do so much in 48 hours |
19:34:05 | FromDiscord | <impbox> would have liked to add more character/story |
19:34:35 | * | vsantana joined #nim |
19:34:42 | FromDiscord | <Elegant Beef> No web build? |
19:34:50 | FromDiscord | <Elegant Beef> Ah nvm |
19:35:01 | FromDiscord | <impbox> https://www.impbox.net/ctrlAltEject/ yep |
19:35:15 | FromDiscord | <impbox> only tested in chrome |
19:36:48 | * | abm joined #nim |
19:38:28 | * | vsantana quit (Client Quit) |
19:40:54 | FromDiscord | <Elegant Beef> Just the tutorial was difficult 😄 |
19:41:04 | FromDiscord | <impbox> yeah... the difficulty is too muich |
19:41:06 | FromDiscord | <impbox> (edit) 'muich' => 'much' |
19:41:26 | FromDiscord | <impbox> i made the main mechanics all too difficult |
19:41:52 | FromDiscord | <Elegant Beef> I think the only reason it's so hard is that you have rotational velocity that needs to be countered |
19:42:13 | FromDiscord | <impbox> yep |
19:46:45 | * | catcat154 joined #nim |
19:47:15 | catcat154 | hey, just dropping by to report a few things regarding cross compilation |
19:48:05 | catcat154 | cross compiling from msys2 latest to linux using the genscript flag produced a shellscript that had gcc.exe at the last line instead of just gcc |
19:48:29 | catcat154 | also it didnt include nimbase.h (might be intentional) |
19:48:49 | catcat154 | other than that it worked very well :^) |
19:59:56 | * | endragor joined #nim |
20:02:31 | * | debased joined #nim |
20:03:52 | * | Vladar quit (Quit: Leaving) |
20:04:25 | * | endragor quit (Ping timeout: 265 seconds) |
20:32:00 | FromDiscord | <Yardanico> @disruptek by the way, after last fixes (probably due to the str v2 mutation optimization) that base64 benchmark is much closer to the default GC with arc |
20:32:51 | disruptek | it's twice as fast as it was, and still nearly 3x slower than refc. |
20:33:10 | disruptek | as of today's build, anyway. |
20:34:20 | FromDiscord | <Yardanico> no |
20:34:26 | FromDiscord | <Yardanico> did you try after https://github.com/nim-lang/Nim/commit/6cc0061a72826022991262eb8e31b97f6fdf37e9 ? |
20:34:43 | FromDiscord | <Yardanico> I get ~1.5s with refc and ~2.1s with arc |
20:34:51 | disruptek | obviously not, since it's not in today's build. |
20:37:27 | * | catcat154 quit (Quit: Connection closed) |
20:43:05 | shashlick | @Yardanico let me check that sciter wrapper now |
20:43:11 | FromDiscord | <Yardanico> oh okay |
20:46:00 | shashlick | let me find your updated wrapper |
20:46:14 | FromDiscord | <Yardanico> oh one sec |
20:46:37 | FromDiscord | <Yardanico> https://play.nim-lang.org/#ix=2rqX |
20:46:45 | FromDiscord | <Yardanico> I also patched that cstring file too |
20:46:47 | FromDiscord | <Yardanico> just emptied it |
20:46:53 | FromDiscord | <Yardanico> (the file which contained a C++ include) |
20:47:58 | * | maier quit (Ping timeout: 256 seconds) |
20:48:10 | FromDiscord | <Yardanico> the problem I'm having is that for ISciterAPI for example |
20:48:34 | FromDiscord | <Yardanico> "LPCWSTR SCFN( SciterClassName )(void);" with SCFN being a macro results in "SCFN*: proc (a1: SciterClassName): LPCWSTR {.cdecl.}" in Nim |
20:49:31 | Shucks | oh gosh |
20:49:38 | shashlick | i don't see any such output in my wrapper |
20:49:42 | Shucks | thats winapi isnt it ;D |
20:49:45 | FromDiscord | <Yardanico> no |
20:49:51 | FromDiscord | <Yardanico> it just uses similar type names |
20:50:09 | FromDiscord | <Yardanico> @shashlick really? how does ISciterAPI in your generated wrapper look like? |
20:51:06 | shashlick | https://play.nim-lang.org/#ix=2rtq |
20:51:15 | FromDiscord | <Yardanico> oh nice, that looks correct |
20:51:20 | FromDiscord | <Yardanico> I wonder why am I getting different results |
20:51:25 | FromDiscord | <Yardanico> do I need nimterop head or something? |
20:51:31 | shashlick | no this is v0.6.3 |
20:51:37 | shashlick | what version do you have |
20:51:46 | FromDiscord | <Yardanico> yeah I have 0.6.3 as well, although I'm on Nim devel if that matters |
20:51:59 | shashlick | do you have some old nimterop@#head sitting around |
20:52:13 | FromDiscord | <Yardanico> ah i have 0.6.2 for some reason |
20:52:20 | FromDiscord | <Yardanico> removed 0.6.2, still the same |
20:52:23 | shashlick | that shouldn't make a big diffference |
20:52:24 | FromDiscord | <Yardanico> (only have 0.6.3 installed) |
20:52:45 | shashlick | seems like the preprocessor isn't being run in your case |
20:52:58 | shashlick | can you post your generated wrapper output |
20:53:10 | shashlick | what OS, gcc version |
20:53:37 | FromDiscord | <Yardanico> Artix Linux (Arch fork), GCC 10.1.0 |
20:53:40 | FromDiscord | <Yardanico> https://gist.github.com/Yardanico/82e03027a386caadaf69f522c6434640 |
20:55:54 | shashlick | my wrapper is 3k lines |
20:56:05 | shashlick | really looks like the preprocessor didn't work here |
20:56:13 | FromDiscord | <Yardanico> can I debug that somehow? |
20:56:47 | shashlick | ya the wrapper output you just posted |
20:56:58 | shashlick | can you run the command line on the top directly |
20:57:00 | shashlick | but remove --pnim |
20:57:06 | shashlick | that will print out the preprocessor output |
20:57:17 | FromDiscord | <Yardanico> sure |
20:57:20 | shashlick | if you can redirect that to a file and see what it looks like |
20:58:02 | FromDiscord | <Yardanico> even without --pnim I don't get any output at all |
20:58:06 | FromDiscord | <Yardanico> I mean it just writes to a file |
20:58:19 | FromDiscord | <Yardanico> or you mean it'll rewrite the file? |
20:58:20 | FromDiscord | <Yardanico> with -o |
20:58:30 | shashlick | ya that's the output |
20:58:33 | shashlick | can you share that output |
20:58:51 | shashlick | if it isn't getting preprocessed then we might need to debug https://github.com/nimterop/nimterop/blob/master/nimterop/toastlib/getters.nim#L289 |
20:58:58 | FromDiscord | <Yardanico> yeah, all macros here are not expanded it seems |
20:59:01 | FromDiscord | <Yardanico> https://gist.github.com/Yardanico/8645b403d69d0d1eed970d54743f45ca |
20:59:07 | shashlick | try the command directly with gcc -E |
20:59:34 | FromDiscord | <Yardanico> what comamnd? |
20:59:38 | FromDiscord | <Yardanico> (edit) 'comamnd?' => 'command?' |
20:59:44 | FromDiscord | <Yardanico> ah I see |
20:59:44 | Araq | so ... my optimizer works |
20:59:46 | FromDiscord | <Yardanico> you mean on that file |
20:59:48 | FromDiscord | <Yardanico> yay |
20:59:55 | Araq | time to sleep |
21:00:09 | shashlick | ya so you can print out the cmd with args sent to startProcess |
21:00:19 | Araq | but seriously guys start to use .raises: [] |
21:00:19 | shashlick | run it directly and see why gcc -E isn't giving the right output |
21:01:29 | FromDiscord | <Yardanico> hmmm |
21:01:37 | FromDiscord | <Yardanico> it doesn't show any errors |
21:01:51 | FromDiscord | <Yardanico> but macros aren't expanded, and that SCFN macro isn't in the generated by Nimterop c file at all |
21:01:55 | FromDiscord | <Yardanico> I can't find #define SCFN there |
21:02:04 | FromDiscord | <Yardanico> in the headers it's in sciter-x-types.h |
21:02:07 | shashlick | is getPreprocessor() even getting called? |
21:02:33 | FromDiscord | <Yardanico> ? |
21:02:45 | FromDiscord | <Yardanico> ah I see what you mean |
21:02:51 | FromDiscord | <Yardanico> lemme check, will clone nimterop locally |
21:03:32 | shashlick | either --preprocess is not being recognized by toast which means the file is sent as is instead of preprocessed |
21:03:37 | shashlick | or the preprocessor is messing up |
21:04:54 | FromDiscord | <Clyybber> Araq: nice! |
21:05:26 | FromDiscord | <Yardanico> @shashlick yeah it's processing |
21:05:29 | FromDiscord | <Yardanico> the command it's calling is |
21:05:37 | FromDiscord | <Yardanico> gcc↵@["-E", "-dD", "-xc", "-w", "-CC", "-I/usr/include/gtk-3.0", "-I/usr/include/glib-2.0", "-I/usr/lib/glib-2.0/include", "-I/usr/include/pango-1.0", "-I/usr/include/cairo", "-I/usr/include/gdk-pixbuf-2.0", "-I/usr/include/atk-1.0", "-I/usr/include/harfbuzz", "-D__attribute__(x)=", "-D__restrict=", "-D__restrict__=", "-D__extension__=", "-D__inline__=inline", "-D__inline=inline", "-D_Noreturn=", "/home/dian/Projects/rimus/src/wrap/sc |
21:05:58 | FromDiscord | <Yardanico> and same for other .h files |
21:06:13 | FromDiscord | <Yardanico> wait |
21:06:15 | FromDiscord | <Yardanico> it's my fault I think |
21:06:15 | FromDiscord | <Yardanico> yeah |
21:06:17 | FromDiscord | <Yardanico> omh |
21:06:37 | FromDiscord | <Yardanico> (edit) 'omh' => 'omg' |
21:06:51 | FromDiscord | <Yardanico> it was totally my fault |
21:06:59 | shashlick | how did you pull it off? |
21:07:02 | FromDiscord | <Yardanico> I had a modified sciter-x-types.h, sorry for your time 🙂 |
21:07:07 | shashlick | will be good to know |
21:07:10 | FromDiscord | <Yardanico> and that modified sciter-x-types didn't have SCFN lol |
21:07:18 | shashlick | ah okay, makes sense |
21:07:25 | FromDiscord | <Yardanico> now time to check why "SciterElementCallback" is undeclared |
21:07:39 | shashlick | okay, so we still don't have a working wrapper - still some symbols need to be fixed |
21:07:55 | shashlick | RECT is from GTK right? |
21:08:00 | shashlick | or is your definition good enough |
21:08:01 | Araq | Clyybber: I have a new idea how to infer .cursor |
21:08:27 | FromDiscord | <Yardanico> @shashlick nah, my definition is good enough |
21:08:31 | shashlick | there are also some tree-sitter parse errors so need to figure those out |
21:08:33 | FromDiscord | <Yardanico> the other Nim binding was using a similar one |
21:08:36 | FromDiscord | <Yardanico> yeah tree-sitter parse error: 'typedef BOOL SC_CALLBACK SciterElementCallback( HELEMENT he, LPVOID param );', skipped |
21:08:40 | FromDiscord | <Yardanico> for SciterElementCallback |
21:09:05 | * | Trustable quit (Remote host closed the connection) |
21:09:37 | shashlick | SC_CALLBACK is not getting preprocessed |
21:10:00 | FromDiscord | <Yardanico> for you as well? |
21:10:22 | * | audiophile joined #nim |
21:10:33 | shashlick | so to avoid parsing all of gtk and everything else, we are turning recurse off |
21:10:50 | shashlick | but in the process, we aren't importing the files as expected by the author |
21:10:58 | FromDiscord | <Yardanico> oh |
21:11:15 | shashlick | parsing x-dom.h in isolation, we aren't importing SC_CALLBACK which is defined in types |
21:11:32 | * | nikita` quit (Quit: leaving) |
21:11:42 | FromDiscord | <Yardanico> so how to fix that? |
21:11:47 | FromDiscord | <Yardanico> I tried putting types.h before dom.h |
21:11:50 | FromDiscord | <Yardanico> in cImport |
21:12:06 | FromDiscord | <Yardanico> one way would be to concatenate all .h files in the needed order? 😄 |
21:12:26 | shashlick | yes correct |
21:12:37 | shashlick | the right way is to recurse but not into all these external packages |
21:13:33 | Araq | Clyybber: want to hear it? |
21:13:53 | FromDiscord | <Yardanico> @Clyybber ^ |
21:14:17 | FromDiscord | <Clyybber> Araq: Hell yeah |
21:15:25 | Araq | we have 'dest = src'. when do we have to materialize (perform a full copy) 'dest'? |
21:16:05 | Araq | only when either 'src' or 'dest' is mutated |
21:16:06 | shashlick | the other challenge is that they have c++ thrown in in some of the files but we don't want those included either |
21:17:08 | Araq | and if 'src' is derived from a non-var parameter we know it doesn't mutate |
21:18:11 | Araq | (ofc it helps if func/.noSideEffect becomes stricter) |
21:18:11 | shashlick | yardanico: i'm going to add some exclusion capabilities into nimterop so that we can be selective in what gets wrapped |
21:18:47 | FromDiscord | <Clyybber> Hmm, interesting |
21:18:57 | Araq | this means every location derived from a parameter is subject to the "No need to materialize" rule |
21:19:04 | FromDiscord | <Clyybber> Yeah, and its all just views |
21:19:07 | disruptek | i can't remember how to do callsite macros. |
21:19:13 | FromDiscord | <Yardanico> @shashlick cool, thanks! |
21:20:21 | Araq | pretty much computing all of Rust's borrowed pointers, without the pointers |
21:21:41 | FromDiscord | <Clyybber> Yeah, I think its a great idea |
21:22:08 | FromDiscord | <Clyybber> Araq: Btw, my handleNested approach was wrong |
21:22:27 | FromDiscord | <Clyybber> This `(echo "hey"; a) = (echo "ho"; (a: "b", b: 3))` echoes "hohey" on arc |
21:22:32 | FromDiscord | <Clyybber> but it should echo "heyho" |
21:23:25 | FromDiscord | <Clyybber> :D |
21:23:31 | Araq | yeah well. the spec is something we try to implement but compilers are hard |
21:24:18 | Araq | my outlined optimization amounts to compile-time copy-on-write |
21:24:37 | FromDiscord | <Yardanico> lol "Hint: 56367 lines; 0.716s; 77.777MiB peakmem; " |
21:25:43 | FromDiscord | <Clyybber> Araq: Yeah, exactly! |
21:26:46 | Araq | Clyybber: maybe we should give up and do right-to-left evaluation for assignments |
21:26:59 | Araq | it's much more natural anyway |
21:27:48 | * | tane quit (Quit: Leaving) |
21:32:59 | FromDiscord | <Clyybber> Hmm, yeah maybe. What about add then though? |
21:33:49 | * | oriba joined #nim |
21:34:45 | Araq | add is left-to-right |
21:35:06 | FromDiscord | <Clyybber> But it would also benefit from being right-to-left |
21:38:03 | * | NimBot joined #nim |
21:38:22 | Araq | well everything in a single call, ofc |
21:38:37 | FromDiscord | <Clyybber> :p |
21:41:40 | Araq | hmm cursorfication is essentially the same as our planned stricter .noSideEffect checking |
21:41:56 | Araq | so I finally have an excuse to work on that |
21:51:00 | FromDiscord | <Clyybber> :D |
22:00:44 | shashlick | @Yardanico - got a wrapper done - can you try it? |
22:00:48 | FromDiscord | <Yardanico> yes |
22:00:52 | * | endragor joined #nim |
22:02:58 | shashlick | http://ix.io/2rtD |
22:03:15 | shashlick | still need to checkin my changes into nimterop, test, etc |
22:03:35 | shashlick | you need to update the header path, besides that it should work assuming you are on linux x64 |
22:05:07 | * | endragor quit (Ping timeout: 246 seconds) |
22:09:21 | FromDiscord | <Yardanico> how would I pass enums to procs expecting "cuint"? |
22:09:26 | FromDiscord | <Yardanico> especially if I need multiple values from that enum |
22:09:34 | FromDiscord | <Yardanico> I mean <SCITER_CREATE_WINDOW_FLAGS> |
22:09:40 | * | audiophile quit (Ping timeout: 258 seconds) |
22:10:26 | disruptek | write a converter or cast them. |
22:11:05 | FromDiscord | <Yardanico> well I'm asking with regards to nimterop, it does some enum stuff |
22:11:10 | shashlick | nimterop includes common conversions to int / cint |
22:11:20 | shashlick | but for other stuff, need to use a converter yes |
22:11:24 | FromDiscord | <Yardanico> ah okay |
22:11:34 | FromDiscord | <Yardanico> I just cast the set or cast the OR'ing of them? |
22:11:35 | shashlick | i don't see why they use cuint |
22:11:49 | disruptek | just pass the set; it'll convert itself. |
22:11:51 | shashlick | cast the entire set before passing it down |
22:12:01 | shashlick | or converter |
22:12:12 | shashlick | convert SCITER_CREATE_WINDOW_FLAGS to cuint |
22:13:08 | FromDiscord | <Yardanico> well I got to the C compiler stage, now it fails because "sciter-x-types.h:220:11: error: unknown type name ‘char16_t’" |
22:13:50 | shashlick | amusingly i didn't run into that - i did earlier |
22:14:14 | shashlick | just add a type char16_t = wchar |
22:15:11 | FromDiscord | <Yardanico> wait where? |
22:15:18 | FromDiscord | <Yardanico> I mean this is a C compiler error in sciter-x-types.h |
22:15:34 | FromDiscord | <Yardanico> ah I know what you mean now |
22:15:44 | FromDiscord | <Yardanico> or not |
22:15:46 | shashlick | oh okay - it's defined in types line 220 |
22:15:52 | FromDiscord | <Yardanico> yeah |
22:16:08 | shashlick | should be coming from gtk looks like |
22:16:16 | shashlick | if !defined(WINDOWLESS) |
22:16:30 | FromDiscord | <Yardanico> actually seems like from C++ |
22:16:31 | FromDiscord | <Yardanico> hrm |
22:17:22 | shashlick | actually i am mapping char16_t=cushort, |
22:17:39 | FromDiscord | <Yardanico> well but it still errors because it includes the original headers |
22:17:53 | shashlick | right - do you need to compile with nim cpp |
22:18:16 | FromDiscord | <Yardanico> well I would prefer to use "nim c", but I can try to use nim cpp |
22:18:22 | shashlick | a lot of this stuff is c++ headers |
22:18:24 | FromDiscord | <Yardanico> the older bindings work with nim c just fine, but they are manually wrapped |
22:18:28 | FromDiscord | <Yardanico> well, with c2nim |
22:19:28 | * | lritter quit (Ping timeout: 246 seconds) |
22:19:47 | shashlick | maybe you need a wrapper with --noHeader |
22:20:43 | shashlick | I can create one but quite a few procs aren't available then |
22:20:46 | shashlick | static inline ones |
22:22:33 | shashlick | if you want that wrapper - http://ix.io/2rtI - you can decide whether those static inline procs aren't important |
22:23:00 | FromDiscord | <Yardanico> oh well, these ones are pretty important 😛 |
22:23:04 | FromDiscord | <Yardanico> they are needed for the DOM manipulation |
22:23:19 | FromDiscord | <Yardanico> and passing values between native side and sciter |
22:23:20 | shashlick | do the original wrappers allow for that |
22:23:24 | FromDiscord | <Yardanico> yes |
22:23:51 | FromDiscord | <Yardanico> e.g. SciterNodeSetText in there is SciterNodeSetText*: proc (hnode: HNODE; text: WideCString; textLength: uint32): SCDOM_RESULT {.stdcall.} |
22:23:56 | FromDiscord | <Yardanico> I'm not even sure if that's correct but it works |
22:24:25 | FromDiscord | <Yardanico> the author of that fork of original nim bindings only tested it on Windows, and I'm testing on linux 🙂 |
22:25:02 | FromDiscord | <Yardanico> I will try to fix those C compiler issues |
22:26:29 | shashlick | looks like the proc is available in multiple ways - see the new wrapper, it contains that proc still cause it is declared in 3 places |
22:26:46 | shashlick | line 206 and 630 in x-api |
22:26:55 | shashlick | so you might still be okay |
22:27:00 | shashlick | using the --noHeader version |
22:31:37 | FromDiscord | <Yardanico> yeah I'm trying 😛 |
22:34:04 | shashlick | okay cool - let me know if any other bugs, will try to fix as soon as possible |
22:35:51 | shashlick | created a branch called "exclude" which has capability required to generate this wrapper |
22:44:12 | * | vicfred joined #nim |
22:48:04 | FromDiscord | <Yardanico> so I was getting weird segfaults, but solved it when I put some sciter init logic (for gtk and the dynlib itself) in a separate module |
22:52:01 | shashlick | Ok so is the wrapper working then? Whatever little you have done so far |
22:52:36 | FromDiscord | <Yardanico> well I'm trying with first version you gave me, because it might work too 😛 |
22:56:17 | FromDiscord | <Yardanico> that's with your noHeader version https://media.discordapp.net/attachments/371759389889003532/732007449833373766/unknown.png |
22:56:30 | FromDiscord | <Yardanico> I adapted some code from the old bindings (loading and gtk initialization) |
22:57:33 | FromDiscord | <Yardanico> I think your noHeader version should be fine |
22:58:32 | FromDiscord | <Yardanico> I'll try porting a more complicated example from old bindings now |
22:59:13 | FromDiscord | <Yardanico> this one (it sets a callback to a button in nim, and changes the text on press) https://media.discordapp.net/attachments/371759389889003532/732008190136549526/unknown.png |
22:59:35 | FromDiscord | <Yardanico> and yes, I just load Nim's logo from wikipedia (since sciter is html) 😄 |
23:02:58 | Shucks | God just wrote some lines in go and realized how much I like nim now. |
23:04:19 | FromDiscord | <Yardanico> @shashlick can you share the wrapper code itself? |
23:11:50 | FromDiscord | <Varriount> Shucks: Go is ok... although at times it seems to conservative for me. |
23:12:09 | FromDiscord | <Varriount> I'd love something like Nim's templates in Go. That would be wonderful. |
23:12:50 | FromDiscord | <Varriount> @Yardanico How much memory & CPU does it consume (both idle and when being used)? |
23:13:34 | shashlick | let me post it |
23:13:39 | FromDiscord | <Yardanico> Minimal applications (at least for me on Linux, idk about macos/windows) is about 40-55MB I think |
23:14:02 | FromDiscord | <Yardanico> library size (on linux) is 8mb (linked dynamically to gtk and stuff) |
23:14:10 | FromDiscord | <Yardanico> sciter has it's own html/css/scripting engine |
23:14:29 | FromDiscord | <Yardanico> it doesn't use webkit or webviews from other frameworks |
23:14:42 | FromDiscord | <Varriount> I'd love to see a comparison on a basic text editor (think notepad) implemented in Nim+Sciter vs Javascript+Electron |
23:15:29 | FromDiscord | <Yardanico> well there's already one in sciter + c++ |
23:15:32 | FromDiscord | <Yardanico> https://github.com/c-smile/sciter-sdk/tree/master/notes |
23:15:34 | FromDiscord | <Yardanico> https://html-notepad.com/ |
23:15:48 | FromDiscord | <Yardanico> and it's not so simple, it's an HTML notepad 😛 |
23:15:58 | FromDiscord | <Varriount> Although, I do wonder why Sciter isn't more popular. Is it the API? |
23:16:03 | FromDiscord | <Yardanico> it's proprietary |
23:16:09 | * | fredrikhr quit (Read error: Connection reset by peer) |
23:16:23 | FromDiscord | <Yardanico> unless you pay (to compile statically or other stuff) |
23:16:24 | FromDiscord | <Varriount> But it's on Github, publically? |
23:16:29 | FromDiscord | <Yardanico> well, the binaries - yes |
23:16:31 | FromDiscord | <Varriount> Oh, is it like Qt? |
23:16:33 | * | fredrikhr joined #nim |
23:16:46 | FromDiscord | <Yardanico> you can freely use the binary libraries in any projects, even commercial ones |
23:16:56 | FromDiscord | <Yardanico> just need to show that you're using Sciter |
23:17:09 | FromDiscord | <Yardanico> @Varriount https://sciter.com/prices/ |
23:17:22 | FromDiscord | <Yardanico> it's used by a lot of antiviruses apparently |
23:17:28 | FromDiscord | <Yardanico> for the UI |
23:17:30 | FromDiscord | <Varriount> So, like, in a `Help -> About` menu? |
23:17:34 | FromDiscord | <Yardanico> yeah |
23:17:41 | FromDiscord | <Varriount> Hm. |
23:17:43 | FromDiscord | <Yardanico> https://github.com/c-smile/sciter-sdk/blob/master/license.htm |
23:17:56 | FromDiscord | <Varriount> I can see why that would turn a lot of people off. |
23:18:16 | FromDiscord | <Yardanico> "Your application shall include link to Terra Informatica site in "About" dialog or similar place in your application. Text of the link: This Application (or Component) uses Sciter Engine (<a href="http://sciter.com/),">http://sciter.com">http://sciter.com/</a>), copyright Terra Informatica Software, Inc.</p>" |
23:18:58 | FromDiscord | <Varriount> Wasn't there a similar library/framework that was an open-source alternative to Sciter (not Electron)? |
23:19:28 | FromDiscord | <Yardanico> https://ultralig.ht/ maybe? |
23:19:47 | FromDiscord | <Yardanico> they use a fork of webkit though |
23:20:08 | FromDiscord | <Varriount> Ah, yes, that's what I was thinking |
23:20:21 | FromDiscord | <Yardanico> and it's not fully open source either |
23:20:26 | FromDiscord | <Varriount> :/ |
23:20:32 | FromDiscord | <Yardanico> "The UltralightCore and Ultralight modules are proprietary— source code access to these repos can be obtained through a custom license." |
23:21:04 | FromDiscord | <Varriount> I can't help but feel that if these libraries went the Qt route, they would pick up more use. |
23:21:14 | FromDiscord | <Yardanico> well sciter's author has been considering open sourcing it |
23:21:24 | FromDiscord | <Yardanico> He commented about that when replying to questions on HN or similar platforms |
23:21:35 | FromDiscord | <Yardanico> the main issue is of course cleaning up the source code and commenting it |
23:21:47 | * | abm quit (Quit: Leaving) |
23:21:55 | FromDiscord | <Yardanico> I think it's mostly a one-man project, and he's been doing it for over ~14 years |
23:22:40 | FromDiscord | <Yardanico> https://sciter.com/sciter-part-i-so-what-is-the-sciter-anyway/ |
23:22:46 | FromDiscord | <Yardanico> august 2006 😛 |
23:22:51 | FromDiscord | <Varriount> Hm, if he has various antivirus companies (Norton, Mcafee, etc.) paying yearly licenses, that's quite a big chunk of money. |
23:23:08 | FromDiscord | <Yardanico> well I guess they all have the "ENTERPRISE++" license or something 😛 |
23:23:11 | FromDiscord | <Yardanico> they certainly have the money for it |
23:23:17 | * | krux02_ joined #nim |
23:23:28 | FromDiscord | <Yardanico> but yeah, seems like you still need to pay each year if you want updated sources |
23:24:32 | FromDiscord | <Yardanico> I was really surprised when I found out about it on nim forum |
23:24:37 | FromDiscord | <Yardanico> I really didn't hear about it before at all |
23:25:07 | FromDiscord | <Varriount> I've heard about Sciter, but discounted it for some reason I can't remember. Probably the license |
23:25:11 | FromDiscord | <Yardanico> it also has bindings to d (abandoned), go, python, rust (these ones seem to be updated) |
23:25:46 | * | krux02 quit (Ping timeout: 256 seconds) |
23:25:48 | FromDiscord | <Yardanico> ah, even .net lol |
23:26:03 | FromDiscord | <Yardanico> all hail plain C APIs |
23:26:20 | FromDiscord | <Yardanico> (although sciter itself is written C++ as far as I know) |
23:26:25 | FromDiscord | <Yardanico> (edit) '(although sciter itself is written ... C++' => '(although sciter itself is writtenin' |
23:39:29 | skrylar[m] | apparnetly this has become the sciter channel :ponders: |
23:39:58 | FromDiscord | <Yardanico> no no no |
23:42:15 | shashlick | @yardanico: https://gist.github.com/genotrance/171c97ab2901f7da9fa0dbfb2999df4a |
23:44:36 | skrylar[m] | reminds me. have to redo the bmessage shit |
23:44:47 | skrylar[m] | right now it uses this morbidly inefficient message format |
23:48:38 | * | oddp quit (Ping timeout: 260 seconds) |
23:51:43 | FromDiscord | <Yardanico> redid this example with nimterop's wrapper https://media.discordapp.net/attachments/371759389889003532/732021401694765217/unknown.png |
23:51:53 | FromDiscord | <Yardanico> there was difference in how old wrapper and nimterop's define some stuff |
23:52:11 | FromDiscord | <Yardanico> @shashlick e.g. SciterWindowAttachEventHandler |
23:52:34 | FromDiscord | <Yardanico> the generated wrapper says "hwndLayout: ptr HWINDOW;", but it should be just "hwndLayout: HWINDOW", as in the headers themselves |
23:52:56 | FromDiscord | <Yardanico> in the headers it's SCDOM_RESULT SCFN( SciterWindowAttachEventHandler)( HWINDOW hwndLayout, LPELEMENT_EVENT_PROC pep, LPVOID tag, UINT subscription ); |
23:55:39 | shashlick | Hmm, need to see what the preprocessed output is and where that ptr came from |
23:55:44 | shashlick | More work for later |
23:55:48 | shashlick | Will check tonight |
23:56:07 | FromDiscord | <Yardanico> yeah, thanks again for your work 🙂 |
23:56:34 | shashlick | Is a good exercise to refine nimterop |
23:56:46 | shashlick | Always some bug or the other |
23:57:00 | shashlick | Can you pls open an issue on that |
23:57:10 | FromDiscord | <Yardanico> on what exactly? on the ptr thing? |