00:12:47 | * | zolk3ri joined #nim |
00:40:09 | * | leorize quit (Ping timeout: 265 seconds) |
00:42:08 | * | zolk3ri_ joined #nim |
00:43:11 | * | leorize joined #nim |
00:46:03 | * | Zevv_ joined #nim |
00:46:07 | * | nuxdie_ joined #nim |
00:46:26 | * | floppydh_ joined #nim |
00:46:31 | * | jxy_ joined #nim |
00:48:21 | * | shodan45_ joined #nim |
00:49:18 | * | pigmej_ joined #nim |
00:49:45 | * | kunev_ joined #nim |
00:49:53 | * | byte512_ joined #nim |
00:50:00 | * | beatmox_ joined #nim |
00:51:11 | * | kunev- joined #nim |
00:51:14 | * | floppydh quit (*.net *.split) |
00:51:14 | * | zolk3ri quit (*.net *.split) |
00:51:14 | * | beatmox quit (*.net *.split) |
00:51:14 | * | byte512 quit (*.net *.split) |
00:51:14 | * | kunev quit (*.net *.split) |
00:51:15 | * | jxy quit (*.net *.split) |
00:51:15 | * | nuxdie quit (*.net *.split) |
00:51:15 | * | Amun_Ra quit (*.net *.split) |
00:51:15 | * | Zevv quit (*.net *.split) |
00:51:16 | * | shodan45 quit (*.net *.split) |
00:51:16 | * | pigmej quit (*.net *.split) |
00:51:16 | * | beatmox_ is now known as beatmox |
00:51:19 | * | pigmej_ is now known as pigmej |
00:51:35 | * | martinium joined #nim |
00:51:51 | FromGitter | <gogolxdong> Is there anyone working on browser? |
00:52:21 | martinium | glad to see that nim is part of the official fedora repos |
00:52:45 | FromGitter | <gogolxdong> yes, it's a good news. |
00:53:58 | * | craigger quit (Ping timeout: 240 seconds) |
00:54:04 | * | zolk3ri_ quit (Remote host closed the connection) |
00:55:03 | * | kunev_ quit (Ping timeout: 255 seconds) |
00:56:24 | * | craigger joined #nim |
00:58:37 | * | Amun_Ra joined #nim |
01:10:09 | * | martinium quit (Ping timeout: 260 seconds) |
01:10:11 | * | S1t1Schu joined #nim |
01:12:02 | * | martinium joined #nim |
01:14:10 | * | S1tiSchu quit (Ping timeout: 264 seconds) |
01:16:57 | * | martinium quit (Ping timeout: 240 seconds) |
01:19:20 | * | martinium joined #nim |
01:48:32 | * | martinium quit (Quit: WeeChat 2.0.1) |
01:51:05 | * | yglukhov joined #nim |
01:55:27 | * | yglukhov quit (Ping timeout: 240 seconds) |
02:08:46 | * | endragor joined #nim |
02:13:48 | * | endragor quit (Ping timeout: 276 seconds) |
02:14:54 | * | vlad1777d quit (Ping timeout: 260 seconds) |
03:14:55 | * | smt` joined #nim |
03:18:41 | * | smt quit (Ping timeout: 265 seconds) |
03:22:37 | * | dddddd quit (Remote host closed the connection) |
03:29:35 | FromGitter | <Varriount> Araq: What was the motivation behind disallowing "invalid" escape sequences in strings, and making generalized string literals use raw behavior? |
03:30:35 | FromGitter | <Varriount> Rather than, say, allowing invalid escape sequences (ignoring them) and not using raw behavior with generalized string literals? |
03:35:28 | FromGitter | <Varriount> Or allowing a pragma for use with the functions to mark whether escaping should be done. |
03:41:31 | * | rockcavera quit (Read error: Connection reset by peer) |
03:42:55 | * | rockcavera joined #nim |
04:11:53 | * | endragor joined #nim |
04:19:28 | * | Lord_Nightmare quit (Ping timeout: 240 seconds) |
04:26:42 | * | Lord_Nightmare joined #nim |
04:51:49 | * | leorize quit (Ping timeout: 260 seconds) |
05:13:26 | * | smt` quit (Read error: Connection reset by peer) |
05:13:36 | * | smt` joined #nim |
05:15:49 | * | yglukhov joined #nim |
05:20:29 | * | yglukhov quit (Ping timeout: 265 seconds) |
05:24:11 | * | nsf joined #nim |
05:36:48 | * | Vladar joined #nim |
05:54:30 | * | Zevv_ is now known as Zevv |
06:00:17 | * | arecaceae joined #nim |
06:13:19 | * | leorize joined #nim |
06:22:09 | Araq | varriount: re"\d+" requires escapes to not be interpreted. |
06:22:27 | Araq | ignoring invalid escape sequences? why? |
06:39:44 | * | jaco60 joined #nim |
06:50:38 | * | r3d9u11 joined #nim |
06:51:51 | FromGitter | <Varriount> Araq: I guess I'm just a bit irritated that the "fmt" function in the strfmt module doesn't just re-escape things. |
06:55:00 | * | yglukhov joined #nim |
07:00:42 | * | rokups joined #nim |
07:06:57 | Araq | yeah, I'm not gonna reply to this |
07:09:43 | Araq | &"{foo}\n" is the better syntax ;-) |
07:15:08 | FromGitter | <alehander42> @Araq @dom96 what do you think about https://github.com/nim-lang/Nim/issues/7505 |
07:17:46 | Araq | IMO JS is too different from our usual posix/windows splits we have for the native code |
07:18:01 | Araq | times.nim with its 'when defined(js)' makes me cringe |
07:18:27 | Araq | instead we should have JS specific overrides for the stdlib modules we end up emulating |
07:18:36 | FromGitter | <alehander42> well that's why I had an alternative idea, to just have them in a `node_system` module or something like that (and eventually autoinclude it with `jsffi` for node) |
07:18:59 | Araq | this can easily be done by playing with the default --path |
07:19:50 | Araq | I don't see the connection to system.nim though |
07:20:00 | Araq | are you talking about sysio? |
07:20:06 | FromGitter | <alehander42> ok, I mean more like "system-level stuff" |
07:20:09 | FromGitter | <alehander42> not like `system.nim` |
07:20:15 | FromGitter | <alehander42> I couldn't find a good word for it |
07:21:24 | FromGitter | <alehander42> so, you mean when one imports `ospaths` in nodejs, we will actually load a `node/ospaths.nim` ? |
07:23:32 | Araq | yes |
07:23:55 | FromGitter | <alehander42> yeah, that makes sense |
07:24:26 | FromGitter | <alehander42> and what about the `async` versions, is it ok to also include them in the same node override modules |
07:29:53 | Araq | well they are not node-specific |
07:31:44 | FromGitter | <alehander42> hm do we have anything else than `asyncfile` ? what I imagined was more like `async readFile()` `async createDir()` etc |
07:39:20 | Araq | yeah asyncfile is underdeveloped |
07:39:27 | * | r3d9u11 quit (Ping timeout: 240 seconds) |
07:46:07 | FromGitter | <nathandaly> > Nim does not allow silently throwing away a return value a discard must be used, however I found this works? let _ = execCmd... |
07:54:24 | FromGitter | <mratsim> you can tag a proc {.discardable.} |
07:55:20 | FromGitter | <nathandaly> The docs said it doesn't allow silently throwing away return vars but it didn't throw an error when I did? |
07:56:23 | FromGitter | <mratsim> `_` is special and meant for throw away return values, expecially for tuple deconstruction |
07:56:56 | FromGitter | <nathandaly> Ah that explains it then thanks :) |
07:57:33 | FromGitter | <mratsim> like let (x, _, _) = foo(bar) |
08:03:12 | * | sendell joined #nim |
08:03:51 | * | athenot quit (Ping timeout: 265 seconds) |
08:04:34 | * | gmpreussner quit (Ping timeout: 264 seconds) |
08:05:34 | * | gmpreussner joined #nim |
08:11:00 | * | planetis[m] quit (Ping timeout: 248 seconds) |
08:11:46 | * | zama quit (Ping timeout: 264 seconds) |
08:12:12 | * | Tanger quit (Ping timeout: 256 seconds) |
08:12:22 | * | riidom_ quit (Ping timeout: 264 seconds) |
08:12:22 | * | Sentreen quit (Ping timeout: 264 seconds) |
08:12:22 | * | kier quit (Ping timeout: 264 seconds) |
08:12:22 | * | joshbaptiste quit (Ping timeout: 264 seconds) |
08:13:50 | * | zama joined #nim |
08:13:55 | * | Sentreen joined #nim |
08:13:56 | FromGitter | <narimiran> hey @mratsim, last night there was some talk about calling python script from nim, and then using the results in nim - have you maybe had similar experience? is there some idiomatic/easy way to do that? |
08:14:00 | * | riidom joined #nim |
08:14:34 | * | vegax87_ quit (Quit: EliteBNC - http://www.elitebnc.net/) |
08:15:12 | * | vegax87 joined #nim |
08:15:51 | FromGitter | <mratsim> mmmh, there are calling Nim from Python for sure, calling Python from Nim maybe asks @alehander42 : https://github.com/metacraft-labs/py2nim |
08:16:15 | * | kier joined #nim |
08:16:30 | * | Tanger joined #nim |
08:20:23 | * | zama quit (Ping timeout: 276 seconds) |
08:21:15 | * | zama joined #nim |
08:21:27 | * | Lord_Nightmare quit (Ping timeout: 240 seconds) |
08:22:17 | * | planetis[m] joined #nim |
08:22:42 | * | xet7 joined #nim |
08:25:21 | * | joshbaptiste joined #nim |
08:25:49 | * | pydsigner quit (Ping timeout: 256 seconds) |
08:26:30 | * | Lord_Nightmare joined #nim |
08:26:52 | * | solitudesf quit (Ping timeout: 245 seconds) |
08:26:52 | * | byteflame quit (Ping timeout: 245 seconds) |
08:26:53 | * | dyce[m] quit (Ping timeout: 245 seconds) |
08:26:58 | * | survivorm[m] quit (Ping timeout: 260 seconds) |
08:26:58 | * | TheManiac quit (Ping timeout: 260 seconds) |
08:26:58 | * | mgdelacroix[m] quit (Ping timeout: 260 seconds) |
08:26:59 | * | unclechu quit (Ping timeout: 260 seconds) |
08:28:05 | FromGitter | <narimiran> yeah, there is a video on youtube about calling nim from python (FFI) |
08:29:30 | FromGitter | <narimiran> i had an idea to rewrite some python code in nim, and when i need to use `scipy.integrate` (to solve some ODE), to call python to do that work, and then return back to nim.... |
08:31:05 | FromGitter | <alehander42> actually I think that was one of the ideas of @yglukhov https://github.com/yglukhov/nimpy |
08:31:19 | * | TheManiac joined #nim |
08:31:29 | * | survivorm[m] joined #nim |
08:31:29 | * | solitudesf joined #nim |
08:31:54 | * | byteflame joined #nim |
08:31:55 | * | mgdelacroix[m] joined #nim |
08:32:06 | * | pydsigner joined #nim |
08:32:23 | FromGitter | <alehander42> but you have to ask him if the calling python from nim is working |
08:32:23 | FromGitter | <alehander42> `py2nim` is more for porting python code to Nim, not calling the Python interpreter |
08:32:41 | FromGitter | <alehander42> so in this case you wouldn't be able to call scipy (except if your port it :D ) |
08:33:21 | Araq | parseJson(execProcess"python stuff.py") |
08:35:10 | * | Sentreen quit (Ping timeout: 264 seconds) |
08:36:22 | * | unclechu joined #nim |
08:36:32 | * | dyce[m] joined #nim |
08:37:25 | FromGitter | <narimiran> @alehander42 nimpy looks interesting! |
08:37:34 | * | edcragg quit (Ping timeout: 264 seconds) |
08:39:33 | FromGitter | <narimiran> @Araq yesterday i have tried to use `execCmdEx`, but `execProcess` might be better for my needs, thanks |
08:39:58 | * | Tanger quit (Ping timeout: 264 seconds) |
08:41:45 | * | edcragg joined #nim |
08:42:26 | FromGitter | <narimiran> what i want from python is numpy.array - yesterday i have printed element by element of that np.array, then manually parsed the received string in nim (`outp.strip.splitLines.map(parseFloat)`) |
08:43:05 | FromGitter | <narimiran> JSON might be a nicer way to do it.... |
08:48:26 | * | Sentreen joined #nim |
08:58:31 | FromGitter | <alehander42> why don't we have default `$` for `ref objects`? |
08:58:49 | FromGitter | <alehander42> it seems easy to do in the general case (with `..` for recursion) |
08:59:13 | Araq | the $ for objects was already a mistake |
08:59:28 | FromGitter | <alehander42> I can't imagine why |
09:00:05 | FromGitter | <alehander42> if a type needs special `$`, the author will define it, otherwise having *something* is better than nothing |
09:00:49 | Araq | that's not true, people write hashit($x) to make things compile and then it doesn't work |
09:01:56 | FromGitter | <alehander42> well "people do that wrong thing in that particular edge case" doesn't mean "not useful it for all other legit cases" |
09:02:28 | Araq | when do you use the $ for objects? for debugging. |
09:02:35 | FromGitter | <alehander42> exactly |
09:02:51 | Araq | only for debugging, for all other use cases its in a Nim specific format and hardly useful |
09:03:04 | FromGitter | <alehander42> well, it's incredibely useful for debugging |
09:03:17 | FromGitter | <alehander42> and development (which is where you spend 90% of the time anyway) |
09:03:47 | Araq | sure but we should have a 'debug' macro then... |
09:03:58 | Araq | well we have something in future.nim like that |
09:04:20 | FromGitter | <alehander42> does it return a string ? |
09:04:53 | FromGitter | <alehander42> well I am just a bit afraid of having several similar mechanisms , as `__str__` and `__repr__` in Python (I was never sure which representation would I get sometimes) |
09:05:44 | Araq | well I'm not gonna change it |
09:06:50 | FromGitter | <alehander42> hm I see only debugEcho |
09:06:58 | Araq | to answer your question |
09:07:04 | Araq | use $refobj[] |
09:07:33 | FromGitter | <alehander42> yeah I know that, but it's tedious |
09:08:19 | FromGitter | <alehander42> and e.g. new users will have no idea that works, and will just write loads of `$` or printing manually fields all the time which will outweight the eventual bugs because of `$` I think |
09:08:30 | FromGitter | <alehander42> loads of custom `$` * |
09:08:40 | FromGitter | <alehander42> but that's speculation of course :D |
09:09:10 | FromGitter | <alehander42> (again, I can have my own `ref $` easily, just wanted to discuss it for the stdlib) |
09:13:10 | FromGitter | <alehander42> I admit that actually having some custom general `dumpObj(obj, depth)` which works for recursive objects might be a good compromise |
09:42:07 | * | Tanger joined #nim |
09:48:35 | FromGitter | <mratsim> @narimiran for Numpy interfacing try pymod: https://github.com/jboy/nim-pymod. Project is dead but it probably still compiles |
09:49:19 | FromGitter | <mratsim> it references the Nimborg project for calling python from Nim |
09:53:59 | * | leorize quit (Ping timeout: 260 seconds) |
09:55:52 | FromGitter | <narimiran> @mratsim very nice, thanks! |
09:57:30 | * | dddddd joined #nim |
10:10:54 | * | kaliy quit (Changing host) |
10:10:54 | * | kaliy joined #nim |
10:13:50 | FromGitter | <dom96> FWIW I like that I can use the times module in the C and JS backend with no code changes. |
10:14:07 | FromGitter | <dom96> We shouldn't be pursuing the worse alternative |
10:14:31 | FromGitter | <dom96> Especially when WASM is right around the corner. |
10:14:38 | FromGitter | <alehander42> afaik it would be similar with my node support for other modules, just the code wouldn't be in `when defined(nodejs)` but in different equivalent modules |
10:14:57 | FromGitter | <alehander42> you'll still use the same `import os` etc in your code |
10:17:31 | Araq | yeah, that's the idea. |
10:22:12 | FromGitter | <dom96> Alright. But then I can't help but cringe at using Nim with node, whyyyy? |
10:22:22 | FromGitter | <alehander42> electron |
10:22:55 | FromGitter | <alehander42> please, no "why electron" .. :D |
10:23:34 | Yardanico | well, it's easier to develop with electron, but it has a *slightly* heavier RAM usage ;) |
10:26:04 | FromGitter | <alehander42> I can't wait for the light alternative with the same support for browser + most dekstop platforms |
10:26:27 | FromGitter | <dom96> What does electron provide that libcef + some browser-side JS doesn't? |
10:30:23 | FromGitter | <alehander42> honestly, I haven't heard of libcef before, I just read a bit about it |
10:30:37 | Yardanico | I think electron would be fine if you'll be able to run multiple apps using 1 electron (browser) instance |
10:30:43 | FromGitter | <alehander42> but I can ask the same, what benefit does libcef provide ? |
10:30:55 | Yardanico | compare 10 tabs in a browser and 10 different electron apps :( |
10:31:59 | FromGitter | <alehander42> e.g. why nobody uses libcef compared to electron |
10:32:30 | FromGitter | <dom96> Because people are scared of anything that isn't JS |
10:32:45 | FromGitter | <dom96> I'm pretty sure electron is built on libcef. |
10:33:23 | FromGitter | <dom96> I was hoping you could tell me what electron brings to the table :( |
10:33:26 | Araq | I tried libcef once and couldn't figure it out |
10:33:27 | FromGitter | <alehander42> @Yardanico I agree, but I guess most electron apps can depend on different electron versions |
10:33:56 | Araq | or maybe something else, but these APIs to browser functionality are a waste of time |
10:34:00 | FromGitter | <alehander42> well I guess that's the whole point, why should I lose time in getting familiar with libcef if I can just use electron |
10:34:20 | FromGitter | <alehander42> and still it's a browser in a dekstop app, so it's not as I'll be winning a lot in efficiency |
10:34:55 | FromGitter | <dom96> Presumably because you won't have to implement half of Nim's stdlib for node. |
10:35:29 | FromGitter | <alehander42> meh, more like 20-30 functions which I assembled incrementally (which are usually 1-2 line translations) |
10:35:58 | Araq | yeah, the problem is |
10:36:13 | Yardanico | If only Nim had a GUI framework which doesn't depend on wx or qt :) There's NiGui but it's not in active development and doesn't have a lot of features :( |
10:36:15 | FromGitter | <dom96> You'd probably get some efficiency gains through. |
10:36:18 | Araq | ever since we got .importccp for JS wrapping JS is superb :P |
10:36:20 | FromGitter | <dom96> *through it |
10:36:47 | Araq | Yardanico, there is also my ui.nim |
10:37:05 | Yardanico | https://github.com/nim-lang/ui ? |
10:37:09 | Araq | yeah |
10:37:18 | FromGitter | <alehander42> I agree, it's quite easy to interact with js stuff these days with nim :D |
10:37:20 | FromGitter | <dom96> AFAIK Spotify and steam both use libcef. |
10:37:36 | Yardanico | yeah, Steam uses libcef |
10:38:03 | FromGitter | <dom96> You should definitely look into it if you haven't. I'm really curious whether electron is still a better route to take. |
10:38:16 | * | kobi7 joined #nim |
10:38:26 | kobi7 | Hello |
10:38:35 | Yardanico | FYI: https://github.com/jangko/nimCEF |
10:39:14 | Yardanico | kobi7, hi! |
10:39:47 | kobi7 | let's say i have two libraries, version 1 and version 2, and I want to reuse some functions from ver 1. Is there a way to import and "re-export", instead of copy pasting? |
10:39:53 | FromGitter | <alehander42> also, most of my performance issues currently relate to harder (for me) to optimize problem domain features which can be order of magnitude heavier than electron, so it's just not such a priority |
10:39:55 | kobi7 | Hi Yardanico, how are you doing? |
10:41:03 | Yardanico | kobi7, yes, you can "import oldlib" and "export oldlib", or, if you want to export specific procs (but AFAIK it doesn't work good with generics): "export oldlib.myproc" |
10:41:49 | Yardanico | kobi7, https://nim-lang.org/docs/manual.html#modules-export-statement |
10:42:00 | Yardanico | oh sorry, wrong link |
10:42:19 | FromGitter | <alehander42> if I can dream I'd love to even have desktop optimized UI-s falling back to os-specific toolkits for example, but that just requires a lot more manpower |
10:42:28 | FromGitter | <alehander42> but thanks, I'll take a look at libcef when I can |
10:42:28 | Yardanico | ah, it's a right link, nvm |
10:49:21 | kobi7 | Ah, cool. |
10:50:14 | dom96 | alehander42: I think in the long run we should be aiming to create our own electron |
10:50:36 | dom96 | We've got a libcef wrapper (which actually looks like it's pretty well maintained :D) |
10:51:03 | dom96 | Electron seems to be little more than a node.js wrapper over libcef |
10:51:22 | dom96 | With support for native menus and notifications, crash reporting and windows installers. |
10:54:42 | dom96 | My prediction: If we don't do this, then Rust will and Rust will use its WASM ability to run the in-browser code very efficiently. |
10:54:56 | dom96 | It's a possible killer app |
10:55:08 | Araq | my prediction: what Rust does is independent from our actions. |
10:55:24 | Yardanico | but it depends on our community size :) |
10:55:27 | * | kobi7 quit (Quit: Leaving) |
10:55:36 | dom96 | Okay, let me rephrase my predicition: Rust will do this |
10:55:40 | dom96 | *prediction |
10:55:54 | Araq | so what, it's an obvious thing to do given their resources |
10:56:36 | dom96 | It won't be Rust core developers doing it |
10:57:11 | dom96 | It will be somebody who loves Rust, which is why I think we should be encouraging developers who are already using electron (!) to do the same for Nim |
10:57:18 | Araq | I'll simply ask PMunch when he is around |
10:57:39 | dom96 | You'll ask him what? |
10:58:09 | Araq | what he thinks works best |
10:58:30 | Araq | he wrote a DSL for describing UIs that sits on top of a couple of different UI libraries |
10:58:45 | dom96 | He hasn't used libcef and electron has he? |
10:58:59 | Araq | I don't know :-) |
10:59:03 | dom96 | This isn't about what UI is better |
10:59:12 | dom96 | libcef/Electron already won |
11:00:32 | FromGitter | <alehander42> @dom96 that certainly sounds as a very cool idea |
11:01:05 | dom96 | Glad you think so :) |
11:01:23 | dom96 | The electron API doesn't look to be that large: https://electronjs.org/docs |
11:01:35 | dom96 | And I bet you only use a small subset |
11:01:45 | dom96 | Translating that to Nim should be trivial ;) |
11:02:01 | Araq | ok, sorry, I misunderstand your points |
11:02:13 | FromGitter | <alehander42> hahaha, well that's a whole another thing |
11:02:18 | * | vlad1777d joined #nim |
11:02:39 | FromGitter | <alehander42> I'd love to play with those ideas in my free time, but don't count on me :D |
11:02:50 | Araq | so your point is, "the people who are sold on electron should improve it for Nim's purposes" |
11:03:27 | dom96 | sure. I don't want to pick on alehander42 too much though :) |
11:03:55 | FromGitter | <alehander42> I already have a bunch of nim-ecosystem stuff in my backlog :D |
11:04:05 | dom96 | If I had a project that worked best on top of electron I would certainly be trying to do this though. |
11:05:39 | dom96 | But for now I guess this is another idea to go into my todo list :) |
11:07:19 | FromGitter | <alehander42> it's now in my side project todo list to experiment with that too |
11:07:33 | FromGitter | <alehander42> just my side project list is very unpredictable :D |
11:08:59 | FromGitter | <zacharycarter> wellll |
11:09:00 | dom96 | Do you have any builds of your electron project that you can share yet? |
11:09:04 | FromGitter | <zacharycarter> someone is already working on a wasm target |
11:09:06 | FromGitter | <zacharycarter> for Nim |
11:09:06 | FromGitter | <alehander42> but I'll take a look at libcef tomorrow, intiguing |
11:09:09 | dom96 | I'm curious to see how complex the UI is |
11:10:19 | FromGitter | <zacharycarter> https://github.com/stisa/nwasm |
11:10:21 | FromGitter | <alehander42> @dom96 not anything for share yet, sorry |
11:11:06 | dom96 | I've been wanting to create a better IRC client since I started programming |
11:11:07 | FromGitter | <alehander42> the UI itself is not very complex, but it's not something I'd want to rewrite completely soon(it has an almost useful panel docking system etc which was PITA to get right) |
11:11:15 | dom96 | Maybe it's time I give libcef a crack |
11:12:51 | dom96 | zacharycarter: oooooh |
11:13:15 | dom96 | now that is awesome |
11:13:19 | dom96 | I love our community :D |
11:13:25 | FromGitter | <alehander42> yeah, @stisa works on nwasm, I found it last week and I was very happy about it :D |
11:14:31 | Yardanico | nice - https://sourceforge.net/p/codeblocks/tickets/657/ |
11:14:58 | FromGitter | <dom96> @stisa great job so far :D |
11:16:02 | dom96 | Yardanico: How are you finding these? :) |
11:16:11 | Yardanico | dom96, https://github.com/nim-lang/Nim/wiki/Editor-Support/_compare/2c4a857%5E...2c4a857 |
11:16:28 | dom96 | ahhh |
11:16:46 | dom96 | Another idea I had was to write a good syntax highlighting test file |
11:17:07 | dom96 | so that we can ask every syntax highlighter to highlight this file correctly |
11:17:19 | dom96 | Too many ideas too little time D: |
11:17:34 | Yardanico | dom96, great idea, nim syntax is not that complicated so file wouldn't probably be very big |
11:18:10 | FromGitter | <zacharycarter> yay! talking to the CEO of that gamedev company today! :D |
11:18:16 | FromGitter | <zacharycarter> over the phone anyway |
11:18:36 | FromGitter | <zacharycarter> err maybe not today - but at some point in the near future - I guess I passed my initial phone screening |
11:19:27 | * | xkapastel quit (Quit: Connection closed for inactivity) |
11:20:54 | * | leorize joined #nim |
11:21:28 | FromGitter | <alehander42> `cmp` works on tuples, nice |
11:22:09 | FromGitter | <zacharycarter> @alehander42 you work at status too? |
11:22:41 | FromGitter | <zacharycarter> with @mratsim ? |
11:36:22 | * | vlad1777d quit (Ping timeout: 264 seconds) |
12:15:02 | yglukhov | Araq, dom96: can you please explain this code to me? https://github.com/nim-lang/Nim/blob/devel/lib/pure/asyncmacro.nim#L326-L329 |
12:15:43 | yglukhov | What case does it cover? |
12:18:13 | dom96 | hrm, that's a weird one |
12:19:30 | yglukhov | I'm playing with auto-futurisation of return type. Dunno if I should consider this case... |
12:20:24 | dom96 | https://github.com/nim-lang/Nim/commit/7c012cb79748184b66a3cf04fefbd5f89ecbdcd0 |
12:20:27 | dom96 | It was introduce here |
12:20:44 | dom96 | The issue doesn't explain it |
12:21:09 | dom96 | nnkCallKinds suggests it's `[]`(Future, string) |
12:21:24 | dom96 | Is that really a way to write Future[string]? |
12:22:11 | dom96 | also, auto-futurisation of return type? |
12:23:02 | FromGitter | <alehander42> I did auto-futurize my first js async implementation returns, but I admit it's kinda too magical |
12:23:11 | yglukhov | yes, so that you don't spell out Future[T] on async proc definition. Just T. |
12:23:59 | yglukhov | alehander42: async itself is a lot more magical than that =) |
12:24:20 | FromGitter | <alehander42> yeah, but still it's counterintuitive: your return type is actually lying to you |
12:24:30 | FromGitter | <alehander42> I know what you mean, I also wanted this feature :D |
12:24:50 | dom96 | yeah, if your intention is to make a PR for this I'm afraid I won't accept |
12:24:59 | FromGitter | <alehander42> also, there is this theoretical "what if you have `Future[Future[T]]` thing ( I admit not very practical) |
12:27:37 | yglukhov | yeah, but {.async.} pragma already hints about the return value. so its just redundant typing, no? |
12:29:33 | Yardanico | yglukhov, I already asked dom96 about this, but he disagreed :( |
12:29:39 | Yardanico | (about implicit Future return type) |
12:29:47 | yglukhov | alehander42. that one is easy. return type is auto futurezed only if it is not Future[T] already |
12:32:17 | dom96 | My logic is that the return type should tell the truth, I don't want to guess what the async macro is doing |
12:33:26 | dom96 | I'm also pretty sure that all other languages do it this way. |
12:34:35 | FromDiscord | <--HA--> Hello. What would be a good way to compile different code depending on target os? Can I use the when statement to do a different import and define a different proc for windows or linux? |
12:34:52 | Yardanico | yes, you can |
12:35:06 | Yardanico | https://github.com/nim-lang/Nim/wiki/Consts-defined-by-the-compiler |
12:36:36 | FromDiscord | <--HA--> the --os:windows switch that one can pass to the compiler is that what I can check with when defined(Windows)? |
12:36:54 | Yardanico | yes |
12:37:07 | FromGitter | <ChristianWitts> that wiki page could do with an update, platform.nim instead of plataform.nim, and linking to extccomp.nim from devel and not an almost 3 y.o. commit |
12:37:16 | Yardanico | well, you can edit it :) |
12:37:30 | Yardanico | nim wiki on github can be edited by any github user |
12:37:37 | FromGitter | <ChristianWitts> Oh, surprisingly open to the world |
12:37:47 | FromDiscord | <--HA--> awesome, thanks |
12:37:49 | Yardanico | (that's the default on github btw) |
12:38:01 | yglukhov | dom96, fair enough, but don't you think that using an async proc requires some knowledge already? like what's a future, what to do with it, etc? besides, void type is auto-futurized already, so it's just inconsistent. |
12:38:30 | Yardanico | oh, I'm sorry, it's not a github default |
12:39:02 | dom96 | yglukhov: Yes, you need to know about futures, which is why I prefer that they are in "your face" so to speak |
12:39:10 | FromGitter | <ChristianWitts> thankfully it’s not a github default, otherwise I’m sure spammer would abuse it. |
12:39:20 | FromGitter | <ChristianWitts> I updated the wiki page :) |
12:39:24 | dom96 | It's not inconsistent. In Nim, the void type is implicit, it's the same for the async macro. |
12:39:40 | Yardanico | ChristianWitts: cool, thanks! |
12:40:02 | yglukhov | dom96: you can't call void async proc without discarding/awaiting it. hence inconsistency. |
12:40:37 | yglukhov | you're looking at the {.async.} proc thinking that it returns nothing, but that's a lie =). |
12:41:33 | Araq | btw .async should forbid the .discardable annoation |
12:41:34 | FromGitter | <alehander42> maybe we should just make them `{.discardable.}`, good point! :D |
12:42:18 | FromGitter | <alehander42> but indeed, it would be easy to call async function without awaiting it |
12:42:42 | euantor | I really wouldn't want the `{.async.}` macro to convert return type to `Future[T]` - I like having to specify that it returns a future |
12:43:02 | euantor | I don't mind about `async void` though |
12:44:11 | FromGitter | <mratsim> @ChristianWitts see also my last post on the forum: https://forum.nim-lang.org/t/3723 |
12:44:15 | yglukhov | euantor: haha, but that just sounds like you're just used to it =). |
12:44:22 | dom96 | Araq: true |
12:44:51 | yglukhov | ok, so how come Future[void] is implicit, but Future[T] is not? |
12:44:55 | euantor | yglukhov: Yes, and I'm used to it from C# too (having to write `Task<T>`) |
12:45:42 | dom96 | Araq: Either that, or we need a way to automatically set a callback on non-awaited futures. |
12:46:19 | * | noonien joined #nim |
12:47:17 | yglukhov | I honestly don't see the point in spelling out smth explicitly when it cannot be otherwise. I mean what's the point (for me) to write Future[T] {.async.}, when Future[T] is the only possible option? That's just not dry =) |
12:48:07 | dom96 | You have to repeat the word 'proc' a lot too :P |
12:48:33 | Araq | I don't mind either way, but I too was confused at first :P |
12:49:18 | Araq | problem is when you transform ': string' to ': Future[string]' then explicit 'Future[string]' would become 'Future[Future[string]]' |
12:49:19 | * | smt_ joined #nim |
12:49:32 | Araq | and that's really bad. |
12:49:46 | Araq | so I think dom96 made the right choice here. |
12:50:10 | dom96 | I'll be honest, I'm pretty sure I just copied C# here :) |
12:50:29 | dom96 | For the implicit 'void' I just followed Nim's lead, I think that makes sense. |
12:50:49 | FromGitter | <alehander42> if we were perl |
12:50:58 | FromGitter | <alehander42> we would just define ~T == Future[T] |
12:51:09 | FromGitter | <alehander42> and add one more amazing symbol |
12:51:22 | yglukhov | Araq: that one is easy. return type is auto futurezed only if it is not Future[T] already |
12:51:41 | Araq | yglukhov, but then it's inconsistent :P |
12:51:56 | FromGitter | <alehander42> but that's very confusing, so T == Future[T], Future[T] == Future[T], Future[T] != Future[Future[T]] |
12:52:19 | Araq | not that I mind inconsistencies too much... |
12:53:02 | Araq | alehander42: yeah, *shrug*, I wouldn't mind it. |
12:53:09 | Araq | but currently it's simpler. |
12:53:22 | * | smt` quit (Ping timeout: 265 seconds) |
12:53:34 | FromGitter | <alehander42> I was kidding, but I really think adding some kind of shortcut for your project ( ~T %T or F[T]) would be simpler and more consistent |
12:53:55 | Araq | I do think though that we should have an .autoasync |
12:54:20 | Araq | that annotates calls starting with write/read/whatever with 'await' automatically |
12:54:38 | Araq | needs some naming scheme for the dangerous "blocking" calls |
12:54:53 | Araq | but then it would feel like a high-level DSL to me. |
12:55:23 | dom96 | Not every call to an async proc requires 'await' |
12:55:37 | dom96 | The programmer should choose consciously, so this isn't worthwhile IMO |
12:56:29 | Araq | yeah you're probably right. on the other hand, I cannot even issue HTTPs requests concurrently easily. |
12:57:04 | Araq | so the harder stuff is hard already and can be done with the existing .async |
12:57:33 | Araq | but most of the time I 'await' a proc that produces a future. |
12:58:18 | yglukhov | I'm thinking of async procs not in terms of return type. Obviously, calling async proc from sync proc will give you a future, but once you're in async world, return value is not a future, and you can't call it synchronously. That's at least how i keep it in mind. Because of that I often forget to enclose return type in Future[], so it's just annoying. Also its a bit inconvenient to transform sync/async/sync procs in the code. |
12:58:51 | dom96 | Araq: Actually there is a heuristic that could be used to determine 'await' vs. 'asyncCheck' |
12:59:09 | Araq | I do mind the 'awaits' more than the Future[T] return types |
12:59:27 | dom96 | the code semantics could turn out surprising though |
12:59:35 | yglukhov | Araq: do you mean you want to get rid of those? |
12:59:51 | * | athenot joined #nim |
12:59:53 | Araq | it introduces a great amount of friction :P |
13:00:11 | Araq | the whole world is divided into these blocking vs non-blocking calls |
13:00:29 | Araq | when it's not relevant to the program logic. |
13:00:37 | dom96 | maybe it's time to scrap this whole thing and adopt Go's approach? :P |
13:00:51 | yglukhov | hmm... yeah, it sounds like go... |
13:01:19 | Araq | well I prefer threading. |
13:01:28 | FromGitter | <alehander42> uh I think autoinferring `await` is impossible |
13:01:50 | Araq | it's not a secret that I think threading plus locks is the best model :P |
13:02:38 | yglukhov | dom96: have I at least made you hesitate about auto futurization? ;) |
13:02:45 | FromGitter | <alehander42> btw if you use an overloaded funcction that returns Future |
13:02:52 | FromGitter | <alehander42> and one overload is truely async |
13:02:57 | FromGitter | <alehander42> and the other one returns immediately |
13:03:09 | dom96 | yglukhov: sure, you certainly made me think about it |
13:03:16 | Araq | you can rule out deadlocks via the .locks annotation and data races with .guard annotations. |
13:03:18 | FromGitter | <alehander42> would the second one return immediately even if I `await` it |
13:03:54 | dom96 | We'll (hopefully) have 'await' support for FlowVar and channels soon |
13:04:02 | FromGitter | <alehander42> this way I can `await <x>` with sync and async impl-s in the same time |
13:04:09 | dom96 | then we'll need a way to transfer FDs between threads |
13:04:26 | dom96 | and things should be good |
13:04:42 | Araq | .async is more efficient than threading |
13:04:46 | yglukhov | alehander42: think about it like "implicit discard of future" inserts an await, and makes this proc return future =) |
13:04:55 | Araq | but that doesn't mean I have to like it. I don't. |
13:05:06 | dom96 | alehander42: I think it is possible |
13:05:28 | dom96 | Not sure if it's possible with macros |
13:05:37 | dom96 | but with the amount of knowledge the compiler has, certainly |
13:05:46 | dom96 | You can just look for how each returned future is used |
13:05:54 | dom96 | If it's not used then you don't await it |
13:06:09 | dom96 | (by "used" I mean `read`) |
13:06:42 | dom96 | Araq: Hrm, is it more efficient? |
13:06:50 | FromGitter | <alehander42> what I mean is, can the compiler detect that an async function actually doesn't call anything `async` inside, and directly make it `sync` on the callsite |
13:07:02 | Araq | something is seriously wrong. I run this code on millions of lines of code called the OS and yet I should be reminded about whether some calls can "block" my program. I don't care if they can. memory reads can block my program, it's called a cache miss, it's expensive but I don't have to write 'await myarray[i]' everywhere because of that. |
13:07:24 | dom96 | As much as I love async await, I often wonder whether Goroutines are a better approach |
13:08:00 | Araq | better is not a good word. it's easier to use in a couple of aspects. |
13:08:10 | Araq | it's worse in other aspects. |
13:08:23 | dom96 | Araq: That's a good point. I think Microsoft did an experiment to write an async OS |
13:08:36 | dom96 | And I suppose it made IO calls which blocked transparent |
13:08:42 | dom96 | in the same way that memory access is transparent |
13:08:58 | FromGitter | <alehander42> well it's all about treshholds |
13:09:20 | FromGitter | <alehander42> the things that you think can be slow enough to be "blocking" can be awaited |
13:09:52 | dom96 | yeah, there isn't enough time in a cache miss to warrant doing other work |
13:10:08 | Araq | there is, it's called hyperthreading. |
13:11:55 | FromGitter | <dandevelo> Can one have two procs with same name but different return types in Nim? |
13:12:21 | Yardanico | AFAIK you can't for now |
13:12:26 | Yardanico | there's no return type overloading (yet) |
13:13:09 | Araq | and if we're after a simple concurrency model, I wouldn't pick Go's channels but locks. But I'm probably nuts on this one. |
13:14:01 | dom96 | Yardanico: I don't think it's "yet" :) |
13:14:20 | dom96 | Araq: I guess you're after a "simple and safe" model |
13:14:36 | dom96 | although, hrm, Go's channels are safe too I suppose |
13:14:40 | dom96 | Why locks then? |
13:15:29 | Araq | because they are simpler, ymmv. |
13:16:01 | Araq | they got a bad reputation because of deadlocks and data races but both problems can be solved. |
13:16:18 | dom96 | yeah... I think solving those problems makes them complicated :) |
13:16:39 | Araq | they don't. |
13:16:39 | FromGitter | <narimiran> @dandevelo i have just tried it and i get `ambiguous call` |
13:16:54 | Araq | I take deadlocks over live-locks. |
13:17:18 | Araq | or weird transactional semantics with nested rollback behaviours :P |
13:17:26 | FromGitter | <dandevelo> Thanks @Yardanico & @narimiran . Indeed, it looks like it is not supported |
13:17:30 | dom96 | I would personally prefer channels |
13:17:59 | dom96 | but if Nim gets GC'd shared memory protected by locks then I'll happily use it |
13:18:44 | Araq | that's the thing. you cannot even build a realistic shared GC on top of message passing. |
13:19:00 | Araq | ok, the Pony people claimed success. |
13:19:40 | dom96 | yep |
13:21:15 | Araq | well I like locks, deal with it. I also prefer polling over event notifications |
13:21:37 | dom96 | That's simply inefficient though |
13:22:05 | Araq | I'm talking about convenient concurrency models. |
13:22:49 | Araq | efficiency is not my point. |
13:23:00 | dom96 | isn't concurrency what async is? |
13:23:06 | Araq | yes. |
13:23:11 | dom96 | you mean parallel models |
13:23:41 | Araq | well I'm fuzzy enough to mean both aspects. |
13:24:25 | dom96 | There does seem to be demand for semaphores and things for concurrency too |
13:25:34 | dom96 | well, I was arguing with someone about async await in #crystal-lang yesterday |
13:26:16 | Araq | so this is how you spend your time :P |
13:26:20 | dom96 | and they really preferred Crystal's approach |
13:26:31 | dom96 | only sometimes :P |
13:26:33 | Araq | what a wonder |
13:26:51 | dom96 | It's interesting to hear other people's perspectives |
13:31:19 | livcd | dom96: what time ? |
13:33:07 | dom96 | Pretty much exactly 24 hours ago |
13:33:32 | * | smt_ quit (Read error: Connection reset by peer) |
13:34:17 | * | smt joined #nim |
13:55:34 | FromGitter | <nathandaly> Really liking nim |
13:56:17 | * | leorize quit (Quit: WeeChat 2.1) |
13:58:17 | * | athenot quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
14:00:29 | dom96 | nathandaly: :D |
14:01:33 | FromGitter | <dandevelo> Given this code: https://www.paste.org/92350 on line 7: should that be "object of T1" or "object of T1Impl" ? |
14:02:07 | Yardanico | dandevelo: do you really need Impl types? |
14:02:25 | Yardanico | You can directly create T1 as an `ref object of RootObj` |
14:02:28 | dom96 | yeah |
14:05:13 | FromGitter | <dandevelo> @Yardanico I got this habit when manually allocating memory and working with ptr instead of ref |
14:09:10 | dom96 | You're better off either using 'ref' or not using it |
14:09:14 | dom96 | so don't define both |
14:11:21 | * | miran joined #nim |
14:16:17 | * | leorize joined #nim |
14:25:06 | FromGitter | <krux02> I just implemented in macros module `symKind` on the `NimNode` instead of `NimSym`, but I gave it the same magic as that function and it kind of already worked. |
14:25:15 | FromGitter | <krux02> no change in the nimVM required |
14:25:48 | FromGitter | <krux02> it kind of works, because when I call symSym on anything that is not a nimSym, then it fails |
14:26:05 | * | athenot_ joined #nim |
14:28:23 | * | athenot_ quit (Read error: Connection reset by peer) |
14:29:12 | * | endragor quit (Remote host closed the connection) |
14:30:54 | * | athenot_ joined #nim |
14:32:48 | * | endragor joined #nim |
14:32:56 | * | SenasOzys quit (Ping timeout: 265 seconds) |
14:35:48 | Araq | cool |
14:35:57 | FromGitter | <alehander42> @dom96 I tried to tl;dr my final thoughts about libcef-based library in https://github.com/nim-lang/Nim/issues/7505#issuecomment-378949200 |
14:37:16 | FromGitter | <krux02> Araq: hmm I kind of need a kind on what error should be reported, when I call symKind or getImpl on a nimNode that is not a symbol |
14:37:34 | * | endragor quit (Ping timeout: 268 seconds) |
14:37:34 | FromGitter | <krux02> second kind shold have been hint |
14:38:00 | FromGitter | <alehander42> it just doesn't seem worth it for me if it doesn't include some more radical UI-stuff (maybe something like xray, where one can move a lot of the UI logic itself in native Nim which just renders/accepts input using the browser?) |
14:38:25 | FromGitter | <krux02> currently it is this: Error: field 'symbol' cannot be found |
14:38:35 | * | SenasOzys joined #nim |
14:38:50 | FromGitter | <krux02> but field symbol doesn't really exist anymore, so I would prefer an error that people can actually understand |
14:44:48 | * | endragor joined #nim |
14:49:22 | * | endragor quit (Ping timeout: 265 seconds) |
14:51:57 | * | athenot_ quit (Ping timeout: 260 seconds) |
14:57:57 | FromGitter | <mratsim> “Error this is not a NimSym, couldn’t find a ‘symbol’ field”? |
15:03:08 | dom96 | "This is not a NimSym" seems sufficient |
15:03:16 | dom96 | or "Expected NimSym, got ..." |
15:07:42 | FromGitter | <gogolxdong> Are you arguing what the async mechainsm is going to be in the next version? |
15:09:18 | * | athenot joined #nim |
15:10:13 | * | leorize quit (Quit: WeeChat 2.1) |
15:10:20 | FromGitter | <krux02> dom96: I am removing/deprecating the NimSym type, because it is much more useful to use the `NimNode` directly |
15:10:55 | FromGitter | <krux02> so saynig `this is not a NimSym is kind of confusing if at some point that type really is removed |
15:11:26 | dom96 | Right, so presumably only certain Nim node kinds have a 'symbol', right? |
15:11:45 | dom96 | "This Nim node kind does not have an associated symbol" |
15:11:46 | FromGitter | <krux02> yes |
15:11:48 | FromGitter | <krux02> only one |
15:12:04 | dom96 | okay then mention it |
15:12:06 | FromGitter | <krux02> again you are talking about symbol |
15:12:17 | FromGitter | <krux02> talking about symbol is confusing |
15:13:39 | dom96 | What is the node kind that has it? |
15:15:44 | * | craigger quit (Quit: bye) |
15:17:55 | * | craigger joined #nim |
15:18:19 | FromGitter | <sivakon> Is there a good example on how to use c2nim? Any help would be appreciated. |
15:18:48 | Yardanico | I actually have a gist which may help |
15:19:14 | Yardanico | https://gist.github.com/zacharycarter/846869eb3423e20af04dea226b65c18f |
15:19:33 | Yardanico | it's made by @zacharycarter |
15:19:42 | FromGitter | <cabhishek> @sivakon also, take a look at https://github.com/genotrance/nimgen |
15:20:04 | Yardanico | yeah, nimgen is very good |
15:20:20 | FromGitter | <cabhishek> @Yardanico I didn't know about the gist. Thanks :) |
15:20:48 | FromGitter | <sivakon> Great. Thanks. I am trying to wrap Open AI Gym for Nim. |
15:23:04 | dom96 | oooh, that's a nice guide |
15:23:42 | dom96 | The chapter on the FFI of my book is freely available too: https://manning-content.s3.amazonaws.com/download/5/08b3cf8-cea3-42c1-97b5-b5047c472b73/SampleCh08.pdf |
15:23:44 | Yardanico | dom96, sadly it's not completed :) |
15:25:00 | dom96 | and there is this too https://nim-lang.org/docs/c2nim.html |
15:25:36 | FromGitter | <sivakon> Great. Can I use it to wrap C++ headers too? |
15:26:19 | * | Trustable joined #nim |
15:26:57 | dom96 | yeah |
15:26:58 | Yardanico | yes |
15:27:29 | Yardanico | but c2nim can't translate any C/C++ headers |
15:27:35 | Yardanico | sometimes you'll need to make changes manually |
15:28:16 | FromGitter | <sivakon> @dom96, @Yardanico Sure. Thanks a ton. |
15:29:07 | FromGitter | <alehander42> what is the diff between |
15:29:15 | FromGitter | <alehander42> Option and GlobalOption ? |
15:29:33 | * | smt quit (Read error: Connection reset by peer) |
15:29:40 | FromGitter | <alehander42> it seems we already have 32 GlobalOption-s , so I don't have a choice I guess |
15:29:54 | Yardanico | wait, what is a GlobalOption? |
15:30:00 | FromGitter | <alehander42> the nim compiler options |
15:30:10 | Yardanico | hmm, I don't really know :P |
15:44:54 | * | nsf quit (Quit: WeeChat 2.0.1) |
15:46:04 | * | aguspiza joined #nim |
16:01:25 | shashlick | @sivakon: openAI gym looks like it is written in Python - where are the C/C++ headers? |
16:04:17 | FromGitter | <krux02> dom96: sorry for the late reply, "What is the node kind that has it?" the node kind is nnkSym. |
16:04:51 | dom96 | So the error message should be simple: "Expected nnkSym, got ..." |
16:06:02 | FromGitter | <krux02> yea, I will do that. |
16:06:26 | FromGitter | <krux02> doesn't look as nice as I hoped it would. but yea it will do |
16:09:03 | * | Jesin joined #nim |
16:10:19 | shashlick | who manages the FromGitter bot? will be cool if it can show gitter gists like how it does when you connect to the gitter irc bridge (as plain text) |
16:10:33 | Yardanico | shashlick, oprypin does |
16:10:44 | * | yhb joined #nim |
16:14:14 | FromGitter | <alehander42> ah when you wonder why it's not working and you haven't even linked the resource |
16:14:18 | FromGitter | <alehander42> i am stupid |
16:16:43 | * | yhb quit (Quit: Page closed) |
16:16:54 | FromGitter | <krux02> well i decided for "node is not a symbol", I hope that is a precise error message |
16:17:13 | FromGitter | <krux02> that also won't confuse anybody |
16:18:03 | dom96 | shashlick: how could it do that? it would be far too long on IRC |
16:24:52 | * | xkapastel joined #nim |
16:24:53 | shashlick | dom96: it just shows up as multiple messages - let me show you a screenshot of how it looks |
16:24:59 | * | Jesin quit (Quit: Leaving) |
16:25:55 | Yardanico | shashlick, it will still be very annoying |
16:27:13 | miran | agreed - too long and annoying for irc |
16:32:31 | * | sendell quit (Remote host closed the connection) |
16:32:36 | * | Jesin joined #nim |
16:37:53 | FromGitter | <alehander42> I have nim js source maps working locally |
16:38:50 | FromGitter | <alehander42> An initial PR (I still need to add tests) https://github.com/nim-lang/Nim/pull/7508 |
16:46:17 | * | athenot quit (Ping timeout: 260 seconds) |
16:46:25 | dom96 | seems you've got zah's changes mixed up in there |
16:46:51 | * | athenot joined #nim |
16:47:21 | shashlick | https://imgur.com/a/C3ykq |
16:47:33 | shashlick | Yardanico: I picked your last post :) |
16:48:22 | Yardanico | shashlick, this is on Gitter |
16:48:54 | shashlick | ya, so it shows up that way when you connect to gitter via their irc bridge - irc.gitter.com |
16:49:23 | shashlick | considering gitter shows those gists inline, it would be nice to see it the same way on irc as well, since so many people use gitter |
16:49:36 | shashlick | it would get logged also inline by the nim bot |
16:49:38 | dom96 | Gitter's IRC must not have any message rate limiting then |
16:49:52 | dom96 | FreeNode will kill a client if it sends messages too fast |
16:49:59 | dom96 | so this isn't practical |
16:50:31 | miran | shashlick: what's wrong with the current situation where you get a link, you click on it, and see the code in gitter? |
16:52:34 | shashlick | then you might as well use gitter :D |
16:52:58 | FromGitter | <narimiran> i might do that indeed :D |
16:57:53 | dom96 | hrm, this gave me the thought to try a multi-im client. Found this: https://meetfranz.com/ |
16:57:57 | dom96 | You guys know of any others? |
16:58:26 | miran | i have tried franz on my linux machine, but wasn't very satisfied |
16:58:33 | dom96 | How come? |
16:58:50 | dom96 | I'd try it but it doesn't seem to support IRC |
16:59:41 | miran | there was a post about one very lightweight (~100 KB) multi-im. it said coming soon for linux so i hadn't tried it, and i forgot its name :) |
17:00:18 | Yardanico | miran, :( |
17:00:56 | shashlick | dom96: looks like 1 sec per line is a safe throttle rate - there's no explicit rate I could find for freenode |
17:01:19 | miran | it was some guy working on it, closed source at the moment, and he said he will open source it later |
17:01:24 | shashlick | but that could break up a message if someone else posts in the middle |
17:02:03 | dom96 | shashlick: yes, far too slow |
17:02:15 | shashlick | am checking on #freenode if they can make any exceptions for legitimate bots |
17:02:22 | dom96 | There is a reason you'll get banned from any IRC channel if you refuse to pastebin your code and instead paste it into IRC directly |
17:05:43 | * | shodan45_ quit (Remote host closed the connection) |
17:06:04 | * | shodan45 joined #nim |
17:07:08 | shashlick | sounds fair but guess more will move to gitter - smart of them to inline their gists and not post them as separate links. the links to their gists in irc take you straight to the chat room |
17:08:14 | * | onionhammer1 joined #nim |
17:08:24 | FromDiscord | <treeform> I managed to get basic source maps working in JavaScript: |
17:08:25 | FromDiscord | <treeform> |
17:08:25 | FromDiscord | <treeform> https://cdn.discordapp.com/attachments/371759389889003532/431500368569171978/unknown.png |
17:09:05 | * | byte512_ quit (Ping timeout: 240 seconds) |
17:09:07 | * | shmup left #nim (#nim) |
17:09:43 | dom96 | treeform: is your approach separate from alehander42's? |
17:09:53 | FromDiscord | <treeform> I don't know what alehander42's is. |
17:10:11 | shashlick | at least I can do something about the FromGitter / FromIRC annoyance - weechat can rewrite them to look seamless, becoming quite fun to use weechat with all it's capabilities |
17:10:12 | * | onionhammer quit (Ping timeout: 255 seconds) |
17:10:14 | * | shodan45 quit (Remote host closed the connection) |
17:10:32 | FromDiscord | <treeform> dom96, what was their approach? |
17:10:48 | dom96 | treeform: I'm not sure, he just made a PR for it: https://github.com/nim-lang/Nim/pull/7508 |
17:10:57 | dom96 | (which seems to have mixed up some other commits) |
17:11:37 | FromDiscord | <treeform> I am just reading the generated JS file and looking for things that look like `F.line =` and `var F={` and generating source maps off that. Not part of nim compiler. |
17:11:53 | dom96 | ooh |
17:12:39 | shashlick | FYI - from #freenode - burst of 4 messages and then 1 per 2s is a safe target in case anyone needs to know |
17:12:43 | * | shodan45 joined #nim |
17:12:47 | dom96 | Will you make it available as a Nimble package or something? |
17:13:15 | FromDiscord | <treeform> dom96, `F.line =`s are very buggy, so that is the main thing that needs fixing. |
17:16:13 | FromGitter | <alehander42> @treeform @dom96 I just use the hot reloading branch in my project, that's why it's based on it |
17:16:18 | FromGitter | <alehander42> you can just look at the last commit |
17:16:38 | FromGitter | <alehander42> (I can rebase, I honestly thought the reloading is already merged :P ) |
17:16:56 | FromGitter | <alehander42> I do something similar, but I use `// line` |
17:17:03 | FromGitter | <alehander42> I fixed some of the wrong |
17:17:12 | FromGitter | <alehander42> `genLineDir` and added some more |
17:17:33 | * | byte512 joined #nim |
17:17:36 | FromGitter | <alehander42> and I am sure my approach is correct when `genLineDir` is used correctly |
17:18:03 | FromGitter | <alehander42> (it's simpler than `F.line = ..` and it implies just `lineDir`) |
17:18:26 | miran | dom96: i'm trying to make a PR and apparently i'm 27 commits ahead of devel!? (i have made one commit) |
17:18:45 | FromGitter | <alehander42> @treeform do you generate the source maps using the `source-map` js lib? |
17:18:57 | FromGitter | <alehander42> I did that initially , but then I ported the gen part of it to nim |
17:19:07 | FromGitter | <alehander42> so now the compiler can do it directly |
17:19:35 | miran | i guess it is an error on my side, but i have seen another PR with some old commits from others.... |
17:19:56 | dom96 | miran: it's a fairly common mistake :) |
17:20:04 | FromDiscord | <treeform> alehander42, do you --lineDir:on and look at `// line` ? |
17:20:10 | dom96 | no idea what the cause might be though |
17:20:16 | FromGitter | <alehander42> I believe that this approach is almost optimal, maybe we can hook creation of SourceNode-s directly to genLineDir and then make generation of code aware of the last line, but that's way more complicated |
17:20:17 | FromDiscord | <treeform> I looked into that but it seemed to be the same info as `F.line =` |
17:20:54 | FromDiscord | <treeform> alehander42, I ported the parts of source-map js I need to nim. |
17:21:04 | FromGitter | <alehander42> @treeform yes, I enable `lineDir` when I pass `sourceMap` to the compiler |
17:21:17 | FromGitter | <alehander42> it is, but I improved genLineDir somewhat |
17:21:26 | FromGitter | <alehander42> and the jsgen line dir generation |
17:21:33 | FromDiscord | <treeform> alehander42, https://gist.github.com/treeform/c95e4073a6f5942d8192a4d425cb885f |
17:21:35 | FromGitter | <alehander42> also, I use now soft newlines when lineDir is on |
17:22:05 | miran | dom96: any advice on what should i do? |
17:22:23 | FromGitter | <alehander42> so I can generate exactly one js line for one Nim line if I need to (which might be not necessary) |
17:22:51 | FromGitter | <alehander42> @treeform me too, my code looks very similarly |
17:22:56 | FromGitter | <alehander42> if you take a look at the PR |
17:22:58 | * | byte512 quit (Ping timeout: 240 seconds) |
17:23:03 | FromGitter | <alehander42> :D |
17:23:34 | dom96 | miran: where is your PR? |
17:23:45 | dom96 | or rather I guess branch |
17:24:06 | miran | i didn't publish it because of all that old unwanted commits coming with it |
17:24:29 | dom96 | so link me your branch |
17:24:42 | * | byte512 joined #nim |
17:24:54 | dom96 | also, if you could recount the steps you took that might help diagnose how you arrived at this problem |
17:25:05 | miran | https://github.com/narimiran/Nim/tree/fix-replace |
17:25:54 | FromDiscord | <treeform> alehander42, your patch seems to focus a ton on hot code reloading |
17:26:06 | miran | i guess i had a "dirty" local `devel` |
17:26:42 | FromDiscord | <treeform> alehander42, my next step was to see if I can make the line generation better... but it looks like you already done some stuff. |
17:26:57 | FromDiscord | <treeform> alehander42, also what are your thoughts on name mangling? |
17:27:01 | dom96 | miran: strange |
17:27:54 | dom96 | miran: I would just start over from a fresh `devel` |
17:28:09 | dom96 | before making your changes, make sure it's up to date |
17:28:28 | miran | ok, i'm rusty with git, how do i do that (start over fresh) |
17:29:09 | dom96 | git checkout devel |
17:29:14 | dom96 | git pull |
17:29:29 | dom96 | git status # double check it all looks good |
17:29:37 | dom96 | then you should be able to make your changes |
17:29:58 | dom96 | before committing make a new branch: git checkout -b replace-fixes |
17:32:02 | FromDiscord | <treeform> alehander42, i think your encode is much better: https://github.com/nim-lang/Nim/pull/7508/files#diff-ff63391d52657b492565ac93bf5c83d0R91 I ported mine from the js lib and its was very confusing. |
17:33:35 | miran | dom96: thanks, it works, PR coming any minute now :) |
17:33:36 | FromGitter | <alehander42> treeform |
17:34:01 | FromGitter | <alehander42> Well name mangling doesn't seem to matter for source maps |
17:34:39 | FromGitter | <alehander42> Or maybe it does |
17:34:54 | FromGitter | <alehander42> And that's what I am missing in my name field |
17:35:26 | FromDiscord | <treeform> yeah I still don't fully understand how the name in source mapping supposed to work |
17:35:39 | FromDiscord | <treeform> I just want to fix this problem: |
17:35:41 | FromDiscord | <treeform> |
17:35:41 | FromDiscord | <treeform> https://cdn.discordapp.com/attachments/371759389889003532/431507230731403264/unknown.png |
17:36:20 | FromGitter | <alehander42> What is the problem |
17:36:27 | dom96 | the fact that it knows that 'i' is a variable :o |
17:36:59 | FromGitter | <alehander42> The stack trace? |
17:37:05 | FromDiscord | <treeform> alehander42, `i` is actually `i_27019` |
17:37:23 | FromGitter | <alehander42> Aaag |
17:37:59 | FromDiscord | <treeform> I wish nim would only mangle names when there is a conflict, 99% of the time there is no conflict, and it should just use clean names... |
17:38:06 | FromDiscord | <treeform> I don't know how to do that. |
17:38:37 | FromGitter | <alehander42> You're trying to watch the variable |
17:38:38 | FromGitter | <alehander42> e |
17:38:41 | FromGitter | <alehander42> ?* |
17:38:54 | FromDiscord | <treeform> yeah watch or hover over it |
17:39:02 | FromDiscord | <treeform> also type `i` in console |
17:39:18 | FromDiscord | <treeform> i wish nim would just output `i` not `i_27019` |
17:39:53 | FromDiscord | <treeform> well thats kind of different from source maps, but related. |
17:41:39 | FromDiscord | <treeform> Also I feel like the fianl version, should be source maps were generated in genLineDir (add Mapping) then compiler should just write both files, rather then parse the source looking for `// line`? |
17:41:49 | FromDiscord | <treeform> alehander42, thoughts? |
17:42:37 | FromGitter | <alehander42> I think I know how to fix it |
17:43:58 | FromDiscord | <treeform> alehander42, you sort the mappings, do they need to be sorted? https://github.com/nim-lang/Nim/pull/7508/files#diff-ff63391d52657b492565ac93bf5c83d0R219 |
17:44:04 | FromGitter | <alehander42> But I am not completely sure it will always work |
17:44:07 | FromDiscord | <treeform> I could not find an answer tot his |
17:44:11 | FromGitter | <alehander42> For function names |
17:44:31 | FromDiscord | <treeform> Yeah name mangling is a hard problem. |
17:47:28 | FromGitter | <alehander42> No wait ofc it will work |
17:47:44 | FromGitter | <alehander42> Ok, I can add that later tonight |
17:48:44 | FromGitter | <alehander42> Or we can also combine efforts @treeform you were first |
17:49:22 | FromGitter | <alehander42> We can try |
17:49:54 | FromGitter | <alehander42> To combine our impls if something is missing |
17:52:34 | FromDiscord | <treeform> alehander42, yeah I am taking your encode functions and putting it into my code. |
17:52:42 | FromDiscord | <treeform> your encode function is great |
17:53:07 | FromDiscord | <treeform> I don't get what some of your code does, SourceNode and walk? |
18:01:48 | FromDiscord | <treeform> slightly cleaned up source map generator: https://gist.github.com/treeform/3ac009556892b100779c6ed38882429b |
18:13:30 | FromGitter | <alehander42> It just collects source nodes recursively |
18:13:59 | FromGitter | <alehander42> No, I think I know how to handle me mangling correctly |
18:14:11 | FromDiscord | <treeform> How? |
18:18:12 | FromGitter | <alehander42> I can collect all the name manglings in jsgen |
18:18:23 | FromGitter | <alehander42> And then replace |
18:18:37 | FromGitter | <alehander42> Their sub source nodes |
18:21:08 | FromGitter | <alehander42> With source node with their mangling names |
18:21:28 | FromGitter | <alehander42> I am not totally sure that's correct |
18:21:38 | FromGitter | <alehander42> I'll try it when I am in home |
18:22:54 | FromDiscord | <treeform> I see. I don't think its a blocker for this PR. You should try to get this PR in as is. Then worry about name mangling later. |
18:27:16 | FromDiscord | <treeform> what there is another hot code reloading patch? https://github.com/nim-lang/Nim/pull/7362 |
18:32:21 | * | nsf joined #nim |
18:40:42 | FromGitter | <alehander42> Did you also so hot reloading hahaha |
18:40:46 | FromGitter | <alehander42> Oh man |
18:40:59 | FromGitter | <alehander42> Why not pushing upstream |
18:44:08 | * | Jesin quit (Quit: Leaving) |
18:47:27 | * | arnetheduck_ quit (Remote host closed the connection) |
19:18:47 | * | Vladar quit (Quit: Leaving) |
19:19:33 | * | SenasOzys quit (Ping timeout: 264 seconds) |
19:26:35 | * | SenasOzys joined #nim |
19:30:58 | miran | nim site is down? |
19:32:06 | Yardanico | miran, not for me |
19:32:12 | Yardanico | workinf perfectly fine |
19:33:24 | miran | Yardanico: it's back on for me, and docs look different than before (changed font) :/ |
19:35:11 | dom96 | unless somebody is hacking our servers there shouldn't have been any changes to fonts :) |
19:36:43 | miran | it's back to the default. strange. |
19:37:01 | miran | i kinda like the "new" font :D |
19:39:06 | * | noonien quit (Quit: Connection closed for inactivity) |
19:45:16 | FromGitter | <zacharycarter> folks were mentioning libcef earlier |
19:45:28 | FromGitter | <zacharycarter> also found - https://github.com/zserge/webview | https://github.com/oskca/webview - today |
19:47:49 | dom96 | I recall somebody mentioning here that they have a beefy server they could let me borrow, for benchmarking purposes |
19:48:01 | dom96 | Was shashlick? |
19:48:03 | dom96 | *Was it |
19:48:15 | dom96 | zacharycarter: I met the guy that created that library at FOSDEM :) |
19:48:34 | FromGitter | <zacharycarter> ah cool! |
19:48:53 | dom96 | https://github.com/zserge/webview/pull/111#issuecomment-367368223 |
19:49:22 | dom96 | I guess I should ping them |
19:58:51 | * | Widdershins quit (Ping timeout: 268 seconds) |
20:01:58 | * | Widdershins joined #nim |
20:02:33 | shashlick | dom96: yep - I can run stuff on it if required |
20:04:55 | dom96 | shashlick: PM |
20:07:17 | * | yglukhov quit (Remote host closed the connection) |
20:07:24 | * | Trustable quit (Remote host closed the connection) |
20:07:36 | * | yglukhov joined #nim |
20:07:51 | * | yglukhov quit (Remote host closed the connection) |
20:08:07 | * | yglukhov joined #nim |
20:12:32 | * | smt joined #nim |
20:12:57 | * | rokups quit (Quit: Connection closed for inactivity) |
20:16:24 | * | smt quit (Client Quit) |
20:23:39 | * | yglukhov quit (Remote host closed the connection) |
20:24:09 | * | rockcavera quit (Remote host closed the connection) |
20:24:15 | * | yglukhov joined #nim |
20:28:27 | * | yglukhov quit (Ping timeout: 240 seconds) |
20:33:54 | * | smt joined #nim |
21:00:44 | FromDiscord | <--HA--> I'm still struggling with the windows api. I want to call SetFileTime. To get a HANDLE of a file for that it looks like I need to call CreateFile. That expects a LPCWSTR as the file name. Which is a "ptr uint16" and at that point I'm stuck. How can I get a LPCWSTR from a string (a nim string)? |
21:02:14 | FromDiscord | <--HA--> I can't believe all this is necessary to change a file modification time, am I missing something perhaps? |
21:05:12 | * | nsf quit (Quit: WeeChat 2.0.1) |
21:05:33 | dom96 | It seems our stdlib is missing this, perhaps you can use this as a reference? https://github.com/nim-lang/Nim/blob/master/lib/pure/os.nim#L181 |
21:06:27 | FromDiscord | <--HA--> I'll check that out, thanks |
21:06:32 | dom96 | yeah, seems you should just use findFirstFile |
21:06:51 | dom96 | feel free to make a PR for a setLastModificationTime function |
21:08:02 | * | jaco60 quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
21:08:57 | FromDiscord | <--HA--> It would be nice to have that in the os module perhaps, like getLastModificationTime a set version of that. At lesat for someone like me who doesn't know anything about win api it would be helpful |
21:09:42 | dom96 | yep, which is why it'd be great if you could create a PR to add it :) |
21:11:27 | * | miran quit (Quit: Konversation terminated!) |
21:11:37 | dom96 | if you need any help, let me know |
21:12:51 | FromDiscord | <--HA--> oh findFirstFile is helpful to see, all of that code in os.nim really. I'll give it a try and let you know how far I get |
21:15:28 | dom96 | great :) |
21:21:09 | FromGitter | <krux02> yay tests for my PR run through |
21:21:18 | FromGitter | <krux02> don't merge yet though. |
21:22:11 | FromGitter | <krux02> dom96: what do you think about it: https://github.com/nim-lang/Nim/pull/7491 |
21:23:42 | FromGitter | <data-man> https://www.experts-exchange.com/questions/10054777/Fast-Get-File-Modification-Time.html |
21:28:41 | * | rockcavera joined #nim |
21:31:53 | dom96 | krux02: reviewed it, looks good |
21:34:12 | * | tiocavera joined #nim |
21:34:12 | * | rockcavera is now known as Guest3210 |
21:34:12 | * | tiocavera is now known as rockcavera |
21:37:18 | * | Guest3210 quit (Ping timeout: 276 seconds) |
21:44:16 | * | xkapastel quit (Quit: Connection closed for inactivity) |
21:47:24 | * | vlad1777d joined #nim |
21:49:34 | FromGitter | <krux02> dom96: what deprecation template? |
21:49:46 | FromGitter | <krux02> the replacement procs have the exact same name |
21:49:57 | FromGitter | <krux02> should I write that in the comment? |
21:50:34 | dom96 | yes |
21:50:41 | dom96 | You need the version in there too |
21:50:58 | dom96 | **Deprecated since v0.18.2:** use symName instead |
22:02:25 | * | xkapastel joined #nim |
22:13:14 | FromGitter | <zacharycarter> @gokr small talk got mentioned a few times in our developers slack channel at work today :P |
22:14:57 | * | yglukhov joined #nim |
22:18:22 | * | cyberlis joined #nim |
22:18:54 | FromDiscord | <treeform> alehander42, I did not submit any PRs related to the Javascript stuff, i was working on source maps but you beat me to it. Some one else beat you to the hot code reloading stuff. |
22:19:29 | * | yglukhov quit (Ping timeout: 260 seconds) |
22:19:32 | FromGitter | <alehander42> no no, my branch was just based on the hot reloading stuff , because I use it in the same project |
22:20:08 | FromGitter | <alehander42> it's not mine, it's @zah 's |
22:20:21 | FromDiscord | <treeform> oh I see. |
22:21:49 | FromGitter | <Varriount> @zacharycarter I almost have all the aws v4 signing code written. |
22:22:24 | FromGitter | <Varriount> The only thing left is tying the individual parts together, then testing the output |
22:22:33 | FromGitter | <zacharycarter> :D |
22:23:00 | FromGitter | <zacharycarter> awesome! |
22:23:34 | FromGitter | <zacharycarter> I'm working on some playground improvements / modifications right now |
22:24:48 | FromGitter | <Varriount> @zacharycarter Could your playground be adapted to other languages? |
22:27:19 | dom96 | Varriount: Why would you perform such blasphemy? |
22:28:47 | FromGitter | <zacharycarter> @Varriount sure - I stole the concept from Rust anyway |
22:29:17 | FromGitter | <Varriount> I need to sandbox python |
22:29:29 | FromGitter | <alehander42> @treeform btw do your sourcemaps work well in firefox? I am working mostly with devtools |
22:30:19 | FromGitter | <zacharycarter> @Varriount jupyter notebook :P |
22:31:06 | FromGitter | <zacharycarter> @Varriount - do you guys use kubernetes at work? |
22:31:06 | FromGitter | <alehander42> it seems if I step through `yield` in firefox debugger, it hangs somehow, but it seems to work in chrome |
22:31:09 | dom96 | Varriount: https://repl.it/ |
22:33:34 | FromGitter | <Varriount> dom96: I need it for work |
22:35:45 | FromGitter | <zacharycarter> https://github.com/NightDiveStudios/shockmac |
22:37:42 | * | xet7 quit (Remote host closed the connection) |
22:39:52 | dom96 | zacharycarter: I posted that in offtopic already ;) |
22:42:05 | FromGitter | <zacharycarter> oh whoops |
22:42:40 | FromGitter | <zacharycarter> can I get in offtopic on gitter? |
22:43:29 | * | vlad1777d quit (Remote host closed the connection) |
22:43:30 | FromGitter | <zacharycarter> I just need to get off gitter... |
22:43:34 | FromGitter | <zacharycarter> and find a decent IRC client for osx |
22:45:01 | * | vlad1777d joined #nim |
22:48:38 | dom96 | I'm using XChat Azure on OSX |
22:49:15 | dom96 | I think the Gitter channel is called "twitch" for some reason... |
22:59:10 | * | cyberlis quit (Quit: Leaving) |
23:14:54 | * | aguspiza quit (Ping timeout: 260 seconds) |
23:52:27 | * | vlad1777d quit (Ping timeout: 240 seconds) |
23:53:13 | FromGitter | <alehander42> ah when you've been checking the wrong seq for an element the while time |
23:54:20 | FromGitter | <alehander42> yes |
23:54:57 | FromGitter | <alehander42> https://imgur.com/a/MdleB |
23:55:23 | FromGitter | <alehander42> @treeform it seems name watch works for me now |
23:57:02 | FromDiscord | <treeform> nice! |
23:57:04 | FromDiscord | <treeform> how did you do this? |